@shwfed/nuxt 0.10.7 → 0.10.9

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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
3
  "configKey": "shwfed",
4
- "version": "0.10.7",
4
+ "version": "0.10.9",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -23,6 +23,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
23
23
  icon?: string | undefined;
24
24
  style?: string | undefined;
25
25
  discardEmptyString?: boolean | undefined;
26
+ initialValue?: string | undefined;
26
27
  maxLength?: string | undefined;
27
28
  hidden?: string | undefined;
28
29
  disabled?: string | undefined;
@@ -42,6 +43,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
42
43
  icon?: string | undefined;
43
44
  style?: string | undefined;
44
45
  discardEmptyString?: boolean | undefined;
46
+ initialValue?: string | undefined;
45
47
  maxLength?: string | undefined;
46
48
  hidden?: string | undefined;
47
49
  disabled?: string | undefined;
@@ -60,6 +62,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
60
62
  required?: boolean | undefined;
61
63
  icon?: string | undefined;
62
64
  style?: string | undefined;
65
+ initialValue?: string | undefined;
63
66
  min?: string | undefined;
64
67
  max?: string | undefined;
65
68
  step?: string | undefined;
@@ -84,6 +87,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
84
87
  required?: boolean | undefined;
85
88
  icon?: string | undefined;
86
89
  style?: string | undefined;
90
+ initialValue?: string | undefined;
87
91
  hidden?: string | undefined;
88
92
  disabled?: string | undefined;
89
93
  validation?: readonly Readonly<{
@@ -104,6 +108,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
104
108
  icon?: string | undefined;
105
109
  style?: string | undefined;
106
110
  display?: string | undefined;
111
+ initialValue?: string | undefined;
107
112
  disableDate?: string | undefined;
108
113
  hidden?: string | undefined;
109
114
  disabled?: string | undefined;
@@ -123,6 +128,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
123
128
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
124
129
  style?: string | undefined;
125
130
  }>) => any;
131
+ "initial-value-ready": () => any;
126
132
  }, string, import("vue").PublicProps, Readonly<{
127
133
  config?: Effect.Effect<FieldsConfig | undefined>;
128
134
  } & {
@@ -142,6 +148,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
142
148
  icon?: string | undefined;
143
149
  style?: string | undefined;
144
150
  discardEmptyString?: boolean | undefined;
151
+ initialValue?: string | undefined;
145
152
  maxLength?: string | undefined;
146
153
  hidden?: string | undefined;
147
154
  disabled?: string | undefined;
@@ -161,6 +168,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
161
168
  icon?: string | undefined;
162
169
  style?: string | undefined;
163
170
  discardEmptyString?: boolean | undefined;
171
+ initialValue?: string | undefined;
164
172
  maxLength?: string | undefined;
165
173
  hidden?: string | undefined;
166
174
  disabled?: string | undefined;
@@ -179,6 +187,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
179
187
  required?: boolean | undefined;
180
188
  icon?: string | undefined;
181
189
  style?: string | undefined;
190
+ initialValue?: string | undefined;
182
191
  min?: string | undefined;
183
192
  max?: string | undefined;
184
193
  step?: string | undefined;
@@ -203,6 +212,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
203
212
  required?: boolean | undefined;
204
213
  icon?: string | undefined;
205
214
  style?: string | undefined;
215
+ initialValue?: string | undefined;
206
216
  hidden?: string | undefined;
207
217
  disabled?: string | undefined;
208
218
  validation?: readonly Readonly<{
@@ -223,6 +233,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
223
233
  icon?: string | undefined;
224
234
  style?: string | undefined;
225
235
  display?: string | undefined;
236
+ initialValue?: string | undefined;
226
237
  disableDate?: string | undefined;
227
238
  hidden?: string | undefined;
228
239
  disabled?: string | undefined;
@@ -242,6 +253,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
242
253
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
243
254
  style?: string | undefined;
244
255
  }>) => any) | undefined;
