@atscript/vue-form 0.1.102 → 0.1.103
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-array-B_LjJ0oi.mjs → as-array-4rQYVD9_.mjs} +4 -4
- package/dist/{as-array-DAeDxzYV.cjs → as-array-C6tCzZir.cjs} +4 -4
- package/dist/as-array.cjs +1 -1
- package/dist/as-array.mjs +1 -1
- package/dist/{as-checkbox-dN1K-rJ_.mjs → as-checkbox-C3i6ZmRk.mjs} +1 -1
- package/dist/{as-checkbox-Cva4XHFW.cjs → as-checkbox-oxG8_Isu.cjs} +1 -1
- package/dist/as-checkbox.cjs +1 -1
- package/dist/as-checkbox.mjs +1 -1
- package/dist/{as-collapsible-B0rlXU0x.cjs → as-collapsible-BQ-eYR0v.cjs} +2 -2
- package/dist/{as-collapsible-DQOxKGGj.mjs → as-collapsible-DFTzB5Ar.mjs} +2 -2
- package/dist/as-collapsible.cjs +1 -1
- package/dist/as-collapsible.mjs +1 -1
- package/dist/{as-date-CsBBqja_.mjs → as-date-BfISLr-e.mjs} +1 -1
- package/dist/{as-date-Cizo8gZx.cjs → as-date-C7pJIpe-.cjs} +1 -1
- package/dist/as-date.cjs +1 -1
- package/dist/as-date.mjs +1 -1
- package/dist/{as-datetime-Cjbprmxg.cjs → as-datetime-DFTI8Wcr.cjs} +1 -1
- package/dist/{as-datetime-D_Wbrj9t.mjs → as-datetime-F3In2A6l.mjs} +1 -1
- package/dist/as-datetime.cjs +1 -1
- package/dist/as-datetime.mjs +1 -1
- package/dist/{as-decimal-DhrdOvUQ.cjs → as-decimal-CJAHWYjW.cjs} +1 -1
- package/dist/{as-decimal-DtQuZmPA.mjs → as-decimal-DIO8bD2Y.mjs} +1 -1
- package/dist/as-decimal.cjs +1 -1
- package/dist/as-decimal.mjs +1 -1
- package/dist/{as-field-DGnC4dew.cjs → as-field-BKa4D63r.cjs} +1 -1
- package/dist/{as-field-CDB-HIfz.mjs → as-field-DLW-csEu.mjs} +1 -1
- package/dist/{as-field-shell-D0mNXfQZ.mjs → as-field-shell-BHYEjGcn.mjs} +1 -1
- package/dist/{as-field-shell-zeno02I1.cjs → as-field-shell-CW3DDHnq.cjs} +1 -1
- package/dist/as-field-shell.cjs +1 -1
- package/dist/as-field-shell.mjs +1 -1
- package/dist/as-field.cjs +1 -1
- package/dist/as-field.mjs +1 -1
- package/dist/{as-form-DaAnsFVF.cjs → as-form-CrMA0HdQ.cjs} +196 -10
- package/dist/{as-form-8YNdb-49.mjs → as-form-OsyP7m-A.mjs} +193 -13
- 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-ZykHT4gZ.d.mts → as-form.vue-2NZSk1F9.d.mts} +48 -2
- package/dist/{as-form.vue-5FyX_1CQ.d.cts → as-form.vue-Dg_5GYWG.d.cts} +48 -2
- package/dist/{as-input-CwPkK9qR.cjs → as-input-CqxNYh5q.cjs} +1 -1
- package/dist/{as-input-VOGvI31W.mjs → as-input-D7aA22Yx.mjs} +1 -1
- package/dist/as-input.cjs +1 -1
- package/dist/as-input.mjs +1 -1
- package/dist/{as-iterator---gxkT-L.mjs → as-iterator-DW7giLlz.mjs} +2 -2
- package/dist/{as-iterator-BWXIzbJF.cjs → as-iterator-DsDKfpTh.cjs} +2 -2
- package/dist/as-iterator.cjs +1 -1
- package/dist/as-iterator.mjs +1 -1
- package/dist/{as-multi-select-DGipqqGz.mjs → as-multi-select-Bsf4Y_mv.mjs} +1 -1
- package/dist/{as-multi-select-D7XGZS3L.cjs → as-multi-select-DQUInqwY.cjs} +1 -1
- package/dist/as-multi-select.cjs +1 -1
- package/dist/as-multi-select.mjs +1 -1
- package/dist/{as-number-BIhBVXih.mjs → as-number-B8MCg-ph.mjs} +1 -1
- package/dist/{as-number-BQWwSipg.cjs → as-number-CFdK5xjM.cjs} +1 -1
- package/dist/as-number.cjs +1 -1
- package/dist/as-number.mjs +1 -1
- package/dist/{as-object-BJxJJM13.cjs → as-object-B4sF9sIh.cjs} +4 -4
- package/dist/{as-object-Dr7CttaK.mjs → as-object-CN3KZFXO.mjs} +4 -4
- package/dist/as-object.cjs +1 -1
- package/dist/as-object.mjs +1 -1
- package/dist/{as-radio-CdK8gCkN.cjs → as-radio-BeOQdoeq.cjs} +1 -1
- package/dist/{as-radio-DBW6XzlW.mjs → as-radio-CFaDbRPe.mjs} +1 -1
- package/dist/as-radio.cjs +1 -1
- package/dist/as-radio.mjs +1 -1
- package/dist/{as-ref-D6zp_PIG.mjs → as-ref-CNQgr6zE.mjs} +2 -2
- package/dist/{as-ref-BOAHVeR-.cjs → as-ref-RawBvR6v.cjs} +2 -2
- package/dist/as-ref.cjs +1 -1
- package/dist/as-ref.mjs +1 -1
- package/dist/{as-select-BiS6USZW.mjs → as-select-Cr00CPKf.mjs} +1 -1
- package/dist/{as-select-B2jqgF38.cjs → as-select-LJIvBPiv.cjs} +1 -1
- package/dist/as-select.cjs +1 -1
- package/dist/as-select.mjs +1 -1
- package/dist/{as-time-BN-Vc-iw.mjs → as-time-CE2FaqZ3.mjs} +1 -1
- package/dist/{as-time-DdQnNIQX.cjs → as-time-CqCF0pKQ.cjs} +1 -1
- package/dist/as-time.cjs +1 -1
- package/dist/as-time.mjs +1 -1
- package/dist/{as-tuple-DaY_Mw-y.cjs → as-tuple-B3ysbvxB.cjs} +4 -4
- package/dist/{as-tuple-BUzs7nm6.mjs → as-tuple-CeJWgP6l.mjs} +4 -4
- package/dist/as-tuple.cjs +1 -1
- package/dist/as-tuple.mjs +1 -1
- package/dist/{as-union-B5OFQLJX.mjs → as-union-BPlYyGVk.mjs} +2 -2
- package/dist/{as-union-Cz5cm7BP.cjs → as-union-Djhjo69H.cjs} +2 -2
- package/dist/as-union.cjs +1 -1
- package/dist/as-union.mjs +1 -1
- package/dist/index.cjs +25 -24
- package/dist/index.d.cts +90 -5
- package/dist/index.d.mts +90 -5
- package/dist/index.mjs +25 -25
- package/dist/{use-as-optional-add-flow-C85F2VoU.cjs → use-as-optional-add-flow-BXKiK1Kb.cjs} +1 -1
- package/dist/{use-as-optional-add-flow-CQctXLZI.mjs → use-as-optional-add-flow-B_gr8sX-.mjs} +1 -1
- package/dist/{use-form-context-bAj7UoSe.mjs → use-form-context-D6J1WTyG.mjs} +2 -1
- package/dist/{use-form-context-Dwr8Ai1v.cjs → use-form-context-DpGiGUvJ.cjs} +7 -0
- package/package.json +4 -4
- /package/dist/{use-as-nested-sections-store-jdMRxjBE.cjs → use-as-nested-sections-store--E0Ijpt5.cjs} +0 -0
- /package/dist/{use-as-nested-sections-store-lhi0z5z1.mjs → use-as-nested-sections-store-DVRmG7V0.mjs} +0 -0
- /package/dist/{use-as-value-help-uANI3zWa.cjs → use-as-value-help-BsAriqCI.cjs} +0 -0
- /package/dist/{use-as-value-help-CBykDEjZ.mjs → use-as-value-help-DrISSxCz.mjs} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_use_form_context = require("./use-form-context-
|
|
2
|
-
const require_as_iterator = require("./as-iterator-
|
|
3
|
-
const require_as_collapsible = require("./as-collapsible-
|
|
1
|
+
const require_use_form_context = require("./use-form-context-DpGiGUvJ.cjs");
|
|
2
|
+
const require_as_iterator = require("./as-iterator-DsDKfpTh.cjs");
|
|
3
|
+
const require_as_collapsible = require("./as-collapsible-BQ-eYR0v.cjs");
|
|
4
4
|
const require_as_variant_picker = require("./as-variant-picker-JlEhh7YO.cjs");
|
|
5
|
-
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-
|
|
5
|
+
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-BXKiK1Kb.cjs");
|
|
6
6
|
let vue = require("vue");
|
|
7
7
|
let _atscript_ui = require("@atscript/ui");
|
|
8
8
|
//#region src/components/defaults/as-object.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as useAsUnionVariant } from "./use-form-context-
|
|
2
|
-
import { t as as_iterator_default } from "./as-iterator
|
|
3
|
-
import { t as as_collapsible_default } from "./as-collapsible-
|
|
1
|
+
import { n as useAsUnionVariant } from "./use-form-context-D6J1WTyG.mjs";
|
|
2
|
+
import { t as as_iterator_default } from "./as-iterator-DW7giLlz.mjs";
|
|
3
|
+
import { t as as_collapsible_default } from "./as-collapsible-DFTzB5Ar.mjs";
|
|
4
4
|
import { n as as_optional_clear_default, t as as_variant_picker_default } from "./as-variant-picker-B3GLhKyt.mjs";
|
|
5
|
-
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-
|
|
5
|
+
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-B_gr8sX-.mjs";
|
|
6
6
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, useTemplateRef, vShow, withCtx, withDirectives, withModifiers } from "vue";
|
|
7
7
|
import { isObjectField } from "@atscript/ui";
|
|
8
8
|
//#region src/components/defaults/as-object.vue?vue&type=script&setup=true&lang.ts
|
package/dist/as-object.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_object = require("./as-object-
|
|
1
|
+
const require_as_object = require("./as-object-B4sF9sIh.cjs");
|
|
2
2
|
module.exports = require_as_object.as_object_default;
|
package/dist/as-object.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_object_default } from "./as-object-
|
|
1
|
+
import { t as as_object_default } from "./as-object-CN3KZFXO.mjs";
|
|
2
2
|
export { as_object_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_as_field_shell = require("./as-field-shell-
|
|
1
|
+
const require_as_field_shell = require("./as-field-shell-CW3DDHnq.cjs");
|
|
2
2
|
let vue = require("vue");
|
|
3
3
|
let _atscript_ui = require("@atscript/ui");
|
|
4
4
|
//#region src/components/defaults/as-radio.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as as_field_shell_default } from "./as-field-shell-
|
|
1
|
+
import { t as as_field_shell_default } from "./as-field-shell-BHYEjGcn.mjs";
|
|
2
2
|
import { Fragment, createBlock, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeProps, openBlock, renderList, toDisplayString, unref, vModelRadio, withCtx, withDirectives } from "vue";
|
|
3
3
|
import { optKey, optLabel } from "@atscript/ui";
|
|
4
4
|
//#region src/components/defaults/as-radio.vue?vue&type=script&setup=true&lang.ts
|
package/dist/as-radio.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_radio = require("./as-radio-
|
|
1
|
+
const require_as_radio = require("./as-radio-BeOQdoeq.cjs");
|
|
2
2
|
module.exports = require_as_radio.as_radio_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-CFaDbRPe.mjs";
|
|
2
2
|
export { as_radio_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as useAsValueHelp } from "./use-as-value-help-
|
|
2
|
-
import { t as as_field_shell_default } from "./as-field-shell-
|
|
1
|
+
import { n as useAsValueHelp } from "./use-as-value-help-DrISSxCz.mjs";
|
|
2
|
+
import { t as as_field_shell_default } from "./as-field-shell-BHYEjGcn.mjs";
|
|
3
3
|
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, ref, renderList, toDisplayString, unref, vModelText, withCtx, withDirectives } from "vue";
|
|
4
4
|
import { ComboboxAnchor, ComboboxCancel, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxRoot, ComboboxViewport } from "reka-ui";
|
|
5
5
|
//#region src/components/defaults/as-ref.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_use_as_value_help = require("./use-as-value-help-
|
|
2
|
-
const require_as_field_shell = require("./as-field-shell-
|
|
1
|
+
const require_use_as_value_help = require("./use-as-value-help-BsAriqCI.cjs");
|
|
2
|
+
const require_as_field_shell = require("./as-field-shell-CW3DDHnq.cjs");
|
|
3
3
|
let vue = require("vue");
|
|
4
4
|
let reka_ui = require("reka-ui");
|
|
5
5
|
//#region src/components/defaults/as-ref.vue?vue&type=script&setup=true&lang.ts
|
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-RawBvR6v.cjs");
|
|
2
2
|
module.exports = require_as_ref.as_ref_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-CNQgr6zE.mjs";
|
|
2
2
|
export { as_ref_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as as_field_shell_default } from "./as-field-shell-
|
|
1
|
+
import { t as as_field_shell_default } from "./as-field-shell-BHYEjGcn.mjs";
|
|
2
2
|
import { Fragment, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderList, toDisplayString, unref, vModelSelect, withCtx, withDirectives } from "vue";
|
|
3
3
|
import { optKey, optLabel } from "@atscript/ui";
|
|
4
4
|
//#region src/components/defaults/as-select.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_as_field_shell = require("./as-field-shell-
|
|
1
|
+
const require_as_field_shell = require("./as-field-shell-CW3DDHnq.cjs");
|
|
2
2
|
let vue = require("vue");
|
|
3
3
|
let _atscript_ui = require("@atscript/ui");
|
|
4
4
|
//#region src/components/defaults/as-select.vue?vue&type=script&setup=true&lang.ts
|
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-LJIvBPiv.cjs");
|
|
2
2
|
module.exports = require_as_select.as_select_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-Cr00CPKf.mjs";
|
|
2
2
|
export { as_select_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as as_field_shell_default } from "./as-field-shell-
|
|
1
|
+
import { t as as_field_shell_default } from "./as-field-shell-BHYEjGcn.mjs";
|
|
2
2
|
import { t as as_adornment_shell_default } from "./as-adornment-shell-C4A2fnDp.mjs";
|
|
3
3
|
import { n as as_date_control_default, t as useAsDate } from "./use-as-date-XLE8HBbo.mjs";
|
|
4
4
|
import { computed, createBlock, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, unref, withCtx } from "vue";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_as_field_shell = require("./as-field-shell-
|
|
1
|
+
const require_as_field_shell = require("./as-field-shell-CW3DDHnq.cjs");
|
|
2
2
|
const require_as_adornment_shell = require("./as-adornment-shell-DptUMWNk.cjs");
|
|
3
3
|
const require_use_as_date = require("./use-as-date-DY8b1_V4.cjs");
|
|
4
4
|
let vue = require("vue");
|
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-CqCF0pKQ.cjs");
|
|
2
2
|
module.exports = require_as_time.as_time_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-CE2FaqZ3.mjs";
|
|
2
2
|
export { as_time_default as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const require_use_form_context = require("./use-form-context-
|
|
2
|
-
const require_as_field = require("./as-field-
|
|
3
|
-
const require_as_collapsible = require("./as-collapsible-
|
|
1
|
+
const require_use_form_context = require("./use-form-context-DpGiGUvJ.cjs");
|
|
2
|
+
const require_as_field = require("./as-field-BKa4D63r.cjs");
|
|
3
|
+
const require_as_collapsible = require("./as-collapsible-BQ-eYR0v.cjs");
|
|
4
4
|
const require_as_variant_picker = require("./as-variant-picker-JlEhh7YO.cjs");
|
|
5
|
-
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-
|
|
5
|
+
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-BXKiK1Kb.cjs");
|
|
6
6
|
const require_as_array_clear_btn = require("./as-array-clear-btn-COfRUzeb.cjs");
|
|
7
7
|
let vue = require("vue");
|
|
8
8
|
let _atscript_ui = require("@atscript/ui");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as CHANGE_HANDLER_KEY, n as useAsUnionVariant, r as useFormContext } from "./use-form-context-
|
|
2
|
-
import { t as as_field_default } from "./as-field-
|
|
3
|
-
import { t as as_collapsible_default } from "./as-collapsible-
|
|
1
|
+
import { a as CHANGE_HANDLER_KEY, n as useAsUnionVariant, r as useFormContext } from "./use-form-context-D6J1WTyG.mjs";
|
|
2
|
+
import { t as as_field_default } from "./as-field-DLW-csEu.mjs";
|
|
3
|
+
import { t as as_collapsible_default } from "./as-collapsible-DFTzB5Ar.mjs";
|
|
4
4
|
import { t as as_variant_picker_default } from "./as-variant-picker-B3GLhKyt.mjs";
|
|
5
|
-
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-
|
|
5
|
+
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-B_gr8sX-.mjs";
|
|
6
6
|
import { t as as_array_clear_btn_default } from "./as-array-clear-btn-BY1IBwBP.mjs";
|
|
7
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, inject, normalizeClass, onMounted, openBlock, renderList, toDisplayString, unref, useTemplateRef, vShow, withCtx, withDirectives } from "vue";
|
|
8
8
|
import { META_LABEL, createFormData, createFormValueResolver, getFieldMeta } from "@atscript/ui";
|
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-B3ysbvxB.cjs");
|
|
2
2
|
module.exports = require_as_tuple.as_tuple_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-CeJWgP6l.mjs";
|
|
2
2
|
export { as_tuple_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as
|
|
1
|
+
import { _ as TYPES_KEY, a as CHANGE_HANDLER_KEY, h as PATH_PREFIX_KEY, r as useFormContext, v as UNION_CONTEXT_KEY } from "./use-form-context-D6J1WTyG.mjs";
|
|
2
2
|
import { t as useAsDropdown } from "./use-as-dropdown-B2Shb7wn.mjs";
|
|
3
|
-
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-
|
|
3
|
+
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-B_gr8sX-.mjs";
|
|
4
4
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, inject, mergeProps, normalizeClass, openBlock, provide, ref, renderList, resolveDynamicComponent, toDisplayString, unref, vShow, withDirectives } from "vue";
|
|
5
5
|
import { createFormData, createFormValueResolver, detectUnionVariant, isUnionField } from "@atscript/ui";
|
|
6
6
|
//#region src/composables/use-as-union.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_use_form_context = require("./use-form-context-
|
|
1
|
+
const require_use_form_context = require("./use-form-context-DpGiGUvJ.cjs");
|
|
2
2
|
const require_use_as_dropdown = require("./use-as-dropdown-Bj9toVdw.cjs");
|
|
3
|
-
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-
|
|
3
|
+
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-BXKiK1Kb.cjs");
|
|
4
4
|
let vue = require("vue");
|
|
5
5
|
let _atscript_ui = require("@atscript/ui");
|
|
6
6
|
//#region src/composables/use-as-union.ts
|
package/dist/as-union.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_union = require("./as-union-
|
|
1
|
+
const require_as_union = require("./as-union-Djhjo69H.cjs");
|
|
2
2
|
module.exports = require_as_union.as_union_default;
|
package/dist/as-union.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_union_default } from "./as-union-
|
|
1
|
+
import { t as as_union_default } from "./as-union-BPlYyGVk.mjs";
|
|
2
2
|
export { as_union_default as default };
|
package/dist/index.cjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_use_form_context = require("./use-form-context-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const require_as_field = require("./as-field-
|
|
2
|
+
const require_use_form_context = require("./use-form-context-DpGiGUvJ.cjs");
|
|
3
|
+
const require_as_form = require("./as-form-CrMA0HdQ.cjs");
|
|
4
|
+
const require_use_as_nested_sections_store = require("./use-as-nested-sections-store--E0Ijpt5.cjs");
|
|
5
|
+
const require_use_as_value_help = require("./use-as-value-help-BsAriqCI.cjs");
|
|
6
|
+
const require_as_field = require("./as-field-BKa4D63r.cjs");
|
|
7
7
|
const require_use_as_locale = require("./use-as-locale-C4z5stwD.cjs");
|
|
8
|
-
const require_as_iterator = require("./as-iterator-
|
|
8
|
+
const require_as_iterator = require("./as-iterator-DsDKfpTh.cjs");
|
|
9
9
|
const require_focus_after_toggle = require("./focus-after-toggle-CWxiPZWi.cjs");
|
|
10
|
-
const require_as_collapsible = require("./as-collapsible-
|
|
11
|
-
const require_as_field_shell = require("./as-field-shell-
|
|
10
|
+
const require_as_collapsible = require("./as-collapsible-BQ-eYR0v.cjs");
|
|
11
|
+
const require_as_field_shell = require("./as-field-shell-CW3DDHnq.cjs");
|
|
12
12
|
const require_use_as_dropdown = require("./use-as-dropdown-Bj9toVdw.cjs");
|
|
13
|
-
const require_as_input = require("./as-input-
|
|
14
|
-
const require_as_select = require("./as-select-
|
|
15
|
-
const require_as_multi_select = require("./as-multi-select-
|
|
16
|
-
const require_as_radio = require("./as-radio-
|
|
17
|
-
const require_as_checkbox = require("./as-checkbox-
|
|
13
|
+
const require_as_input = require("./as-input-CqxNYh5q.cjs");
|
|
14
|
+
const require_as_select = require("./as-select-LJIvBPiv.cjs");
|
|
15
|
+
const require_as_multi_select = require("./as-multi-select-DQUInqwY.cjs");
|
|
16
|
+
const require_as_radio = require("./as-radio-BeOQdoeq.cjs");
|
|
17
|
+
const require_as_checkbox = require("./as-checkbox-oxG8_Isu.cjs");
|
|
18
18
|
const require_as_paragraph = require("./as-paragraph-BA-c863H.cjs");
|
|
19
19
|
const require_as_action = require("./as-action-lLooKipk.cjs");
|
|
20
|
-
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-
|
|
21
|
-
const require_as_object = require("./as-object-
|
|
22
|
-
const require_as_array = require("./as-array-
|
|
23
|
-
const require_as_union = require("./as-union-
|
|
24
|
-
const require_as_tuple = require("./as-tuple-
|
|
25
|
-
const require_as_ref = require("./as-ref-
|
|
26
|
-
const require_as_decimal = require("./as-decimal-
|
|
27
|
-
const require_as_number = require("./as-number-
|
|
20
|
+
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-BXKiK1Kb.cjs");
|
|
21
|
+
const require_as_object = require("./as-object-B4sF9sIh.cjs");
|
|
22
|
+
const require_as_array = require("./as-array-C6tCzZir.cjs");
|
|
23
|
+
const require_as_union = require("./as-union-Djhjo69H.cjs");
|
|
24
|
+
const require_as_tuple = require("./as-tuple-B3ysbvxB.cjs");
|
|
25
|
+
const require_as_ref = require("./as-ref-RawBvR6v.cjs");
|
|
26
|
+
const require_as_decimal = require("./as-decimal-CJAHWYjW.cjs");
|
|
27
|
+
const require_as_number = require("./as-number-CFdK5xjM.cjs");
|
|
28
28
|
const require_use_as_date = require("./use-as-date-DY8b1_V4.cjs");
|
|
29
|
-
const require_as_date = require("./as-date-
|
|
30
|
-
const require_as_datetime = require("./as-datetime-
|
|
31
|
-
const require_as_time = require("./as-time-
|
|
29
|
+
const require_as_date = require("./as-date-C7pJIpe-.cjs");
|
|
30
|
+
const require_as_datetime = require("./as-datetime-DFTI8Wcr.cjs");
|
|
31
|
+
const require_as_time = require("./as-time-CqCF0pKQ.cjs");
|
|
32
32
|
let vue = require("vue");
|
|
33
33
|
let _atscript_ui = require("@atscript/ui");
|
|
34
34
|
//#region src/composables/create-as-form-def.ts
|
|
@@ -160,6 +160,7 @@ exports.useAsExternalErrors = require_as_form.useAsExternalErrors;
|
|
|
160
160
|
exports.useAsField = require_as_field.useAsField;
|
|
161
161
|
exports.useAsFocusFirstAfter = require_focus_after_toggle.useAsFocusFirstAfter;
|
|
162
162
|
exports.useAsForm = require_as_form.useAsForm;
|
|
163
|
+
exports.useAsFormPatch = require_as_form.useAsFormPatch;
|
|
163
164
|
exports.useAsLocale = require_use_as_locale.useAsLocale;
|
|
164
165
|
exports.useAsNestedSectionsStore = require_use_as_nested_sections_store.useAsNestedSectionsStore;
|
|
165
166
|
exports.useAsNumber = require_as_number.useAsNumber;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as TAsComponentEmits, c as TAsUnionContext, i as TAsCollapsibleSlots, n as TAsChangeType, o as TAsComponentProps, r as TAsCollapsibleProps, s as TAsTypeComponents, t as TAsBaseComponentProps } from "./types-BYfe1QEF.cjs";
|
|
2
2
|
import _default$3 from "./as-collapsible.cjs";
|
|
3
3
|
import _default$7 from "./as-field.cjs";
|
|
4
|
-
import { a as TFormRule, i as TFormFieldRegistration, n as _default$9, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-
|
|
4
|
+
import { a as TFormRule, i as TFormFieldRegistration, n as _default$9, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-Dg_5GYWG.cjs";
|
|
5
5
|
import _default$11 from "./as-iterator.cjs";
|
|
6
6
|
import { t as _default } from "./as-action.vue-BCbopk0S.cjs";
|
|
7
7
|
import { t as _default$1 } from "./as-array.vue-Ci4xO292.cjs";
|
|
@@ -24,7 +24,7 @@ import { t as _default$21 } from "./as-union.vue-AqH35ozq.cjs";
|
|
|
24
24
|
import * as vue from "vue";
|
|
25
25
|
import { Component, ComputedRef, MaybeRef, Ref, ShallowRef, WritableComputedRef } from "vue";
|
|
26
26
|
import * as _atscript_ui0 from "@atscript/ui";
|
|
27
|
-
import { ClientFactory, ClientFactory as ClientFactory$1, FormArrayFieldDef, FormDef, FormFieldDef, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, ValueHelpInfo, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
27
|
+
import { ClientFactory, ClientFactory as ClientFactory$1, FormArrayFieldDef, FormDef, FormDiffOptions, FormDiffOptions as FormDiffOptions$1, FormFieldChange, FormFieldChange as FormFieldChange$1, FormFieldDef, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, ValueHelpInfo, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
28
28
|
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.77_@atscript+core@0.1.77_@emnapi+core@1.10.0_@emnapi+runtime@1_66e726d698923960847d05359685c8c9/node_modules/@atscript/typescript/dist/utils.d.ts
|
|
29
29
|
interface TError {
|
|
30
30
|
path: string;
|
|
@@ -290,6 +290,69 @@ declare function useAsState<TFormData, TContext>(opts: {
|
|
|
290
290
|
submitValidator?: TFormSubmitValidator;
|
|
291
291
|
}): UseAsStateReturn;
|
|
292
292
|
//#endregion
|
|
293
|
+
//#region src/composables/use-as-form-patch.d.ts
|
|
294
|
+
/**
|
|
295
|
+
* Change-tracking handle for a single `<AsForm>`. Exposed three ways:
|
|
296
|
+
*
|
|
297
|
+
* 1. injected via {@link useAsFormPatch} inside any descendant component,
|
|
298
|
+
* 2. spread into every `<AsForm>` slot (`isDirty` / `changes` / `getPatch` /
|
|
299
|
+
* `getChanges` — so a footer slot can gate a Save button), and
|
|
300
|
+
* 3. `defineExpose`d on `<AsForm>` (so a parent template ref can call
|
|
301
|
+
* `asForm.value.getPatch()`).
|
|
302
|
+
*
|
|
303
|
+
* Built on `@atscript/ui`'s `buildFormDiff`, which diffs the form's CURRENT
|
|
304
|
+
* data against a BASELINE snapshot and produces both a per-field change list
|
|
305
|
+
* and an `@atscript/db` patch object (keyed-array `$update`/`$insert`/`$remove`,
|
|
306
|
+
* `$cas` optimistic-concurrency sibling, revert-aware).
|
|
307
|
+
*/
|
|
308
|
+
interface AsFormPatchHandle {
|
|
309
|
+
/**
|
|
310
|
+
* Reactive dirtiness — `true` when current data differs from the baseline.
|
|
311
|
+
* Revert-aware: a value edited back to its baseline flips this back to
|
|
312
|
+
* `false`. Memoised by Vue; recomputes only when the form data changes.
|
|
313
|
+
*/
|
|
314
|
+
isDirty: ComputedRef<boolean>;
|
|
315
|
+
/**
|
|
316
|
+
* Reactive per-field change list (revert-aware — reverted fields drop out).
|
|
317
|
+
* `before` / `after` hold live references into the baseline / current data.
|
|
318
|
+
*/
|
|
319
|
+
changes: ComputedRef<FormFieldChange$1[]>;
|
|
320
|
+
/**
|
|
321
|
+
* Builds the `@atscript/db` patch object on demand against the baseline
|
|
322
|
+
* snapshot. Safe to call at submit time (a fresh re-snapshot point). Returns
|
|
323
|
+
* `{}` when nothing changed. Carries a top-level `$cas` sibling when the form
|
|
324
|
+
* has a `@db.column.version` column and `opts.cas` is on (default).
|
|
325
|
+
*/
|
|
326
|
+
getPatch: (opts?: FormDiffOptions$1) => Record<string, unknown>;
|
|
327
|
+
/** Builds the per-field change list on demand (same data as `changes`). */
|
|
328
|
+
getChanges: () => FormFieldChange$1[];
|
|
329
|
+
/**
|
|
330
|
+
* Re-baseline to the current data. Call after a successful save so the form
|
|
331
|
+
* becomes clean again WITHOUT a remount. No-op when tracking is inactive.
|
|
332
|
+
*/
|
|
333
|
+
rebase: () => void;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Reactive read-only access to the form's change-tracking handle from any
|
|
337
|
+
* descendant of an `<AsForm track-changes>`. Mirrors the `useAsData` /
|
|
338
|
+
* `useAsPath` injector pattern.
|
|
339
|
+
*
|
|
340
|
+
* THROWS when called outside a form, or inside a form that did not enable
|
|
341
|
+
* `track-changes` — fail loud rather than silently report "not dirty".
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* ```vue
|
|
345
|
+
* <script setup lang="ts">
|
|
346
|
+
* import { useAsFormPatch } from "@atscript/vue-form";
|
|
347
|
+
* const { isDirty, getPatch } = useAsFormPatch();
|
|
348
|
+
* </script>
|
|
349
|
+
* <template>
|
|
350
|
+
* <button :disabled="!isDirty" @click="save(getPatch())">Save</button>
|
|
351
|
+
* </template>
|
|
352
|
+
* ```
|
|
353
|
+
*/
|
|
354
|
+
declare function useAsFormPatch(): AsFormPatchHandle;
|
|
355
|
+
//#endregion
|
|
293
356
|
//#region src/composables/use-as-form.d.ts
|
|
294
357
|
/**
|
|
295
358
|
* Options for {@link useAsForm}. Each reactive prop is supplied as a
|
|
@@ -338,6 +401,15 @@ interface UseAsFormOptions<TFormData = unknown, TFormContext = unknown> {
|
|
|
338
401
|
* server round-trip so consumers can drop their own submit overrides.
|
|
339
402
|
*/
|
|
340
403
|
loading?: () => boolean | undefined;
|
|
404
|
+
/**
|
|
405
|
+
* Enable change tracking. When `true`, the composable captures a deep-clone
|
|
406
|
+
* baseline of the form data (the moment it becomes available) and exposes a
|
|
407
|
+
* {@link AsFormPatchHandle} via `slotProps`, the return value (`patch`), and
|
|
408
|
+
* `provide(FORM_PATCH_KEY)` (read with `useAsFormPatch()`). When falsy
|
|
409
|
+
* (default), there is ZERO overhead — no baseline, no deep watch, and
|
|
410
|
+
* `useAsFormPatch()` throws. Reactive.
|
|
411
|
+
*/
|
|
412
|
+
trackChanges?: () => boolean | undefined;
|
|
341
413
|
/**
|
|
342
414
|
* Outbound callbacks. Customer form roots typically wire these to
|
|
343
415
|
* `defineEmits`; advanced uses can pass plain functions.
|
|
@@ -362,7 +434,11 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
|
362
434
|
formError: ComputedRef<string | undefined>;
|
|
363
435
|
/** Errors discovered by the local validator on the most-recent submit. */
|
|
364
436
|
internalErrors: Ref<Record<string, string>>;
|
|
365
|
-
/**
|
|
437
|
+
/**
|
|
438
|
+
* Reset internal validator + dismissal state and re-run field defaults. When
|
|
439
|
+
* `trackChanges` is enabled, also re-baselines the change tracker to the
|
|
440
|
+
* post-reset state (the form becomes clean again).
|
|
441
|
+
*/
|
|
366
442
|
reset: () => Promise<void>;
|
|
367
443
|
/** Imperatively clear errors (matches `useAsState().clearErrors`). */
|
|
368
444
|
clearErrors: () => void;
|
|
@@ -394,8 +470,17 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
|
394
470
|
setErrors: (errors: Record<string, string>) => void;
|
|
395
471
|
dismissError: (path: string) => void;
|
|
396
472
|
dismissFormError: () => void;
|
|
397
|
-
formContext: TFormContext | undefined;
|
|
473
|
+
formContext: TFormContext | undefined; /** True when `track-changes` is on AND data differs from baseline. */
|
|
474
|
+
isDirty: boolean; /** Revert-aware per-field change list (empty when tracking is off). */
|
|
475
|
+
changes: readonly FormFieldChange$1[]; /** Build the `@atscript/db` patch on demand (`{}` when tracking is off). */
|
|
476
|
+
getPatch: (opts?: FormDiffOptions$1) => Record<string, unknown>; /** Build the per-field change list on demand (`[]` when tracking is off). */
|
|
477
|
+
getChanges: () => FormFieldChange$1[];
|
|
398
478
|
}>;
|
|
479
|
+
/**
|
|
480
|
+
* Change-tracking handle — present ONLY when `trackChanges` is enabled.
|
|
481
|
+
* `undefined` otherwise. Read it from descendants with `useAsFormPatch()`.
|
|
482
|
+
*/
|
|
483
|
+
patch: AsFormPatchHandle | undefined;
|
|
399
484
|
/** Dispatch an action — invoked by `<AsAction>`. */
|
|
400
485
|
invokeAction: (name: string) => void;
|
|
401
486
|
/** Dismiss a single external leaf error. */
|
|
@@ -993,4 +1078,4 @@ type AsErrorDismiss = (path: string) => void;
|
|
|
993
1078
|
*/
|
|
994
1079
|
declare function useAsErrorDismiss(): AsErrorDismiss;
|
|
995
1080
|
//#endregion
|
|
996
|
-
export { _default as AsAction, _default$1 as AsArray, _default$2 as AsCheckbox, _default$3 as AsCollapsible, _default$4 as AsDate, _default$5 as AsDatetime, _default$6 as AsDecimal, type AsErrorDismiss, _default$7 as AsField, _default$8 as AsFieldShell, _default$9 as AsForm, _default$10 as AsInput, _default$11 as AsIterator, _default$12 as AsMultiSelect, type AsNestedSectionsStore, _default$13 as AsNumber, _default$14 as AsObject, _default$15 as AsParagraph, _default$16 as AsRadio, _default$17 as AsRef, _default$18 as AsSelect, _default$19 as AsTime, _default$20 as AsTuple, _default$21 as AsUnion, type ClientFactory, type TAsBaseComponentProps, type TAsChangeType, type TAsCollapsibleProps, type TAsCollapsibleSlots, type TAsComponentEmits, type TAsComponentProps, type TAsTypeComponents, type TAsUnionContext, type TFormFieldCallbacks, type TFormFieldRegistration, type TFormRule, type TFormState, type TFormSubmitValidator, type UseAsArrayReturn, type UseAsDataReturn, type UseAsDateOptions, type UseAsDateReturn, type UseAsDecimalOptions, type UseAsDecimalReturn, type UseAsDualInputOptions, type UseAsDualInputReturn, type UseAsExternalErrorsOptions, type UseAsExternalErrorsReturn, type UseAsFieldOptions, type UseAsFieldReturn, type UseAsFormOptions, type UseAsFormReturn, type UseAsLocaleReturn, type UseAsNumberOptions, type UseAsNumberReturn, type UseAsOptionalAddFlowOptions, type UseAsOptionalAddFlowReturn, type UseAsPathReturn, type UseAsStateReturn, type UseAsTriStateCheckboxOptions, type UseAsTriStateCheckboxReturn, type UseAsTupleReturn, type UseAsTypeMapReturn, type UseAsUnionReturn, type UseAsValueHelpOptions, type UseAsValueHelpReturn, createAsFormDef, createDefaultTypes, focusFirstAfter, focusNewFocusableAfter, formatIndexedLabelParts, getDefaultClientFactory, provideAsLocale, provideAsNestedSectionsStore, resetDefaultClientFactory, setDefaultClientFactory, useAsArray, useAsData, useAsDate, useAsDecimal, useAsDropdown, useAsDualInput, useAsErrorDismiss, useAsExternalErrors, useAsField, useAsFocusFirstAfter, useAsForm, useAsLocale, useAsNestedSectionsStore, useAsNumber, useAsOptionalAddFlow, useAsPath, useAsState, useAsTriStateCheckbox, useAsTuple, useAsTypeMap, useAsUnion, useAsUnionVariant, useAsValueHelp };
|
|
1081
|
+
export { _default as AsAction, _default$1 as AsArray, _default$2 as AsCheckbox, _default$3 as AsCollapsible, _default$4 as AsDate, _default$5 as AsDatetime, _default$6 as AsDecimal, type AsErrorDismiss, _default$7 as AsField, _default$8 as AsFieldShell, _default$9 as AsForm, type AsFormPatchHandle, _default$10 as AsInput, _default$11 as AsIterator, _default$12 as AsMultiSelect, type AsNestedSectionsStore, _default$13 as AsNumber, _default$14 as AsObject, _default$15 as AsParagraph, _default$16 as AsRadio, _default$17 as AsRef, _default$18 as AsSelect, _default$19 as AsTime, _default$20 as AsTuple, _default$21 as AsUnion, type ClientFactory, type FormDiffOptions, type FormFieldChange, type TAsBaseComponentProps, type TAsChangeType, type TAsCollapsibleProps, type TAsCollapsibleSlots, type TAsComponentEmits, type TAsComponentProps, type TAsTypeComponents, type TAsUnionContext, type TFormFieldCallbacks, type TFormFieldRegistration, type TFormRule, type TFormState, type TFormSubmitValidator, type UseAsArrayReturn, type UseAsDataReturn, type UseAsDateOptions, type UseAsDateReturn, type UseAsDecimalOptions, type UseAsDecimalReturn, type UseAsDualInputOptions, type UseAsDualInputReturn, type UseAsExternalErrorsOptions, type UseAsExternalErrorsReturn, type UseAsFieldOptions, type UseAsFieldReturn, type UseAsFormOptions, type UseAsFormReturn, type UseAsLocaleReturn, type UseAsNumberOptions, type UseAsNumberReturn, type UseAsOptionalAddFlowOptions, type UseAsOptionalAddFlowReturn, type UseAsPathReturn, type UseAsStateReturn, type UseAsTriStateCheckboxOptions, type UseAsTriStateCheckboxReturn, type UseAsTupleReturn, type UseAsTypeMapReturn, type UseAsUnionReturn, type UseAsValueHelpOptions, type UseAsValueHelpReturn, createAsFormDef, createDefaultTypes, focusFirstAfter, focusNewFocusableAfter, formatIndexedLabelParts, getDefaultClientFactory, provideAsLocale, provideAsNestedSectionsStore, resetDefaultClientFactory, setDefaultClientFactory, useAsArray, useAsData, useAsDate, useAsDecimal, useAsDropdown, useAsDualInput, useAsErrorDismiss, useAsExternalErrors, useAsField, useAsFocusFirstAfter, useAsForm, useAsFormPatch, useAsLocale, useAsNestedSectionsStore, useAsNumber, useAsOptionalAddFlow, useAsPath, useAsState, useAsTriStateCheckbox, useAsTuple, useAsTypeMap, useAsUnion, useAsUnionVariant, useAsValueHelp };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as TAsComponentEmits, c as TAsUnionContext, i as TAsCollapsibleSlots, n as TAsChangeType, o as TAsComponentProps, r as TAsCollapsibleProps, s as TAsTypeComponents, t as TAsBaseComponentProps } from "./types-CV9ss4UN.mjs";
|
|
2
2
|
import _default$3 from "./as-collapsible.mjs";
|
|
3
3
|
import _default$7 from "./as-field.mjs";
|
|
4
|
-
import { a as TFormRule, i as TFormFieldRegistration, n as _default$9, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-
|
|
4
|
+
import { a as TFormRule, i as TFormFieldRegistration, n as _default$9, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-2NZSk1F9.mjs";
|
|
5
5
|
import _default$11 from "./as-iterator.mjs";
|
|
6
6
|
import { t as _default } from "./as-action.vue-BtQX09n-.mjs";
|
|
7
7
|
import { t as _default$1 } from "./as-array.vue-I42wuF6e.mjs";
|
|
@@ -24,7 +24,7 @@ import { t as _default$21 } from "./as-union.vue-Ew3Bany8.mjs";
|
|
|
24
24
|
import * as vue from "vue";
|
|
25
25
|
import { Component, ComputedRef, MaybeRef, Ref, ShallowRef, WritableComputedRef } from "vue";
|
|
26
26
|
import * as _atscript_ui0 from "@atscript/ui";
|
|
27
|
-
import { ClientFactory, ClientFactory as ClientFactory$1, FormArrayFieldDef, FormDef, FormFieldDef, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, ValueHelpInfo, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
27
|
+
import { ClientFactory, ClientFactory as ClientFactory$1, FormArrayFieldDef, FormDef, FormDiffOptions, FormDiffOptions as FormDiffOptions$1, FormFieldChange, FormFieldChange as FormFieldChange$1, FormFieldDef, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, ValueHelpInfo, getDefaultClientFactory, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
28
28
|
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.77_@atscript+core@0.1.77_@emnapi+core@1.10.0_@emnapi+runtime@1_66e726d698923960847d05359685c8c9/node_modules/@atscript/typescript/dist/utils.d.ts
|
|
29
29
|
interface TError {
|
|
30
30
|
path: string;
|
|
@@ -290,6 +290,69 @@ declare function useAsState<TFormData, TContext>(opts: {
|
|
|
290
290
|
submitValidator?: TFormSubmitValidator;
|
|
291
291
|
}): UseAsStateReturn;
|
|
292
292
|
//#endregion
|
|
293
|
+
//#region src/composables/use-as-form-patch.d.ts
|
|
294
|
+
/**
|
|
295
|
+
* Change-tracking handle for a single `<AsForm>`. Exposed three ways:
|
|
296
|
+
*
|
|
297
|
+
* 1. injected via {@link useAsFormPatch} inside any descendant component,
|
|
298
|
+
* 2. spread into every `<AsForm>` slot (`isDirty` / `changes` / `getPatch` /
|
|
299
|
+
* `getChanges` — so a footer slot can gate a Save button), and
|
|
300
|
+
* 3. `defineExpose`d on `<AsForm>` (so a parent template ref can call
|
|
301
|
+
* `asForm.value.getPatch()`).
|
|
302
|
+
*
|
|
303
|
+
* Built on `@atscript/ui`'s `buildFormDiff`, which diffs the form's CURRENT
|
|
304
|
+
* data against a BASELINE snapshot and produces both a per-field change list
|
|
305
|
+
* and an `@atscript/db` patch object (keyed-array `$update`/`$insert`/`$remove`,
|
|
306
|
+
* `$cas` optimistic-concurrency sibling, revert-aware).
|
|
307
|
+
*/
|
|
308
|
+
interface AsFormPatchHandle {
|
|
309
|
+
/**
|
|
310
|
+
* Reactive dirtiness — `true` when current data differs from the baseline.
|
|
311
|
+
* Revert-aware: a value edited back to its baseline flips this back to
|
|
312
|
+
* `false`. Memoised by Vue; recomputes only when the form data changes.
|
|
313
|
+
*/
|
|
314
|
+
isDirty: ComputedRef<boolean>;
|
|
315
|
+
/**
|
|
316
|
+
* Reactive per-field change list (revert-aware — reverted fields drop out).
|
|
317
|
+
* `before` / `after` hold live references into the baseline / current data.
|
|
318
|
+
*/
|
|
319
|
+
changes: ComputedRef<FormFieldChange$1[]>;
|
|
320
|
+
/**
|
|
321
|
+
* Builds the `@atscript/db` patch object on demand against the baseline
|
|
322
|
+
* snapshot. Safe to call at submit time (a fresh re-snapshot point). Returns
|
|
323
|
+
* `{}` when nothing changed. Carries a top-level `$cas` sibling when the form
|
|
324
|
+
* has a `@db.column.version` column and `opts.cas` is on (default).
|
|
325
|
+
*/
|
|
326
|
+
getPatch: (opts?: FormDiffOptions$1) => Record<string, unknown>;
|
|
327
|
+
/** Builds the per-field change list on demand (same data as `changes`). */
|
|
328
|
+
getChanges: () => FormFieldChange$1[];
|
|
329
|
+
/**
|
|
330
|
+
* Re-baseline to the current data. Call after a successful save so the form
|
|
331
|
+
* becomes clean again WITHOUT a remount. No-op when tracking is inactive.
|
|
332
|
+
*/
|
|
333
|
+
rebase: () => void;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Reactive read-only access to the form's change-tracking handle from any
|
|
337
|
+
* descendant of an `<AsForm track-changes>`. Mirrors the `useAsData` /
|
|
338
|
+
* `useAsPath` injector pattern.
|
|
339
|
+
*
|
|
340
|
+
* THROWS when called outside a form, or inside a form that did not enable
|
|
341
|
+
* `track-changes` — fail loud rather than silently report "not dirty".
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* ```vue
|
|
345
|
+
* <script setup lang="ts">
|
|
346
|
+
* import { useAsFormPatch } from "@atscript/vue-form";
|
|
347
|
+
* const { isDirty, getPatch } = useAsFormPatch();
|
|
348
|
+
* </script>
|
|
349
|
+
* <template>
|
|
350
|
+
* <button :disabled="!isDirty" @click="save(getPatch())">Save</button>
|
|
351
|
+
* </template>
|
|
352
|
+
* ```
|
|
353
|
+
*/
|
|
354
|
+
declare function useAsFormPatch(): AsFormPatchHandle;
|
|
355
|
+
//#endregion
|
|
293
356
|
//#region src/composables/use-as-form.d.ts
|
|
294
357
|
/**
|
|
295
358
|
* Options for {@link useAsForm}. Each reactive prop is supplied as a
|
|
@@ -338,6 +401,15 @@ interface UseAsFormOptions<TFormData = unknown, TFormContext = unknown> {
|
|
|
338
401
|
* server round-trip so consumers can drop their own submit overrides.
|
|
339
402
|
*/
|
|
340
403
|
loading?: () => boolean | undefined;
|
|
404
|
+
/**
|
|
405
|
+
* Enable change tracking. When `true`, the composable captures a deep-clone
|
|
406
|
+
* baseline of the form data (the moment it becomes available) and exposes a
|
|
407
|
+
* {@link AsFormPatchHandle} via `slotProps`, the return value (`patch`), and
|
|
408
|
+
* `provide(FORM_PATCH_KEY)` (read with `useAsFormPatch()`). When falsy
|
|
409
|
+
* (default), there is ZERO overhead — no baseline, no deep watch, and
|
|
410
|
+
* `useAsFormPatch()` throws. Reactive.
|
|
411
|
+
*/
|
|
412
|
+
trackChanges?: () => boolean | undefined;
|
|
341
413
|
/**
|
|
342
414
|
* Outbound callbacks. Customer form roots typically wire these to
|
|
343
415
|
* `defineEmits`; advanced uses can pass plain functions.
|
|
@@ -362,7 +434,11 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
|
362
434
|
formError: ComputedRef<string | undefined>;
|
|
363
435
|
/** Errors discovered by the local validator on the most-recent submit. */
|
|
364
436
|
internalErrors: Ref<Record<string, string>>;
|
|
365
|
-
/**
|
|
437
|
+
/**
|
|
438
|
+
* Reset internal validator + dismissal state and re-run field defaults. When
|
|
439
|
+
* `trackChanges` is enabled, also re-baselines the change tracker to the
|
|
440
|
+
* post-reset state (the form becomes clean again).
|
|
441
|
+
*/
|
|
366
442
|
reset: () => Promise<void>;
|
|
367
443
|
/** Imperatively clear errors (matches `useAsState().clearErrors`). */
|
|
368
444
|
clearErrors: () => void;
|
|
@@ -394,8 +470,17 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
|
394
470
|
setErrors: (errors: Record<string, string>) => void;
|
|
395
471
|
dismissError: (path: string) => void;
|
|
396
472
|
dismissFormError: () => void;
|
|
397
|
-
formContext: TFormContext | undefined;
|
|
473
|
+
formContext: TFormContext | undefined; /** True when `track-changes` is on AND data differs from baseline. */
|
|
474
|
+
isDirty: boolean; /** Revert-aware per-field change list (empty when tracking is off). */
|
|
475
|
+
changes: readonly FormFieldChange$1[]; /** Build the `@atscript/db` patch on demand (`{}` when tracking is off). */
|
|
476
|
+
getPatch: (opts?: FormDiffOptions$1) => Record<string, unknown>; /** Build the per-field change list on demand (`[]` when tracking is off). */
|
|
477
|
+
getChanges: () => FormFieldChange$1[];
|
|
398
478
|
}>;
|
|
479
|
+
/**
|
|
480
|
+
* Change-tracking handle — present ONLY when `trackChanges` is enabled.
|
|
481
|
+
* `undefined` otherwise. Read it from descendants with `useAsFormPatch()`.
|
|
482
|
+
*/
|
|
483
|
+
patch: AsFormPatchHandle | undefined;
|
|
399
484
|
/** Dispatch an action — invoked by `<AsAction>`. */
|
|
400
485
|
invokeAction: (name: string) => void;
|
|
401
486
|
/** Dismiss a single external leaf error. */
|
|
@@ -993,4 +1078,4 @@ type AsErrorDismiss = (path: string) => void;
|
|
|
993
1078
|
*/
|
|
994
1079
|
declare function useAsErrorDismiss(): AsErrorDismiss;
|
|
995
1080
|
//#endregion
|
|
996
|
-
export { _default as AsAction, _default$1 as AsArray, _default$2 as AsCheckbox, _default$3 as AsCollapsible, _default$4 as AsDate, _default$5 as AsDatetime, _default$6 as AsDecimal, type AsErrorDismiss, _default$7 as AsField, _default$8 as AsFieldShell, _default$9 as AsForm, _default$10 as AsInput, _default$11 as AsIterator, _default$12 as AsMultiSelect, type AsNestedSectionsStore, _default$13 as AsNumber, _default$14 as AsObject, _default$15 as AsParagraph, _default$16 as AsRadio, _default$17 as AsRef, _default$18 as AsSelect, _default$19 as AsTime, _default$20 as AsTuple, _default$21 as AsUnion, type ClientFactory, type TAsBaseComponentProps, type TAsChangeType, type TAsCollapsibleProps, type TAsCollapsibleSlots, type TAsComponentEmits, type TAsComponentProps, type TAsTypeComponents, type TAsUnionContext, type TFormFieldCallbacks, type TFormFieldRegistration, type TFormRule, type TFormState, type TFormSubmitValidator, type UseAsArrayReturn, type UseAsDataReturn, type UseAsDateOptions, type UseAsDateReturn, type UseAsDecimalOptions, type UseAsDecimalReturn, type UseAsDualInputOptions, type UseAsDualInputReturn, type UseAsExternalErrorsOptions, type UseAsExternalErrorsReturn, type UseAsFieldOptions, type UseAsFieldReturn, type UseAsFormOptions, type UseAsFormReturn, type UseAsLocaleReturn, type UseAsNumberOptions, type UseAsNumberReturn, type UseAsOptionalAddFlowOptions, type UseAsOptionalAddFlowReturn, type UseAsPathReturn, type UseAsStateReturn, type UseAsTriStateCheckboxOptions, type UseAsTriStateCheckboxReturn, type UseAsTupleReturn, type UseAsTypeMapReturn, type UseAsUnionReturn, type UseAsValueHelpOptions, type UseAsValueHelpReturn, createAsFormDef, createDefaultTypes, focusFirstAfter, focusNewFocusableAfter, formatIndexedLabelParts, getDefaultClientFactory, provideAsLocale, provideAsNestedSectionsStore, resetDefaultClientFactory, setDefaultClientFactory, useAsArray, useAsData, useAsDate, useAsDecimal, useAsDropdown, useAsDualInput, useAsErrorDismiss, useAsExternalErrors, useAsField, useAsFocusFirstAfter, useAsForm, useAsLocale, useAsNestedSectionsStore, useAsNumber, useAsOptionalAddFlow, useAsPath, useAsState, useAsTriStateCheckbox, useAsTuple, useAsTypeMap, useAsUnion, useAsUnionVariant, useAsValueHelp };
|
|
1081
|
+
export { _default as AsAction, _default$1 as AsArray, _default$2 as AsCheckbox, _default$3 as AsCollapsible, _default$4 as AsDate, _default$5 as AsDatetime, _default$6 as AsDecimal, type AsErrorDismiss, _default$7 as AsField, _default$8 as AsFieldShell, _default$9 as AsForm, type AsFormPatchHandle, _default$10 as AsInput, _default$11 as AsIterator, _default$12 as AsMultiSelect, type AsNestedSectionsStore, _default$13 as AsNumber, _default$14 as AsObject, _default$15 as AsParagraph, _default$16 as AsRadio, _default$17 as AsRef, _default$18 as AsSelect, _default$19 as AsTime, _default$20 as AsTuple, _default$21 as AsUnion, type ClientFactory, type FormDiffOptions, type FormFieldChange, type TAsBaseComponentProps, type TAsChangeType, type TAsCollapsibleProps, type TAsCollapsibleSlots, type TAsComponentEmits, type TAsComponentProps, type TAsTypeComponents, type TAsUnionContext, type TFormFieldCallbacks, type TFormFieldRegistration, type TFormRule, type TFormState, type TFormSubmitValidator, type UseAsArrayReturn, type UseAsDataReturn, type UseAsDateOptions, type UseAsDateReturn, type UseAsDecimalOptions, type UseAsDecimalReturn, type UseAsDualInputOptions, type UseAsDualInputReturn, type UseAsExternalErrorsOptions, type UseAsExternalErrorsReturn, type UseAsFieldOptions, type UseAsFieldReturn, type UseAsFormOptions, type UseAsFormReturn, type UseAsLocaleReturn, type UseAsNumberOptions, type UseAsNumberReturn, type UseAsOptionalAddFlowOptions, type UseAsOptionalAddFlowReturn, type UseAsPathReturn, type UseAsStateReturn, type UseAsTriStateCheckboxOptions, type UseAsTriStateCheckboxReturn, type UseAsTupleReturn, type UseAsTypeMapReturn, type UseAsUnionReturn, type UseAsValueHelpOptions, type UseAsValueHelpReturn, createAsFormDef, createDefaultTypes, focusFirstAfter, focusNewFocusableAfter, formatIndexedLabelParts, getDefaultClientFactory, provideAsLocale, provideAsNestedSectionsStore, resetDefaultClientFactory, setDefaultClientFactory, useAsArray, useAsData, useAsDate, useAsDecimal, useAsDropdown, useAsDualInput, useAsErrorDismiss, useAsExternalErrors, useAsField, useAsFocusFirstAfter, useAsForm, useAsFormPatch, useAsLocale, useAsNestedSectionsStore, useAsNumber, useAsOptionalAddFlow, useAsPath, useAsState, useAsTriStateCheckbox, useAsTuple, useAsTypeMap, useAsUnion, useAsUnionVariant, useAsValueHelp };
|