@shwfed/config 2.0.3 → 2.1.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 (92) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/config/blocks/2026-05-17/{com.shwfed.block.chart.line → com.shwfed.block.chart.xy}/config.d.vue.ts +16 -6
  3. package/dist/runtime/components/config/blocks/2026-05-17/{com.shwfed.block.chart.line → com.shwfed.block.chart.xy}/config.vue +263 -76
  4. package/dist/runtime/components/config/blocks/2026-05-17/{com.shwfed.block.chart.line → com.shwfed.block.chart.xy}/config.vue.d.ts +16 -6
  5. package/dist/runtime/components/config/blocks/2026-05-17/{com.shwfed.block.chart.line → com.shwfed.block.chart.xy}/runtime.d.vue.ts +16 -6
  6. package/dist/runtime/components/config/blocks/2026-05-17/{com.shwfed.block.chart.line → com.shwfed.block.chart.xy}/runtime.vue +104 -12
  7. package/dist/runtime/components/config/blocks/2026-05-17/{com.shwfed.block.chart.line → com.shwfed.block.chart.xy}/runtime.vue.d.ts +16 -6
  8. package/dist/runtime/components/config/blocks/2026-05-17/{com.shwfed.block.chart.line → com.shwfed.block.chart.xy}/schema.d.ts +51 -15
  9. package/dist/runtime/components/config/blocks/2026-05-17/{com.shwfed.block.chart.line → com.shwfed.block.chart.xy}/schema.js +67 -22
  10. package/dist/runtime/components/form/ai/fields-button.d.vue.ts +13 -0
  11. package/dist/runtime/components/form/ai/fields-button.vue +458 -0
  12. package/dist/runtime/components/form/ai/fields-button.vue.d.ts +13 -0
  13. package/dist/runtime/components/form/ai/fields-task.md +71 -0
  14. package/dist/runtime/components/form/config.d.vue.ts +1 -1
  15. package/dist/runtime/components/form/config.vue +4 -36
  16. package/dist/runtime/components/form/config.vue.d.ts +1 -1
  17. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +18 -18
  18. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +18 -18
  19. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +4 -4
  20. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +4 -4
  21. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +22 -22
  22. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +22 -22
  23. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +2 -2
  24. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +2 -2
  25. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +4 -4
  26. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +4 -4
  27. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +12 -12
  28. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue +87 -11
  29. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +12 -12
  30. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/runtime.vue +18 -6
  31. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +1 -1
  32. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.js +11 -4
  33. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +10 -10
  34. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +10 -10
  35. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.d.vue.ts +12 -12
  36. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.vue.d.ts +12 -12
  37. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts +2 -2
  38. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue +15 -0
  39. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts +2 -2
  40. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.d.vue.ts +1 -0
  41. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue +13 -4
  42. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue.d.ts +1 -0
  43. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +1 -0
  44. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +1 -1
  45. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +5 -1
  46. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.d.vue.ts +131 -0
  47. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue +170 -0
  48. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue.d.ts +131 -0
  49. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/runtime.d.vue.ts +8 -0
  50. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/runtime.vue +52 -0
  51. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/runtime.vue.d.ts +8 -0
  52. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +112 -0
  53. package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.js +44 -0
  54. package/dist/runtime/components/form/index.vue +5 -4
  55. package/dist/runtime/components/form/schema.d.ts +10 -0
  56. package/dist/runtime/components/form/schema.js +6 -2
  57. package/dist/runtime/components/form/unit-config.d.vue.ts +16 -0
  58. package/dist/runtime/components/form/unit-config.vue +30 -3
  59. package/dist/runtime/components/form/unit-config.vue.d.ts +16 -0
  60. package/dist/runtime/components/form/utils/cel-scope.d.ts +13 -0
  61. package/dist/runtime/components/form/utils/cel-scope.js +32 -0
  62. package/dist/runtime/components/form/utils/schema-meta.d.ts +13 -0
  63. package/dist/runtime/components/form/utils/schema-meta.js +15 -0
  64. package/dist/runtime/components/table/ai/columns-task.md +10 -1
  65. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/config.vue +2 -2
  66. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/runtime.vue +14 -4
  67. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/schema.js +3 -2
  68. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/config.vue +2 -2
  69. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/runtime.vue +14 -4
  70. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.js +3 -2
  71. package/dist/runtime/components/table/config.d.vue.ts +11 -1
  72. package/dist/runtime/components/table/config.vue +4 -0
  73. package/dist/runtime/components/table/config.vue.d.ts +11 -1
  74. package/dist/runtime/components/table/index.d.vue.ts +4 -0
  75. package/dist/runtime/components/table/index.vue +28 -2
  76. package/dist/runtime/components/table/index.vue.d.ts +4 -0
  77. package/dist/runtime/components/table/schema.d.ts +12 -0
  78. package/dist/runtime/components/table/schema.js +6 -1
  79. package/dist/runtime/components/table/utils/shared.d.ts +2 -1
  80. package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.d.vue.ts +1 -1
  81. package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.vue.d.ts +1 -1
  82. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +1 -1
  83. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +1 -1
  84. package/dist/runtime/share/expression.d.ts +1 -2
  85. package/dist/runtime/share/slot-renderer.vue +7 -6
  86. package/dist/runtime/vendor/cel-js/CLAUDE.md +1 -1
  87. package/dist/runtime/vendor/cel-js/PROMPT.md +12 -3
  88. package/dist/runtime/vendor/cel-js/lib/http-builder.d.ts +10 -3
  89. package/dist/runtime/vendor/cel-js/lib/http-builder.js +28 -5
  90. package/dist/runtime/vendor/cel-js/lib/http-builtins.d.ts +4 -3
  91. package/dist/runtime/vendor/cel-js/lib/http-builtins.js +4 -0
  92. package/package.json +1 -1
