@shwfed/config 2.3.29 → 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 +47 -9
- package/dist/module.json +1 -1
- package/dist/preview/assets/{config-Diuyh0Ex.js → config-BovRv7Mw.js} +1 -1
- package/dist/preview/assets/{config-rpX_Mc6I.js → config-ByTxMBcK.js} +1 -1
- package/dist/preview/assets/{config-DhsbcNzx.js → config-C7xYpB3N.js} +1 -1
- package/dist/preview/assets/{config-CZOeZ8ty.js → config-CH9wsYX8.js} +1 -1
- package/dist/preview/assets/{config-aK67Rsw5.js → config-Ch5dL5lp.js} +1 -1
- package/dist/preview/assets/{config-Bl80ye-i.js → config-D50Rl2n_.js} +1 -1
- package/dist/preview/assets/{config-BJzUh1_G.js → config-DiwVK32V.js} +1 -1
- package/dist/preview/assets/{config-6IiXCmyu.js → config-EKVeWrbS.js} +1 -1
- package/dist/preview/assets/{config-DaZD4ZSa.js → config-Q86AhjHq.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-C_jU8d47.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/config/blocks/2026-05-06/com.shwfed.block.form/config.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +3 -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/config.vue +32 -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 +16 -5
- package/dist/runtime/components/form/index.vue.d.ts +1 -0
- package/dist/runtime/components/form/schema.d.ts +4 -0
- package/dist/runtime/components/form/schema.js +6 -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/columns/2026-04-14/com.shwfed.table.column.select/config.vue +0 -22
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/header.vue +3 -15
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.d.ts +0 -1
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/schema.js +0 -4
- package/dist/runtime/components/table/config.d.vue.ts +4 -2
- package/dist/runtime/components/table/config.vue +59 -52
- package/dist/runtime/components/table/config.vue.d.ts +4 -2
- package/dist/runtime/components/table/schema.d.ts +4 -0
- 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-2eQR4s3q.css +0 -1
- package/dist/preview/assets/index-DEF3_MKr.js +0 -659
- package/dist/preview/assets/index-Df-thth9.js +0 -1
- package/dist/preview/assets/runtime-3p1K6te5.js +0 -1
- package/dist/preview/assets/runtime-BcLnafic.js +0 -1
- package/dist/preview/assets/runtime-CSaV-359.js +0 -1
- package/dist/preview/assets/runtime-CjR8Vi5N.js +0 -1
- package/dist/preview/assets/runtime-D_fJCKX_.js +0 -1
- package/dist/preview/assets/runtime-DpeCgGEG.js +0 -1
- package/dist/preview/assets/runtime-K2a1x0TJ.js +0 -1
- package/dist/preview/assets/runtime-g9Zu3VNQ.js +0 -1
- package/dist/preview/assets/runtime-jTnh_6Dm.js +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { cn } from "../../../utils/cn";
|
|
3
|
+
import FieldError from "./FieldError.vue";
|
|
4
|
+
import FieldWarning from "./FieldWarning.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
class: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
7
|
+
errors: { type: Array, required: false },
|
|
8
|
+
warnings: { type: Array, required: false }
|
|
9
|
+
});
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div
|
|
14
|
+
v-if="errors && errors.length || warnings && warnings.length"
|
|
15
|
+
data-slot="field-messages"
|
|
16
|
+
:class="cn('absolute left-0 top-full z-10 flex w-full flex-col gap-0.5', props.class)"
|
|
17
|
+
>
|
|
18
|
+
<FieldError :errors="errors ? [...errors] : void 0" />
|
|
19
|
+
<FieldWarning :errors="warnings ? [...warnings] : void 0" />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
errors?: ReadonlyArray<string>;
|
|
5
|
+
warnings?: ReadonlyArray<string>;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
errors?: Array<string | {
|
|
5
|
+
message: string | undefined;
|
|
6
|
+
} | undefined>;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { cn } from "../../../utils/cn";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
class: { type: [Boolean, null, String, Object, Array], required: false, skipCheck: true },
|
|
6
|
+
errors: { type: Array, required: false }
|
|
7
|
+
});
|
|
8
|
+
const content = computed(() => {
|
|
9
|
+
if (!props.errors || props.errors.length === 0)
|
|
10
|
+
return null;
|
|
11
|
+
const unique = [
|
|
12
|
+
...new Map(
|
|
13
|
+
props.errors.filter(Boolean).map((error) => {
|
|
14
|
+
const message = typeof error === "string" ? error : error?.message;
|
|
15
|
+
return [message, error];
|
|
16
|
+
})
|
|
17
|
+
).values()
|
|
18
|
+
];
|
|
19
|
+
if (unique.length === 1 && unique[0]) {
|
|
20
|
+
return typeof unique[0] === "string" ? unique[0] : unique[0].message;
|
|
21
|
+
}
|
|
22
|
+
return unique.map((error) => typeof error === "string" ? error : error?.message);
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div
|
|
28
|
+
v-if="$slots.default || content"
|
|
29
|
+
role="status"
|
|
30
|
+
data-slot="field-warning"
|
|
31
|
+
:class="cn('max-w-full pt-0.25 text-amber-600 text-xs leading-tight font-normal', props.class)"
|
|
32
|
+
>
|
|
33
|
+
<slot v-if="$slots.default" />
|
|
34
|
+
|
|
35
|
+
<template v-else-if="typeof content === 'string'">
|
|
36
|
+
{{ content }}
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<ul
|
|
40
|
+
v-else-if="Array.isArray(content)"
|
|
41
|
+
class="ml-3 flex list-disc flex-col gap-0.5"
|
|
42
|
+
>
|
|
43
|
+
<li
|
|
44
|
+
v-for="(warning, index) in content"
|
|
45
|
+
:key="index"
|
|
46
|
+
>
|
|
47
|
+
{{ warning }}
|
|
48
|
+
</li>
|
|
49
|
+
</ul>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'vue';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: HTMLAttributes['class'];
|
|
4
|
+
errors?: Array<string | {
|
|
5
|
+
message: string | undefined;
|
|
6
|
+
} | undefined>;
|
|
7
|
+
};
|
|
8
|
+
declare var __VLS_1: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_1) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -10,6 +10,8 @@ export { default as FieldError } from './FieldError.vue.js';
|
|
|
10
10
|
export { default as FieldGroup } from './FieldGroup.vue.js';
|
|
11
11
|
export { default as FieldLabel } from './FieldLabel.vue.js';
|
|
12
12
|
export { default as FieldLegend } from './FieldLegend.vue.js';
|
|
13
|
+
export { default as FieldMessages } from './FieldMessages.vue.js';
|
|
13
14
|
export { default as FieldSeparator } from './FieldSeparator.vue.js';
|
|
15
|
+
export { default as FieldWarning } from './FieldWarning.vue.js';
|
|
14
16
|
export { default as FieldSet } from './FieldSet.vue.js';
|
|
15
17
|
export { default as FieldTitle } from './FieldTitle.vue.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
2
|
export const fieldVariants = cva(
|
|
3
|
-
"group/field flex w-full gap-2 data-[invalid=true]:text-red-400",
|
|
3
|
+
"group/field relative flex w-full gap-2 data-[invalid=true]:text-red-400",
|
|
4
4
|
{
|
|
5
5
|
variants: {
|
|
6
6
|
orientation: {
|
|
@@ -25,11 +25,15 @@ export const fieldVariants = cva(
|
|
|
25
25
|
"**:data-[slot=field-label]:px-1",
|
|
26
26
|
"**:data-[slot=field-label]:text-sm",
|
|
27
27
|
"has-data-[value=true]:**:data-[slot=field-label]:text-[0.625rem]",
|
|
28
|
-
|
|
28
|
+
// Float on focus via `focus-within`, NOT `[data-slot=input-group-control]:focus`:
|
|
29
|
+
// `InputGroupInput`/`InputGroupTextarea` forward that slot to `Input`/`Textarea`,
|
|
30
|
+
// which hard-code `data-slot=input`/`textarea` on the focusable element, so the
|
|
31
|
+
// forwarded slot never lands there and the focus selector would never match.
|
|
32
|
+
"focus-within:**:data-[slot=field-label]:top-0",
|
|
29
33
|
"has-data-[state=open]:**:data-[slot=field-label]:top-0",
|
|
30
|
-
"
|
|
34
|
+
"focus-within:**:data-[slot=field-label]:text-[0.625rem]",
|
|
31
35
|
"has-data-[state=open]:**:data-[slot=field-label]:text-[0.625rem]",
|
|
32
|
-
"
|
|
36
|
+
"focus-within:**:data-[slot=field-label]:text-zinc-700",
|
|
33
37
|
"has-data-[state=open]:**:data-[slot=field-label]:text-zinc-700",
|
|
34
38
|
"has-data-[value=true]:**:data-[slot=field-label]:text-zinc-700",
|
|
35
39
|
"data-[disabled=true]:**:data-[slot=field-label]:text-zinc-400",
|
|
@@ -61,6 +65,8 @@ export { default as FieldError } from "./FieldError.vue";
|
|
|
61
65
|
export { default as FieldGroup } from "./FieldGroup.vue";
|
|
62
66
|
export { default as FieldLabel } from "./FieldLabel.vue";
|
|
63
67
|
export { default as FieldLegend } from "./FieldLegend.vue";
|
|
68
|
+
export { default as FieldMessages } from "./FieldMessages.vue";
|
|
64
69
|
export { default as FieldSeparator } from "./FieldSeparator.vue";
|
|
70
|
+
export { default as FieldWarning } from "./FieldWarning.vue";
|
|
65
71
|
export { default as FieldSet } from "./FieldSet.vue";
|
|
66
72
|
export { default as FieldTitle } from "./FieldTitle.vue";
|
|
@@ -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, {
|
|
@@ -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
|
+
}
|