@atscript/vue-form 0.1.175 → 0.1.176

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.
Files changed (140) hide show
  1. package/dist/_editing-hold-ChPIf1ZC.cjs +65 -0
  2. package/dist/_editing-hold-DVfB2wc_.mjs +54 -0
  3. package/dist/{_shape-BAim7zm2.cjs → _shape-C-TxQCFa.cjs} +17 -1
  4. package/dist/{_shape-CLX3JSFZ.mjs → _shape-bdsPEB8P.mjs} +12 -2
  5. package/dist/as-action.cjs +1 -1
  6. package/dist/as-action.d.mts +1 -1
  7. package/dist/as-action.mjs +1 -1
  8. package/dist/{as-action.vue-CPFAPJbB.d.mts → as-action.vue-CQbDa3g4.d.mts} +1 -1
  9. package/dist/{as-array-B1s5sXYV.cjs → as-array-DjJ_GA65.cjs} +2 -2
  10. package/dist/{as-array-ha4DpqUM.mjs → as-array-DnxeuRPB.mjs} +2 -2
  11. package/dist/as-array.cjs +1 -1
  12. package/dist/as-array.d.mts +1 -1
  13. package/dist/as-array.mjs +1 -1
  14. package/dist/{as-array.vue-CPAuKOJp.d.mts → as-array.vue-DpKFsuRS.d.mts} +1 -1
  15. package/dist/{as-checkbox-OKhewGzL.cjs → as-checkbox-52v5CL8Z.cjs} +1 -1
  16. package/dist/{as-checkbox-Baz513zf.mjs → as-checkbox-BivClBCD.mjs} +1 -1
  17. package/dist/as-checkbox.cjs +1 -1
  18. package/dist/as-checkbox.d.mts +1 -1
  19. package/dist/as-checkbox.mjs +1 -1
  20. package/dist/{as-checkbox.vue-DTwhk8as.d.mts → as-checkbox.vue-Db6OT_lL.d.mts} +1 -1
  21. package/dist/as-collapsible.d.mts +1 -1
  22. package/dist/{as-collapsible.vue-D-C-9GqT.d.mts → as-collapsible.vue-By-ZBZt3.d.mts} +1 -1
  23. package/dist/{as-date-VN6VPCZ-.mjs → as-date-Dsv_nimP.mjs} +4 -4
  24. package/dist/{as-date-4GYZJ-NC.cjs → as-date-HUhD-kZ4.cjs} +4 -4
  25. package/dist/as-date.cjs +1 -1
  26. package/dist/as-date.d.mts +1 -1
  27. package/dist/as-date.mjs +1 -1
  28. package/dist/{as-date.vue-Orrtd1W8.d.mts → as-date.vue-BUaHHI42.d.mts} +1 -1
  29. package/dist/{as-datetime-CWzURHq_.mjs → as-datetime-BxMIrM_M.mjs} +4 -4
  30. package/dist/{as-datetime-CCN03o-l.cjs → as-datetime-CiL-vlD2.cjs} +4 -4
  31. package/dist/as-datetime.cjs +1 -1
  32. package/dist/as-datetime.d.mts +1 -1
  33. package/dist/as-datetime.mjs +1 -1
  34. package/dist/{as-datetime.vue-Cj3rQjQT.d.mts → as-datetime.vue-D3WJpAVe.d.mts} +1 -1
  35. package/dist/{as-decimal-BC09yeEc.cjs → as-decimal-DA24-Wtp.cjs} +2 -2
  36. package/dist/{as-decimal-C8ZbnZ-W.mjs → as-decimal-DegSeh2G.mjs} +2 -2
  37. package/dist/as-decimal.cjs +1 -1
  38. package/dist/as-decimal.d.mts +1 -1
  39. package/dist/as-decimal.mjs +1 -1
  40. package/dist/{as-decimal.vue-BUoGa9Ni.d.mts → as-decimal.vue-BVDyP4LN.d.mts} +1 -1
  41. package/dist/{as-field-shell-nSZx4aV0.mjs → as-field-shell-IaUBze1S.mjs} +34 -21
  42. package/dist/{as-field-shell-DviDLKgc.cjs → as-field-shell-rghztVd7.cjs} +34 -21
  43. package/dist/as-field-shell.cjs +1 -1
  44. package/dist/as-field-shell.d.mts +1 -1
  45. package/dist/as-field-shell.mjs +1 -1
  46. package/dist/{as-field-shell.vue-BLF9cYdM.d.mts → as-field-shell.vue-DBufTHVO.d.mts} +1 -1
  47. package/dist/as-field.d.mts +1 -1
  48. package/dist/as-form.d.cts +1 -1
  49. package/dist/as-form.d.mts +1 -1
  50. package/dist/{as-form.vue-Cl036Br1.d.cts → as-form.vue-Bx1yZIBk.d.cts} +1 -1
  51. package/dist/{as-form.vue-9rtEZqEU.d.mts → as-form.vue-Bxq1IR_f.d.mts} +2 -2
  52. package/dist/{as-input-B5eBOvaM.mjs → as-input-CijlzZ8Q.mjs} +3 -3
  53. package/dist/{as-input-GVFsgqbJ.cjs → as-input-DGvRZOy5.cjs} +3 -3
  54. package/dist/{as-input-control-Dc9TPspz.mjs → as-input-control-B3h--Qe0.mjs} +17 -5
  55. package/dist/{as-input-control-B04eAMwA.cjs → as-input-control-DAbaW7GG.cjs} +16 -4
  56. package/dist/as-input.cjs +1 -1
  57. package/dist/as-input.d.mts +1 -1
  58. package/dist/as-input.mjs +1 -1
  59. package/dist/{as-input.vue-C7EKOcQU.d.mts → as-input.vue-BiPsULeF.d.mts} +1 -1
  60. package/dist/as-iterator.d.mts +1 -1
  61. package/dist/{as-multi-select-BhPKb69b.mjs → as-multi-select-BXnZLgjt.mjs} +1 -1
  62. package/dist/{as-multi-select-BygHZ0wu.cjs → as-multi-select-JUB05J_p.cjs} +1 -1
  63. package/dist/as-multi-select.cjs +1 -1
  64. package/dist/as-multi-select.d.mts +1 -1
  65. package/dist/as-multi-select.mjs +1 -1
  66. package/dist/{as-multi-select.vue-BS9X_0fY.d.mts → as-multi-select.vue-Bmngkww7.d.mts} +1 -1
  67. package/dist/{as-number-BCZD5zX6.mjs → as-number-DkeEBWva.mjs} +3 -3
  68. package/dist/{as-number-bFJlxd6T.cjs → as-number-TfNY5CgX.cjs} +3 -3
  69. package/dist/as-number.cjs +1 -1
  70. package/dist/as-number.d.mts +1 -1
  71. package/dist/as-number.mjs +1 -1
  72. package/dist/{as-number.vue-CJSPy4zg.d.mts → as-number.vue-C2QSKpVL.d.mts} +1 -1
  73. package/dist/{as-object-sly2aTBc.mjs → as-object-BAsjdh_N.mjs} +1 -1
  74. package/dist/{as-object-aItYU-IN.cjs → as-object-lKSwKkt7.cjs} +1 -1
  75. package/dist/as-object.cjs +1 -1
  76. package/dist/as-object.d.mts +1 -1
  77. package/dist/as-object.mjs +1 -1
  78. package/dist/{as-object.vue-DKEhwHCH.d.mts → as-object.vue-DFo_5DXv.d.mts} +1 -1
  79. package/dist/as-paragraph.cjs +1 -1
  80. package/dist/as-paragraph.d.mts +1 -1
  81. package/dist/as-paragraph.mjs +1 -1
  82. package/dist/{as-paragraph.vue-Cu4woZ9u.d.mts → as-paragraph.vue-DiHaNFSX.d.mts} +1 -1
  83. package/dist/{as-radio-DszOJUnp.mjs → as-radio-CHwzhcQE.mjs} +1 -1
  84. package/dist/{as-radio-Bxw-nuBQ.cjs → as-radio-DEHsBgwQ.cjs} +1 -1
  85. package/dist/as-radio.cjs +1 -1
  86. package/dist/as-radio.d.mts +1 -1
  87. package/dist/as-radio.mjs +1 -1
  88. package/dist/{as-radio.vue-dro8-E3x.d.mts → as-radio.vue-C_ZjbI4s.d.mts} +1 -1
  89. package/dist/{as-ref-DCYYySDN.cjs → as-ref-DgdRW4ST.cjs} +16 -37
  90. package/dist/{as-ref-Dsd81GCS.mjs → as-ref-N0dohgyv.mjs} +17 -38
  91. package/dist/as-ref.cjs +1 -1
  92. package/dist/as-ref.d.mts +1 -1
  93. package/dist/as-ref.mjs +1 -1
  94. package/dist/{as-ref.vue-B7wixo40.d.mts → as-ref.vue-DaXQsjsX.d.mts} +1 -1
  95. package/dist/{as-select-ClWgJvtq.cjs → as-select-YPLFDuAQ.cjs} +1 -1
  96. package/dist/{as-select-CER1fT_R.mjs → as-select-bmYhMEV_.mjs} +1 -1
  97. package/dist/as-select.cjs +1 -1
  98. package/dist/as-select.d.mts +1 -1
  99. package/dist/as-select.mjs +1 -1
  100. package/dist/{as-select.vue-DKBV1tqr.d.mts → as-select.vue-IGtjEyQD.d.mts} +1 -1
  101. package/dist/{as-time-C91Kljns.cjs → as-time-21ZSGDiq.cjs} +4 -4
  102. package/dist/{as-time--hMNPNqj.mjs → as-time-D107-bEJ.mjs} +4 -4
  103. package/dist/as-time.cjs +1 -1
  104. package/dist/as-time.d.mts +1 -1
  105. package/dist/as-time.mjs +1 -1
  106. package/dist/{as-time.vue-DTUPfGLQ.d.mts → as-time.vue-CKVgGb-m.d.mts} +1 -1
  107. package/dist/{as-tuple-wuPJs4H-.cjs → as-tuple-5nsBvO-n.cjs} +2 -2
  108. package/dist/{as-tuple-57xADF_i.mjs → as-tuple-gNyJxwi4.mjs} +2 -2
  109. package/dist/as-tuple.cjs +1 -1
  110. package/dist/as-tuple.d.mts +1 -1
  111. package/dist/as-tuple.mjs +1 -1
  112. package/dist/{as-tuple.vue-CF5tHv89.d.mts → as-tuple.vue-CDOHXKBr.d.mts} +1 -1
  113. package/dist/{as-union-DXzqX-M1.mjs → as-union-BLTGJOyB.mjs} +4 -2
  114. package/dist/{as-union-BDC13rY3.cjs → as-union-BuCn5dN6.cjs} +4 -2
  115. package/dist/as-union.cjs +1 -1
  116. package/dist/as-union.d.mts +1 -1
  117. package/dist/as-union.mjs +1 -1
  118. package/dist/{as-union.vue-DJGnj0xV.d.mts → as-union.vue-BcaUH5bH.d.mts} +1 -1
  119. package/dist/index.cjs +20 -20
  120. package/dist/index.d.cts +1 -1
  121. package/dist/index.d.mts +24 -24
  122. package/dist/index.mjs +20 -20
  123. package/dist/locale.d.mts +1 -1
  124. package/package.json +9 -9
  125. /package/dist/{as-action-C0gSyG19.cjs → as-action-B_vPR2YE.cjs} +0 -0
  126. /package/dist/{as-action-BOalk1GL.mjs → as-action-BzdLJvyy.mjs} +0 -0
  127. /package/dist/{as-adornment-shell-grq1H0D-.mjs → as-adornment-shell-CBaksXGT.mjs} +0 -0
  128. /package/dist/{as-adornment-shell-COhqCppW.cjs → as-adornment-shell-CmS9BOFm.cjs} +0 -0
  129. /package/dist/{as-array-clear-btn-CNSn7HrC.cjs → as-array-clear-btn-DSuk9U43.cjs} +0 -0
  130. /package/dist/{as-array-clear-btn-bUM9vztK.mjs → as-array-clear-btn-DkmJoCjN.mjs} +0 -0
  131. /package/dist/{as-field.vue-jAOaV9zg.d.mts → as-field.vue-BWaTLJd6.d.mts} +0 -0
  132. /package/dist/{as-iterator.vue-DisW8puF.d.mts → as-iterator.vue-BUCohjxw.d.mts} +0 -0
  133. /package/dist/{as-paragraph-DfX1uEE_.cjs → as-paragraph-0opsr433.cjs} +0 -0
  134. /package/dist/{as-paragraph-BALTsswa.mjs → as-paragraph-CQCdz9FR.mjs} +0 -0
  135. /package/dist/{types-DitKqqD_.d.mts → types-B0Ey_eD-.d.mts} +0 -0
  136. /package/dist/{use-as-date-Dp3IDhLj.cjs → use-as-date-DFcdIfyr.cjs} +0 -0
  137. /package/dist/{use-as-date-B3sBae9e.mjs → use-as-date-DgPRL0O2.mjs} +0 -0
  138. /package/dist/{use-as-locale-TRSJHpw-.d.mts → use-as-locale-D4NDG8Vg.d.mts} +0 -0
  139. /package/dist/{use-as-optional-add-flow-nwBB3Mdk.cjs → use-as-optional-add-flow-C7f0blhC.cjs} +0 -0
  140. /package/dist/{use-as-optional-add-flow-DRZT-aIT.mjs → use-as-optional-add-flow-fOglspPV.mjs} +0 -0
