@atscript/vue-form 0.1.202 → 0.1.203

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 (103) hide show
  1. package/dist/{as-array-BZ_nxqTz.cjs → as-array-CWuMR-2P.cjs} +26 -16
  2. package/dist/{as-array-clear-btn-CzojQsEk.cjs → as-array-clear-btn-BX3HSWel.cjs} +1 -1
  3. package/dist/{as-array-clear-btn-Bi4wDHOv.mjs → as-array-clear-btn-CRfCFJ73.mjs} +1 -1
  4. package/dist/{as-array-ChUcZDS7.mjs → as-array-dttDB3Rg.mjs} +26 -16
  5. package/dist/as-array.cjs +1 -1
  6. package/dist/as-array.mjs +1 -1
  7. package/dist/{as-checkbox-Dcl1hwmW.mjs → as-checkbox-BS0fjlQC.mjs} +3 -3
  8. package/dist/{as-checkbox-DHe7ow33.cjs → as-checkbox-DyA1ncSp.cjs} +3 -3
  9. package/dist/as-checkbox.cjs +1 -1
  10. package/dist/as-checkbox.mjs +1 -1
  11. package/dist/{as-collapsible-DBVrSPb1.cjs → as-collapsible-B0im1dAa.cjs} +1 -1
  12. package/dist/{as-collapsible-Cq4JQZo8.mjs → as-collapsible-B4Vb0XIR.mjs} +1 -1
  13. package/dist/as-collapsible.cjs +1 -1
  14. package/dist/as-collapsible.mjs +1 -1
  15. package/dist/{as-date-DJC3ll7B.mjs → as-date-Wk0mReg2.mjs} +1 -1
  16. package/dist/{as-date-CzpK7FFU.cjs → as-date-bI28vJja.cjs} +1 -1
  17. package/dist/as-date.cjs +1 -1
  18. package/dist/as-date.mjs +1 -1
  19. package/dist/{as-datetime-CU2pYPsb.cjs → as-datetime-Ca-23Nrq.cjs} +1 -1
  20. package/dist/{as-datetime-Bk__Ct69.mjs → as-datetime-F2PdaCh1.mjs} +1 -1
  21. package/dist/as-datetime.cjs +1 -1
  22. package/dist/as-datetime.mjs +1 -1
  23. package/dist/{as-decimal-BAiy9Cjz.mjs → as-decimal-4zD1qPmT.mjs} +1 -1
  24. package/dist/{as-decimal-B6MeEFmb.cjs → as-decimal-CYIBnc-k.cjs} +1 -1
  25. package/dist/as-decimal.cjs +1 -1
  26. package/dist/as-decimal.mjs +1 -1
  27. package/dist/{as-field-B5y4YbI1.cjs → as-field-BdFUGqKv.cjs} +22 -9
  28. package/dist/{as-field-D3EMcOTS.mjs → as-field-U_EtrpNj.mjs} +22 -9
  29. package/dist/{as-field-shell-DfPH23qM.mjs → as-field-shell-DQ30etIq.mjs} +29 -17
  30. package/dist/{as-field-shell-DoVSv3X2.cjs → as-field-shell-ha1iaJnK.cjs} +29 -17
  31. package/dist/as-field-shell.cjs +1 -1
  32. package/dist/as-field-shell.d.cts +1 -1
  33. package/dist/as-field-shell.d.mts +1 -1
  34. package/dist/as-field-shell.mjs +1 -1
  35. package/dist/{as-field-shell.vue-DHIauZOI.d.cts → as-field-shell.vue-CVDPz5RX.d.cts} +2 -1
  36. package/dist/{as-field-shell.vue-Cypm-sNO.d.mts → as-field-shell.vue-Dj34leHW.d.mts} +2 -1
  37. package/dist/as-field.cjs +1 -1
  38. package/dist/as-field.mjs +1 -1
  39. package/dist/{as-form-BICthTGO.cjs → as-form-Dfrq97Tv.cjs} +8 -4
  40. package/dist/{as-form-DCefxLEt.mjs → as-form-WhZH4ozr.mjs} +8 -4
  41. package/dist/as-form.cjs +1 -1
  42. package/dist/as-form.d.cts +1 -1
  43. package/dist/as-form.d.mts +1 -1
  44. package/dist/as-form.mjs +1 -1
  45. package/dist/{as-form.vue-sPeXmeeF.d.mts → as-form.vue-D7J9Mm_V.d.mts} +7 -2
  46. package/dist/{as-form.vue-CHV8k7wP.d.cts → as-form.vue-DEGb6oP3.d.cts} +7 -2
  47. package/dist/{as-input-Wf71dw3g.cjs → as-input-Cr2zcWgm.cjs} +1 -1
  48. package/dist/{as-input-Dl7R32s4.mjs → as-input-Du26WjkP.mjs} +1 -1
  49. package/dist/as-input.cjs +1 -1
  50. package/dist/as-input.mjs +1 -1
  51. package/dist/{as-iterator-D_47pazg.cjs → as-iterator-BgYp1qj4.cjs} +2 -2
  52. package/dist/{as-iterator-DTNgife_.mjs → as-iterator-BvL2pCKj.mjs} +2 -2
  53. package/dist/as-iterator.cjs +1 -1
  54. package/dist/as-iterator.mjs +1 -1
  55. package/dist/{as-multi-select-CaBpEOU2.mjs → as-multi-select-C9yGmtWR.mjs} +1 -1
  56. package/dist/{as-multi-select-BoWBD88H.cjs → as-multi-select-CNRqlh1o.cjs} +1 -1
  57. package/dist/as-multi-select.cjs +1 -1
  58. package/dist/as-multi-select.mjs +1 -1
  59. package/dist/{as-number-CQ6W7cEP.mjs → as-number-CsoSsIJ8.mjs} +1 -1
  60. package/dist/{as-number-BxcjlrtO.cjs → as-number-DEkR-Oud.cjs} +1 -1
  61. package/dist/as-number.cjs +1 -1
  62. package/dist/as-number.mjs +1 -1
  63. package/dist/{as-object-CWqrZQZ1.mjs → as-object-DIEi_L2T.mjs} +12 -9
  64. package/dist/{as-object-BPb5NTBo.cjs → as-object-DZHwEfd8.cjs} +12 -9
  65. package/dist/as-object.cjs +1 -1
  66. package/dist/as-object.mjs +1 -1
  67. package/dist/{as-radio-gmYSDmA0.mjs → as-radio-Bn14VyaN.mjs} +12 -5
  68. package/dist/{as-radio-CjZST1ug.cjs → as-radio-CvIgHH9G.cjs} +12 -5
  69. package/dist/as-radio.cjs +1 -1
  70. package/dist/as-radio.mjs +1 -1
  71. package/dist/{as-ref-DemuzDv8.cjs → as-ref-BNESufCy.cjs} +7 -5
  72. package/dist/{as-ref-BBfZbvOd.mjs → as-ref-DhWEKsYJ.mjs} +7 -5
  73. package/dist/as-ref.cjs +1 -1
  74. package/dist/as-ref.mjs +1 -1
  75. package/dist/{as-select-BhJDP5e1.cjs → as-select-COxfMWYf.cjs} +57 -15
  76. package/dist/{as-select-Dvhdd605.mjs → as-select-Csr2229O.mjs} +57 -15
  77. package/dist/as-select.cjs +1 -1
  78. package/dist/as-select.mjs +1 -1
  79. package/dist/{as-time-CNJj5Jja.mjs → as-time-YMnd789f.mjs} +1 -1
  80. package/dist/{as-time-DLWM1tBe.cjs → as-time-e40w14c7.cjs} +1 -1
  81. package/dist/as-time.cjs +1 -1
  82. package/dist/as-time.mjs +1 -1
  83. package/dist/{as-tuple-0VjDpPCh.cjs → as-tuple-Bb-sQh6T.cjs} +13 -16
  84. package/dist/{as-tuple-C3D1r8nT.mjs → as-tuple-BjMI93bC.mjs} +13 -16
  85. package/dist/as-tuple.cjs +1 -1
  86. package/dist/as-tuple.mjs +1 -1
  87. package/dist/{as-union-Br5-t5Co.cjs → as-union-D6JPYyYf.cjs} +13 -8
  88. package/dist/{as-union-5oOye2iv.mjs → as-union-D7FONvHe.mjs} +13 -8
  89. package/dist/as-union.cjs +1 -1
  90. package/dist/as-union.mjs +1 -1
  91. package/dist/{as-variant-picker-BYrf1YUe.cjs → as-variant-picker-13N8TxuF.cjs} +1 -1
  92. package/dist/{as-variant-picker-3P9wXCUf.mjs → as-variant-picker-VixxxnXA.mjs} +1 -1
  93. package/dist/index.cjs +23 -23
  94. package/dist/index.d.cts +2 -2
  95. package/dist/index.d.mts +2 -2
  96. package/dist/index.mjs +23 -23
  97. package/dist/{use-as-model-texts-DtqNcugR.cjs → use-as-model-texts-BNO2SFQF.cjs} +1 -1
  98. package/dist/{use-as-model-texts-Duq04LpS.mjs → use-as-model-texts-BTFyHNqS.mjs} +1 -1
  99. package/dist/{use-as-value-help-XPeNhfJY.cjs → use-as-value-help-LDhcfxFi.cjs} +1 -1
  100. package/dist/{use-as-value-help-D16evDGm.mjs → use-as-value-help-LQWMkS5m.mjs} +1 -1
  101. package/dist/{use-form-context-7CK50mTi.cjs → use-form-context-d0IcFey0.cjs} +7 -0
  102. package/dist/{use-form-context-ba0N--m6.mjs → use-form-context-p2PucQHk.mjs} +2 -1
  103. package/package.json +10 -10
