@shwfed/nuxt 0.11.49 → 0.11.51
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/button.d.vue.ts +8 -0
- package/dist/runtime/components/button.vue.d.ts +8 -0
- package/dist/runtime/components/fields.d.vue.ts +850 -6
- package/dist/runtime/components/fields.vue +0 -2
- package/dist/runtime/components/fields.vue.d.ts +850 -6
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.d.vue.ts +8 -0
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue +137 -0
- package/dist/runtime/components/ui/button-configurator/ButtonConfiguratorDialog.vue.d.ts +8 -0
- package/dist/runtime/components/ui/button-configurator/menu.d.ts +2 -0
- package/dist/runtime/components/ui/button-configurator/menu.js +14 -0
- package/dist/runtime/components/ui/buttons/Buttons.d.vue.ts +8 -0
- package/dist/runtime/components/ui/buttons/Buttons.vue +42 -14
- package/dist/runtime/components/ui/buttons/Buttons.vue.d.ts +8 -0
- package/dist/runtime/components/ui/buttons/schema.d.ts +30 -0
- package/dist/runtime/components/ui/buttons/schema.js +5 -0
- package/dist/runtime/components/ui/fields/Fields.d.vue.ts +1698 -10
- package/dist/runtime/components/ui/fields/Fields.vue +627 -162
- package/dist/runtime/components/ui/fields/Fields.vue.d.ts +1698 -10
- package/dist/runtime/components/ui/fields/schema.d.ts +5625 -153
- package/dist/runtime/components/ui/fields/schema.js +83 -80
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.d.vue.ts +849 -5
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue +224 -618
- package/dist/runtime/components/ui/fields-configurator/FieldsConfiguratorDialog.vue.d.ts +849 -5
- package/package.json +1 -1
- package/dist/runtime/components/ui/fields/FieldsBody.d.vue.ts +0 -17
- package/dist/runtime/components/ui/fields/FieldsBody.vue +0 -720
- package/dist/runtime/components/ui/fields/FieldsBody.vue.d.ts +0 -17
- package/dist/runtime/components/ui/fields/render-context.d.ts +0 -120
- package/dist/runtime/components/ui/fields/render-context.js +0 -0
|
@@ -13,27 +13,13 @@ const inheritedFieldContext = {
|
|
|
13
13
|
const labeledFieldShape = {
|
|
14
14
|
hideLabel: z.boolean().optional().describe("\u4E3A true \u65F6\uFF0C\u4E0D\u6E32\u67D3\u5B57\u6BB5\u6807\u7B7E")
|
|
15
15
|
};
|
|
16
|
-
const labeledFieldTitleShape = {
|
|
17
|
-
title: localeC.describe("\u5B57\u6BB5\u6807\u7B7E\u7684\u672C\u5730\u5316\u663E\u793A\u6587\u672C"),
|
|
18
|
-
...labeledFieldShape
|
|
19
|
-
};
|
|
20
16
|
const fieldCellStyleShape = {
|
|
21
17
|
labelStyle: z.string().optional().describe("CSS \u6837\u5F0F\u5BF9\u8C61\u8868\u8FBE\u5F0F\uFF0C\u63A7\u5236 contents \u5E03\u5C40\u6A21\u5F0F\u4E0B\u6807\u7B7E\u5355\u5143\u683C\u7684\u5E03\u5C40\u4E0E\u5916\u89C2"),
|
|
22
18
|
contentStyle: z.string().optional().describe("CSS \u6837\u5F0F\u5BF9\u8C61\u8868\u8FBE\u5F0F\uFF0C\u63A7\u5236 contents \u5E03\u5C40\u6A21\u5F0F\u4E0B\u5185\u5BB9\u5355\u5143\u683C\u7684\u5E03\u5C40\u4E0E\u5916\u89C2")
|
|
23
19
|
};
|
|
24
20
|
export const KIND = "shwfed.component.fields";
|
|
25
|
-
export const CURRENT_COMPATIBILITY_DATE = "2026-03-
|
|
26
|
-
export const SUPPORTED_COMPATIBILITY_DATES = [
|
|
27
|
-
CURRENT_COMPATIBILITY_DATE,
|
|
28
|
-
"2026-03-20"
|
|
29
|
-
];
|
|
30
|
-
export const FieldsOrientationC = z.enum(["horizontal", "vertical", "floating", "contents"]);
|
|
31
|
-
export const FieldsStyleC = expressionC([/^map/, "dyn"], {
|
|
32
|
-
...inheritedFieldContext
|
|
33
|
-
}).optional().describe("\u8FD4\u56DE\u5B57\u6BB5\u96C6\u5408\u5BB9\u5668\u6837\u5F0F\u5BF9\u8C61\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u4F7F\u7528 form\u3001row\u3001index \u548C id \u53D8\u91CF\u3002");
|
|
34
|
-
export const FieldGroupStyleC = expressionC([/^map/, "dyn"], {
|
|
35
|
-
...inheritedFieldContext
|
|
36
|
-
}).optional().describe("\u8FD4\u56DE\u5B57\u6BB5\u7EC4\u5BB9\u5668\u6837\u5F0F\u5BF9\u8C61\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u4F7F\u7528 form\u3001row\u3001index \u548C id \u53D8\u91CF\u3002");
|
|
21
|
+
export const CURRENT_COMPATIBILITY_DATE = "2026-03-20";
|
|
22
|
+
export const SUPPORTED_COMPATIBILITY_DATES = [CURRENT_COMPATIBILITY_DATE];
|
|
37
23
|
export const ValidationRuleC = z.object({
|
|
38
24
|
expression: expressionC(["bool", "dyn"], { value: "dyn", ...inheritedFieldContext }).describe("\u8FD4\u56DE\u5E03\u5C14\u503C\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u4F7F\u7528 value\u3001form\u3001row\u3001index \u548C id \u53D8\u91CF"),
|
|
39
25
|
message: z.string().describe("\u6821\u9A8C\u5931\u8D25\u65F6\u5C55\u793A\u7684 Markdown \u6D88\u606F\uFF0C\u53EF\u5728 {{ expression }} \u4E2D\u4F7F\u7528 value\u3001form\u3001row\u3001index \u548C id \u53D8\u91CF")
|
|
@@ -189,11 +175,6 @@ export const UploadFieldC = z.object({
|
|
|
189
175
|
export const SlotFieldC = z.strictObject({
|
|
190
176
|
id: fieldIdC,
|
|
191
177
|
type: z.literal("slot").describe("\u5177\u540D\u63D2\u69FD\u5B57\u6BB5\uFF0C\u901A\u8FC7\u5B57\u6BB5 id \u5BF9\u5E94\u7684\u5177\u540D\u63D2\u69FD\u6E32\u67D3\u5185\u5BB9"),
|
|
192
|
-
title: localeC.optional().describe("\u53EF\u9009\u7684\u5B57\u6BB5\u6807\u7B7E\uFF1B\u914D\u7F6E\u540E\u8BE5\u63D2\u69FD\u4F1A\u901A\u8FC7\u5E38\u89C4 Field \u6807\u7B7E/\u5185\u5BB9\u7ED3\u6784\u6E32\u67D3"),
|
|
193
|
-
...labeledFieldShape,
|
|
194
|
-
required: z.boolean().optional().describe("\u4E3A true \u65F6\uFF0C\u4EC5\u5728\u5B57\u6BB5\u6807\u7B7E\u540E\u663E\u793A\u5FC5\u586B\u63D0\u793A\u661F\u53F7\uFF0C\u4E0D\u5F71\u54CD\u5B9E\u9645\u6821\u9A8C\u903B\u8F91"),
|
|
195
|
-
hidden: expressionC(["bool", "dyn"], inheritedFieldContext).optional().describe("\u4E3A true \u65F6\uFF0C\u9690\u85CF\u8FD9\u4E2A\u5B57\u6BB5\uFF0C\u53EF\u4F7F\u7528 form\u3001row\u3001index \u548C id \u53D8\u91CF"),
|
|
196
|
-
...fieldCellStyleShape,
|
|
197
178
|
style: z.string().optional().describe("CSS \u6837\u5F0F\u5BF9\u8C61\u8868\u8FBE\u5F0F\uFF0C\u6C42\u503C\u540E\u901A\u8FC7 scoped slot \u7684 style prop \u4F20\u7ED9\u6D88\u8D39\u8005")
|
|
198
179
|
});
|
|
199
180
|
export const EmptyFieldC = z.strictObject({
|
|
@@ -201,34 +182,26 @@ export const EmptyFieldC = z.strictObject({
|
|
|
201
182
|
type: z.literal("empty").describe("\u7A7A\u767D\u5B57\u6BB5\uFF0C\u6309\u987A\u5E8F\u6E32\u67D3\u4E00\u4E2A\u7A7A div\uFF0C\u53EA\u80FD\u901A\u8FC7 style \u63A7\u5236\u5E03\u5C40"),
|
|
202
183
|
style: z.string().optional().describe("CSS \u6837\u5F0F\u5BF9\u8C61\u8868\u8FBE\u5F0F\uFF0C\u6C42\u503C\u540E\u4F5C\u4E3A\u7A7A div \u7684\u5185\u8054\u6837\u5F0F")
|
|
203
184
|
});
|
|
204
|
-
export const FieldC = z.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
required: z.boolean().optional().describe("\u4E3A true \u65F6\uFF0C\u4EC5\u5728\u5B57\u6BB5\u6807\u7B7E\u540E\u663E\u793A\u5FC5\u586B\u63D0\u793A\u661F\u53F7\uFF0C\u4E0D\u5F71\u54CD\u5B9E\u9645\u6821\u9A8C\u903B\u8F91"),
|
|
225
|
-
hidden: expressionC(["bool", "dyn"], inheritedFieldContext).optional().describe("\u4E3A true \u65F6\uFF0C\u9690\u85CF\u8FD9\u4E2A\u5B57\u6BB5\u53CA\u5176\u6240\u6709\u5B50\u5B57\u6BB5\uFF0C\u53EF\u4F7F\u7528 form\u3001row\u3001index \u548C id \u53D8\u91CF"),
|
|
226
|
-
...fieldCellStyleShape,
|
|
227
|
-
bodyOrientation: FieldsOrientationC.optional().describe("\u5BB9\u5668\u5185\u90E8\u5D4C\u5957\u5B57\u6BB5\u7684\u5E03\u5C40\u65B9\u5411\uFF1B\u7559\u7A7A\u65F6\u9ED8\u8BA4 horizontal"),
|
|
228
|
-
bodyBordered: z.boolean().optional().describe("\u4E3A true \u65F6\uFF0C\u5728 contents \u5E03\u5C40\u6A21\u5F0F\u4E0B\u4E3A\u5BB9\u5668\u5185\u90E8\u5B57\u6BB5\u5BB9\u5668\u548C\u5355\u5143\u683C\u6DFB\u52A0\u8868\u683C\u5F0F\u8FB9\u6846"),
|
|
229
|
-
bodyStyle: FieldsStyleC.describe("\u8FD4\u56DE\u5BB9\u5668\u5185\u90E8\u5D4C\u5957\u5B57\u6BB5\u5BB9\u5668\u6837\u5F0F\u5BF9\u8C61\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u4F7F\u7528 form\u3001row\u3001index \u548C id \u53D8\u91CF\u3002"),
|
|
230
|
-
fields: z.array(FieldC).readonly().describe("\u5BB9\u5668\u5B57\u6BB5\u5185\u7684\u5D4C\u5957\u5B57\u6BB5\u5217\u8868\uFF0C\u4EC5\u652F\u6301\u5B57\u6BB5\uFF0C\u4E0D\u652F\u6301\u5B57\u6BB5\u7EC4")
|
|
231
|
-
}).readonly();
|
|
185
|
+
export const FieldC = z.discriminatedUnion("type", [
|
|
186
|
+
StringFieldC,
|
|
187
|
+
TextareaFieldC,
|
|
188
|
+
NumberFieldC,
|
|
189
|
+
MarkdownFieldC,
|
|
190
|
+
MarkdownBodyFieldC,
|
|
191
|
+
SelectFieldC,
|
|
192
|
+
RadioGroupFieldC,
|
|
193
|
+
CalendarFieldC,
|
|
194
|
+
UploadFieldC,
|
|
195
|
+
SlotFieldC,
|
|
196
|
+
EmptyFieldC
|
|
197
|
+
]);
|
|
198
|
+
export const FieldsOrientationC = z.enum(["horizontal", "vertical", "floating", "contents"]);
|
|
199
|
+
export const FieldsStyleC = expressionC([/^map/, "dyn"], {
|
|
200
|
+
...inheritedFieldContext
|
|
201
|
+
}).optional().describe("\u8FD4\u56DE\u5B57\u6BB5\u96C6\u5408\u5BB9\u5668\u6837\u5F0F\u5BF9\u8C61\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u4F7F\u7528 form\u3001row\u3001index \u548C id \u53D8\u91CF\u3002");
|
|
202
|
+
export const FieldGroupStyleC = expressionC([/^map/, "dyn"], {
|
|
203
|
+
...inheritedFieldContext
|
|
204
|
+
}).optional().describe("\u8FD4\u56DE\u5B57\u6BB5\u7EC4\u5BB9\u5668\u6837\u5F0F\u5BF9\u8C61\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u4F7F\u7528 form\u3001row\u3001index \u548C id \u53D8\u91CF\u3002");
|
|
232
205
|
export const FieldGroupC = z.strictObject({
|
|
233
206
|
id: fieldGroupIdC,
|
|
234
207
|
style: FieldGroupStyleC,
|
|
@@ -240,12 +213,14 @@ const fieldsSharedShape = {
|
|
|
240
213
|
style: FieldsStyleC
|
|
241
214
|
};
|
|
242
215
|
function isPathlessField(field) {
|
|
243
|
-
return field.type === "slot" || field.type === "empty" || field.type === "markdown" || field.type === "markdown-body"
|
|
216
|
+
return field.type === "slot" || field.type === "empty" || field.type === "markdown" || field.type === "markdown-body";
|
|
244
217
|
}
|
|
245
|
-
function
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
218
|
+
function validateGroupAndFieldUniqueness(value, ctx) {
|
|
219
|
+
const groupIdOwners = {};
|
|
220
|
+
const fieldIdOwners = {};
|
|
221
|
+
const fieldPathOwners = {};
|
|
222
|
+
value.fields.forEach((field, fieldIndex) => {
|
|
223
|
+
const fieldIdPath = ["fields", fieldIndex, "id"];
|
|
249
224
|
const existingFieldIdPath = fieldIdOwners[field.id];
|
|
250
225
|
if (existingFieldIdPath) {
|
|
251
226
|
ctx.addIssue({
|
|
@@ -261,34 +236,26 @@ function validateFieldUniqueness(fields, parentPath, ctx, fieldIdOwners, fieldPa
|
|
|
261
236
|
} else {
|
|
262
237
|
fieldIdOwners[field.id] = [...fieldIdPath];
|
|
263
238
|
}
|
|
264
|
-
if (
|
|
265
|
-
|
|
266
|
-
const existingFieldPathPath = fieldPathOwners[field.path];
|
|
267
|
-
if (existingFieldPathPath) {
|
|
268
|
-
ctx.addIssue({
|
|
269
|
-
code: "custom",
|
|
270
|
-
message: "field path must be unique",
|
|
271
|
-
path: [...fieldPathPath]
|
|
272
|
-
});
|
|
273
|
-
ctx.addIssue({
|
|
274
|
-
code: "custom",
|
|
275
|
-
message: "field path must be unique",
|
|
276
|
-
path: [...existingFieldPathPath]
|
|
277
|
-
});
|
|
278
|
-
} else {
|
|
279
|
-
fieldPathOwners[field.path] = [...fieldPathPath];
|
|
280
|
-
}
|
|
239
|
+
if (isPathlessField(field)) {
|
|
240
|
+
return;
|
|
281
241
|
}
|
|
282
|
-
|
|
283
|
-
|
|
242
|
+
const fieldPathPath = ["fields", fieldIndex, "path"];
|
|
243
|
+
const existingFieldPathPath = fieldPathOwners[field.path];
|
|
244
|
+
if (existingFieldPathPath) {
|
|
245
|
+
ctx.addIssue({
|
|
246
|
+
code: "custom",
|
|
247
|
+
message: "field path must be unique",
|
|
248
|
+
path: [...fieldPathPath]
|
|
249
|
+
});
|
|
250
|
+
ctx.addIssue({
|
|
251
|
+
code: "custom",
|
|
252
|
+
message: "field path must be unique",
|
|
253
|
+
path: [...existingFieldPathPath]
|
|
254
|
+
});
|
|
255
|
+
} else {
|
|
256
|
+
fieldPathOwners[field.path] = [...fieldPathPath];
|
|
284
257
|
}
|
|
285
258
|
});
|
|
286
|
-
}
|
|
287
|
-
function validateGroupAndFieldUniqueness(value, ctx) {
|
|
288
|
-
const groupIdOwners = {};
|
|
289
|
-
const fieldIdOwners = {};
|
|
290
|
-
const fieldPathOwners = {};
|
|
291
|
-
validateFieldUniqueness(value.fields, ["fields"], ctx, fieldIdOwners, fieldPathOwners);
|
|
292
259
|
value.groups.forEach((group, groupIndex) => {
|
|
293
260
|
const existingGroupIndex = groupIdOwners[group.id];
|
|
294
261
|
if (existingGroupIndex !== void 0) {
|
|
@@ -305,7 +272,43 @@ function validateGroupAndFieldUniqueness(value, ctx) {
|
|
|
305
272
|
} else {
|
|
306
273
|
groupIdOwners[group.id] = groupIndex;
|
|
307
274
|
}
|
|
308
|
-
|
|
275
|
+
group.fields.forEach((field, fieldIndex) => {
|
|
276
|
+
const fieldIdPath = ["groups", groupIndex, "fields", fieldIndex, "id"];
|
|
277
|
+
const existingFieldIdPath = fieldIdOwners[field.id];
|
|
278
|
+
if (existingFieldIdPath) {
|
|
279
|
+
ctx.addIssue({
|
|
280
|
+
code: "custom",
|
|
281
|
+
message: "field id must be unique",
|
|
282
|
+
path: [...fieldIdPath]
|
|
283
|
+
});
|
|
284
|
+
ctx.addIssue({
|
|
285
|
+
code: "custom",
|
|
286
|
+
message: "field id must be unique",
|
|
287
|
+
path: [...existingFieldIdPath]
|
|
288
|
+
});
|
|
289
|
+
} else {
|
|
290
|
+
fieldIdOwners[field.id] = [...fieldIdPath];
|
|
291
|
+
}
|
|
292
|
+
if (isPathlessField(field)) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
const fieldPathPath = ["groups", groupIndex, "fields", fieldIndex, "path"];
|
|
296
|
+
const existingFieldPathPath = fieldPathOwners[field.path];
|
|
297
|
+
if (existingFieldPathPath) {
|
|
298
|
+
ctx.addIssue({
|
|
299
|
+
code: "custom",
|
|
300
|
+
message: "field path must be unique",
|
|
301
|
+
path: [...fieldPathPath]
|
|
302
|
+
});
|
|
303
|
+
ctx.addIssue({
|
|
304
|
+
code: "custom",
|
|
305
|
+
message: "field path must be unique",
|
|
306
|
+
path: [...existingFieldPathPath]
|
|
307
|
+
});
|
|
308
|
+
} else {
|
|
309
|
+
fieldPathOwners[field.path] = [...fieldPathPath];
|
|
310
|
+
}
|
|
311
|
+
});
|
|
309
312
|
});
|
|
310
313
|
}
|
|
311
314
|
const FieldsBodyNormalizedObjectC = z.object({
|