ablok-components 0.0.27 → 0.0.31

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.
@@ -1,16 +1,13 @@
1
- import { defineComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, computed, resolveComponent, createBlock, createCommentVNode, unref, toDisplayString, withDirectives, isRef, vModelDynamic, vModelText, ref, watch, onBeforeMount, Fragment, renderList, createTextVNode, withModifiers } from "vue";
2
- var svgIcon_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".svg-icon{display:inline-block}.svg-icon svg{display:block;stroke-width:0;stroke:currentColor;fill:currentColor;width:1.5em;height:1.5em}.svg-icon--xxl svg{width:12rem;height:12rem}.svg-icon--xl svg{width:8rem;height:8rem}.svg-icon--large svg{width:4rem;height:4rem}\n")();
3
- const _hoisted_1$6 = {
1
+ import { defineComponent as g, openBlock as u, createElementBlock as s, normalizeClass as v, createElementVNode as i, renderSlot as f, computed as p, resolveComponent as $, createBlock as k, createCommentVNode as S, unref as y, toDisplayString as h, withDirectives as x, isRef as V, vModelDynamic as I, vModelText as C, ref as N, watch as B, onBeforeMount as z, Fragment as w, renderList as q, createTextVNode as O, withModifiers as L, reactive as T, createVNode as A } from "vue";
2
+ const D = {
4
3
  class: "icon",
5
4
  preserveAspectRatio: "xMaxYMin"
6
- };
7
- const _hoisted_2$5 = ["xlink:href"];
8
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
5
+ }, U = ["xlink:href"], ye = /* @__PURE__ */ g({
9
6
  __name: "svg-icon",
10
7
  props: {
11
8
  basePath: {
12
9
  type: String,
13
- default: "/static/symbol-defs.svg"
10
+ default: "/symbol-defs.svg"
14
11
  },
15
12
  prefix: {
16
13
  type: String,
@@ -25,29 +22,24 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
25
22
  default: "default"
26
23
  }
27
24
  },
28
- setup(__props) {
29
- return (_ctx, _cache) => {
30
- return openBlock(), createElementBlock("i", {
31
- class: normalizeClass(["svg-icon", {
32
- [`svg-icon--${__props.size}`]: __props.size
33
- }])
34
- }, [
35
- (openBlock(), createElementBlock("svg", _hoisted_1$6, [
36
- createElementVNode("use", {
37
- "xlink:href": `${__props.basePath}#${__props.prefix}${__props.symbol}`,
38
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
39
- x: "0",
40
- y: "0"
41
- }, null, 8, _hoisted_2$5)
42
- ]))
43
- ], 2);
44
- };
25
+ setup(e) {
26
+ return (r, n) => (u(), s("i", {
27
+ class: v(["svg-icon", {
28
+ [`svg-icon--${e.size}`]: e.size
29
+ }])
30
+ }, [
31
+ (u(), s("svg", D, [
32
+ i("use", {
33
+ "xlink:href": `${e.basePath}#${e.prefix}${e.symbol}`,
34
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
35
+ x: "0",
36
+ y: "0"
37
+ }, null, 8, U)
38
+ ]))
39
+ ], 2));
45
40
  }
46
41
  });
47
- var loadingSpinner_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".loading-spinner{min-width:2rem}\n")();
48
- const _hoisted_1$5 = { class: "loading-spinner d-block" };
49
- const _hoisted_2$4 = { class: "loading-spinner__animation" };
50
- const _hoisted_3$2 = {
42
+ const F = { class: "loading-spinner d-block" }, H = { class: "loading-spinner__animation" }, P = {
51
43
  class: "d-block",
52
44
  version: "1.1",
53
45
  id: "L9",
@@ -58,9 +50,7 @@ const _hoisted_3$2 = {
58
50
  viewBox: "0 0 100 100",
59
51
  "enable-background": "new 0 0 0 0",
60
52
  "xml:space": "preserve"
61
- };
62
- const _hoisted_4$2 = ["fill"];
63
- const _hoisted_5$2 = /* @__PURE__ */ createElementVNode("animateTransform", {
53
+ }, E = ["fill"], R = /* @__PURE__ */ i("animateTransform", {
64
54
  attributeName: "transform",
65
55
  attributeType: "XML",
66
56
  type: "rotate",
@@ -68,11 +58,9 @@ const _hoisted_5$2 = /* @__PURE__ */ createElementVNode("animateTransform", {
68
58
  from: "0 50 50",
69
59
  to: "360 50 50",
70
60
  repeatCount: "indefinite"
71
- }, null, -1);
72
- const _hoisted_6$1 = [
73
- _hoisted_5$2
74
- ];
75
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
61
+ }, null, -1), G = [
62
+ R
63
+ ], be = /* @__PURE__ */ g({
76
64
  __name: "loading-spinner",
77
65
  props: {
78
66
  color: {
@@ -80,25 +68,21 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
80
68
  default: "#fff"
81
69
  }
82
70
  },
83
- setup(__props) {
84
- return (_ctx, _cache) => {
85
- return openBlock(), createElementBlock("span", _hoisted_1$5, [
86
- createElementVNode("span", _hoisted_2$4, [
87
- (openBlock(), createElementBlock("svg", _hoisted_3$2, [
88
- createElementVNode("path", {
89
- fill: __props.color,
90
- d: "M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50"
91
- }, _hoisted_6$1, 8, _hoisted_4$2)
92
- ]))
93
- ]),
94
- renderSlot(_ctx.$slots, "default")
95
- ]);
96
- };
71
+ setup(e) {
72
+ return (r, n) => (u(), s("span", F, [
73
+ i("span", H, [
74
+ (u(), s("svg", P, [
75
+ i("path", {
76
+ fill: e.color,
77
+ d: "M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50"
78
+ }, G, 8, E)
79
+ ]))
80
+ ]),
81
+ f(r.$slots, "default")
82
+ ]));
97
83
  }
98
84
  });
99
- var baseButton_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".base-button{display:flex;justify-content:center;align-items:center;box-sizing:border-box;transition:all .2s ease;text-decoration:none;width:100%;margin:0;padding:1.036em 1.625em;appearance:none;outline:none;border:none;border-radius:.4375em;font-size:.875em;line-height:1.125em;text-transform:uppercase;font-weight:700}@media screen and (min-width: 600px){.base-button{width:auto}}.base-button .icon{width:16px;height:16px;margin-top:-1px}.base-button.s-collapsed>.caption{display:none}.base-button.s-pending{background-repeat:no-repeat;background-position:center center}.base-button.s-pending .caption{margin-left:25px;visibility:hidden}@media screen and (min-width: 600px){.base-button.s-pending{background-position:1.625em center}.base-button.s-pending .caption{visibility:visible}}.base-button[readonly],.base-button[disabled]{cursor:not-allowed}\n")();
100
- const _hoisted_1$4 = ["type", "disabled", "href", "to"];
101
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
85
+ const J = ["type", "disabled", "href", "to"], ge = /* @__PURE__ */ g({
102
86
  __name: "base-button",
103
87
  props: {
104
88
  type: null,
@@ -114,55 +98,49 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
114
98
  rounded: { type: Boolean },
115
99
  fab: { type: Boolean }
116
100
  },
117
- setup(__props) {
118
- const props = __props;
119
- const showCaption = computed(() => {
120
- return props.caption && !props.fab;
121
- });
122
- return (_ctx, _cache) => {
123
- const _component_svg_icon = resolveComponent("svg-icon");
124
- return openBlock(), createElementBlock("button", {
125
- type: __props.type,
126
- disabled: __props.disabled,
127
- href: __props.href,
128
- to: __props.to,
129
- class: normalizeClass(["base-button btn btn-primary", {
130
- disabled: __props.disabled,
131
- pending: __props.pending,
132
- rounded: __props.rounded,
133
- outlined: __props.outlined,
134
- fab: __props.fab,
135
- "x-large": __props.size === "x-large",
136
- "large": __props.size === "large",
137
- "small": __props.size === "small",
138
- "x-small": __props.size === "x-small"
101
+ setup(e) {
102
+ const r = e, n = p(() => r.caption && !r.fab);
103
+ return (a, d) => {
104
+ const l = $("svg-icon");
105
+ return u(), s("button", {
106
+ type: e.type,
107
+ disabled: e.disabled,
108
+ href: e.href,
109
+ to: e.to,
110
+ class: v(["base-button btn btn-primary", {
111
+ disabled: e.disabled,
112
+ pending: e.pending,
113
+ rounded: e.rounded,
114
+ outlined: e.outlined,
115
+ fab: e.fab,
116
+ "x-large": e.size === "x-large",
117
+ large: e.size === "large",
118
+ small: e.size === "small",
119
+ "x-small": e.size === "x-small"
139
120
  }])
140
121
  }, [
141
- renderSlot(_ctx.$slots, "default", {}, () => [
142
- __props.icon ? (openBlock(), createBlock(_component_svg_icon, {
122
+ f(a.$slots, "default", {}, () => [
123
+ e.icon ? (u(), k(l, {
143
124
  key: 0,
144
- id: __props.icon,
125
+ id: e.icon,
145
126
  class: "base-button__caption"
146
- }, null, 8, ["id"])) : createCommentVNode("", true),
147
- unref(showCaption) ? (openBlock(), createElementBlock("span", {
127
+ }, null, 8, ["id"])) : S("", !0),
128
+ y(n) ? (u(), s("span", {
148
129
  key: 1,
149
- class: normalizeClass(["base-button__caption", { "icon-padding": __props.icon }])
150
- }, toDisplayString(__props.caption), 3)) : createCommentVNode("", true)
130
+ class: v(["base-button__caption", { "icon-padding": e.icon }])
131
+ }, h(e.caption), 3)) : S("", !0)
151
132
  ])
152
- ], 10, _hoisted_1$4);
133
+ ], 10, J);
153
134
  };
154
135
  }
155
136
  });
156
- function uniqueId() {
137
+ function m() {
157
138
  return (new Date().valueOf() + Math.random()).toString(36);
158
139
  }
159
- var formInput_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".form-input{display:flex;flex-flow:column}.form-input>*{order:2}.form-input__label{order:0}.form-input__input-group{order:1}.form-input input[type=color]{flex:0 0 3rem;height:auto;padding:0;border-width:0}\n")();
160
- const _hoisted_1$3 = { class: "form-input" };
161
- const _hoisted_2$3 = { class: "input-group form-input__input-group" };
162
- const _hoisted_3$1 = ["type", "name", "id", "label", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "checked", "aria-label"];
163
- const _hoisted_4$1 = ["name", "id", "disabled", "read-only", "required", "aria-label"];
164
- const _hoisted_5$1 = ["for", "innerHTML"];
165
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
140
+ const j = { class: "input-group form-input__input-group" }, X = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "checked", "aria-label"], Y = {
141
+ key: 0,
142
+ class: "form-input__color-swatch"
143
+ }, K = ["name", "id", "disabled", "read-only", "required", "aria-label"], Q = ["for", "innerHTML"], pe = /* @__PURE__ */ g({
166
144
  __name: "form-input",
167
145
  props: {
168
146
  modelValue: {
@@ -175,11 +153,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
175
153
  },
176
154
  name: {
177
155
  type: String,
178
- default: () => uniqueId()
156
+ default: () => m()
179
157
  },
180
158
  id: {
181
159
  type: String,
182
- default: () => uniqueId()
160
+ default: () => m()
183
161
  },
184
162
  label: {
185
163
  type: String,
@@ -195,15 +173,15 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
195
173
  },
196
174
  disabled: {
197
175
  type: Boolean,
198
- default: false
176
+ default: !1
199
177
  },
200
178
  readOnly: {
201
179
  type: Boolean,
202
- default: false
180
+ default: !1
203
181
  },
204
182
  required: {
205
183
  type: Boolean,
206
- default: false
184
+ default: !1
207
185
  },
208
186
  maxlength: {
209
187
  type: Number
@@ -214,73 +192,70 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
214
192
  },
215
193
  checked: {
216
194
  type: Boolean,
217
- default: false
195
+ default: !1
218
196
  }
219
197
  },
220
198
  emits: ["update:modelValue"],
221
- setup(__props, { emit }) {
222
- const props = __props;
223
- const model = computed({
199
+ setup(e, { emit: r }) {
200
+ const n = e, a = p({
224
201
  get() {
225
- return props.modelValue;
202
+ return n.modelValue;
226
203
  },
227
- set(update) {
228
- emit("update:modelValue", update);
204
+ set(d) {
205
+ r("update:modelValue", d);
229
206
  }
230
207
  });
231
- return (_ctx, _cache) => {
232
- return openBlock(), createElementBlock("div", _hoisted_1$3, [
233
- createElementVNode("div", _hoisted_2$3, [
234
- renderSlot(_ctx.$slots, "input-prepend"),
235
- withDirectives(createElementVNode("input", {
236
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
237
- type: __props.type === "color" ? "text" : __props.type,
238
- name: __props.name,
239
- id: __props.id,
240
- label: `${__props.label}${__props.required ? " *" : ""}`,
241
- placeholder: __props.placeholder,
242
- pattern: __props.pattern,
243
- disabled: __props.disabled,
244
- "read-only": __props.readOnly,
245
- required: __props.required,
246
- maxlength: __props.maxlength,
247
- checked: __props.checked,
248
- class: "form-control",
249
- "aria-label": __props.label
250
- }, null, 8, _hoisted_3$1), [
251
- [vModelDynamic, unref(model)]
252
- ]),
253
- renderSlot(_ctx.$slots, "input-append", {}, () => [
254
- __props.type === "color" ? withDirectives((openBlock(), createElementBlock("input", {
255
- key: 0,
256
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(model) ? model.value = $event : null),
208
+ return (d, l) => (u(), s("div", {
209
+ class: v(["form-input", `form-input--${e.type}`])
210
+ }, [
211
+ i("div", j, [
212
+ f(d.$slots, "input-prepend"),
213
+ x(i("input", {
214
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => V(a) ? a.value = t : null),
215
+ type: e.type === "color" ? "text" : e.type,
216
+ id: e.id,
217
+ name: e.name,
218
+ placeholder: e.placeholder,
219
+ pattern: e.pattern,
220
+ disabled: e.disabled,
221
+ "read-only": e.readOnly,
222
+ required: e.required,
223
+ maxlength: e.maxlength,
224
+ checked: e.checked,
225
+ class: "form-control",
226
+ "aria-label": e.label
227
+ }, null, 8, X), [
228
+ [I, y(a)]
229
+ ]),
230
+ f(d.$slots, "input-append", {}, () => [
231
+ e.type === "color" ? (u(), s("span", Y, [
232
+ x(i("input", {
233
+ "onUpdate:modelValue": l[1] || (l[1] = (t) => V(a) ? a.value = t : null),
257
234
  type: "color",
258
- name: `${__props.name}-color`,
259
- id: `${__props.id}-color`,
260
- disabled: __props.disabled,
261
- "read-only": __props.readOnly,
262
- required: __props.required,
235
+ name: `${e.name}-color`,
236
+ id: `${e.id}-color`,
237
+ disabled: e.disabled,
238
+ "read-only": e.readOnly,
239
+ required: e.required,
263
240
  class: "form-control",
264
- "aria-label": __props.label
265
- }, null, 8, _hoisted_4$1)), [
266
- [vModelText, unref(model)]
267
- ]) : createCommentVNode("", true)
268
- ])
269
- ]),
270
- renderSlot(_ctx.$slots, "label", {}, () => [
271
- createElementVNode("label", {
272
- for: __props.id,
273
- class: "form-input__label",
274
- innerHTML: __props.label
275
- }, null, 8, _hoisted_5$1)
241
+ "aria-label": e.label
242
+ }, null, 8, K), [
243
+ [C, y(a)]
244
+ ])
245
+ ])) : S("", !0)
276
246
  ])
277
- ]);
278
- };
247
+ ]),
248
+ f(d.$slots, "label", {}, () => [
249
+ i("label", {
250
+ for: e.id,
251
+ class: "form-input__label",
252
+ innerHTML: `${e.label}${e.required ? " *" : ""}`
253
+ }, null, 8, Q)
254
+ ])
255
+ ], 2));
279
256
  }
280
257
  });
281
- const _hoisted_1$2 = { class: "radio-group" };
282
- const _hoisted_2$2 = ["for"];
283
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
258
+ const W = { class: "radio-group" }, Z = ["for"], he = /* @__PURE__ */ g({
284
259
  __name: "check-group",
285
260
  props: {
286
261
  modelValue: {
@@ -292,11 +267,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
292
267
  },
293
268
  name: {
294
269
  type: String,
295
- default: () => uniqueId()
270
+ default: () => m()
296
271
  },
297
272
  id: {
298
273
  type: String,
299
- default: () => uniqueId()
274
+ default: () => m()
300
275
  },
301
276
  label: {
302
277
  type: String,
@@ -308,66 +283,59 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
308
283
  },
309
284
  disabled: {
310
285
  type: Boolean,
311
- default: false
286
+ default: !1
312
287
  },
313
288
  readOnly: {
314
289
  type: Boolean,
315
- default: false
290
+ default: !1
316
291
  },
317
292
  required: {
318
293
  type: Boolean,
319
- default: false
294
+ default: !1
320
295
  }
321
296
  },
322
297
  emits: ["change", "update:modelValue"],
323
- setup(__props, { emit }) {
324
- const props = __props;
325
- const values = ref([]);
326
- watch(() => props.modelValue, (update, before) => {
327
- values.value = props.options.map((option) => option.value ? props.modelValue.some((modelValue) => modelValue["value "] === option.value) : props.modelValue.some((modelValue) => modelValue === option));
328
- }, { immediate: true });
329
- watch(values, (update, before) => {
330
- const options = update.reduce((mappedValues, option, index) => {
331
- const value = option && props.options[index] ? [props.options[index] || props.options[index]] : [];
332
- return [...mappedValues, ...value];
298
+ setup(e, { emit: r }) {
299
+ const n = e, a = N([]);
300
+ return B(() => n.modelValue, (d, l) => {
301
+ a.value = n.options.map(
302
+ (t) => t.value ? n.modelValue.some((o) => o["value "] === t.value) : n.modelValue.some((o) => o === t)
303
+ );
304
+ }, { immediate: !0 }), B(a, (d, l) => {
305
+ const t = d.reduce((o, c, b) => {
306
+ const M = c && n.options[b] ? [n.options[b] || n.options[b]] : [];
307
+ return [...o, ...M];
333
308
  }, []);
334
- emit("update:modelValue", options);
335
- }, { deep: true });
336
- onBeforeMount(() => {
337
- });
338
- return (_ctx, _cache) => {
339
- const _component_form_input = resolveComponent("form-input");
340
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
341
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
342
- return openBlock(), createBlock(_component_form_input, {
343
- key: index,
344
- modelValue: unref(values)[index],
345
- "onUpdate:modelValue": ($event) => unref(values)[index] = $event,
346
- type: "checkbox",
347
- name: __props.name,
348
- id: `${__props.id}-${index}`,
349
- label: `${option.text || option}${__props.required ? " *" : ""}`,
350
- disabled: __props.disabled,
351
- "read-only": __props.readOnly,
352
- required: __props.required
353
- }, null, 8, ["modelValue", "onUpdate:modelValue", "name", "id", "label", "disabled", "read-only", "required"]);
354
- }), 128)),
355
- createElementVNode("label", { for: __props.id }, [
356
- renderSlot(_ctx.$slots, "label", {}, () => [
357
- createTextVNode(toDisplayString(__props.label), 1)
309
+ r("update:modelValue", t);
310
+ }, { deep: !0 }), z(() => {
311
+ }), (d, l) => {
312
+ const t = $("form-input");
313
+ return u(), s("div", W, [
314
+ (u(!0), s(w, null, q(e.options, (o, c) => (u(), k(t, {
315
+ key: c,
316
+ modelValue: y(a)[c],
317
+ "onUpdate:modelValue": (b) => y(a)[c] = b,
318
+ type: "checkbox",
319
+ name: e.name,
320
+ id: `${e.id}-${c}`,
321
+ label: `${o.text || o}${e.required ? " *" : ""}`,
322
+ disabled: e.disabled,
323
+ "read-only": e.readOnly,
324
+ required: e.required
325
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "name", "id", "label", "disabled", "read-only", "required"]))), 128)),
326
+ i("label", { for: e.id }, [
327
+ f(d.$slots, "label", {}, () => [
328
+ O(h(e.label), 1)
358
329
  ])
359
- ], 8, _hoisted_2$2)
330
+ ], 8, Z)
360
331
  ]);
361
332
  };
362
333
  }
363
- });
364
- const _hoisted_1$1 = { class: "radio-group" };
365
- const _hoisted_2$1 = ["for"];
366
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
334
+ }), _ = { class: "radio-group" }, ee = ["for"], ve = /* @__PURE__ */ g({
367
335
  __name: "radio-group",
368
336
  props: {
369
337
  modelValue: {
370
- default: false
338
+ default: !1
371
339
  },
372
340
  options: {
373
341
  type: Array,
@@ -375,11 +343,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
375
343
  },
376
344
  name: {
377
345
  type: String,
378
- default: () => uniqueId()
346
+ default: () => m()
379
347
  },
380
348
  id: {
381
349
  type: String,
382
- default: () => uniqueId()
350
+ default: () => m()
383
351
  },
384
352
  label: {
385
353
  type: String,
@@ -391,64 +359,53 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
391
359
  },
392
360
  disabled: {
393
361
  type: Boolean,
394
- default: false
362
+ default: !1
395
363
  },
396
364
  readOnly: {
397
365
  type: Boolean,
398
- default: false
366
+ default: !1
399
367
  },
400
368
  required: {
401
369
  type: Boolean,
402
- default: false
370
+ default: !1
403
371
  }
404
372
  },
405
373
  emits: ["change", "update:modelValue"],
406
- setup(__props, { emit }) {
407
- const props = __props;
408
- ref(props.options.map((option) => option.value === props.modelValue));
409
- function change(value2) {
410
- emit("update:modelValue", value2);
374
+ setup(e, { emit: r }) {
375
+ const n = e;
376
+ N(n.options.map((d) => d.value === n.modelValue));
377
+ function a(d) {
378
+ r("update:modelValue", d);
411
379
  }
412
- onBeforeMount(() => {
413
- });
414
- return (_ctx, _cache) => {
415
- const _component_form_input = resolveComponent("form-input");
416
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
417
- (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option, index) => {
418
- return openBlock(), createBlock(_component_form_input, {
419
- key: index,
420
- type: "radio",
421
- name: __props.name,
422
- id: `${__props.id}-${index}`,
423
- value: option.value || option,
424
- label: `${option.text || option}${__props.required ? " *" : ""}`,
425
- checked: option.value ? option.value === __props.modelValue : option === __props.modelValue,
426
- disabled: __props.disabled,
427
- "read-only": __props.readOnly,
428
- required: __props.required,
429
- onChange: ($event) => change(option)
430
- }, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]);
431
- }), 128)),
432
- createElementVNode("label", { for: __props.id }, [
433
- renderSlot(_ctx.$slots, "label", {}, () => [
434
- createTextVNode(toDisplayString(__props.label), 1)
380
+ return z(() => {
381
+ }), (d, l) => {
382
+ const t = $("form-input");
383
+ return u(), s("div", _, [
384
+ (u(!0), s(w, null, q(e.options, (o, c) => (u(), k(t, {
385
+ key: c,
386
+ type: "radio",
387
+ name: e.name,
388
+ id: `${e.id}-${c}`,
389
+ value: o.value || o,
390
+ label: `${o.text || o}${e.required ? " *" : ""}`,
391
+ checked: o.value ? o.value === e.modelValue : o === e.modelValue,
392
+ disabled: e.disabled,
393
+ "read-only": e.readOnly,
394
+ required: e.required,
395
+ onChange: (b) => a(o)
396
+ }, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
397
+ i("label", { for: e.id }, [
398
+ f(d.$slots, "label", {}, () => [
399
+ O(h(e.label), 1)
435
400
  ])
436
- ], 8, _hoisted_2$1)
401
+ ], 8, ee)
437
402
  ]);
438
403
  };
439
404
  }
440
- });
441
- const _hoisted_1 = { class: "input input-dropdown" };
442
- const _hoisted_2 = { class: "dropdown" };
443
- const _hoisted_3 = {
405
+ }), te = { class: "input input-dropdown" }, le = { class: "dropdown" }, ae = {
444
406
  class: "btn-group",
445
407
  role: "group"
446
- };
447
- const _hoisted_4 = ["id", "disabled"];
448
- const _hoisted_5 = ["aria-labelledby"];
449
- const _hoisted_6 = ["onClick"];
450
- const _hoisted_7 = ["for"];
451
- const _sfc_main = /* @__PURE__ */ defineComponent({
408
+ }, ne = ["id", "disabled"], de = ["aria-labelledby"], oe = ["onClick"], ie = ["for"], $e = /* @__PURE__ */ g({
452
409
  __name: "input-dropdown",
453
410
  props: {
454
411
  modelValue: {
@@ -457,11 +414,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
457
414
  },
458
415
  name: {
459
416
  type: String,
460
- default: () => uniqueId()
417
+ default: () => m()
461
418
  },
462
419
  id: {
463
420
  type: String,
464
- default: () => uniqueId()
421
+ default: () => m()
465
422
  },
466
423
  label: {
467
424
  type: String,
@@ -485,91 +442,210 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
485
442
  },
486
443
  disabled: {
487
444
  type: Boolean,
488
- default: false
445
+ default: !1
489
446
  },
490
447
  multiple: {
491
448
  type: Boolean,
492
- default: false
449
+ default: !1
493
450
  },
494
451
  required: {
495
452
  type: Boolean,
496
- default: false
453
+ default: !1
497
454
  },
498
455
  outline: {
499
456
  type: Boolean,
500
- default: true
457
+ default: !0
501
458
  },
502
459
  resetOption: {
503
460
  type: Boolean,
504
- default: true
461
+ default: !0
505
462
  }
506
463
  },
507
464
  emits: ["update:modelValue"],
508
- setup(__props, { emit }) {
509
- const props = __props;
510
- computed({
465
+ setup(e, { emit: r }) {
466
+ const n = e;
467
+ p({
511
468
  get() {
512
- return props.modelValue;
469
+ return n.modelValue;
513
470
  },
514
- set(update) {
515
- emit("update:modelValue", update);
471
+ set(t) {
472
+ r("update:modelValue", t);
516
473
  }
517
474
  });
518
- function select(update) {
519
- emit("update:modelValue", update);
475
+ function a(t) {
476
+ r("update:modelValue", t);
520
477
  }
521
- const extendedOptions = computed(() => {
522
- return [
523
- {
524
- text: "Please select"
525
- },
526
- ...props.options.map((option) => typeof option === "string" ? { value: option, text: option } : option)
527
- ];
528
- });
529
- const selectedOption = computed(() => {
530
- return [...props.options].find((option) => JSON.stringify(option.value) === JSON.stringify(props.modelValue));
531
- });
532
- return (_ctx, _cache) => {
533
- return openBlock(), createElementBlock("div", _hoisted_1, [
534
- createElementVNode("div", _hoisted_2, [
535
- createElementVNode("div", _hoisted_3, [
536
- createElementVNode("button", {
537
- class: normalizeClass(["btn dropdown-toggle", {
538
- [`btn-${__props.variant}`]: __props.variant,
539
- [`btn-${__props.color}`]: __props.color,
540
- [`btn-${__props.disabled}`]: __props.disabled,
541
- [`btn-outline-${__props.color || "dark"}`]: __props.outline
542
- }]),
543
- type: "button",
544
- id: __props.id,
545
- "data-bs-toggle": "dropdown",
546
- "aria-expanded": "false",
547
- disabled: __props.disabled
548
- }, toDisplayString(unref(selectedOption) ? unref(selectedOption).text : __props.placeholder), 11, _hoisted_4),
549
- createElementVNode("ul", {
550
- class: "dropdown-menu",
551
- "aria-labelledby": __props.id
478
+ const d = p(() => [
479
+ {
480
+ text: "Please select"
481
+ },
482
+ ...n.options.map(
483
+ (t) => typeof t == "string" ? { value: t, text: t } : t
484
+ )
485
+ ]), l = p(() => [...n.options].find((t) => JSON.stringify(t.value) === JSON.stringify(n.modelValue)));
486
+ return (t, o) => (u(), s("div", te, [
487
+ i("div", le, [
488
+ i("div", ae, [
489
+ i("button", {
490
+ class: v(["btn dropdown-toggle", {
491
+ [`btn-${e.variant}`]: e.variant,
492
+ [`btn-${e.color}`]: e.color,
493
+ [`btn-${e.disabled}`]: e.disabled,
494
+ [`btn-outline-${e.color || "dark"}`]: e.outline
495
+ }]),
496
+ type: "button",
497
+ id: e.id,
498
+ "data-bs-toggle": "dropdown",
499
+ "aria-expanded": "false",
500
+ disabled: e.disabled
501
+ }, h(y(l) ? y(l).text : e.placeholder), 11, ne),
502
+ i("ul", {
503
+ class: "dropdown-menu",
504
+ "aria-labelledby": e.id
505
+ }, [
506
+ (u(!0), s(w, null, q(y(d), (c, b) => (u(), s("li", { key: b }, [
507
+ f(t.$slots, "option", {}, () => [
508
+ i("a", {
509
+ class: "dropdown-item",
510
+ onClick: L((M) => a(c.value), ["prevent"])
511
+ }, h(c.text), 9, oe)
512
+ ])
513
+ ]))), 128))
514
+ ], 8, de)
515
+ ])
516
+ ]),
517
+ i("label", { for: e.id }, [
518
+ f(t.$slots, "label", {}, () => [
519
+ O(h(e.label), 1)
520
+ ])
521
+ ], 8, ie)
522
+ ]));
523
+ }
524
+ }), ue = { class: "input-group" }, re = ["v-model", "id", "name"], se = ["name", "id", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "checked", "aria-label"], ce = ["for"], fe = ["for", "innerHTML"], Se = /* @__PURE__ */ g({
525
+ __name: "file-input",
526
+ props: {
527
+ modelValue: {
528
+ type: [String, Number, Boolean],
529
+ default: ""
530
+ },
531
+ type: {
532
+ type: String,
533
+ default: "text"
534
+ },
535
+ name: {
536
+ type: String,
537
+ default: () => m()
538
+ },
539
+ id: {
540
+ type: String,
541
+ default: () => m()
542
+ },
543
+ label: {
544
+ type: String,
545
+ default: ""
546
+ },
547
+ placeholder: {
548
+ type: String,
549
+ default: ""
550
+ },
551
+ variant: {
552
+ type: String,
553
+ default: ""
554
+ },
555
+ disabled: {
556
+ type: Boolean,
557
+ default: !1
558
+ },
559
+ readOnly: {
560
+ type: Boolean,
561
+ default: !1
562
+ },
563
+ required: {
564
+ type: Boolean,
565
+ default: !1
566
+ },
567
+ maxlength: {
568
+ type: Number
569
+ },
570
+ pattern: {
571
+ type: String,
572
+ default: null
573
+ },
574
+ checked: {
575
+ type: Boolean,
576
+ default: !1
577
+ }
578
+ },
579
+ emits: ["update:modelValue"],
580
+ setup(e, { emit: r }) {
581
+ function n(l) {
582
+ const t = l.target && l.target.files;
583
+ t && (a.splice(0, a.length), Array.from(t).forEach((o) => {
584
+ a.push(o);
585
+ }));
586
+ }
587
+ const a = T([]), d = p(() => a.map((l) => l.name));
588
+ return B(() => a, (l, t) => {
589
+ l !== t && r("update:modelValue", l);
590
+ }, { deep: !0 }), (l, t) => {
591
+ const o = $("svg-icon");
592
+ return u(), s("div", {
593
+ class: v(["file-input", "file-input--primary"])
594
+ }, [
595
+ i("div", ue, [
596
+ f(l.$slots, "input-prepend"),
597
+ i("input", {
598
+ "v-model": a,
599
+ type: "file",
600
+ id: e.id,
601
+ name: e.name,
602
+ onChange: n,
603
+ class: "d-none"
604
+ }, null, 40, re),
605
+ x(i("input", {
606
+ "onUpdate:modelValue": t[0] || (t[0] = (c) => V(d) ? d.value = c : null),
607
+ type: "text",
608
+ name: `${e.name}--text`,
609
+ id: `${e.name}--text`,
610
+ placeholder: e.placeholder,
611
+ pattern: e.pattern,
612
+ disabled: e.disabled,
613
+ "read-only": e.readOnly,
614
+ required: e.required,
615
+ maxlength: e.maxlength,
616
+ checked: e.checked,
617
+ class: "form-control",
618
+ "aria-label": e.label
619
+ }, null, 8, se), [
620
+ [C, y(d)]
621
+ ]),
622
+ f(l.$slots, "input-append", {}, () => [
623
+ i("label", {
624
+ for: e.id,
625
+ class: "input-group-text"
552
626
  }, [
553
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(extendedOptions), (option, index) => {
554
- return openBlock(), createElementBlock("li", { key: index }, [
555
- renderSlot(_ctx.$slots, "option", {}, () => [
556
- createElementVNode("a", {
557
- class: "dropdown-item",
558
- onClick: withModifiers(($event) => select(option.value), ["prevent"])
559
- }, toDisplayString(option.text), 9, _hoisted_6)
560
- ])
561
- ]);
562
- }), 128))
563
- ], 8, _hoisted_5)
627
+ A(o, { symbol: "upload" })
628
+ ], 8, ce)
564
629
  ])
565
630
  ]),
566
- createElementVNode("label", { for: __props.id }, [
567
- renderSlot(_ctx.$slots, "label", {}, () => [
568
- createTextVNode(toDisplayString(__props.label), 1)
569
- ])
570
- ], 8, _hoisted_7)
631
+ f(l.$slots, "label", {}, () => [
632
+ i("label", {
633
+ for: e.id,
634
+ class: "form-input__label",
635
+ innerHTML: `${e.label}${e.required ? " *" : ""}`
636
+ }, null, 8, fe)
637
+ ])
571
638
  ]);
572
639
  };
573
640
  }
574
641
  });
575
- export { _sfc_main$4 as BaseButton, _sfc_main$2 as CheckGroup, _sfc_main$3 as FormInput, _sfc_main as InputDropdown, _sfc_main$5 as LoadingSpinner, _sfc_main$1 as RadioGroup, _sfc_main$6 as SvgIcon };
642
+ export {
643
+ ge as BaseButton,
644
+ he as CheckGroup,
645
+ Se as FileInput,
646
+ pe as FormInput,
647
+ $e as InputDropdown,
648
+ be as LoadingSpinner,
649
+ ve as RadioGroup,
650
+ ye as SvgIcon
651
+ };