@shwfed/config 2.2.4 → 2.3.0

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 (62) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +8 -8
  3. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +8 -8
  4. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +8 -8
  5. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +8 -8
  6. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +9 -15
  7. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.d.vue.ts +3 -4
  8. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue +1 -1
  9. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue.d.ts +3 -4
  10. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +9 -2
  11. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.d.vue.ts +2 -2
  12. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue +32 -52
  13. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue.d.ts +2 -2
  14. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/runtime.vue +19 -8
  15. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +2 -2
  16. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.js +4 -3
  17. package/dist/runtime/components/form/utils/state.d.ts +10 -2
  18. package/dist/runtime/components/form/utils/state.js +10 -3
  19. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/config.vue +25 -0
  20. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/runtime.vue +2 -8
  21. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +4 -0
  22. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.js +5 -0
  23. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +133 -0
  24. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue +533 -0
  25. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +133 -0
  26. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.d.vue.ts +9 -0
  27. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue +237 -0
  28. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/runtime.vue.d.ts +9 -0
  29. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.d.ts +124 -0
  30. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.js +96 -0
  31. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.d.vue.ts +10 -0
  32. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue +475 -0
  33. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue.d.ts +10 -0
  34. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.d.vue.ts +9 -0
  35. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.vue +156 -0
  36. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/runtime.vue.d.ts +9 -0
  37. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +56 -0
  38. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.js +81 -0
  39. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.d.vue.ts +10 -0
  40. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue +292 -0
  41. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue.d.ts +10 -0
  42. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.d.vue.ts +9 -0
  43. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.vue +140 -0
  44. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/runtime.vue.d.ts +9 -0
  45. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.d.ts +50 -0
  46. package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.js +53 -0
  47. package/dist/runtime/components/table/config.d.vue.ts +2 -0
  48. package/dist/runtime/components/table/config.vue +136 -109
  49. package/dist/runtime/components/table/config.vue.d.ts +2 -0
  50. package/dist/runtime/components/table/index.d.vue.ts +2 -2
  51. package/dist/runtime/components/table/index.vue +46 -53
  52. package/dist/runtime/components/table/index.vue.d.ts +2 -2
  53. package/dist/runtime/components/table/row-provider.d.vue.ts +23 -0
  54. package/dist/runtime/components/table/row-provider.vue +55 -0
  55. package/dist/runtime/components/table/row-provider.vue.d.ts +23 -0
  56. package/dist/runtime/components/table/schema.d.ts +17 -29
  57. package/dist/runtime/components/table/schema.js +22 -18
  58. package/dist/runtime/components/table/utils/shared.d.ts +28 -0
  59. package/dist/runtime/components/table/utils/shared.js +40 -0
  60. package/dist/runtime/components/ui/field/index.js +6 -1
  61. package/dist/runtime/components/ui/input/Input.vue +1 -1
  62. package/package.json +1 -1
@@ -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;