@aeria-ui/ui 0.0.63 → 0.0.64

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