@shwfed/config 2.2.5 → 2.3.1

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 (72) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.d.vue.ts +61 -0
  3. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.vue +187 -0
  4. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/config.vue.d.ts +61 -0
  5. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/runtime.d.vue.ts +8 -0
  6. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/runtime.vue +62 -0
  7. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/runtime.vue.d.ts +8 -0
  8. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.d.ts +40 -0
  9. package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.js +87 -0
  10. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +8 -8
  11. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +8 -8
  12. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +8 -8
  13. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +8 -8
  14. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +9 -15
  15. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.d.vue.ts +2 -2
  16. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue +32 -52
  17. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue.d.ts +2 -2
  18. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/runtime.vue +19 -8
  19. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +2 -2
  20. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.js +4 -3
  21. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/config.vue +25 -0
  22. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/runtime.vue +2 -8
  23. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +4 -0
  24. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.js +5 -0
  25. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +133 -0
  26. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue +533 -0
  27. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +133 -0
  28. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.d.vue.ts +9 -0
  29. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue +237 -0
  30. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue.d.ts +9 -0
  31. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.d.ts +124 -0
  32. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.js +96 -0
  33. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.d.vue.ts +10 -0
  34. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue +475 -0
  35. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue.d.ts +10 -0
  36. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.d.vue.ts +9 -0
  37. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.vue +156 -0
  38. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.vue.d.ts +9 -0
  39. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +56 -0
  40. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.js +81 -0
  41. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/config.d.vue.ts +10 -0
  42. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/config.vue +310 -0
  43. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/config.vue.d.ts +10 -0
  44. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/runtime.d.vue.ts +9 -0
  45. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/runtime.vue +81 -0
  46. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/runtime.vue.d.ts +9 -0
  47. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/schema.d.ts +57 -0
  48. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/schema.js +59 -0
  49. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.d.vue.ts +10 -0
  50. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue +292 -0
  51. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue.d.ts +10 -0
  52. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.d.vue.ts +9 -0
  53. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.vue +140 -0
  54. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.vue.d.ts +9 -0
  55. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.d.ts +50 -0
  56. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.js +53 -0
  57. package/dist/runtime/components/table/config.d.vue.ts +2 -0
  58. package/dist/runtime/components/table/config.vue +136 -109
  59. package/dist/runtime/components/table/config.vue.d.ts +2 -0
  60. package/dist/runtime/components/table/index.d.vue.ts +2 -2
  61. package/dist/runtime/components/table/index.vue +46 -53
  62. package/dist/runtime/components/table/index.vue.d.ts +2 -2
  63. package/dist/runtime/components/table/row-provider.d.vue.ts +23 -0
  64. package/dist/runtime/components/table/row-provider.vue +55 -0
  65. package/dist/runtime/components/table/row-provider.vue.d.ts +23 -0
  66. package/dist/runtime/components/table/schema.d.ts +17 -29
  67. package/dist/runtime/components/table/schema.js +22 -18
  68. package/dist/runtime/components/table/utils/shared.d.ts +28 -0
  69. package/dist/runtime/components/table/utils/shared.js +40 -0
  70. package/dist/runtime/components/ui/field/index.js +6 -1
  71. package/dist/runtime/components/ui/input/Input.vue +1 -1
  72. package/package.json +1 -1
@@ -29,11 +29,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
29
29
  readonly message: string;
30
30
  }[]] | undefined;
31
31
  }[];
32
- readonly dataSource: {
32
+ readonly dataSource?: {
33
33
  readonly data: string;
34
34
  readonly request?: string | undefined;
35
35
  readonly total?: string | undefined;
36
- };
36
+ } | undefined;
37
37
  readonly actions?: {
38
38
  readonly size: "default" | "sm" | "xs";
39
39
  readonly style?: string | undefined;
@@ -142,9 +142,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
142
142
  readonly locale: "en" | "ja" | "ko";
143
143
  readonly message: string;
144
144
  }[]] | undefined;