256
+ "onInitial-value-ready"?: (() => any) | undefined;
245
257
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
246
258
  [x: string]: ((props: {
247
259
  style: import("vue").CSSProperties;
@@ -7,7 +7,7 @@ defineOptions({
7
7
  const props = defineProps({
8
8
  config: { type: null, required: false }
9
9
  });
10
- const emit = defineEmits(["update:config"]);
10
+ const emit = defineEmits(["update:config", "initial-value-ready"]);
11
11
  const modelValue = defineModel("modelValue", { type: Object, ...{
12
12
  default: () => ({})
13
13
  } });
@@ -18,6 +18,9 @@ const config = props.config ? props.config.pipe(Effect.map((config2) => config2
18
18
  function handleConfigUpdate(config2) {
19
19
  emit("update:config", config2);
20
20
  }
21
+ function handleInitialValueReady() {
22
+ emit("initial-value-ready");
23
+ }
21
24
  </script>
22
25
 
23
26
  <script>
@@ -39,6 +42,7 @@ export {
39
42
  v-model="modelValue"
40
43
  :config="config"
41
44
  @update:config="handleConfigUpdate"
45
+ @initial-value-ready="handleInitialValueReady"
42
46
  >
43
47
  <template
44
48
  v-for="(_, slotName) in $slots"
@@ -23,6 +23,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
23
23
  icon?: string | undefined;
24
24
  style?: string | undefined;
25
25
  discardEmptyString?: boolean | undefined;
26
+ initialValue?: string | undefined;
26
27
  maxLength?: string | undefined;
27
28
  hidden?: string | undefined;
28
29
  disabled?: string | undefined;
@@ -42,6 +43,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
42
43
  icon?: string | undefined;
43
44
  style?: string | undefined;
44
45
  discardEmptyString?: boolean | undefined;
46
+ initialValue?: string | undefined;
45
47
  maxLength?: string | undefined;
46
48
  hidden?: string | undefined;
47
49
  disabled?: string | undefined;
@@ -60,6 +62,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
60
62
  required?: boolean | undefined;
61
63
  icon?: string | undefined;
62
64
  style?: string | undefined;
65
+ initialValue?: string | undefined;
63
66
  min?: string | undefined;
64
67
  max?: string | undefined;
65
68
  step?: string | undefined;
@@ -84,6 +87,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
84
87
  required?: boolean | undefined;
85
88
  icon?: string | undefined;
86
89
  style?: string | undefined;
90
+ initialValue?: string | undefined;
87
91
  hidden?: string | undefined;
88
92
  disabled?: string | undefined;
89
93
  validation?: readonly Readonly<{
@@ -104,6 +108,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
104
108
  icon?: string | undefined;
105
109
  style?: string | undefined;
106
110
  display?: string | undefined;
111
+ initialValue?: string | undefined;
107
112
  disableDate?: string | undefined;
108
113
  hidden?: string | undefined;
109
114
  disabled?: string | undefined;
@@ -123,6 +128,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
123
128
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
124
129
  style?: string | undefined;
125
130
  }>) => any;
131
+ "initial-value-ready": () => any;
126
132
  }, string, import("vue").PublicProps, Readonly<{
127
133
  config?: Effect.Effect<FieldsConfig | undefined>;
128
134
  } & {
@@ -142,6 +148,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
142
148
  icon?: string | undefined;
143
149
  style?: string | undefined;
144
150
  discardEmptyString?: boolean | undefined;
151
+ initialValue?: string | undefined;
145
152
  maxLength?: string | undefined;
146
153
  hidden?: string | undefined;
147
154
  disabled?: string | undefined;
@@ -161,6 +168,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
161
168
  icon?: string | undefined;
162
169
  style?: string | undefined;
163
170
  discardEmptyString?: boolean | undefined;
171
+ initialValue?: string | undefined;
164
172
  maxLength?: string | undefined;
165
173
  hidden?: string | undefined;
166
174
  disabled?: string | undefined;
@@ -179,6 +187,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
179
187
  required?: boolean | undefined;
180
188
  icon?: string | undefined;
181
189
  style?: string | undefined;
190
+ initialValue?: string | undefined;
182
191
  min?: string | undefined;
183
192
  max?: string | undefined;
184
193
  step?: string | undefined;
@@ -203,6 +212,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
203
212
  required?: boolean | undefined;
204
213
  icon?: string | undefined;
205
214
  style?: string | undefined;
215
+ initialValue?: string | undefined;
206
216
  hidden?: string | undefined;
207
217
  disabled?: string | undefined;
208
218
  validation?: readonly Readonly<{
@@ -223,6 +233,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
223
233
  icon?: string | undefined;
224
234
  style?: string | undefined;
225
235
  display?: string | undefined;
236
+ initialValue?: string | undefined;
226
237
  disableDate?: string | undefined;
227
238
  hidden?: string | undefined;
228
239
  disabled?: string | undefined;
@@ -242,6 +253,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
242
253
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
243
254
  style?: string | undefined;
244
255
  }>) => any) | undefined;
256
+ "onInitial-value-ready"?: (() => any) | undefined;
245
257
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
246
258
  [x: string]: ((props: {
247
259
  style: import("vue").CSSProperties;
@@ -18,6 +18,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
18
18
  icon?: string | undefined;
19
19
  style?: string | undefined;
20
20
  discardEmptyString?: boolean | undefined;
21
+ initialValue?: string | undefined;
21
22
  maxLength?: string | undefined;
22
23
  hidden?: string | undefined;
23
24
  disabled?: string | undefined;
@@ -37,6 +38,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
37
38
  icon?: string | undefined;
38
39
  style?: string | undefined;
39
40
  discardEmptyString?: boolean | undefined;
41
+ initialValue?: string | undefined;
40
42
  maxLength?: string | undefined;
41
43
  hidden?: string | undefined;
42
44
  disabled?: string | undefined;
@@ -55,6 +57,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
55
57
  required?: boolean | undefined;
56
58
  icon?: string | undefined;
57
59
  style?: string | undefined;
60
+ initialValue?: string | undefined;
58
61
  min?: string | undefined;
59
62
  max?: string | undefined;
60
63
  step?: string | undefined;
@@ -79,6 +82,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
79
82
  required?: boolean | undefined;
80
83
  icon?: string | undefined;
81
84
  style?: string | undefined;
85
+ initialValue?: string | undefined;
82
86
  hidden?: string | undefined;
83
87
  disabled?: string | undefined;
84
88
  validation?: readonly Readonly<{
@@ -99,6 +103,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
99
103
  icon?: string | undefined;
100
104
  style?: string | undefined;
101
105
  display?: string | undefined;
106
+ initialValue?: string | undefined;
102
107
  disableDate?: string | undefined;
103
108
  hidden?: string | undefined;
104
109
  disabled?: string | undefined;
@@ -135,6 +140,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
135
140
  icon?: string | undefined;
136
141
  style?: string | undefined;
137
142
  discardEmptyString?: boolean | undefined;
143
+ initialValue?: string | undefined;
138
144
  maxLength?: string | undefined;
139
145
  hidden?: string | undefined;
140
146
  disabled?: string | undefined;
@@ -154,6 +160,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
154
160
  icon?: string | undefined;
155
161
  style?: string | undefined;
156
162
  discardEmptyString?: boolean | undefined;
163
+ initialValue?: string | undefined;
157
164
  maxLength?: string | undefined;
158
165
  hidden?: string | undefined;
159
166
  disabled?: string | undefined;
@@ -172,6 +179,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
172
179
  required?: boolean | undefined;
173
180
  icon?: string | undefined;
174
181
  style?: string | undefined;
182
+ initialValue?: string | undefined;
175
183
  min?: string | undefined;
176
184
  max?: string | undefined;
177
185
  step?: string | undefined;
@@ -196,6 +204,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
196
204
  required?: boolean | undefined;
197
205
  icon?: string | undefined;
198
206
  style?: string | undefined;
207
+ initialValue?: string | undefined;
199
208
  hidden?: string | undefined;
200
209
  disabled?: string | undefined;
201
210
  validation?: readonly Readonly<{
@@ -216,6 +225,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
216
225
  icon?: string | undefined;
217
226
  style?: string | undefined;
218
227
  display?: string | undefined;
228
+ initialValue?: string | undefined;
219
229
  disableDate?: string | undefined;
220
230
  hidden?: string | undefined;
221
231
  disabled?: string | undefined;
@@ -235,6 +245,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
235
245
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
236
246
  style?: string | undefined;
237
247
  }>) => any;
248
+ "initial-value-ready": () => any;
238
249
  }, string, import("vue").PublicProps, Readonly<{
239
250
  config: Effect.Effect<Readonly<{
240
251
  fields: readonly ({
@@ -249,6 +260,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
249
260
  icon?: string | undefined;
250
261
  style?: string | undefined;
251
262
  discardEmptyString?: boolean | undefined;
263
+ initialValue?: string | undefined;
252
264
  maxLength?: string | undefined;
253
265
  hidden?: string | undefined;
254
266
  disabled?: string | undefined;
@@ -268,6 +280,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
268
280
  icon?: string | undefined;
269
281
  style?: string | undefined;
270
282
  discardEmptyString?: boolean | undefined;
283
+ initialValue?: string | undefined;
271
284
  maxLength?: string | undefined;
272
285
  hidden?: string | undefined;
273
286
  disabled?: string | undefined;
@@ -286,6 +299,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
286
299
  required?: boolean | undefined;
287
300
  icon?: string | undefined;
288
301
  style?: string | undefined;
302
+ initialValue?: string | undefined;
289
303
  min?: string | undefined;
290
304
  max?: string | undefined;
291
305
  step?: string | undefined;
@@ -310,6 +324,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
310
324
  required?: boolean | undefined;
311
325
  icon?: string | undefined;
312
326
  style?: string | undefined;
327
+ initialValue?: string | undefined;
313
328
  hidden?: string | undefined;
314
329
  disabled?: string | undefined;
315
330
  validation?: readonly Readonly<{
@@ -330,6 +345,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
330
345
  icon?: string | undefined;
331
346
  style?: string | undefined;
332
347
  display?: string | undefined;
348
+ initialValue?: string | undefined;
333
349
  disableDate?: string | undefined;
334
350
  hidden?: string | undefined;
335
351
  disabled?: string | undefined;
@@ -366,6 +382,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
366
382
  icon?: string | undefined;
367
383
  style?: string | undefined;
368
384
  discardEmptyString?: boolean | undefined;
385
+ initialValue?: string | undefined;
369
386
  maxLength?: string | undefined;
370
387
  hidden?: string | undefined;
371
388
  disabled?: string | undefined;
@@ -385,6 +402,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
385
402
  icon?: string | undefined;
386
403
  style?: string | undefined;
387
404
  discardEmptyString?: boolean | undefined;
405
+ initialValue?: string | undefined;
388
406
  maxLength?: string | undefined;
389
407
  hidden?: string | undefined;
390
408
  disabled?: string | undefined;
@@ -403,6 +421,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
403
421
  required?: boolean | undefined;
404
422
  icon?: string | undefined;
405
423
  style?: string | undefined;
424
+ initialValue?: string | undefined;
406
425
  min?: string | undefined;
407
426
  max?: string | undefined;
408
427
  step?: string | undefined;
@@ -427,6 +446,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
427
446
  required?: boolean | undefined;
428
447
  icon?: string | undefined;
429
448
  style?: string | undefined;
449
+ initialValue?: string | undefined;
430
450
  hidden?: string | undefined;
431
451
  disabled?: string | undefined;
432
452
  validation?: readonly Readonly<{
@@ -447,6 +467,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
447
467
  icon?: string | undefined;
448
468
  style?: string | undefined;
449
469
  display?: string | undefined;
470
+ initialValue?: string | undefined;
450
471
  disableDate?: string | undefined;
451
472
  hidden?: string | undefined;
452
473
  disabled?: string | undefined;
@@ -466,6 +487,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
466
487
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
467
488
  style?: string | undefined;
468
489
  }>) => any) | undefined;
490
+ "onInitial-value-ready"?: (() => any) | undefined;
469
491
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
470
492
  [x: string]: ((props: {
471
493
  style: CSSProperties;
@@ -28,7 +28,7 @@ const defaultConfig = {
28
28
  const props = defineProps({
29
29
  config: { type: null, required: true }
30
30
  });
31
- const emit = defineEmits(["update:config"]);
31
+ const emit = defineEmits(["update:config", "initial-value-ready"]);
32
32
  const config = computedAsync(async () => FieldsConfigC.parse(await props.config.pipe(Effect.runPromise) ?? defaultConfig));
33
33
  const { t, locale } = useI18n();
34
34
  const { $dsl, $md } = useNuxtApp();
@@ -41,6 +41,8 @@ const displayConfig = ref(defaultConfig);
41
41
  const validationErrors = ref({});
42
42
  const calendarOpen = ref({});
43
43
  const selectOpen = ref({});
44
+ const hasInitializedFieldValues = ref(false);
45
+ const hasEmittedInitialValueReady = ref(false);
44
46
  function cloneConfig(config2) {
45
47
  const nextConfig = {
46
48
  fields: config2.fields.slice()
@@ -110,6 +112,19 @@ function isFieldDisabled(field) {
110
112
  function getFieldValue(field) {
111
113
  return getProperty(modelValue.value, field.path);
112
114
  }
115
+ function initializeFieldValues(config2) {
116
+ for (const field of config2.fields) {
117
+ if (isPassiveField(field) || !field.initialValue || hasProperty(modelValue.value, field.path)) {
118
+ continue;
119
+ }
120
+ const initialValue = $dsl.evaluate`${field.initialValue}`({ form: modelValue.value });
121
+ setProperty(
122
+ modelValue.value,
123
+ field.path,
124
+ field.type === "number" && typeof initialValue === "bigint" ? Number(initialValue) : initialValue
125
+ );
126
+ }
127
+ }
113
128
  function stringifySelectValue(value) {
114
129
  try {
115
130
  return JSON.stringify(value);
@@ -261,7 +276,15 @@ watch(config, (value) => {
261
276
  if (!value) {
262
277
  return;
263
278
  }
279
+ if (!hasInitializedFieldValues.value) {
280
+ initializeFieldValues(value);
281
+ hasInitializedFieldValues.value = true;
282
+ }
264
283
  displayConfig.value = cloneConfig(value);
284
+ if (!hasEmittedInitialValueReady.value) {
285
+ hasEmittedInitialValueReady.value = true;
286
+ emit("initial-value-ready");
287
+ }
265
288
  }, { immediate: true });
266
289
  watchEffect(() => {
267
290
  const activePaths = /* @__PURE__ */ new Set();
@@ -18,6 +18,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
18
18
  icon?: string | undefined;
19
19
  style?: string | undefined;
20
20
  discardEmptyString?: boolean | undefined;
21
+ initialValue?: string | undefined;
21
22
  maxLength?: string | undefined;
22
23
  hidden?: string | undefined;
23
24
  disabled?: string | undefined;
@@ -37,6 +38,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
37
38
  icon?: string | undefined;
38
39
  style?: string | undefined;
39
40
  discardEmptyString?: boolean | undefined;
41
+ initialValue?: string | undefined;
40
42
  maxLength?: string | undefined;
41
43
  hidden?: string | undefined;
42
44
  disabled?: string | undefined;
@@ -55,6 +57,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
55
57
  required?: boolean | undefined;
56
58
  icon?: string | undefined;
57
59
  style?: string | undefined;
60
+ initialValue?: string | undefined;
58
61
  min?: string | undefined;
59
62
  max?: string | undefined;
60
63
  step?: string | undefined;
@@ -79,6 +82,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
79
82
  required?: boolean | undefined;
80
83
  icon?: string | undefined;
81
84
  style?: string | undefined;
85
+ initialValue?: string | undefined;
82
86
  hidden?: string | undefined;
83
87
  disabled?: string | undefined;
84
88
  validation?: readonly Readonly<{
@@ -99,6 +103,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
99
103
  icon?: string | undefined;
100
104
  style?: string | undefined;
101
105
  display?: string | undefined;
106
+ initialValue?: string | undefined;
102
107
  disableDate?: string | undefined;
103
108
  hidden?: string | undefined;
104
109
  disabled?: string | undefined;
@@ -135,6 +140,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
135
140
  icon?: string | undefined;
136
141
  style?: string | undefined;
137
142
  discardEmptyString?: boolean | undefined;
143
+ initialValue?: string | undefined;
138
144
  maxLength?: string | undefined;
139
145
  hidden?: string | undefined;
140
146
  disabled?: string | undefined;
@@ -154,6 +160,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
154
160
  icon?: string | undefined;
155
161
  style?: string | undefined;
156
162
  discardEmptyString?: boolean | undefined;
163
+ initialValue?: string | undefined;
157
164
  maxLength?: string | undefined;
158
165
  hidden?: string | undefined;
159
166
  disabled?: string | undefined;
@@ -172,6 +179,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
172
179
  required?: boolean | undefined;
173
180
  icon?: string | undefined;
174
181
  style?: string | undefined;
182
+ initialValue?: string | undefined;
175
183
  min?: string | undefined;
176
184
  max?: string | undefined;
177
185
  step?: string | undefined;
@@ -196,6 +204,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
196
204
  required?: boolean | undefined;
197
205
  icon?: string | undefined;
198
206
  style?: string | undefined;
207
+ initialValue?: string | undefined;
199
208
  hidden?: string | undefined;
200
209
  disabled?: string | undefined;
201
210
  validation?: readonly Readonly<{
@@ -216,6 +225,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
216
225
  icon?: string | undefined;
217
226
  style?: string | undefined;
218
227
  display?: string | undefined;
228
+ initialValue?: string | undefined;
219
229
  disableDate?: string | undefined;
220
230
  hidden?: string | undefined;
221
231
  disabled?: string | undefined;
@@ -235,6 +245,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
235
245
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
236
246
  style?: string | undefined;
237
247
  }>) => any;
248
+ "initial-value-ready": () => any;
238
249
  }, string, import("vue").PublicProps, Readonly<{
239
250
  config: Effect.Effect<Readonly<{
240
251
  fields: readonly ({
@@ -249,6 +260,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
249
260
  icon?: string | undefined;
250
261
  style?: string | undefined;
251
262
  discardEmptyString?: boolean | undefined;
263
+ initialValue?: string | undefined;
252
264
  maxLength?: string | undefined;
253
265
  hidden?: string | undefined;
254
266
  disabled?: string | undefined;
@@ -268,6 +280,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
268
280
  icon?: string | undefined;
269
281
  style?: string | undefined;
270
282
  discardEmptyString?: boolean | undefined;
283
+ initialValue?: string | undefined;
271
284
  maxLength?: string | undefined;
272
285
  hidden?: string | undefined;
273
286
  disabled?: string | undefined;
@@ -286,6 +299,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
286
299
  required?: boolean | undefined;
287
300
  icon?: string | undefined;
288
301
  style?: string | undefined;
302
+ initialValue?: string | undefined;
289
303
  min?: string | undefined;
290
304
  max?: string | undefined;
291
305
  step?: string | undefined;
@@ -310,6 +324,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
310
324
  required?: boolean | undefined;
311
325
  icon?: string | undefined;
312
326
  style?: string | undefined;
327
+ initialValue?: string | undefined;
313
328
  hidden?: string | undefined;
314
329
  disabled?: string | undefined;
315
330
  validation?: readonly Readonly<{
@@ -330,6 +345,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
330
345
  icon?: string | undefined;
331
346
  style?: string | undefined;
332
347
  display?: string | undefined;
348
+ initialValue?: string | undefined;
333
349
  disableDate?: string | undefined;
334
350
  hidden?: string | undefined;
335
351
  disabled?: string | undefined;
@@ -366,6 +382,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
366
382
  icon?: string | undefined;
367
383
  style?: string | undefined;
368
384
  discardEmptyString?: boolean | undefined;
385
+ initialValue?: string | undefined;
369
386
  maxLength?: string | undefined;
370
387
  hidden?: string | undefined;
371
388
  disabled?: string | undefined;
@@ -385,6 +402,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
385
402
  icon?: string | undefined;
386
403
  style?: string | undefined;
387
404
  discardEmptyString?: boolean | undefined;
405
+ initialValue?: string | undefined;
388
406
  maxLength?: string | undefined;
389
407
  hidden?: string | undefined;
390
408
  disabled?: string | undefined;
@@ -403,6 +421,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
403
421
  required?: boolean | undefined;
404
422
  icon?: string | undefined;
405
423
  style?: string | undefined;
424
+ initialValue?: string | undefined;
406
425
  min?: string | undefined;
407
426
  max?: string | undefined;
408
427
  step?: string | undefined;
@@ -427,6 +446,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
427
446
  required?: boolean | undefined;
428
447
  icon?: string | undefined;
429
448
  style?: string | undefined;
449
+ initialValue?: string | undefined;
430
450
  hidden?: string | undefined;
431
451
  disabled?: string | undefined;
432
452
  validation?: readonly Readonly<{
@@ -447,6 +467,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
447
467
  icon?: string | undefined;
448
468
  style?: string | undefined;
449
469
  display?: string | undefined;
470
+ initialValue?: string | undefined;
450
471
  disableDate?: string | undefined;
451
472
  hidden?: string | undefined;
452
473
  disabled?: string | undefined;
@@ -466,6 +487,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
466
487
  orientation?: "vertical" | "horizontal" | "floating" | undefined;
467
488
  style?: string | undefined;
468
489
  }>) => any) | undefined;
490
+ "onInitial-value-ready"?: (() => any) | undefined;
469
491
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
470
492
  [x: string]: ((props: {
471
493
  style: CSSProperties;
@@ -24,6 +24,7 @@ export declare const StringFieldC: z.ZodObject<{
24
24
  icon: z.ZodOptional<z.ZodString>;
25
25
  style: z.ZodOptional<z.ZodString>;
26
26
  discardEmptyString: z.ZodOptional<z.ZodBoolean>;
27
+ initialValue: z.ZodOptional<z.ZodString>;
27
28
  maxLength: z.ZodOptional<z.ZodString>;
28
29
  hidden: z.ZodOptional<z.ZodString>;
29
30
  disabled: z.ZodOptional<z.ZodString>;
@@ -49,6 +50,7 @@ export declare const TextareaFieldC: z.ZodObject<{
49
50
  icon: z.ZodOptional<z.ZodString>;
50
51
  style: z.ZodOptional<z.ZodString>;
51
52
  discardEmptyString: z.ZodOptional<z.ZodBoolean>;
53
+ initialValue: z.ZodOptional<z.ZodString>;
52
54
  maxLength: z.ZodOptional<z.ZodString>;
53
55
  hidden: z.ZodOptional<z.ZodString>;
54
56
  disabled: z.ZodOptional<z.ZodString>;
@@ -73,6 +75,7 @@ export declare const NumberFieldC: z.ZodObject<{
73
75
  required: z.ZodOptional<z.ZodBoolean>;
74
76
  icon: z.ZodOptional<z.ZodString>;
75
77
  style: z.ZodOptional<z.ZodString>;
78
+ initialValue: z.ZodOptional<z.ZodString>;
76
79
  min: z.ZodOptional<z.ZodString>;
77
80
  max: z.ZodOptional<z.ZodString>;
78
81
  step: z.ZodOptional<z.ZodString>;
@@ -103,6 +106,7 @@ export declare const SelectFieldC: z.ZodObject<{
103
106
  value: z.ZodString;
104
107
  key: z.ZodString;
105
108
  style: z.ZodOptional<z.ZodString>;
109
+ initialValue: z.ZodOptional<z.ZodString>;
106
110
  hidden: z.ZodOptional<z.ZodString>;
107
111
  disabled: z.ZodOptional<z.ZodString>;
108
112
  validation: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
@@ -133,6 +137,7 @@ export declare const CalendarFieldC: z.ZodObject<{
133
137
  }>;
134
138
  display: z.ZodOptional<z.ZodString>;
135
139
  value: z.ZodString;
140
+ initialValue: z.ZodOptional<z.ZodString>;
136
141
  disableDate: z.ZodOptional<z.ZodString>;
137
142
  hidden: z.ZodOptional<z.ZodString>;
138
143
  disabled: z.ZodOptional<z.ZodString>;
@@ -168,6 +173,7 @@ export declare const FieldC: z.ZodDiscriminatedUnion<[z.ZodObject<{
168
173
  icon: z.ZodOptional<z.ZodString>;
169
174
  style: z.ZodOptional<z.ZodString>;
170
175
  discardEmptyString: z.ZodOptional<z.ZodBoolean>;
176
+ initialValue: z.ZodOptional<z.ZodString>;
171
177
  maxLength: z.ZodOptional<z.ZodString>;
172
178
  hidden: z.ZodOptional<z.ZodString>;
173
179
  disabled: z.ZodOptional<z.ZodString>;
@@ -192,6 +198,7 @@ export declare const FieldC: z.ZodDiscriminatedUnion<[z.ZodObject<{
192
198
  icon: z.ZodOptional<z.ZodString>;
193
199
  style: z.ZodOptional<z.ZodString>;
194
200
  discardEmptyString: z.ZodOptional<z.ZodBoolean>;
201
+ initialValue: z.ZodOptional<z.ZodString>;
195
202
  maxLength: z.ZodOptional<z.ZodString>;
196
203
  hidden: z.ZodOptional<z.ZodString>;
197
204
  disabled: z.ZodOptional<z.ZodString>;
@@ -215,6 +222,7 @@ export declare const FieldC: z.ZodDiscriminatedUnion<[z.ZodObject<{
215
222
  required: z.ZodOptional<z.ZodBoolean>;
216
223
  icon: z.ZodOptional<z.ZodString>;
217
224
  style: z.ZodOptional<z.ZodString>;
225
+ initialValue: z.ZodOptional<z.ZodString>;
218
226
  min: z.ZodOptional<z.ZodString>;
219
227
  max: z.ZodOptional<z.ZodString>;
220
228
  step: z.ZodOptional<z.ZodString>;
@@ -244,6 +252,7 @@ export declare const FieldC: z.ZodDiscriminatedUnion<[z.ZodObject<{
244
252
  value: z.ZodString;
245
253
  key: z.ZodString;
246
254
  style: z.ZodOptional<z.ZodString>;
255
+ initialValue: z.ZodOptional<z.ZodString>;
247
256
  hidden: z.ZodOptional<z.ZodString>;
248
257
  disabled: z.ZodOptional<z.ZodString>;
249
258
  validation: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
@@ -273,6 +282,7 @@ export declare const FieldC: z.ZodDiscriminatedUnion<[z.ZodObject<{
273
282
  }>;
274
283
  display: z.ZodOptional<z.ZodString>;
275
284
  value: z.ZodString;
285
+ initialValue: z.ZodOptional<z.ZodString>;
276
286
  disableDate: z.ZodOptional<z.ZodString>;
277
287
  hidden: z.ZodOptional<z.ZodString>;
278
288
  disabled: z.ZodOptional<z.ZodString>;
@@ -319,6 +329,7 @@ export declare const FieldsConfigC: z.ZodReadonly<z.ZodObject<{
319
329
  icon: z.ZodOptional<z.ZodString>;
320
330
  style: z.ZodOptional<z.ZodString>;
321
331
  discardEmptyString: z.ZodOptional<z.ZodBoolean>;
332
+ initialValue: z.ZodOptional<z.ZodString>;
322
333
  maxLength: z.ZodOptional<z.ZodString>;
323
334
  hidden: z.ZodOptional<z.ZodString>;
324
335
  disabled: z.ZodOptional<z.ZodString>;
@@ -343,6 +354,7 @@ export declare const FieldsConfigC: z.ZodReadonly<z.ZodObject<{
343
354
  icon: z.ZodOptional<z.ZodString>;
344
355
  style: z.ZodOptional<z.ZodString>;
345
356
  discardEmptyString: z.ZodOptional<z.ZodBoolean>;
357
+ initialValue: z.ZodOptional<z.ZodString>;
346
358
  maxLength: z.ZodOptional<z.ZodString>;
347
359
  hidden: z.ZodOptional<z.ZodString>;
348
360
  disabled: z.ZodOptional<z.ZodString>;
@@ -366,6 +378,7 @@ export declare const FieldsConfigC: z.ZodReadonly<z.ZodObject<{
366
378
  required: z.ZodOptional<z.ZodBoolean>;
367
379
  icon: z.ZodOptional<z.ZodString>;
368
380
  style: z.ZodOptional<z.ZodString>;
381
+ initialValue: z.ZodOptional<z.ZodString>;
369
382
  min: z.ZodOptional<z.ZodString>;
370
383
  max: z.ZodOptional<z.ZodString>;
371
384
  step: z.ZodOptional<z.ZodString>;
@@ -395,6 +408,7 @@ export declare const FieldsConfigC: z.ZodReadonly<z.ZodObject<{
395
408
  value: z.ZodString;
396
409
  key: z.ZodString;
397
410
  style: z.ZodOptional<z.ZodString>;
411
+ initialValue: z.ZodOptional<z.ZodString>;
398
412
  hidden: z.ZodOptional<z.ZodString>;
399
413
  disabled: z.ZodOptional<z.ZodString>;
400
414
  validation: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
@@ -424,6 +438,7 @@ export declare const FieldsConfigC: z.ZodReadonly<z.ZodObject<{
424
438
  }>;
425
439
  display: z.ZodOptional<z.ZodString>;
426
440
  value: z.ZodString;
441
+ initialValue: z.ZodOptional<z.ZodString>;
427
442
  disableDate: z.ZodOptional<z.ZodString>;
428
443
  hidden: z.ZodOptional<z.ZodString>;
429
444
  disabled: z.ZodOptional<z.ZodString>;
@@ -15,6 +15,7 @@ export const StringFieldC = z.object({
15
15
  icon: z.string().optional().describe("Iconify \u56FE\u6807\u6807\u8BC6\u7B26\uFF0C\u663E\u793A\u5728\u8F93\u5165\u6846\u5185\u4FA7"),
16
16
  style: z.string().optional().describe("CSS \u6837\u5F0F\u5BF9\u8C61\u8868\u8FBE\u5F0F\uFF0C\u63A7\u5236\u5B57\u6BB5\u7684\u5E03\u5C40\u4E0E\u5916\u89C2"),
17
17
  discardEmptyString: z.boolean().optional().describe("\u4E3A true \u65F6\uFF0C\u7A7A\u5B57\u7B26\u4E32\u4F5C\u4E3A\u6709\u6548\u503C\u5B58\u50A8\uFF1B\u5426\u5219\u6E05\u7A7A\u8F93\u5165\u5C06\u5220\u9664\u5BF9\u5E94\u5C5E\u6027"),
18
+ initialValue: expressionC("string", { form: "map<string, dyn>" }).optional().describe("\u8FD4\u56DE string \u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u5728\u5B57\u6BB5\u9996\u6B21\u521D\u59CB\u5316\u4E14 path \u4E0D\u5B58\u5728\u65F6\u5199\u5165\u521D\u59CB\u503C\uFF0C\u53EF\u4F7F\u7528 form \u53D8\u91CF"),
18
19
  maxLength: expressionC("int").optional().describe('\u8FD4\u56DE\u6574\u6570\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u9650\u5236\u8F93\u5165\u7684\u6700\u5927\u5B57\u7B26\u6570\uFF0C\u5982 "100"'),
19
20
  hidden: expressionC("bool", { form: "map<string, dyn>" }).optional().describe("\u4E3A true \u65F6\uFF0C\u9690\u85CF\u8FD9\u4E2A\u5B57\u6BB5"),
20
21
  disabled: expressionC("bool", { form: "map<string, dyn>" }).optional().describe("\u4E3A true \u65F6\uFF0C\u7981\u7528\u8FD9\u4E2A\u5B57\u6BB5"),
@@ -29,6 +30,7 @@ export const TextareaFieldC = z.object({
29
30
  icon: z.string().optional().describe("Iconify \u56FE\u6807\u6807\u8BC6\u7B26\uFF0C\u663E\u793A\u5728\u8F93\u5165\u6846\u5185\u4FA7"),
30
31
  style: z.string().optional().describe("CSS \u6837\u5F0F\u5BF9\u8C61\u8868\u8FBE\u5F0F\uFF0C\u63A7\u5236\u5B57\u6BB5\u7684\u5E03\u5C40\u4E0E\u5916\u89C2"),
31
32
  discardEmptyString: z.boolean().optional().describe("\u4E3A true \u65F6\uFF0C\u7A7A\u5B57\u7B26\u4E32\u4F5C\u4E3A\u6709\u6548\u503C\u5B58\u50A8\uFF1B\u5426\u5219\u6E05\u7A7A\u8F93\u5165\u5C06\u5220\u9664\u5BF9\u5E94\u5C5E\u6027"),
33
+ initialValue: expressionC("string", { form: "map<string, dyn>" }).optional().describe("\u8FD4\u56DE string \u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u5728\u5B57\u6BB5\u9996\u6B21\u521D\u59CB\u5316\u4E14 path \u4E0D\u5B58\u5728\u65F6\u5199\u5165\u521D\u59CB\u503C\uFF0C\u53EF\u4F7F\u7528 form \u53D8\u91CF"),
32
34
  maxLength: expressionC("int").optional().describe('\u8FD4\u56DE\u6574\u6570\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u9650\u5236\u8F93\u5165\u7684\u6700\u5927\u5B57\u7B26\u6570\uFF0C\u5982 "100"'),
33
35
  hidden: expressionC("bool", { form: "map<string, dyn>" }).optional().describe("\u4E3A true \u65F6\uFF0C\u9690\u85CF\u8FD9\u4E2A\u5B57\u6BB5"),
34
36
  disabled: expressionC("bool", { form: "map<string, dyn>" }).optional().describe("\u4E3A true \u65F6\uFF0C\u7981\u7528\u8FD9\u4E2A\u5B57\u6BB5"),
@@ -42,6 +44,7 @@ export const NumberFieldC = z.object({
42
44
  required: z.boolean().optional().describe("\u4E3A true \u65F6\uFF0C\u4EC5\u5728\u5B57\u6BB5\u6807\u7B7E\u540E\u663E\u793A\u5FC5\u586B\u63D0\u793A\u661F\u53F7\uFF0C\u4E0D\u5F71\u54CD\u5B9E\u9645\u6821\u9A8C\u903B\u8F91"),
43
45
  icon: z.string().optional().describe("Iconify \u56FE\u6807\u6807\u8BC6\u7B26\uFF0C\u663E\u793A\u5728\u8F93\u5165\u6846\u5185\u4FA7"),
44
46
  style: z.string().optional().describe("CSS \u6837\u5F0F\u5BF9\u8C61\u8868\u8FBE\u5F0F\uFF0C\u63A7\u5236\u5B57\u6BB5\u7684\u5E03\u5C40\u4E0E\u5916\u89C2"),
47
+ initialValue: expressionC(["int", "double"], { form: "map<string, dyn>" }).optional().describe("\u8FD4\u56DE number \u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u5728\u5B57\u6BB5\u9996\u6B21\u521D\u59CB\u5316\u4E14 path \u4E0D\u5B58\u5728\u65F6\u5199\u5165\u521D\u59CB\u503C\uFF0C\u53EF\u4F7F\u7528 form \u53D8\u91CF"),
45
48
  min: expressionC("double").optional().describe('\u8FD4\u56DE\u6D6E\u70B9\u6570\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u9650\u5236\u5141\u8BB8\u7684\u6700\u5C0F\u503C\uFF0C\u5982 "0.0"'),
46
49
  max: expressionC("double").optional().describe('\u8FD4\u56DE\u6D6E\u70B9\u6570\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u9650\u5236\u5141\u8BB8\u7684\u6700\u5927\u503C\uFF0C\u5982 "100.0"'),
47
50
  step: expressionC("double").optional().describe('\u8FD4\u56DE\u6D6E\u70B9\u6570\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u63A7\u5236\u6570\u503C\u9012\u589E\u6B65\u957F\uFF0C\u5982 "0.5"'),
@@ -61,6 +64,7 @@ export const SelectFieldC = z.object({
61
64
  value: expressionC(/.+/, { option: "dyn" }).describe("\u8FD4\u56DE\u4EFB\u610F\u503C\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u63D0\u4F9B option \u53D8\u91CF\uFF0C\u8FD4\u56DE\u503C\u5C06\u88AB\u5199\u5165\u7ED1\u5B9A\u5B57\u6BB5"),
62
65
  key: expressionC("string", { option: "dyn" }).describe("\u8FD4\u56DE\u5B57\u7B26\u4E32\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u63D0\u4F9B option \u53D8\u91CF\uFF0C\u8FD4\u56DE\u503C\u4E0E\u9009\u9879\u6784\u6210\u5168\u6620\u5C04"),
63
66
  style: z.string().optional().describe("CSS \u6837\u5F0F\u5BF9\u8C61\u8868\u8FBE\u5F0F\uFF0C\u63A7\u5236\u5B57\u6BB5\u7684\u5E03\u5C40\u4E0E\u5916\u89C2"),
67
+ initialValue: expressionC(/.+/, { form: "map<string, dyn>" }).optional().describe("\u8FD4\u56DE\u4EFB\u610F\u503C\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u5728\u5B57\u6BB5\u9996\u6B21\u521D\u59CB\u5316\u4E14 path \u4E0D\u5B58\u5728\u65F6\u5199\u5165\u521D\u59CB\u503C\uFF0C\u53EF\u4F7F\u7528 form \u53D8\u91CF"),
64
68
  hidden: expressionC("bool", { form: "map<string, dyn>" }).optional().describe("\u4E3A true \u65F6\uFF0C\u9690\u85CF\u8FD9\u4E2A\u5B57\u6BB5"),
65
69
  disabled: expressionC("bool", { form: "map<string, dyn>" }).optional().describe("\u4E3A true \u65F6\uFF0C\u7981\u7528\u8FD9\u4E2A\u5B57\u6BB5"),
66
70
  validation: validationC
@@ -76,6 +80,7 @@ export const CalendarFieldC = z.object({
76
80
  mode: z.enum(["year", "month", "date"]).describe("\u65E5\u5386\u9009\u62E9\u7CBE\u5EA6\uFF1Ayear \u4EC5\u9009\u5E74\uFF0Cmonth \u9009\u5E74\u6708\uFF0Cdate \u9009\u5E74\u6708\u65E5"),
77
81
  display: z.string().optional().describe('date-fns \u683C\u5F0F\u5B57\u7B26\u4E32\uFF0C\u63A7\u5236\u8F93\u5165\u6846\u4E2D\u7684\u5C55\u793A\u683C\u5F0F\uFF0C\u5982 "yyyy\u5E74MM\u6708dd\u65E5"\uFF1B\u7559\u7A7A\u5219\u663E\u793A\u539F\u59CB\u5B58\u50A8\u503C'),
78
82
  value: z.string().describe('date-fns \u683C\u5F0F\u5B57\u7B26\u4E32\uFF0C\u5B9A\u4E49\u65E5\u671F\u5728 model \u4E2D\u7684\u5B58\u50A8\u683C\u5F0F\uFF0C\u5982 "yyyy-MM-dd"'),
83
+ initialValue: expressionC("string", { form: "map<string, dyn>" }).optional().describe("\u8FD4\u56DE string \u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u5728\u5B57\u6BB5\u9996\u6B21\u521D\u59CB\u5316\u4E14 path \u4E0D\u5B58\u5728\u65F6\u5199\u5165\u521D\u59CB\u503C\uFF0C\u53EF\u4F7F\u7528 form \u53D8\u91CF"),
79
84
  disableDate: expressionC("bool", { date: "Date" }).optional().describe("\u8FD4\u56DE\u5E03\u5C14\u503C\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u4EE5 date\uFF08Date \u7C7B\u578B\uFF09\u4E3A\u53D8\u91CF\uFF0C\u8FD4\u56DE true \u65F6\u8BE5\u65E5\u671F\u5728\u65E5\u5386\u4E2D\u88AB\u7981\u7528"),
80
85
  hidden: expressionC("bool", { form: "map<string, dyn>" }).optional().describe("\u4E3A true \u65F6\uFF0C\u9690\u85CF\u8FD9\u4E2A\u5B57\u6BB5"),
81
86
  disabled: expressionC("bool", { form: "map<string, dyn>" }).optional().describe("\u4E3A true \u65F6\uFF0C\u7981\u7528\u8FD9\u4E2A\u5B57\u6BB5"),
@@ -21,6 +21,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
21
21
  icon?: string | undefined;
22
22
  style?: string | undefined;
23
23
  discardEmptyString?: boolean | undefined;
24
+ initialValue?: string | undefined;
24
25
  maxLength?: string | undefined;
25
26
  hidden?: string | undefined;
26
27
  disabled?: string | undefined;
@@ -40,6 +41,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
40
41
  icon?: string | undefined;
41
42
  style?: string | undefined;
42
43
  discardEmptyString?: boolean | undefined;
44
+ initialValue?: string | undefined;
43
45
  maxLength?: string | undefined;
44
46
  hidden?: string | undefined;
45
47
  disabled?: string | undefined;
@@ -58,6 +60,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
58
60
  required?: boolean | undefined;
59
61
  icon?: string | undefined;
60
62
  style?: string | undefined;
63
+ initialValue?: string | undefined;
61
64
  min?: string | undefined;
62
65
  max?: string | undefined;
63
66
  step?: string | undefined;
@@ -82,6 +85,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
82
85
  required?: boolean | undefined;
83
86
  icon?: string | undefined;
84
87
  style?: string | undefined;
88
+ initialValue?: string | undefined;
85
89
  hidden?: string | undefined;
86
90
  disabled?: string | undefined;
87
91
  validation?: readonly Readonly<{
@@ -102,6 +106,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
102
106
  icon?: string | undefined;
103
107
  style?: string | undefined;
104
108
  display?: string | undefined;
109
+ initialValue?: string | undefined;
105
110
  disableDate?: string | undefined;
106
111
  hidden?: string | undefined;
107
112
  disabled?: string | undefined;
@@ -136,6 +141,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
136
141
  icon?: string | undefined;
137
142
  style?: string | undefined;
138
143
  discardEmptyString?: boolean | undefined;
144
+ initialValue?: string | undefined;
139
145
  maxLength?: string | undefined;
140
146
  hidden?: string | undefined;
141
147
  disabled?: string | undefined;
@@ -155,6 +161,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
155
161
  icon?: string | undefined;
156
162
  style?: string | undefined;
157
163
  discardEmptyString?: boolean | undefined;
164
+ initialValue?: string | undefined;
158
165
  maxLength?: string | undefined;
159
166
  hidden?: string | undefined;
160
167
  disabled?: string | undefined;
@@ -173,6 +180,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
173
180
  required?: boolean | undefined;
174
181
  icon?: string | undefined;
175
182
  style?: string | undefined;
183
+ initialValue?: string | undefined;
176
184
  min?: string | undefined;
177
185
  max?: string | undefined;
178
186
  step?: string | undefined;
@@ -197,6 +205,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
197
205
  required?: boolean | undefined;
198
206
  icon?: string | undefined;
199
207
  style?: string | undefined;
208
+ initialValue?: string | undefined;
200
209
  hidden?: string | undefined;
201
210
  disabled?: string | undefined;
202
211
  validation?: readonly Readonly<{
@@ -217,6 +226,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
217
226
  icon?: string | undefined;
218
227
  style?: string | undefined;
219
228
  display?: string | undefined;
229
+ initialValue?: string | undefined;
220
230
  disableDate?: string | undefined;
221
231
  hidden?: string | undefined;
222
232
  disabled?: string | undefined;
@@ -219,6 +219,7 @@ function normalizeField(field) {
219
219
  required: field.required ? true : void 0,
220
220
  icon: normalizeOptionalString(field.icon ?? ""),
221
221
  style: normalizeOptionalString(field.style ?? ""),
222
+ initialValue: normalizeOptionalString(field.initialValue ?? ""),
222
223
  maxLength: normalizeOptionalString(field.maxLength ?? ""),
223
224
  hidden: normalizeOptionalString(field.hidden ?? ""),
224
225
  disabled: normalizeOptionalString(field.disabled ?? ""),
@@ -232,6 +233,7 @@ function normalizeField(field) {
232
233
  required: field.required ? true : void 0,
233
234
  icon: normalizeOptionalString(field.icon ?? ""),
234
235
  style: normalizeOptionalString(field.style ?? ""),
236
+ initialValue: normalizeOptionalString(field.initialValue ?? ""),
235
237
  min: normalizeOptionalString(field.min ?? ""),
236
238
  max: normalizeOptionalString(field.max ?? ""),
237
239
  step: normalizeOptionalString(field.step ?? ""),
@@ -250,6 +252,7 @@ function normalizeField(field) {
250
252
  label: field.label.trim(),
251
253
  value: field.value.trim(),
252
254
  key: field.key.trim(),
255
+ initialValue: normalizeOptionalString(field.initialValue ?? ""),
253
256
  hidden: normalizeOptionalString(field.hidden ?? ""),
254
257
  disabled: normalizeOptionalString(field.disabled ?? ""),
255
258
  validation: normalizeValidationRules(field.validation)
@@ -263,6 +266,7 @@ function normalizeField(field) {
263
266
  style: normalizeOptionalString(field.style ?? ""),
264
267
  display: normalizeOptionalString(field.display ?? ""),
265
268
  value: field.value.trim(),
269
+ initialValue: normalizeOptionalString(field.initialValue ?? ""),
266
270
  disableDate: normalizeOptionalString(field.disableDate ?? ""),
267
271
  hidden: normalizeOptionalString(field.hidden ?? ""),
268
272
  disabled: normalizeOptionalString(field.disabled ?? ""),
@@ -538,6 +542,17 @@ function updateSelectedFieldDisabled(value) {
538
542
  disabled: normalizeOptionalString(String(value))
539
543
  }));
540
544
  }
545
+ function updateSelectedFieldInitialValue(value) {
546
+ const selected = selectedField.value;
547
+ if (!selected || isPassiveField(selected.field)) {
548
+ return;
549
+ }
550
+ clearFieldError(selected.draftId, "initialValue");
551
+ updateDraftField(selected.draftId, (field) => isPassiveField(field) ? field : {
552
+ ...field,
553
+ initialValue: normalizeOptionalString(String(value))
554
+ });
555
+ }
541
556
  function updateSelectedFieldRequired(value) {
542
557
  const selected = selectedField.value;
543
558
  if (!selected || isPassiveField(selected.field)) {
@@ -1064,6 +1079,7 @@ function buildDslGuideMarkdown() {
1064
1079
  "",
1065
1080
  "### 2. \u5E38\u89C1\u5B57\u6BB5\u4E0E\u7528\u9014",
1066
1081
  '- `style` \u76F8\u5173\u5B57\u6BB5\u9700\u8981\u8FD4\u56DE style map\uFF0C\u4F8B\u5982 `{"display": "grid"}`\u3002',
1082
+ "- `initialValue` \u9700\u8981\u8FD4\u56DE\u5BF9\u5E94\u5B57\u6BB5\u6700\u7EC8\u5199\u5165 `path` \u7684\u503C\u3002",
1067
1083
  "- `hidden` / `disabled` / `disableDate` \u9700\u8981\u8FD4\u56DE `bool`\u3002",
1068
1084
  "- `validation[].expression` \u9700\u8981\u8FD4\u56DE `bool`\uFF1B\u8FD4\u56DE `false` \u65F6\u5C55\u793A\u5BF9\u5E94\u6D88\u606F\u3002",
1069
1085
  "- `select.options` \u901A\u5E38\u8FD4\u56DE\u5217\u8868\uFF1B`label` / `value` / `key` \u7528\u6765\u63CF\u8FF0\u5355\u4E2A\u9009\u9879\u5982\u4F55\u6620\u5C04\u3002",
@@ -1658,6 +1674,26 @@ function confirmChanges() {
1658
1674
  {{ validationErrors[getFieldErrorKey(selectedField.draftId, "disabled")] }}
1659
1675
  </p>
1660
1676
  </label>
1677
+
1678
+ <label class="flex flex-col gap-2 md:col-span-2">
1679
+ <span class="text-xs font-medium text-zinc-500">
1680
+ {{ t("field-initial-value") }}
1681
+ </span>
1682
+ <Textarea
1683
+ data-slot="fields-configurator-field-initial-value-input"
1684
+ :model-value="selectedField.field.initialValue ?? ''"
1685
+ :aria-invalid="validationErrors[getFieldErrorKey(selectedField.draftId, 'initialValue')] ? 'true' : void 0"
1686
+ :placeholder="t('field-initial-value-placeholder')"
1687
+ class="min-h-20 font-mono text-sm"
1688
+ @update:model-value="updateSelectedFieldInitialValue"
1689
+ />
1690
+ <p
1691
+ v-if="validationErrors[getFieldErrorKey(selectedField.draftId, 'initialValue')]"
1692
+ class="text-xs text-red-500"
1693
+ >
1694
+ {{ validationErrors[getFieldErrorKey(selectedField.draftId, "initialValue")] }}
1695
+ </p>
1696
+ </label>
1661
1697
  </section>
1662
1698
 
1663
1699
  <section
@@ -2165,6 +2201,8 @@ function confirmChanges() {
2165
2201
  "field-hidden-placeholder": "返回 true 时隐藏字段",
2166
2202
  "field-disabled": "禁用条件",
2167
2203
  "field-disabled-placeholder": "返回 true 时禁用字段",
2204
+ "field-initial-value": "初始值表达式",
2205
+ "field-initial-value-placeholder": "首次初始化且字段值不存在时写入的值",
2168
2206
  "field-discard-empty-string": "保留空字符串",
2169
2207
  "field-discard-empty-string-description": "开启后,清空输入时仍保存空字符串。",
2170
2208
  "field-max-length": "最大长度",
@@ -2266,6 +2304,8 @@ function confirmChanges() {
2266
2304
  "field-hidden-placeholder": "true を返すと非表示になります",
2267
2305
  "field-disabled": "無効化条件",
2268
2306
  "field-disabled-placeholder": "true を返すと無効になります",
2307
+ "field-initial-value": "初期値式",
2308
+ "field-initial-value-placeholder": "初回初期化時に値が無い場合だけ書き込みます",
2269
2309
  "field-discard-empty-string": "空文字列を保持",
2270
2310
  "field-discard-empty-string-description": "有効にすると、入力を空にしても空文字列を保存します。",
2271
2311
  "field-max-length": "最大長",
@@ -2367,6 +2407,8 @@ function confirmChanges() {
2367
2407
  "field-hidden-placeholder": "Return true to hide the field",
2368
2408
  "field-disabled": "Disabled expression",
2369
2409
  "field-disabled-placeholder": "Return true to disable the field",
2410
+ "field-initial-value": "Initial value expression",
2411
+ "field-initial-value-placeholder": "Written only during first initialization when the path is missing",
2370
2412
  "field-discard-empty-string": "Keep empty string",
2371
2413
  "field-discard-empty-string-description": "When enabled, clearing the input still stores an empty string.",
2372
2414
  "field-max-length": "Max length",
@@ -21,6 +21,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
21
21
  icon?: string | undefined;
22
22
  style?: string | undefined;
23
23
  discardEmptyString?: boolean | undefined;
24
+ initialValue?: string | undefined;
24
25
  maxLength?: string | undefined;
25
26
  hidden?: string | undefined;
26
27
  disabled?: string | undefined;
@@ -40,6 +41,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
40
41
  icon?: string | undefined;
41
42
  style?: string | undefined;
42
43
  discardEmptyString?: boolean | undefined;
44
+ initialValue?: string | undefined;
43
45
  maxLength?: string | undefined;
44
46
  hidden?: string | undefined;
45
47
  disabled?: string | undefined;
@@ -58,6 +60,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
58
60
  required?: boolean | undefined;
59
61
  icon?: string | undefined;
60
62
  style?: string | undefined;
63
+ initialValue?: string | undefined;
61
64
  min?: string | undefined;
62
65
  max?: string | undefined;
63
66
  step?: string | undefined;
@@ -82,6 +85,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
82
85
  required?: boolean | undefined;
83
86
  icon?: string | undefined;
84
87
  style?: string | undefined;
88
+ initialValue?: string | undefined;
85
89
  hidden?: string | undefined;
86
90
  disabled?: string | undefined;
87
91
  validation?: readonly Readonly<{
@@ -102,6 +106,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
102
106
  icon?: string | undefined;
103
107
  style?: string | undefined;
104
108
  display?: string | undefined;
109
+ initialValue?: string | undefined;
105
110
  disableDate?: string | undefined;
106
111
  hidden?: string | undefined;
107
112
  disabled?: string | undefined;
@@ -136,6 +141,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
136
141
  icon?: string | undefined;
137
142
  style?: string | undefined;
138
143
  discardEmptyString?: boolean | undefined;
144
+ initialValue?: string | undefined;
139
145
  maxLength?: string | undefined;
140
146
  hidden?: string | undefined;
141
147
  disabled?: string | undefined;
@@ -155,6 +161,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
155
161
  icon?: string | undefined;
156
162
  style?: string | undefined;
157
163
  discardEmptyString?: boolean | undefined;
164
+ initialValue?: string | undefined;
158
165
  maxLength?: string | undefined;
159
166
  hidden?: string | undefined;
160
167
  disabled?: string | undefined;
@@ -173,6 +180,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
173
180
  required?: boolean | undefined;
174
181
  icon?: string | undefined;
175
182
  style?: string | undefined;
183
+ initialValue?: string | undefined;
176
184
  min?: string | undefined;
177
185
  max?: string | undefined;
178
186
  step?: string | undefined;
@@ -197,6 +205,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
197
205
  required?: boolean | undefined;
198
206
  icon?: string | undefined;
199
207
  style?: string | undefined;
208
+ initialValue?: string | undefined;
200
209
  hidden?: string | undefined;
201
210
  disabled?: string | undefined;
202
211
  validation?: readonly Readonly<{
@@ -217,6 +226,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
217
226
  icon?: string | undefined;
218
227
  style?: string | undefined;
219
228
  display?: string | undefined;
229
+ initialValue?: string | undefined;
220
230
  disableDate?: string | undefined;
221
231
  hidden?: string | undefined;
222
232
  disabled?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/nuxt",
3
- "version": "0.10.7",
3
+ "version": "0.10.9",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "type": "module",