@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,272 +1,169 @@
|
|
|
1
|
-
import { ref, computed, onMounted, watch, resolveComponent, openBlock, createElementBlock, Fragment, renderSlot, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, createVNode, withCtx, renderList, withModifiers, createBlock, resolveDynamicComponent, toDisplayString } from "vue";
|
|
2
|
-
import { i as
|
|
3
|
-
import { r as
|
|
4
|
-
import { u as
|
|
5
|
-
import { P as
|
|
6
|
-
import { _ as
|
|
1
|
+
import { ref as g, computed as k, onMounted as j, watch as G, resolveComponent as J, openBlock as d, createElementBlock as C, Fragment as V, renderSlot as q, createCommentVNode as P, createElementVNode as I, normalizeClass as R, normalizeStyle as B, createVNode as K, withCtx as Q, renderList as X, withModifiers as Y, createBlock as Z, resolveDynamicComponent as x, toDisplayString as _ } from "vue";
|
|
2
|
+
import { i as ee, c as te } from "./component-234624bc.js";
|
|
3
|
+
import { r as oe } from "./renderIcon-47498b32.js";
|
|
4
|
+
import { u as z } from "./index-192a3ef6.js";
|
|
5
|
+
import { P as D } from "./index-360c5092.js";
|
|
6
|
+
import { _ as ne } from "./_plugin-vue_export-helper-dad06003.js";
|
|
7
7
|
import "../locale/lang";
|
|
8
8
|
import "./Overlay.js";
|
|
9
9
|
import "@nutui/icons-vue";
|
|
10
|
-
const { create } =
|
|
11
|
-
const _sfc_main = create({
|
|
10
|
+
const { create: re } = te("popover"), le = re({
|
|
12
11
|
components: {
|
|
13
|
-
[
|
|
12
|
+
[D.name]: D
|
|
14
13
|
},
|
|
15
14
|
props: {
|
|
16
|
-
visible: { type: Boolean, default:
|
|
15
|
+
visible: { type: Boolean, default: !1 },
|
|
17
16
|
list: { type: Array, default: [] },
|
|
18
17
|
theme: { type: String, default: "light" },
|
|
19
18
|
location: { type: String, default: "bottom" },
|
|
20
19
|
offset: { type: Array, default: [0, 12] },
|
|
21
20
|
arrowOffset: { type: Number, default: 0 },
|
|
22
21
|
customClass: { type: String, default: "" },
|
|
23
|
-
showArrow: { type: Boolean, default:
|
|
22
|
+
showArrow: { type: Boolean, default: !0 },
|
|
24
23
|
duration: { type: [Number, String], default: 0.3 },
|
|
25
|
-
overlay: { type: Boolean, default:
|
|
24
|
+
overlay: { type: Boolean, default: !1 },
|
|
26
25
|
overlayClass: { type: String, default: "" },
|
|
27
26
|
overlayStyle: { type: Object },
|
|
28
|
-
closeOnClickOverlay: { type: Boolean, default:
|
|
29
|
-
closeOnClickAction: { type: Boolean, default:
|
|
30
|
-
closeOnClickOutside: { type: Boolean, default:
|
|
27
|
+
closeOnClickOverlay: { type: Boolean, default: !0 },
|
|
28
|
+
closeOnClickAction: { type: Boolean, default: !0 },
|
|
29
|
+
closeOnClickOutside: { type: Boolean, default: !0 },
|
|
31
30
|
targetId: { type: String, default: "" },
|
|
32
31
|
bgColor: { type: String, default: "" }
|
|
33
32
|
},
|
|
34
33
|
emits: ["update", "update:visible", "close", "choose", "open"],
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const direction = location.split("-")[0];
|
|
51
|
-
const skew = location.split("-")[1];
|
|
52
|
-
const base = 16;
|
|
53
|
-
if (bgColor) {
|
|
54
|
-
styles[`border${upperCaseFirst(direction)}Color`] = bgColor;
|
|
55
|
-
}
|
|
56
|
-
if (props.arrowOffset != 0) {
|
|
57
|
-
if (["bottom", "top"].includes(direction)) {
|
|
58
|
-
if (!skew) {
|
|
59
|
-
styles.left = `calc(50% + ${arrowOffset}px)`;
|
|
60
|
-
}
|
|
61
|
-
if (skew == "start") {
|
|
62
|
-
styles.left = `${base + arrowOffset}px`;
|
|
63
|
-
}
|
|
64
|
-
if (skew == "end") {
|
|
65
|
-
styles.right = `${base - arrowOffset}px`;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
if (["left", "right"].includes(direction)) {
|
|
69
|
-
if (!skew) {
|
|
70
|
-
styles.top = `calc(50% - ${arrowOffset}px)`;
|
|
71
|
-
}
|
|
72
|
-
if (skew == "start") {
|
|
73
|
-
styles.top = `${base - arrowOffset}px`;
|
|
74
|
-
}
|
|
75
|
-
if (skew == "end") {
|
|
76
|
-
styles.bottom = `${base + arrowOffset}px`;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return styles;
|
|
81
|
-
});
|
|
82
|
-
const upperCaseFirst = (str) => {
|
|
83
|
-
var str = str.toLowerCase();
|
|
84
|
-
str = str.replace(/\b\w+\b/g, (word) => word.substring(0, 1).toUpperCase() + word.substring(1));
|
|
85
|
-
return str;
|
|
86
|
-
};
|
|
87
|
-
const getRootPosition = computed(() => {
|
|
88
|
-
let styles = {};
|
|
89
|
-
if (!rootRect.value || !conentRootRect.value)
|
|
34
|
+
setup(t, { emit: l }) {
|
|
35
|
+
const h = g(), v = g(), S = g(t.visible);
|
|
36
|
+
let y = g(), u = g();
|
|
37
|
+
const r = k(() => {
|
|
38
|
+
const e = "nut-popover-arrow", o = t.location, n = o.split("-")[0];
|
|
39
|
+
return `${e} ${e}-${n} ${e}--${o}`;
|
|
40
|
+
}), w = k(() => {
|
|
41
|
+
const e = {}, { bgColor: o, arrowOffset: n, location: a } = t, s = a.split("-")[0], i = a.split("-")[1], p = 16;
|
|
42
|
+
return o && (e[`border${N(s)}Color`] = o), t.arrowOffset != 0 && (["bottom", "top"].includes(s) && (i || (e.left = `calc(50% + ${n}px)`), i == "start" && (e.left = `${p + n}px`), i == "end" && (e.right = `${p - n}px`)), ["left", "right"].includes(s) && (i || (e.top = `calc(50% - ${n}px)`), i == "start" && (e.top = `${p - n}px`), i == "end" && (e.bottom = `${p + n}px`))), e;
|
|
43
|
+
}), N = (o) => {
|
|
44
|
+
var o = o.toLowerCase();
|
|
45
|
+
return o = o.replace(/\b\w+\b/g, (n) => n.substring(0, 1).toUpperCase() + n.substring(1)), o;
|
|
46
|
+
}, F = k(() => {
|
|
47
|
+
let e = {};
|
|
48
|
+
if (!y.value || !u.value)
|
|
90
49
|
return {};
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
let cross = 0;
|
|
98
|
-
let parallel = 0;
|
|
99
|
-
if (isArray(offset) && offset.length == 2) {
|
|
100
|
-
cross += +offset[1];
|
|
101
|
-
parallel += +offset[0];
|
|
102
|
-
}
|
|
103
|
-
if (width) {
|
|
104
|
-
if (["bottom", "top"].includes(direction)) {
|
|
105
|
-
const h2 = direction == "bottom" ? height + cross : -(conentHeight + cross);
|
|
106
|
-
styles.top = `${top + h2}px`;
|
|
107
|
-
if (!skew) {
|
|
108
|
-
styles.left = `${-(conentWidth - width) / 2 + left + parallel}px`;
|
|
109
|
-
}
|
|
110
|
-
if (skew == "start") {
|
|
111
|
-
styles.left = `${left + parallel}px`;
|
|
112
|
-
}
|
|
113
|
-
if (skew == "end") {
|
|
114
|
-
styles.left = `${rootRect.value.right + parallel}px`;
|
|
115
|
-
}
|
|
50
|
+
const o = u.value.width, n = u.value.height, { width: a, height: s, left: i, top: p } = y.value, { location: W, offset: b } = t, $ = W.split("-")[0], f = W.split("-")[1];
|
|
51
|
+
let m = 0, c = 0;
|
|
52
|
+
if (ee(b) && b.length == 2 && (m += +b[1], c += +b[0]), a) {
|
|
53
|
+
if (["bottom", "top"].includes($)) {
|
|
54
|
+
const A = $ == "bottom" ? s + m : -(n + m);
|
|
55
|
+
e.top = `${p + A}px`, f || (e.left = `${-(o - a) / 2 + i + c}px`), f == "start" && (e.left = `${i + c}px`), f == "end" && (e.left = `${y.value.right + c}px`);
|
|
116
56
|
}
|
|
117
|
-
if (["left", "right"].includes(
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
if (!skew) {
|
|
121
|
-
styles.top = `${top - conentHeight / 2 + height / 2 - 4 + parallel}px`;
|
|
122
|
-
}
|
|
123
|
-
if (skew == "start") {
|
|
124
|
-
styles.top = `${top + parallel}px`;
|
|
125
|
-
}
|
|
126
|
-
if (skew == "end") {
|
|
127
|
-
styles.top = `${top + height + parallel}px`;
|
|
128
|
-
}
|
|
57
|
+
if (["left", "right"].includes($)) {
|
|
58
|
+
const A = $ == "left" ? -(o + m) : a + m;
|
|
59
|
+
e.left = `${i + A}px`, f || (e.top = `${p - n / 2 + s / 2 - 4 + c}px`), f == "start" && (e.top = `${p + c}px`), f == "end" && (e.top = `${p + s + c}px`);
|
|
129
60
|
}
|
|
130
61
|
}
|
|
131
|
-
return
|
|
132
|
-
})
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
let rect2 = useRect(popoverRef.value);
|
|
142
|
-
if (props.targetId) {
|
|
143
|
-
rect2 = useRect(document.querySelector(`#${props.targetId}`));
|
|
144
|
-
}
|
|
145
|
-
rootRect.value = rect2;
|
|
146
|
-
setTimeout(() => {
|
|
147
|
-
conentRootRect.value = {
|
|
148
|
-
height: popoverContentRef.value.clientHeight,
|
|
149
|
-
width: popoverContentRef.value.clientWidth
|
|
62
|
+
return e;
|
|
63
|
+
}), H = k(() => {
|
|
64
|
+
const e = {};
|
|
65
|
+
return t.bgColor && (e.background = t.bgColor), e;
|
|
66
|
+
}), E = () => {
|
|
67
|
+
let e = z(h.value);
|
|
68
|
+
t.targetId && (e = z(document.querySelector(`#${t.targetId}`))), y.value = e, setTimeout(() => {
|
|
69
|
+
u.value = {
|
|
70
|
+
height: v.value.clientHeight,
|
|
71
|
+
width: v.value.clientWidth
|
|
150
72
|
};
|
|
151
73
|
}, 0);
|
|
152
74
|
};
|
|
153
|
-
|
|
75
|
+
j(() => {
|
|
154
76
|
setTimeout(() => {
|
|
155
|
-
|
|
77
|
+
E();
|
|
156
78
|
}, 200);
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
() =>
|
|
160
|
-
|
|
161
|
-
showPopup.value = value;
|
|
162
|
-
if (value) {
|
|
163
|
-
window.addEventListener("touchstart", clickAway, true);
|
|
164
|
-
getContentWidth();
|
|
165
|
-
} else {
|
|
166
|
-
window.removeEventListener("touchstart", clickAway, true);
|
|
167
|
-
}
|
|
79
|
+
}), G(
|
|
80
|
+
() => t.visible,
|
|
81
|
+
(e) => {
|
|
82
|
+
S.value = e, e ? (window.addEventListener("touchstart", L, !0), E()) : window.removeEventListener("touchstart", L, !0);
|
|
168
83
|
}
|
|
169
84
|
);
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
update
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
if (props.closeOnClickAction) {
|
|
185
|
-
closePopover();
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
const clickAway = (event) => {
|
|
189
|
-
const element = popoverRef.value;
|
|
190
|
-
const elContent = popoverContentRef.value;
|
|
191
|
-
let el = element && !element.contains(event.target);
|
|
192
|
-
if (props.targetId) {
|
|
193
|
-
const dom = document.querySelector(`#${props.targetId}`);
|
|
194
|
-
el = dom && !dom.contains(event.target);
|
|
195
|
-
}
|
|
196
|
-
if (el && elContent && !elContent.contains(event.target) && props.closeOnClickOutside) {
|
|
197
|
-
closePopover();
|
|
85
|
+
const M = (e) => {
|
|
86
|
+
l("update", e), l("update:visible", e);
|
|
87
|
+
}, T = () => {
|
|
88
|
+
M(!t.visible), l("open");
|
|
89
|
+
}, O = () => {
|
|
90
|
+
l("update:visible", !1), l("close");
|
|
91
|
+
}, U = (e, o) => {
|
|
92
|
+
!e.disabled && l("choose", e, o), t.closeOnClickAction && O();
|
|
93
|
+
}, L = (e) => {
|
|
94
|
+
const o = h.value, n = v.value;
|
|
95
|
+
let a = o && !o.contains(e.target);
|
|
96
|
+
if (t.targetId) {
|
|
97
|
+
const s = document.querySelector(`#${t.targetId}`);
|
|
98
|
+
a = s && !s.contains(e.target);
|
|
198
99
|
}
|
|
100
|
+
a && n && !n.contains(e.target) && t.closeOnClickOutside && O();
|
|
199
101
|
};
|
|
200
102
|
return {
|
|
201
|
-
showPopup,
|
|
202
|
-
openPopover,
|
|
203
|
-
popoverArrow,
|
|
204
|
-
closePopover,
|
|
205
|
-
chooseItem,
|
|
206
|
-
popoverRef,
|
|
207
|
-
popoverContentRef,
|
|
208
|
-
getRootPosition,
|
|
209
|
-
customStyle,
|
|
210
|
-
popoverArrowStyle,
|
|
211
|
-
renderIcon
|
|
103
|
+
showPopup: S,
|
|
104
|
+
openPopover: T,
|
|
105
|
+
popoverArrow: r,
|
|
106
|
+
closePopover: O,
|
|
107
|
+
chooseItem: U,
|
|
108
|
+
popoverRef: h,
|
|
109
|
+
popoverContentRef: v,
|
|
110
|
+
getRootPosition: F,
|
|
111
|
+
customStyle: H,
|
|
112
|
+
popoverArrowStyle: w,
|
|
113
|
+
renderIcon: oe
|
|
212
114
|
};
|
|
213
115
|
}
|
|
214
|
-
})
|
|
215
|
-
const _hoisted_1 = {
|
|
116
|
+
}), se = {
|
|
216
117
|
ref: "popoverContentRef",
|
|
217
118
|
class: "nut-popover-content-group"
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
224
|
-
!_ctx.targetId ? (openBlock(), createElementBlock("div", {
|
|
119
|
+
}, ie = ["onClick"], ae = { class: "nut-popover-menu-item-name" };
|
|
120
|
+
function pe(t, l, h, v, S, y) {
|
|
121
|
+
const u = J("nut-popup");
|
|
122
|
+
return d(), C(V, null, [
|
|
123
|
+
t.targetId ? P("", !0) : (d(), C("div", {
|
|
225
124
|
key: 0,
|
|
226
125
|
class: "nut-popover-wrapper",
|
|
227
|
-
onClick:
|
|
126
|
+
onClick: l[0] || (l[0] = (...r) => t.openPopover && t.openPopover(...r)),
|
|
228
127
|
ref: "popoverRef"
|
|
229
128
|
}, [
|
|
230
|
-
|
|
231
|
-
], 512))
|
|
232
|
-
|
|
233
|
-
class:
|
|
234
|
-
style:
|
|
129
|
+
q(t.$slots, "reference")
|
|
130
|
+
], 512)),
|
|
131
|
+
I("view", {
|
|
132
|
+
class: R(["nut-popover", `nut-popover--${t.theme}`, `${t.customClass}`]),
|
|
133
|
+
style: B(t.getRootPosition)
|
|
235
134
|
}, [
|
|
236
|
-
|
|
237
|
-
popClass: `nut-popover-content nut-popover-content--${
|
|
238
|
-
style:
|
|
239
|
-
visible:
|
|
240
|
-
"onUpdate:visible":
|
|
135
|
+
K(u, {
|
|
136
|
+
popClass: `nut-popover-content nut-popover-content--${t.location}`,
|
|
137
|
+
style: B(t.customStyle),
|
|
138
|
+
visible: t.showPopup,
|
|
139
|
+
"onUpdate:visible": l[1] || (l[1] = (r) => t.showPopup = r),
|
|
241
140
|
position: "",
|
|
242
141
|
transition: "nut-popover",
|
|
243
|
-
overlay:
|
|
244
|
-
duration:
|
|
245
|
-
overlayStyle:
|
|
246
|
-
overlayClass:
|
|
247
|
-
closeOnClickOverlay:
|
|
142
|
+
overlay: t.overlay,
|
|
143
|
+
duration: t.duration,
|
|
144
|
+
overlayStyle: t.overlayStyle,
|
|
145
|
+
overlayClass: t.overlayClass,
|
|
146
|
+
closeOnClickOverlay: t.closeOnClickOverlay
|
|
248
147
|
}, {
|
|
249
|
-
default:
|
|
250
|
-
|
|
251
|
-
|
|
148
|
+
default: Q(() => [
|
|
149
|
+
I("view", se, [
|
|
150
|
+
t.showArrow ? (d(), C("view", {
|
|
252
151
|
key: 0,
|
|
253
|
-
class:
|
|
254
|
-
style:
|
|
255
|
-
}, null, 6)) :
|
|
256
|
-
|
|
257
|
-
(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
], 10, _hoisted_2);
|
|
269
|
-
}), 128))
|
|
152
|
+
class: R(t.popoverArrow),
|
|
153
|
+
style: B(t.popoverArrowStyle)
|
|
154
|
+
}, null, 6)) : P("", !0),
|
|
155
|
+
q(t.$slots, "content"),
|
|
156
|
+
(d(!0), C(V, null, X(t.list, (r, w) => (d(), C("view", {
|
|
157
|
+
key: w,
|
|
158
|
+
class: R([r.className, r.disabled && "nut-popover-menu-disabled", "nut-popover-menu-item"]),
|
|
159
|
+
onClick: Y((N) => t.chooseItem(r, w), ["stop"])
|
|
160
|
+
}, [
|
|
161
|
+
r.icon ? (d(), Z(x(t.renderIcon(r.icon)), {
|
|
162
|
+
key: 0,
|
|
163
|
+
class: "nut-popover-item-img"
|
|
164
|
+
})) : P("", !0),
|
|
165
|
+
I("view", ae, _(r.name), 1)
|
|
166
|
+
], 10, ie))), 128))
|
|
270
167
|
], 512)
|
|
271
168
|
]),
|
|
272
169
|
_: 3
|
|
@@ -274,7 +171,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
274
171
|
], 6)
|
|
275
172
|
], 64);
|
|
276
173
|
}
|
|
277
|
-
const
|
|
174
|
+
const he = /* @__PURE__ */ ne(le, [["render", pe]]);
|
|
278
175
|
export {
|
|
279
|
-
|
|
176
|
+
he as default
|
|
280
177
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { P } from "./index-
|
|
1
|
+
import { P as f } from "./index-360c5092.js";
|
|
2
2
|
import "vue";
|
|
3
|
-
import "./_plugin-vue_export-helper-
|
|
4
|
-
import "./component-
|
|
3
|
+
import "./_plugin-vue_export-helper-dad06003.js";
|
|
4
|
+
import "./component-234624bc.js";
|
|
5
5
|
import "../locale/lang";
|
|
6
6
|
import "./Overlay.js";
|
|
7
7
|
import "@nutui/icons-vue";
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
f as default
|
|
10
10
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { _ as
|
|
1
|
+
import { computed as c, openBlock as r, createElementBlock as i, normalizeClass as s, createCommentVNode as n, createElementVNode as f, toDisplayString as d } from "vue";
|
|
2
|
+
import { c as g } from "./component-234624bc.js";
|
|
3
|
+
import { _ as h } 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: S } = g("price"), $ = S({
|
|
7
6
|
props: {
|
|
8
7
|
price: {
|
|
9
8
|
type: [Number, String],
|
|
@@ -11,7 +10,7 @@ const _sfc_main = create({
|
|
|
11
10
|
},
|
|
12
11
|
needSymbol: {
|
|
13
12
|
type: Boolean,
|
|
14
|
-
default:
|
|
13
|
+
default: !0
|
|
15
14
|
},
|
|
16
15
|
symbol: {
|
|
17
16
|
type: String,
|
|
@@ -23,7 +22,7 @@ const _sfc_main = create({
|
|
|
23
22
|
},
|
|
24
23
|
thousands: {
|
|
25
24
|
type: Boolean,
|
|
26
|
-
default:
|
|
25
|
+
default: !1
|
|
27
26
|
},
|
|
28
27
|
position: {
|
|
29
28
|
type: String,
|
|
@@ -35,91 +34,54 @@ const _sfc_main = create({
|
|
|
35
34
|
},
|
|
36
35
|
strikeThrough: {
|
|
37
36
|
type: Boolean,
|
|
38
|
-
default:
|
|
37
|
+
default: !1
|
|
39
38
|
}
|
|
40
39
|
},
|
|
41
|
-
setup(
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
const showSymbol = computed(() => {
|
|
49
|
-
const symbol = props.needSymbol ? props.symbol : "";
|
|
50
|
-
return symbol;
|
|
51
|
-
});
|
|
52
|
-
const checkPoint = (price) => {
|
|
53
|
-
return String(price).indexOf(".") > 0;
|
|
54
|
-
};
|
|
55
|
-
const formatThousands = (num) => {
|
|
56
|
-
if (Number(num) == 0) {
|
|
57
|
-
num = 0;
|
|
58
|
-
}
|
|
59
|
-
if (checkPoint(num)) {
|
|
60
|
-
num = Number(num).toFixed(props.decimalDigits);
|
|
61
|
-
num = typeof num.split(".") === "string" ? num.split(".") : num.split(".")[0];
|
|
62
|
-
} else {
|
|
63
|
-
num = num.toString();
|
|
64
|
-
}
|
|
65
|
-
if (props.thousands) {
|
|
66
|
-
return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
|
|
67
|
-
} else {
|
|
68
|
-
return num;
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const formatDecimal = (decimalNum) => {
|
|
72
|
-
if (Number(decimalNum) == 0) {
|
|
73
|
-
decimalNum = 0;
|
|
74
|
-
}
|
|
75
|
-
if (checkPoint(decimalNum)) {
|
|
76
|
-
decimalNum = Number(decimalNum).toFixed(props.decimalDigits);
|
|
77
|
-
decimalNum = typeof decimalNum.split(".") === "string" ? 0 : decimalNum.split(".")[1] ? decimalNum.split(".")[1] : 0;
|
|
78
|
-
} else {
|
|
79
|
-
decimalNum = 0;
|
|
80
|
-
}
|
|
81
|
-
const result = "0." + decimalNum;
|
|
82
|
-
const resultFixed = Number(result).toFixed(props.decimalDigits);
|
|
83
|
-
return String(resultFixed).substring(2, resultFixed.length);
|
|
84
|
-
};
|
|
40
|
+
setup(t) {
|
|
41
|
+
const l = c(() => ({
|
|
42
|
+
[u]: !0,
|
|
43
|
+
[`${u}--strike`]: t.strikeThrough
|
|
44
|
+
})), a = c(() => t.needSymbol ? t.symbol : ""), o = (e) => String(e).indexOf(".") > 0;
|
|
85
45
|
return {
|
|
86
|
-
classes,
|
|
87
|
-
showSymbol,
|
|
88
|
-
checkPoint,
|
|
89
|
-
formatThousands,
|
|
90
|
-
formatDecimal
|
|
46
|
+
classes: l,
|
|
47
|
+
showSymbol: a,
|
|
48
|
+
checkPoint: o,
|
|
49
|
+
formatThousands: (e) => (Number(e) == 0 && (e = 0), o(e) ? (e = Number(e).toFixed(t.decimalDigits), e = typeof e.split(".") == "string" ? e.split(".") : e.split(".")[0]) : e = e.toString(), t.thousands ? (e || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") : e),
|
|
50
|
+
formatDecimal: (e) => {
|
|
51
|
+
Number(e) == 0 && (e = 0), o(e) ? (e = Number(e).toFixed(t.decimalDigits), e = typeof e.split(".") == "string" ? 0 : e.split(".")[1] ? e.split(".")[1] : 0) : e = 0;
|
|
52
|
+
const m = "0." + e, p = Number(m).toFixed(t.decimalDigits);
|
|
53
|
+
return String(p).substring(2, p.length);
|
|
54
|
+
}
|
|
91
55
|
};
|
|
92
56
|
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return openBlock(), createElementBlock("view", {
|
|
98
|
-
class: normalizeClass(_ctx.classes)
|
|
57
|
+
}), k = ["innerHTML"], w = ["innerHTML"];
|
|
58
|
+
function D(t, l, a, o, y, b) {
|
|
59
|
+
return r(), i("view", {
|
|
60
|
+
class: s(t.classes)
|
|
99
61
|
}, [
|
|
100
|
-
|
|
62
|
+
t.needSymbol && t.position == "before" ? (r(), i("view", {
|
|
101
63
|
key: 0,
|
|
102
|
-
class:
|
|
103
|
-
innerHTML:
|
|
104
|
-
}, null, 10,
|
|
105
|
-
|
|
106
|
-
class:
|
|
107
|
-
},
|
|
108
|
-
|
|
64
|
+
class: s(["nut-price--symbol", `nut-price--symbol-${t.size}`]),
|
|
65
|
+
innerHTML: t.showSymbol
|
|
66
|
+
}, null, 10, k)) : n("", !0),
|
|
67
|
+
f("view", {
|
|
68
|
+
class: s(`nut-price--${t.size}`)
|
|
69
|
+
}, d(t.formatThousands(t.price)), 3),
|
|
70
|
+
t.decimalDigits != 0 ? (r(), i("view", {
|
|
109
71
|
key: 1,
|
|
110
|
-
class:
|
|
111
|
-
}, ".", 2)) :
|
|
112
|
-
|
|
113
|
-
class:
|
|
114
|
-
},
|
|
115
|
-
|
|
72
|
+
class: s(`nut-price--decimal-${t.size}`)
|
|
73
|
+
}, ".", 2)) : n("", !0),
|
|
74
|
+
f("view", {
|
|
75
|
+
class: s(`nut-price--decimal-${t.size}`)
|
|
76
|
+
}, d(t.formatDecimal(t.price)), 3),
|
|
77
|
+
t.needSymbol && t.position == "after" ? (r(), i("view", {
|
|
116
78
|
key: 2,
|
|
117
|
-
class:
|
|
118
|
-
innerHTML:
|
|
119
|
-
}, null, 10,
|
|
79
|
+
class: s(["nut-price--symbol", `nut-price--symbol-${t.size}`]),
|
|
80
|
+
innerHTML: t.showSymbol
|
|
81
|
+
}, null, 10, w)) : n("", !0)
|
|
120
82
|
], 2);
|
|
121
83
|
}
|
|
122
|
-
const
|
|
84
|
+
const F = /* @__PURE__ */ h($, [["render", D]]);
|
|
123
85
|
export {
|
|
124
|
-
|
|
86
|
+
F as default
|
|
125
87
|
};
|