@nutui/nutui 4.0.10-beta.1 → 4.0.10
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/CHANGELOG.md +17 -0
- package/dist/nutui.es.js +1 -1
- package/dist/nutui.js +6550 -8291
- package/dist/nutui.umd.js +1 -1
- package/dist/packages/_es/ActionSheet.js +78 -111
- package/dist/packages/_es/Address.js +250 -375
- package/dist/packages/_es/AddressList.js +269 -354
- package/dist/packages/_es/Animate.js +41 -58
- package/dist/packages/_es/Audio.js +128 -197
- package/dist/packages/_es/AudioOperate.js +60 -71
- package/dist/packages/_es/Avatar.js +66 -89
- package/dist/packages/_es/AvatarGroup.js +23 -31
- package/dist/packages/_es/Backtop.js +59 -99
- package/dist/packages/_es/Badge.js +36 -47
- package/dist/packages/_es/Barrage.js +68 -147
- package/dist/packages/_es/Button.js +47 -66
- package/dist/packages/_es/Calendar.js +135 -157
- package/dist/packages/_es/CalendarItem.js +6 -6
- package/dist/packages/_es/Card.js +42 -56
- package/dist/packages/_es/Cascader.js +315 -474
- package/dist/packages/_es/Category.js +29 -39
- package/dist/packages/_es/CategoryPane.js +57 -83
- package/dist/packages/_es/Cell.js +56 -71
- package/dist/packages/_es/CellGroup.js +19 -27
- package/dist/packages/_es/Checkbox.js +109 -156
- package/dist/packages/_es/CheckboxGroup.js +38 -59
- package/dist/packages/_es/CircleProgress.js +67 -96
- package/dist/packages/_es/Col.js +23 -31
- package/dist/packages/_es/Collapse.js +33 -58
- package/dist/packages/_es/CollapseItem.js +78 -108
- package/dist/packages/_es/Comment.js +207 -279
- package/dist/packages/_es/ConfigProvider.js +37 -55
- package/dist/packages/_es/Countdown.js +100 -212
- package/dist/packages/_es/Countup.js +232 -445
- package/dist/packages/_es/DatePicker.js +162 -265
- package/dist/packages/_es/Dialog.js +161 -213
- package/dist/packages/_es/Divider.js +42 -57
- package/dist/packages/_es/Drag.js +70 -153
- package/dist/packages/_es/Ecard.js +64 -104
- package/dist/packages/_es/Elevator.js +143 -219
- package/dist/packages/_es/Ellipsis.js +95 -178
- package/dist/packages/_es/Empty.js +23 -39
- package/dist/packages/_es/FixedNav.js +93 -116
- package/dist/packages/_es/Form.js +107 -178
- package/dist/packages/_es/FormItem.js +48 -61
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +58 -84
- package/dist/packages/_es/Image.js +90 -129
- package/dist/packages/_es/ImagePreview.js +256 -412
- package/dist/packages/_es/Indicator.js +30 -34
- package/dist/packages/_es/InfiniteLoading.js +83 -136
- package/dist/packages/_es/Input.js +160 -264
- package/dist/packages/_es/InputNumber.js +81 -117
- package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
- package/dist/packages/_es/Invoice.js +104 -130
- package/dist/packages/_es/Layout.js +3 -4
- package/dist/packages/_es/List.js +117 -215
- package/dist/packages/_es/Menu.js +95 -150
- package/dist/packages/_es/MenuItem.js +109 -154
- package/dist/packages/_es/Navbar.js +103 -119
- package/dist/packages/_es/Noticebar.js +197 -312
- package/dist/packages/_es/Notify.js +110 -166
- package/dist/packages/_es/NumberKeyboard.js +127 -202
- package/dist/packages/_es/Overlay.js +52 -80
- package/dist/packages/_es/Pagination.js +70 -100
- package/dist/packages/_es/Picker.js +275 -437
- package/dist/packages/_es/Popover.js +122 -225
- package/dist/packages/_es/Popup.js +4 -4
- package/dist/packages/_es/Price.js +44 -82
- package/dist/packages/_es/Progress.js +63 -79
- package/dist/packages/_es/PullRefresh.js +95 -173
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +3 -3
- package/dist/packages/_es/Range.js +204 -347
- package/dist/packages/_es/Rate.js +92 -141
- package/dist/packages/_es/Row.js +21 -27
- package/dist/packages/_es/Searchbar.js +123 -174
- package/dist/packages/_es/ShortPassword.js +69 -93
- package/dist/packages/_es/SideNavbar.js +49 -80
- package/dist/packages/_es/SideNavbarItem.js +22 -32
- package/dist/packages/_es/Signature.js +83 -146
- package/dist/packages/_es/Skeleton.js +110 -130
- package/dist/packages/_es/Sku.js +250 -343
- package/dist/packages/_es/Step.js +59 -86
- package/dist/packages/_es/Steps.js +26 -31
- package/dist/packages/_es/Sticky.js +4 -4
- package/dist/packages/_es/SubSideNavbar.js +52 -74
- package/dist/packages/_es/Swipe.js +83 -155
- package/dist/packages/_es/Swiper.js +174 -311
- package/dist/packages/_es/SwiperItem.js +28 -44
- package/dist/packages/_es/Switch.js +55 -68
- package/dist/packages/_es/TabPane.js +30 -41
- package/dist/packages/_es/Tabbar.js +41 -52
- package/dist/packages/_es/TabbarItem.js +61 -82
- package/dist/packages/_es/Table.js +109 -165
- package/dist/packages/_es/Tabs.js +240 -388
- package/dist/packages/_es/Tag.js +44 -61
- package/dist/packages/_es/Textarea.js +80 -124
- package/dist/packages/_es/TimeDetail.js +49 -76
- package/dist/packages/_es/TimePannel.js +34 -48
- package/dist/packages/_es/TimeSelect.js +47 -68
- package/dist/packages/_es/Toast.js +144 -218
- package/dist/packages/_es/Tour.js +138 -192
- package/dist/packages/_es/TrendArrow.js +57 -77
- package/dist/packages/_es/Uploader.js +234 -359
- package/dist/packages/_es/Video.js +191 -316
- package/dist/packages/_es/Watermark.js +84 -117
- package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/packages/_es/common-d218746f.js +116 -0
- package/dist/packages/_es/component-234624bc.js +89 -0
- package/dist/packages/_es/index-14dfadc4.js +561 -0
- package/dist/packages/_es/index-192a3ef6.js +29 -0
- package/dist/packages/_es/index-360c5092.js +210 -0
- package/dist/packages/_es/index-496e6e05.js +24 -0
- package/dist/packages/_es/index-50eed3d9.js +7 -0
- package/dist/packages/_es/index-53ec2d4d.js +34 -0
- package/dist/packages/_es/index-fadb0974.js +8 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
- package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
- package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
- package/dist/packages/_es/pxCheck-38173291.js +4 -0
- package/dist/packages/_es/raf-a74f1a06.js +16 -0
- package/dist/packages/_es/renderIcon-47498b32.js +5 -0
- package/dist/smartips/web-types.json +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +154 -51
- package/dist/styles/themes/jdb.scss +154 -51
- package/dist/styles/themes/jddkh.scss +154 -51
- package/dist/styles/themes/jdt.scss +154 -51
- package/dist/types/__VUE/address/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
- package/dist/types/__VUE/image/index.vue.d.ts +2 -2
- package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
- package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/table/common.d.ts +55 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
- package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
- package/dist/packages/_es/common-b9a5e726.js +0 -145
- package/dist/packages/_es/component-81a4c1d0.js +0 -145
- package/dist/packages/_es/index-29892cda.js +0 -33
- package/dist/packages/_es/index-43c34ac6.js +0 -30
- package/dist/packages/_es/index-54d03fc1.js +0 -8
- package/dist/packages/_es/index-79c5dc33.js +0 -10
- package/dist/packages/_es/index-7a7385e4.js +0 -67
- package/dist/packages/_es/index-87422be8.js +0 -942
- package/dist/packages/_es/index-da0a7662.js +0 -259
- package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
- package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
- package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
- package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
- package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
- package/dist/packages/_es/raf-729dad54.js +0 -25
- package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { ref, reactive, computed, onMounted, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot } from "vue";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
1
|
+
var v = Object.defineProperty, h = Object.defineProperties;
|
|
2
|
+
var b = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var u = Object.getOwnPropertySymbols;
|
|
4
|
+
var N = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (s, t, e) => t in s ? v(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, p = (s, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
N.call(t, e) && f(s, e, t[e]);
|
|
8
|
+
if (u)
|
|
9
|
+
for (var e of u(t))
|
|
10
|
+
g.call(t, e) && f(s, e, t[e]);
|
|
11
|
+
return s;
|
|
12
|
+
}, m = (s, t) => h(s, b(t));
|
|
13
|
+
import { ref as x, reactive as y, computed as $, onMounted as w, toRefs as C, openBlock as S, createElementBlock as k, normalizeClass as A, createElementVNode as _, renderSlot as B } from "vue";
|
|
14
|
+
import { c as E } from "./component-234624bc.js";
|
|
15
|
+
import { _ as L } from "./_plugin-vue_export-helper-dad06003.js";
|
|
23
16
|
import "../locale/lang";
|
|
24
|
-
const { componentName, create } =
|
|
25
|
-
const _sfc_main = create({
|
|
17
|
+
const { componentName: M, create: z } = E("side-navbar"), D = z({
|
|
26
18
|
props: {
|
|
27
19
|
offset: {
|
|
28
20
|
type: [String, Number],
|
|
@@ -30,76 +22,53 @@ const _sfc_main = create({
|
|
|
30
22
|
}
|
|
31
23
|
},
|
|
32
24
|
emits: [],
|
|
33
|
-
setup: (
|
|
34
|
-
const
|
|
35
|
-
const state = reactive({
|
|
25
|
+
setup: (s) => {
|
|
26
|
+
const t = x(null), e = y({
|
|
36
27
|
count: 1,
|
|
37
28
|
observer: null
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const setPaddingLeft = (nodeList, level = 1) => {
|
|
46
|
-
var _a;
|
|
47
|
-
for (let i = 0; i < nodeList.length; i++) {
|
|
48
|
-
let item = nodeList[i];
|
|
49
|
-
if ((_a = item == null ? void 0 : item.children) == null ? void 0 : _a[0]) {
|
|
50
|
-
item.children[0].style.paddingLeft = +props.offset * level + "px";
|
|
51
|
-
if (!item.className.includes("nut-side-navbar-item")) {
|
|
52
|
-
setPaddingLeft(Array.from(item.children[1].children), ++state.count);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
29
|
+
}), i = $(() => ({
|
|
30
|
+
[M]: !0
|
|
31
|
+
})), a = (r, o = 1) => {
|
|
32
|
+
var d;
|
|
33
|
+
for (let l = 0; l < r.length; l++) {
|
|
34
|
+
let n = r[l];
|
|
35
|
+
(d = n == null ? void 0 : n.children) != null && d[0] && (n.children[0].style.paddingLeft = +s.offset * o + "px", n.className.includes("nut-side-navbar-item") || a(Array.from(n.children[1].children), ++e.count));
|
|
55
36
|
}
|
|
56
|
-
|
|
37
|
+
e.count--;
|
|
38
|
+
}, c = () => {
|
|
39
|
+
let r = t.value.childNodes;
|
|
40
|
+
r.length && (r = Array.from(r).filter((o) => o.nodeType !== 3).map((o) => o), a(r));
|
|
57
41
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
onMounted(() => {
|
|
68
|
-
handleSlots();
|
|
69
|
-
state.observer = new MutationObserver(function() {
|
|
70
|
-
state.count = 1;
|
|
71
|
-
handleSlots();
|
|
42
|
+
return w(() => {
|
|
43
|
+
c(), e.observer = new MutationObserver(function() {
|
|
44
|
+
e.count = 1, c();
|
|
45
|
+
}), e.observer.observe(t.value, {
|
|
46
|
+
attributes: !1,
|
|
47
|
+
childList: !0,
|
|
48
|
+
characterData: !1,
|
|
49
|
+
subtree: !0
|
|
72
50
|
});
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
characterData: false,
|
|
77
|
-
subtree: true
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
81
|
-
list,
|
|
82
|
-
classes
|
|
51
|
+
}), m(p({}, C(e)), {
|
|
52
|
+
list: t,
|
|
53
|
+
classes: i
|
|
83
54
|
});
|
|
84
55
|
}
|
|
85
|
-
})
|
|
86
|
-
const _hoisted_1 = { class: "nut-side-navbar__content" };
|
|
87
|
-
const _hoisted_2 = {
|
|
56
|
+
}), O = { class: "nut-side-navbar__content" }, P = {
|
|
88
57
|
class: "nut-side-navbar__content__list",
|
|
89
58
|
ref: "list"
|
|
90
59
|
};
|
|
91
|
-
function
|
|
92
|
-
return
|
|
93
|
-
class:
|
|
60
|
+
function R(s, t, e, i, a, c) {
|
|
61
|
+
return S(), k("view", {
|
|
62
|
+
class: A(s.classes)
|
|
94
63
|
}, [
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
64
|
+
_("view", O, [
|
|
65
|
+
_("view", P, [
|
|
66
|
+
B(s.$slots, "default")
|
|
98
67
|
], 512)
|
|
99
68
|
])
|
|
100
69
|
], 2);
|
|
101
70
|
}
|
|
102
|
-
const
|
|
71
|
+
const G = /* @__PURE__ */ L(D, [["render", R]]);
|
|
103
72
|
export {
|
|
104
|
-
|
|
73
|
+
G as default
|
|
105
74
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { computed, openBlock, createElementBlock, normalizeClass, withModifiers, createElementVNode, toDisplayString } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { _ as
|
|
1
|
+
import { computed as r, openBlock as l, createElementBlock as a, normalizeClass as c, withModifiers as p, createElementVNode as m, toDisplayString as d } from "vue";
|
|
2
|
+
import { c as f } from "./component-234624bc.js";
|
|
3
|
+
import { _ as k } from "./_plugin-vue_export-helper-dad06003.js";
|
|
4
4
|
import "../locale/lang";
|
|
5
|
-
const { componentName, create } =
|
|
6
|
-
const _sfc_main = create({
|
|
5
|
+
const { componentName: u, create: C } = f("side-navbar-item"), _ = C({
|
|
7
6
|
props: {
|
|
8
7
|
title: {
|
|
9
8
|
type: String,
|
|
@@ -15,34 +14,25 @@ const _sfc_main = create({
|
|
|
15
14
|
}
|
|
16
15
|
},
|
|
17
16
|
emits: ["click"],
|
|
18
|
-
setup: (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const _hoisted_1 = ["ikey"];
|
|
35
|
-
const _hoisted_2 = { class: "nut-side-navbar-item__title" };
|
|
36
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
37
|
-
return openBlock(), createElementBlock("view", {
|
|
38
|
-
class: normalizeClass(_ctx.classes),
|
|
39
|
-
onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"])),
|
|
40
|
-
ikey: _ctx.ikey
|
|
17
|
+
setup: (e, t) => ({
|
|
18
|
+
classes: r(() => ({
|
|
19
|
+
[u]: !0
|
|
20
|
+
})),
|
|
21
|
+
handleClick: () => {
|
|
22
|
+
t.emit("click");
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
}), y = ["ikey"], h = { class: "nut-side-navbar-item__title" };
|
|
26
|
+
function $(e, t, s, i, o, g) {
|
|
27
|
+
return l(), a("view", {
|
|
28
|
+
class: c(e.classes),
|
|
29
|
+
onClick: t[0] || (t[0] = p((...n) => e.handleClick && e.handleClick(...n), ["stop"])),
|
|
30
|
+
ikey: e.ikey
|
|
41
31
|
}, [
|
|
42
|
-
|
|
43
|
-
], 10,
|
|
32
|
+
m("span", h, d(e.title), 1)
|
|
33
|
+
], 10, y);
|
|
44
34
|
}
|
|
45
|
-
const
|
|
35
|
+
const B = /* @__PURE__ */ k(_, [["render", $]]);
|
|
46
36
|
export {
|
|
47
|
-
|
|
37
|
+
B as default
|
|
48
38
|
};
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
import { ref, computed, reactive, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withDirectives, vShow, toDisplayString, createCommentVNode, createVNode, withCtx, createTextVNode } from "vue";
|
|
21
|
-
import { c as createComponent } from "./component-81a4c1d0.js";
|
|
22
|
-
import Button from "./Button.js";
|
|
23
|
-
import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
|
|
1
|
+
var $ = Object.defineProperty, B = Object.defineProperties;
|
|
2
|
+
var P = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var h = Object.getOwnPropertySymbols;
|
|
4
|
+
var U = Object.prototype.hasOwnProperty, V = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var g = (e, s, n) => s in e ? $(e, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[s] = n, C = (e, s) => {
|
|
6
|
+
for (var n in s || (s = {}))
|
|
7
|
+
U.call(s, n) && g(e, n, s[n]);
|
|
8
|
+
if (h)
|
|
9
|
+
for (var n of h(s))
|
|
10
|
+
V.call(s, n) && g(e, n, s[n]);
|
|
11
|
+
return e;
|
|
12
|
+
}, y = (e, s) => B(e, P(s));
|
|
13
|
+
import { ref as E, computed as j, reactive as X, onMounted as Y, toRefs as z, resolveComponent as M, openBlock as S, createElementBlock as w, normalizeClass as O, createElementVNode as k, withDirectives as q, vShow as A, toDisplayString as p, createCommentVNode as F, createVNode as L, withCtx as b, createTextVNode as D } from "vue";
|
|
14
|
+
import { c as G } from "./component-234624bc.js";
|
|
15
|
+
import x from "./Button.js";
|
|
16
|
+
import { _ as I } from "./_plugin-vue_export-helper-dad06003.js";
|
|
24
17
|
import "../locale/lang";
|
|
25
18
|
import "@nutui/icons-vue";
|
|
26
|
-
const { componentName, create, translate } =
|
|
27
|
-
const _sfc_main = create({
|
|
19
|
+
const { componentName: J, create: K, translate: Q } = G("signature"), Z = K({
|
|
28
20
|
props: {
|
|
29
21
|
customClass: {
|
|
30
22
|
type: String,
|
|
@@ -36,15 +28,7 @@ const _sfc_main = create({
|
|
|
36
28
|
},
|
|
37
29
|
strokeStyle: {
|
|
38
30
|
type: String,
|
|
39
|
-
default: () =>
|
|
40
|
-
let bodyDom = document.getElementsByTagName("body");
|
|
41
|
-
let clsName = bodyDom[0]["className"];
|
|
42
|
-
if (clsName.indexOf("nut-theme-dark") == -1) {
|
|
43
|
-
return "#000";
|
|
44
|
-
} else {
|
|
45
|
-
return "#fff";
|
|
46
|
-
}
|
|
47
|
-
}
|
|
31
|
+
default: () => document.getElementsByTagName("body")[0].className.indexOf("nut-theme-dark") == -1 ? "#000" : "#fff"
|
|
48
32
|
},
|
|
49
33
|
type: {
|
|
50
34
|
type: String,
|
|
@@ -56,154 +40,107 @@ const _sfc_main = create({
|
|
|
56
40
|
}
|
|
57
41
|
},
|
|
58
42
|
components: {
|
|
59
|
-
[
|
|
43
|
+
[x.name]: x
|
|
60
44
|
},
|
|
61
45
|
emits: ["start", "end", "signing", "confirm", "clear"],
|
|
62
|
-
setup(
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return {
|
|
68
|
-
[prefixCls]: true,
|
|
69
|
-
[`${props.customClass}`]: props.customClass
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
const state = reactive({
|
|
46
|
+
setup(e, { emit: s }) {
|
|
47
|
+
const n = E(null), l = E(null), m = j(() => ({
|
|
48
|
+
[J]: !0,
|
|
49
|
+
[`${e.customClass}`]: e.customClass
|
|
50
|
+
})), a = X({
|
|
73
51
|
canvasHeight: 0,
|
|
74
52
|
canvasWidth: 0,
|
|
75
53
|
ctx: null,
|
|
76
54
|
isSupportTouch: "ontouchstart" in window,
|
|
77
55
|
events: "ontouchstart" in window ? ["touchstart", "touchmove", "touchend", "touchleave"] : ["mousedown", "mousemove", "mouseup", "mouseleave"]
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
event.preventDefault();
|
|
108
|
-
emit("end");
|
|
109
|
-
canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
|
|
110
|
-
canvas.value.removeEventListener(state.events[2], endEventHandler, false);
|
|
111
|
-
};
|
|
112
|
-
const leaveEventHandler = (event) => {
|
|
113
|
-
event.preventDefault();
|
|
114
|
-
canvas.value.removeEventListener(state.events[1], moveEventHandler, false);
|
|
115
|
-
canvas.value.removeEventListener(state.events[2], endEventHandler, false);
|
|
116
|
-
};
|
|
117
|
-
const clear = () => {
|
|
118
|
-
canvas.value.addEventListener(state.events[2], endEventHandler, false);
|
|
119
|
-
state.ctx.clearRect(0, 0, state.canvasWidth, state.canvasHeight);
|
|
120
|
-
state.ctx.closePath();
|
|
121
|
-
emit("clear");
|
|
122
|
-
};
|
|
123
|
-
const confirm = () => {
|
|
124
|
-
onSave(canvas.value);
|
|
125
|
-
};
|
|
126
|
-
const isCanvasBlank = (canvas2) => {
|
|
127
|
-
if (!canvas2) {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
var blank = document.createElement("canvas");
|
|
131
|
-
blank.width = canvas2.width;
|
|
132
|
-
blank.height = canvas2.height;
|
|
133
|
-
return (canvas2 == null ? void 0 : canvas2.toDataURL()) == blank.toDataURL();
|
|
134
|
-
};
|
|
135
|
-
const onSave = (canvas2) => {
|
|
136
|
-
let dataurl;
|
|
137
|
-
switch (props.type) {
|
|
56
|
+
}), r = () => {
|
|
57
|
+
let t = document.createElement("canvas");
|
|
58
|
+
return !!(t.getContext && t.getContext("2d"));
|
|
59
|
+
}, c = () => {
|
|
60
|
+
n.value.addEventListener(a.events[0], N, !1);
|
|
61
|
+
}, N = (t) => {
|
|
62
|
+
t.preventDefault(), a.ctx.beginPath(), a.ctx.lineWidth = e.lineWidth, a.ctx.strokeStyle = e.strokeStyle, s("start"), n.value.addEventListener(a.events[1], d, !1), n.value.addEventListener(a.events[2], i, !1), n.value.addEventListener(a.events[3], H, !1);
|
|
63
|
+
}, d = (t) => {
|
|
64
|
+
t.preventDefault();
|
|
65
|
+
let o = a.isSupportTouch ? t.touches[0] : t;
|
|
66
|
+
s("signing", o);
|
|
67
|
+
let u = n.value.getBoundingClientRect(), v = o.clientX - u.left, _ = o.clientY - u.top;
|
|
68
|
+
a.ctx.lineTo(v, _), a.ctx.stroke();
|
|
69
|
+
}, i = (t) => {
|
|
70
|
+
t.preventDefault(), s("end"), n.value.removeEventListener(a.events[1], d, !1), n.value.removeEventListener(a.events[2], i, !1);
|
|
71
|
+
}, H = (t) => {
|
|
72
|
+
t.preventDefault(), n.value.removeEventListener(a.events[1], d, !1), n.value.removeEventListener(a.events[2], i, !1);
|
|
73
|
+
}, T = () => {
|
|
74
|
+
n.value.addEventListener(a.events[2], i, !1), a.ctx.clearRect(0, 0, a.canvasWidth, a.canvasHeight), a.ctx.closePath(), s("clear");
|
|
75
|
+
}, W = () => {
|
|
76
|
+
R(n.value);
|
|
77
|
+
}, f = (t) => {
|
|
78
|
+
if (!t)
|
|
79
|
+
return !0;
|
|
80
|
+
var o = document.createElement("canvas");
|
|
81
|
+
return o.width = t.width, o.height = t.height, (t == null ? void 0 : t.toDataURL()) == o.toDataURL();
|
|
82
|
+
}, R = (t) => {
|
|
83
|
+
let o;
|
|
84
|
+
switch (e.type) {
|
|
138
85
|
case "png":
|
|
139
|
-
|
|
86
|
+
o = t.toDataURL("image/png");
|
|
140
87
|
break;
|
|
141
88
|
case "jpg":
|
|
142
|
-
|
|
89
|
+
o = t.toDataURL("image/jpeg", 0.8);
|
|
143
90
|
break;
|
|
144
91
|
}
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
emit("confirm", _canvas, _filePath);
|
|
92
|
+
const u = f(t) ? "请绘制签名" : t, v = f(t) ? "" : o;
|
|
93
|
+
s("confirm", u, v);
|
|
148
94
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
state.canvasWidth = wrap.value.offsetWidth;
|
|
153
|
-
state.canvasHeight = wrap.value.offsetHeight;
|
|
154
|
-
addEvent();
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), { canvas, wrap, isCanvasSupported, confirm, clear, classes, translate });
|
|
95
|
+
return Y(() => {
|
|
96
|
+
r() && (a.ctx = n.value.getContext("2d"), a.canvasWidth = l.value.offsetWidth, a.canvasHeight = l.value.offsetHeight, c());
|
|
97
|
+
}), y(C({}, z(a)), { canvas: n, wrap: l, isCanvasSupported: r, confirm: W, clear: T, classes: m, translate: Q });
|
|
158
98
|
}
|
|
159
|
-
})
|
|
160
|
-
const _hoisted_1 = {
|
|
99
|
+
}), ee = {
|
|
161
100
|
class: "nut-signature-inner",
|
|
162
101
|
ref: "wrap"
|
|
163
|
-
}
|
|
164
|
-
const _hoisted_2 = ["height", "width"];
|
|
165
|
-
const _hoisted_3 = {
|
|
102
|
+
}, te = ["height", "width"], ne = {
|
|
166
103
|
key: 0,
|
|
167
104
|
class: "nut-signature-unsopport"
|
|
168
105
|
};
|
|
169
|
-
function
|
|
170
|
-
const
|
|
171
|
-
return
|
|
172
|
-
class:
|
|
106
|
+
function se(e, s, n, l, m, a) {
|
|
107
|
+
const r = M("nut-button");
|
|
108
|
+
return S(), w("div", {
|
|
109
|
+
class: O(e.classes)
|
|
173
110
|
}, [
|
|
174
|
-
|
|
175
|
-
|
|
111
|
+
k("div", ee, [
|
|
112
|
+
q(k("canvas", {
|
|
176
113
|
ref: "canvas",
|
|
177
|
-
height:
|
|
178
|
-
width:
|
|
179
|
-
}, null, 8,
|
|
180
|
-
[
|
|
114
|
+
height: e.canvasHeight,
|
|
115
|
+
width: e.canvasWidth
|
|
116
|
+
}, null, 8, te), [
|
|
117
|
+
[A, e.isCanvasSupported()]
|
|
181
118
|
]),
|
|
182
|
-
|
|
119
|
+
e.isCanvasSupported() ? F("", !0) : (S(), w("p", ne, p(e.unSupportTpl || e.translate("unSupportTpl")), 1))
|
|
183
120
|
], 512),
|
|
184
|
-
|
|
121
|
+
L(r, {
|
|
185
122
|
class: "nut-signature-btn",
|
|
186
123
|
type: "default",
|
|
187
|
-
onClick:
|
|
124
|
+
onClick: s[0] || (s[0] = (c) => e.clear())
|
|
188
125
|
}, {
|
|
189
|
-
default:
|
|
190
|
-
|
|
126
|
+
default: b(() => [
|
|
127
|
+
D(p(e.translate("reSign")), 1)
|
|
191
128
|
]),
|
|
192
129
|
_: 1
|
|
193
130
|
}),
|
|
194
|
-
|
|
131
|
+
L(r, {
|
|
195
132
|
class: "nut-signature-btn",
|
|
196
133
|
type: "primary",
|
|
197
|
-
onClick:
|
|
134
|
+
onClick: s[1] || (s[1] = (c) => e.confirm())
|
|
198
135
|
}, {
|
|
199
|
-
default:
|
|
200
|
-
|
|
136
|
+
default: b(() => [
|
|
137
|
+
D(p(e.translate("confirm")), 1)
|
|
201
138
|
]),
|
|
202
139
|
_: 1
|
|
203
140
|
})
|
|
204
141
|
], 2);
|
|
205
142
|
}
|
|
206
|
-
const
|
|
143
|
+
const de = /* @__PURE__ */ I(Z, [["render", se]]);
|
|
207
144
|
export {
|
|
208
|
-
|
|
145
|
+
de as default
|
|
209
146
|
};
|