@nutui/nutui 3.1.18-beta.0 → 3.1.19-beta.1
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 +41 -0
- package/LICENSE +1 -1
- package/README.md +6 -0
- package/dist/nutui.d.ts +39 -36
- package/dist/nutui.es.js +13149 -11288
- package/dist/nutui.umd.js +13156 -11381
- package/dist/packages/_es/ActionSheet.js +13 -19
- package/dist/packages/_es/Address.js +70 -55
- package/dist/packages/_es/Audio.js +13 -13
- package/dist/packages/_es/AudioOperate.js +125 -0
- package/dist/packages/_es/Avatar.js +4 -4
- package/dist/packages/_es/BackTop.js +69 -108
- package/dist/packages/_es/Badge.js +4 -4
- package/dist/packages/_es/Barrage.js +63 -56
- package/dist/packages/_es/Button.js +3 -3
- package/dist/packages/_es/Calendar.js +30 -702
- package/dist/packages/_es/CalendarItem.js +10 -0
- package/dist/packages/_es/Card.js +7 -6
- package/dist/packages/_es/Cascader.js +8 -8
- package/dist/packages/_es/Cell.js +27 -27
- package/dist/packages/_es/CellGroup.js +2 -2
- package/dist/packages/_es/Checkbox.js +4 -4
- package/dist/packages/_es/CheckboxGroup.js +3 -3
- package/dist/packages/_es/CircleProgress.js +150 -41
- package/dist/packages/_es/Col.js +2 -2
- package/dist/packages/_es/Collapse.js +35 -9
- package/dist/packages/_es/CollapseItem.js +79 -38
- package/dist/packages/_es/CountDown.js +8 -6
- package/dist/packages/_es/CountUp.js +31 -30
- package/dist/packages/_es/DatePicker.js +81 -44
- package/dist/packages/_es/Dialog.js +7 -83
- package/dist/packages/_es/Divider.js +5 -5
- package/dist/packages/_es/Drag.js +93 -55
- package/dist/packages/_es/Elevator.js +75 -50
- package/dist/packages/_es/Empty.js +4 -4
- package/dist/packages/_es/FixedNav.js +6 -6
- package/dist/packages/_es/Form.js +11 -9
- package/dist/packages/_es/FormItem.js +9 -6
- package/dist/packages/_es/Grid.js +2 -2
- package/dist/packages/_es/GridItem.js +9 -27
- package/dist/packages/_es/Icon.js +2 -2
- package/dist/packages/_es/ImagePreview.js +14 -83
- package/dist/packages/_es/Indicator.js +4 -4
- package/dist/packages/_es/InfiniteLoading.js +94 -108
- package/dist/packages/_es/Input.js +297 -73
- package/dist/packages/_es/InputNumber.js +24 -17
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/List.js +131 -0
- package/dist/packages/_es/Menu.js +16 -13
- package/dist/packages/_es/MenuItem.js +8 -8
- package/dist/packages/_es/Navbar.js +17 -12
- package/dist/packages/_es/NoticeBar.js +47 -39
- package/dist/packages/_es/Notify.js +28 -163
- package/dist/packages/_es/NumberKeyboard.js +4 -4
- package/dist/packages/_es/OldPicker.js +486 -0
- package/dist/packages/_es/OverLay.js +6 -26
- package/dist/packages/_es/Pagination.js +8 -8
- package/dist/packages/_es/Picker.js +192 -163
- package/dist/packages/_es/Popover.js +155 -30
- package/dist/packages/_es/Popup.js +7 -70
- package/dist/packages/_es/Price.js +18 -6
- package/dist/packages/_es/Progress.js +29 -27
- package/dist/packages/_es/PullRefresh.js +363 -0
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +169 -46
- package/dist/packages/_es/Rate.js +17 -20
- package/dist/packages/_es/Row.js +2 -2
- package/dist/packages/_es/SearchBar.js +9 -7
- package/dist/packages/_es/ShortPassword.js +90 -68
- package/dist/packages/_es/SideNavBar.js +6 -17
- package/dist/packages/_es/SideNavBarItem.js +2 -2
- package/dist/packages/_es/Signature.js +70 -70
- package/dist/packages/_es/Skeleton.js +9 -12
- package/dist/packages/_es/Sku.js +40 -31
- package/dist/packages/_es/Step.js +28 -12
- package/dist/packages/_es/Steps.js +8 -3
- package/dist/packages/_es/Sticky.js +29 -24
- package/dist/packages/_es/SubSideNavBar.js +2 -2
- package/dist/packages/_es/Swipe.js +40 -27
- package/dist/packages/_es/Swiper.js +32 -14
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +4 -4
- package/dist/packages/_es/TabPane.js +2 -2
- package/dist/packages/_es/Tabbar.js +4 -4
- package/dist/packages/_es/TabbarItem.js +28 -23
- package/dist/packages/_es/Table.js +14 -14
- package/dist/packages/_es/Tabs.js +19 -15
- package/dist/packages/_es/Tag.js +14 -8
- package/dist/packages/_es/TextArea.js +49 -15
- package/dist/packages/_es/TimeDetail.js +5 -4
- package/dist/packages/_es/TimePannel.js +4 -4
- package/dist/packages/_es/TimeSelect.js +9 -8
- package/dist/packages/_es/Toast.js +42 -171
- package/dist/packages/_es/Uploader.js +108 -139
- package/dist/packages/_es/Video.js +14 -10
- package/dist/packages/_es/common.js +2 -2
- package/dist/packages/_es/component.js +2 -2
- package/dist/packages/_es/index.js +45 -7
- package/dist/packages/_es/index.taro.js +719 -0
- package/dist/packages/_es/index2.js +2 -2
- package/dist/packages/_es/index3.js +57 -29
- package/dist/packages/_es/index4.js +414 -57
- package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
- package/dist/packages/_es/pxCheck.js +2 -2
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/_es/util.js +2 -2
- package/dist/packages/badge/index.scss +11 -13
- package/dist/packages/button/index.scss +1 -0
- package/dist/packages/calendar/index.scss +9 -4
- package/dist/packages/calendaritem/index.scss +0 -207
- package/dist/packages/cell/index.scss +6 -6
- package/dist/packages/checkbox/index.scss +4 -3
- package/dist/packages/collapseitem/index.scss +21 -11
- package/dist/packages/countdown/index.scss +3 -1
- package/dist/packages/divider/index.scss +8 -8
- package/dist/packages/elevator/index.scss +36 -36
- package/dist/packages/formitem/index.scss +15 -8
- package/dist/packages/indicator/index.scss +1 -1
- package/dist/packages/input/index.scss +70 -24
- package/dist/packages/inputnumber/index.scss +4 -2
- package/dist/packages/list/index.scss +24 -0
- package/dist/packages/menu/index.scss +3 -3
- package/dist/packages/navbar/index.scss +28 -8
- package/dist/packages/noticebar/index.scss +7 -8
- package/dist/packages/notify/index.scss +9 -0
- package/dist/packages/numberkeyboard/index.scss +22 -21
- package/dist/packages/oldpicker/index.scss +131 -0
- package/dist/packages/picker/index.scss +38 -32
- package/dist/packages/progress/index.scss +6 -5
- package/dist/packages/radio/index.scss +7 -6
- package/dist/packages/range/index.scss +109 -2
- package/dist/packages/searchbar/index.scss +7 -7
- package/dist/packages/sidenavbaritem/index.scss +5 -5
- package/dist/packages/step/index.scss +29 -29
- package/dist/packages/subsidenavbar/index.scss +10 -8
- package/dist/packages/tabbaritem/index.scss +15 -0
- package/dist/packages/timedetail/index.scss +13 -13
- package/dist/packages/timepannel/index.scss +7 -7
- package/dist/packages/timeselect/index.scss +3 -3
- package/dist/packages/uploader/index.scss +6 -6
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +64 -62
- package/dist/styles/themes/jdt.scss +91 -0
- package/dist/styles/variables-jdt.scss +728 -0
- package/dist/styles/variables.scss +250 -44
- package/package.json +2 -1
- package/dist/packages/_es/raf.js +0 -19
- package/dist/styles/themes/jdd.scss +0 -2
|
@@ -18,18 +18,140 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
22
|
-
* (c)
|
|
21
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import {
|
|
25
|
+
import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, createCommentVNode, renderSlot, ref, reactive, onMounted, watch, withModifiers, Fragment, renderList, createVNode, toDisplayString } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import Popup,
|
|
28
|
-
import Button from "./Button.js";
|
|
27
|
+
import { _ as _sfc_main$2, P as Popup, p as popupProps } from "./index4.js";
|
|
29
28
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
|
-
import "./
|
|
31
|
-
import "
|
|
29
|
+
import { u as useTaroRect } from "./index.js";
|
|
30
|
+
import Taro from "@tarojs/taro";
|
|
31
|
+
import "./use-lock-scroll.js";
|
|
32
32
|
import "./pxCheck.js";
|
|
33
|
+
const { componentName: componentName$1, create: create$1 } = createComponent("button");
|
|
34
|
+
const _sfc_main$1 = create$1({
|
|
35
|
+
components: {
|
|
36
|
+
[_sfc_main$2.name]: _sfc_main$2
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
color: String,
|
|
40
|
+
shape: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "round"
|
|
43
|
+
},
|
|
44
|
+
plain: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
loading: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
disabled: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
type: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: "default"
|
|
59
|
+
},
|
|
60
|
+
size: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: "normal"
|
|
63
|
+
},
|
|
64
|
+
block: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
icon: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: ""
|
|
71
|
+
},
|
|
72
|
+
iconClassPrefix: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "nut-icon"
|
|
75
|
+
},
|
|
76
|
+
iconFontClassName: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: "nutui-iconfont"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
emits: ["click"],
|
|
82
|
+
setup(props, { emit, slots }) {
|
|
83
|
+
const { type, size, shape, disabled, loading, color, plain, block } = toRefs(props);
|
|
84
|
+
const handleClick = (event) => {
|
|
85
|
+
if (!loading.value && !disabled.value) {
|
|
86
|
+
emit("click", event);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const classes = computed(() => {
|
|
90
|
+
const prefixCls = componentName$1;
|
|
91
|
+
return {
|
|
92
|
+
[prefixCls]: true,
|
|
93
|
+
[`${prefixCls}--${type.value}`]: type.value,
|
|
94
|
+
[`${prefixCls}--${size.value}`]: size.value,
|
|
95
|
+
[`${prefixCls}--${shape.value}`]: shape.value,
|
|
96
|
+
[`${prefixCls}--plain`]: plain.value,
|
|
97
|
+
[`${prefixCls}--block`]: block.value,
|
|
98
|
+
[`${prefixCls}--disabled`]: disabled.value,
|
|
99
|
+
[`${prefixCls}--loading`]: loading.value
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
const getStyle = computed(() => {
|
|
103
|
+
var _a;
|
|
104
|
+
const style = {};
|
|
105
|
+
if (color == null ? void 0 : color.value) {
|
|
106
|
+
if (plain.value) {
|
|
107
|
+
style.color = color.value;
|
|
108
|
+
style.background = "#fff";
|
|
109
|
+
if (!((_a = color.value) == null ? void 0 : _a.includes("gradient"))) {
|
|
110
|
+
style.borderColor = color.value;
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
style.color = "#fff";
|
|
114
|
+
style.background = color.value;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return style;
|
|
118
|
+
});
|
|
119
|
+
return {
|
|
120
|
+
handleClick,
|
|
121
|
+
classes,
|
|
122
|
+
getStyle
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
const _hoisted_1$1 = { class: "nut-button__warp" };
|
|
127
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
128
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
129
|
+
return openBlock(), createElementBlock("view", {
|
|
130
|
+
class: normalizeClass(_ctx.classes),
|
|
131
|
+
style: normalizeStyle(_ctx.getStyle),
|
|
132
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
|
|
133
|
+
}, [
|
|
134
|
+
createElementVNode("view", _hoisted_1$1, [
|
|
135
|
+
_ctx.loading ? (openBlock(), createBlock(_component_nut_icon, {
|
|
136
|
+
key: 0,
|
|
137
|
+
class: "nut-icon-loading"
|
|
138
|
+
})) : createCommentVNode("", true),
|
|
139
|
+
_ctx.icon && !_ctx.loading ? (openBlock(), createBlock(_component_nut_icon, {
|
|
140
|
+
key: 1,
|
|
141
|
+
name: _ctx.icon,
|
|
142
|
+
"class-prefix": _ctx.iconClassPrefix,
|
|
143
|
+
"font-class-name": _ctx.iconFontClassName
|
|
144
|
+
}, null, 8, ["name", "class-prefix", "font-class-name"])) : createCommentVNode("", true),
|
|
145
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("view", {
|
|
146
|
+
key: 2,
|
|
147
|
+
class: normalizeClass({ text: _ctx.icon || _ctx.loading })
|
|
148
|
+
}, [
|
|
149
|
+
renderSlot(_ctx.$slots, "default")
|
|
150
|
+
], 2)) : createCommentVNode("", true)
|
|
151
|
+
])
|
|
152
|
+
], 6);
|
|
153
|
+
}
|
|
154
|
+
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
33
155
|
const { componentName, create } = createComponent("popover");
|
|
34
156
|
const _sfc_main = create({
|
|
35
157
|
inheritAttrs: false,
|
|
@@ -81,15 +203,15 @@ const _sfc_main = create({
|
|
|
81
203
|
[`${prefixCls}--${location.value}`]: location.value
|
|
82
204
|
};
|
|
83
205
|
});
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
state.
|
|
87
|
-
|
|
206
|
+
const getReference = async () => {
|
|
207
|
+
const refe = await useTaroRect(reference, Taro);
|
|
208
|
+
state.elWidth = refe.width;
|
|
209
|
+
state.elHeight = refe.height;
|
|
210
|
+
};
|
|
88
211
|
const getStyle = computed(() => {
|
|
89
212
|
const style = {};
|
|
90
213
|
if (location.value == "top") {
|
|
91
|
-
style.bottom = state.elHeight +
|
|
92
|
-
style.left = 0 + "px";
|
|
214
|
+
style.bottom = state.elHeight + 10 + "px";
|
|
93
215
|
} else if (location.value == "right") {
|
|
94
216
|
style.top = 0 + "px";
|
|
95
217
|
style.right = -state.elWidth + "px";
|
|
@@ -97,8 +219,7 @@ const _sfc_main = create({
|
|
|
97
219
|
style.top = 0 + "px";
|
|
98
220
|
style.left = -state.elWidth + "px";
|
|
99
221
|
} else {
|
|
100
|
-
style.top = state.elHeight +
|
|
101
|
-
style.left = 0 + "px";
|
|
222
|
+
style.top = state.elHeight + 10 + "px";
|
|
102
223
|
}
|
|
103
224
|
return style;
|
|
104
225
|
});
|
|
@@ -120,7 +241,9 @@ const _sfc_main = create({
|
|
|
120
241
|
return style;
|
|
121
242
|
});
|
|
122
243
|
onMounted(() => {
|
|
123
|
-
|
|
244
|
+
setTimeout(() => {
|
|
245
|
+
getReference();
|
|
246
|
+
}, 200);
|
|
124
247
|
});
|
|
125
248
|
watch(() => props.visible, (value) => {
|
|
126
249
|
showPopup.value = value;
|
|
@@ -137,12 +260,10 @@ const _sfc_main = create({
|
|
|
137
260
|
emit("close");
|
|
138
261
|
emit("update:visible", false);
|
|
139
262
|
};
|
|
140
|
-
const chooseItem = (item,
|
|
141
|
-
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
emit("choose", item, index2);
|
|
263
|
+
const chooseItem = (item, index) => {
|
|
264
|
+
emit("choose", item, index);
|
|
145
265
|
};
|
|
266
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
146
267
|
return {
|
|
147
268
|
classes,
|
|
148
269
|
showPopup,
|
|
@@ -154,11 +275,12 @@ const _sfc_main = create({
|
|
|
154
275
|
getReference,
|
|
155
276
|
reference,
|
|
156
277
|
getStyle,
|
|
157
|
-
getArrowStyle
|
|
278
|
+
getArrowStyle,
|
|
279
|
+
refRandomId
|
|
158
280
|
};
|
|
159
281
|
}
|
|
160
282
|
});
|
|
161
|
-
const _hoisted_1 =
|
|
283
|
+
const _hoisted_1 = ["id"];
|
|
162
284
|
const _hoisted_2 = ["onClick"];
|
|
163
285
|
const _hoisted_3 = { class: "title-name" };
|
|
164
286
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -167,9 +289,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
167
289
|
onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.openPopover && _ctx.openPopover(...args), ["stop"])),
|
|
168
290
|
class: normalizeClass(_ctx.classes)
|
|
169
291
|
}, [
|
|
170
|
-
createElementVNode("div",
|
|
292
|
+
createElementVNode("div", {
|
|
293
|
+
ref: "reference",
|
|
294
|
+
id: "reference-" + _ctx.refRandomId
|
|
295
|
+
}, [
|
|
171
296
|
renderSlot(_ctx.$slots, "reference")
|
|
172
|
-
],
|
|
297
|
+
], 8, _hoisted_1),
|
|
173
298
|
_ctx.showPopup ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
174
299
|
createElementVNode("view", {
|
|
175
300
|
class: "more-background",
|
|
@@ -184,11 +309,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
184
309
|
style: normalizeStyle(_ctx.getArrowStyle)
|
|
185
310
|
}, null, 6),
|
|
186
311
|
renderSlot(_ctx.$slots, "content"),
|
|
187
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item,
|
|
312
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index) => {
|
|
188
313
|
return openBlock(), createElementBlock("view", {
|
|
189
|
-
key:
|
|
314
|
+
key: index,
|
|
190
315
|
class: normalizeClass({ "title-item": true, disabled: item.disabled }),
|
|
191
|
-
onClick: withModifiers(($event) => _ctx.chooseItem(item,
|
|
316
|
+
onClick: withModifiers(($event) => _ctx.chooseItem(item, index), ["stop"])
|
|
192
317
|
}, [
|
|
193
318
|
item.icon ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
|
|
194
319
|
createVNode(_component_nut_icon, {
|
|
@@ -203,5 +328,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
203
328
|
], 64)) : createCommentVNode("", true)
|
|
204
329
|
], 2);
|
|
205
330
|
}
|
|
206
|
-
var
|
|
207
|
-
export {
|
|
331
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
332
|
+
export { index_taro as default };
|
|
@@ -18,33 +18,17 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
22
|
-
* (c)
|
|
21
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
22
|
+
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { reactive, computed, onMounted, onBeforeUnmount, onBeforeMount, onActivated, onDeactivated, watch, toRefs, resolveComponent, openBlock,
|
|
25
|
+
import { reactive, computed, onMounted, onBeforeUnmount, onBeforeMount, onActivated, onDeactivated, watch, toRefs, resolveComponent, openBlock, createElementBlock, createBlock, normalizeClass, normalizeStyle, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, renderSlot, vShow } from "vue";
|
|
26
|
+
import { u as useLockScroll } from "./use-lock-scroll.js";
|
|
26
27
|
import overlay, { overlayProps } from "./OverLay.js";
|
|
27
28
|
import _sfc_main$1 from "./Icon.js";
|
|
28
29
|
import { c as createComponent } from "./component.js";
|
|
29
30
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
31
|
import "./pxCheck.js";
|
|
31
|
-
let count = 0;
|
|
32
|
-
const CLSNAME = "nut-overflow-hidden";
|
|
33
|
-
const useLockScroll = (isLock) => {
|
|
34
|
-
const lock = () => {
|
|
35
|
-
if (isLock()) {
|
|
36
|
-
!count && document.body.classList.add(CLSNAME);
|
|
37
|
-
count++;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const unlock = () => {
|
|
41
|
-
if (isLock() && count) {
|
|
42
|
-
count--;
|
|
43
|
-
!count && document.body.classList.remove(CLSNAME);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
return [lock, unlock];
|
|
47
|
-
};
|
|
48
32
|
const { componentName, create } = createComponent("popup");
|
|
49
33
|
let _zIndex = 2e3;
|
|
50
34
|
const popupProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
@@ -87,13 +71,10 @@ const popupProps = __spreadProps(__spreadValues({}, overlayProps), {
|
|
|
87
71
|
round: {
|
|
88
72
|
type: Boolean,
|
|
89
73
|
default: false
|
|
90
|
-
},
|
|
91
|
-
isWrapTeleport: {
|
|
92
|
-
type: Boolean,
|
|
93
|
-
default: true
|
|
94
74
|
}
|
|
95
75
|
});
|
|
96
76
|
const _sfc_main = create({
|
|
77
|
+
children: [overlay],
|
|
97
78
|
components: {
|
|
98
79
|
[overlay.name]: overlay,
|
|
99
80
|
[_sfc_main$1.name]: _sfc_main$1
|
|
@@ -218,14 +199,10 @@ const _sfc_main = create({
|
|
|
218
199
|
});
|
|
219
200
|
}
|
|
220
201
|
});
|
|
221
|
-
const _hoisted_1 = { key: 1 };
|
|
222
202
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
223
203
|
const _component_nut_overlay = resolveComponent("nut-overlay");
|
|
224
204
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
225
|
-
return
|
|
226
|
-
key: 0,
|
|
227
|
-
to: _ctx.teleport
|
|
228
|
-
}, [
|
|
205
|
+
return openBlock(), createElementBlock("view", null, [
|
|
229
206
|
_ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
|
|
230
207
|
key: 0,
|
|
231
208
|
visible: _ctx.visible,
|
|
@@ -265,47 +242,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
265
242
|
]),
|
|
266
243
|
_: 3
|
|
267
244
|
}, 8, ["name", "onAfterEnter", "onAfterLeave"])
|
|
268
|
-
]
|
|
269
|
-
_ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
|
|
270
|
-
key: 0,
|
|
271
|
-
visible: _ctx.visible,
|
|
272
|
-
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
273
|
-
class: normalizeClass(_ctx.overlayClass),
|
|
274
|
-
style: normalizeStyle(_ctx.overlayStyle),
|
|
275
|
-
"z-index": _ctx.zIndex,
|
|
276
|
-
"lock-scroll": _ctx.lockScroll,
|
|
277
|
-
duration: _ctx.duration,
|
|
278
|
-
onClick: _ctx.onClickOverlay
|
|
279
|
-
}, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : createCommentVNode("", true),
|
|
280
|
-
createVNode(Transition, {
|
|
281
|
-
name: _ctx.transitionName,
|
|
282
|
-
onAfterEnter: _ctx.onOpened,
|
|
283
|
-
onAfterLeave: _ctx.onClosed
|
|
284
|
-
}, {
|
|
285
|
-
default: withCtx(() => [
|
|
286
|
-
withDirectives(createElementVNode("view", {
|
|
287
|
-
class: normalizeClass(_ctx.classes),
|
|
288
|
-
style: normalizeStyle(_ctx.popStyle),
|
|
289
|
-
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
290
|
-
}, [
|
|
291
|
-
_ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
|
|
292
|
-
_ctx.closed ? (openBlock(), createElementBlock("view", {
|
|
293
|
-
key: 1,
|
|
294
|
-
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
|
|
295
|
-
class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
|
|
296
|
-
}, [
|
|
297
|
-
createVNode(_component_nut_icon, {
|
|
298
|
-
name: _ctx.closeIcon,
|
|
299
|
-
size: "12px"
|
|
300
|
-
}, null, 8, ["name"])
|
|
301
|
-
], 2)) : createCommentVNode("", true)
|
|
302
|
-
], 6), [
|
|
303
|
-
[vShow, _ctx.visible]
|
|
304
|
-
])
|
|
305
|
-
]),
|
|
306
|
-
_: 3
|
|
307
|
-
}, 8, ["name", "onAfterEnter", "onAfterLeave"])
|
|
308
|
-
]));
|
|
245
|
+
]);
|
|
309
246
|
}
|
|
310
247
|
var Popup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
311
248
|
export { Popup as default, popupProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
|
|
@@ -44,8 +44,17 @@ const _sfc_main = create({
|
|
|
44
44
|
[componentName]: true
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
|
+
const replaceSpecialChar = (url) => {
|
|
48
|
+
url = url.replace(/"/g, '"');
|
|
49
|
+
url = url.replace(/&/g, "&");
|
|
50
|
+
url = url.replace(/</g, "<");
|
|
51
|
+
url = url.replace(/>/g, ">");
|
|
52
|
+
url = url.replace(/ /g, " ");
|
|
53
|
+
url = url.replace(/¥/g, "\uFFE5");
|
|
54
|
+
return url;
|
|
55
|
+
};
|
|
47
56
|
const showSymbol = computed(() => {
|
|
48
|
-
const symbol = props.needSymbol ? props.symbol : "";
|
|
57
|
+
const symbol = props.needSymbol ? replaceSpecialChar(props.symbol) : "";
|
|
49
58
|
return symbol;
|
|
50
59
|
});
|
|
51
60
|
const checkPoint = (price) => {
|
|
@@ -86,7 +95,8 @@ const _sfc_main = create({
|
|
|
86
95
|
showSymbol,
|
|
87
96
|
checkPoint,
|
|
88
97
|
formatThousands,
|
|
89
|
-
formatDecimal
|
|
98
|
+
formatDecimal,
|
|
99
|
+
replaceSpecialChar
|
|
90
100
|
};
|
|
91
101
|
}
|
|
92
102
|
});
|
|
@@ -99,6 +109,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
99
109
|
_ctx.needSymbol && _ctx.position == "before" ? (openBlock(), createElementBlock("view", {
|
|
100
110
|
key: 0,
|
|
101
111
|
class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
|
|
112
|
+
decode: "true",
|
|
102
113
|
innerHTML: _ctx.showSymbol
|
|
103
114
|
}, null, 10, _hoisted_1)) : createCommentVNode("", true),
|
|
104
115
|
createElementVNode("view", {
|
|
@@ -114,9 +125,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
114
125
|
_ctx.needSymbol && _ctx.position == "after" ? (openBlock(), createElementBlock("view", {
|
|
115
126
|
key: 2,
|
|
116
127
|
class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
|
|
128
|
+
decode: "true",
|
|
117
129
|
innerHTML: _ctx.showSymbol
|
|
118
130
|
}, null, 10, _hoisted_2)) : createCommentVNode("", true)
|
|
119
131
|
], 2);
|
|
120
132
|
}
|
|
121
|
-
var
|
|
122
|
-
export {
|
|
133
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
134
|
+
export { index_taro as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
3
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, computed,
|
|
6
|
+
import { ref, computed, onMounted, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, createCommentVNode, createBlock } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
8
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
10
|
const { create } = createComponent("progress");
|
|
10
11
|
const _sfc_main = create({
|
|
@@ -20,7 +21,7 @@ const _sfc_main = create({
|
|
|
20
21
|
},
|
|
21
22
|
status: {
|
|
22
23
|
type: String,
|
|
23
|
-
default: ""
|
|
24
|
+
default: "text"
|
|
24
25
|
},
|
|
25
26
|
strokeWidth: {
|
|
26
27
|
type: [Number, String],
|
|
@@ -42,6 +43,10 @@ const _sfc_main = create({
|
|
|
42
43
|
tyep: String,
|
|
43
44
|
default: ""
|
|
44
45
|
},
|
|
46
|
+
textBackground: {
|
|
47
|
+
tyep: String,
|
|
48
|
+
default: ""
|
|
49
|
+
},
|
|
45
50
|
iconName: {
|
|
46
51
|
type: String,
|
|
47
52
|
default: "checked"
|
|
@@ -59,7 +64,8 @@ const _sfc_main = create({
|
|
|
59
64
|
const height = ref(props.strokeWidth + "px");
|
|
60
65
|
const progressOuter = ref();
|
|
61
66
|
const insideText = ref();
|
|
62
|
-
const
|
|
67
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
68
|
+
const randRef = ref(refRandomId);
|
|
63
69
|
const bgStyle = computed(() => {
|
|
64
70
|
return {
|
|
65
71
|
width: props.percentage + "%",
|
|
@@ -71,22 +77,9 @@ const _sfc_main = create({
|
|
|
71
77
|
color: props.textColor || ""
|
|
72
78
|
};
|
|
73
79
|
});
|
|
74
|
-
const slideLeft = (values) => {
|
|
75
|
-
if (props.textInside) {
|
|
76
|
-
let offsetWidth = progressOuter.value.offsetWidth;
|
|
77
|
-
let percentageWidth = progressOuter.value.offsetWidth * Number(values) * 0.01;
|
|
78
|
-
let insideTextWidth = insideText.value.offsetWidth;
|
|
79
|
-
left.value = percentageWidth - 5 + "px";
|
|
80
|
-
if (offsetWidth == percentageWidth) {
|
|
81
|
-
left.value = percentageWidth - insideTextWidth + "px";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
watch(() => props.percentage, (values) => {
|
|
86
|
-
slideLeft(values);
|
|
87
|
-
});
|
|
88
80
|
onMounted(() => {
|
|
89
|
-
|
|
81
|
+
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
82
|
+
});
|
|
90
83
|
});
|
|
91
84
|
return {
|
|
92
85
|
height,
|
|
@@ -94,16 +87,19 @@ const _sfc_main = create({
|
|
|
94
87
|
textStyle,
|
|
95
88
|
progressOuter,
|
|
96
89
|
insideText,
|
|
97
|
-
|
|
90
|
+
randRef
|
|
98
91
|
};
|
|
99
92
|
}
|
|
100
93
|
});
|
|
101
94
|
const _hoisted_1 = { class: "nut-progress" };
|
|
95
|
+
const _hoisted_2 = ["id"];
|
|
96
|
+
const _hoisted_3 = ["id"];
|
|
102
97
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
103
98
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
104
99
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
105
100
|
createElementVNode("div", {
|
|
106
101
|
class: normalizeClass(["nut-progress-outer", [_ctx.showText && !_ctx.textInside ? "nut-progress-outer-part" : "", _ctx.size ? "nut-progress-" + _ctx.size : ""]]),
|
|
102
|
+
id: "nut-progress-outer-taro-" + _ctx.randRef,
|
|
107
103
|
ref: "progressOuter",
|
|
108
104
|
style: normalizeStyle({ height: _ctx.height })
|
|
109
105
|
}, [
|
|
@@ -115,20 +111,26 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
115
111
|
key: 0,
|
|
116
112
|
class: "nut-progress-text nut-progress-insidetext",
|
|
117
113
|
ref: "insideText",
|
|
118
|
-
|
|
114
|
+
id: "nut-progress-insidetext-taro-" + _ctx.randRef,
|
|
115
|
+
style: normalizeStyle({
|
|
116
|
+
lineHeight: _ctx.height,
|
|
117
|
+
left: `${_ctx.percentage}%`,
|
|
118
|
+
transform: `translate(-${+_ctx.percentage}%,-50%)`,
|
|
119
|
+
background: _ctx.textBackground || _ctx.strokeColor
|
|
120
|
+
})
|
|
119
121
|
}, [
|
|
120
122
|
createElementVNode("span", {
|
|
121
123
|
style: normalizeStyle(_ctx.textStyle)
|
|
122
124
|
}, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)
|
|
123
|
-
],
|
|
125
|
+
], 12, _hoisted_3)) : createCommentVNode("", true)
|
|
124
126
|
], 6)
|
|
125
|
-
],
|
|
127
|
+
], 14, _hoisted_2),
|
|
126
128
|
_ctx.showText && !_ctx.textInside ? (openBlock(), createElementBlock("div", {
|
|
127
129
|
key: 0,
|
|
128
130
|
class: "nut-progress-text",
|
|
129
131
|
style: normalizeStyle({ lineHeight: _ctx.height })
|
|
130
132
|
}, [
|
|
131
|
-
_ctx.status == "
|
|
133
|
+
_ctx.status == "text" || _ctx.status == "active" ? (openBlock(), createElementBlock("span", {
|
|
132
134
|
key: 0,
|
|
133
135
|
style: normalizeStyle(_ctx.textStyle)
|
|
134
136
|
}, toDisplayString(_ctx.percentage) + toDisplayString(_ctx.isShowPercentage ? "%" : ""), 5)) : _ctx.status == "icon" ? (openBlock(), createBlock(_component_nut_icon, {
|
|
@@ -140,5 +142,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
140
142
|
], 4)) : createCommentVNode("", true)
|
|
141
143
|
]);
|
|
142
144
|
}
|
|
143
|
-
var
|
|
144
|
-
export {
|
|
145
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
146
|
+
export { index_taro as default };
|