vuiii 0.1.0-alpha
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/README.md +16 -0
- package/dist/components/Breadcrumbs.vue.d.ts +17 -0
- package/dist/components/Button.vue.d.ts +76 -0
- package/dist/components/Checkbox.vue.d.ts +28 -0
- package/dist/components/CheckboxGroup.vue.d.ts +59 -0
- package/dist/components/Form.vue.d.ts +84 -0
- package/dist/components/FormFields.vue.d.ts +49 -0
- package/dist/components/FormGroup.vue.d.ts +47 -0
- package/dist/components/Icon.vue.d.ts +16 -0
- package/dist/components/Input.vue.d.ts +57 -0
- package/dist/components/Select.vue.d.ts +83 -0
- package/dist/components/Table.vue.d.ts +51 -0
- package/dist/components/Textarea.vue.d.ts +19 -0
- package/dist/components/modal/ModalLayout.vue.d.ts +32 -0
- package/dist/components/modal/ModalLayoutDialog.vue.d.ts +36 -0
- package/dist/components/modal/ModalStack.vue.d.ts +18 -0
- package/dist/components/snackbar/SnackbarStack.vue.d.ts +18 -0
- package/dist/favicon.ico +0 -0
- package/dist/hooks/useAction.d.ts +35 -0
- package/dist/icons/arrow-narrow-down.vue.d.ts +2 -0
- package/dist/icons/arrow-narrow-left.vue.d.ts +2 -0
- package/dist/icons/arrow-narrow-right.vue.d.ts +2 -0
- package/dist/icons/arrow-narrow-up.vue.d.ts +2 -0
- package/dist/icons/check-circle.vue.d.ts +2 -0
- package/dist/icons/check.vue.d.ts +2 -0
- package/dist/icons/chevron-left.vue.d.ts +2 -0
- package/dist/icons/chevron-right.vue.d.ts +2 -0
- package/dist/icons/exclamation-circle.vue.d.ts +2 -0
- package/dist/icons/exclamation.vue.d.ts +2 -0
- package/dist/icons/plus.vue.d.ts +2 -0
- package/dist/icons/search.vue.d.ts +2 -0
- package/dist/icons/spinner.vue.d.ts +2 -0
- package/dist/icons/trash.vue.d.ts +2 -0
- package/dist/icons/x.vue.d.ts +2 -0
- package/dist/index.d.ts +21 -0
- package/dist/modal.d.ts +69 -0
- package/dist/snackbar.d.ts +21 -0
- package/dist/style.css +1 -0
- package/dist/utils/normalizeOptions.d.ts +13 -0
- package/dist/utils/resolveGlobImport.d.ts +3 -0
- package/dist/utils/transformInputAttrs.d.ts +5 -0
- package/dist/vui.es.js +1751 -0
- package/dist/vui.umd.js +1 -0
- package/package.json +45 -0
package/dist/vui.es.js
ADDED
|
@@ -0,0 +1,1751 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { openBlock, createElementBlock, createElementVNode, pushScopeId, popScopeId, defineComponent, createBlock, resolveDynamicComponent, resolveComponent, Fragment, renderList, createVNode, withCtx, createTextVNode, toDisplayString, mergeProps, renderSlot, normalizeClass, createCommentVNode, withDirectives, vShow, withModifiers, normalizeProps, guardReactiveProps, normalizeStyle, useSlots, useAttrs, getCurrentInstance, getCurrentScope, computed, unref, createSlots, ref, onMounted, onBeforeUnmount, Transition, TransitionGroup, reactive, createApp, h } from "vue";
|
|
33
|
+
import { useRouter } from "vue-router";
|
|
34
|
+
var style = "";
|
|
35
|
+
var _export_sfc = (sfc, props) => {
|
|
36
|
+
const target = sfc.__vccOpts || sfc;
|
|
37
|
+
for (const [key, val] of props) {
|
|
38
|
+
target[key] = val;
|
|
39
|
+
}
|
|
40
|
+
return target;
|
|
41
|
+
};
|
|
42
|
+
const _sfc_main$u = {};
|
|
43
|
+
const _hoisted_1$t = {
|
|
44
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
45
|
+
fill: "none",
|
|
46
|
+
viewBox: "0 0 24 24",
|
|
47
|
+
stroke: "currentColor",
|
|
48
|
+
"stroke-width": "2"
|
|
49
|
+
};
|
|
50
|
+
const _hoisted_2$n = /* @__PURE__ */ createElementVNode("path", {
|
|
51
|
+
"stroke-linecap": "round",
|
|
52
|
+
"stroke-linejoin": "round",
|
|
53
|
+
d: "M16 17l-4 4m0 0l-4-4m4 4V3"
|
|
54
|
+
}, null, -1);
|
|
55
|
+
const _hoisted_3$l = [
|
|
56
|
+
_hoisted_2$n
|
|
57
|
+
];
|
|
58
|
+
function _sfc_render$o(_ctx, _cache) {
|
|
59
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$t, _hoisted_3$l);
|
|
60
|
+
}
|
|
61
|
+
var arrowNarrowDown = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$o]]);
|
|
62
|
+
var __glob_2_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
63
|
+
__proto__: null,
|
|
64
|
+
"default": arrowNarrowDown
|
|
65
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
66
|
+
const _sfc_main$t = {};
|
|
67
|
+
const _hoisted_1$s = {
|
|
68
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
69
|
+
fill: "none",
|
|
70
|
+
viewBox: "0 0 24 24",
|
|
71
|
+
stroke: "currentColor",
|
|
72
|
+
"stroke-width": "2"
|
|
73
|
+
};
|
|
74
|
+
const _hoisted_2$m = /* @__PURE__ */ createElementVNode("path", {
|
|
75
|
+
"stroke-linecap": "round",
|
|
76
|
+
"stroke-linejoin": "round",
|
|
77
|
+
d: "M7 16l-4-4m0 0l4-4m-4 4h18"
|
|
78
|
+
}, null, -1);
|
|
79
|
+
const _hoisted_3$k = [
|
|
80
|
+
_hoisted_2$m
|
|
81
|
+
];
|
|
82
|
+
function _sfc_render$n(_ctx, _cache) {
|
|
83
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$s, _hoisted_3$k);
|
|
84
|
+
}
|
|
85
|
+
var arrowNarrowLeft = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$n]]);
|
|
86
|
+
var __glob_2_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
87
|
+
__proto__: null,
|
|
88
|
+
"default": arrowNarrowLeft
|
|
89
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
90
|
+
const _sfc_main$s = {};
|
|
91
|
+
const _hoisted_1$r = {
|
|
92
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
93
|
+
fill: "none",
|
|
94
|
+
viewBox: "0 0 24 24",
|
|
95
|
+
stroke: "currentColor",
|
|
96
|
+
"stroke-width": "2"
|
|
97
|
+
};
|
|
98
|
+
const _hoisted_2$l = /* @__PURE__ */ createElementVNode("path", {
|
|
99
|
+
"stroke-linecap": "round",
|
|
100
|
+
"stroke-linejoin": "round",
|
|
101
|
+
d: "M17 8l4 4m0 0l-4 4m4-4H3"
|
|
102
|
+
}, null, -1);
|
|
103
|
+
const _hoisted_3$j = [
|
|
104
|
+
_hoisted_2$l
|
|
105
|
+
];
|
|
106
|
+
function _sfc_render$m(_ctx, _cache) {
|
|
107
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$r, _hoisted_3$j);
|
|
108
|
+
}
|
|
109
|
+
var arrowNarrowRight = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$m]]);
|
|
110
|
+
var __glob_2_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
111
|
+
__proto__: null,
|
|
112
|
+
"default": arrowNarrowRight
|
|
113
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
114
|
+
const _sfc_main$r = {};
|
|
115
|
+
const _hoisted_1$q = {
|
|
116
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
117
|
+
fill: "none",
|
|
118
|
+
viewBox: "0 0 24 24",
|
|
119
|
+
stroke: "currentColor",
|
|
120
|
+
"stroke-width": "2"
|
|
121
|
+
};
|
|
122
|
+
const _hoisted_2$k = /* @__PURE__ */ createElementVNode("path", {
|
|
123
|
+
"stroke-linecap": "round",
|
|
124
|
+
"stroke-linejoin": "round",
|
|
125
|
+
d: "M8 7l4-4m0 0l4 4m-4-4v18"
|
|
126
|
+
}, null, -1);
|
|
127
|
+
const _hoisted_3$i = [
|
|
128
|
+
_hoisted_2$k
|
|
129
|
+
];
|
|
130
|
+
function _sfc_render$l(_ctx, _cache) {
|
|
131
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$q, _hoisted_3$i);
|
|
132
|
+
}
|
|
133
|
+
var arrowNarrowUp = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$l]]);
|
|
134
|
+
var __glob_2_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
135
|
+
__proto__: null,
|
|
136
|
+
"default": arrowNarrowUp
|
|
137
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
138
|
+
const _sfc_main$q = {};
|
|
139
|
+
const _hoisted_1$p = {
|
|
140
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
141
|
+
fill: "none",
|
|
142
|
+
viewBox: "0 0 24 24",
|
|
143
|
+
stroke: "currentColor",
|
|
144
|
+
"stroke-width": "2"
|
|
145
|
+
};
|
|
146
|
+
const _hoisted_2$j = /* @__PURE__ */ createElementVNode("path", {
|
|
147
|
+
"stroke-linecap": "round",
|
|
148
|
+
"stroke-linejoin": "round",
|
|
149
|
+
d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
150
|
+
}, null, -1);
|
|
151
|
+
const _hoisted_3$h = [
|
|
152
|
+
_hoisted_2$j
|
|
153
|
+
];
|
|
154
|
+
function _sfc_render$k(_ctx, _cache) {
|
|
155
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$p, _hoisted_3$h);
|
|
156
|
+
}
|
|
157
|
+
var checkCircle = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$k]]);
|
|
158
|
+
var __glob_2_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
159
|
+
__proto__: null,
|
|
160
|
+
"default": checkCircle
|
|
161
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
162
|
+
const _sfc_main$p = {};
|
|
163
|
+
const _hoisted_1$o = {
|
|
164
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
165
|
+
fill: "none",
|
|
166
|
+
viewBox: "0 0 24 24",
|
|
167
|
+
stroke: "currentColor",
|
|
168
|
+
"stroke-width": "2"
|
|
169
|
+
};
|
|
170
|
+
const _hoisted_2$i = /* @__PURE__ */ createElementVNode("path", {
|
|
171
|
+
"stroke-linecap": "round",
|
|
172
|
+
"stroke-linejoin": "round",
|
|
173
|
+
d: "M5 13l4 4L19 7"
|
|
174
|
+
}, null, -1);
|
|
175
|
+
const _hoisted_3$g = [
|
|
176
|
+
_hoisted_2$i
|
|
177
|
+
];
|
|
178
|
+
function _sfc_render$j(_ctx, _cache) {
|
|
179
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$o, _hoisted_3$g);
|
|
180
|
+
}
|
|
181
|
+
var check = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$j]]);
|
|
182
|
+
var __glob_2_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
183
|
+
__proto__: null,
|
|
184
|
+
"default": check
|
|
185
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
186
|
+
const _sfc_main$o = {};
|
|
187
|
+
const _hoisted_1$n = {
|
|
188
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
189
|
+
fill: "none",
|
|
190
|
+
viewBox: "0 0 24 24",
|
|
191
|
+
stroke: "currentColor",
|
|
192
|
+
"stroke-width": "2"
|
|
193
|
+
};
|
|
194
|
+
const _hoisted_2$h = /* @__PURE__ */ createElementVNode("path", {
|
|
195
|
+
"stroke-linecap": "round",
|
|
196
|
+
"stroke-linejoin": "round",
|
|
197
|
+
d: "M15 19l-7-7 7-7"
|
|
198
|
+
}, null, -1);
|
|
199
|
+
const _hoisted_3$f = [
|
|
200
|
+
_hoisted_2$h
|
|
201
|
+
];
|
|
202
|
+
function _sfc_render$i(_ctx, _cache) {
|
|
203
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$n, _hoisted_3$f);
|
|
204
|
+
}
|
|
205
|
+
var chevronLeft = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$i]]);
|
|
206
|
+
var __glob_2_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
207
|
+
__proto__: null,
|
|
208
|
+
"default": chevronLeft
|
|
209
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
210
|
+
const _sfc_main$n = {};
|
|
211
|
+
const _hoisted_1$m = {
|
|
212
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
213
|
+
fill: "none",
|
|
214
|
+
viewBox: "0 0 24 24",
|
|
215
|
+
stroke: "currentColor",
|
|
216
|
+
"stroke-width": "2"
|
|
217
|
+
};
|
|
218
|
+
const _hoisted_2$g = /* @__PURE__ */ createElementVNode("path", {
|
|
219
|
+
"stroke-linecap": "round",
|
|
220
|
+
"stroke-linejoin": "round",
|
|
221
|
+
d: "M9 5l7 7-7 7"
|
|
222
|
+
}, null, -1);
|
|
223
|
+
const _hoisted_3$e = [
|
|
224
|
+
_hoisted_2$g
|
|
225
|
+
];
|
|
226
|
+
function _sfc_render$h(_ctx, _cache) {
|
|
227
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$m, _hoisted_3$e);
|
|
228
|
+
}
|
|
229
|
+
var chevronRight = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$h]]);
|
|
230
|
+
var __glob_2_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
231
|
+
__proto__: null,
|
|
232
|
+
"default": chevronRight
|
|
233
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
234
|
+
const _sfc_main$m = {};
|
|
235
|
+
const _hoisted_1$l = {
|
|
236
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
237
|
+
fill: "none",
|
|
238
|
+
viewBox: "0 0 24 24",
|
|
239
|
+
stroke: "currentColor",
|
|
240
|
+
"stroke-width": "2"
|
|
241
|
+
};
|
|
242
|
+
const _hoisted_2$f = /* @__PURE__ */ createElementVNode("path", {
|
|
243
|
+
"stroke-linecap": "round",
|
|
244
|
+
"stroke-linejoin": "round",
|
|
245
|
+
d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
246
|
+
}, null, -1);
|
|
247
|
+
const _hoisted_3$d = [
|
|
248
|
+
_hoisted_2$f
|
|
249
|
+
];
|
|
250
|
+
function _sfc_render$g(_ctx, _cache) {
|
|
251
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$l, _hoisted_3$d);
|
|
252
|
+
}
|
|
253
|
+
var exclamationCircle = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$g]]);
|
|
254
|
+
var __glob_2_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
255
|
+
__proto__: null,
|
|
256
|
+
"default": exclamationCircle
|
|
257
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
258
|
+
const _sfc_main$l = {};
|
|
259
|
+
const _hoisted_1$k = {
|
|
260
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
261
|
+
fill: "none",
|
|
262
|
+
viewBox: "0 0 24 24",
|
|
263
|
+
stroke: "currentColor",
|
|
264
|
+
"stroke-width": "2"
|
|
265
|
+
};
|
|
266
|
+
const _hoisted_2$e = /* @__PURE__ */ createElementVNode("path", {
|
|
267
|
+
"stroke-linecap": "round",
|
|
268
|
+
"stroke-linejoin": "round",
|
|
269
|
+
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
270
|
+
}, null, -1);
|
|
271
|
+
const _hoisted_3$c = [
|
|
272
|
+
_hoisted_2$e
|
|
273
|
+
];
|
|
274
|
+
function _sfc_render$f(_ctx, _cache) {
|
|
275
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$k, _hoisted_3$c);
|
|
276
|
+
}
|
|
277
|
+
var exclamation = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$f]]);
|
|
278
|
+
var __glob_2_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
279
|
+
__proto__: null,
|
|
280
|
+
"default": exclamation
|
|
281
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
282
|
+
const _sfc_main$k = {};
|
|
283
|
+
const _hoisted_1$j = {
|
|
284
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
285
|
+
fill: "none",
|
|
286
|
+
viewBox: "0 0 24 24",
|
|
287
|
+
stroke: "currentColor",
|
|
288
|
+
"stroke-width": "2"
|
|
289
|
+
};
|
|
290
|
+
const _hoisted_2$d = /* @__PURE__ */ createElementVNode("path", {
|
|
291
|
+
"stroke-linecap": "round",
|
|
292
|
+
"stroke-linejoin": "round",
|
|
293
|
+
d: "M12 4v16m8-8H4"
|
|
294
|
+
}, null, -1);
|
|
295
|
+
const _hoisted_3$b = [
|
|
296
|
+
_hoisted_2$d
|
|
297
|
+
];
|
|
298
|
+
function _sfc_render$e(_ctx, _cache) {
|
|
299
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$j, _hoisted_3$b);
|
|
300
|
+
}
|
|
301
|
+
var plus = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$e]]);
|
|
302
|
+
var __glob_2_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
303
|
+
__proto__: null,
|
|
304
|
+
"default": plus
|
|
305
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
306
|
+
const _sfc_main$j = {};
|
|
307
|
+
const _hoisted_1$i = {
|
|
308
|
+
fill: "none",
|
|
309
|
+
stroke: "currentColor",
|
|
310
|
+
viewBox: "0 0 24 24",
|
|
311
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
312
|
+
};
|
|
313
|
+
const _hoisted_2$c = /* @__PURE__ */ createElementVNode("path", {
|
|
314
|
+
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",
|
|
315
|
+
"stroke-linecap": "round",
|
|
316
|
+
"stroke-linejoin": "round",
|
|
317
|
+
"stroke-width": "2"
|
|
318
|
+
}, null, -1);
|
|
319
|
+
const _hoisted_3$a = [
|
|
320
|
+
_hoisted_2$c
|
|
321
|
+
];
|
|
322
|
+
function _sfc_render$d(_ctx, _cache) {
|
|
323
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$i, _hoisted_3$a);
|
|
324
|
+
}
|
|
325
|
+
var search = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$d]]);
|
|
326
|
+
var __glob_2_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
327
|
+
__proto__: null,
|
|
328
|
+
"default": search
|
|
329
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
330
|
+
var spinner_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
331
|
+
const _sfc_main$i = {};
|
|
332
|
+
const _withScopeId$1 = (n) => (pushScopeId("data-v-683816b2"), n = n(), popScopeId(), n);
|
|
333
|
+
const _hoisted_1$h = {
|
|
334
|
+
class: "IconSpinner",
|
|
335
|
+
fill: "none",
|
|
336
|
+
stroke: "currentColor",
|
|
337
|
+
viewBox: "0 0 25 25",
|
|
338
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
339
|
+
};
|
|
340
|
+
const _hoisted_2$b = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("path", {
|
|
341
|
+
d: "M23.5 12.5c0 6.1-4.9 11-11 11s-11-4.9-11-11 4.9-11 11-11",
|
|
342
|
+
"shape-rendering": "geometricPrecision",
|
|
343
|
+
style: { "stroke-width": "2", "stroke-miterlimit": "10", "stroke": "currentColor", "fill": "none" },
|
|
344
|
+
"vector-effect": "non-scaling-stroke"
|
|
345
|
+
}, null, -1));
|
|
346
|
+
const _hoisted_3$9 = [
|
|
347
|
+
_hoisted_2$b
|
|
348
|
+
];
|
|
349
|
+
function _sfc_render$c(_ctx, _cache) {
|
|
350
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$h, _hoisted_3$9);
|
|
351
|
+
}
|
|
352
|
+
var spinner = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$c], ["__scopeId", "data-v-683816b2"]]);
|
|
353
|
+
var __glob_2_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
354
|
+
__proto__: null,
|
|
355
|
+
"default": spinner
|
|
356
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
357
|
+
const _sfc_main$h = {};
|
|
358
|
+
const _hoisted_1$g = {
|
|
359
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
360
|
+
fill: "none",
|
|
361
|
+
viewBox: "0 0 24 24",
|
|
362
|
+
stroke: "currentColor",
|
|
363
|
+
"stroke-width": "2"
|
|
364
|
+
};
|
|
365
|
+
const _hoisted_2$a = /* @__PURE__ */ createElementVNode("path", {
|
|
366
|
+
"stroke-linecap": "round",
|
|
367
|
+
"stroke-linejoin": "round",
|
|
368
|
+
d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"
|
|
369
|
+
}, null, -1);
|
|
370
|
+
const _hoisted_3$8 = [
|
|
371
|
+
_hoisted_2$a
|
|
372
|
+
];
|
|
373
|
+
function _sfc_render$b(_ctx, _cache) {
|
|
374
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$g, _hoisted_3$8);
|
|
375
|
+
}
|
|
376
|
+
var trash = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$b]]);
|
|
377
|
+
var __glob_2_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
378
|
+
__proto__: null,
|
|
379
|
+
"default": trash
|
|
380
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
381
|
+
const _sfc_main$g = {};
|
|
382
|
+
const _hoisted_1$f = {
|
|
383
|
+
"aria-hidden": "true",
|
|
384
|
+
fill: "none",
|
|
385
|
+
stroke: "currentColor",
|
|
386
|
+
viewBox: "0 0 24 24",
|
|
387
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
388
|
+
};
|
|
389
|
+
const _hoisted_2$9 = /* @__PURE__ */ createElementVNode("path", {
|
|
390
|
+
d: "M6 18L18 6M6 6l12 12",
|
|
391
|
+
"stroke-linecap": "round",
|
|
392
|
+
"stroke-linejoin": "round",
|
|
393
|
+
"stroke-width": "2"
|
|
394
|
+
}, null, -1);
|
|
395
|
+
const _hoisted_3$7 = [
|
|
396
|
+
_hoisted_2$9
|
|
397
|
+
];
|
|
398
|
+
function _sfc_render$a(_ctx, _cache) {
|
|
399
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$f, _hoisted_3$7);
|
|
400
|
+
}
|
|
401
|
+
var x = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$a]]);
|
|
402
|
+
var __glob_2_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
403
|
+
__proto__: null,
|
|
404
|
+
"default": x
|
|
405
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
406
|
+
function resolveGlobImport(imports, filename) {
|
|
407
|
+
var _a;
|
|
408
|
+
return (_a = Object.entries(imports).map(([path, source]) => ({ path, source })).find((item) => item.path.endsWith(`/${filename}`))) == null ? void 0 : _a.source.default;
|
|
409
|
+
}
|
|
410
|
+
var Icon_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
411
|
+
let customIconResolver;
|
|
412
|
+
function registerCustomIconResolver(resolver) {
|
|
413
|
+
customIconResolver = resolver;
|
|
414
|
+
}
|
|
415
|
+
function resolveIconComponent(name) {
|
|
416
|
+
let component;
|
|
417
|
+
if (customIconResolver) {
|
|
418
|
+
component = customIconResolver(name);
|
|
419
|
+
}
|
|
420
|
+
if (!component) {
|
|
421
|
+
component = resolveGlobImport(icons, `${name}.vue`);
|
|
422
|
+
}
|
|
423
|
+
return component;
|
|
424
|
+
}
|
|
425
|
+
const icons = { "../icons/arrow-narrow-down.vue": __glob_2_0, "../icons/arrow-narrow-left.vue": __glob_2_1, "../icons/arrow-narrow-right.vue": __glob_2_2, "../icons/arrow-narrow-up.vue": __glob_2_3, "../icons/check-circle.vue": __glob_2_4, "../icons/check.vue": __glob_2_5, "../icons/chevron-left.vue": __glob_2_6, "../icons/chevron-right.vue": __glob_2_7, "../icons/exclamation-circle.vue": __glob_2_8, "../icons/exclamation.vue": __glob_2_9, "../icons/plus.vue": __glob_2_10, "../icons/search.vue": __glob_2_11, "../icons/spinner.vue": __glob_2_12, "../icons/trash.vue": __glob_2_13, "../icons/x.vue": __glob_2_14 };
|
|
426
|
+
const _sfc_main$f = defineComponent({
|
|
427
|
+
props: {
|
|
428
|
+
name: {
|
|
429
|
+
type: String,
|
|
430
|
+
required: true
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
data() {
|
|
434
|
+
return {
|
|
435
|
+
component: void 0
|
|
436
|
+
};
|
|
437
|
+
},
|
|
438
|
+
watch: {
|
|
439
|
+
name: {
|
|
440
|
+
immediate: true,
|
|
441
|
+
handler() {
|
|
442
|
+
this.component = resolveIconComponent(this.name);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
448
|
+
return openBlock(), createBlock(resolveDynamicComponent(__spreadValues({}, _ctx.component)), { class: "Icon" });
|
|
449
|
+
}
|
|
450
|
+
var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$9], ["__scopeId", "data-v-3f9f02d0"]]);
|
|
451
|
+
var Breadcrumbs_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
452
|
+
const _sfc_main$e = defineComponent({
|
|
453
|
+
components: {
|
|
454
|
+
Icon
|
|
455
|
+
},
|
|
456
|
+
props: {
|
|
457
|
+
breadcrumbs: {
|
|
458
|
+
type: Object,
|
|
459
|
+
default: () => ({})
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
const _hoisted_1$e = { class: "Breadcrumbs" };
|
|
464
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
465
|
+
const _component_router_link = resolveComponent("router-link");
|
|
466
|
+
const _component_Icon = resolveComponent("Icon");
|
|
467
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
468
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.breadcrumbs, (location, label, index) => {
|
|
469
|
+
return openBlock(), createElementBlock("div", {
|
|
470
|
+
key: index,
|
|
471
|
+
class: "Breadcrumbs__breadcrumb"
|
|
472
|
+
}, [
|
|
473
|
+
createVNode(_component_router_link, {
|
|
474
|
+
to: location,
|
|
475
|
+
class: "Breadcrumbs__link"
|
|
476
|
+
}, {
|
|
477
|
+
default: withCtx(() => [
|
|
478
|
+
createTextVNode(toDisplayString(label), 1)
|
|
479
|
+
]),
|
|
480
|
+
_: 2
|
|
481
|
+
}, 1032, ["to"]),
|
|
482
|
+
createVNode(_component_Icon, {
|
|
483
|
+
name: "chevron-right",
|
|
484
|
+
class: "Breadcrumbs__arrow"
|
|
485
|
+
})
|
|
486
|
+
]);
|
|
487
|
+
}), 128))
|
|
488
|
+
]);
|
|
489
|
+
}
|
|
490
|
+
var Breadcrumbs = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$8], ["__scopeId", "data-v-357000f6"]]);
|
|
491
|
+
var button = "";
|
|
492
|
+
var Button_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
493
|
+
const sizes$2 = ["normal", "small"];
|
|
494
|
+
const variants = ["default", "primary", "secondary", "danger"];
|
|
495
|
+
const _sfc_main$d = defineComponent({
|
|
496
|
+
components: {
|
|
497
|
+
Icon
|
|
498
|
+
},
|
|
499
|
+
inheritAttrs: false,
|
|
500
|
+
props: {
|
|
501
|
+
size: {
|
|
502
|
+
type: String,
|
|
503
|
+
default: "normal",
|
|
504
|
+
validator: (value) => sizes$2.includes(value)
|
|
505
|
+
},
|
|
506
|
+
variant: {
|
|
507
|
+
type: String,
|
|
508
|
+
default: "default",
|
|
509
|
+
validator: (value) => variants.includes(value)
|
|
510
|
+
},
|
|
511
|
+
prefixIcon: {
|
|
512
|
+
type: String,
|
|
513
|
+
default: ""
|
|
514
|
+
},
|
|
515
|
+
suffixIcon: {
|
|
516
|
+
type: String,
|
|
517
|
+
default: ""
|
|
518
|
+
},
|
|
519
|
+
label: {
|
|
520
|
+
type: String,
|
|
521
|
+
default: ""
|
|
522
|
+
},
|
|
523
|
+
active: Boolean,
|
|
524
|
+
loading: Boolean,
|
|
525
|
+
block: Boolean,
|
|
526
|
+
disabled: Boolean
|
|
527
|
+
},
|
|
528
|
+
computed: {
|
|
529
|
+
component() {
|
|
530
|
+
if (this.$attrs.to) {
|
|
531
|
+
return "router-link";
|
|
532
|
+
}
|
|
533
|
+
if (this.$attrs.href) {
|
|
534
|
+
return "a";
|
|
535
|
+
}
|
|
536
|
+
return "button";
|
|
537
|
+
},
|
|
538
|
+
classModifiers() {
|
|
539
|
+
const classModifiers = [this.size, this.variant];
|
|
540
|
+
if (this.active) {
|
|
541
|
+
classModifiers.push("active");
|
|
542
|
+
}
|
|
543
|
+
if (this.loading) {
|
|
544
|
+
classModifiers.push("loading");
|
|
545
|
+
}
|
|
546
|
+
if (this.disabled) {
|
|
547
|
+
classModifiers.push("disabled");
|
|
548
|
+
}
|
|
549
|
+
return classModifiers.map((modifier) => `button--${modifier}`);
|
|
550
|
+
},
|
|
551
|
+
normalizedAttrs() {
|
|
552
|
+
return __spreadValues({
|
|
553
|
+
type: this.component === "button" ? "button" : void 0
|
|
554
|
+
}, this.$attrs);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
const _hoisted_1$d = { key: 1 };
|
|
559
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
560
|
+
const _component_Icon = resolveComponent("Icon");
|
|
561
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.component), mergeProps({
|
|
562
|
+
class: ["Button button", [_ctx.classModifiers, { "Button--block": _ctx.block }, { "button--disabled": _ctx.$attrs.disabled }]]
|
|
563
|
+
}, _ctx.normalizedAttrs), {
|
|
564
|
+
default: withCtx(() => [
|
|
565
|
+
renderSlot(_ctx.$slots, "prefix", {}, () => [
|
|
566
|
+
_ctx.prefixIcon && !_ctx.loading ? (openBlock(), createBlock(_component_Icon, {
|
|
567
|
+
key: 0,
|
|
568
|
+
class: normalizeClass(["Button__icon Button__icon--prefix", [`Button__icon--${_ctx.size}`]]),
|
|
569
|
+
name: _ctx.prefixIcon
|
|
570
|
+
}, null, 8, ["class", "name"])) : createCommentVNode("", true)
|
|
571
|
+
], true),
|
|
572
|
+
_ctx.loading ? (openBlock(), createBlock(_component_Icon, {
|
|
573
|
+
key: 0,
|
|
574
|
+
class: normalizeClass(["Button__icon Button__icon--prefix", [`Button__icon--${_ctx.size}`]]),
|
|
575
|
+
name: "spinner"
|
|
576
|
+
}, null, 8, ["class"])) : createCommentVNode("", true),
|
|
577
|
+
_ctx.$slots.default || _ctx.label ? (openBlock(), createElementBlock("span", _hoisted_1$d, [
|
|
578
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
579
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
580
|
+
], true)
|
|
581
|
+
])) : createCommentVNode("", true),
|
|
582
|
+
renderSlot(_ctx.$slots, "suffix", {}, () => [
|
|
583
|
+
_ctx.suffixIcon ? (openBlock(), createBlock(_component_Icon, {
|
|
584
|
+
key: 0,
|
|
585
|
+
class: normalizeClass(["Button__icon Button__icon--suffix", [`Button__icon--${_ctx.size}`]]),
|
|
586
|
+
name: _ctx.suffixIcon
|
|
587
|
+
}, null, 8, ["class", "name"])) : createCommentVNode("", true)
|
|
588
|
+
], true)
|
|
589
|
+
]),
|
|
590
|
+
_: 3
|
|
591
|
+
}, 16, ["class"]);
|
|
592
|
+
}
|
|
593
|
+
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$7], ["__scopeId", "data-v-4c3e5fdd"]]);
|
|
594
|
+
var input = "";
|
|
595
|
+
const transformInputAttrs = defineComponent({
|
|
596
|
+
emits: ["update:modelValue"],
|
|
597
|
+
computed: {
|
|
598
|
+
normalizedAttrs() {
|
|
599
|
+
const retrieveValue2 = (element) => {
|
|
600
|
+
if (element.getAttribute("type") === "number") {
|
|
601
|
+
return element.valueAsNumber;
|
|
602
|
+
}
|
|
603
|
+
if (element.getAttribute("type") === "checkbox") {
|
|
604
|
+
return element.checked;
|
|
605
|
+
}
|
|
606
|
+
return element.value;
|
|
607
|
+
};
|
|
608
|
+
const _a = this.$attrs, { class: _class } = _a, attrs = __objRest(_a, ["class"]);
|
|
609
|
+
return __spreadProps(__spreadValues({}, attrs), {
|
|
610
|
+
onInput: (e) => this.$emit("update:modelValue", retrieveValue2(e.target))
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
var Checkbox_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
616
|
+
const _sfc_main$c = defineComponent({
|
|
617
|
+
mixins: [transformInputAttrs],
|
|
618
|
+
inheritAttrs: false,
|
|
619
|
+
props: {
|
|
620
|
+
modelValue: Boolean,
|
|
621
|
+
required: Boolean,
|
|
622
|
+
switch: Boolean,
|
|
623
|
+
caption: {
|
|
624
|
+
type: String,
|
|
625
|
+
default: ""
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
const _withScopeId = (n) => (pushScopeId("data-v-6d3aac34"), n = n(), popScopeId(), n);
|
|
630
|
+
const _hoisted_1$c = ["checked", "required"];
|
|
631
|
+
const _hoisted_2$8 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "Checkbox__switchDot" }, null, -1));
|
|
632
|
+
const _hoisted_3$6 = [
|
|
633
|
+
_hoisted_2$8
|
|
634
|
+
];
|
|
635
|
+
const _hoisted_4$3 = {
|
|
636
|
+
key: 1,
|
|
637
|
+
class: "Checkbox__label"
|
|
638
|
+
};
|
|
639
|
+
const _hoisted_5$1 = {
|
|
640
|
+
key: 0,
|
|
641
|
+
class: "Checkbox__required"
|
|
642
|
+
};
|
|
643
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
644
|
+
return openBlock(), createElementBlock("label", {
|
|
645
|
+
class: normalizeClass(["Checkbox", [_ctx.$attrs.class, { "Checkbox--disabled": _ctx.$attrs.disabled }]])
|
|
646
|
+
}, [
|
|
647
|
+
withDirectives(createElementVNode("input", mergeProps(_ctx.normalizedAttrs, {
|
|
648
|
+
checked: _ctx.modelValue,
|
|
649
|
+
class: "Checkbox__input input",
|
|
650
|
+
required: _ctx.required,
|
|
651
|
+
type: "checkbox"
|
|
652
|
+
}), null, 16, _hoisted_1$c), [
|
|
653
|
+
[vShow, !_ctx.$props.switch]
|
|
654
|
+
]),
|
|
655
|
+
_ctx.$props.switch ? (openBlock(), createElementBlock("div", {
|
|
656
|
+
key: 0,
|
|
657
|
+
class: normalizeClass(["Checkbox__switch", { "Checkbox__switch--active": _ctx.modelValue }])
|
|
658
|
+
}, _hoisted_3$6, 2)) : createCommentVNode("", true),
|
|
659
|
+
_ctx.$slots.default || _ctx.caption ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
660
|
+
_ctx.required ? (openBlock(), createElementBlock("span", _hoisted_5$1, "*")) : createCommentVNode("", true),
|
|
661
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
662
|
+
createTextVNode(toDisplayString(_ctx.caption), 1)
|
|
663
|
+
], true)
|
|
664
|
+
])) : createCommentVNode("", true)
|
|
665
|
+
], 2);
|
|
666
|
+
}
|
|
667
|
+
var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$6], ["__scopeId", "data-v-6d3aac34"]]);
|
|
668
|
+
function retrieveValue(item, extractor) {
|
|
669
|
+
if (typeof extractor === "function") {
|
|
670
|
+
return extractor(item);
|
|
671
|
+
}
|
|
672
|
+
if (extractor || extractor === 0) {
|
|
673
|
+
return item[extractor];
|
|
674
|
+
}
|
|
675
|
+
return item;
|
|
676
|
+
}
|
|
677
|
+
function normalizeOptions(items, extractors = {}) {
|
|
678
|
+
if (Array.isArray(items)) {
|
|
679
|
+
return items.map((item) => ({
|
|
680
|
+
value: retrieveValue(item, extractors.value),
|
|
681
|
+
label: retrieveValue(item, extractors.label),
|
|
682
|
+
description: extractors.description && retrieveValue(item, extractors.description),
|
|
683
|
+
disabled: extractors.disabled && retrieveValue(item, extractors.disabled)
|
|
684
|
+
}));
|
|
685
|
+
}
|
|
686
|
+
return Object.entries(items || {}).reduce((options, [value, label]) => {
|
|
687
|
+
return options.concat({
|
|
688
|
+
value,
|
|
689
|
+
label
|
|
690
|
+
});
|
|
691
|
+
}, []);
|
|
692
|
+
}
|
|
693
|
+
var CheckboxGroup_vue_vue_type_style_index_0_lang = "";
|
|
694
|
+
const _sfc_main$b = defineComponent({
|
|
695
|
+
components: {
|
|
696
|
+
Checkbox
|
|
697
|
+
},
|
|
698
|
+
props: {
|
|
699
|
+
modelValue: {
|
|
700
|
+
type: Array,
|
|
701
|
+
default: () => []
|
|
702
|
+
},
|
|
703
|
+
options: {
|
|
704
|
+
type: [Array, Object],
|
|
705
|
+
required: true
|
|
706
|
+
},
|
|
707
|
+
optionLabelKey: {
|
|
708
|
+
type: [Function, String, Number],
|
|
709
|
+
default: void 0
|
|
710
|
+
},
|
|
711
|
+
optionValueKey: {
|
|
712
|
+
type: [Function, String, Number],
|
|
713
|
+
default: void 0
|
|
714
|
+
},
|
|
715
|
+
optionDisabledKey: {
|
|
716
|
+
type: [Function, String, Number],
|
|
717
|
+
default: void 0
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
emits: ["update:modelValue"],
|
|
721
|
+
computed: {
|
|
722
|
+
normalizedOptions() {
|
|
723
|
+
return normalizeOptions(this.options, {
|
|
724
|
+
value: this.optionValueKey,
|
|
725
|
+
label: this.optionLabelKey,
|
|
726
|
+
disabled: this.optionDisabledKey
|
|
727
|
+
});
|
|
728
|
+
},
|
|
729
|
+
checkedValues() {
|
|
730
|
+
return this.modelValue.reduce((result, value) => __spreadProps(__spreadValues({}, result), {
|
|
731
|
+
[value]: true
|
|
732
|
+
}), {});
|
|
733
|
+
}
|
|
734
|
+
},
|
|
735
|
+
methods: {
|
|
736
|
+
toggleCheckedValue(value) {
|
|
737
|
+
const checkedValues = __spreadProps(__spreadValues({}, this.checkedValues), {
|
|
738
|
+
[value]: !this.checkedValues[value]
|
|
739
|
+
});
|
|
740
|
+
const modelValue = Object.entries(checkedValues).filter(([_, isChecked]) => isChecked).map(([value2]) => value2);
|
|
741
|
+
this.$emit("update:modelValue", modelValue);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
const _hoisted_1$b = { class: "CheckboxGroup" };
|
|
746
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
747
|
+
const _component_Checkbox = resolveComponent("Checkbox");
|
|
748
|
+
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
749
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.normalizedOptions, (option) => {
|
|
750
|
+
return openBlock(), createElementBlock("div", {
|
|
751
|
+
key: option.value
|
|
752
|
+
}, [
|
|
753
|
+
createVNode(_component_Checkbox, {
|
|
754
|
+
disabled: option.disabled,
|
|
755
|
+
"model-value": _ctx.checkedValues[option.value],
|
|
756
|
+
"onUpdate:modelValue": ($event) => _ctx.toggleCheckedValue(option.value)
|
|
757
|
+
}, {
|
|
758
|
+
default: withCtx(() => [
|
|
759
|
+
createTextVNode(toDisplayString(option.label), 1)
|
|
760
|
+
]),
|
|
761
|
+
_: 2
|
|
762
|
+
}, 1032, ["disabled", "model-value", "onUpdate:modelValue"])
|
|
763
|
+
]);
|
|
764
|
+
}), 128))
|
|
765
|
+
]);
|
|
766
|
+
}
|
|
767
|
+
var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$5]]);
|
|
768
|
+
var FormGroup_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
769
|
+
const _sfc_main$a = defineComponent({
|
|
770
|
+
props: {
|
|
771
|
+
label: {
|
|
772
|
+
type: String,
|
|
773
|
+
default: ""
|
|
774
|
+
},
|
|
775
|
+
error: {
|
|
776
|
+
type: [String, Array, Boolean],
|
|
777
|
+
default: ""
|
|
778
|
+
},
|
|
779
|
+
description: {
|
|
780
|
+
type: String,
|
|
781
|
+
default: ""
|
|
782
|
+
},
|
|
783
|
+
hint: {
|
|
784
|
+
type: String,
|
|
785
|
+
default: ""
|
|
786
|
+
},
|
|
787
|
+
required: Boolean
|
|
788
|
+
},
|
|
789
|
+
computed: {
|
|
790
|
+
errorMessage() {
|
|
791
|
+
if (Array.isArray(this.error)) {
|
|
792
|
+
return this.error.filter(Boolean).join(" ");
|
|
793
|
+
}
|
|
794
|
+
if (typeof this.error === "string") {
|
|
795
|
+
return this.error;
|
|
796
|
+
}
|
|
797
|
+
return "";
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
});
|
|
801
|
+
const _hoisted_1$a = {
|
|
802
|
+
key: 0,
|
|
803
|
+
class: "FormGroup__header"
|
|
804
|
+
};
|
|
805
|
+
const _hoisted_2$7 = { class: "FormGroup__label" };
|
|
806
|
+
const _hoisted_3$5 = {
|
|
807
|
+
key: 0,
|
|
808
|
+
class: "FormGroup__required"
|
|
809
|
+
};
|
|
810
|
+
const _hoisted_4$2 = {
|
|
811
|
+
key: 1,
|
|
812
|
+
class: "FormGroup__description"
|
|
813
|
+
};
|
|
814
|
+
const _hoisted_5 = {
|
|
815
|
+
key: 2,
|
|
816
|
+
class: "FormGroup__hint"
|
|
817
|
+
};
|
|
818
|
+
const _hoisted_6 = {
|
|
819
|
+
key: 3,
|
|
820
|
+
class: "FormGroup__error"
|
|
821
|
+
};
|
|
822
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
823
|
+
return openBlock(), createElementBlock("div", {
|
|
824
|
+
class: normalizeClass(["FormGroup", { "FormGroup--invalid": _ctx.error }])
|
|
825
|
+
}, [
|
|
826
|
+
_ctx.label ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
827
|
+
createElementVNode("label", _hoisted_2$7, toDisplayString(_ctx.label), 1),
|
|
828
|
+
_ctx.required ? (openBlock(), createElementBlock("div", _hoisted_3$5, "*")) : createCommentVNode("", true)
|
|
829
|
+
])) : createCommentVNode("", true),
|
|
830
|
+
_ctx.$slots.description || _ctx.description ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
831
|
+
renderSlot(_ctx.$slots, "description", {}, () => [
|
|
832
|
+
createTextVNode(toDisplayString(_ctx.description), 1)
|
|
833
|
+
], true)
|
|
834
|
+
])) : createCommentVNode("", true),
|
|
835
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
836
|
+
_ctx.$slots.hint || _ctx.hint ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
837
|
+
renderSlot(_ctx.$slots, "hint", {}, () => [
|
|
838
|
+
createTextVNode(toDisplayString(_ctx.hint), 1)
|
|
839
|
+
], true)
|
|
840
|
+
])) : createCommentVNode("", true),
|
|
841
|
+
_ctx.errorMessage ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString(_ctx.errorMessage), 1)) : createCommentVNode("", true)
|
|
842
|
+
], 2);
|
|
843
|
+
}
|
|
844
|
+
var FormGroup = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$4], ["__scopeId", "data-v-4214535a"]]);
|
|
845
|
+
var FormFields_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
846
|
+
const _hoisted_1$9 = { class: "FormFields" };
|
|
847
|
+
const _sfc_main$9 = defineComponent({
|
|
848
|
+
name: "FormFields",
|
|
849
|
+
props: {
|
|
850
|
+
fields: {
|
|
851
|
+
type: Object,
|
|
852
|
+
default: () => ({})
|
|
853
|
+
},
|
|
854
|
+
modelValue: {
|
|
855
|
+
type: Object,
|
|
856
|
+
default: () => ({})
|
|
857
|
+
},
|
|
858
|
+
errors: {
|
|
859
|
+
type: Object,
|
|
860
|
+
default: () => ({})
|
|
861
|
+
}
|
|
862
|
+
},
|
|
863
|
+
emits: ["update:modelValue"],
|
|
864
|
+
setup(__props, { emit: emits }) {
|
|
865
|
+
const props = __props;
|
|
866
|
+
function getFieldValue(name) {
|
|
867
|
+
var _a;
|
|
868
|
+
const getter = ((_a = props.fields[name].value) == null ? void 0 : _a.getter) || ((modelValue) => modelValue[name]);
|
|
869
|
+
return getter(props.modelValue);
|
|
870
|
+
}
|
|
871
|
+
function setFieldValue(name, value) {
|
|
872
|
+
var _a;
|
|
873
|
+
const setter = ((_a = props.fields[name].value) == null ? void 0 : _a.setter) || ((value2, modelValue2) => __spreadProps(__spreadValues({}, modelValue2), { [name]: value2 }));
|
|
874
|
+
const modelValue = setter(value, props.modelValue);
|
|
875
|
+
emits("update:modelValue", modelValue);
|
|
876
|
+
}
|
|
877
|
+
return (_ctx, _cache) => {
|
|
878
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
879
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.fields, (field, name) => {
|
|
880
|
+
var _a;
|
|
881
|
+
return openBlock(), createBlock(FormGroup, {
|
|
882
|
+
key: name,
|
|
883
|
+
label: field.label,
|
|
884
|
+
description: field.description,
|
|
885
|
+
hint: field.hint,
|
|
886
|
+
required: field.required,
|
|
887
|
+
error: (_a = __props.errors) == null ? void 0 : _a[name]
|
|
888
|
+
}, {
|
|
889
|
+
default: withCtx(() => [
|
|
890
|
+
(openBlock(), createBlock(resolveDynamicComponent(field.component), mergeProps({
|
|
891
|
+
"model-value": getFieldValue(String(name))
|
|
892
|
+
}, field.props, {
|
|
893
|
+
"onUpdate:modelValue": ($event) => setFieldValue(String(name), $event)
|
|
894
|
+
}), null, 16, ["model-value", "onUpdate:modelValue"]))
|
|
895
|
+
]),
|
|
896
|
+
_: 2
|
|
897
|
+
}, 1032, ["label", "description", "hint", "required", "error"]);
|
|
898
|
+
}), 128))
|
|
899
|
+
]);
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
});
|
|
903
|
+
var FormFields = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-319aedc6"]]);
|
|
904
|
+
var Form_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
905
|
+
const _hoisted_1$8 = { class: "Form" };
|
|
906
|
+
const _hoisted_2$6 = ["disabled"];
|
|
907
|
+
const _hoisted_3$4 = {
|
|
908
|
+
key: 0,
|
|
909
|
+
class: "Form__title"
|
|
910
|
+
};
|
|
911
|
+
const _hoisted_4$1 = {
|
|
912
|
+
key: 0,
|
|
913
|
+
class: "Form__buttons"
|
|
914
|
+
};
|
|
915
|
+
const _sfc_main$8 = defineComponent({
|
|
916
|
+
name: "Form",
|
|
917
|
+
props: {
|
|
918
|
+
structure: {
|
|
919
|
+
type: Object,
|
|
920
|
+
default: () => ({})
|
|
921
|
+
},
|
|
922
|
+
modelValue: {
|
|
923
|
+
type: Object,
|
|
924
|
+
default: () => void 0
|
|
925
|
+
},
|
|
926
|
+
errors: {
|
|
927
|
+
type: Object,
|
|
928
|
+
default: () => ({})
|
|
929
|
+
},
|
|
930
|
+
submit: {
|
|
931
|
+
type: Function,
|
|
932
|
+
default: void 0
|
|
933
|
+
},
|
|
934
|
+
submitLabel: {
|
|
935
|
+
type: String,
|
|
936
|
+
default: "Submit"
|
|
937
|
+
},
|
|
938
|
+
cancel: {
|
|
939
|
+
type: [Function, Object],
|
|
940
|
+
default: void 0
|
|
941
|
+
},
|
|
942
|
+
cancelLabel: {
|
|
943
|
+
type: String,
|
|
944
|
+
default: "Cancel"
|
|
945
|
+
},
|
|
946
|
+
submitting: Boolean
|
|
947
|
+
},
|
|
948
|
+
emits: ["update:modelValue", "change", "submit", "cancel"],
|
|
949
|
+
setup(__props, { emit: emits }) {
|
|
950
|
+
const props = __props;
|
|
951
|
+
const router = useRouter();
|
|
952
|
+
function submit() {
|
|
953
|
+
var _a;
|
|
954
|
+
(_a = props.submit) == null ? void 0 : _a.call(props, props.modelValue);
|
|
955
|
+
}
|
|
956
|
+
function cancel() {
|
|
957
|
+
var _a;
|
|
958
|
+
typeof props.cancel === "function" ? (_a = props.cancel) == null ? void 0 : _a.call(props) : props.cancel && router.push(props.cancel);
|
|
959
|
+
}
|
|
960
|
+
return (_ctx, _cache) => {
|
|
961
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
962
|
+
__props.modelValue ? (openBlock(), createElementBlock("form", {
|
|
963
|
+
key: 0,
|
|
964
|
+
disabled: __props.submitting,
|
|
965
|
+
onSubmit: _cache[3] || (_cache[3] = withModifiers(($event) => submit == null ? void 0 : submit(), ["prevent"]))
|
|
966
|
+
}, [
|
|
967
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.structure, (block, index) => {
|
|
968
|
+
return openBlock(), createElementBlock("div", { key: index }, [
|
|
969
|
+
block.title ? (openBlock(), createElementBlock("div", _hoisted_3$4, toDisplayString(block.title), 1)) : createCommentVNode("", true),
|
|
970
|
+
createVNode(FormFields, {
|
|
971
|
+
fields: block.fields,
|
|
972
|
+
"model-value": __props.modelValue,
|
|
973
|
+
errors: __props.errors,
|
|
974
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emits("update:modelValue", $event)),
|
|
975
|
+
onChange: _cache[1] || (_cache[1] = ($event) => emits("change", $event))
|
|
976
|
+
}, null, 8, ["fields", "model-value", "errors"])
|
|
977
|
+
]);
|
|
978
|
+
}), 128)),
|
|
979
|
+
renderSlot(_ctx.$slots, "buttons", normalizeProps(guardReactiveProps({ cancel, submit })), () => [
|
|
980
|
+
submit || cancel ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
981
|
+
submit ? (openBlock(), createBlock(Button, {
|
|
982
|
+
key: 0,
|
|
983
|
+
variant: "primary",
|
|
984
|
+
type: "submit",
|
|
985
|
+
label: __props.submitLabel,
|
|
986
|
+
disabled: __props.submitting,
|
|
987
|
+
"prefix-icon": __props.submitting ? "spinner" : void 0
|
|
988
|
+
}, null, 8, ["label", "disabled", "prefix-icon"])) : createCommentVNode("", true),
|
|
989
|
+
cancel ? (openBlock(), createBlock(Button, {
|
|
990
|
+
key: 1,
|
|
991
|
+
label: __props.cancelLabel,
|
|
992
|
+
disabled: __props.submitting,
|
|
993
|
+
onClick: _cache[2] || (_cache[2] = ($event) => cancel())
|
|
994
|
+
}, null, 8, ["label", "disabled"])) : createCommentVNode("", true)
|
|
995
|
+
])) : createCommentVNode("", true)
|
|
996
|
+
], true)
|
|
997
|
+
], 40, _hoisted_2$6)) : (openBlock(), createBlock(Icon, {
|
|
998
|
+
key: 1,
|
|
999
|
+
name: "spinner"
|
|
1000
|
+
}))
|
|
1001
|
+
]);
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
});
|
|
1005
|
+
var Form = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-5366fc3a"]]);
|
|
1006
|
+
var Input_vue_vue_type_style_index_0_lang = "";
|
|
1007
|
+
const sizes$1 = ["normal", "small"];
|
|
1008
|
+
const _sfc_main$7 = defineComponent({
|
|
1009
|
+
components: {
|
|
1010
|
+
Icon
|
|
1011
|
+
},
|
|
1012
|
+
mixins: [transformInputAttrs],
|
|
1013
|
+
inheritAttrs: false,
|
|
1014
|
+
props: {
|
|
1015
|
+
modelValue: {
|
|
1016
|
+
type: [Number, String],
|
|
1017
|
+
default: ""
|
|
1018
|
+
},
|
|
1019
|
+
prefixIcon: {
|
|
1020
|
+
type: String,
|
|
1021
|
+
default: ""
|
|
1022
|
+
},
|
|
1023
|
+
suffixIcon: {
|
|
1024
|
+
type: String,
|
|
1025
|
+
default: ""
|
|
1026
|
+
},
|
|
1027
|
+
size: {
|
|
1028
|
+
type: String,
|
|
1029
|
+
default: "normal",
|
|
1030
|
+
validator: (value) => sizes$1.includes(value)
|
|
1031
|
+
},
|
|
1032
|
+
invalid: Boolean
|
|
1033
|
+
},
|
|
1034
|
+
computed: {
|
|
1035
|
+
hasPrefix() {
|
|
1036
|
+
return Boolean(this.$slots.prefix || this.prefixIcon);
|
|
1037
|
+
},
|
|
1038
|
+
hasSuffix() {
|
|
1039
|
+
return Boolean(this.$slots.suffix || this.suffixIcon);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
const _hoisted_1$7 = { class: "Input__icon Input__icon--left" };
|
|
1044
|
+
const _hoisted_2$5 = ["aria-label", "value"];
|
|
1045
|
+
const _hoisted_3$3 = { class: "Input__icon Input__icon--right" };
|
|
1046
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1047
|
+
const _component_Icon = resolveComponent("Icon");
|
|
1048
|
+
return openBlock(), createElementBlock("div", {
|
|
1049
|
+
class: normalizeClass(["Input input", [
|
|
1050
|
+
_ctx.$attrs.class,
|
|
1051
|
+
{
|
|
1052
|
+
"input--invalid": _ctx.invalid,
|
|
1053
|
+
"input--disabled": _ctx.$attrs.disabled,
|
|
1054
|
+
"input--small": _ctx.size === "small"
|
|
1055
|
+
}
|
|
1056
|
+
]]),
|
|
1057
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$refs.input.focus())
|
|
1058
|
+
}, [
|
|
1059
|
+
_ctx.hasPrefix ? renderSlot(_ctx.$slots, "prefix", { key: 0 }, () => [
|
|
1060
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
1061
|
+
createVNode(_component_Icon, { name: _ctx.prefixIcon }, null, 8, ["name"])
|
|
1062
|
+
])
|
|
1063
|
+
]) : createCommentVNode("", true),
|
|
1064
|
+
createElementVNode("input", mergeProps({
|
|
1065
|
+
ref: "input",
|
|
1066
|
+
"aria-label": _ctx.$attrs.placeholder || "input"
|
|
1067
|
+
}, _ctx.normalizedAttrs, {
|
|
1068
|
+
class: "Input__nestedInput input__nested",
|
|
1069
|
+
value: _ctx.modelValue
|
|
1070
|
+
}), null, 16, _hoisted_2$5),
|
|
1071
|
+
_ctx.hasSuffix ? renderSlot(_ctx.$slots, "suffix", { key: 1 }, () => [
|
|
1072
|
+
createElementVNode("div", _hoisted_3$3, [
|
|
1073
|
+
createVNode(_component_Icon, { name: _ctx.suffixIcon }, null, 8, ["name"])
|
|
1074
|
+
])
|
|
1075
|
+
]) : createCommentVNode("", true)
|
|
1076
|
+
], 2);
|
|
1077
|
+
}
|
|
1078
|
+
var Input = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$3]]);
|
|
1079
|
+
const sizes = ["normal", "small"];
|
|
1080
|
+
const _sfc_main$6 = defineComponent({
|
|
1081
|
+
mixins: [transformInputAttrs],
|
|
1082
|
+
props: {
|
|
1083
|
+
value: {
|
|
1084
|
+
type: [String, Number, Object],
|
|
1085
|
+
default: ""
|
|
1086
|
+
},
|
|
1087
|
+
options: {
|
|
1088
|
+
type: [Array, Object],
|
|
1089
|
+
required: true
|
|
1090
|
+
},
|
|
1091
|
+
optionLabelKey: {
|
|
1092
|
+
type: [Function, String, Number],
|
|
1093
|
+
default: void 0
|
|
1094
|
+
},
|
|
1095
|
+
optionValueKey: {
|
|
1096
|
+
type: [Function, String, Number],
|
|
1097
|
+
default: void 0
|
|
1098
|
+
},
|
|
1099
|
+
optionDisabledKey: {
|
|
1100
|
+
type: [Function, String, Number],
|
|
1101
|
+
default: void 0
|
|
1102
|
+
},
|
|
1103
|
+
placeholder: {
|
|
1104
|
+
type: String,
|
|
1105
|
+
default: ""
|
|
1106
|
+
},
|
|
1107
|
+
size: {
|
|
1108
|
+
type: String,
|
|
1109
|
+
default: "normal",
|
|
1110
|
+
validator: (value) => sizes.includes(value)
|
|
1111
|
+
},
|
|
1112
|
+
allowEmpty: Boolean
|
|
1113
|
+
},
|
|
1114
|
+
computed: {
|
|
1115
|
+
normalizedOptions() {
|
|
1116
|
+
return normalizeOptions(this.options, {
|
|
1117
|
+
value: this.optionValueKey,
|
|
1118
|
+
label: this.optionLabelKey,
|
|
1119
|
+
disabled: this.optionDisabledKey
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
});
|
|
1124
|
+
const _hoisted_1$6 = ["value"];
|
|
1125
|
+
const _hoisted_2$4 = ["disabled"];
|
|
1126
|
+
const _hoisted_3$2 = ["disabled", "value"];
|
|
1127
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1128
|
+
return openBlock(), createElementBlock("select", mergeProps({ class: "Select input" }, _ctx.normalizedAttrs, {
|
|
1129
|
+
class: [_ctx.$attrs.class, { "input--small": _ctx.size === "small" }],
|
|
1130
|
+
value: _ctx.value
|
|
1131
|
+
}), [
|
|
1132
|
+
_ctx.placeholder ? (openBlock(), createElementBlock("option", {
|
|
1133
|
+
key: 0,
|
|
1134
|
+
disabled: !_ctx.allowEmpty,
|
|
1135
|
+
selected: "",
|
|
1136
|
+
value: void 0
|
|
1137
|
+
}, toDisplayString(_ctx.placeholder), 9, _hoisted_2$4)) : createCommentVNode("", true),
|
|
1138
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.normalizedOptions, (option) => {
|
|
1139
|
+
return openBlock(), createElementBlock("option", {
|
|
1140
|
+
key: option.value,
|
|
1141
|
+
disabled: option.disabled,
|
|
1142
|
+
value: option.value
|
|
1143
|
+
}, toDisplayString(option.label), 9, _hoisted_3$2);
|
|
1144
|
+
}), 128))
|
|
1145
|
+
], 16, _hoisted_1$6);
|
|
1146
|
+
}
|
|
1147
|
+
var Select = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$2]]);
|
|
1148
|
+
var table = "";
|
|
1149
|
+
var typography = "";
|
|
1150
|
+
const _sfc_main$5 = defineComponent({
|
|
1151
|
+
props: {
|
|
1152
|
+
items: {
|
|
1153
|
+
type: Array,
|
|
1154
|
+
default: () => []
|
|
1155
|
+
},
|
|
1156
|
+
columns: {
|
|
1157
|
+
type: Object,
|
|
1158
|
+
default: null
|
|
1159
|
+
},
|
|
1160
|
+
rowClass: {
|
|
1161
|
+
type: [String, Function],
|
|
1162
|
+
default: null
|
|
1163
|
+
}
|
|
1164
|
+
},
|
|
1165
|
+
computed: {
|
|
1166
|
+
normalizedColumns() {
|
|
1167
|
+
return Object.entries(this.columns).reduce((result, [key, options]) => __spreadProps(__spreadValues({}, result), {
|
|
1168
|
+
[key]: typeof options === "string" ? { label: options } : options
|
|
1169
|
+
}), {});
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
methods: {
|
|
1173
|
+
formatValue(item, key) {
|
|
1174
|
+
const column = this.normalizedColumns[key];
|
|
1175
|
+
const value = typeof column.value === "function" ? column.value(item) : item[key];
|
|
1176
|
+
if (column.format) {
|
|
1177
|
+
return column.format(value);
|
|
1178
|
+
}
|
|
1179
|
+
return value;
|
|
1180
|
+
},
|
|
1181
|
+
resolveRowClass(item) {
|
|
1182
|
+
return typeof this.rowClass === "function" ? this.rowClass(item) : this.rowClass;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
});
|
|
1186
|
+
const _hoisted_1$5 = { class: "table table--hover" };
|
|
1187
|
+
const _hoisted_2$3 = ["width"];
|
|
1188
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1189
|
+
const _component_router_link = resolveComponent("router-link");
|
|
1190
|
+
return openBlock(), createElementBlock("table", _hoisted_1$5, [
|
|
1191
|
+
createElementVNode("thead", null, [
|
|
1192
|
+
createElementVNode("tr", null, [
|
|
1193
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.normalizedColumns, (column, key) => {
|
|
1194
|
+
return openBlock(), createElementBlock("th", {
|
|
1195
|
+
key,
|
|
1196
|
+
style: normalizeStyle({ textAlign: column.align || "left" }),
|
|
1197
|
+
width: column.width
|
|
1198
|
+
}, toDisplayString(column.label), 13, _hoisted_2$3);
|
|
1199
|
+
}), 128))
|
|
1200
|
+
])
|
|
1201
|
+
]),
|
|
1202
|
+
createElementVNode("tbody", null, [
|
|
1203
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item, index) => {
|
|
1204
|
+
return openBlock(), createElementBlock("tr", {
|
|
1205
|
+
key: index,
|
|
1206
|
+
class: normalizeClass(_ctx.resolveRowClass(item))
|
|
1207
|
+
}, [
|
|
1208
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.normalizedColumns, (column, key) => {
|
|
1209
|
+
return openBlock(), createElementBlock("td", {
|
|
1210
|
+
key,
|
|
1211
|
+
style: normalizeStyle({ textAlign: column.align || "left" })
|
|
1212
|
+
}, [
|
|
1213
|
+
renderSlot(_ctx.$slots, key, normalizeProps(guardReactiveProps({ item })), () => [
|
|
1214
|
+
column.href ? (openBlock(), createBlock(_component_router_link, {
|
|
1215
|
+
key: 0,
|
|
1216
|
+
class: "link",
|
|
1217
|
+
to: column.href(item)
|
|
1218
|
+
}, {
|
|
1219
|
+
default: withCtx(() => [
|
|
1220
|
+
createTextVNode(toDisplayString(_ctx.formatValue(item, key)), 1)
|
|
1221
|
+
]),
|
|
1222
|
+
_: 2
|
|
1223
|
+
}, 1032, ["to"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1224
|
+
createTextVNode(toDisplayString(_ctx.formatValue(item, key)), 1)
|
|
1225
|
+
], 64))
|
|
1226
|
+
])
|
|
1227
|
+
], 4);
|
|
1228
|
+
}), 128))
|
|
1229
|
+
], 2);
|
|
1230
|
+
}), 128))
|
|
1231
|
+
])
|
|
1232
|
+
]);
|
|
1233
|
+
}
|
|
1234
|
+
var Table = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$1]]);
|
|
1235
|
+
const _sfc_main$4 = defineComponent({
|
|
1236
|
+
mixins: [transformInputAttrs],
|
|
1237
|
+
props: {
|
|
1238
|
+
value: {
|
|
1239
|
+
type: String,
|
|
1240
|
+
default: ""
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
});
|
|
1244
|
+
const _hoisted_1$4 = ["value"];
|
|
1245
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1246
|
+
return openBlock(), createElementBlock("textarea", mergeProps(_ctx.normalizedAttrs, {
|
|
1247
|
+
class: ["Textarea input", _ctx.$attrs.class],
|
|
1248
|
+
value: _ctx.value
|
|
1249
|
+
}), null, 16, _hoisted_1$4);
|
|
1250
|
+
}
|
|
1251
|
+
var Textarea = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render]]);
|
|
1252
|
+
var ModalLayout_vue_vue_type_style_index_0_lang = "";
|
|
1253
|
+
const _hoisted_1$3 = {
|
|
1254
|
+
key: 1,
|
|
1255
|
+
class: "ModalLayout__header"
|
|
1256
|
+
};
|
|
1257
|
+
const _hoisted_2$2 = { class: "ModalLayout__title" };
|
|
1258
|
+
const _hoisted_3$1 = { class: "ModalLayout__body" };
|
|
1259
|
+
const _hoisted_4 = {
|
|
1260
|
+
key: 2,
|
|
1261
|
+
class: "ModalLayout__footer"
|
|
1262
|
+
};
|
|
1263
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1264
|
+
name: "ModalLayout",
|
|
1265
|
+
props: {
|
|
1266
|
+
title: {
|
|
1267
|
+
type: String,
|
|
1268
|
+
default: ""
|
|
1269
|
+
},
|
|
1270
|
+
width: {
|
|
1271
|
+
type: [Number, String],
|
|
1272
|
+
default: 600
|
|
1273
|
+
},
|
|
1274
|
+
hideCloser: Boolean,
|
|
1275
|
+
scroll: Boolean,
|
|
1276
|
+
plain: Boolean
|
|
1277
|
+
},
|
|
1278
|
+
setup(__props) {
|
|
1279
|
+
const props = __props;
|
|
1280
|
+
const slots = useSlots();
|
|
1281
|
+
useAttrs();
|
|
1282
|
+
getCurrentInstance();
|
|
1283
|
+
getCurrentScope();
|
|
1284
|
+
const hasHeader = computed(() => {
|
|
1285
|
+
return Boolean(slots.header || props.title);
|
|
1286
|
+
});
|
|
1287
|
+
const hasFooter = computed(() => {
|
|
1288
|
+
return Boolean(slots.footer);
|
|
1289
|
+
});
|
|
1290
|
+
const computedStyle = computed(() => {
|
|
1291
|
+
const maxWidth = props.width + (Number(props.width) ? "px" : "");
|
|
1292
|
+
if (maxWidth && maxWidth !== "auto") {
|
|
1293
|
+
return {
|
|
1294
|
+
width: "100%",
|
|
1295
|
+
maxWidth
|
|
1296
|
+
};
|
|
1297
|
+
}
|
|
1298
|
+
return {};
|
|
1299
|
+
});
|
|
1300
|
+
function close() {
|
|
1301
|
+
window.dispatchEvent(new KeyboardEvent("keydown", { "key": "Escape" }));
|
|
1302
|
+
}
|
|
1303
|
+
return (_ctx, _cache) => {
|
|
1304
|
+
return openBlock(), createElementBlock("div", {
|
|
1305
|
+
class: normalizeClass(["ModalLayout", { hasHeader: unref(hasHeader), hasFooter: unref(hasFooter), isScrollable: _ctx.$props.scroll, isPlain: _ctx.$props.plain }]),
|
|
1306
|
+
style: normalizeStyle(unref(computedStyle))
|
|
1307
|
+
}, [
|
|
1308
|
+
!__props.hideCloser ? (openBlock(), createElementBlock("div", {
|
|
1309
|
+
key: 0,
|
|
1310
|
+
class: "ModalLayout__close",
|
|
1311
|
+
onClick: _cache[0] || (_cache[0] = ($event) => close())
|
|
1312
|
+
}, [
|
|
1313
|
+
createVNode(Icon, {
|
|
1314
|
+
name: "x",
|
|
1315
|
+
class: "ModalLayout__closeIcon"
|
|
1316
|
+
})
|
|
1317
|
+
])) : createCommentVNode("", true),
|
|
1318
|
+
unref(hasHeader) ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
1319
|
+
renderSlot(_ctx.$slots, "header", {}, () => [
|
|
1320
|
+
createElementVNode("div", _hoisted_2$2, toDisplayString(__props.title), 1)
|
|
1321
|
+
])
|
|
1322
|
+
])) : createCommentVNode("", true),
|
|
1323
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
1324
|
+
renderSlot(_ctx.$slots, "default")
|
|
1325
|
+
]),
|
|
1326
|
+
unref(hasFooter) ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
1327
|
+
renderSlot(_ctx.$slots, "footer")
|
|
1328
|
+
])) : createCommentVNode("", true)
|
|
1329
|
+
], 6);
|
|
1330
|
+
};
|
|
1331
|
+
}
|
|
1332
|
+
});
|
|
1333
|
+
var ModalLayoutDialog_vue_vue_type_style_index_0_lang = "";
|
|
1334
|
+
const _hoisted_1$2 = { class: "ModalLayoutDialog__buttons" };
|
|
1335
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1336
|
+
name: "ModalLayoutDialog",
|
|
1337
|
+
props: {
|
|
1338
|
+
title: {
|
|
1339
|
+
type: String,
|
|
1340
|
+
default: ""
|
|
1341
|
+
},
|
|
1342
|
+
message: {
|
|
1343
|
+
type: String,
|
|
1344
|
+
default: ""
|
|
1345
|
+
},
|
|
1346
|
+
buttons: {
|
|
1347
|
+
type: Array,
|
|
1348
|
+
default: () => []
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
emits: ["close"],
|
|
1352
|
+
setup(__props) {
|
|
1353
|
+
return (_ctx, _cache) => {
|
|
1354
|
+
var _a;
|
|
1355
|
+
return openBlock(), createBlock(_sfc_main$3, {
|
|
1356
|
+
ref: "root",
|
|
1357
|
+
class: "ModalLayoutDialog",
|
|
1358
|
+
width: "480",
|
|
1359
|
+
title: _ctx.$props.title
|
|
1360
|
+
}, createSlots({
|
|
1361
|
+
default: withCtx(() => [
|
|
1362
|
+
createTextVNode(toDisplayString(_ctx.$props.message) + " ", 1)
|
|
1363
|
+
]),
|
|
1364
|
+
_: 2
|
|
1365
|
+
}, [
|
|
1366
|
+
((_a = _ctx.$props.buttons) == null ? void 0 : _a.length) ? {
|
|
1367
|
+
name: "footer",
|
|
1368
|
+
fn: withCtx(() => [
|
|
1369
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
1370
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.$props.buttons, (button2, $index) => {
|
|
1371
|
+
return openBlock(), createElementBlock("span", {
|
|
1372
|
+
key: $index,
|
|
1373
|
+
class: "ModalLayoutDialog__buttonWrapper"
|
|
1374
|
+
}, [
|
|
1375
|
+
createVNode(Button, {
|
|
1376
|
+
type: "button",
|
|
1377
|
+
variant: button2.variant,
|
|
1378
|
+
"prefix-icon": button2.icon,
|
|
1379
|
+
autofocus: "",
|
|
1380
|
+
onClick: ($event) => _ctx.$emit("close", button2.value)
|
|
1381
|
+
}, {
|
|
1382
|
+
default: withCtx(() => [
|
|
1383
|
+
createTextVNode(toDisplayString(button2.label), 1)
|
|
1384
|
+
]),
|
|
1385
|
+
_: 2
|
|
1386
|
+
}, 1032, ["variant", "prefix-icon", "onClick"])
|
|
1387
|
+
]);
|
|
1388
|
+
}), 128))
|
|
1389
|
+
])
|
|
1390
|
+
])
|
|
1391
|
+
} : void 0
|
|
1392
|
+
]), 1032, ["title"]);
|
|
1393
|
+
};
|
|
1394
|
+
}
|
|
1395
|
+
});
|
|
1396
|
+
var ModalStack_vue_vue_type_style_index_0_lang = "";
|
|
1397
|
+
const _hoisted_1$1 = { class: "ModalStack" };
|
|
1398
|
+
const _hoisted_2$1 = {
|
|
1399
|
+
key: 0,
|
|
1400
|
+
class: "ModalStack__backdrop"
|
|
1401
|
+
};
|
|
1402
|
+
const _hoisted_3 = ["onClick"];
|
|
1403
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1404
|
+
name: "ModalStack",
|
|
1405
|
+
props: {
|
|
1406
|
+
modals: {
|
|
1407
|
+
type: Array,
|
|
1408
|
+
default: () => []
|
|
1409
|
+
}
|
|
1410
|
+
},
|
|
1411
|
+
emits: ["closeModal"],
|
|
1412
|
+
setup(__props, { emit: emits }) {
|
|
1413
|
+
const props = __props;
|
|
1414
|
+
const modalInstances = ref({});
|
|
1415
|
+
const activeModal = computed(() => {
|
|
1416
|
+
return props.modals.length ? props.modals[props.modals.length - 1] : null;
|
|
1417
|
+
});
|
|
1418
|
+
function registerReference(modalId) {
|
|
1419
|
+
return (instance) => modalInstances.value[modalId] = instance;
|
|
1420
|
+
}
|
|
1421
|
+
function closeModal(modal2, result) {
|
|
1422
|
+
var _a;
|
|
1423
|
+
const close = () => {
|
|
1424
|
+
emits("closeModal", { modal: modal2, result });
|
|
1425
|
+
};
|
|
1426
|
+
const modalRootInstance = modalInstances.value[modal2.id].$refs.root;
|
|
1427
|
+
if ((_a = modalRootInstance.$attrs) == null ? void 0 : _a.onBeforeClose) {
|
|
1428
|
+
modalRootInstance.$attrs.onBeforeClose(close);
|
|
1429
|
+
} else {
|
|
1430
|
+
close();
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
function closeActiveModal() {
|
|
1434
|
+
if (activeModal.value) {
|
|
1435
|
+
closeModal(activeModal.value);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
function closeActiveModalByEscapeKey(e) {
|
|
1439
|
+
if (activeModal.value && e.key === "Escape" && !e.defaultPrevented) {
|
|
1440
|
+
e.preventDefault();
|
|
1441
|
+
closeActiveModal();
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
function closeModalByBackdropClick(e, modal2) {
|
|
1445
|
+
if (e.target === e.currentTarget) {
|
|
1446
|
+
closeModal(modal2);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
onMounted(() => {
|
|
1450
|
+
window.addEventListener("keydown", closeActiveModalByEscapeKey);
|
|
1451
|
+
});
|
|
1452
|
+
onBeforeUnmount(() => {
|
|
1453
|
+
window.removeEventListener("keydown", closeActiveModalByEscapeKey);
|
|
1454
|
+
});
|
|
1455
|
+
return (_ctx, _cache) => {
|
|
1456
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1457
|
+
createVNode(Transition, { name: "ModalStack__backdrop" }, {
|
|
1458
|
+
default: withCtx(() => [
|
|
1459
|
+
props.modals.length ? (openBlock(), createElementBlock("div", _hoisted_2$1)) : createCommentVNode("", true)
|
|
1460
|
+
]),
|
|
1461
|
+
_: 1
|
|
1462
|
+
}),
|
|
1463
|
+
createVNode(TransitionGroup, { name: "ModalStack__modal" }, {
|
|
1464
|
+
default: withCtx(() => [
|
|
1465
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(props.modals, (modal2) => {
|
|
1466
|
+
var _a;
|
|
1467
|
+
return openBlock(), createElementBlock("div", {
|
|
1468
|
+
key: modal2.id,
|
|
1469
|
+
class: "ModalStack__modalWrapper",
|
|
1470
|
+
onClick: ($event) => closeModalByBackdropClick($event, modal2)
|
|
1471
|
+
}, [
|
|
1472
|
+
(openBlock(), createBlock(resolveDynamicComponent(modal2.component), mergeProps(modal2.props, {
|
|
1473
|
+
ref_for: true,
|
|
1474
|
+
ref: registerReference(modal2.id),
|
|
1475
|
+
class: ["ModalStack__modal", { isActive: ((_a = unref(activeModal)) == null ? void 0 : _a.id) === modal2.id }],
|
|
1476
|
+
onClose: ($event) => closeModal(modal2, $event)
|
|
1477
|
+
}), null, 16, ["class", "onClose"]))
|
|
1478
|
+
], 8, _hoisted_3);
|
|
1479
|
+
}), 128))
|
|
1480
|
+
]),
|
|
1481
|
+
_: 1
|
|
1482
|
+
})
|
|
1483
|
+
]);
|
|
1484
|
+
};
|
|
1485
|
+
}
|
|
1486
|
+
});
|
|
1487
|
+
const defaultConfig = {
|
|
1488
|
+
cancelLabel: "Cancel",
|
|
1489
|
+
confirmLabel: "OK"
|
|
1490
|
+
};
|
|
1491
|
+
const modal = (app, config = {}) => {
|
|
1492
|
+
let iterator = 1;
|
|
1493
|
+
config = __spreadValues(__spreadValues({}, defaultConfig), config);
|
|
1494
|
+
const state = reactive({
|
|
1495
|
+
modals: []
|
|
1496
|
+
});
|
|
1497
|
+
const closeModal = (modal2, result) => {
|
|
1498
|
+
var _a;
|
|
1499
|
+
state.modals = state.modals.filter(({ id }) => id !== modal2.id);
|
|
1500
|
+
modal2.resolve(result);
|
|
1501
|
+
(_a = modal2.focusElement) == null ? void 0 : _a.focus();
|
|
1502
|
+
};
|
|
1503
|
+
const modalApp = createApp({
|
|
1504
|
+
parent: app,
|
|
1505
|
+
data() {
|
|
1506
|
+
return state;
|
|
1507
|
+
},
|
|
1508
|
+
render() {
|
|
1509
|
+
return h(_sfc_main$1, {
|
|
1510
|
+
modals: state.modals,
|
|
1511
|
+
onCloseModal: ({ modal: modal2, result }) => closeModal(modal2, result)
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
});
|
|
1515
|
+
const placeholder = document.createElement("div");
|
|
1516
|
+
document.body.appendChild(placeholder);
|
|
1517
|
+
modalApp.mount(placeholder);
|
|
1518
|
+
const openModal = (component, props) => {
|
|
1519
|
+
var _a;
|
|
1520
|
+
const focusElement = document.activeElement;
|
|
1521
|
+
(_a = focusElement.blur) == null ? void 0 : _a.call(focusElement);
|
|
1522
|
+
return new Promise((resolve) => {
|
|
1523
|
+
state.modals.push({
|
|
1524
|
+
id: iterator++,
|
|
1525
|
+
component,
|
|
1526
|
+
props,
|
|
1527
|
+
resolve,
|
|
1528
|
+
focusElement
|
|
1529
|
+
});
|
|
1530
|
+
});
|
|
1531
|
+
};
|
|
1532
|
+
const openDialog = (options) => {
|
|
1533
|
+
return openModal(_sfc_main$2, options);
|
|
1534
|
+
};
|
|
1535
|
+
const openAlert = (options) => {
|
|
1536
|
+
if (typeof options === "string") {
|
|
1537
|
+
options = {
|
|
1538
|
+
message: options
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
const { title, message, confirmVariant, confirmLabel = config.confirmLabel, confirmIcon } = options;
|
|
1542
|
+
return openDialog({
|
|
1543
|
+
title,
|
|
1544
|
+
message,
|
|
1545
|
+
buttons: [
|
|
1546
|
+
{
|
|
1547
|
+
variant: confirmVariant || "primary",
|
|
1548
|
+
label: confirmLabel || "",
|
|
1549
|
+
icon: confirmIcon
|
|
1550
|
+
}
|
|
1551
|
+
]
|
|
1552
|
+
});
|
|
1553
|
+
};
|
|
1554
|
+
const openConfirm = (options) => {
|
|
1555
|
+
if (typeof options === "string") {
|
|
1556
|
+
options = {
|
|
1557
|
+
message: options
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
const {
|
|
1561
|
+
title,
|
|
1562
|
+
message,
|
|
1563
|
+
cancelLabel = config.cancelLabel,
|
|
1564
|
+
cancelVariant,
|
|
1565
|
+
cancelIcon,
|
|
1566
|
+
confirmLabel = config.confirmLabel,
|
|
1567
|
+
confirmVariant,
|
|
1568
|
+
confirmIcon
|
|
1569
|
+
} = options;
|
|
1570
|
+
return openDialog({
|
|
1571
|
+
title,
|
|
1572
|
+
message,
|
|
1573
|
+
buttons: [
|
|
1574
|
+
{
|
|
1575
|
+
variant: cancelVariant || "secondary",
|
|
1576
|
+
label: cancelLabel || "",
|
|
1577
|
+
icon: cancelIcon,
|
|
1578
|
+
value: false
|
|
1579
|
+
},
|
|
1580
|
+
{
|
|
1581
|
+
variant: confirmVariant || "primary",
|
|
1582
|
+
label: confirmLabel || "",
|
|
1583
|
+
icon: confirmIcon,
|
|
1584
|
+
value: true
|
|
1585
|
+
}
|
|
1586
|
+
]
|
|
1587
|
+
});
|
|
1588
|
+
};
|
|
1589
|
+
app.config.globalProperties.$modal = {
|
|
1590
|
+
open: openModal,
|
|
1591
|
+
dialog: openDialog,
|
|
1592
|
+
alert: openAlert,
|
|
1593
|
+
confirm: openConfirm
|
|
1594
|
+
};
|
|
1595
|
+
};
|
|
1596
|
+
function useModal() {
|
|
1597
|
+
var _a;
|
|
1598
|
+
return (_a = getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$modal;
|
|
1599
|
+
}
|
|
1600
|
+
var SnackbarStack_vue_vue_type_style_index_0_lang = "";
|
|
1601
|
+
const _hoisted_1 = { class: "Snackbar" };
|
|
1602
|
+
const _hoisted_2 = ["onClick"];
|
|
1603
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1604
|
+
name: "SnackbarStack",
|
|
1605
|
+
props: {
|
|
1606
|
+
messages: {
|
|
1607
|
+
type: Array,
|
|
1608
|
+
default: () => []
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
emits: ["remove-message"],
|
|
1612
|
+
setup(__props, { emit }) {
|
|
1613
|
+
const props = __props;
|
|
1614
|
+
const messagesInReverse = computed(() => {
|
|
1615
|
+
return [...props.messages].reverse();
|
|
1616
|
+
});
|
|
1617
|
+
return (_ctx, _cache) => {
|
|
1618
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1619
|
+
createVNode(TransitionGroup, { name: "Snackbar__transition" }, {
|
|
1620
|
+
default: withCtx(() => [
|
|
1621
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(messagesInReverse), (message, index) => {
|
|
1622
|
+
return openBlock(), createElementBlock("div", {
|
|
1623
|
+
key: message.id,
|
|
1624
|
+
class: "Snackbar__message"
|
|
1625
|
+
}, [
|
|
1626
|
+
createElementVNode("div", {
|
|
1627
|
+
class: "Snackbar__messageWrapper",
|
|
1628
|
+
style: normalizeStyle({ transform: `translateY(-${100 * index}%)` })
|
|
1629
|
+
}, [
|
|
1630
|
+
createElementVNode("div", {
|
|
1631
|
+
class: normalizeClass(["Snackbar__messageBlock", `Snackbar__messageBlock--${message.type}`])
|
|
1632
|
+
}, [
|
|
1633
|
+
createElementVNode("div", null, toDisplayString(message.text), 1),
|
|
1634
|
+
createElementVNode("div", {
|
|
1635
|
+
class: "Snackbar__messageClose",
|
|
1636
|
+
onClick: ($event) => _ctx.$emit("remove-message", message.id)
|
|
1637
|
+
}, [
|
|
1638
|
+
createVNode(Icon, {
|
|
1639
|
+
class: "Snackbar__messageCloseIcon",
|
|
1640
|
+
name: "x"
|
|
1641
|
+
})
|
|
1642
|
+
], 8, _hoisted_2)
|
|
1643
|
+
], 2)
|
|
1644
|
+
], 4)
|
|
1645
|
+
]);
|
|
1646
|
+
}), 128))
|
|
1647
|
+
]),
|
|
1648
|
+
_: 1
|
|
1649
|
+
})
|
|
1650
|
+
]);
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
});
|
|
1654
|
+
const DEFAULT_MESSAGE_DURATION = 1e4;
|
|
1655
|
+
const MAX_MESSAGES = 5;
|
|
1656
|
+
const snackbar = (app) => {
|
|
1657
|
+
let iterator = 1;
|
|
1658
|
+
const state = reactive({
|
|
1659
|
+
messages: []
|
|
1660
|
+
});
|
|
1661
|
+
const removeMessage = (messageId) => {
|
|
1662
|
+
state.messages = state.messages.filter(({ id }) => id !== messageId);
|
|
1663
|
+
};
|
|
1664
|
+
const snackbarApp = createApp({
|
|
1665
|
+
parent: app,
|
|
1666
|
+
data() {
|
|
1667
|
+
return state;
|
|
1668
|
+
},
|
|
1669
|
+
render() {
|
|
1670
|
+
return h(_sfc_main, { messages: this.messages, onRemoveMessage: removeMessage });
|
|
1671
|
+
}
|
|
1672
|
+
});
|
|
1673
|
+
const placeholder = document.createElement("div");
|
|
1674
|
+
document.body.appendChild(placeholder);
|
|
1675
|
+
snackbarApp.mount(placeholder);
|
|
1676
|
+
const showMessage = (text, type = "success", duration = DEFAULT_MESSAGE_DURATION) => {
|
|
1677
|
+
const id = iterator++;
|
|
1678
|
+
state.messages.push({ text, type, id });
|
|
1679
|
+
if (state.messages.length > MAX_MESSAGES) {
|
|
1680
|
+
state.messages.shift();
|
|
1681
|
+
}
|
|
1682
|
+
if (duration > 0) {
|
|
1683
|
+
setTimeout(() => removeMessage(id), duration);
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
app.config.globalProperties.$snackbar = {
|
|
1687
|
+
success: (text) => showMessage(text, "success"),
|
|
1688
|
+
error: (text) => showMessage(text, "error", 0)
|
|
1689
|
+
};
|
|
1690
|
+
};
|
|
1691
|
+
function useSnackbar() {
|
|
1692
|
+
var _a;
|
|
1693
|
+
return (_a = getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$snackbar;
|
|
1694
|
+
}
|
|
1695
|
+
function useAction(action, params = {}) {
|
|
1696
|
+
const snackbard = useSnackbar();
|
|
1697
|
+
const modal2 = useModal();
|
|
1698
|
+
const router = useRouter();
|
|
1699
|
+
const isSubmitting = ref(false);
|
|
1700
|
+
const result = ref();
|
|
1701
|
+
const errors = ref(Object.freeze({}));
|
|
1702
|
+
const submit = async (data) => {
|
|
1703
|
+
var _a;
|
|
1704
|
+
if (params.confirm) {
|
|
1705
|
+
const confirmed = await modal2.confirm(typeof params.confirm === "function" ? params.confirm(data) : params.confirm);
|
|
1706
|
+
if (!confirmed) {
|
|
1707
|
+
return;
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
if (params.validator) {
|
|
1711
|
+
const validationResult = await params.validator(data);
|
|
1712
|
+
errors.value = validationResult.errors;
|
|
1713
|
+
if (!validationResult.isValid) {
|
|
1714
|
+
return;
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
isSubmitting.value = true;
|
|
1718
|
+
try {
|
|
1719
|
+
result.value = await action(data);
|
|
1720
|
+
} catch (error) {
|
|
1721
|
+
snackbard.error(typeof params.errorMessage === "function" ? params.errorMessage(error, data) : params.errorMessage || error.message);
|
|
1722
|
+
isSubmitting.value = false;
|
|
1723
|
+
if (params.onError) {
|
|
1724
|
+
const hasErrorBeenResolved = params.onError({ error, data, router });
|
|
1725
|
+
if (hasErrorBeenResolved) {
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
}
|
|
1729
|
+
throw error;
|
|
1730
|
+
}
|
|
1731
|
+
isSubmitting.value = false;
|
|
1732
|
+
if (params.successMessage) {
|
|
1733
|
+
snackbard.success(typeof params.successMessage === "function" ? params.successMessage(result.value, data) : params.successMessage);
|
|
1734
|
+
}
|
|
1735
|
+
(_a = params.onSuccess) == null ? void 0 : _a.call(params, { result: result.value, data, router });
|
|
1736
|
+
if (params.redirectOnSuccess) {
|
|
1737
|
+
router.push(typeof params.redirectOnSuccess === "function" ? params.redirectOnSuccess(result.value, data) : params.redirectOnSuccess);
|
|
1738
|
+
}
|
|
1739
|
+
return result.value;
|
|
1740
|
+
};
|
|
1741
|
+
if (params.immediate) {
|
|
1742
|
+
onMounted(submit);
|
|
1743
|
+
}
|
|
1744
|
+
return {
|
|
1745
|
+
submit,
|
|
1746
|
+
errors,
|
|
1747
|
+
result,
|
|
1748
|
+
isSubmitting
|
|
1749
|
+
};
|
|
1750
|
+
}
|
|
1751
|
+
export { Breadcrumbs, Button, Checkbox, CheckboxGroup, Form, FormFields, FormGroup, Icon, Input, Select, Table, Textarea, modal, registerCustomIconResolver, snackbar, useAction, useModal, useSnackbar };
|