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