@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-04-27/com.shwfed.form.field.timerange/config.vue
CHANGED
|
@@ -3,6 +3,7 @@ import { Icon } from "@iconify/vue";
|
|
|
3
3
|
import { computed } from "vue";
|
|
4
4
|
import { format as formatDate } from "date-fns";
|
|
5
5
|
import { ExpressionEditor } from "../../../../ui/expression-editor";
|
|
6
|
+
import DerivedValueEditor from "../../../DerivedValueEditor.vue";
|
|
6
7
|
import { Field, FieldLabel } from "../../../../ui/field";
|
|
7
8
|
import { IconPicker } from "../../../../ui/icon-picker";
|
|
8
9
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText } from "../../../../ui/input-group";
|
|
@@ -251,6 +252,7 @@ const valueFormatExample = computed(() => {
|
|
|
251
252
|
{{ fieldTitle("tooltip") }}
|
|
252
253
|
</FieldLabel>
|
|
253
254
|
<LocaleField
|
|
255
|
+
markdown
|
|
254
256
|
:model-value="value.tooltip"
|
|
255
257
|
@update:model-value="(v) => value = { ...value, tooltip: v }"
|
|
256
258
|
/>
|
|
@@ -461,5 +463,24 @@ const valueFormatExample = computed(() => {
|
|
|
461
463
|
/>
|
|
462
464
|
</Field>
|
|
463
465
|
</div>
|
|
466
|
+
|
|
467
|
+
<Field orientation="vertical">
|
|
468
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
469
|
+
<template #tooltip>
|
|
470
|
+
<Markdown
|
|
471
|
+
:source="fieldDescription('derived')"
|
|
472
|
+
block
|
|
473
|
+
class="prose prose-sm prose-zinc"
|
|
474
|
+
/>
|
|
475
|
+
</template>
|
|
476
|
+
{{ fieldTitle("derived") }}
|
|
477
|
+
</FieldLabel>
|
|
478
|
+
<DerivedValueEditor
|
|
479
|
+
:model-value="value.derived"
|
|
480
|
+
result-type="dyn"
|
|
481
|
+
placeholder="例:[form.from, form.to]"
|
|
482
|
+
@update:model-value="(v) => value = { ...value, derived: v }"
|
|
483
|
+
/>
|
|
484
|
+
</Field>
|
|
464
485
|
</div>
|
|
465
486
|
</template>
|
|
@@ -26,11 +26,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
26
26
|
readonly compatibilityDate: "2026-04-27";
|
|
27
27
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
28
28
|
readonly readonly?: string | undefined;
|
|
29
|
+
readonly binding?: string | readonly [string, string] | undefined;
|
|
30
|
+
readonly derived?: {
|
|
31
|
+
readonly mode: "formula" | "prefill";
|
|
32
|
+
readonly expression: string;
|
|
33
|
+
} | undefined;
|
|
29
34
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
30
35
|
readonly valueFormat?: string | undefined;
|
|
31
|
-
readonly timeGranularity?: "
|
|
36
|
+
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
32
37
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
33
|
-
readonly binding?: string | readonly [string, string] | undefined;
|
|
34
38
|
}) => any;
|
|
35
39
|
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
36
40
|
"onUpdate:modelValue"?: ((value: {
|
|
@@ -56,11 +60,15 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
56
60
|
readonly compatibilityDate: "2026-04-27";
|
|
57
61
|
readonly orientation?: "vertical" | "floating" | undefined;
|
|
58
62
|
readonly readonly?: string | undefined;
|
|
63
|
+
readonly binding?: string | readonly [string, string] | undefined;
|
|
64
|
+
readonly derived?: {
|
|
65
|
+
readonly mode: "formula" | "prefill";
|
|
66
|
+
readonly expression: string;
|
|
67
|
+
} | undefined;
|
|
59
68
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
60
69
|
readonly valueFormat?: string | undefined;
|
|
61
|
-
readonly timeGranularity?: "
|
|
70
|
+
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
62
71
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
63
|
-
readonly binding?: string | readonly [string, string] | undefined;
|
|
64
72
|
}) => any) | undefined;
|
|
65
73
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
66
74
|
declare const _default: typeof __VLS_export;
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/runtime.vue
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { useNuxtApp } from "#app";
|
|
3
2
|
import { Effect } from "effect";
|
|
4
3
|
import { computed, ref } from "vue";
|
|
5
4
|
import { useI18n } from "vue-i18n";
|
|
6
|
-
import {
|
|
5
|
+
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
6
|
+
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
7
7
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
8
8
|
import { DateRangePicker } from "../../../../ui/date-range-picker";
|
|
9
9
|
import { Field, FieldLabel } from "../../../../ui/field";
|
|
10
|
+
import { Markdown } from "../../../../ui/markdown";
|
|
10
11
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
12
|
+
import { useFormReadonly } from "../../../utils/readonly";
|
|
11
13
|
import { useFormState } from "../../../utils/state";
|
|
12
14
|
defineOptions({ name: "ShwfedTimeRangeFieldRuntime" });
|
|
13
15
|
const props = defineProps({
|
|
@@ -16,7 +18,6 @@ const props = defineProps({
|
|
|
16
18
|
});
|
|
17
19
|
const { locale } = useI18n();
|
|
18
20
|
const { state, getAt, setAt } = useFormState();
|
|
19
|
-
const { $cel: _rawCel } = useNuxtApp();
|
|
20
21
|
const inherited = injectCELContext();
|
|
21
22
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
22
23
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -33,7 +34,11 @@ function evalBool(expression, label) {
|
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
const isDisabled = computed(() => evalBool(props.config.disabled, "disabled"));
|
|
36
|
-
const
|
|
37
|
+
const formReadonly = useFormReadonly();
|
|
38
|
+
const isReadonly = computed(
|
|
39
|
+
() => props.config.readonly != null ? evalBool(props.config.readonly, "readonly") : formReadonly.value
|
|
40
|
+
);
|
|
41
|
+
const effectiveReadonly = computed(() => isReadonly.value || props.config.derived?.mode === "formula");
|
|
37
42
|
function asRange(raw) {
|
|
38
43
|
if (!Array.isArray(raw) || raw.length !== 2) return void 0;
|
|
39
44
|
const [a, b] = raw;
|
|
@@ -90,12 +95,15 @@ const readonlyText = computed(() => {
|
|
|
90
95
|
v-if="tooltipText"
|
|
91
96
|
#tooltip
|
|
92
97
|
>
|
|
93
|
-
|
|
98
|
+
<Markdown
|
|
99
|
+
:source="tooltipText"
|
|
100
|
+
class="prose prose-xs prose-zinc"
|
|
101
|
+
/>
|
|
94
102
|
</template>
|
|
95
103
|
{{ labelText }}
|
|
96
104
|
</FieldLabel>
|
|
97
105
|
<div
|
|
98
|
-
v-if="
|
|
106
|
+
v-if="effectiveReadonly"
|
|
99
107
|
class="min-h-9 py-1.5 text-sm text-zinc-700"
|
|
100
108
|
>
|
|
101
109
|
{{ readonlyText }}
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.d.ts
CHANGED
|
@@ -45,6 +45,10 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
45
45
|
binding: Schema.optional<Schema.Union<[Schema.filter<typeof Schema.String>, Schema.filter<Schema.Tuple2<Schema.filter<typeof Schema.String>, Schema.filter<typeof Schema.String>>>]>>;
|
|
46
46
|
disabled: Schema.optional<Schema.Schema<string, string, never>>;
|
|
47
47
|
readonly: Schema.optional<Schema.Schema<string, string, never>>;
|
|
48
|
+
derived: Schema.optional<Schema.Struct<{
|
|
49
|
+
mode: Schema.Literal<["formula", "prefill"]>;
|
|
50
|
+
expression: Schema.Schema<string, string, never>;
|
|
51
|
+
}>>;
|
|
48
52
|
valueFormat: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
49
53
|
rangeSeparatorIcon: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
50
54
|
timeGranularity: Schema.optional<Schema.Literal<["hour", "minute", "second"]>>;
|
package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { Expression } from "../../../../../share/expression.js";
|
|
3
3
|
import { Locale } from "../../../../../share/locale.js";
|
|
4
|
-
import { commonFieldFields, FieldOrientationSchema } from "../../../utils/common.js";
|
|
4
|
+
import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
|
|
5
5
|
export const type = "com.shwfed.form.field.timerange";
|
|
6
6
|
export const compatibilityDate = "2026-04-27";
|
|
7
7
|
const BindingPath = Schema.String.pipe(Schema.minLength(1));
|
|
@@ -54,6 +54,7 @@ export function schema(configure) {
|
|
|
54
54
|
title: "\u53EA\u8BFB\u6761\u4EF6",
|
|
55
55
|
description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u503C"
|
|
56
56
|
})),
|
|
57
|
+
derived: derivedField(configure, "dyn"),
|
|
57
58
|
valueFormat: Schema.optional(Schema.String.pipe(Schema.minLength(1)).annotations({
|
|
58
59
|
title: "\u5B58\u50A8\u683C\u5F0F",
|
|
59
60
|
description: "\u5199\u5165\u8868\u5355\u72B6\u6001\u7684 `date-fns` \u683C\u5F0F\u4E32\uFF1B\u7559\u7A7A\u65F6\u4F7F\u7528\u9ED8\u8BA4 `HH:mm:ss`"
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts
CHANGED
|
@@ -37,6 +37,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
37
37
|
readonly step?: number | undefined;
|
|
38
38
|
readonly readonly?: string | undefined;
|
|
39
39
|
readonly binding?: string | undefined;
|
|
40
|
+
readonly derived?: {
|
|
41
|
+
readonly mode: "formula" | "prefill";
|
|
42
|
+
readonly expression: string;
|
|
43
|
+
} | undefined;
|
|
40
44
|
readonly precision?: number | undefined;
|
|
41
45
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
42
46
|
}) => any;
|
|
@@ -75,6 +79,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
75
79
|
readonly step?: number | undefined;
|
|
76
80
|
readonly readonly?: string | undefined;
|
|
77
81
|
readonly binding?: string | undefined;
|
|
82
|
+
readonly derived?: {
|
|
83
|
+
readonly mode: "formula" | "prefill";
|
|
84
|
+
readonly expression: string;
|
|
85
|
+
} | undefined;
|
|
78
86
|
readonly precision?: number | undefined;
|
|
79
87
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
80
88
|
}) => any) | undefined;
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
DropdownMenuTrigger
|
|
9
9
|
} from "../../../../ui/dropdown-menu";
|
|
10
10
|
import { ExpressionEditor } from "../../../../ui/expression-editor";
|
|
11
|
+
import DerivedValueEditor from "../../../DerivedValueEditor.vue";
|
|
11
12
|
import { Field, FieldLabel } from "../../../../ui/field";
|
|
12
13
|
import {
|
|
13
14
|
InputGroup,
|
|
@@ -183,6 +184,7 @@ function onStepChange(v) {
|
|
|
183
184
|
{{ fieldTitle("tooltip") }}
|
|
184
185
|
</FieldLabel>
|
|
185
186
|
<LocaleField
|
|
187
|
+
markdown
|
|
186
188
|
:model-value="value.tooltip"
|
|
187
189
|
@update:model-value="(v) => value = { ...value, tooltip: v }"
|
|
188
190
|
/>
|
|
@@ -401,5 +403,24 @@ function onStepChange(v) {
|
|
|
401
403
|
/>
|
|
402
404
|
</Field>
|
|
403
405
|
</div>
|
|
406
|
+
|
|
407
|
+
<Field orientation="vertical">
|
|
408
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
409
|
+
<template #tooltip>
|
|
410
|
+
<Markdown
|
|
411
|
+
:source="fieldDescription('derived')"
|
|
412
|
+
block
|
|
413
|
+
class="prose prose-sm prose-zinc"
|
|
414
|
+
/>
|
|
415
|
+
</template>
|
|
416
|
+
{{ fieldTitle("derived") }}
|
|
417
|
+
</FieldLabel>
|
|
418
|
+
<DerivedValueEditor
|
|
419
|
+
:model-value="value.derived"
|
|
420
|
+
result-type="number"
|
|
421
|
+
placeholder="例:form.price * form.qty"
|
|
422
|
+
@update:model-value="(v) => value = { ...value, derived: v }"
|
|
423
|
+
/>
|
|
424
|
+
</Field>
|
|
404
425
|
</div>
|
|
405
426
|
</template>
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts
CHANGED
|
@@ -37,6 +37,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
37
37
|
readonly step?: number | undefined;
|
|
38
38
|
readonly readonly?: string | undefined;
|
|
39
39
|
readonly binding?: string | undefined;
|
|
40
|
+
readonly derived?: {
|
|
41
|
+
readonly mode: "formula" | "prefill";
|
|
42
|
+
readonly expression: string;
|
|
43
|
+
} | undefined;
|
|
40
44
|
readonly precision?: number | undefined;
|
|
41
45
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
42
46
|
}) => any;
|
|
@@ -75,6 +79,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
75
79
|
readonly step?: number | undefined;
|
|
76
80
|
readonly readonly?: string | undefined;
|
|
77
81
|
readonly binding?: string | undefined;
|
|
82
|
+
readonly derived?: {
|
|
83
|
+
readonly mode: "formula" | "prefill";
|
|
84
|
+
readonly expression: string;
|
|
85
|
+
} | undefined;
|
|
78
86
|
readonly precision?: number | undefined;
|
|
79
87
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
80
88
|
}) => any) | undefined;
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/runtime.vue
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { useNuxtApp } from "#app";
|
|
3
2
|
import { Icon } from "@iconify/vue";
|
|
4
3
|
import { Effect } from "effect";
|
|
5
|
-
import { computed, nextTick
|
|
4
|
+
import { computed, nextTick } from "vue";
|
|
6
5
|
import { useI18n } from "vue-i18n";
|
|
7
|
-
import {
|
|
6
|
+
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
7
|
+
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
8
8
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
9
9
|
import { Field, FieldLabel } from "../../../../ui/field";
|
|
10
10
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupNumberField } from "../../../../ui/input-group";
|
|
11
|
+
import { Markdown } from "../../../../ui/markdown";
|
|
11
12
|
import { DEFAULT_FIELD_ORIENTATION } from "../../../utils/common";
|
|
13
|
+
import { useFieldValue } from "../../../utils/field-value";
|
|
14
|
+
import { useFormReadonly } from "../../../utils/readonly";
|
|
12
15
|
import { useFormState } from "../../../utils/state";
|
|
13
16
|
defineOptions({ name: "ShwfedNumberFieldRuntime" });
|
|
14
17
|
const props = defineProps({
|
|
@@ -16,8 +19,7 @@ const props = defineProps({
|
|
|
16
19
|
config: { type: null, required: true }
|
|
17
20
|
});
|
|
18
21
|
const { locale } = useI18n();
|
|
19
|
-
const { state
|
|
20
|
-
const { $cel: _rawCel } = useNuxtApp();
|
|
22
|
+
const { state } = useFormState();
|
|
21
23
|
const inherited = injectCELContext();
|
|
22
24
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
23
25
|
const labelText = computed(() => getLocalizedText(props.config.label, locale.value));
|
|
@@ -47,31 +49,21 @@ function evalNumber(expression, label) {
|
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
const isDisabled = computed(() => evalBool(props.config.disabled, "disabled"));
|
|
50
|
-
const
|
|
52
|
+
const formReadonly = useFormReadonly();
|
|
53
|
+
const isReadonly = computed(
|
|
54
|
+
() => props.config.readonly != null ? evalBool(props.config.readonly, "readonly") : formReadonly.value
|
|
55
|
+
);
|
|
56
|
+
const effectiveReadonly = computed(() => isReadonly.value || props.config.derived?.mode === "formula");
|
|
51
57
|
const minValue = computed(() => evalNumber(props.config.min, "min"));
|
|
52
58
|
const maxValue = computed(() => evalNumber(props.config.max, "max"));
|
|
53
59
|
const formatOptions = computed(() => ({
|
|
54
60
|
useGrouping: false,
|
|
55
61
|
maximumFractionDigits: 20
|
|
56
62
|
}));
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (path == null) return uncontrolled.value;
|
|
62
|
-
const raw = getAt(path);
|
|
63
|
-
return typeof raw === "number" && Number.isFinite(raw) ? raw : void 0;
|
|
64
|
-
},
|
|
65
|
-
set: (next) => {
|
|
66
|
-
const path = props.config.binding;
|
|
67
|
-
const value = typeof next === "number" && Number.isFinite(next) ? next : void 0;
|
|
68
|
-
if (path == null) {
|
|
69
|
-
uncontrolled.value = value;
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (value === void 0) delAt(path);
|
|
73
|
-
else setAt(path, value);
|
|
74
|
-
}
|
|
63
|
+
const { draft, commit } = useFieldValue({
|
|
64
|
+
binding: () => props.config.binding,
|
|
65
|
+
fromState: (raw) => typeof raw === "number" && Number.isFinite(raw) ? raw : void 0,
|
|
66
|
+
toState: (next) => typeof next === "number" && Number.isFinite(next) ? next : null
|
|
75
67
|
});
|
|
76
68
|
function applyRounding(n, precision, mode) {
|
|
77
69
|
const factor = 10 ** precision;
|
|
@@ -84,18 +76,22 @@ function applyRounding(n, precision, mode) {
|
|
|
84
76
|
return Math.round(n * factor) / factor;
|
|
85
77
|
}
|
|
86
78
|
}
|
|
87
|
-
const showClear = computed(() => !isDisabled.value &&
|
|
79
|
+
const showClear = computed(() => !isDisabled.value && draft.value !== void 0);
|
|
88
80
|
function handleClear() {
|
|
89
|
-
|
|
81
|
+
draft.value = void 0;
|
|
82
|
+
commit();
|
|
90
83
|
}
|
|
91
84
|
async function onBlur() {
|
|
92
|
-
const precision = props.config.precision;
|
|
93
|
-
if (precision === void 0) return;
|
|
94
85
|
await nextTick();
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
|
|
86
|
+
const precision = props.config.precision;
|
|
87
|
+
if (precision !== void 0) {
|
|
88
|
+
const current = draft.value;
|
|
89
|
+
if (current !== void 0) {
|
|
90
|
+
const rounded = applyRounding(current, precision, props.config.roundingMode ?? "round");
|
|
91
|
+
if (rounded !== current) draft.value = rounded;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
commit();
|
|
99
95
|
}
|
|
100
96
|
</script>
|
|
101
97
|
|
|
@@ -113,15 +109,18 @@ async function onBlur() {
|
|
|
113
109
|
v-if="tooltipText"
|
|
114
110
|
#tooltip
|
|
115
111
|
>
|
|
116
|
-
|
|
112
|
+
<Markdown
|
|
113
|
+
:source="tooltipText"
|
|
114
|
+
class="prose prose-xs prose-zinc"
|
|
115
|
+
/>
|
|
117
116
|
</template>
|
|
118
117
|
{{ labelText }}
|
|
119
118
|
</FieldLabel>
|
|
120
119
|
<div
|
|
121
|
-
v-if="
|
|
120
|
+
v-if="effectiveReadonly"
|
|
122
121
|
class="min-h-9 py-1.5 text-sm text-zinc-700"
|
|
123
122
|
>
|
|
124
|
-
{{
|
|
123
|
+
{{ draft ?? "\u2014" }}
|
|
125
124
|
</div>
|
|
126
125
|
<InputGroup
|
|
127
126
|
v-else
|
|
@@ -130,7 +129,7 @@ async function onBlur() {
|
|
|
130
129
|
>
|
|
131
130
|
<InputGroupNumberField
|
|
132
131
|
:id="fieldId"
|
|
133
|
-
:model-value="
|
|
132
|
+
:model-value="draft"
|
|
134
133
|
:step="config.step"
|
|
135
134
|
:step-snapping="config.step !== void 0"
|
|
136
135
|
:min="minValue"
|
|
@@ -139,13 +138,13 @@ async function onBlur() {
|
|
|
139
138
|
:disabled="isDisabled"
|
|
140
139
|
:placeholder="placeholderText"
|
|
141
140
|
input-class="text-left"
|
|
142
|
-
@update:model-value="(v) =>
|
|
141
|
+
@update:model-value="(v) => draft = v"
|
|
143
142
|
@blur="onBlur"
|
|
144
143
|
/>
|
|
145
144
|
<InputGroupAddon
|
|
146
145
|
v-if="showClear"
|
|
147
146
|
align="inline-end"
|
|
148
|
-
class="opacity-0 transition-opacity group-hover/number-field:opacity-100 focus-within:opacity-100"
|
|
147
|
+
class="[@media(hover:hover)]:opacity-0 transition-opacity group-hover/number-field:opacity-100 focus-within:opacity-100"
|
|
149
148
|
>
|
|
150
149
|
<InputGroupButton
|
|
151
150
|
size="icon-xs"
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
42
42
|
binding: Schema.optional<Schema.refine<string, typeof Schema.String>>;
|
|
43
43
|
disabled: Schema.optional<Schema.Schema<string, string, never>>;
|
|
44
44
|
readonly: Schema.optional<Schema.Schema<string, string, never>>;
|
|
45
|
+
derived: Schema.optional<Schema.Struct<{
|
|
46
|
+
mode: Schema.Literal<["formula", "prefill"]>;
|
|
47
|
+
expression: Schema.Schema<string, string, never>;
|
|
48
|
+
}>>;
|
|
45
49
|
precision: Schema.optional<Schema.refine<number, Schema.filter<typeof Schema.Number>>>;
|
|
46
50
|
roundingMode: Schema.optional<Schema.Literal<["round", "floor", "ceil"]>>;
|
|
47
51
|
step: Schema.optional<Schema.refine<number, typeof Schema.Number>>;
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { Expression } from "../../../../../share/expression.js";
|
|
3
3
|
import { Locale } from "../../../../../share/locale.js";
|
|
4
|
-
import { commonFieldFields, FieldOrientationSchema } from "../../../utils/common.js";
|
|
4
|
+
import { commonFieldFields, derivedField, FieldOrientationSchema } from "../../../utils/common.js";
|
|
5
5
|
export const type = "com.shwfed.form.field.number";
|
|
6
6
|
export const compatibilityDate = "2026-04-28";
|
|
7
7
|
export const metadata = {
|
|
@@ -42,6 +42,7 @@ export function schema(configure) {
|
|
|
42
42
|
title: "\u53EA\u8BFB\u6761\u4EF6",
|
|
43
43
|
description: "\u8FD4\u56DE `true` \u65F6\u4EC5\u4EE5\u7EAF\u6587\u672C\u5C55\u793A\u5F53\u524D\u503C"
|
|
44
44
|
})),
|
|
45
|
+
derived: derivedField(configure, "number"),
|
|
45
46
|
precision: Schema.optional(Schema.Number.pipe(Schema.int(), Schema.nonNegative()).annotations({
|
|
46
47
|
title: "\u5C0F\u6570\u4F4D\u6570",
|
|
47
48
|
description: "\u4FDD\u7559\u7684\u5C0F\u6570\u4F4D\u6570\uFF1B\u7559\u7A7A\u8868\u793A\u4E0D\u9650\u5236\uFF08\u4EFB\u610F\u7CBE\u5EA6\uFF09"
|
|
@@ -29,6 +29,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
29
29
|
readonly max?: string | undefined;
|
|
30
30
|
readonly step?: number | undefined;
|
|
31
31
|
readonly readonly?: string | undefined;
|
|
32
|
+
readonly binding?: string | undefined;
|
|
33
|
+
readonly derived?: {
|
|
34
|
+
readonly mode: "formula" | "prefill";
|
|
35
|
+
readonly expression: string;
|
|
36
|
+
} | undefined;
|
|
32
37
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
33
38
|
readonly startPlaceholder?: readonly [{
|
|
34
39
|
readonly locale: "zh";
|
|
@@ -44,7 +49,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
44
49
|
readonly locale: "en" | "ja" | "ko";
|
|
45
50
|
readonly message: string;
|
|
46
51
|
}[]] | undefined;
|
|
47
|
-
readonly binding?: string | undefined;
|
|
48
52
|
readonly precision?: number | undefined;
|
|
49
53
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
50
54
|
}) => any;
|
|
@@ -75,6 +79,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
75
79
|
readonly max?: string | undefined;
|
|
76
80
|
readonly step?: number | undefined;
|
|
77
81
|
readonly readonly?: string | undefined;
|
|
82
|
+
readonly binding?: string | undefined;
|
|
83
|
+
readonly derived?: {
|
|
84
|
+
readonly mode: "formula" | "prefill";
|
|
85
|
+
readonly expression: string;
|
|
86
|
+
} | undefined;
|
|
78
87
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
79
88
|
readonly startPlaceholder?: readonly [{
|
|
80
89
|
readonly locale: "zh";
|
|
@@ -90,7 +99,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
90
99
|
readonly locale: "en" | "ja" | "ko";
|
|
91
100
|
readonly message: string;
|
|
92
101
|
}[]] | undefined;
|
|
93
|
-
readonly binding?: string | undefined;
|
|
94
102
|
readonly precision?: number | undefined;
|
|
95
103
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
96
104
|
}) => any) | undefined;
|
package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
DropdownMenuTrigger
|
|
9
9
|
} from "../../../../ui/dropdown-menu";
|
|
10
10
|
import { ExpressionEditor } from "../../../../ui/expression-editor";
|
|
11
|
+
import DerivedValueEditor from "../../../DerivedValueEditor.vue";
|
|
11
12
|
import { Field, FieldLabel } from "../../../../ui/field";
|
|
12
13
|
import { IconPicker } from "../../../../ui/icon-picker";
|
|
13
14
|
import {
|
|
@@ -173,6 +174,7 @@ function setSeparatorIcon(next) {
|
|
|
173
174
|
{{ fieldTitle("tooltip") }}
|
|
174
175
|
</FieldLabel>
|
|
175
176
|
<LocaleField
|
|
177
|
+
markdown
|
|
176
178
|
:model-value="value.tooltip"
|
|
177
179
|
@update:model-value="(v) => value = { ...value, tooltip: v }"
|
|
178
180
|
/>
|
|
@@ -453,5 +455,24 @@ function setSeparatorIcon(next) {
|
|
|
453
455
|
/>
|
|
454
456
|
</Field>
|
|
455
457
|
</div>
|
|
458
|
+
|
|
459
|
+
<Field orientation="vertical">
|
|
460
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
461
|
+
<template #tooltip>
|
|
462
|
+
<Markdown
|
|
463
|
+
:source="fieldDescription('derived')"
|
|
464
|
+
block
|
|
465
|
+
class="prose prose-sm prose-zinc"
|
|
466
|
+
/>
|
|
467
|
+
</template>
|
|
468
|
+
{{ fieldTitle("derived") }}
|
|
469
|
+
</FieldLabel>
|
|
470
|
+
<DerivedValueEditor
|
|
471
|
+
:model-value="value.derived"
|
|
472
|
+
result-type="dyn"
|
|
473
|
+
placeholder="例:[form.lo, form.hi]"
|
|
474
|
+
@update:model-value="(v) => value = { ...value, derived: v }"
|
|
475
|
+
/>
|
|
476
|
+
</Field>
|
|
456
477
|
</div>
|
|
457
478
|
</template>
|
|
@@ -29,6 +29,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
29
29
|
readonly max?: string | undefined;
|
|
30
30
|
readonly step?: number | undefined;
|
|
31
31
|
readonly readonly?: string | undefined;
|
|
32
|
+
readonly binding?: string | undefined;
|
|
33
|
+
readonly derived?: {
|
|
34
|
+
readonly mode: "formula" | "prefill";
|
|
35
|
+
readonly expression: string;
|
|
36
|
+
} | undefined;
|
|
32
37
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
33
38
|
readonly startPlaceholder?: readonly [{
|
|
34
39
|
readonly locale: "zh";
|
|
@@ -44,7 +49,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
44
49
|
readonly locale: "en" | "ja" | "ko";
|
|
45
50
|
readonly message: string;
|
|
46
51
|
}[]] | undefined;
|
|
47
|
-
readonly binding?: string | undefined;
|
|
48
52
|
readonly precision?: number | undefined;
|
|
49
53
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
50
54
|
}) => any;
|
|
@@ -75,6 +79,11 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
75
79
|
readonly max?: string | undefined;
|
|
76
80
|
readonly step?: number | undefined;
|
|
77
81
|
readonly readonly?: string | undefined;
|
|
82
|
+
readonly binding?: string | undefined;
|
|
83
|
+
readonly derived?: {
|
|
84
|
+
readonly mode: "formula" | "prefill";
|
|
85
|
+
readonly expression: string;
|
|
86
|
+
} | undefined;
|
|
78
87
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
79
88
|
readonly startPlaceholder?: readonly [{
|
|
80
89
|
readonly locale: "zh";
|
|
@@ -90,7 +99,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
90
99
|
readonly locale: "en" | "ja" | "ko";
|
|
91
100
|
readonly message: string;
|
|
92
101
|
}[]] | undefined;
|
|
93
|
-
readonly binding?: string | undefined;
|
|
94
102
|
readonly precision?: number | undefined;
|
|
95
103
|
readonly roundingMode?: "round" | "floor" | "ceil" | undefined;
|
|
96
104
|
}) => any) | undefined;
|