@shwfed/config 3.0.18 → 3.0.20

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.
Files changed (76) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/app.vue +4 -1
  3. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.d.vue.ts +6 -6
  4. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/config.vue.d.ts +6 -6
  5. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.d.vue.ts +6 -6
  6. package/dist/runtime/components/config/blocks/2026-07-17/com.shwfed.block.invoice.realestate.lease/runtime.vue.d.ts +6 -6
  7. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.d.vue.ts +2 -2
  8. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue.d.ts +2 -2
  9. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts +2 -2
  10. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts +2 -2
  11. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +4 -4
  12. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +4 -4
  13. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +4 -4
  14. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +4 -4
  15. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +6 -6
  16. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +6 -6
  17. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +2 -2
  18. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +2 -2
  19. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
  20. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
  21. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +2 -2
  22. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +2 -2
  23. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +29 -14
  24. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.d.vue.ts +2 -2
  25. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue.d.ts +2 -2
  26. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +4 -4
  27. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +4 -4
  28. package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +29 -14
  29. package/dist/runtime/components/form/fields/2026-06-14/com.shwfed.form.field.combobox.single/runtime.vue +29 -14
  30. package/dist/runtime/components/form/index.vue +8 -8
  31. package/dist/runtime/components/form/utils/state.d.ts +18 -1
  32. package/dist/runtime/components/form/utils/state.js +5 -1
  33. package/dist/runtime/components/modal.vue +2 -1
  34. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  35. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  36. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  37. package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  38. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  39. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  40. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  41. package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  42. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
  43. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
  44. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
  45. package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
  46. package/dist/runtime/components/ui/date-picker/DatePicker.d.vue.ts +4 -10
  47. package/dist/runtime/components/ui/date-picker/DatePicker.vue +57 -40
  48. package/dist/runtime/components/ui/date-picker/DatePicker.vue.d.ts +4 -10
  49. package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +2 -0
  50. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue +2 -1
  51. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +2 -0
  52. package/dist/runtime/components/ui/date-picker/DatePickerPanels.d.vue.ts +23 -0
  53. package/dist/runtime/components/ui/date-picker/DatePickerPanels.vue +56 -0
  54. package/dist/runtime/components/ui/date-picker/DatePickerPanels.vue.d.ts +23 -0
  55. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +2 -2
  56. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +2 -2
  57. package/dist/runtime/components/ui/date-picker/index.d.ts +2 -2
  58. package/dist/runtime/components/ui/date-picker/types.d.ts +6 -0
  59. package/dist/runtime/components/ui/date-range-picker/DateRangePicker.d.vue.ts +2 -8
  60. package/dist/runtime/components/ui/date-range-picker/DateRangePicker.vue +59 -43
  61. package/dist/runtime/components/ui/date-range-picker/DateRangePicker.vue.d.ts +2 -8
  62. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +2 -0
  63. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue +3 -2
  64. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +2 -0
  65. package/dist/runtime/components/ui/date-range-picker/DateRangePickerPanels.d.vue.ts +23 -0
  66. package/dist/runtime/components/ui/date-range-picker/DateRangePickerPanels.vue +60 -0
  67. package/dist/runtime/components/ui/date-range-picker/DateRangePickerPanels.vue.d.ts +23 -0
  68. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
  69. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
  70. package/dist/runtime/components/ui/date-range-picker/index.d.ts +2 -2
  71. package/dist/runtime/components/ui/date-range-picker/types.d.ts +6 -0
  72. package/dist/runtime/components/ui/input-group/InputGroupNumberField.vue +1 -1
  73. package/dist/runtime/components/ui/sidebar/SidebarProvider.vue +3 -2
  74. package/dist/runtime/composables/useIsMobile.d.ts +15 -0
  75. package/dist/runtime/composables/useIsMobile.js +12 -0
  76. package/package.json +1 -1
@@ -35,7 +35,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
35
35
  readonly mode: "formula" | "prefill";
36
36
  readonly expression: string;
37
37
  } | undefined;
