@shwfed/config 1.1.5 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.mts +2 -19
- package/dist/module.json +1 -1
- package/dist/module.mjs +15 -34
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.d.vue.ts +36 -4
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue +45 -8
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue.d.ts +36 -4
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/runtime.vue +15 -9
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.d.ts +17 -1
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.js +23 -4
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.d.vue.ts +36 -4
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue +39 -5
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue.d.ts +36 -4
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/runtime.vue +15 -9
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.d.ts +17 -1
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.js +23 -5
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.prototype/config.vue +1 -0
- package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/config.d.vue.ts +2 -2
- package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/config.vue.d.ts +2 -2
- package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/runtime.vue +2 -3
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/config.d.vue.ts +1 -1
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/config.vue +44 -10
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/config.vue.d.ts +1 -1
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/runtime.vue +24 -7
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.d.ts +6 -1
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.js +6 -3
- package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.reset → 2026-05-15/com.shwfed.actions.button.event.dispatch}/config.d.vue.ts +13 -5
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.vue +32 -0
- package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.reset → 2026-05-15/com.shwfed.actions.button.event.dispatch}/config.vue.d.ts +13 -5
- package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.search → 2026-05-15/com.shwfed.actions.button.event.dispatch}/runtime.vue +5 -7
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.d.ts +17 -0
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.js +18 -0
- package/dist/runtime/components/actions/components/group.vue +2 -3
- package/dist/runtime/components/actions/components/triggers-field.d.vue.ts +17 -0
- package/dist/runtime/components/actions/components/triggers-field.vue +209 -0
- package/dist/runtime/components/actions/components/triggers-field.vue.d.ts +17 -0
- package/dist/runtime/components/actions/config.vue +51 -1
- package/dist/runtime/components/actions/schema.d.ts +4 -0
- package/dist/runtime/components/actions/schema.js +6 -0
- package/dist/runtime/components/actions/utils/resolve.d.ts +25 -1
- package/dist/runtime/components/actions/utils/resolve.js +37 -9
- package/dist/runtime/components/app.vue +1 -1
- package/dist/runtime/components/block-layout-editor/index.vue +11 -11
- package/dist/runtime/components/block-layout-editor/sidebar.vue +0 -4
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +6 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +6 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +6 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +6 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +7 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.d.vue.ts +1 -1
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.vue +16 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.vue.d.ts +1 -1
- 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/schema.d.ts +18 -9
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.js +8 -4
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/config.d.vue.ts +77 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/config.vue +535 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/config.vue.d.ts +77 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/runtime.d.vue.ts +77 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/runtime.vue +233 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/runtime.vue.d.ts +77 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/schema.d.ts +134 -0
- package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/schema.js +142 -0
- package/dist/runtime/components/config/index.vue +1 -1
- package/dist/runtime/components/config/use-editor.js +4 -3
- package/dist/runtime/components/form/DerivedValueEditor.d.vue.ts +19 -0
- package/dist/runtime/components/form/DerivedValueEditor.vue +77 -0
- package/dist/runtime/components/form/DerivedValueEditor.vue.d.ts +19 -0
- package/dist/runtime/components/form/config.vue +58 -24
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/runtime.vue +29 -31
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.js +3 -2
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/runtime.vue +24 -26
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.js +3 -2
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +10 -2
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +10 -2
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/runtime.vue +15 -7
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts +10 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts +10 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue +14 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +10 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +10 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue +14 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +12 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +12 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue +14 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +12 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +12 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/runtime.vue +14 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +12 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +12 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/runtime.vue +14 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +12 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +12 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/runtime.vue +14 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/runtime.vue +37 -38
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +10 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +10 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/runtime.vue +33 -22
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/runtime.vue +14 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.js +3 -2
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/config.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/config.vue +21 -0
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/config.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/runtime.vue +14 -7
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.d.ts +4 -0
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.js +2 -1
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.vue +1 -0
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/runtime.vue +13 -8
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +10 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue +25 -1
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +10 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +102 -44
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.d.ts +14 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.js +14 -5
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue +1 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue +22 -5
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +7 -4
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +7 -1
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.d.vue.ts +113 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.vue +426 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.vue.d.ts +113 -0
- package/dist/runtime/components/{actions/buttons/2026-04-27/com.shwfed.actions.button.table.search → form/fields/2026-05-17/com.shwfed.form.field.checkbox.group}/runtime.d.vue.ts +1 -1
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/runtime.vue +176 -0
- package/dist/runtime/components/{actions/buttons/2026-04-27/com.shwfed.actions.button.table.search → form/fields/2026-05-17/com.shwfed.form.field.checkbox.group}/runtime.vue.d.ts +1 -1
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.d.ts +121 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.js +78 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.d.vue.ts +113 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.vue +426 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.vue.d.ts +113 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.d.vue.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue +159 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue.d.ts +8 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.d.ts +121 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.js +78 -0
- package/dist/runtime/components/form/index.d.vue.ts +6 -0
- package/dist/runtime/components/form/index.vue +41 -6
- package/dist/runtime/components/form/index.vue.d.ts +6 -0
- package/dist/runtime/components/form/schema.d.ts +5 -1
- package/dist/runtime/components/form/schema.js +13 -1
- package/dist/runtime/components/form/unit-config.d.vue.ts +0 -3
- package/dist/runtime/components/form/unit-config.vue +4 -10
- package/dist/runtime/components/form/unit-config.vue.d.ts +0 -3
- package/dist/runtime/components/form/utils/commit-bus.d.ts +26 -0
- package/dist/runtime/components/form/utils/commit-bus.js +27 -0
- package/dist/runtime/components/form/utils/common.d.ts +27 -0
- package/dist/runtime/components/form/utils/common.js +31 -0
- package/dist/runtime/components/form/utils/derived.d.ts +72 -0
- package/dist/runtime/components/form/utils/derived.js +116 -0
- package/dist/runtime/components/form/utils/field-value.d.ts +35 -0
- package/dist/runtime/components/form/utils/field-value.js +40 -0
- package/dist/runtime/components/form/utils/history.d.ts +36 -0
- package/dist/runtime/components/form/utils/history.js +74 -0
- package/dist/runtime/components/form/utils/readonly.d.ts +8 -0
- package/dist/runtime/components/form/utils/readonly.js +9 -0
- package/dist/runtime/components/form/utils/state.d.ts +27 -1
- package/dist/runtime/components/form/utils/state.js +16 -8
- package/dist/runtime/components/table/ai/columns-button.vue +3 -4
- package/dist/runtime/components/table/ai/data-source-button.vue +3 -4
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/runtime.vue +2 -3
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/runtime.vue +2 -3
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/runtime.vue +2 -3
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/runtime.vue +2 -3
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/runtime.vue +11 -6
- package/dist/runtime/components/table/config.vue +46 -2
- package/dist/runtime/components/table/index.d.vue.ts +4 -0
- package/dist/runtime/components/table/index.vue +28 -22
- package/dist/runtime/components/table/index.vue.d.ts +4 -0
- package/dist/runtime/components/table/schema.d.ts +33 -0
- package/dist/runtime/components/table/schema.js +21 -0
- package/dist/runtime/components/table/utils/instance.d.ts +2 -0
- package/dist/runtime/components/table/utils/instance.js +8 -0
- package/dist/runtime/components/ui/date-picker/DatePickerInput.vue +2 -2
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue +2 -2
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue +2 -2
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue +2 -2
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +13 -1
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +11 -3
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +13 -1
- package/dist/runtime/components/ui/locale/Locale.vue +2 -2
- package/dist/runtime/components/ui/radio-group/RadioGroup.d.vue.ts +22 -0
- package/dist/runtime/components/ui/radio-group/RadioGroup.vue +32 -0
- package/dist/runtime/components/ui/radio-group/RadioGroup.vue.d.ts +22 -0
- package/dist/runtime/components/ui/radio-group/RadioGroupItem.d.vue.ts +8 -0
- package/dist/runtime/components/ui/radio-group/RadioGroupItem.vue +36 -0
- package/dist/runtime/components/ui/radio-group/RadioGroupItem.vue.d.ts +8 -0
- package/dist/runtime/components/ui/radio-group/index.d.ts +2 -0
- package/dist/runtime/components/ui/radio-group/index.js +2 -0
- package/dist/runtime/composables/useOverlay.d.ts +1 -5
- package/dist/runtime/composables/useOverlay.js +4 -3
- package/dist/runtime/composables/useTranslateLocale.js +1 -2
- package/dist/runtime/share/event-bus.d.ts +118 -0
- package/dist/runtime/share/event-bus.js +55 -0
- package/dist/runtime/share/expression.d.ts +7 -0
- package/dist/runtime/share/expression.js +3 -1
- package/dist/runtime/share/layout.d.ts +1 -0
- package/dist/runtime/share/layout.js +3 -2
- package/dist/runtime/share/slot-renderer.vue +6 -4
- package/dist/runtime/{plugins → utils}/ai/cel-prompt.d.ts +1 -1
- package/dist/runtime/{plugins → utils}/ai/index.d.ts +1 -6
- package/dist/runtime/{plugins → utils}/ai/index.js +5 -14
- package/dist/runtime/utils/cel.d.ts +5 -0
- package/dist/runtime/utils/cel.js +42 -0
- package/dist/runtime/vendor/cel-js/CLAUDE.md +8 -2
- package/dist/runtime/vendor/cel-js/PROMPT.md +35 -10
- package/dist/runtime/vendor/cel-js/lib/functions.js +63 -1
- package/dist/runtime/vendor/cel-js/lib/http-builder.d.ts +35 -0
- package/dist/runtime/{plugins/http/builder.js → vendor/cel-js/lib/http-builder.js} +25 -23
- package/dist/runtime/vendor/cel-js/lib/http-builtins.d.ts +9 -10
- package/dist/runtime/vendor/cel-js/lib/http-builtins.js +53 -13
- package/dist/types.d.mts +7 -1
- package/package.json +1 -1
- package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.reset/config.vue +0 -10
- package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.reset/runtime.vue +0 -25
- package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.reset/schema.d.ts +0 -13
- package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.reset/schema.js +0 -16
- package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/config.d.vue.ts +0 -17
- package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/config.vue +0 -10
- package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/config.vue.d.ts +0 -17
- package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/schema.d.ts +0 -13
- package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/schema.js +0 -16
- package/dist/runtime/components/table/utils/host.d.ts +0 -9
- package/dist/runtime/components/table/utils/host.js +0 -8
- package/dist/runtime/composables/useCel.d.ts +0 -16
- package/dist/runtime/composables/useCel.js +0 -8
- package/dist/runtime/middleware/token.d.ts +0 -2
- package/dist/runtime/middleware/token.js +0 -20
- package/dist/runtime/plugins/cel/http.d.ts +0 -8
- package/dist/runtime/plugins/cel/http.js +0 -49
- package/dist/runtime/plugins/cel/index.d.ts +0 -9
- package/dist/runtime/plugins/cel/index.js +0 -59
- package/dist/runtime/plugins/http/builder.d.ts +0 -14
- package/dist/runtime/plugins/http/index.d.ts +0 -19
- package/dist/runtime/plugins/http/index.js +0 -35
- package/dist/runtime/plugins/toast/index.d.ts +0 -108
- package/dist/runtime/plugins/toast/index.js +0 -10
- package/dist/runtime/types.d.ts +0 -25
- /package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.reset → 2026-05-15/com.shwfed.actions.button.event.dispatch}/runtime.d.vue.ts +0 -0
- /package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.reset → 2026-05-15/com.shwfed.actions.button.event.dispatch}/runtime.vue.d.ts +0 -0
- /package/dist/runtime/{plugins → utils}/ai/cel-prompt.js +0 -0
- /package/dist/runtime/{plugins/cel/context.d.ts → utils/cel-context.d.ts} +0 -0
- /package/dist/runtime/{plugins/cel/context.js → utils/cel-context.js} +0 -0
package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
|
+
import { useI18n } from "vue-i18n";
|
|
5
|
+
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
6
|
+
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
7
|
+
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
8
|
+
import { getLocalizedText } from "../../../../../share/locale";
|
|
9
|
+
import { RadioGroup, RadioGroupItem } from "../../../../ui/radio-group";
|
|
10
|
+
import { Field, FieldLabel } from "../../../../ui/field";
|
|
11
|
+
import { Markdown } from "../../../../ui/markdown";
|
|
12
|
+
import { useFormReadonly } from "../../../utils/readonly";
|
|
13
|
+
import { useFormState } from "../../../utils/state";
|
|
14
|
+
defineOptions({ name: "ShwfedRadioGroupFieldRuntime" });
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
fieldId: { type: String, required: true },
|
|
17
|
+
config: { type: null, required: true }
|
|
18
|
+
});
|
|
19
|
+
const { locale, t } = useI18n({
|
|
20
|
+
inheritLocale: true,
|
|
21
|
+
messages: {
|
|
22
|
+
zh: { "radio-group-empty": "\u65E0\u53EF\u9009\u9879" },
|
|
23
|
+
en: { "radio-group-empty": "No options" },
|
|
24
|
+
ja: { "radio-group-empty": "\u9078\u629E\u80A2\u306A\u3057" }
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const { state, getAt, setAt } = useFormState();
|
|
28
|
+
const inherited = injectCELContext();
|
|
29
|
+
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
30
|
+
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
31
|
+
const tooltipText = computed(
|
|
32
|
+
() => props.config.tooltip ? getLocalizedText(props.config.tooltip, locale.value) : void 0
|
|
33
|
+
);
|
|
34
|
+
function evalBool(expression, label) {
|
|
35
|
+
if (!expression) return false;
|
|
36
|
+
try {
|
|
37
|
+
return Effect.runSync($cel(expression, { form: state.value ?? {} }));
|
|
38
|
+
} catch (err) {
|
|
39
|
+
console.error(`[shwfed-form] failed to evaluate ${label} for ${props.fieldId}:`, err);
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const isDisabled = computed(() => evalBool(props.config.disabled, "disabled"));
|
|
44
|
+
const formReadonly = useFormReadonly();
|
|
45
|
+
const isReadonly = computed(
|
|
46
|
+
() => props.config.readonly != null ? evalBool(props.config.readonly, "readonly") : formReadonly.value
|
|
47
|
+
);
|
|
48
|
+
const effectiveReadonly = computed(() => isReadonly.value || props.config.derived?.mode === "formula");
|
|
49
|
+
function safeInterpolate(tpl, ctx) {
|
|
50
|
+
try {
|
|
51
|
+
return interpolateMarkdown(tpl, $cel, ctx);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.error(`[shwfed-form] failed to interpolate option text for ${props.fieldId}:`, err);
|
|
54
|
+
return tpl;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const entries = computed(
|
|
58
|
+
() => (props.config.items ?? []).map((item) => {
|
|
59
|
+
const labelTpl = getLocalizedText(item.label, locale.value) ?? "";
|
|
60
|
+
const tooltipTpl = item.tooltip ? getLocalizedText(item.tooltip, locale.value) : void 0;
|
|
61
|
+
const ctx = { form: state.value ?? {} };
|
|
62
|
+
return {
|
|
63
|
+
key: item.id,
|
|
64
|
+
value: item.value.value,
|
|
65
|
+
label: labelTpl ? safeInterpolate(labelTpl, ctx) : "",
|
|
66
|
+
tooltip: tooltipTpl ? safeInterpolate(tooltipTpl, ctx) : void 0
|
|
67
|
+
};
|
|
68
|
+
})
|
|
69
|
+
);
|
|
70
|
+
const uncontrolled = ref(void 0);
|
|
71
|
+
const model = computed({
|
|
72
|
+
get: () => {
|
|
73
|
+
const path = props.config.binding;
|
|
74
|
+
const raw = path == null ? uncontrolled.value : getAt(path);
|
|
75
|
+
return typeof raw === "string" || typeof raw === "number" ? raw : void 0;
|
|
76
|
+
},
|
|
77
|
+
set: (next) => {
|
|
78
|
+
const path = props.config.binding;
|
|
79
|
+
if (path == null) {
|
|
80
|
+
uncontrolled.value = next;
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
setAt(path, next);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
function onSelect(next) {
|
|
87
|
+
if (isDisabled.value) return;
|
|
88
|
+
model.value = typeof next === "string" || typeof next === "number" ? next : void 0;
|
|
89
|
+
}
|
|
90
|
+
const readonlyText = computed(() => {
|
|
91
|
+
const selected = entries.value.find((e) => e.value === model.value);
|
|
92
|
+
return selected?.label || "\u2014";
|
|
93
|
+
});
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<template>
|
|
97
|
+
<Field
|
|
98
|
+
orientation="vertical"
|
|
99
|
+
:data-disabled="isDisabled || void 0"
|
|
100
|
+
>
|
|
101
|
+
<FieldLabel
|
|
102
|
+
v-if="labelText"
|
|
103
|
+
class="text-xs text-zinc-500"
|
|
104
|
+
>
|
|
105
|
+
<template
|
|
106
|
+
v-if="tooltipText"
|
|
107
|
+
#tooltip
|
|
108
|
+
>
|
|
109
|
+
<Markdown
|
|
110
|
+
:source="tooltipText"
|
|
111
|
+
class="prose prose-xs prose-zinc"
|
|
112
|
+
/>
|
|
113
|
+
</template>
|
|
114
|
+
{{ labelText }}
|
|
115
|
+
</FieldLabel>
|
|
116
|
+
<div
|
|
117
|
+
v-if="effectiveReadonly"
|
|
118
|
+
class="min-h-9 py-1.5 text-sm text-zinc-700"
|
|
119
|
+
>
|
|
120
|
+
{{ readonlyText }}
|
|
121
|
+
</div>
|
|
122
|
+
<div
|
|
123
|
+
v-else-if="entries.length === 0"
|
|
124
|
+
class="min-h-9 py-1.5 text-sm text-zinc-400"
|
|
125
|
+
>
|
|
126
|
+
{{ t("radio-group-empty") }}
|
|
127
|
+
</div>
|
|
128
|
+
<RadioGroup
|
|
129
|
+
v-else
|
|
130
|
+
:model-value="model"
|
|
131
|
+
:disabled="isDisabled"
|
|
132
|
+
class="flex flex-wrap items-start gap-x-6 gap-y-2 py-1"
|
|
133
|
+
@update:model-value="onSelect"
|
|
134
|
+
>
|
|
135
|
+
<label
|
|
136
|
+
v-for="entry in entries"
|
|
137
|
+
:key="entry.key"
|
|
138
|
+
data-slot="radio-group-option"
|
|
139
|
+
class="flex items-start gap-2"
|
|
140
|
+
:class="isDisabled ? 'cursor-not-allowed opacity-60' : 'cursor-pointer'"
|
|
141
|
+
>
|
|
142
|
+
<RadioGroupItem
|
|
143
|
+
:value="entry.value"
|
|
144
|
+
:disabled="isDisabled"
|
|
145
|
+
class="mt-0.5"
|
|
146
|
+
/>
|
|
147
|
+
<span class="flex flex-col gap-0.5">
|
|
148
|
+
<span class="text-sm text-zinc-700">{{ entry.label }}</span>
|
|
149
|
+
<Markdown
|
|
150
|
+
v-if="entry.tooltip"
|
|
151
|
+
:source="entry.tooltip"
|
|
152
|
+
block
|
|
153
|
+
class="prose prose-xs prose-zinc text-zinc-400"
|
|
154
|
+
/>
|
|
155
|
+
</span>
|
|
156
|
+
</label>
|
|
157
|
+
</RadioGroup>
|
|
158
|
+
</Field>
|
|
159
|
+
</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-17/com.shwfed.form.field.radio.group/schema.d.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
|
|
3
|
+
export declare const type: "com.shwfed.form.field.radio.group";
|
|
4
|
+
export declare const compatibilityDate: "2026-05-17";
|
|
5
|
+
export declare const metadata: {
|
|
6
|
+
readonly name: "单选框组";
|
|
7
|
+
readonly icon: "fluent:radio-button-20-regular";
|
|
8
|
+
readonly w: {
|
|
9
|
+
readonly initial: 8;
|
|
10
|
+
readonly min: 2;
|
|
11
|
+
readonly max: number;
|
|
12
|
+
};
|
|
13
|
+
readonly h: {
|
|
14
|
+
readonly initial: 2;
|
|
15
|
+
readonly min: 2;
|
|
16
|
+
readonly max: 2;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare function itemSchema(configure: (env: Environment) => void): Schema.Struct<{
|
|
20
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
21
|
+
label: Schema.refine<readonly [{
|
|
22
|
+
readonly locale: "zh";
|
|
23
|
+
readonly message: string;
|
|
24
|
+
}, ...{
|
|
25
|
+
readonly locale: "en" | "ja" | "ko";
|
|
26
|
+
readonly message: string;
|
|
27
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
28
|
+
locale: Schema.Literal<["zh"]>;
|
|
29
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
30
|
+
}>], [Schema.Struct<{
|
|
31
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
32
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
33
|
+
}>]>>;
|
|
34
|
+
value: Schema.Union<[Schema.Struct<{
|
|
35
|
+
kind: Schema.Literal<["text"]>;
|
|
36
|
+
value: typeof Schema.String;
|
|
37
|
+
}>, Schema.Struct<{
|
|
38
|
+
kind: Schema.Literal<["number"]>;
|
|
39
|
+
value: typeof Schema.Number;
|
|
40
|
+
}>]>;
|
|
41
|
+
tooltip: Schema.optional<Schema.refine<readonly [{
|
|
42
|
+
readonly locale: "zh";
|
|
43
|
+
readonly message: string;
|
|
44
|
+
}, ...{
|
|
45
|
+
readonly locale: "en" | "ja" | "ko";
|
|
46
|
+
readonly message: string;
|
|
47
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
48
|
+
locale: Schema.Literal<["zh"]>;
|
|
49
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
50
|
+
}>], [Schema.Struct<{
|
|
51
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
52
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
53
|
+
}>]>>>;
|
|
54
|
+
}>;
|
|
55
|
+
export declare function schema(configure: (env: Environment) => void): Schema.Struct<{
|
|
56
|
+
label: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
57
|
+
locale: Schema.Literal<["zh"]>;
|
|
58
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
59
|
+
}>], [Schema.Struct<{
|
|
60
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
61
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
62
|
+
}>]>>;
|
|
63
|
+
tooltip: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
|
|
64
|
+
locale: Schema.Literal<["zh"]>;
|
|
65
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
66
|
+
}>], [Schema.Struct<{
|
|
67
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
68
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
69
|
+
}>]>>;
|
|
70
|
+
binding: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
71
|
+
disabled: Schema.optional<Schema.Schema<string, string, never>>;
|
|
72
|
+
readonly: Schema.optional<Schema.Schema<string, string, never>>;
|
|
73
|
+
derived: Schema.optional<Schema.Struct<{
|
|
74
|
+
mode: Schema.Literal<["formula", "prefill"]>;
|
|
75
|
+
expression: Schema.Schema<string, string, never>;
|
|
76
|
+
}>>;
|
|
77
|
+
items: Schema.optionalWith<Schema.Array$<Schema.Struct<{
|
|
78
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
79
|
+
label: Schema.refine<readonly [{
|
|
80
|
+
readonly locale: "zh";
|
|
81
|
+
readonly message: string;
|
|
82
|
+
}, ...{
|
|
83
|
+
readonly locale: "en" | "ja" | "ko";
|
|
84
|
+
readonly message: string;
|
|
85
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
86
|
+
locale: Schema.Literal<["zh"]>;
|
|
87
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
88
|
+
}>], [Schema.Struct<{
|
|
89
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
90
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
91
|
+
}>]>>;
|
|
92
|
+
value: Schema.Union<[Schema.Struct<{
|
|
93
|
+
kind: Schema.Literal<["text"]>;
|
|
94
|
+
value: typeof Schema.String;
|
|
95
|
+
}>, Schema.Struct<{
|
|
96
|
+
kind: Schema.Literal<["number"]>;
|
|
97
|
+
value: typeof Schema.Number;
|
|
98
|
+
}>]>;
|
|
99
|
+
tooltip: Schema.optional<Schema.refine<readonly [{
|
|
100
|
+
readonly locale: "zh";
|
|
101
|
+
readonly message: string;
|
|
102
|
+
}, ...{
|
|
103
|
+
readonly locale: "en" | "ja" | "ko";
|
|
104
|
+
readonly message: string;
|
|
105
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
106
|
+
locale: Schema.Literal<["zh"]>;
|
|
107
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
108
|
+
}>], [Schema.Struct<{
|
|
109
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
110
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
111
|
+
}>]>>>;
|
|
112
|
+
}>>, {
|
|
113
|
+
default: () => readonly [];
|
|
114
|
+
}>;
|
|
115
|
+
id: Schema.refine<string, typeof Schema.String>;
|
|
116
|
+
displayName: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
117
|
+
hidden: Schema.optional<Schema.Schema<string, string, never>>;
|
|
118
|
+
type: Schema.Literal<["com.shwfed.form.field.radio.group"]>;
|
|
119
|
+
compatibilityDate: Schema.Literal<["2026-05-17"]>;
|
|
120
|
+
}>;
|
|
121
|
+
export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
|
package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Expression, LocaleMarkdown } from "../../../../../share/expression.js";
|
|
3
|
+
import { Locale } from "../../../../../share/locale.js";
|
|
4
|
+
import { commonFieldFields, derivedField } from "../../../utils/common.js";
|
|
5
|
+
export const type = "com.shwfed.form.field.radio.group";
|
|
6
|
+
export const compatibilityDate = "2026-05-17";
|
|
7
|
+
export const metadata = {
|
|
8
|
+
name: "\u5355\u9009\u6846\u7EC4",
|
|
9
|
+
icon: "fluent:radio-button-20-regular",
|
|
10
|
+
w: { initial: 8, min: 2, max: Infinity },
|
|
11
|
+
h: { initial: 2, min: 2, max: 2 }
|
|
12
|
+
};
|
|
13
|
+
export function itemSchema(configure) {
|
|
14
|
+
const LocaleMd = LocaleMarkdown({ configure });
|
|
15
|
+
const TextValue = Schema.Struct({
|
|
16
|
+
kind: Schema.Literal("text"),
|
|
17
|
+
value: Schema.String
|
|
18
|
+
});
|
|
19
|
+
const NumberValue = Schema.Struct({
|
|
20
|
+
kind: Schema.Literal("number"),
|
|
21
|
+
value: Schema.Number
|
|
22
|
+
});
|
|
23
|
+
const ItemValue = Schema.Union(TextValue, NumberValue).annotations({
|
|
24
|
+
title: "\u503C",
|
|
25
|
+
description: "\u9009\u9879\u7ED1\u5B9A\u7684\u503C\uFF0C\u53EF\u4EE5\u662F\u6587\u672C\u6216\u6570\u5B57"
|
|
26
|
+
});
|
|
27
|
+
return Schema.Struct({
|
|
28
|
+
id: Schema.UUID.annotations({ description: "\u9009\u9879\u552F\u4E00\u6807\u8BC6\uFF0C\u7528\u4E8E\u7A33\u5B9A\u7684 v-for key" }),
|
|
29
|
+
label: LocaleMd.annotations({
|
|
30
|
+
title: "\u6807\u7B7E",
|
|
31
|
+
description: "\u9009\u9879\u5C55\u793A\u7684\u672C\u5730\u5316\u6587\u672C\uFF0C\u652F\u6301 Markdown \u4E0E `{{ form.foo }}` \u63D2\u503C"
|
|
32
|
+
}),
|
|
33
|
+
value: ItemValue,
|
|
34
|
+
tooltip: Schema.optional(LocaleMd.annotations({
|
|
35
|
+
title: "\u63D0\u793A",
|
|
36
|
+
description: "\u5C55\u793A\u5728\u9009\u9879\u6807\u7B7E\u4E0B\u65B9\u7684\u672C\u5730\u5316\u63D0\u793A\uFF0C\u652F\u6301 Markdown"
|
|
37
|
+
}))
|
|
38
|
+
}).annotations({
|
|
39
|
+
title: "RadioGroupItem"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function schema(configure) {
|
|
43
|
+
const CelBool = Expression({ configure, resultType: "bool" });
|
|
44
|
+
const Item = itemSchema(configure);
|
|
45
|
+
return Schema.Struct({
|
|
46
|
+
type: Schema.Literal(type),
|
|
47
|
+
compatibilityDate: Schema.Literal(compatibilityDate),
|
|
48
|
+
...commonFieldFields(configure),
|
|
49
|
+
label: Schema.optional(Locale.annotations({
|
|
50
|
+
title: "\u6807\u7B7E",
|
|
51
|
+
description: "\u5B57\u6BB5\u524D\u5C55\u793A\u7684\u6587\u672C\uFF1B\u7559\u7A7A\u5219\u4E0D\u6E32\u67D3\u6807\u7B7E"
|
|
52
|
+
})),
|
|
53
|
+
tooltip: Schema.optional(Locale.annotations({
|
|
54
|
+
title: "\u63D0\u793A",
|
|
55
|
+
description: "\u9F20\u6807\u60AC\u505C\u5728\u6807\u7B7E\u4E0A\u65F6\u5C55\u793A\u7684\u8BF4\u660E"
|
|
56
|
+
})),
|
|
57
|
+
binding: Schema.optional(Schema.String.pipe(Schema.minLength(1)).annotations({
|
|
58
|
+
title: "\u7ED1\u5B9A\u8DEF\u5F84",
|
|
59
|
+
description: "\u5199\u5165\u8868\u5355\u72B6\u6001\u7684 `dot-prop` \u8DEF\u5F84\uFF0C\u4F8B\u5982 `user.role`\uFF1B\u5199\u5165\u503C\u4E3A\u9009\u4E2D\u9009\u9879\u7684\u503C\uFF1B\u7559\u7A7A\u5219\u4E3A\u975E\u53D7\u63A7\u5B57\u6BB5"
|
|
60
|
+
})),
|
|
61
|
+
disabled: Schema.optional(CelBool.annotations({
|
|
62
|
+
title: "\u7981\u7528\u6761\u4EF6",
|
|
63
|
+
description: "\u8FD4\u56DE `true` \u65F6\u5355\u9009\u6846\u4ECD\u7136\u6E32\u67D3\u4F46\u4E0D\u53EF\u9009\u62E9"
|
|
64
|
+
})),
|
|
65
|
+
readonly: Schema.optional(CelBool.annotations({
|
|
66
|
+
title: "\u53EA\u8BFB\u6761\u4EF6",
|
|
67
|
+
description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u9009\u4E2D\u9009\u9879\u7684\u6807\u7B7E"
|
|
68
|
+
})),
|
|
69
|
+
derived: derivedField(configure, "dyn"),
|
|
70
|
+
items: Schema.optionalWith(Schema.Array(Item).annotations({
|
|
71
|
+
title: "\u9009\u9879",
|
|
72
|
+
description: "\u5355\u9009\u6846\u7EC4\u53EF\u9009\u9879\u5217\u8868"
|
|
73
|
+
}), { default: () => [] })
|
|
74
|
+
}).annotations({
|
|
75
|
+
title: "RadioGroupField",
|
|
76
|
+
description: "\u5355\u9009\u6846\u7EC4\u5355\u9009\u8F93\u5165"
|
|
77
|
+
});
|
|
78
|
+
}
|
|
@@ -11,6 +11,12 @@ type __VLS_ModelProps = {
|
|
|
11
11
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
12
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
13
13
|
seeded: Promise<void>;
|
|
14
|
+
flush: () => void;
|
|
15
|
+
settled: () => Promise<void>;
|
|
16
|
+
undo: () => void;
|
|
17
|
+
redo: () => void;
|
|
18
|
+
canUndo: import("vue").Ref<boolean, boolean>;
|
|
19
|
+
canRedo: import("vue").Ref<boolean, boolean>;
|
|
14
20
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
21
|
"update:modelValue": (value: FormState) => any;
|
|
16
22
|
"update:config": (value: FormConfigValue) => any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { cel as _rawCel } from "../../utils/cel";
|
|
3
3
|
import { TZDate } from "@date-fns/tz";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
import { computed, onMounted, ref, watch } from "vue";
|
|
@@ -7,9 +7,14 @@ import {
|
|
|
7
7
|
celBindings,
|
|
8
8
|
injectCELContext,
|
|
9
9
|
provideCELContext
|
|
10
|
-
} from "../../
|
|
10
|
+
} from "../../utils/cel-context";
|
|
11
|
+
import { provideCommitBus } from "./utils/commit-bus";
|
|
12
|
+
import { provideDerivedQuiescence, useDerived } from "./utils/derived";
|
|
13
|
+
import { useFormHistory } from "./utils/history";
|
|
14
|
+
import { provideFormReadonly } from "./utils/readonly";
|
|
11
15
|
import { findField } from "./utils/resolve";
|
|
12
16
|
import { provideFormState } from "./utils/state";
|
|
17
|
+
import { DEFAULT_GAP } from "./schema";
|
|
13
18
|
defineOptions({ name: "ShwfedForm" });
|
|
14
19
|
const state = defineModel({ type: Object, ...{ default: () => ({}) } });
|
|
15
20
|
const config = defineModel("config", { type: Object, ...{ required: true } });
|
|
@@ -19,7 +24,6 @@ const props = defineProps({
|
|
|
19
24
|
const configure = props.configure ?? (() => {
|
|
20
25
|
});
|
|
21
26
|
void configure;
|
|
22
|
-
const { $cel: _rawCel } = useNuxtApp();
|
|
23
27
|
provideCELContext({
|
|
24
28
|
form: {
|
|
25
29
|
type: "dyn",
|
|
@@ -40,7 +44,20 @@ provideCELContext({
|
|
|
40
44
|
});
|
|
41
45
|
const inherited = injectCELContext();
|
|
42
46
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
43
|
-
provideFormState(state);
|
|
47
|
+
const formState = provideFormState(state);
|
|
48
|
+
const commitBus = provideCommitBus();
|
|
49
|
+
const quiescence = provideDerivedQuiescence();
|
|
50
|
+
const formReadonly = computed(() => {
|
|
51
|
+
const expr = config.value.readonly;
|
|
52
|
+
if (!expr) return false;
|
|
53
|
+
try {
|
|
54
|
+
return Effect.runSync($cel(expr, { form: state.value ?? {} }));
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.error("[shwfed-form] failed to evaluate form readonly:", err);
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
provideFormReadonly(formReadonly);
|
|
44
61
|
const seeded = (() => {
|
|
45
62
|
const current = state.value ?? {};
|
|
46
63
|
const initial = config.value.initial;
|
|
@@ -56,7 +73,23 @@ const seeded = (() => {
|
|
|
56
73
|
}
|
|
57
74
|
);
|
|
58
75
|
})();
|
|
59
|
-
|
|
76
|
+
useDerived({
|
|
77
|
+
fields: () => config.value.fields,
|
|
78
|
+
evaluate: (expression) => $cel(expression),
|
|
79
|
+
ready: seeded,
|
|
80
|
+
formState,
|
|
81
|
+
quiescence
|
|
82
|
+
});
|
|
83
|
+
const formHistory = useFormHistory(state, { quiescence, seeded, dirty: formState.dirty });
|
|
84
|
+
defineExpose({
|
|
85
|
+
seeded,
|
|
86
|
+
flush: commitBus.flushAll,
|
|
87
|
+
settled: quiescence.settled,
|
|
88
|
+
undo: formHistory.undo,
|
|
89
|
+
redo: formHistory.redo,
|
|
90
|
+
canUndo: formHistory.canUndo,
|
|
91
|
+
canRedo: formHistory.canRedo
|
|
92
|
+
});
|
|
60
93
|
function pickLayout(sets) {
|
|
61
94
|
for (const set of sets) {
|
|
62
95
|
if (!set.media) return set;
|
|
@@ -140,7 +173,9 @@ const gridStyle = computed(() => {
|
|
|
140
173
|
"display: grid",
|
|
141
174
|
`grid-template-columns: ${colTemplate}`,
|
|
142
175
|
rowTemplate ? `grid-template-rows: ${rowTemplate}` : "",
|
|
143
|
-
|
|
176
|
+
// A missing `gap` resolves to `DEFAULT_GAP`, not 0 — same fallback the
|
|
177
|
+
// layout editor shows, so editor and render agree. `gap: 0` stays 0.
|
|
178
|
+
`gap: calc(${l.gap ?? DEFAULT_GAP} * 0.25rem)`,
|
|
144
179
|
l.style ?? ""
|
|
145
180
|
].filter(Boolean);
|
|
146
181
|
return parts.join("; ");
|
|
@@ -11,6 +11,12 @@ type __VLS_ModelProps = {
|
|
|
11
11
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
12
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
13
13
|
seeded: Promise<void>;
|
|
14
|
+
flush: () => void;
|
|
15
|
+
settled: () => Promise<void>;
|
|
16
|
+
undo: () => void;
|
|
17
|
+
redo: () => void;
|
|
18
|
+
canUndo: import("vue").Ref<boolean, boolean>;
|
|
19
|
+
canRedo: import("vue").Ref<boolean, boolean>;
|
|
14
20
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
21
|
"update:modelValue": (value: FormState) => any;
|
|
16
22
|
"update:config": (value: FormConfigValue) => any;
|
|
@@ -3,7 +3,7 @@ import type { Environment } from '../../vendor/cel-js/lib/index.js';
|
|
|
3
3
|
import { type LayoutSetValue } from '../../share/layout.js';
|
|
4
4
|
export { commonFieldFields } from './utils/common.js';
|
|
5
5
|
export { getStructFieldTitle, getStructFieldDescription } from './utils/schema-meta.js';
|
|
6
|
-
export { Align, LayoutSet, validatePlacements } from '../../share/layout.js';
|
|
6
|
+
export { Align, DEFAULT_GAP, LayoutSet, validatePlacements } from '../../share/layout.js';
|
|
7
7
|
declare const KIND = "shwfed.component.form";
|
|
8
8
|
type AnySchema = Schema.Schema<any, any, never>;
|
|
9
9
|
/**
|
|
@@ -89,6 +89,7 @@ export declare function FormConfig(configure: (env: Environment) => void): Schem
|
|
|
89
89
|
};
|
|
90
90
|
readonly media?: string | undefined;
|
|
91
91
|
}[];
|
|
92
|
+
readonly readonly?: string | undefined;
|
|
92
93
|
}, Schema.Struct<{
|
|
93
94
|
fields: Schema.Array$<AnySchema>;
|
|
94
95
|
layouts: Schema.refine<readonly {
|
|
@@ -124,6 +125,7 @@ export declare function FormConfig(configure: (env: Environment) => void): Schem
|
|
|
124
125
|
}>>>;
|
|
125
126
|
kind: Schema.tag<"shwfed.component.form">;
|
|
126
127
|
initial: Schema.optional<Schema.Schema<string, string, never>>;
|
|
128
|
+
readonly: Schema.optional<Schema.Schema<string, string, never>>;
|
|
127
129
|
}>>;
|
|
128
130
|
export declare function createFormConfig(body: Omit<Schema.Schema.Type<ReturnType<typeof FormConfig>>, 'kind'>): {
|
|
129
131
|
initial?: string | undefined;
|
|
@@ -145,6 +147,7 @@ export declare function createFormConfig(body: Omit<Schema.Schema.Type<ReturnTyp
|
|
|
145
147
|
};
|
|
146
148
|
readonly media?: string | undefined;
|
|
147
149
|
}[];
|
|
150
|
+
readonly?: string | undefined;
|
|
148
151
|
kind: typeof KIND;
|
|
149
152
|
};
|
|
150
153
|
export declare function defaultFormConfig(): FormConfigValue;
|
|
@@ -161,4 +164,5 @@ export type FormUnitValue = Readonly<{
|
|
|
161
164
|
export type FormConfigValue = Readonly<{
|
|
162
165
|
kind: typeof KIND;
|
|
163
166
|
initial?: string;
|
|
167
|
+
readonly?: string;
|
|
164
168
|
}> & FormUnitValue;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "../../share/layout.js";
|
|
9
9
|
export { commonFieldFields } from "./utils/common.js";
|
|
10
10
|
export { getStructFieldTitle, getStructFieldDescription } from "./utils/schema-meta.js";
|
|
11
|
-
export { Align, LayoutSet, validatePlacements } from "../../share/layout.js";
|
|
11
|
+
export { Align, DEFAULT_GAP, LayoutSet, validatePlacements } from "../../share/layout.js";
|
|
12
12
|
const KIND = "shwfed.component.form";
|
|
13
13
|
function unitFields(configure) {
|
|
14
14
|
const fieldSchemas = allFieldSchemas(configure);
|
|
@@ -40,9 +40,11 @@ export function FormUnit(configure) {
|
|
|
40
40
|
export function FormConfig(configure) {
|
|
41
41
|
const formConfigure = (env) => {
|
|
42
42
|
env.registerVariable("now", "Date", { description: "\u5F53\u524D\u65E5\u671F/\u65F6\u95F4" });
|
|
43
|
+
env.registerVariable("form", "dyn", { description: "\u5F53\u524D\u8868\u5355\u72B6\u6001" });
|
|
43
44
|
configure(env);
|
|
44
45
|
};
|
|
45
46
|
const CelFormInitial = Expression({ configure: formConfigure, resultType: "dyn" });
|
|
47
|
+
const CelFormReadonly = Expression({ configure: formConfigure, resultType: "bool" });
|
|
46
48
|
return Schema.Struct({
|
|
47
49
|
kind: Schema.tag(KIND),
|
|
48
50
|
initial: Schema.optional(CelFormInitial.annotations({
|
|
@@ -59,6 +61,16 @@ export function FormConfig(configure) {
|
|
|
59
61
|
- 如果配置了初始值,重置这个表单将**重置为其初始值,而非空**
|
|
60
62
|
`
|
|
61
63
|
})),
|
|
64
|
+
readonly: Schema.optional(CelFormReadonly.annotations({
|
|
65
|
+
title: "\u53EA\u8BFB\u6761\u4EF6",
|
|
66
|
+
description: md`
|
|
67
|
+
返回 \`true\` 时整个表单切到只读:所有字段以纯文本展示、不可编辑。
|
|
68
|
+
|
|
69
|
+
可访问 \`form\` 当前状态,因此可让表单按数据自锁——例如 \`form.status == 'submitted'\`,新建时可填、载入已提交的记录后只读。
|
|
70
|
+
|
|
71
|
+
字段自身的「只读条件」会**覆盖**这里:未配置只读条件的字段跟随本表达式,配置了的以字段自己的结果为准(可在只读表单中单独放开某个字段)。
|
|
72
|
+
`
|
|
73
|
+
})),
|
|
62
74
|
...unitFields(formConfigure)
|
|
63
75
|
}).pipe(Schema.filter(unitPlacementsFilter)).annotations({
|
|
64
76
|
title: "FormConfig",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { cel as rawCel } from "../../utils/cel";
|
|
3
3
|
import { Icon } from "@iconify/vue";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
5
|
import { computed, inject, onBeforeUnmount, provide, ref, useTemplateRef, watch } from "vue";
|
|
@@ -7,7 +7,7 @@ import { toast } from "vue-sonner";
|
|
|
7
7
|
import {
|
|
8
8
|
celBindings,
|
|
9
9
|
injectCELContext
|
|
10
|
-
} from "../../
|
|
10
|
+
} from "../../utils/cel-context";
|
|
11
11
|
import { findFreePlacement, normalizeLayoutSet } from "../../share/layout";
|
|
12
12
|
import { getLocalizedText } from "../../share/locale";
|
|
13
13
|
import BlockLayoutEditor from "../block-layout-editor/index.vue";
|
|
@@ -43,9 +43,7 @@ provide(FORM_FIELD_LAYOUT_KEY, { fullPane });
|
|
|
43
43
|
const takeover = inject(SIDEBAR_TAKEOVER_KEY, null);
|
|
44
44
|
const takeoverTarget = computed(() => takeover?.target.value ?? null);
|
|
45
45
|
const activeFieldId = computed(() => {
|
|
46
|
-
|
|
47
|
-
if (t.kind === "field-drill") return t.id;
|
|
48
|
-
return selection.value.kind === "field" ? selection.value.id : null;
|
|
46
|
+
return top.value.kind === "field-drill" ? top.value.id : null;
|
|
49
47
|
});
|
|
50
48
|
const activeField = computed(() => {
|
|
51
49
|
const id = activeFieldId.value;
|
|
@@ -148,7 +146,7 @@ function addField(entry, options) {
|
|
|
148
146
|
layouts: nextLayouts
|
|
149
147
|
};
|
|
150
148
|
if (!options?.silent) {
|
|
151
|
-
|
|
149
|
+
drillField(field.id);
|
|
152
150
|
}
|
|
153
151
|
}
|
|
154
152
|
function removeField(id) {
|
|
@@ -169,9 +167,6 @@ function removeFields(ids) {
|
|
|
169
167
|
});
|
|
170
168
|
})
|
|
171
169
|
};
|
|
172
|
-
if (selection.value.kind === "field" && drop.has(selection.value.id)) {
|
|
173
|
-
selection.value = { kind: "layout" };
|
|
174
|
-
}
|
|
175
170
|
if (top.value.kind === "field-drill" && drop.has(top.value.id)) {
|
|
176
171
|
stack.value = stack.value.slice(0, -1);
|
|
177
172
|
}
|
|
@@ -185,7 +180,6 @@ function updateActiveField(next) {
|
|
|
185
180
|
fields[i] = next;
|
|
186
181
|
unit.value = { ...unit.value, fields };
|
|
187
182
|
}
|
|
188
|
-
const { $cel: rawCel } = useNuxtApp();
|
|
189
183
|
const inheritedCEL = injectCELContext();
|
|
190
184
|
function celForMigration(expression, context) {
|
|
191
185
|
return rawCel(expression, { ...celBindings(inheritedCEL), ...context });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form-wide registry of pending field commits.
|
|
3
|
+
*
|
|
4
|
+
* Text-like fields defer writing their draft into form state until blur (see
|
|
5
|
+
* `useFieldValue`). A focused field therefore still holds uncommitted input
|
|
6
|
+
* when something reads the form — e.g. a parent about to submit. The host
|
|
7
|
+
* calls `flushAll()` to drain every pending draft into form state first.
|
|
8
|
+
*/
|
|
9
|
+
export type CommitBus = {
|
|
10
|
+
/** Register a field's commit fn; returns a callback that unregisters it. */
|
|
11
|
+
register: (commit: () => void) => () => void;
|
|
12
|
+
/** Commit every registered field's pending draft. */
|
|
13
|
+
flushAll: () => void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Provide a commit bus for the current form. Called once at the top-level
|
|
17
|
+
* form host; nested list rows inherit it through `inject`, so a single bus
|
|
18
|
+
* spans every field in the form regardless of nesting depth.
|
|
19
|
+
*/
|
|
20
|
+
export declare function provideCommitBus(): CommitBus;
|
|
21
|
+
/**
|
|
22
|
+
* Inject the form's commit bus. Falls back to a no-op bus when a field is
|
|
23
|
+
* mounted outside a `<Form>` host — a field is fully functional without one;
|
|
24
|
+
* the bus only matters for host-driven flushing.
|
|
25
|
+
*/
|
|
26
|
+
export declare function useCommitBus(): CommitBus;
|