@atscript/vue-form 0.1.112 → 0.1.114

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 (105) hide show
  1. package/dist/{as-array-D750y4P8.mjs → as-array-DMMA0WhA.mjs} +4 -4
  2. package/dist/{as-array-3Fu3HnDd.cjs → as-array-opoGhD7Q.cjs} +4 -4
  3. package/dist/as-array.cjs +1 -1
  4. package/dist/as-array.mjs +1 -1
  5. package/dist/{as-checkbox-DwLRHmXj.mjs → as-checkbox-Bg5MN2x8.mjs} +1 -1
  6. package/dist/{as-checkbox-sgF16SuJ.cjs → as-checkbox-C-NoKSv6.cjs} +1 -1
  7. package/dist/as-checkbox.cjs +1 -1
  8. package/dist/as-checkbox.mjs +1 -1
  9. package/dist/{as-collapsible-DFTzB5Ar.mjs → as-collapsible-_RN5621d.mjs} +2 -2
  10. package/dist/{as-collapsible-BQ-eYR0v.cjs → as-collapsible-nMEolKb7.cjs} +2 -2
  11. package/dist/as-collapsible.cjs +1 -1
  12. package/dist/as-collapsible.mjs +1 -1
  13. package/dist/{as-date-hCCTd52o.cjs → as-date-DCZ0t3-h.cjs} +1 -1
  14. package/dist/{as-date-CfCa2Kp1.mjs → as-date-DF8WzVgY.mjs} +1 -1
  15. package/dist/as-date.cjs +1 -1
  16. package/dist/as-date.mjs +1 -1
  17. package/dist/{as-datetime-DDlWca2Q.cjs → as-datetime-BhhbOw99.cjs} +1 -1
  18. package/dist/{as-datetime-B1I_zREk.mjs → as-datetime-wuk9i8Tz.mjs} +1 -1
  19. package/dist/as-datetime.cjs +1 -1
  20. package/dist/as-datetime.mjs +1 -1
  21. package/dist/{as-decimal-C8Yf5dS7.cjs → as-decimal-B1_3ivMF.cjs} +1 -1
  22. package/dist/{as-decimal-Cg17vyjS.mjs → as-decimal-CVp3Wtrz.mjs} +1 -1
  23. package/dist/as-decimal.cjs +1 -1
  24. package/dist/as-decimal.mjs +1 -1
  25. package/dist/{as-field-DKzUSrFN.cjs → as-field-BC3LdGue.cjs} +87 -18
  26. package/dist/{as-field-ByxmIAOc.mjs → as-field-oZeBwI9U.mjs} +77 -20
  27. package/dist/{as-field-shell-DLvPV8WS.mjs → as-field-shell-BErcR8c9.mjs} +1 -1
  28. package/dist/{as-field-shell-C4epFfvE.cjs → as-field-shell-_XX9G3PP.cjs} +1 -1
  29. package/dist/as-field-shell.cjs +1 -1
  30. package/dist/as-field-shell.mjs +1 -1
  31. package/dist/as-field.cjs +1 -1
  32. package/dist/as-field.d.cts +1 -1
  33. package/dist/as-field.d.mts +1 -1
  34. package/dist/as-field.mjs +1 -1
  35. package/dist/{as-field.vue-A2cJj-Ih.d.cts → as-field.vue-BHOc-pFM.d.cts} +1 -1
  36. package/dist/{as-field.vue-CmjIDgQ5.d.mts → as-field.vue-BOTSEvA_.d.mts} +1 -1
  37. package/dist/{as-form-CeyIoLQu.mjs → as-form-KXdLWQMq.mjs} +4 -4
  38. package/dist/{as-form-CTVUwzWx.cjs → as-form-qrsfdEOq.cjs} +4 -4
  39. package/dist/as-form.cjs +1 -1
  40. package/dist/as-form.d.cts +1 -1
  41. package/dist/as-form.d.mts +1 -1
  42. package/dist/as-form.mjs +1 -1
  43. package/dist/{as-form.vue-B4L3nz9h.d.mts → as-form.vue-DJZ7Ub54.d.mts} +111 -4
  44. package/dist/{as-form.vue-Dsp9sK25.d.cts → as-form.vue-DLFb1NRU.d.cts} +111 -4
  45. package/dist/{as-input-Bp1Ltp15.cjs → as-input-CGJZNsPn.cjs} +1 -1
  46. package/dist/{as-input-DF--i7kY.mjs → as-input-CLdDhrzx.mjs} +1 -1
  47. package/dist/as-input.cjs +1 -1
  48. package/dist/as-input.mjs +1 -1
  49. package/dist/as-iterator-CaXKhPjU.mjs +99 -0
  50. package/dist/as-iterator-Cs1qZXGu.cjs +116 -0
  51. package/dist/as-iterator.cjs +1 -1
  52. package/dist/as-iterator.d.cts +1 -1
  53. package/dist/as-iterator.d.mts +1 -1
  54. package/dist/as-iterator.mjs +1 -1
  55. package/dist/{as-iterator.vue-BZeozFr-.d.cts → as-iterator.vue-DYDv_Gbh.d.cts} +7 -0
  56. package/dist/{as-iterator.vue-C8HW6n25.d.mts → as-iterator.vue-diVHA64A.d.mts} +7 -0
  57. package/dist/{as-multi-select-mp-aM3LV.mjs → as-multi-select-BzXxFUZU.mjs} +1 -1
  58. package/dist/{as-multi-select-b1l34vP5.cjs → as-multi-select-DcBATdiH.cjs} +1 -1
  59. package/dist/as-multi-select.cjs +1 -1
  60. package/dist/as-multi-select.mjs +1 -1
  61. package/dist/{as-number-joydTMcJ.cjs → as-number-Bv33W-S9.cjs} +1 -1
  62. package/dist/{as-number-De9zTltV.mjs → as-number-Cros_r8k.mjs} +1 -1
  63. package/dist/as-number.cjs +1 -1
  64. package/dist/as-number.mjs +1 -1
  65. package/dist/{as-object-GXjX_JFz.mjs → as-object-BJG7f5tQ.mjs} +4 -4
  66. package/dist/{as-object-Bc-wd0dQ.cjs → as-object-DindiCq4.cjs} +4 -4
  67. package/dist/as-object.cjs +1 -1
  68. package/dist/as-object.mjs +1 -1
  69. package/dist/{as-radio-SwpgM1xP.mjs → as-radio-CNeg0NQ0.mjs} +1 -1
  70. package/dist/{as-radio-Dlmxk1vr.cjs → as-radio-CjrO1d-4.cjs} +1 -1
  71. package/dist/as-radio.cjs +1 -1
  72. package/dist/as-radio.mjs +1 -1
  73. package/dist/{as-ref-BCpvUq8E.cjs → as-ref-CMDYGqL6.cjs} +1 -1
  74. package/dist/{as-ref-8JnEuan0.mjs → as-ref-v00Tyeum.mjs} +1 -1
  75. package/dist/as-ref.cjs +1 -1
  76. package/dist/as-ref.mjs +1 -1
  77. package/dist/{as-select-C3ukCyGQ.mjs → as-select-BZUE0TJD.mjs} +1 -1
  78. package/dist/{as-select-CtSNZXtC.cjs → as-select-CeFTgQo6.cjs} +1 -1
  79. package/dist/as-select.cjs +1 -1
  80. package/dist/as-select.mjs +1 -1
  81. package/dist/{as-time-nAPtGL3t.cjs → as-time-BMwVQp45.cjs} +1 -1
  82. package/dist/{as-time-QJ9YiVj9.mjs → as-time-CQ2GWcPn.mjs} +1 -1
  83. package/dist/as-time.cjs +1 -1
  84. package/dist/as-time.mjs +1 -1
  85. package/dist/{as-tuple-DJ3koxgJ.cjs → as-tuple-Ca4bIuag.cjs} +4 -4
  86. package/dist/{as-tuple-C7hQyVOD.mjs → as-tuple-H0qDsZKS.mjs} +4 -4
  87. package/dist/as-tuple.cjs +1 -1
  88. package/dist/as-tuple.mjs +1 -1
  89. package/dist/{as-union-DZWgGqqM.mjs → as-union-Car_1kUS.mjs} +2 -2
  90. package/dist/{as-union-BDRNBacb.cjs → as-union-CovWOnmN.cjs} +2 -2
  91. package/dist/as-union.cjs +1 -1
  92. package/dist/as-union.mjs +1 -1
  93. package/dist/index.cjs +66 -23
  94. package/dist/index.d.cts +4 -4
  95. package/dist/index.d.mts +4 -4
  96. package/dist/index.mjs +45 -26
  97. package/dist/{use-as-nested-sections-store-DVRmG7V0.mjs → use-as-nested-sections-store-Dfo971PK.mjs} +13 -1
  98. package/dist/{use-as-nested-sections-store--E0Ijpt5.cjs → use-as-nested-sections-store-u1VgBJAP.cjs} +18 -0
  99. package/dist/{use-as-optional-add-flow-B_gr8sX-.mjs → use-as-optional-add-flow-BdjKNx9P.mjs} +1 -1
  100. package/dist/{use-as-optional-add-flow-BXKiK1Kb.cjs → use-as-optional-add-flow-CD8seN3C.cjs} +1 -1
  101. package/dist/{use-form-context-DpGiGUvJ.cjs → use-form-context-B6ZnzfxG.cjs} +2 -7
  102. package/dist/{use-form-context-D6J1WTyG.mjs → use-form-context-cDW2GW4-.mjs} +5 -10
  103. package/package.json +4 -4
  104. package/dist/as-iterator-CDzc27DB.cjs +0 -65
  105. package/dist/as-iterator-D1SisoDg.mjs +0 -60
