@lobehub/ui 6.0.3 → 6.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,13 +2,13 @@ import "@stylexjs/stylex";
2
2
  //#region src/Accordion/style.d.ts
3
3
  export declare const accordionStyles: {
4
4
  panel: string;
5
- header: string;
6
5
  action: string;
7
6
  content: string;
8
7
  trigger: string;
8
+ header: string;
9
+ item: string;
9
10
  root: string;
10
11
  indicator: string;
11
- item: string;
12
12
  itemOutlined: string;
13
13
  rootOutlined: string;
14
14
  actionAlwaysVisible: string;
@@ -42,7 +42,7 @@ declare const styleArrays: {
42
42
  }> | Readonly<{
43
43
  readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "transparent">;
44
44
  readonly cursor: stylex.StyleXClassNameFor<"cursor", "default">;
45
- readonly display: stylex.StyleXClassNameFor<"display", "none" | "flex">;
45
+ readonly display: stylex.StyleXClassNameFor<"display", "flex" | "none">;
46
46
  }>)[];
47
47
  item: Readonly<{
48
48
  readonly borderRadius: stylex.StyleXClassNameFor<"borderRadius", string>;
@@ -12,6 +12,7 @@ const createTanstackEngine = (initialValues) => {
12
12
  const serverErrors = /* @__PURE__ */ new Map();
13
13
  const validating = /* @__PURE__ */ new Set();
14
14
  const touched = /* @__PURE__ */ new Set();
15
+ const edited = /* @__PURE__ */ new Set();
15
16
  const listeners = /* @__PURE__ */ new Set();
16
17
  const valueListeners = /* @__PURE__ */ new Set();
17
18
  const snapshots = /* @__PURE__ */ new Map();
@@ -36,6 +37,10 @@ const createTanstackEngine = (initialValues) => {
36
37
  for (const entry of touched) if (isSameOrNested(entry, path)) return true;
37
38
  return false;
38
39
  };
40
+ const isEdited = (path) => {
41
+ for (const entry of edited) if (isSameOrNested(entry, path)) return true;
42
+ return false;
43
+ };
39
44
  const errorOf = (path) => serverErrors.get(path) ?? fieldErrors.get(path) ?? formErrors.get(path);
40
45
  const getField = (path) => {
41
46
  const next = {
@@ -70,7 +75,8 @@ const createTanstackEngine = (initialValues) => {
70
75
  if (mode === "change") return true;
71
76
  if (mode === "blur") return trigger === "blur";
72
77
  if (mode === "submit") return false;
73
- return trigger === "blur" || errorOf(path) !== void 0;
78
+ if (errorOf(path) !== void 0) return true;
79
+ return trigger === "blur" && (isEdited(path) || submitCount > 0);
74
80
  };
75
81
  const setOrDelete = (map, path, error) => {
76
82
  if (error === void 0) map.delete(path);
@@ -128,6 +134,7 @@ const createTanstackEngine = (initialValues) => {
128
134
  };
129
135
  const afterUserChange = (path) => {
130
136
  touched.add(path);
137
+ edited.add(path);
131
138
  serverErrors.delete(path);
132
139
  schedule(path, "change");
133
140
  for (const [other, runtime] of fields) if (other !== path && runtime.registration.deps?.includes(path) && isTouched(other)) runField(other, true);
@@ -160,6 +167,7 @@ const createTanstackEngine = (initialValues) => {
160
167
  serverErrors.clear();
161
168
  validating.clear();
162
169
  touched.clear();
170
+ edited.clear();
163
171
  };
164
172
  const runSubmit = async (onSubmit) => {
165
173
  submitCount += 1;
@@ -210,6 +218,7 @@ const createTanstackEngine = (initialValues) => {
210
218
  moveItem: (path, from, to) => {
211
219
  form.moveFieldValues(toEnginePath(path), from, to);
212
220
  touched.add(path);
221
+ edited.add(path);
213
222
  clearErrorsUnder(path);
214
223
  emitValueChange(path, "user");
215
224
  notify();
@@ -221,6 +230,7 @@ const createTanstackEngine = (initialValues) => {
221
230
  pushItem: (path, item) => {
222
231
  form.pushFieldValue(toEnginePath(path), item);
223
232
  touched.add(path);
233
+ edited.add(path);
224
234
  emitValueChange(path, "user");
225
235
  notify();
226
236
  },
@@ -243,6 +253,7 @@ const createTanstackEngine = (initialValues) => {
243
253
  removeItem: (path, index) => {
244
254
  form.removeFieldValue(toEnginePath(path), index);
245
255
  touched.add(path);
256
+ edited.add(path);
246
257
  clearErrorsUnder(path);
247
258
  emitValueChange(path, "user");
248
259
  notify();
@@ -256,6 +267,7 @@ const createTanstackEngine = (initialValues) => {
256
267
  validating.delete(key);
257
268
  }
258
269
  for (const entry of touched) if (isUnder(entry, path)) touched.delete(entry);
270
+ for (const entry of edited) if (isUnder(entry, path)) edited.delete(entry);
259
271
  clearErrorsUnder(path, true);
260
272
  form.setFieldValue(toEnginePath(path), getBy(baseline, toEnginePath(path)), { dontUpdateMeta: true });
261
273
  emitValueChange(path, "api");
@@ -1 +1 @@
1
- {"version":3,"file":"tanstack.mjs","names":[],"sources":["../../../src/FormKit/engine/tanstack.ts"],"sourcesContent":["import { FormApi, getBy, setBy } from '@tanstack/form-core';\nimport { isEqual } from 'es-toolkit/compat';\n\nimport type {\n ChangeSource,\n CreateEngine,\n FieldRegistration,\n FieldSnapshot,\n FormEngine,\n FormStatus,\n FormValidator,\n ValidateResult,\n ValidateTrigger,\n ValueChange,\n} from './types';\n\nconst toEnginePath = (path: string) => path.replaceAll(/\\.(\\d+)(?=\\.|$)/g, '[$1]');\n\nconst isSameOrNested = (a: string, b: string) =>\n a === b || a.startsWith(`${b}.`) || b.startsWith(`${a}.`);\n\nconst isUnder = (path: string, root: string) => path === root || path.startsWith(`${root}.`);\n\ninterface FieldRuntime {\n registration: FieldRegistration;\n timer?: ReturnType<typeof setTimeout>;\n token: number;\n}\n\nexport const createTanstackEngine: CreateEngine = (initialValues) => {\n const form = new FormApi({ defaultValues: initialValues });\n\n const fields = new Map<string, FieldRuntime>();\n const fieldErrors = new Map<string, string>();\n const formErrors = new Map<string, string>();\n const serverErrors = new Map<string, string>();\n const validating = new Set<string>();\n const touched = new Set<string>();\n const listeners = new Set<() => void>();\n const valueListeners = new Set<(change: ValueChange) => void>();\n const snapshots = new Map<string, FieldSnapshot>();\n\n let formValidator: FormValidator | undefined;\n let baseline = initialValues;\n let dirtyCache: { baseline: unknown; dirty: boolean; values: unknown } | undefined;\n let inflightSubmit: Promise<ValidateResult> | undefined;\n let submitting = false;\n let submitCount = 0;\n let status: FormStatus = { dirty: false, submitCount: 0, submitting: false };\n\n const notify = () => {\n for (const listener of listeners) listener();\n };\n const storeSubscription = form.store.subscribe(notify);\n\n const getValue = (path: string) => form.getFieldValue(toEnginePath(path) as never) as unknown;\n const getValues = () => form.state.values as Record<string, unknown>;\n const isTouched = (path: string) => {\n for (const entry of touched) if (isSameOrNested(entry, path)) return true;\n return false;\n };\n const errorOf = (path: string) =>\n serverErrors.get(path) ?? fieldErrors.get(path) ?? formErrors.get(path);\n\n const getField = (path: string): FieldSnapshot => {\n const next: FieldSnapshot = {\n error: errorOf(path),\n touched: isTouched(path),\n validating: validating.has(path),\n value: getValue(path),\n };\n const prev = snapshots.get(path);\n if (\n prev &&\n prev.error === next.error &&\n prev.touched === next.touched &&\n prev.validating === next.validating &&\n Object.is(prev.value, next.value)\n )\n return prev;\n snapshots.set(path, next);\n return next;\n };\n\n const getStatus = (): FormStatus => {\n const values = getValues();\n if (dirtyCache?.values !== values || dirtyCache.baseline !== baseline)\n dirtyCache = { baseline, dirty: !isEqual(values, baseline), values };\n const { dirty } = dirtyCache;\n if (\n status.dirty !== dirty ||\n status.submitting !== submitting ||\n status.submitCount !== submitCount\n )\n status = { dirty, submitCount, submitting };\n return status;\n };\n\n const shouldValidate = (path: string, trigger: ValidateTrigger) => {\n const mode = fields.get(path)?.registration.validateOn ?? 'auto';\n if (trigger === 'submit') return true;\n if (mode === 'change') return true;\n if (mode === 'blur') return trigger === 'blur';\n if (mode === 'submit') return false;\n return trigger === 'blur' || errorOf(path) !== undefined;\n };\n\n const setOrDelete = (map: Map<string, string>, path: string, error: string | undefined) => {\n if (error === undefined) map.delete(path);\n else map.set(path, error);\n };\n\n const runField = (path: string, withFormValidator: boolean): Promise<void> => {\n const runtime = fields.get(path);\n if (!runtime) return Promise.resolve();\n runtime.token += 1;\n const token = runtime.token;\n const { validate } = runtime.registration;\n if (!validate && !(withFormValidator && formValidator)) return Promise.resolve();\n\n validating.add(path);\n notify();\n return (async () => {\n const values = getValues();\n const [fieldError, formResult] = await Promise.all([\n validate?.(getValue(path), values),\n withFormValidator ? formValidator?.(values) : undefined,\n ]);\n if (runtime.token !== token || fields.get(path) !== runtime) return;\n setOrDelete(fieldErrors, path, fieldError);\n if (withFormValidator) setOrDelete(formErrors, path, formResult?.[path]);\n validating.delete(path);\n notify();\n })();\n };\n\n const schedule = (path: string, trigger: ValidateTrigger) => {\n const runtime = fields.get(path);\n if (!runtime || !shouldValidate(path, trigger)) return;\n clearTimeout(runtime.timer);\n const debounceMs = runtime.registration.debounceMs ?? 0;\n if (trigger === 'change' && debounceMs > 0) {\n runtime.token += 1;\n runtime.timer = setTimeout(() => void runField(path, true), debounceMs);\n return;\n }\n void runField(path, true);\n };\n\n const clearErrorsUnder = (path: string, inclusive = false) => {\n for (const map of [fieldErrors, formErrors, serverErrors])\n for (const key of map.keys())\n if (inclusive ? isUnder(key, path) : key.startsWith(`${path}.`)) map.delete(key);\n };\n\n const resetTo = (values: Record<string, unknown>) => {\n clearRuntimeState();\n baseline = values;\n form.reset(values);\n notify();\n };\n\n const emitValueChange = (path: string, source: ChangeSource) => {\n for (const listener of valueListeners) listener({ path, source });\n };\n\n const afterUserChange = (path: string) => {\n touched.add(path);\n serverErrors.delete(path);\n schedule(path, 'change');\n for (const [other, runtime] of fields) {\n if (other !== path && runtime.registration.deps?.includes(path) && isTouched(other))\n void runField(other, true);\n }\n notify();\n };\n\n const validate = async (paths?: string[]): Promise<ValidateResult> => {\n const values = getValues();\n const formResult = (formValidator ? await formValidator(values) : undefined) ?? {};\n const targets = paths ?? [...new Set([...fields.keys(), ...Object.keys(formResult)])];\n await Promise.all(targets.map((path) => runField(path, false)));\n for (const path of targets) setOrDelete(formErrors, path, formResult[path]);\n notify();\n const errors: Record<string, string> = {};\n for (const path of targets) {\n const error = errorOf(path);\n if (error !== undefined) errors[path] = error;\n }\n return { errors, valid: Object.keys(errors).length === 0 };\n };\n\n const clearRuntimeState = () => {\n for (const runtime of fields.values()) {\n clearTimeout(runtime.timer);\n runtime.token += 1;\n }\n fieldErrors.clear();\n formErrors.clear();\n serverErrors.clear();\n validating.clear();\n touched.clear();\n };\n\n const runSubmit = async (onSubmit?: (values: Record<string, unknown>) => unknown) => {\n submitCount += 1;\n serverErrors.clear();\n for (const path of fields.keys()) touched.add(path);\n let values: Record<string, unknown>;\n let result: ValidateResult;\n do {\n values = getValues();\n result = await validate();\n // Async validators must finish against unchanged values before submission.\n } while (values !== getValues());\n if (!result.valid) {\n notify();\n return result;\n }\n submitting = true;\n notify();\n try {\n await onSubmit?.(values);\n if (serverErrors.size > 0) return { errors: Object.fromEntries(serverErrors), valid: false };\n resetTo(getValues());\n } finally {\n submitting = false;\n notify();\n }\n return result;\n };\n\n const engine: FormEngine = {\n blurField: (path) => {\n touched.add(path);\n schedule(path, 'blur');\n notify();\n },\n destroy: () => {\n for (const runtime of fields.values()) clearTimeout(runtime.timer);\n storeSubscription.unsubscribe();\n listeners.clear();\n valueListeners.clear();\n },\n getField,\n getStatus,\n getValue,\n getValues,\n isTouched,\n moveItem: (path, from, to) => {\n form.moveFieldValues(toEnginePath(path) as never, from, to);\n touched.add(path);\n clearErrorsUnder(path);\n emitValueChange(path, 'user');\n notify();\n },\n onValueChange: (listener) => {\n valueListeners.add(listener);\n return () => valueListeners.delete(listener);\n },\n pushItem: (path, item) => {\n form.pushFieldValue(toEnginePath(path) as never, item as never);\n touched.add(path);\n emitValueChange(path, 'user');\n notify();\n },\n registerField: (path, registration) => {\n const runtime: FieldRuntime = { registration, token: 0 };\n fields.set(path, runtime);\n return () => {\n if (fields.get(path) !== runtime) return;\n clearTimeout(runtime.timer);\n fields.delete(path);\n fieldErrors.delete(path);\n validating.delete(path);\n snapshots.delete(path);\n notify();\n };\n },\n removeItem: (path, index) => {\n void form.removeFieldValue(toEnginePath(path) as never, index);\n touched.add(path);\n clearErrorsUnder(path);\n emitValueChange(path, 'user');\n notify();\n },\n reset: (values) => resetTo(values ?? baseline),\n resetField: (path) => {\n for (const [key, runtime] of fields) {\n if (!isUnder(key, path)) continue;\n clearTimeout(runtime.timer);\n runtime.token += 1;\n validating.delete(key);\n }\n for (const entry of touched) if (isUnder(entry, path)) touched.delete(entry);\n clearErrorsUnder(path, true);\n form.setFieldValue(toEnginePath(path) as never, getBy(baseline, toEnginePath(path)), {\n dontUpdateMeta: true,\n });\n emitValueChange(path, 'api');\n notify();\n },\n setErrors: (errors) => {\n for (const [path, error] of Object.entries(errors)) setOrDelete(serverErrors, path, error);\n notify();\n },\n setFormValidator: (validator) => {\n formValidator = validator;\n },\n setValue: (path, value, source) => {\n form.setFieldValue(toEnginePath(path) as never, value as never, { dontUpdateMeta: true });\n if (source === 'api') baseline = setBy(baseline, toEnginePath(path), () => value);\n emitValueChange(path, source);\n if (source === 'user') afterUserChange(path);\n },\n submit: (onSubmit) => {\n inflightSubmit ??= runSubmit(onSubmit).finally(() => {\n inflightSubmit = undefined;\n });\n return inflightSubmit;\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n validate,\n };\n\n return engine;\n};\n"],"mappings":";;;AAgBA,MAAM,gBAAgB,SAAiB,KAAK,WAAW,oBAAoB,MAAM;AAEjF,MAAM,kBAAkB,GAAW,MACjC,MAAM,KAAK,EAAE,WAAW,GAAG,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE,EAAE;AAE1D,MAAM,WAAW,MAAc,SAAiB,SAAS,QAAQ,KAAK,WAAW,GAAG,KAAK,EAAE;AAQ3F,MAAa,wBAAsC,kBAAkB;CACnE,MAAM,OAAO,IAAI,QAAQ,EAAE,eAAe,cAAc,CAAC;CAEzD,MAAM,yBAAS,IAAI,IAA0B;CAC7C,MAAM,8BAAc,IAAI,IAAoB;CAC5C,MAAM,6BAAa,IAAI,IAAoB;CAC3C,MAAM,+BAAe,IAAI,IAAoB;CAC7C,MAAM,6BAAa,IAAI,IAAY;CACnC,MAAM,0BAAU,IAAI,IAAY;CAChC,MAAM,4BAAY,IAAI,IAAgB;CACtC,MAAM,iCAAiB,IAAI,IAAmC;CAC9D,MAAM,4BAAY,IAAI,IAA2B;CAEjD,IAAI;CACJ,IAAI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KAClB,CAAC;GACD,gBAAgB,MAAM,KAAK;GAC3B,OAAO;EACT;EACA,YAAY,WAAW;GACrB,KAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,GAAG,YAAY,cAAc,MAAM,KAAK;GACzF,OAAO;EACT;EACA,mBAAmB,cAAc;GAC/B,gBAAgB;EAClB;EACA,WAAW,MAAM,OAAO,WAAW;GACjC,KAAK,cAAc,aAAa,IAAI,GAAY,OAAgB,EAAE,gBAAgB,KAAK,CAAC;GACxF,IAAI,WAAW,OAAO,WAAW,MAAM,UAAU,aAAa,IAAI,SAAS,KAAK;GAChF,gBAAgB,MAAM,MAAM;GAC5B,IAAI,WAAW,QAAQ,gBAAgB,IAAI;EAC7C;EACA,SAAS,aAAa;GACpB,mBAAmB,UAAU,QAAQ,CAAC,CAAC,cAAc;IACnD,iBAAiB,KAAA;GACnB,CAAC;GACD,OAAO;EACT;EACA,YAAY,aAAa;GACvB,UAAU,IAAI,QAAQ;GACtB,aAAa,UAAU,OAAO,QAAQ;EACxC;EACA;CAGU;AACd"}
1
+ {"version":3,"file":"tanstack.mjs","names":[],"sources":["../../../src/FormKit/engine/tanstack.ts"],"sourcesContent":["import { FormApi, getBy, setBy } from '@tanstack/form-core';\nimport { isEqual } from 'es-toolkit/compat';\n\nimport type {\n ChangeSource,\n CreateEngine,\n FieldRegistration,\n FieldSnapshot,\n FormEngine,\n FormStatus,\n FormValidator,\n ValidateResult,\n ValidateTrigger,\n ValueChange,\n} from './types';\n\nconst toEnginePath = (path: string) => path.replaceAll(/\\.(\\d+)(?=\\.|$)/g, '[$1]');\n\nconst isSameOrNested = (a: string, b: string) =>\n a === b || a.startsWith(`${b}.`) || b.startsWith(`${a}.`);\n\nconst isUnder = (path: string, root: string) => path === root || path.startsWith(`${root}.`);\n\ninterface FieldRuntime {\n registration: FieldRegistration;\n timer?: ReturnType<typeof setTimeout>;\n token: number;\n}\n\nexport const createTanstackEngine: CreateEngine = (initialValues) => {\n const form = new FormApi({ defaultValues: initialValues });\n\n const fields = new Map<string, FieldRuntime>();\n const fieldErrors = new Map<string, string>();\n const formErrors = new Map<string, string>();\n const serverErrors = new Map<string, string>();\n const validating = new Set<string>();\n const touched = new Set<string>();\n const edited = new Set<string>();\n const listeners = new Set<() => void>();\n const valueListeners = new Set<(change: ValueChange) => void>();\n const snapshots = new Map<string, FieldSnapshot>();\n\n let formValidator: FormValidator | undefined;\n let baseline = initialValues;\n let dirtyCache: { baseline: unknown; dirty: boolean; values: unknown } | undefined;\n let inflightSubmit: Promise<ValidateResult> | undefined;\n let submitting = false;\n let submitCount = 0;\n let status: FormStatus = { dirty: false, submitCount: 0, submitting: false };\n\n const notify = () => {\n for (const listener of listeners) listener();\n };\n const storeSubscription = form.store.subscribe(notify);\n\n const getValue = (path: string) => form.getFieldValue(toEnginePath(path) as never) as unknown;\n const getValues = () => form.state.values as Record<string, unknown>;\n const isTouched = (path: string) => {\n for (const entry of touched) if (isSameOrNested(entry, path)) return true;\n return false;\n };\n const isEdited = (path: string) => {\n for (const entry of edited) if (isSameOrNested(entry, path)) return true;\n return false;\n };\n const errorOf = (path: string) =>\n serverErrors.get(path) ?? fieldErrors.get(path) ?? formErrors.get(path);\n\n const getField = (path: string): FieldSnapshot => {\n const next: FieldSnapshot = {\n error: errorOf(path),\n touched: isTouched(path),\n validating: validating.has(path),\n value: getValue(path),\n };\n const prev = snapshots.get(path);\n if (\n prev &&\n prev.error === next.error &&\n prev.touched === next.touched &&\n prev.validating === next.validating &&\n Object.is(prev.value, next.value)\n )\n return prev;\n snapshots.set(path, next);\n return next;\n };\n\n const getStatus = (): FormStatus => {\n const values = getValues();\n if (dirtyCache?.values !== values || dirtyCache.baseline !== baseline)\n dirtyCache = { baseline, dirty: !isEqual(values, baseline), values };\n const { dirty } = dirtyCache;\n if (\n status.dirty !== dirty ||\n status.submitting !== submitting ||\n status.submitCount !== submitCount\n )\n status = { dirty, submitCount, submitting };\n return status;\n };\n\n const shouldValidate = (path: string, trigger: ValidateTrigger) => {\n const mode = fields.get(path)?.registration.validateOn ?? 'auto';\n if (trigger === 'submit') return true;\n if (mode === 'change') return true;\n if (mode === 'blur') return trigger === 'blur';\n if (mode === 'submit') return false;\n if (errorOf(path) !== undefined) return true;\n return trigger === 'blur' && (isEdited(path) || submitCount > 0);\n };\n\n const setOrDelete = (map: Map<string, string>, path: string, error: string | undefined) => {\n if (error === undefined) map.delete(path);\n else map.set(path, error);\n };\n\n const runField = (path: string, withFormValidator: boolean): Promise<void> => {\n const runtime = fields.get(path);\n if (!runtime) return Promise.resolve();\n runtime.token += 1;\n const token = runtime.token;\n const { validate } = runtime.registration;\n if (!validate && !(withFormValidator && formValidator)) return Promise.resolve();\n\n validating.add(path);\n notify();\n return (async () => {\n const values = getValues();\n const [fieldError, formResult] = await Promise.all([\n validate?.(getValue(path), values),\n withFormValidator ? formValidator?.(values) : undefined,\n ]);\n if (runtime.token !== token || fields.get(path) !== runtime) return;\n setOrDelete(fieldErrors, path, fieldError);\n if (withFormValidator) setOrDelete(formErrors, path, formResult?.[path]);\n validating.delete(path);\n notify();\n })();\n };\n\n const schedule = (path: string, trigger: ValidateTrigger) => {\n const runtime = fields.get(path);\n if (!runtime || !shouldValidate(path, trigger)) return;\n clearTimeout(runtime.timer);\n const debounceMs = runtime.registration.debounceMs ?? 0;\n if (trigger === 'change' && debounceMs > 0) {\n runtime.token += 1;\n runtime.timer = setTimeout(() => void runField(path, true), debounceMs);\n return;\n }\n void runField(path, true);\n };\n\n const clearErrorsUnder = (path: string, inclusive = false) => {\n for (const map of [fieldErrors, formErrors, serverErrors])\n for (const key of map.keys())\n if (inclusive ? isUnder(key, path) : key.startsWith(`${path}.`)) map.delete(key);\n };\n\n const resetTo = (values: Record<string, unknown>) => {\n clearRuntimeState();\n baseline = values;\n form.reset(values);\n notify();\n };\n\n const emitValueChange = (path: string, source: ChangeSource) => {\n for (const listener of valueListeners) listener({ path, source });\n };\n\n const afterUserChange = (path: string) => {\n touched.add(path);\n edited.add(path);\n serverErrors.delete(path);\n schedule(path, 'change');\n for (const [other, runtime] of fields) {\n if (other !== path && runtime.registration.deps?.includes(path) && isTouched(other))\n void runField(other, true);\n }\n notify();\n };\n\n const validate = async (paths?: string[]): Promise<ValidateResult> => {\n const values = getValues();\n const formResult = (formValidator ? await formValidator(values) : undefined) ?? {};\n const targets = paths ?? [...new Set([...fields.keys(), ...Object.keys(formResult)])];\n await Promise.all(targets.map((path) => runField(path, false)));\n for (const path of targets) setOrDelete(formErrors, path, formResult[path]);\n notify();\n const errors: Record<string, string> = {};\n for (const path of targets) {\n const error = errorOf(path);\n if (error !== undefined) errors[path] = error;\n }\n return { errors, valid: Object.keys(errors).length === 0 };\n };\n\n const clearRuntimeState = () => {\n for (const runtime of fields.values()) {\n clearTimeout(runtime.timer);\n runtime.token += 1;\n }\n fieldErrors.clear();\n formErrors.clear();\n serverErrors.clear();\n validating.clear();\n touched.clear();\n edited.clear();\n };\n\n const runSubmit = async (onSubmit?: (values: Record<string, unknown>) => unknown) => {\n submitCount += 1;\n serverErrors.clear();\n for (const path of fields.keys()) touched.add(path);\n let values: Record<string, unknown>;\n let result: ValidateResult;\n do {\n values = getValues();\n result = await validate();\n // Async validators must finish against unchanged values before submission.\n } while (values !== getValues());\n if (!result.valid) {\n notify();\n return result;\n }\n submitting = true;\n notify();\n try {\n await onSubmit?.(values);\n if (serverErrors.size > 0) return { errors: Object.fromEntries(serverErrors), valid: false };\n resetTo(getValues());\n } finally {\n submitting = false;\n notify();\n }\n return result;\n };\n\n const engine: FormEngine = {\n blurField: (path) => {\n touched.add(path);\n schedule(path, 'blur');\n notify();\n },\n destroy: () => {\n for (const runtime of fields.values()) clearTimeout(runtime.timer);\n storeSubscription.unsubscribe();\n listeners.clear();\n valueListeners.clear();\n },\n getField,\n getStatus,\n getValue,\n getValues,\n isTouched,\n moveItem: (path, from, to) => {\n form.moveFieldValues(toEnginePath(path) as never, from, to);\n touched.add(path);\n edited.add(path);\n clearErrorsUnder(path);\n emitValueChange(path, 'user');\n notify();\n },\n onValueChange: (listener) => {\n valueListeners.add(listener);\n return () => valueListeners.delete(listener);\n },\n pushItem: (path, item) => {\n form.pushFieldValue(toEnginePath(path) as never, item as never);\n touched.add(path);\n edited.add(path);\n emitValueChange(path, 'user');\n notify();\n },\n registerField: (path, registration) => {\n const runtime: FieldRuntime = { registration, token: 0 };\n fields.set(path, runtime);\n return () => {\n if (fields.get(path) !== runtime) return;\n clearTimeout(runtime.timer);\n fields.delete(path);\n fieldErrors.delete(path);\n validating.delete(path);\n snapshots.delete(path);\n notify();\n };\n },\n removeItem: (path, index) => {\n void form.removeFieldValue(toEnginePath(path) as never, index);\n touched.add(path);\n edited.add(path);\n clearErrorsUnder(path);\n emitValueChange(path, 'user');\n notify();\n },\n reset: (values) => resetTo(values ?? baseline),\n resetField: (path) => {\n for (const [key, runtime] of fields) {\n if (!isUnder(key, path)) continue;\n clearTimeout(runtime.timer);\n runtime.token += 1;\n validating.delete(key);\n }\n for (const entry of touched) if (isUnder(entry, path)) touched.delete(entry);\n for (const entry of edited) if (isUnder(entry, path)) edited.delete(entry);\n clearErrorsUnder(path, true);\n form.setFieldValue(toEnginePath(path) as never, getBy(baseline, toEnginePath(path)), {\n dontUpdateMeta: true,\n });\n emitValueChange(path, 'api');\n notify();\n },\n setErrors: (errors) => {\n for (const [path, error] of Object.entries(errors)) setOrDelete(serverErrors, path, error);\n notify();\n },\n setFormValidator: (validator) => {\n formValidator = validator;\n },\n setValue: (path, value, source) => {\n form.setFieldValue(toEnginePath(path) as never, value as never, { dontUpdateMeta: true });\n if (source === 'api') baseline = setBy(baseline, toEnginePath(path), () => value);\n emitValueChange(path, source);\n if (source === 'user') afterUserChange(path);\n },\n submit: (onSubmit) => {\n inflightSubmit ??= runSubmit(onSubmit).finally(() => {\n inflightSubmit = undefined;\n });\n return inflightSubmit;\n },\n subscribe: (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n },\n validate,\n };\n\n return engine;\n};\n"],"mappings":";;;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AAgB;EAClB;EACA,WAAW,MAAM,OAAO,WAAW;GACjC,KAAK,cAAc,aAAa,IAAI,GAAY,OAAgB,EAAE,gBAAgB,KAAK,CAAC;GACxF,IAAI,WAAW,OAAO,WAAW,MAAM,UAAU,aAAa,IAAI,SAAS,KAAK;GAChF,gBAAgB,MAAM,MAAM;GAC5B,IAAI,WAAW,QAAQ,gBAAgB,IAAI;EAC7C;EACA,SAAS,aAAa;GACpB,mBAAmB,UAAU,QAAQ,CAAC,CAAC,cAAc;IACnD,iBAAiB,KAAA;GACnB,CAAC;GACD,OAAO;EACT;EACA,YAAY,aAAa;GACvB,UAAU,IAAI,QAAQ;GACtB,aAAa,UAAU,OAAO,QAAQ;EACxC;EACA;CAGU;AACd"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "6.0.3",
3
+ "version": "6.0.4",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",