@@ -1,15 +1,20 @@
1
1
  import { i as useAsFocusFirstAfter } from "./focus-after-toggle-DAwak7c1.mjs";
2
- import { n as useAsUnionVariant, t as formatIndexedLabelParts } from "./use-form-context-ba0N--m6.mjs";
2
+ import { n as useAsUnionVariant, t as formatIndexedLabelParts } from "./use-form-context-p2PucQHk.mjs";
3
3
  import { o as useAsTexts } from "./use-as-locale-CznDr-7i.mjs";
4
- import { n as as_optional_clear_default, t as as_variant_picker_default } from "./as-variant-picker-3P9wXCUf.mjs";
4
+ import { n as as_optional_clear_default, t as as_variant_picker_default } from "./as-variant-picker-VixxxnXA.mjs";
5
5
  import { n as useEditingHold } from "./_editing-hold-C6emgUTM.mjs";
6
6
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, normalizeClass, normalizeStyle, openBlock, ref, renderSlot, toDisplayString, unref, vShow, withDirectives, withKeys, withModifiers } from "vue";
7
7
  //#region src/components/internal/as-no-data.vue?vue&type=script&setup=true&lang.ts
8
- const _hoisted_1$1 = {
8
+ const _hoisted_1$1 = [
9
+ "role",
10
+ "tabindex",
11
+ "data-disabled"
12
+ ];
13
+ const _hoisted_2$1 = {
9
14
  class: "as-no-data-icon",
10
15
  "aria-hidden": "true"
11
16
  };
12
- const _hoisted_2$1 = { class: "as-no-data-text" };
17
+ const _hoisted_3$1 = { class: "as-no-data-text" };
13
18
  //#endregion
14
19
  //#region src/components/internal/as-no-data.vue
15
20
  var as_no_data_default = /* @__PURE__ */ defineComponent({
@@ -17,7 +22,7 @@ var as_no_data_default = /* @__PURE__ */ defineComponent({
17
22
  props: {
18
23
  onEdit: {
19
24
  type: Function,
20
- required: true
25
+ required: false
21
26
  },
22
27
  kind: {
23
28
  type: String,
@@ -33,13 +38,14 @@ var as_no_data_default = /* @__PURE__ */ defineComponent({
33
38
  return (_ctx, _cache) => {
34
39
  return openBlock(), createElementBlock("div", {
35
40
  class: normalizeClass(rootClass.value),
36
- onMouseenter: _cache[0] || (_cache[0] = ($event) => hovered.value = true),
41
+ role: __props.onEdit ? "button" : void 0,
42
+ tabindex: __props.onEdit ? 0 : void 0,
43
+ "data-disabled": __props.onEdit ? void 0 : "",
44
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => hovered.value = !!__props.onEdit),
37
45
  onMouseleave: _cache[1] || (_cache[1] = ($event) => hovered.value = false),
38
- onClick: _cache[2] || (_cache[2] = (...args) => __props.onEdit && __props.onEdit(...args)),
39
- role: "button",
40
- tabindex: "0",
41
- onKeydown: [_cache[3] || (_cache[3] = withKeys((...args) => __props.onEdit && __props.onEdit(...args), ["enter"])), _cache[4] || (_cache[4] = withKeys(withModifiers((...args) => __props.onEdit && __props.onEdit(...args), ["prevent"]), ["space"]))]
42
- }, [createElementVNode("span", _hoisted_1$1, [createElementVNode("span", { class: normalizeClass(hovered.value ? "i-as-field-fill" : "i-as-field-empty") }, null, 2)]), createElementVNode("span", _hoisted_2$1, toDisplayString(unref(t)(hovered.value ? "UI_FORM_CLICK_TO_EDIT" : "UI_FORM_NOT_SET")), 1)], 34);
46
+ onClick: _cache[2] || (_cache[2] = ($event) => __props.onEdit?.()),
47
+ onKeydown: [_cache[3] || (_cache[3] = withKeys(($event) => __props.onEdit?.(), ["enter"])), _cache[4] || (_cache[4] = withKeys(withModifiers(($event) => __props.onEdit?.(), ["prevent"]), ["space"]))]
48
+ }, [createElementVNode("span", _hoisted_2$1, [createElementVNode("span", { class: normalizeClass(hovered.value ? "i-as-field-fill" : "i-as-field-empty") }, null, 2)]), createElementVNode("span", _hoisted_3$1, toDisplayString(unref(t)(hovered.value ? "UI_FORM_CLICK_TO_EDIT" : "UI_FORM_NOT_SET")), 1)], 42, _hoisted_1$1);
43
49
  };
44
50
  }
45
51
  });
@@ -289,6 +295,10 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
289
295
  hideEmptyPlaceholder: {
290
296
  type: Boolean,
291
297
  required: false
298
+ },
299
+ hideOptionalClear: {
300
+ type: Boolean,
301
+ required: false
292
302
  }
293
303
  },
294
304
  emits: ["action"],
@@ -309,7 +319,9 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
309
319
  if (!held.value) return dirtyWithValue = dirty;
310
320
  return dirty || dirtyWithValue;
311
321
  });
