@atscript/vue-form 0.1.206 → 0.1.208
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/{as-action-rT6WXLph.cjs → as-action-BGIbuTxh.cjs} +3 -3
- package/dist/{as-action-kBskX68v.mjs → as-action-CPQ64nNi.mjs} +3 -3
- package/dist/as-action.cjs +1 -1
- package/dist/as-action.d.cts +1 -1
- package/dist/as-action.d.mts +1 -1
- package/dist/as-action.mjs +1 -1
- package/dist/{as-action.vue-B7RrjGhF.d.cts → as-action.vue-D0twy1JK.d.cts} +1 -1
- package/dist/{as-action.vue-Dtez-EWu.d.mts → as-action.vue-Dse77iCr.d.mts} +1 -1
- package/dist/{as-array-Tt_4kl5r.mjs → as-array-CEtgj6nd.mjs} +13 -14
- package/dist/{as-array-C5lqDDLN.cjs → as-array-CKedVJIz.cjs} +13 -14
- package/dist/{as-array-clear-btn-DGUQY_7_.mjs → as-array-clear-btn-BFfll2RA.mjs} +1 -1
- package/dist/{as-array-clear-btn-Dk88CYmS.cjs → as-array-clear-btn-nYR8rEeL.cjs} +1 -1
- package/dist/as-array.cjs +1 -1
- package/dist/as-array.d.cts +1 -1
- package/dist/as-array.d.mts +1 -1
- package/dist/as-array.mjs +1 -1
- package/dist/{as-array.vue-Ca_xan2n.d.mts → as-array.vue-BCB8mLx-.d.mts} +1 -1
- package/dist/{as-array.vue-Dp_zd3ZM.d.cts → as-array.vue-DJNzEE8-.d.cts} +1 -1
- package/dist/{as-checkbox-CCX9E19U.mjs → as-checkbox-B7C-CvhT.mjs} +9 -17
- package/dist/{as-checkbox-D7NywgIa.cjs → as-checkbox-DKaEfo7e.cjs} +9 -17
- package/dist/as-checkbox.cjs +1 -1
- package/dist/as-checkbox.d.cts +1 -1
- package/dist/as-checkbox.d.mts +1 -1
- package/dist/as-checkbox.mjs +1 -1
- package/dist/{as-checkbox.vue-BClSBx1g.d.mts → as-checkbox.vue-CoCgt4vV.d.mts} +1 -1
- package/dist/{as-checkbox.vue-Bf3qqcKu.d.cts → as-checkbox.vue-fPeyQDp5.d.cts} +1 -1
- package/dist/{as-collapsible-CTOLQ3IK.cjs → as-collapsible-Bs0LOl1t.cjs} +1 -1
- package/dist/{as-collapsible-CvBoWb0D.mjs → as-collapsible-DOIWkQ0v.mjs} +1 -1
- package/dist/as-collapsible.cjs +1 -1
- package/dist/as-collapsible.d.cts +1 -1
- package/dist/as-collapsible.d.mts +1 -1
- package/dist/as-collapsible.mjs +1 -1
- package/dist/{as-collapsible.vue-BXdpM7_K.d.cts → as-collapsible.vue-CH3ez8zm.d.cts} +1 -1
- package/dist/{as-collapsible.vue-CUhn1EVX.d.mts → as-collapsible.vue-DewV2oaE.d.mts} +1 -1
- package/dist/{as-date-Ubw_1-Ai.cjs → as-date-BMKMiM_d.cjs} +6 -6
- package/dist/{as-date-3haOaiAG.mjs → as-date-CFQtrpZT.mjs} +6 -6
- package/dist/as-date.cjs +1 -1
- package/dist/as-date.d.cts +1 -1
- package/dist/as-date.d.mts +1 -1
- package/dist/as-date.mjs +1 -1
- package/dist/{as-date.vue-B5NWZ5ON.d.cts → as-date.vue-BSghCVx0.d.cts} +1 -1
- package/dist/{as-date.vue-CJQOrfj3.d.mts → as-date.vue-CPgqqKMB.d.mts} +1 -1
- package/dist/{as-datetime--7bl-yGW.cjs → as-datetime-Bl1K4U51.cjs} +6 -6
- package/dist/{as-datetime-BTekpasP.mjs → as-datetime-DqfSymmL.mjs} +6 -6
- package/dist/as-datetime.cjs +1 -1
- package/dist/as-datetime.d.cts +1 -1
- package/dist/as-datetime.d.mts +1 -1
- package/dist/as-datetime.mjs +1 -1
- package/dist/{as-datetime.vue-BvmFdGxe.d.cts → as-datetime.vue-B-KRC-0X.d.mts} +1 -1
- package/dist/{as-datetime.vue-CzMz_RUy.d.mts → as-datetime.vue-CjDTsMDw.d.cts} +1 -1
- package/dist/{as-decimal-DWPRXsYY.cjs → as-decimal-48M_h9Sl.cjs} +22 -28
- package/dist/{as-decimal-7CIE6UKX.mjs → as-decimal-CsAJlvie.mjs} +22 -28
- package/dist/as-decimal.cjs +1 -1
- package/dist/as-decimal.d.cts +1 -1
- package/dist/as-decimal.d.mts +1 -1
- package/dist/as-decimal.mjs +1 -1
- package/dist/{as-decimal.vue-DdVqHtMT.d.cts → as-decimal.vue-BZ2imea4.d.mts} +1 -1
- package/dist/{as-decimal.vue-DyDt1ds0.d.mts → as-decimal.vue-BvvG5aIL.d.cts} +1 -1
- package/dist/{as-field-jh5AWref.mjs → as-field-C6iquEB1.mjs} +123 -173
- package/dist/{as-field-DAClnYiP.cjs → as-field-CJMJJfXO.cjs} +122 -172
- package/dist/{as-field-shell-Cu8jxZYj.cjs → as-field-shell-CMq52Z6e.cjs} +7 -7
- package/dist/{as-field-shell-DPzfvPo0.mjs → as-field-shell-DXbAJupk.mjs} +7 -7
- package/dist/as-field-shell.cjs +1 -1
- package/dist/as-field-shell.d.cts +1 -1
- package/dist/as-field-shell.d.mts +1 -1
- package/dist/as-field-shell.mjs +1 -1
- package/dist/{as-field-shell.vue-CPy2uA-b.d.mts → as-field-shell.vue-BbSIqZSY.d.cts} +1 -1
- package/dist/{as-field-shell.vue-D-8AWUGW.d.cts → as-field-shell.vue-D0NYcajH.d.mts} +1 -1
- package/dist/as-field.cjs +1 -1
- package/dist/as-field.d.mts +1 -1
- package/dist/as-field.mjs +1 -1
- package/dist/{as-form-r5pkXt5U.cjs → as-form-B4-StU3b.cjs} +41 -43
- package/dist/{as-form-B8d1MVTB.mjs → as-form-DQePBFwR.mjs} +42 -44
- package/dist/as-form.cjs +1 -1
- package/dist/as-form.d.cts +1 -1
- package/dist/as-form.d.mts +1 -1
- package/dist/as-form.mjs +1 -1
- package/dist/{as-form.vue-D1AS3Xf6.d.mts → as-form.vue-BMNZuvpb.d.mts} +66 -54
- package/dist/{as-form.vue-BvRHy6mu.d.cts → as-form.vue-DS5r3CWl.d.cts} +66 -54
- package/dist/{as-input-tKw19JnF.mjs → as-input-D1IO72Tn.mjs} +6 -6
- package/dist/{as-input-BTbu0eF-.cjs → as-input-Dy7v1AjV.cjs} +6 -6
- package/dist/{as-input-control-1igViaqC.mjs → as-input-control-CINIJm-h.mjs} +13 -5
- package/dist/{as-input-control-uJpmle-G.cjs → as-input-control-DXJBrgih.cjs} +13 -5
- package/dist/as-input.cjs +1 -1
- package/dist/as-input.d.cts +1 -1
- package/dist/as-input.d.mts +1 -1
- package/dist/as-input.mjs +1 -1
- package/dist/{as-input.vue-CuC3DYeR.d.cts → as-input.vue-DMxFk9uv.d.cts} +1 -1
- package/dist/{as-input.vue-DawR7pA-.d.mts → as-input.vue-DzG-WB4x.d.mts} +1 -1
- package/dist/{as-iterator-B1o83rKV.mjs → as-iterator-A9ozhHhf.mjs} +2 -2
- package/dist/{as-iterator-q_w9HBHt.cjs → as-iterator-C8aJ6SUs.cjs} +2 -2
- package/dist/as-iterator.cjs +1 -1
- package/dist/as-iterator.d.mts +1 -1
- package/dist/as-iterator.mjs +1 -1
- package/dist/{as-multi-select-DPQ9_Qf1.cjs → as-multi-select-BiOEQf1L.cjs} +7 -11
- package/dist/{as-multi-select-DhOlsgdq.mjs → as-multi-select-CoT5MJd_.mjs} +8 -12
- package/dist/as-multi-select.cjs +1 -1
- package/dist/as-multi-select.d.cts +1 -1
- package/dist/as-multi-select.d.mts +1 -1
- package/dist/as-multi-select.mjs +1 -1
- package/dist/{as-multi-select.vue-CbVBJq8N.d.mts → as-multi-select.vue-CBtBFW6X.d.cts} +1 -1
- package/dist/{as-multi-select.vue-CXC47PBk.d.cts → as-multi-select.vue-CGjTCFGD.d.mts} +1 -1
- package/dist/{as-number-CVjNUjiS.mjs → as-number-Ck8nNMCB.mjs} +5 -5
- package/dist/{as-number-CJmX5rb1.cjs → as-number-DKW_PZcq.cjs} +5 -5
- package/dist/as-number.cjs +1 -1
- package/dist/as-number.d.cts +1 -1
- package/dist/as-number.d.mts +1 -1
- package/dist/as-number.mjs +1 -1
- package/dist/{as-number.vue-BdNvLZca.d.mts → as-number.vue-AKk1tllp.d.mts} +1 -1
- package/dist/{as-number.vue-hJuiJJ70.d.cts → as-number.vue-i5gytLQ2.d.cts} +1 -1
- package/dist/{as-object-DY5IEc94.mjs → as-object-6GgXdo_K.mjs} +8 -8
- package/dist/{as-object-Dq5CPM3i.cjs → as-object-DfHzCJcJ.cjs} +8 -8
- package/dist/as-object.cjs +1 -1
- package/dist/as-object.d.cts +1 -1
- package/dist/as-object.d.mts +1 -1
- package/dist/as-object.mjs +1 -1
- package/dist/{as-object.vue-DHFGLetx.d.cts → as-object.vue-Gor6cnwh.d.mts} +1 -1
- package/dist/{as-object.vue-DVK_BKOL.d.mts → as-object.vue-cwrRrJ2O.d.cts} +1 -1
- package/dist/{as-paragraph-CaytophZ.cjs → as-paragraph-DHtc4LrM.cjs} +3 -3
- package/dist/{as-paragraph-ChOqmJe2.mjs → as-paragraph-ScTsCm_J.mjs} +3 -3
- package/dist/as-paragraph.cjs +1 -1
- package/dist/as-paragraph.d.cts +1 -1
- package/dist/as-paragraph.d.mts +1 -1
- package/dist/as-paragraph.mjs +1 -1
- package/dist/{as-paragraph.vue-6mBonWFb.d.mts → as-paragraph.vue-DqHrI7WD.d.mts} +1 -1
- package/dist/{as-paragraph.vue-B_aPmK-B.d.cts → as-paragraph.vue-Ds64gwEP.d.cts} +1 -1
- package/dist/{as-radio-BW9K8h6V.mjs → as-radio-Cc3VOm3A.mjs} +4 -4
- package/dist/{as-radio-C6PnEdjD.cjs → as-radio-DLGMEC9o.cjs} +4 -4
- package/dist/as-radio.cjs +1 -1
- package/dist/as-radio.d.cts +1 -1
- package/dist/as-radio.d.mts +1 -1
- package/dist/as-radio.mjs +1 -1
- package/dist/{as-radio.vue-BFxeAHfl.d.mts → as-radio.vue-CkooFq0m.d.cts} +1 -1
- package/dist/{as-radio.vue-B_tDoVl1.d.cts → as-radio.vue-T0Ejt0II.d.mts} +1 -1
- package/dist/{as-ref-CXtYo-UZ.mjs → as-ref-Cs4i9tpS.mjs} +14 -14
- package/dist/{as-ref-DTsWT_zU.cjs → as-ref-FknTPCae.cjs} +14 -14
- package/dist/as-ref.cjs +1 -1
- package/dist/as-ref.d.cts +1 -1
- package/dist/as-ref.d.mts +1 -1
- package/dist/as-ref.mjs +1 -1
- package/dist/{as-ref.vue-CqFDKTYk.d.mts → as-ref.vue-CCzEnDNd.d.cts} +1 -1
- package/dist/{as-ref.vue-gCsaCDQx.d.cts → as-ref.vue-CvStQFs3.d.mts} +1 -1
- package/dist/{as-select-DOvo86Oc.cjs → as-select-DBxxq0jZ.cjs} +7 -16
- package/dist/{as-select-CbZNupL6.mjs → as-select-br9EmsoX.mjs} +8 -17
- package/dist/as-select.cjs +1 -1
- package/dist/as-select.d.cts +1 -1
- package/dist/as-select.d.mts +1 -1
- package/dist/as-select.mjs +1 -1
- package/dist/{as-select.vue-BN3zvSGs.d.mts → as-select.vue-CK4AWxmk.d.cts} +1 -1
- package/dist/{as-select.vue-Bh7ppdg9.d.cts → as-select.vue-LKjJASjX.d.mts} +1 -1
- package/dist/{as-time-CfnhY3Pf.cjs → as-time-BmTk1YfU.cjs} +6 -6
- package/dist/{as-time-BDpnkjy8.mjs → as-time-DTz7PrnB.mjs} +6 -6
- package/dist/as-time.cjs +1 -1
- package/dist/as-time.d.cts +1 -1
- package/dist/as-time.d.mts +1 -1
- package/dist/as-time.mjs +1 -1
- package/dist/{as-time.vue-C-ruJhmX.d.mts → as-time.vue-DTRJCO4G.d.cts} +1 -1
- package/dist/{as-time.vue-C_0z-HOS.d.cts → as-time.vue-q2i-2K0N.d.mts} +1 -1
- package/dist/{as-tuple-C5_dcvsH.cjs → as-tuple-BemXpNrJ.cjs} +22 -14
- package/dist/{as-tuple--wL64cCu.mjs → as-tuple-D3IoTMkI.mjs} +23 -15
- package/dist/as-tuple.cjs +1 -1
- package/dist/as-tuple.d.cts +1 -1
- package/dist/as-tuple.d.mts +1 -1
- package/dist/as-tuple.mjs +1 -1
- package/dist/{as-tuple.vue-BDiSN-np.d.cts → as-tuple.vue-BEY7sq9x.d.cts} +1 -1
- package/dist/{as-tuple.vue-CGWun6Iw.d.mts → as-tuple.vue-CNgBlckL.d.mts} +1 -1
- package/dist/{as-union-DAnpGBeK.mjs → as-union-CIEUE2Xd.mjs} +32 -11
- package/dist/{as-union-D3NoKN1H.cjs → as-union-DqRkSoIr.cjs} +31 -10
- package/dist/as-union.cjs +1 -1
- package/dist/as-union.d.cts +1 -1
- package/dist/as-union.d.mts +1 -1
- package/dist/as-union.mjs +1 -1
- package/dist/{as-union.vue-BpcREl7L.d.mts → as-union.vue-B3KVCUUI.d.mts} +1 -1
- package/dist/{as-union.vue-DuUeLY1X.d.cts → as-union.vue-CGk27JvO.d.cts} +1 -1
- package/dist/{as-variant-picker-CihlFH-c.mjs → as-variant-picker-O_6JNWLk.mjs} +2 -2
- package/dist/{as-variant-picker-CpCxKFtT.cjs → as-variant-picker-apxtW5rZ.cjs} +2 -2
- package/dist/index.cjs +48 -28
- package/dist/index.d.cts +23 -23
- package/dist/index.d.mts +25 -25
- package/dist/index.mjs +31 -30
- package/dist/locale.cjs +2 -0
- package/dist/locale.d.cts +2 -2
- package/dist/locale.d.mts +2 -2
- package/dist/locale.mjs +2 -1
- package/dist/{types-271BUWyf.d.mts → types-BXTpoOfM.d.cts} +112 -17
- package/dist/{types-DbjorSCn.d.cts → types-CXGcf7sO.d.mts} +112 -17
- package/dist/{use-as-date-BigwPKEs.cjs → use-as-date-CpkJjcyB.cjs} +21 -17
- package/dist/{use-as-date-iSu5NS79.mjs → use-as-date-FsgcnN9l.mjs} +21 -17
- package/dist/{use-as-model-texts-Cpx5bHJQ.mjs → use-as-model-texts-D26kn80o.mjs} +1 -1
- package/dist/{use-as-model-texts-C3V56UDt.cjs → use-as-model-texts-DR4s80Mb.cjs} +1 -1
- package/dist/{use-as-value-help-CQMUkP1r.cjs → use-as-value-help-CIvYUvdk.cjs} +57 -29
- package/dist/{use-as-value-help-DE8KCbqo.mjs → use-as-value-help-b4tk3NRF.mjs} +53 -31
- package/dist/{use-form-context-U6vg1uqK.cjs → use-form-context-BPlkQwkM.cjs} +16 -0
- package/dist/{use-form-context-0FtVVTvf.mjs → use-form-context-D_ejQqCc.mjs} +12 -2
- package/dist/{use-as-locale-D4NDG8Vg.d.mts → use-value-help-texts-BL1qfGA2.d.cts} +26 -2
- package/dist/use-value-help-texts-LySFdZya.mjs +52 -0
- package/dist/{use-as-locale-CtvT6oO5.d.cts → use-value-help-texts-fzgKU4NG.d.mts} +26 -2
- package/dist/use-value-help-texts-ikiPKy-U.cjs +57 -0
- package/package.json +9 -9
- /package/dist/{_editing-hold-D2uqwszu.cjs → _editing-hold-DbM25sc_.cjs} +0 -0
- /package/dist/{_editing-hold-D_X5gXHh.mjs → _editing-hold-s65mkJu2.mjs} +0 -0
- /package/dist/{_shape-A661ZxnJ.mjs → _shape-CnW2sBRs.mjs} +0 -0
- /package/dist/{_shape-7OdPsQao.cjs → _shape-DPDZTV_T.cjs} +0 -0
- /package/dist/{as-adornment-shell-CBaksXGT.mjs → as-adornment-shell-C_z_q-mz.mjs} +0 -0
- /package/dist/{as-adornment-shell-CmS9BOFm.cjs → as-adornment-shell-CgwCACXA.cjs} +0 -0
- /package/dist/{as-field.vue-BWaTLJd6.d.mts → as-field.vue-BMg2Ep8h.d.mts} +0 -0
- /package/dist/{as-iterator.vue-BUCohjxw.d.mts → as-iterator.vue-BdUxcovH.d.mts} +0 -0
- /package/dist/{use-as-optional-add-flow-DMDd4Ms0.cjs → use-as-optional-add-flow-CsUjhfkc.cjs} +0 -0
- /package/dist/{use-as-optional-add-flow-C1Ol6KO2.mjs → use-as-optional-add-flow-WA-R6yXz.mjs} +0 -0
- /package/dist/{variant-label-_GLezszT.cjs → variant-label-CSzBE4T6.cjs} +0 -0
- /package/dist/{variant-label-CmzTQC2B.mjs → variant-label-Drm3s-28.mjs} +0 -0
package/dist/as-radio.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-radio.vue-
|
|
1
|
+
import { t as _default } from "./as-radio.vue-CkooFq0m.cjs";
|
|
2
2
|
export = _default;
|
package/dist/as-radio.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-radio.vue-
|
|
1
|
+
import { t as _default } from "./as-radio.vue-T0Ejt0II.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-radio.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_radio_default } from "./as-radio-
|
|
1
|
+
import { t as as_radio_default } from "./as-radio-Cc3VOm3A.mjs";
|
|
2
2
|
export { as_radio_default as default };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { n as useAsValueHelp, t as CLIENT_FACTORY_KEY } from "./use-as-value-help-
|
|
1
|
+
import { n as useAsValueHelp, t as CLIENT_FACTORY_KEY } from "./use-as-value-help-b4tk3NRF.mjs";
|
|
2
2
|
import { o as useAsTexts } from "./use-as-locale-CznDr-7i.mjs";
|
|
3
|
-
import { r as soleRow } from "./_shape-
|
|
4
|
-
import { t as as_field_shell_default } from "./as-field-shell-
|
|
5
|
-
import { t as as_input_control_default } from "./as-input-control-
|
|
3
|
+
import { r as soleRow } from "./_shape-CnW2sBRs.mjs";
|
|
4
|
+
import { t as as_field_shell_default } from "./as-field-shell-DXbAJupk.mjs";
|
|
5
|
+
import { t as as_input_control_default } from "./as-input-control-CINIJm-h.mjs";
|
|
6
6
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, inject, mergeProps, normalizeProps, openBlock, ref, renderList, renderSlot, shallowRef, toDisplayString, unref, watch, withCtx } from "vue";
|
|
7
|
+
import { codeOf, valueHelpRowText } from "@atscript/ui";
|
|
7
8
|
import { ComboboxAnchor, ComboboxCancel, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxRoot, ComboboxViewport } from "reka-ui";
|
|
8
9
|
//#region src/components/defaults/as-ref.vue?vue&type=script&setup=true&lang.ts
|
|
9
10
|
const _hoisted_1 = {
|
|
@@ -165,9 +166,9 @@ var as_ref_default = /* @__PURE__ */ defineComponent({
|
|
|
165
166
|
type: Object,
|
|
166
167
|
required: false
|
|
167
168
|
},
|
|
168
|
-
|
|
169
|
-
type:
|
|
170
|
-
required:
|
|
169
|
+
displayText: {
|
|
170
|
+
type: Function,
|
|
171
|
+
required: true
|
|
171
172
|
},
|
|
172
173
|
singularLabel: {
|
|
173
174
|
type: String,
|
|
@@ -284,25 +285,24 @@ var as_ref_default = /* @__PURE__ */ defineComponent({
|
|
|
284
285
|
const keys = resolved?.value?.primaryKeys ?? [];
|
|
285
286
|
return (info?.columns ?? []).filter((c) => c !== info?.targetField && keys.includes(c));
|
|
286
287
|
});
|
|
288
|
+
const rowText = (item) => valueHelpRowText(resolved.value, item);
|
|
287
289
|
function itemKey(item) {
|
|
288
290
|
return [item[info.targetField], ...keyColumns.value.map((c) => item[c])].filter((v) => v !== void 0 && v !== null && v !== "").join(" · ");
|
|
289
291
|
}
|
|
290
292
|
const inputText = ref("");
|
|
291
293
|
const focused = ref(false);
|
|
292
|
-
const showsLabel = () => props.valueLabel !== void 0 && (props.readonly || !focused.value);
|
|
293
294
|
function displayValue() {
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
return v && typeof v !== "object" ? String(v) : "";
|
|
295
|
+
if (props.readonly || !focused.value) return props.displayText();
|
|
296
|
+
return codeOf(props.model.value) ?? "";
|
|
297
297
|
}
|
|
298
|
-
watch(
|
|
298
|
+
watch(props.displayText, () => {
|
|
299
299
|
if (!focused.value && !open.value) inputText.value = displayValue();
|
|
300
300
|
});
|
|
301
301
|
const inputRef = ref(null);
|
|
302
302
|
let quietFocus = false;
|
|
303
303
|
function onInputFocus() {
|
|
304
304
|
focused.value = true;
|
|
305
|
-
if (
|
|
305
|
+
if (!props.readonly) inputText.value = displayValue();
|
|
306
306
|
if (!quietFocus) listOpen.value = true;
|
|
307
307
|
}
|
|
308
308
|
function onInputBlur() {
|
|
@@ -428,7 +428,7 @@ var as_ref_default = /* @__PURE__ */ defineComponent({
|
|
|
428
428
|
class: "as-ref-item",
|
|
429
429
|
onSelect: ($event) => pickRow(item)
|
|
430
430
|
}, {
|
|
431
|
-
default: withCtx(() => [createElementVNode("span", _hoisted_3, toDisplayString(itemKey(item)), 1), createElementVNode("span", _hoisted_4, [createTextVNode(toDisplayString(item
|
|
431
|
+
default: withCtx(() => [createElementVNode("span", _hoisted_3, toDisplayString(itemKey(item)), 1), createElementVNode("span", _hoisted_4, [createTextVNode(toDisplayString(rowText(item).label) + " ", 1), rowText(item).descr ? (openBlock(), createElementBlock("span", _hoisted_5, " — " + toDisplayString(rowText(item).descr), 1)) : createCommentVNode("v-if", true)])]),
|
|
432
432
|
_: 2
|
|
433
433
|
}, 1032, ["value", "onSelect"]);
|
|
434
434
|
}), 128)), createVNode(unref(ComboboxEmpty), { class: "as-ref-status" }, {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const require_use_as_value_help = require("./use-as-value-help-
|
|
1
|
+
const require_use_as_value_help = require("./use-as-value-help-CIvYUvdk.cjs");
|
|
2
2
|
const require_use_as_locale = require("./use-as-locale-eo7FyfaZ.cjs");
|
|
3
|
-
const require__shape = require("./_shape-
|
|
4
|
-
const require_as_field_shell = require("./as-field-shell-
|
|
5
|
-
const require_as_input_control = require("./as-input-control-
|
|
3
|
+
const require__shape = require("./_shape-DPDZTV_T.cjs");
|
|
4
|
+
const require_as_field_shell = require("./as-field-shell-CMq52Z6e.cjs");
|
|
5
|
+
const require_as_input_control = require("./as-input-control-DXJBrgih.cjs");
|
|
6
6
|
let vue = require("vue");
|
|
7
|
+
let _atscript_ui = require("@atscript/ui");
|
|
7
8
|
let reka_ui = require("reka-ui");
|
|
8
9
|
//#region src/components/defaults/as-ref.vue?vue&type=script&setup=true&lang.ts
|
|
9
10
|
const _hoisted_1 = {
|
|
@@ -165,9 +166,9 @@ var as_ref_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
165
166
|
type: Object,
|
|
166
167
|
required: false
|
|
167
168
|
},
|
|
168
|
-
|
|
169
|
-
type:
|
|
170
|
-
required:
|
|
169
|
+
displayText: {
|
|
170
|
+
type: Function,
|
|
171
|
+
required: true
|
|
171
172
|
},
|
|
172
173
|
singularLabel: {
|
|
173
174
|
type: String,
|
|
@@ -284,25 +285,24 @@ var as_ref_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
284
285
|
const keys = resolved?.value?.primaryKeys ?? [];
|
|
285
286
|
return (info?.columns ?? []).filter((c) => c !== info?.targetField && keys.includes(c));
|
|
286
287
|
});
|
|
288
|
+
const rowText = (item) => (0, _atscript_ui.valueHelpRowText)(resolved.value, item);
|
|
287
289
|
function itemKey(item) {
|
|
288
290
|
return [item[info.targetField], ...keyColumns.value.map((c) => item[c])].filter((v) => v !== void 0 && v !== null && v !== "").join(" · ");
|
|
289
291
|
}
|
|
290
292
|
const inputText = (0, vue.ref)("");
|
|
291
293
|
const focused = (0, vue.ref)(false);
|
|
292
|
-
const showsLabel = () => props.valueLabel !== void 0 && (props.readonly || !focused.value);
|
|
293
294
|
function displayValue() {
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
return v && typeof v !== "object" ? String(v) : "";
|
|
295
|
+
if (props.readonly || !focused.value) return props.displayText();
|
|
296
|
+
return (0, _atscript_ui.codeOf)(props.model.value) ?? "";
|
|
297
297
|
}
|
|
298
|
-
(0, vue.watch)(
|
|
298
|
+
(0, vue.watch)(props.displayText, () => {
|
|
299
299
|
if (!focused.value && !open.value) inputText.value = displayValue();
|
|
300
300
|
});
|
|
301
301
|
const inputRef = (0, vue.ref)(null);
|
|
302
302
|
let quietFocus = false;
|
|
303
303
|
function onInputFocus() {
|
|
304
304
|
focused.value = true;
|
|
305
|
-
if (
|
|
305
|
+
if (!props.readonly) inputText.value = displayValue();
|
|
306
306
|
if (!quietFocus) listOpen.value = true;
|
|
307
307
|
}
|
|
308
308
|
function onInputBlur() {
|
|
@@ -428,7 +428,7 @@ var as_ref_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
428
428
|
class: "as-ref-item",
|
|
429
429
|
onSelect: ($event) => pickRow(item)
|
|
430
430
|
}, {
|
|
431
|
-
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", _hoisted_3, (0, vue.toDisplayString)(itemKey(item)), 1), (0, vue.createElementVNode)("span", _hoisted_4, [(0, vue.createTextVNode)((0, vue.toDisplayString)(item
|
|
431
|
+
default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", _hoisted_3, (0, vue.toDisplayString)(itemKey(item)), 1), (0, vue.createElementVNode)("span", _hoisted_4, [(0, vue.createTextVNode)((0, vue.toDisplayString)(rowText(item).label) + " ", 1), rowText(item).descr ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_5, " — " + (0, vue.toDisplayString)(rowText(item).descr), 1)) : (0, vue.createCommentVNode)("v-if", true)])]),
|
|
432
432
|
_: 2
|
|
433
433
|
}, 1032, ["value", "onSelect"]);
|
|
434
434
|
}), 128)), (0, vue.createVNode)((0, vue.unref)(reka_ui.ComboboxEmpty), { class: "as-ref-status" }, {
|
package/dist/as-ref.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_ref = require("./as-ref-
|
|
1
|
+
const require_as_ref = require("./as-ref-FknTPCae.cjs");
|
|
2
2
|
module.exports = require_as_ref.as_ref_default;
|
package/dist/as-ref.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-ref.vue-
|
|
1
|
+
import { t as _default } from "./as-ref.vue-CCzEnDNd.cjs";
|
|
2
2
|
export = _default;
|
package/dist/as-ref.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-ref.vue-
|
|
1
|
+
import { t as _default } from "./as-ref.vue-CvStQFs3.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-ref.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_ref_default } from "./as-ref-
|
|
1
|
+
import { t as as_ref_default } from "./as-ref-Cs4i9tpS.mjs";
|
|
2
2
|
export { as_ref_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require__shape = require("./_shape-
|
|
2
|
-
const require_as_field_shell = require("./as-field-shell-
|
|
1
|
+
const require__shape = require("./_shape-DPDZTV_T.cjs");
|
|
2
|
+
const require_as_field_shell = require("./as-field-shell-CMq52Z6e.cjs");
|
|
3
3
|
let vue = require("vue");
|
|
4
4
|
let _atscript_ui = require("@atscript/ui");
|
|
5
5
|
//#region src/components/defaults/as-select.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -178,9 +178,9 @@ var as_select_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
178
178
|
type: Object,
|
|
179
179
|
required: false
|
|
180
180
|
},
|
|
181
|
-
|
|
182
|
-
type:
|
|
183
|
-
required:
|
|
181
|
+
displayText: {
|
|
182
|
+
type: Function,
|
|
183
|
+
required: true
|
|
184
184
|
},
|
|
185
185
|
singularLabel: {
|
|
186
186
|
type: String,
|
|
@@ -249,29 +249,20 @@ var as_select_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
249
249
|
},
|
|
250
250
|
setup(__props) {
|
|
251
251
|
const props = __props;
|
|
252
|
-
const
|
|
253
|
-
const offersEmpty = !!props.valueHelp && !!prop && !(0, _atscript_ui.hasFieldMeta)(prop, _atscript_ui.UI_FORM_OPTIONS) && !(0, _atscript_ui.hasFieldMeta)(prop, _atscript_ui.UI_FORM_FN_OPTIONS) && (0, _atscript_ui.extractFieldLiteralOptions)(prop) === void 0 || !!props.optional && !require__shape.isTriState(props);
|
|
252
|
+
const offersEmpty = !!props.field && (0, _atscript_ui.listsDictionary)(props.field) || !!props.optional && !require__shape.isTriState(props);
|
|
254
253
|
const selected = (0, vue.computed)({
|
|
255
254
|
get: () => offersEmpty && props.model.value == null ? props.emptiedValue : props.model.value,
|
|
256
255
|
set: (v) => {
|
|
257
256
|
props.model.value = v;
|
|
258
257
|
}
|
|
259
258
|
});
|
|
260
|
-
function readonlyText() {
|
|
261
|
-
const value = props.model.value;
|
|
262
|
-
if (value === void 0 || value === null || value === "") return "";
|
|
263
|
-
if (props.valueLabel !== void 0) return props.valueLabel;
|
|
264
|
-
const key = String(value);
|
|
265
|
-
const option = props.options?.find((o) => (0, _atscript_ui.optKey)(o) === key);
|
|
266
|
-
return option === void 0 ? key : (0, _atscript_ui.optLabel)(option);
|
|
267
|
-
}
|
|
268
259
|
return (_ctx, _cache) => {
|
|
269
260
|
return (0, vue.openBlock)(), (0, vue.createBlock)(require_as_field_shell.as_field_shell_default, (0, vue.normalizeProps)((0, vue.guardReactiveProps)(_ctx.$props)), {
|
|
270
261
|
default: (0, vue.withCtx)(({ inputId }) => [__props.readonly ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createElementVNode)("input", {
|
|
271
262
|
id: inputId,
|
|
272
263
|
type: "text",
|
|
273
264
|
readonly: "",
|
|
274
|
-
value:
|
|
265
|
+
value: __props.displayText(),
|
|
275
266
|
placeholder: __props.placeholder,
|
|
276
267
|
disabled: __props.disabled,
|
|
277
268
|
"aria-required": __props.required || void 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as isTriState } from "./_shape-
|
|
2
|
-
import { t as as_field_shell_default } from "./as-field-shell-
|
|
1
|
+
import { t as isTriState } from "./_shape-CnW2sBRs.mjs";
|
|
2
|
+
import { t as as_field_shell_default } from "./as-field-shell-DXbAJupk.mjs";
|
|
3
3
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderList, toDisplayString, unref, vModelSelect, withCtx, withDirectives } from "vue";
|
|
4
|
-
import {
|
|
4
|
+
import { listsDictionary, optKey, optLabel, optionValue } from "@atscript/ui";
|
|
5
5
|
//#region src/components/defaults/as-select.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
const _hoisted_1 = [
|
|
7
7
|
"id",
|
|
@@ -178,9 +178,9 @@ var as_select_default = /* @__PURE__ */ defineComponent({
|
|
|
178
178
|
type: Object,
|
|
179
179
|
required: false
|
|
180
180
|
},
|
|
181
|
-
|
|
182
|
-
type:
|
|
183
|
-
required:
|
|
181
|
+
displayText: {
|
|
182
|
+
type: Function,
|
|
183
|
+
required: true
|
|
184
184
|
},
|
|
185
185
|
singularLabel: {
|
|
186
186
|
type: String,
|
|
@@ -249,29 +249,20 @@ var as_select_default = /* @__PURE__ */ defineComponent({
|
|
|
249
249
|
},
|
|
250
250
|
setup(__props) {
|
|
251
251
|
const props = __props;
|
|
252
|
-
const
|
|
253
|
-
const offersEmpty = !!props.valueHelp && !!prop && !hasFieldMeta(prop, UI_FORM_OPTIONS) && !hasFieldMeta(prop, UI_FORM_FN_OPTIONS) && extractFieldLiteralOptions(prop) === void 0 || !!props.optional && !isTriState(props);
|
|
252
|
+
const offersEmpty = !!props.field && listsDictionary(props.field) || !!props.optional && !isTriState(props);
|
|
254
253
|
const selected = computed({
|
|
255
254
|
get: () => offersEmpty && props.model.value == null ? props.emptiedValue : props.model.value,
|
|
256
255
|
set: (v) => {
|
|
257
256
|
props.model.value = v;
|
|
258
257
|
}
|
|
259
258
|
});
|
|
260
|
-
function readonlyText() {
|
|
261
|
-
const value = props.model.value;
|
|
262
|
-
if (value === void 0 || value === null || value === "") return "";
|
|
263
|
-
if (props.valueLabel !== void 0) return props.valueLabel;
|
|
264
|
-
const key = String(value);
|
|
265
|
-
const option = props.options?.find((o) => optKey(o) === key);
|
|
266
|
-
return option === void 0 ? key : optLabel(option);
|
|
267
|
-
}
|
|
268
259
|
return (_ctx, _cache) => {
|
|
269
260
|
return openBlock(), createBlock(as_field_shell_default, normalizeProps(guardReactiveProps(_ctx.$props)), {
|
|
270
261
|
default: withCtx(({ inputId }) => [__props.readonly ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("input", {
|
|
271
262
|
id: inputId,
|
|
272
263
|
type: "text",
|
|
273
264
|
readonly: "",
|
|
274
|
-
value:
|
|
265
|
+
value: __props.displayText(),
|
|
275
266
|
placeholder: __props.placeholder,
|
|
276
267
|
disabled: __props.disabled,
|
|
277
268
|
"aria-required": __props.required || void 0,
|
package/dist/as-select.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_select = require("./as-select-
|
|
1
|
+
const require_as_select = require("./as-select-DBxxq0jZ.cjs");
|
|
2
2
|
module.exports = require_as_select.as_select_default;
|
package/dist/as-select.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-select.vue-
|
|
1
|
+
import { t as _default } from "./as-select.vue-CK4AWxmk.cjs";
|
|
2
2
|
export = _default;
|
package/dist/as-select.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-select.vue-
|
|
1
|
+
import { t as _default } from "./as-select.vue-LKjJASjX.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-select.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_select_default } from "./as-select-
|
|
1
|
+
import { t as as_select_default } from "./as-select-br9EmsoX.mjs";
|
|
2
2
|
export { as_select_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_as_field_shell = require("./as-field-shell-
|
|
2
|
-
const require_as_adornment_shell = require("./as-adornment-shell-
|
|
3
|
-
const require_use_as_date = require("./use-as-date-
|
|
1
|
+
const require_as_field_shell = require("./as-field-shell-CMq52Z6e.cjs");
|
|
2
|
+
const require_as_adornment_shell = require("./as-adornment-shell-CgwCACXA.cjs");
|
|
3
|
+
const require_use_as_date = require("./use-as-date-CpkJjcyB.cjs");
|
|
4
4
|
let vue = require("vue");
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/components/defaults/as-time.vue
|
|
@@ -142,9 +142,9 @@ var as_time_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
142
142
|
type: Object,
|
|
143
143
|
required: false
|
|
144
144
|
},
|
|
145
|
-
|
|
146
|
-
type:
|
|
147
|
-
required:
|
|
145
|
+
displayText: {
|
|
146
|
+
type: Function,
|
|
147
|
+
required: true
|
|
148
148
|
},
|
|
149
149
|
singularLabel: {
|
|
150
150
|
type: String,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as as_field_shell_default } from "./as-field-shell-
|
|
2
|
-
import { t as as_adornment_shell_default } from "./as-adornment-shell-
|
|
3
|
-
import { n as as_date_control_default, t as useAsDate } from "./use-as-date-
|
|
1
|
+
import { t as as_field_shell_default } from "./as-field-shell-DXbAJupk.mjs";
|
|
2
|
+
import { t as as_adornment_shell_default } from "./as-adornment-shell-C_z_q-mz.mjs";
|
|
3
|
+
import { n as as_date_control_default, t as useAsDate } from "./use-as-date-FsgcnN9l.mjs";
|
|
4
4
|
import { computed, createBlock, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, unref, withCtx } from "vue";
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/components/defaults/as-time.vue
|
|
@@ -142,9 +142,9 @@ var as_time_default = /* @__PURE__ */ defineComponent({
|
|
|
142
142
|
type: Object,
|
|
143
143
|
required: false
|
|
144
144
|
},
|
|
145
|
-
|
|
146
|
-
type:
|
|
147
|
-
required:
|
|
145
|
+
displayText: {
|
|
146
|
+
type: Function,
|
|
147
|
+
required: true
|
|
148
148
|
},
|
|
149
149
|
singularLabel: {
|
|
150
150
|
type: String,
|
package/dist/as-time.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_time = require("./as-time-
|
|
1
|
+
const require_as_time = require("./as-time-BmTk1YfU.cjs");
|
|
2
2
|
module.exports = require_as_time.as_time_default;
|
package/dist/as-time.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-time.vue-
|
|
1
|
+
import { t as _default } from "./as-time.vue-DTRJCO4G.cjs";
|
|
2
2
|
export = _default;
|
package/dist/as-time.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-time.vue-
|
|
1
|
+
import { t as _default } from "./as-time.vue-q2i-2K0N.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-time.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_time_default } from "./as-time-
|
|
1
|
+
import { t as as_time_default } from "./as-time-DTz7PrnB.mjs";
|
|
2
2
|
export { as_time_default as default };
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
const require_use_form_context = require("./use-form-context-
|
|
1
|
+
const require_use_form_context = require("./use-form-context-BPlkQwkM.cjs");
|
|
2
2
|
const require_use_as_locale = require("./use-as-locale-eo7FyfaZ.cjs");
|
|
3
|
-
const require_as_field = require("./as-field-
|
|
4
|
-
const require_as_collapsible = require("./as-collapsible-
|
|
5
|
-
const require_as_variant_picker = require("./as-variant-picker-
|
|
6
|
-
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-
|
|
7
|
-
const require_as_array_clear_btn = require("./as-array-clear-btn-
|
|
3
|
+
const require_as_field = require("./as-field-CJMJJfXO.cjs");
|
|
4
|
+
const require_as_collapsible = require("./as-collapsible-Bs0LOl1t.cjs");
|
|
5
|
+
const require_as_variant_picker = require("./as-variant-picker-apxtW5rZ.cjs");
|
|
6
|
+
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-CsUjhfkc.cjs");
|
|
7
|
+
const require_as_array_clear_btn = require("./as-array-clear-btn-nYR8rEeL.cjs");
|
|
8
8
|
let vue = require("vue");
|
|
9
9
|
let _atscript_ui = require("@atscript/ui");
|
|
10
10
|
//#region src/composables/use-as-tuple.ts
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Composable for managing tuple field state. Fixed-length, position-typed; auto-fills missing
|
|
13
|
+
* positions on mount unless optional. A locked tuple — disabled or read-only, its own or a
|
|
14
|
+
* parent's (as `useAsArray`) — is neither filled nor cleared: `clear` / `fillMissing` do nothing;
|
|
15
|
+
* a required one is filled when its lock lifts.
|
|
16
|
+
*/
|
|
12
17
|
function useAsTuple(field) {
|
|
13
18
|
const { pathPrefix, getByPath, setByPath, emptyValueOf } = require_use_form_context.useFormContext("useAsTuple");
|
|
14
19
|
const handleChange = (0, vue.inject)(require_use_form_context.CHANGE_HANDLER_KEY, () => {});
|
|
20
|
+
const locked = require_use_form_context.useInheritedLock();
|
|
15
21
|
const isOptional = field.prop.optional ?? false;
|
|
16
22
|
const itemFields = [];
|
|
17
23
|
const positionLabeled = [];
|
|
@@ -31,6 +37,7 @@ function useAsTuple(field) {
|
|
|
31
37
|
return !Array.isArray(v) || v.length === 0;
|
|
32
38
|
});
|
|
33
39
|
function fillMissing() {
|
|
40
|
+
if (locked.value) return;
|
|
34
41
|
let arr = getByPath(pathPrefix.value);
|
|
35
42
|
if (!Array.isArray(arr)) {
|
|
36
43
|
arr = [];
|
|
@@ -42,13 +49,14 @@ function useAsTuple(field) {
|
|
|
42
49
|
handleChange("array-add", pathPrefix.value, tail);
|
|
43
50
|
}
|
|
44
51
|
function clear() {
|
|
45
|
-
if (!isOptional) return;
|
|
52
|
+
if (!isOptional || locked.value) return;
|
|
46
53
|
setByPath(pathPrefix.value, void 0);
|
|
47
54
|
handleChange("array-remove", pathPrefix.value, void 0);
|
|
48
55
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
if (!isOptional) {
|
|
57
|
+
(0, vue.onMounted)(fillMissing);
|
|
58
|
+
(0, vue.watch)(locked, () => fillMissing());
|
|
59
|
+
}
|
|
52
60
|
return {
|
|
53
61
|
itemFields,
|
|
54
62
|
positionLabeled,
|
|
@@ -205,9 +213,9 @@ var as_tuple_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
205
213
|
type: Object,
|
|
206
214
|
required: false
|
|
207
215
|
},
|
|
208
|
-
|
|
209
|
-
type:
|
|
210
|
-
required:
|
|
216
|
+
displayText: {
|
|
217
|
+
type: Function,
|
|
218
|
+
required: true
|
|
211
219
|
},
|
|
212
220
|
singularLabel: {
|
|
213
221
|
type: String,
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as useInheritedLock, n as useAsUnionVariant, o as CHANGE_HANDLER_KEY, r as useFormContext } from "./use-form-context-D_ejQqCc.mjs";
|
|
2
2
|
import { o as useAsTexts } from "./use-as-locale-CznDr-7i.mjs";
|
|
3
|
-
import { t as as_field_default } from "./as-field-
|
|
4
|
-
import { t as as_collapsible_default } from "./as-collapsible-
|
|
5
|
-
import { t as as_variant_picker_default } from "./as-variant-picker-
|
|
6
|
-
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-
|
|
7
|
-
import { t as as_array_clear_btn_default } from "./as-array-clear-btn-
|
|
8
|
-
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, normalizeClass, onMounted, openBlock, renderList, toDisplayString, unref, useTemplateRef, vShow, withCtx, withDirectives } from "vue";
|
|
3
|
+
import { t as as_field_default } from "./as-field-C6iquEB1.mjs";
|
|
4
|
+
import { t as as_collapsible_default } from "./as-collapsible-DOIWkQ0v.mjs";
|
|
5
|
+
import { t as as_variant_picker_default } from "./as-variant-picker-O_6JNWLk.mjs";
|
|
6
|
+
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-WA-R6yXz.mjs";
|
|
7
|
+
import { t as as_array_clear_btn_default } from "./as-array-clear-btn-BFfll2RA.mjs";
|
|
8
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, normalizeClass, onMounted, openBlock, renderList, toDisplayString, unref, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
|
|
9
9
|
import { META_LABEL, getFieldMeta } from "@atscript/ui";
|
|
10
10
|
//#region src/composables/use-as-tuple.ts
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Composable for managing tuple field state. Fixed-length, position-typed; auto-fills missing
|
|
13
|
+
* positions on mount unless optional. A locked tuple — disabled or read-only, its own or a
|
|
14
|
+
* parent's (as `useAsArray`) — is neither filled nor cleared: `clear` / `fillMissing` do nothing;
|
|
15
|
+
* a required one is filled when its lock lifts.
|
|
16
|
+
*/
|
|
12
17
|
function useAsTuple(field) {
|
|
13
18
|
const { pathPrefix, getByPath, setByPath, emptyValueOf } = useFormContext("useAsTuple");
|
|
14
19
|
const handleChange = inject(CHANGE_HANDLER_KEY, () => {});
|
|
20
|
+
const locked = useInheritedLock();
|
|
15
21
|
const isOptional = field.prop.optional ?? false;
|
|
16
22
|
const itemFields = [];
|
|
17
23
|
const positionLabeled = [];
|
|
@@ -31,6 +37,7 @@ function useAsTuple(field) {
|
|
|
31
37
|
return !Array.isArray(v) || v.length === 0;
|
|
32
38
|
});
|
|
33
39
|
function fillMissing() {
|
|
40
|
+
if (locked.value) return;
|
|
34
41
|
let arr = getByPath(pathPrefix.value);
|
|
35
42
|
if (!Array.isArray(arr)) {
|
|
36
43
|
arr = [];
|
|
@@ -42,13 +49,14 @@ function useAsTuple(field) {
|
|
|
42
49
|
handleChange("array-add", pathPrefix.value, tail);
|
|
43
50
|
}
|
|
44
51
|
function clear() {
|
|
45
|
-
if (!isOptional) return;
|
|
52
|
+
if (!isOptional || locked.value) return;
|
|
46
53
|
setByPath(pathPrefix.value, void 0);
|
|
47
54
|
handleChange("array-remove", pathPrefix.value, void 0);
|
|
48
55
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
if (!isOptional) {
|
|
57
|
+
onMounted(fillMissing);
|
|
58
|
+
watch(locked, () => fillMissing());
|
|
59
|
+
}
|
|
52
60
|
return {
|
|
53
61
|
itemFields,
|
|
54
62
|
positionLabeled,
|
|
@@ -205,9 +213,9 @@ var as_tuple_default = /* @__PURE__ */ defineComponent({
|
|
|
205
213
|
type: Object,
|
|
206
214
|
required: false
|
|
207
215
|
},
|
|
208
|
-
|
|
209
|
-
type:
|
|
210
|
-
required:
|
|
216
|
+
displayText: {
|
|
217
|
+
type: Function,
|
|
218
|
+
required: true
|
|
211
219
|
},
|
|
212
220
|
singularLabel: {
|
|
213
221
|
type: String,
|
package/dist/as-tuple.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_tuple = require("./as-tuple-
|
|
1
|
+
const require_as_tuple = require("./as-tuple-BemXpNrJ.cjs");
|
|
2
2
|
module.exports = require_as_tuple.as_tuple_default;
|
package/dist/as-tuple.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-tuple.vue-
|
|
1
|
+
import { t as _default } from "./as-tuple.vue-BEY7sq9x.cjs";
|
|
2
2
|
export = _default;
|
package/dist/as-tuple.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-tuple.vue-
|
|
1
|
+
import { t as _default } from "./as-tuple.vue-CNgBlckL.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-tuple.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_tuple_default } from "./as-tuple
|
|
1
|
+
import { t as as_tuple_default } from "./as-tuple-D3IoTMkI.mjs";
|
|
2
2
|
export { as_tuple_default as default };
|