@shwfed/config 2.3.18 → 2.3.19

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 (64) hide show
  1. package/dist/mcp.mjs +964 -587
  2. package/dist/module.json +1 -1
  3. package/dist/preview/assets/{config-eopfzGON.js → config-B8qIrXw4.js} +1 -1
  4. package/dist/preview/assets/{config-qmkDiyXK.js → config-BERbwRqR.js} +1 -1
  5. package/dist/preview/assets/{config-CR-ypZys.js → config-BQDXm2N4.js} +1 -1
  6. package/dist/preview/assets/{config-DRy0SpMq.js → config-BZrnB31E.js} +1 -1
  7. package/dist/preview/assets/{config-C8Y4mJbo.js → config-BfiDa6j3.js} +1 -1
  8. package/dist/preview/assets/{config-CGjY6-4G.js → config-BmzbCaL9.js} +1 -1
  9. package/dist/preview/assets/config-CI4d63Pa.js +1 -0
  10. package/dist/preview/assets/{config-Cs3k3BuR.js → config-CrffMahT.js} +1 -1
  11. package/dist/preview/assets/{config-D9mrL0UY.js → config-RIqYuUkC.js} +1 -1
  12. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-BakGkJ_w.js → definition.vue_vue_type_script_setup_true_lang-DP6_YUR7.js} +1 -1
  13. package/dist/preview/assets/index-CT6yD2gM.js +1 -0
  14. package/dist/preview/assets/{index-BUyz4nJb.css → index-DomLsyPH.css} +1 -1
  15. package/dist/preview/assets/index-X6To2gmZ.js +643 -0
  16. package/dist/preview/assets/{runtime-C2q2Mp8_.js → runtime-BQsuM5NY.js} +1 -1
  17. package/dist/preview/assets/{runtime-B1Lqn7iS.js → runtime-CKWbV48T.js} +1 -1
  18. package/dist/preview/assets/{runtime-DQcKN5I_.js → runtime-CQPoA4Wr.js} +1 -1
  19. package/dist/preview/assets/runtime-CpsOFZJU.js +1 -0
  20. package/dist/preview/assets/{runtime-BvJjQaAU.js → runtime-DLe-_bzP.js} +1 -1
  21. package/dist/preview/assets/runtime-DY65pO8M.js +1 -0
  22. package/dist/preview/assets/runtime-DyCSllvl.js +1 -0
  23. package/dist/preview/assets/runtime-ZprvETkX.js +1 -0
  24. package/dist/preview/assets/runtime-pkc99x6z.js +1 -0
  25. package/dist/preview/index.html +2 -2
  26. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.d.vue.ts +27 -0
  27. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.vue +68 -0
  28. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/config.vue.d.ts +27 -0
  29. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/runtime.d.vue.ts +8 -0
  30. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/runtime.vue +52 -0
  31. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/runtime.vue.d.ts +8 -0
  32. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.d.ts +18 -0
  33. package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/schema.js +35 -0
  34. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +109 -0
  35. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue +426 -0
  36. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +109 -0
  37. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.d.vue.ts +9 -0
  38. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.vue +337 -0
  39. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.vue.d.ts +9 -0
  40. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +85 -0
  41. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.js +146 -0
  42. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +137 -0
  43. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue +586 -0
  44. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +137 -0
  45. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/runtime.d.vue.ts +9 -0
  46. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/runtime.vue +268 -0
  47. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/runtime.vue.d.ts +9 -0
  48. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +126 -0
  49. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.js +124 -0
  50. package/dist/runtime/components/table/config.vue +3 -0
  51. package/dist/runtime/components/table/index.vue +2 -0
  52. package/dist/runtime/components/table/utils/shared-fetch.d.ts +30 -0
  53. package/dist/runtime/components/table/utils/shared-fetch.js +42 -0
  54. package/dist/runtime/components/ui/calendar/Calendar.vue +9 -4
  55. package/dist/runtime/components/ui/date-range-picker/DateRangePickerMonthPanel.vue +4 -1
  56. package/dist/runtime/components/ui/date-range-picker/DateRangePickerYearPanel.vue +4 -1
  57. package/dist/runtime/components/ui/range-calendar/RangeCalendar.vue +3 -1
  58. package/package.json +1 -1
  59. package/dist/preview/assets/index-Bsbk3Okp.js +0 -1
  60. package/dist/preview/assets/index-Dz_SnGc9.js +0 -639
  61. package/dist/preview/assets/runtime-C-3DIGFz.js +0 -1
  62. package/dist/preview/assets/runtime-CdELhC3y.js +0 -1
  63. package/dist/preview/assets/runtime-D8OAMic8.js +0 -1
  64. package/dist/preview/assets/runtime-DQvlwOZl.js +0 -1