@@ -0,0 +1,131 @@
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 label?: readonly [{
8
+ readonly locale: "zh";
9
+ readonly message: string;
10
+ }, ...{
11
+ readonly locale: "en" | "ja" | "ko";
12
+ readonly message: string;
13
+ }[]] | undefined;
14
+ readonly type: "com.shwfed.form.field.table";
15
+ readonly id: string;
16
+ readonly table: Readonly<{
17
+ kind: "shwfed.component.table";
18
+ id?: string;
19
+ displayName?: string;
20
+ columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
21
+ groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
22
+ dataSource: Readonly<{
23
+ request?: string;
24
+ data: string;
25
+ total?: string;
26
+ }>;
27
+ actions?: import("../../../../table/schema.js").TableActionsValue;
28
+ query?: import("../../../schema.js").FormConfigValue;
29
+ cellStyle?: string;
30
+ style?: string;
31
+ pagination?: import("effect/Schema").Schema.Type<typeof import("../../../../table/schema.js").Pagination>;
32
+ initialState?: import("effect/Schema").Schema.Type<import("effect/Schema").Struct<{
33
+ columnVisibility: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>>;
34
+ columnOrder: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
35
+ columnPinning: import("effect/Schema").optional<import("effect/Schema").Struct<{
36
+ left: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
37
+ right: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
38
+ }>>;
39
+ rowPinning: import("effect/Schema").optional<import("effect/Schema").Struct<{
40
+ top: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
41
+ bottom: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
42
+ }>>;
43
+ sorting: import("effect/Schema").optional<import("effect/Schema").Array$<import("effect/Schema").Struct<{
44
+ id: import("effect/Schema").SchemaClass<string, string, never>;
45
+ desc: import("effect/Schema").optionalWith<typeof import("effect/Schema").Boolean, {
46
+ default: () => false;
47
+ }>;
48
+ }>>>;
49
+ expanded: import("effect/Schema").optional<import("effect/Schema").Union<[typeof import("effect/Schema").Boolean, import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>]>>;
50
+ grouping: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
51
+ columnSizing: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Number>>;
52
+ rowSelection: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>>;
53
+ }>>;
54
+ }>;
55
+ readonly hidden?: string | undefined;
56
+ readonly tooltip?: readonly [{
57
+ readonly locale: "zh";
58
+ readonly message: string;
59
+ }, ...{
60
+ readonly locale: "en" | "ja" | "ko";
61
+ readonly message: string;
62
+ }[]] | undefined;
63
+ readonly displayName?: string | undefined;
64
+ readonly compatibilityDate: "2026-05-18";
65
+ readonly binding?: string | undefined;
66
+ }) => any;
67
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
68
+ "onUpdate:modelValue"?: ((value: {
69
+ readonly label?: readonly [{
70
+ readonly locale: "zh";
71
+ readonly message: string;
72
+ }, ...{
73
+ readonly locale: "en" | "ja" | "ko";
74
+ readonly message: string;
75
+ }[]] | undefined;
76
+ readonly type: "com.shwfed.form.field.table";
77
+ readonly id: string;
78
+ readonly table: Readonly<{
79
+ kind: "shwfed.component.table";
80
+ id?: string;
81
+ displayName?: string;
82
+ columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
83
+ groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
84
+ dataSource: Readonly<{
85
+ request?: string;
86
+ data: string;
87
+ total?: string;
88
+ }>;
89
+ actions?: import("../../../../table/schema.js").TableActionsValue;
90
+ query?: import("../../../schema.js").FormConfigValue;
91
+ cellStyle?: string;
92
+ style?: string;
93
+ pagination?: import("effect/Schema").Schema.Type<typeof import("../../../../table/schema.js").Pagination>;
94
+ initialState?: import("effect/Schema").Schema.Type<import("effect/Schema").Struct<{
95
+ columnVisibility: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>>;
96
+ columnOrder: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
97
+ columnPinning: import("effect/Schema").optional<import("effect/Schema").Struct<{
98
+ left: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
99
+ right: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
100
+ }>>;
101
+ rowPinning: import("effect/Schema").optional<import("effect/Schema").Struct<{
102
+ top: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
103
+ bottom: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
104
+ }>>;
105
+ sorting: import("effect/Schema").optional<import("effect/Schema").Array$<import("effect/Schema").Struct<{
106
+ id: import("effect/Schema").SchemaClass<string, string, never>;
107
+ desc: import("effect/Schema").optionalWith<typeof import("effect/Schema").Boolean, {
108
+ default: () => false;
109
+ }>;
110
+ }>>>;
111
+ expanded: import("effect/Schema").optional<import("effect/Schema").Union<[typeof import("effect/Schema").Boolean, import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>]>>;
112
+ grouping: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
113
+ columnSizing: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Number>>;
114
+ rowSelection: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>>;
115
+ }>>;
116
+ }>;
117
+ readonly hidden?: string | undefined;
118
+ readonly tooltip?: readonly [{
119
+ readonly locale: "zh";
120
+ readonly message: string;
121
+ }, ...{
122
+ readonly locale: "en" | "ja" | "ko";
123
+ readonly message: string;
124
+ }[]] | undefined;
125
+ readonly displayName?: string | undefined;
126
+ readonly compatibilityDate: "2026-05-18";
127
+ readonly binding?: string | undefined;
128
+ }) => any) | undefined;
129
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
130
+ declare const _default: typeof __VLS_export;
131
+ export default _default;
@@ -0,0 +1,170 @@
1
+ <script setup>
2
+ import { computed, defineAsyncComponent, inject, onBeforeUnmount, onMounted } from "vue";
3
+ import { ExpressionEditor } from "../../../../ui/expression-editor";
4
+ import { Field, FieldLabel } from "../../../../ui/field";
5
+ import { InputGroup, InputGroupInput } from "../../../../ui/input-group";
6
+ import { Locale as LocaleField } from "../../../../ui/locale";
7
+ import { Markdown } from "../../../../ui/markdown";
8
+ import { FORM_FIELD_LAYOUT_KEY } from "../../../field-layout";
9
+ import { getStructFieldDescription, getStructFieldTitle, registerFormVariablesIfAbsent } from "../../../schema";
10
+ import { schema } from "./schema";
11
+ defineOptions({ name: "ShwfedTableFieldConfig" });
12
+ const TableConfigEditor = defineAsyncComponent(() => import("../../../../table/config.vue"));
13
+ const value = defineModel({ type: null, ...{ required: true } });
14
+ const fieldSchema = schema(() => {
15
+ });
16
+ const fieldTitle = (f) => getStructFieldTitle(fieldSchema, f) ?? f;
17
+ const fieldDescription = (f) => getStructFieldDescription(fieldSchema, f);
18
+ const layout = inject(FORM_FIELD_LAYOUT_KEY, null);
19
+ onMounted(() => {
20
+ if (layout) layout.fullPane.value = true;
21
+ });
22
+ onBeforeUnmount(() => {
23
+ if (layout) layout.fullPane.value = false;
24
+ });
25
+ function configureEmbeddedTable(env) {
26
+ registerFormVariablesIfAbsent(env);
27
+ }
28
+ const tableModel = computed({
29
+ get: () => value.value.table,
30
+ set: (next) => {
31
+ value.value = { ...value.value, table: next };
32
+ }
33
+ });
34
+ const bindingText = computed({
35
+ get: () => value.value.binding ?? "",
36
+ set: (next) => {
37
+ const trimmed = next.trim();
38
+ if (trimmed.length === 0) {
39
+ const { binding: _omit, ...rest } = value.value;
40
+ value.value = rest;
41
+ } else {
42
+ value.value = { ...value.value, binding: trimmed };
43
+ }
44
+ }
45
+ });
46
+ function setDisplayName(v) {
47
+ const s = String(v ?? "");
48
+ value.value = { ...value.value, displayName: s.length > 0 ? s : void 0 };
49
+ }
50
+ </script>
51
+
52
+ <template>
53
+ <TableConfigEditor
54
+ v-model="tableModel"
55
+ :configure="configureEmbeddedTable"
56
+ >
57
+ <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"
101
+ />
102
+ </InputGroup>
103
+ </Field>
104
+ </div>
105
+
106
+ <div class="grid grid-cols-2 gap-3">
107
+ <Field orientation="vertical">
108
+ <FieldLabel class="text-xs text-zinc-500">
109
+ <template
110
+ v-if="fieldDescription('label')"
111
+ #tooltip
112
+ >
113
+ <Markdown
114
+ :source="fieldDescription('label')"
115
+ block
116
+ class="prose prose-sm prose-zinc"
117
+ />
118
+ </template>
119
+ {{ fieldTitle("label") }}
120
+ </FieldLabel>
121
+ <LocaleField
122
+ :model-value="value.label"
123
+ @update:model-value="(v) => value = { ...value, label: v }"
124
+ />
125
+ </Field>
126
+
127
+ <Field orientation="vertical">
128
+ <FieldLabel class="text-xs text-zinc-500">
129
+ <template
130
+ v-if="fieldDescription('tooltip')"
131
+ #tooltip
132
+ >
133
+ <Markdown
134
+ :source="fieldDescription('tooltip')"
135
+ block
136
+ class="prose prose-sm prose-zinc"
137
+ />
138
+ </template>
139
+ {{ fieldTitle("tooltip") }}
140
+ </FieldLabel>
141
+ <LocaleField
142
+ markdown
143
+ :model-value="value.tooltip"
144
+ @update:model-value="(v) => value = { ...value, tooltip: v }"
145
+ />
146
+ </Field>
147
+ </div>
148
+
149
+ <Field orientation="vertical">
150
+ <FieldLabel class="text-xs text-zinc-500">
151
+ <template #tooltip>
152
+ <Markdown
153
+ :source="fieldDescription('hidden') ?? '\u8FD4\u56DE `true` \u65F6\u5B57\u6BB5\u5728\u6240\u6709\u5E03\u5C40\u4E2D\u90FD\u4E0D\u6E32\u67D3'"
154
+ block
155
+ class="prose prose-sm prose-zinc"
156
+ />
157
+ </template>
158
+ {{ fieldTitle("hidden") }}
159
+ </FieldLabel>
160
+ <ExpressionEditor
161
+ :model-value="value.hidden ?? ''"
162
+ placeholder="例:form.role == 'guest'"
163
+ result-type="bool"
164
+ class="min-h-10"
165
+ @update:model-value="(v) => value = { ...value, hidden: v.length > 0 ? v : void 0 }"
166
+ />
167
+ </Field>
168
+ </template>
169
+ </TableConfigEditor>
170
+ </template>
@@ -0,0 +1,131 @@
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 label?: readonly [{
8
+ readonly locale: "zh";
9
+ readonly message: string;
10
+ }, ...{
11
+ readonly locale: "en" | "ja" | "ko";
12
+ readonly message: string;
13
+ }[]] | undefined;
14
+ readonly type: "com.shwfed.form.field.table";
15
+ readonly id: string;
16
+ readonly table: Readonly<{
17
+ kind: "shwfed.component.table";
18
+ id?: string;
19
+ displayName?: string;
20
+ columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
21
+ groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
22
+ dataSource: Readonly<{
23
+ request?: string;
24
+ data: string;
25
+ total?: string;
26
+ }>;
27
+ actions?: import("../../../../table/schema.js").TableActionsValue;
28
+ query?: import("../../../schema.js").FormConfigValue;
29
+ cellStyle?: string;
30
+ style?: string;
31
+ pagination?: import("effect/Schema").Schema.Type<typeof import("../../../../table/schema.js").Pagination>;
32
+ initialState?: import("effect/Schema").Schema.Type<import("effect/Schema").Struct<{
33
+ columnVisibility: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>>;
34
+ columnOrder: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
35
+ columnPinning: import("effect/Schema").optional<import("effect/Schema").Struct<{
36
+ left: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
37
+ right: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
38
+ }>>;
39
+ rowPinning: import("effect/Schema").optional<import("effect/Schema").Struct<{
40
+ top: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
41
+ bottom: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
42
+ }>>;
43
+ sorting: import("effect/Schema").optional<import("effect/Schema").Array$<import("effect/Schema").Struct<{
44
+ id: import("effect/Schema").SchemaClass<string, string, never>;
45
+ desc: import("effect/Schema").optionalWith<typeof import("effect/Schema").Boolean, {
46
+ default: () => false;
47
+ }>;
48
+ }>>>;
49
+ expanded: import("effect/Schema").optional<import("effect/Schema").Union<[typeof import("effect/Schema").Boolean, import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>]>>;
50
+ grouping: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
51
+ columnSizing: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Number>>;
52
+ rowSelection: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>>;
53
+ }>>;
54
+ }>;
55
+ readonly hidden?: string | undefined;
56
+ readonly tooltip?: readonly [{
57
+ readonly locale: "zh";
58
+ readonly message: string;
59
+ }, ...{
60
+ readonly locale: "en" | "ja" | "ko";
61
+ readonly message: string;
62
+ }[]] | undefined;
63
+ readonly displayName?: string | undefined;
64
+ readonly compatibilityDate: "2026-05-18";
65
+ readonly binding?: string | undefined;
66
+ }) => any;
67
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
68
+ "onUpdate:modelValue"?: ((value: {
69
+ readonly label?: readonly [{
70
+ readonly locale: "zh";
71
+ readonly message: string;
72
+ }, ...{
73
+ readonly locale: "en" | "ja" | "ko";
74
+ readonly message: string;
75
+ }[]] | undefined;
76
+ readonly type: "com.shwfed.form.field.table";
77
+ readonly id: string;
78
+ readonly table: Readonly<{
79
+ kind: "shwfed.component.table";
80
+ id?: string;
81
+ displayName?: string;
82
+ columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
83
+ groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
84
+ dataSource: Readonly<{
85
+ request?: string;
86
+ data: string;
87
+ total?: string;
88
+ }>;
89
+ actions?: import("../../../../table/schema.js").TableActionsValue;
90
+ query?: import("../../../schema.js").FormConfigValue;
91
+ cellStyle?: string;
92
+ style?: string;
93
+ pagination?: import("effect/Schema").Schema.Type<typeof import("../../../../table/schema.js").Pagination>;
94
+ initialState?: import("effect/Schema").Schema.Type<import("effect/Schema").Struct<{
95
+ columnVisibility: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>>;
96
+ columnOrder: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
97
+ columnPinning: import("effect/Schema").optional<import("effect/Schema").Struct<{
98
+ left: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
99
+ right: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
100
+ }>>;
101
+ rowPinning: import("effect/Schema").optional<import("effect/Schema").Struct<{
102
+ top: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
103
+ bottom: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
104
+ }>>;
105
+ sorting: import("effect/Schema").optional<import("effect/Schema").Array$<import("effect/Schema").Struct<{
106
+ id: import("effect/Schema").SchemaClass<string, string, never>;
107
+ desc: import("effect/Schema").optionalWith<typeof import("effect/Schema").Boolean, {
108
+ default: () => false;
109
+ }>;
110
+ }>>>;
111
+ expanded: import("effect/Schema").optional<import("effect/Schema").Union<[typeof import("effect/Schema").Boolean, import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>]>>;
112
+ grouping: import("effect/Schema").optional<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
113
+ columnSizing: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Number>>;
114
+ rowSelection: import("effect/Schema").optional<import("effect/Schema").Record$<typeof import("effect/Schema").String, typeof import("effect/Schema").Boolean>>;
115
+ }>>;
116
+ }>;
117
+ readonly hidden?: string | undefined;
118
+ readonly tooltip?: readonly [{
119
+ readonly locale: "zh";
120
+ readonly message: string;
121
+ }, ...{
122
+ readonly locale: "en" | "ja" | "ko";
123
+ readonly message: string;
124
+ }[]] | undefined;
125
+ readonly displayName?: string | undefined;
126
+ readonly compatibilityDate: "2026-05-18";
127
+ readonly binding?: string | undefined;
128
+ }) => any) | undefined;
129
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
130
+ declare const _default: typeof __VLS_export;
131
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import type { Value } from './schema.js';
2
+ type __VLS_Props = {
3
+ fieldId: string;
4
+ config: Value;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,52 @@
1
+ <script setup>
2
+ import { computed, defineAsyncComponent } from "vue";
3
+ import { useI18n } from "vue-i18n";
4
+ import { getLocalizedText } from "../../../../../share/locale";
5
+ import { Field, FieldLabel } from "../../../../ui/field";
6
+ import { Markdown } from "../../../../ui/markdown";
7
+ import { useFormState } from "../../../utils/state";
8
+ defineOptions({ name: "ShwfedTableFieldRuntime" });
9
+ const ShwfedTable = defineAsyncComponent(() => import("../../../../table/index.vue"));
10
+ const props = defineProps({
11
+ fieldId: { type: String, required: true },
12
+ config: { type: null, required: true }
13
+ });
14
+ const { locale } = useI18n();
15
+ const { setAtSilent } = useFormState();
16
+ const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
17
+ const tooltipText = computed(
18
+ () => props.config.tooltip ? getLocalizedText(props.config.tooltip, locale.value) : void 0
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
+ }
26
+ </script>
27
+
28
+ <template>
29
+ <Field orientation="vertical">
30
+ <FieldLabel
31
+ v-if="labelText"
32
+ :for="fieldId"
33
+ class="text-xs text-zinc-500"
34
+ >
35
+ <template
36
+ v-if="tooltipText"
37
+ #tooltip
38
+ >
39
+ <Markdown
40
+ :source="tooltipText"
41
+ class="prose prose-xs prose-zinc"
42
+ />
43
+ </template>
44
+ {{ labelText }}
45
+ </FieldLabel>
46
+
47
+ <ShwfedTable
48
+ :config="tableConfig"
49
+ @update:rows="onRows"
50
+ />
51
+ </Field>
52
+ </template>
@@ -0,0 +1,8 @@
1
+ import type { Value } from './schema.js';
2
+ type __VLS_Props = {
3
+ fieldId: string;
4
+ config: Value;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,112 @@
1
+ import { Schema } from 'effect';
2
+ import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
3
+ export declare const type: "com.shwfed.form.field.table";
4
+ export declare const compatibilityDate: "2026-05-18";
5
+ export declare const metadata: {
6
+ readonly name: "表格";
7
+ readonly icon: "fluent:table-20-regular";
8
+ readonly w: {
9
+ readonly initial: 12;
10
+ readonly min: 6;
11
+ readonly max: number;
12
+ };
13
+ readonly h: {
14
+ readonly initial: 10;
15
+ readonly min: 5;
16
+ readonly max: number;
17
+ readonly grow: true;
18
+ };
19
+ };
20
+ export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
21
+ label: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
22
+ locale: Schema.Literal<["zh"]>;
23
+ message: Schema.SchemaClass<string, string, never>;
24
+ }>], [Schema.Struct<{
25
+ locale: Schema.Literal<["ja", "en", "ko"]>;
26
+ message: Schema.SchemaClass<string, string, never>;
27
+ }>]>>;
28
+ tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
29
+ locale: Schema.Literal<["zh"]>;
30
+ message: Schema.SchemaClass<string, string, never>;
31
+ }>], [Schema.Struct<{
32
+ locale: Schema.Literal<["ja", "en", "ko"]>;
33
+ message: Schema.SchemaClass<string, string, never>;
34
+ }>]>>;
35
+ binding: Schema.optional<Schema.refine<string, typeof Schema.String>>;
36
+ table: Schema.suspend<Readonly<{
37
+ kind: "shwfed.component.table";
38
+ id?: string;
39
+ displayName?: string;
40
+ columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
41
+ groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
42
+ dataSource: import("../../../../table/schema.js").DataSourceValue;
43
+ actions?: import("../../../../table/schema.js").TableActionsValue;
44
+ query?: import("../../../schema.js").FormConfigValue;
45
+ cellStyle?: string;
46
+ style?: string;
47
+ pagination?: Schema.Schema.Type<typeof import("../../../../table/schema.js").Pagination>;
48
+ initialState?: Schema.Schema.Type<Schema.Struct<{
49
+ columnVisibility: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Boolean>>;
50
+ columnOrder: Schema.optional<Schema.Array$<typeof Schema.String>>;
51
+ columnPinning: Schema.optional<Schema.Struct<{
52
+ left: Schema.optional<Schema.Array$<typeof Schema.String>>;
53
+ right: Schema.optional<Schema.Array$<typeof Schema.String>>;
54
+ }>>;
55
+ rowPinning: Schema.optional<Schema.Struct<{
56
+ top: Schema.optional<Schema.Array$<typeof Schema.String>>;
57
+ bottom: Schema.optional<Schema.Array$<typeof Schema.String>>;
58
+ }>>;
59
+ sorting: Schema.optional<Schema.Array$<Schema.Struct<{
60
+ id: Schema.SchemaClass<string, string, never>;
61
+ desc: Schema.optionalWith<typeof Schema.Boolean, {
62
+ default: () => false;
63
+ }>;
64
+ }>>>;
65
+ expanded: Schema.optional<Schema.Union<[typeof Schema.Boolean, Schema.Record$<typeof Schema.String, typeof Schema.Boolean>]>>;
66
+ grouping: Schema.optional<Schema.Array$<typeof Schema.String>>;
67
+ columnSizing: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Number>>;
68
+ rowSelection: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Boolean>>;
69
+ }>>;
70
+ }>, Readonly<{
71
+ kind: "shwfed.component.table";
72
+ id?: string;
73
+ displayName?: string;
74
+ columns: ReadonlyArray<import("../../../../table/schema.js").ColumnValue>;
75
+ groups: ReadonlyArray<import("../../../../table/schema.js").ColumnGroupValue>;
76
+ dataSource: import("../../../../table/schema.js").DataSourceValue;
77
+ actions?: import("../../../../table/schema.js").TableActionsValue;
78
+ query?: import("../../../schema.js").FormConfigValue;
79
+ cellStyle?: string;
80
+ style?: string;
81
+ pagination?: Schema.Schema.Type<typeof import("../../../../table/schema.js").Pagination>;
82
+ initialState?: Schema.Schema.Type<Schema.Struct<{
83
+ columnVisibility: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Boolean>>;
84
+ columnOrder: Schema.optional<Schema.Array$<typeof Schema.String>>;
85
+ columnPinning: Schema.optional<Schema.Struct<{
86
+ left: Schema.optional<Schema.Array$<typeof Schema.String>>;
87
+ right: Schema.optional<Schema.Array$<typeof Schema.String>>;
88
+ }>>;
89
+ rowPinning: Schema.optional<Schema.Struct<{
90
+ top: Schema.optional<Schema.Array$<typeof Schema.String>>;
91
+ bottom: Schema.optional<Schema.Array$<typeof Schema.String>>;
92
+ }>>;
93
+ sorting: Schema.optional<Schema.Array$<Schema.Struct<{
94
+ id: Schema.SchemaClass<string, string, never>;
95
+ desc: Schema.optionalWith<typeof Schema.Boolean, {
96
+ default: () => false;
97
+ }>;
98
+ }>>>;
99
+ expanded: Schema.optional<Schema.Union<[typeof Schema.Boolean, Schema.Record$<typeof Schema.String, typeof Schema.Boolean>]>>;
100
+ grouping: Schema.optional<Schema.Array$<typeof Schema.String>>;
101
+ columnSizing: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Number>>;
102
+ rowSelection: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.Boolean>>;
103
+ }>>;
104
+ }>, never>;
105
+ id: Schema.refine<string, typeof Schema.String>;
106
+ displayName: Schema.optional<Schema.SchemaClass<string, string, never>>;
107
+ hidden: Schema.optional<Schema.Schema<string, string, never>>;
108
+ type: Schema.Literal<["com.shwfed.form.field.table"]>;
109
+ compatibilityDate: Schema.Literal<["2026-05-18"]>;
110
+ }>;
111
+ export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
112
+ export declare function defaults(): Partial<Value>;