@atscript/vue-form 0.1.152 → 0.1.154
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/_shape-CpbGJMWP.mjs +26 -0
- package/dist/_shape-JEtANIMR.cjs +37 -0
- package/dist/as-action.d.mts +1 -1
- package/dist/{as-action.vue-DOOr8wOc.d.mts → as-action.vue-yDKx8hC0.d.mts} +1 -1
- package/dist/{as-array-DCDWM-j2.mjs → as-array-CD_Z7lZV.mjs} +1 -1
- package/dist/{as-array-DzQ4o2My.cjs → as-array-CX52_z_L.cjs} +1 -1
- package/dist/as-array.cjs +1 -1
- package/dist/as-array.d.mts +1 -1
- package/dist/as-array.mjs +1 -1
- package/dist/{as-array.vue-Cd2X9Aj9.d.mts → as-array.vue-DKcxkmjP.d.mts} +1 -1
- package/dist/as-checkbox.d.mts +1 -1
- package/dist/{as-checkbox.vue-C2kipqKM.d.mts → as-checkbox.vue-BXS5v6Ru.d.mts} +1 -1
- package/dist/as-collapsible.d.mts +1 -1
- package/dist/{as-collapsible.vue-B6Bs3fZU.d.mts → as-collapsible.vue-DowxhNde.d.mts} +1 -1
- package/dist/{as-date-DPNqfBaq.cjs → as-date-DTUQP2Dc.cjs} +3 -2
- package/dist/{as-date-gGh6aNHW.mjs → as-date-DyQsn7Mu.mjs} +3 -2
- package/dist/as-date.cjs +1 -1
- package/dist/as-date.d.mts +1 -1
- package/dist/as-date.mjs +1 -1
- package/dist/{as-date.vue-BZ1cNMbN.d.mts → as-date.vue-BVvALvZ_.d.mts} +1 -1
- package/dist/{as-datetime-BDUWhEuq.cjs → as-datetime-BDJtlZLz.cjs} +3 -2
- package/dist/{as-datetime-DqXt3riD.mjs → as-datetime-CrstxtPJ.mjs} +3 -2
- package/dist/as-datetime.cjs +1 -1
- package/dist/as-datetime.d.mts +1 -1
- package/dist/as-datetime.mjs +1 -1
- package/dist/{as-datetime.vue-DLuL9Zp3.d.mts → as-datetime.vue-CCQqZsKA.d.mts} +1 -1
- package/dist/{as-decimal-BcvgGV03.cjs → as-decimal-BZWqiKXZ.cjs} +4 -19
- package/dist/{as-decimal-Ck4oZ3uK.mjs → as-decimal-Bimpnzo2.mjs} +2 -17
- package/dist/as-decimal.cjs +1 -1
- package/dist/as-decimal.d.mts +1 -1
- package/dist/as-decimal.mjs +1 -1
- package/dist/{as-decimal.vue-BfhaMuCz.d.mts → as-decimal.vue-BDfM2ICc.d.mts} +1 -1
- package/dist/{as-field-BNqrZQ5T.cjs → as-field-C_DB6Lbi.cjs} +1 -1
- package/dist/{as-field-DVC3N3Aj.mjs → as-field-DqK4Yiev.mjs} +1 -1
- package/dist/as-field-shell.d.mts +1 -1
- package/dist/{as-field-shell.vue-BDtmxN8W.d.mts → as-field-shell.vue-DisEXQI1.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-CAWAyI3M.cjs → as-form-DbSg_v0Z.cjs} +3 -3
- package/dist/{as-form-DIn-szcN.mjs → as-form-DfmlwTZL.mjs} +3 -3
- 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-DkRgc3SA.d.mts → as-form.vue-Ctj17ZG-.d.mts} +25 -4
- package/dist/{as-form.vue-B6JmG2a-.d.cts → as-form.vue-D4ivaF3s.d.cts} +24 -3
- package/dist/as-input.d.mts +1 -1
- package/dist/{as-input.vue--S9S4-N-.d.mts → as-input.vue-CL-Om6Ed.d.mts} +1 -1
- package/dist/{as-iterator-BWx3pwuW.cjs → as-iterator-DHNJwo-R.cjs} +1 -1
- package/dist/{as-iterator-reJaf7uT.mjs → as-iterator-mOyaYJiN.mjs} +1 -1
- 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.d.mts +1 -1
- package/dist/{as-multi-select.vue-DRe3VNeM.d.mts → as-multi-select.vue-5GHWrbim.d.mts} +1 -1
- package/dist/{as-number-B7zYsrwk.mjs → as-number-6DTZnVfg.mjs} +2 -1
- package/dist/{as-number-DZyfbo_R.cjs → as-number-BMsgxGQw.cjs} +2 -1
- package/dist/as-number.cjs +1 -1
- package/dist/as-number.d.mts +1 -1
- package/dist/as-number.mjs +1 -1
- package/dist/{as-number.vue-BUUl1Y_9.d.mts → as-number.vue-BiZ2B2iJ.d.mts} +1 -1
- package/dist/{as-object-DBdqrS5b.mjs → as-object-B_x-yycI.mjs} +1 -1
- package/dist/{as-object-B4WiszzH.cjs → as-object-YYxV2y77.cjs} +1 -1
- package/dist/as-object.cjs +1 -1
- package/dist/as-object.d.mts +1 -1
- package/dist/as-object.mjs +1 -1
- package/dist/{as-object.vue-pL1w2onW.d.mts → as-object.vue-Dg4IT2JT.d.mts} +1 -1
- package/dist/as-paragraph.d.mts +1 -1
- package/dist/{as-paragraph.vue-aKtn76iW.d.mts → as-paragraph.vue-Bp-MUDcH.d.mts} +1 -1
- package/dist/as-radio.d.mts +1 -1
- package/dist/{as-radio.vue-DQ9GnafC.d.mts → as-radio.vue-NmjJm8Pj.d.mts} +1 -1
- package/dist/{as-ref-CPLoPNRP.cjs → as-ref-BEhS_vo9.cjs} +1 -1
- package/dist/{as-ref-qg5EwDtk.mjs → as-ref-BWJlIf5G.mjs} +1 -1
- package/dist/as-ref.cjs +1 -1
- package/dist/as-ref.d.mts +1 -1
- package/dist/as-ref.mjs +1 -1
- package/dist/{as-ref.vue-njC9usEd.d.mts → as-ref.vue-vP2P1ePF.d.mts} +1 -1
- package/dist/as-select.d.mts +1 -1
- package/dist/{as-select.vue-DGwIGxEr.d.mts → as-select.vue-9mQ6cjW7.d.mts} +1 -1
- package/dist/{as-time-hfgmHDVL.mjs → as-time-BQ6KXMyV.mjs} +3 -2
- package/dist/{as-time-Bybj2FVd.cjs → as-time-Cu-8mKpR.cjs} +3 -2
- package/dist/as-time.cjs +1 -1
- package/dist/as-time.d.mts +1 -1
- package/dist/as-time.mjs +1 -1
- package/dist/{as-time.vue-CpQRa8tU.d.mts → as-time.vue-DGfZPnWK.d.mts} +1 -1
- package/dist/{as-tuple-Bctdt-WG.cjs → as-tuple-CfgSnsT9.cjs} +1 -1
- package/dist/{as-tuple-CnRtQniL.mjs → as-tuple-Dny4Ov_j.mjs} +1 -1
- package/dist/as-tuple.cjs +1 -1
- package/dist/as-tuple.d.mts +1 -1
- package/dist/as-tuple.mjs +1 -1
- package/dist/{as-tuple.vue-Bvlf7sFv.d.mts → as-tuple.vue-CInEbMRo.d.mts} +1 -1
- package/dist/as-union.d.mts +1 -1
- package/dist/{as-union.vue-CYgwfCd3.d.mts → as-union.vue-Bz3EO0Gg.d.mts} +1 -1
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +23 -23
- package/dist/index.mjs +14 -14
- package/dist/{use-as-value-help-CE8IP9SR.cjs → use-as-value-help-CDmkz6A7.cjs} +3 -1
- package/dist/{use-as-value-help-C_utk6AR.mjs → use-as-value-help-CYMlEubv.mjs} +5 -3
- package/package.json +9 -9
- /package/dist/{as-field.vue-BOTSEvA_.d.mts → as-field.vue-CN4gnZcq.d.mts} +0 -0
- /package/dist/{as-iterator.vue-diVHA64A.d.mts → as-iterator.vue-B0DTpqFJ.d.mts} +0 -0
- /package/dist/{types-QI-iGjsL.d.mts → types-BLoV3zIo.d.mts} +0 -0
- /package/dist/{use-as-date-BazILwxT.cjs → use-as-date-U_aHShPD.cjs} +0 -0
- /package/dist/{use-as-date-DXJhqwyJ.mjs → use-as-date-pbhMXyU8.mjs} +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/composables/_shape.ts
|
|
2
|
+
/**
|
|
3
|
+
* Match the input shape on commit: `null`/`undefined` model → write the
|
|
4
|
+
* canonical string (first-ever commit); pre-existing string → string;
|
|
5
|
+
* pre-existing number → number (caller opted into float; the precision
|
|
6
|
+
* loss is on them).
|
|
7
|
+
*
|
|
8
|
+
* Shared by `useAsDecimal` and `useAsNumber`. Not exported from the
|
|
9
|
+
* package barrel — internal helper, no public surface.
|
|
10
|
+
*/
|
|
11
|
+
function preserveShape(original, normalized) {
|
|
12
|
+
if (original === null || original === void 0) return normalized;
|
|
13
|
+
if (typeof original === "string") return normalized;
|
|
14
|
+
return Number(normalized);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The value an emptied input commits: `undefined` (omitted) on an optional
|
|
18
|
+
* field — `null` is not a value of `name?: T`, and atscript >= 0.1.103
|
|
19
|
+
* rejects it there when the field also carries `@meta.required` — else
|
|
20
|
+
* `null`. Shared by the number / decimal / date / datetime / time inputs.
|
|
21
|
+
*/
|
|
22
|
+
function committedValue(value, optional) {
|
|
23
|
+
return value === null && optional ? void 0 : value;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { preserveShape as n, committedValue as t };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/composables/_shape.ts
|
|
2
|
+
/**
|
|
3
|
+
* Match the input shape on commit: `null`/`undefined` model → write the
|
|
4
|
+
* canonical string (first-ever commit); pre-existing string → string;
|
|
5
|
+
* pre-existing number → number (caller opted into float; the precision
|
|
6
|
+
* loss is on them).
|
|
7
|
+
*
|
|
8
|
+
* Shared by `useAsDecimal` and `useAsNumber`. Not exported from the
|
|
9
|
+
* package barrel — internal helper, no public surface.
|
|
10
|
+
*/
|
|
11
|
+
function preserveShape(original, normalized) {
|
|
12
|
+
if (original === null || original === void 0) return normalized;
|
|
13
|
+
if (typeof original === "string") return normalized;
|
|
14
|
+
return Number(normalized);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The value an emptied input commits: `undefined` (omitted) on an optional
|
|
18
|
+
* field — `null` is not a value of `name?: T`, and atscript >= 0.1.103
|
|
19
|
+
* rejects it there when the field also carries `@meta.required` — else
|
|
20
|
+
* `null`. Shared by the number / decimal / date / datetime / time inputs.
|
|
21
|
+
*/
|
|
22
|
+
function committedValue(value, optional) {
|
|
23
|
+
return value === null && optional ? void 0 : value;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
Object.defineProperty(exports, "committedValue", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return committedValue;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "preserveShape", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function() {
|
|
35
|
+
return preserveShape;
|
|
36
|
+
}
|
|
37
|
+
});
|
package/dist/as-action.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-action.vue-
|
|
1
|
+
import { t as _default } from "./as-action.vue-yDKx8hC0.mjs";
|
|
2
2
|
export { _default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as CHANGE_HANDLER_KEY, n as useAsUnionVariant, r as useFormContext } from "./use-form-context-cDW2GW4-.mjs";
|
|
2
|
-
import { t as as_field_default } from "./as-field-
|
|
2
|
+
import { t as as_field_default } from "./as-field-DqK4Yiev.mjs";
|
|
3
3
|
import { t as as_collapsible_default } from "./as-collapsible-DHSlSMfY.mjs";
|
|
4
4
|
import { t as as_variant_picker_default } from "./as-variant-picker-B3GLhKyt.mjs";
|
|
5
5
|
import { t as useAsDropdown } from "./use-as-dropdown-B2Shb7wn.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_use_form_context = require("./use-form-context-B6ZnzfxG.cjs");
|
|
2
|
-
const require_as_field = require("./as-field-
|
|
2
|
+
const require_as_field = require("./as-field-C_DB6Lbi.cjs");
|
|
3
3
|
const require_as_collapsible = require("./as-collapsible-CQyuXwj9.cjs");
|
|
4
4
|
const require_as_variant_picker = require("./as-variant-picker-JlEhh7YO.cjs");
|
|
5
5
|
const require_use_as_dropdown = require("./use-as-dropdown-Bj9toVdw.cjs");
|
package/dist/as-array.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_array = require("./as-array-
|
|
1
|
+
const require_as_array = require("./as-array-CX52_z_L.cjs");
|
|
2
2
|
module.exports = require_as_array.as_array_default;
|
package/dist/as-array.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-array.vue-
|
|
1
|
+
import { t as _default } from "./as-array.vue-DKcxkmjP.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-array.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_array_default } from "./as-array-
|
|
1
|
+
import { t as as_array_default } from "./as-array-CD_Z7lZV.mjs";
|
|
2
2
|
export { as_array_default as default };
|
package/dist/as-checkbox.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-checkbox.vue-
|
|
1
|
+
import { t as _default } from "./as-checkbox.vue-BXS5v6Ru.mjs";
|
|
2
2
|
export { _default as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-collapsible.vue-
|
|
1
|
+
import { t as _default } from "./as-collapsible.vue-DowxhNde.mjs";
|
|
2
2
|
export { _default as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_as_field_shell = require("./as-field-shell-BrJpCzIA.cjs");
|
|
2
2
|
const require_as_adornment_shell = require("./as-adornment-shell-DptUMWNk.cjs");
|
|
3
|
-
const
|
|
3
|
+
const require__shape = require("./_shape-JEtANIMR.cjs");
|
|
4
|
+
const require_use_as_date = require("./use-as-date-U_aHShPD.cjs");
|
|
4
5
|
let vue = require("vue");
|
|
5
6
|
//#endregion
|
|
6
7
|
//#region src/components/defaults/as-date.vue
|
|
@@ -205,7 +206,7 @@ var as_date_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
205
206
|
modelValue: () => props.model.value,
|
|
206
207
|
kind: "date",
|
|
207
208
|
onCommit: (v) => {
|
|
208
|
-
props.model.value = v;
|
|
209
|
+
props.model.value = require__shape.committedValue(v, props.optional);
|
|
209
210
|
}
|
|
210
211
|
});
|
|
211
212
|
const shellTitle = (0, vue.computed)(() => props.currencyCode ?? props.unitCode ?? void 0);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as as_field_shell_default } from "./as-field-shell-Bxqa_ZsU.mjs";
|
|
2
2
|
import { t as as_adornment_shell_default } from "./as-adornment-shell-C4A2fnDp.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { t as committedValue } from "./_shape-CpbGJMWP.mjs";
|
|
4
|
+
import { n as as_date_control_default, t as useAsDate } from "./use-as-date-pbhMXyU8.mjs";
|
|
4
5
|
import { computed, createBlock, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, unref, withCtx } from "vue";
|
|
5
6
|
//#endregion
|
|
6
7
|
//#region src/components/defaults/as-date.vue
|
|
@@ -205,7 +206,7 @@ var as_date_default = /* @__PURE__ */ defineComponent({
|
|
|
205
206
|
modelValue: () => props.model.value,
|
|
206
207
|
kind: "date",
|
|
207
208
|
onCommit: (v) => {
|
|
208
|
-
props.model.value = v;
|
|
209
|
+
props.model.value = committedValue(v, props.optional);
|
|
209
210
|
}
|
|
210
211
|
});
|
|
211
212
|
const shellTitle = computed(() => props.currencyCode ?? props.unitCode ?? void 0);
|
package/dist/as-date.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_date = require("./as-date-
|
|
1
|
+
const require_as_date = require("./as-date-DTUQP2Dc.cjs");
|
|
2
2
|
module.exports = require_as_date.as_date_default;
|
package/dist/as-date.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-date.vue-
|
|
1
|
+
import { t as _default } from "./as-date.vue-BVvALvZ_.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-date.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_date_default } from "./as-date-
|
|
1
|
+
import { t as as_date_default } from "./as-date-DyQsn7Mu.mjs";
|
|
2
2
|
export { as_date_default as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_as_field_shell = require("./as-field-shell-BrJpCzIA.cjs");
|
|
2
2
|
const require_as_adornment_shell = require("./as-adornment-shell-DptUMWNk.cjs");
|
|
3
|
-
const
|
|
3
|
+
const require__shape = require("./_shape-JEtANIMR.cjs");
|
|
4
|
+
const require_use_as_date = require("./use-as-date-U_aHShPD.cjs");
|
|
4
5
|
let vue = require("vue");
|
|
5
6
|
//#endregion
|
|
6
7
|
//#region src/components/defaults/as-datetime.vue
|
|
@@ -205,7 +206,7 @@ var as_datetime_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
205
206
|
modelValue: () => props.model.value,
|
|
206
207
|
kind: "datetime",
|
|
207
208
|
onCommit: (v) => {
|
|
208
|
-
props.model.value = v;
|
|
209
|
+
props.model.value = require__shape.committedValue(v, props.optional);
|
|
209
210
|
}
|
|
210
211
|
});
|
|
211
212
|
const shellTitle = (0, vue.computed)(() => props.currencyCode ?? props.unitCode ?? void 0);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t as as_field_shell_default } from "./as-field-shell-Bxqa_ZsU.mjs";
|
|
2
2
|
import { t as as_adornment_shell_default } from "./as-adornment-shell-C4A2fnDp.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { t as committedValue } from "./_shape-CpbGJMWP.mjs";
|
|
4
|
+
import { n as as_date_control_default, t as useAsDate } from "./use-as-date-pbhMXyU8.mjs";
|
|
4
5
|
import { computed, createBlock, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, unref, withCtx } from "vue";
|
|
5
6
|
//#endregion
|
|
6
7
|
//#region src/components/defaults/as-datetime.vue
|
|
@@ -205,7 +206,7 @@ var as_datetime_default = /* @__PURE__ */ defineComponent({
|
|
|
205
206
|
modelValue: () => props.model.value,
|
|
206
207
|
kind: "datetime",
|
|
207
208
|
onCommit: (v) => {
|
|
208
|
-
props.model.value = v;
|
|
209
|
+
props.model.value = committedValue(v, props.optional);
|
|
209
210
|
}
|
|
210
211
|
});
|
|
211
212
|
const shellTitle = computed(() => props.currencyCode ?? props.unitCode ?? void 0);
|
package/dist/as-datetime.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_datetime = require("./as-datetime-
|
|
1
|
+
const require_as_datetime = require("./as-datetime-BDJtlZLz.cjs");
|
|
2
2
|
module.exports = require_as_datetime.as_datetime_default;
|
package/dist/as-datetime.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-datetime.vue-
|
|
1
|
+
import { t as _default } from "./as-datetime.vue-CCQqZsKA.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-datetime.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_datetime_default } from "./as-datetime-
|
|
1
|
+
import { t as as_datetime_default } from "./as-datetime-CrstxtPJ.mjs";
|
|
2
2
|
export { as_datetime_default as default };
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
const require_use_as_locale = require("./use-as-locale-C4z5stwD.cjs");
|
|
2
2
|
const require_as_field_shell = require("./as-field-shell-BrJpCzIA.cjs");
|
|
3
|
+
const require__shape = require("./_shape-JEtANIMR.cjs");
|
|
3
4
|
let vue = require("vue");
|
|
4
5
|
let _atscript_ui = require("@atscript/ui");
|
|
5
|
-
//#region src/composables/_shape.ts
|
|
6
|
-
/**
|
|
7
|
-
* Match the input shape on commit: `null`/`undefined` model → write the
|
|
8
|
-
* canonical string (first-ever commit); pre-existing string → string;
|
|
9
|
-
* pre-existing number → number (caller opted into float; the precision
|
|
10
|
-
* loss is on them).
|
|
11
|
-
*
|
|
12
|
-
* Shared by `useAsDecimal` and `useAsNumber`. Not exported from the
|
|
13
|
-
* package barrel — internal helper, no public surface.
|
|
14
|
-
*/
|
|
15
|
-
function preserveShape(original, normalized) {
|
|
16
|
-
if (original === null || original === void 0) return normalized;
|
|
17
|
-
if (typeof original === "string") return normalized;
|
|
18
|
-
return Number(normalized);
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
6
|
//#region src/composables/use-as-decimal.ts
|
|
22
7
|
/**
|
|
23
8
|
* Reactive composable for decimal-typed inputs (the `AsDecimal` SFC and
|
|
@@ -88,7 +73,7 @@ function useAsDecimal(opts) {
|
|
|
88
73
|
});
|
|
89
74
|
function commit(canonical) {
|
|
90
75
|
const padded = (0, _atscript_ui.enforceScale)(canonical, storageScale.value);
|
|
91
|
-
const shaped = preserveShape(opts.modelValue(), padded);
|
|
76
|
+
const shaped = require__shape.preserveShape(opts.modelValue(), padded);
|
|
92
77
|
opts.onCommit(shaped);
|
|
93
78
|
}
|
|
94
79
|
function setFromInput(raw) {
|
|
@@ -121,7 +106,7 @@ function useAsDecimal(opts) {
|
|
|
121
106
|
const s = typeof v === "number" ? Number.isFinite(v) ? String(v) : "" : v;
|
|
122
107
|
if (s === "") return;
|
|
123
108
|
if ((0, _atscript_ui.splitDecimalString)(s).decimal.length <= newScale) return;
|
|
124
|
-
const shaped = preserveShape(v, (0, _atscript_ui.enforceScale)((0, _atscript_ui.enforceScale)(s, newScale), storageScale.value));
|
|
109
|
+
const shaped = require__shape.preserveShape(v, (0, _atscript_ui.enforceScale)((0, _atscript_ui.enforceScale)(s, newScale), storageScale.value));
|
|
125
110
|
opts.onCommit(shaped);
|
|
126
111
|
}, { flush: "sync" });
|
|
127
112
|
return {
|
|
@@ -615,7 +600,7 @@ var as_decimal_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
615
600
|
scale: () => props.scale,
|
|
616
601
|
storageScale: () => props.precisionScale,
|
|
617
602
|
onCommit: (v) => {
|
|
618
|
-
props.model.value = v;
|
|
603
|
+
props.model.value = require__shape.committedValue(v, props.optional);
|
|
619
604
|
}
|
|
620
605
|
});
|
|
621
606
|
const { integerInput, decimalInput, integerDisplay, decimalDisplay, onIntegerFocus, onDecimalFocus, onBlurAll, onIntegerInput, onIntegerKeydown, onIntegerPaste, onDecimalInput, onDecimalKeydown, onDecimalPaste } = useAsDualInput({
|
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
import { n as useAsLocale } from "./use-as-locale-BrFdAgnU.mjs";
|
|
2
2
|
import { t as as_field_shell_default } from "./as-field-shell-Bxqa_ZsU.mjs";
|
|
3
|
+
import { n as preserveShape, t as committedValue } from "./_shape-CpbGJMWP.mjs";
|
|
3
4
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, nextTick, normalizeClass, normalizeProps, openBlock, ref, toDisplayString, unref, watch, withCtx } from "vue";
|
|
4
5
|
import { enforceScale, formatDecimalForDisplay, getDecimalSeparator, getThousandsSeparator, groupInteger, joinDecimalString, parseDecimalInput, splitDecimalString } from "@atscript/ui";
|
|
5
|
-
//#region src/composables/_shape.ts
|
|
6
|
-
/**
|
|
7
|
-
* Match the input shape on commit: `null`/`undefined` model → write the
|
|
8
|
-
* canonical string (first-ever commit); pre-existing string → string;
|
|
9
|
-
* pre-existing number → number (caller opted into float; the precision
|
|
10
|
-
* loss is on them).
|
|
11
|
-
*
|
|
12
|
-
* Shared by `useAsDecimal` and `useAsNumber`. Not exported from the
|
|
13
|
-
* package barrel — internal helper, no public surface.
|
|
14
|
-
*/
|
|
15
|
-
function preserveShape(original, normalized) {
|
|
16
|
-
if (original === null || original === void 0) return normalized;
|
|
17
|
-
if (typeof original === "string") return normalized;
|
|
18
|
-
return Number(normalized);
|
|
19
|
-
}
|
|
20
|
-
//#endregion
|
|
21
6
|
//#region src/composables/use-as-decimal.ts
|
|
22
7
|
/**
|
|
23
8
|
* Reactive composable for decimal-typed inputs (the `AsDecimal` SFC and
|
|
@@ -615,7 +600,7 @@ var as_decimal_default = /* @__PURE__ */ defineComponent({
|
|
|
615
600
|
scale: () => props.scale,
|
|
616
601
|
storageScale: () => props.precisionScale,
|
|
617
602
|
onCommit: (v) => {
|
|
618
|
-
props.model.value = v;
|
|
603
|
+
props.model.value = committedValue(v, props.optional);
|
|
619
604
|
}
|
|
620
605
|
});
|
|
621
606
|
const { integerInput, decimalInput, integerDisplay, decimalDisplay, onIntegerFocus, onDecimalFocus, onBlurAll, onIntegerInput, onIntegerKeydown, onIntegerPaste, onDecimalInput, onDecimalKeydown, onDecimalPaste } = useAsDualInput({
|
package/dist/as-decimal.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_decimal = require("./as-decimal-
|
|
1
|
+
const require_as_decimal = require("./as-decimal-BZWqiKXZ.cjs");
|
|
2
2
|
module.exports = require_as_decimal.as_decimal_default;
|
package/dist/as-decimal.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-decimal.vue-
|
|
1
|
+
import { t as _default } from "./as-decimal.vue-BDfM2ICc.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-decimal.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_decimal_default } from "./as-decimal-
|
|
1
|
+
import { t as as_decimal_default } from "./as-decimal-Bimpnzo2.mjs";
|
|
2
2
|
export { as_decimal_default as default };
|
|
@@ -448,7 +448,7 @@ var as_field_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
448
448
|
const { model, error: formError, onBlur: _onBlur, isDirty } = useAsField({
|
|
449
449
|
getValue: getModel,
|
|
450
450
|
setValue: setModel,
|
|
451
|
-
rules: [formRule],
|
|
451
|
+
rules: isDerived ? [] : [formRule],
|
|
452
452
|
path: () => absolutePath.value,
|
|
453
453
|
...props.field.prop.optional ? { resetValue: void 0 } : (0, _atscript_ui.isArrayField)(props.field) || (0, _atscript_ui.isTupleField)(props.field) ? { resetValue: [] } : (0, _atscript_ui.isObjectField)(props.field) ? { resetValue: {} } : {}
|
|
454
454
|
});
|
|
@@ -448,7 +448,7 @@ var as_field_default = /* @__PURE__ */ defineComponent({
|
|
|
448
448
|
const { model, error: formError, onBlur: _onBlur, isDirty } = useAsField({
|
|
449
449
|
getValue: getModel,
|
|
450
450
|
setValue: setModel,
|
|
451
|
-
rules: [formRule],
|
|
451
|
+
rules: isDerived ? [] : [formRule],
|
|
452
452
|
path: () => absolutePath.value,
|
|
453
453
|
...props.field.prop.optional ? { resetValue: void 0 } : isArrayField(props.field) || isTupleField(props.field) ? { resetValue: [] } : isObjectField(props.field) ? { resetValue: {} } : {}
|
|
454
454
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-field-shell.vue-
|
|
1
|
+
import { t as _default } from "./as-field-shell.vue-DisEXQI1.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-field.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_field = require("./as-field-
|
|
1
|
+
const require_as_field = require("./as-field-C_DB6Lbi.cjs");
|
|
2
2
|
module.exports = require_as_field.as_field_default;
|
package/dist/as-field.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-field.vue-
|
|
1
|
+
import { t as _default } from "./as-field.vue-CN4gnZcq.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-field.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_field_default } from "./as-field-
|
|
1
|
+
import { t as as_field_default } from "./as-field-DqK4Yiev.mjs";
|
|
2
2
|
export { as_field_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_use_form_context = require("./use-form-context-B6ZnzfxG.cjs");
|
|
2
2
|
const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-u1VgBJAP.cjs");
|
|
3
|
-
const require_use_as_value_help = require("./use-as-value-help-
|
|
4
|
-
const require_as_field = require("./as-field-
|
|
5
|
-
const require_as_iterator = require("./as-iterator-
|
|
3
|
+
const require_use_as_value_help = require("./use-as-value-help-CDmkz6A7.cjs");
|
|
4
|
+
const require_as_field = require("./as-field-C_DB6Lbi.cjs");
|
|
5
|
+
const require_as_iterator = require("./as-iterator-DHNJwo-R.cjs");
|
|
6
6
|
let vue = require("vue");
|
|
7
7
|
let _atscript_ui = require("@atscript/ui");
|
|
8
8
|
//#region src/composables/use-as-form-patch.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as TYPES_KEY, a as CHANGE_HANDLER_KEY, c as ERRORS_KEY, d as FORM_PATCH_KEY, f as FORM_STATE_KEY, g as ROOT_DATA_KEY, h as PATH_PREFIX_KEY, i as ACTION_HANDLER_KEY, l as FORM_CONTEXT_KEY, o as COMPONENTS_KEY, p as HIDE_ROOT_TITLE_KEY, s as DISMISS_EXTERNAL_AT_KEY, u as FORM_DATA_KEY } from "./use-form-context-cDW2GW4-.mjs";
|
|
2
2
|
import { i as useAsNestedSectionsStore, n as provideAsNestedSectionsStore, t as DESCENDANT_ERROR_COUNTS_KEY } from "./use-as-nested-sections-store-Dfo971PK.mjs";
|
|
3
|
-
import { t as CLIENT_FACTORY_KEY } from "./use-as-value-help-
|
|
4
|
-
import { t as as_field_default } from "./as-field-
|
|
5
|
-
import { t as as_iterator_default } from "./as-iterator-
|
|
3
|
+
import { t as CLIENT_FACTORY_KEY } from "./use-as-value-help-CYMlEubv.mjs";
|
|
4
|
+
import { t as as_field_default } from "./as-field-DqK4Yiev.mjs";
|
|
5
|
+
import { t as as_iterator_default } from "./as-iterator-mOyaYJiN.mjs";
|
|
6
6
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, isProxy, isRef, mergeProps, nextTick, normalizeProps, openBlock, provide, reactive, ref, renderSlot, shallowRef, toDisplayString, toRaw, toValue, unref, watch, watchEffect, withModifiers } from "vue";
|
|
7
7
|
import { META_DESCRIPTION, META_LABEL, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_SUBMIT_TEXT, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, collectDirtyPaths, deepClone, getByPath, getDeclaredFormActions, getFormValidator, iteratePathAncestors, mergeErrorMaps, omitPaths, resolveFormProp, setByPath, unionVariantChanged } from "@atscript/ui";
|
|
8
8
|
//#region src/composables/use-as-form-patch.ts
|
package/dist/as-form.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_form = require("./as-form-
|
|
1
|
+
const require_as_form = require("./as-form-DbSg_v0Z.cjs");
|
|
2
2
|
module.exports = require_as_form.as_form_default;
|
package/dist/as-form.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _default, t as Props } from "./as-form.vue-
|
|
1
|
+
import { n as _default, t as Props } from "./as-form.vue-D4ivaF3s.cjs";
|
|
2
2
|
export { Props, _default as default };
|
package/dist/as-form.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _default, t as Props } from "./as-form.vue-
|
|
1
|
+
import { n as _default, t as Props } from "./as-form.vue-Ctj17ZG-.mjs";
|
|
2
2
|
export { Props, _default as default };
|
package/dist/as-form.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_form_default } from "./as-form-
|
|
1
|
+
import { t as as_form_default } from "./as-form-DfmlwTZL.mjs";
|
|
2
2
|
export { as_form_default as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { c as TAsUnionContext, n as TAsChangeType, o as TAsComponentProps, s as TAsTypeComponents } from "./types-
|
|
1
|
+
import { c as TAsUnionContext, n as TAsChangeType, o as TAsComponentProps, s as TAsTypeComponents } from "./types-BLoV3zIo.mjs";
|
|
2
2
|
import * as vue from "vue";
|
|
3
3
|
import { Component, ComputedRef, MaybeRef, MaybeRefOrGetter, Ref, ShallowRef, WritableComputedRef } from "vue";
|
|
4
4
|
import * as _atscript_ui0 from "@atscript/ui";
|
|
5
5
|
import { ClientFactory, ClientFactory as ClientFactory$1, FormArrayFieldDef, FormDef, FormDiffOptions, FormDiffOptions as FormDiffOptions$1, FormFieldChange, FormFieldChange as FormFieldChange$1, FormFieldDef, FormRebaseOptions, FormRebaseOptions as FormRebaseOptions$1, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, TResolveOptions, ValueHelpInfo, getDefaultClientFactory, hasFieldMeta as hasFieldMeta$1, isFieldHidden as isFieldHidden$1, joinPath as joinPath$1, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
6
6
|
import { TFnScope } from "@atscript/ui-fns";
|
|
7
7
|
|
|
8
|
-
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.
|
|
8
|
+
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.106_@atscript+core@0.1.106_@emnapi+core@1.10.0_@emnapi+runtime_96fdb6f93c90696d3f246aeeae6df5e5/node_modules/@atscript/typescript/dist/utils.d.ts
|
|
9
9
|
interface TError {
|
|
10
10
|
path: string;
|
|
11
11
|
message: string;
|
|
@@ -33,6 +33,11 @@ interface TValidatorPluginContext {
|
|
|
33
33
|
validateAnnotatedType: Validator<any>['validateAnnotatedType'];
|
|
34
34
|
error: Validator<any>['error'];
|
|
35
35
|
path: Validator<any>['path'];
|
|
36
|
+
/**
|
|
37
|
+
* The type the validator was created for — the root of the walk, as passed to the
|
|
38
|
+
* constructor (before `replace`). The plugin's `def` argument is the node visited now.
|
|
39
|
+
*/
|
|
40
|
+
readonly root: TAtscriptAnnotatedType;
|
|
36
41
|
context: unknown;
|
|
37
42
|
}
|
|
38
43
|
/**
|
|
@@ -97,16 +102,32 @@ declare class Validator<T extends TAtscriptAnnotatedType = TAtscriptAnnotatedTyp
|
|
|
97
102
|
private get shortcuts();
|
|
98
103
|
protected validateSafe(def: TAtscriptAnnotatedType, value: any): boolean;
|
|
99
104
|
protected get path(): string;
|
|
105
|
+
/** The type this validator was created for (see {@link TValidatorPluginContext.root}). */
|
|
106
|
+
protected get root(): T;
|
|
100
107
|
protected validateAnnotatedType(def: TAtscriptAnnotatedType, value: any): boolean;
|
|
101
108
|
protected validateUnion(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Constraints annotated on the union itself (`@expect.min 0` on `number | null`)
|
|
111
|
+
* apply to the non-null value that matched `branch`, on top of the branch's own.
|
|
112
|
+
* A literal branch (an enum value) is exempt: its value is fixed.
|
|
113
|
+
*/
|
|
114
|
+
protected validateUnionConstraints(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, branch: TAtscriptAnnotatedType, value: any): boolean;
|
|
102
115
|
protected validateIntersection(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
|
|
103
116
|
protected validateTuple(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
|
|
104
117
|
protected validateArray(def: TAtscriptAnnotatedType<TAtscriptTypeArray>, value: any): boolean;
|
|
118
|
+
/** `@expect.minLength` / `maxLength` / `array.uniqueItems` checks for an array value. */
|
|
119
|
+
protected validateArrayConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: any[], of?: TAtscriptAnnotatedType): boolean;
|
|
105
120
|
protected validateObject(def: TAtscriptAnnotatedType<TAtscriptTypeObject>, value: any): boolean;
|
|
106
121
|
protected validatePrimitive(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: any): boolean;
|
|
107
122
|
protected validateString(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: string): boolean;
|
|
123
|
+
/** `@meta.required` / `@expect.minLength` / `maxLength` / `pattern` checks for a string value. */
|
|
124
|
+
protected validateStringConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: string): boolean;
|
|
108
125
|
protected validateNumber(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: number): boolean;
|
|
126
|
+
/** `@expect.int` / `min` / `max` checks for a number value. */
|
|
127
|
+
protected validateNumberConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: number): boolean;
|
|
109
128
|
protected validateBoolean(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: boolean): boolean;
|
|
129
|
+
/** `@meta.required` check for a boolean value (must be `true`). */
|
|
130
|
+
protected validateBooleanConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: boolean): boolean;
|
|
110
131
|
}
|
|
111
132
|
/** Error thrown by {@link Validator.validate} when validation fails. Contains structured error details. */
|
|
112
133
|
/** Type definition for union, intersection, or tuple types. */
|
|
@@ -1346,12 +1367,12 @@ interface Props<TF, TC> {
|
|
|
1346
1367
|
}
|
|
1347
1368
|
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<{
|
|
1348
1369
|
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
1349
|
-
|
|
1370
|
+
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1350
1371
|
onError?: ((errors: {
|
|
1351
1372
|
path: string;
|
|
1352
1373
|
message: string;
|
|
1353
1374
|
}[]) => any) | undefined;
|
|
1354
|
-
|
|
1375
|
+
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
1355
1376
|
"onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
|
|
1356
1377
|
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
1357
1378
|
}> & (typeof globalThis extends {
|
|
@@ -5,7 +5,7 @@ import * as _atscript_ui0 from "@atscript/ui";
|
|
|
5
5
|
import { ClientFactory, ClientFactory as ClientFactory$1, FormArrayFieldDef, FormDef, FormDiffOptions, FormDiffOptions as FormDiffOptions$1, FormFieldChange, FormFieldChange as FormFieldChange$1, FormFieldDef, FormRebaseOptions, FormRebaseOptions as FormRebaseOptions$1, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, TResolveOptions, ValueHelpInfo, getDefaultClientFactory, hasFieldMeta, isFieldHidden, joinPath, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
6
6
|
import { TFnScope } from "@atscript/ui-fns";
|
|
7
7
|
|
|
8
|
-
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.
|
|
8
|
+
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.106_@atscript+core@0.1.106_@emnapi+core@1.10.0_@emnapi+runtime_96fdb6f93c90696d3f246aeeae6df5e5/node_modules/@atscript/typescript/dist/utils.d.ts
|
|
9
9
|
interface TError {
|
|
10
10
|
path: string;
|
|
11
11
|
message: string;
|
|
@@ -33,6 +33,11 @@ interface TValidatorPluginContext {
|
|
|
33
33
|
validateAnnotatedType: Validator<any>['validateAnnotatedType'];
|
|
34
34
|
error: Validator<any>['error'];
|
|
35
35
|
path: Validator<any>['path'];
|
|
36
|
+
/**
|
|
37
|
+
* The type the validator was created for — the root of the walk, as passed to the
|
|
38
|
+
* constructor (before `replace`). The plugin's `def` argument is the node visited now.
|
|
39
|
+
*/
|
|
40
|
+
readonly root: TAtscriptAnnotatedType;
|
|
36
41
|
context: unknown;
|
|
37
42
|
}
|
|
38
43
|
/**
|
|
@@ -97,16 +102,32 @@ declare class Validator<T extends TAtscriptAnnotatedType = TAtscriptAnnotatedTyp
|
|
|
97
102
|
private get shortcuts();
|
|
98
103
|
protected validateSafe(def: TAtscriptAnnotatedType, value: any): boolean;
|
|
99
104
|
protected get path(): string;
|
|
105
|
+
/** The type this validator was created for (see {@link TValidatorPluginContext.root}). */
|
|
106
|
+
protected get root(): T;
|
|
100
107
|
protected validateAnnotatedType(def: TAtscriptAnnotatedType, value: any): boolean;
|
|
101
108
|
protected validateUnion(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Constraints annotated on the union itself (`@expect.min 0` on `number | null`)
|
|
111
|
+
* apply to the non-null value that matched `branch`, on top of the branch's own.
|
|
112
|
+
* A literal branch (an enum value) is exempt: its value is fixed.
|
|
113
|
+
*/
|
|
114
|
+
protected validateUnionConstraints(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, branch: TAtscriptAnnotatedType, value: any): boolean;
|
|
102
115
|
protected validateIntersection(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
|
|
103
116
|
protected validateTuple(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
|
|
104
117
|
protected validateArray(def: TAtscriptAnnotatedType<TAtscriptTypeArray>, value: any): boolean;
|
|
118
|
+
/** `@expect.minLength` / `maxLength` / `array.uniqueItems` checks for an array value. */
|
|
119
|
+
protected validateArrayConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: any[], of?: TAtscriptAnnotatedType): boolean;
|
|
105
120
|
protected validateObject(def: TAtscriptAnnotatedType<TAtscriptTypeObject>, value: any): boolean;
|
|
106
121
|
protected validatePrimitive(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: any): boolean;
|
|
107
122
|
protected validateString(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: string): boolean;
|
|
123
|
+
/** `@meta.required` / `@expect.minLength` / `maxLength` / `pattern` checks for a string value. */
|
|
124
|
+
protected validateStringConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: string): boolean;
|
|
108
125
|
protected validateNumber(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: number): boolean;
|
|
126
|
+
/** `@expect.int` / `min` / `max` checks for a number value. */
|
|
127
|
+
protected validateNumberConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: number): boolean;
|
|
109
128
|
protected validateBoolean(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: boolean): boolean;
|
|
129
|
+
/** `@meta.required` check for a boolean value (must be `true`). */
|
|
130
|
+
protected validateBooleanConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: boolean): boolean;
|
|
110
131
|
}
|
|
111
132
|
/** Error thrown by {@link Validator.validate} when validation fails. Contains structured error details. */
|
|
112
133
|
/** Type definition for union, intersection, or tuple types. */
|
|
@@ -1346,12 +1367,12 @@ interface Props<TF, TC> {
|
|
|
1346
1367
|
}
|
|
1347
1368
|
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<{
|
|
1348
1369
|
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
1349
|
-
|
|
1370
|
+
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1350
1371
|
onError?: ((errors: {
|
|
1351
1372
|
path: string;
|
|
1352
1373
|
message: string;
|
|
1353
1374
|
}[]) => any) | undefined;
|
|
1354
|
-
|
|
1375
|
+
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
1355
1376
|
"onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
|
|
1356
1377
|
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
1357
1378
|
}> & (typeof globalThis extends {
|