@appmax_npm/ds-prime 1.0.0-alpha.76 → 1.0.0-alpha.78
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/ambutton/index.js +13 -13
- package/amtabs/index.d.ts +15 -0
- package/amtabs/index.js +54 -0
- package/config/preset.js +2 -2
- package/css/index.css +1 -1
- package/index/index.js +2 -2
- package/package.json +1 -1
package/ambutton/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as u, computed as t, openBlock as
|
|
2
|
-
import
|
|
3
|
-
import { _ as
|
|
1
|
+
import { defineComponent as u, computed as t, openBlock as o, createBlock as n, unref as p, mergeProps as f, withCtx as c, createCommentVNode as m, createElementVNode as b, renderSlot as _ } from "vue";
|
|
2
|
+
import y from "primevue/button";
|
|
3
|
+
import { _ as v } from "../AmIcon.vue_vue_type_script_setup_true_lang-BVNnd-E1.js";
|
|
4
4
|
import { _ as B } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const g = /* @__PURE__ */ u({
|
|
6
6
|
__name: "AmButton",
|
|
@@ -27,22 +27,22 @@ const g = /* @__PURE__ */ u({
|
|
|
27
27
|
class: {},
|
|
28
28
|
style: {}
|
|
29
29
|
},
|
|
30
|
-
setup(
|
|
31
|
-
const e =
|
|
32
|
-
if (!e.disabled
|
|
33
|
-
return e.href;
|
|
30
|
+
setup(r) {
|
|
31
|
+
const e = r, a = t(() => {
|
|
32
|
+
if (!e.disabled)
|
|
33
|
+
return typeof e.to == "string" ? e.to : e.href;
|
|
34
34
|
}), s = t(() => {
|
|
35
|
-
if (!
|
|
35
|
+
if (!e.disabled)
|
|
36
36
|
return e.to;
|
|
37
|
-
}), i = t(() => e.as ? e.as : e.disabled ? "button" : e.
|
|
38
|
-
return (d, h) => (
|
|
37
|
+
}), i = t(() => e.as ? e.as : e.disabled ? "button" : e.to ? "router-link" : e.href ? "a" : "button"), l = t(() => e.disabled || e.loading);
|
|
38
|
+
return (d, h) => (o(), n(p(y), f(e, {
|
|
39
39
|
as: i.value,
|
|
40
40
|
disabled: l.value,
|
|
41
41
|
to: s.value,
|
|
42
|
-
href:
|
|
42
|
+
href: a.value
|
|
43
43
|
}), {
|
|
44
44
|
default: c(() => [
|
|
45
|
-
e.loading ? (
|
|
45
|
+
e.loading ? (o(), n(v, {
|
|
46
46
|
key: 0,
|
|
47
47
|
"data-test": "button-loading",
|
|
48
48
|
icon: "progress_activity",
|
|
@@ -55,7 +55,7 @@ const g = /* @__PURE__ */ u({
|
|
|
55
55
|
_: 3
|
|
56
56
|
}, 16, ["as", "disabled", "to", "href"]));
|
|
57
57
|
}
|
|
58
|
-
}), A = /* @__PURE__ */ B(g, [["__scopeId", "data-v-
|
|
58
|
+
}), A = /* @__PURE__ */ B(g, [["__scopeId", "data-v-3d4184e1"]]);
|
|
59
59
|
export {
|
|
60
60
|
A as default
|
|
61
61
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DefineComponent } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface AmTabsProps {
|
|
4
|
+
tabs: string[];
|
|
5
|
+
modelValue?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AmTabsSlots {}
|
|
9
|
+
|
|
10
|
+
export interface AmTabsEmits {
|
|
11
|
+
'update:modelValue': (value: number) => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const AmTabs: DefineComponent<AmTabsProps, AmTabsSlots, AmTabsEmits>;
|
|
15
|
+
export default AmTabs;
|
package/amtabs/index.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineComponent as b, mergeModels as p, ref as o, useModel as y, onMounted as V, openBlock as u, createElementBlock as m, Fragment as k, renderList as x, createVNode as i, withCtx as f, createTextVNode as T, toDisplayString as g, createElementVNode as A, normalizeStyle as h } from "vue";
|
|
2
|
+
import { _ as C } from "../AmText.vue_vue_type_script_setup_true_lang-BMNozCVT.js";
|
|
3
|
+
import E from "../ambutton/index.js";
|
|
4
|
+
import { _ as M } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const $ = { name: "AmTabs" }, w = /* @__PURE__ */ b({
|
|
6
|
+
...$,
|
|
7
|
+
props: /* @__PURE__ */ p({
|
|
8
|
+
tabs: { default: () => [] },
|
|
9
|
+
modelValue: {}
|
|
10
|
+
}, {
|
|
11
|
+
modelValue: { default: 0 },
|
|
12
|
+
modelModifiers: {}
|
|
13
|
+
}),
|
|
14
|
+
emits: ["update:modelValue"],
|
|
15
|
+
setup(r) {
|
|
16
|
+
const { tabs: d } = r, n = o(0), s = o(0), t = y(r, "modelValue"), a = o(null), _ = 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);
|
|
22
|
+
};
|
|
23
|
+
return V(c), (e, B) => (u(), m("div", {
|
|
24
|
+
ref_key: "parentElement",
|
|
25
|
+
ref: a,
|
|
26
|
+
class: "w-full flex items-center border-b border-gray-200 relative"
|
|
27
|
+
}, [
|
|
28
|
+
(u(), m(k, null, x(d, (v, l) => i(E, {
|
|
29
|
+
"data-active": t.value === l,
|
|
30
|
+
key: l,
|
|
31
|
+
class: "am-tab",
|
|
32
|
+
onClick: (L) => _(l),
|
|
33
|
+
text: ""
|
|
34
|
+
}, {
|
|
35
|
+
default: f(() => [
|
|
36
|
+
i(C, { class: "am-tab__label" }, {
|
|
37
|
+
default: f(() => [
|
|
38
|
+
T(g(v), 1)
|
|
39
|
+
]),
|
|
40
|
+
_: 2
|
|
41
|
+
}, 1024)
|
|
42
|
+
]),
|
|
43
|
+
_: 2
|
|
44
|
+
}, 1032, ["data-active", "onClick"])), 64)),
|
|
45
|
+
A("span", {
|
|
46
|
+
style: h({ scale: `${n.value} 1`, translate: `${s.value}px` }),
|
|
47
|
+
class: "am-tab__line bg-primary-500 absolute left-0"
|
|
48
|
+
}, null, 4)
|
|
49
|
+
], 512));
|
|
50
|
+
}
|
|
51
|
+
}), z = /* @__PURE__ */ M(w, [["__scopeId", "data-v-f1622eaa"]]);
|
|
52
|
+
export {
|
|
53
|
+
z as default
|
|
54
|
+
};
|
package/config/preset.js
CHANGED