feat: migrate DateField and shared date input group

This commit is contained in:
maoyingjie
2026-10-23 23:56:18 +08:00
parent 3c878d2582
commit 01f0776805
63 changed files with 3974 additions and 90 deletions
@@ -0,0 +1,25 @@
import { defineComponent, watch } from "vue";
import { injectDateFieldRootContext } from "reka-ui";
/** Reka does not watch equal primitive null values after a rejected edit.
* Clear its existing segment refs without replacing DOM, focus or IDs. */
export default defineComponent({
name: "EmptyDateBridge",
props: { revision: { type: Number, required: true } },
setup(props) {
const base = injectDateFieldRootContext();
watch(
() => props.revision,
() => {
base.segmentValues.value = Object.fromEntries(
Object.keys(base.segmentValues.value).map((part) => [
part,
part === "dayPeriod" ? "AM" : null,
]),
) as typeof base.segmentValues.value;
},
{ flush: "post" },
);
return () => null;
},
});