@shwfed/config 2.5.1 → 2.5.3

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 (50) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/preview/assets/{config-BsgSoDjY.js → config-BVjCjkAL.js} +1 -1
  3. package/dist/preview/assets/{config-nsiwkAq8.js → config-C5TWIUX-.js} +1 -1
  4. package/dist/preview/assets/{config-2hrRmW-I.js → config-CH28q4_H.js} +1 -1
  5. package/dist/preview/assets/{config-BfzthOw9.js → config-CtGduGcR.js} +1 -1
  6. package/dist/preview/assets/{config-DdgZWox9.js → config-D9tBv8LD.js} +1 -1
  7. package/dist/preview/assets/{config-CaLzEMyt.js → config-DN6k6pjm.js} +1 -1
  8. package/dist/preview/assets/{config-DKtPKn2s.js → config-DxB8qwAu.js} +1 -1
  9. package/dist/preview/assets/{config-h_LH1CT_.js → config-U359oLg8.js} +1 -1
  10. package/dist/preview/assets/{config-zxVo1EOM.js → config-ekMG8PO0.js} +1 -1
  11. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-CLpbGZ37.js → definition.vue_vue_type_script_setup_true_lang-I7unZVnH.js} +1 -1
  12. package/dist/preview/assets/{index-C5dK4QAf.js → index-CZ-XSjS_.js} +50 -50
  13. package/dist/preview/assets/index-HfGseg4M.js +1 -0
  14. package/dist/preview/assets/{runtime-CEXA5ttw.js → runtime-27bDIkKv.js} +1 -1
  15. package/dist/preview/assets/{runtime-DOLtY37Y.js → runtime-BAQ6ezPo.js} +1 -1
  16. package/dist/preview/assets/{runtime-DZqXButD.js → runtime-BKQvzSax.js} +1 -1
  17. package/dist/preview/assets/{runtime-MJo092Ed.js → runtime-BafXFP0s.js} +1 -1
  18. package/dist/preview/assets/{runtime-CZZWuLu9.js → runtime-CAzVJ-if.js} +1 -1
  19. package/dist/preview/assets/{runtime-BRWnAaFs.js → runtime-CQly-3c3.js} +1 -1
  20. package/dist/preview/assets/{runtime-527oKJb4.js → runtime-DJgDXKfE.js} +1 -1
  21. package/dist/preview/assets/{runtime-i3-6DCWP.js → runtime-Dhd51Wyr.js} +1 -1
  22. package/dist/preview/assets/{runtime-BLhH77F7.js → runtime-x8IdC454.js} +1 -1
  23. package/dist/preview/index.html +1 -1
  24. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +4 -4
  25. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +4 -4
  26. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +6 -6
  27. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +6 -6
  28. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
  29. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
  30. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +4 -4
  31. package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +4 -4
  32. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/config.vue +15 -9
  33. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/config.vue +19 -10
  34. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/config.vue +19 -8
  35. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/config.vue +20 -14
  36. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/config.vue +20 -11
  37. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.vue +37 -16
  38. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue +80 -34
  39. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.vue +48 -18
  40. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue +44 -17
  41. package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
  42. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
  43. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
  44. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
  45. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
  46. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
  47. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
  48. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
  49. package/package.json +1 -1
  50. package/dist/preview/assets/index-C0NJ1FZp.js +0 -1
@@ -56,12 +56,13 @@ const currentPreserveModeLabel = computed(
56
56
  () => PRESERVE_MODE_OPTIONS.find((o) => o.value === (value.value.preserveMode ?? "round"))?.label
57
57
  );
58
58
  function onPreserveDigitsChange(v) {
59
- value.value.preserveDigits = v;
59
+ const next = { ...value.value, preserveDigits: v };
60
60
  if (v === void 0) {
61
- value.value.preserveMode = void 0;
62
- } else if (value.value.preserveMode === void 0) {
63
- value.value.preserveMode = "round";
61
+ next.preserveMode = void 0;
62
+ } else if (next.preserveMode === void 0) {
63
+ next.preserveMode = "round";
64
64
  }
65
+ value.value = next;
65
66
  }