@@ -0,0 +1,65 @@
1
+ let vue = require("vue");
2
+ //#region src/composables/_editing-hold.ts
3
+ /**
4
+ * Holding an editor in place while the user is in it. An emptied input of an
5
+ * optional field commits `undefined`, and the chrome around it swaps an unset
6
+ * field for its placeholder (AsFieldShell's "Not set", AsUnion's "Add") — so
7
+ * while focus is in the input the editor must stay, and the placeholder shows
8
+ * once focus leaves.
9
+ *
10
+ * Internal — not exported from the package barrel. The key is private to this
11
+ * module.
12
+ */
13
+ const EDITING_HOLD_KEY = Symbol("atui.editing-hold");
14
+ /**
15
+ * For a container that swaps its editor for a placeholder (AsUnion): whether
16
+ * an input row below it has focus, fed by the {@link useEditingHold} rows.
17
+ */
18
+ function provideEditingHold() {
19
+ const editing = (0, vue.ref)(false);
20
+ (0, vue.provide)(EDITING_HOLD_KEY, editing);
21
+ return editing;
22
+ }
23
+ /**
24
+ * Focus tracking for an input row (bind `onFocusin` / `onFocusout` on it),
25
+ * mirrored into the closest {@link provideEditingHold}. Consumed: a row inside
26
+ * another row's subtree does not report to the container.
27
+ *
28
+ * Focus moving between two elements of the row keeps `editing`, and so does
29
+ * the window losing focus: the browser then fires `focusout` with no
30
+ * `relatedTarget`, but the input stays the document's active element (on a
31
+ * move to another element of the page it is `<body>` during `focusout`).
32
+ */
33
+ function useEditingHold() {
34
+ const container = (0, vue.inject)(EDITING_HOLD_KEY, void 0);
35
+ (0, vue.provide)(EDITING_HOLD_KEY, void 0);
36
+ const editing = (0, vue.ref)(false);
37
+ function set(value) {
38
+ editing.value = value;
39
+ if (container) container.value = value;
40
+ }
41
+ (0, vue.onBeforeUnmount)(() => {
42
+ if (editing.value && container) container.value = false;
43
+ });
44
+ return {
45
+ editing,
46
+ onFocusin: () => set(true),
47
+ onFocusout: (e) => {
48
+ const row = e.currentTarget;
49
+ set(row.contains(e.relatedTarget) || row.contains(document.activeElement));
50
+ }
51
+ };
52
+ }
53
+ //#endregion
54
+ Object.defineProperty(exports, "provideEditingHold", {
55
+ enumerable: true,
56
+ get: function() {
57
+ return provideEditingHold;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "useEditingHold", {
61
+ enumerable: true,
62
+ get: function() {
63
+ return useEditingHold;
64
+ }
65
+ });
@@ -0,0 +1,54 @@
1
+ import { inject, onBeforeUnmount, provide, ref } from "vue";
2
+ //#region src/composables/_editing-hold.ts
3
+ /**
4
+ * Holding an editor in place while the user is in it. An emptied input of an
5
+ * optional field commits `undefined`, and the chrome around it swaps an unset
6
+ * field for its placeholder (AsFieldShell's "Not set", AsUnion's "Add") — so
7
+ * while focus is in the input the editor must stay, and the placeholder shows
8
+ * once focus leaves.
9
+ *
10
+ * Internal — not exported from the package barrel. The key is private to this
11
+ * module.
12
+ */
13
+ const EDITING_HOLD_KEY = Symbol("atui.editing-hold");
14
+ /**
15
+ * For a container that swaps its editor for a placeholder (AsUnion): whether
16
+ * an input row below it has focus, fed by the {@link useEditingHold} rows.
17
+ */
18
+ function provideEditingHold() {
19
+ const editing = ref(false);
20
+ provide(EDITING_HOLD_KEY, editing);
21
+ return editing;
22
+ }
23
+ /**
24
+ * Focus tracking for an input row (bind `onFocusin` / `onFocusout` on it),
25
+ * mirrored into the closest {@link provideEditingHold}. Consumed: a row inside
26
+ * another row's subtree does not report to the container.
27
+ *
28
+ * Focus moving between two elements of the row keeps `editing`, and so does
29
+ * the window losing focus: the browser then fires `focusout` with no
30
+ * `relatedTarget`, but the input stays the document's active element (on a
31
+ * move to another element of the page it is `<body>` during `focusout`).
32
+ */
33
+ function useEditingHold() {
34
+ const container = inject(EDITING_HOLD_KEY, void 0);
35
+ provide(EDITING_HOLD_KEY, void 0);
36
+ const editing = ref(false);
37
+ function set(value) {
38
+ editing.value = value;
39
+ if (container) container.value = value;
40
+ }
41
+ onBeforeUnmount(() => {
42
+ if (editing.value && container) container.value = false;
43
+ });
44
+ return {
45
+ editing,
46
+ onFocusin: () => set(true),
47
+ onFocusout: (e) => {
48
+ const row = e.currentTarget;
49
+ set(row.contains(e.relatedTarget) || row.contains(document.activeElement));
50
+ }
51
+ };
52
+ }
53
+ //#endregion
54
+ export { useEditingHold as n, provideEditingHold as t };
@@ -17,12 +17,28 @@ function preserveShape(original, normalized) {
17
17
  * The value an emptied input commits: `undefined` (omitted) on an optional
18
18
  * field — `null` is not a value of `name?: T`, and atscript >= 0.1.103
19
19
  * rejects it there when the field also carries `@meta.required` — else
20
- * `null`. Shared by the number / decimal / date / datetime / time inputs.
20
+ * `null`. Shared by the number / decimal / date / datetime / time inputs and
21
+ * the native number input of the text control.
21
22
  */
22
23
  function committedValue(value, optional) {
23
24
  return value === null && optional ? void 0 : value;
24
25
  }
26
+ /**
27
+ * The value an emptied text input commits: `undefined` (omitted) on an
28
+ * optional field, like {@link committedValue}; `""` on a required one. Used by
29
+ * the text control (which also renders the reference input's plain-text
30
+ * fallback).
31
+ */
32
+ function committedText(value, optional) {
33
+ return value === "" && optional ? void 0 : value;
34
+ }
25
35
  //#endregion
36
+ Object.defineProperty(exports, "committedText", {
37
+ enumerable: true,
38
+ get: function() {
39
+ return committedText;
40
+ }
41
+ });
26
42
  Object.defineProperty(exports, "committedValue", {
27
43
  enumerable: true,
28
44
  get: function() {
@@ -17,10 +17,20 @@ function preserveShape(original, normalized) {
17
17
  * The value an emptied input commits: `undefined` (omitted) on an optional
18
18
  * field — `null` is not a value of `name?: T`, and atscript >= 0.1.103
19
19
  * rejects it there when the field also carries `@meta.required` — else
20
- * `null`. Shared by the number / decimal / date / datetime / time inputs.
20
+ * `null`. Shared by the number / decimal / date / datetime / time inputs and
21
+ * the native number input of the text control.
21
22
  */
22
23
  function committedValue(value, optional) {
23
24
  return value === null && optional ? void 0 : value;
24
25
  }
26
+ /**
27
+ * The value an emptied text input commits: `undefined` (omitted) on an
28
+ * optional field, like {@link committedValue}; `""` on a required one. Used by
29
+ * the text control (which also renders the reference input's plain-text
30
+ * fallback).
31
+ */
32
+ function committedText(value, optional) {
33
+ return value === "" && optional ? void 0 : value;
34
+ }
25
35
  //#endregion
26
- export { preserveShape as n, committedValue as t };
36
+ export { committedValue as n, preserveShape as r, committedText as t };
@@ -1,2 +1,2 @@
1
- const require_as_action = require("./as-action-C0gSyG19.cjs");
1
+ const require_as_action = require("./as-action-B_vPR2YE.cjs");
2
2
  module.exports = require_as_action.as_action_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-action.vue-CPFAPJbB.mjs";
1
+ import { t as _default } from "./as-action.vue-CQbDa3g4.mjs";
2
2
  export { _default as default };
@@ -1,2 +1,2 @@
1
- import { t as as_action_default } from "./as-action-BOalk1GL.mjs";
1
+ import { t as as_action_default } from "./as-action-BzdLJvyy.mjs";
2
2
  export { as_action_default as default };
@@ -1,4 +1,4 @@
1
- import { o as TAsComponentProps } from "./types-DitKqqD_.mjs";
1
+ import { o as TAsComponentProps } from "./types-B0Ey_eD-.mjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/defaults/as-action.vue.d.ts
@@ -5,8 +5,8 @@ const require_use_as_model_texts = require("./use-as-model-texts-x-ioNOC1.cjs");
5
5
  const require_as_collapsible = require("./as-collapsible-COchVoS0.cjs");
6
6
  const require_as_variant_picker = require("./as-variant-picker-BxOP4dkG.cjs");
7
7
  const require_variant_label = require("./variant-label-CYIvHn4B.cjs");
8
- const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-nwBB3Mdk.cjs");
9
- const require_as_array_clear_btn = require("./as-array-clear-btn-CNSn7HrC.cjs");
8
+ const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-C7f0blhC.cjs");
9
+ const require_as_array_clear_btn = require("./as-array-clear-btn-DSuk9U43.cjs");
10
10
  let vue = require("vue");
11
11
  let _atscript_ui = require("@atscript/ui");
12
12
  //#region src/composables/use-as-array.ts
@@ -5,8 +5,8 @@ import { t as useAsModelTexts } from "./use-as-model-texts-DJf4hBHf.mjs";
5
5
  import { t as as_collapsible_default } from "./as-collapsible-B_YnV9V8.mjs";
6
6
  import { t as as_variant_picker_default } from "./as-variant-picker-DJ_sqKD3.mjs";
7
7
  import { n as useAsDropdown, t as variantLabel } from "./variant-label-zYWRiOjJ.mjs";
8
- import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-DRZT-aIT.mjs";
9
- import { t as as_array_clear_btn_default } from "./as-array-clear-btn-bUM9vztK.mjs";
8
+ import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-fOglspPV.mjs";
9
+ import { t as as_array_clear_btn_default } from "./as-array-clear-btn-DkmJoCjN.mjs";
10
10
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, normalizeClass, openBlock, reactive, ref, renderList, toDisplayString, unref, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
11
11
  import { createFormData, createFormValueResolver, getFieldMeta, isUnionField } from "@atscript/ui";
12
12
  //#region src/composables/use-as-array.ts
package/dist/as-array.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_as_array = require("./as-array-B1s5sXYV.cjs");
1
+ const require_as_array = require("./as-array-DjJ_GA65.cjs");
2
2
  module.exports = require_as_array.as_array_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-array.vue-CPAuKOJp.mjs";
1
+ import { t as _default } from "./as-array.vue-DpKFsuRS.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-ha4DpqUM.mjs";
1
+ import { t as as_array_default } from "./as-array-DnxeuRPB.mjs";
2
2
  export { as_array_default as default };
@@ -1,4 +1,4 @@
1
- import { o as TAsComponentProps } from "./types-DitKqqD_.mjs";
1
+ import { o as TAsComponentProps } from "./types-B0Ey_eD-.mjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/defaults/as-array.vue.d.ts
@@ -1,5 +1,5 @@
1
1
  const require_use_as_locale = require("./use-as-locale-CnNyyqcF.cjs");
2
- const require_as_field_shell = require("./as-field-shell-DviDLKgc.cjs");
2
+ const require_as_field_shell = require("./as-field-shell-rghztVd7.cjs");
3
3
  const require_as_variant_picker = require("./as-variant-picker-BxOP4dkG.cjs");
4
4
  let vue = require("vue");
5
5
  let _atscript_ui = require("@atscript/ui");
@@ -1,5 +1,5 @@
1
1
  import { o as useAsTexts } from "./use-as-locale-BEzm7jbp.mjs";
2
- import { t as as_field_shell_default } from "./as-field-shell-nSZx4aV0.mjs";
2
+ import { t as as_field_shell_default } from "./as-field-shell-IaUBze1S.mjs";
3
3
  import { n as as_optional_clear_default } from "./as-variant-picker-DJ_sqKD3.mjs";
4
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeProps, normalizeClass, openBlock, ref, toDisplayString, unref, watchEffect, withCtx } from "vue";
5
5
  import { optKey, optLabel } from "@atscript/ui";
@@ -1,2 +1,2 @@
1
- const require_as_checkbox = require("./as-checkbox-OKhewGzL.cjs");
1
+ const require_as_checkbox = require("./as-checkbox-52v5CL8Z.cjs");
2
2
  module.exports = require_as_checkbox.as_checkbox_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-checkbox.vue-DTwhk8as.mjs";
1
+ import { t as _default } from "./as-checkbox.vue-Db6OT_lL.mjs";
2
2
  export { _default as default };
@@ -1,2 +1,2 @@
1
- import { t as as_checkbox_default } from "./as-checkbox-Baz513zf.mjs";
1
+ import { t as as_checkbox_default } from "./as-checkbox-BivClBCD.mjs";
2
2
  export { as_checkbox_default as default };
@@ -1,4 +1,4 @@
1
- import { o as TAsComponentProps } from "./types-DitKqqD_.mjs";
1
+ import { o as TAsComponentProps } from "./types-B0Ey_eD-.mjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/defaults/as-checkbox.vue.d.ts
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-collapsible.vue-D-C-9GqT.mjs";
1
+ import { t as _default } from "./as-collapsible.vue-By-ZBZt3.mjs";
2
2
  export { _default as default };
@@ -1,4 +1,4 @@
1
- import { i as TAsCollapsibleSlots, r as TAsCollapsibleProps } from "./types-DitKqqD_.mjs";
1
+ import { i as TAsCollapsibleSlots, r as TAsCollapsibleProps } from "./types-B0Ey_eD-.mjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/as-collapsible.vue.d.ts
@@ -1,7 +1,7 @@
1
- import { t as as_field_shell_default } from "./as-field-shell-nSZx4aV0.mjs";
2
- import { t as as_adornment_shell_default } from "./as-adornment-shell-grq1H0D-.mjs";
3
- import { t as committedValue } from "./_shape-CLX3JSFZ.mjs";
4
- import { n as as_date_control_default, t as useAsDate } from "./use-as-date-B3sBae9e.mjs";
1
+ import { t as as_field_shell_default } from "./as-field-shell-IaUBze1S.mjs";
2
+ import { n as committedValue } from "./_shape-bdsPEB8P.mjs";
3
+ import { t as as_adornment_shell_default } from "./as-adornment-shell-CBaksXGT.mjs";
4
+ import { n as as_date_control_default, t as useAsDate } from "./use-as-date-DgPRL0O2.mjs";
5
5
  import { computed, createBlock, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, unref, withCtx } from "vue";
6
6
  //#endregion
7
7
  //#region src/components/defaults/as-date.vue
@@ -1,7 +1,7 @@
1
- const require_as_field_shell = require("./as-field-shell-DviDLKgc.cjs");
2
- const require_as_adornment_shell = require("./as-adornment-shell-COhqCppW.cjs");
3
- const require__shape = require("./_shape-BAim7zm2.cjs");
4
- const require_use_as_date = require("./use-as-date-Dp3IDhLj.cjs");
1
+ const require_as_field_shell = require("./as-field-shell-rghztVd7.cjs");
2
+ const require__shape = require("./_shape-C-TxQCFa.cjs");
3
+ const require_as_adornment_shell = require("./as-adornment-shell-CmS9BOFm.cjs");
4
+ const require_use_as_date = require("./use-as-date-DFcdIfyr.cjs");
5
5
  let vue = require("vue");
6
6
  //#endregion
7
7
  //#region src/components/defaults/as-date.vue
package/dist/as-date.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_as_date = require("./as-date-4GYZJ-NC.cjs");
1
+ const require_as_date = require("./as-date-HUhD-kZ4.cjs");
2
2
  module.exports = require_as_date.as_date_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-date.vue-Orrtd1W8.mjs";
1
+ import { t as _default } from "./as-date.vue-BUaHHI42.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-VN6VPCZ-.mjs";
1
+ import { t as as_date_default } from "./as-date-Dsv_nimP.mjs";
2
2
  export { as_date_default as default };
@@ -1,4 +1,4 @@
1
- import { o as TAsComponentProps } from "./types-DitKqqD_.mjs";
1
+ import { o as TAsComponentProps } from "./types-B0Ey_eD-.mjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/defaults/as-date.vue.d.ts
@@ -1,7 +1,7 @@
1
- import { t as as_field_shell_default } from "./as-field-shell-nSZx4aV0.mjs";
2
- import { t as as_adornment_shell_default } from "./as-adornment-shell-grq1H0D-.mjs";
3
- import { t as committedValue } from "./_shape-CLX3JSFZ.mjs";
4
- import { n as as_date_control_default, t as useAsDate } from "./use-as-date-B3sBae9e.mjs";
1
+ import { t as as_field_shell_default } from "./as-field-shell-IaUBze1S.mjs";
2
+ import { n as committedValue } from "./_shape-bdsPEB8P.mjs";
3
+ import { t as as_adornment_shell_default } from "./as-adornment-shell-CBaksXGT.mjs";
4
+ import { n as as_date_control_default, t as useAsDate } from "./use-as-date-DgPRL0O2.mjs";
5
5
  import { computed, createBlock, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, unref, withCtx } from "vue";
6
6
  //#endregion
7
7
  //#region src/components/defaults/as-datetime.vue
@@ -1,7 +1,7 @@
1
- const require_as_field_shell = require("./as-field-shell-DviDLKgc.cjs");
2
- const require_as_adornment_shell = require("./as-adornment-shell-COhqCppW.cjs");
3
- const require__shape = require("./_shape-BAim7zm2.cjs");
4
- const require_use_as_date = require("./use-as-date-Dp3IDhLj.cjs");
1
+ const require_as_field_shell = require("./as-field-shell-rghztVd7.cjs");
2
+ const require__shape = require("./_shape-C-TxQCFa.cjs");
3
+ const require_as_adornment_shell = require("./as-adornment-shell-CmS9BOFm.cjs");
4
+ const require_use_as_date = require("./use-as-date-DFcdIfyr.cjs");
5
5
  let vue = require("vue");
6
6
  //#endregion
7
7
  //#region src/components/defaults/as-datetime.vue
@@ -1,2 +1,2 @@
1
- const require_as_datetime = require("./as-datetime-CCN03o-l.cjs");
1
+ const require_as_datetime = require("./as-datetime-CiL-vlD2.cjs");
2
2
  module.exports = require_as_datetime.as_datetime_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-datetime.vue-Cj3rQjQT.mjs";
1
+ import { t as _default } from "./as-datetime.vue-D3WJpAVe.mjs";
2
2
  export { _default as default };
@@ -1,2 +1,2 @@
1
- import { t as as_datetime_default } from "./as-datetime-CWzURHq_.mjs";
1
+ import { t as as_datetime_default } from "./as-datetime-BxMIrM_M.mjs";
2
2
  export { as_datetime_default as default };
@@ -1,4 +1,4 @@
1
- import { o as TAsComponentProps } from "./types-DitKqqD_.mjs";
1
+ import { o as TAsComponentProps } from "./types-B0Ey_eD-.mjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/defaults/as-datetime.vue.d.ts
@@ -1,6 +1,6 @@
1
1
  const require_use_as_locale = require("./use-as-locale-CnNyyqcF.cjs");
2
- const require_as_field_shell = require("./as-field-shell-DviDLKgc.cjs");
3
- const require__shape = require("./_shape-BAim7zm2.cjs");
2
+ const require_as_field_shell = require("./as-field-shell-rghztVd7.cjs");
3
+ const require__shape = require("./_shape-C-TxQCFa.cjs");
4
4
  let vue = require("vue");
5
5
  let _atscript_ui = require("@atscript/ui");
6
6
  //#region src/composables/use-as-decimal.ts
@@ -1,6 +1,6 @@
1
1
  import { a as useAsLocale, o as useAsTexts } from "./use-as-locale-BEzm7jbp.mjs";
2
- import { t as as_field_shell_default } from "./as-field-shell-nSZx4aV0.mjs";
3
- import { n as preserveShape, t as committedValue } from "./_shape-CLX3JSFZ.mjs";
2
+ import { t as as_field_shell_default } from "./as-field-shell-IaUBze1S.mjs";
3
+ import { n as committedValue, r as preserveShape } from "./_shape-bdsPEB8P.mjs";
4
4
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, guardReactiveProps, nextTick, normalizeClass, normalizeProps, openBlock, ref, toDisplayString, unref, watch, withCtx } from "vue";
5
5
  import { enforceScale, formatDecimalForDisplay, getDecimalSeparator, getThousandsSeparator, groupInteger, joinDecimalString, parseDecimalInput, splitDecimalString } from "@atscript/ui";
6
6
  //#region src/composables/use-as-decimal.ts
@@ -1,2 +1,2 @@
1
- const require_as_decimal = require("./as-decimal-BC09yeEc.cjs");
1
+ const require_as_decimal = require("./as-decimal-DA24-Wtp.cjs");
2
2
  module.exports = require_as_decimal.as_decimal_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-decimal.vue-BUoGa9Ni.mjs";
1
+ import { t as _default } from "./as-decimal.vue-BVDyP4LN.mjs";
2
2
  export { _default as default };
@@ -1,2 +1,2 @@
1
- import { t as as_decimal_default } from "./as-decimal-C8ZbnZ-W.mjs";
1
+ import { t as as_decimal_default } from "./as-decimal-DegSeh2G.mjs";
2
2
  export { as_decimal_default as default };
@@ -1,4 +1,4 @@
1
- import { o as TAsComponentProps } from "./types-DitKqqD_.mjs";
1
+ import { o as TAsComponentProps } from "./types-B0Ey_eD-.mjs";
2
2
  import * as vue from "vue";
3
3
 
4
4
  //#region src/components/defaults/as-decimal.vue.d.ts
@@ -2,6 +2,7 @@ import { n as useAsUnionVariant, t as formatIndexedLabelParts } from "./use-form
2
2
  import { o as useAsTexts } from "./use-as-locale-BEzm7jbp.mjs";
3
3
  import { r as useAsFocusFirstAfter } from "./focus-after-toggle-CXzXFIdA.mjs";
4
4
  import { n as as_optional_clear_default, t as as_variant_picker_default } from "./as-variant-picker-DJ_sqKD3.mjs";
5
+ import { n as useEditingHold } from "./_editing-hold-DVfB2wc_.mjs";
5
6
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, ref, renderSlot, toDisplayString, unref, vShow, withDirectives, withKeys, withModifiers } from "vue";
6
7
  //#region src/components/internal/as-no-data.vue?vue&type=script&setup=true&lang.ts
7
8
  const _hoisted_1$1 = {
@@ -65,19 +66,18 @@ const _hoisted_7 = [
65
66
  "title"
66
67
  ];
67
68
  const _hoisted_8 = ["id"];
68
- const _hoisted_9 = { class: "as-field-input-row" };
69
- const _hoisted_10 = {
69
+ const _hoisted_9 = {
70
70
  key: 0,
71
71
  class: "as-field-footer-row"
72
72
  };
73
- const _hoisted_11 = ["id", "role"];
74
- const _hoisted_12 = {
73
+ const _hoisted_10 = ["id", "role"];
74
+ const _hoisted_11 = {
75
75
  key: 1,
76
76
  class: "as-error-slot",
77
77
  "aria-hidden": "true"
78
78
  };
79
- const _hoisted_13 = ["id"];
80
- const _hoisted_14 = ["disabled"];
79
+ const _hoisted_12 = ["id"];
80
+ const _hoisted_13 = ["disabled"];
81
81
  //#endregion
82
82
  //#region src/components/defaults/as-field-shell.vue
83
83
  var as_field_shell_default = /* @__PURE__ */ defineComponent({
@@ -296,9 +296,18 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
296
296
  const hasVariantPicker = unionCtx !== void 0 && unionCtx.variants.length > 1;
297
297
  const labelParts = computed(() => formatIndexedLabelParts(props.label, props.arrayIndex));
298
298
  const { rootRef, enableOptional } = useAsFocusFirstAfter(props.onToggleOptional);
299
- const showOptionalClear = computed(() => !!props.optional && optionalEnabled.value && !props.chromeless);
299
+ const { editing, onFocusin, onFocusout } = useEditingHold();
300
+ const held = computed(() => !!props.optional && editing.value && !optionalEnabled.value);
301
+ const chromeEnabled = computed(() => optionalEnabled.value || held.value);
302
+ let dirtyWithValue = false;
303
+ const shownDirty = computed(() => {
304
+ const dirty = !!props.isDirty;
305
+ if (!held.value) return dirtyWithValue = dirty;
306
+ return dirty || dirtyWithValue;
307
+ });
308
+ const showOptionalClear = computed(() => !!props.optional && chromeEnabled.value && !props.chromeless);
300
309
  const statusId = computed(() => props.statusId || `${props.inputId}-status`);
301
- const showEmptyPlaceholder = computed(() => !!props.optional && !optionalEnabled.value && !props.chromeless && !props.hideEmptyPlaceholder);
310
+ const showEmptyPlaceholder = computed(() => !!props.optional && !chromeEnabled.value && !props.chromeless && !props.hideEmptyPlaceholder);
302
311
  const { t } = useAsTexts();
303
312
  return (_ctx, _cache) => {
304
313
  return withDirectives((openBlock(), createElementBlock("div", {
@@ -306,7 +315,7 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
306
315
  ref: rootRef,
307
316
  class: normalizeClass(["as-default-field", [__props.fieldClass, _ctx.$props.class]]),
308
317
  style: normalizeStyle(_ctx.$props.style),
309
- "data-dirty": __props.isDirty ? "" : void 0
318
+ "data-dirty": shownDirty.value ? "" : void 0
310
319
  }, [
311
320
  createCommentVNode(" Header row: label/header on left, action buttons on right "),
312
321
  _ctx.$slots.header || labelParts.value && !__props.chromeless || __props.onRemove || showOptionalClear.value || unref(hasVariantPicker) ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [
@@ -314,8 +323,8 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
314
323
  key: 0,
315
324
  inputId: __props.inputId,
316
325
  descId: __props.descId,
317
- optionalEnabled: optionalEnabled.value,
318
- isDirty: !!__props.isDirty,
326
+ optionalEnabled: chromeEnabled.value,
327
+ isDirty: shownDirty.value,
319
328
  statusId: statusId.value
320
329
  }) : !__props.chromeless ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [labelParts.value ? (openBlock(), createElementBlock("label", {
321
330
  key: 0,
@@ -339,7 +348,7 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
339
348
  "aria-label": unref(t)("UI_REMOVE"),
340
349
  title: unref(t)("UI_REMOVE"),
341
350
  onClick: _cache[1] || (_cache[1] = (...args) => __props.onRemove && __props.onRemove(...args))
342
- }, [..._cache[3] || (_cache[3] = [createElementVNode("span", {
351
+ }, [..._cache[5] || (_cache[5] = [createElementVNode("span", {
343
352
  class: "as-field-remove-btn-icon",
344
353
  "aria-hidden": "true"
345
354
  }, null, -1)])], 8, _hoisted_7)) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true),
@@ -353,16 +362,20 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
353
362
  kind: __props.type === "textarea" ? "textarea" : "input",
354
363
  "on-edit": unref(enableOptional)
355
364
  }, null, 8, ["kind", "on-edit"])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
356
- createElementVNode("div", _hoisted_9, [renderSlot(_ctx.$slots, "default", {
365
+ createElementVNode("div", {
366
+ class: "as-field-input-row",
367
+ onFocusin: _cache[2] || (_cache[2] = (...args) => unref(onFocusin) && unref(onFocusin)(...args)),
368
+ onFocusout: _cache[3] || (_cache[3] = (...args) => unref(onFocusout) && unref(onFocusout)(...args))
369
+ }, [renderSlot(_ctx.$slots, "default", {
357
370
  inputId: __props.inputId,
358
371
  errorId: __props.errorId,
359
372
  descId: __props.descId
360
- })]),
373
+ })], 32),
361
374
  renderSlot(_ctx.$slots, "after-input", { descId: __props.descId }),
362
- __props.error || __props.hint || __props.formAction || __props.isDirty || _ctx.$slots.status ? (openBlock(), createElementBlock("div", _hoisted_10, [
375
+ __props.error || __props.hint || __props.formAction || shownDirty.value || _ctx.$slots.status ? (openBlock(), createElementBlock("div", _hoisted_9, [
363
376
  createCommentVNode(" `status` owns the whole error/hint/announcement area: overriding it\n replaces the default markup wholesale (keep `statusId` on your own\n node so `aria-describedby` still resolves). "),
364
377
  renderSlot(_ctx.$slots, "status", {
365
- isDirty: !!__props.isDirty,
378
+ isDirty: shownDirty.value,
366
379
  error: __props.error,
367
380
  hint: __props.hint,
368
381
  statusId: statusId.value,
@@ -373,21 +386,21 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
373
386
  id: __props.errorId,
374
387
  class: "as-error-slot",
375
388
  role: __props.error ? "alert" : void 0
376
- }, toDisplayString(__props.error || __props.hint), 9, _hoisted_11)) : (openBlock(), createElementBlock("span", _hoisted_12)),
389
+ }, toDisplayString(__props.error || __props.hint), 9, _hoisted_10)) : (openBlock(), createElementBlock("span", _hoisted_11)),
377
390
  createCommentVNode(" Visually hidden: the `data-dirty` rail is the sighted cue, this\n is its AT counterpart. `role=\"status\"` would make it a live\n region and re-announce on every keystroke — it is referenced\n through `aria-describedby` instead, which AsField appends on\n exactly this `isDirty` condition, so a clean field never points\n at a missing node. "),
378
- __props.isDirty ? (openBlock(), createElementBlock("span", {
391
+ shownDirty.value ? (openBlock(), createElementBlock("span", {
379
392
  key: 2,
380
393
  id: statusId.value,
381
394
  class: "as-field-status"
382
- }, toDisplayString(unref(t)("UI_FORM_MODIFIED")), 9, _hoisted_13)) : createCommentVNode("v-if", true)
395
+ }, toDisplayString(unref(t)("UI_FORM_MODIFIED")), 9, _hoisted_12)) : createCommentVNode("v-if", true)
383
396
  ]),
384
397
  __props.formAction ? (openBlock(), createElementBlock("button", {
385
398
  key: 0,
386
399
  type: "button",
387
400
  class: "as-field-action-link",
388
401
  disabled: __props.disabled,
389
- onClick: _cache[2] || (_cache[2] = ($event) => emit("action", __props.formAction.id))
390
- }, toDisplayString(__props.formAction.label), 9, _hoisted_14)) : createCommentVNode("v-if", true)
402
+ onClick: _cache[4] || (_cache[4] = ($event) => emit("action", __props.formAction.id))
403
+ }, toDisplayString(__props.formAction.label), 9, _hoisted_13)) : createCommentVNode("v-if", true)
391
404
  ])) : createCommentVNode("v-if", true)
392
405
  ], 64))
393
406
  ], 14, _hoisted_1)), [[vShow, !__props.hidden]]);