145
- readonly pageSizes: readonly number[];
146
- readonly pageIndex: number;
147
145
  readonly pageSize: number;
146
+ readonly pageSizes?: readonly number[] | undefined;
147
+ readonly pageIndex?: number | undefined;
148
148
  } | undefined;
149
149
  readonly initialState?: {
150
150
  readonly expanded?: boolean | {
@@ -204,11 +204,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
204
204
  readonly message: string;
205
205
  }[]] | undefined;
206
206
  }[];
207
- readonly dataSource: {
207
+ readonly dataSource?: {
208
208
  readonly data: string;
209
209
  readonly request?: string | undefined;
210
210
  readonly total?: string | undefined;
211
- };
211
+ } | undefined;
212
212
  readonly actions?: {
213
213
  readonly size: "default" | "sm" | "xs";
214
214
  readonly style?: string | undefined;
@@ -317,9 +317,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
317
317
  readonly locale: "en" | "ja" | "ko";
318
318
  readonly message: string;
319
319
  }[]] | undefined;
320
- readonly pageSizes: readonly number[];
321
- readonly pageIndex: number;
322
320
  readonly pageSize: number;
321
+ readonly pageSizes?: readonly number[] | undefined;
322
+ readonly pageIndex?: number | undefined;
323
323
  } | undefined;
324
324
  readonly initialState?: {
325
325
  readonly expanded?: boolean | {
@@ -29,11 +29,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
29
29
  readonly message: string;
30
30
  }[]] | undefined;
31
31
  }[];
32
- readonly dataSource: {
32
+ readonly dataSource?: {
33
33
  readonly data: string;
34
34
  readonly request?: string | undefined;
35
35
  readonly total?: string | undefined;
36
- };
36
+ } | undefined;
37
37
  readonly actions?: {
38
38
  readonly size: "default" | "sm" | "xs";
39
39
  readonly style?: string | undefined;
@@ -142,9 +142,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
142
142
  readonly locale: "en" | "ja" | "ko";
143
143
  readonly message: string;
144
144
  }[]] | undefined;
145
- readonly pageSizes: readonly number[];
146
- readonly pageIndex: number;
147
145
  readonly pageSize: number;
146
+ readonly pageSizes?: readonly number[] | undefined;
147
+ readonly pageIndex?: number | undefined;
148
148
  } | undefined;
149
149
  readonly initialState?: {
150
150
  readonly expanded?: boolean | {
@@ -204,11 +204,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
204
204
  readonly message: string;
205
205
  }[]] | undefined;
206
206
  }[];
207
- readonly dataSource: {
207
+ readonly dataSource?: {
208
208
  readonly data: string;
209
209
  readonly request?: string | undefined;
210
210
  readonly total?: string | undefined;
211
- };
211
+ } | undefined;
212
212
  readonly actions?: {
213
213
  readonly size: "default" | "sm" | "xs";
214
214
  readonly style?: string | undefined;
@@ -317,9 +317,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
317
317
  readonly locale: "en" | "ja" | "ko";
318
318
  readonly message: string;
319
319
  }[]] | undefined;
320
- readonly pageSizes: readonly number[];
321
- readonly pageIndex: number;
322
320
  readonly pageSize: number;
321
+ readonly pageSizes?: readonly number[] | undefined;
322
+ readonly pageIndex?: number | undefined;
323
323
  } | undefined;
324
324
  readonly initialState?: {
325
325
  readonly expanded?: boolean | {
@@ -44,11 +44,11 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
44
44
  readonly message: string;
45
45
  }[]] | undefined;
46
46
  }[];