38
- readonly rangeSeparatorIcon?: string | undefined;
39
38
  readonly startPlaceholder?: readonly [{
40
39
  readonly locale: "zh";
41
40
  readonly message: string;
@@ -50,6 +49,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
50
49
  readonly locale: "en" | "ja" | "ko";
51
50
  readonly message: string;
52
51
  }[]] | undefined;
52
+ readonly rangeSeparatorIcon?: string | undefined;
53
53
  readonly validations?: readonly {
54
54
  readonly message: readonly [{
55
55
  readonly locale: "zh";
@@ -98,7 +98,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
98
98
  readonly mode: "formula" | "prefill";
99
99
  readonly expression: string;
100
100
  } | undefined;
101
- readonly rangeSeparatorIcon?: string | undefined;
102
101
  readonly startPlaceholder?: readonly [{
103
102
  readonly locale: "zh";
104
103
  readonly message: string;
@@ -113,6 +112,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
113
112
  readonly locale: "en" | "ja" | "ko";
114
113
  readonly message: string;
115
114
  }[]] | undefined;
115
+ readonly rangeSeparatorIcon?: string | undefined;
116
116
  readonly validations?: readonly {
117
117
  readonly message: readonly [{
118
118
  readonly locale: "zh";
@@ -35,7 +35,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
35
35
  readonly mode: "formula" | "prefill";
36
36
  readonly expression: string;
37
37
  } | undefined;
38
- readonly rangeSeparatorIcon?: string | undefined;
39
38
  readonly startPlaceholder?: readonly [{
40
39
  readonly locale: "zh";
41
40
  readonly message: string;
@@ -50,6 +49,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
50
49
  readonly locale: "en" | "ja" | "ko";
51
50
  readonly message: string;
52
51
  }[]] | undefined;
52
+ readonly rangeSeparatorIcon?: string | undefined;
53
53
  readonly validations?: readonly {
54
54
  readonly message: readonly [{
55
55
  readonly locale: "zh";
@@ -98,7 +98,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
98
98
  readonly mode: "formula" | "prefill";
99
99
  readonly expression: string;
100
100
  } | undefined;
101
- readonly rangeSeparatorIcon?: string | undefined;
102
101
  readonly startPlaceholder?: readonly [{
103
102
  readonly locale: "zh";
104
103
  readonly message: string;
@@ -113,6 +112,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
113
112
  readonly locale: "en" | "ja" | "ko";
114
113
  readonly message: string;
115
114
  }[]] | undefined;
115
+ readonly rangeSeparatorIcon?: string | undefined;
116
116
  readonly validations?: readonly {
117
117
  readonly message: readonly [{
118
118
  readonly locale: "zh";
@@ -3,7 +3,7 @@ import { Icon } from "@iconify/vue";
3
3
  import { watchDebounced } from "@vueuse/core";
4
4
  import { Effect, Option } from "effect";
5
5
  import { Fetch } from "fx-fetch";
6
- import { computed, nextTick, ref } from "vue";
6
+ import { computed, nextTick, onScopeDispose, ref } from "vue";
7
7
  import { useI18n } from "vue-i18n";
8
8
  import { asRequest, fetchJsonOption } from "../../../../../share/request";
9
9
  import { cel as _rawCel } from "../../../../../utils/cel";
@@ -23,6 +23,7 @@ import { InputGroup, InputGroupAddon, InputGroupButton } from "../../../../ui/in
23
23
  import { Markdown } from "../../../../ui/markdown";
24
24
  import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
25
25
  import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
26
+ import { useDerivedQuiescence } from "../../../utils/derived";
26
27
  import { useFieldValidation } from "../../../utils/validation";
27
28
  import { useFormReadonly } from "../../../utils/readonly";
28
29
  import { useFormScope, useFormState } from "../../../utils/state";
@@ -51,7 +52,7 @@ const { locale, t } = useI18n({
51
52
  }
52
53
  }
53
54
  });
54
- const { getAt, setAt, setAtSilent } = useFormState();
55
+ const { getAt, setAt, setAtSilent, seeded } = useFormState();
55
56
  const formScope = useFormScope();
56
57
  const inherited = injectCELContext();
57
58
  const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
@@ -163,20 +164,34 @@ const model = computed({
163
164
  setAt(path, next);
164
165
  }
165
166
  });
167
+ let seedSettled = false;
166
168
  let lastRequestSignature;
167
- watchDebounced(
168
- requestSignature,
169
- () => {
170
- if (lastRequestSignature != null) {
171
- const path = props.config.binding;
172
- if (path == null) uncontrolled.value = void 0;
173
- else setAtSilent(path, void 0);
174
- }
175
- lastRequestSignature = requestSignature.value;
169
+ let lastFetchedSignature;
170
+ function reactToRequest() {
171
+ if (!seedSettled) return;
172
+ if (lastRequestSignature != null && requestSignature.value !== lastRequestSignature) {
173
+ const path = props.config.binding;
174
+ if (path == null) uncontrolled.value = void 0;
175
+ else setAtSilent(path, void 0);
176
+ }
177
+ lastRequestSignature = requestSignature.value;
178
+ if (requestSignature.value !== lastFetchedSignature) {
179
+ lastFetchedSignature = requestSignature.value;
176
180
  void fetchOptions();
177
- },
178
- { debounce: 200, immediate: true }
179
- );
181
+ }
182
+ }
183
+ watchDebounced(requestSignature, reactToRequest, { debounce: 200, immediate: true });
184
+ const quiescence = useDerivedQuiescence();
185
+ let disposed = false;
186
+ onScopeDispose(() => {
187
+ disposed = true;
188
+ });
189
+ function establishBaseline() {
190
+ if (disposed) return;
191
+ seedSettled = true;
192
+ reactToRequest();
193
+ }
194
+ seeded.then(() => quiescence.settled(), () => quiescence.settled()).then(establishBaseline);
180
195
  function isEqual(a, b) {
181
196
  if (a === b) return true;
182
197
  if (a == null || b == null) return false;
@@ -40,8 +40,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
40
40
  readonly expression: string;
41
41
  } | undefined;
42
42
  readonly format?: string | undefined;
43
- readonly valueFormat?: string | undefined;
44
43
  readonly disabledDate?: string | undefined;
44
+ readonly valueFormat?: string | undefined;
45
45
  readonly validations?: readonly {
46
46
  readonly message: readonly [{
47
47
  readonly locale: "zh";
@@ -103,8 +103,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
103
  readonly expression: string;
104
104
  } | undefined;
105
105
  readonly format?: string | undefined;
106
- readonly valueFormat?: string | undefined;
107
106
  readonly disabledDate?: string | undefined;
107
+ readonly valueFormat?: string | undefined;
108
108
  readonly validations?: readonly {
109
109
  readonly message: readonly [{
110
110
  readonly locale: "zh";
@@ -40,8 +40,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
40
40
  readonly expression: string;
41
41
  } | undefined;
42
42
  readonly format?: string | undefined;
43
- readonly valueFormat?: string | undefined;
44
43
  readonly disabledDate?: string | undefined;
44
+ readonly valueFormat?: string | undefined;
45
45
  readonly validations?: readonly {
46
46
  readonly message: readonly [{
47
47
  readonly locale: "zh";
@@ -103,8 +103,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
103
  readonly expression: string;
104
104
  } | undefined;
105
105
  readonly format?: string | undefined;
106
- readonly valueFormat?: string | undefined;
107
106
  readonly disabledDate?: string | undefined;
107
+ readonly valueFormat?: string | undefined;
108
108
  readonly validations?: readonly {
109
109
  readonly message: readonly [{
110
110
  readonly locale: "zh";
@@ -33,9 +33,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
33
33
  readonly expression: string;
34
34
  } | undefined;
35
35
  readonly format?: string | undefined;
36
- readonly valueFormat?: string | undefined;
37
36
  readonly disabledDate?: string | undefined;
38
- readonly rangeSeparatorIcon?: string | undefined;
37
+ readonly valueFormat?: string | undefined;
39
38
  readonly startPlaceholder?: readonly [{
40
39
  readonly locale: "zh";
41
40
  readonly message: string;
@@ -50,6 +49,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
50
49
  readonly locale: "en" | "ja" | "ko";
51
50
  readonly message: string;
52
51
  }[]] | undefined;
52
+ readonly rangeSeparatorIcon?: string | undefined;
53
53
  readonly validations?: readonly {
54
54
  readonly message: readonly [{
55
55
  readonly locale: "zh";
@@ -105,9 +105,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
105
105
  readonly expression: string;
106
106
  } | undefined;
107
107
  readonly format?: string | undefined;
108
- readonly valueFormat?: string | undefined;
109
108
  readonly disabledDate?: string | undefined;
110
- readonly rangeSeparatorIcon?: string | undefined;
109
+ readonly valueFormat?: string | undefined;
111
110
  readonly startPlaceholder?: readonly [{
112
111
  readonly locale: "zh";
113
112
  readonly message: string;
@@ -122,6 +121,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
122
121
  readonly locale: "en" | "ja" | "ko";
123
122
  readonly message: string;
124
123
  }[]] | undefined;
124
+ readonly rangeSeparatorIcon?: string | undefined;
125
125
  readonly validations?: readonly {
126
126
  readonly message: readonly [{
127
127
  readonly locale: "zh";
@@ -33,9 +33,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
33
33
  readonly expression: string;
34
34
  } | undefined;
35
35
  readonly format?: string | undefined;
36
- readonly valueFormat?: string | undefined;
37
36
  readonly disabledDate?: string | undefined;
38
- readonly rangeSeparatorIcon?: string | undefined;
37
+ readonly valueFormat?: string | undefined;
39
38
  readonly startPlaceholder?: readonly [{
40
39
  readonly locale: "zh";
41
40
  readonly message: string;
@@ -50,6 +49,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
50
49
  readonly locale: "en" | "ja" | "ko";
51
50
  readonly message: string;
52
51
  }[]] | undefined;
52
+ readonly rangeSeparatorIcon?: string | undefined;
53
53
  readonly validations?: readonly {
54
54
  readonly message: readonly [{
55
55
  readonly locale: "zh";
@@ -105,9 +105,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
105
105
  readonly expression: string;
106
106
  } | undefined;
107
107
  readonly format?: string | undefined;
108
- readonly valueFormat?: string | undefined;
109
108
  readonly disabledDate?: string | undefined;
110
- readonly rangeSeparatorIcon?: string | undefined;
109
+ readonly valueFormat?: string | undefined;
111
110
  readonly startPlaceholder?: readonly [{
112
111
  readonly locale: "zh";
113
112
  readonly message: string;
@@ -122,6 +121,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
122
121
  readonly locale: "en" | "ja" | "ko";
123
122
  readonly message: string;
124
123
  }[]] | undefined;
124
+ readonly rangeSeparatorIcon?: string | undefined;
125
125
  readonly validations?: readonly {
126
126
  readonly message: readonly [{
127
127
  readonly locale: "zh";
@@ -3,7 +3,7 @@ import { Icon } from "@iconify/vue";
3
3
  import { watchDebounced } from "@vueuse/core";
4
4
  import { Effect, Option } from "effect";
5
5
  import { Fetch } from "fx-fetch";
6
- import { computed, nextTick, ref, watch } from "vue";
6
+ import { computed, nextTick, onScopeDispose, ref, watch } from "vue";
7
7
  import { useI18n } from "vue-i18n";
8
8
  import { asRequest, fetchJsonOption } from "../../../../../share/request";
9
9
  import { cel as _rawCel } from "../../../../../utils/cel";
@@ -24,6 +24,7 @@ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "
24
24
  import { Markdown } from "../../../../ui/markdown";
25
25
  import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
26
26
  import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
27
+ import { useDerivedQuiescence } from "../../../utils/derived";
27
28
  import { useFormReadonly } from "../../../utils/readonly";
28
29
  import { useFormScope, useFormState } from "../../../utils/state";
29
30
  import { useFieldValidation } from "../../../utils/validation";
@@ -55,7 +56,7 @@ const { locale, t } = useI18n({
55
56
  }
56
57
  }
57
58
  });
58
- const { getAt, setAt, setAtSilent } = useFormState();
59
+ const { getAt, setAt, setAtSilent, seeded } = useFormState();
59
60
  const formScope = useFormScope();
60
61
  const inherited = injectCELContext();
61
62
  const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
@@ -220,20 +221,34 @@ const model = computed({
220
221
  setAt(path, next);
221
222
  }
222
223
  });
224
+ let seedSettled = false;
223
225
  let lastRequestSignature;
224
- watchDebounced(
225
- requestSignature,
226
- () => {
227
- if (lastRequestSignature != null) {
228
- const path = props.config.binding;
229
- if (path == null) uncontrolled.value = void 0;
230
- else setAtSilent(path, void 0);
231
- }
232
- lastRequestSignature = requestSignature.value;
226
+ let lastFetchedSignature;
227
+ function reactToRequest() {
228
+ if (!seedSettled) return;
229
+ if (lastRequestSignature != null && requestSignature.value !== lastRequestSignature) {
230
+ const path = props.config.binding;
231
+ if (path == null) uncontrolled.value = void 0;
232
+ else setAtSilent(path, void 0);
233
+ }
234
+ lastRequestSignature = requestSignature.value;
235
+ if (requestSignature.value !== lastFetchedSignature) {
236
+ lastFetchedSignature = requestSignature.value;
233
237
  void fetchOptions();
234
- },
235
- { debounce: 200, immediate: true }
236
- );
238
+ }
239
+ }
240
+ watchDebounced(requestSignature, reactToRequest, { debounce: 200, immediate: true });
241
+ const quiescence = useDerivedQuiescence();
242
+ let disposed = false;
243
+ onScopeDispose(() => {
244
+ disposed = true;
245
+ });
246
+ function establishBaseline() {
247
+ if (disposed) return;
248
+ seedSettled = true;
249
+ reactToRequest();
250
+ }
251
+ seeded.then(() => quiescence.settled(), () => quiescence.settled()).then(establishBaseline);
237
252
  function isEqual(a, b) {
238
253
  if (a === b) return true;
239
254
  if (a == null || b == null) return false;
@@ -3,7 +3,7 @@ import { Icon } from "@iconify/vue";
3
3
  import { watchDebounced } from "@vueuse/core";
4
4
  import { Effect, Option } from "effect";
5
5
  import { Fetch } from "fx-fetch";
6
- import { computed, nextTick, ref, watch } from "vue";
6
+ import { computed, nextTick, onScopeDispose, ref, watch } from "vue";
7
7
  import { useI18n } from "vue-i18n";
8
8
  import { asRequest, fetchJsonOption } from "../../../../../share/request";
9
9
  import { cel as _rawCel } from "../../../../../utils/cel";
@@ -24,6 +24,7 @@ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "
24
24
  import { Markdown } from "../../../../ui/markdown";
25
25
  import { Popover, PopoverAnchor, PopoverContent, PopoverTrigger } from "../../../../ui/popover";
26
26
  import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
27
+ import { useDerivedQuiescence } from "../../../utils/derived";
27
28
  import { useFormReadonly } from "../../../utils/readonly";
28
29
  import { useFormScope, useFormState } from "../../../utils/state";
29
30
  import { useFieldValidation } from "../../../utils/validation";
@@ -55,7 +56,7 @@ const { locale, t } = useI18n({
55
56
  }
56
57
  }
57
58
  });
58
- const { getAt, setAt, setAtSilent } = useFormState();
59
+ const { getAt, setAt, setAtSilent, seeded } = useFormState();
59
60
  const formScope = useFormScope();
60
61
  const inherited = injectCELContext();
61
62
  const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
@@ -223,20 +224,34 @@ const model = computed({
223
224
  setAt(path, next);
224
225
  }
225
226
  });
227
+ let seedSettled = false;
226
228
  let lastRequestSignature;
227
- watchDebounced(
228
- requestSignature,
229
- () => {
230
- if (lastRequestSignature != null) {
231
- const path = props.config.binding;
232
- if (path == null) uncontrolled.value = void 0;
233
- else setAtSilent(path, void 0);
234
- }
235
- lastRequestSignature = requestSignature.value;
229
+ let lastFetchedSignature;
230
+ function reactToRequest() {
231
+ if (!seedSettled) return;
232
+ if (lastRequestSignature != null && requestSignature.value !== lastRequestSignature) {
233
+ const path = props.config.binding;
234
+ if (path == null) uncontrolled.value = void 0;
235
+ else setAtSilent(path, void 0);
236
+ }
237
+ lastRequestSignature = requestSignature.value;
238
+ if (requestSignature.value !== lastFetchedSignature) {
239
+ lastFetchedSignature = requestSignature.value;
236
240
  void fetchOptions();
237
- },
238
- { debounce: 200, immediate: true }
239
- );
241
+ }
242
+ }
243
+ watchDebounced(requestSignature, reactToRequest, { debounce: 200, immediate: true });
244
+ const quiescence = useDerivedQuiescence();
245
+ let disposed = false;
246
+ onScopeDispose(() => {
247
+ disposed = true;
248
+ });
249
+ function establishBaseline() {
250
+ if (disposed) return;
251
+ seedSettled = true;
252
+ reactToRequest();
253
+ }
254
+ seeded.then(() => quiescence.settled(), () => quiescence.settled()).then(establishBaseline);
240
255
  function isEqual(a, b) {
241
256
  if (a === b) return true;
242
257
  if (a == null || b == null) return false;
@@ -53,7 +53,14 @@ if (config.value.id) {
53
53
  }
54
54
  const inherited = injectCELContext();
55
55
  const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
56
- const formState = provideFormState(state);
56
+ const seeded = (() => {
57
+ const current = state.value ?? {};
58
+ if (!config.value.initial || Object.keys(current).length > 0) return Promise.resolve();
59
+ return computeSeed(current).then((seed) => {
60
+ if (seed) state.value = { ...current, ...seed };
61
+ });
62
+ })();
63
+ const formState = provideFormState(state, "form", seeded);
57
64
  const commitBus = provideCommitBus();
58
65
  const quiescence = provideDerivedQuiescence();
59
66
  const formReadonly = computed(() => {
@@ -79,13 +86,6 @@ async function computeSeed(base) {
79
86
  return null;
80
87
  }
81
88
  }
82
- const seeded = (() => {
83
- const current = state.value ?? {};
84
- if (!config.value.initial || Object.keys(current).length > 0) return Promise.resolve();
85
- return computeSeed(current).then((seed) => {
86
- if (seed) state.value = { ...current, ...seed };
87
- });
88
- })();
89
89
  async function reseed() {
90
90
  const seed = await computeSeed({});
91
91
  state.value = seed ? { ...seed } : {};
@@ -33,6 +33,23 @@ export type FormStateBag = {
33
33
  * through the bags themselves.
34
34
  */
35
35
  parent: FormStateBag | undefined;
36
+ /**
37
+ * Resolves once the form's `initial` seed has landed in `state` (or
38
+ * immediately when there is no seed). The top-level form host passes its
39
+ * own seed promise; nested bags (list/table rows) inherit the enclosing
40
+ * form's, and a host-less fallback bag gets an already-resolved one.
41
+ *
42
+ * A field runtime awaits this before it establishes any request/watch
43
+ * baseline: while the seed is in flight `state` is empty, so a request
44
+ * expression that reads `form.?dep` builds a param-less-but-non-`null`
45
+ * request. Establishing a baseline against that pre-seed request would make
46
+ * the post-seed signature look like a "change away" and wrongly clear the
47
+ * seeded selection. Keying the first baseline off THIS boundary (not off a
48
+ * `null` signature, which `.query`'s drop-missing-param semantics defeats)
49
+ * is the correct edge. May reject when the seed itself failed — consumers
50
+ * must still start on rejection (mirror `useDerived`'s `ready` handling).
51
+ */
52
+ seeded: Promise<void>;
36
53
  state: Ref<unknown>;
37
54
  getAt: (path: string) => unknown;
38
55
  /**
@@ -83,7 +100,7 @@ export type FormStateBag = {
83
100
  coerce: (path: string, value: unknown) => unknown;
84
101
  };
85
102
  export declare const FORM_STATE_KEY: InjectionKey<FormStateBag>;
86
- export declare function provideFormState(state: Ref<unknown>, kind?: FormStateBagKind): FormStateBag;
103
+ export declare function provideFormState(state: Ref<unknown>, kind?: FormStateBagKind, seeded?: Promise<void>): FormStateBag;
87
104
  export declare function useFormState(): FormStateBag;
88
105
  /**
89
106
  * The nearest `'form'`-kind bag enclosing the current field — what the CEL
@@ -2,7 +2,7 @@ import { getProperty, setProperty } from "dot-prop";
2
2
  import { inject, provide, ref } from "vue";
3
3
  export const SELF_BINDING = ".";
4
4
  export const FORM_STATE_KEY = Symbol("shwfed-form-state");
5
- export function provideFormState(state, kind = "form") {
5
+ export function provideFormState(state, kind = "form", seeded) {
6
6
  const parent = inject(FORM_STATE_KEY, void 0);
7
7
  const dirty = ref(/* @__PURE__ */ new Set());
8
8
  const coercions = /* @__PURE__ */ new Map();
@@ -27,6 +27,10 @@ export function provideFormState(state, kind = "form") {
27
27
  const bag = {
28
28
  kind,
29
29
  parent,
30
+ // Explicit seed promise when given (the top-level form host), else inherit
31
+ // the enclosing form's (list/table rows), else an already-resolved one (a
32
+ // host-less fallback bag — the standalone table, a test harness).
33
+ seeded: seeded ?? parent?.seeded ?? Promise.resolve(),
30
34
  state,
31
35
  getAt: (path) => path === SELF_BINDING ? state.value : getProperty(state.value, path),
32
36
  setAt: (path, value) => {
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { useMediaQuery } from "@vueuse/core";
3
3
  import { computed, ref, useAttrs, useSlots } from "vue";
4
+ import { DESKTOP_MEDIA_QUERY } from "../composables/useIsMobile";
4
5
  import {
5
6
  Dialog,
6
7
  DialogClose,
@@ -28,7 +29,7 @@ defineOptions({
28
29
  const props = defineProps({
29
30
  open: { type: Boolean, required: false },
30
31
  defaultOpen: { type: Boolean, required: false, default: false },
31
- breakpoint: { type: String, required: false, default: "(min-width: 640px)" },
32
+ breakpoint: { type: String, required: false, default: DESKTOP_MEDIA_QUERY },
32
33
  showCloseButton: { type: Boolean, required: false, default: true },
33
34
  dismissible: { type: Boolean, required: false, default: true },
34
35
  contentWidth: { type: String, required: false }
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
44
44
  readonly mode: "formula" | "prefill";
45
45
  readonly expression: string;
46
46
  } | undefined;
47
+ readonly enableSorting?: boolean | undefined;
47
48
  readonly nodeKey: string;
48
49
  readonly nodeChildren: string;
49
50
  readonly nodeLabel: readonly [{
@@ -53,7 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
53
54
  readonly locale: "en" | "ja" | "ko";
54
55
  readonly message: string;
55
56
  }[]];
56
- readonly enableSorting?: boolean | undefined;
57
57
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
58
58
  readonly nodeTooltip?: readonly [{
59
59
  readonly locale: "zh";
@@ -108,6 +108,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
108
108
  readonly mode: "formula" | "prefill";
109
109
  readonly expression: string;
110
110
  } | undefined;
111
+ readonly enableSorting?: boolean | undefined;
111
112
  readonly nodeKey: string;
112
113
  readonly nodeChildren: string;
113
114
  readonly nodeLabel: readonly [{
@@ -117,7 +118,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
117
118
  readonly locale: "en" | "ja" | "ko";
118
119
  readonly message: string;
119
120
  }[]];
120
- readonly enableSorting?: boolean | undefined;
121
121
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
122
122
  readonly nodeTooltip?: readonly [{
123
123
  readonly locale: "zh";
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
44
44
  readonly mode: "formula" | "prefill";
45
45
  readonly expression: string;
46
46
  } | undefined;
47
+ readonly enableSorting?: boolean | undefined;
47
48
  readonly nodeKey: string;
48
49
  readonly nodeChildren: string;
49
50
  readonly nodeLabel: readonly [{
@@ -53,7 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
53
54
  readonly locale: "en" | "ja" | "ko";
54
55
  readonly message: string;
55
56
  }[]];
56
- readonly enableSorting?: boolean | undefined;
57
57
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
58
58
  readonly nodeTooltip?: readonly [{
59
59
  readonly locale: "zh";
@@ -108,6 +108,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
108
108
  readonly mode: "formula" | "prefill";
109
109
  readonly expression: string;
110
110
  } | undefined;
111
+ readonly enableSorting?: boolean | undefined;
111
112
  readonly nodeKey: string;
112
113
  readonly nodeChildren: string;
113
114
  readonly nodeLabel: readonly [{
@@ -117,7 +118,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
117
118
  readonly locale: "en" | "ja" | "ko";
118
119
  readonly message: string;
119
120
  }[]];
120
- readonly enableSorting?: boolean | undefined;
121
121
  readonly cascade: "independent" | "cascade-down" | "cascade-both";
122
122
  readonly nodeTooltip?: readonly [{
123
123
  readonly locale: "zh";
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
44
44
  readonly mode: "formula" | "prefill";
45
45
  readonly expression: string;
46
46
  } | undefined;
47
+ readonly enableSorting?: boolean | undefined;
47
48
  readonly nodeKey: string;
48
49
  readonly nodeChildren: string;
49
50
  readonly nodeLabel: readonly [{
@@ -53,7 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
53
54
  readonly locale: "en" | "ja" | "ko";
54
55
  readonly message: string;
55
56
  }[]];
56
- readonly enableSorting?: boolean | undefined;
57
57
  readonly nodeTooltip?: readonly [{
58
58
  readonly locale: "zh";
59
59
  readonly message: string;
@@ -107,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
107
107
  readonly mode: "formula" | "prefill";
108
108
  readonly expression: string;
109
109
  } | undefined;
110
+ readonly enableSorting?: boolean | undefined;
110
111
  readonly nodeKey: string;
111
112
  readonly nodeChildren: string;
112
113
  readonly nodeLabel: readonly [{
@@ -116,7 +117,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
116
117
  readonly locale: "en" | "ja" | "ko";
117
118
  readonly message: string;
118
119
  }[]];
119
- readonly enableSorting?: boolean | undefined;
120
120
  readonly nodeTooltip?: readonly [{
121
121
  readonly locale: "zh";
122
122
  readonly message: string;
@@ -44,6 +44,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
44
44
  readonly mode: "formula" | "prefill";
45
45
  readonly expression: string;
46
46
  } | undefined;
47
+ readonly enableSorting?: boolean | undefined;
47
48
  readonly nodeKey: string;
48
49
  readonly nodeChildren: string;
49
50
  readonly nodeLabel: readonly [{
@@ -53,7 +54,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
53
54
  readonly locale: "en" | "ja" | "ko";
54
55
  readonly message: string;
55
56
  }[]];
56
- readonly enableSorting?: boolean | undefined;
57
57
  readonly nodeTooltip?: readonly [{
58
58
  readonly locale: "zh";
59
59
  readonly message: string;
@@ -107,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
107
107
  readonly mode: "formula" | "prefill";
108
108
  readonly expression: string;
109
109
  } | undefined;
110
+ readonly enableSorting?: boolean | undefined;
110
111
  readonly nodeKey: string;
111
112
  readonly nodeChildren: string;
112
113
  readonly nodeLabel: readonly [{
@@ -116,7 +117,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
116
117
  readonly locale: "en" | "ja" | "ko";
117
118
  readonly message: string;
118
119
  }[]];
119
- readonly enableSorting?: boolean | undefined;
120
120
  readonly nodeTooltip?: readonly [{
121
121
  readonly locale: "zh";
122
122
  readonly message: string;