btt-ui 1.0.17 → 1.0.24
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 +28 -26
- package/es/src/button/src/button.mjs +29 -29
- package/es/src/card/src/card.mjs +15 -15
- package/es/src/dialog/src/dialog.mjs +49 -49
- package/es/src/drag/src/drag.mjs +15 -15
- package/es/src/echarts/src/index.mjs +20 -20
- package/es/src/index.mjs +69 -66
- package/es/src/input/src/input.mjs +60 -60
- package/es/src/overlay/src/overlay.mjs +15 -15
- package/es/src/sign/src/sign.mjs +24 -24
- package/es/src/switch/src/switch.mjs +29 -29
- package/es/src/textButton/src/button.mjs +24 -24
- package/es/src/upload/dragger.mjs +23 -23
- package/es/src/upload/upload.mjs +18 -18
- package/es/src/uploadFile/src/style/index.css +14 -1
- package/es/src/uploadFile/src/uploadFile.mjs +89 -77
- package/es/src/xgplay/index.mjs +6 -0
- package/es/src/xgplay/src/index.mjs +81 -0
- package/lib/index.js +1 -1
- package/lib/src/button/src/button.js +1 -1
- package/lib/src/card/src/card.js +1 -1
- package/lib/src/dialog/src/dialog.js +1 -1
- package/lib/src/drag/src/drag.js +1 -1
- package/lib/src/echarts/src/index.js +1 -1
- package/lib/src/index.js +1 -1
- package/lib/src/input/src/input.js +1 -1
- package/lib/src/overlay/src/overlay.js +1 -1
- package/lib/src/sign/src/sign.js +1 -1
- package/lib/src/switch/src/switch.js +1 -1
- package/lib/src/textButton/src/button.js +1 -1
- package/lib/src/upload/dragger.js +1 -1
- package/lib/src/upload/upload.js +1 -1
- package/lib/src/uploadFile/src/style/index.css +14 -1
- package/lib/src/uploadFile/src/uploadFile.js +1 -1
- package/lib/src/xgplay/index.js +1 -0
- package/lib/src/xgplay/src/index.js +1 -0
- package/package.json +2 -2
- /package/es/src/{xgplayer → xgplay}/src/style/index.css +0 -0
- /package/lib/src/{xgplayer → xgplay}/src/style/index.css +0 -0
package/es/src/index.mjs
CHANGED
|
@@ -1,83 +1,86 @@
|
|
|
1
1
|
import "./style/common.css";
|
|
2
2
|
import { Button as o } from "./button/index.mjs";
|
|
3
|
-
import { Button as
|
|
3
|
+
import { Button as po } from "./button/index.mjs";
|
|
4
4
|
import { TextButton as r } from "./textButton/index.mjs";
|
|
5
|
-
import { TextButton as
|
|
5
|
+
import { TextButton as io } from "./textButton/index.mjs";
|
|
6
6
|
import { Tooltip as t } from "./tooltip/index.mjs";
|
|
7
|
-
import { Tooltip as
|
|
7
|
+
import { Tooltip as lo } from "./tooltip/index.mjs";
|
|
8
8
|
import { Icon as m } from "./icon/index.mjs";
|
|
9
|
-
import { Icon as
|
|
9
|
+
import { Icon as so } from "./icon/index.mjs";
|
|
10
10
|
import { KInput as e } from "./input/index.mjs";
|
|
11
|
-
import { KInput as
|
|
11
|
+
import { KInput as uo } from "./input/index.mjs";
|
|
12
12
|
import p from "./link/index.mjs";
|
|
13
|
-
import { default as
|
|
13
|
+
import { default as co } from "./link/index.mjs";
|
|
14
14
|
import f from "./upload/index.mjs";
|
|
15
|
-
import { default as
|
|
15
|
+
import { default as ho } from "./upload/index.mjs";
|
|
16
16
|
import i from "./shake/index.mjs";
|
|
17
|
-
import { default as
|
|
17
|
+
import { default as So } from "./shake/index.mjs";
|
|
18
18
|
import a from "./dialog/index.mjs";
|
|
19
|
-
import { default as
|
|
19
|
+
import { default as bo } from "./dialog/index.mjs";
|
|
20
20
|
import l from "./scroll/index.mjs";
|
|
21
|
-
import { default as
|
|
21
|
+
import { default as Io } from "./scroll/index.mjs";
|
|
22
22
|
import x from "./toast/index.mjs";
|
|
23
|
-
import { default as
|
|
23
|
+
import { default as Do } from "./toast/index.mjs";
|
|
24
24
|
import s from "./wheel/index.mjs";
|
|
25
|
-
import { default as
|
|
25
|
+
import { default as wo } from "./wheel/index.mjs";
|
|
26
26
|
import n from "./uploadFile/index.mjs";
|
|
27
|
-
import { default as
|
|
27
|
+
import { default as Fo } from "./uploadFile/index.mjs";
|
|
28
28
|
import { Card as u } from "./card/index.mjs";
|
|
29
|
-
import { Card as
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
|
|
29
|
+
import { Card as Ho } from "./card/index.mjs";
|
|
30
|
+
import d from "./xgplay/index.mjs";
|
|
31
|
+
import { default as Mo } from "./xgplay/index.mjs";
|
|
32
|
+
import { ECharts as K } from "./echarts/index.mjs";
|
|
33
|
+
import { ECharts as Vo } from "./echarts/index.mjs";
|
|
34
|
+
import { HotMap as c } from "./hotmap/index.mjs";
|
|
35
|
+
import { HotMap as Po } from "./hotmap/index.mjs";
|
|
36
|
+
import { KTree as T } from "./tree/index.mjs";
|
|
37
|
+
import { KTree as qo } from "./tree/index.mjs";
|
|
38
|
+
import { TableScroll as h } from "./tableScroll/index.mjs";
|
|
39
|
+
import { TableScroll as yo } from "./tableScroll/index.mjs";
|
|
40
|
+
import { KSelect as C, KOption as S } from "./select/index.mjs";
|
|
41
|
+
import { KOption as Ao, KSelect as Jo } from "./select/index.mjs";
|
|
42
|
+
import { KCheckbox as k, KCheckboxGroup as b } from "./checkbox/index.mjs";
|
|
43
|
+
import { KCheckbox as Qo, KCheckboxGroup as Ro } from "./checkbox/index.mjs";
|
|
44
|
+
import { KCollapse as g, KCollapseItem as I } from "./collapse/index.mjs";
|
|
45
|
+
import { KCollapse as Yo, KCollapseItem as Zo } from "./collapse/index.mjs";
|
|
46
|
+
import { Switch as B } from "./switch/index.mjs";
|
|
47
|
+
import { Switch as $o } from "./switch/index.mjs";
|
|
48
|
+
import { Timeline as D } from "./timeline/index.mjs";
|
|
49
|
+
import { Timeline as rr } from "./timeline/index.mjs";
|
|
50
|
+
import { Drag as U } from "./drag/index.mjs";
|
|
51
|
+
import { Drag as mr } from "./drag/index.mjs";
|
|
52
|
+
import { Sign as w } from "./sign/index.mjs";
|
|
53
|
+
import { Sign as pr } from "./sign/index.mjs";
|
|
54
|
+
const to = [o, r, m, p, f, i, a, l, x, s, t, e, B, D, U, n, u, c, T, k, b, g, I, w, K, C, S, h, d];
|
|
53
55
|
export {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
56
|
+
po as Button,
|
|
57
|
+
Ho as Card,
|
|
58
|
+
bo as Dialog,
|
|
59
|
+
mr as Drag,
|
|
60
|
+
Vo as ECharts,
|
|
61
|
+
Po as HotMap,
|
|
62
|
+
so as Icon,
|
|
63
|
+
Qo as KCheckbox,
|
|
64
|
+
Ro as KCheckboxGroup,
|
|
65
|
+
Yo as KCollapse,
|
|
66
|
+
Zo as KCollapseItem,
|
|
67
|
+
uo as KInput,
|
|
68
|
+
Ao as KOption,
|
|
69
|
+
Jo as KSelect,
|
|
70
|
+
Mo as KVideo,
|
|
71
|
+
co as Link,
|
|
72
|
+
Io as Scroll,
|
|
73
|
+
So as Shake,
|
|
74
|
+
pr as Sign,
|
|
75
|
+
$o as Switch,
|
|
76
|
+
yo as TableScroll,
|
|
77
|
+
io as TextButton,
|
|
78
|
+
rr as Timeline,
|
|
79
|
+
Do as Toast,
|
|
80
|
+
lo as Tooltip,
|
|
81
|
+
qo as Tree,
|
|
82
|
+
ho as Upload,
|
|
83
|
+
Fo as UploadFile,
|
|
84
|
+
wo as Wheel,
|
|
85
|
+
to as default
|
|
83
86
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as I, ref as n, computed as
|
|
2
|
-
import { Icon as
|
|
1
|
+
import { defineComponent as I, ref as n, computed as D, openBlock as o, createElementBlock as m, normalizeClass as c, unref as a, createElementVNode as k, renderSlot as B, createBlock as b, createCommentVNode as s, withDirectives as V, mergeProps as R, vModelDynamic as j, createVNode as z, withModifiers as F, vShow as L } from "vue";
|
|
2
|
+
import { Icon as p } from "../../icon/index.mjs";
|
|
3
3
|
import { createNamespace as O } from "../../../assets/ts/utils.mjs";
|
|
4
4
|
import "./style/index.css";
|
|
5
5
|
const T = ["type", "placeholder", "autofocus", "readonly", "disabled"], U = I({
|
|
@@ -19,97 +19,97 @@ const T = ["type", "placeholder", "autofocus", "readonly", "disabled"], U = I({
|
|
|
19
19
|
autofocus: { type: Boolean, default: !1 }
|
|
20
20
|
},
|
|
21
21
|
emits: ["update:modelValue", "focus", "blur", "clear"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
get: () =>
|
|
25
|
-
set: (
|
|
26
|
-
|
|
22
|
+
setup(e, { expose: C, emit: M }) {
|
|
23
|
+
const t = e, f = M, { n: u } = O("input"), r = n(), v = n(t.autofocus), i = n(!0), y = n(t.type), w = n(!1), d = D({
|
|
24
|
+
get: () => t.modelValue,
|
|
25
|
+
set: (l) => {
|
|
26
|
+
f("update:modelValue", l);
|
|
27
27
|
}
|
|
28
|
-
}),
|
|
29
|
-
|
|
28
|
+
}), N = () => {
|
|
29
|
+
v.value = !0, f("focus");
|
|
30
|
+
}, P = () => {
|
|
31
|
+
v.value = !1, f("blur");
|
|
32
|
+
}, h = () => {
|
|
33
|
+
d.value = "", f("clear");
|
|
30
34
|
}, $ = () => {
|
|
31
|
-
|
|
32
|
-
}, b = () => {
|
|
33
|
-
d.value = "", r("clear");
|
|
34
|
-
}, g = () => {
|
|
35
|
-
o.type === "password" && (i.value = !i.value, i.value ? v.value = o.type : v.value = "text");
|
|
35
|
+
t.type === "password" && (i.value = !i.value, i.value ? y.value = t.type : y.value = "text");
|
|
36
36
|
};
|
|
37
|
-
function
|
|
38
|
-
|
|
37
|
+
function g() {
|
|
38
|
+
w.value = t.clearable && d.value;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
40
|
+
function E() {
|
|
41
|
+
w.value = !1;
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return C({
|
|
44
44
|
blur: () => {
|
|
45
|
-
var
|
|
46
|
-
return (
|
|
45
|
+
var l;
|
|
46
|
+
return (l = r.value) == null ? void 0 : l.blur();
|
|
47
47
|
},
|
|
48
48
|
focus: () => {
|
|
49
|
-
var
|
|
50
|
-
return (
|
|
49
|
+
var l;
|
|
50
|
+
return (l = r.value) == null ? void 0 : l.focus();
|
|
51
51
|
},
|
|
52
|
-
clear:
|
|
53
|
-
input: () =>
|
|
54
|
-
}), (
|
|
55
|
-
class:
|
|
52
|
+
clear: h,
|
|
53
|
+
input: () => r.value
|
|
54
|
+
}), (l, x) => (o(), m("div", {
|
|
55
|
+
class: c([a(u)(), { "is-disabled": e.disabled }])
|
|
56
56
|
}, [
|
|
57
57
|
k("div", {
|
|
58
|
-
class:
|
|
59
|
-
onMouseenter:
|
|
60
|
-
onMouseleave:
|
|
58
|
+
class: c([a(u)("wrapper"), { "is-focus": v.value }]),
|
|
59
|
+
onMouseenter: g,
|
|
60
|
+
onMouseleave: E
|
|
61
61
|
}, [
|
|
62
|
-
|
|
62
|
+
l.$slots.prefix || e.prefixIcon ? (o(), m("span", {
|
|
63
63
|
key: 0,
|
|
64
|
-
class:
|
|
64
|
+
class: c(a(u)("prefix"))
|
|
65
65
|
}, [
|
|
66
|
-
B(
|
|
67
|
-
e.prefixIcon ? (
|
|
66
|
+
B(l.$slots, "prefix"),
|
|
67
|
+
e.prefixIcon ? (o(), b(a(p), {
|
|
68
68
|
key: 0,
|
|
69
69
|
name: e.prefixIcon
|
|
70
|
-
}, null, 8, ["name"])) :
|
|
71
|
-
], 2)) :
|
|
72
|
-
V(k("input",
|
|
70
|
+
}, null, 8, ["name"])) : s("", !0)
|
|
71
|
+
], 2)) : s("", !0),
|
|
72
|
+
V(k("input", R({
|
|
73
73
|
ref_key: "inputRef",
|
|
74
|
-
ref:
|
|
75
|
-
"onUpdate:modelValue":
|
|
76
|
-
class:
|
|
77
|
-
type:
|
|
74
|
+
ref: r,
|
|
75
|
+
"onUpdate:modelValue": x[0] || (x[0] = (S) => d.value = S),
|
|
76
|
+
class: a(u)("inner"),
|
|
77
|
+
type: y.value,
|
|
78
78
|
placeholder: e.placeholder,
|
|
79
79
|
autofocus: e.autofocus,
|
|
80
80
|
readonly: e.readonly,
|
|
81
81
|
disabled: e.disabled,
|
|
82
|
-
onFocus:
|
|
83
|
-
onBlur:
|
|
84
|
-
},
|
|
85
|
-
[
|
|
82
|
+
onFocus: N,
|
|
83
|
+
onBlur: P
|
|
84
|
+
}, l.$attrs), null, 16, T), [
|
|
85
|
+
[j, d.value]
|
|
86
86
|
]),
|
|
87
|
-
e.showPassword || e.clearable ? (
|
|
87
|
+
e.showPassword || e.clearable ? (o(), m("span", {
|
|
88
88
|
key: 1,
|
|
89
|
-
class:
|
|
89
|
+
class: c(a(u)("suffix"))
|
|
90
90
|
}, [
|
|
91
|
-
e.showPassword ? (
|
|
91
|
+
e.showPassword ? (o(), b(a(p), {
|
|
92
92
|
key: 0,
|
|
93
93
|
name: i.value ? "view" : "hide",
|
|
94
|
-
onClick:
|
|
95
|
-
}, null, 8, ["name"])) :
|
|
96
|
-
V(z(
|
|
94
|
+
onClick: $
|
|
95
|
+
}, null, 8, ["name"])) : s("", !0),
|
|
96
|
+
V(z(a(p), {
|
|
97
97
|
name: "circle-close",
|
|
98
|
-
onClick: F(
|
|
98
|
+
onClick: F(h, ["stop"])
|
|
99
99
|
}, null, 512), [
|
|
100
|
-
[L,
|
|
100
|
+
[L, w.value]
|
|
101
101
|
])
|
|
102
|
-
], 2)) :
|
|
103
|
-
|
|
102
|
+
], 2)) : s("", !0),
|
|
103
|
+
l.$slots.suffix || e.suffixIcon ? (o(), m("span", {
|
|
104
104
|
key: 2,
|
|
105
|
-
class:
|
|
105
|
+
class: c(a(u)("suffix"))
|
|
106
106
|
}, [
|
|
107
|
-
B(
|
|
108
|
-
e.suffixIcon ? (
|
|
107
|
+
B(l.$slots, "suffix"),
|
|
108
|
+
e.suffixIcon ? (o(), b(a(p), {
|
|
109
109
|
key: 0,
|
|
110
110
|
name: e.suffixIcon
|
|
111
|
-
}, null, 8, ["name"])) :
|
|
112
|
-
], 2)) :
|
|
111
|
+
}, null, 8, ["name"])) : s("", !0)
|
|
112
|
+
], 2)) : s("", !0)
|
|
113
113
|
], 34)
|
|
114
114
|
], 2));
|
|
115
115
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { createNamespace as
|
|
1
|
+
import { defineComponent as m, computed as d, openBlock as l, createElementBlock as s, normalizeClass as o, unref as f, normalizeStyle as n, renderSlot as r } from "vue";
|
|
2
|
+
import { createNamespace as y } from "../../../assets/ts/utils.mjs";
|
|
3
3
|
import "./style/index.css";
|
|
4
|
-
const
|
|
4
|
+
const i = m({
|
|
5
5
|
name: "k-overlay"
|
|
6
|
-
}), C =
|
|
7
|
-
...
|
|
6
|
+
}), C = m({
|
|
7
|
+
...i,
|
|
8
8
|
props: {
|
|
9
9
|
mask: { type: Boolean, default: !0 },
|
|
10
10
|
customMaskEvent: { type: Boolean, default: !1 },
|
|
@@ -12,22 +12,22 @@ const y = r({
|
|
|
12
12
|
zIndex: { default: 2e3 }
|
|
13
13
|
},
|
|
14
14
|
emits: [""],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
zIndex:
|
|
15
|
+
setup(e) {
|
|
16
|
+
const c = e, { n: u } = y("overlay"), a = d(() => ({
|
|
17
|
+
zIndex: c.zIndex
|
|
18
18
|
}));
|
|
19
|
-
return (
|
|
19
|
+
return (t, v) => e.mask ? (l(), s("div", {
|
|
20
20
|
key: 0,
|
|
21
|
-
class: o([
|
|
22
|
-
style:
|
|
21
|
+
class: o([f(u)(), e.overlayClass]),
|
|
22
|
+
style: n(a.value)
|
|
23
23
|
}, [
|
|
24
|
-
|
|
25
|
-
], 6)) : (
|
|
24
|
+
r(t.$slots, "default")
|
|
25
|
+
], 6)) : (l(), s("div", {
|
|
26
26
|
key: 1,
|
|
27
27
|
class: o([e.overlayClass]),
|
|
28
|
-
style:
|
|
28
|
+
style: n(a.value)
|
|
29
29
|
}, [
|
|
30
|
-
|
|
30
|
+
r(t.$slots, "default")
|
|
31
31
|
], 6));
|
|
32
32
|
}
|
|
33
33
|
});
|
package/es/src/sign/src/sign.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const O =
|
|
1
|
+
import { defineComponent as b, ref as Y, reactive as q, onMounted as L, openBlock as W, createElementBlock as F, normalizeStyle as E, withModifiers as m } from "vue";
|
|
2
|
+
const O = b({
|
|
3
3
|
name: "k-sign"
|
|
4
|
-
}), z =
|
|
4
|
+
}), z = b({
|
|
5
5
|
...O,
|
|
6
6
|
props: {
|
|
7
7
|
width: { default: 600 },
|
|
@@ -19,8 +19,8 @@ const O = C({
|
|
|
19
19
|
isCrop: { type: Boolean, default: !0 }
|
|
20
20
|
},
|
|
21
21
|
emits: ["change"],
|
|
22
|
-
setup(
|
|
23
|
-
const r = Y(), a =
|
|
22
|
+
setup(p, { expose: M, emit: I }) {
|
|
23
|
+
const r = Y(), a = p, x = I, t = q({
|
|
24
24
|
sratio: 1,
|
|
25
25
|
ctx: null,
|
|
26
26
|
resImg: "",
|
|
@@ -39,23 +39,23 @@ const O = C({
|
|
|
39
39
|
t.isMove = !0, f(o.pageX - t.offset.left, o.pageY - t.offset.top, !1);
|
|
40
40
|
}, D = (o) => {
|
|
41
41
|
t.isMove && f(o.pageX - t.offset.left, o.pageY - t.offset.top, !0);
|
|
42
|
-
},
|
|
42
|
+
}, v = async () => {
|
|
43
43
|
t.isMove = !1;
|
|
44
|
-
let o = await
|
|
45
|
-
|
|
46
|
-
},
|
|
44
|
+
let o = await y();
|
|
45
|
+
x("change", o);
|
|
46
|
+
}, R = (o) => {
|
|
47
47
|
t.isMove = !0, f(
|
|
48
48
|
o.changedTouches[0].clientX - t.offset.left,
|
|
49
49
|
o.changedTouches[0].clientY - t.offset.top,
|
|
50
50
|
!1
|
|
51
51
|
);
|
|
52
|
-
},
|
|
52
|
+
}, _ = (o) => {
|
|
53
53
|
t.isMove && f(
|
|
54
54
|
o.changedTouches[0].clientX - t.offset.left,
|
|
55
55
|
o.changedTouches[0].clientY - t.offset.top,
|
|
56
56
|
!0
|
|
57
57
|
);
|
|
58
|
-
},
|
|
58
|
+
}, w = () => {
|
|
59
59
|
t.isMove = !1;
|
|
60
60
|
}, B = (o) => {
|
|
61
61
|
let c = r.value.width, u = r.value.height, h = 0, l = 0;
|
|
@@ -74,9 +74,9 @@ const O = C({
|
|
|
74
74
|
const l = document.createElement("canvas"), g = l.getContext("2d");
|
|
75
75
|
let i, n, e;
|
|
76
76
|
c % 90 != 0 && console.error("\u65CB\u8F6C\u89D2\u5EA6\u5FC5\u987B\u662F90\u7684\u500D\u6570!");
|
|
77
|
-
const
|
|
77
|
+
const C = c / 90 % 4, s = { sx: 0, sy: 0, ex: 0, ey: 0 }, d = new Image();
|
|
78
78
|
d.crossOrigin = "anonymous", d.src = o, d.onload = function() {
|
|
79
|
-
switch (i = d.width, n = d.height, e = i > n ? i : n, l.width = e * 2, l.height = e * 2,
|
|
79
|
+
switch (i = d.width, n = d.height, e = i > n ? i : n, l.width = e * 2, l.height = e * 2, C) {
|
|
80
80
|
case 0:
|
|
81
81
|
s.sx = e, s.sy = e, s.ex = e + i, s.ey = e + n;
|
|
82
82
|
break;
|
|
@@ -92,9 +92,9 @@ const O = C({
|
|
|
92
92
|
}
|
|
93
93
|
g.translate(e, e), g.rotate(c * Math.PI / 180), g.drawImage(d, 0, 0);
|
|
94
94
|
var X = g.getImageData(s.sx, s.sy, s.ex, s.ey);
|
|
95
|
-
|
|
95
|
+
C % 2 == 0 ? (l.width = i, l.height = n) : (l.width = n, l.height = i), g.putImageData(X, 0, 0), h(l.toDataURL(u, a.quality));
|
|
96
96
|
};
|
|
97
|
-
}),
|
|
97
|
+
}), y = () => new Promise((o) => {
|
|
98
98
|
const c = t.ctx.getImageData(0, 0, r.value.width, r.value.height), u = B(c.data), h = document.createElement("canvas"), l = h.getContext("2d");
|
|
99
99
|
h.width = u[2] - u[0], h.height = u[3] - u[1];
|
|
100
100
|
const g = t.ctx.getImageData(...u);
|
|
@@ -109,26 +109,26 @@ const O = C({
|
|
|
109
109
|
}) : o(n);
|
|
110
110
|
}), S = () => {
|
|
111
111
|
t.ctx.beginPath(), t.ctx.clearRect(0, 0, a.width, a.height), t.ctx.closePath(), setTimeout(() => {
|
|
112
|
-
|
|
112
|
+
x("change", "");
|
|
113
113
|
}, 1e3);
|
|
114
114
|
};
|
|
115
115
|
return L(() => {
|
|
116
116
|
setTimeout(T, 100);
|
|
117
117
|
}), M({
|
|
118
118
|
clearCanvas: S,
|
|
119
|
-
createImg:
|
|
119
|
+
createImg: y
|
|
120
120
|
}), (o, c) => (W(), F("canvas", {
|
|
121
121
|
ref_key: "vueSign",
|
|
122
122
|
ref: r,
|
|
123
|
-
style: E({ background:
|
|
123
|
+
style: E({ background: p.bgColor }),
|
|
124
124
|
onMousedown: k,
|
|
125
125
|
onMousemove: D,
|
|
126
|
-
onMouseup:
|
|
127
|
-
onMouseleave:
|
|
128
|
-
onTouchstart:
|
|
129
|
-
onTouchmove:
|
|
130
|
-
onTouchend:
|
|
131
|
-
onTouchcancel:
|
|
126
|
+
onMouseup: v,
|
|
127
|
+
onMouseleave: v,
|
|
128
|
+
onTouchstart: m(R, ["stop"]),
|
|
129
|
+
onTouchmove: m(_, ["stop"]),
|
|
130
|
+
onTouchend: m(w, ["stop"]),
|
|
131
|
+
onTouchcancel: m(w, ["stop"])
|
|
132
132
|
}, null, 36));
|
|
133
133
|
}
|
|
134
134
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { addUnit as
|
|
3
|
-
import { Icon as
|
|
1
|
+
import { defineComponent as h, computed as r, openBlock as c, createElementBlock as o, normalizeClass as a, unref as l, normalizeStyle as V, withDirectives as k, createElementVNode as s, vModelCheckbox as B, toDisplayString as m, createCommentVNode as d, createBlock as T } from "vue";
|
|
2
|
+
import { addUnit as w, createNamespace as C } from "../../../assets/ts/utils.mjs";
|
|
3
|
+
import { Icon as N } from "../../icon/index.mjs";
|
|
4
4
|
import "./style/index.css";
|
|
5
|
-
const
|
|
5
|
+
const P = ["disabled"], S = { class: "is-text" }, z = h({
|
|
6
6
|
name: "k-switch"
|
|
7
|
-
}), M =
|
|
7
|
+
}), M = h({
|
|
8
8
|
...z,
|
|
9
9
|
props: {
|
|
10
10
|
modelValue: { type: [Number, String, Boolean], default: !1 },
|
|
@@ -18,59 +18,59 @@ const S = ["disabled"], x = { class: "is-text" }, z = f({
|
|
|
18
18
|
width: { default: "" }
|
|
19
19
|
},
|
|
20
20
|
emits: ["update:modelValue", "change"],
|
|
21
|
-
setup(
|
|
22
|
-
const t =
|
|
21
|
+
setup(e, { emit: p }) {
|
|
22
|
+
const t = e, f = p, { n: i } = C("switch"), n = r({
|
|
23
23
|
get: () => t.modelValue === t.activeValue,
|
|
24
|
-
set: (
|
|
25
|
-
|
|
24
|
+
set: (u) => {
|
|
25
|
+
f("update:modelValue", u ? t.activeValue : t.inactiveValue), f("change", u ? t.activeValue : t.inactiveValue);
|
|
26
26
|
}
|
|
27
|
-
}), y =
|
|
27
|
+
}), y = r(() => {
|
|
28
28
|
if (t.width)
|
|
29
|
-
return { width:
|
|
30
|
-
}), b =
|
|
29
|
+
return { width: w(t.width) };
|
|
30
|
+
}), b = r(() => t.inlinePrompt ? n.value ? t.activeText : t.inactiveText : "");
|
|
31
31
|
function g() {
|
|
32
32
|
t.disabled || (n.value = !n.value);
|
|
33
33
|
}
|
|
34
|
-
return (
|
|
34
|
+
return (u, v) => (c(), o("div", {
|
|
35
35
|
class: a([l(i)(), { "is-checked": n.value, "is-disabled": e.disabled }]),
|
|
36
36
|
onClick: g,
|
|
37
|
-
style:
|
|
37
|
+
style: V(y.value)
|
|
38
38
|
}, [
|
|
39
|
-
|
|
40
|
-
"onUpdate:modelValue":
|
|
39
|
+
k(s("input", {
|
|
40
|
+
"onUpdate:modelValue": v[0] || (v[0] = (x) => n.value = x),
|
|
41
41
|
class: a(l(i)("input")),
|
|
42
42
|
type: "checkbox",
|
|
43
43
|
disabled: e.disabled
|
|
44
|
-
}, null, 10,
|
|
45
|
-
[
|
|
44
|
+
}, null, 10, P), [
|
|
45
|
+
[B, n.value]
|
|
46
46
|
]),
|
|
47
|
-
!e.inlinePrompt && e.inactiveText ? (
|
|
47
|
+
!e.inlinePrompt && e.inactiveText ? (c(), o("span", {
|
|
48
48
|
key: 0,
|
|
49
49
|
class: a(l(i)("label--left"))
|
|
50
|
-
},
|
|
51
|
-
|
|
50
|
+
}, m(e.inactiveText), 3)) : d("", !0),
|
|
51
|
+
s("span", {
|
|
52
52
|
class: a(l(i)("core"))
|
|
53
53
|
}, [
|
|
54
|
-
e.inlinePrompt ? (
|
|
54
|
+
e.inlinePrompt ? (c(), o("span", {
|
|
55
55
|
key: 0,
|
|
56
56
|
class: a(l(i)("inner"))
|
|
57
57
|
}, [
|
|
58
|
-
|
|
59
|
-
], 2)) :
|
|
60
|
-
|
|
58
|
+
s("span", S, m(b.value), 1)
|
|
59
|
+
], 2)) : d("", !0),
|
|
60
|
+
s("div", {
|
|
61
61
|
class: a(l(i)("action"))
|
|
62
62
|
}, [
|
|
63
|
-
e.loading ? (
|
|
63
|
+
e.loading ? (c(), T(l(N), {
|
|
64
64
|
key: 0,
|
|
65
65
|
class: a({ "is-loading": e.loading }),
|
|
66
66
|
name: "loading"
|
|
67
|
-
}, null, 8, ["class"])) :
|
|
67
|
+
}, null, 8, ["class"])) : d("", !0)
|
|
68
68
|
], 2)
|
|
69
69
|
], 2),
|
|
70
|
-
!e.inlinePrompt && e.activeText ? (
|
|
70
|
+
!e.inlinePrompt && e.activeText ? (c(), o("span", {
|
|
71
71
|
key: 1,
|
|
72
72
|
class: a(l(i)("label--right"))
|
|
73
|
-
},
|
|
73
|
+
}, m(e.activeText), 3)) : d("", !0)
|
|
74
74
|
], 6));
|
|
75
75
|
}
|
|
76
76
|
});
|