@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,11 +18,12 @@ 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 { inject, reactive, computed, getCurrentInstance,
|
|
25
|
+
import { inject, ref, reactive, computed, getCurrentInstance, watch, onMounted, toRefs, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, createCommentVNode, renderSlot, normalizeStyle } from "vue";
|
|
26
|
+
import Taro, { eventCenter, getCurrentInstance as getCurrentInstance$1 } from "@tarojs/taro";
|
|
26
27
|
import { c as createComponent } from "./component.js";
|
|
27
28
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
29
|
const { create, componentName } = createComponent("collapse-item");
|
|
@@ -51,6 +52,7 @@ const _sfc_main = create({
|
|
|
51
52
|
},
|
|
52
53
|
setup(props, ctx) {
|
|
53
54
|
const collapse = inject("collapseParent");
|
|
55
|
+
const conHeight = ref("auto");
|
|
54
56
|
const parent = reactive(collapse);
|
|
55
57
|
const classes = computed(() => {
|
|
56
58
|
const prefixCls = componentName;
|
|
@@ -69,7 +71,7 @@ const _sfc_main = create({
|
|
|
69
71
|
icon: parent.props.icon,
|
|
70
72
|
iconSize: parent.props.iconSize,
|
|
71
73
|
iconColor: parent.props.iconColor,
|
|
72
|
-
openExpanded:
|
|
74
|
+
openExpanded: null,
|
|
73
75
|
iconStyle: {
|
|
74
76
|
transform: "rotate(0deg)",
|
|
75
77
|
marginTop: parent.props.iconHeght ? "-" + parent.props.iconHeght / 2 + "px" : "-10px"
|
|
@@ -84,31 +86,33 @@ const _sfc_main = create({
|
|
|
84
86
|
const wrapperRef = ref(null);
|
|
85
87
|
const contentRef = ref(null);
|
|
86
88
|
const onTransitionEnd = () => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
nextTick(() => {
|
|
90
|
+
parent.children.forEach((item1, index) => {
|
|
91
|
+
let ary = Array.from(item1.$el.children);
|
|
92
|
+
ary.forEach((item2, index2) => {
|
|
93
|
+
if (item2.className.includes("collapse-wrapper")) {
|
|
94
|
+
item2.style.willChange = "auto";
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
});
|
|
91
99
|
};
|
|
92
100
|
const animation = () => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
if (parent.props.icon && !proxyData.openExpanded) {
|
|
102
|
+
proxyData.iconStyle["transform"] = "rotate(0deg)";
|
|
103
|
+
} else {
|
|
104
|
+
proxyData.iconStyle["transform"] = "rotate(" + parent.props.rotate + "deg)";
|
|
97
105
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
proxyData.iconStyle["transform"] = "rotate(" + parent.props.rotate + "deg)";
|
|
106
|
+
nextTick(() => {
|
|
107
|
+
const query = Taro.getEnv() === "ALIPAY" ? my.createSelectorQuery() : Taro.createSelectorQuery();
|
|
108
|
+
query.selectAll(".collapse-content").boundingClientRect();
|
|
109
|
+
query.exec((res) => {
|
|
110
|
+
getH(res[0]);
|
|
111
|
+
});
|
|
112
|
+
if (!proxyData.openExpanded) {
|
|
113
|
+
onTransitionEnd();
|
|
107
114
|
}
|
|
108
|
-
}
|
|
109
|
-
if (!proxyData.openExpanded) {
|
|
110
|
-
onTransitionEnd();
|
|
111
|
-
}
|
|
115
|
+
});
|
|
112
116
|
};
|
|
113
117
|
const open = () => {
|
|
114
118
|
proxyData.openExpanded = !proxyData.openExpanded;
|
|
@@ -123,7 +127,7 @@ const _sfc_main = create({
|
|
|
123
127
|
const currentName = computed(() => props.name);
|
|
124
128
|
const toggleOpen = () => {
|
|
125
129
|
if (parent.props.accordion) {
|
|
126
|
-
parent.children.forEach((item,
|
|
130
|
+
parent.children.forEach((item, index) => {
|
|
127
131
|
if (currentName.value == item.name) {
|
|
128
132
|
item.changeOpen(!item.openExpanded);
|
|
129
133
|
} else {
|
|
@@ -157,11 +161,40 @@ const _sfc_main = create({
|
|
|
157
161
|
watch(() => {
|
|
158
162
|
var _a, _b;
|
|
159
163
|
return (_b = (_a = ctx == null ? void 0 : ctx.slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a);
|
|
160
|
-
}, () => {
|
|
164
|
+
}, (vnodes) => {
|
|
161
165
|
setTimeout(() => {
|
|
162
|
-
|
|
166
|
+
getRefHeight();
|
|
163
167
|
}, 300);
|
|
164
168
|
});
|
|
169
|
+
const getH = (list) => {
|
|
170
|
+
parent.children.forEach((item1, index1) => {
|
|
171
|
+
let ary = Array.from(item1.$el.children);
|
|
172
|
+
let _uid = ary[1].children[0]["uid"];
|
|
173
|
+
let tm = list.filter((item2) => item2.id == _uid);
|
|
174
|
+
if (tm && tm.length > 0) {
|
|
175
|
+
let h = tm[0]["height"];
|
|
176
|
+
item1.conHeight = h;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
const getH5 = () => {
|
|
181
|
+
parent.children.forEach((item1, index1) => {
|
|
182
|
+
let ary = Array.from(item1.$el.children);
|
|
183
|
+
let h = ary[1].children[0]["offsetHeight"];
|
|
184
|
+
item1.conHeight = h;
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
const getRefHeight = () => {
|
|
188
|
+
const query = Taro.getEnv() === "ALIPAY" ? my.createSelectorQuery() : Taro.createSelectorQuery();
|
|
189
|
+
query.selectAll(".collapse-content").boundingClientRect();
|
|
190
|
+
query.exec((res) => {
|
|
191
|
+
if (Taro.getEnv() === "WEB") {
|
|
192
|
+
getH5();
|
|
193
|
+
} else {
|
|
194
|
+
getH(res[0]);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
};
|
|
165
198
|
onMounted(() => {
|
|
166
199
|
const { name } = props;
|
|
167
200
|
const active = parent && parent.props.active;
|
|
@@ -175,10 +208,18 @@ const _sfc_main = create({
|
|
|
175
208
|
defaultOpen();
|
|
176
209
|
}
|
|
177
210
|
}
|
|
211
|
+
if (Taro.getEnv() === "WEB") {
|
|
212
|
+
getRefHeight();
|
|
213
|
+
} else {
|
|
214
|
+
eventCenter.once(getCurrentInstance$1().router.onReady, () => {
|
|
215
|
+
getRefHeight();
|
|
216
|
+
});
|
|
217
|
+
}
|
|
178
218
|
});
|
|
179
219
|
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
180
220
|
classes
|
|
181
221
|
}, toRefs(proxyData)), toRefs(parent.props)), toRefs(titleIconStyle)), {
|
|
222
|
+
conHeight,
|
|
182
223
|
wrapperRef,
|
|
183
224
|
contentRef,
|
|
184
225
|
open,
|
|
@@ -197,10 +238,6 @@ const _hoisted_4 = {
|
|
|
197
238
|
};
|
|
198
239
|
const _hoisted_5 = ["innerHTML"];
|
|
199
240
|
const _hoisted_6 = {
|
|
200
|
-
class: "collapse-wrapper",
|
|
201
|
-
ref: "wrapperRef"
|
|
202
|
-
};
|
|
203
|
-
const _hoisted_7 = {
|
|
204
241
|
class: "collapse-content",
|
|
205
242
|
ref: "contentRef"
|
|
206
243
|
};
|
|
@@ -221,7 +258,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
221
258
|
name: _ctx.titleIcon,
|
|
222
259
|
size: _ctx.titleIconSize,
|
|
223
260
|
color: _ctx.titleIconColor,
|
|
224
|
-
class: normalizeClass([_ctx.titleIconPosition == "left" ? "titleIconLeft" : "titleIconRight"])
|
|
261
|
+
class: normalizeClass(["collapse-title-icon", _ctx.titleIconPosition == "left" ? "titleIconLeft" : "titleIconRight"])
|
|
225
262
|
}, null, 8, ["name", "size", "color", "class"])) : createCommentVNode("", true),
|
|
226
263
|
_ctx.$slots.mTitle ? renderSlot(_ctx.$slots, "mTitle", { key: 1 }) : (openBlock(), createElementBlock("view", {
|
|
227
264
|
key: 2,
|
|
@@ -247,12 +284,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
247
284
|
style: normalizeStyle(_ctx.iconStyle)
|
|
248
285
|
}, null, 8, ["name", "size", "color", "class", "style"])) : createCommentVNode("", true)
|
|
249
286
|
], 2),
|
|
250
|
-
createElementVNode("view",
|
|
251
|
-
|
|
287
|
+
createElementVNode("view", {
|
|
288
|
+
class: normalizeClass(["collapse-wrapper", _ctx.openExpanded ? "open-style" : "close-style"]),
|
|
289
|
+
ref: "wrapperRef",
|
|
290
|
+
style: normalizeStyle({ height: _ctx.openExpanded ? _ctx.conHeight == "auto" ? "auto" : _ctx.conHeight + "px" : 0 })
|
|
291
|
+
}, [
|
|
292
|
+
createElementVNode("view", _hoisted_6, [
|
|
252
293
|
renderSlot(_ctx.$slots, "default")
|
|
253
294
|
], 512)
|
|
254
|
-
],
|
|
295
|
+
], 6)
|
|
255
296
|
], 2);
|
|
256
297
|
}
|
|
257
|
-
var
|
|
258
|
-
export {
|
|
298
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
299
|
+
export { index_taro as default };
|
|
@@ -18,8 +18,8 @@ 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
25
|
import { reactive, computed, watch, toRefs, openBlock, createElementBlock, normalizeClass, renderSlot, toDisplayString, Fragment, createElementVNode, createCommentVNode } from "vue";
|
|
@@ -62,7 +62,7 @@ const _sfc_main = create({
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
components: {},
|
|
65
|
-
emits: ["input", "on-end", "on-restart", "on-paused"
|
|
65
|
+
emits: ["input", "on-end", "on-restart", "on-paused"],
|
|
66
66
|
setup(props, { emit, slots }) {
|
|
67
67
|
const state = reactive({
|
|
68
68
|
restTime: 0,
|
|
@@ -125,11 +125,13 @@ const _sfc_main = create({
|
|
|
125
125
|
const end = getTimeStamp(props.endTime || curr);
|
|
126
126
|
const diffTime = curr - start;
|
|
127
127
|
state.restTime = end - (start + diffTime);
|
|
128
|
+
clearInterval(state.timer);
|
|
129
|
+
state.timer = null;
|
|
128
130
|
state.timer = setInterval(() => {
|
|
129
131
|
if (!props.paused) {
|
|
130
132
|
let restTime2 = end - (Date.now() - state.p + diffTime);
|
|
131
133
|
state.restTime = restTime2;
|
|
132
|
-
if (restTime2 <
|
|
134
|
+
if (restTime2 < delay) {
|
|
133
135
|
state.restTime = 0;
|
|
134
136
|
emit("on-end");
|
|
135
137
|
clearInterval(state.timer);
|
|
@@ -219,5 +221,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
219
221
|
], 64))
|
|
220
222
|
], 2);
|
|
221
223
|
}
|
|
222
|
-
var
|
|
223
|
-
export {
|
|
224
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
225
|
+
export { index_taro as default };
|
|
@@ -18,8 +18,8 @@ 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
25
|
import { getCurrentInstance, reactive, watch, nextTick, onMounted, onUnmounted, toRefs, openBlock, createElementBlock, Fragment, normalizeStyle, renderList, createCommentVNode, toDisplayString, createTextVNode } from "vue";
|
|
@@ -179,20 +179,20 @@ const _sfc_main = create({
|
|
|
179
179
|
return m / baseNum;
|
|
180
180
|
}
|
|
181
181
|
};
|
|
182
|
-
const topNumber = (
|
|
182
|
+
const topNumber = (index) => {
|
|
183
183
|
let { num_total_len, pointNum, initDigit1, initDigit2, sortFlag } = data;
|
|
184
|
-
let idx1 = sortFlag == "add" || sortFlag == "equal" ? String(initDigit2)[
|
|
185
|
-
let idx2 = sortFlag == "add" || sortFlag == "equal" ? String(initDigit1)[
|
|
186
|
-
let num =
|
|
184
|
+
let idx1 = sortFlag == "add" || sortFlag == "equal" ? String(initDigit2)[index - (num_total_len - pointNum)] : 10 - Number(String(initDigit2)[index - (num_total_len - pointNum)]);
|
|
185
|
+
let idx2 = sortFlag == "add" || sortFlag == "equal" ? String(initDigit1)[index] : 10 - Number(String(initDigit1)[index]);
|
|
186
|
+
let num = index > num_total_len - pointNum - 1 ? -idx1 * 100 + "%" : index <= String(initDigit1).length - 1 ? -idx2 * 100 + "%" : 0;
|
|
187
187
|
if (num == "-1000%") {
|
|
188
188
|
num = 0;
|
|
189
189
|
}
|
|
190
190
|
return num;
|
|
191
191
|
};
|
|
192
|
-
const turnNumber = (
|
|
192
|
+
const turnNumber = (index) => {
|
|
193
193
|
let { num_total_len, pointNum, initDigit1, initDigit2, sortFlag } = data;
|
|
194
|
-
let idx1 = String(initDigit2)[
|
|
195
|
-
let num =
|
|
194
|
+
let idx1 = String(initDigit2)[index - (num_total_len - pointNum)];
|
|
195
|
+
let num = index > num_total_len - pointNum - 1 ? idx1 ? idx1 : 0 : index <= String(initDigit1).length - 1 ? String(initDigit1)[index] : 0;
|
|
196
196
|
return num;
|
|
197
197
|
};
|
|
198
198
|
const countChange = () => {
|
|
@@ -322,21 +322,21 @@ const _sfc_main = create({
|
|
|
322
322
|
}, props.during);
|
|
323
323
|
};
|
|
324
324
|
const runStep = (el) => {
|
|
325
|
-
let currentTurn = el.
|
|
325
|
+
let currentTurn = el.style.all;
|
|
326
326
|
let turningNum;
|
|
327
327
|
if (data.sortFlag == "add") {
|
|
328
328
|
turningNum = parseInt(String(currentTurn)) + 1;
|
|
329
329
|
} else {
|
|
330
330
|
turningNum = parseInt(String(currentTurn)) - 1 >= 0 ? parseInt(String(currentTurn)) - 1 : 9;
|
|
331
331
|
}
|
|
332
|
-
el.
|
|
333
|
-
if (el.style.transition == "none
|
|
332
|
+
el.style.all = String(turningNum);
|
|
333
|
+
if (el.style.transition == "none" || turningNum == 1 || !el.style.transition) {
|
|
334
334
|
el.style.transition = `all linear ${props.during}ms`;
|
|
335
335
|
}
|
|
336
336
|
if (turningNum == 10 || data.sortFlag == "reduce" && turningNum == 0) {
|
|
337
337
|
var timeOut = null;
|
|
338
338
|
el.style.top = `-${data.sortFlag == "add" ? turningNum * 100 : (10 - turningNum) * 100}%`;
|
|
339
|
-
el.
|
|
339
|
+
el.style.all = "0";
|
|
340
340
|
timeOut = setTimeout(() => {
|
|
341
341
|
timeOut && clearTimeout(timeOut);
|
|
342
342
|
el.style.transition = "none";
|
|
@@ -397,16 +397,16 @@ const _sfc_main = create({
|
|
|
397
397
|
}
|
|
398
398
|
};
|
|
399
399
|
useExtend({ machineLuck });
|
|
400
|
-
const scrollTime = (
|
|
400
|
+
const scrollTime = (index, total, num) => {
|
|
401
401
|
let t = setInterval(() => {
|
|
402
402
|
if (num <= total) {
|
|
403
403
|
num += 10;
|
|
404
|
-
data.prizeY[
|
|
404
|
+
data.prizeY[index] = parseFloat(String(num));
|
|
405
405
|
} else {
|
|
406
406
|
clearInterval(t);
|
|
407
407
|
t = null;
|
|
408
408
|
data.finshMachine += 1;
|
|
409
|
-
data.prizeY[
|
|
409
|
+
data.prizeY[index] = total;
|
|
410
410
|
if (data.finshMachine == props.machineNum) {
|
|
411
411
|
let distance = props.numHeight * props.machinePrizeNum;
|
|
412
412
|
data.prizeYPrev = [];
|
|
@@ -458,17 +458,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
458
458
|
class: "run-number-machine-img",
|
|
459
459
|
style: normalizeStyle({ height: _ctx.numHeight + "px" })
|
|
460
460
|
}, [
|
|
461
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.machineNum, (val,
|
|
461
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.machineNum, (val, index) => {
|
|
462
462
|
return openBlock(), createElementBlock("view", {
|
|
463
463
|
class: "run-number-machine-img-li",
|
|
464
464
|
ref_for: true,
|
|
465
465
|
ref: "run-number-machine-img-li",
|
|
466
|
-
key: "mImg" +
|
|
466
|
+
key: "mImg" + index,
|
|
467
467
|
style: normalizeStyle({
|
|
468
468
|
width: _ctx.numWidth + "px",
|
|
469
469
|
height: _ctx.numHeight + "px",
|
|
470
|
-
|
|
471
|
-
|
|
470
|
+
background: "url(" + _ctx.customBgImg + ") ",
|
|
471
|
+
backgroundPosition: "0 " + _ctx.prizeY[index] + "px"
|
|
472
472
|
})
|
|
473
473
|
}, null, 4);
|
|
474
474
|
}), 128))
|
|
@@ -477,16 +477,16 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
477
477
|
class: "run-number-img",
|
|
478
478
|
style: normalizeStyle({ height: _ctx.numHeight + "px" })
|
|
479
479
|
}, [
|
|
480
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.num_total_len, (val,
|
|
480
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.num_total_len, (val, index) => {
|
|
481
481
|
return openBlock(), createElementBlock("view", {
|
|
482
482
|
class: "run-number-img-li",
|
|
483
|
-
key: "cImg" +
|
|
483
|
+
key: "cImg" + index,
|
|
484
484
|
style: normalizeStyle({
|
|
485
485
|
width: _ctx.numWidth + "px",
|
|
486
486
|
height: _ctx.numHeight + "px",
|
|
487
|
-
left: _ctx.numWidth * (
|
|
487
|
+
left: _ctx.numWidth * (index > _ctx.num_total_len - _ctx.pointNum - 1 ? index == _ctx.num_total_len - _ctx.pointNum ? index * 1.5 : index * 1.3 : index) + "px",
|
|
488
488
|
backgroundImage: "url(" + _ctx.customBgImg + ")",
|
|
489
|
-
backgroundPosition: "0 " + -(String(_ctx.relNum)[
|
|
489
|
+
backgroundPosition: "0 " + -(String(_ctx.relNum)[index] * _ctx.numHeight + _ctx.customSpacNum * String(_ctx.relNum)[index]) + "px",
|
|
490
490
|
transition: "all linear " + _ctx.during / 10 + "ms"
|
|
491
491
|
})
|
|
492
492
|
}, null, 4);
|
|
@@ -512,17 +512,18 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
512
512
|
lineHeight: _ctx.numHeight + "px"
|
|
513
513
|
})
|
|
514
514
|
}, [
|
|
515
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.num_total_len, (val,
|
|
515
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.num_total_len, (val, index) => {
|
|
516
516
|
return openBlock(), createElementBlock("view", {
|
|
517
517
|
ref_for: true,
|
|
518
518
|
ref: "numberItem",
|
|
519
519
|
class: "numberItem",
|
|
520
520
|
key: val,
|
|
521
521
|
style: normalizeStyle({
|
|
522
|
-
|
|
523
|
-
|
|
522
|
+
all: _ctx.turnNumber(index),
|
|
523
|
+
top: _ctx.topNumber(index),
|
|
524
|
+
left: _ctx.numWidth * (index > _ctx.num_total_len - _ctx.pointNum - 1 ? index * 1.1 : index) + "px"
|
|
524
525
|
}),
|
|
525
|
-
"turn-number": _ctx.turnNumber(
|
|
526
|
+
"turn-number": _ctx.turnNumber(index)
|
|
526
527
|
}, [
|
|
527
528
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.to0_10, (item, idx) => {
|
|
528
529
|
return openBlock(), createElementBlock("view", {
|
|
@@ -554,5 +555,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
554
555
|
], 64))
|
|
555
556
|
]);
|
|
556
557
|
}
|
|
557
|
-
var
|
|
558
|
-
export {
|
|
558
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
559
|
+
export { index_taro as default };
|
|
@@ -18,18 +18,29 @@ 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,
|
|
26
|
-
import
|
|
25
|
+
import { reactive, computed, onBeforeMount, watch, toRefs, resolveComponent, openBlock, createBlock } from "vue";
|
|
26
|
+
import nutPicker from "./Picker.js";
|
|
27
|
+
import { p as popupProps } from "./index4.js";
|
|
27
28
|
import { c as createComponent } from "./component.js";
|
|
28
29
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
29
30
|
import "./Popup.js";
|
|
31
|
+
import "./use-lock-scroll.js";
|
|
30
32
|
import "./OverLay.js";
|
|
31
33
|
import "./Icon.js";
|
|
32
34
|
import "./pxCheck.js";
|
|
35
|
+
import "./index.js";
|
|
36
|
+
import "@tarojs/taro";
|
|
37
|
+
function padZero(num, targetLength = 2) {
|
|
38
|
+
let str = num + "";
|
|
39
|
+
while (str.length < targetLength) {
|
|
40
|
+
str = "0" + str;
|
|
41
|
+
}
|
|
42
|
+
return str;
|
|
43
|
+
}
|
|
33
44
|
const { componentName, create } = createComponent("datepicker");
|
|
34
45
|
const currentYear = new Date().getFullYear();
|
|
35
46
|
function isDate(val) {
|
|
@@ -45,25 +56,29 @@ const zhCNType = {
|
|
|
45
56
|
};
|
|
46
57
|
const _sfc_main = create({
|
|
47
58
|
components: {
|
|
48
|
-
|
|
59
|
+
nutPicker
|
|
49
60
|
},
|
|
50
|
-
props: {
|
|
61
|
+
props: __spreadProps(__spreadValues({}, popupProps), {
|
|
51
62
|
modelValue: null,
|
|
52
|
-
visible: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: false
|
|
55
|
-
},
|
|
56
63
|
title: {
|
|
57
64
|
type: String,
|
|
58
65
|
default: ""
|
|
59
66
|
},
|
|
67
|
+
okText: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "\u786E\u5B9A"
|
|
70
|
+
},
|
|
71
|
+
cancelText: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: "\u53D6\u6D88"
|
|
74
|
+
},
|
|
60
75
|
type: {
|
|
61
76
|
type: String,
|
|
62
77
|
default: "date"
|
|
63
78
|
},
|
|
64
79
|
isShowChinese: {
|
|
65
80
|
type: Boolean,
|
|
66
|
-
default:
|
|
81
|
+
default: false
|
|
67
82
|
},
|
|
68
83
|
minuteStep: {
|
|
69
84
|
type: Number,
|
|
@@ -78,14 +93,20 @@ const _sfc_main = create({
|
|
|
78
93
|
type: Date,
|
|
79
94
|
default: () => new Date(currentYear + 10, 11, 31),
|
|
80
95
|
validator: isDate
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
96
|
+
},
|
|
97
|
+
formatter: {
|
|
98
|
+
type: Function,
|
|
99
|
+
default: null
|
|
100
|
+
},
|
|
101
|
+
filter: Function
|
|
102
|
+
}),
|
|
103
|
+
emits: ["click", "update:visible", "change", "confirm", "update:moduleValue"],
|
|
84
104
|
setup(props, { emit }) {
|
|
85
105
|
const state = reactive({
|
|
86
106
|
show: false,
|
|
87
107
|
currentDate: new Date(),
|
|
88
|
-
title: props.title
|
|
108
|
+
title: props.title,
|
|
109
|
+
selectedValue: []
|
|
89
110
|
});
|
|
90
111
|
const formatValue = (value) => {
|
|
91
112
|
if (!isDate(value)) {
|
|
@@ -181,42 +202,56 @@ const _sfc_main = create({
|
|
|
181
202
|
}
|
|
182
203
|
return result;
|
|
183
204
|
});
|
|
184
|
-
const
|
|
205
|
+
const columns = computed(() => {
|
|
206
|
+
const val = ranges.value.map((res, columnIndex) => {
|
|
207
|
+
return generateValue(res.range[0], res.range[1], getDateIndex(res.type), res.type, columnIndex);
|
|
208
|
+
});
|
|
209
|
+
return val;
|
|
210
|
+
});
|
|
211
|
+
const changeHandler = ({
|
|
212
|
+
columnIndex,
|
|
213
|
+
selectedValue,
|
|
214
|
+
selectedOptions
|
|
215
|
+
}) => {
|
|
185
216
|
if (["date", "datetime"].includes(props.type)) {
|
|
186
217
|
let formatDate = [];
|
|
187
|
-
|
|
188
|
-
formatDate = val.map((res) => {
|
|
189
|
-
return Number(res.slice(0, res.length - 1));
|
|
190
|
-
});
|
|
191
|
-
} else {
|
|
192
|
-
formatDate = val;
|
|
193
|
-
}
|
|
218
|
+
formatDate = selectedValue;
|
|
194
219
|
if (props.type === "date") {
|
|
195
220
|
state.currentDate = formatValue(new Date(formatDate[0], formatDate[1] - 1, Math.min(formatDate[2], getMonthEndDay(formatDate[0], formatDate[1]))));
|
|
196
221
|
} else if (props.type === "datetime") {
|
|
197
222
|
state.currentDate = formatValue(new Date(formatDate[0], formatDate[1] - 1, Math.min(formatDate[2], getMonthEndDay(formatDate[0], formatDate[1])), formatDate[3], formatDate[4]));
|
|
198
223
|
}
|
|
199
224
|
}
|
|
225
|
+
emit("change", { columnIndex, selectedValue, selectedOptions });
|
|
226
|
+
};
|
|
227
|
+
const formatterOption = (type, value) => {
|
|
228
|
+
const { filter, formatter, isShowChinese } = props;
|
|
229
|
+
let fOption = null;
|
|
230
|
+
if (formatter) {
|
|
231
|
+
fOption = formatter(type, { text: padZero(value, 2), value: padZero(value, 2) });
|
|
232
|
+
} else {
|
|
233
|
+
const padMin = padZero(value, 2);
|
|
234
|
+
const fatter = isShowChinese ? zhCNType[type] : "";
|
|
235
|
+
fOption = { text: padMin + fatter, value: padMin };
|
|
236
|
+
}
|
|
237
|
+
return fOption;
|
|
200
238
|
};
|
|
201
|
-
const generateValue = (min, max, val, type) => {
|
|
239
|
+
const generateValue = (min, max, val, type, columnIndex) => {
|
|
202
240
|
const arr = [];
|
|
203
|
-
let
|
|
241
|
+
let index = 0;
|
|
204
242
|
while (min <= max) {
|
|
205
|
-
|
|
206
|
-
arr.push(min + zhCNType[type]);
|
|
207
|
-
} else {
|
|
208
|
-
arr.push(min);
|
|
209
|
-
}
|
|
243
|
+
arr.push(formatterOption(type, min));
|
|
210
244
|
if (type === "minute") {
|
|
211
245
|
min += props.minuteStep;
|
|
212
246
|
} else {
|
|
213
247
|
min++;
|
|
214
248
|
}
|
|
215
249
|
if (min <= val) {
|
|
216
|
-
|
|
250
|
+
index++;
|
|
217
251
|
}
|
|
218
252
|
}
|
|
219
|
-
|
|
253
|
+
state.selectedValue[columnIndex] = arr[index].value;
|
|
254
|
+
return props.filter ? props.filter(type, arr) : arr;
|
|
220
255
|
};
|
|
221
256
|
const getDateIndex = (type) => {
|
|
222
257
|
if (type === "year") {
|
|
@@ -234,12 +269,6 @@ const _sfc_main = create({
|
|
|
234
269
|
}
|
|
235
270
|
return 0;
|
|
236
271
|
};
|
|
237
|
-
const columns = computed(() => {
|
|
238
|
-
const val = ranges.value.map((res) => {
|
|
239
|
-
return generateValue(res.range[0], res.range[1], getDateIndex(res.type), res.type);
|
|
240
|
-
});
|
|
241
|
-
return val;
|
|
242
|
-
});
|
|
243
272
|
const closeHandler = () => {
|
|
244
273
|
emit("update:visible", false);
|
|
245
274
|
};
|
|
@@ -247,9 +276,12 @@ const _sfc_main = create({
|
|
|
247
276
|
emit("update:visible", false);
|
|
248
277
|
emit("confirm", val);
|
|
249
278
|
};
|
|
250
|
-
|
|
279
|
+
onBeforeMount(() => {
|
|
251
280
|
state.currentDate = formatValue(props.modelValue);
|
|
252
281
|
});
|
|
282
|
+
watch(() => props.modelValue, (value) => {
|
|
283
|
+
state.currentDate = formatValue(value);
|
|
284
|
+
});
|
|
253
285
|
watch(() => props.title, (val) => {
|
|
254
286
|
state.title = val;
|
|
255
287
|
});
|
|
@@ -267,13 +299,18 @@ const _sfc_main = create({
|
|
|
267
299
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
268
300
|
const _component_nut_picker = resolveComponent("nut-picker");
|
|
269
301
|
return openBlock(), createBlock(_component_nut_picker, {
|
|
302
|
+
modelValue: _ctx.selectedValue,
|
|
303
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.selectedValue = $event),
|
|
270
304
|
visible: _ctx.show,
|
|
305
|
+
okText: _ctx.okText,
|
|
306
|
+
cancelText: _ctx.cancelText,
|
|
271
307
|
onClose: _ctx.closeHandler,
|
|
272
|
-
|
|
308
|
+
columns: _ctx.columns,
|
|
273
309
|
onChange: _ctx.changeHandler,
|
|
274
310
|
title: _ctx.title,
|
|
275
|
-
onConfirm: _ctx.confirm
|
|
276
|
-
|
|
311
|
+
onConfirm: _ctx.confirm,
|
|
312
|
+
isWrapTeleport: _ctx.isWrapTeleport
|
|
313
|
+
}, null, 8, ["modelValue", "visible", "okText", "cancelText", "onClose", "columns", "onChange", "title", "onConfirm", "isWrapTeleport"]);
|
|
277
314
|
}
|
|
278
|
-
var
|
|
279
|
-
export {
|
|
315
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
316
|
+
export { index_taro as default };
|