@shwfed/config 2.4.0 → 2.5.0
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 +128 -27
- package/dist/module.json +1 -1
- package/dist/preview/assets/{config-Bxkq2ZRm.js → config-BkytEQN5.js} +1 -1
- package/dist/preview/assets/{config-BdFIFUa_.js → config-CK011_jJ.js} +1 -1
- package/dist/preview/assets/{config-BcQQl4v6.js → config-C_bBX0wD.js} +1 -1
- package/dist/preview/assets/{config-CHHX7vhb.js → config-Cbn8o9BY.js} +1 -1
- package/dist/preview/assets/{config-CZ0f5xdI.js → config-DYL6kHr3.js} +1 -1
- package/dist/preview/assets/{config-Ddh8pxIi.js → config-Dx0zHfGt.js} +1 -1
- package/dist/preview/assets/{config-D9xGgFnF.js → config-E-DM6b5t.js} +1 -1
- package/dist/preview/assets/{config-C32yfrlg.js → config-PjseWUbC.js} +1 -1
- package/dist/preview/assets/{config-Bi9F-Jdh.js → config-dwcdYHd4.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-uJFJXxli.js} +1 -1
- package/dist/preview/assets/index-7MVXgV5n.css +1 -0
- package/dist/preview/assets/index-CmPiZG_4.js +1 -0
- package/dist/preview/assets/index-x-77enex.js +668 -0
- package/dist/preview/assets/runtime-BRMGkqSr.js +1 -0
- package/dist/preview/assets/runtime-CHLboM_z.js +1 -0
- package/dist/preview/assets/runtime-CeHdesjP.js +1 -0
- package/dist/preview/assets/runtime-D4_9FCLy.js +1 -0
- package/dist/preview/assets/runtime-DHBTDws7.js +1 -0
- package/dist/preview/assets/runtime-DJHpCLnr.js +1 -0
- package/dist/preview/assets/runtime-DKq86fZU.js +1 -0
- package/dist/preview/assets/runtime-DjpjaNec.js +1 -0
- package/dist/preview/assets/runtime-ZQryOEKm.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/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +1 -1
- 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 +14 -18
- package/dist/runtime/components/form/index.vue.d.ts +1 -0
- package/dist/runtime/components/form/schema.d.ts +2 -10
- package/dist/runtime/components/form/schema.js +2 -5
- package/dist/runtime/components/form/utils/cel-scope.d.ts +12 -3
- package/dist/runtime/components/form/utils/cel-scope.js +17 -18
- 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/form-vars.d.ts +19 -0
- package/dist/runtime/components/form/utils/form-vars.js +5 -0
- 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/columns/2026-04-14/com.shwfed.table.column.date/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.date/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.number/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue +20 -7
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue +20 -7
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue +20 -7
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-27/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue +20 -8
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/schema.js +2 -1
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue +20 -7
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-multi/schema.d.ts +1 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.d.vue.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue +20 -7
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/config.vue.d.ts +2 -0
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.tree-combobox-single/schema.d.ts +1 -0
- package/dist/runtime/components/table/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/config.vue +25 -45
- package/dist/runtime/components/table/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/index.vue +22 -2
- package/dist/runtime/components/table/schema.d.ts +4 -2
- package/dist/runtime/components/table/schema.js +69 -13
- package/dist/runtime/components/table/utils/shared.d.ts +2 -0
- package/dist/runtime/components/table/utils/shared.js +12 -4
- 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
|
@@ -7,6 +7,7 @@ import { useTranslateLocale } from "../../../composables/useTranslateLocale";
|
|
|
7
7
|
import { cn } from "../../../utils/cn";
|
|
8
8
|
import { Button } from "../button";
|
|
9
9
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../dropdown-menu";
|
|
10
|
+
import { Field, FieldLabel } from "../field";
|
|
10
11
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupTextarea } from "../input-group";
|
|
11
12
|
const supportedLocales = ["zh", "ja", "en", "ko"];
|
|
12
13
|
defineOptions({
|
|
@@ -18,6 +19,8 @@ const props = defineProps({
|
|
|
18
19
|
class: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
19
20
|
multiline: { type: Boolean, required: false },
|
|
20
21
|
markdown: { type: Boolean, required: false },
|
|
22
|
+
floating: { type: Boolean, required: false },
|
|
23
|
+
placeholder: { type: String, required: false },
|
|
21
24
|
translateHint: { type: String, required: false }
|
|
22
25
|
});
|
|
23
26
|
const emits = defineEmits(["update:modelValue"]);
|
|
@@ -136,32 +139,123 @@ async function onAiTranslate(locale) {
|
|
|
136
139
|
data-slot="locale"
|
|
137
140
|
:class="cn('flex flex-col gap-2', props.class)"
|
|
138
141
|
>
|
|
139
|
-
<
|
|
142
|
+
<Field
|
|
140
143
|
v-for="(item, index) in locales"
|
|
141
144
|
:key="item.locale"
|
|
142
|
-
|
|
143
|
-
:data-locale="item.locale"
|
|
145
|
+
:orientation="props.floating ? 'floating' : 'contents'"
|
|
144
146
|
>
|
|
145
|
-
<
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
<FieldLabel v-if="props.floating">
|
|
148
|
+
{{ localeLabel(item.locale) }}
|
|
149
|
+
</FieldLabel>
|
|
150
|
+
<InputGroup
|
|
151
|
+
data-slot="locale-row"
|
|
152
|
+
:data-locale="item.locale"
|
|
149
153
|
>
|
|
150
|
-
<
|
|
154
|
+
<InputGroupAddon
|
|
155
|
+
v-if="props.multiline"
|
|
156
|
+
align="block-start"
|
|
157
|
+
class="border-b border-zinc-200"
|
|
158
|
+
>
|
|
159
|
+
<div class="flex w-full items-center justify-between gap-3">
|
|
160
|
+
<DropdownMenu v-if="item.locale !== 'zh' && availableLocales(index).length > 0">
|
|
161
|
+
<DropdownMenuTrigger as-child>
|
|
162
|
+
<InputGroupButton
|
|
163
|
+
size="sm"
|
|
164
|
+
as-child
|
|
165
|
+
>
|
|
166
|
+
<button
|
|
167
|
+
type="button"
|
|
168
|
+
data-slot="locale-trigger"
|
|
169
|
+
class="text-zinc-500 transition-colors hover:text-zinc-700"
|
|
170
|
+
:aria-label="`\u9009\u62E9\u8BED\u8A00\uFF1A${localeLabel(item.locale)}`"
|
|
171
|
+
>
|
|
172
|
+
<Icon :icon="localeIcon(item.locale)" />
|
|
173
|
+
<span>{{ localeLabel(item.locale) }}</span>
|
|
174
|
+
</button>
|
|
175
|
+
</InputGroupButton>
|
|
176
|
+
</DropdownMenuTrigger>
|
|
177
|
+
<DropdownMenuContent align="start">
|
|
178
|
+
<DropdownMenuItem
|
|
179
|
+
v-for="locale in availableLocales(index)"
|
|
180
|
+
:key="locale"
|
|
181
|
+
data-slot="locale-option"
|
|
182
|
+
:data-locale-option="locale"
|
|
183
|
+
@select="updateLocale(index, locale)"
|
|
184
|
+
>
|
|
185
|
+
<Icon :icon="localeIcon(locale)" />
|
|
186
|
+
<span>{{ localeLabel(locale) }}</span>
|
|
187
|
+
</DropdownMenuItem>
|
|
188
|
+
</DropdownMenuContent>
|
|
189
|
+
</DropdownMenu>
|
|
190
|
+
|
|
191
|
+
<span
|
|
192
|
+
v-else
|
|
193
|
+
data-slot="locale-icon"
|
|
194
|
+
class="flex items-center gap-2 text-zinc-500"
|
|
195
|
+
>
|
|
196
|
+
<Icon :icon="localeIcon(item.locale)" />
|
|
197
|
+
<span>{{ localeLabel(item.locale) }}</span>
|
|
198
|
+
</span>
|
|
199
|
+
|
|
200
|
+
<div class="flex items-center gap-2">
|
|
201
|
+
<Icon
|
|
202
|
+
v-if="props.markdown"
|
|
203
|
+
data-slot="locale-markdown-indicator"
|
|
204
|
+
icon="fluent:markdown-20-regular"
|
|
205
|
+
class="text-purple-600"
|
|
206
|
+
aria-label="支持 Markdown"
|
|
207
|
+
/>
|
|
208
|
+
<InputGroupButton
|
|
209
|
+
v-if="canAiTranslate(item.locale) || isAiTranslating(item.locale)"
|
|
210
|
+
size="icon-xs"
|
|
211
|
+
as-child
|
|
212
|
+
>
|
|
213
|
+
<button
|
|
214
|
+
type="button"
|
|
215
|
+
data-slot="locale-translate"
|
|
216
|
+
:disabled="isAiTranslating(item.locale) || !canAiTranslate(item.locale)"
|
|
217
|
+
:aria-label="`AI \u7FFB\u8BD1\uFF1A${localeLabel(item.locale)}`"
|
|
218
|
+
@click="onAiTranslate(item.locale)"
|
|
219
|
+
>
|
|
220
|
+
<Icon
|
|
221
|
+
:icon="isAiTranslating(item.locale) ? 'fluent:arrow-sync-20-regular' : 'fluent:magic-wand-20-regular'"
|
|
222
|
+
:class="isAiTranslating(item.locale) ? 'animate-spin' : ''"
|
|
223
|
+
/>
|
|
224
|
+
</button>
|
|
225
|
+
</InputGroupButton>
|
|
226
|
+
<InputGroupButton
|
|
227
|
+
variant="destructive"
|
|
228
|
+
size="icon-xs"
|
|
229
|
+
as-child
|
|
230
|
+
>
|
|
231
|
+
<button
|
|
232
|
+
type="button"
|
|
233
|
+
data-slot="locale-delete"
|
|
234
|
+
:disabled="item.locale === 'zh'"
|
|
235
|
+
:aria-label="`\u5220\u9664\u8BED\u8A00\uFF1A${localeLabel(item.locale)}`"
|
|
236
|
+
@click="removeLocale(index)"
|
|
237
|
+
>
|
|
238
|
+
<Icon icon="fluent:delete-20-regular" />
|
|
239
|
+
</button>
|
|
240
|
+
</InputGroupButton>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
</InputGroupAddon>
|
|
244
|
+
|
|
245
|
+
<InputGroupAddon v-else>
|
|
151
246
|
<DropdownMenu v-if="item.locale !== 'zh' && availableLocales(index).length > 0">
|
|
152
247
|
<DropdownMenuTrigger as-child>
|
|
153
248
|
<InputGroupButton
|
|
154
|
-
size="sm"
|
|
249
|
+
size="icon-sm"
|
|
155
250
|
as-child
|
|
156
251
|
>
|
|
157
252
|
<button
|
|
158
253
|
type="button"
|
|
159
254
|
data-slot="locale-trigger"
|
|
160
|
-
class="text-zinc-500 transition-colors hover:text-zinc-700"
|
|
255
|
+
class="text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5"
|
|
161
256
|
:aria-label="`\u9009\u62E9\u8BED\u8A00\uFF1A${localeLabel(item.locale)}`"
|
|
162
257
|
>
|
|
163
258
|
<Icon :icon="localeIcon(item.locale)" />
|
|
164
|
-
<span>{{ localeLabel(item.locale) }}</span>
|
|
165
259
|
</button>
|
|
166
260
|
</InputGroupButton>
|
|
167
261
|
</DropdownMenuTrigger>
|
|
@@ -178,163 +272,79 @@ async function onAiTranslate(locale) {
|
|
|
178
272
|
</DropdownMenuItem>
|
|
179
273
|
</DropdownMenuContent>
|
|
180
274
|
</DropdownMenu>
|
|
181
|
-
|
|
182
275
|
<span
|
|
183
276
|
v-else
|
|
184
277
|
data-slot="locale-icon"
|
|
185
|
-
class="flex items-center
|
|
278
|
+
class="-ml-[0.45rem] flex size-8 items-center justify-center text-zinc-500"
|
|
186
279
|
>
|
|
187
280
|
<Icon :icon="localeIcon(item.locale)" />
|
|
188
|
-
<span>{{ localeLabel(item.locale) }}</span>
|
|
189
281
|
</span>
|
|
282
|
+
</InputGroupAddon>
|
|
190
283
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
/>
|
|
199
|
-
<InputGroupButton
|
|
200
|
-
v-if="canAiTranslate(item.locale) || isAiTranslating(item.locale)"
|
|
201
|
-
size="icon-xs"
|
|
202
|
-
as-child
|
|
203
|
-
>
|
|
204
|
-
<button
|
|
205
|
-
type="button"
|
|
206
|
-
data-slot="locale-translate"
|
|
207
|
-
:disabled="isAiTranslating(item.locale) || !canAiTranslate(item.locale)"
|
|
208
|
-
:aria-label="`AI \u7FFB\u8BD1\uFF1A${localeLabel(item.locale)}`"
|
|
209
|
-
@click="onAiTranslate(item.locale)"
|
|
210
|
-
>
|
|
211
|
-
<Icon
|
|
212
|
-
:icon="isAiTranslating(item.locale) ? 'fluent:arrow-sync-20-regular' : 'fluent:magic-wand-20-regular'"
|
|
213
|
-
:class="isAiTranslating(item.locale) ? 'animate-spin' : ''"
|
|
214
|
-
/>
|
|
215
|
-
</button>
|
|
216
|
-
</InputGroupButton>
|
|
217
|
-
<InputGroupButton
|
|
218
|
-
variant="destructive"
|
|
219
|
-
size="icon-xs"
|
|
220
|
-
as-child
|
|
221
|
-
>
|
|
222
|
-
<button
|
|
223
|
-
type="button"
|
|
224
|
-
data-slot="locale-delete"
|
|
225
|
-
:disabled="item.locale === 'zh'"
|
|
226
|
-
:aria-label="`\u5220\u9664\u8BED\u8A00\uFF1A${localeLabel(item.locale)}`"
|
|
227
|
-
@click="removeLocale(index)"
|
|
228
|
-
>
|
|
229
|
-
<Icon icon="fluent:delete-20-regular" />
|
|
230
|
-
</button>
|
|
231
|
-
</InputGroupButton>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
</InputGroupAddon>
|
|
284
|
+
<InputGroupInput
|
|
285
|
+
v-if="!props.multiline"
|
|
286
|
+
data-slot="locale-input"
|
|
287
|
+
:model-value="item.message"
|
|
288
|
+
:placeholder="props.placeholder ?? (props.floating ? '' : localeLabel(item.locale))"
|
|
289
|
+
@update:model-value="handleMessageUpdate(index, $event)"
|
|
290
|
+
/>
|
|
235
291
|
|
|
236
|
-
|
|
237
|
-
<DropdownMenu v-if="item.locale !== 'zh' && availableLocales(index).length > 0">
|
|
238
|
-
<DropdownMenuTrigger as-child>
|
|
239
|
-
<InputGroupButton
|
|
240
|
-
size="icon-sm"
|
|
241
|
-
as-child
|
|
242
|
-
>
|
|
243
|
-
<button
|
|
244
|
-
type="button"
|
|
245
|
-
data-slot="locale-trigger"
|
|
246
|
-
class="text-zinc-500 transition-colors hover:text-zinc-700 [&_svg:not([class*='size-'])]:size-3.5"
|
|
247
|
-
:aria-label="`\u9009\u62E9\u8BED\u8A00\uFF1A${localeLabel(item.locale)}`"
|
|
248
|
-
>
|
|
249
|
-
<Icon :icon="localeIcon(item.locale)" />
|
|
250
|
-
</button>
|
|
251
|
-
</InputGroupButton>
|
|
252
|
-
</DropdownMenuTrigger>
|
|
253
|
-
<DropdownMenuContent align="start">
|
|
254
|
-
<DropdownMenuItem
|
|
255
|
-
v-for="locale in availableLocales(index)"
|
|
256
|
-
:key="locale"
|
|
257
|
-
data-slot="locale-option"
|
|
258
|
-
:data-locale-option="locale"
|
|
259
|
-
@select="updateLocale(index, locale)"
|
|
260
|
-
>
|
|
261
|
-
<Icon :icon="localeIcon(locale)" />
|
|
262
|
-
<span>{{ localeLabel(locale) }}</span>
|
|
263
|
-
</DropdownMenuItem>
|
|
264
|
-
</DropdownMenuContent>
|
|
265
|
-
</DropdownMenu>
|
|
266
|
-
<span
|
|
292
|
+
<InputGroupTextarea
|
|
267
293
|
v-else
|
|
268
|
-
data-slot="locale-
|
|
269
|
-
class="-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
</InputGroupAddon>
|
|
274
|
-
|
|
275
|
-
<InputGroupInput
|
|
276
|
-
v-if="!props.multiline"
|
|
277
|
-
data-slot="locale-input"
|
|
278
|
-
:model-value="item.message"
|
|
279
|
-
:placeholder="localeLabel(item.locale)"
|
|
280
|
-
@update:model-value="handleMessageUpdate(index, $event)"
|
|
281
|
-
/>
|
|
282
|
-
|
|
283
|
-
<InputGroupTextarea
|
|
284
|
-
v-else
|
|
285
|
-
data-slot="locale-textarea"
|
|
286
|
-
class="min-h-32"
|
|
287
|
-
:model-value="item.message"
|
|
288
|
-
:placeholder="localeLabel(item.locale)"
|
|
289
|
-
@update:model-value="handleMessageUpdate(index, $event)"
|
|
290
|
-
/>
|
|
291
|
-
|
|
292
|
-
<InputGroupAddon
|
|
293
|
-
v-if="!props.multiline"
|
|
294
|
-
align="inline-end"
|
|
295
|
-
>
|
|
296
|
-
<Icon
|
|
297
|
-
v-if="props.markdown"
|
|
298
|
-
data-slot="locale-markdown-indicator"
|
|
299
|
-
icon="fluent:markdown-20-regular"
|
|
300
|
-
class="text-purple-600"
|
|
301
|
-
aria-label="支持 Markdown"
|
|
294
|
+
data-slot="locale-textarea"
|
|
295
|
+
class="min-h-32"
|
|
296
|
+
:model-value="item.message"
|
|
297
|
+
:placeholder="props.placeholder ?? (props.floating ? '' : localeLabel(item.locale))"
|
|
298
|
+
@update:model-value="handleMessageUpdate(index, $event)"
|
|
302
299
|
/>
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
300
|
+
|
|
301
|
+
<InputGroupAddon
|
|
302
|
+
v-if="!props.multiline"
|
|
303
|
+
align="inline-end"
|
|
307
304
|
>
|
|
308
|
-
<
|
|
309
|
-
|
|
310
|
-
data-slot="locale-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
305
|
+
<Icon
|
|
306
|
+
v-if="props.markdown"
|
|
307
|
+
data-slot="locale-markdown-indicator"
|
|
308
|
+
icon="fluent:markdown-20-regular"
|
|
309
|
+
class="text-purple-600"
|
|
310
|
+
aria-label="支持 Markdown"
|
|
311
|
+
/>
|
|
312
|
+
<InputGroupButton
|
|
313
|
+
v-if="canAiTranslate(item.locale) || isAiTranslating(item.locale)"
|
|
314
|
+
size="icon-xs"
|
|
315
|
+
as-child
|
|
314
316
|
>
|
|
315
|
-
<
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
317
|
+
<button
|
|
318
|
+
type="button"
|
|
319
|
+
data-slot="locale-translate"
|
|
320
|
+
:disabled="isAiTranslating(item.locale) || !canAiTranslate(item.locale)"
|
|
321
|
+
:aria-label="`AI \u7FFB\u8BD1\uFF1A${localeLabel(item.locale)}`"
|
|
322
|
+
@click="onAiTranslate(item.locale)"
|
|
323
|
+
>
|
|
324
|
+
<Icon
|
|
325
|
+
:icon="isAiTranslating(item.locale) ? 'fluent:arrow-sync-20-regular' : 'fluent:magic-wand-20-regular'"
|
|
326
|
+
:class="isAiTranslating(item.locale) ? 'animate-spin' : ''"
|
|
327
|
+
/>
|
|
328
|
+
</button>
|
|
329
|
+
</InputGroupButton>
|
|
330
|
+
<InputGroupButton
|
|
331
|
+
variant="destructive"
|
|
332
|
+
size="icon-xs"
|
|
333
|
+
as-child
|
|
332
334
|
>
|
|
333
|
-
<
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
335
|
+
<button
|
|
336
|
+
type="button"
|
|
337
|
+
data-slot="locale-delete"
|
|
338
|
+
:disabled="item.locale === 'zh'"
|
|
339
|
+
:aria-label="`\u5220\u9664\u8BED\u8A00\uFF1A${localeLabel(item.locale)}`"
|
|
340
|
+
@click="removeLocale(index)"
|
|
341
|
+
>
|
|
342
|
+
<Icon icon="fluent:delete-20-regular" />
|
|
343
|
+
</button>
|
|
344
|
+
</InputGroupButton>
|
|
345
|
+
</InputGroupAddon>
|
|
346
|
+
</InputGroup>
|
|
347
|
+
</Field>
|
|
338
348
|
|
|
339
349
|
<Button
|
|
340
350
|
type="button"
|
|
@@ -5,6 +5,8 @@ type __VLS_Props = {
|
|
|
5
5
|
class?: HTMLAttributes['class'];
|
|
6
6
|
multiline?: boolean;
|
|
7
7
|
markdown?: boolean;
|
|
8
|
+
floating?: boolean;
|
|
9
|
+
placeholder?: string;
|
|
8
10
|
translateHint?: string;
|
|
9
11
|
};
|
|
10
12
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type InjectionKey } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* A form-scoped "validate me" callback. Resolves `true` when the enclosing
|
|
4
|
+
* `<Form>` has no `error`-severity validation results (and reveals the errors
|
|
5
|
+
* on the way out either way).
|
|
6
|
+
*
|
|
7
|
+
* Lives in `share/` — the neutral ground for host↔button contracts, alongside
|
|
8
|
+
* `event-bus` — so a host-agnostic action button can run pre-submit validation
|
|
9
|
+
* without importing the form module. The form host provides the callback; a
|
|
10
|
+
* submit-style button injects it and always validates before firing. This is
|
|
11
|
+
* the transitional seam: the final design dispatches a fallible `validate`
|
|
12
|
+
* operation over the event bus instead, at which point this key retires.
|
|
13
|
+
*/
|
|
14
|
+
export type FormValidate = () => Promise<boolean>;
|
|
15
|
+
export declare const FORM_VALIDATE_KEY: InjectionKey<FormValidate>;
|
|
16
|
+
export declare function provideFormValidate(validate: FormValidate): void;
|
|
17
|
+
/** Inject the enclosing form's validate callback, or `undefined` outside a form. */
|
|
18
|
+
export declare function useFormValidate(): FormValidate | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { inject, provide } from "vue";
|
|
2
|
+
export const FORM_VALIDATE_KEY = Symbol("shwfed/form-validate");
|
|
3
|
+
export function provideFormValidate(validate) {
|
|
4
|
+
provide(FORM_VALIDATE_KEY, validate);
|
|
5
|
+
}
|
|
6
|
+
export function useFormValidate() {
|
|
7
|
+
return inject(FORM_VALIDATE_KEY, void 0);
|
|
8
|
+
}
|