312
- const showOptionalClear = computed(() => !!props.optional && chromeEnabled.value && !props.chromeless);
322
+ const editable = computed(() => !props.disabled && !props.readonly);
323
+ const showOptionalClear = computed(() => !!props.optional && chromeEnabled.value && editable.value && !props.chromeless && !props.hideOptionalClear);
324
+ const showRemove = computed(() => !!props.onRemove && editable.value);
313
325
  const statusId = computed(() => props.statusId || `${props.inputId}-status`);
314
326
  const showEmptyPlaceholder = computed(() => !!props.optional && !chromeEnabled.value && !props.chromeless && !props.hideEmptyPlaceholder);
315
327
  const { t } = useAsTexts();
@@ -322,7 +334,7 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
322
334
  "data-dirty": shownDirty.value ? "" : void 0
323
335
  }, [
324
336
  createCommentVNode(" Header row: label/header on left, action buttons on right "),
325
- _ctx.$slots.header || labelParts.value && !__props.chromeless || __props.onRemove || showOptionalClear.value || unref(hasVariantPicker) ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [
337
+ _ctx.$slots.header || labelParts.value && !__props.chromeless || showRemove.value || showOptionalClear.value || unref(hasVariantPicker) ? (openBlock(), createElementBlock("div", _hoisted_2, [createElementVNode("div", _hoisted_3, [
326
338
  _ctx.$slots.header ? renderSlot(_ctx.$slots, "header", {
327
339
  key: 0,
328
340
  inputId: __props.inputId,
@@ -339,12 +351,12 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
339
351
  unref(hasVariantPicker) ? (openBlock(), createBlock(as_variant_picker_default, {
340
352
  key: 2,
341
353
  "union-context": unref(unionCtx),
342
- disabled: __props.disabled
354
+ disabled: !editable.value
343
355
  }, null, 8, ["union-context", "disabled"])) : createCommentVNode("v-if", true)
344
- ]), showOptionalClear.value || __props.onRemove ? (openBlock(), createElementBlock("div", _hoisted_6, [showOptionalClear.value ? (openBlock(), createBlock(as_optional_clear_default, {
356
+ ]), showOptionalClear.value || showRemove.value ? (openBlock(), createElementBlock("div", _hoisted_6, [showOptionalClear.value ? (openBlock(), createBlock(as_optional_clear_default, {
345
357
  key: 0,
346
358
  onClear: _cache[0] || (_cache[0] = ($event) => __props.onToggleOptional?.(false))
347
- })) : __props.onRemove ? (openBlock(), createElementBlock("button", {
359
+ })) : showRemove.value ? (openBlock(), createElementBlock("button", {
348
360
  key: 1,
349
361
  type: "button",
350
362
  class: "as-field-remove-btn",
@@ -364,7 +376,7 @@ var as_field_shell_default = /* @__PURE__ */ defineComponent({
364
376
  showEmptyPlaceholder.value ? (openBlock(), createBlock(as_no_data_default, {
365
377
  key: 2,
366
378
  kind: __props.type === "textarea" ? "textarea" : "input",
367
- "on-edit": unref(enableOptional)
379
+ "on-edit": editable.value ? unref(enableOptional) : void 0
368
380
  }, null, 8, ["kind", "on-edit"])) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
369
381
  createElementVNode("div", {
370
382
  class: "as-field-input-row",
@@ -1,15 +1,20 @@
1
1
  const require_focus_after_toggle = require("./focus-after-toggle-BhZGqrUK.cjs");
2
- const require_use_form_context = require("./use-form-context-7CK50mTi.cjs");
2
+ const require_use_form_context = require("./use-form-context-d0IcFey0.cjs");
3
3
  const require_use_as_locale = require("./use-as-locale-eo7FyfaZ.cjs");
4
- const require_as_variant_picker = require("./as-variant-picker-BYrf1YUe.cjs");
4
+ const require_as_variant_picker = require("./as-variant-picker-13N8TxuF.cjs");
5
5
  const require__editing_hold = require("./_editing-hold-Bj0kZjCr.cjs");
6
6
  let vue = require("vue");
7
7
  //#region src/components/internal/as-no-data.vue?vue&type=script&setup=true&lang.ts
8
- const _hoisted_1$1 = {
8
+ const _hoisted_1$1 = [
9
+ "role",
10
+ "tabindex",
11
+ "data-disabled"
12
+ ];
13
+ const _hoisted_2$1 = {
9
14
  class: "as-no-data-icon",
10
15
  "aria-hidden": "true"
11
16
  };
12
- const _hoisted_2$1 = { class: "as-no-data-text" };
17
+ const _hoisted_3$1 = { class: "as-no-data-text" };
13
18
  //#endregion
14
19
  //#region src/components/internal/as-no-data.vue
15
20
  var as_no_data_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -17,7 +22,7 @@ var as_no_data_default = /* @__PURE__ */ (0, vue.defineComponent)({
17
22
  props: {
18
23
  onEdit: {
19
24
  type: Function,
20
- required: true
25
+ required: false
21
26
  },
22
27
  kind: {
23
28
  type: String,
@@ -33,13 +38,14 @@ var as_no_data_default = /* @__PURE__ */ (0, vue.defineComponent)({
33
38
  return (_ctx, _cache) => {
34
39
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
35
40
  class: (0, vue.normalizeClass)(rootClass.value),
36
- onMouseenter: _cache[0] || (_cache[0] = ($event) => hovered.value = true),
41
+ role: __props.onEdit ? "button" : void 0,
42
+ tabindex: __props.onEdit ? 0 : void 0,
43
+ "data-disabled": __props.onEdit ? void 0 : "",
44
+ onMouseenter: _cache[0] || (_cache[0] = ($event) => hovered.value = !!__props.onEdit),
37
45
  onMouseleave: _cache[1] || (_cache[1] = ($event) => hovered.value = false),
38
- onClick: _cache[2] || (_cache[2] = (...args) => __props.onEdit && __props.onEdit(...args)),
39
- role: "button",
40
- tabindex: "0",
41
- onKeydown: [_cache[3] || (_cache[3] = (0, vue.withKeys)((...args) => __props.onEdit && __props.onEdit(...args), ["enter"])), _cache[4] || (_cache[4] = (0, vue.withKeys)((0, vue.withModifiers)((...args) => __props.onEdit && __props.onEdit(...args), ["prevent"]), ["space"]))]
42
- }, [(0, vue.createElementVNode)("span", _hoisted_1$1, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(hovered.value ? "i-as-field-fill" : "i-as-field-empty") }, null, 2)]), (0, vue.createElementVNode)("span", _hoisted_2$1, (0, vue.toDisplayString)((0, vue.unref)(t)(hovered.value ? "UI_FORM_CLICK_TO_EDIT" : "UI_FORM_NOT_SET")), 1)], 34);
46
+ onClick: _cache[2] || (_cache[2] = ($event) => __props.onEdit?.()),
47
+ onKeydown: [_cache[3] || (_cache[3] = (0, vue.withKeys)(($event) => __props.onEdit?.(), ["enter"])), _cache[4] || (_cache[4] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => __props.onEdit?.(), ["prevent"]), ["space"]))]
48
+ }, [(0, vue.createElementVNode)("span", _hoisted_2$1, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(hovered.value ? "i-as-field-fill" : "i-as-field-empty") }, null, 2)]), (0, vue.createElementVNode)("span", _hoisted_3$1, (0, vue.toDisplayString)((0, vue.unref)(t)(hovered.value ? "UI_FORM_CLICK_TO_EDIT" : "UI_FORM_NOT_SET")), 1)], 42, _hoisted_1$1);
43
49
  };
44
50
  }
45
51
  });
@@ -289,6 +295,10 @@ var as_field_shell_default = /* @__PURE__ */ (0, vue.defineComponent)({
289
295
  hideEmptyPlaceholder: {
290
296
  type: Boolean,
291
297
  required: false
298
+ },
299
+ hideOptionalClear: {
300
+ type: Boolean,
301
+ required: false
292
302
  }
293
303
  },
294
304
  emits: ["action"],
@@ -309,7 +319,9 @@ var as_field_shell_default = /* @__PURE__ */ (0, vue.defineComponent)({
309
319
  if (!held.value) return dirtyWithValue = dirty;
310
320
  return dirty || dirtyWithValue;
311
321
  });
312
- const showOptionalClear = (0, vue.computed)(() => !!props.optional && chromeEnabled.value && !props.chromeless);
322
+ const editable = (0, vue.computed)(() => !props.disabled && !props.readonly);
323
+ const showOptionalClear = (0, vue.computed)(() => !!props.optional && chromeEnabled.value && editable.value && !props.chromeless && !props.hideOptionalClear);
324
+ const showRemove = (0, vue.computed)(() => !!props.onRemove && editable.value);
313
325
  const statusId = (0, vue.computed)(() => props.statusId || `${props.inputId}-status`);
314
326
  const showEmptyPlaceholder = (0, vue.computed)(() => !!props.optional && !chromeEnabled.value && !props.chromeless && !props.hideEmptyPlaceholder);
315
327
  const { t } = require_use_as_locale.useAsTexts();
@@ -322,7 +334,7 @@ var as_field_shell_default = /* @__PURE__ */ (0, vue.defineComponent)({
322
334
  "data-dirty": shownDirty.value ? "" : void 0
323
335
  }, [
324
336
  (0, vue.createCommentVNode)(" Header row: label/header on left, action buttons on right "),
325
- _ctx.$slots.header || labelParts.value && !__props.chromeless || __props.onRemove || showOptionalClear.value || (0, vue.unref)(hasVariantPicker) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2, [(0, vue.createElementVNode)("div", _hoisted_3, [
337
+ _ctx.$slots.header || labelParts.value && !__props.chromeless || showRemove.value || showOptionalClear.value || (0, vue.unref)(hasVariantPicker) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2, [(0, vue.createElementVNode)("div", _hoisted_3, [
326
338
  _ctx.$slots.header ? (0, vue.renderSlot)(_ctx.$slots, "header", {
327
339
  key: 0,
328
340
  inputId: __props.inputId,
@@ -339,12 +351,12 @@ var as_field_shell_default = /* @__PURE__ */ (0, vue.defineComponent)({
339
351
  (0, vue.unref)(hasVariantPicker) ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_variant_picker.as_variant_picker_default, {
340
352
  key: 2,
341
353
  "union-context": (0, vue.unref)(unionCtx),
342
- disabled: __props.disabled
354
+ disabled: !editable.value
343
355
  }, null, 8, ["union-context", "disabled"])) : (0, vue.createCommentVNode)("v-if", true)
344
- ]), showOptionalClear.value || __props.onRemove ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6, [showOptionalClear.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_variant_picker.as_optional_clear_default, {
356
+ ]), showOptionalClear.value || showRemove.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6, [showOptionalClear.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_variant_picker.as_optional_clear_default, {
345
357
  key: 0,
346
358
  onClear: _cache[0] || (_cache[0] = ($event) => __props.onToggleOptional?.(false))
347
- })) : __props.onRemove ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
359
+ })) : showRemove.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
348
360
  key: 1,
349
361
  type: "button",
350
362
  class: "as-field-remove-btn",
@@ -364,7 +376,7 @@ var as_field_shell_default = /* @__PURE__ */ (0, vue.defineComponent)({
364
376
  showEmptyPlaceholder.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(as_no_data_default, {
365
377
  key: 2,
366
378
  kind: __props.type === "textarea" ? "textarea" : "input",
367
- "on-edit": (0, vue.unref)(enableOptional)
379
+ "on-edit": editable.value ? (0, vue.unref)(enableOptional) : void 0
368
380
  }, null, 8, ["kind", "on-edit"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 3 }, [
369
381
  (0, vue.createElementVNode)("div", {
370
382
  class: "as-field-input-row",
@@ -1,2 +1,2 @@
1
- const require_as_field_shell = require("./as-field-shell-DoVSv3X2.cjs");
1
+ const require_as_field_shell = require("./as-field-shell-ha1iaJnK.cjs");
2
2
  module.exports = require_as_field_shell.as_field_shell_default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-field-shell.vue-DHIauZOI.cjs";
1
+ import { t as _default } from "./as-field-shell.vue-CVDPz5RX.cjs";
2
2
  export = _default;
@@ -1,2 +1,2 @@
1
- import { t as _default } from "./as-field-shell.vue-Cypm-sNO.mjs";
1
+ import { t as _default } from "./as-field-shell.vue-Dj34leHW.mjs";
2
2
  export { _default as default };
@@ -1,2 +1,2 @@
1
- import { t as as_field_shell_default } from "./as-field-shell-DfPH23qM.mjs";
1
+ import { t as as_field_shell_default } from "./as-field-shell-DQ30etIq.mjs";
2
2
  export { as_field_shell_default as default };
@@ -5,7 +5,8 @@ import * as vue from "vue";
5
5
  type __VLS_Props = TAsComponentProps & {
6
6
  fieldClass?: string; /** Suppress all default chrome (label/description/clear/placeholder) — for fields with inline headers (e.g. checkbox). */
7
7
  chromeless?: boolean; /** Skip the empty-state placeholder; render the input slot directly (e.g. radio group, where unchecked = empty). */
8
- hideEmptyPlaceholder?: boolean;
8
+ hideEmptyPlaceholder?: boolean; /** Skip the label-row unset ×: the control unsets the field itself (e.g. the reference field's own ×). */
9
+ hideOptionalClear?: boolean;
9
10
  };
10
11
  declare var __VLS_1: {
11
12
  inputId: string;
@@ -5,7 +5,8 @@ import * as vue from "vue";
5
5
  type __VLS_Props = TAsComponentProps & {
6
6
  fieldClass?: string; /** Suppress all default chrome (label/description/clear/placeholder) — for fields with inline headers (e.g. checkbox). */
7
7
  chromeless?: boolean; /** Skip the empty-state placeholder; render the input slot directly (e.g. radio group, where unchecked = empty). */
8
- hideEmptyPlaceholder?: boolean;
8
+ hideEmptyPlaceholder?: boolean; /** Skip the label-row unset ×: the control unsets the field itself (e.g. the reference field's own ×). */
9
+ hideOptionalClear?: boolean;
9
10
  };
10
11
  declare var __VLS_1: {
11
12
  inputId: string;
package/dist/as-field.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_as_field = require("./as-field-B5y4YbI1.cjs");
1
+ const require_as_field = require("./as-field-BdFUGqKv.cjs");
2
2
  module.exports = require_as_field.as_field_default;
package/dist/as-field.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as as_field_default } from "./as-field-D3EMcOTS.mjs";
1
+ import { t as as_field_default } from "./as-field-U_EtrpNj.mjs";
2
2
  export { as_field_default as default };
@@ -1,10 +1,10 @@
1
1
  const require_focus_after_toggle = require("./focus-after-toggle-BhZGqrUK.cjs");
2
- const require_use_form_context = require("./use-form-context-7CK50mTi.cjs");
2
+ const require_use_form_context = require("./use-form-context-d0IcFey0.cjs");
3
3
  const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-ApstV9NL.cjs");
4
- const require_use_as_value_help = require("./use-as-value-help-XPeNhfJY.cjs");
4
+ const require_use_as_value_help = require("./use-as-value-help-LDhcfxFi.cjs");
5
5
  const require_use_as_locale = require("./use-as-locale-eo7FyfaZ.cjs");
6
- const require_as_field = require("./as-field-B5y4YbI1.cjs");
7
- const require_as_iterator = require("./as-iterator-D_47pazg.cjs");
6
+ const require_as_field = require("./as-field-BdFUGqKv.cjs");
7
+ const require_as_iterator = require("./as-iterator-BgYp1qj4.cjs");
8
8
  let vue = require("vue");
9
9
  let _atscript_ui = require("@atscript/ui");
10
10
  //#region src/composables/use-as-form-patch.ts
@@ -447,6 +447,10 @@ function useAsForm(options) {
447
447
  if (patch) (0, vue.provide)(require_use_form_context.FORM_PATCH_KEY, patch);
448
448
  (0, vue.provide)(require_use_form_context.ROOT_DATA_KEY, data);
449
449
  (0, vue.provide)(require_use_form_context.PATH_PREFIX_KEY, (0, vue.computed)(() => ""));
450
+ (0, vue.provide)(require_use_form_context.LOCK_KEY, {
451
+ disabled: false,
452
+ readonly: false
453
+ });
450
454
  (0, vue.provide)(require_use_form_context.TYPES_KEY, (0, vue.computed)(() => options.types?.() ?? {}));
451
455
  (0, vue.provide)(require_use_form_context.COMPONENTS_KEY, (0, vue.computed)(() => options.components?.()));
452
456
  (0, vue.provide)(require_use_form_context.HIDE_ROOT_TITLE_KEY, options.hideRootTitle?.() === true);
@@ -1,10 +1,10 @@
1
1
  import { r as resetKeepingFocus } from "./focus-after-toggle-DAwak7c1.mjs";
2
- import { _ as PATH_PREFIX_KEY, a as CHANGE_HANDLER_KEY, c as ERRORS_KEY, d as FORM_NORMALIZED_DATA_KEY, f as FORM_PATCH_KEY, g as MODEL_TEXTS_KEY, i as ACTION_HANDLER_KEY, l as FORM_CONTEXT_KEY, m as HIDE_ROOT_TITLE_KEY, o as COMPONENTS_KEY, p as FORM_STATE_KEY, s as DISMISS_EXTERNAL_AT_KEY, u as FORM_DATA_KEY, v as ROOT_DATA_KEY, y as TYPES_KEY } from "./use-form-context-ba0N--m6.mjs";
2
+ import { _ as MODEL_TEXTS_KEY, a as CHANGE_HANDLER_KEY, b as TYPES_KEY, c as ERRORS_KEY, d as FORM_NORMALIZED_DATA_KEY, f as FORM_PATCH_KEY, g as LOCK_KEY, i as ACTION_HANDLER_KEY, l as FORM_CONTEXT_KEY, m as HIDE_ROOT_TITLE_KEY, o as COMPONENTS_KEY, p as FORM_STATE_KEY, s as DISMISS_EXTERNAL_AT_KEY, u as FORM_DATA_KEY, v as PATH_PREFIX_KEY, y as ROOT_DATA_KEY } from "./use-form-context-p2PucQHk.mjs";
3
3
  import { i as useAsNestedSectionsStore, n as provideAsNestedSectionsStore, t as DESCENDANT_ERROR_COUNTS_KEY } from "./use-as-nested-sections-store-CkrMJbnN.mjs";
4
- import { t as CLIENT_FACTORY_KEY } from "./use-as-value-help-D16evDGm.mjs";
4
+ import { t as CLIENT_FACTORY_KEY } from "./use-as-value-help-LQWMkS5m.mjs";
5
5
  import { o as useAsTexts } from "./use-as-locale-CznDr-7i.mjs";
6
- import { t as as_field_default } from "./as-field-D3EMcOTS.mjs";
7
- import { t as as_iterator_default } from "./as-iterator-DTNgife_.mjs";
6
+ import { t as as_field_default } from "./as-field-U_EtrpNj.mjs";
7
+ import { t as as_iterator_default } from "./as-iterator-BvL2pCKj.mjs";
8
8
  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";
9
9
  import { FORM_ERROR_KEY, 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, createFormData, createFormValueResolver, deepClone, deepEqual, deleteByPath, getByPath, getDeclaredFormActions, getFormValidator, iteratePathAncestors, mergeErrorMaps, omitPaths, omitSkippedNavFields, resolveFormProp, setByPath, unionVariantChanged } from "@atscript/ui";
10
10
  //#region src/composables/use-as-form-patch.ts
@@ -447,6 +447,10 @@ function useAsForm(options) {
447
447
  if (patch) provide(FORM_PATCH_KEY, patch);
448
448
  provide(ROOT_DATA_KEY, data);
449
449
  provide(PATH_PREFIX_KEY, computed(() => ""));
450
+ provide(LOCK_KEY, {
451
+ disabled: false,
452
+ readonly: false
453
+ });
450
454
  provide(TYPES_KEY, computed(() => options.types?.() ?? {}));
451
455
  provide(COMPONENTS_KEY, computed(() => options.components?.()));
452
456
  provide(HIDE_ROOT_TITLE_KEY, options.hideRootTitle?.() === true);
package/dist/as-form.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_as_form = require("./as-form-BICthTGO.cjs");
1
+ const require_as_form = require("./as-form-Dfrq97Tv.cjs");
2
2
  module.exports = require_as_form.as_form_default;
@@ -1,2 +1,2 @@
1
- import { n as _default, t as Props } from "./as-form.vue-CHV8k7wP.cjs";
1
+ import { n as _default, t as Props } from "./as-form.vue-DEGb6oP3.cjs";
2
2
  export { Props, _default as default };
@@ -1,2 +1,2 @@
1
- import { n as _default, t as Props } from "./as-form.vue-sPeXmeeF.mjs";
1
+ import { n as _default, t as Props } from "./as-form.vue-D7J9Mm_V.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-DCefxLEt.mjs";
1
+ import { t as as_form_default } from "./as-form-WhZH4ozr.mjs";
2
2
  export { as_form_default as default };
@@ -164,8 +164,13 @@ interface UseAsArrayReturn {
164
164
  * Manages stable keys, add/remove with constraints, and item field resolution.
165
165
  * Union item types are handled transparently — AsUnion manages variant state locally.
166
166
  * Used by the default `AsArray` component and available for custom array components.
167
+ *
168
+ * A locked array — disabled or read-only, its own or a parent's (the state
169
+ * `<AsField>` hands to the fields inside it) — has `canAdd` / `canRemove`
170
+ * `false`, and `addItem` / `removeItem` / `clear` do nothing. `locked`
171
+ * overrides that state.
167
172
  */
168
- declare function useAsArray(field: FormArrayFieldDef, disabled?: ComputedRef<boolean>): UseAsArrayReturn;
173
+ declare function useAsArray(field: FormArrayFieldDef, locked?: ComputedRef<boolean>): UseAsArrayReturn;
169
174
  //#endregion
170
175
  //#region src/composables/use-as-tuple.d.ts
171
176
  interface UseAsTupleReturn {
@@ -900,8 +905,8 @@ interface Props<TF, TC> {
900
905
  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<{
901
906
  props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
902
907
  onError?: ((errors: TAsFormError[]) => any) | undefined;
903
- onSubmit?: ((data: TAsFormValue<TFormData>) => any) | undefined;
904
908
  onAction?: ((name: string, data: TAsFormValue<TFormData>) => any) | undefined;
909
+ onSubmit?: ((data: TAsFormValue<TFormData>) => any) | undefined;
905
910
  "onUnsupported-action"?: ((name: string, data: TAsFormValue<TFormData>) => any) | undefined;
906
911
  onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TAsFormValue<TFormData>) => any) | undefined;
907
912
  }> & (typeof globalThis extends {
@@ -164,8 +164,13 @@ interface UseAsArrayReturn {
164
164
  * Manages stable keys, add/remove with constraints, and item field resolution.
165
165
  * Union item types are handled transparently — AsUnion manages variant state locally.
166
166
  * Used by the default `AsArray` component and available for custom array components.
167
+ *
168
+ * A locked array — disabled or read-only, its own or a parent's (the state
169
+ * `<AsField>` hands to the fields inside it) — has `canAdd` / `canRemove`
170
+ * `false`, and `addItem` / `removeItem` / `clear` do nothing. `locked`
171
+ * overrides that state.
167
172
  */
168
- declare function useAsArray(field: FormArrayFieldDef, disabled?: ComputedRef<boolean>): UseAsArrayReturn;
173
+ declare function useAsArray(field: FormArrayFieldDef, locked?: ComputedRef<boolean>): UseAsArrayReturn;
169
174
  //#endregion
170
175
  //#region src/composables/use-as-tuple.d.ts
171
176
  interface UseAsTupleReturn {
@@ -900,8 +905,8 @@ interface Props<TF, TC> {
900
905
  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<{
901
906
  props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
902
907
  onError?: ((errors: TAsFormError[]) => any) | undefined;
903
- onSubmit?: ((data: TAsFormValue<TFormData>) => any) | undefined;
904
908
  onAction?: ((name: string, data: TAsFormValue<TFormData>) => any) | undefined;
909
+ onSubmit?: ((data: TAsFormValue<TFormData>) => any) | undefined;
905
910
  "onUnsupported-action"?: ((name: string, data: TAsFormValue<TFormData>) => any) | undefined;
906
911
  onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TAsFormValue<TFormData>) => any) | undefined;
907
912
  }> & (typeof globalThis extends {
@@ -1,4 +1,4 @@
1
- const require_as_field_shell = require("./as-field-shell-DoVSv3X2.cjs");
1
+ const require_as_field_shell = require("./as-field-shell-ha1iaJnK.cjs");
2
2
  const require_as_input_control = require("./as-input-control-D8xoJfr7.cjs");
3
3
  const require_as_adornment_shell = require("./as-adornment-shell-CmS9BOFm.cjs");
4
4
  let vue = require("vue");
@@ -1,4 +1,4 @@
1
- import { t as as_field_shell_default } from "./as-field-shell-DfPH23qM.mjs";
1
+ import { t as as_field_shell_default } from "./as-field-shell-DQ30etIq.mjs";
2
2
  import { t as as_input_control_default } from "./as-input-control-Wygcey6h.mjs";
3
3
  import { t as as_adornment_shell_default } from "./as-adornment-shell-CBaksXGT.mjs";
4
4
  import { computed, createBlock, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeProps, openBlock, withCtx } from "vue";
package/dist/as-input.cjs CHANGED
@@ -1,2 +1,2 @@
1
- const require_as_input = require("./as-input-Wf71dw3g.cjs");
1
+ const require_as_input = require("./as-input-Cr2zcWgm.cjs");
2
2
  module.exports = require_as_input.as_input_default;
package/dist/as-input.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as as_input_default } from "./as-input-Dl7R32s4.mjs";
1
+ import { t as as_input_default } from "./as-input-Du26WjkP.mjs";
2
2
  export { as_input_default as default };
@@ -1,5 +1,5 @@
1
- const require_use_form_context = require("./use-form-context-7CK50mTi.cjs");
2
- const require_as_field = require("./as-field-B5y4YbI1.cjs");
1
+ const require_use_form_context = require("./use-form-context-d0IcFey0.cjs");
2
+ const require_as_field = require("./as-field-BdFUGqKv.cjs");
3
3
  let vue = require("vue");
4
4
  let _atscript_ui = require("@atscript/ui");
5
5
  //#region src/composables/use-as-level.ts
@@ -1,5 +1,5 @@
1
- import { _ as PATH_PREFIX_KEY, h as LEVEL_KEY } from "./use-form-context-ba0N--m6.mjs";
2
- import { t as as_field_default } from "./as-field-D3EMcOTS.mjs";
1
+ import { h as LEVEL_KEY, v as PATH_PREFIX_KEY } from "./use-form-context-p2PucQHk.mjs";
2
+ import { t as as_field_default } from "./as-field-U_EtrpNj.mjs";
3
3
  import { Fragment, computed, createBlock, createElementBlock, defineComponent, inject, openBlock, provide, renderList } from "vue";
4
4
  import { joinPath } from "@atscript/ui";
5
5
  //#region src/composables/use-as-level.ts
@@ -1,2 +1,2 @@
1
- const require_as_iterator = require("./as-iterator-D_47pazg.cjs");
1
+ const require_as_iterator = require("./as-iterator-BgYp1qj4.cjs");
2
2
  module.exports = require_as_iterator.as_iterator_default;
@@ -1,2 +1,2 @@
1
- import { t as as_iterator_default } from "./as-iterator-DTNgife_.mjs";
1
+ import { t as as_iterator_default } from "./as-iterator-BvL2pCKj.mjs";
2
2
  export { as_iterator_default as default };
@@ -1,5 +1,5 @@
1
1
  import { o as useAsTexts } from "./use-as-locale-CznDr-7i.mjs";
2
- import { t as as_field_shell_default } from "./as-field-shell-DfPH23qM.mjs";
2
+ import { t as as_field_shell_default } from "./as-field-shell-DQ30etIq.mjs";
3
3
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, openBlock, ref, renderList, toDisplayString, unref, withCtx, withModifiers } from "vue";
4
4
  import { hasFieldMeta, optKey, optLabel, optionValue } from "@atscript/ui";
5
5
  import { ComboboxAnchor, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxPortal, ComboboxRoot, ComboboxViewport, TagsInputInput, TagsInputItem, TagsInputItemDelete, TagsInputItemText, TagsInputRoot } from "reka-ui";
@@ -1,5 +1,5 @@
1
1
  const require_use_as_locale = require("./use-as-locale-eo7FyfaZ.cjs");
2
- const require_as_field_shell = require("./as-field-shell-DoVSv3X2.cjs");
2
+ const require_as_field_shell = require("./as-field-shell-ha1iaJnK.cjs");
3
3
  let vue = require("vue");
4
4
  let _atscript_ui = require("@atscript/ui");
5
5
  let reka_ui = require("reka-ui");
@@ -1,2 +1,2 @@
1
- const require_as_multi_select = require("./as-multi-select-BoWBD88H.cjs");
1
+ const require_as_multi_select = require("./as-multi-select-CNRqlh1o.cjs");
2
2
  module.exports = require_as_multi_select.as_multi_select_default;
@@ -1,2 +1,2 @@
1
- import { t as as_multi_select_default } from "./as-multi-select-CaBpEOU2.mjs";
1
+ import { t as as_multi_select_default } from "./as-multi-select-C9yGmtWR.mjs";
2
2
  export { as_multi_select_default as default };
@@ -1,6 +1,6 @@
1
1
  import { a as useAsLocale } from "./use-as-locale-CznDr-7i.mjs";
2
2
  import { n as committedValue } from "./_shape-DhwW2SvD.mjs";
3
- import { t as as_field_shell_default } from "./as-field-shell-DfPH23qM.mjs";
3
+ import { t as as_field_shell_default } from "./as-field-shell-DQ30etIq.mjs";
4
4
  import { t as as_input_control_default } from "./as-input-control-Wygcey6h.mjs";
5
5
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, mergeProps, normalizeClass, normalizeProps, openBlock, ref, toDisplayString, withCtx } from "vue";
6
6
  import { getDecimalSeparator, parseDecimalInput } from "@atscript/ui";
@@ -1,6 +1,6 @@
1
1
  const require_use_as_locale = require("./use-as-locale-eo7FyfaZ.cjs");
2
2
  const require__shape = require("./_shape-BDO-1MzF.cjs");
3
- const require_as_field_shell = require("./as-field-shell-DoVSv3X2.cjs");
3
+ const require_as_field_shell = require("./as-field-shell-ha1iaJnK.cjs");
4
4
  const require_as_input_control = require("./as-input-control-D8xoJfr7.cjs");
5
5
  let vue = require("vue");
6
6
  let _atscript_ui = require("@atscript/ui");
@@ -1,2 +1,2 @@
1
- const require_as_number = require("./as-number-BxcjlrtO.cjs");
1
+ const require_as_number = require("./as-number-DEkR-Oud.cjs");
2
2
  module.exports = require_as_number.as_number_default;
@@ -1,2 +1,2 @@
1
- import { t as as_number_default } from "./as-number-CQ6W7cEP.mjs";
1
+ import { t as as_number_default } from "./as-number-CsoSsIJ8.mjs";
2
2
  export { as_number_default as default };
@@ -1,8 +1,8 @@
1
- import { n as useAsUnionVariant } from "./use-form-context-ba0N--m6.mjs";
1
+ import { n as useAsUnionVariant } from "./use-form-context-p2PucQHk.mjs";
2
2
  import { o as useAsTexts } from "./use-as-locale-CznDr-7i.mjs";
3
- import { t as as_iterator_default } from "./as-iterator-DTNgife_.mjs";
4
- import { t as as_collapsible_default } from "./as-collapsible-Cq4JQZo8.mjs";
5
- import { n as as_optional_clear_default, t as as_variant_picker_default } from "./as-variant-picker-3P9wXCUf.mjs";
3
+ import { t as as_iterator_default } from "./as-iterator-BvL2pCKj.mjs";
4
+ import { t as as_collapsible_default } from "./as-collapsible-B4Vb0XIR.mjs";
5
+ import { n as as_optional_clear_default, t as as_variant_picker_default } from "./as-variant-picker-VixxxnXA.mjs";
6
6
  import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-C1Ol6KO2.mjs";
7
7
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, useTemplateRef, vShow, withCtx, withDirectives, withModifiers } from "vue";
8
8
  import { isObjectField } from "@atscript/ui";
@@ -20,7 +20,8 @@ const _hoisted_3 = [
20
20
  "aria-label",
21
21
  "title"
22
22
  ];
23
- const _hoisted_4 = {
23
+ const _hoisted_4 = ["disabled"];
24
+ const _hoisted_5 = {
24
25
  key: 0,
25
26
  class: "as-collapsible-description"
26
27
  };
@@ -230,6 +231,7 @@ var as_object_default = /* @__PURE__ */ defineComponent({
230
231
  const props = __props;
231
232
  const objectDef = computed(() => isObjectField(props.field) ? props.field.objectDef : void 0);
232
233
  const optionalEnabled = computed(() => props.model?.value != null);
234
+ const locked = computed(() => !!props.disabled || !!props.readonly);
233
235
  const unionCtx = useAsUnionVariant();
234
236
  const hasVariantPicker = computed(() => unionCtx !== void 0 && unionCtx.variants.length > 1);
235
237
  const level = computed(() => props.level ?? 0);
@@ -272,9 +274,9 @@ var as_object_default = /* @__PURE__ */ defineComponent({
272
274
  "title-extras": withCtx(() => [hasVariantPicker.value ? (openBlock(), createBlock(as_variant_picker_default, {
273
275
  key: 0,
274
276
  "union-context": unref(unionCtx),
275
- disabled: __props.disabled
277
+ disabled: locked.value
276
278
  }, null, 8, ["union-context", "disabled"])) : createCommentVNode("v-if", true)]),
277
- actions: withCtx(() => [__props.onRemove ? (openBlock(), createElementBlock("button", {
279
+ actions: withCtx(() => [__props.onRemove && !locked.value ? (openBlock(), createElementBlock("button", {
278
280
  key: 0,
279
281
  type: "button",
280
282
  class: "as-field-remove-btn",
@@ -285,7 +287,7 @@ var as_object_default = /* @__PURE__ */ defineComponent({
285
287
  }, [..._cache[2] || (_cache[2] = [createElementVNode("span", {
286
288
  class: "as-field-remove-btn-icon",
287
289
  "aria-hidden": "true"
288
- }, null, -1)])], 8, _hoisted_3)) : __props.optional && optionalEnabled.value ? (openBlock(), createBlock(as_optional_clear_default, {
290
+ }, null, -1)])], 8, _hoisted_3)) : __props.optional && optionalEnabled.value && !locked.value ? (openBlock(), createBlock(as_optional_clear_default, {
289
291
  key: 1,
290
292
  label: __props.title,
291
293
  onClear: _cache[1] || (_cache[1] = ($event) => __props.onToggleOptional?.(false))
@@ -297,11 +299,12 @@ var as_object_default = /* @__PURE__ */ defineComponent({
297
299
  empty: withCtx(() => [withDirectives(createElementVNode("div", { class: normalizeClass(["as-object-empty as-grid-item", _ctx.$props.class]) }, [createElementVNode("button", {
298
300
  type: "button",
299
301
  class: "as-object-empty-add",
302
+ disabled: locked.value,
300
303
  onClick: handleAddData
301
304
  }, [_cache[3] || (_cache[3] = createElementVNode("span", {
302
305
  class: "i-as-field-fill as-object-empty-add-icon",
303
306
  "aria-hidden": "true"
304
- }, null, -1)), createTextVNode(" " + toDisplayString(unref(t)("UI_FORM_ADD", { item: __props.title })), 1)]), __props.description ? (openBlock(), createElementBlock("p", _hoisted_4, toDisplayString(__props.description), 1)) : createCommentVNode("v-if", true)], 2), [[vShow, !__props.hidden]])]),
307
+ }, null, -1)), createTextVNode(" " + toDisplayString(unref(t)("UI_FORM_ADD", { item: __props.title })), 1)], 8, _hoisted_4), __props.description ? (openBlock(), createElementBlock("p", _hoisted_5, toDisplayString(__props.description), 1)) : createCommentVNode("v-if", true)], 2), [[vShow, !__props.hidden]])]),
305
308
  _: 1
306
309
  }, 8, [
307
310
  "class",