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