abl-ui 0.5.55 → 0.5.56

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,246 +1,89 @@
1
- import { openBlock as d, createElementBlock as n, normalizeStyle as y, renderSlot as S, createElementVNode as o, normalizeClass as _, createTextVNode as U, toDisplayString as H, createCommentVNode as E, createStaticVNode as L, computed as C, ref as x, onMounted as M, nextTick as I, onUnmounted as $, Fragment as b, renderList as f, createVNode as F } from "vue";
2
- const a = [];
3
- for (let e = 0; e < 256; ++e)
4
- a.push((e + 256).toString(16).slice(1));
5
- function D(e, t = 0) {
6
- return (a[e[t + 0]] + a[e[t + 1]] + a[e[t + 2]] + a[e[t + 3]] + "-" + a[e[t + 4]] + a[e[t + 5]] + "-" + a[e[t + 6]] + a[e[t + 7]] + "-" + a[e[t + 8]] + a[e[t + 9]] + "-" + a[e[t + 10]] + a[e[t + 11]] + a[e[t + 12]] + a[e[t + 13]] + a[e[t + 14]] + a[e[t + 15]]).toLowerCase();
7
- }
8
- let w;
9
- const N = new Uint8Array(16);
10
- function R() {
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(N);
17
- }
18
- const A = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), V = { randomUUID: A };
19
- function T(e, t, l) {
20
- var r;
21
- if (V.randomUUID && !t && !e)
22
- return V.randomUUID();
23
- e = e || {};
24
- const u = e.random ?? ((r = e.rng) == null ? void 0 : r.call(e)) ?? R();
25
- if (u.length < 16)
26
- throw new Error("Random bytes length must be >= 16");
27
- if (u[6] = u[6] & 15 | 64, u[8] = u[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 v = 0; v < 16; ++v)
31
- t[l + v] = u[v];
32
- return t;
33
- }
34
- return D(u);
35
- }
36
- const k = (e, t) => {
37
- const l = e.__vccOpts || e;
38
- for (const [u, r] of t)
39
- l[u] = r;
40
- return l;
41
- }, j = { class: "abl-empty" }, O = /* @__PURE__ */ L('<g fill="none" fill-rule="evenodd" data-v-4c40dcbd><g transform="translate(24 31.67)" data-v-4c40dcbd><ellipse fill-opacity=".8" fill="#F5F5F7" cx="67.797" cy="106.89" rx="67.797" ry="12.668" data-v-4c40dcbd></ellipse><path d="M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z" fill="#AEB8C2" data-v-4c40dcbd></path><path d="M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z" fill="url(#linearGradient-1)" transform="translate(13.56)" data-v-4c40dcbd></path><path d="M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z" fill="#F5F5F7" data-v-4c40dcbd></path><path d="M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z" fill="#DCE0E6" data-v-4c40dcbd></path></g><path d="M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z" fill="#DCE0E6" data-v-4c40dcbd></path><g transform="translate(149.65 15.383)" fill="#FFF" data-v-4c40dcbd><ellipse cx="20.654" cy="3.167" rx="2.849" ry="2.815" data-v-4c40dcbd></ellipse><path d="M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z" data-v-4c40dcbd></path></g></g>', 1), G = [
42
- O
43
- ], P = /* @__PURE__ */ L('<g transform="translate(0 1)" fill="none" fill-rule="evenodd" data-v-4c40dcbd><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7" data-v-4c40dcbd></ellipse><g fill-rule="nonzero" stroke="#d9d9d9" data-v-4c40dcbd><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" data-v-4c40dcbd></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa" data-v-4c40dcbd></path></g></g>', 1), q = [
44
- P
45
- ], J = ["src"], K = {
46
- __name: "index",
1
+ import { computed as r, openBlock as n, createElementBlock as o, normalizeClass as s, Fragment as d, createCommentVNode as l, createElementVNode as u, toDisplayString as f, renderSlot as c } from "vue";
2
+ const y = {
3
+ key: 0,
4
+ class: "iconfont-abl icon-abl-loading2 abl-icon-loading"
5
+ }, g = { class: "abl-button__text" }, b = {
6
+ name: "AblButton"
7
+ }, m = /* @__PURE__ */ Object.assign(b, {
47
8
  props: {
48
- name: "abl-empty",
49
- description: {
9
+ type: {
50
10
  type: String,
51
- default: ""
11
+ default: "default"
52
12
  },
53
- image: {
54
- type: String,
55
- default: "1"
13
+ dashed: {
14
+ type: Boolean,
15
+ default: !1
56
16
  },
57
- imageStyle: {
58
- type: Object,
59
- default: {}
60
- }
61
- },
62
- setup(e) {
63
- return (t, l) => (d(), n("div", j, [
64
- e.image === "1" ? (d(), n("svg", {
65
- key: 0,
66
- class: "abl-u-empty-1",
67
- style: y(e.imageStyle),
68
- viewBox: "0 0 184 152",
69
- xmlns: "http://www.w3.org/2000/svg"
70
- }, G, 4)) : e.image === "2" ? (d(), n("svg", {
71
- key: 1,
72
- class: "abl-u-empty-2",
73
- style: y(e.imageStyle),
74
- viewBox: "0 0 64 41",
75
- xmlns: "http://www.w3.org/2000/svg"
76
- }, q, 4)) : S(t.$slots, "default", { key: 2 }, () => [
77
- o("img", {
78
- class: "abl-u-empty",
79
- src: e.image,
80
- style: y(e.imageStyle),
81
- alt: "image"
82
- }, null, 12, J)
83
- ], !0),
84
- e.description ? (d(), n("p", {
85
- key: 3,
86
- class: _(["u-description", { gray: e.image === "2" }])
87
- }, [
88
- S(t.$slots, "description", {}, () => [
89
- U(H(e.description), 1)
90
- ], !0)
91
- ], 2)) : E("", !0)
92
- ]));
93
- }
94
- }, Q = /* @__PURE__ */ k(K, [["__scopeId", "data-v-4c40dcbd"]]);
95
- const W = { class: "abl-table" }, X = ["id"], Y = { class: "gridtable" }, Z = { class: "table-thead" }, ee = ["id"], te = { class: "gridtable" }, le = { key: 0 }, ae = ["colspan"], de = { class: "no-data-div" }, ne = { class: "empty-center" }, ce = {
96
- __name: "index",
97
- props: {
98
- name: "abl-table",
99
- data: {
100
- type: Array,
101
- default: []
17
+ circle: {
18
+ type: Boolean,
19
+ default: !1
102
20
  },
103
- columns: {
104
- type: Array,
105
- default: []
21
+ round: {
22
+ type: Boolean,
23
+ default: !1
106
24
  },
107
- border: {
25
+ disabled: {
108
26
  type: Boolean,
109
27
  default: !1
110
28
  },
111
- height: {
112
- type: Number,
113
- default: null
29
+ icon: {
30
+ type: String,
31
+ default: ""
114
32
  },
115
- stripe: {
33
+ iconPosition: {
34
+ type: String,
35
+ default: "left"
36
+ },
37
+ loading: {
116
38
  type: Boolean,
117
39
  default: !1
40
+ },
41
+ loadingText: {
42
+ type: String,
43
+ default: "loading..."
118
44
  }
119
45
  },
120
- setup(e, { emit: t }) {
121
- const l = e, u = C(() => ({
122
- maxHeight: l.height ? l.height + "px" : ""
123
- })), r = x(), v = x(), p = x({
124
- bodyHandler: null,
125
- headHandler: null
126
- });
127
- M(async () => {
128
- r.value = T(), await I();
129
- const c = document.getElementById("tableBody" + r.value), h = document.getElementById("tableHead" + r.value);
130
- if (!c)
131
- return;
132
- (c == null ? void 0 : c.scrollHeight) > (c == null ? void 0 : c.clientHeight) ? v.value = {
133
- width: "calc(100% - 2px)",
134
- paddingRight: "2px"
135
- } : v.value = {};
136
- let i = !1;
137
- function g(m, z) {
138
- i || (i = !0, z.scrollLeft = m == null ? void 0 : m.scrollLeft, i = !1);
139
- }
140
- p.value.bodyHandler = () => g(c, h), p.value.headHandler = () => g(h, c), c.addEventListener("scroll", p.value.bodyHandler, { passive: !0 }), h.addEventListener("scroll", p.value.headHandler, { passive: !0 });
141
- }), $(() => {
142
- const c = document.getElementById("tableBody" + r.value), h = document.getElementById("tableHead" + r.value);
143
- c && c.removeEventListener("scroll", p.value.bodyHandler, { passive: !0 }), h && h.removeEventListener("scroll", p.value.headHandler, { passive: !0 });
144
- });
145
- const B = (c) => {
146
- let h = document.getElementsByClassName("table-fixed-column--left");
147
- c.target.scrollLeft > 0 ? [...h].forEach((s) => {
148
- s.classList.add("box-shadow");
149
- }) : [...h].forEach((s) => {
150
- s.classList.remove("box-shadow");
151
- });
152
- };
153
- return (c, h) => (d(), n("section", null, [
154
- o("div", W, [
155
- o("div", {
156
- class: _(["table__inner-wrapper", e.border ? "has-table-border" : ""]),
157
- id: "box"
158
- }, [
159
- o("div", {
160
- class: "table__head",
161
- id: r.value ? "tableHead" + r.value : "",
162
- style: y(v.value)
163
- }, [
164
- o("table", Y, [
165
- o("colgroup", null, [
166
- (d(!0), n(b, null, f(l.columns, (s, i) => (d(), n("col", {
167
- key: i,
168
- style: y({ width: s.width || "50px" })
169
- }, null, 4))), 128))
170
- ]),
171
- o("thead", Z, [
172
- o("tr", null, [
173
- (d(!0), n(b, null, f(l.columns, (s, i) => (d(), n("th", {
174
- key: i,
175
- class: _(s.fixed == "left" ? "table-fixed-column--left" : s.fixed == "right" ? "table-fixed-column--right" : "")
176
- }, [
177
- o("div", {
178
- class: "cell",
179
- style: y({ "text-align": s.align || "left" })
180
- }, H(s.title), 5)
181
- ], 2))), 128))
182
- ])
183
- ])
184
- ])
185
- ], 12, X),
186
- o("div", {
187
- style: y(u.value),
188
- class: "table__body",
189
- id: r.value ? "tableBody" + r.value : "",
190
- onScroll: B
191
- }, [
192
- o("table", te, [
193
- o("colgroup", null, [
194
- (d(!0), n(b, null, f(l.columns, (s, i) => (d(), n("col", {
195
- key: i,
196
- class: "",
197
- style: y({ width: s.width || "50px" })
198
- }, null, 4))), 128))
199
- ]),
200
- l.data.length > 0 ? (d(), n("tbody", le, [
201
- (d(!0), n(b, null, f(l.data, (s, i) => (d(), n("tr", {
202
- key: i,
203
- class: _([{ "tr-selected": s.selected, "tr-stripe": l.stripe && i % 2 == 0 }])
204
- }, [
205
- (d(!0), n(b, null, f(e.columns, (g, m) => (d(), n("td", {
206
- key: m,
207
- class: _(g.fixed == "left" ? "table-fixed-column--left" : g.fixed == "right" ? "table-fixed-column--right" : "")
208
- }, [
209
- o("div", {
210
- class: "cell",
211
- style: y({ "text-align": g.align || "left" })
212
- }, H(s[g.prop]), 5)
213
- ], 2))), 128))
214
- ], 2))), 128))
215
- ])) : E("", !0)
216
- ])
217
- ], 44, ee),
218
- l.data.length == 0 ? (d(), n("div", {
46
+ setup(e) {
47
+ const t = e, a = r(() => ({
48
+ [`abl-button-${t.type}`]: t.type,
49
+ "is-dashed": t.dashed,
50
+ "is-round": t.round,
51
+ "is-circle": t.circle,
52
+ "is-disabled": t.disabled
53
+ }));
54
+ return (i, B) => (n(), o("button", {
55
+ class: s(["abl-button", a.value])
56
+ }, [
57
+ e.loading ? (n(), o(d, { key: 0 }, [
58
+ e.loading ? (n(), o("i", y)) : l("", !0),
59
+ u("span", null, f(e.loadingText), 1)
60
+ ], 64)) : (n(), o(d, { key: 1 }, [
61
+ e.iconPosition === "left" ? c(i.$slots, "icon", { key: 0 }, () => [
62
+ e.icon ? (n(), o("i", {
63
+ key: 0,
64
+ class: s(["iconfont-abl slot-icon-left", e.icon])
65
+ }, null, 2)) : l("", !0)
66
+ ]) : l("", !0),
67
+ u("span", g, [
68
+ c(i.$slots, "default")
69
+ ]),
70
+ e.iconPosition === "right" ? c(i.$slots, "icon", { key: 1 }, () => [
71
+ e.icon ? (n(), o("i", {
219
72
  key: 0,
220
- class: "no-data-td",
221
- colspan: l.columns.length
222
- }, [
223
- o("div", de, [
224
- o("div", ne, [
225
- F(Q, {
226
- image: "1",
227
- description: "No Data"
228
- })
229
- ])
230
- ])
231
- ], 8, ae)) : E("", !0)
232
- ], 2)
233
- ])
234
- ]));
73
+ class: s(["iconfont-abl slot-icon-right", e.icon])
74
+ }, null, 2)) : l("", !0)
75
+ ]) : l("", !0)
76
+ ], 64))
77
+ ], 2));
235
78
  }
236
- }, se = /* @__PURE__ */ k(ce, [["__scopeId", "data-v-c284cd51"]]), oe = [
237
- se
238
- ], re = function(e, t) {
239
- oe.forEach((l) => {
240
- e.component(l.name, l);
79
+ }), k = [
80
+ m
81
+ ], h = function(e, t) {
82
+ k.forEach((a) => {
83
+ e.component(a.name, a);
241
84
  }), e.config.globalProperties.$lockCount = 0;
242
- }, ue = { install: re };
85
+ }, S = { install: h };
243
86
  export {
244
- se as ablTable,
245
- ue as default
87
+ m as ablButton,
88
+ S as default
246
89
  };
package/lib/abl-ui.umd.js CHANGED
@@ -1 +1 @@
1
- (function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m["abl-ui"]={},m.Vue))})(this,function(m,e){"use strict";const n=[];for(let t=0;t<256;++t)n.push((t+256).toString(16).slice(1));function u(t,l=0){return(n[t[l+0]]+n[t[l+1]]+n[t[l+2]]+n[t[l+3]]+"-"+n[t[l+4]]+n[t[l+5]]+"-"+n[t[l+6]]+n[t[l+7]]+"-"+n[t[l+8]]+n[t[l+9]]+"-"+n[t[l+10]]+n[t[l+11]]+n[t[l+12]]+n[t[l+13]]+n[t[l+14]]+n[t[l+15]]).toLowerCase()}let b;const k=new Uint8Array(16);function x(){if(!b){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");b=crypto.getRandomValues.bind(crypto)}return b(k)}const f={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function B(t,l,a){var o;if(f.randomUUID&&!l&&!t)return f.randomUUID();t=t||{};const s=t.random??((o=t.rng)==null?void 0:o.call(t))??x();if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,l){if(a=a||0,a<0||a+16>l.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let h=0;h<16;++h)l[a+h]=s[h];return l}return u(s)}const q="",_=(t,l)=>{const a=t.__vccOpts||t;for(const[s,o]of l)a[s]=o;return a},V={class:"abl-empty"},S=[e.createStaticVNode('<g fill="none" fill-rule="evenodd" data-v-4c40dcbd><g transform="translate(24 31.67)" data-v-4c40dcbd><ellipse fill-opacity=".8" fill="#F5F5F7" cx="67.797" cy="106.89" rx="67.797" ry="12.668" data-v-4c40dcbd></ellipse><path d="M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z" fill="#AEB8C2" data-v-4c40dcbd></path><path d="M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z" fill="url(#linearGradient-1)" transform="translate(13.56)" data-v-4c40dcbd></path><path d="M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z" fill="#F5F5F7" data-v-4c40dcbd></path><path d="M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z" fill="#DCE0E6" data-v-4c40dcbd></path></g><path d="M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z" fill="#DCE0E6" data-v-4c40dcbd></path><g transform="translate(149.65 15.383)" fill="#FFF" data-v-4c40dcbd><ellipse cx="20.654" cy="3.167" rx="2.849" ry="2.815" data-v-4c40dcbd></ellipse><path d="M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z" data-v-4c40dcbd></path></g></g>',1)],w=[e.createStaticVNode('<g transform="translate(0 1)" fill="none" fill-rule="evenodd" data-v-4c40dcbd><ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7" data-v-4c40dcbd></ellipse><g fill-rule="nonzero" stroke="#d9d9d9" data-v-4c40dcbd><path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" data-v-4c40dcbd></path><path d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z" fill="#fafafa" data-v-4c40dcbd></path></g></g>',1)],z=["src"],H=_({__name:"index",props:{name:"abl-empty",description:{type:String,default:""},image:{type:String,default:"1"},imageStyle:{type:Object,default:{}}},setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("div",V,[t.image==="1"?(e.openBlock(),e.createElementBlock("svg",{key:0,class:"abl-u-empty-1",style:e.normalizeStyle(t.imageStyle),viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},S,4)):t.image==="2"?(e.openBlock(),e.createElementBlock("svg",{key:1,class:"abl-u-empty-2",style:e.normalizeStyle(t.imageStyle),viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},w,4)):e.renderSlot(l.$slots,"default",{key:2},()=>[e.createElementVNode("img",{class:"abl-u-empty",src:t.image,style:e.normalizeStyle(t.imageStyle),alt:"image"},null,12,z)],!0),t.description?(e.openBlock(),e.createElementBlock("p",{key:3,class:e.normalizeClass(["u-description",{gray:t.image==="2"}])},[e.renderSlot(l.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(t.description),1)],!0)],2)):e.createCommentVNode("",!0)]))}},[["__scopeId","data-v-4c40dcbd"]]),Q="",N={class:"abl-table"},L=["id"],C={class:"gridtable"},U={class:"table-thead"},F=["id"],M={class:"gridtable"},$={key:0},D=["colspan"],I={class:"no-data-div"},T={class:"empty-center"},E=_({__name:"index",props:{name:"abl-table",data:{type:Array,default:[]},columns:{type:Array,default:[]},border:{type:Boolean,default:!1},height:{type:Number,default:null},stripe:{type:Boolean,default:!1}},setup(t,{emit:l}){const a=t,s=e.computed(()=>({maxHeight:a.height?a.height+"px":""})),o=e.ref(),h=e.ref(),p=e.ref({bodyHandler:null,headHandler:null});e.onMounted(async()=>{o.value=B(),await e.nextTick();const c=document.getElementById("tableBody"+o.value),i=document.getElementById("tableHead"+o.value);if(!c)return;(c==null?void 0:c.scrollHeight)>(c==null?void 0:c.clientHeight)?h.value={width:"calc(100% - 2px)",paddingRight:"2px"}:h.value={};let r=!1;function y(g,O){r||(r=!0,O.scrollLeft=g==null?void 0:g.scrollLeft,r=!1)}p.value.bodyHandler=()=>y(c,i),p.value.headHandler=()=>y(i,c),c.addEventListener("scroll",p.value.bodyHandler,{passive:!0}),i.addEventListener("scroll",p.value.headHandler,{passive:!0})}),e.onUnmounted(()=>{const c=document.getElementById("tableBody"+o.value),i=document.getElementById("tableHead"+o.value);c&&c.removeEventListener("scroll",p.value.bodyHandler,{passive:!0}),i&&i.removeEventListener("scroll",p.value.headHandler,{passive:!0})});const A=c=>{let i=document.getElementsByClassName("table-fixed-column--left");c.target.scrollLeft>0?[...i].forEach(d=>{d.classList.add("box-shadow")}):[...i].forEach(d=>{d.classList.remove("box-shadow")})};return(c,i)=>(e.openBlock(),e.createElementBlock("section",null,[e.createElementVNode("div",N,[e.createElementVNode("div",{class:e.normalizeClass(["table__inner-wrapper",t.border?"has-table-border":""]),id:"box"},[e.createElementVNode("div",{class:"table__head",id:o.value?"tableHead"+o.value:"",style:e.normalizeStyle(h.value)},[e.createElementVNode("table",C,[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,(d,r)=>(e.openBlock(),e.createElementBlock("col",{key:r,style:e.normalizeStyle({width:d.width||"50px"})},null,4))),128))]),e.createElementVNode("thead",U,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,(d,r)=>(e.openBlock(),e.createElementBlock("th",{key:r,class:e.normalizeClass(d.fixed=="left"?"table-fixed-column--left":d.fixed=="right"?"table-fixed-column--right":"")},[e.createElementVNode("div",{class:"cell",style:e.normalizeStyle({"text-align":d.align||"left"})},e.toDisplayString(d.title),5)],2))),128))])])])],12,L),e.createElementVNode("div",{style:e.normalizeStyle(s.value),class:"table__body",id:o.value?"tableBody"+o.value:"",onScroll:A},[e.createElementVNode("table",M,[e.createElementVNode("colgroup",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.columns,(d,r)=>(e.openBlock(),e.createElementBlock("col",{key:r,class:"",style:e.normalizeStyle({width:d.width||"50px"})},null,4))),128))]),a.data.length>0?(e.openBlock(),e.createElementBlock("tbody",$,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.data,(d,r)=>(e.openBlock(),e.createElementBlock("tr",{key:r,class:e.normalizeClass([{"tr-selected":d.selected,"tr-stripe":a.stripe&&r%2==0}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,(y,g)=>(e.openBlock(),e.createElementBlock("td",{key:g,class:e.normalizeClass(y.fixed=="left"?"table-fixed-column--left":y.fixed=="right"?"table-fixed-column--right":"")},[e.createElementVNode("div",{class:"cell",style:e.normalizeStyle({"text-align":y.align||"left"})},e.toDisplayString(d[y.prop]),5)],2))),128))],2))),128))])):e.createCommentVNode("",!0)])],44,F),a.data.length==0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"no-data-td",colspan:a.columns.length},[e.createElementVNode("div",I,[e.createElementVNode("div",T,[e.createVNode(H,{image:"1",description:"No Data"})])])],8,D)):e.createCommentVNode("",!0)],2)])]))}},[["__scopeId","data-v-c284cd51"]]),R=[E],j={install:function(t,l){R.forEach(a=>{t.component(a.name,a)}),t.config.globalProperties.$lockCount=0}};m.ablTable=E,m.default=j,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
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 f="",c={key:0,class:"iconfont-abl icon-abl-loading2 abl-icon-loading"},s={class:"abl-button__text"},i=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 o=t,l=e.computed(()=>({[`abl-button-${o.type}`]:o.type,"is-dashed":o.dashed,"is-round":o.round,"is-circle":o.circle,"is-disabled":o.disabled}));return(a,y)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["abl-button",l.value])},[t.loading?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.loading?(e.openBlock(),e.createElementBlock("i",c)):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(a.$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",s,[e.renderSlot(a.$slots,"default")]),t.iconPosition==="right"?e.renderSlot(a.$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=[i],r={install:function(t,o){d.forEach(l=>{t.component(l.name,l)}),t.config.globalProperties.$lockCount=0}};n.ablButton=i,n.default=r,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/lib/style.css CHANGED
@@ -1 +1 @@
1
- @charset "UTF-8";.abl-empty[data-v-4c40dcbd]{text-align:center}.abl-empty .abl-u-empty[data-v-4c40dcbd]{display:inline-block;vertical-align:bottom}.abl-empty .abl-u-empty-1[data-v-4c40dcbd]{display:inline-block;vertical-align:bottom;width:184px;height:100px}.abl-empty .abl-u-empty-2[data-v-4c40dcbd]{display:inline-block;vertical-align:bottom;width:64px;height:40px}.abl-empty .u-description[data-v-4c40dcbd]{margin-top:8px;font-size:14px;color:#00000094;line-height:1.5714285714}.abl-empty .gray[data-v-4c40dcbd]{color:#00000040}.table__inner-wrapper[data-v-c284cd51]{width:100%;position:relative;border:none;overflow:hidden}.table__body[data-v-c284cd51]{overflow-x:auto;overflow-y:auto;width:100%}.table__head[data-v-c284cd51]{overflow-x:auto;background-color:#f9f9f9;box-sizing:content-box}.table__head[data-v-c284cd51]::-webkit-scrollbar{display:none}.table__body[data-v-c284cd51]::-webkit-scrollbar{width:2px;height:4px}.table__body[data-v-c284cd51]::-webkit-scrollbar-thumb{background-color:#f1f1f1;border-radius:4px}.table__body[data-v-c284cd51]::-webkit-scrollbar-track{background-color:#fff}table.gridtable[data-v-c284cd51]{font-size:13px;color:#333;border-width:1px;border-color:#ccc;border-collapse:collapse;width:100%;table-layout:fixed}table.gridtable .tr-selected[data-v-c284cd51]{background-color:#faf4ec}table.gridtable .table-thead[data-v-c284cd51]{color:#909399;position:sticky;top:0}table.gridtable .table-thead th[data-v-c284cd51]{padding:16px 0;font-weight:500;border-bottom:1px solid #ebeef5;min-width:0;box-sizing:border-box;text-overflow:ellipsis}table.gridtable .table-thead th .cell[data-v-c284cd51]{padding:0 12px;box-sizing:border-box;overflow:hidden;white-space:normal;overflow-wrap:break-word;line-height:1.2}table.gridtable td[data-v-c284cd51]{padding:16px 0;color:#606266;border-bottom:1px solid #ebeef5;min-width:0;box-sizing:border-box;text-overflow:ellipsis}table.gridtable td .cell[data-v-c284cd51]{padding:0 12px;box-sizing:border-box;overflow:hidden;white-space:normal;overflow-wrap:break-word;line-height:1.2}table.gridtable .table-fixed-column--left[data-v-c284cd51]{position:sticky!important;left:0;background:inherit;background-color:#fff}table.gridtable th.table-fixed-column--left[data-v-c284cd51]{background-color:#f9f9f9}table.gridtable .box-shadow[data-v-c284cd51]{box-shadow:inset -10px 0 10px -10px #00000026}table.gridtable .tr-stripe[data-v-c284cd51]{background-color:#faf4ec}table.gridtable .tr-stripe .table-fixed-column--left[data-v-c284cd51]{background-color:#faf4ec!important}.table__body tr[data-v-c284cd51]:hover,.table__body tr:hover .table-fixed-column--left[data-v-c284cd51]{background-color:#faf4ec}.no-data-td[data-v-c284cd51]{text-align:center;left:0;position:sticky}.no-data-td .no-data-div[data-v-c284cd51]{width:100%;height:140px;padding-top:10px}.has-table-border[data-v-c284cd51]{border:1px solid #ebeef5}.has-table-border td[data-v-c284cd51],.has-table-border th[data-v-c284cd51]{border-bottom:1px solid #ebeef5;border-right:1px solid #ebeef5}.has-table-border tr:last-child td[data-v-c284cd51]{border-bottom:none}.has-table-border td[data-v-c284cd51]:last-child{border-right:none}.has-table-border th[data-v-c284cd51]:last-child{border-bottom:none;border-right:none}
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)}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abl-ui",
3
- "version": "0.5.55",
3
+ "version": "0.5.56",
4
4
  "main": "./lib/abl-ui.es.js",
5
5
  "directories": {
6
6
  "lib": "lib"