66
67
  </script>
67
68
 
@@ -82,7 +83,10 @@ function onPreserveDigitsChange(v) {
82
83
  </template>
83
84
  {{ fieldTitle("title") }}
84
85
  </FieldLabel>
85
- <Locale v-model="value.title" />
86
+ <Locale
87
+ :model-value="value.title"
88
+ @update:model-value="(v) => value = { ...value, title: v }"
89
+ />
86
90
  </Field>
87
91
  <Field orientation="vertical">
88
92
  <FieldLabel class="text-xs text-zinc-500">
@@ -99,8 +103,9 @@ function onPreserveDigitsChange(v) {
99
103
  {{ fieldTitle("tooltip") }}
100
104
  </FieldLabel>
101
105
  <Locale
102
- v-model="value.tooltip"
106
+ :model-value="value.tooltip"
103
107
  markdown
108
+ @update:model-value="(v) => value = { ...value, tooltip: v }"
104
109
  />
105
110
  </Field>
106
111
  </div>
@@ -120,9 +125,10 @@ function onPreserveDigitsChange(v) {
120
125
  {{ fieldTitle("accessor") }}
121
126
  </FieldLabel>
122
127
  <Input
123
- v-model="value.accessor"
128
+ :model-value="value.accessor"
124
129
  placeholder="如 row.salary"
125
130
  class="font-mono text-xs"
131
+ @update:model-value="(v) => value = { ...value, accessor: v }"
126
132
  />
127
133
  </Field>
128
134
  <Field orientation="vertical">
@@ -155,7 +161,7 @@ function onPreserveDigitsChange(v) {
155
161
  <DropdownMenuItem
156
162
  v-for="opt in ALIGN_OPTIONS"
157
163
  :key="opt.value"
158
- @select="value.align = opt.value"
164
+ @select="value = { ...value, align: opt.value }"
159
165
  >
160
166
  <Icon :icon="opt.icon" />
161
167
  {{ opt.label }}
@@ -167,13 +173,13 @@ function onPreserveDigitsChange(v) {
167
173
  :model-value="value.size"
168
174
  :disabled="value.grow"
169
175
  :min="0"
170
- @update:model-value="(v) => value.size = v"
176
+ @update:model-value="(v) => value = { ...value, size: v }"
171
177
  />
172
178
  <InputGroupAddon align="inline-end">
173
179
  <InputGroupButton
174
180
  :variant="value.grow ? 'primary' : 'ghost'"
175
181
  size="xs"
176
- @click="value.grow = !value.grow"
182
+ @click="value = { ...value, grow: !value.grow }"
177
183
  >
178
184
  <Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
179
185
  {{ fieldTitle("grow") }}
@@ -197,7 +203,7 @@ function onPreserveDigitsChange(v) {
197
203
  </FieldLabel>
198
204
  <Select
199
205
  :model-value="value.displayMode ?? 'plain'"
200
- @update:model-value="(v) => value.displayMode = v"
206
+ @update:model-value="(v) => value = { ...value, displayMode: v }"
201
207
  >
202
208
  <SelectTrigger class="w-full">
203
209
  <SelectValue />
@@ -254,7 +260,7 @@ function onPreserveDigitsChange(v) {
254
260
  <DropdownMenuItem
255
261
  v-for="opt in PRESERVE_MODE_OPTIONS"
256
262
  :key="opt.value"
257
- @select="value.preserveMode = opt.value"
263
+ @select="value = { ...value, preserveMode: opt.value }"
258
264
  >
259
265
  {{ opt.label }}
260
266
  </DropdownMenuItem>
@@ -287,13 +293,13 @@ function onPreserveDigitsChange(v) {
287
293
  <InputGroupInput
288
294
  :model-value="value.sortKey"
289
295
  placeholder="例:created_at"
290
- @update:model-value="(v) => value.sortKey = v || void 0"
296
+ @update:model-value="(v) => value = { ...value, sortKey: v || void 0 }"
291
297
  />
292
298
  <InputGroupAddon align="inline-end">
293
299
  <InputGroupButton
294
300
  :variant="value.enableSorting ? 'primary' : 'ghost'"
295
301
  size="xs"
296
- @click="value.enableSorting = !value.enableSorting"
302
+ @click="value = { ...value, enableSorting: !value.enableSorting }"
297
303
  >
298
304
  <Icon :icon="value.enableSorting ? 'fluent:arrow-sort-up-16-regular' : 'fluent:arrow-sort-16-regular'" />
299
305
  {{ fieldTitle("enableSorting") }}
@@ -50,8 +50,12 @@ const DISPLAY_MODE_OPTIONS = [
50
50
  const copyExpressionModel = computed({
51
51
  get: () => value.value.copyExpression ?? "",
52
52
  set: (v) => {
53
- if (v === "") delete value.value.copyExpression;
54
- else value.value.copyExpression = v;
53
+ if (v === "") {
54
+ const { copyExpression: _drop, ...rest } = value.value;
55
+ value.value = rest;
56
+ } else {
57
+ value.value = { ...value.value, copyExpression: v };
58
+ }
55
59
  }
56
60
  });
57
61
  </script>
@@ -73,7 +77,10 @@ const copyExpressionModel = computed({
73
77
  </template>
74
78
  {{ fieldTitle("title") }}
75
79
  </FieldLabel>
76
- <Locale v-model="value.title" />
80
+ <Locale
81
+ :model-value="value.title"
82
+ @update:model-value="(v) => value = { ...value, title: v }"
83
+ />
77
84
  </Field>
78
85
  <Field orientation="vertical">
79
86
  <FieldLabel class="text-xs text-zinc-500">
@@ -90,8 +97,9 @@ const copyExpressionModel = computed({
90
97
  {{ fieldTitle("tooltip") }}
91
98
  </FieldLabel>
92
99
  <Locale
93
- v-model="value.tooltip"
100
+ :model-value="value.tooltip"
94
101
  markdown
102
+ @update:model-value="(v) => value = { ...value, tooltip: v }"
95
103
  />
96
104
  </Field>
97
105
  </div>
@@ -111,9 +119,10 @@ const copyExpressionModel = computed({
111
119
  {{ fieldTitle("accessor") }}
112
120
  </FieldLabel>
113
121
  <Input
114
- v-model="value.accessor"
122
+ :model-value="value.accessor"
115
123
  placeholder="如 row.user.name"
116
124
  class="font-mono text-xs"
125
+ @update:model-value="(v) => value = { ...value, accessor: v }"
117
126
  />
118
127
  </Field>
119
128
  <Field orientation="vertical">
@@ -146,7 +155,7 @@ const copyExpressionModel = computed({
146
155
  <DropdownMenuItem
147
156
  v-for="opt in ALIGN_OPTIONS"
148
157
  :key="opt.value"
149
- @select="value.align = opt.value"
158
+ @select="value = { ...value, align: opt.value }"
150
159
  >
151
160
  <Icon :icon="opt.icon" />
152
161
  {{ opt.label }}
@@ -158,13 +167,13 @@ const copyExpressionModel = computed({
158
167
  :model-value="value.size"
159
168
  :disabled="value.grow"
160
169
  :min="0"
161
- @update:model-value="(v) => value.size = v"
170
+ @update:model-value="(v) => value = { ...value, size: v }"
162
171
  />
163
172
  <InputGroupAddon align="inline-end">
164
173
  <InputGroupButton
165
174
  :variant="value.grow ? 'primary' : 'ghost'"
166
175
  size="xs"
167
- @click="value.grow = !value.grow"
176
+ @click="value = { ...value, grow: !value.grow }"
168
177
  >
169
178
  <Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
170
179
  {{ fieldTitle("grow") }}
@@ -209,7 +218,7 @@ const copyExpressionModel = computed({
209
218
  </FieldLabel>
210
219
  <Select
211
220
  :model-value="value.displayMode ?? 'plain'"
212
- @update:model-value="(v) => value.displayMode = v"
221
+ @update:model-value="(v) => value = { ...value, displayMode: v }"
213
222
  >
214
223
  <SelectTrigger class="w-full">
215
224
  <SelectValue />
@@ -249,13 +258,13 @@ const copyExpressionModel = computed({
249
258
  <InputGroupInput
250
259
  :model-value="value.sortKey"
251
260
  placeholder="例:created_at"
252
- @update:model-value="(v) => value.sortKey = v || void 0"
261
+ @update:model-value="(v) => value = { ...value, sortKey: v || void 0 }"
253
262
  />
254
263
  <InputGroupAddon align="inline-end">
255
264
  <InputGroupButton
256
265
  :variant="value.enableSorting ? 'primary' : 'ghost'"
257
266
  size="xs"
258
- @click="value.enableSorting = !value.enableSorting"
267
+ @click="value = { ...value, enableSorting: !value.enableSorting }"
259
268
  >
260
269
  <Icon :icon="value.enableSorting ? 'fluent:arrow-sort-up-16-regular' : 'fluent:arrow-sort-16-regular'" />
261
270
  {{ fieldTitle("enableSorting") }}
@@ -50,28 +50,44 @@ const JSON_VARS = {
50
50
  const disabledModel = computed({
51
51
  get: () => value.value.disabled ?? "",
52
52
  set: (v) => {
53
- if (v === "") delete value.value.disabled;
54
- else value.value.disabled = v;
53
+ if (v === "") {
54
+ const { disabled: _drop, ...rest } = value.value;
55
+ value.value = rest;
56
+ } else {
57
+ value.value = { ...value.value, disabled: v };
58
+ }
55
59
  }
56
60
  });
57
61
  const onChangeModel = computed({
58
62
  get: () => value.value.onChange ?? "",
59
63
  set: (v) => {
60
- if (v === "") delete value.value.onChange;
61
- else value.value.onChange = v;
64
+ if (v === "") {
65
+ const { onChange: _drop, ...rest } = value.value;
66
+ value.value = rest;
67
+ } else {
68
+ value.value = { ...value.value, onChange: v };
69
+ }
62
70
  }
63
71
  });
64
72
  const successMessageModel = computed({
65
73
  get: () => value.value.successMessage ?? "",
66
74
  set: (v) => {
67
- if (v === "") delete value.value.successMessage;
68
- else value.value.successMessage = v;
75
+ if (v === "") {
76
+ const { successMessage: _drop, ...rest } = value.value;
77
+ value.value = rest;
78
+ } else {
79
+ value.value = { ...value.value, successMessage: v };
80
+ }
69
81
  }
70
82
  });
71
83
  const triggers = computed(() => value.value.triggers ?? []);
72
84
  function updateTriggers(next) {
73
- if (next.length === 0) delete value.value.triggers;
74
- else value.value.triggers = next;
85
+ if (next.length === 0) {
86
+ const { triggers: _drop, ...rest } = value.value;
87
+ value.value = rest;
88
+ } else {
89
+ value.value = { ...value.value, triggers: next };
90
+ }
75
91
  }
76
92
  </script>
77
93
 
@@ -92,7 +108,10 @@ function updateTriggers(next) {
92
108
  </template>
93
109
  {{ fieldTitle("title") }}
94
110
  </FieldLabel>
95
- <Locale v-model="value.title" />
111
+ <Locale
112
+ :model-value="value.title"
113
+ @update:model-value="(v) => value = { ...value, title: v }"
114
+ />
96
115
  </Field>
97
116
  <Field orientation="vertical">
98
117
  <FieldLabel class="text-xs text-zinc-500">
@@ -109,8 +128,9 @@ function updateTriggers(next) {
109
128
  {{ fieldTitle("tooltip") }}
110
129
  </FieldLabel>
111
130
  <Locale
112
- v-model="value.tooltip"
131
+ :model-value="value.tooltip"
113
132
  markdown
133
+ @update:model-value="(v) => value = { ...value, tooltip: v }"
114
134
  />
115
135
  </Field>
116
136
  </div>
@@ -130,10 +150,11 @@ function updateTriggers(next) {
130
150
  {{ fieldTitle("accessor") }}
131
151
  </FieldLabel>
132
152
  <ExpressionEditor
133
- v-model="value.accessor"
153
+ :model-value="value.accessor"
134
154
  placeholder="如 row.enabled"
135
155
  result-type="bool"
136
156
  :extra-vars="ROW_VARS"
157
+ @update:model-value="(v) => value = { ...value, accessor: v }"
137
158
  />
138
159
  </Field>
139
160
  <Field orientation="vertical">
@@ -166,7 +187,7 @@ function updateTriggers(next) {
166
187
  <DropdownMenuItem
167
188
  v-for="opt in ALIGN_OPTIONS"
168
189
  :key="opt.value"
169
- @select="value.align = opt.value"
190
+ @select="value = { ...value, align: opt.value }"
170
191
  >
171
192
  <Icon :icon="opt.icon" />
172
193
  {{ opt.label }}
@@ -178,13 +199,13 @@ function updateTriggers(next) {
178
199
  :model-value="value.size"
179
200
  :disabled="value.grow"
180
201
  :min="0"
181
- @update:model-value="(v) => value.size = v"
202
+ @update:model-value="(v) => value = { ...value, size: v }"
182
203
  />
183
204
  <InputGroupAddon align="inline-end">
184
205
  <InputGroupButton
185
206
  :variant="value.grow ? 'primary' : 'ghost'"
186
207
  size="xs"
187
- @click="value.grow = !value.grow"
208
+ @click="value = { ...value, grow: !value.grow }"
188
209
  >
189
210
  <Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
190
211
  {{ fieldTitle("grow") }}
@@ -299,13 +320,13 @@ function updateTriggers(next) {
299
320
  <InputGroupInput
300
321
  :model-value="value.sortKey"
301
322
  placeholder="例:created_at"
302
- @update:model-value="(v) => value.sortKey = v || void 0"
323
+ @update:model-value="(v) => value = { ...value, sortKey: v || void 0 }"
303
324
  />
304
325
  <InputGroupAddon align="inline-end">
305
326
  <InputGroupButton
306
327
  :variant="value.enableSorting ? 'primary' : 'ghost'"
307
328
  size="xs"
308
- @click="value.enableSorting = !value.enableSorting"
329
+ @click="value = { ...value, enableSorting: !value.enableSorting }"
309
330
  >
310
331
  <Icon :icon="value.enableSorting ? 'fluent:arrow-sort-up-16-regular' : 'fluent:arrow-sort-16-regular'" />
311
332
  {{ fieldTitle("enableSorting") }}
@@ -42,36 +42,56 @@ const bindingText = computed({
42
42
  get: () => value.value.binding ?? "",
43
43
  set: (v) => {
44
44
  const trimmed = v.trim();
45
- if (trimmed === "") delete value.value.binding;
46
- else value.value.binding = trimmed;
45
+ if (trimmed === "") {
46
+ const { binding: _drop, ...rest } = value.value;
47
+ value.value = rest;
48
+ } else {
49
+ value.value = { ...value.value, binding: trimmed };
50
+ }
47
51
  }
48
52
  });
49
53
  const hiddenModel = computed({
50
54
  get: () => value.value.hidden ?? "",
51
55
  set: (v) => {
52
- if (v === "") delete value.value.hidden;
53
- else value.value.hidden = v;
56
+ if (v === "") {
57
+ const { hidden: _drop, ...rest } = value.value;
58
+ value.value = rest;
59
+ } else {
60
+ value.value = { ...value.value, hidden: v };
61
+ }
54
62
  }
55
63
  });
56
64
  const disabledModel = computed({
57
65
  get: () => value.value.disabled ?? "",
58
66
  set: (v) => {
59
- if (v === "") delete value.value.disabled;
60
- else value.value.disabled = v;
67
+ if (v === "") {
68
+ const { disabled: _drop, ...rest } = value.value;
69
+ value.value = rest;
70
+ } else {
71
+ value.value = { ...value.value, disabled: v };
72
+ }
61
73
  }
62
74
  });
63
75
  const readonlyModel = computed({
64
76
  get: () => value.value.readonly ?? "",
65
77
  set: (v) => {
66
- if (v === "") delete value.value.readonly;
67
- else value.value.readonly = v;
78
+ if (v === "") {
79
+ const { readonly: _drop, ...rest } = value.value;
80
+ value.value = rest;
81
+ } else {
82
+ value.value = { ...value.value, readonly: v };
83
+ }
68
84
  }
69
85
  });
70
86
  const derivedModel = computed({
71
87
  get: () => value.value.derived,
72
88
  set: (v) => {
73
- if (v == null) delete value.value.derived;
74
- else value.value.derived = v;
89
+ if (v == null) {
90
+ const { derived: _drop, ...rest } = value.value;
91
+ value.value = rest;
92
+ } else {
93
+ value.value = { ...value.value, derived: v };
94
+ }
75
95
  }
76
96
  });
77
97
  const currentRoundingModeLabel = computed(
@@ -79,23 +99,48 @@ const currentRoundingModeLabel = computed(
79
99
  );
80
100
  function onPrecisionChange(v) {
81
101
  if (v === void 0) {
82
- delete value.value.precision;
83
- delete value.value.roundingMode;
102
+ const { precision: _p, roundingMode: _r, ...rest } = value.value;
103
+ value.value = rest;
104
+ } else if (value.value.roundingMode === void 0) {
105
+ value.value = { ...value.value, precision: v, roundingMode: "round" };
84
106
  } else {
85
- value.value.precision = v;
86
- if (value.value.roundingMode === void 0) value.value.roundingMode = "round";
107
+ value.value = { ...value.value, precision: v };
87
108
  }
88
109
  }
89
110
  function onRoundingModeChange(mode) {
90
- value.value.roundingMode = mode;
111
+ value.value = { ...value.value, roundingMode: mode };
91
112
  }
92
113
  function onStepChange(v) {
93
- if (v === void 0 || !(v > 0)) delete value.value.step;
94
- else value.value.step = v;
114
+ if (v === void 0 || !(v > 0)) {
115
+ const { step: _drop, ...rest } = value.value;
116
+ value.value = rest;
117
+ } else {
118
+ value.value = { ...value.value, step: v };
119
+ }
95
120
  }
96
121
  function onValueAsStringChange(next) {
97
- if (next) value.value.valueAsString = true;
98
- else delete value.value.valueAsString;
122
+ if (next) {
123
+ value.value = { ...value.value, valueAsString: true };
124
+ } else {
125
+ const { valueAsString: _drop, ...rest } = value.value;
126
+ value.value = rest;
127
+ }
128
+ }
129
+ function onMinChange(v) {
130
+ if (v.length > 0) {
131
+ value.value = { ...value.value, min: v };
132
+ } else {
133
+ const { min: _drop, ...rest } = value.value;
134
+ value.value = rest;
135
+ }
136
+ }
137
+ function onMaxChange(v) {
138
+ if (v.length > 0) {
139
+ value.value = { ...value.value, max: v };
140
+ } else {
141
+ const { max: _drop, ...rest } = value.value;
142
+ value.value = rest;
143
+ }
99
144
  }
100
145
  </script>
101
146
 
@@ -116,7 +161,10 @@ function onValueAsStringChange(next) {
116
161
  </template>
117
162
  {{ fieldTitle("title") }}
118
163
  </FieldLabel>
119
- <Locale v-model="value.title" />
164
+ <Locale
165
+ :model-value="value.title"
166
+ @update:model-value="(v) => value = { ...value, title: v }"
167
+ />
120
168
  </Field>
121
169
  <Field orientation="vertical">
122
170
  <FieldLabel class="text-xs text-zinc-500">
@@ -133,8 +181,9 @@ function onValueAsStringChange(next) {
133
181
  {{ fieldTitle("tooltip") }}
134
182
  </FieldLabel>
135
183
  <Locale
136
- v-model="value.tooltip"
184
+ :model-value="value.tooltip"
137
185
  markdown
186
+ @update:model-value="(v) => value = { ...value, tooltip: v }"
138
187
  />
139
188
  </Field>
140
189
  </div>
@@ -175,7 +224,10 @@ function onValueAsStringChange(next) {
175
224
  </template>
176
225
  {{ fieldTitle("placeholder") }}
177
226
  </FieldLabel>
178
- <Locale v-model="value.placeholder" />
227
+ <Locale
228
+ :model-value="value.placeholder"
229
+ @update:model-value="(v) => value = { ...value, placeholder: v }"
230
+ />
179
231
  </Field>
180
232
  <Field orientation="vertical">
181
233
  <FieldLabel class="text-xs text-zinc-500">
@@ -196,13 +248,13 @@ function onValueAsStringChange(next) {
196
248
  :model-value="value.size"
197
249
  :disabled="value.grow"
198
250
  :min="0"
199
- @update:model-value="(v) => value.size = v"
251
+ @update:model-value="(v) => value = { ...value, size: v }"
200
252
  />
201
253
  <InputGroupAddon align="inline-end">
202
254
  <InputGroupButton
203
255
  :variant="value.grow ? 'primary' : 'ghost'"
204
256
  size="xs"
205
- @click="value.grow = !value.grow"
257
+ @click="value = { ...value, grow: !value.grow }"
206
258
  >
207
259
  <Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
208
260
  {{ fieldTitle("grow") }}
@@ -325,10 +377,7 @@ function onValueAsStringChange(next) {
325
377
  result-type="number"
326
378
  class="min-h-10"
327
379
  :extra-vars="ROW_VARS"
328
- @update:model-value="(v) => {
329
- if (v.length > 0) value.min = v;
330
- else delete value.min;
331
- }"
380
+ @update:model-value="onMinChange"
332
381
  />
333
382
  </Field>
334
383
  <Field orientation="vertical">
@@ -351,10 +400,7 @@ function onValueAsStringChange(next) {
351
400
  result-type="number"
352
401
  class="min-h-10"
353
402
  :extra-vars="ROW_VARS"
354
- @update:model-value="(v) => {
355
- if (v.length > 0) value.max = v;
356
- else delete value.max;
357
- }"
403
+ @update:model-value="onMaxChange"
358
404
  />
359
405
  </Field>
360
406
  </div>
@@ -469,13 +515,13 @@ function onValueAsStringChange(next) {
469
515
  <InputGroupInput
470
516
  :model-value="value.sortKey"
471
517
  placeholder="例:created_at"
472
- @update:model-value="(v) => value.sortKey = v || void 0"
518
+ @update:model-value="(v) => value = { ...value, sortKey: v || void 0 }"
473
519
  />
474
520
  <InputGroupAddon align="inline-end">
475
521
  <InputGroupButton
476
522
  :variant="value.enableSorting ? 'primary' : 'ghost'"
477
523
  size="xs"
478
- @click="value.enableSorting = !value.enableSorting"
524
+ @click="value = { ...value, enableSorting: !value.enableSorting }"
479
525
  >
480
526
  <Icon :icon="value.enableSorting ? 'fluent:arrow-sort-up-16-regular' : 'fluent:arrow-sort-16-regular'" />
481
527
  {{ fieldTitle("enableSorting") }}