abl-ui 0.5.62 → 0.5.63
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/lib/abl-ui.es.js +193 -209
- package/lib/abl-ui.umd.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/abl-ui.es.js
CHANGED
|
@@ -1,181 +1,10 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
const
|
|
3
|
-
for (let e = 0; e < 256; ++e)
|
|
4
|
-
o.push((e + 256).toString(16).slice(1));
|
|
5
|
-
function R(e, t = 0) {
|
|
6
|
-
return (o[e[t + 0]] + o[e[t + 1]] + o[e[t + 2]] + o[e[t + 3]] + "-" + o[e[t + 4]] + o[e[t + 5]] + "-" + o[e[t + 6]] + o[e[t + 7]] + "-" + o[e[t + 8]] + o[e[t + 9]] + "-" + o[e[t + 10]] + o[e[t + 11]] + o[e[t + 12]] + o[e[t + 13]] + o[e[t + 14]] + o[e[t + 15]]).toLowerCase();
|
|
7
|
-
}
|
|
8
|
-
let w;
|
|
9
|
-
const V = new Uint8Array(16);
|
|
10
|
-
function C() {
|
|
11
|
-
if (!w) {
|
|
12
|
-
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
13
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
14
|
-
w = crypto.getRandomValues.bind(crypto);
|
|
15
|
-
}
|
|
16
|
-
return w(V);
|
|
17
|
-
}
|
|
18
|
-
const T = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), H = { randomUUID: T };
|
|
19
|
-
function N(e, t, l) {
|
|
20
|
-
var r;
|
|
21
|
-
if (H.randomUUID && !t && !e)
|
|
22
|
-
return H.randomUUID();
|
|
23
|
-
e = e || {};
|
|
24
|
-
const c = e.random ?? ((r = e.rng) == null ? void 0 : r.call(e)) ?? C();
|
|
25
|
-
if (c.length < 16)
|
|
26
|
-
throw new Error("Random bytes length must be >= 16");
|
|
27
|
-
if (c[6] = c[6] & 15 | 64, c[8] = c[8] & 63 | 128, t) {
|
|
28
|
-
if (l = l || 0, l < 0 || l + 16 > t.length)
|
|
29
|
-
throw new RangeError(`UUID byte range ${l}:${l + 15} is out of buffer bounds`);
|
|
30
|
-
for (let h = 0; h < 16; ++h)
|
|
31
|
-
t[l + h] = c[h];
|
|
32
|
-
return t;
|
|
33
|
-
}
|
|
34
|
-
return R(c);
|
|
35
|
-
}
|
|
36
|
-
const P = { class: "abl-table" }, A = ["id"], j = { class: "gridtable" }, z = { class: "table-thead" }, F = ["id"], M = { class: "gridtable" }, O = { key: 0 }, q = ["colspan"], G = /* @__PURE__ */ i("div", { class: "no-data-div" }, [
|
|
37
|
-
/* @__PURE__ */ i("div", { class: "empty-center" })
|
|
38
|
-
], -1), J = [
|
|
39
|
-
G
|
|
40
|
-
], K = {
|
|
41
|
-
__name: "index",
|
|
42
|
-
props: {
|
|
43
|
-
name: "abl-table",
|
|
44
|
-
data: {
|
|
45
|
-
type: Array,
|
|
46
|
-
default: []
|
|
47
|
-
},
|
|
48
|
-
columns: {
|
|
49
|
-
type: Array,
|
|
50
|
-
default: []
|
|
51
|
-
},
|
|
52
|
-
border: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: !1
|
|
55
|
-
},
|
|
56
|
-
height: {
|
|
57
|
-
type: Number,
|
|
58
|
-
default: null
|
|
59
|
-
},
|
|
60
|
-
stripe: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: !1
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
setup(e, { emit: t }) {
|
|
66
|
-
const l = e, c = S(() => ({
|
|
67
|
-
maxHeight: l.height ? l.height + "px" : ""
|
|
68
|
-
})), r = B(), h = B(), f = B({
|
|
69
|
-
bodyHandler: null,
|
|
70
|
-
headHandler: null
|
|
71
|
-
});
|
|
72
|
-
$(async () => {
|
|
73
|
-
r.value = N(), await I();
|
|
74
|
-
const d = document.getElementById("tableBody" + r.value), y = document.getElementById("tableHead" + r.value);
|
|
75
|
-
if (!d)
|
|
76
|
-
return;
|
|
77
|
-
(d == null ? void 0 : d.scrollHeight) > (d == null ? void 0 : d.clientHeight) ? h.value = {
|
|
78
|
-
width: "calc(100% - 2px)",
|
|
79
|
-
paddingRight: "2px"
|
|
80
|
-
} : h.value = {};
|
|
81
|
-
let u = !1;
|
|
82
|
-
function g(x, L) {
|
|
83
|
-
u || (u = !0, L.scrollLeft = x == null ? void 0 : x.scrollLeft, u = !1);
|
|
84
|
-
}
|
|
85
|
-
f.value.bodyHandler = () => g(d, y), f.value.headHandler = () => g(y, d), d.addEventListener("scroll", f.value.bodyHandler, { passive: !0 }), y.addEventListener("scroll", f.value.headHandler, { passive: !0 });
|
|
86
|
-
}), D(() => {
|
|
87
|
-
const d = document.getElementById("tableBody" + r.value), y = document.getElementById("tableHead" + r.value);
|
|
88
|
-
d && d.removeEventListener("scroll", f.value.bodyHandler, { passive: !0 }), y && y.removeEventListener("scroll", f.value.headHandler, { passive: !0 });
|
|
89
|
-
});
|
|
90
|
-
const U = (d) => {
|
|
91
|
-
let y = document.getElementsByClassName("table-fixed-column--left");
|
|
92
|
-
d.target.scrollLeft > 0 ? [...y].forEach((s) => {
|
|
93
|
-
s.classList.add("box-shadow");
|
|
94
|
-
}) : [...y].forEach((s) => {
|
|
95
|
-
s.classList.remove("box-shadow");
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
return (d, y) => (n(), a("section", null, [
|
|
99
|
-
i("div", P, [
|
|
100
|
-
i("div", {
|
|
101
|
-
class: v(["table__inner-wrapper", e.border ? "has-table-border" : ""]),
|
|
102
|
-
id: "box"
|
|
103
|
-
}, [
|
|
104
|
-
i("div", {
|
|
105
|
-
class: "table__head",
|
|
106
|
-
id: r.value ? "tableHead" + r.value : "",
|
|
107
|
-
style: p(h.value)
|
|
108
|
-
}, [
|
|
109
|
-
i("table", j, [
|
|
110
|
-
i("colgroup", null, [
|
|
111
|
-
(n(!0), a(b, null, _(l.columns, (s, u) => (n(), a("col", {
|
|
112
|
-
key: u,
|
|
113
|
-
style: p({ width: s.width || "50px" })
|
|
114
|
-
}, null, 4))), 128))
|
|
115
|
-
]),
|
|
116
|
-
i("thead", z, [
|
|
117
|
-
i("tr", null, [
|
|
118
|
-
(n(!0), a(b, null, _(l.columns, (s, u) => (n(), a("th", {
|
|
119
|
-
key: u,
|
|
120
|
-
class: v(s.fixed == "left" ? "table-fixed-column--left" : s.fixed == "right" ? "table-fixed-column--right" : "")
|
|
121
|
-
}, [
|
|
122
|
-
i("div", {
|
|
123
|
-
class: "cell",
|
|
124
|
-
style: p({ "text-align": s.align || "left" })
|
|
125
|
-
}, E(s.title), 5)
|
|
126
|
-
], 2))), 128))
|
|
127
|
-
])
|
|
128
|
-
])
|
|
129
|
-
])
|
|
130
|
-
], 12, A),
|
|
131
|
-
i("div", {
|
|
132
|
-
style: p(c.value),
|
|
133
|
-
class: "table__body",
|
|
134
|
-
id: r.value ? "tableBody" + r.value : "",
|
|
135
|
-
onScroll: U
|
|
136
|
-
}, [
|
|
137
|
-
i("table", M, [
|
|
138
|
-
i("colgroup", null, [
|
|
139
|
-
(n(!0), a(b, null, _(l.columns, (s, u) => (n(), a("col", {
|
|
140
|
-
key: u,
|
|
141
|
-
class: "",
|
|
142
|
-
style: p({ width: s.width || "50px" })
|
|
143
|
-
}, null, 4))), 128))
|
|
144
|
-
]),
|
|
145
|
-
l.data.length > 0 ? (n(), a("tbody", O, [
|
|
146
|
-
(n(!0), a(b, null, _(l.data, (s, u) => (n(), a("tr", {
|
|
147
|
-
key: u,
|
|
148
|
-
class: v([{ "tr-selected": s.selected, "tr-stripe": l.stripe && u % 2 == 0 }])
|
|
149
|
-
}, [
|
|
150
|
-
(n(!0), a(b, null, _(e.columns, (g, x) => (n(), a("td", {
|
|
151
|
-
key: x,
|
|
152
|
-
class: v(g.fixed == "left" ? "table-fixed-column--left" : g.fixed == "right" ? "table-fixed-column--right" : "")
|
|
153
|
-
}, [
|
|
154
|
-
i("div", {
|
|
155
|
-
class: "cell",
|
|
156
|
-
style: p({ "text-align": g.align || "left" })
|
|
157
|
-
}, E(s[g.prop]), 5)
|
|
158
|
-
], 2))), 128))
|
|
159
|
-
], 2))), 128))
|
|
160
|
-
])) : m("", !0)
|
|
161
|
-
])
|
|
162
|
-
], 44, F),
|
|
163
|
-
l.data.length == 0 ? (n(), a("div", {
|
|
164
|
-
key: 0,
|
|
165
|
-
class: "no-data-td",
|
|
166
|
-
colspan: l.columns.length
|
|
167
|
-
}, J, 8, q)) : m("", !0)
|
|
168
|
-
], 2)
|
|
169
|
-
])
|
|
170
|
-
]));
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
const Q = {
|
|
1
|
+
import { computed as M, openBlock as a, createElementBlock as l, normalizeClass as r, Fragment as b, createCommentVNode as h, createElementVNode as f, toDisplayString as k, renderSlot as g, ref as x, watch as V, normalizeStyle as d, renderList as S, withModifiers as z, createTextVNode as w, pushScopeId as N, popScopeId as E } from "vue";
|
|
2
|
+
const H = {
|
|
174
3
|
key: 0,
|
|
175
4
|
class: "iconfont-abl icon-abl-loading2 abl-icon-loading"
|
|
176
|
-
},
|
|
5
|
+
}, I = { class: "abl-button__text" }, P = {
|
|
177
6
|
name: "AblButton"
|
|
178
|
-
},
|
|
7
|
+
}, T = /* @__PURE__ */ Object.assign(P, {
|
|
179
8
|
props: {
|
|
180
9
|
type: {
|
|
181
10
|
type: String,
|
|
@@ -215,48 +44,203 @@ const Q = {
|
|
|
215
44
|
}
|
|
216
45
|
},
|
|
217
46
|
setup(e) {
|
|
218
|
-
const
|
|
219
|
-
[`abl-button-${
|
|
220
|
-
"is-dashed":
|
|
221
|
-
"is-round":
|
|
222
|
-
"is-circle":
|
|
223
|
-
"is-disabled":
|
|
47
|
+
const c = e, o = M(() => ({
|
|
48
|
+
[`abl-button-${c.type}`]: c.type,
|
|
49
|
+
"is-dashed": c.dashed,
|
|
50
|
+
"is-round": c.round,
|
|
51
|
+
"is-circle": c.circle,
|
|
52
|
+
"is-disabled": c.disabled
|
|
224
53
|
}));
|
|
225
|
-
return (
|
|
226
|
-
class:
|
|
54
|
+
return (n, i) => (a(), l("button", {
|
|
55
|
+
class: r(["abl-button", o.value])
|
|
227
56
|
}, [
|
|
228
|
-
e.loading ? (
|
|
229
|
-
e.loading ? (
|
|
230
|
-
|
|
231
|
-
], 64)) : (
|
|
232
|
-
e.iconPosition === "left" ?
|
|
233
|
-
e.icon ? (
|
|
57
|
+
e.loading ? (a(), l(b, { key: 0 }, [
|
|
58
|
+
e.loading ? (a(), l("i", H)) : h("", !0),
|
|
59
|
+
f("span", null, k(e.loadingText), 1)
|
|
60
|
+
], 64)) : (a(), l(b, { key: 1 }, [
|
|
61
|
+
e.iconPosition === "left" ? g(n.$slots, "icon", { key: 0 }, () => [
|
|
62
|
+
e.icon ? (a(), l("i", {
|
|
234
63
|
key: 0,
|
|
235
|
-
class:
|
|
236
|
-
}, null, 2)) :
|
|
237
|
-
]) :
|
|
238
|
-
|
|
239
|
-
|
|
64
|
+
class: r(["iconfont-abl slot-icon-left", e.icon])
|
|
65
|
+
}, null, 2)) : h("", !0)
|
|
66
|
+
]) : h("", !0),
|
|
67
|
+
f("span", I, [
|
|
68
|
+
g(n.$slots, "default")
|
|
240
69
|
]),
|
|
241
|
-
e.iconPosition === "right" ?
|
|
242
|
-
e.icon ? (
|
|
70
|
+
e.iconPosition === "right" ? g(n.$slots, "icon", { key: 1 }, () => [
|
|
71
|
+
e.icon ? (a(), l("i", {
|
|
243
72
|
key: 0,
|
|
244
|
-
class:
|
|
245
|
-
}, null, 2)) :
|
|
246
|
-
]) :
|
|
73
|
+
class: r(["iconfont-abl slot-icon-right", e.icon])
|
|
74
|
+
}, null, 2)) : h("", !0)
|
|
75
|
+
]) : h("", !0)
|
|
247
76
|
], 64))
|
|
248
77
|
], 2));
|
|
249
78
|
}
|
|
250
|
-
})
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
79
|
+
});
|
|
80
|
+
const D = (e, c) => {
|
|
81
|
+
const o = e.__vccOpts || e;
|
|
82
|
+
for (const [n, i] of c)
|
|
83
|
+
o[n] = i;
|
|
84
|
+
return o;
|
|
85
|
+
}, v = (e) => (N("data-v-60739909"), e = e(), E(), e), F = ["onClick"], O = ["onClick", "onMouseenter"], j = /* @__PURE__ */ v(() => /* @__PURE__ */ f("path", { d: "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" }, null, -1)), R = [
|
|
86
|
+
j
|
|
87
|
+
], q = /* @__PURE__ */ v(() => /* @__PURE__ */ f("path", { d: "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z" }, null, -1)), A = [
|
|
88
|
+
q
|
|
89
|
+
], G = ["onClick", "onMouseenter"], J = /* @__PURE__ */ v(() => /* @__PURE__ */ f("path", { d: "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z" }, null, -1)), K = [
|
|
90
|
+
J
|
|
91
|
+
], Q = /* @__PURE__ */ v(() => /* @__PURE__ */ f("path", { d: "M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z" }, null, -1)), U = [
|
|
92
|
+
Q
|
|
93
|
+
], W = {
|
|
94
|
+
__name: "index",
|
|
95
|
+
props: {
|
|
96
|
+
modelValue: {
|
|
97
|
+
type: Number,
|
|
98
|
+
default: 0
|
|
99
|
+
},
|
|
100
|
+
allowClear: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: !1
|
|
103
|
+
},
|
|
104
|
+
allowHalf: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: !1
|
|
107
|
+
},
|
|
108
|
+
character: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: "star-filled"
|
|
111
|
+
},
|
|
112
|
+
size: {
|
|
113
|
+
type: Number,
|
|
114
|
+
default: 18
|
|
115
|
+
},
|
|
116
|
+
color: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: "#ffb400"
|
|
119
|
+
},
|
|
120
|
+
gap: {
|
|
121
|
+
type: Number,
|
|
122
|
+
default: 4
|
|
123
|
+
},
|
|
124
|
+
readonly: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: !1
|
|
127
|
+
},
|
|
128
|
+
count: {
|
|
129
|
+
type: Number,
|
|
130
|
+
default: 5
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
emits: ["update:modelValue", "change", "hoverChange"],
|
|
134
|
+
setup(e, { emit: c }) {
|
|
135
|
+
const o = e, n = x(o.modelValue), i = x();
|
|
136
|
+
V(
|
|
137
|
+
() => o.modelValue,
|
|
138
|
+
(t) => {
|
|
139
|
+
n.value = t;
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
const u = c, m = (t) => {
|
|
143
|
+
i.value = null, t !== o.modelValue ? (u("change", t), u("update:modelValue", t)) : o.allowClear ? (i.value = t, u("change", 0), u("update:modelValue", 0)) : u("change", t);
|
|
144
|
+
}, L = (t) => {
|
|
145
|
+
n.value = t, u("hoverChange", t);
|
|
146
|
+
}, p = (t) => {
|
|
147
|
+
n.value = t, u("hoverChange", t);
|
|
148
|
+
}, $ = () => {
|
|
149
|
+
i.value = null;
|
|
150
|
+
}, B = () => {
|
|
151
|
+
n.value = o.modelValue;
|
|
152
|
+
}, C = (t) => {
|
|
153
|
+
t.preventDefault();
|
|
154
|
+
};
|
|
155
|
+
return (t, _) => (a(), l("div", {
|
|
156
|
+
class: r(["abl-rate", { disabled: e.readonly }]),
|
|
157
|
+
style: d(`--color: ${e.color};`),
|
|
158
|
+
onMouseleave: B
|
|
159
|
+
}, [
|
|
160
|
+
(a(!0), l(b, null, S(e.count, (s) => (a(), l("div", {
|
|
161
|
+
class: r(["abl-rate-star", { "abl-rate-star-half": e.allowHalf && n.value >= s - 0.5 && n.value < s, "abl-rate-star-full": n.value >= s, "temp-gray": !e.allowHalf && i.value === s }]),
|
|
162
|
+
style: d(`margin-right: ${s !== e.count ? e.gap : 0}px;`),
|
|
163
|
+
onClick: (y) => e.allowHalf ? C(y) : m(s),
|
|
164
|
+
key: s
|
|
165
|
+
}, [
|
|
166
|
+
e.allowHalf ? (a(), l("div", {
|
|
167
|
+
key: 0,
|
|
168
|
+
class: r(["abl-rate-star-first", { "temp-gray-first": i.value === s - 0.5 }]),
|
|
169
|
+
onClick: z((y) => m(s - 0.5), ["stop"]),
|
|
170
|
+
onMouseenter: (y) => L(s - 0.5),
|
|
171
|
+
onMouseleave: $
|
|
172
|
+
}, [
|
|
173
|
+
e.character === "star-filled" ? (a(), l("svg", {
|
|
174
|
+
key: 0,
|
|
175
|
+
class: "action-star",
|
|
176
|
+
style: d(`width: ${e.size}px;`),
|
|
177
|
+
focusable: "false",
|
|
178
|
+
"data-icon": "star",
|
|
179
|
+
"aria-hidden": "true",
|
|
180
|
+
viewBox: "64 64 896 896"
|
|
181
|
+
}, R, 4)) : e.character === "star-outlined" ? (a(), l("svg", {
|
|
182
|
+
key: 1,
|
|
183
|
+
class: "action-star",
|
|
184
|
+
style: d(`width: ${e.size}px;`),
|
|
185
|
+
focusable: "false",
|
|
186
|
+
"data-icon": "star",
|
|
187
|
+
"aria-hidden": "true",
|
|
188
|
+
viewBox: "64 64 896 896"
|
|
189
|
+
}, A, 4)) : (a(), l("span", {
|
|
190
|
+
key: 2,
|
|
191
|
+
class: "action-star",
|
|
192
|
+
style: d(`font-size: ${0.66 * e.size}px; height: ${e.size}px;`)
|
|
193
|
+
}, [
|
|
194
|
+
g(t.$slots, "character", {}, () => [
|
|
195
|
+
w(k(e.character), 1)
|
|
196
|
+
], !0)
|
|
197
|
+
], 4))
|
|
198
|
+
], 42, O)) : h("", !0),
|
|
199
|
+
f("div", {
|
|
200
|
+
class: r(["abl-rate-star-second", { "temp-gray-second": i.value === s }]),
|
|
201
|
+
onClick: z((y) => m(s), ["stop"]),
|
|
202
|
+
onMouseenter: (y) => p(s),
|
|
203
|
+
onMouseleave: $
|
|
204
|
+
}, [
|
|
205
|
+
e.character === "star-filled" ? (a(), l("svg", {
|
|
206
|
+
key: 0,
|
|
207
|
+
class: "action-star",
|
|
208
|
+
style: d(`width: ${e.size}px;`),
|
|
209
|
+
focusable: "false",
|
|
210
|
+
"data-icon": "star",
|
|
211
|
+
"aria-hidden": "true",
|
|
212
|
+
viewBox: "64 64 896 896"
|
|
213
|
+
}, K, 4)) : e.character === "star-outlined" ? (a(), l("svg", {
|
|
214
|
+
key: 1,
|
|
215
|
+
class: "action-star",
|
|
216
|
+
style: d(`width: ${e.size}px;`),
|
|
217
|
+
focusable: "false",
|
|
218
|
+
"data-icon": "star",
|
|
219
|
+
"aria-hidden": "true",
|
|
220
|
+
viewBox: "64 64 896 896"
|
|
221
|
+
}, U, 4)) : (a(), l("span", {
|
|
222
|
+
key: 2,
|
|
223
|
+
class: "action-star",
|
|
224
|
+
style: d(`font-size: ${0.66 * e.size}px; height: ${e.size}px;`)
|
|
225
|
+
}, [
|
|
226
|
+
g(t.$slots, "character", {}, () => [
|
|
227
|
+
w(k(e.character), 1)
|
|
228
|
+
], !0)
|
|
229
|
+
], 4))
|
|
230
|
+
], 42, G)
|
|
231
|
+
], 14, F))), 128))
|
|
232
|
+
], 38));
|
|
233
|
+
}
|
|
234
|
+
}, X = /* @__PURE__ */ D(W, [["__scopeId", "data-v-60739909"]]), Y = [
|
|
235
|
+
T,
|
|
236
|
+
X
|
|
237
|
+
], Z = function(e, c) {
|
|
238
|
+
Y.forEach((o) => {
|
|
239
|
+
e.component(o.name, o);
|
|
256
240
|
}), e.config.globalProperties.$lockCount = 0;
|
|
257
|
-
},
|
|
241
|
+
}, te = { install: Z };
|
|
258
242
|
export {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
243
|
+
T as ablButton,
|
|
244
|
+
X as ablRate,
|
|
245
|
+
te as default
|
|
262
246
|
};
|
package/lib/abl-ui.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s["abl-ui"]={},s.Vue))})(this,function(s,e){"use strict";const _="",u={key:0,class:"iconfont-abl icon-abl-loading2 abl-icon-loading"},g={class:"abl-button__text"},h=Object.assign({name:"AblButton"},{props:{type:{type:String,default:"default"},dashed:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},round:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},icon:{type:String,default:""},iconPosition:{type:String,default:"left"},loading:{type:Boolean,default:!1},loadingText:{type:String,default:"loading..."}},setup(t){const c=t,a=e.computed(()=>({[`abl-button-${c.type}`]:c.type,"is-dashed":c.dashed,"is-round":c.round,"is-circle":c.circle,"is-disabled":c.disabled}));return(o,i)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["abl-button",a.value])},[t.loading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.loading?(e.openBlock(),e.createElementBlock("i",u)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.loadingText),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.iconPosition==="left"?e.renderSlot(o.$slots,"icon",{key:0},()=>[t.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["iconfont-abl slot-icon-left",t.icon])},null,2)):e.createCommentVNode("",!0)]):e.createCommentVNode("",!0),e.createElementVNode("span",g,[e.renderSlot(o.$slots,"default")]),t.iconPosition==="right"?e.renderSlot(o.$slots,"icon",{key:1},()=>[t.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["iconfont-abl slot-icon-right",t.icon])},null,2)):e.createCommentVNode("",!0)]):e.createCommentVNode("",!0)],64))],2))}}),D="",B=(t,c)=>{const a=t.__vccOpts||t;for(const[o,i]of c)a[o]=i;return a},f=t=>(e.pushScopeId("data-v-60739909"),t=t(),e.popScopeId(),t),b=["onClick"],p=["onClick","onMouseenter"],z=[f(()=>e.createElementVNode("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"},null,-1))],S=[f(()=>e.createElementVNode("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"},null,-1))],V=["onClick","onMouseenter"],C=[f(()=>e.createElementVNode("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3z"},null,-1))],E=[f(()=>e.createElementVNode("path",{d:"M908.1 353.1l-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3a32.05 32.05 0 00.6 45.3l183.7 179.1-43.4 252.9a31.95 31.95 0 0046.4 33.7L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3zM664.8 561.6l36.1 210.3L512 672.7 323.1 772l36.1-210.3-152.8-149L417.6 382 512 190.7 606.4 382l211.2 30.7-152.8 148.9z"},null,-1))],y=B({__name:"index",props:{modelValue:{type:Number,default:0},allowClear:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},character:{type:String,default:"star-filled"},size:{type:Number,default:18},color:{type:String,default:"#ffb400"},gap:{type:Number,default:4},readonly:{type:Boolean,default:!1},count:{type:Number,default:5}},emits:["update:modelValue","change","hoverChange"],setup(t,{emit:c}){const a=t,o=e.ref(a.modelValue),i=e.ref();e.watch(()=>a.modelValue,l=>{o.value=l});const r=c,m=l=>{i.value=null,l!==a.modelValue?(r("change",l),r("update:modelValue",l)):a.allowClear?(i.value=l,r("change",0),r("update:modelValue",0)):r("change",l)},w=l=>{o.value=l,r("hoverChange",l)},N=l=>{o.value=l,r("hoverChange",l)},k=()=>{i.value=null},L=()=>{o.value=a.modelValue},M=l=>{l.preventDefault()};return(l,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["abl-rate",{disabled:t.readonly}]),style:e.normalizeStyle(`--color: ${t.color};`),onMouseleave:L},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.count,n=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["abl-rate-star",{"abl-rate-star-half":t.allowHalf&&o.value>=n-.5&&o.value<n,"abl-rate-star-full":o.value>=n,"temp-gray":!t.allowHalf&&i.value===n}]),style:e.normalizeStyle(`margin-right: ${n!==t.count?t.gap:0}px;`),onClick:d=>t.allowHalf?M(d):m(n),key:n},[t.allowHalf?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["abl-rate-star-first",{"temp-gray-first":i.value===n-.5}]),onClick:e.withModifiers(d=>m(n-.5),["stop"]),onMouseenter:d=>w(n-.5),onMouseleave:k},[t.character==="star-filled"?(e.openBlock(),e.createElementBlock("svg",{key:0,class:"action-star",style:e.normalizeStyle(`width: ${t.size}px;`),focusable:"false","data-icon":"star","aria-hidden":"true",viewBox:"64 64 896 896"},z,4)):t.character==="star-outlined"?(e.openBlock(),e.createElementBlock("svg",{key:1,class:"action-star",style:e.normalizeStyle(`width: ${t.size}px;`),focusable:"false","data-icon":"star","aria-hidden":"true",viewBox:"64 64 896 896"},S,4)):(e.openBlock(),e.createElementBlock("span",{key:2,class:"action-star",style:e.normalizeStyle(`font-size: ${.66*t.size}px; height: ${t.size}px;`)},[e.renderSlot(l.$slots,"character",{},()=>[e.createTextVNode(e.toDisplayString(t.character),1)],!0)],4))],42,p)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["abl-rate-star-second",{"temp-gray-second":i.value===n}]),onClick:e.withModifiers(d=>m(n),["stop"]),onMouseenter:d=>N(n),onMouseleave:k},[t.character==="star-filled"?(e.openBlock(),e.createElementBlock("svg",{key:0,class:"action-star",style:e.normalizeStyle(`width: ${t.size}px;`),focusable:"false","data-icon":"star","aria-hidden":"true",viewBox:"64 64 896 896"},C,4)):t.character==="star-outlined"?(e.openBlock(),e.createElementBlock("svg",{key:1,class:"action-star",style:e.normalizeStyle(`width: ${t.size}px;`),focusable:"false","data-icon":"star","aria-hidden":"true",viewBox:"64 64 896 896"},E,4)):(e.openBlock(),e.createElementBlock("span",{key:2,class:"action-star",style:e.normalizeStyle(`font-size: ${.66*t.size}px; height: ${t.size}px;`)},[e.renderSlot(l.$slots,"character",{},()=>[e.createTextVNode(e.toDisplayString(t.character),1)],!0)],4))],42,V)],14,b))),128))],38))}},[["__scopeId","data-v-60739909"]]),$=[h,y],x={install:function(t,c){$.forEach(a=>{t.component(a.name,a)}),t.config.globalProperties.$lockCount=0}};s.ablButton=h,s.ablRate=y,s.default=x,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.abl-button{box-sizing:border-box;font-size:14px;background-color:#fff;padding:0 15px;height:40px;cursor:pointer;display:inline-flex;justify-content:center;align-items:center;border-radius:4px;transition:all .25s;color:#111;border:1px solid #d9d9d9;-webkit-user-select:none;user-select:none}.abl-button:focus{outline:none}.abl-button::-moz-focus-inner{border:0}.abl-button.is-circle{border-radius:100%;width:40px}.abl-button.is-round{border-radius:20px}.abl-button.abl-button-default:hover{color:#111;border-color:#111}.abl-button.abl-button-default:active{opacity:1}.abl-button.abl-button-default.is-dashed{border-style:dashed}.abl-button.abl-button-primary{background-color:#111;border-color:#111;color:#fff}.abl-button.abl-button-primary:hover{opacity:.9}.abl-button.abl-button-primary:active{opacity:1}.abl-button.abl-button-primary.is-disabled{cursor:not-allowed;opacity:.5}.abl-button.abl-button-primary.is-disabled:hover{opacity:.5}.abl-button.abl-button-primary.is-dashed{border-style:dashed;background-color:#fff!important;color:#111}.abl-button.abl-button-info{background-color:#909399;border-color:#909399;color:#fff}.abl-button.abl-button-info:hover{opacity:.9}.abl-button.abl-button-info:active{opacity:1}.abl-button.abl-button-info.is-disabled{cursor:not-allowed;opacity:.5}.abl-button.abl-button-info.is-disabled:hover{opacity:.5}.abl-button.abl-button-info.is-dashed{border-style:dashed;background-color:#fff!important;color:#909399}.abl-button.abl-button-success{background-color:#67c23a;border-color:#67c23a;color:#fff}.abl-button.abl-button-success:hover{opacity:.8}.abl-button.abl-button-success:active{opacity:1}.abl-button.abl-button-success.is-disabled{cursor:not-allowed;opacity:.5}.abl-button.abl-button-success.is-disabled:hover{opacity:.5}.abl-button.abl-button-success.is-dashed{border-style:dashed;background-color:#fff!important;color:#67c23a}.abl-button.abl-button-warning{background-color:#e6a23c;border-color:#e6a23c;color:#fff}.abl-button.abl-button-warning:hover{opacity:.8}.abl-button.abl-button-warning:active{opacity:1}.abl-button.abl-button-warning.is-disabled{cursor:not-allowed;opacity:.5}.abl-button.abl-button-warning.is-disabled:hover{opacity:.5}.abl-button.abl-button-warning.is-dashed{border-style:dashed;background-color:#fff!important;color:#e6a23c}.abl-button.abl-button-danger{background-color:#f56c6c;border-color:#f56c6c;color:#fff}.abl-button.abl-button-danger:hover{opacity:.8}.abl-button.abl-button-danger:active{opacity:1}.abl-button.abl-button-danger.is-disabled{cursor:not-allowed;opacity:.5}.abl-button.abl-button-danger.is-disabled:hover{opacity:.5}.abl-button.abl-button-danger.is-dashed{border-style:dashed;background-color:#fff!important;color:#f56c6c}.abl-button>.abl-icon-loading{margin-right:4px;animation:abl-spin 1s infinite linear}.abl-button>.slot-icon-left{margin-right:5px}.abl-button>.slot-icon-right{margin-left:5px}@keyframes abl-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.abl-rate[data-v-60739909]{display:inline-block}.abl-rate .abl-rate-star[data-v-60739909]{position:relative;display:inline-block;cursor:pointer;transition:transform .3s ease-in-out}.abl-rate .abl-rate-star[data-v-60739909]:hover{transform:scale(1.1)}.abl-rate .abl-rate-star .action-star[data-v-60739909]{display:inline-flex;align-items:center;text-align:center;vertical-align:middle;fill:#0000000f;color:#0000000f;transition:all .3s}.abl-rate .abl-rate-star .abl-rate-star-first[data-v-60739909]{position:absolute;top:0;width:50%;height:100%;opacity:0;overflow:hidden;transition:all .3s}.abl-rate .abl-rate-star .abl-rate-star-first[data-v-60739909]:hover{opacity:1}.abl-rate .abl-rate-star .abl-rate-star-first:hover .action-star[data-v-60739909]{fill:var(--color);color:var(--color)}.abl-rate .abl-rate-star .abl-rate-star-second[data-v-60739909]{display:inline-block}.abl-rate .abl-rate-star .abl-rate-star-second:hover .action-star[data-v-60739909]{fill:var(--color);color:var(--color)}.abl-rate .abl-rate-star .temp-gray-first[data-v-60739909]:hover{opacity:0}.abl-rate .abl-rate-star .temp-gray-first:hover .action-star[data-v-60739909],.abl-rate .abl-rate-star .temp-gray-second:hover .action-star[data-v-60739909]{fill:#0000000f;color:#0000000f}.abl-rate .abl-rate-star-half .abl-rate-star-first[data-v-60739909]{opacity:1}.abl-rate .abl-rate-star-half .abl-rate-star-first .action-star[data-v-60739909],.abl-rate .abl-rate-star-full .abl-rate-star-second .action-star[data-v-60739909]{fill:var(--color);color:var(--color)}.disabled[data-v-60739909]{pointer-events:none}
|