@appmax_npm/ds-prime 1.0.0-alpha.78 → 1.0.0-alpha.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AmChip.vue_vue_type_script_setup_true_lang-BMxK8yMe.js +38 -0
- package/AmFilterLevelDateSelect-D5mO5OlD.js +37 -0
- package/AmFilterLevelMultiSelectFilter-DWMAl6Ny.js +47 -0
- package/AmFilterLevelSelectFilter-Cjp0hFKC.js +57 -0
- package/AmIconButton.vue_vue_type_script_setup_true_lang-BbPbbVqM.js +26 -0
- package/ambutton/index.d.ts +1 -1
- package/ambutton/index.js +18 -19
- package/amchip/index.d.ts +25 -0
- package/amchip/index.js +4 -0
- package/amfilterlevel/index.d.ts +54 -0
- package/amfilterlevel/index.js +215 -0
- package/amiconbutton/index.d.ts +23 -0
- package/amiconbutton/index.js +4 -0
- package/amtabs/index.js +17 -17
- package/css/index.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineComponent as r, openBlock as c, createBlock as a, withCtx as i, createElementVNode as e, renderSlot as m, createVNode as l } from "vue";
|
|
2
|
+
import { _ as p } from "./AmText.vue_vue_type_script_setup_true_lang-BMNozCVT.js";
|
|
3
|
+
import { _ } from "./AmIcon.vue_vue_type_script_setup_true_lang-BVNnd-E1.js";
|
|
4
|
+
const f = { class: "p-1" }, d = { name: "AmChip" }, b = /* @__PURE__ */ r({
|
|
5
|
+
...d,
|
|
6
|
+
props: {
|
|
7
|
+
removable: { type: Boolean },
|
|
8
|
+
class: {},
|
|
9
|
+
style: {}
|
|
10
|
+
},
|
|
11
|
+
emits: ["remove"],
|
|
12
|
+
setup(u, { emit: o }) {
|
|
13
|
+
const t = o, s = () => t("remove");
|
|
14
|
+
return (n, v) => (c(), a(p, {
|
|
15
|
+
variant: "caption",
|
|
16
|
+
class: "inline-flex items-center px-1 bg-surface-200 rounded"
|
|
17
|
+
}, {
|
|
18
|
+
default: i(() => [
|
|
19
|
+
e("span", f, [
|
|
20
|
+
m(n.$slots, "default")
|
|
21
|
+
]),
|
|
22
|
+
e("button", {
|
|
23
|
+
onClick: s,
|
|
24
|
+
class: "inline-flex p-1 cursor-pointer"
|
|
25
|
+
}, [
|
|
26
|
+
l(_, {
|
|
27
|
+
icon: "close",
|
|
28
|
+
size: "sm"
|
|
29
|
+
})
|
|
30
|
+
])
|
|
31
|
+
]),
|
|
32
|
+
_: 3
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
b as _
|
|
38
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent as n, mergeModels as u, useModel as m, openBlock as r, createElementBlock as s, createVNode as d, unref as c } from "vue";
|
|
2
|
+
import i from "primevue/datepicker";
|
|
3
|
+
const p = { class: "flex w-full justify-center" }, f = { name: "AmFilterLevelDateSelect" }, k = /* @__PURE__ */ n({
|
|
4
|
+
...f,
|
|
5
|
+
props: /* @__PURE__ */ u({
|
|
6
|
+
modelValue: {},
|
|
7
|
+
label: {},
|
|
8
|
+
name: {},
|
|
9
|
+
component: { type: [String, Function] },
|
|
10
|
+
formatChipLabel: { type: Function },
|
|
11
|
+
options: {}
|
|
12
|
+
}, {
|
|
13
|
+
modelValue: { default: [] },
|
|
14
|
+
modelModifiers: {}
|
|
15
|
+
}),
|
|
16
|
+
emits: ["update:modelValue"],
|
|
17
|
+
setup(t) {
|
|
18
|
+
const e = m(t, "modelValue"), o = {
|
|
19
|
+
day: {
|
|
20
|
+
class: "!w-auto !h-auto !aspect-square !max-h-[2.5rem]"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return (V, l) => (r(), s("div", p, [
|
|
24
|
+
d(c(i), {
|
|
25
|
+
inline: "",
|
|
26
|
+
modelValue: e.value,
|
|
27
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => e.value = a),
|
|
28
|
+
pt: o,
|
|
29
|
+
class: "w-full !max-w-[37.5rem]",
|
|
30
|
+
selectionMode: "range"
|
|
31
|
+
}, null, 8, ["modelValue"])
|
|
32
|
+
]));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
k as default
|
|
37
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineComponent as i, mergeModels as s, useModel as p, openBlock as t, createElementBlock as a, Fragment as f, renderList as c, createVNode as r, unref as v, withCtx as V, createTextVNode as _, toDisplayString as y } from "vue";
|
|
2
|
+
import { _ as g } from "./AmText.vue_vue_type_script_setup_true_lang-BMNozCVT.js";
|
|
3
|
+
import b from "primevue/checkbox";
|
|
4
|
+
const F = { class: "space-y-2 divide-y divide-gray-200" }, $ = { name: "AmFilterLevelMultiSelectFilter" }, h = /* @__PURE__ */ i({
|
|
5
|
+
...$,
|
|
6
|
+
props: /* @__PURE__ */ s({
|
|
7
|
+
modelValue: {},
|
|
8
|
+
label: {},
|
|
9
|
+
name: {},
|
|
10
|
+
component: { type: [String, Function] },
|
|
11
|
+
formatChipLabel: { type: Function },
|
|
12
|
+
options: {}
|
|
13
|
+
}, {
|
|
14
|
+
modelValue: { default: () => [] },
|
|
15
|
+
modelModifiers: {}
|
|
16
|
+
}),
|
|
17
|
+
emits: ["update:modelValue"],
|
|
18
|
+
setup(u) {
|
|
19
|
+
const o = p(u, "modelValue");
|
|
20
|
+
return (e, n) => (t(), a("div", F, [
|
|
21
|
+
(t(!0), a(f, null, c(e.options, (m, l) => (t(), a("div", {
|
|
22
|
+
class: "flex items-center gap-2 pt-2",
|
|
23
|
+
key: l
|
|
24
|
+
}, [
|
|
25
|
+
r(v(b), {
|
|
26
|
+
modelValue: o.value,
|
|
27
|
+
"onUpdate:modelValue": n[0] || (n[0] = (d) => o.value = d),
|
|
28
|
+
inputId: `${e.name}-${l + 1}`,
|
|
29
|
+
name: e.name,
|
|
30
|
+
value: m.value
|
|
31
|
+
}, null, 8, ["modelValue", "inputId", "name", "value"]),
|
|
32
|
+
r(g, {
|
|
33
|
+
as: "label",
|
|
34
|
+
for: `${e.name}-${l + 1}`
|
|
35
|
+
}, {
|
|
36
|
+
default: V(() => [
|
|
37
|
+
_(y(m.label), 1)
|
|
38
|
+
]),
|
|
39
|
+
_: 2
|
|
40
|
+
}, 1032, ["for"])
|
|
41
|
+
]))), 128))
|
|
42
|
+
]));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
h as default
|
|
47
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent as c, mergeModels as p, ref as f, useModel as V, onMounted as v, openBlock as o, createElementBlock as n, Fragment as _, renderList as y, createVNode as s, unref as g, withCtx as h, createTextVNode as M, toDisplayString as b } from "vue";
|
|
2
|
+
import { _ as F } from "./AmText.vue_vue_type_script_setup_true_lang-BMNozCVT.js";
|
|
3
|
+
import $ from "primevue/checkbox";
|
|
4
|
+
const k = { class: "space-y-2 divide-y divide-gray-200" }, C = { name: "AmFilterLevelSelectFilter" }, B = /* @__PURE__ */ c({
|
|
5
|
+
...C,
|
|
6
|
+
props: /* @__PURE__ */ p({
|
|
7
|
+
modelValue: {},
|
|
8
|
+
label: {},
|
|
9
|
+
name: {},
|
|
10
|
+
component: { type: [String, Function] },
|
|
11
|
+
formatChipLabel: { type: Function },
|
|
12
|
+
options: {}
|
|
13
|
+
}, {
|
|
14
|
+
modelValue: {
|
|
15
|
+
default: () => null
|
|
16
|
+
},
|
|
17
|
+
modelModifiers: {}
|
|
18
|
+
}),
|
|
19
|
+
emits: ["update:modelValue"],
|
|
20
|
+
setup(m) {
|
|
21
|
+
const u = (e) => {
|
|
22
|
+
const [l] = t.value;
|
|
23
|
+
return l !== e && (t.value = l === null ? [] : [e]), e;
|
|
24
|
+
}, t = f([]), d = V(m, "modelValue", {
|
|
25
|
+
set: u
|
|
26
|
+
}), i = (e) => {
|
|
27
|
+
const l = e[e.length - 1];
|
|
28
|
+
d.value = l === void 0 ? null : l, t.value = l === void 0 ? [] : [l];
|
|
29
|
+
};
|
|
30
|
+
return v(() => u(d.value)), (e, l) => (o(), n("div", k, [
|
|
31
|
+
(o(!0), n(_, null, y(e.options, (r, a) => (o(), n("div", {
|
|
32
|
+
class: "flex items-center gap-2 pt-2",
|
|
33
|
+
key: a
|
|
34
|
+
}, [
|
|
35
|
+
s(g($), {
|
|
36
|
+
modelValue: t.value,
|
|
37
|
+
"onUpdate:modelValue": i,
|
|
38
|
+
inputId: `${e.name}-${a + 1}`,
|
|
39
|
+
name: e.name,
|
|
40
|
+
value: r.value
|
|
41
|
+
}, null, 8, ["modelValue", "inputId", "name", "value"]),
|
|
42
|
+
s(F, {
|
|
43
|
+
as: "label",
|
|
44
|
+
for: `${e.name}-${a + 1}`
|
|
45
|
+
}, {
|
|
46
|
+
default: h(() => [
|
|
47
|
+
M(b(r.label), 1)
|
|
48
|
+
]),
|
|
49
|
+
_: 2
|
|
50
|
+
}, 1032, ["for"])
|
|
51
|
+
]))), 128))
|
|
52
|
+
]));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
B as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent as e, openBlock as t, createBlock as n, withCtx as r, createVNode as c } from "vue";
|
|
2
|
+
import s from "./ambutton/index.js";
|
|
3
|
+
import { _ } from "./AmIcon.vue_vue_type_script_setup_true_lang-BVNnd-E1.js";
|
|
4
|
+
const a = { name: "AmIconButton" }, f = /* @__PURE__ */ e({
|
|
5
|
+
...a,
|
|
6
|
+
props: {
|
|
7
|
+
icon: {}
|
|
8
|
+
},
|
|
9
|
+
setup(i) {
|
|
10
|
+
return (o, m) => (t(), n(s, {
|
|
11
|
+
severity: "secondary",
|
|
12
|
+
rounded: "",
|
|
13
|
+
size: "small",
|
|
14
|
+
text: "",
|
|
15
|
+
class: "!p-2"
|
|
16
|
+
}, {
|
|
17
|
+
default: r(() => [
|
|
18
|
+
c(_, { icon: o.icon }, null, 8, ["icon"])
|
|
19
|
+
]),
|
|
20
|
+
_: 1
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
f as _
|
|
26
|
+
};
|
package/ambutton/index.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ export interface AmButtonProps extends AllowedComponentProps {
|
|
|
15
15
|
severity?: 'secondary' | 'success' | 'info' | 'warn' | 'help' | 'danger' | 'contrast';
|
|
16
16
|
text?: boolean;
|
|
17
17
|
outlined?: boolean;
|
|
18
|
+
rounded?: boolean;
|
|
18
19
|
size?: 'small' | 'large';
|
|
19
|
-
plain?: boolean;
|
|
20
20
|
fluid?: boolean;
|
|
21
21
|
href?: string;
|
|
22
22
|
disabled?: boolean;
|
package/ambutton/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as u, computed as t, openBlock as o, createBlock as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as u, computed as t, openBlock as o, createBlock as a, unref as f, mergeProps as p, withCtx as c, createCommentVNode as m, renderSlot as b } from "vue";
|
|
2
|
+
import _ from "primevue/button";
|
|
3
|
+
import { _ as g } from "../AmIcon.vue_vue_type_script_setup_true_lang-BVNnd-E1.js";
|
|
4
|
+
import { _ as y } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const v = /* @__PURE__ */ u({
|
|
6
6
|
__name: "AmButton",
|
|
7
7
|
props: {
|
|
8
8
|
as: {},
|
|
@@ -19,43 +19,42 @@ const g = /* @__PURE__ */ u({
|
|
|
19
19
|
severity: {},
|
|
20
20
|
text: { type: Boolean },
|
|
21
21
|
outlined: { type: Boolean },
|
|
22
|
+
rounded: { type: Boolean },
|
|
22
23
|
size: {},
|
|
23
|
-
plain: { type: Boolean },
|
|
24
24
|
fluid: { type: Boolean },
|
|
25
25
|
href: {},
|
|
26
26
|
disabled: { type: Boolean },
|
|
27
27
|
class: {},
|
|
28
28
|
style: {}
|
|
29
29
|
},
|
|
30
|
-
setup(
|
|
31
|
-
const e =
|
|
30
|
+
setup(n) {
|
|
31
|
+
const e = n, r = t(() => {
|
|
32
32
|
if (!e.disabled)
|
|
33
33
|
return typeof e.to == "string" ? e.to : e.href;
|
|
34
34
|
}), s = t(() => {
|
|
35
35
|
if (!e.disabled)
|
|
36
36
|
return e.to;
|
|
37
|
-
}), i = t(() => e.as ? e.as : e.disabled ? "button" : e.to ? "router-link" : e.href ? "a" : "button"),
|
|
38
|
-
return (
|
|
37
|
+
}), i = t(() => e.as ? e.as : e.disabled ? "button" : e.to ? "router-link" : e.href ? "a" : "button"), d = t(() => e.disabled || e.loading);
|
|
38
|
+
return (l, B) => (o(), a(f(_), p(e, {
|
|
39
39
|
as: i.value,
|
|
40
|
-
disabled:
|
|
40
|
+
disabled: d.value,
|
|
41
41
|
to: s.value,
|
|
42
|
-
href:
|
|
42
|
+
href: r.value,
|
|
43
|
+
"data-loading": e.loading
|
|
43
44
|
}), {
|
|
44
45
|
default: c(() => [
|
|
45
|
-
e.loading ? (o(),
|
|
46
|
+
e.loading ? (o(), a(g, {
|
|
46
47
|
key: 0,
|
|
47
48
|
"data-test": "button-loading",
|
|
48
49
|
icon: "progress_activity",
|
|
49
50
|
class: "animate-spin"
|
|
50
51
|
})) : m("", !0),
|
|
51
|
-
b("
|
|
52
|
-
_(d.$slots, "default", {}, void 0, !0)
|
|
53
|
-
])
|
|
52
|
+
b(l.$slots, "default", {}, void 0, !0)
|
|
54
53
|
]),
|
|
55
54
|
_: 3
|
|
56
|
-
}, 16, ["as", "disabled", "to", "href"]));
|
|
55
|
+
}, 16, ["as", "disabled", "to", "href", "data-loading"]));
|
|
57
56
|
}
|
|
58
|
-
}),
|
|
57
|
+
}), P = /* @__PURE__ */ y(v, [["__scopeId", "data-v-bf2547ea"]]);
|
|
59
58
|
export {
|
|
60
|
-
|
|
59
|
+
P as default
|
|
61
60
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AllowedComponentProps, Component, DefineComponent, VNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface AmChipProps extends AllowedComponentProps {
|
|
4
|
+
removable?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AmChipSlots {
|
|
8
|
+
default: () => VNode[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface AmChipEmits {
|
|
12
|
+
remove: [void];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* **DS Prime - AmChip**
|
|
17
|
+
*
|
|
18
|
+
* AmChip é um componente customizado para o DS Prime.
|
|
19
|
+
*
|
|
20
|
+
* [Documentação](https://appmax-space.bitbucket.io/ds-prime/componentes/AmChip.html)
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
declare const AmChip: DefineComponent<AmChipProps, AmChipSlots, AmChipEmits>;
|
|
24
|
+
|
|
25
|
+
export default AmChip;
|
package/amchip/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
|
|
3
|
+
type DynamicComponent = () => Promise<any>;
|
|
4
|
+
|
|
5
|
+
export type AmFilterType = 'multiselect' | 'select' | 'date';
|
|
6
|
+
export type AmFilterLevelFormatChipLabel = (field: AmFilterField, value: unknown, values: AmFilterLevelValues) => string;
|
|
7
|
+
export type AmFilterLevelOption = { label: string; value: unknown };
|
|
8
|
+
|
|
9
|
+
export type AmFilterComponentList = Record<AmFilterType, DynamicComponent>;
|
|
10
|
+
export interface AmFilterField {
|
|
11
|
+
label: string;
|
|
12
|
+
name: string;
|
|
13
|
+
component: keyof AmFilterComponentList | DynamicComponent;
|
|
14
|
+
formatChipLabel?: AmFilterLevelFormatChipLabel;
|
|
15
|
+
options?: AmFilterLevelOption[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type AmFilterLevelValues = Record<string, unknown>;
|
|
19
|
+
|
|
20
|
+
export interface AmFilterLevelProps {
|
|
21
|
+
title?: string;
|
|
22
|
+
visible?: boolean;
|
|
23
|
+
fields: AmFilterField[];
|
|
24
|
+
values?: AmFilterLevelValues;
|
|
25
|
+
modelValue?: AmFilterLevelValues;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface AmFilterLevelSlots {}
|
|
29
|
+
|
|
30
|
+
export interface AmFilterLevelEmits {
|
|
31
|
+
'update:modelValue': [AmFilterLevelValues];
|
|
32
|
+
'update:visible': [boolean];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* **DS Prime - AmFilterLevel**
|
|
37
|
+
*
|
|
38
|
+
* AmFilterLevel é um componente customizado para o DS Prime.
|
|
39
|
+
*
|
|
40
|
+
* [Documentação](https://appmax-space.bitbucket.io/ds-prime/componentes/AmFilterLevel.html)
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
declare const AmFilterLevel: DefineComponent<AmFilterLevelProps, AmFilterLevelSlots, AmFilterLevelEmits>;
|
|
44
|
+
|
|
45
|
+
export default AmFilterLevel;
|
|
46
|
+
|
|
47
|
+
export interface AmFilterLevelComponentConfig {
|
|
48
|
+
component: Function;
|
|
49
|
+
formatChipLabel: AmFilterLevelFormatChipLabel;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface AmFilterLevelComponentProps extends AmFilterField {
|
|
53
|
+
modelValue: unknown[];
|
|
54
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { defineComponent as q, ref as I, computed as v, defineAsyncComponent as G, onMounted as H, watch as J, openBlock as p, createElementBlock as d, Fragment as D, createVNode as s, unref as N, withCtx as n, createElementVNode as h, createTextVNode as c, toDisplayString as y, renderList as K, createCommentVNode as B, createBlock as Q, resolveDynamicComponent as W, mergeProps as Z } from "vue";
|
|
2
|
+
import M from "primevue/drawer";
|
|
3
|
+
import { _ as ee } from "../AmChip.vue_vue_type_script_setup_true_lang-BMxK8yMe.js";
|
|
4
|
+
import { _ as k } from "../AmText.vue_vue_type_script_setup_true_lang-BMNozCVT.js";
|
|
5
|
+
import C from "../ambutton/index.js";
|
|
6
|
+
import { _ as te } from "../AmIcon.vue_vue_type_script_setup_true_lang-BVNnd-E1.js";
|
|
7
|
+
import { _ as P } from "../AmIconButton.vue_vue_type_script_setup_true_lang-BbPbbVqM.js";
|
|
8
|
+
const g = (e) => new Date(e), L = (e) => g(e).toLocaleDateString("pt-BR"), oe = ([e, t]) => g(e).getDate() === g(t).getDate(), ne = (e, t) => {
|
|
9
|
+
if (!t || !Array.isArray(t)) return "";
|
|
10
|
+
const [r, l] = t;
|
|
11
|
+
return r ? !l || oe(t) ? L(r) : `${L(r)} à ${L(l)}` : "";
|
|
12
|
+
}, le = (e, t) => {
|
|
13
|
+
if (!Array.isArray(t)) return "";
|
|
14
|
+
const r = t[t.length - 1];
|
|
15
|
+
if (r === void 0 || !Array.isArray(e == null ? void 0 : e.options)) return "";
|
|
16
|
+
const l = t.length;
|
|
17
|
+
if (l === 0) return "";
|
|
18
|
+
const { label: f = "" } = e.options.find((_) => _.value === r) || {};
|
|
19
|
+
return l === 1 ? f : `${f}, +${l - 1}`;
|
|
20
|
+
}, ae = (e, t) => {
|
|
21
|
+
if (t === void 0 || !Array.isArray(e.options)) return "";
|
|
22
|
+
const { label: r = "" } = e.options.find((l) => l.value === t) || {};
|
|
23
|
+
return r;
|
|
24
|
+
}, V = {
|
|
25
|
+
date: {
|
|
26
|
+
component: () => import("../AmFilterLevelDateSelect-D5mO5OlD.js"),
|
|
27
|
+
formatChipLabel: ne
|
|
28
|
+
},
|
|
29
|
+
multiselect: {
|
|
30
|
+
component: () => import("../AmFilterLevelMultiSelectFilter-DWMAl6Ny.js"),
|
|
31
|
+
formatChipLabel: le
|
|
32
|
+
},
|
|
33
|
+
select: {
|
|
34
|
+
component: () => import("../AmFilterLevelSelectFilter-Cjp0hFKC.js"),
|
|
35
|
+
formatChipLabel: ae
|
|
36
|
+
}
|
|
37
|
+
}, se = () => "Selecionado", re = ({ component: e }) => typeof e == "string" ? Object.keys(V).includes(e) ? V[e].component : null : e, ie = (e) => e.formatChipLabel ? e.formatChipLabel : typeof e.component != "string" ? se : V[e.component].formatChipLabel, ue = { class: "flex justify-between w-full" }, ce = { key: 0 }, me = {
|
|
38
|
+
key: 1,
|
|
39
|
+
class: "pb-2 px-4 pt-0"
|
|
40
|
+
}, pe = { class: "p-4 flex items-center justify-between gap-2" }, fe = { class: "flex items-center" }, ve = { class: "p-4" }, de = { name: "AmFilterLevel" }, ke = /* @__PURE__ */ q({
|
|
41
|
+
...de,
|
|
42
|
+
props: {
|
|
43
|
+
title: { default: "Filtros" },
|
|
44
|
+
visible: { type: Boolean, default: !1 },
|
|
45
|
+
fields: { default: () => [] },
|
|
46
|
+
values: {},
|
|
47
|
+
modelValue: { default: () => ({}) }
|
|
48
|
+
},
|
|
49
|
+
emits: ["update:modelValue", "update:visible"],
|
|
50
|
+
setup(e, { emit: t }) {
|
|
51
|
+
const l = e, f = t, _ = () => f("update:visible", !1), i = I({}), b = I(-1), w = v(
|
|
52
|
+
() => l.fields.map((o) => ({
|
|
53
|
+
...o,
|
|
54
|
+
component: re(o),
|
|
55
|
+
formatChipLabel: ie(o),
|
|
56
|
+
options: o.options || []
|
|
57
|
+
}))
|
|
58
|
+
), m = v(() => w.value[b.value]), S = v(() => b.value > -1), T = v(() => m.value.component ? G(m.value.component) : null), X = v(() => i.value[m.value.name]), A = (o, a) => {
|
|
59
|
+
i.value = { ...i.value, [o]: a };
|
|
60
|
+
}, Y = (o) => A(m.value.name, o), j = (o) => {
|
|
61
|
+
const a = i.value[o];
|
|
62
|
+
return Array.isArray(a) ? a.length > 0 : a != null;
|
|
63
|
+
}, z = (o) => A(o, void 0), R = (o) => {
|
|
64
|
+
b.value = o;
|
|
65
|
+
}, E = () => {
|
|
66
|
+
b.value = -1;
|
|
67
|
+
}, F = () => {
|
|
68
|
+
f("update:modelValue", i.value), _();
|
|
69
|
+
}, $ = () => {
|
|
70
|
+
l.visible && (i.value = l.modelValue);
|
|
71
|
+
}, O = () => {
|
|
72
|
+
i.value = {}, F();
|
|
73
|
+
};
|
|
74
|
+
return H($), J(() => l.visible, $), (o, a) => (p(), d(D, null, [
|
|
75
|
+
s(N(M), {
|
|
76
|
+
class: "am-filter-level",
|
|
77
|
+
visible: o.visible,
|
|
78
|
+
position: "right",
|
|
79
|
+
"show-close-icon": !1,
|
|
80
|
+
"block-scroll": ""
|
|
81
|
+
}, {
|
|
82
|
+
header: n(() => [
|
|
83
|
+
h("div", ue, [
|
|
84
|
+
s(k, {
|
|
85
|
+
as: "h1",
|
|
86
|
+
variant: "title",
|
|
87
|
+
size: "small"
|
|
88
|
+
}, {
|
|
89
|
+
default: n(() => [
|
|
90
|
+
c(y(o.title), 1)
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
}),
|
|
94
|
+
s(P, {
|
|
95
|
+
icon: "close",
|
|
96
|
+
onClick: _
|
|
97
|
+
})
|
|
98
|
+
])
|
|
99
|
+
]),
|
|
100
|
+
default: n(() => [
|
|
101
|
+
(p(!0), d(D, null, K(w.value, (u, x) => (p(), d(D, {
|
|
102
|
+
key: u.name
|
|
103
|
+
}, [
|
|
104
|
+
x > 0 ? (p(), d("hr", ce)) : B("", !0),
|
|
105
|
+
s(C, {
|
|
106
|
+
class: "flex !rounded-none w-full",
|
|
107
|
+
severity: "secondary",
|
|
108
|
+
text: "",
|
|
109
|
+
onClick: (U) => R(x)
|
|
110
|
+
}, {
|
|
111
|
+
default: n(() => [
|
|
112
|
+
s(k, { as: "span" }, {
|
|
113
|
+
default: n(() => [
|
|
114
|
+
c(y(u.label), 1)
|
|
115
|
+
]),
|
|
116
|
+
_: 2
|
|
117
|
+
}, 1024),
|
|
118
|
+
s(te, {
|
|
119
|
+
icon: "chevron_right",
|
|
120
|
+
class: "ml-auto",
|
|
121
|
+
size: "sm"
|
|
122
|
+
})
|
|
123
|
+
]),
|
|
124
|
+
_: 2
|
|
125
|
+
}, 1032, ["onClick"]),
|
|
126
|
+
j(u.name) ? (p(), d("div", me, [
|
|
127
|
+
s(ee, {
|
|
128
|
+
onRemove: (U) => z(u.name),
|
|
129
|
+
removable: ""
|
|
130
|
+
}, {
|
|
131
|
+
default: n(() => [
|
|
132
|
+
c(y(u.formatChipLabel(u, i.value[u.name], i.value)), 1)
|
|
133
|
+
]),
|
|
134
|
+
_: 2
|
|
135
|
+
}, 1032, ["onRemove"])
|
|
136
|
+
])) : B("", !0)
|
|
137
|
+
], 64))), 128))
|
|
138
|
+
]),
|
|
139
|
+
footer: n(() => [
|
|
140
|
+
h("div", pe, [
|
|
141
|
+
s(C, {
|
|
142
|
+
class: "w-full",
|
|
143
|
+
onClick: O,
|
|
144
|
+
severity: "secondary"
|
|
145
|
+
}, {
|
|
146
|
+
default: n(() => a[0] || (a[0] = [
|
|
147
|
+
c("Limpar")
|
|
148
|
+
])),
|
|
149
|
+
_: 1
|
|
150
|
+
}),
|
|
151
|
+
s(C, {
|
|
152
|
+
class: "w-full",
|
|
153
|
+
onClick: F
|
|
154
|
+
}, {
|
|
155
|
+
default: n(() => a[1] || (a[1] = [
|
|
156
|
+
c("Aplicar")
|
|
157
|
+
])),
|
|
158
|
+
_: 1
|
|
159
|
+
})
|
|
160
|
+
])
|
|
161
|
+
]),
|
|
162
|
+
_: 1
|
|
163
|
+
}, 8, ["visible"]),
|
|
164
|
+
s(N(M), {
|
|
165
|
+
class: "am-filter-level",
|
|
166
|
+
visible: S.value,
|
|
167
|
+
position: "right",
|
|
168
|
+
"show-close-icon": !1
|
|
169
|
+
}, {
|
|
170
|
+
header: n(() => [
|
|
171
|
+
h("div", fe, [
|
|
172
|
+
s(P, {
|
|
173
|
+
icon: "arrow_back",
|
|
174
|
+
onClick: E,
|
|
175
|
+
class: "translate-x-[-.5rem]"
|
|
176
|
+
}),
|
|
177
|
+
s(k, {
|
|
178
|
+
as: "h2",
|
|
179
|
+
variant: "title",
|
|
180
|
+
size: "small"
|
|
181
|
+
}, {
|
|
182
|
+
default: n(() => [
|
|
183
|
+
c(y(m.value.label), 1)
|
|
184
|
+
]),
|
|
185
|
+
_: 1
|
|
186
|
+
})
|
|
187
|
+
])
|
|
188
|
+
]),
|
|
189
|
+
default: n(() => [
|
|
190
|
+
(p(), Q(W(T.value), Z({
|
|
191
|
+
modelValue: X.value,
|
|
192
|
+
"onUpdate:modelValue": Y
|
|
193
|
+
}, m.value), null, 16, ["modelValue"]))
|
|
194
|
+
]),
|
|
195
|
+
footer: n(() => [
|
|
196
|
+
h("div", ve, [
|
|
197
|
+
s(C, {
|
|
198
|
+
class: "w-full",
|
|
199
|
+
onClick: E
|
|
200
|
+
}, {
|
|
201
|
+
default: n(() => a[2] || (a[2] = [
|
|
202
|
+
c("Confirmar")
|
|
203
|
+
])),
|
|
204
|
+
_: 1
|
|
205
|
+
})
|
|
206
|
+
])
|
|
207
|
+
]),
|
|
208
|
+
_: 1
|
|
209
|
+
}, 8, ["visible"])
|
|
210
|
+
], 64));
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
export {
|
|
214
|
+
ke as default
|
|
215
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface AmIconButtonProps {
|
|
4
|
+
icon: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AmIconButtonSlots {
|
|
8
|
+
default: () => JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface AmIconButtonEmits {}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* **DS Prime - AmIconButton**
|
|
15
|
+
*
|
|
16
|
+
* AmIconButton é um componente customizado para o DS Prime.
|
|
17
|
+
*
|
|
18
|
+
* [Documentação](https://appmax-space.bitbucket.io/ds-prime/componentes/AmIconButton.html)
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
declare const AmIconButton: DefineComponent<AmIconButtonProps, AmIconButtonSlots, AmIconButtonEmits>;
|
|
22
|
+
|
|
23
|
+
export default AmIconButton;
|