@shwfed/config 2.3.27 → 2.3.29
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 +3963 -1597
- package/dist/module.json +1 -1
- package/dist/preview/assets/{config-CRqRJ0oF.js → config-6IiXCmyu.js} +1 -1
- package/dist/preview/assets/{config-C45AT0tt.js → config-BJzUh1_G.js} +1 -1
- package/dist/preview/assets/{config-CIcy6Jwg.js → config-Bl80ye-i.js} +1 -1
- package/dist/preview/assets/{config-D0YS2Bpj.js → config-CZOeZ8ty.js} +1 -1
- package/dist/preview/assets/{config-l3KurfL5.js → config-DaZD4ZSa.js} +1 -1
- package/dist/preview/assets/{config-D-i-AFgH.js → config-DhsbcNzx.js} +1 -1
- package/dist/preview/assets/{config-CXaH7a2G.js → config-Diuyh0Ex.js} +1 -1
- package/dist/preview/assets/{config-Bv_hUugV.js → config-aK67Rsw5.js} +1 -1
- package/dist/preview/assets/{config-DrpESRR5.js → config-rpX_Mc6I.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.js → definition.vue_vue_type_script_setup_true_lang-C_jU8d47.js} +1 -1
- package/dist/preview/assets/index-2eQR4s3q.css +1 -0
- package/dist/preview/assets/index-DEF3_MKr.js +659 -0
- package/dist/preview/assets/index-Df-thth9.js +1 -0
- package/dist/preview/assets/{runtime-Df715bRA.js → runtime-3p1K6te5.js} +1 -1
- package/dist/preview/assets/{runtime-D42ecZyC.js → runtime-BcLnafic.js} +1 -1
- package/dist/preview/assets/{runtime-D6twt5H_.js → runtime-CSaV-359.js} +1 -1
- package/dist/preview/assets/{runtime-z_QPMN-R.js → runtime-CjR8Vi5N.js} +1 -1
- package/dist/preview/assets/{runtime-CvuGnDIa.js → runtime-D_fJCKX_.js} +1 -1
- package/dist/preview/assets/{runtime-tobnPKdV.js → runtime-DpeCgGEG.js} +1 -1
- package/dist/preview/assets/{runtime-CmCvUWLV.js → runtime-K2a1x0TJ.js} +1 -1
- package/dist/preview/assets/{runtime-BSASeqgI.js → runtime-g9Zu3VNQ.js} +1 -1
- package/dist/preview/assets/{runtime-DUyUjFqF.js → runtime-jTnh_6Dm.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/block-layout-editor/index.d.vue.ts +10 -2
- package/dist/runtime/components/block-layout-editor/index.vue +44 -8
- package/dist/runtime/components/block-layout-editor/index.vue.d.ts +10 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.vue +57 -3
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/runtime.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/runtime.vue +1 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/runtime.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.js +4 -0
- package/dist/runtime/components/config/config.vue +35 -0
- package/dist/runtime/components/config/use-editor.d.ts +11 -1
- package/dist/runtime/components/config/use-editor.js +27 -1
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +4 -4
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +127 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue +593 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +127 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.vue +465 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +95 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.js +112 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +125 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue +525 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +125 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.vue +460 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.d.ts +92 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.js +104 -0
- package/dist/runtime/components/form/fields/2026-05-26/tree-combobox-shared.d.ts +35 -0
- package/dist/runtime/components/form/fields/2026-05-26/tree-combobox-shared.js +31 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.d.vue.ts +163 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue +745 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue.d.ts +163 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +383 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.d.ts +264 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.js +183 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.d.vue.ts +163 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue +745 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue.d.ts +163 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +402 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.d.ts +264 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.js +209 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +129 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue +618 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +129 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +501 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +99 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +133 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +127 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue +550 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +127 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +496 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +96 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +125 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +133 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue +605 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +133 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +401 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +102 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +142 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +131 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue +560 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +131 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +395 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +96 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +118 -0
- package/dist/runtime/components/form/fields/2026-05-28/tree-combobox-shared.d.ts +35 -0
- package/dist/runtime/components/form/fields/2026-05-28/tree-combobox-shared.js +31 -0
- package/dist/runtime/components/form/unit-config.vue +45 -1
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +131 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue +607 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +131 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/runtime.vue +447 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +90 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.js +143 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +129 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue +538 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +129 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/runtime.vue +429 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.d.ts +87 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.js +135 -0
- package/dist/runtime/components/table/columns/2026-05-27/tree-combobox-shared.d.ts +35 -0
- package/dist/runtime/components/table/columns/2026-05-27/tree-combobox-shared.js +31 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +183 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue +931 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +183 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue +463 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +283 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.js +275 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +183 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue +931 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +183 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +414 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +283 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.js +275 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +133 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue +632 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +133 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue +461 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +93 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +161 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +131 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue +563 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +131 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue +443 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.d.ts +90 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +153 -0
- package/dist/runtime/components/table/columns/2026-05-28/tree-combobox-shared.d.ts +35 -0
- package/dist/runtime/components/table/columns/2026-05-28/tree-combobox-shared.js +31 -0
- package/dist/runtime/components/table/config.vue +16 -16
- package/dist/runtime/components/ui/command/CommandItem.d.vue.ts +7 -0
- package/dist/runtime/components/ui/command/CommandItem.vue +13 -4
- package/dist/runtime/components/ui/command/CommandItem.vue.d.ts +7 -0
- package/dist/runtime/components/ui/tree/Tree.d.vue.ts +2 -0
- package/dist/runtime/components/ui/tree/Tree.vue +7 -2
- package/dist/runtime/components/ui/tree/Tree.vue.d.ts +2 -0
- package/dist/runtime/components/ui/tree/TreeNode.vue +16 -26
- package/dist/runtime/share/clipboard.d.ts +26 -0
- package/dist/runtime/share/clipboard.js +82 -0
- package/dist/runtime/share/layout.d.ts +4 -0
- package/dist/runtime/share/layout.js +35 -0
- package/package.json +1 -1
- package/dist/preview/assets/index-BCE-G4Ha.css +0 -1
- package/dist/preview/assets/index-C3Ycah5_.js +0 -643
- package/dist/preview/assets/index-hWT4_I5k.js +0 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { type Value } from './schema.js';
|
|
2
|
+
type __VLS_ModelProps = {
|
|
3
|
+
modelValue: Value;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:modelValue": (value: {
|
|
7
|
+
readonly filter?: {
|
|
8
|
+
readonly label?: readonly [{
|
|
9
|
+
readonly locale: "zh";
|
|
10
|
+
readonly message: string;
|
|
11
|
+
}, ...{
|
|
12
|
+
readonly locale: "en" | "ja" | "ko";
|
|
13
|
+
readonly message: string;
|
|
14
|
+
}[]] | undefined;
|
|
15
|
+
readonly enabled: boolean;
|
|
16
|
+
readonly keywords?: string | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
readonly label?: readonly [{
|
|
19
|
+
readonly locale: "zh";
|
|
20
|
+
readonly message: string;
|
|
21
|
+
}, ...{
|
|
22
|
+
readonly locale: "en" | "ja" | "ko";
|
|
23
|
+
readonly message: string;
|
|
24
|
+
}[]] | undefined;
|
|
25
|
+
readonly disabled?: string | undefined;
|
|
26
|
+
readonly type: "com.shwfed.form.field.tree.multi";
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly hidden?: string | undefined;
|
|
29
|
+
readonly tooltip?: readonly [{
|
|
30
|
+
readonly locale: "zh";
|
|
31
|
+
readonly message: string;
|
|
32
|
+
}, ...{
|
|
33
|
+
readonly locale: "en" | "ja" | "ko";
|
|
34
|
+
readonly message: string;
|
|
35
|
+
}[]] | undefined;
|
|
36
|
+
readonly displayName?: string | undefined;
|
|
37
|
+
readonly compatibilityDate: "2026-05-28";
|
|
38
|
+
readonly readonly?: string | undefined;
|
|
39
|
+
readonly binding?: string | undefined;
|
|
40
|
+
readonly derived?: {
|
|
41
|
+
readonly mode: "formula" | "prefill";
|
|
42
|
+
readonly expression: string;
|
|
43
|
+
} | undefined;
|
|
44
|
+
readonly dataSource: {
|
|
45
|
+
readonly data: string;
|
|
46
|
+
readonly request?: string | undefined;
|
|
47
|
+
};
|
|
48
|
+
readonly nodeKey: string;
|
|
49
|
+
readonly nodeChildren: string;
|
|
50
|
+
readonly nodeLabel: readonly [{
|
|
51
|
+
readonly locale: "zh";
|
|
52
|
+
readonly message: string;
|
|
53
|
+
}, ...{
|
|
54
|
+
readonly locale: "en" | "ja" | "ko";
|
|
55
|
+
readonly message: string;
|
|
56
|
+
}[]];
|
|
57
|
+
readonly expandAll: boolean;
|
|
58
|
+
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
59
|
+
readonly nodeTooltip?: readonly [{
|
|
60
|
+
readonly locale: "zh";
|
|
61
|
+
readonly message: string;
|
|
62
|
+
}, ...{
|
|
63
|
+
readonly locale: "en" | "ja" | "ko";
|
|
64
|
+
readonly message: string;
|
|
65
|
+
}[]] | undefined;
|
|
66
|
+
readonly nodeSelectable?: string | undefined;
|
|
67
|
+
}) => any;
|
|
68
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
69
|
+
"onUpdate:modelValue"?: ((value: {
|
|
70
|
+
readonly filter?: {
|
|
71
|
+
readonly label?: readonly [{
|
|
72
|
+
readonly locale: "zh";
|
|
73
|
+
readonly message: string;
|
|
74
|
+
}, ...{
|
|
75
|
+
readonly locale: "en" | "ja" | "ko";
|
|
76
|
+
readonly message: string;
|
|
77
|
+
}[]] | undefined;
|
|
78
|
+
readonly enabled: boolean;
|
|
79
|
+
readonly keywords?: string | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
readonly label?: readonly [{
|
|
82
|
+
readonly locale: "zh";
|
|
83
|
+
readonly message: string;
|
|
84
|
+
}, ...{
|
|
85
|
+
readonly locale: "en" | "ja" | "ko";
|
|
86
|
+
readonly message: string;
|
|
87
|
+
}[]] | undefined;
|
|
88
|
+
readonly disabled?: string | undefined;
|
|
89
|
+
readonly type: "com.shwfed.form.field.tree.multi";
|
|
90
|
+
readonly id: string;
|
|
91
|
+
readonly hidden?: string | undefined;
|
|
92
|
+
readonly tooltip?: readonly [{
|
|
93
|
+
readonly locale: "zh";
|
|
94
|
+
readonly message: string;
|
|
95
|
+
}, ...{
|
|
96
|
+
readonly locale: "en" | "ja" | "ko";
|
|
97
|
+
readonly message: string;
|
|
98
|
+
}[]] | undefined;
|
|
99
|
+
readonly displayName?: string | undefined;
|
|
100
|
+
readonly compatibilityDate: "2026-05-28";
|
|
101
|
+
readonly readonly?: string | undefined;
|
|
102
|
+
readonly binding?: string | undefined;
|
|
103
|
+
readonly derived?: {
|
|
104
|
+
readonly mode: "formula" | "prefill";
|
|
105
|
+
readonly expression: string;
|
|
106
|
+
} | undefined;
|
|
107
|
+
readonly dataSource: {
|
|
108
|
+
readonly data: string;
|
|
109
|
+
readonly request?: string | undefined;
|
|
110
|
+
};
|
|
111
|
+
readonly nodeKey: string;
|
|
112
|
+
readonly nodeChildren: string;
|
|
113
|
+
readonly nodeLabel: readonly [{
|
|
114
|
+
readonly locale: "zh";
|
|
115
|
+
readonly message: string;
|
|
116
|
+
}, ...{
|
|
117
|
+
readonly locale: "en" | "ja" | "ko";
|
|
118
|
+
readonly message: string;
|
|
119
|
+
}[]];
|
|
120
|
+
readonly expandAll: boolean;
|
|
121
|
+
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
122
|
+
readonly nodeTooltip?: readonly [{
|
|
123
|
+
readonly locale: "zh";
|
|
124
|
+
readonly message: string;
|
|
125
|
+
}, ...{
|
|
126
|
+
readonly locale: "en" | "ja" | "ko";
|
|
127
|
+
readonly message: string;
|
|
128
|
+
}[]] | undefined;
|
|
129
|
+
readonly nodeSelectable?: string | undefined;
|
|
130
|
+
}) => any) | undefined;
|
|
131
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
132
|
+
declare const _default: typeof __VLS_export;
|
|
133
|
+
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;
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue
ADDED
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Icon } from "@iconify/vue";
|
|
3
|
+
import { Effect, Fiber, Option } from "effect";
|
|
4
|
+
import { Fetch } from "fx-fetch";
|
|
5
|
+
import { computed, ref, shallowRef, watch } from "vue";
|
|
6
|
+
import { useI18n } from "vue-i18n";
|
|
7
|
+
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
8
|
+
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
9
|
+
import { getLocalizedText } from "../../../../../share/locale";
|
|
10
|
+
import { Checkbox } from "../../../../ui/checkbox";
|
|
11
|
+
import { Field, FieldLabel } from "../../../../ui/field";
|
|
12
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
|
|
13
|
+
import { Markdown } from "../../../../ui/markdown";
|
|
14
|
+
import { Skeleton } from "../../../../ui/skeleton";
|
|
15
|
+
import { Tree as UiTree } from "../../../../ui/tree";
|
|
16
|
+
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
17
|
+
import { useFormReadonly } from "../../../utils/readonly";
|
|
18
|
+
import { useFormState } from "../../../utils/state";
|
|
19
|
+
defineOptions({ name: "ShwfedTreeMultiFieldRuntime" });
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
fieldId: { type: String, required: true },
|
|
22
|
+
config: { type: null, required: true }
|
|
23
|
+
});
|
|
24
|
+
const { locale, t } = useI18n({
|
|
25
|
+
inheritLocale: true,
|
|
26
|
+
messages: {
|
|
27
|
+
zh: {
|
|
28
|
+
"tree-multi-search-label": "\u641C\u7D22",
|
|
29
|
+
"tree-multi-search-clear": "\u6E05\u9664\u641C\u7D22",
|
|
30
|
+
"tree-multi-load-error": "\u52A0\u8F7D\u5931\u8D25",
|
|
31
|
+
"tree-multi-empty": "\u65E0\u53EF\u9009\u9879",
|
|
32
|
+
"tree-multi-readonly-empty": "\u2014",
|
|
33
|
+
"tree-multi-readonly-separator": "\u3001"
|
|
34
|
+
},
|
|
35
|
+
en: {
|
|
36
|
+
"tree-multi-search-label": "Search",
|
|
37
|
+
"tree-multi-search-clear": "Clear search",
|
|
38
|
+
"tree-multi-load-error": "Failed to load",
|
|
39
|
+
"tree-multi-empty": "No options",
|
|
40
|
+
"tree-multi-readonly-empty": "\u2014",
|
|
41
|
+
"tree-multi-readonly-separator": ", "
|
|
42
|
+
},
|
|
43
|
+
ja: {
|
|
44
|
+
"tree-multi-search-label": "\u691C\u7D22",
|
|
45
|
+
"tree-multi-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
|
|
46
|
+
"tree-multi-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
|
|
47
|
+
"tree-multi-empty": "\u9078\u629E\u80A2\u306A\u3057",
|
|
48
|
+
"tree-multi-readonly-empty": "\u2014",
|
|
49
|
+
"tree-multi-readonly-separator": "\u3001"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const { state, getAt, setAt } = useFormState();
|
|
54
|
+
const inherited = injectCELContext();
|
|
55
|
+
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
56
|
+
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
57
|
+
const tooltipText = computed(
|
|
58
|
+
() => props.config.tooltip ? getLocalizedText(props.config.tooltip, locale.value) : void 0
|
|
59
|
+
);
|
|
60
|
+
function evalBool(expression, label) {
|
|
61
|
+
if (!expression) return false;
|
|
62
|
+
try {
|
|
63
|
+
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
64
|
+
} catch (err) {
|
|
65
|
+
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const isDisabled = computed(() => evalBool(props.config.disabled, "disabled"));
|
|
70
|
+
const formReadonly = useFormReadonly();
|
|
71
|
+
const isReadonly = computed(
|
|
72
|
+
() => props.config.readonly != null ? evalBool(props.config.readonly, "readonly") : formReadonly.value
|
|
73
|
+
);
|
|
74
|
+
const effectiveReadonly = computed(() => isReadonly.value || props.config.derived?.mode === "formula");
|
|
75
|
+
const uncontrolled = ref([]);
|
|
76
|
+
const model = computed({
|
|
77
|
+
get: () => {
|
|
78
|
+
const path = props.config.binding;
|
|
79
|
+
const raw = path == null ? uncontrolled.value : getAt(path);
|
|
80
|
+
return Array.isArray(raw) ? raw.map((v) => String(v)) : [];
|
|
81
|
+
},
|
|
82
|
+
set: (next) => {
|
|
83
|
+
const coerced = next.map((v) => String(v));
|
|
84
|
+
const path = props.config.binding;
|
|
85
|
+
if (path == null) {
|
|
86
|
+
uncontrolled.value = coerced;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
setAt(path, coerced);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const roots = ref([]);
|
|
93
|
+
const loading = ref(false);
|
|
94
|
+
const fetchError = ref(null);
|
|
95
|
+
async function fetchTree() {
|
|
96
|
+
const dataSource = props.config.dataSource;
|
|
97
|
+
if (!dataSource) {
|
|
98
|
+
roots.value = [];
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const effect = Effect.gen(function* () {
|
|
102
|
+
let jsonOpt = Option.none();
|
|
103
|
+
if (dataSource.request) {
|
|
104
|
+
const builder = yield* $cel(dataSource.request, {
|
|
105
|
+
form: state.value ?? {}
|
|
106
|
+
});
|
|
107
|
+
const response = yield* builder.json();
|
|
108
|
+
jsonOpt = Option.some(response);
|
|
109
|
+
}
|
|
110
|
+
const dataRaw = yield* $cel(dataSource.data, {
|
|
111
|
+
form: state.value ?? {},
|
|
112
|
+
json: jsonOpt
|
|
113
|
+
});
|
|
114
|
+
return Array.isArray(dataRaw) ? dataRaw : [];
|
|
115
|
+
});
|
|
116
|
+
const program = Effect.gen(function* () {
|
|
117
|
+
const showMaskFiber = yield* Effect.fork(
|
|
118
|
+
Effect.sync(() => {
|
|
119
|
+
loading.value = true;
|
|
120
|
+
}).pipe(Effect.delay("30 millis"))
|
|
121
|
+
);
|
|
122
|
+
return yield* Effect.ensuring(effect, Fiber.interrupt(showMaskFiber));
|
|
123
|
+
}).pipe(
|
|
124
|
+
Effect.ensuring(Effect.sync(() => {
|
|
125
|
+
loading.value = false;
|
|
126
|
+
}))
|
|
127
|
+
);
|
|
128
|
+
try {
|
|
129
|
+
const result = await Effect.runPromise(Effect.provide(program, Fetch.layer));
|
|
130
|
+
roots.value = result;
|
|
131
|
+
fetchError.value = null;
|
|
132
|
+
} catch (e) {
|
|
133
|
+
console.warn("[shwfed-form] tree dataSource fetch failed", e);
|
|
134
|
+
fetchError.value = e;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
watch(
|
|
138
|
+
() => [props.config.dataSource?.request, props.config.dataSource?.data],
|
|
139
|
+
() => {
|
|
140
|
+
void fetchTree();
|
|
141
|
+
},
|
|
142
|
+
{ immediate: true }
|
|
143
|
+
);
|
|
144
|
+
function nodeCtx(node) {
|
|
145
|
+
return { form: state.value ?? {}, node };
|
|
146
|
+
}
|
|
147
|
+
function getKey(node) {
|
|
148
|
+
try {
|
|
149
|
+
const v = Effect.runSync($cel(props.config.nodeKey, nodeCtx(node)));
|
|
150
|
+
return String(v);
|
|
151
|
+
} catch (err) {
|
|
152
|
+
console.error(`[shwfed-form] failed to evaluate nodeKey for ${props.fieldId}:`, err);
|
|
153
|
+
return "";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function getChildren(node) {
|
|
157
|
+
let raw;
|
|
158
|
+
try {
|
|
159
|
+
raw = Effect.runSync($cel(props.config.nodeChildren, nodeCtx(node)));
|
|
160
|
+
} catch (err) {
|
|
161
|
+
console.error(`[shwfed-form] failed to evaluate nodeChildren for ${props.fieldId}:`, err);
|
|
162
|
+
return void 0;
|
|
163
|
+
}
|
|
164
|
+
if (raw == null) return void 0;
|
|
165
|
+
if (!Array.isArray(raw)) return void 0;
|
|
166
|
+
if (raw.length === 0) return void 0;
|
|
167
|
+
return raw;
|
|
168
|
+
}
|
|
169
|
+
function nodeSelectable(node, _depth) {
|
|
170
|
+
if (isDisabled.value) return false;
|
|
171
|
+
const expr = props.config.nodeSelectable;
|
|
172
|
+
if (!expr) return true;
|
|
173
|
+
try {
|
|
174
|
+
return Effect.runSync($cel(expr, nodeCtx(node)));
|
|
175
|
+
} catch (err) {
|
|
176
|
+
console.error(`[shwfed-form] failed to evaluate nodeSelectable for ${props.fieldId}:`, err);
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function safeInterpolate(tpl, node) {
|
|
181
|
+
try {
|
|
182
|
+
return interpolateMarkdown(tpl, $cel, { form: state.value ?? {}, node });
|
|
183
|
+
} catch (err) {
|
|
184
|
+
console.error(`[shwfed-form] failed to interpolate node text for ${props.fieldId}:`, err);
|
|
185
|
+
return tpl;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function nodeLabelText(node) {
|
|
189
|
+
const tpl = getLocalizedText(props.config.nodeLabel, locale.value) ?? "";
|
|
190
|
+
return tpl ? safeInterpolate(tpl, node) : "";
|
|
191
|
+
}
|
|
192
|
+
function nodeTooltipText(node) {
|
|
193
|
+
if (!props.config.nodeTooltip) return void 0;
|
|
194
|
+
const tpl = getLocalizedText(props.config.nodeTooltip, locale.value);
|
|
195
|
+
if (!tpl) return void 0;
|
|
196
|
+
return safeInterpolate(tpl, node);
|
|
197
|
+
}
|
|
198
|
+
const initialExpanded = computed(() => {
|
|
199
|
+
if (!props.config.expandAll) return [];
|
|
200
|
+
const out = [];
|
|
201
|
+
const stack = [...roots.value];
|
|
202
|
+
while (stack.length) {
|
|
203
|
+
const n = stack.pop();
|
|
204
|
+
const kids = getChildren(n);
|
|
205
|
+
if (kids && kids.length) {
|
|
206
|
+
out.push(getKey(n));
|
|
207
|
+
stack.push(...kids);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return out;
|
|
211
|
+
});
|
|
212
|
+
const filterQuery = ref("");
|
|
213
|
+
function evalKeywords(node) {
|
|
214
|
+
const expr = props.config.filter?.keywords;
|
|
215
|
+
if (!expr) return [];
|
|
216
|
+
try {
|
|
217
|
+
const raw = Effect.runSync($cel(expr, nodeCtx(node)));
|
|
218
|
+
if (!Array.isArray(raw)) return [];
|
|
219
|
+
return raw.map((v) => String(v));
|
|
220
|
+
} catch {
|
|
221
|
+
return [];
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const searchCorpus = shallowRef(/* @__PURE__ */ new Map());
|
|
225
|
+
watch(
|
|
226
|
+
() => [
|
|
227
|
+
roots.value,
|
|
228
|
+
locale.value,
|
|
229
|
+
props.config.nodeLabel,
|
|
230
|
+
props.config.filter?.keywords
|
|
231
|
+
],
|
|
232
|
+
() => {
|
|
233
|
+
const map = /* @__PURE__ */ new Map();
|
|
234
|
+
const stack = [...roots.value];
|
|
235
|
+
while (stack.length) {
|
|
236
|
+
const n = stack.pop();
|
|
237
|
+
const label = nodeLabelText(n).trim().toLowerCase();
|
|
238
|
+
const kw = evalKeywords(n).map((k) => k.trim().toLowerCase()).join("\n");
|
|
239
|
+
map.set(getKey(n), kw ? `${label}
|
|
240
|
+
${kw}` : label);
|
|
241
|
+
const kids = getChildren(n);
|
|
242
|
+
if (kids && kids.length) stack.push(...kids);
|
|
243
|
+
}
|
|
244
|
+
searchCorpus.value = map;
|
|
245
|
+
},
|
|
246
|
+
{ immediate: true }
|
|
247
|
+
);
|
|
248
|
+
function filterPredicate(node, query) {
|
|
249
|
+
const q = query.trim().toLowerCase();
|
|
250
|
+
if (!q) return true;
|
|
251
|
+
const hay = searchCorpus.value.get(getKey(node));
|
|
252
|
+
if (hay !== void 0) return hay.includes(q);
|
|
253
|
+
return nodeLabelText(node).trim().toLowerCase().includes(q);
|
|
254
|
+
}
|
|
255
|
+
const filterLabelText = computed(() => {
|
|
256
|
+
const localized = props.config.filter?.label ? getLocalizedText(props.config.filter.label, locale.value) : void 0;
|
|
257
|
+
return localized && localized.length > 0 ? localized : t("tree-multi-search-label");
|
|
258
|
+
});
|
|
259
|
+
const readonlyText = computed(() => {
|
|
260
|
+
const selected = new Set(model.value);
|
|
261
|
+
const empty = t("tree-multi-readonly-empty");
|
|
262
|
+
if (selected.size === 0) return empty;
|
|
263
|
+
const found = /* @__PURE__ */ new Map();
|
|
264
|
+
const stack = [...roots.value];
|
|
265
|
+
while (stack.length) {
|
|
266
|
+
const n = stack.pop();
|
|
267
|
+
const k = getKey(n);
|
|
268
|
+
if (selected.has(k)) found.set(k, nodeLabelText(n));
|
|
269
|
+
const kids = getChildren(n);
|
|
270
|
+
if (kids && kids.length) stack.push(...kids);
|
|
271
|
+
}
|
|
272
|
+
const labels = model.value.map((id) => found.get(id) ?? id).filter((l) => l.length > 0);
|
|
273
|
+
return labels.length > 0 ? labels.join(t("tree-multi-readonly-separator")) : empty;
|
|
274
|
+
});
|
|
275
|
+
</script>
|
|
276
|
+
|
|
277
|
+
<template>
|
|
278
|
+
<Field
|
|
279
|
+
orientation="vertical"
|
|
280
|
+
:data-disabled="isDisabled || void 0"
|
|
281
|
+
>
|
|
282
|
+
<FieldLabel
|
|
283
|
+
v-if="labelText"
|
|
284
|
+
class="text-xs text-zinc-500"
|
|
285
|
+
>
|
|
286
|
+
<template
|
|
287
|
+
v-if="tooltipText"
|
|
288
|
+
#tooltip
|
|
289
|
+
>
|
|
290
|
+
<Markdown
|
|
291
|
+
:source="tooltipText"
|
|
292
|
+
class="prose prose-xs prose-zinc"
|
|
293
|
+
/>
|
|
294
|
+
</template>
|
|
295
|
+
{{ labelText }}
|
|
296
|
+
</FieldLabel>
|
|
297
|
+
|
|
298
|
+
<div
|
|
299
|
+
v-if="effectiveReadonly"
|
|
300
|
+
class="min-h-9 py-1.5 text-sm text-zinc-700"
|
|
301
|
+
>
|
|
302
|
+
{{ readonlyText }}
|
|
303
|
+
</div>
|
|
304
|
+
|
|
305
|
+
<template v-else>
|
|
306
|
+
<Field
|
|
307
|
+
v-if="config.filter?.enabled"
|
|
308
|
+
orientation="floating"
|
|
309
|
+
>
|
|
310
|
+
<FieldLabel>{{ filterLabelText }}</FieldLabel>
|
|
311
|
+
<InputGroup>
|
|
312
|
+
<InputGroupAddon align="inline-start">
|
|
313
|
+
<Icon icon="lucide:search" />
|
|
314
|
+
</InputGroupAddon>
|
|
315
|
+
<InputGroupInput
|
|
316
|
+
v-model="filterQuery"
|
|
317
|
+
:disabled="isDisabled"
|
|
318
|
+
/>
|
|
319
|
+
<InputGroupAddon
|
|
320
|
+
v-if="filterQuery.length > 0"
|
|
321
|
+
align="inline-end"
|
|
322
|
+
>
|
|
323
|
+
<InputGroupButton
|
|
324
|
+
size="icon-xs"
|
|
325
|
+
:aria-label="t('tree-multi-search-clear')"
|
|
326
|
+
@click="filterQuery = ''"
|
|
327
|
+
>
|
|
328
|
+
<Icon icon="lucide:x" />
|
|
329
|
+
</InputGroupButton>
|
|
330
|
+
</InputGroupAddon>
|
|
331
|
+
</InputGroup>
|
|
332
|
+
</Field>
|
|
333
|
+
|
|
334
|
+
<div
|
|
335
|
+
v-if="fetchError && roots.length === 0"
|
|
336
|
+
class="min-h-9 py-1.5 text-sm text-red-500"
|
|
337
|
+
>
|
|
338
|
+
{{ t("tree-multi-load-error") }}
|
|
339
|
+
</div>
|
|
340
|
+
<div
|
|
341
|
+
v-else-if="loading && roots.length === 0"
|
|
342
|
+
class="flex flex-col gap-1.5 py-1"
|
|
343
|
+
aria-busy="true"
|
|
344
|
+
>
|
|
345
|
+
<Skeleton class="h-6 w-2/3" />
|
|
346
|
+
<Skeleton class="h-6 w-1/2" />
|
|
347
|
+
<Skeleton class="h-6 w-3/5" />
|
|
348
|
+
<Skeleton class="h-6 w-2/5" />
|
|
349
|
+
</div>
|
|
350
|
+
|
|
351
|
+
<UiTree
|
|
352
|
+
v-else
|
|
353
|
+
v-model="model"
|
|
354
|
+
:roots="roots"
|
|
355
|
+
:get-key="getKey"
|
|
356
|
+
:get-children="getChildren"
|
|
357
|
+
selection-mode="multi"
|
|
358
|
+
:cascade="config.cascade ?? 'cascade-both'"
|
|
359
|
+
:selectable="nodeSelectable"
|
|
360
|
+
:filter-predicate="filterPredicate"
|
|
361
|
+
:filter-query="filterQuery"
|
|
362
|
+
:initial-expanded="initialExpanded"
|
|
363
|
+
:show-focused-row="false"
|
|
364
|
+
:class="isDisabled ? 'pointer-events-none opacity-60' : void 0"
|
|
365
|
+
>
|
|
366
|
+
<template #node="{ node, selected, indeterminate }">
|
|
367
|
+
<span class="flex items-start gap-2">
|
|
368
|
+
<!-- Presentational checkbox: mirrors the row's selection state but
|
|
369
|
+
never owns it. `pointer-events-none` + `tabindex=-1` keep the
|
|
370
|
+
existing row-click / keyboard toggle in `<UiTree>` the single
|
|
371
|
+
source of truth — the control is a visual reflection only. -->
|
|
372
|
+
<Checkbox
|
|
373
|
+
:model-value="indeterminate ? 'indeterminate' : selected"
|
|
374
|
+
class="pointer-events-none mt-0.5 shrink-0"
|
|
375
|
+
tabindex="-1"
|
|
376
|
+
aria-hidden="true"
|
|
377
|
+
/>
|
|
378
|
+
<span class="flex flex-col gap-0.5">
|
|
379
|
+
<Markdown
|
|
380
|
+
:source="nodeLabelText(node)"
|
|
381
|
+
class="prose prose-sm prose-zinc text-zinc-700"
|
|
382
|
+
/>
|
|
383
|
+
<Markdown
|
|
384
|
+
v-if="nodeTooltipText(node)"
|
|
385
|
+
:source="nodeTooltipText(node)"
|
|
386
|
+
block
|
|
387
|
+
class="prose prose-xs prose-zinc text-zinc-400"
|
|
388
|
+
/>
|
|
389
|
+
</span>
|
|
390
|
+
</span>
|
|
391
|
+
</template>
|
|
392
|
+
|
|
393
|
+
<template #empty>
|
|
394
|
+
<div class="min-h-9 py-1.5 text-sm text-zinc-400">
|
|
395
|
+
{{ t("tree-multi-empty") }}
|
|
396
|
+
</div>
|
|
397
|
+
</template>
|
|
398
|
+
</UiTree>
|
|
399
|
+
</template>
|
|
400
|
+
</Field>
|
|
401
|
+
</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;
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
|
|
3
|
+
import type { MigrateFn, MigrateSource } from '../../../utils/resolve.js';
|
|
4
|
+
export declare const type: "com.shwfed.form.field.tree.multi";
|
|
5
|
+
export declare const compatibilityDate: "2026-05-28";
|
|
6
|
+
export declare const metadata: {
|
|
7
|
+
readonly name: "树(多选)";
|
|
8
|
+
readonly icon: "fluent:tree-evergreen-20-regular";
|
|
9
|
+
readonly w: {
|
|
10
|
+
readonly initial: 8;
|
|
11
|
+
readonly min: 4;
|
|
12
|
+
readonly max: number;
|
|
13
|
+
};
|
|
14
|
+
readonly h: {
|
|
15
|
+
readonly initial: 8;
|
|
16
|
+
readonly min: 4;
|
|
17
|
+
readonly max: number;
|
|
18
|
+
readonly grow: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
|
|
22
|
+
label: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
23
|
+
locale: Schema.Literal<["zh"]>;
|
|
24
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
25
|
+
}>], [Schema.Struct<{
|
|
26
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
27
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
28
|
+
}>]>>;
|
|
29
|
+
tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
30
|
+
locale: Schema.Literal<["zh"]>;
|
|
31
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
32
|
+
}>], [Schema.Struct<{
|
|
33
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
34
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
35
|
+
}>]>>;
|
|
36
|
+
binding: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
37
|
+
disabled: Schema.optional<Schema.Schema<string, string, never>>;
|
|
38
|
+
readonly: Schema.optional<Schema.Schema<string, string, never>>;
|
|
39
|
+
derived: Schema.optional<Schema.Struct<{
|
|
40
|
+
mode: Schema.Literal<["formula", "prefill"]>;
|
|
41
|
+
expression: Schema.Schema<string, string, never>;
|
|
42
|
+
}>>;
|
|
43
|
+
dataSource: Schema.Struct<{
|
|
44
|
+
request: Schema.optional<Schema.Schema<string, string, never>>;
|
|
45
|
+
data: Schema.Schema<string, string, never>;
|
|
46
|
+
}>;
|
|
47
|
+
nodeKey: Schema.Schema<string, string, never>;
|
|
48
|
+
nodeChildren: Schema.Schema<string, string, never>;
|
|
49
|
+
nodeLabel: Schema.refine<readonly [{
|
|
50
|
+
readonly locale: "zh";
|
|
51
|
+
readonly message: string;
|
|
52
|
+
}, ...{
|
|
53
|
+
readonly locale: "en" | "ja" | "ko";
|
|
54
|
+
readonly message: string;
|
|
55
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
56
|
+
locale: Schema.Literal<["zh"]>;
|
|
57
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
58
|
+
}>], [Schema.Struct<{
|
|
59
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
60
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
61
|
+
}>]>>;
|
|
62
|
+
nodeTooltip: Schema.optional<Schema.refine<readonly [{
|
|
63
|
+
readonly locale: "zh";
|
|
64
|
+
readonly message: string;
|
|
65
|
+
}, ...{
|
|
66
|
+
readonly locale: "en" | "ja" | "ko";
|
|
67
|
+
readonly message: string;
|
|
68
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
69
|
+
locale: Schema.Literal<["zh"]>;
|
|
70
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
71
|
+
}>], [Schema.Struct<{
|
|
72
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
73
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
74
|
+
}>]>>>;
|
|
75
|
+
nodeSelectable: Schema.optional<Schema.Schema<string, string, never>>;
|
|
76
|
+
cascade: Schema.optionalWith<Schema.Literal<["independent", "cascade-down", "cascade-both"]>, {
|
|
77
|
+
default: () => "cascade-both";
|
|
78
|
+
}>;
|
|
79
|
+
expandAll: Schema.optionalWith<typeof Schema.Boolean, {
|
|
80
|
+
default: () => false;
|
|
81
|
+
}>;
|
|
82
|
+
filter: Schema.optional<Schema.Struct<{
|
|
83
|
+
enabled: Schema.SchemaClass<boolean, boolean, never>;
|
|
84
|
+
label: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
85
|
+
locale: Schema.Literal<["zh"]>;
|
|
86
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
87
|
+
}>], [Schema.Struct<{
|
|
88
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
89
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
90
|
+
}>]>>;
|
|
91
|
+
keywords: Schema.optional<Schema.Schema<string, string, never>>;
|
|
92
|
+
}>>;
|
|
93
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
94
|
+
displayName: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
95
|
+
hidden: Schema.optional<Schema.Schema<string, string, never>>;
|
|
96
|
+
type: Schema.Literal<["com.shwfed.form.field.tree.multi"]>;
|
|
97
|
+
compatibilityDate: Schema.Literal<["2026-05-28"]>;
|
|
98
|
+
}>;
|
|
99
|
+
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
100
|
+
export declare function defaults(): Partial<Value>;
|
|
101
|
+
export declare const migrateFrom: ReadonlyArray<MigrateSource>;
|
|
102
|
+
export declare const migrate: MigrateFn;
|