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 CHANGED
@@ -1,169 +1,10 @@
1
- import { getCurrentInstance as z, onBeforeUnmount as _, onUpdated as S, onBeforeMount as I, computed as f, openBlock as n, createBlock as V, Teleport as P, createVNode as m, Transition as k, withCtx as w, createElementBlock as s, normalizeClass as r, normalizeStyle as b, createCommentVNode as i, createElementVNode as l, renderSlot as u, toDisplayString as x, Fragment as C } from "vue";
2
- const N = { class: "abl-drawer-content" }, T = { class: "abl-drawer-wrapper-body" }, E = {
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
- }, U = { class: "abl-button__text" }, G = {
5
+ }, I = { class: "abl-button__text" }, P = {
165
6
  name: "AblButton"
166
- }, L = /* @__PURE__ */ Object.assign(G, {
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(t) {
206
- const a = t, d = f(() => ({
207
- [`abl-button-${a.type}`]: a.type,
208
- "is-dashed": a.dashed,
209
- "is-round": a.round,
210
- "is-circle": a.circle,
211
- "is-disabled": a.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 (o, y) => (n(), s("button", {
214
- class: r(["abl-button", d.value])
54
+ return (n, i) => (a(), l("button", {
55
+ class: r(["abl-button", o.value])
215
56
  }, [
216
- t.loading ? (n(), s(C, { key: 0 }, [
217
- t.loading ? (n(), s("i", O)) : i("", !0),
218
- l("span", null, x(t.loadingText), 1)
219
- ], 64)) : (n(), s(C, { key: 1 }, [
220
- t.iconPosition === "left" ? u(o.$slots, "icon", { key: 0 }, () => [
221
- t.icon ? (n(), s("i", {
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", t.icon])
224
- }, null, 2)) : i("", !0)
225
- ]) : i("", !0),
226
- l("span", U, [
227
- u(o.$slots, "default")
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
- t.iconPosition === "right" ? u(o.$slots, "icon", { key: 1 }, () => [
230
- t.icon ? (n(), s("i", {
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", t.icon])
233
- }, null, 2)) : i("", !0)
234
- ]) : i("", !0)
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
- }), q = [
239
- L,
240
- M
241
- ], J = function(t, a) {
242
- q.forEach((d) => {
243
- t.component(d.name, d);
244
- }), t.config.globalProperties.$lockCount = 0;
245
- }, R = { install: J };
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
- L as ablButton,
248
- M as ablDrawer,
249
- R as default
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(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n["abl-ui"]={},n.Vue))})(this,function(n,e){"use strict";const z="",y={class:"abl-drawer-content"},u={class:"abl-drawer-wrapper-body"},b={key:0,class:"abl-drawer-header"},h={class:"abl-drawer-header-title"},g={class:"abl-drawer-title"},k=[e.createElementVNode("span",{class:"icon iconfont-abl"},"",-1)],C={class:"abl-drawer-body"},c={__name:"index",props:{modelValue:{type:Boolean,default:!1},width:{type:String,default:"30%"},height:{type:String,default:"40%"},direction:{type:String,default:"right"},customClass:{type:String,default:""},beforeClose:{type:Function,default:()=>{}},maskClosable:{type:Boolean,default:!0},title:{type:String,default:""},showClose:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},footerStyle:{type:Object,default:()=>{}},beforeClose:{type:Function},zIndex:{type:Number,default:2e3},round:{type:Boolean,default:!1},class:{type:String,default:""},animate:{type:Boolean,default:!0},overlay:{type:Boolean,default:!0}},emits:["update:modelValue","close","confirm"],setup(o,{emit:a}){const d=a,l=e.getCurrentInstance(),s=i=>{l&&(l.appContext.config.globalProperties.$lockCount=i||0)},t=o,f=()=>{document.body.style.overflow="hidden",document.body.style.touchAction="none";const i=l.appContext.config.globalProperties.$lockCount||0;s(i+1)},m=()=>{l.appContext.config.globalProperties.$lockCount>0&&s((l.appContext.config.globalProperties.$lockCount||0)-1),(l.appContext.config.globalProperties.$lockCount||0)<=0&&(document.body.style.overflow="",document.body.style.touchAction="")};e.onBeforeUnmount(()=>{t.modelValue&&m()}),e.onUpdated(()=>{t.modelValue?f():m()}),e.onBeforeMount(()=>{t.modelValue&&f()}),e.computed(()=>t.disabled||t.appendTo==="self");const S=e.computed(()=>[t.direction=="left"?{top:0,left:0,width:t.width,height:"100%",zIndex:t.zIndex+2}:t.direction=="top"?{top:0,left:0,width:"100%",height:t.height,zIndex:t.zIndex+2}:t.direction=="right"?{top:0,right:0,width:t.width,height:"100%",zIndex:t.zIndex+2}:t.direction=="bottom"?{bottom:0,left:0,width:"100%",height:t.height,zIndex:t.zIndex+2}:{}]),_=e.computed(()=>`slide-${t.direction}`),N=()=>{t.maskClosable&&p()},p=()=>{typeof t.beforeClose=="function"?t.beforeClose():(d("update:modelValue",!1),d("close"))};return(i,T)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"fade-popup",appear:""},{default:e.withCtx(()=>[o.modelValue&&o.overlay?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["abl-drawer-mask",`${t.class}-mask`]),onClick:N,style:e.normalizeStyle(`z-index: ${t.zIndex}`)},null,6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:_.value,appear:""},{default:e.withCtx(()=>[o.modelValue?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["abl-drawer",o.customClass,`abl-drawer-${t.direction}`,o.round&&"abl-drawer-round",t.class]),style:e.normalizeStyle(`z-index: ${t.zIndex+1}`)},[e.createElementVNode("div",{class:"abl-drawer-content-wrapper",style:e.normalizeStyle(S.value)},[e.createElementVNode("div",y,[e.createElementVNode("div",u,[o.showHeader?(e.openBlock(),e.createElementBlock("div",b,[e.renderSlot(i.$slots,"header",{},()=>[e.createElementVNode("div",h,[e.createElementVNode("span",g,e.toDisplayString(o.title),1)]),e.createElementVNode("div",{class:"abl-drawer-close-btn",onClick:p,type:"button"},k)])])):e.createCommentVNode("",!0),e.createElementVNode("div",C,[e.renderSlot(i.$slots,"default")])])])],4)],6)):e.createCommentVNode("",!0)]),_:3},8,["name"])]))}},E="",B={key:0,class:"iconfont-abl icon-abl-loading2 abl-icon-loading"},V={class:"abl-button__text"},r=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(o){const a=o,d=e.computed(()=>({[`abl-button-${a.type}`]:a.type,"is-dashed":a.dashed,"is-round":a.round,"is-circle":a.circle,"is-disabled":a.disabled}));return(l,s)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["abl-button",d.value])},[o.loading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.loading?(e.openBlock(),e.createElementBlock("i",B)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(o.loadingText),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o.iconPosition==="left"?e.renderSlot(l.$slots,"icon",{key:0},()=>[o.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["iconfont-abl slot-icon-left",o.icon])},null,2)):e.createCommentVNode("",!0)]):e.createCommentVNode("",!0),e.createElementVNode("span",V,[e.renderSlot(l.$slots,"default")]),o.iconPosition==="right"?e.renderSlot(l.$slots,"icon",{key:1},()=>[o.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(["iconfont-abl slot-icon-right",o.icon])},null,2)):e.createCommentVNode("",!0)]):e.createCommentVNode("",!0)],64))],2))}}),w=[r,c],x={install:function(o,a){w.forEach(d=>{o.component(d.name,d)}),o.config.globalProperties.$lockCount=0}};n.ablButton=r,n.ablDrawer=c,n.default=x,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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
- .fade-popup-enter-active,.fade-popup-leave-active{transition:opacity .2s ease}.fade-popup-enter-from,.fade-popup-leave-to{opacity:0;transition:opacity .3s ease}.slide-left-enter-active,.slide-left-leave-active{transition:all .3s ease;transform:translate(0)}.slide-left-enter-from,.slide-left-leave-to{transform:translate(-100%)}.slide-top-enter-active,.slide-top-leave-active{transition:all .3s ease;transform:translateY(0)}.slide-top-enter-from,.slide-top-leave-to{transform:translateY(-100%)}.slide-right-enter-active,.slide-right-leave-active{transition:all .3s ease;transform:translate(0)}.slide-right-enter-from,.slide-right-leave-to{transform:translate(100%)}.slide-bottom-enter-active,.slide-bottom-leave-active{transition:all .3s ease;transform:translateY(0)}.slide-bottom-enter-from,.slide-bottom-leave-to{transform:translateY(100%)}.abl-drawer{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2001;pointer-events:none}.abl-drawer .abl-drawer-header{display:flex;align-items:center;padding:15px;font-size:16px;border-bottom:1px solid rgba(5,5,5,.06)}.abl-drawer .abl-drawer-header .abl-drawer-header-title{display:flex;flex:1;align-items:center;min-width:0;min-height:0}.abl-drawer .abl-drawer-header .abl-drawer-header-title .abl-drawer-title{flex:1;margin:0;color:var(--theme-color);font-weight:500;font-size:16px}.abl-drawer .abl-drawer-header .abl-drawer-close-btn{display:inline-flex;border:none;cursor:pointer;font-size:24px;color:var(--theme-color);outline:none}.abl-drawer .abl-drawer-header .abl-drawer-close-btn .icon{font-size:24px}.abl-drawer .abl-drawer-body{flex:1;padding:15px;overflow:auto}.abl-drawer .abl-drawer-content-wrapper{width:30%;height:100%;position:fixed;right:0;z-index:2002;background:#fff;box-shadow:0 2px 12px #0707071a}.abl-drawer .abl-drawer-content-wrapper .abl-drawer-content{width:100%;height:100%;overflow:auto;background:#ffffff;pointer-events:auto}.abl-drawer .abl-drawer-content-wrapper .abl-drawer-content .abl-drawer-wrapper-body{display:flex;flex-direction:column;width:100%;height:100%}.abl-drawer .abl-drawer-content-wrapper .abl-drawer-content .abl-drawer-wrapper-body .abl-drawer-footer{flex-shrink:0;padding:24px;border-top:1px solid rgba(5,5,5,.06)}.abl-drawer-round.abl-drawer-bottom .abl-drawer-content-wrapper,.abl-drawer-round.abl-drawer-bottom .abl-drawer-content{border-radius:12px 12px 0 0}.abl-drawer-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;background:rgba(0,0,0,.45);pointer-events:auto}.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)}}
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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abl-ui",
3
- "version": "0.5.61",
3
+ "version": "0.5.63",
4
4
  "main": "./lib/abl-ui.es.js",
5
5
  "directories": {
6
6
  "lib": "lib"