@shwfed/config 2.4.0 → 2.4.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/mcp.mjs +43 -5
- package/dist/module.json +1 -1
- package/dist/preview/assets/{config-CZ0f5xdI.js → config-BovRv7Mw.js} +1 -1
- package/dist/preview/assets/{config-BcQQl4v6.js → config-ByTxMBcK.js} +1 -1
- package/dist/preview/assets/{config-Ddh8pxIi.js → config-C7xYpB3N.js} +1 -1
- package/dist/preview/assets/{config-Bi9F-Jdh.js → config-CH9wsYX8.js} +1 -1
- package/dist/preview/assets/{config-C32yfrlg.js → config-Ch5dL5lp.js} +1 -1
- package/dist/preview/assets/{config-D9xGgFnF.js → config-D50Rl2n_.js} +1 -1
- package/dist/preview/assets/{config-CHHX7vhb.js → config-DiwVK32V.js} +1 -1
- package/dist/preview/assets/{config-BdFIFUa_.js → config-EKVeWrbS.js} +1 -1
- package/dist/preview/assets/{config-Bxkq2ZRm.js → config-Q86AhjHq.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-C_cjxvm1.js → definition.vue_vue_type_script_setup_true_lang-D8NPPbjZ.js} +1 -1
- package/dist/preview/assets/index-65eB1l4r.css +1 -0
- package/dist/preview/assets/index-CIrlYN0M.js +1 -0
- package/dist/preview/assets/index-DUDlWaQI.js +661 -0
- package/dist/preview/assets/runtime-BP7zXnyG.js +1 -0
- package/dist/preview/assets/runtime-BQSwNpLC.js +1 -0
- package/dist/preview/assets/runtime-BwR_BbTu.js +1 -0
- package/dist/preview/assets/runtime-Ch3JIgUQ.js +1 -0
- package/dist/preview/assets/runtime-CjvZcU7X.js +1 -0
- package/dist/preview/assets/runtime-Cunk4vOs.js +1 -0
- package/dist/preview/assets/runtime-D34aQN00.js +1 -0
- package/dist/preview/assets/runtime-a9TOQRwD.js +1 -0
- package/dist/preview/assets/runtime-aPt-bW3F.js +1 -0
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/runtime.vue +7 -4
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/runtime.vue +6 -0
- package/dist/runtime/components/form/ValidationRulesField.d.vue.ts +16 -0
- package/dist/runtime/components/form/ValidationRulesField.vue +207 -0
- package/dist/runtime/components/form/ValidationRulesField.vue.d.ts +16 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +30 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue +51 -9
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/runtime.vue +22 -2
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-20/com.shwfed.form.field.collapsible/runtime.vue +26 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.month/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-25/com.shwfed.form.field.combobox.multi/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-26/com.shwfed.form.field.tree.combobox.single/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.multi/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.combobox.single/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.multi/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.combobox.single/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts +18 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.d.vue.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue +38 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue.d.ts +24 -0
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue +18 -2
- package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts +18 -0
- package/dist/runtime/components/form/index.d.vue.ts +1 -0
- package/dist/runtime/components/form/index.vue +9 -0
- package/dist/runtime/components/form/index.vue.d.ts +1 -0
- package/dist/runtime/components/form/schema.js +2 -2
- package/dist/runtime/components/form/utils/common.d.ts +42 -0
- package/dist/runtime/components/form/utils/common.js +40 -2
- package/dist/runtime/components/form/utils/validation.d.ts +85 -0
- package/dist/runtime/components/form/utils/validation.js +113 -0
- package/dist/runtime/components/table/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/config.vue +5 -0
- package/dist/runtime/components/table/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/utils/shared.js +2 -2
- package/dist/runtime/components/ui/field/FieldError.vue +1 -1
- package/dist/runtime/components/ui/field/FieldMessages.d.vue.ts +9 -0
- package/dist/runtime/components/ui/field/FieldMessages.vue +21 -0
- package/dist/runtime/components/ui/field/FieldMessages.vue.d.ts +9 -0
- package/dist/runtime/components/ui/field/FieldWarning.d.vue.ts +20 -0
- package/dist/runtime/components/ui/field/FieldWarning.vue +51 -0
- package/dist/runtime/components/ui/field/FieldWarning.vue.d.ts +20 -0
- package/dist/runtime/components/ui/field/index.d.ts +2 -0
- package/dist/runtime/components/ui/field/index.js +10 -4
- package/dist/runtime/components/ui/locale/Locale.d.vue.ts +2 -0
- package/dist/runtime/components/ui/locale/Locale.vue +165 -155
- package/dist/runtime/components/ui/locale/Locale.vue.d.ts +2 -0
- package/dist/runtime/share/form-validate.d.ts +18 -0
- package/dist/runtime/share/form-validate.js +8 -0
- package/package.json +1 -1
- package/dist/preview/assets/index-BqOX70Hd.css +0 -1
- package/dist/preview/assets/index-D-VR1i8D.js +0 -659
- package/dist/preview/assets/index-ihZGlPdX.js +0 -1
- package/dist/preview/assets/runtime-Bn8mqeDH.js +0 -1
- package/dist/preview/assets/runtime-Cc_Wk3o-.js +0 -1
- package/dist/preview/assets/runtime-CttAjIgg.js +0 -1
- package/dist/preview/assets/runtime-Cx4f2UTl.js +0 -1
- package/dist/preview/assets/runtime-D1dESjXR.js +0 -1
- package/dist/preview/assets/runtime-DIEP1Xbh.js +0 -1
- package/dist/preview/assets/runtime-DKceWuBx.js +0 -1
- package/dist/preview/assets/runtime-Dhid9O5c.js +0 -1
- package/dist/preview/assets/runtime-YMiqi6WY.js +0 -1
|
@@ -33,6 +33,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
33
33
|
readonly locale: "en" | "ja" | "ko";
|
|
34
34
|
readonly message: string;
|
|
35
35
|
}[]] | undefined;
|
|
36
|
+
readonly required?: string | undefined;
|
|
36
37
|
readonly displayName?: string | undefined;
|
|
37
38
|
readonly compatibilityDate: "2026-05-28";
|
|
38
39
|
readonly readonly?: string | undefined;
|
|
@@ -56,6 +57,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
56
57
|
}[]];
|
|
57
58
|
readonly expandAll: boolean;
|
|
58
59
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
60
|
+
readonly validations?: readonly {
|
|
61
|
+
readonly message: readonly [{
|
|
62
|
+
readonly locale: "zh";
|
|
63
|
+
readonly message: string;
|
|
64
|
+
}, ...{
|
|
65
|
+
readonly locale: "en" | "ja" | "ko";
|
|
66
|
+
readonly message: string;
|
|
67
|
+
}[]];
|
|
68
|
+
readonly warning?: boolean | undefined;
|
|
69
|
+
readonly when: string;
|
|
70
|
+
}[] | undefined;
|
|
59
71
|
readonly nodeTooltip?: readonly [{
|
|
60
72
|
readonly locale: "zh";
|
|
61
73
|
readonly message: string;
|
|
@@ -96,6 +108,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
96
108
|
readonly locale: "en" | "ja" | "ko";
|
|
97
109
|
readonly message: string;
|
|
98
110
|
}[]] | undefined;
|
|
111
|
+
readonly required?: string | undefined;
|
|
99
112
|
readonly displayName?: string | undefined;
|
|
100
113
|
readonly compatibilityDate: "2026-05-28";
|
|
101
114
|
readonly readonly?: string | undefined;
|
|
@@ -119,6 +132,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
119
132
|
}[]];
|
|
120
133
|
readonly expandAll: boolean;
|
|
121
134
|
readonly cascade: "independent" | "cascade-down" | "cascade-both";
|
|
135
|
+
readonly validations?: readonly {
|
|
136
|
+
readonly message: readonly [{
|
|
137
|
+
readonly locale: "zh";
|
|
138
|
+
readonly message: string;
|
|
139
|
+
}, ...{
|
|
140
|
+
readonly locale: "en" | "ja" | "ko";
|
|
141
|
+
readonly message: string;
|
|
142
|
+
}[]];
|
|
143
|
+
readonly warning?: boolean | undefined;
|
|
144
|
+
readonly when: string;
|
|
145
|
+
}[] | undefined;
|
|
122
146
|
readonly nodeTooltip?: readonly [{
|
|
123
147
|
readonly locale: "zh";
|
|
124
148
|
readonly message: string;
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/runtime.vue
CHANGED
|
@@ -8,7 +8,7 @@ import { cel as _rawCel } from "../../../../../utils/cel";
|
|
|
8
8
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
9
9
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
10
10
|
import { Checkbox } from "../../../../ui/checkbox";
|
|
11
|
-
import { Field, FieldLabel } from "../../../../ui/field";
|
|
11
|
+
import { Field, FieldLabel, FieldMessages } from "../../../../ui/field";
|
|
12
12
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
|
|
13
13
|
import { Markdown } from "../../../../ui/markdown";
|
|
14
14
|
import { Skeleton } from "../../../../ui/skeleton";
|
|
@@ -16,6 +16,7 @@ import { Tree as UiTree } from "../../../../ui/tree";
|
|
|
16
16
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
17
17
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
18
18
|
import { useFormState } from "../../../utils/state";
|
|
19
|
+
import { useFieldValidation } from "../../../utils/validation";
|
|
19
20
|
defineOptions({ name: "ShwfedTreeMultiFieldRuntime" });
|
|
20
21
|
const props = defineProps({
|
|
21
22
|
fieldId: { type: String, required: true },
|
|
@@ -72,6 +73,12 @@ const isReadonly = computed(
|
|
|
72
73
|
() => props.config.readonly != null ? evalBool(props.config.readonly, "readonly") : formReadonly.value
|
|
73
74
|
);
|
|
74
75
|
const effectiveReadonly = computed(() => isReadonly.value || props.config.derived?.mode === "formula");
|
|
76
|
+
const { isRequired, errors, warnings, visible } = useFieldValidation({
|
|
77
|
+
fieldId: () => props.fieldId,
|
|
78
|
+
config: () => props.config,
|
|
79
|
+
$cel,
|
|
80
|
+
locale: () => locale.value
|
|
81
|
+
});
|
|
75
82
|
const uncontrolled = ref([]);
|
|
76
83
|
const model = computed({
|
|
77
84
|
get: () => {
|
|
@@ -292,7 +299,11 @@ const readonlyText = computed(() => {
|
|
|
292
299
|
class="prose prose-xs prose-zinc"
|
|
293
300
|
/>
|
|
294
301
|
</template>
|
|
295
|
-
{{ labelText }}
|
|
302
|
+
{{ labelText }}<span
|
|
303
|
+
v-if="isRequired"
|
|
304
|
+
aria-hidden="true"
|
|
305
|
+
class="text-red-600"
|
|
306
|
+
> *</span>
|
|
296
307
|
</FieldLabel>
|
|
297
308
|
|
|
298
309
|
<div
|
|
@@ -397,5 +408,10 @@ const readonlyText = computed(() => {
|
|
|
397
408
|
</template>
|
|
398
409
|
</UiTree>
|
|
399
410
|
</template>
|
|
411
|
+
<FieldMessages
|
|
412
|
+
v-if="visible"
|
|
413
|
+
:errors="errors"
|
|
414
|
+
:warnings="warnings"
|
|
415
|
+
/>
|
|
400
416
|
</Field>
|
|
401
417
|
</template>
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.multi/schema.d.ts
CHANGED
|
@@ -93,6 +93,24 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
93
93
|
id: Schema.refine<string, typeof Schema.String>;
|
|
94
94
|
displayName: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
95
95
|
hidden: Schema.optional<Schema.Schema<string, string, never>>;
|
|
96
|
+
required: Schema.optional<Schema.Schema<string, string, never>>;
|
|
97
|
+
validations: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
98
|
+
when: Schema.Schema<string, string, never>;
|
|
99
|
+
warning: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
100
|
+
message: Schema.refine<readonly [{
|
|
101
|
+
readonly locale: "zh";
|
|
102
|
+
readonly message: string;
|
|
103
|
+
}, ...{
|
|
104
|
+
readonly locale: "en" | "ja" | "ko";
|
|
105
|
+
readonly message: string;
|
|
106
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
107
|
+
locale: Schema.Literal<["zh"]>;
|
|
108
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
109
|
+
}>], [Schema.Struct<{
|
|
110
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
111
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
112
|
+
}>]>>;
|
|
113
|
+
}>>>;
|
|
96
114
|
type: Schema.Literal<["com.shwfed.form.field.tree.multi"]>;
|
|
97
115
|
compatibilityDate: Schema.Literal<["2026-05-28"]>;
|
|
98
116
|
}>;
|
|
@@ -33,6 +33,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
33
33
|
readonly locale: "en" | "ja" | "ko";
|
|
34
34
|
readonly message: string;
|
|
35
35
|
}[]] | undefined;
|
|
36
|
+
readonly required?: string | undefined;
|
|
36
37
|
readonly displayName?: string | undefined;
|
|
37
38
|
readonly compatibilityDate: "2026-05-28";
|
|
38
39
|
readonly readonly?: string | undefined;
|
|
@@ -55,6 +56,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
55
56
|
readonly message: string;
|
|
56
57
|
}[]];
|
|
57
58
|
readonly expandAll: boolean;
|
|
59
|
+
readonly validations?: readonly {
|
|
60
|
+
readonly message: readonly [{
|
|
61
|
+
readonly locale: "zh";
|
|
62
|
+
readonly message: string;
|
|
63
|
+
}, ...{
|
|
64
|
+
readonly locale: "en" | "ja" | "ko";
|
|
65
|
+
readonly message: string;
|
|
66
|
+
}[]];
|
|
67
|
+
readonly warning?: boolean | undefined;
|
|
68
|
+
readonly when: string;
|
|
69
|
+
}[] | undefined;
|
|
58
70
|
readonly nodeTooltip?: readonly [{
|
|
59
71
|
readonly locale: "zh";
|
|
60
72
|
readonly message: string;
|
|
@@ -95,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
95
107
|
readonly locale: "en" | "ja" | "ko";
|
|
96
108
|
readonly message: string;
|
|
97
109
|
}[]] | undefined;
|
|
110
|
+
readonly required?: string | undefined;
|
|
98
111
|
readonly displayName?: string | undefined;
|
|
99
112
|
readonly compatibilityDate: "2026-05-28";
|
|
100
113
|
readonly readonly?: string | undefined;
|
|
@@ -117,6 +130,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
117
130
|
readonly message: string;
|
|
118
131
|
}[]];
|
|
119
132
|
readonly expandAll: boolean;
|
|
133
|
+
readonly validations?: readonly {
|
|
134
|
+
readonly message: readonly [{
|
|
135
|
+
readonly locale: "zh";
|
|
136
|
+
readonly message: string;
|
|
137
|
+
}, ...{
|
|
138
|
+
readonly locale: "en" | "ja" | "ko";
|
|
139
|
+
readonly message: string;
|
|
140
|
+
}[]];
|
|
141
|
+
readonly warning?: boolean | undefined;
|
|
142
|
+
readonly when: string;
|
|
143
|
+
}[] | undefined;
|
|
120
144
|
readonly nodeTooltip?: readonly [{
|
|
121
145
|
readonly locale: "zh";
|
|
122
146
|
readonly message: string;
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/config.vue
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { ExpressionEditor } from "../../../../ui/expression-editor";
|
|
4
4
|
import DerivedValueEditor from "../../../DerivedValueEditor.vue";
|
|
5
|
+
import ValidationRulesField from "../../../ValidationRulesField.vue";
|
|
5
6
|
import { Field, FieldLabel } from "../../../../ui/field";
|
|
6
7
|
import { InputGroup, InputGroupInput } from "../../../../ui/input-group";
|
|
7
8
|
import { Locale as LocaleField } from "../../../../ui/locale";
|
|
@@ -477,6 +478,26 @@ function setFilterKeywords(next) {
|
|
|
477
478
|
|
|
478
479
|
<!-- 通用:隐藏 / 禁用 / 只读 + 派生值 — conventionally last -->
|
|
479
480
|
<div class="grid grid-cols-3 gap-3">
|
|
481
|
+
<Field orientation="vertical">
|
|
482
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
483
|
+
<template #tooltip>
|
|
484
|
+
<Markdown
|
|
485
|
+
:source="fieldDescription('required') ?? '\u8FD4\u56DE `true` \u65F6\u663E\u793A\u5FC5\u586B\u661F\u53F7\u5E76\u8981\u6C42\u975E\u7A7A'"
|
|
486
|
+
block
|
|
487
|
+
class="prose prose-sm prose-zinc"
|
|
488
|
+
/>
|
|
489
|
+
</template>
|
|
490
|
+
{{ fieldTitle("required") }}
|
|
491
|
+
</FieldLabel>
|
|
492
|
+
<ExpressionEditor
|
|
493
|
+
:model-value="value.required ?? ''"
|
|
494
|
+
placeholder="例:form.type == 'company'"
|
|
495
|
+
result-type="bool"
|
|
496
|
+
class="min-h-10"
|
|
497
|
+
@update:model-value="(v) => value = { ...value, required: v.length > 0 ? v : void 0 }"
|
|
498
|
+
/>
|
|
499
|
+
</Field>
|
|
500
|
+
|
|
480
501
|
<Field orientation="vertical">
|
|
481
502
|
<FieldLabel class="text-xs text-zinc-500">
|
|
482
503
|
<template #tooltip>
|
|
@@ -556,5 +577,22 @@ function setFilterKeywords(next) {
|
|
|
556
577
|
@update:model-value="(v) => value = { ...value, derived: v }"
|
|
557
578
|
/>
|
|
558
579
|
</Field>
|
|
580
|
+
|
|
581
|
+
<Field orientation="vertical">
|
|
582
|
+
<FieldLabel class="text-xs text-zinc-500">
|
|
583
|
+
<template #tooltip>
|
|
584
|
+
<Markdown
|
|
585
|
+
:source="fieldDescription('validations')"
|
|
586
|
+
block
|
|
587
|
+
class="prose prose-sm prose-zinc"
|
|
588
|
+
/>
|
|
589
|
+
</template>
|
|
590
|
+
{{ fieldTitle("validations") }}
|
|
591
|
+
</FieldLabel>
|
|
592
|
+
<ValidationRulesField
|
|
593
|
+
:model-value="value.validations"
|
|
594
|
+
@update:model-value="(v) => value = { ...value, validations: v.length > 0 ? v : void 0 }"
|
|
595
|
+
/>
|
|
596
|
+
</Field>
|
|
559
597
|
</div>
|
|
560
598
|
</template>
|
|
@@ -33,6 +33,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
33
33
|
readonly locale: "en" | "ja" | "ko";
|
|
34
34
|
readonly message: string;
|
|
35
35
|
}[]] | undefined;
|
|
36
|
+
readonly required?: string | undefined;
|
|
36
37
|
readonly displayName?: string | undefined;
|
|
37
38
|
readonly compatibilityDate: "2026-05-28";
|
|
38
39
|
readonly readonly?: string | undefined;
|
|
@@ -55,6 +56,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
55
56
|
readonly message: string;
|
|
56
57
|
}[]];
|
|
57
58
|
readonly expandAll: boolean;
|
|
59
|
+
readonly validations?: readonly {
|
|
60
|
+
readonly message: readonly [{
|
|
61
|
+
readonly locale: "zh";
|
|
62
|
+
readonly message: string;
|
|
63
|
+
}, ...{
|
|
64
|
+
readonly locale: "en" | "ja" | "ko";
|
|
65
|
+
readonly message: string;
|
|
66
|
+
}[]];
|
|
67
|
+
readonly warning?: boolean | undefined;
|
|
68
|
+
readonly when: string;
|
|
69
|
+
}[] | undefined;
|
|
58
70
|
readonly nodeTooltip?: readonly [{
|
|
59
71
|
readonly locale: "zh";
|
|
60
72
|
readonly message: string;
|
|
@@ -95,6 +107,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
95
107
|
readonly locale: "en" | "ja" | "ko";
|
|
96
108
|
readonly message: string;
|
|
97
109
|
}[]] | undefined;
|
|
110
|
+
readonly required?: string | undefined;
|
|
98
111
|
readonly displayName?: string | undefined;
|
|
99
112
|
readonly compatibilityDate: "2026-05-28";
|
|
100
113
|
readonly readonly?: string | undefined;
|
|
@@ -117,6 +130,17 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
117
130
|
readonly message: string;
|
|
118
131
|
}[]];
|
|
119
132
|
readonly expandAll: boolean;
|
|
133
|
+
readonly validations?: readonly {
|
|
134
|
+
readonly message: readonly [{
|
|
135
|
+
readonly locale: "zh";
|
|
136
|
+
readonly message: string;
|
|
137
|
+
}, ...{
|
|
138
|
+
readonly locale: "en" | "ja" | "ko";
|
|
139
|
+
readonly message: string;
|
|
140
|
+
}[]];
|
|
141
|
+
readonly warning?: boolean | undefined;
|
|
142
|
+
readonly when: string;
|
|
143
|
+
}[] | undefined;
|
|
120
144
|
readonly nodeTooltip?: readonly [{
|
|
121
145
|
readonly locale: "zh";
|
|
122
146
|
readonly message: string;
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/runtime.vue
CHANGED
|
@@ -7,7 +7,7 @@ import { useI18n } from "vue-i18n";
|
|
|
7
7
|
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
8
8
|
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
9
9
|
import { getLocalizedText } from "../../../../../share/locale";
|
|
10
|
-
import { Field, FieldLabel } from "../../../../ui/field";
|
|
10
|
+
import { Field, FieldLabel, FieldMessages } from "../../../../ui/field";
|
|
11
11
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
|
|
12
12
|
import { Markdown } from "../../../../ui/markdown";
|
|
13
13
|
import { Skeleton } from "../../../../ui/skeleton";
|
|
@@ -15,6 +15,7 @@ import { Tree as UiTree } from "../../../../ui/tree";
|
|
|
15
15
|
import { interpolateMarkdown } from "../../../../table/utils/runtime";
|
|
16
16
|
import { useFormReadonly } from "../../../utils/readonly";
|
|
17
17
|
import { useFormState } from "../../../utils/state";
|
|
18
|
+
import { useFieldValidation } from "../../../utils/validation";
|
|
18
19
|
defineOptions({ name: "ShwfedTreeSingleFieldRuntime" });
|
|
19
20
|
const props = defineProps({
|
|
20
21
|
fieldId: { type: String, required: true },
|
|
@@ -68,6 +69,12 @@ const isReadonly = computed(
|
|
|
68
69
|
() => props.config.readonly != null ? evalBool(props.config.readonly, "readonly") : formReadonly.value
|
|
69
70
|
);
|
|
70
71
|
const effectiveReadonly = computed(() => isReadonly.value || props.config.derived?.mode === "formula");
|
|
72
|
+
const { isRequired, errors, warnings, visible } = useFieldValidation({
|
|
73
|
+
fieldId: () => props.fieldId,
|
|
74
|
+
config: () => props.config,
|
|
75
|
+
$cel,
|
|
76
|
+
locale: () => locale.value
|
|
77
|
+
});
|
|
71
78
|
const uncontrolled = ref(void 0);
|
|
72
79
|
const model = computed({
|
|
73
80
|
get: () => {
|
|
@@ -288,7 +295,11 @@ const readonlyText = computed(() => {
|
|
|
288
295
|
class="prose prose-xs prose-zinc"
|
|
289
296
|
/>
|
|
290
297
|
</template>
|
|
291
|
-
{{ labelText }}
|
|
298
|
+
{{ labelText }}<span
|
|
299
|
+
v-if="isRequired"
|
|
300
|
+
aria-hidden="true"
|
|
301
|
+
class="text-red-600"
|
|
302
|
+
> *</span>
|
|
292
303
|
</FieldLabel>
|
|
293
304
|
|
|
294
305
|
<div
|
|
@@ -391,5 +402,10 @@ const readonlyText = computed(() => {
|
|
|
391
402
|
</template>
|
|
392
403
|
</UiTree>
|
|
393
404
|
</template>
|
|
405
|
+
<FieldMessages
|
|
406
|
+
v-if="visible"
|
|
407
|
+
:errors="errors"
|
|
408
|
+
:warnings="warnings"
|
|
409
|
+
/>
|
|
394
410
|
</Field>
|
|
395
411
|
</template>
|
package/dist/runtime/components/form/fields/2026-05-28/com.shwfed.form.field.tree.single/schema.d.ts
CHANGED
|
@@ -89,6 +89,24 @@ export declare function schema(configure: (env: Environment) => void): Schema.St
|
|
|
89
89
|
id: Schema.refine<string, typeof Schema.String>;
|
|
90
90
|
displayName: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
91
91
|
hidden: Schema.optional<Schema.Schema<string, string, never>>;
|
|
92
|
+
required: Schema.optional<Schema.Schema<string, string, never>>;
|
|
93
|
+
validations: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
94
|
+
when: Schema.Schema<string, string, never>;
|
|
95
|
+
warning: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
96
|
+
message: Schema.refine<readonly [{
|
|
97
|
+
readonly locale: "zh";
|
|
98
|
+
readonly message: string;
|
|
99
|
+
}, ...{
|
|
100
|
+
readonly locale: "en" | "ja" | "ko";
|
|
101
|
+
readonly message: string;
|
|
102
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
103
|
+
locale: Schema.Literal<["zh"]>;
|
|
104
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
105
|
+
}>], [Schema.Struct<{
|
|
106
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
107
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
108
|
+
}>]>>;
|
|
109
|
+
}>>>;
|
|
92
110
|
type: Schema.Literal<["com.shwfed.form.field.tree.single"]>;
|
|
93
111
|
compatibilityDate: Schema.Literal<["2026-05-28"]>;
|
|
94
112
|
}>;
|
|
@@ -13,6 +13,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
13
13
|
seeded: Promise<void>;
|
|
14
14
|
flush: () => void;
|
|
15
15
|
settled: () => Promise<void>;
|
|
16
|
+
validate: () => Promise<boolean>;
|
|
16
17
|
undo: () => void;
|
|
17
18
|
redo: () => void;
|
|
18
19
|
canUndo: import("vue").Ref<boolean, boolean>;
|
|
@@ -14,8 +14,10 @@ import { provideCommitBus } from "./utils/commit-bus";
|
|
|
14
14
|
import { provideDerivedQuiescence, useDerived } from "./utils/derived";
|
|
15
15
|
import { useFormHistory } from "./utils/history";
|
|
16
16
|
import { evaluateInitial } from "./utils/initial";
|
|
17
|
+
import { provideFormValidate } from "../../share/form-validate";
|
|
17
18
|
import { provideFormReadonly } from "./utils/readonly";
|
|
18
19
|
import { provideFormState } from "./utils/state";
|
|
20
|
+
import { provideValidation } from "./utils/validation";
|
|
19
21
|
defineOptions({ name: "ShwfedForm" });
|
|
20
22
|
const state = defineModel({ type: Object, ...{ default: () => ({}) } });
|
|
21
23
|
const config = defineModel("config", { type: Object, ...{ required: true } });
|
|
@@ -82,11 +84,18 @@ useDerived({
|
|
|
82
84
|
formState,
|
|
83
85
|
quiescence
|
|
84
86
|
});
|
|
87
|
+
const validation = provideValidation({
|
|
88
|
+
flush: commitBus.flushAll,
|
|
89
|
+
seeded,
|
|
90
|
+
settled: quiescence.settled
|
|
91
|
+
});
|
|
92
|
+
provideFormValidate(validation.validate);
|
|
85
93
|
const formHistory = useFormHistory(state, { quiescence, seeded, dirty: formState.dirty });
|
|
86
94
|
defineExpose({
|
|
87
95
|
seeded,
|
|
88
96
|
flush: commitBus.flushAll,
|
|
89
97
|
settled: quiescence.settled,
|
|
98
|
+
validate: validation.validate,
|
|
90
99
|
undo: formHistory.undo,
|
|
91
100
|
redo: formHistory.redo,
|
|
92
101
|
canUndo: formHistory.canUndo,
|
|
@@ -13,6 +13,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
13
13
|
seeded: Promise<void>;
|
|
14
14
|
flush: () => void;
|
|
15
15
|
settled: () => Promise<void>;
|
|
16
|
+
validate: () => Promise<boolean>;
|
|
16
17
|
undo: () => void;
|
|
17
18
|
redo: () => void;
|
|
18
19
|
canUndo: import("vue").Ref<boolean, boolean>;
|
|
@@ -39,8 +39,8 @@ export function FormUnit(configure) {
|
|
|
39
39
|
}
|
|
40
40
|
export function registerFormVariablesIfAbsent(env) {
|
|
41
41
|
const declared = new Set(env.getDefinitions().variables.map((v) => v.name));
|
|
42
|
-
if (!declared.has("now")) env.registerVariable("now", "Date", { description: "\u5F53\u524D\u65E5\u671F/\u65F6\u95F4" });
|
|
43
|
-
if (!declared.has("form")) env.registerVariable("form", "dyn", { description: "\u5F53\u524D\u8868\u5355\u72B6\u6001" });
|
|
42
|
+
if (!declared.has("now")) env.registerVariable("now", "Date", { label: "\u5F53\u524D\u65F6\u95F4", description: "\u5F53\u524D\u65E5\u671F/\u65F6\u95F4" });
|
|
43
|
+
if (!declared.has("form")) env.registerVariable("form", "dyn", { label: "\u8868\u5355\u503C", description: "\u5F53\u524D\u8868\u5355\u72B6\u6001" });
|
|
44
44
|
}
|
|
45
45
|
export function FormConfig(configure) {
|
|
46
46
|
const formConfigure = (env) => {
|
|
@@ -1,9 +1,51 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
2
|
import type { Environment } from '../../../vendor/cel-js/lib/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* One field-owned validation rule. Extracted so the config editor
|
|
5
|
+
* (`ValidationRulesField`) can read the `when` / `message` `@title` +
|
|
6
|
+
* `@description` straight off this struct — single source of truth, no
|
|
7
|
+
* duplicated label/tooltip copy. `configure` only shapes the CEL environment;
|
|
8
|
+
* the annotations are static, so a no-op `configure` is fine for metadata.
|
|
9
|
+
*/
|
|
10
|
+
export declare function validationRuleStruct(configure: (env: Environment) => void): Schema.Struct<{
|
|
11
|
+
when: Schema.Schema<string, string, never>;
|
|
12
|
+
warning: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
13
|
+
message: Schema.refine<readonly [{
|
|
14
|
+
readonly locale: "zh";
|
|
15
|
+
readonly message: string;
|
|
16
|
+
}, ...{
|
|
17
|
+
readonly locale: "en" | "ja" | "ko";
|
|
18
|
+
readonly message: string;
|
|
19
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
20
|
+
locale: Schema.Literal<["zh"]>;
|
|
21
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
22
|
+
}>], [Schema.Struct<{
|
|
23
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
24
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
25
|
+
}>]>>;
|
|
26
|
+
}>;
|
|
3
27
|
export declare function commonFieldFields(configure: (env: Environment) => void): {
|
|
4
28
|
id: Schema.refine<string, typeof Schema.String>;
|
|
5
29
|
displayName: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
6
30
|
hidden: Schema.optional<Schema.Schema<string, string, never>>;
|
|
31
|
+
required: Schema.optional<Schema.Schema<string, string, never>>;
|
|
32
|
+
validations: Schema.optional<Schema.Array$<Schema.Struct<{
|
|
33
|
+
when: Schema.Schema<string, string, never>;
|
|
34
|
+
warning: Schema.optional<Schema.SchemaClass<boolean, boolean, never>>;
|
|
35
|
+
message: Schema.refine<readonly [{
|
|
36
|
+
readonly locale: "zh";
|
|
37
|
+
readonly message: string;
|
|
38
|
+
}, ...{
|
|
39
|
+
readonly locale: "en" | "ja" | "ko";
|
|
40
|
+
readonly message: string;
|
|
41
|
+
}[]], Schema.TupleType<readonly [Schema.Struct<{
|
|
42
|
+
locale: Schema.Literal<["zh"]>;
|
|
43
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
44
|
+
}>], [Schema.Struct<{
|
|
45
|
+
locale: Schema.Literal<["ja", "en", "ko"]>;
|
|
46
|
+
message: Schema.SchemaClass<string, string, never>;
|
|
47
|
+
}>]>>;
|
|
48
|
+
}>>>;
|
|
7
49
|
};
|
|
8
50
|
export declare const FIELD_ORIENTATIONS: readonly ["vertical", "floating"];
|
|
9
51
|
export type FieldOrientation = typeof FIELD_ORIENTATIONS[number];
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { Expression } from "../../../share/expression.js";
|
|
2
|
+
import { Expression, LocaleMarkdown } from "../../../share/expression.js";
|
|
3
3
|
import { md } from "../../../share/markdown.js";
|
|
4
|
+
export function validationRuleStruct(configure) {
|
|
5
|
+
const CelBool = Expression({ configure, resultType: "bool" });
|
|
6
|
+
return Schema.Struct({
|
|
7
|
+
when: CelBool.annotations({
|
|
8
|
+
title: "\u89C4\u5219",
|
|
9
|
+
description: md`
|
|
10
|
+
返回 \`true\` 时视为校验**未**通过,返回 \`false\` 视为通过
|
|
11
|
+
`
|
|
12
|
+
}),
|
|
13
|
+
// Severity toggle. Off (default / absent) ⇒ error: standard blocks submit
|
|
14
|
+
// and reds the field. On ⇒ warning: yellow hint only, never blocks submit.
|
|
15
|
+
warning: Schema.optional(Schema.Boolean.annotations({
|
|
16
|
+
title: "\u4EC5\u8B66\u544A",
|
|
17
|
+
description: "\u5F00\u542F\u540E\u8BE5\u89C4\u5219\u4EC5\u9EC4\u8272\u63D0\u793A\u3001\u4E0D\u963B\u6B62\u63D0\u4EA4"
|
|
18
|
+
})),
|
|
19
|
+
message: LocaleMarkdown({ configure }).annotations({
|
|
20
|
+
title: "\u6D88\u606F",
|
|
21
|
+
description: "\u6821\u9A8C\u672A\u901A\u8FC7\u65F6\u5C55\u793A\u7684\u672C\u5730\u5316\u6D88\u606F\uFF0C\u652F\u6301 inline Markdown \u4E0E `{{ \u8868\u8FBE\u5F0F }}` \u63D2\u503C"
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
4
25
|
export function commonFieldFields(configure) {
|
|
5
26
|
const CelBool = Expression({ configure, resultType: "bool" });
|
|
6
27
|
return {
|
|
@@ -12,7 +33,24 @@ export function commonFieldFields(configure) {
|
|
|
12
33
|
hidden: Schema.optional(CelBool.annotations({
|
|
13
34
|
title: "\u9690\u85CF\u6761\u4EF6",
|
|
14
35
|
description: "\u8FD4\u56DE `true` \u65F6\u5B57\u6BB5\u5728\u6240\u6709\u5E03\u5C40\u4E2D\u90FD\u4E0D\u6E32\u67D3"
|
|
15
|
-
}))
|
|
36
|
+
})),
|
|
37
|
+
// Required marker + non-empty check share one expression — no drift
|
|
38
|
+
// between the star the user sees and the rule that gates submit.
|
|
39
|
+
required: Schema.optional(CelBool.annotations({
|
|
40
|
+
title: "\u5FC5\u586B\u6761\u4EF6",
|
|
41
|
+
description: "\u8FD4\u56DE `true` \u65F6\u663E\u793A\u5FC5\u586B\u661F\u53F7\u5E76\u8981\u6C42\u975E\u7A7A\uFF0C\u7559\u7A7A\u8868\u793A\u4E0D\u5FC5\u586B"
|
|
42
|
+
})),
|
|
43
|
+
// Field-owned rules. `when` returns a bool — `true` triggers the rule; the
|
|
44
|
+
// per-rule `warning` switch picks the severity (error by default, warning
|
|
45
|
+
// when on). The message is a localized Markdown template with `{{ 表达式 }}`
|
|
46
|
+
// interpolation. Cross-field rules read `form.*` and live on the field where
|
|
47
|
+
// the error should appear.
|
|
48
|
+
validations: Schema.optional(
|
|
49
|
+
Schema.Array(validationRuleStruct(configure)).annotations({
|
|
50
|
+
title: "\u6821\u9A8C\u89C4\u5219",
|
|
51
|
+
description: "\u53CD\u9988\u6D88\u606F\u5C06\u6309\u7167\u6821\u9A8C\u89C4\u5219\u5217\u8868\u987A\u5E8F\u5C55\u793A"
|
|
52
|
+
})
|
|
53
|
+
)
|
|
16
54
|
};
|
|
17
55
|
}
|
|
18
56
|
export const FIELD_ORIENTATIONS = ["vertical", "floating"];
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Effect } from 'effect';
|
|
2
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
3
|
+
import { type LocaleValue } from '../../../share/locale.js';
|
|
4
|
+
export type Severity = 'error' | 'warning';
|
|
5
|
+
export type FieldValidationResult = {
|
|
6
|
+
severity: Severity;
|
|
7
|
+
/** Already i18n-resolved and `{{ }}`-interpolated — ready to render. */
|
|
8
|
+
message: string;
|
|
9
|
+
/** Index in the field's `validations[]`; `-1` for the implicit required rule. */
|
|
10
|
+
ruleIndex: number;
|
|
11
|
+
};
|
|
12
|
+
/** The slice of a field's config the validation engine reads. */
|
|
13
|
+
export type ValidatableConfig = {
|
|
14
|
+
required?: string;
|
|
15
|
+
validations?: ReadonlyArray<{
|
|
16
|
+
when: string;
|
|
17
|
+
warning?: boolean;
|
|
18
|
+
message: LocaleValue;
|
|
19
|
+
}>;
|
|
20
|
+
binding?: string | readonly [string, string];
|
|
21
|
+
};
|
|
22
|
+
type Registration = () => ReadonlyArray<FieldValidationResult>;
|
|
23
|
+
export type ValidationProvider = {
|
|
24
|
+
/**
|
|
25
|
+
* Global reveal gate. Errors on a pristine field stay hidden until that
|
|
26
|
+
* field's binding is dirtied (first blur) or `reveal()` flips this true.
|
|
27
|
+
* Once true it never retracts during the form's life — only a full unmount
|
|
28
|
+
* resets it. `undo`/`redo` do not touch it (they roll back state, not the
|
|
29
|
+
* gate).
|
|
30
|
+
*/
|
|
31
|
+
revealed: Ref<boolean>;
|
|
32
|
+
reveal: () => void;
|
|
33
|
+
/** Register a mounted field's id + live results thunk; returns an unregister fn. */
|
|
34
|
+
register: (fieldId: () => string, results: Registration) => () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Drain pending drafts, await the seed and derived-value settlement, then
|
|
37
|
+
* read every registered field's results. `true` ⇒ no `error`-severity
|
|
38
|
+
* result anywhere. Always calls `reveal()` so the failing fields surface.
|
|
39
|
+
*/
|
|
40
|
+
validate: () => Promise<boolean>;
|
|
41
|
+
/** Union of results across the given field ids — used by collapsible aggregation. */
|
|
42
|
+
resultsFor: (fieldIds: ReadonlyArray<string>) => ReadonlyArray<FieldValidationResult>;
|
|
43
|
+
};
|
|
44
|
+
export type ValidationHost = {
|
|
45
|
+
/** Drain pending field commits (the form's commit bus). */
|
|
46
|
+
flush: () => void;
|
|
47
|
+
/** Resolves once the initial seed has landed. */
|
|
48
|
+
seeded: Promise<void>;
|
|
49
|
+
/** Resolves once every derived value — cascades included — has settled. */
|
|
50
|
+
settled: () => Promise<void>;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Provide the form-wide validation registry. Called once at the top-level form
|
|
54
|
+
* host, after the commit bus / quiescence are available; nested list rows
|
|
55
|
+
* inherit it through `inject`, so every field in the form — at any nesting
|
|
56
|
+
* depth — registers into this single provider.
|
|
57
|
+
*/
|
|
58
|
+
export declare function provideValidation(host: ValidationHost): ValidationProvider;
|
|
59
|
+
/**
|
|
60
|
+
* Inject the form's validation provider. Returns `undefined` when used outside
|
|
61
|
+
* a `<Form>` host (e.g. a submit button placed on a bare page) — callers treat
|
|
62
|
+
* that as "no validation".
|
|
63
|
+
*/
|
|
64
|
+
export declare function useValidationProvider(): ValidationProvider | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Field-level validation. Called inside an input field's `runtime.vue`. Reads
|
|
67
|
+
* the field's `required` / `validations` config, evaluates them synchronously
|
|
68
|
+
* against the field's CEL context (`form`, plus a list row's `item`/`index`),
|
|
69
|
+
* registers the live results into the form-wide provider for as long as the
|
|
70
|
+
* field is mounted, and returns the bits the field renders: the required star,
|
|
71
|
+
* the error/warning message lists, and the dirty-gated `visible` flag.
|
|
72
|
+
*/
|
|
73
|
+
export declare function useFieldValidation(options: {
|
|
74
|
+
fieldId: () => string;
|
|
75
|
+
config: () => ValidatableConfig;
|
|
76
|
+
$cel: <T>(expression: string, context?: Record<string, unknown>) => Effect.Effect<T, any>;
|
|
77
|
+
/** Current i18n locale, for resolving the message `Locale`. */
|
|
78
|
+
locale: () => string;
|
|
79
|
+
}): {
|
|
80
|
+
isRequired: ComputedRef<boolean>;
|
|
81
|
+
errors: ComputedRef<ReadonlyArray<string>>;
|
|
82
|
+
warnings: ComputedRef<ReadonlyArray<string>>;
|
|
83
|
+
visible: ComputedRef<boolean>;
|
|
84
|
+
};
|
|
85
|
+
export {};
|