@aeria-ui/ui 0.0.41 → 0.0.43

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