@nutui/nutui 3.1.10 → 3.1.12-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 +17 -0
- package/dist/nutui.d.ts +5 -1
- package/dist/nutui.es.js +4041 -3518
- package/dist/nutui.umd.js +4084 -3627
- package/dist/packages/_es/ActionSheet.js +13 -12
- package/dist/packages/_es/Address.js +63 -49
- package/dist/packages/_es/Avatar.js +4 -5
- package/dist/packages/_es/BackTop.js +72 -109
- package/dist/packages/_es/Badge.js +4 -5
- package/dist/packages/_es/Barrage.js +63 -57
- package/dist/packages/_es/Button.js +5 -6
- package/dist/packages/_es/Calendar.js +27 -18
- package/dist/packages/_es/Card.js +104 -0
- package/dist/packages/_es/Cell.js +5 -13
- package/dist/packages/_es/CellGroup.js +4 -5
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +9 -4
- package/dist/packages/_es/CircleProgress.js +142 -46
- package/dist/packages/_es/Col.js +4 -5
- package/dist/packages/_es/Collapse.js +35 -10
- package/dist/packages/_es/CollapseItem.js +80 -35
- package/dist/packages/_es/CountDown.js +7 -5
- package/dist/packages/_es/CountUp.js +34 -31
- package/dist/packages/_es/DatePicker.js +451 -219
- package/dist/packages/_es/Dialog.js +13 -87
- package/dist/packages/_es/Divider.js +5 -6
- package/dist/packages/_es/Drag.js +76 -50
- package/dist/packages/_es/Elevator.js +81 -52
- package/dist/packages/_es/FixedNav.js +8 -9
- package/dist/packages/_es/Form.js +137 -0
- package/dist/packages/_es/FormItem.js +109 -0
- package/dist/packages/_es/Icon.js +6 -40
- package/dist/packages/_es/ImagePreview.js +23 -21
- package/dist/packages/_es/InfiniteLoading.js +95 -109
- package/dist/packages/_es/Input.js +22 -21
- package/dist/packages/_es/InputNumber.js +24 -18
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +89 -171
- package/dist/packages/_es/MenuItem.js +155 -18
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +39 -26
- package/dist/packages/_es/Notify.js +30 -166
- package/dist/packages/_es/NumberKeyboard.js +10 -6
- package/dist/packages/_es/OverLay.js +22 -29
- package/dist/packages/_es/Pagination.js +8 -9
- package/dist/packages/_es/Picker.js +61 -447
- package/dist/packages/_es/Popover.js +146 -25
- package/dist/packages/_es/Popup.js +18 -39
- package/dist/packages/_es/Price.js +18 -7
- package/dist/packages/_es/Progress.js +23 -12
- package/dist/packages/_es/Radio.js +20 -7
- package/dist/packages/_es/RadioGroup.js +7 -3
- package/dist/packages/_es/Range.js +38 -59
- package/dist/packages/_es/Rate.js +16 -20
- package/dist/packages/_es/Row.js +4 -5
- package/dist/packages/_es/SearchBar.js +7 -5
- package/dist/packages/_es/ShortPassword.js +89 -59
- package/dist/packages/_es/Signature.js +70 -71
- package/dist/packages/_es/Sku.js +508 -0
- package/dist/packages/_es/Step.js +10 -8
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +42 -27
- package/dist/packages/_es/Swiper.js +17 -418
- package/dist/packages/_es/SwiperItem.js +14 -39
- package/dist/packages/_es/Switch.js +4 -5
- package/dist/packages/_es/TabPane.js +4 -5
- package/dist/packages/_es/Tabbar.js +4 -5
- package/dist/packages/_es/TabbarItem.js +8 -9
- package/dist/packages/_es/Tabs.js +23 -17
- package/dist/packages/_es/Tag.js +5 -6
- package/dist/packages/_es/TextArea.js +16 -12
- package/dist/packages/_es/TimeDetail.js +7 -5
- package/dist/packages/_es/TimePannel.js +7 -5
- package/dist/packages/_es/TimeSelect.js +12 -7
- package/dist/packages/_es/Toast.js +41 -163
- package/dist/packages/_es/Uploader.js +210 -164
- package/dist/packages/_es/commonProps.js +30 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +44 -0
- package/dist/packages/_es/index2.js +44 -8
- package/dist/packages/_es/index3.js +419 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/_es/util.js +47 -0
- package/dist/packages/button/index.scss +9 -0
- package/dist/packages/card/index.scss +97 -0
- package/dist/packages/checkbox/index.scss +1 -1
- package/dist/packages/form/index.scss +2 -0
- package/dist/packages/formitem/index.scss +60 -0
- package/dist/packages/menu/index.scss +32 -60
- package/dist/packages/menuitem/index.scss +36 -99
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/progress/index.scss +2 -0
- package/dist/packages/radio/index.scss +32 -4
- package/dist/packages/radiogroup/index.scss +20 -0
- package/dist/packages/sku/index.scss +147 -0
- package/dist/packages/switch/index.scss +1 -1
- package/dist/packages/uploader/index.scss +95 -8
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -2
- package/dist/styles/mixins/index.scss +0 -4
- package/dist/styles/themes/default.scss +34 -30
- package/dist/styles/variables.scss +45 -3
- package/package.json +3 -2
- package/dist/packages/_es/Video.js +0 -405
- package/dist/packages/_es/plugin-vue_export-helper.js +0 -12
- package/dist/packages/_es/style.css +0 -160
|
@@ -17,46 +17,21 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
+
};
|
|
20
23
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
24
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
22
25
|
* (c) 2021 @jdf2e.
|
|
23
26
|
* Released under the MIT License.
|
|
24
27
|
*/
|
|
25
|
-
import
|
|
28
|
+
import Taro from "@tarojs/taro";
|
|
29
|
+
import { ref, computed, toRefs, openBlock, createElementBlock, toDisplayString, createCommentVNode, createElementVNode, normalizeStyle, normalizeClass, withModifiers, Fragment, renderList, renderSlot } from "vue";
|
|
26
30
|
import { c as createComponent } from "./component.js";
|
|
27
31
|
import { u as useTouch } from "./index.js";
|
|
28
|
-
import {
|
|
29
|
-
function isWindow(val) {
|
|
30
|
-
return val === window;
|
|
31
|
-
}
|
|
32
|
-
const useRect = (elementRef) => {
|
|
33
|
-
const element = unref(elementRef);
|
|
34
|
-
if (isWindow(element)) {
|
|
35
|
-
const width = element.innerWidth;
|
|
36
|
-
const height = element.innerHeight;
|
|
37
|
-
return {
|
|
38
|
-
top: 0,
|
|
39
|
-
left: 0,
|
|
40
|
-
right: width,
|
|
41
|
-
bottom: height,
|
|
42
|
-
width,
|
|
43
|
-
height
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
if (element && element.getBoundingClientRect) {
|
|
47
|
-
return element.getBoundingClientRect();
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
top: 0,
|
|
51
|
-
left: 0,
|
|
52
|
-
right: 0,
|
|
53
|
-
bottom: 0,
|
|
54
|
-
width: 0,
|
|
55
|
-
height: 0
|
|
56
|
-
};
|
|
57
|
-
};
|
|
32
|
+
import { u as useTaroRect } from "./index2.js";
|
|
58
33
|
const { componentName, create } = createComponent("range");
|
|
59
|
-
|
|
34
|
+
var _sfc_main = create({
|
|
60
35
|
props: {
|
|
61
36
|
range: {
|
|
62
37
|
type: Boolean,
|
|
@@ -166,13 +141,13 @@ const _sfc_main = create({
|
|
|
166
141
|
emit("change", value);
|
|
167
142
|
}
|
|
168
143
|
};
|
|
169
|
-
const onClick = (event) => {
|
|
144
|
+
const onClick = async (event) => {
|
|
170
145
|
if (props.disabled) {
|
|
171
146
|
return;
|
|
172
147
|
}
|
|
173
148
|
const { min, modelValue } = props;
|
|
174
|
-
const rect =
|
|
175
|
-
const delta = event.clientX - rect.left;
|
|
149
|
+
const rect = await useTaroRect(root, Taro);
|
|
150
|
+
const delta = event.touches[0].clientX - rect.left;
|
|
176
151
|
const total = rect.width;
|
|
177
152
|
const value = Number(min) + delta / total * scope.value;
|
|
178
153
|
if (isRange(modelValue)) {
|
|
@@ -200,7 +175,7 @@ const _sfc_main = create({
|
|
|
200
175
|
}
|
|
201
176
|
dragStatus.value = "start";
|
|
202
177
|
};
|
|
203
|
-
const onTouchMove = (event) => {
|
|
178
|
+
const onTouchMove = async (event) => {
|
|
204
179
|
if (props.disabled) {
|
|
205
180
|
return;
|
|
206
181
|
}
|
|
@@ -209,7 +184,7 @@ const _sfc_main = create({
|
|
|
209
184
|
}
|
|
210
185
|
touch.move(event);
|
|
211
186
|
dragStatus.value = "draging";
|
|
212
|
-
const rect =
|
|
187
|
+
const rect = await useTaroRect(root, Taro);
|
|
213
188
|
const delta = touch.deltaX.value;
|
|
214
189
|
const total = rect.width;
|
|
215
190
|
const diff = delta / total * scope.value;
|
|
@@ -236,6 +211,7 @@ const _sfc_main = create({
|
|
|
236
211
|
const value = typeof idx === "number" ? props.modelValue[idx] : props.modelValue;
|
|
237
212
|
return value;
|
|
238
213
|
};
|
|
214
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
239
215
|
return __spreadProps(__spreadValues({
|
|
240
216
|
root,
|
|
241
217
|
classes,
|
|
@@ -248,7 +224,8 @@ const _sfc_main = create({
|
|
|
248
224
|
}, toRefs(props)), {
|
|
249
225
|
barStyle,
|
|
250
226
|
curValue,
|
|
251
|
-
buttonIndex
|
|
227
|
+
buttonIndex,
|
|
228
|
+
refRandomId
|
|
252
229
|
});
|
|
253
230
|
}
|
|
254
231
|
});
|
|
@@ -257,17 +234,18 @@ const _hoisted_2 = {
|
|
|
257
234
|
key: 0,
|
|
258
235
|
class: "min"
|
|
259
236
|
};
|
|
260
|
-
const _hoisted_3 = ["
|
|
261
|
-
const _hoisted_4 =
|
|
237
|
+
const _hoisted_3 = ["id"];
|
|
238
|
+
const _hoisted_4 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "onTouchstart"];
|
|
239
|
+
const _hoisted_5 = {
|
|
262
240
|
key: 0,
|
|
263
241
|
class: "number"
|
|
264
242
|
};
|
|
265
|
-
const
|
|
266
|
-
const
|
|
243
|
+
const _hoisted_6 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax"];
|
|
244
|
+
const _hoisted_7 = {
|
|
267
245
|
key: 0,
|
|
268
246
|
class: "number"
|
|
269
247
|
};
|
|
270
|
-
const
|
|
248
|
+
const _hoisted_8 = {
|
|
271
249
|
key: 1,
|
|
272
250
|
class: "max"
|
|
273
251
|
};
|
|
@@ -276,6 +254,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
276
254
|
!_ctx.hiddenRange ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(+_ctx.min), 1)) : createCommentVNode("", true),
|
|
277
255
|
createElementVNode("view", {
|
|
278
256
|
ref: "root",
|
|
257
|
+
id: "root-" + _ctx.refRandomId,
|
|
279
258
|
style: normalizeStyle(_ctx.wrapperStyle),
|
|
280
259
|
class: normalizeClass(_ctx.classes),
|
|
281
260
|
onClick: _cache[9] || (_cache[9] = withModifiers((...args) => _ctx.onClick && _ctx.onClick(...args), ["stop"]))
|
|
@@ -284,22 +263,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
284
263
|
class: "nut-range-bar",
|
|
285
264
|
style: normalizeStyle(_ctx.barStyle)
|
|
286
265
|
}, [
|
|
287
|
-
_ctx.range ? (openBlock(), createElementBlock(Fragment, { key: 0 }, renderList([0, 1], (
|
|
266
|
+
_ctx.range ? (openBlock(), createElementBlock(Fragment, { key: 0 }, renderList([0, 1], (index) => {
|
|
288
267
|
return createElementVNode("view", {
|
|
289
|
-
key:
|
|
268
|
+
key: index,
|
|
290
269
|
role: "slider",
|
|
291
270
|
class: normalizeClass({
|
|
292
|
-
"nut-range-button-wrapper-left":
|
|
293
|
-
"nut-range-button-wrapper-right":
|
|
271
|
+
"nut-range-button-wrapper-left": index == 0,
|
|
272
|
+
"nut-range-button-wrapper-right": index == 1
|
|
294
273
|
}),
|
|
295
274
|
tabindex: _ctx.disabled ? -1 : 0,
|
|
296
275
|
"aria-valuemin": +_ctx.min,
|
|
297
|
-
"aria-valuenow": _ctx.curValue(
|
|
276
|
+
"aria-valuenow": _ctx.curValue(index),
|
|
298
277
|
"aria-valuemax": +_ctx.max,
|
|
299
278
|
"aria-orientation": "horizontal",
|
|
300
279
|
onTouchstart: withModifiers((e) => {
|
|
301
|
-
if (typeof
|
|
302
|
-
_ctx.buttonIndex =
|
|
280
|
+
if (typeof index === "number") {
|
|
281
|
+
_ctx.buttonIndex = index;
|
|
303
282
|
}
|
|
304
283
|
_ctx.onTouchStart(e);
|
|
305
284
|
}, ["stop", "prevent"]),
|
|
@@ -313,9 +292,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
313
292
|
class: "nut-range-button",
|
|
314
293
|
style: normalizeStyle(_ctx.buttonStyle)
|
|
315
294
|
}, [
|
|
316
|
-
!_ctx.hiddenTag ? (openBlock(), createElementBlock("view",
|
|
295
|
+
!_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_5, toDisplayString(_ctx.curValue(index)), 1)) : createCommentVNode("", true)
|
|
317
296
|
], 4))
|
|
318
|
-
], 42,
|
|
297
|
+
], 42, _hoisted_4);
|
|
319
298
|
}), 64)) : (openBlock(), createElementBlock("view", {
|
|
320
299
|
key: 1,
|
|
321
300
|
role: "slider",
|
|
@@ -338,13 +317,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
338
317
|
class: "nut-range-button",
|
|
339
318
|
style: normalizeStyle(_ctx.buttonStyle)
|
|
340
319
|
}, [
|
|
341
|
-
!_ctx.hiddenTag ? (openBlock(), createElementBlock("view",
|
|
320
|
+
!_ctx.hiddenTag ? (openBlock(), createElementBlock("view", _hoisted_7, toDisplayString(_ctx.curValue(_ctx.index)), 1)) : createCommentVNode("", true)
|
|
342
321
|
], 4))
|
|
343
|
-
], 40,
|
|
322
|
+
], 40, _hoisted_6))
|
|
344
323
|
], 4)
|
|
345
|
-
],
|
|
346
|
-
!_ctx.hiddenRange ? (openBlock(), createElementBlock("view",
|
|
324
|
+
], 14, _hoisted_3),
|
|
325
|
+
!_ctx.hiddenRange ? (openBlock(), createElementBlock("view", _hoisted_8, toDisplayString(+_ctx.max), 1)) : createCommentVNode("", true)
|
|
347
326
|
]);
|
|
348
327
|
}
|
|
349
|
-
|
|
350
|
-
export {
|
|
328
|
+
_sfc_main.render = _sfc_render;
|
|
329
|
+
export { _sfc_main as default };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, normalizeStyle, createVNode, createBlock, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { p as pxCheck } from "./pxCheck.js";
|
|
9
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
9
|
const { componentName, create } = createComponent("rate");
|
|
11
|
-
|
|
10
|
+
var _sfc_main = create({
|
|
12
11
|
props: {
|
|
13
12
|
count: {
|
|
14
13
|
type: [String, Number],
|
|
@@ -63,20 +62,16 @@ const _sfc_main = create({
|
|
|
63
62
|
[prefixCls]: true
|
|
64
63
|
};
|
|
65
64
|
});
|
|
66
|
-
const onClick = (e,
|
|
67
|
-
e.preventDefault();
|
|
68
|
-
e.stopPropagation();
|
|
65
|
+
const onClick = (e, index) => {
|
|
69
66
|
if (props.disabled || props.readonly)
|
|
70
67
|
return;
|
|
71
68
|
let value = 0;
|
|
72
|
-
if (
|
|
69
|
+
if (index === 1 && props.modelValue === index)
|
|
73
70
|
;
|
|
74
71
|
else {
|
|
75
|
-
value =
|
|
76
|
-
if (props.allowHalf) {
|
|
77
|
-
|
|
78
|
-
value -= 0.5;
|
|
79
|
-
}
|
|
72
|
+
value = index;
|
|
73
|
+
if (props.allowHalf && e == 2) {
|
|
74
|
+
value -= 0.5;
|
|
80
75
|
}
|
|
81
76
|
}
|
|
82
77
|
emit("update:modelValue", value);
|
|
@@ -89,7 +84,6 @@ const _sfc_main = create({
|
|
|
89
84
|
};
|
|
90
85
|
}
|
|
91
86
|
});
|
|
92
|
-
const _hoisted_1 = ["onClick"];
|
|
93
87
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
94
88
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
95
89
|
return openBlock(), createElementBlock("view", {
|
|
@@ -99,31 +93,33 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
99
93
|
return openBlock(), createElementBlock("view", {
|
|
100
94
|
class: "nut-rate-item",
|
|
101
95
|
key: n,
|
|
102
|
-
onClick: ($event) => _ctx.onClick($event, n),
|
|
103
96
|
style: normalizeStyle({ marginRight: _ctx.pxCheck(_ctx.spacing) })
|
|
104
97
|
}, [
|
|
105
98
|
createVNode(_component_nut_icon, {
|
|
106
99
|
size: _ctx.iconSize,
|
|
107
100
|
class: normalizeClass(["nut-rate-item__icon", { "nut-rate-item__icon--disabled": _ctx.disabled || n > _ctx.modelValue }]),
|
|
101
|
+
onClick: ($event) => _ctx.onClick(1, n),
|
|
108
102
|
color: n <= _ctx.modelValue ? _ctx.activeColor : _ctx.voidColor,
|
|
109
103
|
name: n <= _ctx.modelValue ? _ctx.checkedIcon : _ctx.uncheckedIcon
|
|
110
|
-
}, null, 8, ["size", "class", "color", "name"]),
|
|
104
|
+
}, null, 8, ["size", "onClick", "class", "color", "name"]),
|
|
111
105
|
_ctx.allowHalf && _ctx.modelValue + 1 > n ? (openBlock(), createBlock(_component_nut_icon, {
|
|
112
106
|
key: 0,
|
|
113
107
|
class: "nut-rate-item__icon nut-rate-item__icon--half",
|
|
108
|
+
onClick: ($event) => _ctx.onClick(2, n),
|
|
114
109
|
color: n <= _ctx.modelValue ? _ctx.activeColor : _ctx.voidColor,
|
|
115
110
|
size: _ctx.iconSize,
|
|
116
111
|
name: _ctx.checkedIcon
|
|
117
|
-
}, null, 8, ["color", "size", "name"])) : _ctx.allowHalf && _ctx.modelValue + 1 < n ? (openBlock(), createBlock(_component_nut_icon, {
|
|
112
|
+
}, null, 8, ["onClick", "color", "size", "name"])) : _ctx.allowHalf && _ctx.modelValue + 1 < n ? (openBlock(), createBlock(_component_nut_icon, {
|
|
118
113
|
key: 1,
|
|
119
114
|
class: "nut-rate-item__icon nut-rate-item__icon--disabled nut-rate-item__icon--half",
|
|
115
|
+
onClick: ($event) => _ctx.onClick(2, n),
|
|
120
116
|
color: _ctx.voidColor,
|
|
121
117
|
size: _ctx.iconSize,
|
|
122
118
|
name: _ctx.uncheckedIcon
|
|
123
|
-
}, null, 8, ["color", "size", "name"])) : createCommentVNode("", true)
|
|
124
|
-
],
|
|
119
|
+
}, null, 8, ["onClick", "color", "size", "name"])) : createCommentVNode("", true)
|
|
120
|
+
], 4);
|
|
125
121
|
}), 128))
|
|
126
122
|
], 2);
|
|
127
123
|
}
|
|
128
|
-
|
|
129
|
-
export {
|
|
124
|
+
_sfc_main.render = _sfc_render;
|
|
125
|
+
export { _sfc_main as default };
|
package/dist/packages/_es/Row.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { provide, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
8
|
const { componentName, create } = createComponent("row");
|
|
10
|
-
|
|
9
|
+
var _sfc_main = create({
|
|
11
10
|
props: {
|
|
12
11
|
type: {
|
|
13
12
|
type: String,
|
|
@@ -57,5 +56,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
57
56
|
renderSlot(_ctx.$slots, "default")
|
|
58
57
|
], 2);
|
|
59
58
|
}
|
|
60
|
-
|
|
61
|
-
export {
|
|
59
|
+
_sfc_main.render = _sfc_render;
|
|
60
|
+
export { _sfc_main as default };
|
|
@@ -17,16 +17,18 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
+
};
|
|
20
23
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
24
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
22
25
|
* (c) 2021 @jdf2e.
|
|
23
26
|
* Released under the MIT License.
|
|
24
27
|
*/
|
|
25
28
|
import { reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, normalizeStyle, renderSlot, createCommentVNode, createElementVNode, withModifiers, withDirectives, createVNode, vShow } from "vue";
|
|
26
29
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
30
|
const { create } = createComponent("searchbar");
|
|
29
|
-
|
|
31
|
+
var _sfc_main = create({
|
|
30
32
|
props: {
|
|
31
33
|
modelValue: {
|
|
32
34
|
type: [String, Number],
|
|
@@ -190,5 +192,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
190
192
|
])) : createCommentVNode("", true)
|
|
191
193
|
], 4);
|
|
192
194
|
}
|
|
193
|
-
|
|
194
|
-
export {
|
|
195
|
+
_sfc_main.render = _sfc_render;
|
|
196
|
+
export { _sfc_main as default };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, computed, watch, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString, withDirectives,
|
|
6
|
+
import { ref, computed, watch, onMounted, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, createElementVNode, toDisplayString, withDirectives, vModelText, createCommentVNode, Fragment, renderList } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import {
|
|
8
|
+
import Taro, { eventCenter, getCurrentInstance } from "@tarojs/taro";
|
|
9
9
|
const { create } = createComponent("shortpassword");
|
|
10
|
-
|
|
10
|
+
var _sfc_main = create({
|
|
11
11
|
props: {
|
|
12
12
|
title: {
|
|
13
13
|
type: String,
|
|
@@ -52,18 +52,43 @@ const _sfc_main = create({
|
|
|
52
52
|
const realpwd = ref();
|
|
53
53
|
const comLen = computed(() => range(Number(props.length)));
|
|
54
54
|
const show = ref(props.visible);
|
|
55
|
+
const refRandomId = Math.random().toString(36).slice(-8);
|
|
56
|
+
const randRef = ref(refRandomId);
|
|
57
|
+
const isWx = ref(false);
|
|
55
58
|
function sureClick() {
|
|
56
59
|
emit("ok", realInput.value);
|
|
57
60
|
}
|
|
58
61
|
function focus() {
|
|
59
|
-
|
|
62
|
+
let dom = "";
|
|
63
|
+
console.log(123);
|
|
64
|
+
if (isWx.value) {
|
|
65
|
+
setTimeout(() => {
|
|
66
|
+
if (!document.getElementById("nut-input-real-taro-" + randRef.value))
|
|
67
|
+
return;
|
|
68
|
+
dom = document.getElementById("nut-input-real-taro-" + randRef.value);
|
|
69
|
+
if (!dom)
|
|
70
|
+
return;
|
|
71
|
+
dom.focus();
|
|
72
|
+
}, 150);
|
|
73
|
+
} else {
|
|
74
|
+
dom = document.getElementsByClassName("nut-input-real")[0];
|
|
75
|
+
let h = dom.children[0];
|
|
76
|
+
h.focus();
|
|
77
|
+
}
|
|
60
78
|
}
|
|
61
79
|
watch(() => props.visible, (value) => {
|
|
62
80
|
show.value = value;
|
|
81
|
+
if (value) {
|
|
82
|
+
randRef.value = Math.random().toString(36).slice(-8);
|
|
83
|
+
if (Taro.getEnv() === "WEB") {
|
|
84
|
+
isWx.value = false;
|
|
85
|
+
} else {
|
|
86
|
+
isWx.value = true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
63
89
|
});
|
|
64
90
|
watch(() => props.modelValue, (value) => {
|
|
65
91
|
realInput.value = value;
|
|
66
|
-
console.log("watch", value);
|
|
67
92
|
});
|
|
68
93
|
function changeValue(e) {
|
|
69
94
|
const input = e.target;
|
|
@@ -92,54 +117,46 @@ const _sfc_main = create({
|
|
|
92
117
|
function onTips() {
|
|
93
118
|
emit("tips");
|
|
94
119
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
if (isAndroid) {
|
|
105
|
-
return {
|
|
106
|
-
opacity: 0,
|
|
107
|
-
zindex: 10
|
|
108
|
-
};
|
|
120
|
+
onMounted(() => {
|
|
121
|
+
eventCenter.once(getCurrentInstance().router.onReady, () => {
|
|
122
|
+
});
|
|
123
|
+
if (Taro.getEnv() === "WEB") {
|
|
124
|
+
isWx.value = false;
|
|
125
|
+
} else {
|
|
126
|
+
isWx.value = true;
|
|
109
127
|
}
|
|
110
|
-
}
|
|
128
|
+
});
|
|
111
129
|
return {
|
|
112
130
|
comLen,
|
|
113
131
|
sureClick,
|
|
114
132
|
realInput,
|
|
115
133
|
realpwd,
|
|
116
|
-
focus,
|
|
117
134
|
range,
|
|
118
135
|
changeValue,
|
|
119
136
|
close,
|
|
120
137
|
onTips,
|
|
138
|
+
focus,
|
|
121
139
|
show,
|
|
122
|
-
|
|
123
|
-
|
|
140
|
+
closeIcon,
|
|
141
|
+
isWx,
|
|
142
|
+
refRandomId,
|
|
143
|
+
randRef
|
|
124
144
|
};
|
|
125
145
|
}
|
|
126
146
|
});
|
|
127
147
|
const _hoisted_1 = { class: "nut-shortpsd-title" };
|
|
128
|
-
const _hoisted_2 = { class: "nut-
|
|
129
|
-
const _hoisted_3 =
|
|
130
|
-
const _hoisted_4 =
|
|
131
|
-
const _hoisted_5 = {
|
|
148
|
+
const _hoisted_2 = { class: "nut-shortpsdWx-subtitle" };
|
|
149
|
+
const _hoisted_3 = ["id", "maxlength"];
|
|
150
|
+
const _hoisted_4 = { class: "nut-input-w" };
|
|
151
|
+
const _hoisted_5 = /* @__PURE__ */ createElementVNode("view", { class: "nut-input-site" }, null, -1);
|
|
152
|
+
const _hoisted_6 = {
|
|
132
153
|
key: 0,
|
|
133
154
|
class: "nut-shortpsd-icon"
|
|
134
155
|
};
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
const _hoisted_8 = {
|
|
138
|
-
key: 0,
|
|
139
|
-
class: "nut-shortpsd-forget"
|
|
140
|
-
};
|
|
156
|
+
const _hoisted_7 = { class: "nut-shortpsd-message" };
|
|
157
|
+
const _hoisted_8 = { class: "nut-shortpsd-error" };
|
|
141
158
|
const _hoisted_9 = {
|
|
142
|
-
key:
|
|
159
|
+
key: 1,
|
|
143
160
|
class: "nut-shortpsd-footer"
|
|
144
161
|
};
|
|
145
162
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -153,7 +170,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
153
170
|
textAlign: "center"
|
|
154
171
|
},
|
|
155
172
|
visible: _ctx.show,
|
|
156
|
-
"onUpdate:visible": _cache[
|
|
173
|
+
"onUpdate:visible": _cache[8] || (_cache[8] = ($event) => _ctx.show = $event),
|
|
157
174
|
closeable: true,
|
|
158
175
|
onClickCloseIcon: _ctx.closeIcon,
|
|
159
176
|
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
@@ -162,54 +179,67 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
162
179
|
default: withCtx(() => [
|
|
163
180
|
createElementVNode("view", _hoisted_1, toDisplayString(_ctx.title), 1),
|
|
164
181
|
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.desc), 1),
|
|
165
|
-
|
|
166
|
-
|
|
182
|
+
_ctx.isWx && _ctx.visible ? withDirectives((openBlock(), createElementBlock("input", {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: "nut-input-real-taro",
|
|
185
|
+
id: "nut-input-real-taro-" + _ctx.randRef,
|
|
186
|
+
type: "number",
|
|
187
|
+
maxlength: _ctx.length,
|
|
188
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.realInput = $event),
|
|
189
|
+
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.changeValue && _ctx.changeValue(...args))
|
|
190
|
+
}, null, 40, _hoisted_3)), [
|
|
191
|
+
[vModelText, _ctx.realInput]
|
|
192
|
+
]) : createCommentVNode("", true),
|
|
193
|
+
createElementVNode("view", _hoisted_4, [
|
|
194
|
+
!_ctx.isWx ? withDirectives((openBlock(), createElementBlock("input", {
|
|
195
|
+
key: 0,
|
|
167
196
|
ref: "realpwd",
|
|
168
197
|
class: "nut-input-real",
|
|
169
198
|
type: "number",
|
|
170
199
|
maxlength: "6",
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}, null, 36), [
|
|
200
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.realInput = $event),
|
|
201
|
+
onInput: _cache[3] || (_cache[3] = (...args) => _ctx.changeValue && _ctx.changeValue(...args))
|
|
202
|
+
}, null, 544)), [
|
|
175
203
|
[vModelText, _ctx.realInput]
|
|
176
|
-
]),
|
|
177
|
-
|
|
204
|
+
]) : createCommentVNode("", true),
|
|
205
|
+
_hoisted_5,
|
|
178
206
|
createElementVNode("view", {
|
|
179
|
-
class: "nut-shortpsd-fake",
|
|
180
|
-
onClick: _cache[
|
|
207
|
+
class: "nut-shortpsd-fake-taro",
|
|
208
|
+
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.focus && _ctx.focus(...args))
|
|
181
209
|
}, [
|
|
182
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(new Array(_ctx.comLen), (sublen,
|
|
210
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(new Array(_ctx.comLen), (sublen, index) => {
|
|
183
211
|
return openBlock(), createElementBlock("view", {
|
|
184
212
|
class: "nut-shortpsd-li",
|
|
185
|
-
key:
|
|
213
|
+
key: index
|
|
186
214
|
}, [
|
|
187
|
-
String(_ctx.realInput).length >
|
|
215
|
+
String(_ctx.realInput).length > index ? (openBlock(), createElementBlock("view", _hoisted_6)) : createCommentVNode("", true)
|
|
188
216
|
]);
|
|
189
217
|
}), 128))
|
|
190
218
|
])
|
|
191
219
|
]),
|
|
192
|
-
createElementVNode("view",
|
|
193
|
-
createElementVNode("view",
|
|
194
|
-
_ctx.tips ? (openBlock(), createElementBlock("view",
|
|
220
|
+
createElementVNode("view", _hoisted_7, [
|
|
221
|
+
createElementVNode("view", _hoisted_8, toDisplayString(_ctx.errorMsg), 1),
|
|
222
|
+
_ctx.tips ? (openBlock(), createElementBlock("view", {
|
|
223
|
+
key: 0,
|
|
224
|
+
class: "nut-shortpsd-forget",
|
|
225
|
+
onClick: _cache[5] || (_cache[5] = (...args) => _ctx.onTips && _ctx.onTips(...args))
|
|
226
|
+
}, [
|
|
195
227
|
createVNode(_component_nut_icon, {
|
|
196
228
|
class: "icon",
|
|
197
229
|
size: "11px",
|
|
198
230
|
name: "tips"
|
|
199
231
|
}),
|
|
200
|
-
createElementVNode("view",
|
|
201
|
-
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onTips && _ctx.onTips(...args))
|
|
202
|
-
}, toDisplayString(_ctx.tips), 1)
|
|
232
|
+
createElementVNode("view", null, toDisplayString(_ctx.tips), 1)
|
|
203
233
|
])) : createCommentVNode("", true)
|
|
204
234
|
]),
|
|
205
235
|
!_ctx.noButton ? (openBlock(), createElementBlock("view", _hoisted_9, [
|
|
206
236
|
createElementVNode("view", {
|
|
207
237
|
class: "nut-shortpsd-cancle",
|
|
208
|
-
onClick: _cache[
|
|
238
|
+
onClick: _cache[6] || (_cache[6] = (...args) => _ctx.close && _ctx.close(...args))
|
|
209
239
|
}, "\u53D6\u6D88"),
|
|
210
240
|
createElementVNode("view", {
|
|
211
241
|
class: "nut-shortpsd-sure",
|
|
212
|
-
onClick: _cache[
|
|
242
|
+
onClick: _cache[7] || (_cache[7] = (...args) => _ctx.sureClick && _ctx.sureClick(...args))
|
|
213
243
|
}, "\u786E\u8BA4")
|
|
214
244
|
])) : createCommentVNode("", true)
|
|
215
245
|
]),
|
|
@@ -217,5 +247,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
217
247
|
}, 8, ["visible", "onClickCloseIcon", "close-on-click-overlay", "onClickOverlay"])
|
|
218
248
|
]);
|
|
219
249
|
}
|
|
220
|
-
|
|
221
|
-
export {
|
|
250
|
+
_sfc_main.render = _sfc_render;
|
|
251
|
+
export { _sfc_main as default };
|