@appmax_npm/ds-prime 1.0.0-alpha.144 → 1.0.0-alpha.147
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/amfield/index.js +25 -22
- package/amfilterlevel/index.d.ts +13 -2
- package/amfilterlevel/index.js +82 -79
- package/amtabs/index.js +26 -30
- package/config/Locales/enUS.json +155 -0
- package/config/Locales/ptBR.json +155 -0
- package/config/theme.js +10 -11
- package/css/index.css +1 -1
- package/index/index.js +405 -39
- package/index.js +3 -1
- package/package.json +3 -5
- package/plugins/toaster/index.js +2 -2
- package/plugins/translator/index.d.ts +3 -0
- package/plugins/translator/index.js +27 -0
- package/aminternationalizationmodal/index.d.ts +0 -10
- package/aminternationalizationmodal/index.js +0 -325
- package/amslider/index.d.ts +0 -11
- package/amslider/index.js +0 -157
package/amfield/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { defineComponent as m, createPropsRestProxy as p, openBlock as o, createBlock as n, unref as u, withCtx as s, createVNode as b, resolveDynamicComponent as f, mergeProps as h } from "vue";
|
|
2
|
+
import { _ as c } from "../AmInputText.vue_vue_type_script_setup_true_lang-DzkxGjuT.js";
|
|
3
3
|
import { _ as P } from "../AmFieldWrapper.vue_vue_type_script_setup_true_lang-qr-if4V7.js";
|
|
4
|
-
import { FormField as
|
|
5
|
-
const
|
|
6
|
-
...
|
|
4
|
+
import { FormField as _ } from "@primevue/forms";
|
|
5
|
+
const v = { name: "AmField" }, B = /* @__PURE__ */ m({
|
|
6
|
+
...v,
|
|
7
7
|
props: {
|
|
8
|
-
as: { default: () =>
|
|
8
|
+
as: { default: () => c },
|
|
9
9
|
name: {},
|
|
10
10
|
dataTestPrefix: {},
|
|
11
11
|
label: {},
|
|
@@ -15,12 +15,12 @@ const _ = { name: "AmField" }, B = /* @__PURE__ */ i({
|
|
|
15
15
|
help: {},
|
|
16
16
|
disabled: { type: Boolean }
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const a =
|
|
20
|
-
return (e,
|
|
18
|
+
setup(d) {
|
|
19
|
+
const a = p(d, ["as", "help", "label", "labelHint", "hint", "dataTestPrefix"]);
|
|
20
|
+
return (e, T) => (o(), n(u(_), {
|
|
21
21
|
name: a.name
|
|
22
22
|
}, {
|
|
23
|
-
default:
|
|
23
|
+
default: s((l) => {
|
|
24
24
|
var r;
|
|
25
25
|
return [
|
|
26
26
|
b(P, {
|
|
@@ -29,20 +29,23 @@ const _ = { name: "AmField" }, B = /* @__PURE__ */ i({
|
|
|
29
29
|
label: e.label,
|
|
30
30
|
labelHint: e.labelHint,
|
|
31
31
|
hint: e.hint,
|
|
32
|
-
error: a.error || ((r = l
|
|
32
|
+
error: l.touched ? a.error || ((r = l.error) == null ? void 0 : r.message) : "",
|
|
33
33
|
disabled: a.disabled
|
|
34
34
|
}, {
|
|
35
|
-
default:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
default: s(() => {
|
|
36
|
+
var t;
|
|
37
|
+
return [
|
|
38
|
+
(o(), n(f(e.as), h({
|
|
39
|
+
modelValue: l.value,
|
|
40
|
+
"onUpdate:modelValue": (i) => l.value = i,
|
|
41
|
+
class: "overflow-hidden"
|
|
42
|
+
}, { ...e.$attrs, ...a }, {
|
|
43
|
+
"data-test": `${e.dataTestPrefix}-field`,
|
|
44
|
+
invalid: l.touched && !!(a.error || (t = l.error) != null && t.message),
|
|
45
|
+
disabled: a.disabled
|
|
46
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "data-test", "invalid", "disabled"]))
|
|
47
|
+
];
|
|
48
|
+
}),
|
|
46
49
|
_: 2
|
|
47
50
|
}, 1032, ["dataTestPrefix", "help", "label", "labelHint", "hint", "error", "disabled"])
|
|
48
51
|
];
|
package/amfilterlevel/index.d.ts
CHANGED
|
@@ -3,7 +3,11 @@ import { DefineComponent } from 'vue';
|
|
|
3
3
|
type DynamicComponent = () => Promise<any>;
|
|
4
4
|
|
|
5
5
|
export type AmFilterType = 'multiselect' | 'select' | 'date';
|
|
6
|
-
export type AmFilterLevelFormatChipLabel = (
|
|
6
|
+
export type AmFilterLevelFormatChipLabel = (
|
|
7
|
+
field: AmFilterField,
|
|
8
|
+
value: unknown,
|
|
9
|
+
values: AmFilterLevelValues
|
|
10
|
+
) => string;
|
|
7
11
|
export type AmFilterLevelOption = { label: string; value: unknown };
|
|
8
12
|
|
|
9
13
|
export type AmFilterComponentList = Record<AmFilterType, DynamicComponent>;
|
|
@@ -19,6 +23,9 @@ export type AmFilterLevelValues = Record<string, unknown>;
|
|
|
19
23
|
|
|
20
24
|
export interface AmFilterLevelProps {
|
|
21
25
|
title?: string;
|
|
26
|
+
buttonClearText?: string;
|
|
27
|
+
buttonApplyText?: string;
|
|
28
|
+
confirmButtonText?: string;
|
|
22
29
|
visible?: boolean;
|
|
23
30
|
fields: AmFilterField[];
|
|
24
31
|
values?: AmFilterLevelValues;
|
|
@@ -41,7 +48,11 @@ export interface AmFilterLevelEmits {
|
|
|
41
48
|
* [Documentação](https://appmax-space.bitbucket.io/ds-prime/componentes/AmFilterLevel.html)
|
|
42
49
|
*/
|
|
43
50
|
|
|
44
|
-
declare const AmFilterLevel: DefineComponent<
|
|
51
|
+
declare const AmFilterLevel: DefineComponent<
|
|
52
|
+
AmFilterLevelProps,
|
|
53
|
+
AmFilterLevelSlots,
|
|
54
|
+
AmFilterLevelEmits
|
|
55
|
+
>;
|
|
45
56
|
|
|
46
57
|
export default AmFilterLevel;
|
|
47
58
|
|
package/amfilterlevel/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { defineComponent as q, ref as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as q, ref as V, computed as b, defineAsyncComponent as G, onMounted as H, watch as J, openBlock as p, createElementBlock as h, Fragment as E, createVNode as l, unref as F, withCtx as s, createElementVNode as d, createTextVNode as m, toDisplayString as f, renderList as K, createCommentVNode as B, createBlock as Q, resolveDynamicComponent as W, mergeProps as Z } from "vue";
|
|
2
|
+
import I from "primevue/drawer";
|
|
3
3
|
import { _ as ee } from "../AmChip.vue_vue_type_script_setup_true_lang-DTDfRnFx.js";
|
|
4
4
|
import { _ as L } from "../AmText.vue_vue_type_script_setup_true_lang-yjw50cPR.js";
|
|
5
5
|
import C from "../ambutton/index.js";
|
|
6
6
|
import { _ as te } from "../AmIcon.vue_vue_type_script_setup_true_lang-DSPwaviT.js";
|
|
7
|
-
import { _ as
|
|
7
|
+
import { _ as N } from "../AmIconButton.vue_vue_type_script_setup_true_lang-ChfTIqQH.js";
|
|
8
8
|
import { _ as ae } from "../AmLoading.vue_vue_type_script_setup_true_lang-DjatXofa.js";
|
|
9
|
-
const
|
|
9
|
+
const T = (t) => new Date(t), $ = (t) => T(t).toLocaleDateString("pt-BR"), se = ([t, a]) => T(t).getDate() === T(a).getDate(), oe = (t, a) => {
|
|
10
10
|
if (!a || !Array.isArray(a)) return "";
|
|
11
|
-
const [
|
|
12
|
-
return
|
|
11
|
+
const [n, o] = a;
|
|
12
|
+
return n ? !o || se(a) ? $(n) : `${$(n)} à ${$(o)}` : "";
|
|
13
13
|
}, le = (t, a) => {
|
|
14
14
|
if (!Array.isArray(a)) return "";
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const { label:
|
|
20
|
-
return
|
|
15
|
+
const n = a[a.length - 1];
|
|
16
|
+
if (n === void 0 || !Array.isArray(t == null ? void 0 : t.options)) return "";
|
|
17
|
+
const o = a.length;
|
|
18
|
+
if (o === 0) return "";
|
|
19
|
+
const { label: v = "" } = t.options.find((y) => y.value === n) || {};
|
|
20
|
+
return o === 1 ? v : `${v}, +${o - 1}`;
|
|
21
21
|
}, ne = (t, a) => {
|
|
22
22
|
if (a === void 0 || !Array.isArray(t.options)) return "";
|
|
23
|
-
const { label:
|
|
24
|
-
return
|
|
25
|
-
},
|
|
23
|
+
const { label: n = "" } = t.options.find((o) => o.value === a) || {};
|
|
24
|
+
return n;
|
|
25
|
+
}, g = {
|
|
26
26
|
date: {
|
|
27
27
|
component: () => import("../AmFilterLevelDateSelect-BbVyzCa5.js"),
|
|
28
28
|
formatChipLabel: oe
|
|
@@ -35,13 +35,16 @@ const g = (t) => new Date(t), $ = (t) => g(t).toLocaleDateString("pt-BR"), se =
|
|
|
35
35
|
component: () => import("../AmFilterLevelSelectFilter-Be3LFJno.js"),
|
|
36
36
|
formatChipLabel: ne
|
|
37
37
|
}
|
|
38
|
-
}, re = () => "Selecionado", ie = ({ component: t }) => typeof t == "string" ? Object.keys(
|
|
38
|
+
}, re = () => "Selecionado", ie = ({ component: t }) => typeof t == "string" ? Object.keys(g).includes(t) ? g[t].component : null : t, ue = (t) => t.formatChipLabel ? t.formatChipLabel : typeof t.component != "string" ? re : g[t.component].formatChipLabel, ce = { class: "flex justify-between w-full" }, de = {
|
|
39
39
|
key: 0,
|
|
40
40
|
class: "px-6"
|
|
41
|
-
}, me = ["data-test"], fe = { class: "p-4 flex items-center justify-between gap-2" }, pe = { class: "flex items-center" }, ve = { class: "p-4" }, be = { name: "AmFilterLevel" },
|
|
41
|
+
}, me = ["data-test"], fe = { class: "p-4 flex items-center justify-between gap-2" }, pe = { class: "flex items-center" }, ve = { class: "p-4" }, be = { name: "AmFilterLevel" }, ke = /* @__PURE__ */ q({
|
|
42
42
|
...be,
|
|
43
43
|
props: {
|
|
44
44
|
title: { default: "Filtros" },
|
|
45
|
+
buttonClearText: { default: "Limpar" },
|
|
46
|
+
buttonApplyText: { default: "Aplicar" },
|
|
47
|
+
confirmButtonText: { default: "Confirmar" },
|
|
45
48
|
visible: { type: Boolean, default: !1 },
|
|
46
49
|
fields: { default: () => [] },
|
|
47
50
|
values: {},
|
|
@@ -50,34 +53,34 @@ const g = (t) => new Date(t), $ = (t) => g(t).toLocaleDateString("pt-BR"), se =
|
|
|
50
53
|
},
|
|
51
54
|
emits: ["update:modelValue", "update:visible"],
|
|
52
55
|
setup(t, { emit: a }) {
|
|
53
|
-
const
|
|
54
|
-
() =>
|
|
56
|
+
const o = t, v = a, y = () => v("update:visible", !1), u = V({}), _ = V(-1), k = b(
|
|
57
|
+
() => o.fields.map((e) => ({
|
|
55
58
|
...e,
|
|
56
59
|
component: ie(e),
|
|
57
60
|
formatChipLabel: ue(e),
|
|
58
61
|
options: e.options || []
|
|
59
62
|
}))
|
|
60
|
-
), c =
|
|
63
|
+
), c = b(() => k.value[_.value]), M = b(() => _.value > -1), S = b(() => c.value.component ? G({
|
|
61
64
|
loader: c.value.component,
|
|
62
65
|
loadingComponent: ae
|
|
63
|
-
}) : null), X =
|
|
64
|
-
u.value = { ...u.value, [e]:
|
|
65
|
-
}, Y = (e) =>
|
|
66
|
-
const
|
|
67
|
-
return Array.isArray(
|
|
68
|
-
}, z = (e) =>
|
|
69
|
-
|
|
70
|
-
},
|
|
71
|
-
|
|
66
|
+
}) : null), X = b(() => u.value[c.value.name]), D = (e, r) => {
|
|
67
|
+
u.value = { ...u.value, [e]: r };
|
|
68
|
+
}, Y = (e) => D(c.value.name, e), j = (e) => {
|
|
69
|
+
const r = u.value[e];
|
|
70
|
+
return Array.isArray(r) ? r.length > 0 : r != null && r !== "";
|
|
71
|
+
}, z = (e) => D(e, void 0), R = (e) => {
|
|
72
|
+
_.value = e;
|
|
73
|
+
}, P = () => {
|
|
74
|
+
_.value = -1;
|
|
72
75
|
}, w = () => {
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
+
v("update:modelValue", u.value), y();
|
|
77
|
+
}, x = () => {
|
|
78
|
+
o.visible && (u.value = o.modelValue);
|
|
76
79
|
}, O = () => {
|
|
77
80
|
u.value = {}, w();
|
|
78
81
|
};
|
|
79
|
-
return H(
|
|
80
|
-
|
|
82
|
+
return H(x), J(() => o.visible, x), (e, r) => (p(), h(E, null, [
|
|
83
|
+
l(F(I), {
|
|
81
84
|
class: "am-filter-level",
|
|
82
85
|
visible: e.visible,
|
|
83
86
|
position: "right",
|
|
@@ -85,50 +88,50 @@ const g = (t) => new Date(t), $ = (t) => g(t).toLocaleDateString("pt-BR"), se =
|
|
|
85
88
|
"block-scroll": "",
|
|
86
89
|
"data-test": `${e.dataTestPrefix}-drawer-level-1`
|
|
87
90
|
}, {
|
|
88
|
-
header:
|
|
91
|
+
header: s(() => [
|
|
89
92
|
d("div", ce, [
|
|
90
|
-
|
|
93
|
+
l(L, {
|
|
91
94
|
as: "h1",
|
|
92
95
|
variant: "title",
|
|
93
96
|
size: "small",
|
|
94
97
|
"data-test": `${e.dataTestPrefix}-title`
|
|
95
98
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
m(
|
|
99
|
+
default: s(() => [
|
|
100
|
+
m(f(e.title), 1)
|
|
98
101
|
]),
|
|
99
102
|
_: 1
|
|
100
103
|
}, 8, ["data-test"]),
|
|
101
|
-
|
|
104
|
+
l(N, {
|
|
102
105
|
icon: "close",
|
|
103
106
|
onClick: y,
|
|
104
107
|
"data-test": `${e.dataTestPrefix}-close-button`
|
|
105
108
|
}, null, 8, ["data-test"])
|
|
106
109
|
])
|
|
107
110
|
]),
|
|
108
|
-
default:
|
|
111
|
+
default: s(() => [
|
|
109
112
|
d("div", null, [
|
|
110
|
-
(
|
|
113
|
+
(p(!0), h(E, null, K(k.value, (i, A) => (p(), h("div", {
|
|
111
114
|
class: "grid mx-[-1.5rem]",
|
|
112
115
|
key: i.name
|
|
113
116
|
}, [
|
|
114
|
-
A > 0 ? (
|
|
117
|
+
A > 0 ? (p(), h("div", de, r[0] || (r[0] = [
|
|
115
118
|
d("hr", null, null, -1)
|
|
116
|
-
]))) :
|
|
117
|
-
|
|
119
|
+
]))) : B("", !0),
|
|
120
|
+
l(C, {
|
|
118
121
|
class: "flex !rounded-none w-full !px-6",
|
|
119
122
|
severity: "secondary",
|
|
120
123
|
text: "",
|
|
121
124
|
onClick: (U) => R(A),
|
|
122
125
|
"data-test": `${e.dataTestPrefix}-${i.name}-field`
|
|
123
126
|
}, {
|
|
124
|
-
default:
|
|
125
|
-
|
|
126
|
-
default:
|
|
127
|
-
m(
|
|
127
|
+
default: s(() => [
|
|
128
|
+
l(L, { as: "span" }, {
|
|
129
|
+
default: s(() => [
|
|
130
|
+
m(f(i.label), 1)
|
|
128
131
|
]),
|
|
129
132
|
_: 2
|
|
130
133
|
}, 1024),
|
|
131
|
-
|
|
134
|
+
l(te, {
|
|
132
135
|
icon: "chevron_right",
|
|
133
136
|
class: "ml-auto",
|
|
134
137
|
size: "sm"
|
|
@@ -136,83 +139,83 @@ const g = (t) => new Date(t), $ = (t) => g(t).toLocaleDateString("pt-BR"), se =
|
|
|
136
139
|
]),
|
|
137
140
|
_: 2
|
|
138
141
|
}, 1032, ["onClick", "data-test"]),
|
|
139
|
-
j(i.name) ? (
|
|
142
|
+
j(i.name) ? (p(), h("div", {
|
|
140
143
|
key: 1,
|
|
141
144
|
class: "pb-2 px-6 pt-0",
|
|
142
145
|
"data-test": `${e.dataTestPrefix}-${i.name}-chip-group`
|
|
143
146
|
}, [
|
|
144
|
-
|
|
147
|
+
l(ee, {
|
|
145
148
|
onRemove: (U) => z(i.name),
|
|
146
149
|
removable: "",
|
|
147
150
|
"data-test": `${e.dataTestPrefix}-${i.name}-chip-item`
|
|
148
151
|
}, {
|
|
149
|
-
default:
|
|
150
|
-
m(
|
|
152
|
+
default: s(() => [
|
|
153
|
+
m(f(i.formatChipLabel(i, u.value[i.name], u.value)), 1)
|
|
151
154
|
]),
|
|
152
155
|
_: 2
|
|
153
156
|
}, 1032, ["onRemove", "data-test"])
|
|
154
|
-
], 8, me)) :
|
|
157
|
+
], 8, me)) : B("", !0)
|
|
155
158
|
]))), 128))
|
|
156
159
|
])
|
|
157
160
|
]),
|
|
158
|
-
footer:
|
|
161
|
+
footer: s(() => [
|
|
159
162
|
d("div", fe, [
|
|
160
|
-
|
|
163
|
+
l(C, {
|
|
161
164
|
class: "w-full",
|
|
162
165
|
onClick: O,
|
|
163
166
|
severity: "secondary",
|
|
164
167
|
"data-test": `${e.dataTestPrefix}-reset-filter-button`
|
|
165
168
|
}, {
|
|
166
|
-
default:
|
|
167
|
-
m(
|
|
168
|
-
])
|
|
169
|
+
default: s(() => [
|
|
170
|
+
m(f(e.buttonClearText), 1)
|
|
171
|
+
]),
|
|
169
172
|
_: 1
|
|
170
173
|
}, 8, ["data-test"]),
|
|
171
|
-
|
|
174
|
+
l(C, {
|
|
172
175
|
class: "w-full",
|
|
173
176
|
onClick: w,
|
|
174
177
|
"data-test": `${e.dataTestPrefix}-apply-filter-button`
|
|
175
178
|
}, {
|
|
176
|
-
default:
|
|
177
|
-
m(
|
|
178
|
-
])
|
|
179
|
+
default: s(() => [
|
|
180
|
+
m(f(e.buttonApplyText), 1)
|
|
181
|
+
]),
|
|
179
182
|
_: 1
|
|
180
183
|
}, 8, ["data-test"])
|
|
181
184
|
])
|
|
182
185
|
]),
|
|
183
186
|
_: 1
|
|
184
187
|
}, 8, ["visible", "data-test"]),
|
|
185
|
-
|
|
188
|
+
l(F(I), {
|
|
186
189
|
class: "am-filter-level",
|
|
187
190
|
visible: M.value,
|
|
188
191
|
position: "right",
|
|
189
192
|
"show-close-icon": !1,
|
|
190
193
|
"data-test": `${e.dataTestPrefix}-drawer-level-2`
|
|
191
194
|
}, {
|
|
192
|
-
header:
|
|
195
|
+
header: s(() => [
|
|
193
196
|
d("div", pe, [
|
|
194
|
-
|
|
197
|
+
l(N, {
|
|
195
198
|
icon: "arrow_back",
|
|
196
|
-
onClick:
|
|
199
|
+
onClick: P,
|
|
197
200
|
class: "translate-x-[-.5rem]",
|
|
198
201
|
"data-test": `${e.dataTestPrefix}-go-back-button`
|
|
199
202
|
}, null, 8, ["data-test"]),
|
|
200
|
-
|
|
203
|
+
l(L, {
|
|
201
204
|
as: "h2",
|
|
202
205
|
variant: "title",
|
|
203
206
|
size: "small",
|
|
204
207
|
"data-test": `${e.dataTestPrefix}-field-title`
|
|
205
208
|
}, {
|
|
206
|
-
default:
|
|
207
|
-
m(
|
|
209
|
+
default: s(() => [
|
|
210
|
+
m(f(c.value.label), 1)
|
|
208
211
|
]),
|
|
209
212
|
_: 1
|
|
210
213
|
}, 8, ["data-test"])
|
|
211
214
|
])
|
|
212
215
|
]),
|
|
213
|
-
default:
|
|
216
|
+
default: s(() => [
|
|
214
217
|
d("div", null, [
|
|
215
|
-
(
|
|
218
|
+
(p(), Q(W(S.value), Z({
|
|
216
219
|
modelValue: X.value,
|
|
217
220
|
"onUpdate:modelValue": Y
|
|
218
221
|
}, c.value, {
|
|
@@ -220,16 +223,16 @@ const g = (t) => new Date(t), $ = (t) => g(t).toLocaleDateString("pt-BR"), se =
|
|
|
220
223
|
}), null, 16, ["modelValue", "data-test"]))
|
|
221
224
|
])
|
|
222
225
|
]),
|
|
223
|
-
footer:
|
|
226
|
+
footer: s(() => [
|
|
224
227
|
d("div", ve, [
|
|
225
|
-
|
|
228
|
+
l(C, {
|
|
226
229
|
class: "w-full",
|
|
227
|
-
onClick:
|
|
230
|
+
onClick: P,
|
|
228
231
|
"data-test": `${e.dataTestPrefix}-confirm-button`
|
|
229
232
|
}, {
|
|
230
|
-
default:
|
|
231
|
-
m(
|
|
232
|
-
])
|
|
233
|
+
default: s(() => [
|
|
234
|
+
m(f(e.confirmButtonText), 1)
|
|
235
|
+
]),
|
|
233
236
|
_: 1
|
|
234
237
|
}, 8, ["data-test"])
|
|
235
238
|
])
|
|
@@ -240,5 +243,5 @@ const g = (t) => new Date(t), $ = (t) => g(t).toLocaleDateString("pt-BR"), se =
|
|
|
240
243
|
}
|
|
241
244
|
});
|
|
242
245
|
export {
|
|
243
|
-
|
|
246
|
+
ke as default
|
|
244
247
|
};
|
package/amtabs/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
import
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
6
|
-
|
|
1
|
+
import { defineComponent as _, mergeModels as p, ref as o, useModel as v, onMounted as b, openBlock as r, createElementBlock as u, Fragment as y, renderList as k, createBlock as V, withCtx as m, createVNode as T, createTextVNode as g, toDisplayString as x, createElementVNode as A, normalizeStyle as h } from "vue";
|
|
2
|
+
import { _ as B } from "../AmText.vue_vue_type_script_setup_true_lang-yjw50cPR.js";
|
|
3
|
+
import C from "../ambutton/index.js";
|
|
4
|
+
import { _ as E } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const M = { name: "AmTabs" }, $ = /* @__PURE__ */ _({
|
|
6
|
+
...M,
|
|
7
7
|
props: /* @__PURE__ */ p({
|
|
8
8
|
tabs: { default: () => [] },
|
|
9
9
|
modelValue: {}
|
|
@@ -12,47 +12,43 @@ const $ = { name: "AmTabs" }, w = /* @__PURE__ */ b({
|
|
|
12
12
|
modelModifiers: {}
|
|
13
13
|
}),
|
|
14
14
|
emits: ["update:modelValue"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
e && (c.value = e.clientWidth, m.value = e.offsetLeft);
|
|
23
|
-
}, 0);
|
|
15
|
+
setup(i) {
|
|
16
|
+
const n = o(0), s = o(0), t = v(i, "modelValue"), a = o(null), f = async (e) => {
|
|
17
|
+
t.value !== e && (t.value = e, c());
|
|
18
|
+
}, c = () => {
|
|
19
|
+
if (!a.value) return;
|
|
20
|
+
const e = a.value.querySelectorAll(".am-tab")[t.value];
|
|
21
|
+
e && (n.value = e.clientWidth, s.value = e.offsetLeft);
|
|
24
22
|
};
|
|
25
|
-
return
|
|
26
|
-
(t.value < 0 || t.value >= a.tabs.length) && (t.value = 0), i();
|
|
27
|
-
}), (e, r) => (n(), f("div", {
|
|
23
|
+
return b(c), (e, w) => (r(), u("div", {
|
|
28
24
|
ref_key: "parentElement",
|
|
29
|
-
ref:
|
|
25
|
+
ref: a,
|
|
30
26
|
class: "w-full flex items-center border-b border-gray-200 relative"
|
|
31
27
|
}, [
|
|
32
|
-
(
|
|
33
|
-
"data-active":
|
|
34
|
-
key:
|
|
28
|
+
(r(!0), u(y, null, k(e.tabs, (d, l) => (r(), V(C, {
|
|
29
|
+
"data-active": t.value === l,
|
|
30
|
+
key: l,
|
|
35
31
|
class: "am-tab",
|
|
36
|
-
onClick: (L) =>
|
|
32
|
+
onClick: (L) => f(l),
|
|
37
33
|
text: ""
|
|
38
34
|
}, {
|
|
39
|
-
default:
|
|
40
|
-
|
|
41
|
-
default:
|
|
42
|
-
|
|
35
|
+
default: m(() => [
|
|
36
|
+
T(B, { class: "am-tab__label" }, {
|
|
37
|
+
default: m(() => [
|
|
38
|
+
g(x(d), 1)
|
|
43
39
|
]),
|
|
44
40
|
_: 2
|
|
45
41
|
}, 1024)
|
|
46
42
|
]),
|
|
47
43
|
_: 2
|
|
48
44
|
}, 1032, ["data-active", "onClick"]))), 128)),
|
|
49
|
-
|
|
50
|
-
style:
|
|
45
|
+
A("span", {
|
|
46
|
+
style: h({ scale: `${n.value} 1`, translate: `${s.value}px` }),
|
|
51
47
|
class: "am-tab__line bg-primary-500 absolute left-0"
|
|
52
48
|
}, null, 4)
|
|
53
49
|
], 512));
|
|
54
50
|
}
|
|
55
|
-
}), z = /* @__PURE__ */
|
|
51
|
+
}), z = /* @__PURE__ */ E($, [["__scopeId", "data-v-81f00e50"]]);
|
|
56
52
|
export {
|
|
57
53
|
z as default
|
|
58
54
|
};
|