@aeria-ui/ui 0.0.87 → 0.0.89
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/dist/{_id_-090c4448.js → _id_-37c83f35.js} +2 -2
- package/dist/{activation-3f758882.js → activation-46990c40.js} +2 -2
- package/dist/components/aeria-insert-panel/aeria-insert-panel.vue.d.ts +26 -6
- package/dist/components/index.d.ts +21 -17
- package/dist/{index-30662a00.js → index-4ba787c5.js} +1 -1
- package/dist/{index-5b6214ff.js → index-4fc7259a.js} +2 -2
- package/dist/{index-339eb5da.js → index-61a4a8b7.js} +2 -2
- package/dist/index-fb9f4da7.js +3515 -0
- package/dist/{signin-4f04dd22.js → signin-277485f6.js} +1 -1
- package/dist/{signup-e12dbeb1.js → signup-c87489a0.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/ui.js +27 -25
- package/package.json +2 -2
- package/dist/index-a9156ef8.js +0 -3507
|
@@ -0,0 +1,3515 @@
|
|
|
1
|
+
import { defineComponent as U, ref as J, resolveDirective as oe, openBlock as t, createElementBlock as s, normalizeClass as Y, Fragment as P, renderList as D, withDirectives as N, toDisplayString as C, createCommentVNode as y, createTextVNode as Q, unref as e, renderSlot as O, inject as _e, computed as H, createElementVNode as A, mergeProps as G, createBlock as k, withCtx as v, resolveDynamicComponent as be, useCssVars as It, normalizeProps as de, guardReactiveProps as ge, Teleport as Xe, onMounted as Ye, watch as ue, createVNode as q, withModifiers as ze, vModelDynamic as At, onBeforeMount as $t, normalizeStyle as he, pushScopeId as Je, popScopeId as Ze, provide as ye, createSlots as ce, vModelCheckbox as Bt, onUnmounted as wt, isRef as mt, resolveComponent as St, Suspense as Tt, useSlots as jt, h as Rt } from "vue";
|
|
2
|
+
import { t as R, useI18n as Lt } from "@aeria-ui/i18n";
|
|
3
|
+
import { arraysIntersect as gt, deepClone as Ce, getReferenceProperty as me, convertConditionToQuery as zt, freshItem as Mt, isRequired as qt, evaluateCondition as Ke, deepMerge as Me } from "@aeriajs/common";
|
|
4
|
+
import { useStore as ie, getStoreId as qe, useParentStore as Ie, STORE_ID as Fe, getGlobalStateManager as Pe } from "@aeria-ui/state-management";
|
|
5
|
+
import { useScrollObserver as Ne, useBreakpoints as Ue, useMask as Ft, PAGINATION_PER_PAGE_DEFAULTS as Ut, API_URL as kt, request as Et, useDebounce as Vt, isDocumentComplete as Ht, getObjectKey as Dt, convertToSearchQuery as Qt, useAction as Gt, convertFromSearchQuery as Wt, useParentCollectionStore as Ge, usePasswordPolicy as Kt } from "@aeria-ui/core";
|
|
6
|
+
import { useRouter as Ae } from "vue-router";
|
|
7
|
+
const Xt = ["onClick"], Yt = { key: 0 }, Jt = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "accordion__content"
|
|
10
|
+
}, Zt = /* @__PURE__ */ U({
|
|
11
|
+
__name: "aeria-accordion",
|
|
12
|
+
props: {
|
|
13
|
+
enumerate: { type: Boolean },
|
|
14
|
+
noPadding: { type: Boolean },
|
|
15
|
+
headers: {}
|
|
16
|
+
},
|
|
17
|
+
setup(c) {
|
|
18
|
+
const r = J(null), l = (n) => typeof n == "string" ? n : n.title;
|
|
19
|
+
return (n, o) => {
|
|
20
|
+
const u = oe("clickable");
|
|
21
|
+
return t(), s("div", {
|
|
22
|
+
class: Y({
|
|
23
|
+
accordion: !0,
|
|
24
|
+
"accordion--padded": !n.noPadding
|
|
25
|
+
})
|
|
26
|
+
}, [
|
|
27
|
+
(t(!0), s(P, null, D(Object.keys(n.$slots).filter((i) => i !== "default"), (i, _) => (t(), s("div", {
|
|
28
|
+
key: i,
|
|
29
|
+
class: "accordion__slot"
|
|
30
|
+
}, [
|
|
31
|
+
N((t(), s("div", {
|
|
32
|
+
class: "accordion__header",
|
|
33
|
+
onClick: (p) => r.value === i ? r.value = null : r.value = i
|
|
34
|
+
}, [
|
|
35
|
+
n.enumerate ? (t(), s("span", Yt, C(_ + 1) + ". ", 1)) : y("", !0),
|
|
36
|
+
Q(" " + C(n.headers[i] ? l(n.headers[i]) : e(R)(i)), 1)
|
|
37
|
+
], 8, Xt)), [
|
|
38
|
+
[u]
|
|
39
|
+
]),
|
|
40
|
+
r.value === i ? (t(), s("div", Jt, [
|
|
41
|
+
O(n.$slots, i, {}, void 0, !0)
|
|
42
|
+
])) : y("", !0)
|
|
43
|
+
]))), 128))
|
|
44
|
+
], 2);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const K = (c, r) => {
|
|
49
|
+
const l = c.__vccOpts || c;
|
|
50
|
+
for (const [n, o] of r)
|
|
51
|
+
l[n] = o;
|
|
52
|
+
return l;
|
|
53
|
+
}, ql = /* @__PURE__ */ K(Zt, [["__scopeId", "data-v-3ea933d4"]]), Pt = /* @__PURE__ */ U({
|
|
54
|
+
__name: "aeria-badge",
|
|
55
|
+
props: {
|
|
56
|
+
large: { type: Boolean },
|
|
57
|
+
alt: { type: Boolean }
|
|
58
|
+
},
|
|
59
|
+
setup(c) {
|
|
60
|
+
return (r, l) => (t(), s("div", {
|
|
61
|
+
class: Y(`
|
|
62
|
+
badge
|
|
63
|
+
${r.large && "badge--large"}
|
|
64
|
+
${r.alt && "badge--alt"}
|
|
65
|
+
`)
|
|
66
|
+
}, [
|
|
67
|
+
O(r.$slots, "default", {}, void 0, !0)
|
|
68
|
+
], 2));
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const $e = /* @__PURE__ */ K(Pt, [["__scopeId", "data-v-47f92648"]]), Nt = /* @__PURE__ */ U({
|
|
72
|
+
__name: "aeria-bare-button",
|
|
73
|
+
props: {
|
|
74
|
+
disabled: { type: Boolean }
|
|
75
|
+
},
|
|
76
|
+
emits: ["click"],
|
|
77
|
+
setup(c, { emit: r }) {
|
|
78
|
+
const l = c, n = r, o = (u) => {
|
|
79
|
+
l.disabled || n("click", u);
|
|
80
|
+
};
|
|
81
|
+
return (u, i) => (t(), s("button", {
|
|
82
|
+
class: Y(`
|
|
83
|
+
barebutton
|
|
84
|
+
barebutton--${u.disabled ? "disabled" : "enabled"}
|
|
85
|
+
`),
|
|
86
|
+
onClick: o
|
|
87
|
+
}, [
|
|
88
|
+
O(u.$slots, "default", {}, void 0, !0)
|
|
89
|
+
], 2));
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
const ve = /* @__PURE__ */ K(Nt, [["__scopeId", "data-v-35bc81ae"]]), xt = ["href"], en = {
|
|
93
|
+
key: 0,
|
|
94
|
+
"data-component": "icon-label"
|
|
95
|
+
}, tn = /* @__PURE__ */ U({
|
|
96
|
+
__name: "aeria-icon",
|
|
97
|
+
props: {
|
|
98
|
+
icon: {},
|
|
99
|
+
size: {},
|
|
100
|
+
fill: {},
|
|
101
|
+
medium: { type: Boolean },
|
|
102
|
+
reactive: { type: Boolean },
|
|
103
|
+
iconRight: { type: Boolean },
|
|
104
|
+
active: { type: Boolean }
|
|
105
|
+
},
|
|
106
|
+
setup(c) {
|
|
107
|
+
const r = c, l = typeof r.reactive == "boolean" ? r.reactive : _e("iconReactive", !1), n = H(() => {
|
|
108
|
+
var o;
|
|
109
|
+
return (o = r.icon) != null && o.includes(":") ? r.icon : `regular:${r.icon}`;
|
|
110
|
+
});
|
|
111
|
+
return (o, u) => (t(), s("a", {
|
|
112
|
+
class: Y(`
|
|
113
|
+
icon
|
|
114
|
+
${e(l) && "icon--reactive"}
|
|
115
|
+
${o.active && "icon--active"}
|
|
116
|
+
${o.$slots.default ? "icon--centered" : "icon--standalone"}
|
|
117
|
+
`)
|
|
118
|
+
}, [
|
|
119
|
+
A("div", {
|
|
120
|
+
class: Y(`
|
|
121
|
+
icon__icon
|
|
122
|
+
${o.size && `icon__icon--${o.size}`}
|
|
123
|
+
${o.iconRight && "icon__icon--right"}
|
|
124
|
+
`)
|
|
125
|
+
}, [
|
|
126
|
+
(t(), s("svg", G({
|
|
127
|
+
width: "24",
|
|
128
|
+
height: "24",
|
|
129
|
+
viewBox: "0 0 256 256",
|
|
130
|
+
"data-component": "icon"
|
|
131
|
+
}, {
|
|
132
|
+
...o.fill ? { fill: o.fill } : {}
|
|
133
|
+
}), [
|
|
134
|
+
A("use", {
|
|
135
|
+
href: `/assets/icons.svg#${n.value}`
|
|
136
|
+
}, null, 8, xt)
|
|
137
|
+
], 16))
|
|
138
|
+
], 2),
|
|
139
|
+
o.$slots.default ? (t(), s("div", en, [
|
|
140
|
+
O(o.$slots, "default", {}, void 0, !0)
|
|
141
|
+
])) : y("", !0)
|
|
142
|
+
], 2));
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
const Z = /* @__PURE__ */ K(tn, [["__scopeId", "data-v-6d36de33"]]), nn = { class: "button__content" }, on = {
|
|
146
|
+
key: 1,
|
|
147
|
+
class: "button__content"
|
|
148
|
+
}, an = /* @__PURE__ */ U({
|
|
149
|
+
__name: "aeria-button",
|
|
150
|
+
props: {
|
|
151
|
+
size: {},
|
|
152
|
+
variant: {},
|
|
153
|
+
small: { type: Boolean },
|
|
154
|
+
large: { type: Boolean },
|
|
155
|
+
icon: {},
|
|
156
|
+
disabled: { type: Boolean },
|
|
157
|
+
loading: { type: Boolean }
|
|
158
|
+
},
|
|
159
|
+
setup(c) {
|
|
160
|
+
const r = c, l = _e("buttonVariant", r.variant) || "primary", n = (() => {
|
|
161
|
+
switch (!0) {
|
|
162
|
+
case r.small:
|
|
163
|
+
return "small";
|
|
164
|
+
case r.large:
|
|
165
|
+
return "large";
|
|
166
|
+
}
|
|
167
|
+
return _e("buttonSize", r.size) || "medium";
|
|
168
|
+
})();
|
|
169
|
+
return (o, u) => (t(), k(ve, {
|
|
170
|
+
class: Y(`
|
|
171
|
+
button
|
|
172
|
+
button--${e(l)}
|
|
173
|
+
button--${e(n)}
|
|
174
|
+
${o.loading && "button--loading"}
|
|
175
|
+
`),
|
|
176
|
+
disabled: o.disabled
|
|
177
|
+
}, {
|
|
178
|
+
default: v(() => [
|
|
179
|
+
o.icon ? (t(), k(Z, {
|
|
180
|
+
key: 0,
|
|
181
|
+
icon: o.icon
|
|
182
|
+
}, {
|
|
183
|
+
default: v(() => [
|
|
184
|
+
A("div", nn, [
|
|
185
|
+
O(o.$slots, "default", {}, void 0, !0)
|
|
186
|
+
])
|
|
187
|
+
]),
|
|
188
|
+
_: 3
|
|
189
|
+
}, 8, ["icon"])) : (t(), s("div", on, [
|
|
190
|
+
O(o.$slots, "default", {}, void 0, !0)
|
|
191
|
+
]))
|
|
192
|
+
]),
|
|
193
|
+
_: 3
|
|
194
|
+
}, 8, ["class", "disabled"]));
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
const re = /* @__PURE__ */ K(an, [["__scopeId", "data-v-c328251b"]]), ln = { class: "card__picture" }, sn = { class: "card__footer" }, rn = { class: "card__footer-upper" }, un = { class: "card__badge" }, cn = /* @__PURE__ */ U({
|
|
198
|
+
__name: "aeria-card",
|
|
199
|
+
props: {
|
|
200
|
+
inactive: { type: Boolean },
|
|
201
|
+
horizontal: { type: Boolean }
|
|
202
|
+
},
|
|
203
|
+
setup(c) {
|
|
204
|
+
return (r, l) => (t(), s("div", {
|
|
205
|
+
class: Y(`
|
|
206
|
+
card
|
|
207
|
+
${r.inactive && "card--inactive"}
|
|
208
|
+
${r.horizontal && "card--horizontal"}
|
|
209
|
+
`)
|
|
210
|
+
}, [
|
|
211
|
+
A("div", ln, [
|
|
212
|
+
O(r.$slots, "default", {}, void 0, !0)
|
|
213
|
+
]),
|
|
214
|
+
A("div", sn, [
|
|
215
|
+
A("div", rn, [
|
|
216
|
+
A("div", null, [
|
|
217
|
+
O(r.$slots, "footer", {}, void 0, !0)
|
|
218
|
+
]),
|
|
219
|
+
r.$slots.actions ? O(r.$slots, "actions", { key: 0 }, void 0, !0) : y("", !0)
|
|
220
|
+
]),
|
|
221
|
+
A("div", un, [
|
|
222
|
+
O(r.$slots, "badge", {}, void 0, !0)
|
|
223
|
+
])
|
|
224
|
+
])
|
|
225
|
+
], 2));
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
const dn = /* @__PURE__ */ K(cn, [["__scopeId", "data-v-c1a322df"]]), pn = { class: "panel__header-left" }, _n = { key: 1 }, mn = {
|
|
229
|
+
key: 2,
|
|
230
|
+
style: { "margin-left": "auto" }
|
|
231
|
+
}, fn = /* @__PURE__ */ U({
|
|
232
|
+
__name: "aeria-panel",
|
|
233
|
+
props: {
|
|
234
|
+
closeHint: { type: Boolean, default: !1 },
|
|
235
|
+
modelValue: { default: !0 },
|
|
236
|
+
title: {},
|
|
237
|
+
float: { type: Boolean },
|
|
238
|
+
fixedRight: { type: Boolean },
|
|
239
|
+
floating: { type: Boolean },
|
|
240
|
+
loading: { type: Boolean },
|
|
241
|
+
bordered: { type: Boolean },
|
|
242
|
+
overlay: { type: Boolean },
|
|
243
|
+
invisibleOverlay: { type: Boolean },
|
|
244
|
+
collapsed: { type: Boolean },
|
|
245
|
+
collapsible: { type: Boolean, default: !1 },
|
|
246
|
+
fill: { type: Boolean },
|
|
247
|
+
fillFooter: { type: Boolean },
|
|
248
|
+
transparent: { type: Boolean },
|
|
249
|
+
transparentMobile: { type: Boolean },
|
|
250
|
+
outerHeader: { type: Boolean },
|
|
251
|
+
overlayLayer: {}
|
|
252
|
+
},
|
|
253
|
+
emits: ["update:modelValue", "update:collapsed", "update:closeHint", "overlayClick", "close"],
|
|
254
|
+
setup(c, { emit: r }) {
|
|
255
|
+
const l = c, n = r, o = H(() => l.floating || l.float), u = J(l.collapsed), i = J(null), { reachedEnd: _ } = Ne(i), p = () => {
|
|
256
|
+
n("update:modelValue", !1), n("close");
|
|
257
|
+
}, b = () => {
|
|
258
|
+
n("overlayClick");
|
|
259
|
+
}, d = (a) => {
|
|
260
|
+
n("update:collapsed", a), u.value = a;
|
|
261
|
+
};
|
|
262
|
+
return (a, w) => {
|
|
263
|
+
const f = oe("clickable"), $ = oe("loading"), S = oe("overlay");
|
|
264
|
+
return a.modelValue ? N((t(), s("div", {
|
|
265
|
+
key: 0,
|
|
266
|
+
class: Y(`
|
|
267
|
+
panel
|
|
268
|
+
${a.fixedRight && "panel--fixed"}
|
|
269
|
+
`)
|
|
270
|
+
}, [
|
|
271
|
+
(t(), k(be(
|
|
272
|
+
o.value ? "dialog" : "div"
|
|
273
|
+
), {
|
|
274
|
+
"data-component": "panel",
|
|
275
|
+
class: Y(`
|
|
276
|
+
aeria-surface
|
|
277
|
+
panel__content
|
|
278
|
+
${o.value && "panel__content--floating"}
|
|
279
|
+
${a.bordered && "panel__content--bordered"}
|
|
280
|
+
${a.fixedRight && "panel__content--fixed-right"}
|
|
281
|
+
${a.transparent && "panel__content--transparent"}
|
|
282
|
+
${a.transparentMobile && "panel__content--transparent-mobile"}
|
|
283
|
+
${a.outerHeader && "panel__content--outer-header"}
|
|
284
|
+
`),
|
|
285
|
+
onClick: w[2] || (w[2] = (B) => B.stopPropagation())
|
|
286
|
+
}, {
|
|
287
|
+
default: v(() => [
|
|
288
|
+
a.$slots.header || a.title ? (t(), s("div", {
|
|
289
|
+
key: 0,
|
|
290
|
+
class: Y(`
|
|
291
|
+
panel__header
|
|
292
|
+
${u.value && "panel__header--collapsed"}
|
|
293
|
+
${a.outerHeader && "panel__header--outer"}
|
|
294
|
+
`)
|
|
295
|
+
}, [
|
|
296
|
+
A("div", pn, [
|
|
297
|
+
a.$slots.header ? O(a.$slots, "header", { key: 0 }, void 0, !0) : a.title ? (t(), s("div", _n, C(a.title), 1)) : y("", !0),
|
|
298
|
+
a.$slots.extra ? (t(), s("div", mn, [
|
|
299
|
+
O(a.$slots, "extra", {}, void 0, !0)
|
|
300
|
+
])) : y("", !0)
|
|
301
|
+
]),
|
|
302
|
+
a.collapsible && u.value ? N((t(), k(Z, {
|
|
303
|
+
key: 0,
|
|
304
|
+
reactive: "",
|
|
305
|
+
icon: "plus",
|
|
306
|
+
onClick: w[0] || (w[0] = (B) => d(!u.value))
|
|
307
|
+
}, null, 512)), [
|
|
308
|
+
[f]
|
|
309
|
+
]) : a.collapsible && !u.value ? N((t(), k(Z, {
|
|
310
|
+
key: 1,
|
|
311
|
+
reactive: "",
|
|
312
|
+
icon: "minus",
|
|
313
|
+
onClick: w[1] || (w[1] = (B) => d(!u.value))
|
|
314
|
+
}, null, 512)), [
|
|
315
|
+
[f]
|
|
316
|
+
]) : a.closeHint ? N((t(), k(Z, {
|
|
317
|
+
key: 2,
|
|
318
|
+
reactive: "",
|
|
319
|
+
icon: "x",
|
|
320
|
+
onClick: p
|
|
321
|
+
}, null, 512)), [
|
|
322
|
+
[f]
|
|
323
|
+
]) : y("", !0)
|
|
324
|
+
], 2)) : y("", !0),
|
|
325
|
+
u.value ? y("", !0) : N((t(), s("div", {
|
|
326
|
+
key: 1,
|
|
327
|
+
ref_key: "body",
|
|
328
|
+
ref: i,
|
|
329
|
+
class: Y(`
|
|
330
|
+
panel__body
|
|
331
|
+
${a.fill || "panel__body--padded"}
|
|
332
|
+
`)
|
|
333
|
+
}, [
|
|
334
|
+
O(a.$slots, "default", {}, void 0, !0)
|
|
335
|
+
], 2)), [
|
|
336
|
+
[$, a.loading]
|
|
337
|
+
]),
|
|
338
|
+
a.$slots.footer ? (t(), s("div", {
|
|
339
|
+
key: 2,
|
|
340
|
+
class: Y(`
|
|
341
|
+
panel__footer
|
|
342
|
+
${a.fillFooter || "panel__footer--padded"}
|
|
343
|
+
${e(_) || "panel__footer--shadowed"}
|
|
344
|
+
`)
|
|
345
|
+
}, [
|
|
346
|
+
O(a.$slots, "footer", {}, void 0, !0)
|
|
347
|
+
], 2)) : y("", !0)
|
|
348
|
+
]),
|
|
349
|
+
_: 3
|
|
350
|
+
}, 8, ["class"]))
|
|
351
|
+
], 2)), [
|
|
352
|
+
[S, {
|
|
353
|
+
condition: a.overlay || a.fixedRight || o.value,
|
|
354
|
+
invisible: a.invisibleOverlay,
|
|
355
|
+
click: b,
|
|
356
|
+
layer: a.overlayLayer || (o.value ? 60 : a.fixedRight ? 50 : 0)
|
|
357
|
+
}]
|
|
358
|
+
]) : y("", !0);
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
const Be = /* @__PURE__ */ K(fn, [["__scopeId", "data-v-73b47cf0"]]), vn = { class: "content__body" }, yn = {
|
|
363
|
+
key: 0,
|
|
364
|
+
class: "content__section"
|
|
365
|
+
}, bn = { class: "content__item" }, hn = /* @__PURE__ */ U({
|
|
366
|
+
__name: "aeria-context-menu",
|
|
367
|
+
props: {
|
|
368
|
+
actions: {},
|
|
369
|
+
subject: {},
|
|
370
|
+
overlayLayer: {}
|
|
371
|
+
},
|
|
372
|
+
emits: ["actionClick"],
|
|
373
|
+
setup(c, { emit: r }) {
|
|
374
|
+
It((p) => ({
|
|
375
|
+
"036683e2": _.value.x,
|
|
376
|
+
"036683e0": _.value.y
|
|
377
|
+
}));
|
|
378
|
+
const l = r, n = J(null), o = J(!1), u = (p) => p == null ? void 0 : p.filter((b) => {
|
|
379
|
+
if (b.roles) {
|
|
380
|
+
const d = ie("user");
|
|
381
|
+
return gt(b.roles, d.currentUser.roles);
|
|
382
|
+
}
|
|
383
|
+
return !0;
|
|
384
|
+
}), i = (p, b) => {
|
|
385
|
+
const d = b && Ce(b);
|
|
386
|
+
p.click && p.click(d), l("actionClick", {
|
|
387
|
+
action: p,
|
|
388
|
+
subject: d
|
|
389
|
+
}), o.value = !1;
|
|
390
|
+
}, _ = H(() => {
|
|
391
|
+
if (!n.value)
|
|
392
|
+
return {
|
|
393
|
+
x: 0,
|
|
394
|
+
y: 0
|
|
395
|
+
};
|
|
396
|
+
const p = n.value.getBoundingClientRect().top, b = n.value.getBoundingClientRect().left, d = n.value.offsetHeight;
|
|
397
|
+
return {
|
|
398
|
+
_: o.value,
|
|
399
|
+
x: Math.floor(b) + "px",
|
|
400
|
+
y: Math.floor(p + d) + "px"
|
|
401
|
+
};
|
|
402
|
+
});
|
|
403
|
+
return (p, b) => {
|
|
404
|
+
const d = oe("overlay");
|
|
405
|
+
return t(), s(P, null, [
|
|
406
|
+
Object.keys(p.$slots).some((a) => a !== "default") || p.actions !== void 0 && p.actions.length > 0 ? (t(), s("div", {
|
|
407
|
+
key: 0,
|
|
408
|
+
ref_key: "contextmenu",
|
|
409
|
+
ref: n,
|
|
410
|
+
class: "contextmenu"
|
|
411
|
+
}, [
|
|
412
|
+
A("a", {
|
|
413
|
+
class: "contextmenu__trigger",
|
|
414
|
+
onClick: b[0] || (b[0] = (a) => o.value = !0)
|
|
415
|
+
}, [
|
|
416
|
+
O(p.$slots, "default", de(ge({
|
|
417
|
+
visible: o.value
|
|
418
|
+
})), void 0, !0)
|
|
419
|
+
])
|
|
420
|
+
], 512)) : y("", !0),
|
|
421
|
+
o.value ? (t(), k(Xe, {
|
|
422
|
+
key: 1,
|
|
423
|
+
to: "main"
|
|
424
|
+
}, [
|
|
425
|
+
N((t(), k(Be, {
|
|
426
|
+
modelValue: o.value,
|
|
427
|
+
"onUpdate:modelValue": b[4] || (b[4] = (a) => o.value = a),
|
|
428
|
+
fill: "",
|
|
429
|
+
bordered: "",
|
|
430
|
+
class: "content",
|
|
431
|
+
style: { "--panel-min-width": "0" }
|
|
432
|
+
}, {
|
|
433
|
+
default: v(() => [
|
|
434
|
+
A("div", vn, [
|
|
435
|
+
p.$slots.header ? (t(), s("div", yn, [
|
|
436
|
+
O(p.$slots, "header", {}, void 0, !0)
|
|
437
|
+
])) : y("", !0),
|
|
438
|
+
Object.keys(p.$slots).filter((a) => !["default", "extra", "header"].includes(a)).length > 0 ? (t(), s("div", {
|
|
439
|
+
key: 1,
|
|
440
|
+
class: "content__section",
|
|
441
|
+
onClick: b[1] || (b[1] = (a) => o.value = !1)
|
|
442
|
+
}, [
|
|
443
|
+
(t(!0), s(P, null, D(Object.keys(p.$slots).filter((a) => !["default", "extra", "header"].includes(a)), (a, w) => (t(), k(ve, {
|
|
444
|
+
key: `slot-${w}`,
|
|
445
|
+
class: "content__item content__item--reactive"
|
|
446
|
+
}, {
|
|
447
|
+
default: v(() => [
|
|
448
|
+
O(p.$slots, a, {}, void 0, !0)
|
|
449
|
+
]),
|
|
450
|
+
_: 2
|
|
451
|
+
}, 1024))), 128))
|
|
452
|
+
])) : y("", !0),
|
|
453
|
+
p.actions !== void 0 && p.actions.length > 0 ? (t(), s("div", {
|
|
454
|
+
key: 2,
|
|
455
|
+
class: "content__section",
|
|
456
|
+
onClick: b[2] || (b[2] = (a) => o.value = !1)
|
|
457
|
+
}, [
|
|
458
|
+
(t(!0), s(P, null, D(u(p.actions), (a, w) => (t(), k(ve, {
|
|
459
|
+
key: `action-${w}`,
|
|
460
|
+
class: "content__item content__item--reactive",
|
|
461
|
+
onClick: (f) => i(a, p.subject)
|
|
462
|
+
}, {
|
|
463
|
+
default: v(() => [
|
|
464
|
+
a.icon ? (t(), k(Z, {
|
|
465
|
+
key: 0,
|
|
466
|
+
icon: a.icon
|
|
467
|
+
}, {
|
|
468
|
+
default: v(() => [
|
|
469
|
+
Q(C(a.translate ? e(R)(a.label, { capitalize: !0 }) : a.label), 1)
|
|
470
|
+
]),
|
|
471
|
+
_: 2
|
|
472
|
+
}, 1032, ["icon"])) : y("", !0)
|
|
473
|
+
]),
|
|
474
|
+
_: 2
|
|
475
|
+
}, 1032, ["onClick"]))), 128))
|
|
476
|
+
])) : y("", !0),
|
|
477
|
+
p.$slots.extra ? (t(), s("div", {
|
|
478
|
+
key: 3,
|
|
479
|
+
class: "content__section",
|
|
480
|
+
onClick: b[3] || (b[3] = (a) => o.value = !1)
|
|
481
|
+
}, [
|
|
482
|
+
A("div", bn, [
|
|
483
|
+
p.$slots.extra ? O(p.$slots, "extra", { key: 0 }, void 0, !0) : y("", !0)
|
|
484
|
+
])
|
|
485
|
+
])) : y("", !0)
|
|
486
|
+
])
|
|
487
|
+
]),
|
|
488
|
+
_: 3
|
|
489
|
+
}, 8, ["modelValue"])), [
|
|
490
|
+
[
|
|
491
|
+
d,
|
|
492
|
+
{
|
|
493
|
+
layer: p.overlayLayer,
|
|
494
|
+
click: () => {
|
|
495
|
+
o.value = !1;
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
void 0,
|
|
499
|
+
{ invisibleOnLarge: !0 }
|
|
500
|
+
]
|
|
501
|
+
])
|
|
502
|
+
])) : y("", !0)
|
|
503
|
+
], 64);
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
const Oe = /* @__PURE__ */ K(hn, [["__scopeId", "data-v-a03802b2"]]), $n = { class: "info__content" }, gn = /* @__PURE__ */ U({
|
|
508
|
+
__name: "aeria-info",
|
|
509
|
+
props: {
|
|
510
|
+
where: { default: "top" }
|
|
511
|
+
},
|
|
512
|
+
setup(c) {
|
|
513
|
+
const r = Ue(), l = J(!1);
|
|
514
|
+
return (n, o) => e(r).md ? (t(), s("div", {
|
|
515
|
+
key: 0,
|
|
516
|
+
class: "info",
|
|
517
|
+
onMouseleave: o[1] || (o[1] = (u) => l.value = !1)
|
|
518
|
+
}, [
|
|
519
|
+
l.value ? (t(), s("div", {
|
|
520
|
+
key: 0,
|
|
521
|
+
class: Y(`
|
|
522
|
+
info__bubble
|
|
523
|
+
info__bubble--${n.where}
|
|
524
|
+
`)
|
|
525
|
+
}, [
|
|
526
|
+
A("div", $n, [
|
|
527
|
+
O(n.$slots, "text", {}, void 0, !0)
|
|
528
|
+
])
|
|
529
|
+
], 2)) : y("", !0),
|
|
530
|
+
A("div", {
|
|
531
|
+
onMouseover: o[0] || (o[0] = (u) => l.value = !0)
|
|
532
|
+
}, [
|
|
533
|
+
O(n.$slots, "default", {}, void 0, !0)
|
|
534
|
+
], 32)
|
|
535
|
+
], 32)) : O(n.$slots, "default", { key: 1 }, void 0, !0);
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
const kn = /* @__PURE__ */ K(gn, [["__scopeId", "data-v-7e2a5440"]]), Vn = { class: "input" }, Cn = {
|
|
539
|
+
key: 0,
|
|
540
|
+
class: "input__label"
|
|
541
|
+
}, On = {
|
|
542
|
+
key: 1,
|
|
543
|
+
class: "input__hint"
|
|
544
|
+
}, In = ["placeholder", "readonly", "value"], An = ["value"], Bn = {
|
|
545
|
+
key: 1,
|
|
546
|
+
class: "input__clipboard"
|
|
547
|
+
}, wn = /* @__PURE__ */ U({
|
|
548
|
+
__name: "aeria-input",
|
|
549
|
+
props: {
|
|
550
|
+
modelValue: {},
|
|
551
|
+
property: {},
|
|
552
|
+
propertyName: {},
|
|
553
|
+
parentPropertyName: {},
|
|
554
|
+
parentCollection: {},
|
|
555
|
+
readOnly: { type: Boolean },
|
|
556
|
+
variant: {}
|
|
557
|
+
},
|
|
558
|
+
emits: ["update:modelValue", "input", "change", "clipboardCopy"],
|
|
559
|
+
setup(c, { emit: r }) {
|
|
560
|
+
var ee;
|
|
561
|
+
const l = c, n = r, o = l.property || {}, u = "icon" in o || "inputType" in o && o.inputType === "search", i = _e("searchOnly", !1), _ = _e("innerInputLabel", !1), p = !i && (l.readOnly || o.readOnly), b = (h) => (n("clipboardCopy", h), navigator.clipboard.writeText(h)), d = _e("inputVariant", l.variant) || "normal", a = Object.assign(Object.assign({}, l), {
|
|
562
|
+
name: l.propertyName,
|
|
563
|
+
readonly: p,
|
|
564
|
+
type: (() => {
|
|
565
|
+
if ("type" in o)
|
|
566
|
+
switch (o.type) {
|
|
567
|
+
case "number":
|
|
568
|
+
case "integer":
|
|
569
|
+
return "number";
|
|
570
|
+
}
|
|
571
|
+
if (o.inputType)
|
|
572
|
+
return o.inputType;
|
|
573
|
+
switch (typeof l.modelValue) {
|
|
574
|
+
case "string":
|
|
575
|
+
return "text";
|
|
576
|
+
case "number":
|
|
577
|
+
return "number";
|
|
578
|
+
default:
|
|
579
|
+
return "text";
|
|
580
|
+
}
|
|
581
|
+
})(),
|
|
582
|
+
placeholder: _ ? o.description || l.propertyName : o.placeholder
|
|
583
|
+
});
|
|
584
|
+
"type" in o && ((o.type === "number" || o.type === "integer") && (o.minimum && (a.min = o.minimum), o.exclusiveMinimum && (a.min = o.exclusiveMinimum + 1), o.maximum && (a.max = o.maximum), o.exclusiveMaximum && (a.max = o.exclusiveMaximum - 1)), o.type === "string" && ((o.format === "date" || o.format === "date-time") && (a.type = !i && o.format === "date-time" ? "datetime-local" : "date"), a.minlength = o.minLength, a.maxlength = o.maxLength)), a.type === "text" && i && (a.type = "search"), Ye(() => {
|
|
585
|
+
l.modelValue !== null && B(l.modelValue);
|
|
586
|
+
});
|
|
587
|
+
const w = (h) => {
|
|
588
|
+
try {
|
|
589
|
+
if (!h)
|
|
590
|
+
return "";
|
|
591
|
+
const W = h instanceof Date ? h : new Date(h);
|
|
592
|
+
switch (a.type) {
|
|
593
|
+
case "date":
|
|
594
|
+
return W.toISOString().slice(0, 10);
|
|
595
|
+
case "datetime-local":
|
|
596
|
+
return W.toISOString().slice(0, 19);
|
|
597
|
+
default:
|
|
598
|
+
throw new Error();
|
|
599
|
+
}
|
|
600
|
+
} catch {
|
|
601
|
+
return "";
|
|
602
|
+
}
|
|
603
|
+
}, f = J(""), $ = ((ee = l.property) == null ? void 0 : ee.type) === "string" && l.property.mask ? Ft(l.property.mask) : null;
|
|
604
|
+
ue(() => l.modelValue, (h) => {
|
|
605
|
+
f.value = (() => {
|
|
606
|
+
if ($)
|
|
607
|
+
return h ? $.enmask(String(h), void 0, {
|
|
608
|
+
defaultValue: !0
|
|
609
|
+
}) : "";
|
|
610
|
+
switch (a.type) {
|
|
611
|
+
case "date":
|
|
612
|
+
case "datetime-local":
|
|
613
|
+
return w(h);
|
|
614
|
+
}
|
|
615
|
+
switch (h) {
|
|
616
|
+
case null:
|
|
617
|
+
case void 0:
|
|
618
|
+
return "";
|
|
619
|
+
default:
|
|
620
|
+
return h;
|
|
621
|
+
}
|
|
622
|
+
})();
|
|
623
|
+
}, {
|
|
624
|
+
immediate: !0
|
|
625
|
+
});
|
|
626
|
+
const S = (h) => {
|
|
627
|
+
var W;
|
|
628
|
+
return typeof f.value == "string" && ((W = l.property) == null ? void 0 : W.type) === "string" && $ !== null ? (f.value = $.enmask(f.value, void 0, {
|
|
629
|
+
defaultValue: !0
|
|
630
|
+
}), l.property.maskedValue === !0 ? f.value : $.unmask(f.value)) : h;
|
|
631
|
+
}, B = (h) => {
|
|
632
|
+
const W = (() => {
|
|
633
|
+
if (!h || typeof h != "string")
|
|
634
|
+
return h;
|
|
635
|
+
if (a.type === "number" || a.type === "integer")
|
|
636
|
+
return Number(h);
|
|
637
|
+
if (!("type" in o && o.type === "string"))
|
|
638
|
+
return S(h);
|
|
639
|
+
switch (o.format) {
|
|
640
|
+
case "date":
|
|
641
|
+
case "date-time":
|
|
642
|
+
return new Date(h);
|
|
643
|
+
default:
|
|
644
|
+
return S(h);
|
|
645
|
+
}
|
|
646
|
+
})();
|
|
647
|
+
n("input", W), n("update:modelValue", W);
|
|
648
|
+
}, X = (h) => {
|
|
649
|
+
const W = h.target.value;
|
|
650
|
+
f.value = W, B(W);
|
|
651
|
+
};
|
|
652
|
+
return (h, W) => {
|
|
653
|
+
const ne = oe("focus"), T = oe("clickable");
|
|
654
|
+
return t(), s("label", Vn, [
|
|
655
|
+
e(_) ? y("", !0) : (t(), s("div", Cn, [
|
|
656
|
+
h.$slots.default ? O(h.$slots, "default", { key: 0 }, void 0, !0) : O(h.$slots, "description", { key: 1 }, void 0, !0)
|
|
657
|
+
])),
|
|
658
|
+
h.$slots.hint ? (t(), s("div", On, [
|
|
659
|
+
O(h.$slots, "hint", {}, void 0, !0)
|
|
660
|
+
])) : y("", !0),
|
|
661
|
+
"element" in e(o) && e(o).element === "textarea" ? (t(), s("div", {
|
|
662
|
+
key: 2,
|
|
663
|
+
class: Y(`
|
|
664
|
+
input__container
|
|
665
|
+
input__container--textarea
|
|
666
|
+
input__container--${e(d)}
|
|
667
|
+
`)
|
|
668
|
+
}, [
|
|
669
|
+
N(A("textarea", {
|
|
670
|
+
placeholder: e(a).placeholder,
|
|
671
|
+
readonly: e(a).readonly,
|
|
672
|
+
value: h.modelValue,
|
|
673
|
+
class: Y(`
|
|
674
|
+
input__textarea
|
|
675
|
+
input__input--${e(d)}
|
|
676
|
+
`),
|
|
677
|
+
onInput: X
|
|
678
|
+
}, null, 42, In), [
|
|
679
|
+
[ne, e(o).focus]
|
|
680
|
+
])
|
|
681
|
+
], 2)) : (t(), s("div", {
|
|
682
|
+
key: 3,
|
|
683
|
+
class: Y(`
|
|
684
|
+
input__container
|
|
685
|
+
input__container--${e(d)}
|
|
686
|
+
`)
|
|
687
|
+
}, [
|
|
688
|
+
N(A("input", G(e(a), {
|
|
689
|
+
value: f.value,
|
|
690
|
+
"data-component": "input",
|
|
691
|
+
class: `
|
|
692
|
+
input__input
|
|
693
|
+
input__input--${e(d)}
|
|
694
|
+
${e(u) && "input__input--icon"}
|
|
695
|
+
${e(p) && "input__input--readOnly"}
|
|
696
|
+
`,
|
|
697
|
+
onInput: X,
|
|
698
|
+
onChange: W[0] || (W[0] = (g) => n("change", g))
|
|
699
|
+
}), null, 16, An), [
|
|
700
|
+
[ne, e(o).focus]
|
|
701
|
+
]),
|
|
702
|
+
e(u) ? (t(), k(Z, {
|
|
703
|
+
key: 0,
|
|
704
|
+
icon: e(o).icon || "magnifying-glass",
|
|
705
|
+
class: Y(`
|
|
706
|
+
input__icon
|
|
707
|
+
input__icon--${e(d)}
|
|
708
|
+
`)
|
|
709
|
+
}, null, 8, ["icon", "class"])) : y("", !0),
|
|
710
|
+
e(p) ? (t(), s("div", Bn, [
|
|
711
|
+
q(kn, null, {
|
|
712
|
+
text: v(() => [
|
|
713
|
+
Q("Copiar")
|
|
714
|
+
]),
|
|
715
|
+
default: v(() => [
|
|
716
|
+
N(q(Z, {
|
|
717
|
+
reactive: "",
|
|
718
|
+
icon: "clipboard",
|
|
719
|
+
onClick: W[1] || (W[1] = ze((g) => b(String(h.modelValue || "")), ["prevent"]))
|
|
720
|
+
}, null, 512), [
|
|
721
|
+
[T]
|
|
722
|
+
])
|
|
723
|
+
]),
|
|
724
|
+
_: 1
|
|
725
|
+
})
|
|
726
|
+
])) : y("", !0)
|
|
727
|
+
], 2))
|
|
728
|
+
]);
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
});
|
|
732
|
+
const ke = /* @__PURE__ */ K(wn, [["__scopeId", "data-v-7817bd05"]]), Sn = {
|
|
733
|
+
key: 1,
|
|
734
|
+
value: ""
|
|
735
|
+
}, Tn = ["value", "data-selected"], jn = /* @__PURE__ */ U({
|
|
736
|
+
__name: "aeria-select",
|
|
737
|
+
props: {
|
|
738
|
+
modelValue: {},
|
|
739
|
+
property: {},
|
|
740
|
+
propertyName: {},
|
|
741
|
+
parentPropertyName: {},
|
|
742
|
+
parentCollection: {},
|
|
743
|
+
readOnly: { type: Boolean },
|
|
744
|
+
booleanRef: { type: Boolean },
|
|
745
|
+
multiple: { type: [Boolean, Number] },
|
|
746
|
+
noOutline: { type: Boolean }
|
|
747
|
+
},
|
|
748
|
+
emits: ["update:modelValue", "change"],
|
|
749
|
+
setup(c, { emit: r }) {
|
|
750
|
+
const l = c, n = r, o = J(null), u = l.property, i = (d) => {
|
|
751
|
+
l.booleanRef && (_.value = d), n("update:modelValue", (d == null ? void 0 : d._id) || d), n("change", (d == null ? void 0 : d._id) || d);
|
|
752
|
+
}, _ = l.booleanRef ? (() => {
|
|
753
|
+
const d = J(l.modelValue);
|
|
754
|
+
return H({
|
|
755
|
+
get: () => {
|
|
756
|
+
switch (d.value) {
|
|
757
|
+
case "true":
|
|
758
|
+
return !0;
|
|
759
|
+
case "false":
|
|
760
|
+
return !1;
|
|
761
|
+
default:
|
|
762
|
+
return null;
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
set: (w) => {
|
|
766
|
+
d.value = w;
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
})() : H({
|
|
770
|
+
get: () => l.modelValue,
|
|
771
|
+
set: i
|
|
772
|
+
}), p = (d) => Array.isArray(l.modelValue) ? l.modelValue.includes(d) : l.modelValue === d, b = H(() => l.multiple ? typeof l.multiple == "number" ? l.multiple : 5 : 1);
|
|
773
|
+
return l.multiple && ue(() => l.modelValue, (d) => {
|
|
774
|
+
var w;
|
|
775
|
+
if (!o.value)
|
|
776
|
+
return;
|
|
777
|
+
const a = o.value.querySelector('option[data-selected="true"]');
|
|
778
|
+
a && a.removeAttribute("data-selected"), (w = o.value.querySelector(`option[value="${d}"]`)) == null || w.setAttribute("data-selected", "true");
|
|
779
|
+
}), (d, a) => d.readOnly ? (t(), k(ke, {
|
|
780
|
+
key: 1,
|
|
781
|
+
"read-only": "",
|
|
782
|
+
"model-value": e(_)
|
|
783
|
+
}, null, 8, ["model-value"])) : (t(), s("select", G({ key: 0 }, {
|
|
784
|
+
size: b.value,
|
|
785
|
+
value: e(_)
|
|
786
|
+
}, {
|
|
787
|
+
ref_key: "select",
|
|
788
|
+
ref: o,
|
|
789
|
+
class: {
|
|
790
|
+
select: !0,
|
|
791
|
+
"select--multiple": !!b.value,
|
|
792
|
+
"select--outline": !d.noOutline
|
|
793
|
+
},
|
|
794
|
+
onChange: a[0] || (a[0] = (w) => i(w.target.value))
|
|
795
|
+
}), [
|
|
796
|
+
e(u) && e(u).icon ? (t(), k(Z, {
|
|
797
|
+
key: 0,
|
|
798
|
+
icon: e(u).icon
|
|
799
|
+
}, null, 8, ["icon"])) : y("", !0),
|
|
800
|
+
l.multiple ? y("", !0) : (t(), s("option", Sn, C(e(R)("none")), 1)),
|
|
801
|
+
(t(!0), s(P, null, D(e(u) && "enum" in e(u) ? e(u).enum : [], (w) => {
|
|
802
|
+
var f;
|
|
803
|
+
return t(), s("option", {
|
|
804
|
+
key: w,
|
|
805
|
+
value: w,
|
|
806
|
+
"data-selected": p(w)
|
|
807
|
+
}, C((f = e(u)) != null && f.translate ? e(R)(w) : w), 9, Tn);
|
|
808
|
+
}), 128)),
|
|
809
|
+
O(d.$slots, "default", {}, void 0, !0)
|
|
810
|
+
], 16));
|
|
811
|
+
}
|
|
812
|
+
});
|
|
813
|
+
const De = /* @__PURE__ */ K(jn, [["__scopeId", "data-v-1c0432ab"]]), Rn = { class: "pagination" }, Ln = { class: "pagination__arrows" }, zn = ["value"], Mn = {
|
|
814
|
+
key: 0,
|
|
815
|
+
class: "pagination__summary"
|
|
816
|
+
}, qn = /* @__PURE__ */ U({
|
|
817
|
+
__name: "aeria-pagination",
|
|
818
|
+
props: {
|
|
819
|
+
pagination: {},
|
|
820
|
+
noSummary: { type: Boolean }
|
|
821
|
+
},
|
|
822
|
+
emits: ["paginate"],
|
|
823
|
+
setup(c, { emit: r }) {
|
|
824
|
+
const l = c, n = r, o = H({
|
|
825
|
+
get: () => Math.floor(l.pagination.offset / l.pagination.limit),
|
|
826
|
+
set: (b) => {
|
|
827
|
+
l.pagination.offset = b * l.pagination.limit;
|
|
828
|
+
}
|
|
829
|
+
}), u = H({
|
|
830
|
+
get: () => l.pagination.limit,
|
|
831
|
+
set: (b) => {
|
|
832
|
+
l.pagination.limit = Number(b);
|
|
833
|
+
}
|
|
834
|
+
}), i = J(o.value ? o.value + 1 : 1), _ = H(() => Math.ceil(l.pagination.recordsTotal / l.pagination.limit)), p = (b) => {
|
|
835
|
+
o.value = b === "previous" ? o.value - 1 : o.value + 1;
|
|
836
|
+
};
|
|
837
|
+
return ue([
|
|
838
|
+
o,
|
|
839
|
+
u
|
|
840
|
+
], ([b]) => {
|
|
841
|
+
i.value = b + 1, n("paginate", {
|
|
842
|
+
offset: o.value * u.value,
|
|
843
|
+
limit: u.value
|
|
844
|
+
});
|
|
845
|
+
}), (b, d) => (t(), s("div", Rn, [
|
|
846
|
+
A("div", Ln, [
|
|
847
|
+
q(ve, {
|
|
848
|
+
disabled: o.value === 0,
|
|
849
|
+
onClick: d[0] || (d[0] = (a) => o.value = 0)
|
|
850
|
+
}, {
|
|
851
|
+
default: v(() => [
|
|
852
|
+
q(Z, { icon: "caret-double-left" })
|
|
853
|
+
]),
|
|
854
|
+
_: 1
|
|
855
|
+
}, 8, ["disabled"]),
|
|
856
|
+
q(ve, {
|
|
857
|
+
disabled: o.value === 0,
|
|
858
|
+
onClick: d[1] || (d[1] = (a) => p("previous"))
|
|
859
|
+
}, {
|
|
860
|
+
default: v(() => [
|
|
861
|
+
q(Z, { icon: "caret-left" })
|
|
862
|
+
]),
|
|
863
|
+
_: 1
|
|
864
|
+
}, 8, ["disabled"]),
|
|
865
|
+
q(ve, {
|
|
866
|
+
disabled: o.value === _.value - 1,
|
|
867
|
+
onClick: d[2] || (d[2] = (a) => p("next"))
|
|
868
|
+
}, {
|
|
869
|
+
default: v(() => [
|
|
870
|
+
q(Z, { icon: "caret-right" })
|
|
871
|
+
]),
|
|
872
|
+
_: 1
|
|
873
|
+
}, 8, ["disabled"]),
|
|
874
|
+
q(ve, {
|
|
875
|
+
disabled: o.value === _.value - 1,
|
|
876
|
+
onClick: d[3] || (d[3] = (a) => o.value = _.value - 1)
|
|
877
|
+
}, {
|
|
878
|
+
default: v(() => [
|
|
879
|
+
q(Z, { icon: "caret-double-right" })
|
|
880
|
+
]),
|
|
881
|
+
_: 1
|
|
882
|
+
}, 8, ["disabled"]),
|
|
883
|
+
q(De, {
|
|
884
|
+
modelValue: u.value,
|
|
885
|
+
"onUpdate:modelValue": d[4] || (d[4] = (a) => u.value = a),
|
|
886
|
+
property: {
|
|
887
|
+
enum: [],
|
|
888
|
+
icon: "list"
|
|
889
|
+
},
|
|
890
|
+
class: "pagination__control"
|
|
891
|
+
}, {
|
|
892
|
+
default: v(() => [
|
|
893
|
+
(t(!0), s(P, null, D(e(Ut), (a) => (t(), s("option", {
|
|
894
|
+
key: `limit-${a}`,
|
|
895
|
+
value: a
|
|
896
|
+
}, C(a), 9, zn))), 128))
|
|
897
|
+
]),
|
|
898
|
+
_: 1
|
|
899
|
+
}, 8, ["modelValue"])
|
|
900
|
+
]),
|
|
901
|
+
b.noSummary ? y("", !0) : (t(), s("div", Mn, [
|
|
902
|
+
Q(C(e(R)("Page")) + " ", 1),
|
|
903
|
+
(t(), k(ke, {
|
|
904
|
+
key: o.value,
|
|
905
|
+
modelValue: i.value,
|
|
906
|
+
"onUpdate:modelValue": d[5] || (d[5] = (a) => i.value = a),
|
|
907
|
+
property: {
|
|
908
|
+
type: "number",
|
|
909
|
+
minimum: 1
|
|
910
|
+
},
|
|
911
|
+
style: { height: "100%" },
|
|
912
|
+
onChange: d[6] || (d[6] = (a) => {
|
|
913
|
+
o.value = i.value === 0 ? 0 : i.value - 1;
|
|
914
|
+
})
|
|
915
|
+
}, null, 8, ["modelValue"])),
|
|
916
|
+
A("span", null, C(e(R)("of")) + " " + C(_.value), 1)
|
|
917
|
+
]))
|
|
918
|
+
]));
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
const Fn = /* @__PURE__ */ K(qn, [["__scopeId", "data-v-ae7235de"]]), Un = { class: "checkbox__text" }, En = ["innerHTML"], Hn = { class: "checkbox__hint" }, Dn = ["innerHTML"], Qn = {
|
|
922
|
+
inheritAttrs: !1
|
|
923
|
+
}, Gn = /* @__PURE__ */ U({
|
|
924
|
+
...Qn,
|
|
925
|
+
__name: "aeria-checkbox",
|
|
926
|
+
props: {
|
|
927
|
+
modelValue: {},
|
|
928
|
+
property: {},
|
|
929
|
+
propertyName: {},
|
|
930
|
+
parentPropertyName: {},
|
|
931
|
+
parentCollection: {},
|
|
932
|
+
readOnly: { type: Boolean },
|
|
933
|
+
value: {},
|
|
934
|
+
variant: {}
|
|
935
|
+
},
|
|
936
|
+
emits: ["update:modelValue", "change"],
|
|
937
|
+
setup(c, { emit: r }) {
|
|
938
|
+
const l = c, n = l.property, o = l.readOnly || (n == null ? void 0 : n.readOnly), u = (() => {
|
|
939
|
+
if (n && "type" in n)
|
|
940
|
+
switch (n.type) {
|
|
941
|
+
case "array":
|
|
942
|
+
case "boolean":
|
|
943
|
+
return "checkbox";
|
|
944
|
+
}
|
|
945
|
+
return "radio";
|
|
946
|
+
})(), i = r, _ = l.value || !1, p = H({
|
|
947
|
+
get: () => {
|
|
948
|
+
var d;
|
|
949
|
+
if (n) {
|
|
950
|
+
if ("type" in n && n.type === "boolean")
|
|
951
|
+
return !!l.value;
|
|
952
|
+
if ("items" in n)
|
|
953
|
+
return (d = l.modelValue) == null ? void 0 : d.includes(l.value);
|
|
954
|
+
}
|
|
955
|
+
return l.modelValue === l.value;
|
|
956
|
+
},
|
|
957
|
+
set: () => {
|
|
958
|
+
var d;
|
|
959
|
+
if (!o) {
|
|
960
|
+
if (n) {
|
|
961
|
+
if ("type" in n && n.type === "boolean") {
|
|
962
|
+
i("update:modelValue", !l.modelValue);
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
if ("items" in n) {
|
|
966
|
+
if ((d = l.modelValue) != null && d.includes(_)) {
|
|
967
|
+
i("update:modelValue", l.modelValue.filter((a) => a !== _));
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
i("update:modelValue", [_].concat(l.modelValue || []));
|
|
971
|
+
return;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
i("update:modelValue", l.value);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}), b = (d) => {
|
|
978
|
+
o && d.preventDefault();
|
|
979
|
+
};
|
|
980
|
+
return (d, a) => {
|
|
981
|
+
var f, $;
|
|
982
|
+
const w = oe("clickable");
|
|
983
|
+
return N((t(), s("label", {
|
|
984
|
+
class: Y(`
|
|
985
|
+
checkbox
|
|
986
|
+
${e(o) && "checkbox--readOnly"}
|
|
987
|
+
`)
|
|
988
|
+
}, [
|
|
989
|
+
N(A("input", G({
|
|
990
|
+
"onUpdate:modelValue": a[0] || (a[0] = (S) => p.value = S)
|
|
991
|
+
}, {
|
|
992
|
+
type: e(u),
|
|
993
|
+
readOnly: e(o),
|
|
994
|
+
checked: p.value
|
|
995
|
+
}, {
|
|
996
|
+
class: "checkbox__input",
|
|
997
|
+
onClick: b
|
|
998
|
+
}), null, 16), [
|
|
999
|
+
[At, p.value]
|
|
1000
|
+
]),
|
|
1001
|
+
A("div", Un, [
|
|
1002
|
+
A("div", null, [
|
|
1003
|
+
d.$slots.description ? O(d.$slots, "description", { key: 0 }, void 0, !0) : e(_) ? (t(), s("div", {
|
|
1004
|
+
key: 1,
|
|
1005
|
+
innerHTML: (f = e(n)) != null && f.translate ? e(R)(e(_)) : e(_)
|
|
1006
|
+
}, null, 8, En)) : O(d.$slots, "default", { key: 2 }, void 0, !0)
|
|
1007
|
+
]),
|
|
1008
|
+
A("div", Hn, [
|
|
1009
|
+
d.$slots.hint ? O(d.$slots, "hint", { key: 0 }, void 0, !0) : ($ = e(n)) != null && $.hint ? (t(), s("div", {
|
|
1010
|
+
key: 1,
|
|
1011
|
+
innerHTML: e(n).hint
|
|
1012
|
+
}, null, 8, Dn)) : y("", !0)
|
|
1013
|
+
])
|
|
1014
|
+
])
|
|
1015
|
+
], 2)), [
|
|
1016
|
+
[w]
|
|
1017
|
+
]);
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
});
|
|
1021
|
+
const Wn = /* @__PURE__ */ K(Gn, [["__scopeId", "data-v-b9da4354"]]), Kn = {
|
|
1022
|
+
inheritAttrs: !1
|
|
1023
|
+
}, Xn = /* @__PURE__ */ U({
|
|
1024
|
+
...Kn,
|
|
1025
|
+
__name: "aeria-options",
|
|
1026
|
+
props: {
|
|
1027
|
+
modelValue: {},
|
|
1028
|
+
propertyName: {},
|
|
1029
|
+
parentPropertyName: {},
|
|
1030
|
+
parentCollection: {},
|
|
1031
|
+
readOnly: { type: Boolean },
|
|
1032
|
+
property: {},
|
|
1033
|
+
columns: { default: 1 }
|
|
1034
|
+
},
|
|
1035
|
+
emits: ["update:modelValue"],
|
|
1036
|
+
setup(c, { emit: r }) {
|
|
1037
|
+
const l = c, n = r, o = l.readOnly || l.property.readOnly, u = "items" in l.property ? l.property.items.enum : l.property.enum, i = (_) => {
|
|
1038
|
+
n("update:modelValue", _);
|
|
1039
|
+
};
|
|
1040
|
+
return $t(() => {
|
|
1041
|
+
l.modelValue || n(
|
|
1042
|
+
"update:modelValue",
|
|
1043
|
+
"items" in l.property ? [] : ""
|
|
1044
|
+
);
|
|
1045
|
+
}), (_, p) => (t(), s("div", {
|
|
1046
|
+
class: "options",
|
|
1047
|
+
style: he(`
|
|
1048
|
+
--columns: ${_.columns};
|
|
1049
|
+
grid-template-columns: repeat(var(--columns), 1fr);
|
|
1050
|
+
`)
|
|
1051
|
+
}, [
|
|
1052
|
+
(t(!0), s(P, null, D(e(u), (b) => (t(), s("div", {
|
|
1053
|
+
key: `option-${b}`,
|
|
1054
|
+
class: "options__checkbox"
|
|
1055
|
+
}, [
|
|
1056
|
+
q(Wn, G({ ref_for: !0 }, {
|
|
1057
|
+
value: b,
|
|
1058
|
+
readOnly: e(o),
|
|
1059
|
+
property: _.property
|
|
1060
|
+
}, {
|
|
1061
|
+
"model-value": _.modelValue,
|
|
1062
|
+
"onUpdate:modelValue": i
|
|
1063
|
+
}), null, 16, ["model-value"])
|
|
1064
|
+
]))), 128))
|
|
1065
|
+
], 4));
|
|
1066
|
+
}
|
|
1067
|
+
});
|
|
1068
|
+
const Yn = /* @__PURE__ */ K(Xn, [["__scopeId", "data-v-4aed0c5c"]]), Jn = (c) => (Je("data-v-0e3564b6"), c = c(), Ze(), c), Zn = { class: "switch-wrapper" }, Pn = /* @__PURE__ */ Jn(() => /* @__PURE__ */ A("div", { class: "switch__slider" }, null, -1)), Nn = { key: 1 }, xn = {
|
|
1069
|
+
inheritAttrs: !1
|
|
1070
|
+
}, eo = /* @__PURE__ */ U({
|
|
1071
|
+
...xn,
|
|
1072
|
+
__name: "aeria-switch",
|
|
1073
|
+
props: {
|
|
1074
|
+
modelValue: {},
|
|
1075
|
+
property: {},
|
|
1076
|
+
propertyName: {},
|
|
1077
|
+
parentPropertyName: {},
|
|
1078
|
+
parentCollection: {},
|
|
1079
|
+
readOnly: { type: Boolean }
|
|
1080
|
+
},
|
|
1081
|
+
emits: ["update:modelValue", "change"],
|
|
1082
|
+
setup(c, { emit: r }) {
|
|
1083
|
+
const l = c, n = r, o = l.property, u = l.readOnly || (o == null ? void 0 : o.readOnly), i = () => {
|
|
1084
|
+
u || (n("change", !l.modelValue), n("update:modelValue", !l.modelValue));
|
|
1085
|
+
};
|
|
1086
|
+
return (_, p) => {
|
|
1087
|
+
var d;
|
|
1088
|
+
const b = oe("clickable");
|
|
1089
|
+
return t(), s("div", Zn, [
|
|
1090
|
+
N((t(), s("a", {
|
|
1091
|
+
class: Y(`
|
|
1092
|
+
switch
|
|
1093
|
+
${_.modelValue && "switch--active"}
|
|
1094
|
+
${e(u) && "switch--readOnly"}
|
|
1095
|
+
`),
|
|
1096
|
+
onClick: ze(i, ["stop"])
|
|
1097
|
+
}, [
|
|
1098
|
+
Pn,
|
|
1099
|
+
A("div", {
|
|
1100
|
+
class: Y(`
|
|
1101
|
+
switch__dummy
|
|
1102
|
+
${!_.modelValue && "switch__dummy--flex"}
|
|
1103
|
+
`)
|
|
1104
|
+
}, null, 2)
|
|
1105
|
+
], 2)), [
|
|
1106
|
+
[b, {
|
|
1107
|
+
blocked: e(u)
|
|
1108
|
+
}]
|
|
1109
|
+
]),
|
|
1110
|
+
_.$slots.default ? O(_.$slots, "default", { key: 0 }, void 0, !0) : (t(), s("div", Nn, C(((d = e(o)) == null ? void 0 : d.description) || _.propertyName), 1))
|
|
1111
|
+
]);
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
const to = /* @__PURE__ */ K(eo, [["__scopeId", "data-v-0e3564b6"]]), Ct = (c) => (Je("data-v-153a2e0f"), c = c(), Ze(), c), no = { class: "picture" }, oo = {
|
|
1116
|
+
key: 0,
|
|
1117
|
+
style: { position: "fixed", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }
|
|
1118
|
+
}, ao = ["src", "alt"], lo = {
|
|
1119
|
+
key: 0,
|
|
1120
|
+
class: "picture__meta"
|
|
1121
|
+
}, so = ["src"], io = /* @__PURE__ */ Ct(() => /* @__PURE__ */ A("line", {
|
|
1122
|
+
x1: "0",
|
|
1123
|
+
y1: "0",
|
|
1124
|
+
x2: "200",
|
|
1125
|
+
y2: "200",
|
|
1126
|
+
stroke: "#000",
|
|
1127
|
+
"vector-effect": "non-scaling-stroke"
|
|
1128
|
+
}, null, -1)), ro = /* @__PURE__ */ Ct(() => /* @__PURE__ */ A("line", {
|
|
1129
|
+
x1: "200",
|
|
1130
|
+
y1: "0",
|
|
1131
|
+
x2: "0",
|
|
1132
|
+
y2: "200",
|
|
1133
|
+
stroke: "#000",
|
|
1134
|
+
"vector-effect": "non-scaling-stroke"
|
|
1135
|
+
}, null, -1)), uo = [
|
|
1136
|
+
io,
|
|
1137
|
+
ro
|
|
1138
|
+
], co = { key: 5 }, po = /* @__PURE__ */ U({
|
|
1139
|
+
__name: "aeria-picture",
|
|
1140
|
+
props: {
|
|
1141
|
+
url: {},
|
|
1142
|
+
alt: {},
|
|
1143
|
+
fileId: {},
|
|
1144
|
+
modelValue: {},
|
|
1145
|
+
objectFit: {},
|
|
1146
|
+
bordered: { type: Boolean },
|
|
1147
|
+
width: {},
|
|
1148
|
+
height: {},
|
|
1149
|
+
expandable: { type: Boolean },
|
|
1150
|
+
meta: {}
|
|
1151
|
+
},
|
|
1152
|
+
setup(c) {
|
|
1153
|
+
const r = c, l = H(() => r.fileId ? `${kt}/file/${r.fileId}/picture` : r.url || r.modelValue), n = J(!1);
|
|
1154
|
+
return (o, u) => {
|
|
1155
|
+
var _;
|
|
1156
|
+
const i = oe("overlay");
|
|
1157
|
+
return t(), s("figure", no, [
|
|
1158
|
+
l.value ? (t(), k(Xe, {
|
|
1159
|
+
key: 0,
|
|
1160
|
+
to: "main"
|
|
1161
|
+
}, [
|
|
1162
|
+
n.value ? N((t(), s("div", oo, [
|
|
1163
|
+
A("img", {
|
|
1164
|
+
src: l.value,
|
|
1165
|
+
alt: o.alt,
|
|
1166
|
+
style: `
|
|
1167
|
+
max-height: 60vh;
|
|
1168
|
+
object-fit: contain;
|
|
1169
|
+
`,
|
|
1170
|
+
onClick: u[0] || (u[0] = (p) => n.value = !0)
|
|
1171
|
+
}, null, 8, ao),
|
|
1172
|
+
(_ = o.meta) != null && _.owner ? (t(), s("div", lo, " Criado por " + C(o.meta.owner.name) + " em " + C(o.formatDateTime(o.meta.created_at, { hours: !0 })), 1)) : y("", !0)
|
|
1173
|
+
])), [
|
|
1174
|
+
[i, {
|
|
1175
|
+
click: () => {
|
|
1176
|
+
n.value = !1;
|
|
1177
|
+
}
|
|
1178
|
+
}]
|
|
1179
|
+
]) : y("", !0)
|
|
1180
|
+
])) : y("", !0),
|
|
1181
|
+
l.value ? (t(), s("img", {
|
|
1182
|
+
key: 1,
|
|
1183
|
+
src: l.value,
|
|
1184
|
+
class: Y(`
|
|
1185
|
+
picture__image
|
|
1186
|
+
${o.bordered && "picture__image--bordered"}
|
|
1187
|
+
${o.expandable && "picture__image--expandable"}
|
|
1188
|
+
`),
|
|
1189
|
+
style: he(`
|
|
1190
|
+
object-fit: ${o.objectFit || "cover"};
|
|
1191
|
+
width: ${o.width || "100%"};
|
|
1192
|
+
height: ${o.height || "100%"};
|
|
1193
|
+
`),
|
|
1194
|
+
onClick: u[1] || (u[1] = () => {
|
|
1195
|
+
o.expandable && (n.value = !0);
|
|
1196
|
+
})
|
|
1197
|
+
}, null, 14, so)) : o.$slots.fallback ? O(o.$slots, "fallback", { key: 2 }, void 0, !0) : o.$slots.default ? O(o.$slots, "default", { key: 3 }, void 0, !0) : (t(), s("svg", {
|
|
1198
|
+
key: 4,
|
|
1199
|
+
class: Y(["picture__background", `
|
|
1200
|
+
${o.bordered && "picture__image--bordered"}
|
|
1201
|
+
`]),
|
|
1202
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1203
|
+
viewBox: "0 0 200 200",
|
|
1204
|
+
preserveAspectRatio: "none",
|
|
1205
|
+
style: he(`
|
|
1206
|
+
object-fit: ${o.objectFit || "cover"};
|
|
1207
|
+
width: ${o.width || "100%"};
|
|
1208
|
+
height: ${o.height || "100%"};
|
|
1209
|
+
`)
|
|
1210
|
+
}, uo, 6)),
|
|
1211
|
+
o.$slots.caption ? (t(), s("figcaption", co, [
|
|
1212
|
+
O(o.$slots, "caption", {}, void 0, !0)
|
|
1213
|
+
])) : y("", !0)
|
|
1214
|
+
]);
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
});
|
|
1218
|
+
const He = /* @__PURE__ */ K(po, [["__scopeId", "data-v-153a2e0f"]]), _o = { class: "file" }, mo = { key: 0 }, fo = ["href"], vo = {
|
|
1219
|
+
key: 1,
|
|
1220
|
+
class: "file__actions"
|
|
1221
|
+
}, yo = ["accept"], bo = {
|
|
1222
|
+
key: 0,
|
|
1223
|
+
class: "file__buttons"
|
|
1224
|
+
}, ho = {
|
|
1225
|
+
key: 1,
|
|
1226
|
+
class: "file__buttons"
|
|
1227
|
+
}, $o = /* @__PURE__ */ U({
|
|
1228
|
+
__name: "aeria-file",
|
|
1229
|
+
props: {
|
|
1230
|
+
modelValue: {},
|
|
1231
|
+
property: {},
|
|
1232
|
+
propertyName: {},
|
|
1233
|
+
parentPropertyName: {},
|
|
1234
|
+
parentCollection: {},
|
|
1235
|
+
readOnly: { type: Boolean },
|
|
1236
|
+
meta: {},
|
|
1237
|
+
content: {}
|
|
1238
|
+
},
|
|
1239
|
+
emits: ["update:content", "change", "update:modelValue"],
|
|
1240
|
+
setup(c, { emit: r }) {
|
|
1241
|
+
var f;
|
|
1242
|
+
const l = c, n = r, u = qe() ? Ie() : null, i = J(((f = l.modelValue) == null ? void 0 : f.file) || null), _ = H(() => {
|
|
1243
|
+
var $;
|
|
1244
|
+
return i.value ? URL.createObjectURL(i.value) : ($ = l.modelValue) == null ? void 0 : $.link;
|
|
1245
|
+
}), p = H(() => {
|
|
1246
|
+
var $, S, B;
|
|
1247
|
+
return /^image\//.test(($ = l.modelValue) == null ? void 0 : $.type) && !((S = i.value) != null && S.type) || /^image\//.test((B = i.value) == null ? void 0 : B.type);
|
|
1248
|
+
}), b = ($) => new Promise((S) => {
|
|
1249
|
+
const B = new FileReader();
|
|
1250
|
+
B.onload = () => S(B.result), B.readAsArrayBuffer($);
|
|
1251
|
+
}), d = () => {
|
|
1252
|
+
l.modelValue.tempId && n("update:modelValue", null), i.value = null;
|
|
1253
|
+
}, a = async ($) => {
|
|
1254
|
+
i.value = $.target.files[0];
|
|
1255
|
+
const S = i.value, B = await b(S);
|
|
1256
|
+
if (u) {
|
|
1257
|
+
const { data: { error: X, result: ee } } = await Et(`${kt}/${u.$id}/upload?name=${S.name}`, B, {
|
|
1258
|
+
params: {
|
|
1259
|
+
method: "POST",
|
|
1260
|
+
headers: {
|
|
1261
|
+
"content-type": S.type || "application/octet-stream",
|
|
1262
|
+
"x-stream-request": "1"
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
});
|
|
1266
|
+
if (X)
|
|
1267
|
+
return;
|
|
1268
|
+
n("update:modelValue", {
|
|
1269
|
+
tempId: ee.tempId,
|
|
1270
|
+
file: S
|
|
1271
|
+
});
|
|
1272
|
+
} else
|
|
1273
|
+
n("update:modelValue", S);
|
|
1274
|
+
n("update:content", B), n("change", B);
|
|
1275
|
+
}, w = async () => {
|
|
1276
|
+
n("update:modelValue", null);
|
|
1277
|
+
};
|
|
1278
|
+
return ($, S) => {
|
|
1279
|
+
var B, X, ee, h, W, ne;
|
|
1280
|
+
return t(), s("div", _o, [
|
|
1281
|
+
i.value || (B = $.modelValue) != null && B._id ? (t(), s("div", mo, [
|
|
1282
|
+
p.value ? (t(), k(He, {
|
|
1283
|
+
key: 0,
|
|
1284
|
+
modelValue: _.value,
|
|
1285
|
+
"onUpdate:modelValue": S[0] || (S[0] = (T) => _.value = T),
|
|
1286
|
+
alt: "Image preview",
|
|
1287
|
+
expandable: $.readOnly,
|
|
1288
|
+
class: Y(`
|
|
1289
|
+
file__image
|
|
1290
|
+
${!e(u) || ((X = $.modelValue) == null ? void 0 : X._id) || "file__image--unsent"}
|
|
1291
|
+
`)
|
|
1292
|
+
}, null, 8, ["modelValue", "expandable", "class"])) : y("", !0),
|
|
1293
|
+
(ee = $.modelValue) != null && ee._id ? (t(), s("a", {
|
|
1294
|
+
key: 1,
|
|
1295
|
+
href: $.modelValue.download_link
|
|
1296
|
+
}, C($.modelValue.name), 9, fo)) : y("", !0)
|
|
1297
|
+
])) : y("", !0),
|
|
1298
|
+
$.readOnly ? y("", !0) : (t(), s("div", vo, [
|
|
1299
|
+
A("input", {
|
|
1300
|
+
ref: "file",
|
|
1301
|
+
type: "file",
|
|
1302
|
+
accept: (W = (h = $.property) == null ? void 0 : h.accept) == null ? void 0 : W.join(","),
|
|
1303
|
+
onChange: a
|
|
1304
|
+
}, null, 40, yo),
|
|
1305
|
+
i.value ? (t(), s("div", bo, [
|
|
1306
|
+
q(re, {
|
|
1307
|
+
small: "",
|
|
1308
|
+
onClick: ze(d, ["prevent"])
|
|
1309
|
+
}, {
|
|
1310
|
+
default: v(() => [
|
|
1311
|
+
Q(C(e(R)("action.clear", { capitalize: !0 })), 1)
|
|
1312
|
+
]),
|
|
1313
|
+
_: 1
|
|
1314
|
+
})
|
|
1315
|
+
])) : (ne = $.modelValue) != null && ne._id ? (t(), s("div", ho, [
|
|
1316
|
+
q(re, {
|
|
1317
|
+
small: "",
|
|
1318
|
+
onClick: ze(w, ["prevent"])
|
|
1319
|
+
}, {
|
|
1320
|
+
default: v(() => [
|
|
1321
|
+
Q(C(e(R)("action.remove", { capitalize: !0 })), 1)
|
|
1322
|
+
]),
|
|
1323
|
+
_: 1
|
|
1324
|
+
})
|
|
1325
|
+
])) : y("", !0)
|
|
1326
|
+
]))
|
|
1327
|
+
]);
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1331
|
+
const go = /* @__PURE__ */ K($o, [["__scopeId", "data-v-e6cdde77"]]), ko = { class: "container" }, Vo = {
|
|
1332
|
+
key: 1,
|
|
1333
|
+
class: "container__footer"
|
|
1334
|
+
}, Co = /* @__PURE__ */ U({
|
|
1335
|
+
__name: "aeria-search-container",
|
|
1336
|
+
props: {
|
|
1337
|
+
observeScroll: { type: Boolean }
|
|
1338
|
+
},
|
|
1339
|
+
emits: ["endReached"],
|
|
1340
|
+
setup(c, { emit: r }) {
|
|
1341
|
+
const l = c, n = r, o = J(null), u = l.observeScroll ? Ne(o, {
|
|
1342
|
+
antecipate: 100
|
|
1343
|
+
}).reachedEnd : null;
|
|
1344
|
+
return u !== null && ue(u, (i) => {
|
|
1345
|
+
i && n("endReached", i);
|
|
1346
|
+
}), (i, _) => (t(), s("div", ko, [
|
|
1347
|
+
i.$slots.default ? (t(), s("div", {
|
|
1348
|
+
key: 0,
|
|
1349
|
+
ref_key: "containerEl",
|
|
1350
|
+
ref: o,
|
|
1351
|
+
class: "container__content"
|
|
1352
|
+
}, [
|
|
1353
|
+
O(i.$slots, "default", {}, void 0, !0)
|
|
1354
|
+
], 512)) : y("", !0),
|
|
1355
|
+
i.$slots.footer ? (t(), s("div", Vo, [
|
|
1356
|
+
O(i.$slots, "footer", {}, void 0, !0)
|
|
1357
|
+
])) : y("", !0)
|
|
1358
|
+
]));
|
|
1359
|
+
}
|
|
1360
|
+
});
|
|
1361
|
+
const ft = /* @__PURE__ */ K(Co, [["__scopeId", "data-v-c86e2d2a"]]), Oo = { class: "item__values" }, Io = /* @__PURE__ */ U({
|
|
1362
|
+
__name: "aeria-search-item",
|
|
1363
|
+
props: {
|
|
1364
|
+
item: {},
|
|
1365
|
+
indexes: {},
|
|
1366
|
+
modelValue: {},
|
|
1367
|
+
property: {},
|
|
1368
|
+
readOnly: { type: Boolean }
|
|
1369
|
+
},
|
|
1370
|
+
emits: ["update:modelValue", "change"],
|
|
1371
|
+
setup(c, { emit: r }) {
|
|
1372
|
+
const l = Ae(), n = c, o = r, u = n.property, i = me(u), _ = Ie(), p = H(() => Array.isArray(n.modelValue) ? Array.isArray(n.modelValue) && Object.values(n.modelValue).some(({ _id: w }) => n.item._id === w) : n.modelValue && n.modelValue._id === n.item._id), b = () => {
|
|
1373
|
+
if (p.value)
|
|
1374
|
+
return;
|
|
1375
|
+
const w = ($) => $.filter((S) => !!(S != null && S._id)), f = "items" in u ? w(Array.isArray(n.modelValue) ? n.modelValue : [n.modelValue]) : n.modelValue;
|
|
1376
|
+
Array.isArray(f) ? o("update:modelValue", f.concat([n.item])) : o("update:modelValue", n.item), o("change", n.item);
|
|
1377
|
+
}, d = async (w) => {
|
|
1378
|
+
if (i.purge && (w != null && w.purge)) {
|
|
1379
|
+
const { _id: $ } = n.item;
|
|
1380
|
+
await _.$actions.remove({
|
|
1381
|
+
filters: {
|
|
1382
|
+
_id: $
|
|
1383
|
+
}
|
|
1384
|
+
});
|
|
1385
|
+
}
|
|
1386
|
+
const f = () => {
|
|
1387
|
+
const $ = [...n.modelValue], S = $.findIndex((B) => B._id === n.item._id);
|
|
1388
|
+
return $.splice(S, 1), $;
|
|
1389
|
+
};
|
|
1390
|
+
o("update:modelValue", "items" in u ? f() : null);
|
|
1391
|
+
}, a = () => {
|
|
1392
|
+
if (n.readOnly) {
|
|
1393
|
+
l.push({
|
|
1394
|
+
path: `/dashboard/c/${i.$ref}/${n.item._id}`
|
|
1395
|
+
});
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
return p.value ? d() : b();
|
|
1399
|
+
};
|
|
1400
|
+
return (w, f) => {
|
|
1401
|
+
const $ = oe("clickable");
|
|
1402
|
+
return N((t(), s("div", {
|
|
1403
|
+
class: Y({
|
|
1404
|
+
item: !0,
|
|
1405
|
+
"item--selected": p.value
|
|
1406
|
+
}),
|
|
1407
|
+
onClick: a
|
|
1408
|
+
}, [
|
|
1409
|
+
O(w.$slots, "default", {}, void 0, !0),
|
|
1410
|
+
A("div", Oo, [
|
|
1411
|
+
(t(!0), s(P, null, D(w.indexes, (S, B) => (t(), s("div", {
|
|
1412
|
+
key: `index-${w.item._id}-${B}`,
|
|
1413
|
+
class: "item__value"
|
|
1414
|
+
}, C(w.item[S]), 1))), 128))
|
|
1415
|
+
]),
|
|
1416
|
+
w.readOnly ? (t(), k(Z, {
|
|
1417
|
+
key: 0,
|
|
1418
|
+
icon: "arrow-square-out",
|
|
1419
|
+
style: { "--icon-color": "var(--theme-brand-color-contrast)" }
|
|
1420
|
+
})) : y("", !0)
|
|
1421
|
+
], 2)), [
|
|
1422
|
+
[$]
|
|
1423
|
+
]);
|
|
1424
|
+
};
|
|
1425
|
+
}
|
|
1426
|
+
});
|
|
1427
|
+
const We = /* @__PURE__ */ K(Io, [["__scopeId", "data-v-e8413b98"]]), Ao = { class: "search__panel" }, Bo = { class: "search__input" }, wo = ["value"], So = { style: { flex: "1" } }, To = { key: 1 }, jo = { key: 0 }, Ro = { key: 1 }, Lo = { class: "search__summary" }, zo = {
|
|
1428
|
+
key: 1,
|
|
1429
|
+
class: "search"
|
|
1430
|
+
}, Mo = { key: 0 }, Ee = 10, qo = /* @__PURE__ */ U({
|
|
1431
|
+
__name: "aeria-search",
|
|
1432
|
+
props: {
|
|
1433
|
+
modelValue: {},
|
|
1434
|
+
parentPropertyName: {},
|
|
1435
|
+
parentCollection: {},
|
|
1436
|
+
readOnly: { type: Boolean },
|
|
1437
|
+
property: {},
|
|
1438
|
+
propertyName: {},
|
|
1439
|
+
selectOnly: { type: Boolean },
|
|
1440
|
+
panel: { default: void 0 }
|
|
1441
|
+
},
|
|
1442
|
+
emits: ["update:modelValue", "change", "update:panel"],
|
|
1443
|
+
setup(c, { emit: r }) {
|
|
1444
|
+
const l = c, n = me(l.property), o = l.panel !== void 0 ? H(() => l.panel) : J(!1), u = r, i = ie(me(l.property).$ref), _ = qe(), p = _ ? Ie() : null, b = n.indexes;
|
|
1445
|
+
ye(Fe, me(l.property).$ref), ye("innerInputLabel", !0), ye("omitInputLabels", !0);
|
|
1446
|
+
const d = J(l.modelValue), a = J({
|
|
1447
|
+
data: [],
|
|
1448
|
+
pagination: {}
|
|
1449
|
+
}), w = H(() => a.value.data), f = H(() => a.value.pagination), $ = J(0), S = J(b[0]), B = J(!1), X = J({}), ee = () => {
|
|
1450
|
+
const L = {};
|
|
1451
|
+
if (_) {
|
|
1452
|
+
const F = e(_);
|
|
1453
|
+
L[F] = p;
|
|
1454
|
+
}
|
|
1455
|
+
return n.constraints ? zt(n.constraints, L) : {};
|
|
1456
|
+
}, h = () => {
|
|
1457
|
+
w.value.length < f.value.recordsTotal && ($.value += 1, ne());
|
|
1458
|
+
}, W = async () => {
|
|
1459
|
+
if (Object.values(X.value).every((F) => !(String(F).length > 0)))
|
|
1460
|
+
return i.$actions.custom("getAll", {
|
|
1461
|
+
limit: Ee,
|
|
1462
|
+
offset: $.value * Ee,
|
|
1463
|
+
filters: ee()
|
|
1464
|
+
});
|
|
1465
|
+
const L = b.filter((F) => {
|
|
1466
|
+
var m;
|
|
1467
|
+
return ((m = X.value[F]) == null ? void 0 : m.length) > 0;
|
|
1468
|
+
}).map((F) => ({
|
|
1469
|
+
[F]: {
|
|
1470
|
+
$regex: X.value[F].trim().replace("(", "\\(").replace(")", "\\)"),
|
|
1471
|
+
$options: "i"
|
|
1472
|
+
}
|
|
1473
|
+
}));
|
|
1474
|
+
return i.$actions.custom("getAll", {
|
|
1475
|
+
limit: Ee,
|
|
1476
|
+
offset: $.value * Ee,
|
|
1477
|
+
filters: {
|
|
1478
|
+
...ee(),
|
|
1479
|
+
...L.length > 0 && {
|
|
1480
|
+
$or: L
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
});
|
|
1484
|
+
}, ne = async () => {
|
|
1485
|
+
if (i.loading.getAll)
|
|
1486
|
+
return;
|
|
1487
|
+
const { error: L, result: F } = await W();
|
|
1488
|
+
if (L) {
|
|
1489
|
+
ie("meta").$actions.spawnToast({
|
|
1490
|
+
text: "Request failed",
|
|
1491
|
+
icon: "warning"
|
|
1492
|
+
});
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1495
|
+
a.value.pagination = F.pagination, $.value === 0 && a.value.data.splice(0), a.value.data.push(...F.data);
|
|
1496
|
+
}, [T] = Vt({
|
|
1497
|
+
delay: 800
|
|
1498
|
+
})(() => {
|
|
1499
|
+
$.value = 0, ne(), B.value = !1;
|
|
1500
|
+
}), g = () => {
|
|
1501
|
+
B.value = !0, T();
|
|
1502
|
+
}, j = () => {
|
|
1503
|
+
"effect" in o ? u("update:panel", !0) : o.value = !0, ne();
|
|
1504
|
+
}, ae = () => {
|
|
1505
|
+
$.value = 0, a.value.data.splice(0), "effect" in o ? u("update:panel", !1) : o.value = !1;
|
|
1506
|
+
}, le = H(() => !Object.values(X.value).some((L) => !!L));
|
|
1507
|
+
ue(le, (L, F) => {
|
|
1508
|
+
L && !F && ne();
|
|
1509
|
+
}), Ye(() => {
|
|
1510
|
+
l.selectOnly && ne();
|
|
1511
|
+
});
|
|
1512
|
+
const se = (L) => {
|
|
1513
|
+
d.value = L, l.selectOnly || u("update:modelValue", L);
|
|
1514
|
+
}, te = () => {
|
|
1515
|
+
ae(), u("update:modelValue", d.value);
|
|
1516
|
+
};
|
|
1517
|
+
return (L, F) => {
|
|
1518
|
+
const m = oe("clickable");
|
|
1519
|
+
return t(), s("div", null, [
|
|
1520
|
+
e(o) ? (t(), k(Xe, {
|
|
1521
|
+
key: 0,
|
|
1522
|
+
to: "main"
|
|
1523
|
+
}, [
|
|
1524
|
+
q(Be, {
|
|
1525
|
+
float: "",
|
|
1526
|
+
"close-hint": "",
|
|
1527
|
+
title: `${e(R)("action.select", { capitalize: !0 })} ${e(R)(L.propertyName)}`,
|
|
1528
|
+
"overlay-layer": 65,
|
|
1529
|
+
"model-value": e(o),
|
|
1530
|
+
style: { "--panel-max-width": "36rem" },
|
|
1531
|
+
onClose: ae,
|
|
1532
|
+
onOverlayClick: ae
|
|
1533
|
+
}, {
|
|
1534
|
+
footer: v(() => [
|
|
1535
|
+
q(re, {
|
|
1536
|
+
large: "",
|
|
1537
|
+
onClick: te
|
|
1538
|
+
}, {
|
|
1539
|
+
default: v(() => [
|
|
1540
|
+
Q(C(e(R)("action.save", { capitalize: !0 })), 1)
|
|
1541
|
+
]),
|
|
1542
|
+
_: 1
|
|
1543
|
+
})
|
|
1544
|
+
]),
|
|
1545
|
+
default: v(() => {
|
|
1546
|
+
var z, E;
|
|
1547
|
+
return [
|
|
1548
|
+
A("div", Ao, [
|
|
1549
|
+
A("div", Bo, [
|
|
1550
|
+
e(b).length > 1 ? (t(), k(De, {
|
|
1551
|
+
key: 0,
|
|
1552
|
+
modelValue: S.value,
|
|
1553
|
+
"onUpdate:modelValue": F[0] || (F[0] = (V) => S.value = V),
|
|
1554
|
+
style: { width: "auto" },
|
|
1555
|
+
onChange: F[1] || (F[1] = (V) => X.value = {})
|
|
1556
|
+
}, {
|
|
1557
|
+
default: v(() => [
|
|
1558
|
+
(t(!0), s(P, null, D(e(b), (V) => (t(), s("option", {
|
|
1559
|
+
key: `searchfield-${V}`,
|
|
1560
|
+
value: V
|
|
1561
|
+
}, C(e(R)(V)), 9, wo))), 128))
|
|
1562
|
+
]),
|
|
1563
|
+
_: 1
|
|
1564
|
+
}, 8, ["modelValue"])) : y("", !0),
|
|
1565
|
+
A("div", So, [
|
|
1566
|
+
(t(), k(ke, {
|
|
1567
|
+
key: `field-${S.value}`,
|
|
1568
|
+
modelValue: X.value[S.value],
|
|
1569
|
+
"onUpdate:modelValue": F[2] || (F[2] = (V) => X.value[S.value] = V),
|
|
1570
|
+
property: {
|
|
1571
|
+
...e(i).properties[S.value],
|
|
1572
|
+
inputType: "search"
|
|
1573
|
+
},
|
|
1574
|
+
onInput: g
|
|
1575
|
+
}, null, 8, ["modelValue", "property"]))
|
|
1576
|
+
])
|
|
1577
|
+
]),
|
|
1578
|
+
w.value.length ? (t(), k(ft, {
|
|
1579
|
+
key: 0,
|
|
1580
|
+
"observe-scroll": "",
|
|
1581
|
+
onEndReached: h
|
|
1582
|
+
}, {
|
|
1583
|
+
default: v(() => [
|
|
1584
|
+
(t(!0), s(P, null, D(w.value, (V) => (t(), k(We, G({ ref_for: !0 }, {
|
|
1585
|
+
item: V,
|
|
1586
|
+
indexes: e(b),
|
|
1587
|
+
property: L.property
|
|
1588
|
+
}, {
|
|
1589
|
+
key: `matching-${V._id}`,
|
|
1590
|
+
modelValue: d.value,
|
|
1591
|
+
"onUpdate:modelValue": F[3] || (F[3] = (I) => d.value = I)
|
|
1592
|
+
}), null, 16, ["modelValue"]))), 128))
|
|
1593
|
+
]),
|
|
1594
|
+
_: 1
|
|
1595
|
+
})) : (t(), s("div", To, [
|
|
1596
|
+
B.value ? (t(), s("div", jo, C(e(R)("searching", { capitalize: !0 })) + "... ", 1)) : !e(i).loading.getAll && Object.values(X.value).filter((V) => !!V).length > 0 && !("items" in L.property && ((z = L.modelValue) != null && z.length) || !Array.isArray(L.modelValue) && ((E = L.modelValue) != null && E._id)) ? (t(), s("div", Ro, C(e(R)("no_results", { capitalize: !0 })), 1)) : y("", !0)
|
|
1597
|
+
]))
|
|
1598
|
+
]),
|
|
1599
|
+
A("div", Lo, C(e(R)("showing", { capitalize: !0 })) + " " + C(w.value.length) + " " + C(e(R)("of")) + " " + C(f.value.recordsTotal), 1)
|
|
1600
|
+
];
|
|
1601
|
+
}),
|
|
1602
|
+
_: 1
|
|
1603
|
+
}, 8, ["title", "model-value"])
|
|
1604
|
+
])) : y("", !0),
|
|
1605
|
+
L.selectOnly ? y("", !0) : (t(), s("div", zo, [
|
|
1606
|
+
q(ft, null, ce({
|
|
1607
|
+
default: v(() => {
|
|
1608
|
+
var z;
|
|
1609
|
+
return [
|
|
1610
|
+
"items" in L.property ? (t(), s("div", Mo, [
|
|
1611
|
+
(t(!0), s(P, null, D(L.modelValue, (E) => (t(), k(We, G({ ref_for: !0 }, {
|
|
1612
|
+
item: E,
|
|
1613
|
+
indexes: e(b),
|
|
1614
|
+
property: L.property,
|
|
1615
|
+
readOnly: L.readOnly,
|
|
1616
|
+
modelValue: L.modelValue
|
|
1617
|
+
}, {
|
|
1618
|
+
key: `selected-${E._id}`,
|
|
1619
|
+
"onUpdate:modelValue": se
|
|
1620
|
+
}), null, 16))), 128))
|
|
1621
|
+
])) : (z = L.modelValue) != null && z._id ? (t(), k(We, G({ key: 1 }, {
|
|
1622
|
+
item: L.modelValue,
|
|
1623
|
+
indexes: e(b),
|
|
1624
|
+
property: e(n),
|
|
1625
|
+
readOnly: L.readOnly,
|
|
1626
|
+
modelValue: L.modelValue
|
|
1627
|
+
}, { "onUpdate:modelValue": se }), null, 16)) : y("", !0)
|
|
1628
|
+
];
|
|
1629
|
+
}),
|
|
1630
|
+
_: 2
|
|
1631
|
+
}, [
|
|
1632
|
+
L.readOnly ? void 0 : {
|
|
1633
|
+
name: "footer",
|
|
1634
|
+
fn: v(() => [
|
|
1635
|
+
N((t(), k(Z, {
|
|
1636
|
+
icon: "plus",
|
|
1637
|
+
onClick: j
|
|
1638
|
+
}, {
|
|
1639
|
+
default: v(() => [
|
|
1640
|
+
Q(C(e(R)("action.select", { capitalize: !0 })), 1)
|
|
1641
|
+
]),
|
|
1642
|
+
_: 1
|
|
1643
|
+
})), [
|
|
1644
|
+
[m]
|
|
1645
|
+
])
|
|
1646
|
+
]),
|
|
1647
|
+
key: "0"
|
|
1648
|
+
}
|
|
1649
|
+
]), 1024)
|
|
1650
|
+
]))
|
|
1651
|
+
]);
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
});
|
|
1655
|
+
const Fo = /* @__PURE__ */ K(qo, [["__scopeId", "data-v-15bbe202"]]), vt = (c, r) => {
|
|
1656
|
+
const l = "items" in c ? c.items : c, n = {
|
|
1657
|
+
options: Yn,
|
|
1658
|
+
select: De,
|
|
1659
|
+
switch: to,
|
|
1660
|
+
file: go,
|
|
1661
|
+
search: Fo,
|
|
1662
|
+
input: ke,
|
|
1663
|
+
form: Qe
|
|
1664
|
+
}, o = (() => {
|
|
1665
|
+
if ("type" in l) {
|
|
1666
|
+
if (l.type === "object")
|
|
1667
|
+
return "form";
|
|
1668
|
+
if (l.type === "boolean")
|
|
1669
|
+
return "switch";
|
|
1670
|
+
}
|
|
1671
|
+
if ("element" in c) {
|
|
1672
|
+
if (c.element === "checkbox" || c.element === "radio")
|
|
1673
|
+
return "options";
|
|
1674
|
+
if (c.element === "select")
|
|
1675
|
+
return "select";
|
|
1676
|
+
}
|
|
1677
|
+
const u = me(c);
|
|
1678
|
+
return u ? u.inline ? "form" : u.$ref === "file" ? "file" : "search" : "items" in c && c.uniqueItems ? "options" : "enum" in l ? "select" : "input";
|
|
1679
|
+
})();
|
|
1680
|
+
return r[o] ? r[o] : n[o];
|
|
1681
|
+
}, Uo = (c, r, l) => {
|
|
1682
|
+
c ?? (c = []);
|
|
1683
|
+
const n = "items" in r ? r.items : r;
|
|
1684
|
+
if ("$ref" in n) {
|
|
1685
|
+
const o = ie(n.$ref, l), u = Ce(o.$freshItem);
|
|
1686
|
+
return c.push(u);
|
|
1687
|
+
}
|
|
1688
|
+
return "properties" in n ? c.push(Mt(n)) : "type" in n && n.type === "boolean" ? c.push({}) : c.push(null);
|
|
1689
|
+
}, Eo = (c, r) => {
|
|
1690
|
+
c.splice(r, 1);
|
|
1691
|
+
}, Ho = {
|
|
1692
|
+
key: 0,
|
|
1693
|
+
class: "form__header"
|
|
1694
|
+
}, Do = { class: "form__fieldset" }, Qo = { key: 0 }, Go = ["innerHTML"], Wo = ["onInput"], Ko = { key: 4 }, Xo = { value: "true" }, Yo = { value: "false" }, Jo = {
|
|
1695
|
+
key: 5,
|
|
1696
|
+
style: { display: "grid", "row-gap": ".4rem" }
|
|
1697
|
+
}, Zo = { key: 0 }, Po = { class: "form__array" }, No = { style: { "flex-grow": "1" } }, xo = {
|
|
1698
|
+
key: 7,
|
|
1699
|
+
class: "form__validation-error"
|
|
1700
|
+
}, ea = { key: 0 }, ta = { key: 1 }, na = {
|
|
1701
|
+
key: 2,
|
|
1702
|
+
class: "form__footer"
|
|
1703
|
+
}, oa = /* @__PURE__ */ U({
|
|
1704
|
+
__name: "aeria-form",
|
|
1705
|
+
props: {
|
|
1706
|
+
modelValue: {},
|
|
1707
|
+
property: {},
|
|
1708
|
+
propertyName: {},
|
|
1709
|
+
parentPropertyName: {},
|
|
1710
|
+
parentCollection: {},
|
|
1711
|
+
readOnly: { type: Boolean },
|
|
1712
|
+
form: {},
|
|
1713
|
+
collection: {},
|
|
1714
|
+
searchOnly: { type: Boolean },
|
|
1715
|
+
layout: {},
|
|
1716
|
+
formLayout: {},
|
|
1717
|
+
required: {},
|
|
1718
|
+
formComponents: {},
|
|
1719
|
+
propertyComponents: {},
|
|
1720
|
+
omitFormHeader: { type: Boolean },
|
|
1721
|
+
omitInputLabels: { type: Boolean },
|
|
1722
|
+
innerInputLabel: { type: Boolean },
|
|
1723
|
+
validationErrors: { default: null },
|
|
1724
|
+
highlightRequired: { type: Boolean, default: !0 },
|
|
1725
|
+
focus: { type: Boolean },
|
|
1726
|
+
includeId: { type: Boolean },
|
|
1727
|
+
includeTimestamps: { type: Boolean }
|
|
1728
|
+
},
|
|
1729
|
+
emits: ["update:modelValue", "input", "change", "clipboardCopy"],
|
|
1730
|
+
setup(c, { emit: r }) {
|
|
1731
|
+
var F;
|
|
1732
|
+
const l = Pe(), n = c, o = r;
|
|
1733
|
+
$t(() => {
|
|
1734
|
+
n.modelValue || o("update:modelValue", n.property && "items" in n.property ? [] : {});
|
|
1735
|
+
});
|
|
1736
|
+
const u = n.property && me(n.property), i = u ? u.$ref : n.collection || qe(), _ = n.readOnly || ((F = n.property) == null ? void 0 : F.readOnly), p = i ? ie(e(i)) : null;
|
|
1737
|
+
!i && process.env.NODE_ENV !== "production" && console.warn(`aeria-form was used without providing storeId or specifying
|
|
1738
|
+
collection prop, some features may not work as intended`);
|
|
1739
|
+
const b = J(!1), d = H(() => {
|
|
1740
|
+
const m = (() => !n.form && n.property ? "type" in n.property && n.property.type === "object" ? "properties" in n.property ? n.property.properties : void 0 : p == null ? void 0 : p.properties : n.form)();
|
|
1741
|
+
if (!m)
|
|
1742
|
+
return;
|
|
1743
|
+
const z = {};
|
|
1744
|
+
if (n.includeId && (z._id = {
|
|
1745
|
+
type: "string",
|
|
1746
|
+
readOnly: !0
|
|
1747
|
+
}), n.includeTimestamps) {
|
|
1748
|
+
const E = {
|
|
1749
|
+
type: "string",
|
|
1750
|
+
format: "date-time",
|
|
1751
|
+
readOnly: !0,
|
|
1752
|
+
isTimestamp: !0
|
|
1753
|
+
};
|
|
1754
|
+
m.created_at || (z.created_at = E), m.created_at || (z.updated_at = E);
|
|
1755
|
+
}
|
|
1756
|
+
return Object.assign(z, m), z;
|
|
1757
|
+
}), a = H(() => n.layout || (p == null ? void 0 : p.description.formLayout)), w = (m) => {
|
|
1758
|
+
const z = _e(m, n[m]);
|
|
1759
|
+
return n[m] && ye(m, n[m]), z;
|
|
1760
|
+
}, f = H(() => n.validationErrors !== null ? n.validationErrors : p == null ? void 0 : p.validationErrors), $ = w("formComponents") || {}, S = w("propertyComponents") || {}, B = w("omitFormHeader"), X = w("omitInputLabels"), ee = w("innerInputLabel");
|
|
1761
|
+
i && ye(Fe, i), ye("searchOnly", n.searchOnly);
|
|
1762
|
+
const h = (m) => d.value ? Object.entries(d.value).filter(([z, E]) => !E.noForm && m([
|
|
1763
|
+
z,
|
|
1764
|
+
E
|
|
1765
|
+
])) : null, W = (m, z) => {
|
|
1766
|
+
var V;
|
|
1767
|
+
if (n.searchOnly || !i || n.includeId && m === "_id" || n.includeTimestamps && z.isTimestamp)
|
|
1768
|
+
return !0;
|
|
1769
|
+
const E = n.property && "properties" in n.property ? n.property.form : (V = p == null ? void 0 : p.description) == null ? void 0 : V.form;
|
|
1770
|
+
return !E || E.includes(m);
|
|
1771
|
+
}, ne = h(([m, z]) => W(m, z)), T = Ue(), g = {}, j = (m, z) => {
|
|
1772
|
+
var M, fe, we, Se;
|
|
1773
|
+
const E = [], V = ((fe = (M = a.value) == null ? void 0 : M.fields) == null ? void 0 : fe[m]) || ((Se = (we = a.value) == null ? void 0 : we.fields) == null ? void 0 : Se.$default);
|
|
1774
|
+
if (!z)
|
|
1775
|
+
return;
|
|
1776
|
+
if (V != null && V.if && !n.searchOnly) {
|
|
1777
|
+
const Te = Ke(
|
|
1778
|
+
n.modelValue,
|
|
1779
|
+
V.if
|
|
1780
|
+
);
|
|
1781
|
+
Te.satisfied || (g[m] && (p ? n.modelValue[m] = typeof p.$freshItem[m] == "object" ? Ce(p.$freshItem[m]) : p.$freshItem[m] : n.modelValue[m] = [
|
|
1782
|
+
void 0,
|
|
1783
|
+
null
|
|
1784
|
+
].includes(n.modelValue[m]) ? null : n.modelValue[m].constructor()), E.push("display: none;")), g[m] = Te.satisfied;
|
|
1785
|
+
}
|
|
1786
|
+
const I = T.value.md && (V == null ? void 0 : V.span) || 6;
|
|
1787
|
+
return E.push(`
|
|
1788
|
+
--field-span: ${I};
|
|
1789
|
+
grid-column: span var(--field-span) / span var(--field-span);
|
|
1790
|
+
`), V && (V.verticalSpacing && E.push(`
|
|
1791
|
+
--vertical-spacing: ${V.verticalSpacing};
|
|
1792
|
+
padding: var(--vertical-spacing) 0;
|
|
1793
|
+
`), V.separator && E.push(`
|
|
1794
|
+
border-top: 1px solid var(--theme-border-color);
|
|
1795
|
+
border-width: 1px 0 1px 0;
|
|
1796
|
+
padding: 1rem 0;
|
|
1797
|
+
margin: 1rem 0;
|
|
1798
|
+
`)), E.join("");
|
|
1799
|
+
}, ae = (m) => m === null || m instanceof Object && !Object.keys(m).length, le = H(() => n.required ? n.required : n.property && "required" in n.property ? n.property.required : p == null ? void 0 : p.description.required), se = H(() => n.form ? Ht(
|
|
1800
|
+
n.modelValue,
|
|
1801
|
+
n.form,
|
|
1802
|
+
le.value,
|
|
1803
|
+
p == null ? void 0 : p.description
|
|
1804
|
+
) : !0), te = (m, z) => {
|
|
1805
|
+
var E;
|
|
1806
|
+
return (E = f.value) != null && E[m] && (typeof f.value[m].index != "number" || f.value[m].index === z) ? f.value[m].errors : null;
|
|
1807
|
+
}, L = (m) => {
|
|
1808
|
+
if (!(_ || m.readOnly) && !n.parentPropertyName && !n.parentCollection && !b.value)
|
|
1809
|
+
return b.value = !0, !0;
|
|
1810
|
+
};
|
|
1811
|
+
return (m, z) => {
|
|
1812
|
+
const E = oe("clickable"), V = oe("focus");
|
|
1813
|
+
return t(), s("form", {
|
|
1814
|
+
class: "form",
|
|
1815
|
+
style: he(`row-gap: ${e(B) ? ".8rem" : "var(--form-internal-gap, 1.6rem);"};`)
|
|
1816
|
+
}, [
|
|
1817
|
+
m.$slots.header && !e(B) ? (t(), s("header", Ho, [
|
|
1818
|
+
O(m.$slots, "header", {}, void 0, !0)
|
|
1819
|
+
])) : y("", !0),
|
|
1820
|
+
O(m.$slots, "default", {}, void 0, !0),
|
|
1821
|
+
A("fieldset", Do, [
|
|
1822
|
+
(t(!0), s(P, null, D(e(ne), ([I, M]) => {
|
|
1823
|
+
var fe, we, Se, Te, xe, et, tt, nt, ot, at, lt, st, it;
|
|
1824
|
+
return t(), s("div", {
|
|
1825
|
+
key: `field-${I}`,
|
|
1826
|
+
style: he(j(I, M)),
|
|
1827
|
+
class: "form__field"
|
|
1828
|
+
}, [
|
|
1829
|
+
(!("type" in M) || M.type !== "boolean" || m.searchOnly) && !M.noLabel && !e(X) && !e(ee) ? (t(), s("label", Qo, [
|
|
1830
|
+
A("div", {
|
|
1831
|
+
class: Y({
|
|
1832
|
+
"form__field-label": !0,
|
|
1833
|
+
"form__field-label--section": "items" in M ? "properties" in M.items : "properties" in M,
|
|
1834
|
+
"form__field-required-hint": m.highlightRequired && !e(_) && !m.searchOnly && (!le.value || e(qt)(I, le.value, m.modelValue))
|
|
1835
|
+
})
|
|
1836
|
+
}, C(M.description || e(R)(I)), 3),
|
|
1837
|
+
M.hint ? (t(), s("div", {
|
|
1838
|
+
key: 0,
|
|
1839
|
+
innerHTML: M.hint
|
|
1840
|
+
}, null, 8, Go)) : y("", !0)
|
|
1841
|
+
])) : y("", !0),
|
|
1842
|
+
m.$slots[`field-${I}`] ? O(m.$slots, `field-${I}`, G({
|
|
1843
|
+
key: 1,
|
|
1844
|
+
ref_for: !0
|
|
1845
|
+
}, {
|
|
1846
|
+
readOnly: e(_),
|
|
1847
|
+
property: M,
|
|
1848
|
+
propertyName: I,
|
|
1849
|
+
modelValue: m.modelValue
|
|
1850
|
+
}), void 0, !0) : (Se = (we = (fe = m.layout) == null ? void 0 : fe.fields) == null ? void 0 : we[I]) != null && Se.component && e(S)[m.layout.fields[I].component.name] ? (t(), k(be(e(S)[m.layout.fields[I].component.name]), G({
|
|
1851
|
+
key: 2,
|
|
1852
|
+
modelValue: m.modelValue[I],
|
|
1853
|
+
"onUpdate:modelValue": (x) => m.modelValue[I] = x,
|
|
1854
|
+
ref_for: !0
|
|
1855
|
+
}, {
|
|
1856
|
+
readOnly: e(_),
|
|
1857
|
+
property: M,
|
|
1858
|
+
propertyName: I,
|
|
1859
|
+
...m.layout.fields[I].component.props || {}
|
|
1860
|
+
}, {
|
|
1861
|
+
onInput: (x) => o("input", I),
|
|
1862
|
+
onChange: z[0] || (z[0] = (x) => o("change", x))
|
|
1863
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])) : "format" in M && ["date", "date-time"].includes(M.format) && m.searchOnly ? (t(), s("div", {
|
|
1864
|
+
key: 3,
|
|
1865
|
+
style: { display: "grid", "grid-template-columns": "repeat(2, 1fr)", "column-gap": "1rem" },
|
|
1866
|
+
onInput: (x) => o("input", I),
|
|
1867
|
+
onChange: z[1] || (z[1] = (x) => o("change", x))
|
|
1868
|
+
}, [
|
|
1869
|
+
q(ke, G({
|
|
1870
|
+
modelValue: m.modelValue[I].$gte,
|
|
1871
|
+
"onUpdate:modelValue": (x) => m.modelValue[I].$gte = x,
|
|
1872
|
+
ref_for: !0
|
|
1873
|
+
}, {
|
|
1874
|
+
property: M,
|
|
1875
|
+
propertyName: I
|
|
1876
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue"]),
|
|
1877
|
+
q(ke, G({
|
|
1878
|
+
modelValue: m.modelValue[I].$lte,
|
|
1879
|
+
"onUpdate:modelValue": (x) => m.modelValue[I].$lte = x,
|
|
1880
|
+
ref_for: !0
|
|
1881
|
+
}, {
|
|
1882
|
+
property: M,
|
|
1883
|
+
propertyName: I
|
|
1884
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue"])
|
|
1885
|
+
], 40, Wo)) : "type" in M && M.type === "boolean" && m.searchOnly ? (t(), s("div", Ko, [
|
|
1886
|
+
q(De, G({ ref_for: !0 }, {
|
|
1887
|
+
property: M,
|
|
1888
|
+
propertyName: I
|
|
1889
|
+
}, {
|
|
1890
|
+
"boolean-ref": "",
|
|
1891
|
+
"model-value": m.modelValue[I],
|
|
1892
|
+
onChange: z[2] || (z[2] = (x) => o("change", x)),
|
|
1893
|
+
"onUpdate:modelValue": (x) => {
|
|
1894
|
+
m.modelValue[I] = x == "true" ? !0 : x == "false" ? !1 : null;
|
|
1895
|
+
}
|
|
1896
|
+
}), {
|
|
1897
|
+
default: v(() => [
|
|
1898
|
+
A("option", Xo, C(e(R)("yes")), 1),
|
|
1899
|
+
A("option", Yo, C(e(R)("no")), 1)
|
|
1900
|
+
]),
|
|
1901
|
+
_: 2
|
|
1902
|
+
}, 1040, ["model-value", "onUpdate:modelValue"])
|
|
1903
|
+
])) : m.modelValue && "items" in M && !M.uniqueItems && (!("$ref" in M.items) || M.items.inline || M.items.$ref === "file") ? (t(), s("div", Jo, [
|
|
1904
|
+
e(_) ? y("", !0) : (t(), s("div", Zo, [
|
|
1905
|
+
q(re, {
|
|
1906
|
+
small: "",
|
|
1907
|
+
variant: "alt",
|
|
1908
|
+
icon: "plus",
|
|
1909
|
+
disabled: !("inline" in M.items && M.items.inline) && (((Te = m.modelValue[I]) == null ? void 0 : Te.length) >= M.maxItems || ae((et = m.modelValue[I]) == null ? void 0 : et[((xe = m.modelValue[I]) == null ? void 0 : xe.length) - 1])),
|
|
1910
|
+
onClick: ze((x) => {
|
|
1911
|
+
m.modelValue[I] || (m.modelValue[I] = []), e(Uo)(m.modelValue[I], M, e(l));
|
|
1912
|
+
}, ["prevent"])
|
|
1913
|
+
}, {
|
|
1914
|
+
default: v(() => [
|
|
1915
|
+
Q(C(e(R)("action.add", { capitalize: !0 })), 1)
|
|
1916
|
+
]),
|
|
1917
|
+
_: 2
|
|
1918
|
+
}, 1032, ["disabled", "onClick"])
|
|
1919
|
+
])),
|
|
1920
|
+
A("div", Po, [
|
|
1921
|
+
(t(!0), s(P, null, D(m.modelValue[I], (x, je) => {
|
|
1922
|
+
var rt, ut, ct, dt, pt, _t;
|
|
1923
|
+
return t(), s("div", {
|
|
1924
|
+
key: `rep-${I}-${e(Dt)(x, je)}`,
|
|
1925
|
+
class: "form__array-item"
|
|
1926
|
+
}, [
|
|
1927
|
+
A("div", No, [
|
|
1928
|
+
(t(), k(be(e(vt)(M, e($))), G({
|
|
1929
|
+
modelValue: m.modelValue[I][je],
|
|
1930
|
+
"onUpdate:modelValue": (Re) => m.modelValue[I][je] = Re,
|
|
1931
|
+
ref_for: !0
|
|
1932
|
+
}, {
|
|
1933
|
+
readOnly: e(_),
|
|
1934
|
+
property: M.items,
|
|
1935
|
+
propertyName: I,
|
|
1936
|
+
parentCollection: e(i),
|
|
1937
|
+
parentPropertyName: m.parentPropertyName,
|
|
1938
|
+
columns: ((ct = (ut = (rt = m.layout) == null ? void 0 : rt.fields) == null ? void 0 : ut[I]) == null ? void 0 : ct.optionsColumns) || ((_t = (pt = (dt = m.layout) == null ? void 0 : dt.fields) == null ? void 0 : pt.$default) == null ? void 0 : _t.optionsColumns),
|
|
1939
|
+
validationErrors: te(I, je),
|
|
1940
|
+
...M.componentProps || {}
|
|
1941
|
+
}, {
|
|
1942
|
+
onInput: (Re) => o("input", I),
|
|
1943
|
+
onChange: z[3] || (z[3] = (Re) => o("change", Re))
|
|
1944
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"]))
|
|
1945
|
+
]),
|
|
1946
|
+
e(_) ? y("", !0) : N((t(), k(Z, {
|
|
1947
|
+
key: 0,
|
|
1948
|
+
reactive: "",
|
|
1949
|
+
icon: "trash",
|
|
1950
|
+
onClick: (Re) => e(Eo)(m.modelValue[I], je)
|
|
1951
|
+
}, null, 8, ["onClick"])), [
|
|
1952
|
+
[E]
|
|
1953
|
+
])
|
|
1954
|
+
]);
|
|
1955
|
+
}), 128))
|
|
1956
|
+
])
|
|
1957
|
+
])) : m.modelValue ? N((t(), k(be(e(vt)(M, e($))), G({
|
|
1958
|
+
key: 6,
|
|
1959
|
+
modelValue: m.modelValue[I],
|
|
1960
|
+
"onUpdate:modelValue": (x) => m.modelValue[I] = x,
|
|
1961
|
+
ref_for: !0
|
|
1962
|
+
}, {
|
|
1963
|
+
readOnly: e(_),
|
|
1964
|
+
property: M,
|
|
1965
|
+
propertyName: I,
|
|
1966
|
+
parentPropertyName: m.parentPropertyName,
|
|
1967
|
+
parentCollection: e(i),
|
|
1968
|
+
columns: ((ot = (nt = (tt = m.layout) == null ? void 0 : tt.fields) == null ? void 0 : nt[I]) == null ? void 0 : ot.optionsColumns) || ((st = (lt = (at = m.layout) == null ? void 0 : at.fields) == null ? void 0 : lt.$default) == null ? void 0 : st.optionsColumns),
|
|
1969
|
+
...M.componentProps || {},
|
|
1970
|
+
validationErrors: te(I)
|
|
1971
|
+
}, {
|
|
1972
|
+
onInput: (x) => o("input", I),
|
|
1973
|
+
onChange: z[4] || (z[4] = (x) => o("change", x)),
|
|
1974
|
+
onClipboardCopy: z[5] || (z[5] = (x) => o("clipboardCopy", x))
|
|
1975
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])), [
|
|
1976
|
+
[V, L(M)]
|
|
1977
|
+
]) : y("", !0),
|
|
1978
|
+
(it = f.value) != null && it[I] ? (t(), s("div", xo, [
|
|
1979
|
+
f.value[I].type ? (t(), s("span", ea, C(e(R)(`validation_error.${f.value[I].type}`)), 1)) : y("", !0),
|
|
1980
|
+
f.value[I].detail ? (t(), s("span", ta, C(e(R)(f.value[I].detail)), 1)) : y("", !0)
|
|
1981
|
+
])) : y("", !0)
|
|
1982
|
+
], 4);
|
|
1983
|
+
}), 128))
|
|
1984
|
+
]),
|
|
1985
|
+
m.$slots.after ? O(m.$slots, "after", { key: 1 }, void 0, !0) : y("", !0),
|
|
1986
|
+
m.$slots.footer ? (t(), s("div", na, [
|
|
1987
|
+
O(m.$slots, "footer", de(ge({
|
|
1988
|
+
isInsertReady: se.value
|
|
1989
|
+
})), void 0, !0)
|
|
1990
|
+
])) : y("", !0)
|
|
1991
|
+
], 4);
|
|
1992
|
+
};
|
|
1993
|
+
}
|
|
1994
|
+
});
|
|
1995
|
+
const Qe = /* @__PURE__ */ K(oa, [["__scopeId", "data-v-e02fe7fe"]]), aa = /* @__PURE__ */ U({
|
|
1996
|
+
__name: "aeria-filter-panel",
|
|
1997
|
+
emits: ["update:modelValue"],
|
|
1998
|
+
setup(c, { emit: r }) {
|
|
1999
|
+
const l = r, n = Ie(), o = Ae(), u = e(_e(Fe)), i = () => {
|
|
2000
|
+
n.pagination.offset = 0, n.$actions.filter(), l("update:modelValue", !1);
|
|
2001
|
+
const _ = Object.assign({
|
|
2002
|
+
query: {}
|
|
2003
|
+
}, o.currentRoute.value);
|
|
2004
|
+
for (const p of Object.keys(_.query))
|
|
2005
|
+
p.startsWith(`${u}.`) && delete _.query[p];
|
|
2006
|
+
o.currentRoute.value.query = {}, o.push(Me(_, {
|
|
2007
|
+
query: Qt(n)
|
|
2008
|
+
}));
|
|
2009
|
+
};
|
|
2010
|
+
return (_, p) => (t(), k(Be, {
|
|
2011
|
+
"close-hint": "",
|
|
2012
|
+
"fixed-right": "",
|
|
2013
|
+
title: _.t("filter_by", { capitalize: !0 }),
|
|
2014
|
+
onClose: p[2] || (p[2] = (b) => l("update:modelValue", !1)),
|
|
2015
|
+
onOverlayClick: p[3] || (p[3] = (b) => l("update:modelValue", !1))
|
|
2016
|
+
}, {
|
|
2017
|
+
footer: v(() => [
|
|
2018
|
+
e(n).filtersCount > 0 ? (t(), k(re, {
|
|
2019
|
+
key: 0,
|
|
2020
|
+
variant: "transparent",
|
|
2021
|
+
onClick: p[1] || (p[1] = (b) => {
|
|
2022
|
+
e(n).$actions.clearFilters(), i(), l("update:modelValue", !1);
|
|
2023
|
+
})
|
|
2024
|
+
}, {
|
|
2025
|
+
default: v(() => [
|
|
2026
|
+
Q(C(_.t("action.clear", { capitalize: !0 })) + " ", 1),
|
|
2027
|
+
q($e, null, {
|
|
2028
|
+
default: v(() => [
|
|
2029
|
+
Q(C(e(n).filtersCount), 1)
|
|
2030
|
+
]),
|
|
2031
|
+
_: 1
|
|
2032
|
+
})
|
|
2033
|
+
]),
|
|
2034
|
+
_: 1
|
|
2035
|
+
})) : y("", !0),
|
|
2036
|
+
q(re, {
|
|
2037
|
+
large: "",
|
|
2038
|
+
icon: "funnel",
|
|
2039
|
+
disabled: !e(n).hasActiveFilters,
|
|
2040
|
+
onClick: i
|
|
2041
|
+
}, {
|
|
2042
|
+
default: v(() => [
|
|
2043
|
+
Q(C(_.t("action.filter", { capitalize: !0 })), 1)
|
|
2044
|
+
]),
|
|
2045
|
+
_: 1
|
|
2046
|
+
}, 8, ["disabled"])
|
|
2047
|
+
]),
|
|
2048
|
+
default: v(() => [
|
|
2049
|
+
q(Qe, G({
|
|
2050
|
+
modelValue: e(n).filters,
|
|
2051
|
+
"onUpdate:modelValue": p[0] || (p[0] = (b) => e(n).filters = b)
|
|
2052
|
+
}, {
|
|
2053
|
+
searchOnly: !0,
|
|
2054
|
+
form: e(n).availableFilters,
|
|
2055
|
+
layout: e(n).description.formLayout || {}
|
|
2056
|
+
}, { focus: "" }), null, 16, ["modelValue"])
|
|
2057
|
+
]),
|
|
2058
|
+
_: 1
|
|
2059
|
+
}, 8, ["title"]));
|
|
2060
|
+
}
|
|
2061
|
+
}), la = /* @__PURE__ */ U({
|
|
2062
|
+
__name: "aeria-insert-panel",
|
|
2063
|
+
props: {
|
|
2064
|
+
collection: {},
|
|
2065
|
+
form: {},
|
|
2066
|
+
visible: { default: !0 },
|
|
2067
|
+
modelValue: {},
|
|
2068
|
+
readOnly: { type: Boolean },
|
|
2069
|
+
includeId: { type: Boolean },
|
|
2070
|
+
includeTimestamps: { type: Boolean }
|
|
2071
|
+
},
|
|
2072
|
+
emits: ["update:visible", "update:modelValue", "insert", "cancel"],
|
|
2073
|
+
setup(c, { emit: r }) {
|
|
2074
|
+
const l = c, n = r, o = ie("meta"), u = l.collection || o.view.collection, i = ie(u), _ = _e("individualActions", []);
|
|
2075
|
+
Ye(() => {
|
|
2076
|
+
l.modelValue && i.$actions.setItem(l.modelValue);
|
|
2077
|
+
});
|
|
2078
|
+
const p = H(() => l.form ? i.$actions.useProperties(l.form) : i.description.form ? i.$actions.useProperties(i.description.form) : i.properties), b = async () => {
|
|
2079
|
+
const { error: f, result: $ } = await i.$actions.deepInsert();
|
|
2080
|
+
f || (n("update:visible", !1), n("update:modelValue", $), n("insert", $), i.$actions.clearItem());
|
|
2081
|
+
}, { t: d } = Lt(), a = () => {
|
|
2082
|
+
o.$actions.ask({
|
|
2083
|
+
action: () => {
|
|
2084
|
+
i.$actions.clearItem(), i.validationErrors = {}, n("cancel");
|
|
2085
|
+
},
|
|
2086
|
+
body: d("prompt.close_panel")
|
|
2087
|
+
});
|
|
2088
|
+
}, w = () => o.$actions.spawnToast({
|
|
2089
|
+
icon: "info",
|
|
2090
|
+
text: d("copied_to_clipboard")
|
|
2091
|
+
});
|
|
2092
|
+
return ue(() => i.item._id, (f) => {
|
|
2093
|
+
f === null && n("update:visible", !1);
|
|
2094
|
+
}), (f, $) => {
|
|
2095
|
+
const S = oe("clickable");
|
|
2096
|
+
return t(), k(Be, {
|
|
2097
|
+
"model-value": f.visible,
|
|
2098
|
+
loading: e(i).loading.get,
|
|
2099
|
+
onOverlayClick: a
|
|
2100
|
+
}, ce({
|
|
2101
|
+
extra: v(() => [
|
|
2102
|
+
q(Oe, G({
|
|
2103
|
+
subject: e(i).item,
|
|
2104
|
+
actions: e(_).filter(({ action: B }) => B !== "spawnEdit"),
|
|
2105
|
+
overlayLayer: 60
|
|
2106
|
+
}, {
|
|
2107
|
+
onActionClick: $[2] || ($[2] = (B) => n("update:visible", !1))
|
|
2108
|
+
}), {
|
|
2109
|
+
default: v(({
|
|
2110
|
+
visible: B
|
|
2111
|
+
}) => [
|
|
2112
|
+
e(i).item._id ? N((t(), k(Z, {
|
|
2113
|
+
key: 0,
|
|
2114
|
+
reactive: "",
|
|
2115
|
+
active: B,
|
|
2116
|
+
icon: "dots-three"
|
|
2117
|
+
}, null, 8, ["active"])), [
|
|
2118
|
+
[S]
|
|
2119
|
+
]) : y("", !0)
|
|
2120
|
+
]),
|
|
2121
|
+
_: 1
|
|
2122
|
+
}, 16)
|
|
2123
|
+
]),
|
|
2124
|
+
default: v(() => [
|
|
2125
|
+
q(Qe, G({
|
|
2126
|
+
modelValue: e(i).item,
|
|
2127
|
+
"onUpdate:modelValue": $[0] || ($[0] = (B) => e(i).item = B)
|
|
2128
|
+
}, {
|
|
2129
|
+
collection: e(u),
|
|
2130
|
+
readOnly: f.readOnly,
|
|
2131
|
+
includeId: f.includeId,
|
|
2132
|
+
includeTimestamps: f.includeTimestamps,
|
|
2133
|
+
form: p.value,
|
|
2134
|
+
layout: e(i).description.formLayout || {}
|
|
2135
|
+
}, {
|
|
2136
|
+
focus: "",
|
|
2137
|
+
onClipboardCopy: w,
|
|
2138
|
+
onAdd: $[1] || ($[1] = (B) => B.preventDefault())
|
|
2139
|
+
}), ce({ _: 2 }, [
|
|
2140
|
+
D(Object.keys(f.$slots).filter((B) => B.startsWith("field-")), (B) => ({
|
|
2141
|
+
name: B,
|
|
2142
|
+
fn: v((X) => [
|
|
2143
|
+
O(f.$slots, B, de(ge(X)))
|
|
2144
|
+
])
|
|
2145
|
+
}))
|
|
2146
|
+
]), 1040, ["modelValue"])
|
|
2147
|
+
]),
|
|
2148
|
+
_: 2
|
|
2149
|
+
}, [
|
|
2150
|
+
f.$slots.header ? {
|
|
2151
|
+
name: "header",
|
|
2152
|
+
fn: v(() => [
|
|
2153
|
+
O(f.$slots, "header")
|
|
2154
|
+
]),
|
|
2155
|
+
key: "0"
|
|
2156
|
+
} : void 0,
|
|
2157
|
+
f.readOnly ? void 0 : {
|
|
2158
|
+
name: "footer",
|
|
2159
|
+
fn: v(() => [
|
|
2160
|
+
q(re, {
|
|
2161
|
+
variant: "transparent",
|
|
2162
|
+
onClick: a
|
|
2163
|
+
}, {
|
|
2164
|
+
default: v(() => [
|
|
2165
|
+
Q(C(e(d)("action.cancel", { capitalize: !0 })), 1)
|
|
2166
|
+
]),
|
|
2167
|
+
_: 1
|
|
2168
|
+
}),
|
|
2169
|
+
q(re, {
|
|
2170
|
+
large: "",
|
|
2171
|
+
disabled: !e(i).isInsertReady || e(i).loading.get,
|
|
2172
|
+
loading: e(i).loading.insert,
|
|
2173
|
+
onClick: b
|
|
2174
|
+
}, {
|
|
2175
|
+
default: v(() => [
|
|
2176
|
+
Q(C(e(d)("action.insert", { capitalize: !0 })), 1)
|
|
2177
|
+
]),
|
|
2178
|
+
_: 1
|
|
2179
|
+
}, 8, ["disabled", "loading"])
|
|
2180
|
+
]),
|
|
2181
|
+
key: "1"
|
|
2182
|
+
}
|
|
2183
|
+
]), 1032, ["model-value", "loading"]);
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
}), Ot = (c, r) => {
|
|
2187
|
+
if (r) {
|
|
2188
|
+
if (!c) {
|
|
2189
|
+
r.filtersPreset = {}, r.preferredTableProperties = [], r.pagination.offset = 0;
|
|
2190
|
+
return;
|
|
2191
|
+
}
|
|
2192
|
+
r.filtersPreset = c.filters || {}, r.preferredTableProperties = c.table ? Array.from(c.table) : [], r.pagination.offset = 0;
|
|
2193
|
+
}
|
|
2194
|
+
}, sa = (c, r = {
|
|
2195
|
+
persistInQuery: !0
|
|
2196
|
+
}) => {
|
|
2197
|
+
const n = Ae().currentRoute;
|
|
2198
|
+
return ue(() => n.value.query.section, (o) => {
|
|
2199
|
+
if (c) {
|
|
2200
|
+
if (c.description.filtersPresets) {
|
|
2201
|
+
const u = o || Object.keys(c.description.filtersPresets)[0];
|
|
2202
|
+
Ot(c.description.filtersPresets[u], c);
|
|
2203
|
+
}
|
|
2204
|
+
if (r.persistInQuery) {
|
|
2205
|
+
const u = n.value.query;
|
|
2206
|
+
u.offset && (c.pagination.offset = +u.offset), u.limit && (c.pagination.limit = +u.limit), u.search && (c.textQuery = u.search, c.filters.$text = {
|
|
2207
|
+
$search: `"${u.search}"`,
|
|
2208
|
+
$caseSensitive: !1
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
}, {
|
|
2213
|
+
immediate: !0
|
|
2214
|
+
});
|
|
2215
|
+
}, ia = {
|
|
2216
|
+
key: 0,
|
|
2217
|
+
class: "table aeria-surface"
|
|
2218
|
+
}, ra = { key: 0 }, ua = { key: 1 }, ca = { key: 0 }, da = ["checked"], pa = {
|
|
2219
|
+
key: 1,
|
|
2220
|
+
style: { "text-align": "right" }
|
|
2221
|
+
}, _a = { key: 2 }, ma = { key: 3 }, fa = ["onClick"], va = { key: 0 }, ya = ["value"], ba = { class: "table__cell-mobile-label" }, ha = {
|
|
2222
|
+
key: 0,
|
|
2223
|
+
class: "table__cell-container"
|
|
2224
|
+
}, $a = {
|
|
2225
|
+
key: 1,
|
|
2226
|
+
class: "table__cell-container"
|
|
2227
|
+
}, ga = { class: "table__cell-grid" }, ka = { key: 0 }, Va = { key: 1 }, Ca = { key: 0 }, Oa = ["href"], Ia = { key: 3 }, Aa = { key: 1 }, Ba = { key: 2 }, wa = { key: 0 }, Sa = { key: 1 }, Ta = { key: 2 }, ja = {
|
|
2228
|
+
key: 1,
|
|
2229
|
+
class: "no-print"
|
|
2230
|
+
}, Ra = { class: "table__cell-actions" }, La = {
|
|
2231
|
+
key: 2,
|
|
2232
|
+
class: "no-print table__mobile-actions"
|
|
2233
|
+
}, za = ["id"], Ma = { key: 1 }, qa = ["colspan"], Fa = { class: "table__empty" }, Ua = /* @__PURE__ */ U({
|
|
2234
|
+
__name: "aeria-table",
|
|
2235
|
+
props: {
|
|
2236
|
+
columns: {},
|
|
2237
|
+
rows: {},
|
|
2238
|
+
collection: {},
|
|
2239
|
+
checkbox: { type: Boolean },
|
|
2240
|
+
actions: {},
|
|
2241
|
+
layout: {}
|
|
2242
|
+
},
|
|
2243
|
+
emits: ["itemClick"],
|
|
2244
|
+
setup(c, { emit: r }) {
|
|
2245
|
+
const l = c, n = r, o = Ue(), u = l.collection || qe(), i = u ? ie(typeof u == "string" ? u : u.value) : null, _ = H({
|
|
2246
|
+
get: () => i == null ? void 0 : i.selected,
|
|
2247
|
+
set: (f) => i == null ? void 0 : i.$actions.selectManyItems(f, !0)
|
|
2248
|
+
}), p = H(() => l.columns ? Object.keys(l.columns).length + Number(l.checkbox) : 0), b = (f, $) => f != null && f.button ? typeof f.button == "object" ? Ke($, f.button).satisfied : f.button : !1, d = (f) => {
|
|
2249
|
+
var $;
|
|
2250
|
+
return !o.value.xl || !(($ = l.layout) != null && $.actions) || !l.actions ? [] : l.actions.filter((S) => {
|
|
2251
|
+
const B = l.layout.actions[S.action];
|
|
2252
|
+
return b(B, f);
|
|
2253
|
+
});
|
|
2254
|
+
}, a = (f) => {
|
|
2255
|
+
var $;
|
|
2256
|
+
return l.actions ? !o.value.xl || !(($ = l.layout) != null && $.actions) ? l.actions : l.actions.filter((S) => {
|
|
2257
|
+
const B = l.layout.actions[S.action];
|
|
2258
|
+
if (S.roles) {
|
|
2259
|
+
const X = ie("user");
|
|
2260
|
+
if (!gt(S.roles, X.currentUser.roles))
|
|
2261
|
+
return !1;
|
|
2262
|
+
}
|
|
2263
|
+
return !b(B, f);
|
|
2264
|
+
}) : [];
|
|
2265
|
+
}, w = (f, $) => {
|
|
2266
|
+
var X, ee;
|
|
2267
|
+
const S = [], B = (ee = (X = l.layout) == null ? void 0 : X.actions) == null ? void 0 : ee[$.action];
|
|
2268
|
+
return B != null && B.if && (Ke(
|
|
2269
|
+
f,
|
|
2270
|
+
B.if
|
|
2271
|
+
).satisfied || S.push("display: none;")), S.join("");
|
|
2272
|
+
};
|
|
2273
|
+
return (f, $) => {
|
|
2274
|
+
var B, X, ee;
|
|
2275
|
+
const S = oe("clickable");
|
|
2276
|
+
return p.value > 0 || f.$slots.thead ? (t(), s("table", ia, [
|
|
2277
|
+
f.$slots.thead ? (t(), s("thead", ra, [
|
|
2278
|
+
O(f.$slots, "thead", {}, void 0, !0)
|
|
2279
|
+
])) : (t(), s("thead", ua, [
|
|
2280
|
+
A("tr", null, [
|
|
2281
|
+
f.checkbox && e(i) && e(o).md ? (t(), s("th", ca, [
|
|
2282
|
+
A("input", {
|
|
2283
|
+
type: "checkbox",
|
|
2284
|
+
checked: e(i).selected.length > 0 && e(i).selected.length === e(i).itemsCount,
|
|
2285
|
+
onChange: $[0] || ($[0] = (h) => e(i).$actions.selectAllItems(h.target.checked))
|
|
2286
|
+
}, null, 40, da)
|
|
2287
|
+
])) : y("", !0),
|
|
2288
|
+
(t(!0), s(P, null, D(Object.entries(f.columns), ([h, W], ne) => (t(), s("th", {
|
|
2289
|
+
key: `header-${ne}`,
|
|
2290
|
+
class: "table__header"
|
|
2291
|
+
}, C(W.description || e(R)(h)), 1))), 128)),
|
|
2292
|
+
(B = f.actions) != null && B.length ? (t(), s("th", pa)) : y("", !0)
|
|
2293
|
+
])
|
|
2294
|
+
])),
|
|
2295
|
+
f.$slots.tbody ? (t(), s("tbody", _a, [
|
|
2296
|
+
O(f.$slots, "tbody", {}, void 0, !0)
|
|
2297
|
+
])) : (t(), s("tbody", ma, [
|
|
2298
|
+
(t(!0), s(P, null, D(f.rows, (h) => {
|
|
2299
|
+
var W, ne;
|
|
2300
|
+
return t(), s("tr", {
|
|
2301
|
+
key: h._id,
|
|
2302
|
+
onClick: (T) => n("itemClick", h)
|
|
2303
|
+
}, [
|
|
2304
|
+
e(i) && f.checkbox && e(o).md ? (t(), s("td", va, [
|
|
2305
|
+
N(A("input", {
|
|
2306
|
+
"onUpdate:modelValue": $[1] || ($[1] = (T) => _.value = T),
|
|
2307
|
+
type: "checkbox",
|
|
2308
|
+
value: h._id
|
|
2309
|
+
}, null, 8, ya), [
|
|
2310
|
+
[Bt, _.value]
|
|
2311
|
+
])
|
|
2312
|
+
])) : y("", !0),
|
|
2313
|
+
(t(!0), s(P, null, D(Object.entries(f.columns), ([T, g], j) => {
|
|
2314
|
+
var ae, le, se;
|
|
2315
|
+
return t(), s("td", {
|
|
2316
|
+
key: `column-${h._id}-${j}`
|
|
2317
|
+
}, [
|
|
2318
|
+
A("div", ba, C(g.description || e(R)(T)), 1),
|
|
2319
|
+
`row-${T}` in f.$slots ? (t(), s("div", ha, [
|
|
2320
|
+
O(f.$slots, `row-${T}`, G({ ref_for: !0 }, {
|
|
2321
|
+
store: e(i),
|
|
2322
|
+
column: T,
|
|
2323
|
+
property: g,
|
|
2324
|
+
row: h
|
|
2325
|
+
}), void 0, !0)
|
|
2326
|
+
])) : (t(), s("div", $a, [
|
|
2327
|
+
A("div", ga, [
|
|
2328
|
+
"type" in g && g.type === "boolean" ? (t(), s("div", ka, [
|
|
2329
|
+
h[T] ? (t(), k(Z, {
|
|
2330
|
+
key: 0,
|
|
2331
|
+
icon: "check",
|
|
2332
|
+
"icon-classes": "aeria-blueish"
|
|
2333
|
+
}, {
|
|
2334
|
+
default: v(() => [
|
|
2335
|
+
Q(C(e(R)("yes")), 1)
|
|
2336
|
+
]),
|
|
2337
|
+
_: 1
|
|
2338
|
+
})) : (t(), k(Z, {
|
|
2339
|
+
key: 1,
|
|
2340
|
+
icon: "x",
|
|
2341
|
+
"icon-classes": "aeria-redish"
|
|
2342
|
+
}, {
|
|
2343
|
+
default: v(() => [
|
|
2344
|
+
Q(C(e(R)("no")), 1)
|
|
2345
|
+
]),
|
|
2346
|
+
_: 1
|
|
2347
|
+
}))
|
|
2348
|
+
])) : ((ae = e(me)(g)) == null ? void 0 : ae.$ref) === "file" ? (t(), s("div", Va, [
|
|
2349
|
+
h[T] ? (t(), s("div", Ca, [
|
|
2350
|
+
"items" in g && h[T][0] && /^image/.test(h[T][0].type) ? (t(), k(He, {
|
|
2351
|
+
key: 0,
|
|
2352
|
+
modelValue: h[T][0].link,
|
|
2353
|
+
"onUpdate:modelValue": (te) => h[T][0].link = te,
|
|
2354
|
+
expandable: "",
|
|
2355
|
+
meta: h[T][0],
|
|
2356
|
+
alt: "Row image",
|
|
2357
|
+
class: "table__picture"
|
|
2358
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : /^image/.test(h[T].type) ? (t(), k(He, {
|
|
2359
|
+
key: 1,
|
|
2360
|
+
modelValue: h[T].link,
|
|
2361
|
+
"onUpdate:modelValue": (te) => h[T].link = te,
|
|
2362
|
+
expandable: "",
|
|
2363
|
+
meta: h[T],
|
|
2364
|
+
alt: "Row image",
|
|
2365
|
+
class: "table__picture"
|
|
2366
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : h[T].link ? (t(), s("a", {
|
|
2367
|
+
key: 2,
|
|
2368
|
+
href: h[T].link,
|
|
2369
|
+
style: { "font-size": "10pt" }
|
|
2370
|
+
}, C(h[T].filename), 9, Oa)) : (t(), s("div", Ia, " - "))
|
|
2371
|
+
])) : (t(), s("div", Aa, " - "))
|
|
2372
|
+
])) : (t(), s("div", Ba, [
|
|
2373
|
+
e(i) ? (t(), s("span", wa, C(e(i).$actions.formatValue({
|
|
2374
|
+
value: h[T],
|
|
2375
|
+
key: T,
|
|
2376
|
+
property: g
|
|
2377
|
+
})), 1)) : (t(), s("span", Sa, C(Array.isArray(h[T]) ? h[T].filter((te) => !!te).join(", ") : [void 0, null].includes(h[T]) ? "-" : h[T]), 1)),
|
|
2378
|
+
((se = (le = e(me)(g)) == null ? void 0 : le.indexes) == null ? void 0 : se.length) > 1 ? (t(), s("div", Ta, [
|
|
2379
|
+
(t(!0), s(P, null, D(e(me)(g).indexes.slice(1, 2), (te, L) => (t(), s("div", {
|
|
2380
|
+
key: `subvalue-${L}`,
|
|
2381
|
+
class: "table__cell-subvalue"
|
|
2382
|
+
}, C(e(i).$actions.formatValue({
|
|
2383
|
+
value: h[T],
|
|
2384
|
+
key: T,
|
|
2385
|
+
property: g,
|
|
2386
|
+
index: te
|
|
2387
|
+
})), 1))), 128))
|
|
2388
|
+
])) : y("", !0)
|
|
2389
|
+
]))
|
|
2390
|
+
])
|
|
2391
|
+
]))
|
|
2392
|
+
]);
|
|
2393
|
+
}), 128)),
|
|
2394
|
+
(W = f.actions) != null && W.length && e(o).md ? (t(), s("td", ja, [
|
|
2395
|
+
A("div", Ra, [
|
|
2396
|
+
(t(!0), s(P, null, D(d(h), (T) => (t(), k(re, {
|
|
2397
|
+
key: `action-${T.action}`,
|
|
2398
|
+
small: "",
|
|
2399
|
+
variant: "alt",
|
|
2400
|
+
icon: T.icon,
|
|
2401
|
+
style: he(w(h, T)),
|
|
2402
|
+
onClick: (g) => T.click(h)
|
|
2403
|
+
}, {
|
|
2404
|
+
default: v(() => [
|
|
2405
|
+
Q(C(e(R)(T.label)), 1)
|
|
2406
|
+
]),
|
|
2407
|
+
_: 2
|
|
2408
|
+
}, 1032, ["icon", "style", "onClick"]))), 128)),
|
|
2409
|
+
a(h).length > 0 ? (t(), k(Oe, G({
|
|
2410
|
+
key: 0,
|
|
2411
|
+
ref_for: !0
|
|
2412
|
+
}, {
|
|
2413
|
+
subject: h,
|
|
2414
|
+
actions: a(h)
|
|
2415
|
+
}), {
|
|
2416
|
+
default: v(({
|
|
2417
|
+
visible: T
|
|
2418
|
+
}) => [
|
|
2419
|
+
N(q(Z, {
|
|
2420
|
+
reactive: "",
|
|
2421
|
+
active: T,
|
|
2422
|
+
icon: "dots-three"
|
|
2423
|
+
}, null, 8, ["active"]), [
|
|
2424
|
+
[S]
|
|
2425
|
+
])
|
|
2426
|
+
]),
|
|
2427
|
+
_: 2
|
|
2428
|
+
}, 1040)) : y("", !0)
|
|
2429
|
+
])
|
|
2430
|
+
])) : (ne = f.actions) != null && ne.length ? (t(), s("td", La, [
|
|
2431
|
+
A("div", {
|
|
2432
|
+
class: "table__mobile-actions-grid",
|
|
2433
|
+
style: he(`grid-template-columns: repeat(${d(h).length + (a(h).length ? 1 : 0)}, 1fr);`)
|
|
2434
|
+
}, [
|
|
2435
|
+
(t(!0), s(P, null, D(d(h), (T) => (t(), k(ve, {
|
|
2436
|
+
key: `action-${T.action}`,
|
|
2437
|
+
class: "table__mobile-actions-button",
|
|
2438
|
+
onClick: (g) => T.click(h)
|
|
2439
|
+
}, {
|
|
2440
|
+
default: v(() => [
|
|
2441
|
+
q(Z, {
|
|
2442
|
+
icon: T.icon || "gear"
|
|
2443
|
+
}, {
|
|
2444
|
+
default: v(() => [
|
|
2445
|
+
Q(C(e(R)(T.label)), 1)
|
|
2446
|
+
]),
|
|
2447
|
+
_: 2
|
|
2448
|
+
}, 1032, ["icon"])
|
|
2449
|
+
]),
|
|
2450
|
+
_: 2
|
|
2451
|
+
}, 1032, ["onClick"]))), 128)),
|
|
2452
|
+
a(h).length > 0 ? (t(), k(Oe, G({
|
|
2453
|
+
key: 0,
|
|
2454
|
+
ref_for: !0
|
|
2455
|
+
}, {
|
|
2456
|
+
subject: h,
|
|
2457
|
+
actions: a(h)
|
|
2458
|
+
}), {
|
|
2459
|
+
default: v(() => [
|
|
2460
|
+
q(Z, {
|
|
2461
|
+
icon: "dots-three",
|
|
2462
|
+
class: "table__mobile-actions-button"
|
|
2463
|
+
})
|
|
2464
|
+
]),
|
|
2465
|
+
_: 2
|
|
2466
|
+
}, 1040)) : y("", !0)
|
|
2467
|
+
], 4)
|
|
2468
|
+
])) : y("", !0),
|
|
2469
|
+
A("div", {
|
|
2470
|
+
id: `dropdown-${h._id}`
|
|
2471
|
+
}, null, 8, za)
|
|
2472
|
+
], 8, fa);
|
|
2473
|
+
}), 128))
|
|
2474
|
+
])),
|
|
2475
|
+
A("tfoot", null, [
|
|
2476
|
+
f.$slots.tfoot ? O(f.$slots, "tfoot", { key: 0 }, void 0, !0) : f.columns && !((X = f.rows) != null && X.length) && !((ee = e(i)) != null && ee.loading.getAll) ? (t(), s("tr", Ma, [
|
|
2477
|
+
A("td", {
|
|
2478
|
+
colspan: p.value + 1
|
|
2479
|
+
}, [
|
|
2480
|
+
A("div", Fa, C(e(R)("no_results", { capitalize: !0 })) + ". ", 1)
|
|
2481
|
+
], 8, qa)
|
|
2482
|
+
])) : y("", !0)
|
|
2483
|
+
])
|
|
2484
|
+
])) : y("", !0);
|
|
2485
|
+
};
|
|
2486
|
+
}
|
|
2487
|
+
});
|
|
2488
|
+
const Ea = /* @__PURE__ */ K(Ua, [["__scopeId", "data-v-5cd758ff"]]), Ha = /* @__PURE__ */ U({
|
|
2489
|
+
__name: "aeria-tabular",
|
|
2490
|
+
props: {
|
|
2491
|
+
individualActions: {},
|
|
2492
|
+
layoutOptions: {},
|
|
2493
|
+
componentProps: {}
|
|
2494
|
+
},
|
|
2495
|
+
setup(c) {
|
|
2496
|
+
const r = c, l = Ie(), n = qe(), o = H(() => {
|
|
2497
|
+
const u = {
|
|
2498
|
+
collection: n,
|
|
2499
|
+
checkbox: l.hasSelectionActions,
|
|
2500
|
+
columns: l.tableProperties,
|
|
2501
|
+
rows: l.items,
|
|
2502
|
+
actions: r.individualActions,
|
|
2503
|
+
layout: l.tableLayout
|
|
2504
|
+
};
|
|
2505
|
+
return Object.assign(u, r.componentProps);
|
|
2506
|
+
});
|
|
2507
|
+
return (u, i) => (t(), s("div", null, [
|
|
2508
|
+
u.$slots.inner ? O(u.$slots, "inner", { key: 0 }) : y("", !0),
|
|
2509
|
+
e(l).properties ? (t(), k(Ea, G({ key: 1 }, o.value, {
|
|
2510
|
+
key: e(l).$id
|
|
2511
|
+
}), ce({ _: 2 }, [
|
|
2512
|
+
D(Object.keys(u.$slots).filter((_) => !["inner"].includes(_)), (_) => ({
|
|
2513
|
+
name: _,
|
|
2514
|
+
fn: v((p) => [
|
|
2515
|
+
O(u.$slots, _, de(ge(p)))
|
|
2516
|
+
])
|
|
2517
|
+
}))
|
|
2518
|
+
]), 1040)) : y("", !0)
|
|
2519
|
+
]));
|
|
2520
|
+
}
|
|
2521
|
+
}), Da = /* @__PURE__ */ U({
|
|
2522
|
+
__name: "aeria-grid",
|
|
2523
|
+
props: {
|
|
2524
|
+
list: { type: Boolean }
|
|
2525
|
+
},
|
|
2526
|
+
setup(c) {
|
|
2527
|
+
return (r, l) => (t(), s("div", {
|
|
2528
|
+
class: Y(`
|
|
2529
|
+
grid
|
|
2530
|
+
${r.list && "grid--list"}
|
|
2531
|
+
`)
|
|
2532
|
+
}, [
|
|
2533
|
+
O(r.$slots, "default", {}, void 0, !0)
|
|
2534
|
+
], 2));
|
|
2535
|
+
}
|
|
2536
|
+
});
|
|
2537
|
+
const Qa = /* @__PURE__ */ K(Da, [["__scopeId", "data-v-438c4aed"]]), Ga = { key: 0 }, Wa = {
|
|
2538
|
+
key: 1,
|
|
2539
|
+
class: "card__information"
|
|
2540
|
+
}, Ka = /* @__PURE__ */ U({
|
|
2541
|
+
__name: "aeria-grid",
|
|
2542
|
+
props: {
|
|
2543
|
+
individualActions: {},
|
|
2544
|
+
hasSelectionActions: { type: Boolean },
|
|
2545
|
+
layoutOptions: {},
|
|
2546
|
+
componentName: {}
|
|
2547
|
+
},
|
|
2548
|
+
setup(c) {
|
|
2549
|
+
const l = c.layoutOptions, n = Ie(), o = (u) => Array.isArray(u) ? u[0] : u;
|
|
2550
|
+
return (u, i) => {
|
|
2551
|
+
const _ = oe("clickable");
|
|
2552
|
+
return t(), k(Qa, {
|
|
2553
|
+
list: u.componentName === "list"
|
|
2554
|
+
}, {
|
|
2555
|
+
default: v(() => [
|
|
2556
|
+
(t(!0), s(P, null, D(e(n).items, (p) => (t(), k(dn, {
|
|
2557
|
+
key: p,
|
|
2558
|
+
inactive: !!(e(l).active && !p[e(l).active]),
|
|
2559
|
+
horizontal: u.componentName === "list"
|
|
2560
|
+
}, ce({
|
|
2561
|
+
footer: v(() => [
|
|
2562
|
+
e(l).title ? (t(), s("div", Ga, C(p[e(l).title]), 1)) : y("", !0),
|
|
2563
|
+
e(l).information ? (t(), s("div", Wa, C(p[e(l).information]), 1)) : y("", !0)
|
|
2564
|
+
]),
|
|
2565
|
+
actions: v(() => [
|
|
2566
|
+
u.individualActions.length > 0 ? (t(), k(Oe, G({
|
|
2567
|
+
key: 0,
|
|
2568
|
+
ref_for: !0
|
|
2569
|
+
}, {
|
|
2570
|
+
subject: p,
|
|
2571
|
+
actions: u.individualActions
|
|
2572
|
+
}), {
|
|
2573
|
+
default: v(({
|
|
2574
|
+
visible: b
|
|
2575
|
+
}) => [
|
|
2576
|
+
N(q(Z, {
|
|
2577
|
+
reactive: "",
|
|
2578
|
+
active: b,
|
|
2579
|
+
icon: "dots-three-vertical"
|
|
2580
|
+
}, null, 8, ["active"]), [
|
|
2581
|
+
[_]
|
|
2582
|
+
])
|
|
2583
|
+
]),
|
|
2584
|
+
_: 2
|
|
2585
|
+
}, 1040)) : y("", !0)
|
|
2586
|
+
]),
|
|
2587
|
+
default: v(() => {
|
|
2588
|
+
var b;
|
|
2589
|
+
return [
|
|
2590
|
+
q(He, {
|
|
2591
|
+
alt: "Item picture",
|
|
2592
|
+
expandable: "",
|
|
2593
|
+
url: (b = o(p[e(l).picture])) == null ? void 0 : b.link,
|
|
2594
|
+
meta: o(p[e(l).picture])
|
|
2595
|
+
}, null, 8, ["url", "meta"])
|
|
2596
|
+
];
|
|
2597
|
+
}),
|
|
2598
|
+
_: 2
|
|
2599
|
+
}, [
|
|
2600
|
+
e(l).badge && Array.isArray(p[e(l).badge]) ? {
|
|
2601
|
+
name: "badge",
|
|
2602
|
+
fn: v(() => [
|
|
2603
|
+
(t(!0), s(P, null, D(p[e(l).badge], (b) => (t(), k($e, {
|
|
2604
|
+
key: `${p._id}-${b}`,
|
|
2605
|
+
large: ""
|
|
2606
|
+
}, {
|
|
2607
|
+
default: v(() => [
|
|
2608
|
+
Q(C(e(l).translateBadge ? e(R)(b) : b), 1)
|
|
2609
|
+
]),
|
|
2610
|
+
_: 2
|
|
2611
|
+
}, 1024))), 128))
|
|
2612
|
+
]),
|
|
2613
|
+
key: "0"
|
|
2614
|
+
} : e(l).badge ? {
|
|
2615
|
+
name: "badge",
|
|
2616
|
+
fn: v(() => [
|
|
2617
|
+
q($e, null, {
|
|
2618
|
+
default: v(() => [
|
|
2619
|
+
Q(C(e(l).translateBadge ? e(R)(p[e(l).badge]) : p[e(l).badge]), 1)
|
|
2620
|
+
]),
|
|
2621
|
+
_: 2
|
|
2622
|
+
}, 1024)
|
|
2623
|
+
]),
|
|
2624
|
+
key: "1"
|
|
2625
|
+
} : void 0
|
|
2626
|
+
]), 1032, ["inactive", "horizontal"]))), 128))
|
|
2627
|
+
]),
|
|
2628
|
+
_: 1
|
|
2629
|
+
}, 8, ["list"]);
|
|
2630
|
+
};
|
|
2631
|
+
}
|
|
2632
|
+
});
|
|
2633
|
+
const yt = /* @__PURE__ */ K(Ka, [["__scopeId", "data-v-ccbced12"]]), Xa = (c) => ({
|
|
2634
|
+
tabular: Ha,
|
|
2635
|
+
grid: yt,
|
|
2636
|
+
list: yt
|
|
2637
|
+
})[c], pe = J(!1);
|
|
2638
|
+
J(!1);
|
|
2639
|
+
const Ve = J(!1), Le = J((...c) => null), bt = J(), Ya = (c) => (Je("data-v-ece8263c"), c = c(), Ze(), c), Ja = {
|
|
2640
|
+
key: 2,
|
|
2641
|
+
class: "crud__controls"
|
|
2642
|
+
}, Za = {
|
|
2643
|
+
key: 0,
|
|
2644
|
+
class: "crud__search"
|
|
2645
|
+
}, Pa = { class: "crud__actions" }, Na = { class: "crud__context-badge" }, xa = /* @__PURE__ */ Ya(() => /* @__PURE__ */ A("div", null, "Filtros", -1)), el = { key: 0 }, tl = {
|
|
2646
|
+
key: 3,
|
|
2647
|
+
class: "crud__pagination"
|
|
2648
|
+
}, ht = 30, nl = /* @__PURE__ */ U({
|
|
2649
|
+
__name: "aeria-crud",
|
|
2650
|
+
props: {
|
|
2651
|
+
collection: {},
|
|
2652
|
+
noControls: { type: Boolean },
|
|
2653
|
+
noActions: { type: Boolean },
|
|
2654
|
+
noFetch: { type: Boolean },
|
|
2655
|
+
noLayoutToggle: { type: Boolean },
|
|
2656
|
+
layout: {},
|
|
2657
|
+
action: {},
|
|
2658
|
+
componentProps: {},
|
|
2659
|
+
scrollPagination: { type: Boolean },
|
|
2660
|
+
noQueryPersistence: { type: Boolean }
|
|
2661
|
+
},
|
|
2662
|
+
emits: ["uiEvent"],
|
|
2663
|
+
setup(c, { emit: r }) {
|
|
2664
|
+
const l = c, n = r, o = Ae(), u = Vt({
|
|
2665
|
+
delay: 600
|
|
2666
|
+
}), i = ie("meta"), _ = Ue(), { reachedEnd: p, detach: b } = Ne(null, {
|
|
2667
|
+
antecipate: 600
|
|
2668
|
+
}), d = !_.value.md || l.scrollPagination;
|
|
2669
|
+
d && ue(p, (g) => {
|
|
2670
|
+
g && a.pagination.recordsTotal > a.items.length && $.value < ht && ($.value += 1, B());
|
|
2671
|
+
});
|
|
2672
|
+
const a = ie(l.collection);
|
|
2673
|
+
sa(a, {
|
|
2674
|
+
persistInQuery: !l.noQueryPersistence
|
|
2675
|
+
});
|
|
2676
|
+
const w = Pe(), f = l.action ? e(l.action) : Gt(a, o, w);
|
|
2677
|
+
Le.value = f[0], bt.value = f[1];
|
|
2678
|
+
const $ = J(0), S = J(!1), B = async (g) => {
|
|
2679
|
+
a.activeFilters = Object.assign({}, (g == null ? void 0 : g.filters) || a.$filters), Object.assign(a.activeFilters, a.filtersPreset);
|
|
2680
|
+
const j = {
|
|
2681
|
+
filters: a.activeFilters,
|
|
2682
|
+
limit: a.pagination.limit,
|
|
2683
|
+
offset: a.pagination.offset,
|
|
2684
|
+
project: a.preferredTableProperties.length > 0 ? a.preferredTableProperties : a.description.table || Object.keys(a.properties)
|
|
2685
|
+
};
|
|
2686
|
+
$.value > 0 && (j.limit = 15, j.offset = $.value * j.limit), a.description.tableMeta && (j.project = j.project.concat(a.description.tableMeta)), g && Object.assign(j, g), a.loading.getAll = !0;
|
|
2687
|
+
const { error: ae, result: le } = await a.$actions.retrieveItems(j);
|
|
2688
|
+
if (ae)
|
|
2689
|
+
return;
|
|
2690
|
+
const { data: se, pagination: te } = le;
|
|
2691
|
+
a.pagination.recordsCount = te.recordsCount, a.pagination.recordsTotal = te.recordsTotal, $.value === 0 && a.items.splice(0), a.items.push(...se), a.loading.getAll = !1, S.value = !0;
|
|
2692
|
+
}, X = async (g) => {
|
|
2693
|
+
o.push(Me(o.currentRoute.value, {
|
|
2694
|
+
query: {
|
|
2695
|
+
offset: g.offset,
|
|
2696
|
+
limit: g.limit
|
|
2697
|
+
}
|
|
2698
|
+
})), a.pagination.offset = g.offset, a.pagination.limit = g.limit, B();
|
|
2699
|
+
}, ee = _e("noResultsComponent", null);
|
|
2700
|
+
ue(() => [
|
|
2701
|
+
o.currentRoute.value.path,
|
|
2702
|
+
o.currentRoute.value.query.section
|
|
2703
|
+
], async (g, j) => {
|
|
2704
|
+
if (j && j[0] === g[0] && j[1] === g[1])
|
|
2705
|
+
return;
|
|
2706
|
+
const ae = o.currentRoute.value;
|
|
2707
|
+
if (i.view.title = l.collection, i.view.collection = l.collection, !l.noFetch && (!ae.query._popstate || a.itemsCount === 0)) {
|
|
2708
|
+
const le = Wt(a, ae);
|
|
2709
|
+
Object.keys(le).length > 0 && Object.assign(a.filters, le), await B();
|
|
2710
|
+
}
|
|
2711
|
+
}, {
|
|
2712
|
+
immediate: !0,
|
|
2713
|
+
flush: "post"
|
|
2714
|
+
});
|
|
2715
|
+
const [h] = u((g) => (o.push(Me(o.currentRoute.value, {
|
|
2716
|
+
query: {
|
|
2717
|
+
search: g || void 0
|
|
2718
|
+
}
|
|
2719
|
+
})), g ? (a.filters = Object.assign(Ce(a.freshFilters), {
|
|
2720
|
+
$text: {
|
|
2721
|
+
$search: `"${g}"`,
|
|
2722
|
+
$caseSensitive: !1
|
|
2723
|
+
}
|
|
2724
|
+
}), B({
|
|
2725
|
+
offset: 0
|
|
2726
|
+
})) : (a.filters = Ce(a.freshFilters), $.value = 0, B())));
|
|
2727
|
+
ue(() => a.textQuery, (g) => {
|
|
2728
|
+
h(g);
|
|
2729
|
+
});
|
|
2730
|
+
const W = (g) => {
|
|
2731
|
+
g.currentLayout = g.currentLayout === "tabular" ? g.description.layout.name : "tabular";
|
|
2732
|
+
};
|
|
2733
|
+
wt(() => {
|
|
2734
|
+
a.$actions.clearFilters(), a.textQuery = "", b();
|
|
2735
|
+
}), ue(() => bt.value, async (g) => {
|
|
2736
|
+
var le;
|
|
2737
|
+
const j = Ce(g);
|
|
2738
|
+
let ae;
|
|
2739
|
+
if (j)
|
|
2740
|
+
if ((j.name === "spawnEdit" || j.name === "duplicate") && (ae = a.$actions.get({
|
|
2741
|
+
filters: {
|
|
2742
|
+
_id: j.params._id
|
|
2743
|
+
}
|
|
2744
|
+
})), j.name === "spawnAdd")
|
|
2745
|
+
a.$actions.clearItem(), (le = j.params) != null && le.item && (a.$actions.setItem(j.params.item), Object.keys(j.params.item).forEach((se) => {
|
|
2746
|
+
delete a.referenceItem[se];
|
|
2747
|
+
})), pe.value = "add";
|
|
2748
|
+
else if (j.name === "spawnEdit")
|
|
2749
|
+
a.$actions.setItem(j.params), pe.value = "edit";
|
|
2750
|
+
else if (j.name === "duplicate") {
|
|
2751
|
+
await ae;
|
|
2752
|
+
const se = Object.entries(a.item).reduce((te, [L, F]) => {
|
|
2753
|
+
if (!(L in a.properties))
|
|
2754
|
+
return {
|
|
2755
|
+
...te,
|
|
2756
|
+
[L]: F
|
|
2757
|
+
};
|
|
2758
|
+
const m = a.properties[L];
|
|
2759
|
+
if (m.readOnly)
|
|
2760
|
+
return te;
|
|
2761
|
+
const z = (E) => {
|
|
2762
|
+
const V = me(m);
|
|
2763
|
+
if (!V)
|
|
2764
|
+
return E;
|
|
2765
|
+
if (V.$ref === "file")
|
|
2766
|
+
return {};
|
|
2767
|
+
if (V.inline && E) {
|
|
2768
|
+
const { _id: I, ...M } = E;
|
|
2769
|
+
return M;
|
|
2770
|
+
}
|
|
2771
|
+
return E;
|
|
2772
|
+
};
|
|
2773
|
+
return F = Array.isArray(F) ? F.map(z) : z(F), {
|
|
2774
|
+
...te,
|
|
2775
|
+
[L]: F
|
|
2776
|
+
};
|
|
2777
|
+
}, {});
|
|
2778
|
+
a.$actions.setItem(se), delete a.item._id, a.referenceItem = {}, pe.value = "duplicate";
|
|
2779
|
+
} else
|
|
2780
|
+
n("uiEvent", j);
|
|
2781
|
+
}, {
|
|
2782
|
+
deep: !0
|
|
2783
|
+
}), ue(() => pe, ({ value: g }) => {
|
|
2784
|
+
g === !1 && (i.view.collection = l.collection, a.$actions.clearItem());
|
|
2785
|
+
});
|
|
2786
|
+
const ne = H(() => a.individualActions.map((g) => ({
|
|
2787
|
+
click: Le.value(g),
|
|
2788
|
+
...g
|
|
2789
|
+
}))), T = H(() => a.actions.filter((g) => !g.button));
|
|
2790
|
+
return ye(Fe, H(() => l.collection)), ye("individualActions", ne), (g, j) => {
|
|
2791
|
+
var se, te, L, F, m, z, E;
|
|
2792
|
+
const ae = oe("clickable"), le = oe("loading");
|
|
2793
|
+
return t(), s(P, null, [
|
|
2794
|
+
e(Ve) ? (t(), k(aa, {
|
|
2795
|
+
key: e(a).$id,
|
|
2796
|
+
modelValue: e(Ve),
|
|
2797
|
+
"onUpdate:modelValue": j[0] || (j[0] = (V) => mt(Ve) ? Ve.value = V : null)
|
|
2798
|
+
}, null, 8, ["modelValue"])) : y("", !0),
|
|
2799
|
+
e(pe) ? (t(), k(la, {
|
|
2800
|
+
key: 1,
|
|
2801
|
+
visible: e(pe),
|
|
2802
|
+
"onUpdate:visible": j[1] || (j[1] = (V) => mt(pe) ? pe.value = V : null),
|
|
2803
|
+
"fixed-right": "",
|
|
2804
|
+
onCancel: j[2] || (j[2] = (V) => pe.value = !1)
|
|
2805
|
+
}, ce({
|
|
2806
|
+
header: v(() => [
|
|
2807
|
+
A("span", null, C((() => {
|
|
2808
|
+
switch (e(pe)) {
|
|
2809
|
+
case "add":
|
|
2810
|
+
return e(R)("action.add", { capitalize: !0 });
|
|
2811
|
+
case "duplicate":
|
|
2812
|
+
return e(R)("action.duplicate", { capitalize: !0 });
|
|
2813
|
+
case "edit":
|
|
2814
|
+
default:
|
|
2815
|
+
return e(R)("action.edit", { capitalize: !0 });
|
|
2816
|
+
}
|
|
2817
|
+
})()), 1),
|
|
2818
|
+
A("span", null, " " + C(e(R)(e(i).view.collection)), 1)
|
|
2819
|
+
]),
|
|
2820
|
+
_: 2
|
|
2821
|
+
}, [
|
|
2822
|
+
D(Object.keys(g.$slots).filter((V) => V.startsWith("field-")), (V) => ({
|
|
2823
|
+
name: V,
|
|
2824
|
+
fn: v((I) => [
|
|
2825
|
+
O(g.$slots, V, de(ge(I)), void 0, !0)
|
|
2826
|
+
])
|
|
2827
|
+
}))
|
|
2828
|
+
]), 1032, ["visible"])) : y("", !0),
|
|
2829
|
+
!g.noActions && (e(a).description.search || Object.keys(e(a).availableFilters).length > 0 || ((se = e(a)) == null ? void 0 : se.actions.length) > 0 || g.$slots.actions || !g.noLayoutToggle && e(a).description.layout && ((te = e(a).description.layout) == null ? void 0 : te.name) !== "tabular") ? (t(), s("div", Ja, [
|
|
2830
|
+
e(a).description.search ? (t(), s("div", Za, [
|
|
2831
|
+
q(ke, G({
|
|
2832
|
+
modelValue: e(a).textQuery,
|
|
2833
|
+
"onUpdate:modelValue": j[3] || (j[3] = (V) => e(a).textQuery = V)
|
|
2834
|
+
}, {
|
|
2835
|
+
property: {
|
|
2836
|
+
type: "string",
|
|
2837
|
+
placeholder: e(a).description.search.placeholder || "Pesquise aqui",
|
|
2838
|
+
inputType: "search"
|
|
2839
|
+
}
|
|
2840
|
+
}), null, 16, ["modelValue"])
|
|
2841
|
+
])) : y("", !0),
|
|
2842
|
+
A("div", Pa, [
|
|
2843
|
+
T.value.length > 0 || !g.noLayoutToggle && e(a).description.layout && ((L = e(a).description.layout) == null ? void 0 : L.name) !== "tabular" ? (t(), k(Oe, { key: 0 }, ce({
|
|
2844
|
+
default: v(() => [
|
|
2845
|
+
q(re, {
|
|
2846
|
+
variant: "alt",
|
|
2847
|
+
icon: "sliders"
|
|
2848
|
+
}, {
|
|
2849
|
+
default: v(() => [
|
|
2850
|
+
e(a).filtersCount ? (t(), k($e, { key: 0 }, {
|
|
2851
|
+
default: v(() => [
|
|
2852
|
+
Q(C(e(a).filtersCount), 1)
|
|
2853
|
+
]),
|
|
2854
|
+
_: 1
|
|
2855
|
+
})) : y("", !0)
|
|
2856
|
+
]),
|
|
2857
|
+
_: 1
|
|
2858
|
+
})
|
|
2859
|
+
]),
|
|
2860
|
+
_: 2
|
|
2861
|
+
}, [
|
|
2862
|
+
Object.keys(e(a).availableFilters).length > 0 ? {
|
|
2863
|
+
name: "filter",
|
|
2864
|
+
fn: v(() => [
|
|
2865
|
+
N((t(), k(Z, {
|
|
2866
|
+
icon: "funnel",
|
|
2867
|
+
onClick: j[4] || (j[4] = (V) => Ve.value = !0)
|
|
2868
|
+
}, {
|
|
2869
|
+
default: v(() => [
|
|
2870
|
+
Q(C(e(R)("filters", { capitalize: !0 })), 1)
|
|
2871
|
+
]),
|
|
2872
|
+
_: 1
|
|
2873
|
+
})), [
|
|
2874
|
+
[ae]
|
|
2875
|
+
]),
|
|
2876
|
+
A("div", Na, [
|
|
2877
|
+
e(a).filtersCount ? (t(), k($e, { key: 0 }, {
|
|
2878
|
+
default: v(() => [
|
|
2879
|
+
Q(C(e(a).filtersCount), 1)
|
|
2880
|
+
]),
|
|
2881
|
+
_: 1
|
|
2882
|
+
})) : y("", !0)
|
|
2883
|
+
])
|
|
2884
|
+
]),
|
|
2885
|
+
key: "0"
|
|
2886
|
+
} : void 0,
|
|
2887
|
+
!g.noLayoutToggle && e(a).description.layout && ((F = e(a).description.layout) == null ? void 0 : F.name) !== "tabular" ? {
|
|
2888
|
+
name: "layout-toggle",
|
|
2889
|
+
fn: v(() => [
|
|
2890
|
+
N((t(), k(Z, {
|
|
2891
|
+
icon: "table",
|
|
2892
|
+
onClick: j[5] || (j[5] = (V) => W(e(a)))
|
|
2893
|
+
}, {
|
|
2894
|
+
default: v(() => [
|
|
2895
|
+
Q(C(e(R)("change_layout", { capitalize: !0 })), 1)
|
|
2896
|
+
]),
|
|
2897
|
+
_: 1
|
|
2898
|
+
})), [
|
|
2899
|
+
[ae]
|
|
2900
|
+
])
|
|
2901
|
+
]),
|
|
2902
|
+
key: "1"
|
|
2903
|
+
} : void 0,
|
|
2904
|
+
D(T.value, (V, I) => ({
|
|
2905
|
+
name: `action-${I}`,
|
|
2906
|
+
fn: v(() => [
|
|
2907
|
+
V ? (t(), k(Z, {
|
|
2908
|
+
key: 0,
|
|
2909
|
+
icon: V.icon || "gear",
|
|
2910
|
+
disabled: e(a).selected.length === 0 && "selection" in V && V.selection,
|
|
2911
|
+
onClick: (M) => e(Le)(V)({ _id: e(a).selected.map((fe) => fe._id) })
|
|
2912
|
+
}, {
|
|
2913
|
+
default: v(() => [
|
|
2914
|
+
Q(C(e(R)(V.label, { capitalize: !0 })), 1)
|
|
2915
|
+
]),
|
|
2916
|
+
_: 2
|
|
2917
|
+
}, 1032, ["icon", "disabled", "onClick"])) : y("", !0)
|
|
2918
|
+
])
|
|
2919
|
+
}))
|
|
2920
|
+
]), 1024)) : Object.keys(e(a).availableFilters).length > 0 ? (t(), k(re, {
|
|
2921
|
+
key: 1,
|
|
2922
|
+
variant: "alt",
|
|
2923
|
+
icon: "funnel",
|
|
2924
|
+
onClick: j[6] || (j[6] = (V) => Ve.value = !0)
|
|
2925
|
+
}, {
|
|
2926
|
+
default: v(() => [
|
|
2927
|
+
xa,
|
|
2928
|
+
e(a).filtersCount ? (t(), k($e, { key: 0 }, {
|
|
2929
|
+
default: v(() => [
|
|
2930
|
+
Q(C(e(a).filtersCount), 1)
|
|
2931
|
+
]),
|
|
2932
|
+
_: 1
|
|
2933
|
+
})) : y("", !0)
|
|
2934
|
+
]),
|
|
2935
|
+
_: 1
|
|
2936
|
+
})) : y("", !0),
|
|
2937
|
+
(t(!0), s(P, null, D(e(a).actions.filter((V) => V.button), (V, I) => (t(), k(re, {
|
|
2938
|
+
key: `action-${I}`,
|
|
2939
|
+
icon: V.icon,
|
|
2940
|
+
disabled: e(a).selected.length === 0 && "selection" in V && V.selection,
|
|
2941
|
+
onClick: (M) => e(Le)(V)({ _id: e(a).selected.map((fe) => fe._id) })
|
|
2942
|
+
}, {
|
|
2943
|
+
default: v(() => [
|
|
2944
|
+
Q(C(e(R)(V.label, { capitalize: !0 })), 1)
|
|
2945
|
+
]),
|
|
2946
|
+
_: 2
|
|
2947
|
+
}, 1032, ["icon", "disabled", "onClick"]))), 128)),
|
|
2948
|
+
g.$slots.actions ? O(g.$slots, "actions", { key: 2 }, void 0, !0) : y("", !0)
|
|
2949
|
+
])
|
|
2950
|
+
])) : y("", !0),
|
|
2951
|
+
N((t(), s("div", null, [
|
|
2952
|
+
e(a).itemsCount === 0 && !e(a).loading.getAll && S.value && (e(ee) || g.$slots.empty) ? (t(), s("div", el, [
|
|
2953
|
+
e(ee) ? (t(), k(be(e(ee)), de(G({ key: 0 }, {
|
|
2954
|
+
collection: e(a).$id
|
|
2955
|
+
})), {
|
|
2956
|
+
default: v(() => [
|
|
2957
|
+
e(a).filtersCount === 0 && e(a).description.actions && "spawnAdd" in e(a).description.actions ? (t(), k(re, {
|
|
2958
|
+
key: 0,
|
|
2959
|
+
icon: "plus",
|
|
2960
|
+
onClick: j[7] || (j[7] = (V) => e(Le)({
|
|
2961
|
+
action: "spawnAdd",
|
|
2962
|
+
event: "spawnAdd"
|
|
2963
|
+
})())
|
|
2964
|
+
}, {
|
|
2965
|
+
default: v(() => [
|
|
2966
|
+
Q(C(e(R)("add_first_item", { capitalize: !0 })), 1)
|
|
2967
|
+
]),
|
|
2968
|
+
_: 1
|
|
2969
|
+
})) : y("", !0)
|
|
2970
|
+
]),
|
|
2971
|
+
_: 1
|
|
2972
|
+
}, 16)) : O(g.$slots, "empty", de(G({ key: 1 }, {
|
|
2973
|
+
collection: e(a).$id
|
|
2974
|
+
})), void 0, !0)
|
|
2975
|
+
])) : g.$slots.component ? O(g.$slots, "component", de(G({ key: 1 }, {
|
|
2976
|
+
store: e(a)
|
|
2977
|
+
})), void 0, !0) : (t(), k(be(e(Xa)(((m = g.layout) == null ? void 0 : m.name) || e(a).$currentLayout)), G({ key: 2 }, {
|
|
2978
|
+
individualActions: ne.value,
|
|
2979
|
+
layoutOptions: ((z = g.layout) == null ? void 0 : z.options) || e(a).layout.options,
|
|
2980
|
+
componentProps: g.componentProps
|
|
2981
|
+
}, {
|
|
2982
|
+
"component-name": ((E = g.layout) == null ? void 0 : E.name) || e(a).$currentLayout
|
|
2983
|
+
}), ce({ _: 2 }, [
|
|
2984
|
+
D(Object.keys(g.$slots).filter((V) => V.startsWith("row-")), (V) => ({
|
|
2985
|
+
name: V,
|
|
2986
|
+
fn: v((I) => [
|
|
2987
|
+
O(g.$slots, V, de(ge(I)), void 0, !0)
|
|
2988
|
+
])
|
|
2989
|
+
})),
|
|
2990
|
+
g.$slots.tfoot ? {
|
|
2991
|
+
name: "tfoot",
|
|
2992
|
+
fn: v(() => [
|
|
2993
|
+
O(g.$slots, "tfoot", {}, void 0, !0)
|
|
2994
|
+
]),
|
|
2995
|
+
key: "0"
|
|
2996
|
+
} : void 0
|
|
2997
|
+
]), 1040, ["component-name"]))
|
|
2998
|
+
])), [
|
|
2999
|
+
[le, (!e(d) || $.value === ht) && e(a).loading.getAll]
|
|
3000
|
+
]),
|
|
3001
|
+
!e(a).loading.getAll && e(a).itemsCount > 0 ? (t(), s("div", tl, [
|
|
3002
|
+
q(Fn, {
|
|
3003
|
+
pagination: e(a).pagination,
|
|
3004
|
+
onPaginate: X
|
|
3005
|
+
}, null, 8, ["pagination"])
|
|
3006
|
+
])) : y("", !0)
|
|
3007
|
+
], 64);
|
|
3008
|
+
};
|
|
3009
|
+
}
|
|
3010
|
+
});
|
|
3011
|
+
const Fl = /* @__PURE__ */ K(nl, [["__scopeId", "data-v-ece8263c"]]), ol = { class: "prompt" }, al = /* @__PURE__ */ U({
|
|
3012
|
+
__name: "aeria-prompt",
|
|
3013
|
+
props: {
|
|
3014
|
+
title: {},
|
|
3015
|
+
options: {}
|
|
3016
|
+
},
|
|
3017
|
+
setup(c) {
|
|
3018
|
+
const r = ie("meta"), l = (n, o) => {
|
|
3019
|
+
r.$actions.fulfillPrompt(n, o);
|
|
3020
|
+
};
|
|
3021
|
+
return (n, o) => (t(), k(Be, {
|
|
3022
|
+
float: "",
|
|
3023
|
+
"fill-footer": "",
|
|
3024
|
+
"close-hint": !1,
|
|
3025
|
+
style: { "--panel-min-width": "32rem" }
|
|
3026
|
+
}, ce({
|
|
3027
|
+
footer: v(() => [
|
|
3028
|
+
A("div", {
|
|
3029
|
+
class: "prompt__options",
|
|
3030
|
+
style: he(`grid-template-columns: repeat(${Object.keys(n.options).length}, 1fr)`)
|
|
3031
|
+
}, [
|
|
3032
|
+
(t(!0), s(P, null, D(Object.entries(n.options), ([u, i], _) => (t(), k(ve, {
|
|
3033
|
+
key: `option-${_}`,
|
|
3034
|
+
class: Y(`
|
|
3035
|
+
prompt__option
|
|
3036
|
+
prompt__option--${i.variant || "primary"}
|
|
3037
|
+
`),
|
|
3038
|
+
onClick: (p) => i.click ? i.click(u, i) : l(u, i)
|
|
3039
|
+
}, {
|
|
3040
|
+
default: v(() => [
|
|
3041
|
+
Q(C(i.title), 1)
|
|
3042
|
+
]),
|
|
3043
|
+
_: 2
|
|
3044
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
3045
|
+
], 4)
|
|
3046
|
+
]),
|
|
3047
|
+
default: v(() => [
|
|
3048
|
+
A("div", ol, [
|
|
3049
|
+
O(n.$slots, "default", {}, void 0, !0)
|
|
3050
|
+
])
|
|
3051
|
+
]),
|
|
3052
|
+
_: 2
|
|
3053
|
+
}, [
|
|
3054
|
+
n.title ? {
|
|
3055
|
+
name: "title",
|
|
3056
|
+
fn: v(() => [
|
|
3057
|
+
Q(C(n.title), 1)
|
|
3058
|
+
]),
|
|
3059
|
+
key: "0"
|
|
3060
|
+
} : void 0
|
|
3061
|
+
]), 1024));
|
|
3062
|
+
}
|
|
3063
|
+
});
|
|
3064
|
+
const ll = /* @__PURE__ */ K(al, [["__scopeId", "data-v-c069c1ef"]]), sl = { class: "toast__content" }, il = { class: "toast__time" }, rl = /* @__PURE__ */ U({
|
|
3065
|
+
__name: "aeria-toast",
|
|
3066
|
+
props: {
|
|
3067
|
+
idx: {},
|
|
3068
|
+
itr: {},
|
|
3069
|
+
date: {},
|
|
3070
|
+
icon: {}
|
|
3071
|
+
},
|
|
3072
|
+
setup(c) {
|
|
3073
|
+
const r = ie("meta");
|
|
3074
|
+
return (l, n) => {
|
|
3075
|
+
const o = oe("clickable");
|
|
3076
|
+
return N((t(), s("div", {
|
|
3077
|
+
class: Y({
|
|
3078
|
+
toast: !0,
|
|
3079
|
+
"toast--animate": e(r).toasts[0].itr === l.itr
|
|
3080
|
+
}),
|
|
3081
|
+
onAnimationend: n[0] || (n[0] = (u) => e(r).$actions.popToast()),
|
|
3082
|
+
onClick: n[1] || (n[1] = (u) => e(r).$actions.popToast(l.itr))
|
|
3083
|
+
}, [
|
|
3084
|
+
q(Z, G(
|
|
3085
|
+
l.icon ? { icon: l.icon } : { icon: "warning-circle" },
|
|
3086
|
+
{ style: { "--icon-size": "4rem", "--icon-color": "var(--theme-brand-color-shade-3)" } }
|
|
3087
|
+
), null, 16),
|
|
3088
|
+
A("div", sl, [
|
|
3089
|
+
O(l.$slots, "default", {}, void 0, !0),
|
|
3090
|
+
A("div", il, C(l.formatDateTime(l.date, { hoursOnly: !0 })), 1)
|
|
3091
|
+
])
|
|
3092
|
+
], 34)), [
|
|
3093
|
+
[o]
|
|
3094
|
+
]);
|
|
3095
|
+
};
|
|
3096
|
+
}
|
|
3097
|
+
});
|
|
3098
|
+
const ul = /* @__PURE__ */ K(rl, [["__scopeId", "data-v-21bbe178"]]), cl = ["innerHTML"], dl = { class: "main__toasts" }, pl = ["innerHTML"], _l = /* @__PURE__ */ U({
|
|
3099
|
+
__name: "aeria-main",
|
|
3100
|
+
setup(c) {
|
|
3101
|
+
const r = ie("meta"), l = H(() => r.themeOverride || r.theme);
|
|
3102
|
+
return (n, o) => {
|
|
3103
|
+
const u = St("router-view");
|
|
3104
|
+
return t(), s("main", {
|
|
3105
|
+
id: "main",
|
|
3106
|
+
class: Y(`
|
|
3107
|
+
main
|
|
3108
|
+
main--${l.value}
|
|
3109
|
+
${l.value === "dark" && "tw-dark"}
|
|
3110
|
+
`)
|
|
3111
|
+
}, [
|
|
3112
|
+
(t(), k(Tt, null, {
|
|
3113
|
+
default: v(() => [
|
|
3114
|
+
q(u, null, {
|
|
3115
|
+
default: v(({ Component: i }) => [
|
|
3116
|
+
(t(), k(be(i), null, ce({ _: 2 }, [
|
|
3117
|
+
D(Object.keys(n.$slots), (_) => ({
|
|
3118
|
+
name: _,
|
|
3119
|
+
fn: v(() => [
|
|
3120
|
+
O(n.$slots, _, {}, void 0, !0)
|
|
3121
|
+
])
|
|
3122
|
+
}))
|
|
3123
|
+
]), 1024))
|
|
3124
|
+
]),
|
|
3125
|
+
_: 3
|
|
3126
|
+
})
|
|
3127
|
+
]),
|
|
3128
|
+
_: 3
|
|
3129
|
+
})),
|
|
3130
|
+
O(n.$slots, "default", {}, void 0, !0),
|
|
3131
|
+
q(Be, G({
|
|
3132
|
+
modelValue: e(r).modal.visible,
|
|
3133
|
+
"onUpdate:modelValue": o[0] || (o[0] = (i) => e(r).modal.visible = i),
|
|
3134
|
+
float: "",
|
|
3135
|
+
"close-hint": ""
|
|
3136
|
+
}, e(r).modal, {
|
|
3137
|
+
"overlay-layer": 70,
|
|
3138
|
+
onOverlayClick: o[1] || (o[1] = (i) => e(r).modal.visible = !1)
|
|
3139
|
+
}), {
|
|
3140
|
+
default: v(() => [
|
|
3141
|
+
e(r).modal.body ? (t(), s("div", {
|
|
3142
|
+
key: 0,
|
|
3143
|
+
style: { "white-space": "pre-wrap" },
|
|
3144
|
+
innerHTML: e(r).modal.body
|
|
3145
|
+
}, null, 8, cl)) : y("", !0),
|
|
3146
|
+
e(r).modal.component ? (t(), k(be(e(r).modal.component), { key: 1 })) : y("", !0)
|
|
3147
|
+
]),
|
|
3148
|
+
_: 1
|
|
3149
|
+
}, 16, ["modelValue"]),
|
|
3150
|
+
e(r).prompt.visible ? (t(), k(ll, de(G({ key: 0 }, e(r).prompt)), {
|
|
3151
|
+
default: v(() => [
|
|
3152
|
+
Q(C(e(r).prompt.body), 1)
|
|
3153
|
+
]),
|
|
3154
|
+
_: 1
|
|
3155
|
+
}, 16)) : y("", !0),
|
|
3156
|
+
A("div", dl, [
|
|
3157
|
+
(t(!0), s(P, null, D(e(r).toasts, (i) => (t(), k(ul, G({ ref_for: !0 }, i, {
|
|
3158
|
+
key: `toast-${i.itr}`
|
|
3159
|
+
}), {
|
|
3160
|
+
default: v(() => [
|
|
3161
|
+
A("div", {
|
|
3162
|
+
innerHTML: e(R)(i.text)
|
|
3163
|
+
}, null, 8, pl)
|
|
3164
|
+
]),
|
|
3165
|
+
_: 2
|
|
3166
|
+
}, 1040))), 128))
|
|
3167
|
+
])
|
|
3168
|
+
], 2);
|
|
3169
|
+
};
|
|
3170
|
+
}
|
|
3171
|
+
});
|
|
3172
|
+
const Ul = /* @__PURE__ */ K(_l, [["__scopeId", "data-v-1166be3d"]]);
|
|
3173
|
+
const ml = {}, fl = { class: "menu" };
|
|
3174
|
+
function vl(c, r) {
|
|
3175
|
+
return t(), s("menu", fl, [
|
|
3176
|
+
(t(!0), s(P, null, D(Object.keys(c.$slots), (l) => (t(), s("div", {
|
|
3177
|
+
key: l,
|
|
3178
|
+
class: "menu__entry"
|
|
3179
|
+
}, [
|
|
3180
|
+
O(c.$slots, l, {}, void 0, !0)
|
|
3181
|
+
]))), 128))
|
|
3182
|
+
]);
|
|
3183
|
+
}
|
|
3184
|
+
const El = /* @__PURE__ */ K(ml, [["render", vl], ["__scopeId", "data-v-3cfef7fb"]]), yl = { class: "tabs" }, bl = {
|
|
3185
|
+
key: 0,
|
|
3186
|
+
class: "tabs__horizontal"
|
|
3187
|
+
}, hl = {
|
|
3188
|
+
key: 0,
|
|
3189
|
+
class: "tabs__tab tabs__tab--info"
|
|
3190
|
+
}, $l = ["onClick"], gl = {
|
|
3191
|
+
key: 1,
|
|
3192
|
+
class: "tabs__context-menu"
|
|
3193
|
+
}, kl = ["onClick"], Vl = /* @__PURE__ */ U({
|
|
3194
|
+
__name: "aeria-tabs",
|
|
3195
|
+
props: {
|
|
3196
|
+
query: {},
|
|
3197
|
+
param: {},
|
|
3198
|
+
dropdown: { type: Boolean }
|
|
3199
|
+
},
|
|
3200
|
+
setup(c) {
|
|
3201
|
+
const r = c, l = jt(), n = Ae(), o = Ue(), u = H(() => {
|
|
3202
|
+
if (r.query) {
|
|
3203
|
+
const _ = n.currentRoute.value.query[r.query];
|
|
3204
|
+
if (_)
|
|
3205
|
+
return _;
|
|
3206
|
+
} else if (r.param) {
|
|
3207
|
+
const _ = n.currentRoute.value.params[r.param];
|
|
3208
|
+
if (_)
|
|
3209
|
+
return _;
|
|
3210
|
+
}
|
|
3211
|
+
return Object.keys(l)[0];
|
|
3212
|
+
}), i = (_) => {
|
|
3213
|
+
r.query && n.push(Me(n.currentRoute.value, {
|
|
3214
|
+
query: {
|
|
3215
|
+
[r.query]: _
|
|
3216
|
+
}
|
|
3217
|
+
})), r.param && n.push(Me(n.currentRoute.value, {
|
|
3218
|
+
params: {
|
|
3219
|
+
[r.param]: _
|
|
3220
|
+
}
|
|
3221
|
+
}));
|
|
3222
|
+
};
|
|
3223
|
+
return (_, p) => {
|
|
3224
|
+
const b = oe("clickable");
|
|
3225
|
+
return t(), s("div", yl, [
|
|
3226
|
+
e(o).md && !_.dropdown ? (t(), s("div", bl, [
|
|
3227
|
+
_.$slots.default ? (t(), s("div", hl, [
|
|
3228
|
+
O(_.$slots, "default", {}, void 0, !0)
|
|
3229
|
+
])) : y("", !0),
|
|
3230
|
+
(t(!0), s(P, null, D(Object.keys(_.$slots).filter((d) => d !== "default"), (d, a) => (t(), s("div", {
|
|
3231
|
+
key: d,
|
|
3232
|
+
class: Y({
|
|
3233
|
+
tabs__tab: !0,
|
|
3234
|
+
"tabs__tab--current": d === u.value || !u.value && a === 0
|
|
3235
|
+
}),
|
|
3236
|
+
onClick: (w) => i(d)
|
|
3237
|
+
}, [
|
|
3238
|
+
O(_.$slots, d, {}, void 0, !0)
|
|
3239
|
+
], 10, $l))), 128))
|
|
3240
|
+
])) : (t(), s("div", gl, [
|
|
3241
|
+
q(Oe, null, ce({
|
|
3242
|
+
default: v(({ visible: d }) => [
|
|
3243
|
+
N((t(), k(Z, {
|
|
3244
|
+
"icon-right": "",
|
|
3245
|
+
active: d,
|
|
3246
|
+
icon: "caret-down",
|
|
3247
|
+
style: { "--icon-color": "var(--theme-brand-color-shade-1)" },
|
|
3248
|
+
class: "tabs__context-menu-icon"
|
|
3249
|
+
}, {
|
|
3250
|
+
default: v(() => [
|
|
3251
|
+
O(_.$slots, u.value, {}, void 0, !0)
|
|
3252
|
+
]),
|
|
3253
|
+
_: 2
|
|
3254
|
+
}, 1032, ["active"])), [
|
|
3255
|
+
[b]
|
|
3256
|
+
])
|
|
3257
|
+
]),
|
|
3258
|
+
_: 2
|
|
3259
|
+
}, [
|
|
3260
|
+
D(Object.keys(_.$slots).filter((d) => d !== "default"), (d) => ({
|
|
3261
|
+
name: d,
|
|
3262
|
+
fn: v(() => [
|
|
3263
|
+
A("div", {
|
|
3264
|
+
onClick: (a) => i(d)
|
|
3265
|
+
}, [
|
|
3266
|
+
O(_.$slots, d, {}, void 0, !0)
|
|
3267
|
+
], 8, kl)
|
|
3268
|
+
])
|
|
3269
|
+
}))
|
|
3270
|
+
]), 1024)
|
|
3271
|
+
]))
|
|
3272
|
+
]);
|
|
3273
|
+
};
|
|
3274
|
+
}
|
|
3275
|
+
});
|
|
3276
|
+
const Cl = /* @__PURE__ */ K(Vl, [["__scopeId", "data-v-a20914ab"]]), Ol = U({
|
|
3277
|
+
props: {
|
|
3278
|
+
initialValue: String,
|
|
3279
|
+
promise: Promise
|
|
3280
|
+
},
|
|
3281
|
+
setup(c) {
|
|
3282
|
+
const r = J(c.initialValue);
|
|
3283
|
+
return c.promise instanceof Promise && c.promise.then((l) => {
|
|
3284
|
+
r.value = l;
|
|
3285
|
+
}), () => Rt("div", r.value);
|
|
3286
|
+
}
|
|
3287
|
+
}), Il = ["onClick"], Al = { key: 1 }, Bl = /* @__PURE__ */ U({
|
|
3288
|
+
__name: "aeria-crud-topbar",
|
|
3289
|
+
props: {
|
|
3290
|
+
collection: {}
|
|
3291
|
+
},
|
|
3292
|
+
setup(c) {
|
|
3293
|
+
const r = c, n = Ae().currentRoute, o = Pe(), u = H(() => r.collection ? Ge(r.collection, o) : typeof n.value.meta.collection == "string" ? Ge(n.value.meta.collection, o) : typeof n.value.params.collection == "string" ? Ge(n.value.params.collection, o) : null), i = async (_, p) => {
|
|
3294
|
+
const { error: b, result: d } = await p.$functions[_.badgeFunction]({
|
|
3295
|
+
filters: _.filters
|
|
3296
|
+
});
|
|
3297
|
+
return b ? 0 : d;
|
|
3298
|
+
};
|
|
3299
|
+
return (_, p) => u.value && u.value.description.filtersPresets ? (t(), k(Cl, {
|
|
3300
|
+
key: 0,
|
|
3301
|
+
dropdown: "",
|
|
3302
|
+
query: "section"
|
|
3303
|
+
}, ce({ _: 2 }, [
|
|
3304
|
+
D(Object.entries(u.value.description.filtersPresets), ([b, d]) => ({
|
|
3305
|
+
name: b,
|
|
3306
|
+
fn: v(() => [
|
|
3307
|
+
A("div", {
|
|
3308
|
+
class: "topbar__preset",
|
|
3309
|
+
onClick: (a) => e(Ot)(d, u.value)
|
|
3310
|
+
}, [
|
|
3311
|
+
d.icon ? (t(), k(Z, {
|
|
3312
|
+
key: 0,
|
|
3313
|
+
icon: d.icon
|
|
3314
|
+
}, {
|
|
3315
|
+
default: v(() => [
|
|
3316
|
+
Q(C(d.label || e(R)(b, { plural: !0 })), 1)
|
|
3317
|
+
]),
|
|
3318
|
+
_: 2
|
|
3319
|
+
}, 1032, ["icon"])) : (t(), s("div", Al, C(d.label || e(R)(b, { plural: !0 })), 1)),
|
|
3320
|
+
d.badgeFunction ? (t(), k($e, { key: 2 }, {
|
|
3321
|
+
default: v(() => [
|
|
3322
|
+
q(e(Ol), {
|
|
3323
|
+
"initial-value": "0",
|
|
3324
|
+
promise: i(d, u.value)
|
|
3325
|
+
}, null, 8, ["promise"])
|
|
3326
|
+
]),
|
|
3327
|
+
_: 2
|
|
3328
|
+
}, 1024)) : y("", !0)
|
|
3329
|
+
], 8, Il)
|
|
3330
|
+
])
|
|
3331
|
+
}))
|
|
3332
|
+
]), 1024)) : y("", !0);
|
|
3333
|
+
}
|
|
3334
|
+
});
|
|
3335
|
+
const wl = /* @__PURE__ */ K(Bl, [["__scopeId", "data-v-85c3b087"]]), Sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3336
|
+
__proto__: null,
|
|
3337
|
+
default: wl
|
|
3338
|
+
}, Symbol.toStringTag, { value: "Module" })), Hl = /* @__PURE__ */ U({
|
|
3339
|
+
__name: "aeria-password-form",
|
|
3340
|
+
props: {
|
|
3341
|
+
modelValue: {}
|
|
3342
|
+
},
|
|
3343
|
+
emits: ["update:modelValue"],
|
|
3344
|
+
setup(c) {
|
|
3345
|
+
const r = c;
|
|
3346
|
+
ye(Fe, null);
|
|
3347
|
+
const l = Kt(), n = H(() => l(
|
|
3348
|
+
r.modelValue.password,
|
|
3349
|
+
r.modelValue.confirmation
|
|
3350
|
+
));
|
|
3351
|
+
return (o, u) => (t(), k(Qe, {
|
|
3352
|
+
form: {
|
|
3353
|
+
password: {
|
|
3354
|
+
type: "string",
|
|
3355
|
+
icon: "key",
|
|
3356
|
+
inputType: "password"
|
|
3357
|
+
},
|
|
3358
|
+
confirmation: {
|
|
3359
|
+
type: "string",
|
|
3360
|
+
icon: "key",
|
|
3361
|
+
inputType: "password"
|
|
3362
|
+
}
|
|
3363
|
+
},
|
|
3364
|
+
"model-value": o.modelValue,
|
|
3365
|
+
"onUpdate:modelValue": u[0] || (u[0] = (i) => o.$emit("update:modelValue", i))
|
|
3366
|
+
}, {
|
|
3367
|
+
after: v(() => [
|
|
3368
|
+
A("div", null, C(n.value || "Senhas conferem"), 1),
|
|
3369
|
+
O(o.$slots, "default", de(ge({ passwordError: n.value })))
|
|
3370
|
+
]),
|
|
3371
|
+
_: 3
|
|
3372
|
+
}, 8, ["model-value"]));
|
|
3373
|
+
}
|
|
3374
|
+
}), Dl = (c, r = []) => ({
|
|
3375
|
+
path: "/user",
|
|
3376
|
+
name: "/builtin:user",
|
|
3377
|
+
component: c,
|
|
3378
|
+
children: r.concat([
|
|
3379
|
+
{
|
|
3380
|
+
path: "invite/:id",
|
|
3381
|
+
name: "/user/invite/:id",
|
|
3382
|
+
redirect: (l) => ({
|
|
3383
|
+
path: "/user/signup",
|
|
3384
|
+
params: {
|
|
3385
|
+
inviteId: l.params.id
|
|
3386
|
+
}
|
|
3387
|
+
})
|
|
3388
|
+
},
|
|
3389
|
+
{
|
|
3390
|
+
path: "signin",
|
|
3391
|
+
name: "/user/signin",
|
|
3392
|
+
component: () => import("./signin-277485f6.js"),
|
|
3393
|
+
meta: {
|
|
3394
|
+
title: "Autenticação"
|
|
3395
|
+
}
|
|
3396
|
+
},
|
|
3397
|
+
{
|
|
3398
|
+
path: "signup",
|
|
3399
|
+
name: "/user/signup",
|
|
3400
|
+
component: () => import("./signup-c87489a0.js"),
|
|
3401
|
+
meta: {
|
|
3402
|
+
title: "Registro"
|
|
3403
|
+
}
|
|
3404
|
+
},
|
|
3405
|
+
{
|
|
3406
|
+
path: "activation",
|
|
3407
|
+
name: "/user/activation",
|
|
3408
|
+
component: () => import("./activation-46990c40.js"),
|
|
3409
|
+
meta: {
|
|
3410
|
+
title: "Ativação"
|
|
3411
|
+
}
|
|
3412
|
+
}
|
|
3413
|
+
])
|
|
3414
|
+
}), Ql = (c, r = []) => ({
|
|
3415
|
+
path: "/dashboard",
|
|
3416
|
+
name: "/builtin:dashboard",
|
|
3417
|
+
component: c,
|
|
3418
|
+
redirect: {
|
|
3419
|
+
name: "/dashboard/"
|
|
3420
|
+
},
|
|
3421
|
+
meta: {
|
|
3422
|
+
title: "Dashboard"
|
|
3423
|
+
},
|
|
3424
|
+
children: r.concat([
|
|
3425
|
+
{
|
|
3426
|
+
path: "c/:collection",
|
|
3427
|
+
name: "/dashboard/:collection",
|
|
3428
|
+
props: !0,
|
|
3429
|
+
components: {
|
|
3430
|
+
default: () => import("./index-61a4a8b7.js"),
|
|
3431
|
+
topbar: () => Promise.resolve().then(() => Sl)
|
|
3432
|
+
},
|
|
3433
|
+
meta: {
|
|
3434
|
+
title: "%viewTitle%"
|
|
3435
|
+
}
|
|
3436
|
+
},
|
|
3437
|
+
{
|
|
3438
|
+
path: "c/:collection/:id/:section?",
|
|
3439
|
+
name: "/dashboard/:collection/:id",
|
|
3440
|
+
props: !0,
|
|
3441
|
+
components: {
|
|
3442
|
+
default: () => import("./_id_-37c83f35.js")
|
|
3443
|
+
},
|
|
3444
|
+
meta: {
|
|
3445
|
+
title: "%viewTitle%"
|
|
3446
|
+
}
|
|
3447
|
+
},
|
|
3448
|
+
{
|
|
3449
|
+
path: "user",
|
|
3450
|
+
name: "/dashboard/user",
|
|
3451
|
+
meta: {
|
|
3452
|
+
title: "user",
|
|
3453
|
+
icon: "users",
|
|
3454
|
+
collection: "user"
|
|
3455
|
+
},
|
|
3456
|
+
redirect: "/dashboard/c/user",
|
|
3457
|
+
children: [
|
|
3458
|
+
{
|
|
3459
|
+
path: "profile",
|
|
3460
|
+
component: () => import("./index-4ba787c5.js"),
|
|
3461
|
+
meta: {
|
|
3462
|
+
title: "Meu perfil",
|
|
3463
|
+
icon: "user-square"
|
|
3464
|
+
}
|
|
3465
|
+
},
|
|
3466
|
+
{
|
|
3467
|
+
path: "changepass",
|
|
3468
|
+
name: "/dashboard/user/changepass",
|
|
3469
|
+
component: () => import("./index-4fc7259a.js"),
|
|
3470
|
+
meta: {
|
|
3471
|
+
title: "Mudar senha",
|
|
3472
|
+
icon: "lock"
|
|
3473
|
+
}
|
|
3474
|
+
}
|
|
3475
|
+
]
|
|
3476
|
+
}
|
|
3477
|
+
])
|
|
3478
|
+
});
|
|
3479
|
+
export {
|
|
3480
|
+
Qe as A,
|
|
3481
|
+
to as B,
|
|
3482
|
+
Ol as C,
|
|
3483
|
+
ll as D,
|
|
3484
|
+
ul as E,
|
|
3485
|
+
wl as F,
|
|
3486
|
+
Dl as G,
|
|
3487
|
+
Ql as H,
|
|
3488
|
+
Hl as _,
|
|
3489
|
+
re as a,
|
|
3490
|
+
Z as b,
|
|
3491
|
+
Wn as c,
|
|
3492
|
+
Fl as d,
|
|
3493
|
+
la as e,
|
|
3494
|
+
He as f,
|
|
3495
|
+
El as g,
|
|
3496
|
+
Be as h,
|
|
3497
|
+
K as i,
|
|
3498
|
+
ql as j,
|
|
3499
|
+
$e as k,
|
|
3500
|
+
ve as l,
|
|
3501
|
+
dn as m,
|
|
3502
|
+
Oe as n,
|
|
3503
|
+
Qa as o,
|
|
3504
|
+
aa as p,
|
|
3505
|
+
kn as q,
|
|
3506
|
+
Ul as r,
|
|
3507
|
+
Fn as s,
|
|
3508
|
+
Ea as t,
|
|
3509
|
+
Cl as u,
|
|
3510
|
+
go as v,
|
|
3511
|
+
ke as w,
|
|
3512
|
+
Yn as x,
|
|
3513
|
+
Fo as y,
|
|
3514
|
+
De as z
|
|
3515
|
+
};
|