@@ -0,0 +1,586 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import { Icon } from "@iconify/vue";
4
+ import { Button } from "../../../../ui/button";
5
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../../../ui/dropdown-menu";
6
+ import { ExpressionEditor } from "../../../../ui/expression-editor";
7
+ import { Switch } from "../../../../ui/switch";
8
+ import { Separator } from "../../../../ui/separator";
9
+ import { Field, FieldLabel } from "../../../../ui/field";
10
+ import { Locale } from "../../../../ui/locale";
11
+ import {
12
+ InputGroup,
13
+ InputGroupAddon,
14
+ InputGroupButton,
15
+ InputGroupInput,
16
+ InputGroupNumberField
17
+ } from "../../../../ui/input-group";
18
+ import { getStructFieldDescription, getStructFieldTitle } from "../../../utils/schema-meta";
19
+ import { Markdown } from "../../../../ui/markdown";
20
+ import TriggersField from "../../../../actions/components/triggers-field.vue";
21
+ import { itemSchema, schema } from "./schema";
22
+ defineOptions({ name: "ShwfedTableComboboxSingleRemoteOptionsStaticConfig" });
23
+ const value = defineModel({ type: null, ...{ required: true } });
24
+ const fieldSchema = schema(() => {
25
+ });
26
+ const fieldTitle = (field) => getStructFieldTitle(fieldSchema, field) ?? field;
27
+ const fieldDescription = (field) => getStructFieldDescription(fieldSchema, field);
28
+ const itemFieldSchema = itemSchema(() => {
29
+ });
30
+ const itemFieldTitle = (f) => getStructFieldTitle(itemFieldSchema, f) ?? f;
31
+ const itemFieldDescription = (f) => getStructFieldDescription(itemFieldSchema, f);
32
+ const ROW_VARS = {
33
+ row: { type: "dyn", label: "\u5F53\u524D\u884C\u6570\u636E" },
34
+ index: { type: "number", label: "\u884C\u7D22\u5F15" }
35
+ };
36
+ const ROW_VALUE_VARS = {
37
+ ...ROW_VARS,
38
+ value: { type: "dyn", label: "\u7528\u6237\u9009\u4E2D\u7684\u65B0\u503C\uFF08\u6E05\u7A7A\u65F6\u4E3A null\uFF09" }
39
+ };
40
+ const JSON_VARS = {
41
+ json: { type: "dyn", label: "HTTP \u54CD\u5E94\u4F53" }
42
+ };
43
+ const hiddenModel = computed({
44
+ get: () => value.value.hidden ?? "",
45
+ set: (v) => {
46
+ if (v === "") {
47
+ const { hidden: _omit, ...rest } = value.value;
48
+ value.value = rest;
49
+ } else {
50
+ value.value = { ...value.value, hidden: v };
51
+ }
52
+ }
53
+ });
54
+ const disabledModel = computed({
55
+ get: () => value.value.disabled ?? "",
56
+ set: (v) => {
57
+ if (v === "") {
58
+ const { disabled: _omit, ...rest } = value.value;
59
+ value.value = rest;
60
+ } else {
61
+ value.value = { ...value.value, disabled: v };
62
+ }
63
+ }
64
+ });
65
+ const readonlyModel = computed({
66
+ get: () => value.value.readonly ?? "",
67
+ set: (v) => {
68
+ if (v === "") {
69
+ const { readonly: _omit, ...rest } = value.value;
70
+ value.value = rest;
71
+ } else {
72
+ value.value = { ...value.value, readonly: v };
73
+ }
74
+ }
75
+ });
76
+ const onChangeModel = computed({
77
+ get: () => value.value.onChange ?? "",
78
+ set: (v) => {
79
+ if (v === "") {
80
+ const { onChange: _omit, ...rest } = value.value;
81
+ value.value = rest;
82
+ } else {
83
+ value.value = { ...value.value, onChange: v };
84
+ }
85
+ }
86
+ });
87
+ const successMessageModel = computed({
88
+ get: () => value.value.successMessage ?? "",
89
+ set: (v) => {
90
+ if (v === "") {
91
+ const { successMessage: _omit, ...rest } = value.value;
92
+ value.value = rest;
93
+ } else {
94
+ value.value = { ...value.value, successMessage: v };
95
+ }
96
+ }
97
+ });
98
+ const triggers = computed(() => value.value.triggers ?? []);
99
+ function updateTriggers(next) {
100
+ if (next.length === 0) {
101
+ const { triggers: _omit, ...rest } = value.value;
102
+ value.value = rest;
103
+ } else {
104
+ value.value = { ...value.value, triggers: [...next] };
105
+ }
106
+ }
107
+ const items = computed(() => value.value.items ?? []);
108
+ function newId() {
109
+ return typeof crypto !== "undefined" && "randomUUID" in crypto ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
110
+ const r = Math.random() * 16 | 0;
111
+ const v = c === "x" ? r : r & 3 | 8;
112
+ return v.toString(16);
113
+ });
114
+ }
115
+ function newItem() {
116
+ return {
117
+ id: newId(),
118
+ label: [{ locale: "zh", message: "" }],
119
+ value: { kind: "text", value: "" }
120
+ };
121
+ }
122
+ function patchItem(index, patch) {
123
+ const next = [...value.value.items ?? []];
124
+ const cur = next[index];
125
+ if (!cur) return;
126
+ next[index] = { ...cur, ...patch };
127
+ value.value = { ...value.value, items: next };
128
+ }
129
+ function addItem() {
130
+ value.value = { ...value.value, items: [...value.value.items ?? [], newItem()] };
131
+ }
132
+ function removeItem(index) {
133
+ const next = [...value.value.items ?? []];
134
+ next.splice(index, 1);
135
+ value.value = { ...value.value, items: next };
136
+ }
137
+ function setItemKind(index, kind) {
138
+ const cur = value.value.items?.[index];
139
+ if (!cur || cur.value.kind === kind) return;
140
+ patchItem(index, {
141
+ value: kind === "text" ? { kind: "text", value: "" } : { kind: "number", value: 0 }
142
+ });
143
+ }
144
+ function setItemTextValue(index, text) {
145
+ patchItem(index, { value: { kind: "text", value: text } });
146
+ }
147
+ function setItemNumberValue(index, n) {
148
+ patchItem(index, {
149
+ value: {
150
+ kind: "number",
151
+ value: typeof n === "number" && Number.isFinite(n) ? n : 0
152
+ }
153
+ });
154
+ }
155
+ function setItemLabel(index, label) {
156
+ patchItem(index, { label });
157
+ }
158
+ function setItemTooltip(index, tooltip) {
159
+ const isEmpty = !tooltip || tooltip.every((l) => l.message.trim().length === 0);
160
+ if (isEmpty) {
161
+ const cur = value.value.items?.[index];
162
+ if (!cur) return;
163
+ const { tooltip: _omit, ...rest } = cur;
164
+ const next = [...value.value.items ?? []];
165
+ next[index] = rest;
166
+ value.value = { ...value.value, items: next };
167
+ } else {
168
+ patchItem(index, { tooltip });
169
+ }
170
+ }
171
+ </script>
172
+
173
+ <template>
174
+ <div class="space-y-5">
175
+ <div class="grid grid-cols-2 gap-x-6 gap-y-4">
176
+ <Field orientation="vertical">
177
+ <FieldLabel class="text-xs text-zinc-500">
178
+ <template
179
+ v-if="fieldDescription('title')"
180
+ #tooltip
181
+ >
182
+ <Markdown
183
+ :source="fieldDescription('title')"
184
+ block
185
+ class="prose prose-sm prose-zinc"
186
+ />
187
+ </template>
188
+ {{ fieldTitle("title") }}
189
+ </FieldLabel>
190
+ <Locale v-model="value.title" />
191
+ </Field>
192
+ <Field orientation="vertical">
193
+ <FieldLabel class="text-xs text-zinc-500">
194
+ <template
195
+ v-if="fieldDescription('tooltip')"
196
+ #tooltip
197
+ >
198
+ <Markdown
199
+ :source="fieldDescription('tooltip')"
200
+ block
201
+ class="prose prose-sm prose-zinc"
202
+ />
203
+ </template>
204
+ {{ fieldTitle("tooltip") }}
205
+ </FieldLabel>
206
+ <Locale
207
+ v-model="value.tooltip"
208
+ markdown
209
+ />
210
+ </Field>
211
+ </div>
212
+ <div class="grid grid-cols-2 gap-x-6 gap-y-4">
213
+ <Field orientation="vertical">
214
+ <FieldLabel class="text-xs text-zinc-500">
215
+ <template
216
+ v-if="fieldDescription('accessor')"
217
+ #tooltip
218
+ >
219
+ <Markdown
220
+ :source="fieldDescription('accessor')"
221
+ block
222
+ class="prose prose-sm prose-zinc"
223
+ />
224
+ </template>
225
+ {{ fieldTitle("accessor") }}
226
+ </FieldLabel>
227
+ <ExpressionEditor
228
+ v-model="value.accessor"
229
+ placeholder="如 row.role"
230
+ result-type="dyn"
231
+ :extra-vars="ROW_VARS"
232
+ />
233
+ </Field>
234
+ <Field orientation="vertical">
235
+ <FieldLabel class="text-xs text-zinc-500">
236
+ <template
237
+ v-if="fieldDescription('placeholder')"
238
+ #tooltip
239
+ >
240
+ <Markdown
241
+ :source="fieldDescription('placeholder')"
242
+ block
243
+ class="prose prose-sm prose-zinc"
244
+ />
245
+ </template>
246
+ {{ fieldTitle("placeholder") }}
247
+ </FieldLabel>
248
+ <Locale v-model="value.placeholder" />
249
+ </Field>
250
+ <Field orientation="vertical">
251
+ <FieldLabel class="text-xs text-zinc-500">
252
+ <template
253
+ v-if="fieldDescription('size')"
254
+ #tooltip
255
+ >
256
+ <Markdown
257
+ :source="fieldDescription('size')"
258
+ block
259
+ class="prose prose-sm prose-zinc"
260
+ />
261
+ </template>
262
+ {{ fieldTitle("size") }}
263
+ </FieldLabel>
264
+ <InputGroup>
265
+ <InputGroupNumberField
266
+ :model-value="value.size"
267
+ :disabled="value.grow"
268
+ :min="0"
269
+ @update:model-value="(v) => value = { ...value, size: v }"
270
+ />
271
+ <InputGroupAddon align="inline-end">
272
+ <InputGroupButton
273
+ :variant="value.grow ? 'primary' : 'ghost'"
274
+ size="xs"
275
+ @click="value = { ...value, grow: !value.grow }"
276
+ >
277
+ <Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
278
+ {{ fieldTitle("grow") }}
279
+ </InputGroupButton>
280
+ </InputGroupAddon>
281
+ </InputGroup>
282
+ </Field>
283
+ </div>
284
+
285
+ <Field orientation="vertical">
286
+ <FieldLabel class="text-xs text-zinc-500">
287
+ <template #tooltip>
288
+ <Markdown
289
+ source="下拉框可选项列表"
290
+ block
291
+ class="prose prose-sm prose-zinc"
292
+ />
293
+ </template>
294
+ {{ fieldTitle("items") }}
295
+ </FieldLabel>
296
+
297
+ <div class="flex flex-col gap-3">
298
+ <div
299
+ v-for="(item, index) in items"
300
+ :key="item.id"
301
+ data-slot="combobox-single-item"
302
+ class="relative pt-8 grid grid-cols-3 gap-3 rounded border border-zinc-200 bg-zinc-50/40 p-3"
303
+ >
304
+ <InputGroupButton
305
+ variant="destructive"
306
+ size="icon-xs"
307
+ data-slot="combobox-single-item-delete"
308
+ aria-label="删除选项"
309
+ class="absolute right-2 top-2 z-10"
310
+ @click="removeItem(index)"
311
+ >
312
+ <Icon icon="fluent:delete-20-regular" />
313
+ </InputGroupButton>
314
+
315
+ <Field orientation="vertical">
316
+ <FieldLabel class="text-xs text-zinc-500">
317
+ <template
318
+ v-if="itemFieldDescription('label')"
319
+ #tooltip
320
+ >
321
+ <Markdown
322
+ :source="itemFieldDescription('label')"
323
+ block
324
+ class="prose prose-sm prose-zinc"
325
+ />
326
+ </template>
327
+ {{ itemFieldTitle("label") }}
328
+ </FieldLabel>
329
+ <Locale
330
+ markdown
331
+ translate-hint="combobox option label"
332
+ :model-value="item.label"
333
+ @update:model-value="(v) => setItemLabel(index, v)"
334
+ />
335
+ </Field>
336
+
337
+ <Field orientation="vertical">
338
+ <FieldLabel class="text-xs text-zinc-500">
339
+ <template
340
+ v-if="itemFieldDescription('value')"
341
+ #tooltip
342
+ >
343
+ <Markdown
344
+ :source="itemFieldDescription('value')"
345
+ block
346
+ class="prose prose-sm prose-zinc"
347
+ />
348
+ </template>
349
+ {{ itemFieldTitle("value") }}
350
+ </FieldLabel>
351
+ <InputGroup>
352
+ <InputGroupAddon align="inline-start">
353
+ <DropdownMenu>
354
+ <DropdownMenuTrigger as-child>
355
+ <InputGroupButton
356
+ size="icon-sm"
357
+ as-child
358
+ >
359
+ <button
360
+ type="button"
361
+ data-slot="combobox-single-item-kind-trigger"
362
+ class="text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5"
363
+ aria-label="切换值类型"
364
+ >
365
+ <Icon
366
+ :icon="item.value.kind === 'number' ? 'fluent:number-symbol-20-regular' : 'fluent:textbox-20-regular'"
367
+ />
368
+ </button>
369
+ </InputGroupButton>
370
+ </DropdownMenuTrigger>
371
+ <DropdownMenuContent align="start">
372
+ <DropdownMenuItem @select="setItemKind(index, 'text')">
373
+ <Icon icon="fluent:textbox-20-regular" />
374
+ <span>文本</span>
375
+ </DropdownMenuItem>
376
+ <DropdownMenuItem @select="setItemKind(index, 'number')">
377
+ <Icon icon="fluent:number-symbol-20-regular" />
378
+ <span>数字</span>
379
+ </DropdownMenuItem>
380
+ </DropdownMenuContent>
381
+ </DropdownMenu>
382
+ </InputGroupAddon>
383
+
384
+ <InputGroupInput
385
+ v-if="item.value.kind === 'text'"
386
+ :model-value="item.value.value"
387
+ placeholder="例:admin"
388
+ @update:model-value="(v) => setItemTextValue(index, String(v ?? ''))"
389
+ />
390
+ <InputGroupNumberField
391
+ v-else
392
+ :model-value="item.value.value"
393
+ @update:model-value="(v) => setItemNumberValue(index, v)"
394
+ />
395
+ </InputGroup>
396
+ </Field>
397
+
398
+ <Field orientation="vertical">
399
+ <FieldLabel class="text-xs text-zinc-500">
400
+ <template
401
+ v-if="itemFieldDescription('tooltip')"
402
+ #tooltip
403
+ >
404
+ <Markdown
405
+ :source="itemFieldDescription('tooltip')"
406
+ block
407
+ class="prose prose-sm prose-zinc"
408
+ />
409
+ </template>
410
+ {{ itemFieldTitle("tooltip") }}
411
+ </FieldLabel>
412
+ <Locale
413
+ markdown
414
+ translate-hint="combobox option tooltip"
415
+ :model-value="item.tooltip"
416
+ @update:model-value="(v) => setItemTooltip(index, v)"
417
+ />
418
+ </Field>
419
+ </div>
420
+
421
+ <Button
422
+ type="button"
423
+ data-slot="combobox-single-add-item"
424
+ class="w-full justify-center"
425
+ @click="addItem"
426
+ >
427
+ <Icon icon="fluent:add-20-regular" />
428
+ <span>增加选项</span>
429
+ </Button>
430
+ </div>
431
+ </Field>
432
+
433
+ <div class="grid grid-cols-2 gap-x-6 gap-y-4">
434
+ <Field orientation="vertical">
435
+ <FieldLabel class="text-xs text-zinc-500">
436
+ <template
437
+ v-if="fieldDescription('hidden')"
438
+ #tooltip
439
+ >
440
+ <Markdown
441
+ :source="fieldDescription('hidden')"
442
+ block
443
+ class="prose prose-sm prose-zinc"
444
+ />
445
+ </template>
446
+ {{ fieldTitle("hidden") }}
447
+ </FieldLabel>
448
+ <ExpressionEditor
449
+ v-model="hiddenModel"
450
+ placeholder="例:row.archived"
451
+ result-type="bool"
452
+ :extra-vars="ROW_VARS"
453
+ />
454
+ </Field>
455
+ <Field orientation="vertical">
456
+ <FieldLabel class="text-xs text-zinc-500">
457
+ <template
458
+ v-if="fieldDescription('disabled')"
459
+ #tooltip
460
+ >
461
+ <Markdown
462
+ :source="fieldDescription('disabled')"
463
+ block
464
+ class="prose prose-sm prose-zinc"
465
+ />
466
+ </template>
467
+ {{ fieldTitle("disabled") }}
468
+ </FieldLabel>
469
+ <ExpressionEditor
470
+ v-model="disabledModel"
471
+ placeholder="例:row.locked"
472
+ result-type="bool"
473
+ :extra-vars="ROW_VARS"
474
+ />
475
+ </Field>
476
+ <Field orientation="vertical">
477
+ <FieldLabel class="text-xs text-zinc-500">
478
+ <template
479
+ v-if="fieldDescription('readonly')"
480
+ #tooltip
481
+ >
482
+ <Markdown
483
+ :source="fieldDescription('readonly')"
484
+ block
485
+ class="prose prose-sm prose-zinc"
486
+ />
487
+ </template>
488
+ {{ fieldTitle("readonly") }}
489
+ </FieldLabel>
490
+ <ExpressionEditor
491
+ v-model="readonlyModel"
492
+ placeholder="例:row.id == null"
493
+ result-type="bool"
494
+ :extra-vars="ROW_VARS"
495
+ />
496
+ </Field>
497
+ <Field orientation="vertical">
498
+ <FieldLabel class="text-xs text-zinc-500">
499
+ <template
500
+ v-if="fieldDescription('onChange')"
501
+ #tooltip
502
+ >
503
+ <Markdown
504
+ :source="fieldDescription('onChange')"
505
+ block
506
+ class="prose prose-sm prose-zinc"
507
+ />
508
+ </template>
509
+ {{ fieldTitle("onChange") }}
510
+ </FieldLabel>
511
+ <ExpressionEditor
512
+ v-model="onChangeModel"
513
+ placeholder="如 http.patch('/api/items/' + row.id).body({ role: value })"
514
+ result-type="HttpRequest"
515
+ :extra-vars="ROW_VALUE_VARS"
516
+ multiline
517
+ />
518
+ </Field>
519
+ <Field orientation="vertical">
520
+ <FieldLabel class="text-xs text-zinc-500">
521
+ <template
522
+ v-if="fieldDescription('successMessage')"
523
+ #tooltip
524
+ >
525
+ <Markdown
526
+ :source="fieldDescription('successMessage')"
527
+ block
528
+ class="prose prose-sm prose-zinc"
529
+ />
530
+ </template>
531
+ {{ fieldTitle("successMessage") }}
532
+ </FieldLabel>
533
+ <ExpressionEditor
534
+ v-model="successMessageModel"
535
+ placeholder="如 '已更新'"
536
+ result-type="string"
537
+ :extra-vars="JSON_VARS"
538
+ />
539
+ </Field>
540
+ <Field orientation="vertical">
541
+ <FieldLabel class="text-xs text-zinc-500">
542
+ <template
543
+ v-if="fieldDescription('triggers')"
544
+ #tooltip
545
+ >
546
+ <Markdown
547
+ :source="fieldDescription('triggers')"
548
+ block
549
+ class="prose prose-sm prose-zinc"
550
+ />
551
+ </template>
552
+ {{ fieldTitle("triggers") }}
553
+ </FieldLabel>
554
+ <TriggersField
555
+ :triggers="triggers"
556
+ @update:triggers="updateTriggers"
557
+ />
558
+ </Field>
559
+ </div>
560
+ <Separator />
561
+ <div class="flex flex-wrap gap-x-8 gap-y-3">
562
+ <Field
563
+ orientation="horizontal"
564
+ class="w-auto gap-2"
565
+ >
566
+ <Switch
567
+ :model-value="value.enableSorting ?? false"
568
+ @update:model-value="(v) => value = { ...value, enableSorting: v }"
569
+ />
570
+ <FieldLabel class="text-sm text-zinc-600">
571
+ <template
572
+ v-if="fieldDescription('enableSorting')"
573
+ #tooltip
574
+ >
575
+ <Markdown
576
+ :source="fieldDescription('enableSorting')"
577
+ block
578
+ class="prose prose-sm prose-zinc"
579
+ />
580
+ </template>
581
+ {{ fieldTitle("enableSorting") }}
582
+ </FieldLabel>
583
+ </Field>
584
+ </div>
585
+ </div>
586
+ </template>