btt-ui 1.0.25 → 1.0.35
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/es/index.mjs +58 -50
- package/es/src/checkbox/index.mjs +6 -6
- package/es/src/countUp/index.mjs +7 -0
- package/es/src/countUp/src/countUp.mjs +48 -0
- package/es/src/countUp/src/index.mjs +103 -0
- package/es/src/countUp/src/style/index.css +6 -0
- package/es/src/directives/bubble.mjs +24 -21
- package/es/src/gradientText/index.mjs +7 -0
- package/es/src/gradientText/src/style/index.css +9 -0
- package/es/src/gradientText/src/text.mjs +24 -0
- package/es/src/index.mjs +92 -80
- package/es/src/numberScroll/index.mjs +7 -0
- package/es/src/numberScroll/src/index.mjs +59 -0
- package/es/src/numberScroll/src/number.mjs +42 -0
- package/es/src/numberScroll/src/style/index.css +32 -0
- package/es/src/table/index.mjs +7 -0
- package/es/src/table/src/style/index.css +83 -0
- package/es/src/table/src/table.mjs +165 -0
- package/es/src/wheel/wheel.mjs +10 -10
- package/es/src/xgplay/src/style/index.css +0 -2
- package/lib/index.js +1 -1
- package/lib/src/checkbox/index.js +1 -1
- package/lib/src/countUp/index.js +1 -0
- package/lib/src/countUp/src/countUp.js +1 -0
- package/lib/src/countUp/src/index.js +1 -0
- package/lib/src/countUp/src/style/index.css +6 -0
- package/lib/src/directives/bubble.js +1 -1
- package/lib/src/gradientText/index.js +1 -0
- package/lib/src/gradientText/src/style/index.css +9 -0
- package/lib/src/gradientText/src/text.js +1 -0
- package/lib/src/index.js +1 -1
- package/lib/src/numberScroll/index.js +1 -0
- package/lib/src/numberScroll/src/index.js +14 -0
- package/lib/src/numberScroll/src/number.js +1 -0
- package/lib/src/numberScroll/src/style/index.css +32 -0
- package/lib/src/table/index.js +1 -0
- package/lib/src/table/src/style/index.css +83 -0
- package/lib/src/table/src/table.js +1 -0
- package/lib/src/wheel/wheel.js +1 -1
- package/lib/src/xgplay/src/style/index.css +0 -2
- package/package.json +2 -2
package/es/index.mjs
CHANGED
|
@@ -1,83 +1,91 @@
|
|
|
1
|
-
import
|
|
1
|
+
import p from "./src/index.mjs";
|
|
2
2
|
import * as m from "./src/directives/index.mjs";
|
|
3
3
|
import { Button as s } from "./src/button/index.mjs";
|
|
4
4
|
import { TextButton as u } from "./src/textButton/index.mjs";
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
5
|
+
import { default as K } from "./src/link/index.mjs";
|
|
6
|
+
import { default as b } from "./src/upload/index.mjs";
|
|
7
|
+
import { default as k } from "./src/shake/index.mjs";
|
|
8
|
+
import { default as S } from "./src/dialog/index.mjs";
|
|
9
9
|
import { default as g } from "./src/scroll/index.mjs";
|
|
10
10
|
import { default as y } from "./src/toast/index.mjs";
|
|
11
11
|
import { default as H } from "./src/wheel/index.mjs";
|
|
12
12
|
import { Switch as L } from "./src/switch/index.mjs";
|
|
13
|
-
import { Timeline as
|
|
14
|
-
import { default as
|
|
15
|
-
import { Card as
|
|
16
|
-
import { HotMap as
|
|
17
|
-
import { KTree as
|
|
18
|
-
import { KCheckbox as
|
|
19
|
-
import { KCollapse as
|
|
13
|
+
import { Timeline as U } from "./src/timeline/index.mjs";
|
|
14
|
+
import { default as G } from "./src/uploadFile/index.mjs";
|
|
15
|
+
import { Card as j } from "./src/card/index.mjs";
|
|
16
|
+
import { HotMap as F } from "./src/hotmap/index.mjs";
|
|
17
|
+
import { KTree as V } from "./src/tree/index.mjs";
|
|
18
|
+
import { KCheckbox as $, KCheckbox as q } from "./src/checkbox/index.mjs";
|
|
19
|
+
import { KCollapse as A, KCollapseItem as J } from "./src/collapse/index.mjs";
|
|
20
20
|
import { Sign as Q } from "./src/sign/index.mjs";
|
|
21
21
|
import { ECharts as X } from "./src/echarts/index.mjs";
|
|
22
22
|
import { TableScroll as Z } from "./src/tableScroll/index.mjs";
|
|
23
|
-
import { default as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
import { default as oo } from "./src/xgplay/index.mjs";
|
|
24
|
+
import { KNumberScroll as to } from "./src/numberScroll/index.mjs";
|
|
25
|
+
import { KCountUp as fo } from "./src/countUp/index.mjs";
|
|
26
|
+
import { KGradientText as mo } from "./src/gradientText/index.mjs";
|
|
27
|
+
import { KTable as lo } from "./src/table/index.mjs";
|
|
28
|
+
import { Icon as no } from "./src/icon/index.mjs";
|
|
29
|
+
import { Tooltip as so } from "./src/tooltip/index.mjs";
|
|
30
|
+
import { KInput as co } from "./src/input/index.mjs";
|
|
31
|
+
import { Drag as To } from "./src/drag/index.mjs";
|
|
32
|
+
import { KOption as ho, KSelect as ko } from "./src/select/index.mjs";
|
|
33
|
+
const e = function(t, r) {
|
|
34
|
+
if (e.installed)
|
|
31
35
|
return;
|
|
32
|
-
|
|
36
|
+
e.installed = !0;
|
|
33
37
|
let f = "2026-03-02 09:30:00";
|
|
34
38
|
if (r)
|
|
35
39
|
setTimeout(() => {
|
|
36
40
|
var a;
|
|
37
|
-
let
|
|
38
|
-
Date.now() >
|
|
41
|
+
let o = new Date((a = r.token) != null ? a : f).getTime();
|
|
42
|
+
Date.now() > o && (document.body.innerHTML = "");
|
|
39
43
|
}, 10);
|
|
40
44
|
else {
|
|
41
|
-
let
|
|
42
|
-
Date.now() >
|
|
45
|
+
let o = new Date(f).getTime();
|
|
46
|
+
Date.now() > o && (document.body.innerHTML = "");
|
|
43
47
|
}
|
|
44
|
-
|
|
45
|
-
t.use(
|
|
46
|
-
}), Object.keys(m).forEach((
|
|
47
|
-
t.directive(
|
|
48
|
+
p.forEach((o) => {
|
|
49
|
+
t.use(o);
|
|
50
|
+
}), Object.keys(m).forEach((o) => {
|
|
51
|
+
t.directive(o, m[o]);
|
|
48
52
|
});
|
|
49
53
|
}, x = {
|
|
50
|
-
install:
|
|
54
|
+
install: e
|
|
51
55
|
};
|
|
52
56
|
export {
|
|
53
57
|
s as Button,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
j as Card,
|
|
59
|
+
S as Dialog,
|
|
60
|
+
To as Drag,
|
|
57
61
|
X as ECharts,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
F as HotMap,
|
|
63
|
+
no as Icon,
|
|
64
|
+
$ as KCheckbox,
|
|
65
|
+
q as KCheckboxGroup,
|
|
66
|
+
A as KCollapse,
|
|
67
|
+
J as KCollapseItem,
|
|
68
|
+
fo as KCountUp,
|
|
69
|
+
mo as KGradientText,
|
|
70
|
+
co as KInput,
|
|
71
|
+
to as KNumberScroll,
|
|
72
|
+
ho as KOption,
|
|
73
|
+
ko as KSelect,
|
|
74
|
+
lo as KTable,
|
|
75
|
+
oo as KVideo,
|
|
76
|
+
K as Link,
|
|
69
77
|
g as Scroll,
|
|
70
|
-
|
|
78
|
+
k as Shake,
|
|
71
79
|
Q as Sign,
|
|
72
80
|
L as Switch,
|
|
73
81
|
Z as TableScroll,
|
|
74
82
|
u as TextButton,
|
|
75
|
-
|
|
83
|
+
U as Timeline,
|
|
76
84
|
y as Toast,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
85
|
+
so as Tooltip,
|
|
86
|
+
V as Tree,
|
|
87
|
+
b as Upload,
|
|
88
|
+
G as UploadFile,
|
|
81
89
|
H as Wheel,
|
|
82
90
|
x as default
|
|
83
91
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { withInstall as o } from "../../assets/ts/utils.mjs";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import m from "./src/checkbox2.mjs";
|
|
3
|
+
import t from "./src/checkbox-group.mjs";
|
|
4
|
+
const a = o(m);
|
|
5
|
+
o(t);
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
i as default
|
|
7
|
+
a as KCheckbox,
|
|
8
|
+
a as default
|
|
9
9
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as u, ref as s, watch as i, onMounted as c, openBlock as f, createElementBlock as m, normalizeClass as l, unref as n, createElementVNode as d, normalizeStyle as p } from "vue";
|
|
2
|
+
import { createNamespace as C } from "../../../assets/ts/utils.mjs";
|
|
3
|
+
import g from "./index.mjs";
|
|
4
|
+
import "./style/index.css";
|
|
5
|
+
const v = u({
|
|
6
|
+
name: "k-number-count"
|
|
7
|
+
}), A = u({
|
|
8
|
+
...v,
|
|
9
|
+
props: {
|
|
10
|
+
value: { default: 0 },
|
|
11
|
+
gradientColor: { default: () => [] },
|
|
12
|
+
size: { default: 16 },
|
|
13
|
+
options: { default: () => ({
|
|
14
|
+
startVal: 0,
|
|
15
|
+
duration: 2,
|
|
16
|
+
decimalPlaces: 0,
|
|
17
|
+
useGrouping: !0,
|
|
18
|
+
separator: ",",
|
|
19
|
+
decimal: ".",
|
|
20
|
+
prefix: "\xA5",
|
|
21
|
+
suffix: "\u5143",
|
|
22
|
+
useEasing: !0,
|
|
23
|
+
enableScrollSpy: !0,
|
|
24
|
+
scrollSpyDelay: 300
|
|
25
|
+
}) }
|
|
26
|
+
},
|
|
27
|
+
setup(e) {
|
|
28
|
+
const o = s(), { n: a } = C("number-count");
|
|
29
|
+
let r, t = e;
|
|
30
|
+
return i(() => t.value, () => {
|
|
31
|
+
r.update(t.value);
|
|
32
|
+
}), c(() => {
|
|
33
|
+
r = new g(o.value, t.value, t.options), r.error ? console.error("\u8BA1\u6570\u5668\u521B\u5EFA\u5931\u8D25\uFF1A", r.error) : r.start();
|
|
34
|
+
}), (x, b) => (f(), m("div", {
|
|
35
|
+
class: l([n(a)()])
|
|
36
|
+
}, [
|
|
37
|
+
d("div", {
|
|
38
|
+
class: l([n(a)("wrapper"), e.gradientColor.length > 0 ? "number-gradient-text" : ""]),
|
|
39
|
+
ref_key: "numberRef",
|
|
40
|
+
ref: o,
|
|
41
|
+
style: p({ "--firstColor": e.gradientColor[0], "--lastColor": e.gradientColor[1], fontSize: e.size + "px" })
|
|
42
|
+
}, null, 6)
|
|
43
|
+
], 2));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
A as default
|
|
48
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
class c {
|
|
2
|
+
constructor(t, i, n) {
|
|
3
|
+
this.endVal = i, this.options = n, this.version = "1.0.0", this.defaults = {
|
|
4
|
+
startVal: 0,
|
|
5
|
+
decimalPlaces: 0,
|
|
6
|
+
duration: 2,
|
|
7
|
+
useEasing: !0,
|
|
8
|
+
useGrouping: !0,
|
|
9
|
+
useIndianSeparators: !1,
|
|
10
|
+
smartEasingThreshold: 999,
|
|
11
|
+
smartEasingAmount: 333,
|
|
12
|
+
separator: ",",
|
|
13
|
+
decimal: ".",
|
|
14
|
+
prefix: "",
|
|
15
|
+
suffix: "",
|
|
16
|
+
enableScrollSpy: !1,
|
|
17
|
+
scrollSpyDelay: 200,
|
|
18
|
+
scrollSpyOnce: !1
|
|
19
|
+
}, this.finalEndVal = null, this.useEasing = !0, this.countDown = !1, this.error = "", this.startVal = 0, this.paused = !0, this.once = !1, this.count = (s) => {
|
|
20
|
+
this.startTime || (this.startTime = s);
|
|
21
|
+
const e = s - this.startTime;
|
|
22
|
+
this.remaining = this.duration - e, this.useEasing ? this.countDown ? this.frameVal = this.startVal - this.easingFn(e, 0, this.startVal - this.endVal, this.duration) : this.frameVal = this.easingFn(e, this.startVal, this.endVal - this.startVal, this.duration) : this.frameVal = this.startVal + (this.endVal - this.startVal) * (e / this.duration);
|
|
23
|
+
const o = this.countDown ? this.frameVal < this.endVal : this.frameVal > this.endVal;
|
|
24
|
+
this.frameVal = o ? this.endVal : this.frameVal, this.frameVal = Number(this.frameVal.toFixed(this.options.decimalPlaces)), this.printValue(this.frameVal), e < this.duration ? this.rAF = requestAnimationFrame(this.count) : this.finalEndVal !== null ? this.update(this.finalEndVal) : this.options.onCompleteCallback && this.options.onCompleteCallback();
|
|
25
|
+
}, this.formatNumber = (s) => {
|
|
26
|
+
const e = s < 0 ? "-" : "";
|
|
27
|
+
let o, a, u, r;
|
|
28
|
+
o = Math.abs(s).toFixed(this.options.decimalPlaces), o += "";
|
|
29
|
+
const d = o.split(".");
|
|
30
|
+
if (a = d[0], u = d.length > 1 ? this.options.decimal + d[1] : "", this.options.useGrouping) {
|
|
31
|
+
r = "";
|
|
32
|
+
let l = 3, p = 0;
|
|
33
|
+
for (let h = 0, m = a.length; h < m; ++h)
|
|
34
|
+
this.options.useIndianSeparators && h === 4 && (l = 2, p = 1), h !== 0 && p % l === 0 && (r = this.options.separator + r), p++, r = a[m - h - 1] + r;
|
|
35
|
+
a = r;
|
|
36
|
+
}
|
|
37
|
+
return this.options.numerals && this.options.numerals.length && (a = a.replace(/[0-9]/g, (l) => this.options.numerals[+l]), u = u.replace(/[0-9]/g, (l) => this.options.numerals[+l])), e + this.options.prefix + a + u + this.options.suffix;
|
|
38
|
+
}, this.easeOutExpo = (s, e, o, a) => o * (-Math.pow(2, -10 * s / a) + 1) * 1024 / 1023 + e, this.options = {
|
|
39
|
+
...this.defaults,
|
|
40
|
+
...n
|
|
41
|
+
}, this.formattingFn = this.options.formattingFn ? this.options.formattingFn : this.formatNumber, this.easingFn = this.options.easingFn ? this.options.easingFn : this.easeOutExpo, this.startVal = this.validateValue(this.options.startVal), this.frameVal = this.startVal, this.endVal = this.validateValue(i), this.options.decimalPlaces = Math.max(this.options.decimalPlaces), this.resetDuration(), this.options.separator = String(this.options.separator), this.useEasing = this.options.useEasing, this.options.separator === "" && (this.options.useGrouping = !1), this.el = typeof t == "string" ? document.getElementById(t) : t, this.el ? this.printValue(this.startVal) : this.error = "[CountUp] target is null or undefined", typeof window < "u" && this.options.enableScrollSpy && (this.error ? console.error(this.error, t) : (window.onScrollFns = window.onScrollFns || [], window.onScrollFns.push(() => this.handleScroll(this)), window.onscroll = () => {
|
|
42
|
+
window.onScrollFns.forEach((s) => s());
|
|
43
|
+
}, this.handleScroll(this)));
|
|
44
|
+
}
|
|
45
|
+
handleScroll(t) {
|
|
46
|
+
if (!t || !window || t.once)
|
|
47
|
+
return;
|
|
48
|
+
const i = window.innerHeight + window.scrollY, n = t.el.getBoundingClientRect(), s = n.top + window.pageYOffset, e = n.top + n.height + window.pageYOffset;
|
|
49
|
+
e < i && e > window.scrollY && t.paused ? (t.paused = !1, setTimeout(() => t.start(), t.options.scrollSpyDelay), t.options.scrollSpyOnce && (t.once = !0)) : (window.scrollY > e || s > i) && !t.paused && t.reset();
|
|
50
|
+
}
|
|
51
|
+
determineDirectionAndSmartEasing() {
|
|
52
|
+
const t = this.finalEndVal ? this.finalEndVal : this.endVal;
|
|
53
|
+
this.countDown = this.startVal > t;
|
|
54
|
+
const i = t - this.startVal;
|
|
55
|
+
if (Math.abs(i) > this.options.smartEasingThreshold && this.options.useEasing) {
|
|
56
|
+
this.finalEndVal = t;
|
|
57
|
+
const n = this.countDown ? 1 : -1;
|
|
58
|
+
this.endVal = t + n * this.options.smartEasingAmount, this.duration = this.duration / 2;
|
|
59
|
+
} else
|
|
60
|
+
this.endVal = t, this.finalEndVal = null;
|
|
61
|
+
this.finalEndVal !== null ? this.useEasing = !1 : this.useEasing = this.options.useEasing;
|
|
62
|
+
}
|
|
63
|
+
start(t) {
|
|
64
|
+
this.error || (this.options.onStartCallback && this.options.onStartCallback(), t && (this.options.onCompleteCallback = t), this.duration > 0 ? (this.determineDirectionAndSmartEasing(), this.paused = !1, this.rAF = requestAnimationFrame(this.count)) : this.printValue(this.endVal));
|
|
65
|
+
}
|
|
66
|
+
pauseResume() {
|
|
67
|
+
this.paused ? (this.startTime = null, this.duration = this.remaining, this.startVal = this.frameVal, this.determineDirectionAndSmartEasing(), this.rAF = requestAnimationFrame(this.count)) : cancelAnimationFrame(this.rAF), this.paused = !this.paused;
|
|
68
|
+
}
|
|
69
|
+
reset() {
|
|
70
|
+
cancelAnimationFrame(this.rAF), this.paused = !0, this.resetDuration(), this.startVal = this.validateValue(this.options.startVal), this.frameVal = this.startVal, this.printValue(this.startVal);
|
|
71
|
+
}
|
|
72
|
+
update(t) {
|
|
73
|
+
cancelAnimationFrame(this.rAF), this.startTime = null, this.endVal = this.validateValue(t), this.endVal !== this.frameVal && (this.startVal = this.frameVal, this.finalEndVal == null && this.resetDuration(), this.finalEndVal = null, this.determineDirectionAndSmartEasing(), this.rAF = requestAnimationFrame(this.count));
|
|
74
|
+
}
|
|
75
|
+
printValue(t) {
|
|
76
|
+
var n;
|
|
77
|
+
if (!this.el)
|
|
78
|
+
return;
|
|
79
|
+
const i = this.formattingFn(t);
|
|
80
|
+
if ((n = this.options.plugin) != null && n.render) {
|
|
81
|
+
this.options.plugin.render(this.el, i);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (this.el.tagName === "INPUT") {
|
|
85
|
+
const s = this.el;
|
|
86
|
+
s.value = i;
|
|
87
|
+
} else
|
|
88
|
+
this.el.tagName === "text" || this.el.tagName === "tspan" ? this.el.textContent = i : this.el.innerHTML = i;
|
|
89
|
+
}
|
|
90
|
+
ensureNumber(t) {
|
|
91
|
+
return typeof t == "number" && !isNaN(t);
|
|
92
|
+
}
|
|
93
|
+
validateValue(t) {
|
|
94
|
+
const i = Number(t);
|
|
95
|
+
return this.ensureNumber(i) ? i : (this.error = `[CountUp] invalid start or end value: ${t}`, null);
|
|
96
|
+
}
|
|
97
|
+
resetDuration() {
|
|
98
|
+
this.startTime = null, this.duration = Number(this.options.duration) * 1e3, this.remaining = this.duration;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
c as default
|
|
103
|
+
};
|