@@ -1,4 +1,4 @@
1
- const require_use_as_nested_sections_store = require("./use-as-nested-sections-store--E0Ijpt5.cjs");
1
+ const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-u1VgBJAP.cjs");
2
2
  const require_focus_after_toggle = require("./focus-after-toggle-CWxiPZWi.cjs");
3
3
  //#region src/composables/use-as-optional-add-flow.ts
4
4
  /**
@@ -43,15 +43,10 @@ function useFormContext(componentName) {
43
43
  const _formContext = (0, vue.inject)(FORM_CONTEXT_KEY);
44
44
  const formContext = (0, vue.computed)(() => _formContext?.value ?? {});
45
45
  function joinPath(segment) {
46
- return (0, vue.computed)(() => {
47
- const s = typeof segment === "function" ? segment() : segment;
48
- if (!s) return pathPrefix.value;
49
- return pathPrefix.value ? `${pathPrefix.value}.${s}` : s;
50
- });
46
+ return (0, vue.computed)(() => (0, _atscript_ui.joinPath)(pathPrefix.value, typeof segment === "function" ? segment() : segment));
51
47
  }
52
48
  function buildPath(segment) {
53
- if (!segment) return pathPrefix.value;
54
- return pathPrefix.value ? `${pathPrefix.value}.${segment}` : segment;
49
+ return (0, _atscript_ui.joinPath)(pathPrefix.value, segment);
55
50
  }
56
51
  function getByPath(path) {
57
52
  return (0, _atscript_ui.getByPath)(rootFormData(), path);
@@ -1,5 +1,5 @@
1
1
  import { computed, inject, provide } from "vue";
2
- import { getByPath, setByPath } from "@atscript/ui";
2
+ import { getByPath, joinPath, setByPath } from "@atscript/ui";
3
3
  //#region src/composables/internal-keys.ts
4
4
  /**
5
5
  * Typed Vue provide/inject keys used across the form tree.
@@ -42,16 +42,11 @@ function useFormContext(componentName) {
42
42
  const pathPrefix = inject(PATH_PREFIX_KEY, EMPTY_PREFIX);
43
43
  const _formContext = inject(FORM_CONTEXT_KEY);
44
44
  const formContext = computed(() => _formContext?.value ?? {});
45
- function joinPath(segment) {
46
- return computed(() => {
47
- const s = typeof segment === "function" ? segment() : segment;
48
- if (!s) return pathPrefix.value;
49
- return pathPrefix.value ? `${pathPrefix.value}.${s}` : s;
50
- });
45
+ function joinPath$1(segment) {
46
+ return computed(() => joinPath(pathPrefix.value, typeof segment === "function" ? segment() : segment));
51
47
  }
52
48
  function buildPath(segment) {
53
- if (!segment) return pathPrefix.value;
54
- return pathPrefix.value ? `${pathPrefix.value}.${segment}` : segment;
49
+ return joinPath(pathPrefix.value, segment);
55
50
  }
56
51
  function getByPath$1(path) {
57
52
  return getByPath(rootFormData(), path);
@@ -72,7 +67,7 @@ function useFormContext(componentName) {
72
67
  rootFormData,
73
68
  pathPrefix,
74
69
  formContext,
75
- joinPath,
70
+ joinPath: joinPath$1,
76
71
  buildPath,
77
72
  getByPath: getByPath$1,
78
73
  setByPath: setByPath$1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/vue-form",
3
- "version": "0.1.112",
3
+ "version": "0.1.114",
4
4
  "description": "Type-driven form rendering for Atscript with Vue 3",
5
5
  "keywords": [
6
6
  "atscript",
@@ -160,7 +160,7 @@
160
160
  "access": "public"
161
161
  },
162
162
  "dependencies": {
163
- "@atscript/ui": "^0.1.112"
163
+ "@atscript/ui": "^0.1.114"
164
164
  },
165
165
  "devDependencies": {
166
166
  "@atscript/core": "^0.1.79",
@@ -176,13 +176,13 @@
176
176
  "vue": "^3",
177
177
  "vue-tsc": "~3.2.9",
178
178
  "vunor": "^0.2.1",
179
- "@atscript/ui-fns": "^0.1.112"
179
+ "@atscript/ui-fns": "^0.1.114"
180
180
  },
181
181
  "peerDependencies": {
182
182
  "@atscript/db-client": "^0.1.111",
183
183
  "reka-ui": "^2.9.8",
184
184
  "vue": "^3",
185
- "@atscript/ui-fns": "^0.1.112"
185
+ "@atscript/ui-fns": "^0.1.114"
186
186
  },
187
187
  "scripts": {
188
188
  "build": "node ../../scripts/gen-exports.mjs && vp pack",
@@ -1,65 +0,0 @@
1
- const require_use_form_context = require("./use-form-context-DpGiGUvJ.cjs");
2
- const require_as_field = require("./as-field-DKzUSrFN.cjs");
3
- let vue = require("vue");
4
- //#endregion
5
- //#region src/components/as-iterator.vue
6
- var as_iterator_default = /* @__PURE__ */ (0, vue.defineComponent)({
7
- __name: "as-iterator",
8
- props: {
9
- def: {
10
- type: Object,
11
- required: true
12
- },
13
- pathPrefix: {
14
- type: String,
15
- required: false
16
- },
17
- onRemove: {
18
- type: Function,
19
- required: false
20
- },
21
- canRemove: {
22
- type: Boolean,
23
- required: false
24
- },
25
- removeLabel: {
26
- type: String,
27
- required: false
28
- },
29
- fields: {
30
- type: Array,
31
- required: false
32
- }
33
- },
34
- setup(__props) {
35
- const props = __props;
36
- const parentPrefix = (0, vue.inject)(require_use_form_context.PATH_PREFIX_KEY, (0, vue.computed)(() => ""));
37
- (0, vue.provide)(require_use_form_context.PATH_PREFIX_KEY, (0, vue.computed)(() => {
38
- if (props.pathPrefix !== void 0) return parentPrefix.value ? `${parentPrefix.value}.${props.pathPrefix}` : props.pathPrefix;
39
- return parentPrefix.value;
40
- }));
41
- return (_ctx, _cache) => {
42
- return (0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.fields ?? __props.def.fields, (f) => {
43
- return (0, vue.openBlock)(), (0, vue.createBlock)(require_as_field.as_field_default, {
44
- key: f.path ?? f.name,
45
- field: f,
46
- "on-remove": __props.onRemove,
47
- "can-remove": __props.canRemove,
48
- "remove-label": __props.removeLabel
49
- }, null, 8, [
50
- "field",
51
- "on-remove",
52
- "can-remove",
53
- "remove-label"
54
- ]);
55
- }), 128);
56
- };
57
- }
58
- });
59
- //#endregion
60
- Object.defineProperty(exports, "as_iterator_default", {
61
- enumerable: true,
62
- get: function() {
63
- return as_iterator_default;
64
- }
65
- });
@@ -1,60 +0,0 @@
1
- import { h as PATH_PREFIX_KEY } from "./use-form-context-D6J1WTyG.mjs";
2
- import { t as as_field_default } from "./as-field-ByxmIAOc.mjs";
3
- import { Fragment, computed, createBlock, createElementBlock, defineComponent, inject, openBlock, provide, renderList } from "vue";
4
- //#endregion
5
- //#region src/components/as-iterator.vue
6
- var as_iterator_default = /* @__PURE__ */ defineComponent({
7
- __name: "as-iterator",
8
- props: {
9
- def: {
10
- type: Object,
11
- required: true
12
- },
13
- pathPrefix: {
14
- type: String,
15
- required: false
16
- },
17
- onRemove: {
18
- type: Function,
19
- required: false
20
- },
21
- canRemove: {
22
- type: Boolean,
23
- required: false
24
- },
25
- removeLabel: {
26
- type: String,
27
- required: false
28
- },
29
- fields: {
30
- type: Array,
31
- required: false
32
- }
33
- },
34
- setup(__props) {
35
- const props = __props;
36
- const parentPrefix = inject(PATH_PREFIX_KEY, computed(() => ""));
37
- provide(PATH_PREFIX_KEY, computed(() => {
38
- if (props.pathPrefix !== void 0) return parentPrefix.value ? `${parentPrefix.value}.${props.pathPrefix}` : props.pathPrefix;
39
- return parentPrefix.value;
40
- }));
41
- return (_ctx, _cache) => {
42
- return openBlock(true), createElementBlock(Fragment, null, renderList(__props.fields ?? __props.def.fields, (f) => {
43
- return openBlock(), createBlock(as_field_default, {
44
- key: f.path ?? f.name,
45
- field: f,
46
- "on-remove": __props.onRemove,
47
- "can-remove": __props.canRemove,
48
- "remove-label": __props.removeLabel
49
- }, null, 8, [
50
- "field",
51
- "on-remove",
52
- "can-remove",
53
- "remove-label"
54
- ]);
55
- }), 128);
56
- };
57
- }
58
- });
59
- //#endregion
60
- export { as_iterator_default as t };