@atscript/vue-form 0.1.103 → 0.1.104
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-lLooKipk.cjs → as-action-B712j9xf.cjs} +4 -0
- package/dist/{as-action-BoZtbaXt.mjs → as-action-CCjN5EFP.mjs} +4 -0
- 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-BCbopk0S.d.cts → as-action.vue-BL8_a0fE.d.cts} +1 -1
- package/dist/{as-action.vue-BtQX09n-.d.mts → as-action.vue-CcOPK2qI.d.mts} +1 -1
- package/dist/{as-array-4rQYVD9_.mjs → as-array-BGG38Y1L.mjs} +5 -1
- package/dist/{as-array-C6tCzZir.cjs → as-array-DVc9_ood.cjs} +5 -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-Ci4xO292.d.cts → as-array.vue-Be1tDTdH.d.cts} +1 -1
- package/dist/{as-array.vue-I42wuF6e.d.mts → as-array.vue-CtBBY2gF.d.mts} +1 -1
- package/dist/{as-checkbox-C3i6ZmRk.mjs → as-checkbox-DwLRHmXj.mjs} +5 -1
- package/dist/{as-checkbox-oxG8_Isu.cjs → as-checkbox-sgF16SuJ.cjs} +5 -1
- 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-BoY72SV8.d.mts → as-checkbox.vue-B6zk5IbU.d.cts} +1 -1
- package/dist/{as-checkbox.vue-DqIm0ms2.d.cts → as-checkbox.vue-CXpsn_WG.d.mts} +1 -1
- package/dist/as-collapsible.d.cts +1 -18
- package/dist/as-collapsible.d.mts +1 -19
- package/dist/as-collapsible.vue-34S3TEq5.d.cts +20 -0
- package/dist/as-collapsible.vue-CIfMlTQ6.d.mts +20 -0
- package/dist/{as-date-BfISLr-e.mjs → as-date-CfCa2Kp1.mjs} +6 -2
- package/dist/{as-date-C7pJIpe-.cjs → as-date-hCCTd52o.cjs} +6 -2
- 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-BfSVrED7.d.mts → as-date.vue-BZiy1s5s.d.cts} +1 -1
- package/dist/{as-date.vue-SdlJH5fn.d.cts → as-date.vue-DWWoojir.d.mts} +1 -1
- package/dist/{as-datetime-F3In2A6l.mjs → as-datetime-B1I_zREk.mjs} +6 -2
- package/dist/{as-datetime-DFTI8Wcr.cjs → as-datetime-DDlWca2Q.cjs} +6 -2
- 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-B47V1siL.d.mts → as-datetime.vue-DYEHokj_.d.cts} +1 -1
- package/dist/{as-datetime.vue-DUp_TDOW.d.cts → as-datetime.vue-NblA-SVE.d.mts} +1 -1
- package/dist/{as-decimal-DIO8bD2Y.mjs → as-decimal-CQM5OfqB.mjs} +5 -1
- package/dist/{as-decimal-CJAHWYjW.cjs → as-decimal-DM10ycwv.cjs} +5 -1
- 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-Bhq4C1Ix.d.cts → as-decimal.vue-BoNNIhbL.d.mts} +1 -1
- package/dist/{as-decimal.vue-DitPZpS_.d.mts → as-decimal.vue-D3eGMvC0.d.cts} +1 -1
- package/dist/{as-field-DLW-csEu.mjs → as-field-5rz47opo.mjs} +10 -4
- package/dist/{as-field-shell-CW3DDHnq.cjs → as-field-shell-C4epFfvE.cjs} +29 -23
- package/dist/{as-field-shell-BHYEjGcn.mjs → as-field-shell-DLvPV8WS.mjs} +29 -23
- 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-Ct1ixFqc.d.cts → as-field-shell.vue-CLDHaWN0.d.cts} +1 -1
- package/dist/{as-field-shell.vue-K4Flr3gw.d.mts → as-field-shell.vue-DssDDSal.d.mts} +1 -1
- package/dist/{as-field-BKa4D63r.cjs → as-field-vktmRs-V.cjs} +9 -3
- package/dist/as-field.cjs +1 -1
- package/dist/as-field.d.cts +1 -24
- package/dist/as-field.d.mts +1 -25
- package/dist/as-field.mjs +1 -1
- package/dist/as-field.vue-A2cJj-Ih.d.cts +26 -0
- package/dist/as-field.vue-CmjIDgQ5.d.mts +26 -0
- package/dist/{as-form-CrMA0HdQ.cjs → as-form-B4DKpAVk.cjs} +75 -37
- package/dist/{as-form-OsyP7m-A.mjs → as-form-me0zA-52.mjs} +77 -39
- 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-D5d1Y2ff.d.cts +1425 -0
- package/dist/as-form.vue-DH3phgWP.d.mts +1425 -0
- package/dist/{as-input-CqxNYh5q.cjs → as-input-Bp1Ltp15.cjs} +6 -2
- package/dist/{as-input-D7aA22Yx.mjs → as-input-DF--i7kY.mjs} +6 -2
- package/dist/{as-input-control-BYo_dfQA.cjs → as-input-control-B7F2q99A.cjs} +4 -0
- package/dist/{as-input-control-Bx-isLZN.mjs → as-input-control-BofS4mCo.mjs} +4 -0
- 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-BHsVVncq.d.cts → as-input.vue-CCAEWqK8.d.mts} +1 -1
- package/dist/{as-input.vue-DgZrW4pc.d.mts → as-input.vue-Nc9Q3RPh.d.cts} +1 -1
- package/dist/{as-iterator-DsDKfpTh.cjs → as-iterator-Bd-bKTMY.cjs} +1 -1
- package/dist/{as-iterator-DW7giLlz.mjs → as-iterator-BjIF-O-J.mjs} +1 -1
- package/dist/as-iterator.cjs +1 -1
- package/dist/as-iterator.d.cts +1 -20
- package/dist/as-iterator.d.mts +1 -21
- package/dist/as-iterator.mjs +1 -1
- package/dist/as-iterator.vue-BZeozFr-.d.cts +22 -0
- package/dist/as-iterator.vue-C8HW6n25.d.mts +22 -0
- package/dist/{as-multi-select-DQUInqwY.cjs → as-multi-select-b1l34vP5.cjs} +5 -1
- package/dist/{as-multi-select-Bsf4Y_mv.mjs → as-multi-select-mp-aM3LV.mjs} +5 -1
- 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--bavpcN-.d.cts → as-multi-select.vue-D9mseRFm.d.cts} +1 -1
- package/dist/{as-multi-select.vue-rsDUkzxa.d.mts → as-multi-select.vue-DKpOsOmM.d.mts} +1 -1
- package/dist/{as-number-B8MCg-ph.mjs → as-number-De9zTltV.mjs} +6 -2
- package/dist/{as-number-CFdK5xjM.cjs → as-number-joydTMcJ.cjs} +6 -2
- 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-D2DrbnQu.d.cts → as-number.vue-CZC0-zs8.d.cts} +1 -1
- package/dist/{as-number.vue-Oml2y6Nt.d.mts → as-number.vue-DrvjSOdq.d.mts} +1 -1
- package/dist/{as-object-CN3KZFXO.mjs → as-object-CQMTYtcY.mjs} +5 -1
- package/dist/{as-object-B4sF9sIh.cjs → as-object-DgeItRdH.cjs} +5 -1
- 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-BljKYrMo.d.cts → as-object.vue-BItO19fw.d.mts} +1 -1
- package/dist/{as-object.vue-DAq7Kha3.d.mts → as-object.vue-DbHog5M-.d.cts} +1 -1
- package/dist/{as-paragraph-GIGj6UgL.mjs → as-paragraph-BP3-0EY4.mjs} +4 -0
- package/dist/{as-paragraph-BA-c863H.cjs → as-paragraph-CPhDTH_V.cjs} +4 -0
- 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-CBU_olev.d.mts → as-paragraph.vue-BGDpjceO.d.mts} +1 -1
- package/dist/{as-paragraph.vue-LxXA7VPD.d.cts → as-paragraph.vue-D36pdOoc.d.cts} +1 -1
- package/dist/{as-radio-BeOQdoeq.cjs → as-radio-Dlmxk1vr.cjs} +5 -1
- package/dist/{as-radio-CFaDbRPe.mjs → as-radio-SwpgM1xP.mjs} +5 -1
- 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-Dk4nlz-d.d.cts → as-radio.vue-EfrhKcBF.d.cts} +1 -1
- package/dist/{as-radio.vue-TVMliE1e.d.mts → as-radio.vue-WywkI-zY.d.mts} +1 -1
- package/dist/{as-ref-CNQgr6zE.mjs → as-ref-8JnEuan0.mjs} +5 -1
- package/dist/{as-ref-RawBvR6v.cjs → as-ref-BCpvUq8E.cjs} +5 -1
- 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-CUxxGqyg.d.mts → as-ref.vue-BD_vsu7I.d.mts} +1 -1
- package/dist/{as-ref.vue-CnzqRblA.d.cts → as-ref.vue-Cxg-A5QR.d.cts} +1 -1
- package/dist/{as-select-Cr00CPKf.mjs → as-select-C3ukCyGQ.mjs} +5 -1
- package/dist/{as-select-LJIvBPiv.cjs → as-select-CtSNZXtC.cjs} +5 -1
- 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-CKjAg-Y2.d.mts → as-select.vue-DoAG5njV.d.mts} +1 -1
- package/dist/{as-select.vue-ZZtjsmcO.d.cts → as-select.vue-hd94jaH_.d.cts} +1 -1
- package/dist/{as-time-CE2FaqZ3.mjs → as-time-QJ9YiVj9.mjs} +6 -2
- package/dist/{as-time-CqCF0pKQ.cjs → as-time-nAPtGL3t.cjs} +6 -2
- 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-BCEE4uCV.d.mts → as-time.vue-DMy_Au0C.d.cts} +1 -1
- package/dist/{as-time.vue-BUAvE5m3.d.cts → as-time.vue-DgW7qSAM.d.mts} +1 -1
- package/dist/{as-tuple-B3ysbvxB.cjs → as-tuple-CFn7aZYt.cjs} +5 -1
- package/dist/{as-tuple-CeJWgP6l.mjs → as-tuple-CJXpGGKj.mjs} +5 -1
- 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-WN7k43tv.d.mts → as-tuple.vue-BDwz5FeN.d.mts} +1 -1
- package/dist/{as-tuple.vue-cy0ThAGl.d.cts → as-tuple.vue-DZ2Soqyw.d.cts} +1 -1
- package/dist/{as-union-Djhjo69H.cjs → as-union-BDRNBacb.cjs} +4 -0
- package/dist/{as-union-BPlYyGVk.mjs → as-union-DZWgGqqM.mjs} +4 -0
- 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-AqH35ozq.d.cts → as-union.vue-D9Mh0M3_.d.mts} +1 -1
- package/dist/{as-union.vue-Ew3Bany8.d.mts → as-union.vue-DQKWNuhd.d.cts} +1 -1
- package/dist/index.cjs +22 -22
- package/dist/index.d.cts +24 -1081
- package/dist/index.d.mts +24 -1081
- package/dist/index.mjs +22 -22
- package/dist/{types-BYfe1QEF.d.cts → types-B8aPXWL5.d.cts} +13 -0
- package/dist/{types-CV9ss4UN.d.mts → types-nuUi10Kl.d.mts} +13 -0
- package/dist/{use-as-date-XLE8HBbo.mjs → use-as-date-B6RGkjjB.mjs} +4 -0
- package/dist/{use-as-date-DY8b1_V4.cjs → use-as-date-CslHBPmQ.cjs} +4 -0
- package/package.json +6 -6
- package/dist/as-form.vue-2NZSk1F9.d.mts +0 -285
- package/dist/as-form.vue-Dg_5GYWG.d.cts +0 -285
package/dist/index.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { h as PATH_PREFIX_KEY, n as useAsUnionVariant, s as DISMISS_EXTERNAL_AT_KEY, t as formatIndexedLabelParts } from "./use-form-context-D6J1WTyG.mjs";
|
|
2
|
-
import { a as useAsFormPatch, i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-
|
|
2
|
+
import { a as useAsFormPatch, i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-me0zA-52.mjs";
|
|
3
3
|
import { n as provideAsNestedSectionsStore, r as useAsNestedSectionsStore } from "./use-as-nested-sections-store-DVRmG7V0.mjs";
|
|
4
4
|
import { n as useAsValueHelp } from "./use-as-value-help-DrISSxCz.mjs";
|
|
5
|
-
import { n as useAsData, r as useAsField, t as as_field_default } from "./as-field-
|
|
5
|
+
import { n as useAsData, r as useAsField, t as as_field_default } from "./as-field-5rz47opo.mjs";
|
|
6
6
|
import { n as useAsLocale, t as provideAsLocale } from "./use-as-locale-BrFdAgnU.mjs";
|
|
7
|
-
import { t as as_iterator_default } from "./as-iterator-
|
|
7
|
+
import { t as as_iterator_default } from "./as-iterator-BjIF-O-J.mjs";
|
|
8
8
|
import { n as focusNewFocusableAfter, r as useAsFocusFirstAfter, t as focusFirstAfter } from "./focus-after-toggle-Dtl3P6CS.mjs";
|
|
9
9
|
import { t as as_collapsible_default } from "./as-collapsible-DFTzB5Ar.mjs";
|
|
10
|
-
import { t as as_field_shell_default } from "./as-field-shell-
|
|
10
|
+
import { t as as_field_shell_default } from "./as-field-shell-DLvPV8WS.mjs";
|
|
11
11
|
import { t as useAsDropdown } from "./use-as-dropdown-B2Shb7wn.mjs";
|
|
12
|
-
import { t as as_input_default } from "./as-input-
|
|
13
|
-
import { t as as_select_default } from "./as-select-
|
|
14
|
-
import { t as as_multi_select_default } from "./as-multi-select-
|
|
15
|
-
import { t as as_radio_default } from "./as-radio-
|
|
16
|
-
import { n as useAsTriStateCheckbox, t as as_checkbox_default } from "./as-checkbox-
|
|
17
|
-
import { t as as_paragraph_default } from "./as-paragraph-
|
|
18
|
-
import { t as as_action_default } from "./as-action-
|
|
12
|
+
import { t as as_input_default } from "./as-input-DF--i7kY.mjs";
|
|
13
|
+
import { t as as_select_default } from "./as-select-C3ukCyGQ.mjs";
|
|
14
|
+
import { t as as_multi_select_default } from "./as-multi-select-mp-aM3LV.mjs";
|
|
15
|
+
import { t as as_radio_default } from "./as-radio-SwpgM1xP.mjs";
|
|
16
|
+
import { n as useAsTriStateCheckbox, t as as_checkbox_default } from "./as-checkbox-DwLRHmXj.mjs";
|
|
17
|
+
import { t as as_paragraph_default } from "./as-paragraph-BP3-0EY4.mjs";
|
|
18
|
+
import { t as as_action_default } from "./as-action-CCjN5EFP.mjs";
|
|
19
19
|
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-B_gr8sX-.mjs";
|
|
20
|
-
import { t as as_object_default } from "./as-object-
|
|
21
|
-
import { n as useAsArray, t as as_array_default } from "./as-array-
|
|
22
|
-
import { n as useAsTypeMap, r as useAsUnion, t as as_union_default } from "./as-union-
|
|
23
|
-
import { n as useAsTuple, t as as_tuple_default } from "./as-tuple-
|
|
24
|
-
import { t as as_ref_default } from "./as-ref-
|
|
25
|
-
import { n as useAsDualInput, r as useAsDecimal, t as as_decimal_default } from "./as-decimal-
|
|
26
|
-
import { n as useAsNumber, t as as_number_default } from "./as-number-
|
|
27
|
-
import { t as useAsDate } from "./use-as-date-
|
|
28
|
-
import { t as as_date_default } from "./as-date-
|
|
29
|
-
import { t as as_datetime_default } from "./as-datetime-
|
|
30
|
-
import { t as as_time_default } from "./as-time-
|
|
20
|
+
import { t as as_object_default } from "./as-object-CQMTYtcY.mjs";
|
|
21
|
+
import { n as useAsArray, t as as_array_default } from "./as-array-BGG38Y1L.mjs";
|
|
22
|
+
import { n as useAsTypeMap, r as useAsUnion, t as as_union_default } from "./as-union-DZWgGqqM.mjs";
|
|
23
|
+
import { n as useAsTuple, t as as_tuple_default } from "./as-tuple-CJXpGGKj.mjs";
|
|
24
|
+
import { t as as_ref_default } from "./as-ref-8JnEuan0.mjs";
|
|
25
|
+
import { n as useAsDualInput, r as useAsDecimal, t as as_decimal_default } from "./as-decimal-CQM5OfqB.mjs";
|
|
26
|
+
import { n as useAsNumber, t as as_number_default } from "./as-number-De9zTltV.mjs";
|
|
27
|
+
import { t as useAsDate } from "./use-as-date-B6RGkjjB.mjs";
|
|
28
|
+
import { t as as_date_default } from "./as-date-CfCa2Kp1.mjs";
|
|
29
|
+
import { t as as_datetime_default } from "./as-datetime-B1I_zREk.mjs";
|
|
30
|
+
import { t as as_time_default } from "./as-time-QJ9YiVj9.mjs";
|
|
31
31
|
import { computed, inject, reactive } from "vue";
|
|
32
32
|
import { createFormData, createFormDef, createFormValueResolver, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
33
33
|
//#region src/composables/create-as-form-def.ts
|
|
@@ -164,6 +164,19 @@ interface TAsComponentProps<V = unknown> extends TAsBaseComponentProps {
|
|
|
164
164
|
* annotation is present on the prop.
|
|
165
165
|
*/
|
|
166
166
|
hasAdornment?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Whether this field has changed since the change-tracking baseline.
|
|
169
|
+
*
|
|
170
|
+
* `true` only when the enclosing `<AsForm>` has `track-changes` enabled AND
|
|
171
|
+
* this field's value differs from the baseline; `false` (or absent) when
|
|
172
|
+
* tracking is off. AsField resolves it from the change list and surfaces it
|
|
173
|
+
* here so default components — and custom swaps — can drive a visual hook
|
|
174
|
+
* (the default `AsFieldShell` paints a `data-dirty` attribute from it) without
|
|
175
|
+
* re-deriving the predicate. Granularity matches the change list: object /
|
|
176
|
+
* section containers light up via their leaves; whole-array fields exactly;
|
|
177
|
+
* an array-ITEM field stays `false` (the array container lights up instead).
|
|
178
|
+
*/
|
|
179
|
+
isDirty?: boolean;
|
|
167
180
|
}
|
|
168
181
|
/**
|
|
169
182
|
* Public emits contract for custom field components used with `AsForm` /
|
|
@@ -164,6 +164,19 @@ interface TAsComponentProps<V = unknown> extends TAsBaseComponentProps {
|
|
|
164
164
|
* annotation is present on the prop.
|
|
165
165
|
*/
|
|
166
166
|
hasAdornment?: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Whether this field has changed since the change-tracking baseline.
|
|
169
|
+
*
|
|
170
|
+
* `true` only when the enclosing `<AsForm>` has `track-changes` enabled AND
|
|
171
|
+
* this field's value differs from the baseline; `false` (or absent) when
|
|
172
|
+
* tracking is off. AsField resolves it from the change list and surfaces it
|
|
173
|
+
* here so default components — and custom swaps — can drive a visual hook
|
|
174
|
+
* (the default `AsFieldShell` paints a `data-dirty` attribute from it) without
|
|
175
|
+
* re-deriving the predicate. Granularity matches the change list: object /
|
|
176
|
+
* section containers light up via their leaves; whole-array fields exactly;
|
|
177
|
+
* an array-ITEM field stays `false` (the array container lights up instead).
|
|
178
|
+
*/
|
|
179
|
+
isDirty?: boolean;
|
|
167
180
|
}
|
|
168
181
|
/**
|
|
169
182
|
* Public emits contract for custom field components used with `AsForm` /
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/vue-form",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.104",
|
|
4
4
|
"description": "Type-driven form rendering for Atscript with Vue 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -160,11 +160,11 @@
|
|
|
160
160
|
"access": "public"
|
|
161
161
|
},
|
|
162
162
|
"dependencies": {
|
|
163
|
-
"@atscript/ui": "^0.1.
|
|
163
|
+
"@atscript/ui": "^0.1.104"
|
|
164
164
|
},
|
|
165
165
|
"devDependencies": {
|
|
166
166
|
"@atscript/core": "^0.1.77",
|
|
167
|
-
"@atscript/db-client": "^0.1.
|
|
167
|
+
"@atscript/db-client": "^0.1.108",
|
|
168
168
|
"@atscript/typescript": "^0.1.77",
|
|
169
169
|
"@tsdown/css": "^0.21.4",
|
|
170
170
|
"@vitejs/plugin-vue": "^6",
|
|
@@ -176,13 +176,13 @@
|
|
|
176
176
|
"vue": "^3",
|
|
177
177
|
"vue-tsc": "~3.2.9",
|
|
178
178
|
"vunor": "^0.2.1",
|
|
179
|
-
"@atscript/ui-fns": "^0.1.
|
|
179
|
+
"@atscript/ui-fns": "^0.1.104"
|
|
180
180
|
},
|
|
181
181
|
"peerDependencies": {
|
|
182
|
-
"@atscript/db-client": "^0.1.
|
|
182
|
+
"@atscript/db-client": "^0.1.108",
|
|
183
183
|
"reka-ui": "^2.9.8",
|
|
184
184
|
"vue": "^3",
|
|
185
|
-
"@atscript/ui-fns": "^0.1.
|
|
185
|
+
"@atscript/ui-fns": "^0.1.104"
|
|
186
186
|
},
|
|
187
187
|
"scripts": {
|
|
188
188
|
"build": "node ../../scripts/gen-exports.mjs && vp pack",
|
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
import { n as TAsChangeType, o as TAsComponentProps, s as TAsTypeComponents } from "./types-CV9ss4UN.mjs";
|
|
2
|
-
import * as vue from "vue";
|
|
3
|
-
import { Component } from "vue";
|
|
4
|
-
import * as _atscript_ui0 from "@atscript/ui";
|
|
5
|
-
import { ClientFactory, FormDef } from "@atscript/ui";
|
|
6
|
-
|
|
7
|
-
//#region src/composables/types.d.ts
|
|
8
|
-
type TFormRule<TValue, TFormData, TContext> = (v: TValue, data?: TFormData, context?: TContext) => boolean | string;
|
|
9
|
-
interface TFormFieldCallbacks {
|
|
10
|
-
validate: () => boolean | string;
|
|
11
|
-
clearErrors: () => void;
|
|
12
|
-
reset: () => void;
|
|
13
|
-
setExternalError: (msg?: string) => void;
|
|
14
|
-
}
|
|
15
|
-
interface TFormFieldRegistration {
|
|
16
|
-
path: () => string;
|
|
17
|
-
callbacks: TFormFieldCallbacks;
|
|
18
|
-
}
|
|
19
|
-
interface TFormState {
|
|
20
|
-
firstSubmitHappened: boolean;
|
|
21
|
-
firstValidation: "on-change" | "touched-on-blur" | "on-blur" | "on-submit" | "none";
|
|
22
|
-
/**
|
|
23
|
-
* Fields registered AFTER `firstSubmitHappened` flipped to true. They stay
|
|
24
|
-
* in this set until either the user edits the field (model watch removes
|
|
25
|
-
* the id) or the next submit fires (set is cleared). Live validation is
|
|
26
|
-
* suppressed for these fields so a freshly-added array item doesn't render
|
|
27
|
-
* red required-field errors before the user has had a chance to type.
|
|
28
|
-
*/
|
|
29
|
-
freshFields: Set<symbol>;
|
|
30
|
-
register: (id: symbol, registration: TFormFieldRegistration) => void;
|
|
31
|
-
unregister: (id: symbol) => void;
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/components/as-form.vue.d.ts
|
|
35
|
-
interface Props<TF, TC> {
|
|
36
|
-
def: FormDef;
|
|
37
|
-
formData?: TF;
|
|
38
|
-
formContext?: TC;
|
|
39
|
-
firstValidation?: TFormState["firstValidation"];
|
|
40
|
-
components?: Record<string, Component<TAsComponentProps>>;
|
|
41
|
-
/**
|
|
42
|
-
* Type-to-component map for field rendering. Maps field types to Vue components.
|
|
43
|
-
* Must include entries for all built-in field types. Use `createDefaultTypes()`
|
|
44
|
-
* for a pre-filled map, or supply your own.
|
|
45
|
-
*/
|
|
46
|
-
types: TAsTypeComponents;
|
|
47
|
-
errors?: Record<string, string | undefined>;
|
|
48
|
-
/**
|
|
49
|
-
* Per-form client factory override. Creates `Client` instances from URL paths
|
|
50
|
-
* for FK value-help pickers inside this form. Falls back to the app-wide
|
|
51
|
-
* default (`setDefaultClientFactory`) and then to the built-in `new Client(url)`
|
|
52
|
-
* factory when unset.
|
|
53
|
-
*/
|
|
54
|
-
clientFactory?: ClientFactory;
|
|
55
|
-
/**
|
|
56
|
-
* Suppress the root field's title rendering. Use when the form is mounted
|
|
57
|
-
* inside a chrome that already shows the form's `@meta.label` (e.g. a
|
|
58
|
-
* dialog header). Nested fields keep their own headings.
|
|
59
|
-
*/
|
|
60
|
-
hideRootTitle?: boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Suppress the default submit button. Use when the host chrome owns the
|
|
63
|
-
* submit affordance (e.g. a dialog footer with its own submit button
|
|
64
|
-
* wired via HTML5 `<button form="...">`). Vue 3 treats an empty
|
|
65
|
-
* `<template #form.submit />` as "slot not provided" and falls back to
|
|
66
|
-
* the default button — this prop is the explicit way to skip it.
|
|
67
|
-
*/
|
|
68
|
-
hideSubmit?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* When true, freezes the form: the body becomes `inert` (blocks pointer
|
|
71
|
-
* events + keyboard focus) and a loading overlay paints over the entire
|
|
72
|
-
* form area. Used by `<AsWfForm>` to lock interaction during a server
|
|
73
|
-
* round-trip so the user can't edit a field whose response is racing in.
|
|
74
|
-
* Visual is shared with `<AsTable>`'s query overlay via vunor
|
|
75
|
-
* `inner-loading`.
|
|
76
|
-
*/
|
|
77
|
-
loading?: boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Enable change tracking. When set, the form captures a deep-clone baseline
|
|
80
|
-
* of its data and surfaces both a changed-fields list and an `@atscript/db`
|
|
81
|
-
* patch object. The tracking surface (`isDirty` / `changes` / `getPatch` /
|
|
82
|
-
* `getChanges`) is spread into every slot AND exposed on the component
|
|
83
|
-
* instance (template ref → `asForm.value.getPatch()`); descendants read it
|
|
84
|
-
* with `useAsFormPatch()`. Off by default — zero overhead when unset.
|
|
85
|
-
*/
|
|
86
|
-
trackChanges?: boolean;
|
|
87
|
-
}
|
|
88
|
-
declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
89
|
-
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
90
|
-
onError?: ((errors: {
|
|
91
|
-
path: string;
|
|
92
|
-
message: string;
|
|
93
|
-
}[]) => any) | undefined;
|
|
94
|
-
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
95
|
-
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
96
|
-
"onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
|
|
97
|
-
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
98
|
-
}> & (typeof globalThis extends {
|
|
99
|
-
__VLS_PROPS_FALLBACK: infer P;
|
|
100
|
-
} ? P : {});
|
|
101
|
-
expose: (exposed: vue.ShallowUnwrapRef<{
|
|
102
|
-
submit: () => void;
|
|
103
|
-
reset: () => Promise<void>; /** True when `track-changes` is on AND data differs from baseline. */
|
|
104
|
-
readonly isDirty: boolean; /** Revert-aware per-field change list (empty when tracking is off). */
|
|
105
|
-
readonly changes: _atscript_ui0.FormFieldChange[]; /** Build the `@atscript/db` patch object on demand (`{}` when off). */
|
|
106
|
-
getPatch: ((opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>) | (() => {}); /** Build the per-field change list on demand (`[]` when off). */
|
|
107
|
-
getChanges: () => _atscript_ui0.FormFieldChange[]; /** Re-baseline to current data after a successful save (no-op when off). */
|
|
108
|
-
rebase: () => void;
|
|
109
|
-
}>) => void;
|
|
110
|
-
attrs: any;
|
|
111
|
-
slots: {
|
|
112
|
-
'form.header'?: (props: {
|
|
113
|
-
title: string | undefined;
|
|
114
|
-
description: string | undefined;
|
|
115
|
-
data: TFormData;
|
|
116
|
-
errors: Record<string, string | undefined> | undefined;
|
|
117
|
-
formError: string | undefined;
|
|
118
|
-
disabled: boolean;
|
|
119
|
-
loading: boolean;
|
|
120
|
-
submitText: string;
|
|
121
|
-
submit: () => void;
|
|
122
|
-
reset: () => Promise<void>;
|
|
123
|
-
clearErrors: () => void;
|
|
124
|
-
setErrors: (errors: Record<string, string>) => void;
|
|
125
|
-
dismissError: (path: string) => void;
|
|
126
|
-
dismissFormError: () => void;
|
|
127
|
-
formContext: TFormContext | undefined;
|
|
128
|
-
isDirty: boolean;
|
|
129
|
-
changes: readonly _atscript_ui0.FormFieldChange[];
|
|
130
|
-
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
131
|
-
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
132
|
-
}) => any;
|
|
133
|
-
} & {
|
|
134
|
-
'form.before'?: (props: {
|
|
135
|
-
title: string | undefined;
|
|
136
|
-
description: string | undefined;
|
|
137
|
-
data: TFormData;
|
|
138
|
-
errors: Record<string, string | undefined> | undefined;
|
|
139
|
-
formError: string | undefined;
|
|
140
|
-
disabled: boolean;
|
|
141
|
-
loading: boolean;
|
|
142
|
-
submitText: string;
|
|
143
|
-
submit: () => void;
|
|
144
|
-
reset: () => Promise<void>;
|
|
145
|
-
clearErrors: () => void;
|
|
146
|
-
setErrors: (errors: Record<string, string>) => void;
|
|
147
|
-
dismissError: (path: string) => void;
|
|
148
|
-
dismissFormError: () => void;
|
|
149
|
-
formContext: TFormContext | undefined;
|
|
150
|
-
isDirty: boolean;
|
|
151
|
-
changes: readonly _atscript_ui0.FormFieldChange[];
|
|
152
|
-
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
153
|
-
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
154
|
-
}) => any;
|
|
155
|
-
} & {
|
|
156
|
-
'form.after'?: (props: {
|
|
157
|
-
title: string | undefined;
|
|
158
|
-
description: string | undefined;
|
|
159
|
-
data: TFormData;
|
|
160
|
-
errors: Record<string, string | undefined> | undefined;
|
|
161
|
-
formError: string | undefined;
|
|
162
|
-
disabled: boolean;
|
|
163
|
-
loading: boolean;
|
|
164
|
-
submitText: string;
|
|
165
|
-
submit: () => void;
|
|
166
|
-
reset: () => Promise<void>;
|
|
167
|
-
clearErrors: () => void;
|
|
168
|
-
setErrors: (errors: Record<string, string>) => void;
|
|
169
|
-
dismissError: (path: string) => void;
|
|
170
|
-
dismissFormError: () => void;
|
|
171
|
-
formContext: TFormContext | undefined;
|
|
172
|
-
isDirty: boolean;
|
|
173
|
-
changes: readonly _atscript_ui0.FormFieldChange[];
|
|
174
|
-
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
175
|
-
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
176
|
-
}) => any;
|
|
177
|
-
} & {
|
|
178
|
-
'form.error'?: (props: {
|
|
179
|
-
message: string;
|
|
180
|
-
dismiss: () => void;
|
|
181
|
-
title: string | undefined;
|
|
182
|
-
description: string | undefined;
|
|
183
|
-
data: TFormData;
|
|
184
|
-
errors: Record<string, string | undefined> | undefined;
|
|
185
|
-
formError: string | undefined;
|
|
186
|
-
disabled: boolean;
|
|
187
|
-
loading: boolean;
|
|
188
|
-
submitText: string;
|
|
189
|
-
submit: () => void;
|
|
190
|
-
reset: () => Promise<void>;
|
|
191
|
-
clearErrors: () => void;
|
|
192
|
-
setErrors: (errors: Record<string, string>) => void;
|
|
193
|
-
dismissError: (path: string) => void;
|
|
194
|
-
dismissFormError: () => void;
|
|
195
|
-
formContext: TFormContext | undefined;
|
|
196
|
-
isDirty: boolean;
|
|
197
|
-
changes: readonly _atscript_ui0.FormFieldChange[];
|
|
198
|
-
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
199
|
-
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
200
|
-
}) => any;
|
|
201
|
-
} & {
|
|
202
|
-
'form.submit'?: (props: {
|
|
203
|
-
text: string;
|
|
204
|
-
title: string | undefined;
|
|
205
|
-
description: string | undefined;
|
|
206
|
-
data: TFormData;
|
|
207
|
-
errors: Record<string, string | undefined> | undefined;
|
|
208
|
-
formError: string | undefined;
|
|
209
|
-
disabled: boolean;
|
|
210
|
-
loading: boolean;
|
|
211
|
-
submitText: string;
|
|
212
|
-
submit: () => void;
|
|
213
|
-
reset: () => Promise<void>;
|
|
214
|
-
clearErrors: () => void;
|
|
215
|
-
setErrors: (errors: Record<string, string>) => void;
|
|
216
|
-
dismissError: (path: string) => void;
|
|
217
|
-
dismissFormError: () => void;
|
|
218
|
-
formContext: TFormContext | undefined;
|
|
219
|
-
isDirty: boolean;
|
|
220
|
-
changes: readonly _atscript_ui0.FormFieldChange[];
|
|
221
|
-
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
222
|
-
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
223
|
-
}) => any;
|
|
224
|
-
} & {
|
|
225
|
-
'form.footer'?: (props: {
|
|
226
|
-
title: string | undefined;
|
|
227
|
-
description: string | undefined;
|
|
228
|
-
data: TFormData;
|
|
229
|
-
errors: Record<string, string | undefined> | undefined;
|
|
230
|
-
formError: string | undefined;
|
|
231
|
-
disabled: boolean;
|
|
232
|
-
loading: boolean;
|
|
233
|
-
submitText: string;
|
|
234
|
-
submit: () => void;
|
|
235
|
-
reset: () => Promise<void>;
|
|
236
|
-
clearErrors: () => void;
|
|
237
|
-
setErrors: (errors: Record<string, string>) => void;
|
|
238
|
-
dismissError: (path: string) => void;
|
|
239
|
-
dismissFormError: () => void;
|
|
240
|
-
formContext: TFormContext | undefined;
|
|
241
|
-
isDirty: boolean;
|
|
242
|
-
changes: readonly _atscript_ui0.FormFieldChange[];
|
|
243
|
-
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
244
|
-
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
245
|
-
}) => any;
|
|
246
|
-
} & {
|
|
247
|
-
'form.loading'?: (props: {
|
|
248
|
-
title: string | undefined;
|
|
249
|
-
description: string | undefined;
|
|
250
|
-
data: TFormData;
|
|
251
|
-
errors: Record<string, string | undefined> | undefined;
|
|
252
|
-
formError: string | undefined;
|
|
253
|
-
disabled: boolean;
|
|
254
|
-
loading: boolean;
|
|
255
|
-
submitText: string;
|
|
256
|
-
submit: () => void;
|
|
257
|
-
reset: () => Promise<void>;
|
|
258
|
-
clearErrors: () => void;
|
|
259
|
-
setErrors: (errors: Record<string, string>) => void;
|
|
260
|
-
dismissError: (path: string) => void;
|
|
261
|
-
dismissFormError: () => void;
|
|
262
|
-
formContext: TFormContext | undefined;
|
|
263
|
-
isDirty: boolean;
|
|
264
|
-
changes: readonly _atscript_ui0.FormFieldChange[];
|
|
265
|
-
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
266
|
-
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
267
|
-
}) => any;
|
|
268
|
-
};
|
|
269
|
-
emit: {
|
|
270
|
-
(e: "submit", data: TFormData): void;
|
|
271
|
-
(e: "error", errors: {
|
|
272
|
-
path: string;
|
|
273
|
-
message: string;
|
|
274
|
-
}[]): void;
|
|
275
|
-
(e: "action", name: string, data: TFormData): void;
|
|
276
|
-
(e: "unsupported-action", name: string, data: TFormData): void;
|
|
277
|
-
(e: "change", type: TAsChangeType, path: string, value: unknown, formData: TFormData): void;
|
|
278
|
-
};
|
|
279
|
-
}>) => vue.VNode & {
|
|
280
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
281
|
-
};
|
|
282
|
-
declare const _default: typeof __VLS_export;
|
|
283
|
-
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
284
|
-
//#endregion
|
|
285
|
-
export { TFormRule as a, TFormFieldRegistration as i, _default as n, TFormState as o, TFormFieldCallbacks as r, Props as t };
|