47
- readonly dataSource: {
47
+ readonly dataSource?: {
48
48
  readonly data: string;
49
49
  readonly request?: string | undefined;
50
50
  readonly total?: string | undefined;
51
- };
51
+ } | undefined;
52
52
  readonly actions?: {
53
53
  readonly size: "default" | "sm" | "xs";
54
54
  readonly style?: string | undefined;
@@ -157,9 +157,9 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
157
157
  readonly locale: "en" | "ja" | "ko";
158
158
  readonly message: string;
159
159
  }[]] | undefined;
160
- readonly pageSizes: readonly number[];
161
- readonly pageIndex: number;
162
160
  readonly pageSize: number;
161
+ readonly pageSizes?: readonly number[] | undefined;
162
+ readonly pageIndex?: number | undefined;
163
163
  } | undefined;
164
164
  readonly initialState?: {
165
165
  readonly expanded?: boolean | {
@@ -213,11 +213,11 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
213
213
  }>>, {
214
214
  default: () => never[];
215
215
  }>;
216
- dataSource: Schema.Struct<{
216
+ dataSource: Schema.optional<Schema.Struct<{
217
217
  request: Schema.optional<Schema.Schema<string, string, never>>;
218
218
  data: Schema.Schema<string, string, never>;
219
219
  total: Schema.optional<Schema.Schema<string, string, never>>;
220
- }>;
220
+ }>>;
221
221
  actions: Schema.optional<Schema.Struct<{
222
222
  size: Schema.optionalWith<Schema.Literal<["default", "sm", "xs"]>, {
223
223
  default: () => "default";
@@ -359,15 +359,9 @@ export declare function schema(configure: (env: Environment) => void, _blockRef:
359
359
  cellStyle: Schema.optional<Schema.Schema<string, string, never>>;
360
360
  style: Schema.optional<typeof Schema.String>;
361
361
  pagination: Schema.optional<Schema.Struct<{
362
- pageSizes: Schema.optionalWith<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.Number>>>, {
363
- default: () => number[];
364
- }>;
365
- pageIndex: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
366
- default: () => number;
367
- }>;
368
- pageSize: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
369
- default: () => number;
370
- }>;
362
+ pageSize: Schema.refine<number, Schema.filter<typeof Schema.Number>>;
363
+ pageSizes: Schema.optional<Schema.Array$<Schema.filter<Schema.filter<typeof Schema.Number>>>>;
364
+ pageIndex: Schema.optional<Schema.filter<Schema.filter<typeof Schema.Number>>>;
371
365
  left: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
372
366
  locale: Schema.Literal<["zh"]>;
373
367
  message: Schema.SchemaClass<string, string, never>;
@@ -19,7 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
19
19
  displayName?: string;
20
20
  columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
21
21
  groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
22
- dataSource: Readonly<{
22
+ dataSource?: Readonly<{
23
23
  request?: string;
24
24
  data: string;
25
25
  total?: string;
@@ -81,7 +81,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
81
81
  displayName?: string;
82
82
  columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
83
83
  groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
84
- dataSource: Readonly<{
84
+ dataSource?: Readonly<{
85
85
  request?: string;
86
86
  data: string;
87
87
  total?: string;
@@ -26,9 +26,16 @@ function configureEmbeddedTable(env) {
26
26
  registerFormVariablesIfAbsent(env);
27
27
  }
28
28
  const tableModel = computed({
29
- get: () => value.value.table,
29
+ get: () => {
30
+ const { dataSource: _omit, ...rest } = value.value.table;
31
+ return rest;
32
+ },
30
33
  set: (next) => {
31
- value.value = { ...value.value, table: next };
34
+ const { dataSource: _omit, ...rest } = next;
35
+ value.value = {
36
+ ...value.value,
37
+ table: rest
38
+ };
32
39
  }
33
40
  });
34
41
  const bindingText = computed({
@@ -43,65 +50,38 @@ const bindingText = computed({
43
50
  }
44
51
  }
45
52
  });
46
- function setDisplayName(v) {
47
- const s = String(v ?? "");
48
- value.value = { ...value.value, displayName: s.length > 0 ? s : void 0 };
49
- }
50
53
  </script>
51
54
 
52
55
  <template>
53
56
  <TableConfigEditor
54
57
  v-model="tableModel"
55
58
  :configure="configureEmbeddedTable"
59
+ hide-display-name
60
+ hide-data-source
56
61
  >
57
62
  <template #general-extra>
58
- <div class="grid grid-cols-2 gap-3">
59
- <Field orientation="vertical">
60
- <FieldLabel class="text-xs text-zinc-500">
61
- <template
62
- v-if="fieldDescription('displayName')"
63
- #tooltip
64
- >
65
- <Markdown
66
- :source="fieldDescription('displayName')"
67
- block
68
- class="prose prose-sm prose-zinc"
69
- />
70
- </template>
71
- {{ fieldTitle("displayName") }}
72
- </FieldLabel>
73
- <InputGroup>
74
- <InputGroupInput
75
- :model-value="value.displayName ?? ''"
76
- placeholder="例:成员表格"
77
- @update:model-value="setDisplayName"
78
- />
79
- </InputGroup>
80
- </Field>
81
-
82
- <Field orientation="vertical">
83
- <FieldLabel class="text-xs text-zinc-500">
84
- <template
85
- v-if="fieldDescription('binding')"
86
- #tooltip
87
- >
88
- <Markdown
89
- :source="fieldDescription('binding')"
90
- block
91
- class="prose prose-sm prose-zinc"
92
- />
93
- </template>
94
- {{ fieldTitle("binding") }}
95
- </FieldLabel>
96
- <InputGroup>
97
- <InputGroupInput
98
- v-model="bindingText"
99
- placeholder="例:rows"
100
- class="font-mono"
63
+ <Field orientation="vertical">
64
+ <FieldLabel class="text-xs text-zinc-500">
65
+ <template
66
+ v-if="fieldDescription('binding')"
67
+ #tooltip
68
+ >
69
+ <Markdown
70
+ :source="fieldDescription('binding')"
71
+ block
72
+ class="prose prose-sm prose-zinc"
101
73
  />
102
- </InputGroup>
103
- </Field>
104
- </div>
74
+ </template>
75
+ {{ fieldTitle("binding") }}
76
+ </FieldLabel>
77
+ <InputGroup>
78
+ <InputGroupInput
79
+ v-model="bindingText"
80
+ placeholder="例:rows"
81
+ class="font-mono"
82
+ />
83
+ </InputGroup>
84
+ </Field>
105
85
 
106
86
  <div class="grid grid-cols-2 gap-3">
107
87
  <Field orientation="vertical">
@@ -19,7 +19,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
19
19
  displayName?: string;
20
20
  columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
21
21
  groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
22
- dataSource: Readonly<{
22
+ dataSource?: Readonly<{
23
23
  request?: string;
24
24
  data: string;
25
25
  total?: string;
@@ -81,7 +81,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
81
81
  displayName?: string;
82
82
  columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
83
83
  groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
84
- dataSource: Readonly<{
84
+ dataSource?: Readonly<{
85
85
  request?: string;
86
86
  data: string;
87
87
  total?: string;
@@ -12,17 +12,28 @@ const props = defineProps({
12
12
  config: { type: null, required: true }
13
13
  });
14
14
  const { locale } = useI18n();
15
- const { setAtSilent } = useFormState();
15
+ const formState = useFormState();
16
16
  const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
17
17
  const tooltipText = computed(
18
18
  () => props.config.tooltip ? getLocalizedText(props.config.tooltip, locale.value) : void 0
19
19
  );
20
- const tableConfig = computed(() => props.config.table);
21
- function onRows(rows) {
22
- const path = props.config.binding;
23
- if (path == null) return;
24
- setAtSilent(path, rows);
25
- }
20
+ const tableConfig = computed(() => {
21
+ const { dataSource: _omit, ...rest } = props.config.table;
22
+ return rest;
23
+ });
24
+ const rowsModel = computed({
25
+ get: () => {
26
+ const binding = props.config.binding?.trim();
27
+ if (!binding) return [];
28
+ const v = formState.getAt(binding);
29
+ return Array.isArray(v) ? v : [];
30
+ },
31
+ set: (next) => {
32
+ const binding = props.config.binding?.trim();
33
+ if (!binding) return;
34
+ formState.setAtSilent(binding, next);
35
+ }
36
+ });
26
37
  </script>
27
38
 
28
39
  <template>
@@ -45,8 +56,8 @@ function onRows(rows) {
45
56
  </FieldLabel>
46
57
 
47
58
  <ShwfedTable
59
+ v-model:rows="rowsModel"
48
60
  :config="tableConfig"
49
- @update:rows="onRows"
50
61
  />
51
62
  </Field>
52
63
  </template>
@@ -39,7 +39,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
39
39
  displayName?: string;
40
40
  columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
41
41
  groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
42
- dataSource: import("../../../../table/schema.js").DataSourceValue;
42
+ dataSource?: import("../../../../table/schema.js").DataSourceValue;
43
43
  actions?: import("../../../../table/schema.js").TableActionsValue;
44
44
  query?: import("../../../schema.js").FormConfigValue;
45
45
  cellStyle?: string;
@@ -73,7 +73,7 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
73
73
  displayName?: string;
74
74
  columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
75
75
  groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
76
- dataSource: import("../../../../table/schema.js").DataSourceValue;
76
+ dataSource?: import("../../../../table/schema.js").DataSourceValue;
77
77
  actions?: import("../../../../table/schema.js").TableActionsValue;
78
78
  query?: import("../../../schema.js").FormConfigValue;
79
79
  cellStyle?: string;
@@ -28,11 +28,11 @@ export function schema(configure) {
28
28
  })),
29
29
  binding: Schema.optional(Schema.String.pipe(Schema.minLength(1)).annotations({
30
30
  title: "\u7ED1\u5B9A\u8DEF\u5F84",
31
- description: "\u8868\u683C\u5F53\u524D\u6570\u636E\u5B9E\u65F6\u5199\u5165\u8868\u5355\u72B6\u6001\u7684 `dot-prop` \u8DEF\u5F84\uFF0C\u4F8B\u5982 `rows`\uFF1B\u7559\u7A7A\u5219\u4E0D\u5199\u5165\u8868\u5355\u72B6\u6001"
31
+ description: "\u8868\u683C\u6570\u636E\u5728\u8868\u5355\u72B6\u6001\u4E2D\u7684 `dot-prop` \u8DEF\u5F84\uFF0C\u4F8B\u5982 `rows`\uFF1B\u8868\u683C\u4ECE `form.<binding>` \u8BFB\u53D6\u884C\u6570\u636E\uFF0C\u672C\u5730\u589E\u5220\u6539\u5B9E\u65F6\u5199\u56DE\u540C\u4E00\u8DEF\u5F84\uFF1B\u7559\u7A7A\u65F6\u8868\u683C\u65E0\u6570\u636E\uFF0C\u884C\u7F16\u8F91\u4E0D\u6301\u4E45\u5316"
32
32
  })),
33
33
  table: Table.annotations({
34
34
  title: "\u8868\u683C\u914D\u7F6E",
35
- description: "\u5185\u5D4C\u8868\u683C\u7684\u5B8C\u6574\u914D\u7F6E\uFF1B\u6570\u636E\u7531\u8868\u683C\u81EA\u5DF1\u7684\u6570\u636E\u6E90\u52A0\u8F7D\uFF0C\u7528\u6237\u7684\u672C\u5730\u589E\u5220\u6539\u5B9E\u65F6\u56DE\u5199\u5230\u300C\u7ED1\u5B9A\u8DEF\u5F84\u300D"
35
+ description: "\u5185\u5D4C\u8868\u683C\u7684\u5B8C\u6574\u914D\u7F6E\uFF1B\u6570\u636E\u6E90\u81EA\u52A8\u7ED1\u5B9A\u5230 `form.<binding>`\uFF0C\u65E0\u9700\u5355\u72EC\u914D\u7F6E"
36
36
  })
37
37
  }).annotations({
38
38
  title: "TableField",
@@ -40,5 +40,6 @@ export function schema(configure) {
40
40
  });
41
41
  }
42
42
  export function defaults() {
43
- return { table: defaultTableConfig() };
43
+ const { dataSource: _omit, ...rest } = defaultTableConfig();
44
+ return { table: rest };
44
45
  }
@@ -20,6 +20,7 @@ import {
20
20
  } from "../../../../ui/dropdown-menu";
21
21
  import { getStructFieldDescription, getStructFieldTitle } from "../../../utils/schema-meta";
22
22
  import { Markdown } from "../../../../ui/markdown";
23
+ import TriggersField from "../../../../actions/components/triggers-field.vue";
23
24
  import { schema } from "./schema";
24
25
  defineOptions({ name: "ShwfedTableSwitchRendererConfig" });
25
26
  const value = defineModel({ type: Object, ...{ required: true } });
@@ -67,6 +68,11 @@ const successMessageModel = computed({
67
68
  else value.value.successMessage = v;
68
69
  }
69
70
  });
71
+ const triggers = computed(() => value.value.triggers ?? []);
72
+ function updateTriggers(next) {
73
+ if (next.length === 0) delete value.value.triggers;
74
+ else value.value.triggers = next;
75
+ }
70
76
  </script>
71
77
 
72
78
  <template>
@@ -250,6 +256,25 @@ const successMessageModel = computed({
250
256
  :extra-vars="JSON_VARS"
251
257
  />
252
258
  </Field>
259
+ <Field orientation="vertical">
260
+ <FieldLabel class="text-xs text-zinc-500">
261
+ <template
262
+ v-if="fieldDescription('triggers')"
263
+ #tooltip
264
+ >
265
+ <Markdown
266
+ :source="fieldDescription('triggers')"
267
+ block
268
+ class="prose prose-sm prose-zinc"
269
+ />
270
+ </template>
271
+ {{ fieldTitle("triggers") }}
272
+ </FieldLabel>
273
+ <TriggersField
274
+ :triggers="triggers"
275
+ @update:triggers="updateTriggers"
276
+ />
277
+ </Field>
253
278
  </div>
254
279
  <Separator />
255
280
  <div class="flex flex-wrap gap-x-8 gap-y-3">
@@ -7,8 +7,7 @@ import { cel as $cel } from "../../../../../utils/cel";
7
7
  import { Switch } from "../../../../ui/switch";
8
8
  import { JUSTIFY_CLASS } from "../../../utils/runtime";
9
9
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
10
- import { useEventChannel } from "../../../../../share/event-bus";
11
- import { useTableInstanceId } from "../../../utils/instance";
10
+ import { dispatchTriggers, useEventChannel } from "../../../../../share/event-bus";
12
11
  defineOptions({ name: "ShwfedTableSwitchRendererRuntime" });
13
12
  const props = defineProps({
14
13
  column: { type: null, required: true },
@@ -16,7 +15,6 @@ const props = defineProps({
16
15
  });
17
16
  const celContext = injectCELContext();
18
17
  const eventChannel = useEventChannel();
19
- const tableInstanceId = useTableInstanceId();
20
18
  const rawValue = computed(() => props.ctx.cell.getValue());
21
19
  const isMissing = computed(() => rawValue.value === void 0 || rawValue.value === null);
22
20
  const checked = computed(() => rawValue.value === true);
@@ -56,11 +54,7 @@ async function onUpdate(next) {
56
54
  console.error("[shwfed-table] switch successMessage failed", e);
57
55
  }
58
56
  }
59
- if (eventChannel && tableInstanceId) {
60
- await Effect.runPromise(
61
- eventChannel.dispatch({ target: tableInstanceId, operation: "search" })
62
- );
63
- }
57
+ await Effect.runPromise(dispatchTriggers(eventChannel, props.column.triggers));
64
58
  } catch (e) {
65
59
  console.error("[shwfed-table] switch onChange failed", e);
66
60
  toast.error("\u8BF7\u6C42\u5931\u8D25");
@@ -15,6 +15,10 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
15
15
  disabled: Schema.optional<Schema.Schema<string, string, never>>;
16
16
  onChange: Schema.optional<Schema.Schema<string, string, never>>;
17
17
  successMessage: Schema.optional<Schema.Schema<string, string, never>>;
18
+ triggers: Schema.optional<Schema.Array$<Schema.Struct<{
19
+ target: Schema.refine<string, typeof Schema.String>;
20
+ operation: Schema.SchemaClass<string, string, never>;
21
+ }>>>;
18
22
  title: Schema.TupleType<readonly [Schema.Struct<{
19
23
  locale: Schema.Literal<["zh"]>;
20
24
  message: Schema.SchemaClass<string, string, never>;
@@ -1,5 +1,6 @@
1
1
  import { Effect, Schema } from "effect";
2
2
  import { Expression } from "../../../../../share/expression.js";
3
+ import { Triggers } from "../../../../../share/event-bus.js";
3
4
  import { Align, CelRowAccess, columnFields, registerRowVariablesIfAbsent } from "../../../utils/shared.js";
4
5
  export const type = "com.shwfed.table.column.switch";
5
6
  export const compatibilityDate = "2026-05-13";
@@ -40,6 +41,10 @@ export function schema(configure) {
40
41
  successMessage: Schema.optional(CelMessage.annotations({
41
42
  title: "\u6210\u529F\u6D88\u606F",
42
43
  description: "\u8BF7\u6C42\u6210\u529F\u540E\u5F39\u51FA\u7684 toast \u5185\u5BB9\uFF1B\u672A\u914D\u7F6E\u5219\u9759\u9ED8"
44
+ })),
45
+ triggers: Schema.optional(Triggers.annotations({
46
+ title: "\u6210\u529F\u540E\u89E6\u53D1",
47
+ description: "\u8BF7\u6C42\u6210\u529F\u540E\u6309\u5217\u8868\u987A\u5E8F\u5192\u6CE1\u7684\u64CD\u4F5C\u8BF7\u6C42\uFF1B\u672A\u914D\u7F6E\u5219\u4EC0\u4E48\u90FD\u4E0D\u505A"
43
48
  }))
44
49
  }).annotations({ title: "SwitchRenderer", description: "\u5F00\u5173\u6E32\u67D3\u5668\uFF08\u53EF\u7F16\u8F91\uFF09" });
45
50
  }
@@ -0,0 +1,133 @@
1
+ import { type Value } from './schema.js';
2
+ type __VLS_ModelProps = {
3
+ modelValue: Value;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:modelValue": (value: {
7
+ readonly size?: number | undefined;
8
+ readonly disabled?: string | undefined;
9
+ readonly type: "com.shwfed.table.column.combobox-single";
10
+ readonly id: string;
11
+ readonly title: readonly [{
12
+ readonly locale: "zh";
13
+ readonly message: string;
14
+ }, ...{
15
+ readonly locale: "en" | "ja" | "ko";
16
+ readonly message: string;
17
+ }[]];
18
+ readonly hidden?: string | undefined;
19
+ readonly tooltip?: readonly [{
20
+ readonly locale: "zh";
21
+ readonly message: string;
22
+ }, ...{
23
+ readonly locale: "en" | "ja" | "ko";
24
+ readonly message: string;
25
+ }[]] | undefined;
26
+ readonly compatibilityDate: "2026-05-20";
27
+ readonly groupId?: string | undefined;
28
+ readonly items: readonly {
29
+ readonly label: readonly [{
30
+ readonly locale: "zh";
31
+ readonly message: string;
32
+ }, ...{
33
+ readonly locale: "en" | "ja" | "ko";
34
+ readonly message: string;
35
+ }[]];
36
+ readonly id: string;
37
+ readonly tooltip?: readonly [{
38
+ readonly locale: "zh";
39
+ readonly message: string;
40
+ }, ...{
41
+ readonly locale: "en" | "ja" | "ko";
42
+ readonly message: string;
43
+ }[]] | undefined;
44
+ readonly value: {
45
+ readonly value: string;
46
+ readonly kind: "text";
47
+ } | {
48
+ readonly value: number;
49
+ readonly kind: "number";
50
+ };
51
+ }[];
52
+ readonly placeholder?: readonly [{
53
+ readonly locale: "zh";
54
+ readonly message: string;
55
+ }, ...{
56
+ readonly locale: "en" | "ja" | "ko";
57
+ readonly message: string;
58
+ }[]] | undefined;
59
+ readonly readonly?: string | undefined;
60
+ readonly grow?: boolean | undefined;
61
+ readonly binding: string;
62
+ readonly derived?: {
63
+ readonly mode: "formula" | "prefill";
64
+ readonly expression: string;
65
+ } | undefined;
66
+ readonly enableSorting?: boolean | undefined;
67
+ }) => any;
68
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
69
+ "onUpdate:modelValue"?: ((value: {
70
+ readonly size?: number | undefined;
71
+ readonly disabled?: string | undefined;
72
+ readonly type: "com.shwfed.table.column.combobox-single";
73
+ readonly id: string;
74
+ readonly title: readonly [{
75
+ readonly locale: "zh";
76
+ readonly message: string;
77
+ }, ...{
78
+ readonly locale: "en" | "ja" | "ko";
79
+ readonly message: string;
80
+ }[]];
81
+ readonly hidden?: string | undefined;
82
+ readonly tooltip?: readonly [{
83
+ readonly locale: "zh";
84
+ readonly message: string;
85
+ }, ...{
86
+ readonly locale: "en" | "ja" | "ko";
87
+ readonly message: string;
88
+ }[]] | undefined;
89
+ readonly compatibilityDate: "2026-05-20";
90
+ readonly groupId?: string | undefined;
91
+ readonly items: readonly {
92
+ readonly label: readonly [{
93
+ readonly locale: "zh";
94
+ readonly message: string;
95
+ }, ...{
96
+ readonly locale: "en" | "ja" | "ko";
97
+ readonly message: string;
98
+ }[]];
99
+ readonly id: string;
100
+ readonly tooltip?: readonly [{
101
+ readonly locale: "zh";
102
+ readonly message: string;
103
+ }, ...{
104
+ readonly locale: "en" | "ja" | "ko";
105
+ readonly message: string;
106
+ }[]] | undefined;
107
+ readonly value: {
108
+ readonly value: string;
109
+ readonly kind: "text";
110
+ } | {
111
+ readonly value: number;
112
+ readonly kind: "number";
113
+ };
114
+ }[];
115
+ readonly placeholder?: readonly [{
116
+ readonly locale: "zh";
117
+ readonly message: string;
118
+ }, ...{
119
+ readonly locale: "en" | "ja" | "ko";
120
+ readonly message: string;
121
+ }[]] | undefined;
122
+ readonly readonly?: string | undefined;
123
+ readonly grow?: boolean | undefined;
124
+ readonly binding: string;
125
+ readonly derived?: {
126
+ readonly mode: "formula" | "prefill";
127
+ readonly expression: string;
128
+ } | undefined;
129
+ readonly enableSorting?: boolean | undefined;
130
+ }) => any) | undefined;
131
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
132
+ declare const _default: typeof __VLS_export;
133
+ export default _default;