@shwfed/config 2.10.4 → 2.10.6
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 +1584 -1315
- package/dist/module.json +1 -1
- package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-DIjsktfi.js → FieldGroup.vue_vue_type_script_setup_true_lang-DoTYH4r0.js} +1 -1
- package/dist/preview/assets/{badge-Cr6_n00S.js → badge-DigodVby.js} +1 -1
- package/dist/preview/assets/{config-BemROLz0.js → config-BFLui9zF.js} +1 -1
- package/dist/preview/assets/{config-CwbWyadd.js → config-BiRUzXVx.js} +1 -1
- package/dist/preview/assets/{config-hXHOfKvD.js → config-Bjb63ooF.js} +1 -1
- package/dist/preview/assets/{config-CrA5lAMB.js → config-C1-hX0FZ.js} +1 -1
- package/dist/preview/assets/{config-CSauYxAG.js → config-CNjSJQmf.js} +1 -1
- package/dist/preview/assets/{config-DTDFg08z.js → config-Cn5zWISv.js} +1 -1
- package/dist/preview/assets/{config-BjUIO7Ps.js → config-D3BYzFT7.js} +1 -1
- package/dist/preview/assets/{config-DF4u2WzQ.js → config-DOqjxDka.js} +1 -1
- package/dist/preview/assets/{config-1VGYa1Zb.js → config-GquBxa0k.js} +1 -1
- package/dist/preview/assets/{config-DpcMlGoM.js → config-WRBBSsbf.js} +1 -1
- package/dist/preview/assets/{config-B2rtOFE1.js → config-Yzim7dYM.js} +1 -1
- package/dist/preview/assets/{config-CNY70agP.js → config-dwZBY29w.js} +1 -1
- package/dist/preview/assets/{config-Bu-ffrDi.js → config-fj68oKtH.js} +1 -1
- package/dist/preview/assets/{config-Dx9AeOjb.js → config-ia-gXiHl.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-v2AaUd8i.js → definition.vue_vue_type_script_setup_true_lang-DLRdfLnh.js} +1 -1
- package/dist/preview/assets/index-5uVTbNBd.js +1 -0
- package/dist/preview/assets/index-ByDPdF8R.js +763 -0
- package/dist/preview/assets/{index-BzWZj-hV.js → index-DjPejdGe.js} +1 -1
- package/dist/preview/assets/index-DyMqqPo8.css +1 -0
- package/dist/preview/assets/{item-B_QcL62I.js → item-D1eyfO0S.js} +1 -1
- package/dist/preview/assets/{runtime-Cfup01hl.js → runtime-BDsoGLTr.js} +1 -1
- package/dist/preview/assets/{runtime-D-MaRCSg.js → runtime-BnmMh817.js} +1 -1
- package/dist/preview/assets/{runtime-Cd79TXff.js → runtime-CeWW9OWp.js} +1 -1
- package/dist/preview/assets/{runtime-CZ6uHCIE.js → runtime-CersyeE4.js} +1 -1
- package/dist/preview/assets/{runtime-hClBh8tp.js → runtime-D2v11Q9f.js} +1 -1
- package/dist/preview/assets/{runtime-BRg0jxiK.js → runtime-DDLzkTJO.js} +1 -1
- package/dist/preview/assets/{runtime-BbiAwZZ9.js → runtime-DVt270HE.js} +1 -1
- package/dist/preview/assets/{runtime-DUMSbsqb.js → runtime-DlviPSYa.js} +1 -1
- package/dist/preview/assets/{runtime-Cu_C4Joj.js → runtime-PGalcWzI.js} +1 -1
- package/dist/preview/assets/{runtime-CKoLdM68.js → runtime-uMgaWxns.js} +1 -1
- package/dist/preview/assets/{schema-meta-BACRMkVo.js → schema-meta-DudoTEwn.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue +17 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.js +10 -1
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.d.vue.ts +223 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.vue +496 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/config.vue.d.ts +223 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/node-actions.d.vue.ts +10 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/node-actions.vue +25 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/node-actions.vue.d.ts +10 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.d.vue.ts +228 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.vue +356 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/runtime.vue.d.ts +228 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.d.ts +228 -0
- package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.js +135 -0
- package/dist/runtime/components/config/config.vue +5 -0
- package/dist/runtime/components/config/index.vue +17 -1
- package/dist/runtime/components/config/utils/resolve.d.ts +26 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +28 -28
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +28 -28
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +6 -6
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/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 +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +22 -22
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/runtime.vue +3 -3
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/runtime.vue +54 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-multi/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-06-14/com.shwfed.table.column.tree-combobox-single/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.d.vue.ts +10 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.vue +543 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/config.vue.d.ts +10 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.d.vue.ts +9 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.vue +110 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/runtime.vue.d.ts +9 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.d.ts +76 -0
- package/dist/runtime/components/table/columns/2026-06-17/com.shwfed.table.column.date-input/schema.js +89 -0
- package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
- package/dist/runtime/components/ui/tree/Tree.d.vue.ts +13 -0
- package/dist/runtime/components/ui/tree/Tree.vue +8 -1
- package/dist/runtime/components/ui/tree/Tree.vue.d.ts +13 -0
- package/dist/runtime/components/ui/tree/TreeNode.d.vue.ts +2 -0
- package/dist/runtime/components/ui/tree/TreeNode.vue +5 -2
- package/dist/runtime/components/ui/tree/TreeNode.vue.d.ts +2 -0
- package/dist/runtime/share/slot-renderer.d.vue.ts +5 -0
- package/dist/runtime/share/slot-renderer.vue +43 -28
- package/dist/runtime/share/slot-renderer.vue.d.ts +5 -0
- package/dist/runtime/share/tree-node-var.d.ts +25 -0
- package/dist/runtime/share/tree-node-var.js +10 -0
- package/dist/runtime/vendor/cel-js/CLAUDE.md +1 -1
- package/dist/runtime/vendor/cel-js/PROMPT.md +6 -0
- package/dist/runtime/vendor/cel-js/lib/http-builtins.d.ts +0 -14
- package/dist/runtime/vendor/cel-js/lib/http-builtins.js +17 -0
- package/package.json +1 -1
- package/dist/preview/assets/index-BDbNnENM.js +0 -1
- package/dist/preview/assets/index-ButPJaOR.css +0 -1
- package/dist/preview/assets/index-E3_P6Fhz.js +0 -761
package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.d.ts
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
|
|
3
|
+
type AnySchema = Schema.Schema<any, any, never>;
|
|
4
|
+
export declare const type: "com.shwfed.block.tree.single";
|
|
5
|
+
export declare const compatibilityDate: "2026-06-17";
|
|
6
|
+
export declare const metadata: {
|
|
7
|
+
readonly name: "树(单选)";
|
|
8
|
+
readonly icon: "fluent:tree-evergreen-20-regular";
|
|
9
|
+
readonly selection: true;
|
|
10
|
+
readonly w: {
|
|
11
|
+
readonly initial: 12;
|
|
12
|
+
readonly min: 6;
|
|
13
|
+
readonly max: number;
|
|
14
|
+
};
|
|
15
|
+
readonly h: {
|
|
16
|
+
readonly initial: 12;
|
|
17
|
+
readonly min: 4;
|
|
18
|
+
readonly max: number;
|
|
19
|
+
readonly grow: true;
|
|
20
|
+
};
|
|
21
|
+
readonly operations: readonly [{
|
|
22
|
+
readonly id: "refresh";
|
|
23
|
+
readonly name: "刷新";
|
|
24
|
+
readonly icon: "fluent:arrow-sync-20-regular";
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "clear-selection";
|
|
27
|
+
readonly name: "清空选中";
|
|
28
|
+
readonly icon: "fluent:select-all-off-20-regular";
|
|
29
|
+
}];
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Standalone page-level single-select tree (a navigator). Mirrors the tree
|
|
33
|
+
* FORM FIELD's node-config surface — same designer experience — but is a
|
|
34
|
+
* different beast: no form binding, no validation, no derived value. The
|
|
35
|
+
* picked node is published to the page `selections` registry under this
|
|
36
|
+
* block's `id`, so a sibling block's expression can read the full chosen
|
|
37
|
+
* record via `selections["<block-id>"]`.
|
|
38
|
+
*
|
|
39
|
+
* The schema is intentionally NOT shared with the form field at the code
|
|
40
|
+
* level: block and field are diverging surfaces (one is form-bound, one is a
|
|
41
|
+
* page navigator), so coupling them would couple two things that evolve
|
|
42
|
+
* apart. The designer UI is kept visually similar in `config.vue` instead.
|
|
43
|
+
*/
|
|
44
|
+
export declare function schema(configure: (env: Environment) => void, _blockRef?: AnySchema): Schema.Struct<{
|
|
45
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
46
|
+
type: Schema.tag<"com.shwfed.block.tree.single">;
|
|
47
|
+
compatibilityDate: Schema.tag<"2026-06-17">;
|
|
48
|
+
style: Schema.optional<Schema.Schema<string, string, never>>;
|
|
49
|
+
dataSource: Schema.Struct<{
|
|
50
|
+
request: Schema.optional<Schema.Schema<string, string, never>>;
|
|
51
|
+
data: Schema.Schema<string, string, never>;
|
|
52
|
+
}>;
|
|
53
|
+
nodeKey: Schema.Schema<string, string, never>;
|
|
54
|
+
nodeChildren: Schema.Schema<string, string, never>;
|
|
55
|
+
nodeLabel: Schema.refine<readonly [{
|
|
56
|
+
readonly locale: "zh";
|
|
57
|
+
readonly message: string;
|
|
58
|
+
}, ...{
|
|
59
|
+
readonly locale: "en" | "ja" | "ko";
|
|
60
|
+
readonly message: string;
|
|
61
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
62
|
+
locale: Schema.Literal<["zh"]>;
|
|
63
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
64
|
+
}>], [Schema.Struct<{
|
|
65
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
66
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
67
|
+
}>]>>;
|
|
68
|
+
nodeTooltip: Schema.optional<Schema.refine<readonly [{
|
|
69
|
+
readonly locale: "zh";
|
|
70
|
+
readonly message: string;
|
|
71
|
+
}, ...{
|
|
72
|
+
readonly locale: "en" | "ja" | "ko";
|
|
73
|
+
readonly message: string;
|
|
74
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
75
|
+
locale: Schema.Literal<["zh"]>;
|
|
76
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
77
|
+
}>], [Schema.Struct<{
|
|
78
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
79
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
80
|
+
}>]>>>;
|
|
81
|
+
nodeSelectable: Schema.optional<Schema.Schema<string, string, never>>;
|
|
82
|
+
expandAll: Schema.optionalWith<typeof Schema.Boolean, {
|
|
83
|
+
default: () => false;
|
|
84
|
+
}>;
|
|
85
|
+
filter: Schema.optional<Schema.Struct<{
|
|
86
|
+
enabled: Schema.SchemaClass<boolean, boolean, never>;
|
|
87
|
+
label: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
88
|
+
locale: Schema.Literal<["zh"]>;
|
|
89
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
90
|
+
}>], [Schema.Struct<{
|
|
91
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
92
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
93
|
+
}>]>>;
|
|
94
|
+
keywords: Schema.optional<Schema.Schema<string, string, never>>;
|
|
95
|
+
}>>;
|
|
96
|
+
nodeActions: Schema.Struct<{
|
|
97
|
+
size: Schema.optionalWith<Schema.Literal<["default", "sm", "xs"]>, {
|
|
98
|
+
default: () => "default";
|
|
99
|
+
}>;
|
|
100
|
+
gap: Schema.optionalWith<Schema.filter<Schema.filter<typeof Schema.Number>>, {
|
|
101
|
+
default: () => number;
|
|
102
|
+
}>;
|
|
103
|
+
style: Schema.optional<typeof Schema.String>;
|
|
104
|
+
groups: Schema.Array$<Schema.Struct<{
|
|
105
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
106
|
+
variant: Schema.optional<Schema.Literal<["default", "primary", "destructive", "ghost", "link"]>>;
|
|
107
|
+
}>>;
|
|
108
|
+
items: Schema.Array$<Schema.Schema<import("../../../../actions/schema.js").RegistryItemValue | {
|
|
109
|
+
readonly disabled?: string | undefined;
|
|
110
|
+
readonly id: string;
|
|
111
|
+
readonly title: readonly [{
|
|
112
|
+
readonly locale: "zh";
|
|
113
|
+
readonly message: string;
|
|
114
|
+
}, ...{
|
|
115
|
+
readonly locale: "en" | "ja" | "ko";
|
|
116
|
+
readonly message: string;
|
|
117
|
+
}[]];
|
|
118
|
+
readonly icon?: string | undefined;
|
|
119
|
+
readonly hidden?: string | undefined;
|
|
120
|
+
readonly tooltip?: readonly [{
|
|
121
|
+
readonly locale: "zh";
|
|
122
|
+
readonly message: string;
|
|
123
|
+
}, ...{
|
|
124
|
+
readonly locale: "en" | "ja" | "ko";
|
|
125
|
+
readonly message: string;
|
|
126
|
+
}[]] | undefined;
|
|
127
|
+
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
128
|
+
readonly action?: any;
|
|
129
|
+
readonly groupId: string;
|
|
130
|
+
readonly hideTitle?: boolean | undefined;
|
|
131
|
+
} | {
|
|
132
|
+
readonly id: string;
|
|
133
|
+
readonly title: readonly [{
|
|
134
|
+
readonly locale: "zh";
|
|
135
|
+
readonly message: string;
|
|
136
|
+
}, ...{
|
|
137
|
+
readonly locale: "en" | "ja" | "ko";
|
|
138
|
+
readonly message: string;
|
|
139
|
+
}[]];
|
|
140
|
+
readonly icon?: string | undefined;
|
|
141
|
+
readonly items: readonly (import("../../../../actions/schema.js").RegistrySubItemValue | {
|
|
142
|
+
readonly disabled?: string | undefined;
|
|
143
|
+
readonly id: string;
|
|
144
|
+
readonly title: readonly [{
|
|
145
|
+
readonly locale: "zh";
|
|
146
|
+
readonly message: string;
|
|
147
|
+
}, ...{
|
|
148
|
+
readonly locale: "en" | "ja" | "ko";
|
|
149
|
+
readonly message: string;
|
|
150
|
+
}[]];
|
|
151
|
+
readonly icon?: string | undefined;
|
|
152
|
+
readonly hidden?: string | undefined;
|
|
153
|
+
readonly tooltip?: readonly [{
|
|
154
|
+
readonly locale: "zh";
|
|
155
|
+
readonly message: string;
|
|
156
|
+
}, ...{
|
|
157
|
+
readonly locale: "en" | "ja" | "ko";
|
|
158
|
+
readonly message: string;
|
|
159
|
+
}[]] | undefined;
|
|
160
|
+
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
161
|
+
readonly action?: any;
|
|
162
|
+
})[];
|
|
163
|
+
readonly groupId: string;
|
|
164
|
+
readonly hideTitle?: boolean | undefined;
|
|
165
|
+
}, import("../../../../actions/schema.js").RegistryItemValue | {
|
|
166
|
+
readonly id: string;
|
|
167
|
+
readonly title: readonly [{
|
|
168
|
+
readonly locale: "zh";
|
|
169
|
+
readonly message: string;
|
|
170
|
+
}, ...{
|
|
171
|
+
readonly locale: "en" | "ja" | "ko";
|
|
172
|
+
readonly message: string;
|
|
173
|
+
}[]];
|
|
174
|
+
readonly groupId: string;
|
|
175
|
+
readonly disabled?: string | undefined;
|
|
176
|
+
readonly icon?: string | undefined;
|
|
177
|
+
readonly hidden?: string | undefined;
|
|
178
|
+
readonly tooltip?: readonly [{
|
|
179
|
+
readonly locale: "zh";
|
|
180
|
+
readonly message: string;
|
|
181
|
+
}, ...{
|
|
182
|
+
readonly locale: "en" | "ja" | "ko";
|
|
183
|
+
readonly message: string;
|
|
184
|
+
}[]] | undefined;
|
|
185
|
+
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
186
|
+
readonly action?: any;
|
|
187
|
+
readonly hideTitle?: boolean | undefined;
|
|
188
|
+
} | {
|
|
189
|
+
readonly id: string;
|
|
190
|
+
readonly title: readonly [{
|
|
191
|
+
readonly locale: "zh";
|
|
192
|
+
readonly message: string;
|
|
193
|
+
}, ...{
|
|
194
|
+
readonly locale: "en" | "ja" | "ko";
|
|
195
|
+
readonly message: string;
|
|
196
|
+
}[]];
|
|
197
|
+
readonly items: readonly (import("../../../../actions/schema.js").RegistrySubItemValue | {
|
|
198
|
+
readonly id: string;
|
|
199
|
+
readonly title: readonly [{
|
|
200
|
+
readonly locale: "zh";
|
|
201
|
+
readonly message: string;
|
|
202
|
+
}, ...{
|
|
203
|
+
readonly locale: "en" | "ja" | "ko";
|
|
204
|
+
readonly message: string;
|
|
205
|
+
}[]];
|
|
206
|
+
readonly disabled?: string | undefined;
|
|
207
|
+
readonly icon?: string | undefined;
|
|
208
|
+
readonly hidden?: string | undefined;
|
|
209
|
+
readonly tooltip?: readonly [{
|
|
210
|
+
readonly locale: "zh";
|
|
211
|
+
readonly message: string;
|
|
212
|
+
}, ...{
|
|
213
|
+
readonly locale: "en" | "ja" | "ko";
|
|
214
|
+
readonly message: string;
|
|
215
|
+
}[]] | undefined;
|
|
216
|
+
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
217
|
+
readonly action?: any;
|
|
218
|
+
})[];
|
|
219
|
+
readonly groupId: string;
|
|
220
|
+
readonly icon?: string | undefined;
|
|
221
|
+
readonly hideTitle?: boolean | undefined;
|
|
222
|
+
}, never>>;
|
|
223
|
+
kind: Schema.tag<"shwfed.component.action">;
|
|
224
|
+
}>;
|
|
225
|
+
}>;
|
|
226
|
+
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
|
227
|
+
export declare function defaultBody(): Record<string, unknown>;
|
|
228
|
+
export {};
|
package/dist/runtime/components/config/blocks/2026-06-17/com.shwfed.block.tree.single/schema.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
3
|
+
import { registerNodeVariableIfAbsent } from "../../../../../share/tree-node-var.js";
|
|
4
|
+
import { ActionsConfig, defaultActionsConfig } from "../../../../actions/schema.js";
|
|
5
|
+
import { DataSource } from "../../../../table/schema.js";
|
|
6
|
+
import { Locale } from "../../../../../share/locale.js";
|
|
7
|
+
export const type = "com.shwfed.block.tree.single";
|
|
8
|
+
export const compatibilityDate = "2026-06-17";
|
|
9
|
+
export const metadata = {
|
|
10
|
+
name: "\u6811\uFF08\u5355\u9009\uFF09",
|
|
11
|
+
icon: "fluent:tree-evergreen-20-regular",
|
|
12
|
+
// Publishes the picked node to the page `selections` registry under this
|
|
13
|
+
// block's id (see `runtime.vue`'s `publishSelection`), so a sibling block
|
|
14
|
+
// can read `selections["<block-id>"]`. The flag lists it in the page-level
|
|
15
|
+
// selection roster (config/config.vue).
|
|
16
|
+
selection: true,
|
|
17
|
+
w: { initial: 12, min: 6, max: Infinity },
|
|
18
|
+
// `grow: true`: the tree's height is content-driven (nodes expand/collapse),
|
|
19
|
+
// so its row escapes the grid's `1fr` equal-share (bare `auto`) and the tree
|
|
20
|
+
// grows top-anchored — expanding a node reveals children below instead of
|
|
21
|
+
// repositioning the whole block inside an oversized track. See
|
|
22
|
+
// `config/utils/resolve.ts` `BlockSizeRange.grow`.
|
|
23
|
+
h: { initial: 12, min: 4, max: Infinity, grow: true },
|
|
24
|
+
// Capability manifest — the operations this block exposes to op-requests
|
|
25
|
+
// bubbled up from its descendants (a per-node action button). Both are
|
|
26
|
+
// param-less, mirroring the table's atomic ops: `refresh` re-runs the
|
|
27
|
+
// DataSource fetch (like the table's `search`); `clear-selection` drops the
|
|
28
|
+
// picked node (like the table's `clear-selection`), which also clears the
|
|
29
|
+
// published `selections` entry once the resolved node falls away.
|
|
30
|
+
operations: [
|
|
31
|
+
{ id: "refresh", name: "\u5237\u65B0", icon: "fluent:arrow-sync-20-regular" },
|
|
32
|
+
{ id: "clear-selection", name: "\u6E05\u7A7A\u9009\u4E2D", icon: "fluent:select-all-off-20-regular" }
|
|
33
|
+
]
|
|
34
|
+
};
|
|
35
|
+
export function schema(configure, _blockRef) {
|
|
36
|
+
const nodeConfigure = (env) => {
|
|
37
|
+
configure(env);
|
|
38
|
+
registerNodeVariableIfAbsent(env);
|
|
39
|
+
};
|
|
40
|
+
const CelNodeKey = Expression({
|
|
41
|
+
configure: nodeConfigure,
|
|
42
|
+
resultType: (t) => t === "string" || t === "number" || t === "dyn"
|
|
43
|
+
});
|
|
44
|
+
const CelNodeChildren = Expression({
|
|
45
|
+
configure: nodeConfigure,
|
|
46
|
+
// Accept lists, optional lists, and `dyn` — CEL infers an empty literal
|
|
47
|
+
// such as `[]` as `list<dyn>`; a configured expression like
|
|
48
|
+
// `has(node.kids) ? node.kids : null` lands on `dyn`. Mirrors the table's
|
|
49
|
+
// `data` expression.
|
|
50
|
+
resultType: (t) => t === "dyn" || t.startsWith("list") || t.startsWith("optional")
|
|
51
|
+
});
|
|
52
|
+
const CelNodeBool = Expression({ configure: nodeConfigure, resultType: "bool" });
|
|
53
|
+
const NodeLocaleMd = LocaleMarkdown({ configure: nodeConfigure });
|
|
54
|
+
const CelKeywords = Expression({
|
|
55
|
+
configure: nodeConfigure,
|
|
56
|
+
resultType: (t) => t === "dyn" || t.startsWith("list") || t.startsWith("optional")
|
|
57
|
+
});
|
|
58
|
+
const CelStyle = Expression({
|
|
59
|
+
configure,
|
|
60
|
+
resultType: (t) => t === "string" || t === "dyn" || t.startsWith("map") || t.startsWith("optional")
|
|
61
|
+
});
|
|
62
|
+
return Schema.Struct({
|
|
63
|
+
id: Schema.UUID.annotations({ description: "\u5757\u552F\u4E00\u6807\u8BC6" }),
|
|
64
|
+
type: Schema.tag(type),
|
|
65
|
+
compatibilityDate: Schema.tag(compatibilityDate),
|
|
66
|
+
style: Schema.optional(CelStyle).annotations({
|
|
67
|
+
title: "\u6837\u5F0F",
|
|
68
|
+
description: "\u8FD4\u56DE\u5E94\u7528\u5728\u6811\u5757\u6839\u5143\u7D20\u4E0A\u7684\u6837\u5F0F\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u8FD4\u56DE CSS \u5B57\u7B26\u4E32\uFF08\u5982 `'max-height: 24rem'`\uFF09\u6216\u6837\u5F0F\u5BF9\u8C61\uFF08\u5982 `{'max-height': '24rem'}`\uFF09\uFF1B\u5E38\u7528\u4E8E\u9650\u5236\u9AD8\u5EA6\uFF0C\u8D85\u51FA\u90E8\u5206\u6811\u4F53\u81EA\u52A8\u6EDA\u52A8\u3002\u7559\u7A7A\u5219\u4E0D\u8BBE\u989D\u5916\u6837\u5F0F"
|
|
69
|
+
}),
|
|
70
|
+
dataSource: DataSource(configure).annotations({
|
|
71
|
+
title: "\u6570\u636E\u6E90",
|
|
72
|
+
description: "\u8FD4\u56DE\u5B8C\u6574\u6811\uFF08\u6839\u8282\u70B9\u5217\u8868\uFF09\u7684\u6570\u636E\u6E90\uFF1B\u6811\u901A\u8FC7 `\u8282\u70B9\u5B50\u7EA7` \u8868\u8FBE\u5F0F\u9010\u5C42\u5411\u4E0B\u8BFB\u53D6\u5B50\u7EA7"
|
|
73
|
+
}),
|
|
74
|
+
nodeKey: CelNodeKey.annotations({
|
|
75
|
+
title: "\u8282\u70B9 ID",
|
|
76
|
+
description: "\u4E3A\u6BCF\u4E2A\u8282\u70B9\u8BA1\u7B97\u7A33\u5B9A\u552F\u4E00 ID \u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u8BBF\u95EE `node`\uFF1B\u8FD0\u884C\u65F6\u4EE5\u5B57\u7B26\u4E32\u5F62\u5F0F\u5B58\u50A8"
|
|
77
|
+
}),
|
|
78
|
+
nodeChildren: CelNodeChildren.annotations({
|
|
79
|
+
title: "\u8282\u70B9\u5B50\u7EA7",
|
|
80
|
+
description: "\u8FD4\u56DE\u5F53\u524D\u8282\u70B9\u7684\u5B50\u7EA7\u5217\u8868\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u8FD4\u56DE `none` / `null` \u89C6\u4E3A\u53F6\u5B50\u8282\u70B9"
|
|
81
|
+
}),
|
|
82
|
+
nodeLabel: NodeLocaleMd.annotations({
|
|
83
|
+
title: "\u8282\u70B9\u6807\u7B7E",
|
|
84
|
+
description: "\u8282\u70B9\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 Markdown \u4E0E `{{ node.foo }}` \u63D2\u503C"
|
|
85
|
+
}),
|
|
86
|
+
nodeTooltip: Schema.optional(NodeLocaleMd.annotations({
|
|
87
|
+
title: "\u8282\u70B9\u63D0\u793A",
|
|
88
|
+
description: "\u9F20\u6807\u60AC\u505C\u5728\u8282\u70B9\u4E0A\u65F6\u5C55\u793A\u7684\u672C\u5730\u5316\u63D0\u793A\uFF0C\u652F\u6301 Markdown \u4E0E\u63D2\u503C"
|
|
89
|
+
})),
|
|
90
|
+
nodeSelectable: Schema.optional(CelNodeBool.annotations({
|
|
91
|
+
title: "\u8282\u70B9\u53EF\u9009\u6761\u4EF6",
|
|
92
|
+
description: "\u8FD4\u56DE `true` \u8868\u793A\u8BE5\u8282\u70B9\u53EF\u88AB\u9009\u62E9"
|
|
93
|
+
})),
|
|
94
|
+
expandAll: Schema.optionalWith(Schema.Boolean, { default: () => false }).annotations({
|
|
95
|
+
title: "\u9ED8\u8BA4\u5168\u90E8\u5C55\u5F00",
|
|
96
|
+
description: "\u5F00\u542F\u540E\u6302\u8F7D\u65F6\u5C55\u5F00\u6240\u6709\u975E\u53F6\u5B50\u8282\u70B9"
|
|
97
|
+
}),
|
|
98
|
+
filter: Schema.optional(Schema.Struct({
|
|
99
|
+
enabled: Schema.Boolean.annotations({ title: "\u542F\u7528", description: "\u662F\u5426\u5728\u6811\u4E0A\u65B9\u663E\u793A\u641C\u7D22\u8F93\u5165\u6846" }),
|
|
100
|
+
label: Schema.optional(Locale.annotations({
|
|
101
|
+
title: "\u6807\u7B7E",
|
|
102
|
+
description: "\u641C\u7D22\u8F93\u5165\u6846\u7684\u6D6E\u52A8\u6807\u7B7E\uFF1B\u7559\u7A7A\u5219\u4F7F\u7528\u9ED8\u8BA4\u503C\u300C\u641C\u7D22\u300D"
|
|
103
|
+
})),
|
|
104
|
+
keywords: Schema.optional(CelKeywords.annotations({
|
|
105
|
+
title: "\u989D\u5916\u5173\u952E\u8BCD",
|
|
106
|
+
description: "\u8FD4\u56DE\u5B57\u7B26\u4E32\u5217\u8868\u7684 CEL \u8868\u8FBE\u5F0F\uFF0C\u53EF\u8BBF\u95EE `node`\uFF1B\u5339\u914D\u89C4\u5219\u4E3A\u300C\u8282\u70B9\u6807\u7B7E \u6216 \u4EFB\u4E00\u5173\u952E\u8BCD\u300D\u5305\u542B\u641C\u7D22\u8BCD\uFF08\u4E0D\u533A\u5206\u5927\u5C0F\u5199\uFF09"
|
|
107
|
+
}))
|
|
108
|
+
}).annotations({
|
|
109
|
+
title: "\u8FC7\u6EE4",
|
|
110
|
+
description: "\u5BA2\u6237\u7AEF\u8FC7\u6EE4\uFF1B\u8FC7\u6EE4\u4E0D\u4F1A\u5F71\u54CD\u5DF2\u9009\u4E2D\u7684\u8282\u70B9 ID"
|
|
111
|
+
})),
|
|
112
|
+
// Per-node actions, revealed on hover. The full Actions config nested
|
|
113
|
+
// under one key — button conditions / expressions evaluate against the
|
|
114
|
+
// hovered `node` (and nothing else beyond the ambient page context).
|
|
115
|
+
nodeActions: ActionsConfig(nodeConfigure).annotations({
|
|
116
|
+
title: "\u8282\u70B9\u64CD\u4F5C",
|
|
117
|
+
description: "\u6BCF\u4E2A\u8282\u70B9\u53F3\u4FA7\u3001\u9F20\u6807\u60AC\u505C\u65F6\u663E\u793A\u7684\u64CD\u4F5C\u6309\u94AE\uFF1B\u6309\u94AE\u8868\u8FBE\u5F0F\u53EF\u8BBF\u95EE `node`"
|
|
118
|
+
})
|
|
119
|
+
}).annotations({
|
|
120
|
+
title: "TreeSingleBlock",
|
|
121
|
+
description: "\u57FA\u4E8E\u6811\u5F62\u6570\u636E\u7684\u5355\u9009\u5BFC\u822A\u5757"
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
export function defaultBody() {
|
|
125
|
+
return {
|
|
126
|
+
dataSource: { data: "[]" },
|
|
127
|
+
nodeKey: "string(node.id)",
|
|
128
|
+
nodeChildren: "has(node.children) ? node.children : null",
|
|
129
|
+
nodeLabel: [{ locale: "zh", message: "{{ node.label }}" }],
|
|
130
|
+
expandAll: false,
|
|
131
|
+
// Per-node actions default to the small button size — a tree row is a
|
|
132
|
+
// tight surface, unlike a standalone Actions block.
|
|
133
|
+
nodeActions: { ...defaultActionsConfig(), size: "sm" }
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -12,6 +12,7 @@ import { Markdown } from "../ui/markdown";
|
|
|
12
12
|
import { ScrollArea } from "../ui/scroll-area";
|
|
13
13
|
import { Separator } from "../ui/separator";
|
|
14
14
|
import { provideEventAncestor } from "../../share/event-bus";
|
|
15
|
+
import { provideSelectionRoster } from "../../utils/cel-context";
|
|
15
16
|
import { BREADCRUMB_EXTENSION_KEY } from "./breadcrumb-extension";
|
|
16
17
|
import { PAGE_TARGET_ID, PageConfig, getStructFieldDescription, getStructFieldTitle, metadata as pageMetadata } from "./schema";
|
|
17
18
|
import { useSlotClipboard } from "./use-editor";
|
|
@@ -89,6 +90,10 @@ const pageEventAncestor = computed(() => ({
|
|
|
89
90
|
operations: pageMetadata.operations
|
|
90
91
|
}));
|
|
91
92
|
provideEventAncestor(pageEventAncestor);
|
|
93
|
+
const selectionRoster = computed(
|
|
94
|
+
() => props.state.blocks.value.filter((b) => props.state.findBlockMeta(b.type, b.compatibilityDate)?.metadata?.selection).map((b) => ({ id: b.id, name: props.state.getBlockLabel(b) }))
|
|
95
|
+
);
|
|
96
|
+
provideSelectionRoster(selectionRoster);
|
|
92
97
|
const sidebarRef = useTemplateRef("sidebarRef");
|
|
93
98
|
function addLayout() {
|
|
94
99
|
sidebarRef.value?.addLayout();
|
|
@@ -6,7 +6,8 @@ import { useI18n } from "vue-i18n";
|
|
|
6
6
|
import { useHead } from "#app";
|
|
7
7
|
import { getLocalizedText } from "../../share/locale";
|
|
8
8
|
import { cel } from "../../utils/cel";
|
|
9
|
-
import { celBindings, injectCELContext } from "../../utils/cel-context";
|
|
9
|
+
import { celBindings, injectCELContext, provideCELContext, SELECTIONS_VAR } from "../../utils/cel-context";
|
|
10
|
+
import { provideSelectionsRegistry } from "../../utils/selections-registry";
|
|
10
11
|
import SlotRenderer from "../../share/slot-renderer.vue";
|
|
11
12
|
import ShwfedModal from "../modal.vue";
|
|
12
13
|
import EditorBody from "./config.vue";
|
|
@@ -43,7 +44,22 @@ const mergedConfigure = (env) => {
|
|
|
43
44
|
if (existing.has(name)) continue;
|
|
44
45
|
env.registerVariable(name, v.type, { description: v.description, label: v.label });
|
|
45
46
|
}
|
|
47
|
+
if (!env.getDefinitions().variables.some((v) => v.name === SELECTIONS_VAR)) {
|
|
48
|
+
env.registerVariable(SELECTIONS_VAR, "dyn", {
|
|
49
|
+
label: "\u9009\u4E2D\u9879",
|
|
50
|
+
description: '\u5404\u9009\u62E9\u578B\u5757\u5F53\u524D\u9009\u4E2D\u9879\u7684\u5B8C\u6574\u5BF9\u8C61/\u8BB0\u5F55\uFF08\u6309\u5757\u6807\u8BC6\uFF0C\u5982 `selections["<\u5757ID>"]`\uFF09'
|
|
51
|
+
});
|
|
52
|
+
}
|
|
46
53
|
};
|
|
54
|
+
const pageSelections = provideSelectionsRegistry();
|
|
55
|
+
provideCELContext({
|
|
56
|
+
[SELECTIONS_VAR]: {
|
|
57
|
+
type: "dyn",
|
|
58
|
+
label: "\u9009\u4E2D\u9879",
|
|
59
|
+
description: '\u5404\u9009\u62E9\u578B\u5757\u5F53\u524D\u9009\u4E2D\u9879\u7684\u5B8C\u6574\u5BF9\u8C61/\u8BB0\u5F55\uFF08\u6309\u5757\u6807\u8BC6\uFF0C\u5982 `selections["<\u5757ID>"]`\uFF09',
|
|
60
|
+
value: () => pageSelections.entries.value
|
|
61
|
+
}
|
|
62
|
+
});
|
|
47
63
|
class PageClosed {
|
|
48
64
|
_tag = "PageClosed";
|
|
49
65
|
}
|
|
@@ -12,12 +12,38 @@ export type BlockSizeRange = Readonly<{
|
|
|
12
12
|
initial: number;
|
|
13
13
|
min: number;
|
|
14
14
|
max: number;
|
|
15
|
+
/**
|
|
16
|
+
* When true on the height axis, the block's row tracks switch from the
|
|
17
|
+
* default `minmax(auto, 1fr)` to a bare `auto` in `slot-renderer.vue`, so the
|
|
18
|
+
* block escapes the grid's `1fr` equal-share and follows its own intrinsic
|
|
19
|
+
* height. Honored only on `h`. Identical mechanism to the form's
|
|
20
|
+
* `FieldSizeRange.grow` (see `FormUnitRenderer`).
|
|
21
|
+
*
|
|
22
|
+
* Use for blocks with dynamic, content-driven height (tree, table). Without
|
|
23
|
+
* it, such a block sits inside a `1fr`-sized track — usually taller than its
|
|
24
|
+
* collapsed content — and visibly *repositions* (floats / re-centers) as the
|
|
25
|
+
* content grows. The bare `auto` makes the track exactly the block's height,
|
|
26
|
+
* so the block is top-anchored and grows straight down ("expanding, not
|
|
27
|
+
* moving"), and its growth no longer redistributes the slot's slack across
|
|
28
|
+
* sibling blocks.
|
|
29
|
+
*/
|
|
30
|
+
grow?: boolean;
|
|
15
31
|
}>;
|
|
16
32
|
export type BlockMetadata = Readonly<{
|
|
17
33
|
name: string;
|
|
18
34
|
icon: string;
|
|
19
35
|
w: BlockSizeRange;
|
|
20
36
|
h: BlockSizeRange;
|
|
37
|
+
/**
|
|
38
|
+
* Marks this block as a selection source — it publishes its current
|
|
39
|
+
* selection to the page `selections` registry under its own `id` (see
|
|
40
|
+
* `config/index.vue`'s page-scope `provideSelectionsRegistry`). The config
|
|
41
|
+
* editor reads this flag to list the block in the page-level selection
|
|
42
|
+
* roster, so a sibling block's expression can reference
|
|
43
|
+
* `selections["<block-id>"]` by the block's friendly name. The mirror of
|
|
44
|
+
* `ColumnMetadata.selection` / `FieldMetadata.selection`, one host up.
|
|
45
|
+
*/
|
|
46
|
+
selection?: boolean;
|
|
21
47
|
}>;
|
|
22
48
|
export type BlockEntry = Readonly<{
|
|
23
49
|
type: string;
|
package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts
CHANGED
|
@@ -39,17 +39,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
39
39
|
readonly mode: "formula" | "prefill";
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
|
-
readonly validations?: readonly {
|
|
43
|
-
readonly message: readonly [{
|
|
44
|
-
readonly locale: "zh";
|
|
45
|
-
readonly message: string;
|
|
46
|
-
}, ...{
|
|
47
|
-
readonly locale: "en" | "ja" | "ko";
|
|
48
|
-
readonly message: string;
|
|
49
|
-
}[]];
|
|
50
|
-
readonly warning?: boolean | undefined;
|
|
51
|
-
readonly when: string;
|
|
52
|
-
}[] | undefined;
|
|
53
42
|
readonly addon?: {
|
|
54
43
|
readonly size: "default" | "sm" | "xs";
|
|
55
44
|
readonly style?: string | undefined;
|
|
@@ -117,6 +106,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
117
106
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
118
107
|
}[];
|
|
119
108
|
} | undefined;
|
|
109
|
+
readonly validations?: readonly {
|
|
110
|
+
readonly message: readonly [{
|
|
111
|
+
readonly locale: "zh";
|
|
112
|
+
readonly message: string;
|
|
113
|
+
}, ...{
|
|
114
|
+
readonly locale: "en" | "ja" | "ko";
|
|
115
|
+
readonly message: string;
|
|
116
|
+
}[]];
|
|
117
|
+
readonly warning?: boolean | undefined;
|
|
118
|
+
readonly when: string;
|
|
119
|
+
}[] | undefined;
|
|
120
120
|
}) => any;
|
|
121
121
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
122
122
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -155,17 +155,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
155
155
|
readonly mode: "formula" | "prefill";
|
|
156
156
|
readonly expression: string;
|
|
157
157
|
} | undefined;
|
|
158
|
-
readonly validations?: readonly {
|
|
159
|
-
readonly message: readonly [{
|
|
160
|
-
readonly locale: "zh";
|
|
161
|
-
readonly message: string;
|
|
162
|
-
}, ...{
|
|
163
|
-
readonly locale: "en" | "ja" | "ko";
|
|
164
|
-
readonly message: string;
|
|
165
|
-
}[]];
|
|
166
|
-
readonly warning?: boolean | undefined;
|
|
167
|
-
readonly when: string;
|
|
168
|
-
}[] | undefined;
|
|
169
158
|
readonly addon?: {
|
|
170
159
|
readonly size: "default" | "sm" | "xs";
|
|
171
160
|
readonly style?: string | undefined;
|
|
@@ -233,6 +222,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
233
222
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
234
223
|
}[];
|
|
235
224
|
} | undefined;
|
|
225
|
+
readonly validations?: readonly {
|
|
226
|
+
readonly message: readonly [{
|
|
227
|
+
readonly locale: "zh";
|
|
228
|
+
readonly message: string;
|
|
229
|
+
}, ...{
|
|
230
|
+
readonly locale: "en" | "ja" | "ko";
|
|
231
|
+
readonly message: string;
|
|
232
|
+
}[]];
|
|
233
|
+
readonly warning?: boolean | undefined;
|
|
234
|
+
readonly when: string;
|
|
235
|
+
}[] | undefined;
|
|
236
236
|
}) => any) | undefined;
|
|
237
237
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
238
238
|
declare const _default: typeof __VLS_export;
|
package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts
CHANGED
|
@@ -39,17 +39,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
39
39
|
readonly mode: "formula" | "prefill";
|
|
40
40
|
readonly expression: string;
|
|
41
41
|
} | undefined;
|
|
42
|
-
readonly validations?: readonly {
|
|
43
|
-
readonly message: readonly [{
|
|
44
|
-
readonly locale: "zh";
|
|
45
|
-
readonly message: string;
|
|
46
|
-
}, ...{
|
|
47
|
-
readonly locale: "en" | "ja" | "ko";
|
|
48
|
-
readonly message: string;
|
|
49
|
-
}[]];
|
|
50
|
-
readonly warning?: boolean | undefined;
|
|
51
|
-
readonly when: string;
|
|
52
|
-
}[] | undefined;
|
|
53
42
|
readonly addon?: {
|
|
54
43
|
readonly size: "default" | "sm" | "xs";
|
|
55
44
|
readonly style?: string | undefined;
|
|
@@ -117,6 +106,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
117
106
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
118
107
|
}[];
|
|
119
108
|
} | undefined;
|
|
109
|
+
readonly validations?: readonly {
|
|
110
|
+
readonly message: readonly [{
|
|
111
|
+
readonly locale: "zh";
|
|
112
|
+
readonly message: string;
|
|
113
|
+
}, ...{
|
|
114
|
+
readonly locale: "en" | "ja" | "ko";
|
|
115
|
+
readonly message: string;
|
|
116
|
+
}[]];
|
|
117
|
+
readonly warning?: boolean | undefined;
|
|
118
|
+
readonly when: string;
|
|
119
|
+
}[] | undefined;
|
|
120
120
|
}) => any;
|
|
121
121
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
122
122
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -155,17 +155,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
155
155
|
readonly mode: "formula" | "prefill";
|
|
156
156
|
readonly expression: string;
|
|
157
157
|
} | undefined;
|
|
158
|
-
readonly validations?: readonly {
|
|
159
|
-
readonly message: readonly [{
|
|
160
|
-
readonly locale: "zh";
|
|
161
|
-
readonly message: string;
|
|
162
|
-
}, ...{
|
|
163
|
-
readonly locale: "en" | "ja" | "ko";
|
|
164
|
-
readonly message: string;
|
|
165
|
-
}[]];
|
|
166
|
-
readonly warning?: boolean | undefined;
|
|
167
|
-
readonly when: string;
|
|
168
|
-
}[] | undefined;
|
|
169
158
|
readonly addon?: {
|
|
170
159
|
readonly size: "default" | "sm" | "xs";
|
|
171
160
|
readonly style?: string | undefined;
|
|
@@ -233,6 +222,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
233
222
|
readonly variant?: "default" | "link" | "destructive" | "primary" | "ghost" | undefined;
|
|
234
223
|
}[];
|
|
235
224
|
} | undefined;
|
|
225
|
+
readonly validations?: readonly {
|
|
226
|
+
readonly message: readonly [{
|
|
227
|
+
readonly locale: "zh";
|
|
228
|
+
readonly message: string;
|
|
229
|
+
}, ...{
|
|
230
|
+
readonly locale: "en" | "ja" | "ko";
|
|
231
|
+
readonly message: string;
|
|
232
|
+
}[]];
|
|
233
|
+
readonly warning?: boolean | undefined;
|
|
234
|
+
readonly when: string;
|
|
235
|
+
}[] | undefined;
|
|
236
236
|
}) => any) | undefined;
|
|
237
237
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
238
238
|
declare const _default: typeof __VLS_export;
|
|
@@ -33,8 +33,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
33
33
|
readonly expression: string;
|
|
34
34
|
} | undefined;
|
|
35
35
|
readonly numberOfMonths?: number | undefined;
|
|
36
|
-
readonly rangeSeparatorIcon?: string | undefined;
|
|
37
36
|
readonly format?: string | undefined;
|
|
37
|
+
readonly valueFormat?: string | undefined;
|
|
38
|
+
readonly rangeSeparatorIcon?: string | undefined;
|
|
38
39
|
readonly startPlaceholder?: readonly [{
|
|
39
40
|
readonly locale: "zh";
|
|
40
41
|
readonly message: string;
|
|
@@ -49,7 +50,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
49
50
|
readonly locale: "en" | "ja" | "ko";
|
|
50
51
|
readonly message: string;
|
|
51
52
|
}[]] | undefined;
|
|
52
|
-
readonly valueFormat?: string | undefined;
|
|
53
53
|
readonly validations?: readonly {
|
|
54
54
|
readonly message: readonly [{
|
|
55
55
|
readonly locale: "zh";
|
|
@@ -105,8 +105,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
105
105
|
readonly expression: string;
|
|
106
106
|
} | undefined;
|
|
107
107
|
readonly numberOfMonths?: number | undefined;
|
|
108
|
-
readonly rangeSeparatorIcon?: string | undefined;
|
|
109
108
|
readonly format?: string | undefined;
|
|
109
|
+
readonly valueFormat?: string | undefined;
|
|
110
|
+
readonly rangeSeparatorIcon?: string | undefined;
|
|
110
111
|
readonly startPlaceholder?: readonly [{
|
|
111
112
|
readonly locale: "zh";
|
|
112
113
|
readonly message: string;
|
|
@@ -121,7 +122,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
121
122
|
readonly locale: "en" | "ja" | "ko";
|
|
122
123
|
readonly message: string;
|
|
123
124
|
}[]] | undefined;
|
|
124
|
-
readonly valueFormat?: string | undefined;
|
|
125
125
|
readonly validations?: readonly {
|
|
126
126
|
readonly message: readonly [{
|
|
127
127
|
readonly locale: "zh";
|