@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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { inject, provide } from "vue";
|
|
2
|
+
const COMMIT_BUS_KEY = Symbol("shwfed-form-commit-bus");
|
|
3
|
+
export function provideCommitBus() {
|
|
4
|
+
const commits = /* @__PURE__ */ new Set();
|
|
5
|
+
const bus = {
|
|
6
|
+
register(commit) {
|
|
7
|
+
commits.add(commit);
|
|
8
|
+
return () => {
|
|
9
|
+
commits.delete(commit);
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
flushAll() {
|
|
13
|
+
for (const commit of [...commits]) commit();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
provide(COMMIT_BUS_KEY, bus);
|
|
17
|
+
return bus;
|
|
18
|
+
}
|
|
19
|
+
const NOOP_BUS = {
|
|
20
|
+
register: () => () => {
|
|
21
|
+
},
|
|
22
|
+
flushAll: () => {
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
export function useCommitBus() {
|
|
26
|
+
return inject(COMMIT_BUS_KEY, NOOP_BUS);
|
|
27
|
+
}
|
|
@@ -13,3 +13,30 @@ export declare const FIELD_ORIENTATION_OPTIONS: ReadonlyArray<{
|
|
|
13
13
|
}>;
|
|
14
14
|
export declare const FieldOrientationSchema: Schema.Literal<["vertical", "floating"]>;
|
|
15
15
|
export declare const DEFAULT_FIELD_ORIENTATION: FieldOrientation;
|
|
16
|
+
type ResultType = string | string[] | ((type: string) => boolean);
|
|
17
|
+
/**
|
|
18
|
+
* The two ways a field's value can be derived from a CEL expression. They are
|
|
19
|
+
* mutually exclusive — a field carries at most one `derived` config, tagged
|
|
20
|
+
* with one of these modes.
|
|
21
|
+
*
|
|
22
|
+
* - `formula` — the field is read-only; its value is always the expression's
|
|
23
|
+
* result, recomputed when dependencies change.
|
|
24
|
+
* - `prefill` — the field stays editable; the expression fills it only while
|
|
25
|
+
* the user has not touched it. A manual edit (an explicit clear included)
|
|
26
|
+
* takes over for good.
|
|
27
|
+
*/
|
|
28
|
+
export declare const DERIVED_MODES: readonly ["formula", "prefill"];
|
|
29
|
+
export type DerivedMode = typeof DERIVED_MODES[number];
|
|
30
|
+
export declare const DERIVED_MODE_LABELS: Readonly<Record<DerivedMode, string>>;
|
|
31
|
+
/**
|
|
32
|
+
* Schema for a field's optional `derived` config — a `{ mode, expression }`
|
|
33
|
+
* tagged struct shared by every input field type. Mutual exclusion of the two
|
|
34
|
+
* modes is structural: one slot, one mode. `resultType` constrains the CEL
|
|
35
|
+
* expression to the field's own value type, exactly as the field's other
|
|
36
|
+
* expression schemas do.
|
|
37
|
+
*/
|
|
38
|
+
export declare function derivedField(configure: (env: Environment) => void, resultType: ResultType): Schema.optional<Schema.Struct<{
|
|
39
|
+
mode: Schema.Literal<["formula", "prefill"]>;
|
|
40
|
+
expression: Schema.Schema<string, string, never>;
|
|
41
|
+
}>>;
|
|
42
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { Expression } from "../../../share/expression.js";
|
|
3
|
+
import { md } from "../../../share/markdown.js";
|
|
3
4
|
export function commonFieldFields(configure) {
|
|
4
5
|
const CelBool = Expression({ configure, resultType: "bool" });
|
|
5
6
|
return {
|
|
@@ -24,3 +25,33 @@ export const FieldOrientationSchema = Schema.Literal(...FIELD_ORIENTATIONS).anno
|
|
|
24
25
|
description: "\u6807\u7B7E\u4E0E\u8F93\u5165\u6846\u7684\u6392\u5217\u65B9\u5411"
|
|
25
26
|
});
|
|
26
27
|
export const DEFAULT_FIELD_ORIENTATION = "vertical";
|
|
28
|
+
export const DERIVED_MODES = ["formula", "prefill"];
|
|
29
|
+
export const DERIVED_MODE_LABELS = {
|
|
30
|
+
formula: "\u8BA1\u7B97\u503C",
|
|
31
|
+
prefill: "\u667A\u80FD\u586B\u5145"
|
|
32
|
+
};
|
|
33
|
+
export function derivedField(configure, resultType) {
|
|
34
|
+
return Schema.optional(
|
|
35
|
+
Schema.Struct({
|
|
36
|
+
mode: Schema.Literal(...DERIVED_MODES).annotations({
|
|
37
|
+
title: "\u6D3E\u751F\u65B9\u5F0F",
|
|
38
|
+
description: "`\u8BA1\u7B97\u503C` \u53EA\u8BFB\u3001\u59CB\u7EC8\u4EE5\u8868\u8FBE\u5F0F\u4E3A\u51C6\uFF1B`\u667A\u80FD\u586B\u5145` \u53EF\u7F16\u8F91\u3001\u7528\u6237\u4FEE\u6539\u540E\u4EE5\u7528\u6237\u4E3A\u51C6"
|
|
39
|
+
}),
|
|
40
|
+
expression: Expression({ configure, resultType }).annotations({
|
|
41
|
+
title: "\u8868\u8FBE\u5F0F",
|
|
42
|
+
description: "\u8FD4\u56DE\u8BE5\u5B57\u6BB5\u503C\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u53EF\u8BBF\u95EE `form` \u5F53\u524D\u8868\u5355\u72B6\u6001"
|
|
43
|
+
})
|
|
44
|
+
}).annotations({
|
|
45
|
+
title: "\u6D3E\u751F\u503C",
|
|
46
|
+
description: md`
|
|
47
|
+
该字段值的**派生来源**,二选一:
|
|
48
|
+
|
|
49
|
+
- **计算值**:字段变为只读,其值始终由表达式计算得出,依赖字段提交时重算。
|
|
50
|
+
|
|
51
|
+
- **智能填充**:字段保持可编辑。用户未手动修改前由表达式持续计算并填入;一旦用户手动修改(含清空),即以用户输入为准,表达式不再覆盖。
|
|
52
|
+
|
|
53
|
+
两种方式都支持异步调用(如 \`http.get(...)\`)。
|
|
54
|
+
`
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
import type { FieldValue } from '../schema.js';
|
|
4
|
+
import type { FormStateBag } from './state.js';
|
|
5
|
+
/**
|
|
6
|
+
* Structural equality over JSON-ish values (the shape a derived expression
|
|
7
|
+
* returns: primitives, arrays, plain objects, `Date`). It is load-bearing: a
|
|
8
|
+
* derived value writes its result back into form state, which re-triggers the
|
|
9
|
+
* expression; a shallow `Object.is` would see a fresh-but-equal array/object
|
|
10
|
+
* as a change and loop forever. With deep equality a settled expression's
|
|
11
|
+
* re-write is a no-op and cascades converge.
|
|
12
|
+
*/
|
|
13
|
+
export declare function deepEqual(a: unknown, b: unknown): boolean;
|
|
14
|
+
export type DerivedQuiescence = {
|
|
15
|
+
/** Count of derived-value evaluations currently in flight, form-wide. */
|
|
16
|
+
inFlight: Ref<number>;
|
|
17
|
+
begin: () => void;
|
|
18
|
+
end: () => void;
|
|
19
|
+
/** Resolves once every derived value — including cascades — has settled. */
|
|
20
|
+
settled: () => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Provide the form-wide derivation quiescence tracker. Called once at the
|
|
24
|
+
* top-level form host; nested list rows inherit it, so `settled()` waits on
|
|
25
|
+
* every derived value in the form — top-level and row-level alike.
|
|
26
|
+
*/
|
|
27
|
+
export declare function provideDerivedQuiescence(): DerivedQuiescence;
|
|
28
|
+
/**
|
|
29
|
+
* Inject the form's quiescence tracker. Falls back to a standalone instance
|
|
30
|
+
* when mounted outside a form host.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useDerivedQuiescence(): DerivedQuiescence;
|
|
33
|
+
export type DerivedOptions = {
|
|
34
|
+
/**
|
|
35
|
+
* Every field of this form unit. Derived values run regardless of layout
|
|
36
|
+
* placement or `hidden` state — a hidden derived field still feeds
|
|
37
|
+
* submission.
|
|
38
|
+
*/
|
|
39
|
+
fields: () => ReadonlyArray<FieldValue>;
|
|
40
|
+
/** Evaluate a derived expression against the host's CEL context. */
|
|
41
|
+
evaluate: (expression: string) => Effect.Effect<unknown, unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* Derived values start only after this resolves — the top-level form passes
|
|
44
|
+
* its `initial` seed promise so first-paint uses the seed, then derivation
|
|
45
|
+
* takes over; list rows pass an already-resolved promise.
|
|
46
|
+
*/
|
|
47
|
+
ready: Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* The form unit's state bag — the top form's or a list row's. Passed
|
|
50
|
+
* explicitly rather than injected: `useDerived` runs in the very component
|
|
51
|
+
* that provides the bag, and a component cannot inject its own provide.
|
|
52
|
+
*/
|
|
53
|
+
formState: FormStateBag;
|
|
54
|
+
/** The form-wide derivation quiescence tracker (provided at the top form). */
|
|
55
|
+
quiescence: DerivedQuiescence;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Maintains every derived field's value in this form unit. A field carrying a
|
|
59
|
+
* `derived` config is computed from a CEL expression and written back to its
|
|
60
|
+
* `binding`, recomputed whenever committed form state changes. Two modes:
|
|
61
|
+
*
|
|
62
|
+
* - `formula` — the field is read-only; its value is *always* the expression's
|
|
63
|
+
* result.
|
|
64
|
+
* - `prefill` — the field stays editable; the expression only fills it while
|
|
65
|
+
* the user has not touched the binding. Once `formState.isDirty(binding)` is
|
|
66
|
+
* true the user has taken over and the expression no longer writes.
|
|
67
|
+
*
|
|
68
|
+
* Mounted by each form-unit host — the top form and every list row — so a row
|
|
69
|
+
* derived value evaluates `item`/writes row state, a top-level one evaluates
|
|
70
|
+
* `form`/writes form state, all sharing one quiescence tracker.
|
|
71
|
+
*/
|
|
72
|
+
export declare function useDerived(options: DerivedOptions): void;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { computed, inject, nextTick, onScopeDispose, provide, ref, watch } from "vue";
|
|
3
|
+
export function deepEqual(a, b) {
|
|
4
|
+
if (Object.is(a, b)) return true;
|
|
5
|
+
if (a === null || b === null || typeof a !== "object" || typeof b !== "object") return false;
|
|
6
|
+
if (a instanceof Date || b instanceof Date) {
|
|
7
|
+
return a instanceof Date && b instanceof Date && a.getTime() === b.getTime();
|
|
8
|
+
}
|
|
9
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
10
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
11
|
+
return a.every((v, i) => deepEqual(v, b[i]));
|
|
12
|
+
}
|
|
13
|
+
const ak = Object.keys(a);
|
|
14
|
+
const bk = Object.keys(b);
|
|
15
|
+
if (ak.length !== bk.length) return false;
|
|
16
|
+
return ak.every(
|
|
17
|
+
(k) => Object.prototype.hasOwnProperty.call(b, k) && deepEqual(a[k], b[k])
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const QUIESCENCE_KEY = Symbol("shwfed-form-derived-quiescence");
|
|
21
|
+
function createQuiescence() {
|
|
22
|
+
const inFlight = ref(0);
|
|
23
|
+
return {
|
|
24
|
+
inFlight,
|
|
25
|
+
begin: () => {
|
|
26
|
+
inFlight.value += 1;
|
|
27
|
+
},
|
|
28
|
+
end: () => {
|
|
29
|
+
inFlight.value -= 1;
|
|
30
|
+
},
|
|
31
|
+
async settled() {
|
|
32
|
+
for (; ; ) {
|
|
33
|
+
if (inFlight.value > 0) {
|
|
34
|
+
await new Promise((resolve) => {
|
|
35
|
+
const stop = watch(inFlight, (n) => {
|
|
36
|
+
if (n === 0) {
|
|
37
|
+
stop();
|
|
38
|
+
resolve();
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
await nextTick();
|
|
44
|
+
if (inFlight.value === 0) return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function provideDerivedQuiescence() {
|
|
50
|
+
const q = createQuiescence();
|
|
51
|
+
provide(QUIESCENCE_KEY, q);
|
|
52
|
+
return q;
|
|
53
|
+
}
|
|
54
|
+
export function useDerivedQuiescence() {
|
|
55
|
+
return inject(QUIESCENCE_KEY, null) ?? createQuiescence();
|
|
56
|
+
}
|
|
57
|
+
export function useDerived(options) {
|
|
58
|
+
const { state, getAt, setAtSilent, isDirty, markDirty } = options.formState;
|
|
59
|
+
const quiescence = options.quiescence;
|
|
60
|
+
const derivedFields = computed(
|
|
61
|
+
() => options.fields().flatMap((field) => {
|
|
62
|
+
const binding = field.binding;
|
|
63
|
+
const derived = field.derived;
|
|
64
|
+
if (typeof binding !== "string" || !derived || typeof derived !== "object") return [];
|
|
65
|
+
const mode = derived.mode;
|
|
66
|
+
const expression = derived.expression;
|
|
67
|
+
if (mode !== "formula" && mode !== "prefill" || typeof expression !== "string") return [];
|
|
68
|
+
return [{ binding, mode, expression }];
|
|
69
|
+
})
|
|
70
|
+
);
|
|
71
|
+
let generation = 0;
|
|
72
|
+
let started = false;
|
|
73
|
+
function evaluateField(field, gen) {
|
|
74
|
+
quiescence.begin();
|
|
75
|
+
Effect.runPromise(options.evaluate(field.expression)).then(
|
|
76
|
+
(result) => {
|
|
77
|
+
if (gen !== generation) return;
|
|
78
|
+
if (field.mode === "prefill" && isDirty(field.binding)) return;
|
|
79
|
+
if (!deepEqual(getAt(field.binding), result)) setAtSilent(field.binding, result);
|
|
80
|
+
},
|
|
81
|
+
() => {
|
|
82
|
+
}
|
|
83
|
+
).finally(() => {
|
|
84
|
+
quiescence.end();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function runAll() {
|
|
88
|
+
const gen = generation += 1;
|
|
89
|
+
for (const field of derivedFields.value) evaluateField(field, gen);
|
|
90
|
+
}
|
|
91
|
+
watch([state, derivedFields], () => {
|
|
92
|
+
if (started) runAll();
|
|
93
|
+
});
|
|
94
|
+
function claimSeededValues() {
|
|
95
|
+
for (const field of derivedFields.value) {
|
|
96
|
+
if (field.mode === "prefill" && getAt(field.binding) !== void 0) {
|
|
97
|
+
markDirty(field.binding);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
let disposed = false;
|
|
102
|
+
onScopeDispose(() => {
|
|
103
|
+
disposed = true;
|
|
104
|
+
});
|
|
105
|
+
options.ready.then(() => {
|
|
106
|
+
if (disposed) return;
|
|
107
|
+
started = true;
|
|
108
|
+
claimSeededValues();
|
|
109
|
+
runAll();
|
|
110
|
+
}, () => {
|
|
111
|
+
if (disposed) return;
|
|
112
|
+
started = true;
|
|
113
|
+
claimSeededValues();
|
|
114
|
+
runAll();
|
|
115
|
+
});
|
|
116
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComputedRef, WritableComputedRef } from 'vue';
|
|
2
|
+
export type FieldValueController<T> = {
|
|
3
|
+
/**
|
|
4
|
+
* Live draft — bind to the input's `v-model`. Updates on every keystroke,
|
|
5
|
+
* but does NOT reach form state until `commit()` runs.
|
|
6
|
+
*/
|
|
7
|
+
draft: WritableComputedRef<T>;
|
|
8
|
+
/** `true` while the draft holds an uncommitted user edit. */
|
|
9
|
+
dirty: ComputedRef<boolean>;
|
|
10
|
+
/** Flush the draft into form state. Wire to `@blur` / Enter / clear. */
|
|
11
|
+
commit: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type FieldValueOptions<T> = {
|
|
14
|
+
/** Bound dot-prop path; `undefined` ⇒ uncontrolled (no form-state slot). */
|
|
15
|
+
binding: () => string | undefined;
|
|
16
|
+
/** Normalize a raw form-state value into the display-typed draft. */
|
|
17
|
+
fromState: (raw: unknown) => T;
|
|
18
|
+
/** Normalize the draft into the value written to form state. */
|
|
19
|
+
toState: (draft: T) => unknown;
|
|
20
|
+
/** Equality for dirty-detection; defaults to `Object.is`. */
|
|
21
|
+
equals?: (a: T, b: T) => boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Splits a text-like field's value into a live `draft` and the committed
|
|
25
|
+
* form-state value. Keystrokes move the draft; `commit()` (wired to blur) is
|
|
26
|
+
* the only thing that writes form state — so every CEL expression and
|
|
27
|
+
* derived value reading `form` sees a stable per-commit cadence rather than
|
|
28
|
+
* per-keystroke churn.
|
|
29
|
+
*
|
|
30
|
+
* An external write to the committed value (initial seed, reset, parent
|
|
31
|
+
* v-model, a later derived write-back) reverse-syncs into the draft — unless
|
|
32
|
+
* the draft is dirty, so a mid-edit value the user has not committed is
|
|
33
|
+
* never clobbered.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useFieldValue<T>(options: FieldValueOptions<T>): FieldValueController<T>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { computed, onBeforeUnmount, ref, watch } from "vue";
|
|
2
|
+
import { useCommitBus } from "./commit-bus.js";
|
|
3
|
+
import { useFormState } from "./state.js";
|
|
4
|
+
export function useFieldValue(options) {
|
|
5
|
+
const { getAt, setAt } = useFormState();
|
|
6
|
+
const equals = options.equals ?? Object.is;
|
|
7
|
+
const uncontrolled = ref(void 0);
|
|
8
|
+
const committed = computed(() => {
|
|
9
|
+
const path = options.binding();
|
|
10
|
+
const raw = path == null ? uncontrolled.value : getAt(path);
|
|
11
|
+
return options.fromState(raw);
|
|
12
|
+
});
|
|
13
|
+
const local = ref(committed.value);
|
|
14
|
+
const touched = ref(false);
|
|
15
|
+
const draft = computed({
|
|
16
|
+
get: () => local.value,
|
|
17
|
+
set: (next) => {
|
|
18
|
+
local.value = next;
|
|
19
|
+
touched.value = true;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
function commit() {
|
|
23
|
+
if (!touched.value) return;
|
|
24
|
+
touched.value = false;
|
|
25
|
+
if (equals(local.value, committed.value)) return;
|
|
26
|
+
const path = options.binding();
|
|
27
|
+
const next = options.toState(local.value);
|
|
28
|
+
if (path == null) uncontrolled.value = next;
|
|
29
|
+
else setAt(path, next);
|
|
30
|
+
}
|
|
31
|
+
watch(committed, (next) => {
|
|
32
|
+
if (!touched.value) local.value = next;
|
|
33
|
+
});
|
|
34
|
+
const unregister = useCommitBus().register(commit);
|
|
35
|
+
onBeforeUnmount(() => {
|
|
36
|
+
unregister();
|
|
37
|
+
commit();
|
|
38
|
+
});
|
|
39
|
+
return { draft, dirty: computed(() => touched.value), commit };
|
|
40
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { DerivedQuiescence } from './derived.js';
|
|
3
|
+
import type { FormState } from './state.js';
|
|
4
|
+
/**
|
|
5
|
+
* Deep clone over the form-state value space — primitives, `null`, arrays,
|
|
6
|
+
* plain objects, and `Date` (constructor preserved, so a `Date` subclass
|
|
7
|
+
* stays an instance of itself). `File`/`Blob` are immutable and shared by
|
|
8
|
+
* reference rather than copied.
|
|
9
|
+
*
|
|
10
|
+
* Used to snapshot form state into the undo history: `setAt` mutates nested
|
|
11
|
+
* objects in place, so a stored snapshot must be a structural copy or a
|
|
12
|
+
* later edit would reach back and corrupt history.
|
|
13
|
+
*/
|
|
14
|
+
export declare function deepClone<T>(value: T): T;
|
|
15
|
+
export type FormHistory = {
|
|
16
|
+
undo: () => void;
|
|
17
|
+
redo: () => void;
|
|
18
|
+
canUndo: Ref<boolean>;
|
|
19
|
+
canRedo: Ref<boolean>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Whole-form undo/redo. One snapshot is recorded per user-initiated change —
|
|
23
|
+
* a field commit plus the derivation cascade it triggers — taken once that
|
|
24
|
+
* cascade settles, so an undo step always lands on a coherent derived state.
|
|
25
|
+
*
|
|
26
|
+
* `useManualRefHistory` is deliberate over `useRefHistory`: snapshots are
|
|
27
|
+
* driven by commit boundaries, not by every `state` mutation (which would
|
|
28
|
+
* record per-keystroke and per-derivation-write churn). It tracks a private
|
|
29
|
+
* `{ state, dirty }` composite ref; undo/redo restore both back into the
|
|
30
|
+
* live `state` / `dirty` refs.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useFormHistory(state: Ref<FormState>, options: {
|
|
33
|
+
quiescence: DerivedQuiescence;
|
|
34
|
+
seeded: Promise<void>;
|
|
35
|
+
dirty: Ref<Set<string>>;
|
|
36
|
+
}): FormHistory;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { useManualRefHistory } from "@vueuse/core";
|
|
2
|
+
import { nextTick, ref, watch } from "vue";
|
|
3
|
+
import { deepEqual } from "./derived.js";
|
|
4
|
+
export function deepClone(value) {
|
|
5
|
+
if (value === null || typeof value !== "object") return value;
|
|
6
|
+
if (value instanceof Date) {
|
|
7
|
+
return new value.constructor(value.getTime());
|
|
8
|
+
}
|
|
9
|
+
if (typeof File !== "undefined" && value instanceof File) return value;
|
|
10
|
+
if (typeof Blob !== "undefined" && value instanceof Blob) return value;
|
|
11
|
+
if (Array.isArray(value)) return value.map((v) => deepClone(v));
|
|
12
|
+
const out = {};
|
|
13
|
+
for (const key of Object.keys(value)) {
|
|
14
|
+
out[key] = deepClone(value[key]);
|
|
15
|
+
}
|
|
16
|
+
return out;
|
|
17
|
+
}
|
|
18
|
+
function sameDirty(a, b) {
|
|
19
|
+
return a.length === b.length && a.every((p) => b.includes(p));
|
|
20
|
+
}
|
|
21
|
+
export function useFormHistory(state, options) {
|
|
22
|
+
const { dirty } = options;
|
|
23
|
+
function capture() {
|
|
24
|
+
return { state: state.value, dirty: [...dirty.value] };
|
|
25
|
+
}
|
|
26
|
+
function clone(s) {
|
|
27
|
+
return { state: deepClone(s.state), dirty: [...s.dirty] };
|
|
28
|
+
}
|
|
29
|
+
const tracked = ref(capture());
|
|
30
|
+
const history = useManualRefHistory(tracked, {
|
|
31
|
+
dump: clone,
|
|
32
|
+
parse: clone,
|
|
33
|
+
capacity: 50
|
|
34
|
+
});
|
|
35
|
+
let navigating = false;
|
|
36
|
+
let recording = false;
|
|
37
|
+
let snapshotPending = false;
|
|
38
|
+
async function scheduleSnapshot() {
|
|
39
|
+
if (snapshotPending) return;
|
|
40
|
+
snapshotPending = true;
|
|
41
|
+
await options.quiescence.settled();
|
|
42
|
+
snapshotPending = false;
|
|
43
|
+
if (!recording || navigating) return;
|
|
44
|
+
tracked.value = capture();
|
|
45
|
+
const last = history.last.value.snapshot;
|
|
46
|
+
if (!deepEqual(tracked.value.state, last.state) || !sameDirty(tracked.value.dirty, last.dirty)) {
|
|
47
|
+
history.commit();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
watch(state, () => {
|
|
51
|
+
if (recording && !navigating) void scheduleSnapshot();
|
|
52
|
+
});
|
|
53
|
+
options.seeded.then(() => options.quiescence.settled()).then(() => {
|
|
54
|
+
tracked.value = capture();
|
|
55
|
+
history.commit();
|
|
56
|
+
history.clear();
|
|
57
|
+
recording = true;
|
|
58
|
+
});
|
|
59
|
+
function navigate(run) {
|
|
60
|
+
navigating = true;
|
|
61
|
+
run();
|
|
62
|
+
state.value = deepClone(tracked.value.state);
|
|
63
|
+
dirty.value = new Set(tracked.value.dirty);
|
|
64
|
+
void nextTick(() => {
|
|
65
|
+
navigating = false;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
undo: () => navigate(() => history.undo()),
|
|
70
|
+
redo: () => navigate(() => history.redo()),
|
|
71
|
+
canUndo: history.canUndo,
|
|
72
|
+
canRedo: history.canRedo
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
/** Provide the form-wide readonly flag. Called once at the top-level form. */
|
|
3
|
+
export declare function provideFormReadonly(readonly: Ref<boolean>): void;
|
|
4
|
+
/**
|
|
5
|
+
* Inject the form-wide readonly flag. Falls back to a never-readonly ref when
|
|
6
|
+
* a field is mounted outside a form host.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useFormReadonly(): Ref<boolean>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { inject, provide, ref } from "vue";
|
|
2
|
+
const FORM_READONLY_KEY = Symbol("shwfed-form-readonly");
|
|
3
|
+
const NEVER_READONLY = ref(false);
|
|
4
|
+
export function provideFormReadonly(readonly) {
|
|
5
|
+
provide(FORM_READONLY_KEY, readonly);
|
|
6
|
+
}
|
|
7
|
+
export function useFormReadonly() {
|
|
8
|
+
return inject(FORM_READONLY_KEY, NEVER_READONLY);
|
|
9
|
+
}
|
|
@@ -3,8 +3,34 @@ export type FormState = Record<string, unknown>;
|
|
|
3
3
|
export type FormStateBag = {
|
|
4
4
|
state: Ref<FormState>;
|
|
5
5
|
getAt: (path: string) => unknown;
|
|
6
|
+
/**
|
|
7
|
+
* Write a value at `path` on behalf of a **user interaction**. Besides
|
|
8
|
+
* writing, it marks the binding dirty — see `dirty`. Every field runtime
|
|
9
|
+
* writes its bound value through this.
|
|
10
|
+
*/
|
|
6
11
|
setAt: (path: string, value: unknown) => void;
|
|
7
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Write a value at `path` **without** touching the dirty set — a system
|
|
14
|
+
* write. Used by the derived-value engine (`useDerived`) and by the remote
|
|
15
|
+
* combobox's stale-selection clear: neither is a user intent, so neither
|
|
16
|
+
* may flip a `prefill` binding to "user-owned".
|
|
17
|
+
*/
|
|
18
|
+
setAtSilent: (path: string, value: unknown) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Bindings the user has touched. A `prefill`-mode derived value stops
|
|
21
|
+
* filling a binding the moment it appears here — the user has taken over.
|
|
22
|
+
* `setAt` adds to it (an explicit clear counts as a touch too); it is never
|
|
23
|
+
* cleared during normal operation. Only undo/redo rolls it back, by
|
|
24
|
+
* snapshotting it alongside `state` — see `history.ts`.
|
|
25
|
+
*/
|
|
26
|
+
dirty: Ref<Set<string>>;
|
|
27
|
+
isDirty: (path: string) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Mark a binding dirty without writing a value — used by `useDerived` at
|
|
30
|
+
* startup to claim every `initial`-seeded / loaded value, so a `prefill`
|
|
31
|
+
* expression will not overwrite it.
|
|
32
|
+
*/
|
|
33
|
+
markDirty: (path: string) => void;
|
|
8
34
|
};
|
|
9
35
|
export declare const FORM_STATE_KEY: InjectionKey<FormStateBag>;
|
|
10
36
|
export declare function provideFormState(state: Ref<FormState>): FormStateBag;
|
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { inject, provide } from "vue";
|
|
1
|
+
import { getProperty, setProperty } from "dot-prop";
|
|
2
|
+
import { inject, provide, ref } from "vue";
|
|
3
3
|
export const FORM_STATE_KEY = Symbol("shwfed-form-state");
|
|
4
4
|
export function provideFormState(state) {
|
|
5
|
+
const dirty = ref(/* @__PURE__ */ new Set());
|
|
6
|
+
function write(path, value) {
|
|
7
|
+
setProperty(state.value, path, value === void 0 ? null : value);
|
|
8
|
+
state.value = { ...state.value };
|
|
9
|
+
}
|
|
10
|
+
function markDirty(path) {
|
|
11
|
+
if (!dirty.value.has(path)) dirty.value = new Set(dirty.value).add(path);
|
|
12
|
+
}
|
|
5
13
|
const bag = {
|
|
6
14
|
state,
|
|
7
15
|
getAt: (path) => getProperty(state.value, path),
|
|
8
16
|
setAt: (path, value) => {
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
write(path, value);
|
|
18
|
+
markDirty(path);
|
|
11
19
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
setAtSilent: write,
|
|
21
|
+
dirty,
|
|
22
|
+
isDirty: (path) => dirty.value.has(path),
|
|
23
|
+
markDirty
|
|
16
24
|
};
|
|
17
25
|
provide(FORM_STATE_KEY, bag);
|
|
18
26
|
return bag;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { celCheck as $celCheck } from "../../../utils/cel";
|
|
3
3
|
import { Icon } from "@iconify/vue";
|
|
4
4
|
import { Either, ParseResult, Schema } from "effect";
|
|
5
5
|
import { computed, ref } from "vue";
|
|
@@ -10,8 +10,8 @@ import { InputGroupButton } from "../../ui/input-group";
|
|
|
10
10
|
import { Markdown } from "../../ui/markdown";
|
|
11
11
|
import { Textarea } from "../../ui/textarea";
|
|
12
12
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip";
|
|
13
|
-
import { composeCelPrompt } from "../../../
|
|
14
|
-
import { StructuredOutputDecodeError } from "../../../
|
|
13
|
+
import { composeCelPrompt } from "../../../utils/ai/cel-prompt";
|
|
14
|
+
import { StructuredOutputDecodeError, ai as $ai } from "../../../utils/ai";
|
|
15
15
|
import { COLUMNS, findColumn } from "../utils/resolve";
|
|
16
16
|
import TASK from "./columns-task.md?raw";
|
|
17
17
|
defineOptions({ name: "ShwfedTableAiColumnsButton" });
|
|
@@ -20,7 +20,6 @@ const props = defineProps({
|
|
|
20
20
|
columns: { type: Array, required: false }
|
|
21
21
|
});
|
|
22
22
|
const emit = defineEmits(["apply"]);
|
|
23
|
-
const { $ai, $celCheck } = useNuxtApp();
|
|
24
23
|
const LocaleEntry = Schema.Struct({
|
|
25
24
|
locale: Schema.String,
|
|
26
25
|
message: Schema.String
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import {
|
|
2
|
+
import { celCheck as $celCheck } from "../../../utils/cel";
|
|
3
3
|
import { Icon } from "@iconify/vue";
|
|
4
4
|
import { Either, Schema } from "effect";
|
|
5
5
|
import { computed, ref } from "vue";
|
|
@@ -9,8 +9,8 @@ import { Button } from "../../ui/button";
|
|
|
9
9
|
import { Markdown } from "../../ui/markdown";
|
|
10
10
|
import { Textarea } from "../../ui/textarea";
|
|
11
11
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../../ui/tooltip";
|
|
12
|
-
import { composeCelPrompt } from "../../../
|
|
13
|
-
import { StructuredOutputDecodeError } from "../../../
|
|
12
|
+
import { composeCelPrompt } from "../../../utils/ai/cel-prompt";
|
|
13
|
+
import { StructuredOutputDecodeError, ai as $ai } from "../../../utils/ai";
|
|
14
14
|
import TASK from "./data-source-task.md?raw";
|
|
15
15
|
defineOptions({ name: "ShwfedTableAiDataSourceButton" });
|
|
16
16
|
const props = defineProps({
|
|
@@ -18,7 +18,6 @@ const props = defineProps({
|
|
|
18
18
|
columns: { type: Array, required: false }
|
|
19
19
|
});
|
|
20
20
|
const emit = defineEmits(["apply"]);
|
|
21
|
-
const { $ai, $celCheck } = useNuxtApp();
|
|
22
21
|
const DataSourceDraft = Schema.Struct({
|
|
23
22
|
request: Schema.optional(Schema.String).annotations({
|
|
24
23
|
description: 'CEL expression returning an HttpRequest (e.g. http.get("/api/users").query("page", pageIndex + 1)). Omit if the data is static or comes from an outer context.'
|
package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/runtime.vue
CHANGED
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { Icon } from "@iconify/vue";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
|
-
import {
|
|
6
|
-
import { celBindings, injectCELContext } from "../../../../../
|
|
5
|
+
import { cel as $cel } from "../../../../../utils/cel";
|
|
6
|
+
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
7
7
|
import { JUSTIFY_CLASS } from "../../../utils/runtime";
|
|
8
8
|
defineOptions({ name: "ShwfedTableIconRendererRuntime" });
|
|
9
9
|
const props = defineProps({
|
|
10
10
|
column: { type: null, required: true },
|
|
11
11
|
ctx: { type: Object, required: true }
|
|
12
12
|
});
|
|
13
|
-
const { $cel } = useNuxtApp();
|
|
14
13
|
const celContext = injectCELContext();
|
|
15
14
|
const iconName = computed(() => {
|
|
16
15
|
const v = props.ctx.cell.getValue();
|
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { Icon } from "@iconify/vue";
|
|
4
4
|
import { Effect } from "effect";
|
|
5
|
-
import {
|
|
5
|
+
import { cel as $cel } from "../../../../../utils/cel";
|
|
6
6
|
import { useI18n } from "vue-i18n";
|
|
7
7
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
8
8
|
import { Button } from "../../../../ui/button";
|
|
9
9
|
import { Markdown } from "../../../../ui/markdown";
|
|
10
10
|
import { JUSTIFY_CLASS, interpolateMarkdown } from "../../../utils/runtime";
|
|
11
|
-
import { celBindings, injectCELContext } from "../../../../../
|
|
11
|
+
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
12
12
|
defineOptions({ name: "ShwfedTableMarkdownRendererRuntime" });
|
|
13
13
|
const props = defineProps({
|
|
14
14
|
column: { type: null, required: true },
|
|
15
15
|
ctx: { type: Object, required: true }
|
|
16
16
|
});
|
|
17
|
-
const { $cel } = useNuxtApp();
|
|
18
17
|
const { locale } = useI18n();
|
|
19
18
|
const celContext = injectCELContext();
|
|
20
19
|
const rendered = computed(() => {
|