@shwfed/config 3.0.4 → 3.0.7
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.
- package/dist/module.json +1 -1
- package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/runtime.vue +4 -10
- package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.d.ts +1 -1
- package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/schema.js +2 -2
- package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/runtime.vue +1 -1
- package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/schema.d.ts +4 -2
- package/dist/runtime/components/actions/buttons/2026-07-13/com.shwfed.actions.button.state.write/schema.js +1 -1
- package/dist/runtime/components/actions/config.vue +109 -3
- package/dist/runtime/components/actions/utils/steps.d.ts +1 -1
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +74 -74
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +74 -74
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +74 -74
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +74 -74
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +37 -37
- package/dist/runtime/components/config/history-picker.vue +6 -4
- package/dist/runtime/components/config/index.vue +25 -0
- package/dist/runtime/components/config/prune-dialog.d.vue.ts +14 -0
- package/dist/runtime/components/config/prune-dialog.vue +83 -0
- package/dist/runtime/components/config/prune-dialog.vue.d.ts +14 -0
- package/dist/runtime/components/config/schema.js +2 -2
- package/dist/runtime/components/config/use-editor.d.ts +9 -0
- package/dist/runtime/components/config/use-editor.js +39 -11
- package/dist/runtime/components/config/utils/linkage.d.ts +8 -0
- package/dist/runtime/components/config/utils/linkage.js +7 -2
- package/dist/runtime/components/config/utils/prune.d.ts +68 -0
- package/dist/runtime/components/config/utils/prune.js +92 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/config.d.vue.ts +31 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/config.vue +191 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/config.vue.d.ts +31 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/expand.d.ts +49 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/expand.js +87 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/runtime.vue +72 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/schema.d.ts +59 -0
- package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/schema.js +139 -0
- package/dist/runtime/components/form/unit-config.vue +2 -2
- package/dist/runtime/components/form/utils/form-vars.d.ts +5 -15
- package/dist/runtime/components/form/utils/form-vars.js +12 -6
- package/dist/runtime/components/operations/2026-06-11/com.shwfed.operation.http.request.json/schema.js +2 -2
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.http.download/schema.js +2 -2
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.navigation/runtime.js +5 -11
- package/dist/runtime/components/operations/2026-06-15/com.shwfed.operation.navigation/schema.js +1 -1
- package/dist/runtime/components/operations/utils/resolve.d.ts +1 -1
- package/dist/runtime/components/operations/utils/step-vars.d.ts +4 -2
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/runtime.vue +1 -21
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.js +16 -1
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/config.vue +2 -2
- package/dist/runtime/components/table/index.vue +15 -0
- package/dist/runtime/components/table/schema.d.ts +74 -74
- package/dist/runtime/components/table/utils/resolve.d.ts +26 -0
- package/dist/runtime/components/table/utils/resolve.js +2 -1
- package/dist/runtime/components/ui/expression-editor/picker-entries.js +1 -1
- package/dist/runtime/components/ui/expression-editor/step-chip-extension.js +1 -1
- package/dist/runtime/components/ui/expression-editor/step-refs.js +1 -1
- package/dist/runtime/share/clipboard.d.ts +15 -9
- package/dist/runtime/share/clipboard.js +22 -10
- package/dist/runtime/share/event-bus.js +2 -2
- package/dist/runtime/share/navigation.d.ts +1 -0
- package/dist/runtime/share/navigation.js +4 -0
- package/dist/runtime/utils/cel-context.d.ts +2 -2
- package/dist/runtime/vendor/cel-js/CLAUDE.md +7 -2
- package/dist/runtime/vendor/cel-js/PROMPT.md +27 -0
- package/dist/runtime/vendor/cel-js/lib/evaluator.js +2 -0
- package/dist/runtime/vendor/cel-js/lib/globals.d.ts +2 -0
- package/dist/runtime/vendor/cel-js/lib/globals.js +10 -0
- package/dist/runtime/vendor/cel-js/lib/map-builtins.d.ts +2 -0
- package/dist/runtime/vendor/cel-js/lib/map-builtins.js +80 -0
- package/dist/runtime/vendor/cel-js/lib/operators.js +2 -12
- package/package.json +1 -1
package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts
CHANGED
|
@@ -39,6 +39,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
39
39
|
readonly mode: "formula" | "prefill";
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
|
+
readonly validations?: readonly {
|
|
43
|
+
readonly message: readonly [{
|
|
44
|
+
readonly locale: "zh";
|
|
45
|
+
readonly message: string;
|
|
46
|
+
}, ...{
|
|
47
|
+
readonly locale: "en" | "ja" | "ko";
|
|
48
|
+
readonly message: string;
|
|
49
|
+
}[]];
|
|
50
|
+
readonly warning?: boolean | undefined;
|
|
51
|
+
readonly when: string;
|
|
52
|
+
}[] | undefined;
|
|
42
53
|
readonly addon?: {
|
|
43
54
|
readonly size: "default" | "sm" | "xs";
|
|
44
55
|
readonly style?: string | undefined;
|
|
@@ -106,17 +117,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
106
117
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
107
118
|
}[];
|
|
108
119
|
} | undefined;
|
|
109
|
-
readonly validations?: readonly {
|
|
110
|
-
readonly message: readonly [{
|
|
111
|
-
readonly locale: "zh";
|
|
112
|
-
readonly message: string;
|
|
113
|
-
}, ...{
|
|
114
|
-
readonly locale: "en" | "ja" | "ko";
|
|
115
|
-
readonly message: string;
|
|
116
|
-
}[]];
|
|
117
|
-
readonly warning?: boolean | undefined;
|
|
118
|
-
readonly when: string;
|
|
119
|
-
}[] | undefined;
|
|
120
120
|
}) => any;
|
|
121
121
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
122
122
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -155,6 +155,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
155
155
|
readonly mode: "formula" | "prefill";
|
|
156
156
|
readonly expression: string;
|
|
157
157
|
} | undefined;
|
|
158
|
+
readonly validations?: readonly {
|
|
159
|
+
readonly message: readonly [{
|
|
160
|
+
readonly locale: "zh";
|
|
161
|
+
readonly message: string;
|
|
162
|
+
}, ...{
|
|
163
|
+
readonly locale: "en" | "ja" | "ko";
|
|
164
|
+
readonly message: string;
|
|
165
|
+
}[]];
|
|
166
|
+
readonly warning?: boolean | undefined;
|
|
167
|
+
readonly when: string;
|
|
168
|
+
}[] | undefined;
|
|
158
169
|
readonly addon?: {
|
|
159
170
|
readonly size: "default" | "sm" | "xs";
|
|
160
171
|
readonly style?: string | undefined;
|
|
@@ -222,17 +233,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
222
233
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
223
234
|
}[];
|
|
224
235
|
} | undefined;
|
|
225
|
-
readonly validations?: readonly {
|
|
226
|
-
readonly message: readonly [{
|
|
227
|
-
readonly locale: "zh";
|
|
228
|
-
readonly message: string;
|
|
229
|
-
}, ...{
|
|
230
|
-
readonly locale: "en" | "ja" | "ko";
|
|
231
|
-
readonly message: string;
|
|
232
|
-
}[]];
|
|
233
|
-
readonly warning?: boolean | undefined;
|
|
234
|
-
readonly when: string;
|
|
235
|
-
}[] | undefined;
|
|
236
236
|
}) => any) | undefined;
|
|
237
237
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
238
238
|
declare const _default: typeof __VLS_export;
|
package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts
CHANGED
|
@@ -39,6 +39,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
39
39
|
readonly mode: "formula" | "prefill";
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
|
+
readonly validations?: readonly {
|
|
43
|
+
readonly message: readonly [{
|
|
44
|
+
readonly locale: "zh";
|
|
45
|
+
readonly message: string;
|
|
46
|
+
}, ...{
|
|
47
|
+
readonly locale: "en" | "ja" | "ko";
|
|
48
|
+
readonly message: string;
|
|
49
|
+
}[]];
|
|
50
|
+
readonly warning?: boolean | undefined;
|
|
51
|
+
readonly when: string;
|
|
52
|
+
}[] | undefined;
|
|
42
53
|
readonly addon?: {
|
|
43
54
|
readonly size: "default" | "sm" | "xs";
|
|
44
55
|
readonly style?: string | undefined;
|
|
@@ -106,17 +117,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
106
117
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
107
118
|
}[];
|
|
108
119
|
} | undefined;
|
|
109
|
-
readonly validations?: readonly {
|
|
110
|
-
readonly message: readonly [{
|
|
111
|
-
readonly locale: "zh";
|
|
112
|
-
readonly message: string;
|
|
113
|
-
}, ...{
|
|
114
|
-
readonly locale: "en" | "ja" | "ko";
|
|
115
|
-
readonly message: string;
|
|
116
|
-
}[]];
|
|
117
|
-
readonly warning?: boolean | undefined;
|
|
118
|
-
readonly when: string;
|
|
119
|
-
}[] | undefined;
|
|
120
120
|
}) => any;
|
|
121
121
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
122
122
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -155,6 +155,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
155
155
|
readonly mode: "formula" | "prefill";
|
|
156
156
|
readonly expression: string;
|
|
157
157
|
} | undefined;
|
|
158
|
+
readonly validations?: readonly {
|
|
159
|
+
readonly message: readonly [{
|
|
160
|
+
readonly locale: "zh";
|
|
161
|
+
readonly message: string;
|
|
162
|
+
}, ...{
|
|
163
|
+
readonly locale: "en" | "ja" | "ko";
|
|
164
|
+
readonly message: string;
|
|
165
|
+
}[]];
|
|
166
|
+
readonly warning?: boolean | undefined;
|
|
167
|
+
readonly when: string;
|
|
168
|
+
}[] | undefined;
|
|
158
169
|
readonly addon?: {
|
|
159
170
|
readonly size: "default" | "sm" | "xs";
|
|
160
171
|
readonly style?: string | undefined;
|
|
@@ -222,17 +233,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
222
233
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
223
234
|
}[];
|
|
224
235
|
} | undefined;
|
|
225
|
-
readonly validations?: readonly {
|
|
226
|
-
readonly message: readonly [{
|
|
227
|
-
readonly locale: "zh";
|
|
228
|
-
readonly message: string;
|
|
229
|
-
}, ...{
|
|
230
|
-
readonly locale: "en" | "ja" | "ko";
|
|
231
|
-
readonly message: string;
|
|
232
|
-
}[]];
|
|
233
|
-
readonly warning?: boolean | undefined;
|
|
234
|
-
readonly when: string;
|
|
235
|
-
}[] | undefined;
|
|
236
236
|
}) => any) | undefined;
|
|
237
237
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
238
238
|
declare const _default: typeof __VLS_export;
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts
CHANGED
|
@@ -42,6 +42,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
42
42
|
readonly mode: "formula" | "prefill";
|
|
43
43
|
readonly expression: string;
|
|
44
44
|
} | undefined;
|
|
45
|
+
readonly validations?: readonly {
|
|
46
|
+
readonly message: readonly [{
|
|
47
|
+
readonly locale: "zh";
|
|
48
|
+
readonly message: string;
|
|
49
|
+
}, ...{
|
|
50
|
+
readonly locale: "en" | "ja" | "ko";
|
|
51
|
+
readonly message: string;
|
|
52
|
+
}[]];
|
|
53
|
+
readonly warning?: boolean | undefined;
|
|
54
|
+
readonly when: string;
|
|
55
|
+
}[] | undefined;
|
|
45
56
|
readonly addon?: {
|
|
46
57
|
readonly size: "default" | "sm" | "xs";
|
|
47
58
|
readonly style?: string | undefined;
|
|
@@ -109,17 +120,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
109
120
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
110
121
|
}[];
|
|
111
122
|
} | undefined;
|
|
112
|
-
readonly validations?: readonly {
|
|
113
|
-
readonly message: readonly [{
|
|
114
|
-
readonly locale: "zh";
|
|
115
|
-
readonly message: string;
|
|
116
|
-
}, ...{
|
|
117
|
-
readonly locale: "en" | "ja" | "ko";
|
|
118
|
-
readonly message: string;
|
|
119
|
-
}[]];
|
|
120
|
-
readonly warning?: boolean | undefined;
|
|
121
|
-
readonly when: string;
|
|
122
|
-
}[] | undefined;
|
|
123
123
|
readonly precision?: number | undefined;
|
|
124
124
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
125
125
|
readonly valueAsString?: boolean | undefined;
|
|
@@ -165,6 +165,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
165
165
|
readonly mode: "formula" | "prefill";
|
|
166
166
|
readonly expression: string;
|
|
167
167
|
} | undefined;
|
|
168
|
+
readonly validations?: readonly {
|
|
169
|
+
readonly message: readonly [{
|
|
170
|
+
readonly locale: "zh";
|
|
171
|
+
readonly message: string;
|
|
172
|
+
}, ...{
|
|
173
|
+
readonly locale: "en" | "ja" | "ko";
|
|
174
|
+
readonly message: string;
|
|
175
|
+
}[]];
|
|
176
|
+
readonly warning?: boolean | undefined;
|
|
177
|
+
readonly when: string;
|
|
178
|
+
}[] | undefined;
|
|
168
179
|
readonly addon?: {
|
|
169
180
|
readonly size: "default" | "sm" | "xs";
|
|
170
181
|
readonly style?: string | undefined;
|
|
@@ -232,17 +243,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
232
243
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
233
244
|
}[];
|
|
234
245
|
} | undefined;
|
|
235
|
-
readonly validations?: readonly {
|
|
236
|
-
readonly message: readonly [{
|
|
237
|
-
readonly locale: "zh";
|
|
238
|
-
readonly message: string;
|
|
239
|
-
}, ...{
|
|
240
|
-
readonly locale: "en" | "ja" | "ko";
|
|
241
|
-
readonly message: string;
|
|
242
|
-
}[]];
|
|
243
|
-
readonly warning?: boolean | undefined;
|
|
244
|
-
readonly when: string;
|
|
245
|
-
}[] | undefined;
|
|
246
246
|
readonly precision?: number | undefined;
|
|
247
247
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
248
248
|
readonly valueAsString?: boolean | undefined;
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts
CHANGED
|
@@ -42,6 +42,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
42
42
|
readonly mode: "formula" | "prefill";
|
|
43
43
|
readonly expression: string;
|
|
44
44
|
} | undefined;
|
|
45
|
+
readonly validations?: readonly {
|
|
46
|
+
readonly message: readonly [{
|
|
47
|
+
readonly locale: "zh";
|
|
48
|
+
readonly message: string;
|
|
49
|
+
}, ...{
|
|
50
|
+
readonly locale: "en" | "ja" | "ko";
|
|
51
|
+
readonly message: string;
|
|
52
|
+
}[]];
|
|
53
|
+
readonly warning?: boolean | undefined;
|
|
54
|
+
readonly when: string;
|
|
55
|
+
}[] | undefined;
|
|
45
56
|
readonly addon?: {
|
|
46
57
|
readonly size: "default" | "sm" | "xs";
|
|
47
58
|
readonly style?: string | undefined;
|
|
@@ -109,17 +120,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
109
120
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
110
121
|
}[];
|
|
111
122
|
} | undefined;
|
|
112
|
-
readonly validations?: readonly {
|
|
113
|
-
readonly message: readonly [{
|
|
114
|
-
readonly locale: "zh";
|
|
115
|
-
readonly message: string;
|
|
116
|
-
}, ...{
|
|
117
|
-
readonly locale: "en" | "ja" | "ko";
|
|
118
|
-
readonly message: string;
|
|
119
|
-
}[]];
|
|
120
|
-
readonly warning?: boolean | undefined;
|
|
121
|
-
readonly when: string;
|
|
122
|
-
}[] | undefined;
|
|
123
123
|
readonly precision?: number | undefined;
|
|
124
124
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
125
125
|
readonly valueAsString?: boolean | undefined;
|
|
@@ -165,6 +165,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
165
165
|
readonly mode: "formula" | "prefill";
|
|
166
166
|
readonly expression: string;
|
|
167
167
|
} | undefined;
|
|
168
|
+
readonly validations?: readonly {
|
|
169
|
+
readonly message: readonly [{
|
|
170
|
+
readonly locale: "zh";
|
|
171
|
+
readonly message: string;
|
|
172
|
+
}, ...{
|
|
173
|
+
readonly locale: "en" | "ja" | "ko";
|
|
174
|
+
readonly message: string;
|
|
175
|
+
}[]];
|
|
176
|
+
readonly warning?: boolean | undefined;
|
|
177
|
+
readonly when: string;
|
|
178
|
+
}[] | undefined;
|
|
168
179
|
readonly addon?: {
|
|
169
180
|
readonly size: "default" | "sm" | "xs";
|
|
170
181
|
readonly style?: string | undefined;
|
|
@@ -232,17 +243,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
232
243
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
233
244
|
}[];
|
|
234
245
|
} | undefined;
|
|
235
|
-
readonly validations?: readonly {
|
|
236
|
-
readonly message: readonly [{
|
|
237
|
-
readonly locale: "zh";
|
|
238
|
-
readonly message: string;
|
|
239
|
-
}, ...{
|
|
240
|
-
readonly locale: "en" | "ja" | "ko";
|
|
241
|
-
readonly message: string;
|
|
242
|
-
}[]];
|
|
243
|
-
readonly warning?: boolean | undefined;
|
|
244
|
-
readonly when: string;
|
|
245
|
-
}[] | undefined;
|
|
246
246
|
readonly precision?: number | undefined;
|
|
247
247
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
248
248
|
readonly valueAsString?: boolean | undefined;
|
package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/config.d.vue.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 type: "com.shwfed.form.field.dynamic";
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly hidden?: string | undefined;
|
|
10
|
+
readonly displayName?: string | undefined;
|
|
11
|
+
readonly transform: string;
|
|
12
|
+
readonly columns?: number | undefined;
|
|
13
|
+
readonly compatibilityDate: "2026-07-13";
|
|
14
|
+
readonly orientation?: "vertical" | "floating" | undefined;
|
|
15
|
+
readonly request: string;
|
|
16
|
+
}) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: {
|
|
19
|
+
readonly type: "com.shwfed.form.field.dynamic";
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly hidden?: string | undefined;
|
|
22
|
+
readonly displayName?: string | undefined;
|
|
23
|
+
readonly transform: string;
|
|
24
|
+
readonly columns?: number | undefined;
|
|
25
|
+
readonly compatibilityDate: "2026-07-13";
|
|
26
|
+
readonly orientation?: "vertical" | "floating" | undefined;
|
|
27
|
+
readonly request: string;
|
|
28
|
+
}) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/config.vue
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Field, FieldLabel } from "../../../../ui/field";
|
|
3
|
+
import { ExpressionEditor } from "../../../../ui/expression-editor";
|
|
4
|
+
import { InputGroup, InputGroupInput } from "../../../../ui/input-group";
|
|
5
|
+
import { Markdown } from "../../../../ui/markdown";
|
|
6
|
+
import {
|
|
7
|
+
Select,
|
|
8
|
+
SelectContent,
|
|
9
|
+
SelectItem,
|
|
10
|
+
SelectTrigger,
|
|
11
|
+
SelectValue
|
|
12
|
+
} from "../../../../ui/select";
|
|
13
|
+
import { getStructFieldDescription, getStructFieldTitle } from "../../../schema";
|
|
14
|
+
import { DEFAULT_FIELD_ORIENTATION, FIELD_ORIENTATION_OPTIONS } from "../../../utils/common";
|
|
15
|
+
import { schema } from "./schema";
|
|
16
|
+
defineOptions({ name: "ShwfedDynamicFieldConfig" });
|
|
17
|
+
const value = defineModel({ type: null, ...{ required: true } });
|
|
18
|
+
const fieldSchema = schema(() => {
|
|
19
|
+
});
|
|
20
|
+
const fieldTitle = (f) => getStructFieldTitle(fieldSchema, f) ?? f;
|
|
21
|
+
const fieldDescription = (f) => getStructFieldDescription(fieldSchema, f);
|
|
22
|
+
const TRANSFORM_VARS = {
|
|
23
|
+
json: { type: "optional<dyn>", label: "HTTP \u54CD\u5E94\u4F53" }
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div class="flex flex-col gap-3">
|
|
29
|
+
<Field orientation="vertical">
|
|
30
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
31
|
+
<template
|
|
32
|
+
v-if="fieldDescription('displayName')"
|
|
33
|
+
#tooltip
|
|
34
|
+
>
|
|
35
|
+
<Markdown
|
|
36
|
+
:source="fieldDescription('displayName')"
|
|
37
|
+
block
|
|
38
|
+
class="prose prose-sm prose-zinc"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|
|
41
|
+
{{ fieldTitle("displayName") }}
|
|
42
|
+
</FieldLabel>
|
|
43
|
+
<InputGroup>
|
|
44
|
+
<InputGroupInput
|
|
45
|
+
:model-value="value.displayName ?? ''"
|
|
46
|
+
placeholder="例:渠道自定义字段"
|
|
47
|
+
@update:model-value="(v) => {
|
|
48
|
+
const s = String(v ?? '');
|
|
49
|
+
value = { ...value, displayName: s.length > 0 ? s : void 0 };
|
|
50
|
+
}"
|
|
51
|
+
/>
|
|
52
|
+
</InputGroup>
|
|
53
|
+
</Field>
|
|
54
|
+
|
|
55
|
+
<Field orientation="vertical">
|
|
56
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
57
|
+
<template
|
|
58
|
+
v-if="fieldDescription('request')"
|
|
59
|
+
#tooltip
|
|
60
|
+
>
|
|
61
|
+
<Markdown
|
|
62
|
+
:source="fieldDescription('request')"
|
|
63
|
+
block
|
|
64
|
+
class="prose prose-sm prose-zinc"
|
|
65
|
+
/>
|
|
66
|
+
</template>
|
|
67
|
+
{{ fieldTitle("request") }}
|
|
68
|
+
</FieldLabel>
|
|
69
|
+
<ExpressionEditor
|
|
70
|
+
:model-value="value.request ?? ''"
|
|
71
|
+
placeholder="如 http.get('/api/fields').query('channel', 'other_inv')"
|
|
72
|
+
result-type="HttpRequest"
|
|
73
|
+
multiline
|
|
74
|
+
class="min-h-20"
|
|
75
|
+
@update:model-value="(v) => value = { ...value, request: v }"
|
|
76
|
+
/>
|
|
77
|
+
</Field>
|
|
78
|
+
|
|
79
|
+
<Field orientation="vertical">
|
|
80
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
81
|
+
<template
|
|
82
|
+
v-if="fieldDescription('transform')"
|
|
83
|
+
#tooltip
|
|
84
|
+
>
|
|
85
|
+
<Markdown
|
|
86
|
+
:source="fieldDescription('transform')"
|
|
87
|
+
block
|
|
88
|
+
class="prose prose-sm prose-zinc"
|
|
89
|
+
/>
|
|
90
|
+
</template>
|
|
91
|
+
{{ fieldTitle("transform") }}
|
|
92
|
+
</FieldLabel>
|
|
93
|
+
<ExpressionEditor
|
|
94
|
+
:model-value="value.transform ?? ''"
|
|
95
|
+
placeholder="如 json.orValue([]).map(f, { 'binding': f.parameter_name, 'label': f.name, 'kind': 'text', 'required': f.is_mandatory })"
|
|
96
|
+
result-type="list"
|
|
97
|
+
multiline
|
|
98
|
+
class="min-h-32"
|
|
99
|
+
:extra-vars="TRANSFORM_VARS"
|
|
100
|
+
@update:model-value="(v) => value = { ...value, transform: v }"
|
|
101
|
+
/>
|
|
102
|
+
</Field>
|
|
103
|
+
|
|
104
|
+
<div class="grid grid-cols-2 gap-3">
|
|
105
|
+
<Field orientation="vertical">
|
|
106
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
107
|
+
<template
|
|
108
|
+
v-if="fieldDescription('columns')"
|
|
109
|
+
#tooltip
|
|
110
|
+
>
|
|
111
|
+
<Markdown
|
|
112
|
+
:source="fieldDescription('columns')"
|
|
113
|
+
block
|
|
114
|
+
class="prose prose-sm prose-zinc"
|
|
115
|
+
/>
|
|
116
|
+
</template>
|
|
117
|
+
{{ fieldTitle("columns") }}
|
|
118
|
+
</FieldLabel>
|
|
119
|
+
<InputGroup>
|
|
120
|
+
<InputGroupInput
|
|
121
|
+
:model-value="value.columns ?? ''"
|
|
122
|
+
type="number"
|
|
123
|
+
min="1"
|
|
124
|
+
step="1"
|
|
125
|
+
placeholder="1"
|
|
126
|
+
@update:model-value="(v) => {
|
|
127
|
+
const n = Math.floor(Number(v));
|
|
128
|
+
value = Number.isFinite(n) && n > 0 ? { ...value, columns: n } : (() => {
|
|
129
|
+
const { columns: _o, ...rest } = value;
|
|
130
|
+
return rest;
|
|
131
|
+
})();
|
|
132
|
+
}"
|
|
133
|
+
/>
|
|
134
|
+
</InputGroup>
|
|
135
|
+
</Field>
|
|
136
|
+
|
|
137
|
+
<Field orientation="vertical">
|
|
138
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
139
|
+
<template
|
|
140
|
+
v-if="fieldDescription('orientation')"
|
|
141
|
+
#tooltip
|
|
142
|
+
>
|
|
143
|
+
<Markdown
|
|
144
|
+
:source="fieldDescription('orientation')"
|
|
145
|
+
block
|
|
146
|
+
class="prose prose-sm prose-zinc"
|
|
147
|
+
/>
|
|
148
|
+
</template>
|
|
149
|
+
{{ fieldTitle("orientation") }}
|
|
150
|
+
</FieldLabel>
|
|
151
|
+
<Select
|
|
152
|
+
:model-value="value.orientation ?? DEFAULT_FIELD_ORIENTATION"
|
|
153
|
+
@update:model-value="(v) => value = { ...value, orientation: v }"
|
|
154
|
+
>
|
|
155
|
+
<SelectTrigger class="w-full">
|
|
156
|
+
<SelectValue />
|
|
157
|
+
</SelectTrigger>
|
|
158
|
+
<SelectContent>
|
|
159
|
+
<SelectItem
|
|
160
|
+
v-for="opt in FIELD_ORIENTATION_OPTIONS"
|
|
161
|
+
:key="opt.value"
|
|
162
|
+
:value="opt.value"
|
|
163
|
+
>
|
|
164
|
+
{{ opt.label }}
|
|
165
|
+
</SelectItem>
|
|
166
|
+
</SelectContent>
|
|
167
|
+
</Select>
|
|
168
|
+
</Field>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<Field orientation="vertical">
|
|
172
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
173
|
+
<template #tooltip>
|
|
174
|
+
<Markdown
|
|
175
|
+
:source="fieldDescription('hidden') ?? '\u8FD4\u56DE `true` \u65F6\u6574\u4E2A\u52A8\u6001\u533A\u57DF\u5728\u6240\u6709\u5E03\u5C40\u4E2D\u90FD\u4E0D\u6E32\u67D3'"
|
|
176
|
+
block
|
|
177
|
+
class="prose prose-sm prose-zinc"
|
|
178
|
+
/>
|
|
179
|
+
</template>
|
|
180
|
+
{{ fieldTitle("hidden") }}
|
|
181
|
+
</FieldLabel>
|
|
182
|
+
<ExpressionEditor
|
|
183
|
+
:model-value="value.hidden ?? ''"
|
|
184
|
+
placeholder="例:form.channel == ''"
|
|
185
|
+
result-type="bool"
|
|
186
|
+
class="min-h-10"
|
|
187
|
+
@update:model-value="(v) => value = { ...value, hidden: v.length > 0 ? v : void 0 }"
|
|
188
|
+
/>
|
|
189
|
+
</Field>
|
|
190
|
+
</div>
|
|
191
|
+
</template>
|
package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/config.vue.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 type: "com.shwfed.form.field.dynamic";
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly hidden?: string | undefined;
|
|
10
|
+
readonly displayName?: string | undefined;
|
|
11
|
+
readonly transform: string;
|
|
12
|
+
readonly columns?: number | undefined;
|
|
13
|
+
readonly compatibilityDate: "2026-07-13";
|
|
14
|
+
readonly orientation?: "vertical" | "floating" | undefined;
|
|
15
|
+
readonly request: string;
|
|
16
|
+
}) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: {
|
|
19
|
+
readonly type: "com.shwfed.form.field.dynamic";
|
|
20
|
+
readonly id: string;
|
|
21
|
+
readonly hidden?: string | undefined;
|
|
22
|
+
readonly displayName?: string | undefined;
|
|
23
|
+
readonly transform: string;
|
|
24
|
+
readonly columns?: number | undefined;
|
|
25
|
+
readonly compatibilityDate: "2026-07-13";
|
|
26
|
+
readonly orientation?: "vertical" | "floating" | undefined;
|
|
27
|
+
readonly request: string;
|
|
28
|
+
}) => any) | undefined;
|
|
29
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/expand.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
import type { FieldValue, FormUnitValue } from '../../../schema.js';
|
|
3
|
+
import type { LayoutSetValue } from '../../../../../share/layout.js';
|
|
4
|
+
export declare const LAYOUT_NAME = "\u52A8\u6001\u5B57\u6BB5";
|
|
5
|
+
/**
|
|
6
|
+
* Looks up a pinned leaf's creation-time `defaults()` seed by
|
|
7
|
+
* `(type, compatibilityDate)` — the registry knowledge the expansion needs for
|
|
8
|
+
* picker parity, injected so this file stays registry-free (the runtime passes
|
|
9
|
+
* a `findField`-backed lookup, tests inject stubs).
|
|
10
|
+
*/
|
|
11
|
+
export type DefaultsLookup = (type: string, compatibilityDate: string) => Record<string, unknown> | undefined;
|
|
12
|
+
/** One initial-value seed: written at `binding` iff that path is currently undefined. */
|
|
13
|
+
export type DynFieldSeed = Readonly<{
|
|
14
|
+
binding: string;
|
|
15
|
+
value: unknown;
|
|
16
|
+
}>;
|
|
17
|
+
export type ExpandResult = Readonly<{
|
|
18
|
+
fields: FieldValue[];
|
|
19
|
+
/** Exactly one synthesized layout — `FormUnitRenderer` requires ≥ 1. */
|
|
20
|
+
layouts: [LayoutSetValue];
|
|
21
|
+
seeds: DynFieldSeed[];
|
|
22
|
+
/** How many list elements were dropped (malformed / duplicate / optionless). */
|
|
23
|
+
dropped: number;
|
|
24
|
+
/** Total elements the transform returned (for the dev aggregate warning). */
|
|
25
|
+
total: number;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Expand a fetched descriptor list into a synthesized form unit.
|
|
29
|
+
*
|
|
30
|
+
* Failure handling (partial-drop, loud — mirrors dyn cols):
|
|
31
|
+
* 1. `transform` throwing / a non-list result → handled by the caller
|
|
32
|
+
* (runtime.vue) for the throw; a non-list reaching here yields zero fields
|
|
33
|
+
* + one warn.
|
|
34
|
+
* 2. per-element decode failure / duplicate `binding` within the block /
|
|
35
|
+
* choice-kind without `options` → drop that element alone, warn with the
|
|
36
|
+
* reason + binding; a dev aggregate count is emitted at the end.
|
|
37
|
+
* 3. a child field's own runtime failure is contained per-field by the form's
|
|
38
|
+
* normal rendering — not here.
|
|
39
|
+
*
|
|
40
|
+
* Ordering is transform-output order. Every child occupies exactly one 1×1
|
|
41
|
+
* grid cell, so `columns` literally means "fields per row" — the semantics the
|
|
42
|
+
* config editor promises. Registry `w.initial` / `h.initial` are deliberately
|
|
43
|
+
* NOT consulted: those step units are calibrated against fine-grained authored
|
|
44
|
+
* grids (text = 8, daterange = 10), so any span math over them collapses to
|
|
45
|
+
* one-field-per-row at realistic block column counts.
|
|
46
|
+
*/
|
|
47
|
+
export declare function expandDynFields(rawList: unknown, block: Value, defaultsOf: DefaultsLookup): ExpandResult;
|
|
48
|
+
/** An empty inner unit for first paint, before the fetch lands. */
|
|
49
|
+
export declare function emptyUnit(block: Value): FormUnitValue;
|
package/dist/runtime/components/form/fields/2026-07-13/com.shwfed.form.field.dynamic/expand.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Either, Schema } from "effect";
|
|
2
|
+
import { CHOICE_KINDS, DynFieldDescriptor, KIND_TO_FIELD } from "./schema.js";
|
|
3
|
+
export const LAYOUT_NAME = "\u52A8\u6001\u5B57\u6BB5";
|
|
4
|
+
function wrapLocale(text) {
|
|
5
|
+
return [{ locale: "zh", message: text }];
|
|
6
|
+
}
|
|
7
|
+
const decodeDescriptor = Schema.decodeUnknownEither(DynFieldDescriptor);
|
|
8
|
+
function buildChild(d, block, defaultsOf) {
|
|
9
|
+
const pin = KIND_TO_FIELD[d.kind];
|
|
10
|
+
const id = `${block.id}::${d.binding}`;
|
|
11
|
+
const field = {
|
|
12
|
+
...defaultsOf(pin.type, pin.compatibilityDate),
|
|
13
|
+
id,
|
|
14
|
+
type: pin.type,
|
|
15
|
+
compatibilityDate: pin.compatibilityDate,
|
|
16
|
+
binding: d.binding,
|
|
17
|
+
label: wrapLocale(d.label)
|
|
18
|
+
};
|
|
19
|
+
if (d.required) field.required = "true";
|
|
20
|
+
if (block.orientation) field.orientation = block.orientation;
|
|
21
|
+
if (CHOICE_KINDS.has(d.kind)) {
|
|
22
|
+
if (!d.options || d.options.length === 0) {
|
|
23
|
+
console.warn("[shwfed-form] dropped choice-kind dynamic field without options", d.binding);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const items = d.options.map((opt, i) => ({
|
|
27
|
+
id: `${id}::opt::${i}`,
|
|
28
|
+
label: wrapLocale(String(opt.label)),
|
|
29
|
+
value: typeof opt.value === "number" ? { kind: "number", value: opt.value } : { kind: "text", value: opt.value }
|
|
30
|
+
}));
|
|
31
|
+
field.options = { kind: "static", items };
|
|
32
|
+
}
|
|
33
|
+
const seed = d.default !== void 0 ? { binding: d.binding, value: d.default } : void 0;
|
|
34
|
+
return { field, seed };
|
|
35
|
+
}
|
|
36
|
+
export function expandDynFields(rawList, block, defaultsOf) {
|
|
37
|
+
const columns = block.columns && block.columns > 0 ? Math.floor(block.columns) : 1;
|
|
38
|
+
const emptyLayouts = () => [{ name: LAYOUT_NAME, layout: { columns, placements: {} } }];
|
|
39
|
+
if (!Array.isArray(rawList)) {
|
|
40
|
+
console.warn("[shwfed-form] dynamic fields transform did not return a list", rawList);
|
|
41
|
+
return { fields: [], layouts: emptyLayouts(), seeds: [], dropped: 0, total: 0 };
|
|
42
|
+
}
|
|
43
|
+
const fields = [];
|
|
44
|
+
const seeds = [];
|
|
45
|
+
const placements = {};
|
|
46
|
+
const seenBindings = /* @__PURE__ */ new Set();
|
|
47
|
+
let dropped = 0;
|
|
48
|
+
let x = 1;
|
|
49
|
+
let y = 1;
|
|
50
|
+
for (const element of rawList) {
|
|
51
|
+
const decoded = decodeDescriptor(element);
|
|
52
|
+
if (Either.isLeft(decoded)) {
|
|
53
|
+
dropped++;
|
|
54
|
+
console.warn("[shwfed-form] dropped invalid dynamic field descriptor", element);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const d = decoded.right;
|
|
58
|
+
if (seenBindings.has(d.binding)) {
|
|
59
|
+
dropped++;
|
|
60
|
+
console.warn("[shwfed-form] dropped duplicate dynamic field binding", d.binding);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const built = buildChild(d, block, defaultsOf);
|
|
64
|
+
if (!built) {
|
|
65
|
+
dropped++;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
seenBindings.add(d.binding);
|
|
69
|
+
fields.push(built.field);
|
|
70
|
+
if (built.seed) seeds.push(built.seed);
|
|
71
|
+
placements[built.field.id] = { area: [[x, y], [x + 1, y + 1]] };
|
|
72
|
+
x++;
|
|
73
|
+
if (x > columns) {
|
|
74
|
+
x = 1;
|
|
75
|
+
y++;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (dropped > 0) {
|
|
79
|
+
console.warn(`[shwfed-form] ${dropped} of ${rawList.length} dynamic fields dropped`);
|
|
80
|
+
}
|
|
81
|
+
const layout = { name: LAYOUT_NAME, layout: { columns, placements } };
|
|
82
|
+
return { fields, layouts: [layout], seeds, dropped, total: rawList.length };
|
|
83
|
+
}
|
|
84
|
+
export function emptyUnit(block) {
|
|
85
|
+
const columns = block.columns && block.columns > 0 ? Math.floor(block.columns) : 1;
|
|
86
|
+
return { fields: [], layouts: [{ name: LAYOUT_NAME, layout: { columns, placements: {} } }] };
|
|
87
|
+
}
|