@shwfed/config 2.3.10 → 2.3.12
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/mcp.mjs +946 -544
- package/dist/module.json +1 -1
- package/dist/preview/assets/{config-CyScbxXy.js → config-B-1L3Ra-.js} +1 -1
- package/dist/preview/assets/{config-ja_GMXxV.js → config-Cf5kO84H.js} +1 -1
- package/dist/preview/assets/{config-bxqg3yuv.js → config-DTQkLHVw.js} +1 -1
- package/dist/preview/assets/{config-HdWYFZ09.js → config-DqxN0Byp.js} +1 -1
- package/dist/preview/assets/{config-2R4XkSGs.js → config-QUQ71Eo6.js} +1 -1
- package/dist/preview/assets/{config-ykJZssgx.js → config-oO93sSer.js} +1 -1
- package/dist/preview/assets/{config-KcLrpkc1.js → config-sJ5XKUJy.js} +1 -1
- package/dist/preview/assets/{config-BxzDT_57.js → config-zCMkbPQt.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-CWyVRSOh.js → definition.vue_vue_type_script_setup_true_lang-D-OVRv68.js} +1 -1
- package/dist/preview/assets/index-Br_eXThF.css +1 -0
- package/dist/preview/assets/index-D8QyOVfp.js +637 -0
- package/dist/preview/assets/index-b_t8yWJJ.js +1 -0
- package/dist/preview/assets/{runtime-B8aUJIpn.js → runtime-10_7L7Gz.js} +1 -1
- package/dist/preview/assets/{runtime-CxA8fvQP.js → runtime-B2EP6060.js} +1 -1
- package/dist/preview/assets/{runtime-LBdh1D75.js → runtime-BxlgShjU.js} +1 -1
- package/dist/preview/assets/{runtime-DqZhDPHl.js → runtime-Cv2doZNu.js} +1 -1
- package/dist/preview/assets/{runtime-CpSiaWMP.js → runtime-CzDUrqSa.js} +1 -1
- package/dist/preview/assets/{runtime-D2K1s33u.js → runtime-DcYhXvSk.js} +1 -1
- package/dist/preview/assets/{runtime-DAXQmtLg.js → runtime-DlDhRVII.js} +1 -1
- package/dist/preview/assets/{runtime-C9XnvD5A.js → runtime-cmkN6aik.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +1 -1
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.d.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.xy/schema.js +6 -17
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +18 -18
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +12 -12
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +12 -12
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +10 -10
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +10 -10
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.d.vue.ts +12 -12
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.vue.d.ts +12 -12
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +133 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue +605 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +133 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +324 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.d.ts +99 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.js +129 -0
- package/dist/runtime/components/form/unit-config.vue +8 -27
- package/dist/runtime/components/form/utils/resolve.d.ts +48 -9
- package/dist/runtime/components/form/utils/resolve.js +59 -5
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.d.vue.ts +10 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.vue +305 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.vue.d.ts +10 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/runtime.vue +81 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +55 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.js +82 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.d.vue.ts +10 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.vue +310 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.vue.d.ts +10 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/runtime.vue +81 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.d.ts +66 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.js +71 -0
- package/dist/runtime/components/table/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/config.vue +7 -46
- package/dist/runtime/components/table/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/schema.d.ts +9 -2
- package/dist/runtime/components/table/schema.js +30 -14
- package/dist/runtime/components/table/utils/resolve.d.ts +53 -0
- package/dist/runtime/components/table/utils/resolve.js +66 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerDateTimePanel.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/tree/Tree.d.vue.ts +57 -0
- package/dist/runtime/components/ui/tree/Tree.vue +325 -0
- package/dist/runtime/components/ui/tree/Tree.vue.d.ts +57 -0
- package/dist/runtime/components/ui/tree/TreeNode.d.vue.ts +53 -0
- package/dist/runtime/components/ui/tree/TreeNode.vue +299 -0
- package/dist/runtime/components/ui/tree/TreeNode.vue.d.ts +53 -0
- package/dist/runtime/components/ui/tree/index.d.ts +3 -0
- package/dist/runtime/components/ui/tree/index.js +2 -0
- package/dist/runtime/components/ui/tree/types.d.ts +120 -0
- package/dist/runtime/components/ui/tree/types.js +0 -0
- package/dist/runtime/components/ui/tree/useTreeState.d.ts +95 -0
- package/dist/runtime/components/ui/tree/useTreeState.js +369 -0
- package/dist/runtime/shims.d.ts +2 -0
- package/package.json +1 -1
- package/dist/preview/assets/index-BPKK3hGV.css +0 -1
- package/dist/preview/assets/index-D3pf2RjG.js +0 -1
- package/dist/preview/assets/index-OUd02U3g.js +0 -1075
- package/dist/runtime/components/form/ai/fields-button.d.vue.ts +0 -13
- package/dist/runtime/components/form/ai/fields-button.vue +0 -458
- package/dist/runtime/components/form/ai/fields-button.vue.d.ts +0 -13
- package/dist/runtime/components/form/ai/fields-task.md +0 -71
- package/dist/runtime/components/table/ai/columns-button.d.vue.ts +0 -12
- package/dist/runtime/components/table/ai/columns-button.vue +0 -491
- package/dist/runtime/components/table/ai/columns-button.vue.d.ts +0 -12
- package/dist/runtime/components/table/ai/columns-task.md +0 -53
- package/dist/runtime/components/table/ai/data-source-button.d.vue.ts +0 -20
- package/dist/runtime/components/table/ai/data-source-button.vue +0 -324
- package/dist/runtime/components/table/ai/data-source-button.vue.d.ts +0 -20
- package/dist/runtime/components/table/ai/data-source-task.md +0 -17
- package/dist/runtime/utils/ai/cel-prompt.d.ts +0 -11
- package/dist/runtime/utils/ai/cel-prompt.js +0 -27
|
@@ -9,9 +9,9 @@ type __VLS_ModelProps = {
|
|
|
9
9
|
modelValue: AnyRecord;
|
|
10
10
|
};
|
|
11
11
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
|
-
declare var
|
|
12
|
+
declare var __VLS_219: {};
|
|
13
13
|
type __VLS_Slots = {} & {
|
|
14
|
-
'general-extra'?: (props: typeof
|
|
14
|
+
'general-extra'?: (props: typeof __VLS_219) => any;
|
|
15
15
|
};
|
|
16
16
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
17
|
"update:modelValue": (value: AnyRecord) => any;
|
|
@@ -95,10 +95,17 @@ export declare const ColumnGroup: Schema.Struct<{
|
|
|
95
95
|
message: Schema.SchemaClass<string, string, never>;
|
|
96
96
|
}>]>>;
|
|
97
97
|
}>;
|
|
98
|
-
export declare function DataSource(configure: (env: Environment) => void
|
|
98
|
+
export declare function DataSource(configure: (env: Environment) => void, extras?: {
|
|
99
|
+
request?: (env: Environment) => void;
|
|
100
|
+
data?: (env: Environment) => void;
|
|
101
|
+
}): Schema.Struct<{
|
|
99
102
|
request: Schema.optional<Schema.Schema<string, string, never>>;
|
|
100
103
|
data: Schema.Schema<string, string, never>;
|
|
104
|
+
}>;
|
|
105
|
+
export declare function tableDataSource(configure: (env: Environment) => void): Schema.Struct<{
|
|
101
106
|
total: Schema.optional<Schema.Schema<string, string, never>>;
|
|
107
|
+
request: Schema.optional<Schema.Schema<string, string, never>>;
|
|
108
|
+
data: Schema.Schema<string, string, never>;
|
|
102
109
|
}>;
|
|
103
110
|
export declare function TableConfig(configure: (env: Environment) => void): Schema.refine<{
|
|
104
111
|
readonly style?: string | undefined;
|
|
@@ -295,9 +302,9 @@ export declare function TableConfig(configure: (env: Environment) => void): Sche
|
|
|
295
302
|
default: () => never[];
|
|
296
303
|
}>;
|
|
297
304
|
dataSource: Schema.optional<Schema.Struct<{
|
|
305
|
+
total: Schema.optional<Schema.Schema<string, string, never>>;
|
|
298
306
|
request: Schema.optional<Schema.Schema<string, string, never>>;
|
|
299
307
|
data: Schema.Schema<string, string, never>;
|
|
300
|
-
total: Schema.optional<Schema.Schema<string, string, never>>;
|
|
301
308
|
}>>;
|
|
302
309
|
actions: Schema.optional<Schema.Struct<{
|
|
303
310
|
size: Schema.optionalWith<Schema.Literal<["default", "sm", "xs"]>, {
|
|
@@ -127,13 +127,11 @@ export const ColumnGroup = Schema.Struct({
|
|
|
127
127
|
description: "\u5217\u5206\u7EC4\u5B9A\u4E49"
|
|
128
128
|
});
|
|
129
129
|
const QUERY_VAR_DESCRIPTION = "\u641C\u7D22\u6761\u4EF6\u5F53\u524D\u72B6\u6001\uFF1B\u672A\u914D\u7F6E\u641C\u7D22\u6761\u4EF6\u65F6\u4E3A\u7A7A\u5BF9\u8C61";
|
|
130
|
-
export function DataSource(configure) {
|
|
130
|
+
export function DataSource(configure, extras) {
|
|
131
131
|
const CelRequest = Expression({
|
|
132
132
|
configure: (env) => {
|
|
133
133
|
configure(env);
|
|
134
|
-
env
|
|
135
|
-
env.registerVariable("pageSize", "number", { description: "\u6BCF\u9875\u884C\u6570\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A 0" });
|
|
136
|
-
env.registerVariable("query", "dyn", { description: QUERY_VAR_DESCRIPTION });
|
|
134
|
+
extras?.request?.(env);
|
|
137
135
|
},
|
|
138
136
|
resultType: "HttpRequest"
|
|
139
137
|
});
|
|
@@ -143,10 +141,35 @@ export function DataSource(configure) {
|
|
|
143
141
|
env.registerVariable("json", "optional<dyn>", {
|
|
144
142
|
description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09\uFF1B\u672A\u914D\u7F6E request \u65F6\u4E3A none"
|
|
145
143
|
});
|
|
146
|
-
env
|
|
144
|
+
extras?.data?.(env);
|
|
147
145
|
},
|
|
148
146
|
resultType: (type) => type.startsWith("list") || type === "dyn" || type.startsWith("optional")
|
|
149
147
|
});
|
|
148
|
+
return Schema.Struct({
|
|
149
|
+
request: Schema.optional(CelRequest).annotations({
|
|
150
|
+
title: "\u8BF7\u6C42",
|
|
151
|
+
description: "\u53EF\u9009\u7684 HTTP \u8BF7\u6C42\u8868\u8FBE\u5F0F\uFF1B\u672A\u914D\u7F6E\u65F6\u6570\u636E\u4ECE `data` \u8868\u8FBE\u5F0F\u4E2D\u8BFB\u53D6\uFF08\u901A\u5E38\u5F15\u7528\u4E0A\u4E0B\u6587\u53D8\u91CF\uFF09"
|
|
152
|
+
}),
|
|
153
|
+
data: CelRows.annotations({
|
|
154
|
+
title: "\u6570\u636E",
|
|
155
|
+
description: "\u8FD4\u56DE\u884C\u6570\u636E\u5217\u8868\uFF08`list<dyn>`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u5728\u914D\u7F6E\u4E86 `request` \u65F6\u53EF\u901A\u8FC7 `json` \u5F15\u7528\u54CD\u5E94\u4F53"
|
|
156
|
+
})
|
|
157
|
+
}).annotations({
|
|
158
|
+
title: "DataSource",
|
|
159
|
+
description: "\u6570\u636E\u6E90\u914D\u7F6E"
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
export function tableDataSource(configure) {
|
|
163
|
+
const base = DataSource(configure, {
|
|
164
|
+
request: (env) => {
|
|
165
|
+
env.registerVariable("pageIndex", "number", { description: "\u5F53\u524D\u9875\u7801\uFF08\u4ECE 0 \u5F00\u59CB\uFF09\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A 0" });
|
|
166
|
+
env.registerVariable("pageSize", "number", { description: "\u6BCF\u9875\u884C\u6570\uFF1B\u672A\u542F\u7528\u5206\u9875\u65F6\u4E3A 0" });
|
|
167
|
+
env.registerVariable("query", "dyn", { description: QUERY_VAR_DESCRIPTION });
|
|
168
|
+
},
|
|
169
|
+
data: (env) => {
|
|
170
|
+
env.registerVariable("query", "dyn", { description: QUERY_VAR_DESCRIPTION });
|
|
171
|
+
}
|
|
172
|
+
});
|
|
150
173
|
const CelTotal = Expression({
|
|
151
174
|
configure: (env) => {
|
|
152
175
|
configure(env);
|
|
@@ -158,14 +181,7 @@ export function DataSource(configure) {
|
|
|
158
181
|
resultType: (type) => type === "number" || type === "dyn" || type.startsWith("optional")
|
|
159
182
|
});
|
|
160
183
|
return Schema.Struct({
|
|
161
|
-
|
|
162
|
-
title: "\u8BF7\u6C42",
|
|
163
|
-
description: "\u53EF\u9009\u7684 HTTP \u8BF7\u6C42\u8868\u8FBE\u5F0F\uFF1B\u672A\u914D\u7F6E\u65F6\u6570\u636E\u4ECE `data` \u8868\u8FBE\u5F0F\u4E2D\u8BFB\u53D6\uFF08\u901A\u5E38\u5F15\u7528\u4E0A\u4E0B\u6587\u53D8\u91CF\uFF09"
|
|
164
|
-
}),
|
|
165
|
-
data: CelRows.annotations({
|
|
166
|
-
title: "\u6570\u636E",
|
|
167
|
-
description: "\u8FD4\u56DE\u884C\u6570\u636E\u5217\u8868\uFF08`list<dyn>`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u5728\u914D\u7F6E\u4E86 `request` \u65F6\u53EF\u901A\u8FC7 `json` \u5F15\u7528\u54CD\u5E94\u4F53"
|
|
168
|
-
}),
|
|
184
|
+
...base.fields,
|
|
169
185
|
total: Schema.optional(CelTotal).annotations({
|
|
170
186
|
title: "\u603B\u6570",
|
|
171
187
|
description: "\u8FD4\u56DE\u603B\u884C\u6570\uFF08`number`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u914D\u7F6E\u540E\u542F\u7528\u670D\u52A1\u7AEF\u5206\u9875\uFF0C\u7559\u7A7A\u5219\u8D70\u524D\u7AEF\u5206\u9875"
|
|
@@ -198,7 +214,7 @@ export function TableConfig(configure) {
|
|
|
198
214
|
const CelRowKey = CelRowAccess(configure, {
|
|
199
215
|
resultType: (type) => type === "string" || type === "number" || type === "dyn"
|
|
200
216
|
});
|
|
201
|
-
const dataSourceSchema =
|
|
217
|
+
const dataSourceSchema = tableDataSource(configure);
|
|
202
218
|
const { fields: actionFields } = ActionSchemaFields((env) => {
|
|
203
219
|
configure(env);
|
|
204
220
|
env.registerVariable("selected", "list<dyn>", {
|
|
@@ -16,6 +16,33 @@ export type ColumnDefDeps = Readonly<{
|
|
|
16
16
|
inheritedContext: Record<string, unknown>;
|
|
17
17
|
}>;
|
|
18
18
|
type ToColumnDef = (value: any, deps: ColumnDefDeps) => Partial<ColumnDef<unknown, unknown>>;
|
|
19
|
+
/**
|
|
20
|
+
* Capabilities a column-migration function may need from the host. Mirrors
|
|
21
|
+
* the form host's `MigrationContext` so cross-host helpers can share a
|
|
22
|
+
* signature; extend additively rather than introducing a parallel context.
|
|
23
|
+
*/
|
|
24
|
+
export type MigrationContext = Readonly<{
|
|
25
|
+
$cel: <T>(expression: string, context?: Record<string, unknown>) => Effect.Effect<T, unknown>;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Migrates a value of a *source* column schema to this entry's schema. Lives
|
|
29
|
+
* on the *target* (newer) entry. The target is picked by one of two rules:
|
|
30
|
+
* (a) same `type` with a strictly newer `compatibilityDate`; (b) an explicit
|
|
31
|
+
* `migrateFrom` declaration on the target naming this source. Failures
|
|
32
|
+
* surface to the host as a toast — see `table/config.vue`'s migrate handler.
|
|
33
|
+
*/
|
|
34
|
+
export type MigrateFn = (prev: unknown, ctx: MigrationContext) => Effect.Effect<unknown, Error>;
|
|
35
|
+
/**
|
|
36
|
+
* Identifies a column entry by `(type, compatibilityDate)`. Used for both
|
|
37
|
+
* `migrateFrom` declarations and the cross-type form of `supersededBy`.
|
|
38
|
+
*
|
|
39
|
+
* Migration declarations only ever live on the *new* (target) code — old
|
|
40
|
+
* folders are never modified to announce that they have been superseded.
|
|
41
|
+
*/
|
|
42
|
+
export type MigrateSource = Readonly<{
|
|
43
|
+
type: string;
|
|
44
|
+
compatibilityDate: string;
|
|
45
|
+
}>;
|
|
19
46
|
export type ColumnEntry = Readonly<{
|
|
20
47
|
type: string;
|
|
21
48
|
compatibilityDate: string;
|
|
@@ -24,9 +51,35 @@ export type ColumnEntry = Readonly<{
|
|
|
24
51
|
config: Component;
|
|
25
52
|
runtime: Component;
|
|
26
53
|
toColumnDef: ToColumnDef;
|
|
54
|
+
/**
|
|
55
|
+
* True iff this entry is shadowed by either (a) a newer-date entry sharing
|
|
56
|
+
* its `type`, or (b) another entry whose `migrateFrom` names this one.
|
|
57
|
+
*/
|
|
58
|
+
deprecated: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Identifies the entry that supersedes this one. Same `type` for the
|
|
61
|
+
* date-versioned rule; a different `type` for declared cross-type
|
|
62
|
+
* migrations.
|
|
63
|
+
*/
|
|
64
|
+
supersededBy?: MigrateSource;
|
|
65
|
+
migrate?: MigrateFn;
|
|
66
|
+
migrateFrom?: ReadonlyArray<MigrateSource>;
|
|
27
67
|
}>;
|
|
28
68
|
export declare const COLUMNS: ReadonlyArray<ColumnEntry>;
|
|
29
69
|
export declare function allColumnSchemas(configure: (env: Environment) => void): ReadonlyArray<AnySchema>;
|
|
30
70
|
export declare function findColumn(type: string, compatibilityDate: string): ColumnEntry | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Finds the registry entry that has declared `(type, compatibilityDate)` as a
|
|
73
|
+
* migration source on its `migrateFrom`. Use when a stored column's identity
|
|
74
|
+
* no longer matches any registry entry (the old folder was renamed away) —
|
|
75
|
+
* a present return means the value is still migratable via the target's
|
|
76
|
+
* `migrate`.
|
|
77
|
+
*
|
|
78
|
+
* Note: for the date-versioned rule (same `type`, newer `compatibilityDate`)
|
|
79
|
+
* the entry itself is in the registry and tagged `deprecated`/`supersededBy`;
|
|
80
|
+
* callers reach the target through `findColumn(supersededBy.type, …)`
|
|
81
|
+
* rather than this function.
|
|
82
|
+
*/
|
|
83
|
+
export declare function findMigrationTarget(type: string, compatibilityDate: string): ColumnEntry | undefined;
|
|
31
84
|
export declare function latestColumnByType(): ReadonlyArray<ColumnEntry>;
|
|
32
85
|
export {};
|
|
@@ -11,6 +11,7 @@ const runtimeModules = import.meta.glob(
|
|
|
11
11
|
"../columns/*/*/runtime.vue",
|
|
12
12
|
{ eager: true, import: "default", exhaustive: true }
|
|
13
13
|
);
|
|
14
|
+
const sourceKey = (type, compatibilityDate) => `${type}@${compatibilityDate}`;
|
|
14
15
|
const registry = defineRegistry({
|
|
15
16
|
hostName: "shwfed-table",
|
|
16
17
|
dirSegment: "columns",
|
|
@@ -21,6 +22,47 @@ const registry = defineRegistry({
|
|
|
21
22
|
if (typeof mod.toColumnDef !== "function") {
|
|
22
23
|
throw new TypeError(`[shwfed-table] column "${type}@${date}" is missing toColumnDef export`);
|
|
23
24
|
}
|
|
25
|
+
},
|
|
26
|
+
// Deprecation rules mirror the form host:
|
|
27
|
+
// (a) date-versioned: another entry shares this entry's `type` with a
|
|
28
|
+
// strictly greater `compatibilityDate`;
|
|
29
|
+
// (b) explicit cross-type: another entry declares this one in its
|
|
30
|
+
// `migrateFrom`. Same source claimed twice → throw.
|
|
31
|
+
deriveEntryExtras: (drafts) => {
|
|
32
|
+
const latestByType = /* @__PURE__ */ new Map();
|
|
33
|
+
for (const d of drafts) {
|
|
34
|
+
const prev = latestByType.get(d.type);
|
|
35
|
+
if (!prev || d.compatibilityDate > prev) latestByType.set(d.type, d.compatibilityDate);
|
|
36
|
+
}
|
|
37
|
+
const migrationTargets2 = /* @__PURE__ */ new Map();
|
|
38
|
+
for (const d of drafts) {
|
|
39
|
+
const sources = d.module.migrateFrom;
|
|
40
|
+
if (!sources || sources.length === 0) continue;
|
|
41
|
+
for (const src of sources) {
|
|
42
|
+
const key = sourceKey(src.type, src.compatibilityDate);
|
|
43
|
+
const existing = migrationTargets2.get(key);
|
|
44
|
+
if (existing) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
`[shwfed-table] migrateFrom collision: source "${key}" is claimed by both "${sourceKey(existing.type, existing.compatibilityDate)}" and "${sourceKey(d.type, d.compatibilityDate)}"`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
migrationTargets2.set(key, { type: d.type, compatibilityDate: d.compatibilityDate });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return (draft) => {
|
|
53
|
+
const declared = migrationTargets2.get(sourceKey(draft.type, draft.compatibilityDate));
|
|
54
|
+
if (declared) {
|
|
55
|
+
return { deprecated: true, supersededBy: declared };
|
|
56
|
+
}
|
|
57
|
+
const latest = latestByType.get(draft.type);
|
|
58
|
+
if (draft.compatibilityDate < latest) {
|
|
59
|
+
return {
|
|
60
|
+
deprecated: true,
|
|
61
|
+
supersededBy: { type: draft.type, compatibilityDate: latest }
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return { deprecated: false };
|
|
65
|
+
};
|
|
24
66
|
}
|
|
25
67
|
});
|
|
26
68
|
export const COLUMNS = registry.ENTRIES.map((e) => ({
|
|
@@ -30,14 +72,37 @@ export const COLUMNS = registry.ENTRIES.map((e) => ({
|
|
|
30
72
|
schema: e.module.schema,
|
|
31
73
|
config: e.config,
|
|
32
74
|
runtime: e.runtime,
|
|
33
|
-
toColumnDef: e.module.toColumnDef
|
|
75
|
+
toColumnDef: e.module.toColumnDef,
|
|
76
|
+
deprecated: e.deprecated,
|
|
77
|
+
...e.supersededBy !== void 0 ? { supersededBy: e.supersededBy } : {},
|
|
78
|
+
...e.module.migrate !== void 0 ? { migrate: e.module.migrate } : {},
|
|
79
|
+
...e.module.migrateFrom !== void 0 ? { migrateFrom: e.module.migrateFrom } : {}
|
|
34
80
|
}));
|
|
81
|
+
const migrationTargets = (() => {
|
|
82
|
+
const map = /* @__PURE__ */ new Map();
|
|
83
|
+
for (const entry of COLUMNS) {
|
|
84
|
+
const sources = entry.migrateFrom;
|
|
85
|
+
if (!sources || sources.length === 0) continue;
|
|
86
|
+
for (const src of sources) {
|
|
87
|
+
map.set(sourceKey(src.type, src.compatibilityDate), {
|
|
88
|
+
type: entry.type,
|
|
89
|
+
compatibilityDate: entry.compatibilityDate
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return map;
|
|
94
|
+
})();
|
|
35
95
|
export function allColumnSchemas(configure) {
|
|
36
96
|
return COLUMNS.map((entry) => entry.schema(configure));
|
|
37
97
|
}
|
|
38
98
|
export function findColumn(type, compatibilityDate) {
|
|
39
99
|
return COLUMNS.find((r) => r.type === type && r.compatibilityDate === compatibilityDate);
|
|
40
100
|
}
|
|
101
|
+
export function findMigrationTarget(type, compatibilityDate) {
|
|
102
|
+
const target = migrationTargets.get(sourceKey(type, compatibilityDate));
|
|
103
|
+
if (!target) return void 0;
|
|
104
|
+
return findColumn(target.type, target.compatibilityDate);
|
|
105
|
+
}
|
|
41
106
|
export function latestColumnByType() {
|
|
42
107
|
const byType = /* @__PURE__ */ new Map();
|
|
43
108
|
for (const r of COLUMNS) {
|
|
@@ -14,10 +14,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
15
|
"onUpdate:modelValue"?: ((args_0: DateRange | undefined) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
rangeSeparatorIcon: string;
|
|
18
17
|
numberOfMonths: number;
|
|
19
18
|
granularity: "hour" | "minute" | "second";
|
|
20
19
|
hourCycle: 12 | 24;
|
|
20
|
+
rangeSeparatorIcon: string;
|
|
21
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
export default _default;
|
|
@@ -14,10 +14,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
15
|
"onUpdate:modelValue"?: ((args_0: DateRange | undefined) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
-
rangeSeparatorIcon: string;
|
|
18
17
|
numberOfMonths: number;
|
|
19
18
|
granularity: "hour" | "minute" | "second";
|
|
20
19
|
hourCycle: 12 | 24;
|
|
20
|
+
rangeSeparatorIcon: string;
|
|
21
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
export default _default;
|
|
@@ -24,11 +24,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
24
24
|
"onUpdate:endValue"?: ((args_0: Time | undefined) => any) | undefined;
|
|
25
25
|
}>, {
|
|
26
26
|
size: "sm" | "md" | "lg";
|
|
27
|
-
rangeSeparatorIcon: string;
|
|
28
27
|
granularity: "hour" | "minute" | "second";
|
|
29
28
|
hourCycle: 12 | 24;
|
|
30
29
|
clearable: boolean;
|
|
31
30
|
clearIcon: string;
|
|
31
|
+
rangeSeparatorIcon: string;
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
34
34
|
export default _default;
|
|
@@ -24,11 +24,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
24
24
|
"onUpdate:endValue"?: ((args_0: Time | undefined) => any) | undefined;
|
|
25
25
|
}>, {
|
|
26
26
|
size: "sm" | "md" | "lg";
|
|
27
|
-
rangeSeparatorIcon: string;
|
|
28
27
|
granularity: "hour" | "minute" | "second";
|
|
29
28
|
hourCycle: 12 | 24;
|
|
30
29
|
clearable: boolean;
|
|
31
30
|
clearIcon: string;
|
|
31
|
+
rangeSeparatorIcon: string;
|
|
32
32
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
34
34
|
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { CascadeMode, DropContext, GetChildren, LoadChildren, MoveEventPayload, NodeKey, SelectedPaneSlotProps, SelectionMode, TreeHandle } from './types.js';
|
|
2
|
+
declare const __VLS_export: <Node>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
4
|
+
/** Root-level nodes. Use `v-model:roots` for controlled mode. */
|
|
5
|
+
roots: Node[];
|
|
6
|
+
getKey: (node: Node) => NodeKey;
|
|
7
|
+
getChildren?: GetChildren<Node>;
|
|
8
|
+
loadChildren?: LoadChildren<Node>;
|
|
9
|
+
/** `'none' | 'single' | 'multi'`. Default `'none'`. */
|
|
10
|
+
selectionMode?: SelectionMode;
|
|
11
|
+
/** Multi cascade mode. Ignored for `single` / `none`. */
|
|
12
|
+
cascade?: CascadeMode;
|
|
13
|
+
/** v-model for selection. Shape depends on `selectionMode`. */
|
|
14
|
+
modelValue?: NodeKey | NodeKey[] | undefined;
|
|
15
|
+
/** Per-node gate. */
|
|
16
|
+
selectable?: (node: Node, depth: number) => boolean;
|
|
17
|
+
/** Per-node draggable gate. Defaults to global `draggable` prop. */
|
|
18
|
+
draggable?: ((node: Node, depth: number) => boolean) | boolean;
|
|
19
|
+
/** Drop gate; required to enable drag-and-drop. */
|
|
20
|
+
canDrop?: (ctx: DropContext<Node>) => boolean;
|
|
21
|
+
/** Render-time filter. Does NOT mutate selection. */
|
|
22
|
+
filterPredicate?: (node: Node, query: string) => boolean;
|
|
23
|
+
filterQuery?: string;
|
|
24
|
+
/** Initial expanded set (uncontrolled). */
|
|
25
|
+
initialExpanded?: NodeKey[];
|
|
26
|
+
} & {
|
|
27
|
+
onMove?: ((payload: MoveEventPayload) => any) | undefined;
|
|
28
|
+
"onUpdate:modelValue"?: ((value: string | string[] | undefined) => any) | undefined;
|
|
29
|
+
"onUpdate:roots"?: ((value: Node[]) => any) | undefined;
|
|
30
|
+
}> & (typeof globalThis extends {
|
|
31
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
32
|
+
} ? P : {});
|
|
33
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<TreeHandle<Node>>) => void;
|
|
34
|
+
attrs: any;
|
|
35
|
+
slots: {
|
|
36
|
+
node?: (p: import("./types.js").NodeSlotProps<Node>) => unknown;
|
|
37
|
+
actions?: (p: import("./types.js").ActionsSlotProps<Node>) => unknown;
|
|
38
|
+
empty?: () => unknown;
|
|
39
|
+
error?: (p: import("./types.js").ErrorSlotProps<Node>) => unknown;
|
|
40
|
+
'loading-children'?: (p: import("./types.js").LoadingChildrenSlotProps<Node>) => unknown;
|
|
41
|
+
'selected-pane'?: (p: SelectedPaneSlotProps<Node>) => unknown;
|
|
42
|
+
};
|
|
43
|
+
emit: {
|
|
44
|
+
(e: "update:modelValue", value: NodeKey | NodeKey[] | undefined): void;
|
|
45
|
+
(e: "update:roots", value: Node[]): void;
|
|
46
|
+
(e: "move", payload: MoveEventPayload): void;
|
|
47
|
+
};
|
|
48
|
+
}>) => import("vue").VNode & {
|
|
49
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
50
|
+
};
|
|
51
|
+
declare const _default: typeof __VLS_export;
|
|
52
|
+
export default _default;
|
|
53
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
54
|
+
[K in keyof T]: T[K];
|
|
55
|
+
} : {
|
|
56
|
+
[K in keyof T as K]: T[K];
|
|
57
|
+
}) & {};
|