abl-ui 0.5.61 → 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 +195 -199
- 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,169 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
3
|
-
key: 0,
|
|
4
|
-
class: "abl-drawer-header"
|
|
5
|
-
}, F = { class: "abl-drawer-header-title" }, j = { class: "abl-drawer-title" }, A = /* @__PURE__ */ l("span", { class: "icon iconfont-abl" }, "", -1), D = [
|
|
6
|
-
A
|
|
7
|
-
], H = { class: "abl-drawer-body" }, M = {
|
|
8
|
-
__name: "index",
|
|
9
|
-
props: {
|
|
10
|
-
modelValue: {
|
|
11
|
-
type: Boolean,
|
|
12
|
-
default: !1
|
|
13
|
-
},
|
|
14
|
-
width: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: "30%"
|
|
17
|
-
},
|
|
18
|
-
height: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "40%"
|
|
21
|
-
},
|
|
22
|
-
direction: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: "right"
|
|
25
|
-
},
|
|
26
|
-
customClass: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: ""
|
|
29
|
-
},
|
|
30
|
-
beforeClose: {
|
|
31
|
-
type: Function,
|
|
32
|
-
default: () => {
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
maskClosable: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: !0
|
|
38
|
-
},
|
|
39
|
-
title: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: ""
|
|
42
|
-
},
|
|
43
|
-
showClose: {
|
|
44
|
-
type: Boolean,
|
|
45
|
-
default: !0
|
|
46
|
-
},
|
|
47
|
-
showHeader: {
|
|
48
|
-
type: Boolean,
|
|
49
|
-
default: !0
|
|
50
|
-
},
|
|
51
|
-
footerStyle: {
|
|
52
|
-
type: Object,
|
|
53
|
-
default: () => {
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
beforeClose: {
|
|
57
|
-
type: Function
|
|
58
|
-
},
|
|
59
|
-
zIndex: {
|
|
60
|
-
type: Number,
|
|
61
|
-
default: 2e3
|
|
62
|
-
},
|
|
63
|
-
round: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: !1
|
|
66
|
-
},
|
|
67
|
-
class: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: ""
|
|
70
|
-
},
|
|
71
|
-
animate: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: !0
|
|
74
|
-
},
|
|
75
|
-
overlay: {
|
|
76
|
-
type: Boolean,
|
|
77
|
-
default: !0
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
emits: ["update:modelValue", "close", "confirm"],
|
|
81
|
-
setup(t, { emit: a }) {
|
|
82
|
-
const d = a, o = z(), y = (c) => {
|
|
83
|
-
o && (o.appContext.config.globalProperties.$lockCount = c || 0);
|
|
84
|
-
}, e = t, p = () => {
|
|
85
|
-
document.body.style.overflow = "hidden", document.body.style.touchAction = "none";
|
|
86
|
-
const c = o.appContext.config.globalProperties.$lockCount || 0;
|
|
87
|
-
y(c + 1);
|
|
88
|
-
}, h = () => {
|
|
89
|
-
o.appContext.config.globalProperties.$lockCount > 0 && y((o.appContext.config.globalProperties.$lockCount || 0) - 1), (o.appContext.config.globalProperties.$lockCount || 0) <= 0 && (document.body.style.overflow = "", document.body.style.touchAction = "");
|
|
90
|
-
};
|
|
91
|
-
_(() => {
|
|
92
|
-
e.modelValue && h();
|
|
93
|
-
}), S(() => {
|
|
94
|
-
e.modelValue ? p() : h();
|
|
95
|
-
}), I(() => {
|
|
96
|
-
e.modelValue && p();
|
|
97
|
-
}), f(() => e.disabled || e.appendTo === "self");
|
|
98
|
-
const $ = f(() => [
|
|
99
|
-
e.direction == "left" ? { top: 0, left: 0, width: e.width, height: "100%", zIndex: e.zIndex + 2 } : e.direction == "top" ? { top: 0, left: 0, width: "100%", height: e.height, zIndex: e.zIndex + 2 } : e.direction == "right" ? { top: 0, right: 0, width: e.width, height: "100%", zIndex: e.zIndex + 2 } : e.direction == "bottom" ? { bottom: 0, left: 0, width: "100%", height: e.height, zIndex: e.zIndex + 2 } : {}
|
|
100
|
-
]), v = f(() => `slide-${e.direction}`), B = () => {
|
|
101
|
-
e.maskClosable && g();
|
|
102
|
-
}, g = () => {
|
|
103
|
-
typeof e.beforeClose == "function" ? e.beforeClose() : (d("update:modelValue", !1), d("close"));
|
|
104
|
-
};
|
|
105
|
-
return (c, K) => (n(), V(P, { to: "body" }, [
|
|
106
|
-
m(k, {
|
|
107
|
-
name: "fade-popup",
|
|
108
|
-
appear: ""
|
|
109
|
-
}, {
|
|
110
|
-
default: w(() => [
|
|
111
|
-
t.modelValue && t.overlay ? (n(), s("div", {
|
|
112
|
-
key: 0,
|
|
113
|
-
class: r(["abl-drawer-mask", `${e.class}-mask`]),
|
|
114
|
-
onClick: B,
|
|
115
|
-
style: b(`z-index: ${e.zIndex}`)
|
|
116
|
-
}, null, 6)) : i("", !0)
|
|
117
|
-
]),
|
|
118
|
-
_: 1
|
|
119
|
-
}),
|
|
120
|
-
m(k, {
|
|
121
|
-
name: v.value,
|
|
122
|
-
appear: ""
|
|
123
|
-
}, {
|
|
124
|
-
default: w(() => [
|
|
125
|
-
t.modelValue ? (n(), s("div", {
|
|
126
|
-
key: 0,
|
|
127
|
-
class: r(["abl-drawer", t.customClass, `abl-drawer-${e.direction}`, t.round && "abl-drawer-round", e.class]),
|
|
128
|
-
style: b(`z-index: ${e.zIndex + 1}`)
|
|
129
|
-
}, [
|
|
130
|
-
l("div", {
|
|
131
|
-
class: "abl-drawer-content-wrapper",
|
|
132
|
-
style: b($.value)
|
|
133
|
-
}, [
|
|
134
|
-
l("div", N, [
|
|
135
|
-
l("div", T, [
|
|
136
|
-
t.showHeader ? (n(), s("div", E, [
|
|
137
|
-
u(c.$slots, "header", {}, () => [
|
|
138
|
-
l("div", F, [
|
|
139
|
-
l("span", j, x(t.title), 1)
|
|
140
|
-
]),
|
|
141
|
-
l("div", {
|
|
142
|
-
class: "abl-drawer-close-btn",
|
|
143
|
-
onClick: g,
|
|
144
|
-
type: "button"
|
|
145
|
-
}, D)
|
|
146
|
-
])
|
|
147
|
-
])) : i("", !0),
|
|
148
|
-
l("div", H, [
|
|
149
|
-
u(c.$slots, "default")
|
|
150
|
-
])
|
|
151
|
-
])
|
|
152
|
-
])
|
|
153
|
-
], 4)
|
|
154
|
-
], 6)) : i("", !0)
|
|
155
|
-
]),
|
|
156
|
-
_: 3
|
|
157
|
-
}, 8, ["name"])
|
|
158
|
-
]));
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
const O = {
|
|
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 = {
|
|
162
3
|
key: 0,
|
|
163
4
|
class: "iconfont-abl icon-abl-loading2 abl-icon-loading"
|
|
164
|
-
},
|
|
5
|
+
}, I = { class: "abl-button__text" }, P = {
|
|
165
6
|
name: "AblButton"
|
|
166
|
-
},
|
|
7
|
+
}, T = /* @__PURE__ */ Object.assign(P, {
|
|
167
8
|
props: {
|
|
168
9
|
type: {
|
|
169
10
|
type: String,
|
|
@@ -202,49 +43,204 @@ const O = {
|
|
|
202
43
|
default: "loading..."
|
|
203
44
|
}
|
|
204
45
|
},
|
|
205
|
-
setup(
|
|
206
|
-
const
|
|
207
|
-
[`abl-button-${
|
|
208
|
-
"is-dashed":
|
|
209
|
-
"is-round":
|
|
210
|
-
"is-circle":
|
|
211
|
-
"is-disabled":
|
|
46
|
+
setup(e) {
|
|
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
|
|
212
53
|
}));
|
|
213
|
-
return (
|
|
214
|
-
class: r(["abl-button",
|
|
54
|
+
return (n, i) => (a(), l("button", {
|
|
55
|
+
class: r(["abl-button", o.value])
|
|
215
56
|
}, [
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
], 64)) : (
|
|
220
|
-
|
|
221
|
-
|
|
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", {
|
|
222
63
|
key: 0,
|
|
223
|
-
class: r(["iconfont-abl slot-icon-left",
|
|
224
|
-
}, null, 2)) :
|
|
225
|
-
]) :
|
|
226
|
-
|
|
227
|
-
|
|
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")
|
|
228
69
|
]),
|
|
229
|
-
|
|
230
|
-
|
|
70
|
+
e.iconPosition === "right" ? g(n.$slots, "icon", { key: 1 }, () => [
|
|
71
|
+
e.icon ? (a(), l("i", {
|
|
231
72
|
key: 0,
|
|
232
|
-
class: r(["iconfont-abl slot-icon-right",
|
|
233
|
-
}, null, 2)) :
|
|
234
|
-
]) :
|
|
73
|
+
class: r(["iconfont-abl slot-icon-right", e.icon])
|
|
74
|
+
}, null, 2)) : h("", !0)
|
|
75
|
+
]) : h("", !0)
|
|
235
76
|
], 64))
|
|
236
77
|
], 2));
|
|
237
78
|
}
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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);
|
|
240
|
+
}), e.config.globalProperties.$lockCount = 0;
|
|
241
|
+
}, te = { install: Z };
|
|
246
242
|
export {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
243
|
+
T as ablButton,
|
|
244
|
+
X as ablRate,
|
|
245
|
+
te as default
|
|
250
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}
|