@atscript/vue-form 0.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +35 -0
- package/dist/as-action-71f9E_bL.cjs +208 -0
- package/dist/as-action-DU17rykn.mjs +203 -0
- package/dist/as-action.cjs +2 -0
- package/dist/as-action.d.cts +2 -0
- package/dist/as-action.d.mts +2 -0
- package/dist/as-action.mjs +2 -0
- package/dist/as-action.vue-BdbAOZCL.d.cts +13 -0
- package/dist/as-action.vue-CmY3eil1.d.mts +13 -0
- package/dist/as-adornment-shell-9UmdNIPR.cjs +97 -0
- package/dist/as-adornment-shell-knFiB7Ct.mjs +92 -0
- package/dist/as-array-Bn27x9cq.cjs +466 -0
- package/dist/as-array-DwarTaKP.mjs +455 -0
- package/dist/as-array-clear-btn-DAGervXL.cjs +48 -0
- package/dist/as-array-clear-btn-DIhzCKC9.mjs +43 -0
- package/dist/as-array.cjs +11 -0
- package/dist/as-array.d.cts +2 -0
- package/dist/as-array.d.mts +2 -0
- package/dist/as-array.mjs +11 -0
- package/dist/as-array.vue-C5r_ycIa.d.mts +9 -0
- package/dist/as-array.vue-CeBZRVm7.d.cts +9 -0
- package/dist/as-checkbox-B_9mwla6.mjs +285 -0
- package/dist/as-checkbox-DXGTVHPE.cjs +296 -0
- package/dist/as-checkbox.cjs +6 -0
- package/dist/as-checkbox.d.cts +2 -0
- package/dist/as-checkbox.d.mts +2 -0
- package/dist/as-checkbox.mjs +6 -0
- package/dist/as-checkbox.vue-BL53Xjmi.d.mts +9 -0
- package/dist/as-checkbox.vue-Da1KVG5J.d.cts +9 -0
- package/dist/as-collapsible-CqxeJut7.cjs +148 -0
- package/dist/as-collapsible-DtNCofNT.mjs +143 -0
- package/dist/as-date-C7tFQDkh.mjs +253 -0
- package/dist/as-date-k3MW3dmA.cjs +258 -0
- package/dist/as-date.cjs +8 -0
- package/dist/as-date.d.cts +2 -0
- package/dist/as-date.d.mts +2 -0
- package/dist/as-date.mjs +8 -0
- package/dist/as-date.vue-C5JaS3Sd.d.mts +9 -0
- package/dist/as-date.vue-e2ewS_V4.d.cts +9 -0
- package/dist/as-datetime-C030mzI5.cjs +258 -0
- package/dist/as-datetime-elcOoDT5.mjs +253 -0
- package/dist/as-datetime.cjs +8 -0
- package/dist/as-datetime.d.cts +2 -0
- package/dist/as-datetime.d.mts +2 -0
- package/dist/as-datetime.mjs +8 -0
- package/dist/as-datetime.vue-ClsSnJSV.d.mts +9 -0
- package/dist/as-datetime.vue-vfHFsby6.d.cts +9 -0
- package/dist/as-decimal-BJIGgPXU.cjs +711 -0
- package/dist/as-decimal-DtXjFPhe.mjs +694 -0
- package/dist/as-decimal.cjs +7 -0
- package/dist/as-decimal.d.cts +2 -0
- package/dist/as-decimal.d.mts +2 -0
- package/dist/as-decimal.mjs +7 -0
- package/dist/as-decimal.vue-B1pEKdjM.d.cts +25 -0
- package/dist/as-decimal.vue-CSCtYRRa.d.mts +25 -0
- package/dist/as-field-CXVjrEPQ.mjs +481 -0
- package/dist/as-field-shell-B2iTn-iM.cjs +346 -0
- package/dist/as-field-shell-Pdy3sAvr.mjs +341 -0
- package/dist/as-field-shell.cjs +5 -0
- package/dist/as-field-shell.d.cts +2 -0
- package/dist/as-field-shell.d.mts +2 -0
- package/dist/as-field-shell.mjs +5 -0
- package/dist/as-field-shell.vue-Ddnp8KxY.d.mts +37 -0
- package/dist/as-field-shell.vue-Dmt05vGD.d.cts +37 -0
- package/dist/as-field-wLYoaZnT.cjs +498 -0
- package/dist/as-field.cjs +4 -0
- package/dist/as-field.d.cts +25 -0
- package/dist/as-field.d.mts +26 -0
- package/dist/as-field.mjs +4 -0
- package/dist/as-form-CWwgyvfw.mjs +425 -0
- package/dist/as-form-DAIkyt7H.cjs +448 -0
- package/dist/as-form.cjs +7 -0
- package/dist/as-form.d.cts +2 -0
- package/dist/as-form.d.mts +2 -0
- package/dist/as-form.mjs +7 -0
- package/dist/as-form.vue-B4Bn0pbC.d.cts +158 -0
- package/dist/as-form.vue-DRrb_yoj.d.mts +158 -0
- package/dist/as-input-CpbV2k3s.cjs +231 -0
- package/dist/as-input-DIa8BzLv.mjs +226 -0
- package/dist/as-input-control-BzELjheN.mjs +266 -0
- package/dist/as-input-control-C5-DelZT.cjs +271 -0
- package/dist/as-input.cjs +8 -0
- package/dist/as-input.d.cts +2 -0
- package/dist/as-input.d.mts +2 -0
- package/dist/as-input.mjs +8 -0
- package/dist/as-input.vue-11ldp9uT.d.cts +17 -0
- package/dist/as-input.vue-fUhcvfv2.d.mts +17 -0
- package/dist/as-iterator-BYMNe6UJ.cjs +61 -0
- package/dist/as-iterator-CT5y1jyn.mjs +56 -0
- package/dist/as-iterator.cjs +5 -0
- package/dist/as-iterator.d.cts +14 -0
- package/dist/as-iterator.d.mts +15 -0
- package/dist/as-iterator.mjs +5 -0
- package/dist/as-number-BA55JIq1.cjs +387 -0
- package/dist/as-number-JPEwPK8Q.mjs +376 -0
- package/dist/as-number.cjs +8 -0
- package/dist/as-number.d.cts +2 -0
- package/dist/as-number.d.mts +2 -0
- package/dist/as-number.mjs +8 -0
- package/dist/as-number.vue-Bk-W7Vwv.d.mts +26 -0
- package/dist/as-number.vue-C2Aih98s.d.cts +26 -0
- package/dist/as-object-CT6lNEqt.mjs +300 -0
- package/dist/as-object-qUL7l8V1.cjs +305 -0
- package/dist/as-object.cjs +11 -0
- package/dist/as-object.d.cts +2 -0
- package/dist/as-object.d.mts +2 -0
- package/dist/as-object.mjs +11 -0
- package/dist/as-object.vue-CKwMyM_F.d.cts +13 -0
- package/dist/as-object.vue-Cg52b61-.d.mts +13 -0
- package/dist/as-paragraph-BGO-j4US.cjs +203 -0
- package/dist/as-paragraph-jIG_dg7_.mjs +198 -0
- package/dist/as-paragraph.cjs +2 -0
- package/dist/as-paragraph.d.cts +2 -0
- package/dist/as-paragraph.d.mts +2 -0
- package/dist/as-paragraph.mjs +2 -0
- package/dist/as-paragraph.vue-BDt0pBG-.d.cts +9 -0
- package/dist/as-paragraph.vue-C3FgTEt5.d.mts +9 -0
- package/dist/as-radio-B1N-gmoI.mjs +242 -0
- package/dist/as-radio-U3OK7bTg.cjs +247 -0
- package/dist/as-radio.cjs +6 -0
- package/dist/as-radio.d.cts +2 -0
- package/dist/as-radio.d.mts +2 -0
- package/dist/as-radio.mjs +6 -0
- package/dist/as-radio.vue-D_fweoN1.d.mts +9 -0
- package/dist/as-radio.vue-ZC4kLBnT.d.cts +9 -0
- package/dist/as-ref-CIifSSCQ.mjs +337 -0
- package/dist/as-ref-SImaIrwK.cjs +342 -0
- package/dist/as-ref.cjs +7 -0
- package/dist/as-ref.d.cts +2 -0
- package/dist/as-ref.d.mts +2 -0
- package/dist/as-ref.mjs +7 -0
- package/dist/as-ref.vue-BNeQeQpO.d.cts +9 -0
- package/dist/as-ref.vue-Cr5jeNDn.d.mts +9 -0
- package/dist/as-select-BB3uxACS.cjs +246 -0
- package/dist/as-select-UBGCVhku.mjs +241 -0
- package/dist/as-select.cjs +6 -0
- package/dist/as-select.d.cts +2 -0
- package/dist/as-select.d.mts +2 -0
- package/dist/as-select.mjs +6 -0
- package/dist/as-select.vue-Dd7huPq2.d.cts +9 -0
- package/dist/as-select.vue-RYpbZbKt.d.mts +9 -0
- package/dist/as-time-C24rvslH.cjs +258 -0
- package/dist/as-time-CQsxUs8P.mjs +253 -0
- package/dist/as-time.cjs +8 -0
- package/dist/as-time.d.cts +2 -0
- package/dist/as-time.d.mts +2 -0
- package/dist/as-time.mjs +8 -0
- package/dist/as-time.vue-huLx2B4l.d.mts +9 -0
- package/dist/as-time.vue-nMEHLXke.d.cts +9 -0
- package/dist/as-tuple-BU--cuuI.cjs +351 -0
- package/dist/as-tuple-DkI9swlW.mjs +340 -0
- package/dist/as-tuple.cjs +11 -0
- package/dist/as-tuple.d.cts +2 -0
- package/dist/as-tuple.d.mts +2 -0
- package/dist/as-tuple.mjs +11 -0
- package/dist/as-tuple.vue-CQhzOJsn.d.mts +9 -0
- package/dist/as-tuple.vue-DyskCkf-.d.cts +9 -0
- package/dist/as-union-BGvdxr3G.mjs +351 -0
- package/dist/as-union-C0btoJn3.cjs +368 -0
- package/dist/as-union.cjs +6 -0
- package/dist/as-union.d.cts +2 -0
- package/dist/as-union.d.mts +2 -0
- package/dist/as-union.mjs +6 -0
- package/dist/as-union.vue-BjlDPZn0.d.mts +9 -0
- package/dist/as-union.vue-CqjU3O10.d.cts +9 -0
- package/dist/as-variant-picker-BVs0AvjK.mjs +96 -0
- package/dist/as-variant-picker-DObQZHmm.cjs +107 -0
- package/dist/index.cjs +173 -0
- package/dist/index.d.cts +966 -0
- package/dist/index.d.mts +966 -0
- package/dist/index.mjs +105 -0
- package/dist/types-C4HRSxgV.d.cts +233 -0
- package/dist/types-Czm-Gtud.d.mts +233 -0
- package/dist/use-as-date-B7CtcRQd.cjs +329 -0
- package/dist/use-as-date-C39i9mzE.mjs +318 -0
- package/dist/use-as-dropdown-BMnEm6jF.mjs +82 -0
- package/dist/use-as-dropdown-C-Qy7Vt0.cjs +105 -0
- package/dist/use-as-locale-BrFdAgnU.mjs +23 -0
- package/dist/use-as-locale-C4z5stwD.cjs +34 -0
- package/dist/use-as-nested-sections-store-jdMRxjBE.cjs +80 -0
- package/dist/use-as-nested-sections-store-lhi0z5z1.mjs +63 -0
- package/dist/use-as-optional-add-flow-CuXEir_i.mjs +43 -0
- package/dist/use-as-optional-add-flow-STOaQWo9.cjs +48 -0
- package/dist/use-as-value-help-CBykDEjZ.mjs +89 -0
- package/dist/use-as-value-help-uANI3zWa.cjs +100 -0
- package/dist/use-form-context-Dwr8Ai1v.cjs +207 -0
- package/dist/use-form-context-bAj7UoSe.mjs +106 -0
- package/package.json +180 -0
- package/styles.d.ts +2 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { n as useAsUnionVariant } from "./use-form-context-bAj7UoSe.mjs";
|
|
2
|
+
import { t as as_iterator_default } from "./as-iterator-CT5y1jyn.mjs";
|
|
3
|
+
import { n as as_optional_clear_default, t as as_variant_picker_default } from "./as-variant-picker-BVs0AvjK.mjs";
|
|
4
|
+
import { t as useAsOptionalAddFlow } from "./use-as-optional-add-flow-CuXEir_i.mjs";
|
|
5
|
+
import { t as as_collapsible_default } from "./as-collapsible-DtNCofNT.mjs";
|
|
6
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, useTemplateRef, vShow, withCtx, withDirectives, withModifiers } from "vue";
|
|
7
|
+
import { isObjectField } from "@atscript/ui";
|
|
8
|
+
//#region src/components/defaults/as-object.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
const _hoisted_1 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "as-form-title"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_2 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "as-form-description"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_3 = ["disabled"];
|
|
18
|
+
const _hoisted_4 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "as-collapsible-description"
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/defaults/as-object.vue
|
|
24
|
+
var as_object_default = /* @__PURE__ */ defineComponent({
|
|
25
|
+
__name: "as-object",
|
|
26
|
+
props: {
|
|
27
|
+
onBlur: {
|
|
28
|
+
type: Function,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
error: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: false
|
|
34
|
+
},
|
|
35
|
+
model: {
|
|
36
|
+
type: Object,
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
value: {
|
|
40
|
+
type: null,
|
|
41
|
+
required: false
|
|
42
|
+
},
|
|
43
|
+
label: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: false
|
|
46
|
+
},
|
|
47
|
+
description: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: false
|
|
50
|
+
},
|
|
51
|
+
hint: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: false
|
|
54
|
+
},
|
|
55
|
+
placeholder: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: false
|
|
58
|
+
},
|
|
59
|
+
prefixIcon: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: false
|
|
62
|
+
},
|
|
63
|
+
suffixIcon: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: false
|
|
66
|
+
},
|
|
67
|
+
class: {
|
|
68
|
+
type: [Object, String],
|
|
69
|
+
required: false
|
|
70
|
+
},
|
|
71
|
+
style: {
|
|
72
|
+
type: [Object, String],
|
|
73
|
+
required: false
|
|
74
|
+
},
|
|
75
|
+
optional: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
required: false,
|
|
78
|
+
skipCheck: true
|
|
79
|
+
},
|
|
80
|
+
onToggleOptional: {
|
|
81
|
+
type: Function,
|
|
82
|
+
required: false
|
|
83
|
+
},
|
|
84
|
+
required: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
required: false,
|
|
87
|
+
skipCheck: true
|
|
88
|
+
},
|
|
89
|
+
readonly: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
required: false,
|
|
92
|
+
skipCheck: true
|
|
93
|
+
},
|
|
94
|
+
type: {
|
|
95
|
+
type: String,
|
|
96
|
+
required: true
|
|
97
|
+
},
|
|
98
|
+
formAction: {
|
|
99
|
+
type: Object,
|
|
100
|
+
required: false
|
|
101
|
+
},
|
|
102
|
+
name: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: false
|
|
105
|
+
},
|
|
106
|
+
field: {
|
|
107
|
+
type: Object,
|
|
108
|
+
required: false
|
|
109
|
+
},
|
|
110
|
+
options: {
|
|
111
|
+
type: Array,
|
|
112
|
+
required: false
|
|
113
|
+
},
|
|
114
|
+
maxLength: {
|
|
115
|
+
type: Number,
|
|
116
|
+
required: false
|
|
117
|
+
},
|
|
118
|
+
autocomplete: {
|
|
119
|
+
type: String,
|
|
120
|
+
required: false
|
|
121
|
+
},
|
|
122
|
+
title: {
|
|
123
|
+
type: String,
|
|
124
|
+
required: false
|
|
125
|
+
},
|
|
126
|
+
level: {
|
|
127
|
+
type: Number,
|
|
128
|
+
required: false
|
|
129
|
+
},
|
|
130
|
+
onRemove: {
|
|
131
|
+
type: Function,
|
|
132
|
+
required: false
|
|
133
|
+
},
|
|
134
|
+
canRemove: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
required: false
|
|
137
|
+
},
|
|
138
|
+
removeLabel: {
|
|
139
|
+
type: String,
|
|
140
|
+
required: false
|
|
141
|
+
},
|
|
142
|
+
arrayIndex: {
|
|
143
|
+
type: Number,
|
|
144
|
+
required: false
|
|
145
|
+
},
|
|
146
|
+
path: {
|
|
147
|
+
type: String,
|
|
148
|
+
required: true
|
|
149
|
+
},
|
|
150
|
+
valueHelp: {
|
|
151
|
+
type: Object,
|
|
152
|
+
required: false
|
|
153
|
+
},
|
|
154
|
+
singularLabel: {
|
|
155
|
+
type: String,
|
|
156
|
+
required: false
|
|
157
|
+
},
|
|
158
|
+
inputId: {
|
|
159
|
+
type: String,
|
|
160
|
+
required: true
|
|
161
|
+
},
|
|
162
|
+
errorId: {
|
|
163
|
+
type: String,
|
|
164
|
+
required: true
|
|
165
|
+
},
|
|
166
|
+
descId: {
|
|
167
|
+
type: String,
|
|
168
|
+
required: true
|
|
169
|
+
},
|
|
170
|
+
ariaDescribedBy: {
|
|
171
|
+
type: String,
|
|
172
|
+
required: false
|
|
173
|
+
},
|
|
174
|
+
currencyCode: {
|
|
175
|
+
type: String,
|
|
176
|
+
required: false
|
|
177
|
+
},
|
|
178
|
+
unitCode: {
|
|
179
|
+
type: String,
|
|
180
|
+
required: false
|
|
181
|
+
},
|
|
182
|
+
precisionScale: {
|
|
183
|
+
type: Number,
|
|
184
|
+
required: false
|
|
185
|
+
},
|
|
186
|
+
prefix: {
|
|
187
|
+
type: String,
|
|
188
|
+
required: false
|
|
189
|
+
},
|
|
190
|
+
suffix: {
|
|
191
|
+
type: String,
|
|
192
|
+
required: false
|
|
193
|
+
},
|
|
194
|
+
scale: {
|
|
195
|
+
type: Number,
|
|
196
|
+
required: false
|
|
197
|
+
},
|
|
198
|
+
hasAdornment: {
|
|
199
|
+
type: Boolean,
|
|
200
|
+
required: false
|
|
201
|
+
},
|
|
202
|
+
disabled: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
required: false
|
|
205
|
+
},
|
|
206
|
+
hidden: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
required: false
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
emits: ["action"],
|
|
212
|
+
setup(__props) {
|
|
213
|
+
const props = __props;
|
|
214
|
+
const objectDef = computed(() => isObjectField(props.field) ? props.field.objectDef : void 0);
|
|
215
|
+
const optionalEnabled = computed(() => props.model?.value != null);
|
|
216
|
+
const unionCtx = useAsUnionVariant();
|
|
217
|
+
const hasVariantPicker = computed(() => unionCtx !== void 0 && unionCtx.variants.length > 1);
|
|
218
|
+
const level = computed(() => props.level ?? 0);
|
|
219
|
+
const isRoot = computed(() => level.value <= 0);
|
|
220
|
+
const collapsibleRef = useTemplateRef("collapsibleRef");
|
|
221
|
+
const { composeAction } = useAsOptionalAddFlow({ path: () => props.path });
|
|
222
|
+
function handleAddData() {
|
|
223
|
+
collapsibleRef.value?.runAndFocusNew(composeAction(() => props.onToggleOptional?.(true)), 2);
|
|
224
|
+
}
|
|
225
|
+
return (_ctx, _cache) => {
|
|
226
|
+
return isRoot.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
227
|
+
__props.title ? (openBlock(), createElementBlock("h2", _hoisted_1, toDisplayString(__props.title), 1)) : createCommentVNode("v-if", true),
|
|
228
|
+
__props.description ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(__props.description), 1)) : createCommentVNode("v-if", true),
|
|
229
|
+
objectDef.value ? (openBlock(), createElementBlock("div", {
|
|
230
|
+
key: 2,
|
|
231
|
+
class: normalizeClass(["as-form-grid", _ctx.$props.class])
|
|
232
|
+
}, [createVNode(as_iterator_default, { def: objectDef.value }, null, 8, ["def"])], 2)) : createCommentVNode("v-if", true)
|
|
233
|
+
], 64)) : (openBlock(), createBlock(as_collapsible_default, {
|
|
234
|
+
key: 1,
|
|
235
|
+
ref_key: "collapsibleRef",
|
|
236
|
+
ref: collapsibleRef,
|
|
237
|
+
class: normalizeClass(_ctx.$props.class),
|
|
238
|
+
title: __props.title,
|
|
239
|
+
"array-index": __props.arrayIndex,
|
|
240
|
+
description: __props.description,
|
|
241
|
+
level: level.value,
|
|
242
|
+
optional: !!__props.optional,
|
|
243
|
+
"optional-enabled": optionalEnabled.value,
|
|
244
|
+
path: __props.path,
|
|
245
|
+
error: __props.error,
|
|
246
|
+
hidden: __props.hidden,
|
|
247
|
+
"default-open": __props.arrayIndex !== void 0
|
|
248
|
+
}, {
|
|
249
|
+
"title-extras": withCtx(() => [hasVariantPicker.value ? (openBlock(), createBlock(as_variant_picker_default, {
|
|
250
|
+
key: 0,
|
|
251
|
+
"union-context": unref(unionCtx),
|
|
252
|
+
disabled: __props.disabled
|
|
253
|
+
}, null, 8, ["union-context", "disabled"])) : createCommentVNode("v-if", true)]),
|
|
254
|
+
actions: withCtx(() => [__props.onRemove ? (openBlock(), createElementBlock("button", {
|
|
255
|
+
key: 0,
|
|
256
|
+
type: "button",
|
|
257
|
+
class: "as-field-remove-btn",
|
|
258
|
+
disabled: !__props.canRemove,
|
|
259
|
+
"aria-label": "Remove",
|
|
260
|
+
title: "Remove",
|
|
261
|
+
onClick: _cache[0] || (_cache[0] = withModifiers((...args) => __props.onRemove && __props.onRemove(...args), ["stop", "prevent"]))
|
|
262
|
+
}, [..._cache[2] || (_cache[2] = [createElementVNode("span", {
|
|
263
|
+
class: "as-field-remove-btn-icon",
|
|
264
|
+
"aria-hidden": "true"
|
|
265
|
+
}, null, -1)])], 8, _hoisted_3)) : __props.optional && optionalEnabled.value ? (openBlock(), createBlock(as_optional_clear_default, {
|
|
266
|
+
key: 1,
|
|
267
|
+
label: __props.title,
|
|
268
|
+
onClear: _cache[1] || (_cache[1] = ($event) => __props.onToggleOptional?.(false))
|
|
269
|
+
}, null, 8, ["label"])) : createCommentVNode("v-if", true)]),
|
|
270
|
+
body: withCtx(() => [objectDef.value ? (openBlock(), createBlock(as_iterator_default, {
|
|
271
|
+
key: 0,
|
|
272
|
+
def: objectDef.value
|
|
273
|
+
}, null, 8, ["def"])) : createCommentVNode("v-if", true)]),
|
|
274
|
+
empty: withCtx(() => [withDirectives(createElementVNode("div", { class: normalizeClass(["as-object-empty as-grid-item", _ctx.$props.class]) }, [createElementVNode("button", {
|
|
275
|
+
type: "button",
|
|
276
|
+
class: "as-object-empty-add",
|
|
277
|
+
onClick: handleAddData
|
|
278
|
+
}, [_cache[3] || (_cache[3] = createElementVNode("span", {
|
|
279
|
+
class: "i-as-field-fill as-object-empty-add-icon",
|
|
280
|
+
"aria-hidden": "true"
|
|
281
|
+
}, null, -1)), createTextVNode(" Add " + toDisplayString(__props.title), 1)]), __props.description ? (openBlock(), createElementBlock("p", _hoisted_4, toDisplayString(__props.description), 1)) : createCommentVNode("v-if", true)], 2), [[vShow, !__props.hidden]])]),
|
|
282
|
+
_: 1
|
|
283
|
+
}, 8, [
|
|
284
|
+
"class",
|
|
285
|
+
"title",
|
|
286
|
+
"array-index",
|
|
287
|
+
"description",
|
|
288
|
+
"level",
|
|
289
|
+
"optional",
|
|
290
|
+
"optional-enabled",
|
|
291
|
+
"path",
|
|
292
|
+
"error",
|
|
293
|
+
"hidden",
|
|
294
|
+
"default-open"
|
|
295
|
+
]));
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
//#endregion
|
|
300
|
+
export { as_object_default as t };
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
const require_use_form_context = require("./use-form-context-Dwr8Ai1v.cjs");
|
|
2
|
+
const require_as_iterator = require("./as-iterator-BYMNe6UJ.cjs");
|
|
3
|
+
const require_as_variant_picker = require("./as-variant-picker-DObQZHmm.cjs");
|
|
4
|
+
const require_use_as_optional_add_flow = require("./use-as-optional-add-flow-STOaQWo9.cjs");
|
|
5
|
+
const require_as_collapsible = require("./as-collapsible-CqxeJut7.cjs");
|
|
6
|
+
let vue = require("vue");
|
|
7
|
+
let _atscript_ui = require("@atscript/ui");
|
|
8
|
+
//#region src/components/defaults/as-object.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
const _hoisted_1 = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "as-form-title"
|
|
12
|
+
};
|
|
13
|
+
const _hoisted_2 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "as-form-description"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_3 = ["disabled"];
|
|
18
|
+
const _hoisted_4 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "as-collapsible-description"
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/components/defaults/as-object.vue
|
|
24
|
+
var as_object_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
25
|
+
__name: "as-object",
|
|
26
|
+
props: {
|
|
27
|
+
onBlur: {
|
|
28
|
+
type: Function,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
error: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: false
|
|
34
|
+
},
|
|
35
|
+
model: {
|
|
36
|
+
type: Object,
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
value: {
|
|
40
|
+
type: null,
|
|
41
|
+
required: false
|
|
42
|
+
},
|
|
43
|
+
label: {
|
|
44
|
+
type: String,
|
|
45
|
+
required: false
|
|
46
|
+
},
|
|
47
|
+
description: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: false
|
|
50
|
+
},
|
|
51
|
+
hint: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: false
|
|
54
|
+
},
|
|
55
|
+
placeholder: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: false
|
|
58
|
+
},
|
|
59
|
+
prefixIcon: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: false
|
|
62
|
+
},
|
|
63
|
+
suffixIcon: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: false
|
|
66
|
+
},
|
|
67
|
+
class: {
|
|
68
|
+
type: [Object, String],
|
|
69
|
+
required: false
|
|
70
|
+
},
|
|
71
|
+
style: {
|
|
72
|
+
type: [Object, String],
|
|
73
|
+
required: false
|
|
74
|
+
},
|
|
75
|
+
optional: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
required: false,
|
|
78
|
+
skipCheck: true
|
|
79
|
+
},
|
|
80
|
+
onToggleOptional: {
|
|
81
|
+
type: Function,
|
|
82
|
+
required: false
|
|
83
|
+
},
|
|
84
|
+
required: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
required: false,
|
|
87
|
+
skipCheck: true
|
|
88
|
+
},
|
|
89
|
+
readonly: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
required: false,
|
|
92
|
+
skipCheck: true
|
|
93
|
+
},
|
|
94
|
+
type: {
|
|
95
|
+
type: String,
|
|
96
|
+
required: true
|
|
97
|
+
},
|
|
98
|
+
formAction: {
|
|
99
|
+
type: Object,
|
|
100
|
+
required: false
|
|
101
|
+
},
|
|
102
|
+
name: {
|
|
103
|
+
type: String,
|
|
104
|
+
required: false
|
|
105
|
+
},
|
|
106
|
+
field: {
|
|
107
|
+
type: Object,
|
|
108
|
+
required: false
|
|
109
|
+
},
|
|
110
|
+
options: {
|
|
111
|
+
type: Array,
|
|
112
|
+
required: false
|
|
113
|
+
},
|
|
114
|
+
maxLength: {
|
|
115
|
+
type: Number,
|
|
116
|
+
required: false
|
|
117
|
+
},
|
|
118
|
+
autocomplete: {
|
|
119
|
+
type: String,
|
|
120
|
+
required: false
|
|
121
|
+
},
|
|
122
|
+
title: {
|
|
123
|
+
type: String,
|
|
124
|
+
required: false
|
|
125
|
+
},
|
|
126
|
+
level: {
|
|
127
|
+
type: Number,
|
|
128
|
+
required: false
|
|
129
|
+
},
|
|
130
|
+
onRemove: {
|
|
131
|
+
type: Function,
|
|
132
|
+
required: false
|
|
133
|
+
},
|
|
134
|
+
canRemove: {
|
|
135
|
+
type: Boolean,
|
|
136
|
+
required: false
|
|
137
|
+
},
|
|
138
|
+
removeLabel: {
|
|
139
|
+
type: String,
|
|
140
|
+
required: false
|
|
141
|
+
},
|
|
142
|
+
arrayIndex: {
|
|
143
|
+
type: Number,
|
|
144
|
+
required: false
|
|
145
|
+
},
|
|
146
|
+
path: {
|
|
147
|
+
type: String,
|
|
148
|
+
required: true
|
|
149
|
+
},
|
|
150
|
+
valueHelp: {
|
|
151
|
+
type: Object,
|
|
152
|
+
required: false
|
|
153
|
+
},
|
|
154
|
+
singularLabel: {
|
|
155
|
+
type: String,
|
|
156
|
+
required: false
|
|
157
|
+
},
|
|
158
|
+
inputId: {
|
|
159
|
+
type: String,
|
|
160
|
+
required: true
|
|
161
|
+
},
|
|
162
|
+
errorId: {
|
|
163
|
+
type: String,
|
|
164
|
+
required: true
|
|
165
|
+
},
|
|
166
|
+
descId: {
|
|
167
|
+
type: String,
|
|
168
|
+
required: true
|
|
169
|
+
},
|
|
170
|
+
ariaDescribedBy: {
|
|
171
|
+
type: String,
|
|
172
|
+
required: false
|
|
173
|
+
},
|
|
174
|
+
currencyCode: {
|
|
175
|
+
type: String,
|
|
176
|
+
required: false
|
|
177
|
+
},
|
|
178
|
+
unitCode: {
|
|
179
|
+
type: String,
|
|
180
|
+
required: false
|
|
181
|
+
},
|
|
182
|
+
precisionScale: {
|
|
183
|
+
type: Number,
|
|
184
|
+
required: false
|
|
185
|
+
},
|
|
186
|
+
prefix: {
|
|
187
|
+
type: String,
|
|
188
|
+
required: false
|
|
189
|
+
},
|
|
190
|
+
suffix: {
|
|
191
|
+
type: String,
|
|
192
|
+
required: false
|
|
193
|
+
},
|
|
194
|
+
scale: {
|
|
195
|
+
type: Number,
|
|
196
|
+
required: false
|
|
197
|
+
},
|
|
198
|
+
hasAdornment: {
|
|
199
|
+
type: Boolean,
|
|
200
|
+
required: false
|
|
201
|
+
},
|
|
202
|
+
disabled: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
required: false
|
|
205
|
+
},
|
|
206
|
+
hidden: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
required: false
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
emits: ["action"],
|
|
212
|
+
setup(__props) {
|
|
213
|
+
const props = __props;
|
|
214
|
+
const objectDef = (0, vue.computed)(() => (0, _atscript_ui.isObjectField)(props.field) ? props.field.objectDef : void 0);
|
|
215
|
+
const optionalEnabled = (0, vue.computed)(() => props.model?.value != null);
|
|
216
|
+
const unionCtx = require_use_form_context.useAsUnionVariant();
|
|
217
|
+
const hasVariantPicker = (0, vue.computed)(() => unionCtx !== void 0 && unionCtx.variants.length > 1);
|
|
218
|
+
const level = (0, vue.computed)(() => props.level ?? 0);
|
|
219
|
+
const isRoot = (0, vue.computed)(() => level.value <= 0);
|
|
220
|
+
const collapsibleRef = (0, vue.useTemplateRef)("collapsibleRef");
|
|
221
|
+
const { composeAction } = require_use_as_optional_add_flow.useAsOptionalAddFlow({ path: () => props.path });
|
|
222
|
+
function handleAddData() {
|
|
223
|
+
collapsibleRef.value?.runAndFocusNew(composeAction(() => props.onToggleOptional?.(true)), 2);
|
|
224
|
+
}
|
|
225
|
+
return (_ctx, _cache) => {
|
|
226
|
+
return isRoot.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [
|
|
227
|
+
__props.title ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("h2", _hoisted_1, (0, vue.toDisplayString)(__props.title), 1)) : (0, vue.createCommentVNode)("v-if", true),
|
|
228
|
+
__props.description ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_2, (0, vue.toDisplayString)(__props.description), 1)) : (0, vue.createCommentVNode)("v-if", true),
|
|
229
|
+
objectDef.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
|
|
230
|
+
key: 2,
|
|
231
|
+
class: (0, vue.normalizeClass)(["as-form-grid", _ctx.$props.class])
|
|
232
|
+
}, [(0, vue.createVNode)(require_as_iterator.as_iterator_default, { def: objectDef.value }, null, 8, ["def"])], 2)) : (0, vue.createCommentVNode)("v-if", true)
|
|
233
|
+
], 64)) : ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_collapsible.as_collapsible_default, {
|
|
234
|
+
key: 1,
|
|
235
|
+
ref_key: "collapsibleRef",
|
|
236
|
+
ref: collapsibleRef,
|
|
237
|
+
class: (0, vue.normalizeClass)(_ctx.$props.class),
|
|
238
|
+
title: __props.title,
|
|
239
|
+
"array-index": __props.arrayIndex,
|
|
240
|
+
description: __props.description,
|
|
241
|
+
level: level.value,
|
|
242
|
+
optional: !!__props.optional,
|
|
243
|
+
"optional-enabled": optionalEnabled.value,
|
|
244
|
+
path: __props.path,
|
|
245
|
+
error: __props.error,
|
|
246
|
+
hidden: __props.hidden,
|
|
247
|
+
"default-open": __props.arrayIndex !== void 0
|
|
248
|
+
}, {
|
|
249
|
+
"title-extras": (0, vue.withCtx)(() => [hasVariantPicker.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_variant_picker.as_variant_picker_default, {
|
|
250
|
+
key: 0,
|
|
251
|
+
"union-context": (0, vue.unref)(unionCtx),
|
|
252
|
+
disabled: __props.disabled
|
|
253
|
+
}, null, 8, ["union-context", "disabled"])) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
254
|
+
actions: (0, vue.withCtx)(() => [__props.onRemove ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
|
|
255
|
+
key: 0,
|
|
256
|
+
type: "button",
|
|
257
|
+
class: "as-field-remove-btn",
|
|
258
|
+
disabled: !__props.canRemove,
|
|
259
|
+
"aria-label": "Remove",
|
|
260
|
+
title: "Remove",
|
|
261
|
+
onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)((...args) => __props.onRemove && __props.onRemove(...args), ["stop", "prevent"]))
|
|
262
|
+
}, [..._cache[2] || (_cache[2] = [(0, vue.createElementVNode)("span", {
|
|
263
|
+
class: "as-field-remove-btn-icon",
|
|
264
|
+
"aria-hidden": "true"
|
|
265
|
+
}, null, -1)])], 8, _hoisted_3)) : __props.optional && optionalEnabled.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_variant_picker.as_optional_clear_default, {
|
|
266
|
+
key: 1,
|
|
267
|
+
label: __props.title,
|
|
268
|
+
onClear: _cache[1] || (_cache[1] = ($event) => __props.onToggleOptional?.(false))
|
|
269
|
+
}, null, 8, ["label"])) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
270
|
+
body: (0, vue.withCtx)(() => [objectDef.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(require_as_iterator.as_iterator_default, {
|
|
271
|
+
key: 0,
|
|
272
|
+
def: objectDef.value
|
|
273
|
+
}, null, 8, ["def"])) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
274
|
+
empty: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(["as-object-empty as-grid-item", _ctx.$props.class]) }, [(0, vue.createElementVNode)("button", {
|
|
275
|
+
type: "button",
|
|
276
|
+
class: "as-object-empty-add",
|
|
277
|
+
onClick: handleAddData
|
|
278
|
+
}, [_cache[3] || (_cache[3] = (0, vue.createElementVNode)("span", {
|
|
279
|
+
class: "i-as-field-fill as-object-empty-add-icon",
|
|
280
|
+
"aria-hidden": "true"
|
|
281
|
+
}, null, -1)), (0, vue.createTextVNode)(" Add " + (0, vue.toDisplayString)(__props.title), 1)]), __props.description ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_4, (0, vue.toDisplayString)(__props.description), 1)) : (0, vue.createCommentVNode)("v-if", true)], 2), [[vue.vShow, !__props.hidden]])]),
|
|
282
|
+
_: 1
|
|
283
|
+
}, 8, [
|
|
284
|
+
"class",
|
|
285
|
+
"title",
|
|
286
|
+
"array-index",
|
|
287
|
+
"description",
|
|
288
|
+
"level",
|
|
289
|
+
"optional",
|
|
290
|
+
"optional-enabled",
|
|
291
|
+
"path",
|
|
292
|
+
"error",
|
|
293
|
+
"hidden",
|
|
294
|
+
"default-open"
|
|
295
|
+
]));
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
//#endregion
|
|
300
|
+
Object.defineProperty(exports, "as_object_default", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: function() {
|
|
303
|
+
return as_object_default;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require("./use-form-context-Dwr8Ai1v.cjs");
|
|
2
|
+
require("./use-as-nested-sections-store-jdMRxjBE.cjs");
|
|
3
|
+
require("./as-field-wLYoaZnT.cjs");
|
|
4
|
+
require("./use-as-locale-C4z5stwD.cjs");
|
|
5
|
+
require("./as-iterator-BYMNe6UJ.cjs");
|
|
6
|
+
require("./use-as-dropdown-C-Qy7Vt0.cjs");
|
|
7
|
+
require("./as-variant-picker-DObQZHmm.cjs");
|
|
8
|
+
require("./use-as-optional-add-flow-STOaQWo9.cjs");
|
|
9
|
+
require("./as-collapsible-CqxeJut7.cjs");
|
|
10
|
+
const require_as_object = require("./as-object-qUL7l8V1.cjs");
|
|
11
|
+
module.exports = require_as_object.as_object_default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./use-form-context-bAj7UoSe.mjs";
|
|
2
|
+
import "./use-as-nested-sections-store-lhi0z5z1.mjs";
|
|
3
|
+
import "./as-field-CXVjrEPQ.mjs";
|
|
4
|
+
import "./use-as-locale-BrFdAgnU.mjs";
|
|
5
|
+
import "./as-iterator-CT5y1jyn.mjs";
|
|
6
|
+
import "./use-as-dropdown-BMnEm6jF.mjs";
|
|
7
|
+
import "./as-variant-picker-BVs0AvjK.mjs";
|
|
8
|
+
import "./use-as-optional-add-flow-CuXEir_i.mjs";
|
|
9
|
+
import "./as-collapsible-DtNCofNT.mjs";
|
|
10
|
+
import { t as as_object_default } from "./as-object-CT6lNEqt.mjs";
|
|
11
|
+
export { as_object_default as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { i as TAsComponentProps } from "./types-C4HRSxgV.cjs";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-object.vue.d.ts
|
|
5
|
+
type __VLS_Props = TAsComponentProps;
|
|
6
|
+
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
7
|
+
action: (name: string) => any;
|
|
8
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onAction?: ((name: string) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { _default as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { i as TAsComponentProps } from "./types-Czm-Gtud.mjs";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-object.vue.d.ts
|
|
5
|
+
type __VLS_Props = TAsComponentProps;
|
|
6
|
+
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
7
|
+
action: (name: string) => any;
|
|
8
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onAction?: ((name: string) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { _default as t };
|