@nutui/nutui 3.1.22-beta.0 → 3.1.22-beta.3
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/dist/nutui.es.js +4019 -19251
- package/dist/nutui.umd.js +4012 -19344
- package/dist/packages/_es/ActionSheet.js +26 -157
- package/dist/packages/_es/Address.js +119 -542
- package/dist/packages/_es/AddressList.js +113 -613
- package/dist/packages/_es/Audio.js +62 -264
- package/dist/packages/_es/AudioOperate.js +18 -107
- package/dist/packages/_es/Avatar.js +42 -165
- package/dist/packages/_es/AvatarGroup.js +14 -73
- package/dist/packages/_es/BackTop.js +43 -156
- package/dist/packages/_es/Badge.js +14 -86
- package/dist/packages/_es/Barrage.js +41 -120
- package/dist/packages/_es/Button.js +23 -128
- package/dist/packages/_es/Calendar.js +24 -237
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +10 -107
- package/dist/packages/_es/Cascader.js +156 -500
- package/dist/packages/_es/Category.js +15 -58
- package/dist/packages/_es/CategoryPane.js +11 -111
- package/dist/packages/_es/Cell.js +21 -100
- package/dist/packages/_es/CellGroup.js +9 -44
- package/dist/packages/_es/Checkbox.js +31 -113
- package/dist/packages/_es/CheckboxGroup.js +29 -58
- package/dist/packages/_es/CircleProgress.js +28 -151
- package/dist/packages/_es/Col.js +14 -56
- package/dist/packages/_es/Collapse.js +24 -85
- package/dist/packages/_es/CollapseItem.js +70 -261
- package/dist/packages/_es/Comment.js +64 -434
- package/dist/packages/_es/CountDown.js +61 -242
- package/dist/packages/_es/CountUp.js +149 -546
- package/dist/packages/_es/DatePicker.js +107 -322
- package/dist/packages/_es/Dialog.js +69 -261
- package/dist/packages/_es/Divider.js +18 -68
- package/dist/packages/_es/Drag.js +56 -197
- package/dist/packages/_es/Ecard.js +24 -159
- package/dist/packages/_es/Elevator.js +63 -198
- package/dist/packages/_es/Empty.js +12 -71
- package/dist/packages/_es/FixedNav.js +15 -122
- package/dist/packages/_es/Form.js +64 -151
- package/dist/packages/_es/FormItem.js +15 -110
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +33 -144
- package/dist/packages/_es/Icon.js +15 -40
- package/dist/packages/_es/ImagePreview.js +74 -298
- package/dist/packages/_es/Indicator.js +15 -62
- package/dist/packages/_es/InfiniteLoading.js +66 -258
- package/dist/packages/_es/Input.js +51 -413
- package/dist/packages/_es/InputNumber.js +41 -160
- package/dist/packages/_es/Layout.js +4 -5
- package/dist/packages/_es/List.js +23 -110
- package/dist/packages/_es/Menu.js +30 -118
- package/dist/packages/_es/MenuItem.js +34 -162
- package/dist/packages/_es/Navbar.js +30 -192
- package/dist/packages/_es/NoticeBar.js +83 -387
- package/dist/packages/_es/Notify.js +81 -236
- package/dist/packages/_es/NumberKeyboard.js +41 -272
- package/dist/packages/_es/OldPicker.js +140 -464
- package/dist/packages/_es/OverLay.js +32 -105
- package/dist/packages/_es/Pagination.js +39 -157
- package/dist/packages/_es/Picker.js +138 -459
- package/dist/packages/_es/Popover.js +327 -965
- package/dist/packages/_es/Popup.js +64 -303
- package/dist/packages/_es/Price.js +16 -118
- package/dist/packages/_es/Progress.js +14 -146
- package/dist/packages/_es/PullRefresh.js +92 -346
- package/dist/packages/_es/Radio.js +22 -90
- package/dist/packages/_es/RadioGroup.js +8 -37
- package/dist/packages/_es/Range.js +92 -417
- package/dist/packages/_es/Rate.js +16 -139
- package/dist/packages/_es/Row.js +22 -64
- package/dist/packages/_es/SearchBar.js +46 -247
- package/dist/packages/_es/ShortPassword.js +35 -225
- package/dist/packages/_es/SideNavBar.js +33 -89
- package/dist/packages/_es/SideNavBarItem.js +11 -46
- package/dist/packages/_es/Signature.js +46 -165
- package/dist/packages/_es/Skeleton.js +20 -136
- package/dist/packages/_es/Sku.js +93 -499
- package/dist/packages/_es/Step.js +25 -119
- package/dist/packages/_es/Steps.js +18 -53
- package/dist/packages/_es/Sticky.js +53 -138
- package/dist/packages/_es/SubSideNavBar.js +26 -90
- package/dist/packages/_es/Swipe.js +46 -183
- package/dist/packages/_es/Swiper.js +121 -433
- package/dist/packages/_es/SwiperItem.js +22 -53
- package/dist/packages/_es/Switch.js +21 -116
- package/dist/packages/_es/TabPane.js +12 -39
- package/dist/packages/_es/Tabbar.js +17 -72
- package/dist/packages/_es/TabbarItem.js +29 -151
- package/dist/packages/_es/Table.js +27 -186
- package/dist/packages/_es/Tabs.js +51 -209
- package/dist/packages/_es/Tag.js +20 -97
- package/dist/packages/_es/TextArea.js +42 -160
- package/dist/packages/_es/TimeDetail.js +23 -84
- package/dist/packages/_es/TimePannel.js +19 -52
- package/dist/packages/_es/TimeSelect.js +15 -103
- package/dist/packages/_es/Toast.js +80 -319
- package/dist/packages/_es/Uploader.js +112 -460
- package/dist/packages/_es/Video.js +83 -340
- package/dist/packages/_es/common.js +38 -128
- package/dist/packages/_es/component.js +35 -76
- package/dist/packages/_es/index.js +5 -6
- package/dist/packages/_es/index2.js +9 -30
- package/dist/packages/_es/index3.js +6 -8
- package/dist/packages/_es/index4.js +13 -58
- package/dist/packages/_es/index5.js +120 -675
- package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
- package/dist/packages/_es/pxCheck.js +3 -5
- package/dist/packages/_es/raf.js +8 -15
- package/dist/packages/button/index.scss +2 -1
- package/dist/packages/cell/index.scss +11 -0
- package/dist/packages/checkbox/index.scss +6 -0
- package/dist/packages/dialog/index.scss +1 -0
- package/dist/packages/elevator/index.scss +21 -0
- package/dist/packages/input/index.scss +13 -1
- package/dist/packages/locale/lang/baseLang.d.ts +1 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.d.ts +8 -0
- package/dist/packages/locale/lang/en-US.js +5 -97
- package/dist/packages/locale/lang/id-ID.d.ts +8 -0
- package/dist/packages/locale/lang/id-ID.js +5 -97
- package/dist/packages/locale/lang/index.js +16 -38
- package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
- package/dist/packages/locale/lang/zh-CN.js +5 -97
- package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
- package/dist/packages/locale/lang/zh-TW.js +5 -97
- package/dist/packages/radio/index.scss +1 -0
- package/dist/packages/switch/index.scss +3 -3
- package/dist/packages/tabpane/index.scss +1 -0
- package/dist/smartips/attributes.json +62 -10
- package/dist/smartips/tags.json +17 -4
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +10 -1
- package/dist/styles/variables-jdt.scss +10 -1
- package/dist/styles/variables.scss +10 -1
- package/dist/types/__VUE/address/index.vue.d.ts +5 -5
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +2 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +18 -5
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.d.ts +9 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +23 -8
- package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
- package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
- package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/picker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/row/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +9 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +3 -3
- package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -1
|
@@ -5,316 +5,77 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (
|
|
9
|
-
for (var prop in
|
|
10
|
-
if (__hasOwnProp.call(
|
|
11
|
-
__defNormalProp(
|
|
8
|
+
var __spreadValues = (a2, b2) => {
|
|
9
|
+
for (var prop in b2 || (b2 = {}))
|
|
10
|
+
if (__hasOwnProp.call(b2, prop))
|
|
11
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
12
12
|
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(
|
|
14
|
-
if (__propIsEnum.call(
|
|
15
|
-
__defNormalProp(
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b2)) {
|
|
14
|
+
if (__propIsEnum.call(b2, prop))
|
|
15
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return a2;
|
|
18
18
|
};
|
|
19
|
-
var __spreadProps = (
|
|
19
|
+
var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.22-beta.
|
|
21
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { ref, reactive, computed, onMounted, onBeforeUnmount, onBeforeMount, onActivated, onDeactivated, watch, toRefs, resolveComponent, openBlock, createBlock, Teleport, normalizeClass, normalizeStyle, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, renderSlot, createElementBlock, vShow } from "vue";
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import { c as
|
|
29
|
-
import { _ as
|
|
25
|
+
import { ref as e, reactive as o, computed as l, onMounted as n, onBeforeUnmount as i, onBeforeMount as t, onActivated as s, onDeactivated as c, watch as a, toRefs as r, resolveComponent as p, openBlock as d, createBlock as u, Teleport as v, normalizeClass as y, normalizeStyle as k, createCommentVNode as m, createVNode as C, Transition as f, withCtx as b, withDirectives as I, createElementVNode as x, renderSlot as S, createElementBlock as O, vShow as z } from "vue";
|
|
26
|
+
import A, { overlayProps as w } from "./OverLay.js";
|
|
27
|
+
import _ from "./Icon.js";
|
|
28
|
+
import { c as h } from "./component.js";
|
|
29
|
+
import { _ as g } from "./plugin-vue_export-helper.js";
|
|
30
30
|
import "../locale/lang";
|
|
31
31
|
import "./pxCheck.js";
|
|
32
|
-
let
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
let B = 0;
|
|
33
|
+
const { componentName: L, create: N } = h("popup");
|
|
34
|
+
let $ = 2e3;
|
|
35
|
+
const j = __spreadProps(__spreadValues({}, w), { position: { type: String, default: "center" }, transition: String, style: { type: Object }, popClass: { type: String, default: "" }, closeable: { type: Boolean, default: false }, closeIconPosition: { type: String, default: "top-right" }, closeIcon: { type: String, default: "close" }, destroyOnClose: { type: Boolean, default: true }, teleport: { type: [String, Element], default: "body" }, overlay: { type: Boolean, default: true }, round: { type: Boolean, default: false }, isWrapTeleport: { type: Boolean, default: true }, safeAreaInsetBottom: { type: Boolean, default: false } }), E = N({ components: { [A.name]: A, [_.name]: _ }, props: __spreadValues({}, j), emits: ["click", "click-close-icon", "open", "close", "opend", "closed", "update:visible", "click-overlay"], setup(p2, { emit: d2 }) {
|
|
36
|
+
const u2 = e(), v2 = o({ zIndex: p2.zIndex ? p2.zIndex : $, showSlot: true, transitionName: `popup-fade-${p2.position}`, overLayCount: 1, keepAlive: false, closed: p2.closeable }), [y2, k2] = (m2 = () => p2.lockScroll, [() => {
|
|
37
|
+
m2() && (!B && document.body.classList.add("nut-overflow-hidden"), B++);
|
|
38
|
+
}, () => {
|
|
39
|
+
m2() && B && (B--, !B && document.body.classList.remove("nut-overflow-hidden"));
|
|
40
|
+
}]);
|
|
41
|
+
var m2;
|
|
42
|
+
const C2 = l(() => ({ [L]: true, round: p2.round, [`popup-${p2.position}`]: true, [`popup-${p2.position}--safebottom`]: p2.position === "bottom" && p2.safeAreaInsetBottom, [p2.popClass]: true })), f2 = l(() => __spreadValues({ zIndex: v2.zIndex, animationDuration: p2.duration ? `${p2.duration}s` : "initial" }, p2.style)), b2 = () => {
|
|
43
|
+
p2.visible || (p2.zIndex !== void 0 && ($ = Number(p2.zIndex)), d2("update:visible", true), y2(), v2.zIndex = ++$), p2.destroyOnClose && (v2.showSlot = true), d2("open");
|
|
44
|
+
}, I2 = () => {
|
|
45
|
+
p2.visible && (k2(), d2("update:visible", false), p2.destroyOnClose && setTimeout(() => {
|
|
46
|
+
v2.showSlot = false, d2("close");
|
|
47
|
+
}, 1e3 * +p2.duration));
|
|
46
48
|
};
|
|
47
|
-
return
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
teleport: {
|
|
81
|
-
type: [String, Element],
|
|
82
|
-
default: "body"
|
|
83
|
-
},
|
|
84
|
-
overlay: {
|
|
85
|
-
type: Boolean,
|
|
86
|
-
default: true
|
|
87
|
-
},
|
|
88
|
-
round: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
default: false
|
|
91
|
-
},
|
|
92
|
-
isWrapTeleport: {
|
|
93
|
-
type: Boolean,
|
|
94
|
-
default: true
|
|
95
|
-
},
|
|
96
|
-
safeAreaInsetBottom: {
|
|
97
|
-
type: Boolean,
|
|
98
|
-
default: false
|
|
99
|
-
}
|
|
100
|
-
});
|
|
101
|
-
const _sfc_main = create({
|
|
102
|
-
components: {
|
|
103
|
-
[overlay.name]: overlay,
|
|
104
|
-
[_sfc_main$1.name]: _sfc_main$1
|
|
105
|
-
},
|
|
106
|
-
props: __spreadValues({}, popupProps),
|
|
107
|
-
emits: ["click", "click-close-icon", "open", "close", "opend", "closed", "update:visible", "click-overlay"],
|
|
108
|
-
setup(props, { emit }) {
|
|
109
|
-
const popupRef = ref();
|
|
110
|
-
const state = reactive({
|
|
111
|
-
zIndex: props.zIndex ? props.zIndex : _zIndex,
|
|
112
|
-
showSlot: true,
|
|
113
|
-
transitionName: `popup-fade-${props.position}`,
|
|
114
|
-
overLayCount: 1,
|
|
115
|
-
keepAlive: false,
|
|
116
|
-
closed: props.closeable
|
|
117
|
-
});
|
|
118
|
-
const [lockScroll, unlockScroll] = useLockScroll(() => props.lockScroll);
|
|
119
|
-
const classes = computed(() => {
|
|
120
|
-
const prefixCls = componentName;
|
|
121
|
-
return {
|
|
122
|
-
[prefixCls]: true,
|
|
123
|
-
["round"]: props.round,
|
|
124
|
-
[`popup-${props.position}`]: true,
|
|
125
|
-
[`popup-${props.position}--safebottom`]: props.position === "bottom" && props.safeAreaInsetBottom,
|
|
126
|
-
[props.popClass]: true
|
|
127
|
-
};
|
|
128
|
-
});
|
|
129
|
-
const popStyle = computed(() => {
|
|
130
|
-
return __spreadValues({
|
|
131
|
-
zIndex: state.zIndex,
|
|
132
|
-
animationDuration: props.duration ? `${props.duration}s` : "initial"
|
|
133
|
-
}, props.style);
|
|
134
|
-
});
|
|
135
|
-
const open = () => {
|
|
136
|
-
if (!props.visible) {
|
|
137
|
-
if (props.zIndex !== void 0) {
|
|
138
|
-
_zIndex = Number(props.zIndex);
|
|
139
|
-
}
|
|
140
|
-
emit("update:visible", true);
|
|
141
|
-
lockScroll();
|
|
142
|
-
state.zIndex = ++_zIndex;
|
|
143
|
-
}
|
|
144
|
-
if (props.destroyOnClose) {
|
|
145
|
-
state.showSlot = true;
|
|
146
|
-
}
|
|
147
|
-
emit("open");
|
|
148
|
-
};
|
|
149
|
-
const close = () => {
|
|
150
|
-
if (props.visible) {
|
|
151
|
-
unlockScroll();
|
|
152
|
-
emit("update:visible", false);
|
|
153
|
-
if (props.destroyOnClose) {
|
|
154
|
-
setTimeout(() => {
|
|
155
|
-
state.showSlot = false;
|
|
156
|
-
emit("close");
|
|
157
|
-
}, +props.duration * 1e3);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
const onClick = (e) => {
|
|
162
|
-
emit("click", e);
|
|
163
|
-
};
|
|
164
|
-
const onClickCloseIcon = (e) => {
|
|
165
|
-
emit("click-close-icon", e);
|
|
166
|
-
close();
|
|
167
|
-
};
|
|
168
|
-
const onClickOverlay = (e) => {
|
|
169
|
-
if (props.closeOnClickOverlay) {
|
|
170
|
-
emit("click-overlay", e);
|
|
171
|
-
close();
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
const onOpened = (e) => {
|
|
175
|
-
emit("opend", e);
|
|
176
|
-
};
|
|
177
|
-
const onClosed = (e) => {
|
|
178
|
-
emit("closed", e);
|
|
179
|
-
};
|
|
180
|
-
onMounted(() => {
|
|
181
|
-
props.transition ? state.transitionName = props.transition : state.transitionName = `popup-slide-${props.position}`;
|
|
182
|
-
props.visible && open();
|
|
183
|
-
});
|
|
184
|
-
onBeforeUnmount(() => {
|
|
185
|
-
props.visible && close();
|
|
186
|
-
});
|
|
187
|
-
onBeforeMount(() => {
|
|
188
|
-
if (props.visible) {
|
|
189
|
-
unlockScroll();
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
onActivated(() => {
|
|
193
|
-
if (state.keepAlive) {
|
|
194
|
-
emit("update:visible", true);
|
|
195
|
-
state.keepAlive = false;
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
onDeactivated(() => {
|
|
199
|
-
if (props.visible) {
|
|
200
|
-
close();
|
|
201
|
-
state.keepAlive = true;
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
watch(() => props.visible, (value) => {
|
|
205
|
-
if (value) {
|
|
206
|
-
open();
|
|
207
|
-
} else {
|
|
208
|
-
close();
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
watch(() => props.position, (value) => {
|
|
212
|
-
value === "center" ? state.transitionName = "popup-fade" : state.transitionName = `popup-slide-${value}`;
|
|
213
|
-
});
|
|
214
|
-
watch(() => props.closeable, (value) => {
|
|
215
|
-
state.closed = value;
|
|
216
|
-
});
|
|
217
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
218
|
-
popStyle,
|
|
219
|
-
classes,
|
|
220
|
-
onClick,
|
|
221
|
-
onClickCloseIcon,
|
|
222
|
-
onClickOverlay,
|
|
223
|
-
onOpened,
|
|
224
|
-
onClosed,
|
|
225
|
-
popupRef
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
const _hoisted_1 = { key: 1 };
|
|
230
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
231
|
-
const _component_nut_overlay = resolveComponent("nut-overlay");
|
|
232
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
233
|
-
return _ctx.isWrapTeleport ? (openBlock(), createBlock(Teleport, {
|
|
234
|
-
key: 0,
|
|
235
|
-
to: _ctx.teleport
|
|
236
|
-
}, [
|
|
237
|
-
_ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
|
|
238
|
-
key: 0,
|
|
239
|
-
visible: _ctx.visible,
|
|
240
|
-
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
241
|
-
class: normalizeClass(_ctx.overlayClass),
|
|
242
|
-
style: normalizeStyle(_ctx.overlayStyle),
|
|
243
|
-
"z-index": _ctx.zIndex,
|
|
244
|
-
"lock-scroll": _ctx.lockScroll,
|
|
245
|
-
duration: _ctx.duration,
|
|
246
|
-
onClick: _ctx.onClickOverlay
|
|
247
|
-
}, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : createCommentVNode("", true),
|
|
248
|
-
createVNode(Transition, {
|
|
249
|
-
name: _ctx.transitionName,
|
|
250
|
-
onAfterEnter: _ctx.onOpened,
|
|
251
|
-
onAfterLeave: _ctx.onClosed
|
|
252
|
-
}, {
|
|
253
|
-
default: withCtx(() => [
|
|
254
|
-
withDirectives(createElementVNode("view", {
|
|
255
|
-
class: normalizeClass(_ctx.classes),
|
|
256
|
-
style: normalizeStyle(_ctx.popStyle),
|
|
257
|
-
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
|
|
258
|
-
ref: "popupRef"
|
|
259
|
-
}, [
|
|
260
|
-
_ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
|
|
261
|
-
_ctx.closed ? (openBlock(), createElementBlock("view", {
|
|
262
|
-
key: 1,
|
|
263
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
|
|
264
|
-
class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
|
|
265
|
-
}, [
|
|
266
|
-
createVNode(_component_nut_icon, {
|
|
267
|
-
name: _ctx.closeIcon,
|
|
268
|
-
size: "12px"
|
|
269
|
-
}, null, 8, ["name"])
|
|
270
|
-
], 2)) : createCommentVNode("", true)
|
|
271
|
-
], 6), [
|
|
272
|
-
[vShow, _ctx.visible]
|
|
273
|
-
])
|
|
274
|
-
]),
|
|
275
|
-
_: 3
|
|
276
|
-
}, 8, ["name", "onAfterEnter", "onAfterLeave"])
|
|
277
|
-
], 8, ["to"])) : (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
278
|
-
_ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
|
|
279
|
-
key: 0,
|
|
280
|
-
visible: _ctx.visible,
|
|
281
|
-
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
282
|
-
class: normalizeClass(_ctx.overlayClass),
|
|
283
|
-
style: normalizeStyle(_ctx.overlayStyle),
|
|
284
|
-
"z-index": _ctx.zIndex,
|
|
285
|
-
"lock-scroll": _ctx.lockScroll,
|
|
286
|
-
duration: _ctx.duration,
|
|
287
|
-
onClick: _ctx.onClickOverlay
|
|
288
|
-
}, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : createCommentVNode("", true),
|
|
289
|
-
createVNode(Transition, {
|
|
290
|
-
name: _ctx.transitionName,
|
|
291
|
-
onAfterEnter: _ctx.onOpened,
|
|
292
|
-
onAfterLeave: _ctx.onClosed
|
|
293
|
-
}, {
|
|
294
|
-
default: withCtx(() => [
|
|
295
|
-
withDirectives(createElementVNode("view", {
|
|
296
|
-
class: normalizeClass(_ctx.classes),
|
|
297
|
-
style: normalizeStyle(_ctx.popStyle),
|
|
298
|
-
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
299
|
-
}, [
|
|
300
|
-
_ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
|
|
301
|
-
_ctx.closed ? (openBlock(), createElementBlock("view", {
|
|
302
|
-
key: 1,
|
|
303
|
-
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
|
|
304
|
-
class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
|
|
305
|
-
}, [
|
|
306
|
-
createVNode(_component_nut_icon, {
|
|
307
|
-
name: _ctx.closeIcon,
|
|
308
|
-
size: "12px"
|
|
309
|
-
}, null, 8, ["name"])
|
|
310
|
-
], 2)) : createCommentVNode("", true)
|
|
311
|
-
], 6), [
|
|
312
|
-
[vShow, _ctx.visible]
|
|
313
|
-
])
|
|
314
|
-
]),
|
|
315
|
-
_: 3
|
|
316
|
-
}, 8, ["name", "onAfterEnter", "onAfterLeave"])
|
|
317
|
-
]));
|
|
318
|
-
}
|
|
319
|
-
var Popup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
320
|
-
export { Popup as default, popupProps };
|
|
49
|
+
return n(() => {
|
|
50
|
+
p2.transition ? v2.transitionName = p2.transition : v2.transitionName = `popup-slide-${p2.position}`, p2.visible && b2();
|
|
51
|
+
}), i(() => {
|
|
52
|
+
p2.visible && I2();
|
|
53
|
+
}), t(() => {
|
|
54
|
+
p2.visible && k2();
|
|
55
|
+
}), s(() => {
|
|
56
|
+
v2.keepAlive && (d2("update:visible", true), v2.keepAlive = false);
|
|
57
|
+
}), c(() => {
|
|
58
|
+
p2.visible && (I2(), v2.keepAlive = true);
|
|
59
|
+
}), a(() => p2.visible, (e2) => {
|
|
60
|
+
e2 ? b2() : I2();
|
|
61
|
+
}), a(() => p2.position, (e2) => {
|
|
62
|
+
v2.transitionName = e2 === "center" ? "popup-fade" : `popup-slide-${e2}`;
|
|
63
|
+
}), a(() => p2.closeable, (e2) => {
|
|
64
|
+
v2.closed = e2;
|
|
65
|
+
}), __spreadProps(__spreadValues({}, r(v2)), { popStyle: f2, classes: C2, onClick: (e2) => {
|
|
66
|
+
d2("click", e2);
|
|
67
|
+
}, onClickCloseIcon: (e2) => {
|
|
68
|
+
d2("click-close-icon", e2), I2();
|
|
69
|
+
}, onClickOverlay: (e2) => {
|
|
70
|
+
p2.closeOnClickOverlay && (d2("click-overlay", e2), I2());
|
|
71
|
+
}, onOpened: (e2) => {
|
|
72
|
+
d2("opend", e2);
|
|
73
|
+
}, onClosed: (e2) => {
|
|
74
|
+
d2("closed", e2);
|
|
75
|
+
}, popupRef: u2 });
|
|
76
|
+
} }), P = { key: 1 };
|
|
77
|
+
var T = g(E, [["render", function(e2, o2, l2, n2, i2, t2) {
|
|
78
|
+
const s2 = p("nut-overlay"), c2 = p("nut-icon");
|
|
79
|
+
return e2.isWrapTeleport ? (d(), u(v, { key: 0, to: e2.teleport }, [e2.overlay ? (d(), u(s2, { key: 0, visible: e2.visible, "close-on-click-overlay": e2.closeOnClickOverlay, class: y(e2.overlayClass), style: k(e2.overlayStyle), "z-index": e2.zIndex, "lock-scroll": e2.lockScroll, duration: e2.duration, onClick: e2.onClickOverlay }, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : m("", true), C(f, { name: e2.transitionName, onAfterEnter: e2.onOpened, onAfterLeave: e2.onClosed }, { default: b(() => [I(x("view", { class: y(e2.classes), style: k(e2.popStyle), onClick: o2[1] || (o2[1] = (...o3) => e2.onClick && e2.onClick(...o3)), ref: "popupRef" }, [e2.showSlot ? S(e2.$slots, "default", { key: 0 }) : m("", true), e2.closed ? (d(), O("view", { key: 1, onClick: o2[0] || (o2[0] = (...o3) => e2.onClickCloseIcon && e2.onClickCloseIcon(...o3)), class: y(["nutui-popup__close-icon", "nutui-popup__close-icon--" + e2.closeIconPosition]) }, [C(c2, { name: e2.closeIcon, size: "12px" }, null, 8, ["name"])], 2)) : m("", true)], 6), [[z, e2.visible]])]), _: 3 }, 8, ["name", "onAfterEnter", "onAfterLeave"])], 8, ["to"])) : (d(), O("view", P, [e2.overlay ? (d(), u(s2, { key: 0, visible: e2.visible, "close-on-click-overlay": e2.closeOnClickOverlay, class: y(e2.overlayClass), style: k(e2.overlayStyle), "z-index": e2.zIndex, "lock-scroll": e2.lockScroll, duration: e2.duration, onClick: e2.onClickOverlay }, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : m("", true), C(f, { name: e2.transitionName, onAfterEnter: e2.onOpened, onAfterLeave: e2.onClosed }, { default: b(() => [I(x("view", { class: y(e2.classes), style: k(e2.popStyle), onClick: o2[3] || (o2[3] = (...o3) => e2.onClick && e2.onClick(...o3)) }, [e2.showSlot ? S(e2.$slots, "default", { key: 0 }) : m("", true), e2.closed ? (d(), O("view", { key: 1, onClick: o2[2] || (o2[2] = (...o3) => e2.onClickCloseIcon && e2.onClickCloseIcon(...o3)), class: y(["nutui-popup__close-icon", "nutui-popup__close-icon--" + e2.closeIconPosition]) }, [C(c2, { name: e2.closeIcon, size: "12px" }, null, 8, ["name"])], 2)) : m("", true)], 6), [[z, e2.visible]])]), _: 3 }, 8, ["name", "onAfterEnter", "onAfterLeave"])]));
|
|
80
|
+
}]]);
|
|
81
|
+
export { T as default, j as popupProps };
|
|
@@ -1,123 +1,21 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22-beta.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { computed as e, openBlock as i, createElementBlock as t, normalizeClass as s, createCommentVNode as r, createElementVNode as o, toDisplayString as n } from "vue";
|
|
7
|
+
import { c as l } from "./component.js";
|
|
8
|
+
import { _ as a } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName, create } =
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
type: String,
|
|
23
|
-
default: "¥"
|
|
24
|
-
},
|
|
25
|
-
decimalDigits: {
|
|
26
|
-
type: [Number, String],
|
|
27
|
-
default: 2
|
|
28
|
-
},
|
|
29
|
-
thousands: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: false
|
|
32
|
-
},
|
|
33
|
-
position: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: "before"
|
|
36
|
-
},
|
|
37
|
-
size: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: "large"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
setup(props) {
|
|
43
|
-
const classes = computed(() => {
|
|
44
|
-
return {
|
|
45
|
-
[componentName]: true
|
|
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
|
-
};
|
|
85
|
-
return {
|
|
86
|
-
classes,
|
|
87
|
-
showSymbol,
|
|
88
|
-
checkPoint,
|
|
89
|
-
formatThousands,
|
|
90
|
-
formatDecimal
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
const _hoisted_1 = ["innerHTML"];
|
|
95
|
-
const _hoisted_2 = ["innerHTML"];
|
|
96
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
97
|
-
return openBlock(), createElementBlock("view", {
|
|
98
|
-
class: normalizeClass(_ctx.classes)
|
|
99
|
-
}, [
|
|
100
|
-
_ctx.needSymbol && _ctx.position == "before" ? (openBlock(), createElementBlock("view", {
|
|
101
|
-
key: 0,
|
|
102
|
-
class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
|
|
103
|
-
innerHTML: _ctx.showSymbol
|
|
104
|
-
}, null, 10, _hoisted_1)) : createCommentVNode("", true),
|
|
105
|
-
createElementVNode("view", {
|
|
106
|
-
class: normalizeClass(`nut-price--${_ctx.size}`)
|
|
107
|
-
}, toDisplayString(_ctx.formatThousands(_ctx.price)), 3),
|
|
108
|
-
_ctx.decimalDigits != 0 ? (openBlock(), createElementBlock("view", {
|
|
109
|
-
key: 1,
|
|
110
|
-
class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
|
|
111
|
-
}, ".", 2)) : createCommentVNode("", true),
|
|
112
|
-
createElementVNode("view", {
|
|
113
|
-
class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
|
|
114
|
-
}, toDisplayString(_ctx.formatDecimal(_ctx.price)), 3),
|
|
115
|
-
_ctx.needSymbol && _ctx.position == "after" ? (openBlock(), createElementBlock("view", {
|
|
116
|
-
key: 2,
|
|
117
|
-
class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
|
|
118
|
-
innerHTML: _ctx.showSymbol
|
|
119
|
-
}, null, 10, _hoisted_2)) : createCommentVNode("", true)
|
|
120
|
-
], 2);
|
|
121
|
-
}
|
|
122
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
123
|
-
export { index as default };
|
|
10
|
+
const { componentName: m, create: p } = l("price"), c = p({ props: { price: { type: [Number, String], default: 0 }, needSymbol: { type: Boolean, default: true }, symbol: { type: String, default: "¥" }, decimalDigits: { type: [Number, String], default: 2 }, thousands: { type: Boolean, default: false }, position: { type: String, default: "before" }, size: { type: String, default: "large" } }, setup(i2) {
|
|
11
|
+
const t2 = e(() => ({ [m]: true })), s2 = e(() => i2.needSymbol ? i2.symbol : ""), r2 = (e2) => String(e2).indexOf(".") > 0;
|
|
12
|
+
return { classes: t2, showSymbol: s2, checkPoint: r2, formatThousands: (e2) => (Number(e2) == 0 && (e2 = 0), e2 = r2(e2) ? typeof (e2 = Number(e2).toFixed(i2.decimalDigits)).split(".") == "string" ? e2.split(".") : e2.split(".")[0] : e2.toString(), i2.thousands ? (e2 || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") : e2), formatDecimal: (e2) => {
|
|
13
|
+
Number(e2) == 0 && (e2 = 0), e2 = r2(e2) ? typeof (e2 = Number(e2).toFixed(i2.decimalDigits)).split(".") == "string" ? 0 : e2.split(".")[1] ? e2.split(".")[1] : 0 : 0;
|
|
14
|
+
const t3 = Number("0." + e2).toFixed(i2.decimalDigits);
|
|
15
|
+
return String(t3).substring(2, t3.length);
|
|
16
|
+
} };
|
|
17
|
+
} }), u = ["innerHTML"], d = ["innerHTML"];
|
|
18
|
+
var y = a(c, [["render", function(e2, l2, a2, m2, p2, c2) {
|
|
19
|
+
return i(), t("view", { class: s(e2.classes) }, [e2.needSymbol && e2.position == "before" ? (i(), t("view", { key: 0, class: s(["nut-price--symbol", `nut-price--symbol-${e2.size}`]), innerHTML: e2.showSymbol }, null, 10, u)) : r("", true), o("view", { class: s(`nut-price--${e2.size}`) }, n(e2.formatThousands(e2.price)), 3), e2.decimalDigits != 0 ? (i(), t("view", { key: 1, class: s(`nut-price--decimal-${e2.size}`) }, ".", 2)) : r("", true), o("view", { class: s(`nut-price--decimal-${e2.size}`) }, n(e2.formatDecimal(e2.price)), 3), e2.needSymbol && e2.position == "after" ? (i(), t("view", { key: 2, class: s(["nut-price--symbol", `nut-price--symbol-${e2.size}`]), innerHTML: e2.showSymbol }, null, 10, d)) : r("", true)], 2);
|
|
20
|
+
}]]);
|
|
21
|
+
export { y as default };
|