@nutui/nutui 3.2.6-beta.1 → 3.2.6
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 +31 -0
- package/README.md +18 -4
- package/dist/nutui.es.js +4461 -4135
- package/dist/nutui.umd.js +4559 -4133
- package/dist/packages/_es/ActionSheet.js +19 -18
- package/dist/packages/_es/Address.js +85 -94
- package/dist/packages/_es/AddressList.js +12 -25
- package/dist/packages/_es/Animate.js +3 -3
- package/dist/packages/_es/Audio.js +2 -9
- package/dist/packages/_es/AudioOperate.js +1 -5
- package/dist/packages/_es/Avatar.js +10 -10
- package/dist/packages/_es/AvatarGroup.js +5 -5
- package/dist/packages/_es/BackTop.js +108 -55
- package/dist/packages/_es/Badge.js +12 -10
- package/dist/packages/_es/Barrage.js +103 -79
- package/dist/packages/_es/Button.js +3 -5
- package/dist/packages/_es/Calendar.js +23 -36
- package/dist/packages/_es/CalendarItem.js +3 -4
- package/dist/packages/_es/Card.js +5 -15
- package/dist/packages/_es/Cascader.js +11 -12
- package/dist/packages/_es/Category.js +12 -13
- package/dist/packages/_es/CategoryPane.js +13 -17
- package/dist/packages/_es/Cell.js +12 -9
- package/dist/packages/_es/CellGroup.js +2 -4
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +82 -98
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +34 -65
- package/dist/packages/_es/CollapseItem.js +60 -93
- package/dist/packages/_es/Comment.js +19 -43
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +3 -3
- package/dist/packages/_es/CountUp.js +52 -47
- package/dist/packages/_es/DatePicker.js +54 -37
- package/dist/packages/_es/Dialog.js +88 -9
- package/dist/packages/_es/Divider.js +3 -3
- package/dist/packages/_es/Drag.js +49 -75
- package/dist/packages/_es/Ecard.js +18 -20
- package/dist/packages/_es/Elevator.js +76 -101
- package/dist/packages/_es/Ellipsis.js +100 -140
- package/dist/packages/_es/Empty.js +4 -6
- package/dist/packages/_es/FixedNav.js +6 -11
- package/dist/packages/_es/Form.js +4 -4
- package/dist/packages/_es/FormItem.js +1 -3
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +27 -10
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +114 -13
- package/dist/packages/_es/ImagePreview.js +411 -149
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +115 -103
- package/dist/packages/_es/Input.js +32 -56
- package/dist/packages/_es/InputNumber.js +16 -25
- package/dist/packages/_es/Invoice.js +5 -6
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +34 -47
- package/dist/packages/_es/Menu.js +35 -35
- package/dist/packages/_es/MenuItem.js +29 -56
- package/dist/packages/_es/Navbar.js +39 -49
- package/dist/packages/_es/NoticeBar.js +45 -54
- package/dist/packages/_es/Notify.js +162 -44
- package/dist/packages/_es/NumberKeyboard.js +20 -15
- package/dist/packages/_es/OldPicker.js +116 -130
- package/dist/packages/_es/OverLay.js +28 -5
- package/dist/packages/_es/Pagination.js +5 -8
- package/dist/packages/_es/Picker.js +74 -198
- package/dist/packages/_es/Popover.js +881 -201
- package/dist/packages/_es/Popup.js +84 -28
- package/dist/packages/_es/Price.js +6 -22
- package/dist/packages/_es/Progress.js +11 -18
- package/dist/packages/_es/PullRefresh.js +2 -4
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +34 -48
- package/dist/packages/_es/Rate.js +14 -15
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +36 -39
- package/dist/packages/_es/ShortPassword.js +66 -97
- package/dist/packages/_es/SideNavBar.js +18 -7
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +80 -113
- package/dist/packages/_es/Skeleton.js +11 -12
- package/dist/packages/_es/Sku.js +38 -63
- package/dist/packages/_es/Step.js +2 -7
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +23 -33
- package/dist/packages/_es/SubSideNavBar.js +2 -4
- package/dist/packages/_es/Swipe.js +26 -41
- package/dist/packages/_es/Swiper.js +21 -38
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +8 -8
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +13 -15
- package/dist/packages/_es/TabbarItem.js +30 -24
- package/dist/packages/_es/Table.js +17 -22
- package/dist/packages/_es/Tabs.js +16 -49
- package/dist/packages/_es/Tag.js +5 -6
- package/dist/packages/_es/TextArea.js +49 -114
- package/dist/packages/_es/TimeDetail.js +3 -4
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +10 -12
- package/dist/packages/_es/Toast.js +164 -53
- package/dist/packages/_es/TrendArrow.js +4 -6
- package/dist/packages/_es/Uploader.js +140 -141
- package/dist/packages/_es/Video.js +18 -39
- package/dist/packages/_es/WaterMark.js +14 -22
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +6 -44
- package/dist/packages/_es/index2.js +31 -8
- package/dist/packages/_es/index3.js +7 -64
- package/dist/packages/_es/index4.js +62 -424
- package/dist/packages/_es/{index.taro.js → index5.js} +154 -167
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/style.css +3 -21
- package/dist/packages/checkbox/index.scss +1 -0
- package/dist/packages/locale/lang/baseLang.js +1 -1
- package/dist/packages/locale/lang/en-US.js +1 -1
- package/dist/packages/locale/lang/id-ID.js +1 -1
- package/dist/packages/locale/lang/index.js +1 -1
- package/dist/packages/locale/lang/zh-CN.js +1 -1
- package/dist/packages/locale/lang/zh-TW.js +1 -1
- package/dist/packages/menuitem/index.scss +12 -3
- package/dist/smartips/attributes.json +5 -1
- package/dist/smartips/tags.json +1 -0
- package/dist/smartips/web-types.json +11 -2
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jddkh.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/types/__VUE/actionsheet/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
- package/dist/types/__VUE/address/{index.taro.vue.d.ts → index.vue.d.ts} +32 -72
- package/dist/types/__VUE/addresslist/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/animate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/avatar/{index.taro.vue.d.ts → index.vue.d.ts} +6 -6
- package/dist/types/__VUE/avatargroup/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/backtop/{index.taro.vue.d.ts → index.vue.d.ts} +37 -15
- package/dist/types/__VUE/badge/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/barrage/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendar/{index.taro.vue.d.ts → index.vue.d.ts} +1 -13
- package/dist/types/__VUE/calendaritem/{index.taro.vue.d.ts → index.vue.d.ts} +17 -17
- package/dist/types/__VUE/card/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/cascader/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/category/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/categorypane/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/cell/{index.taro.vue.d.ts → index.vue.d.ts} +6 -13
- package/dist/types/__VUE/checkbox/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/circleprogress/{index.taro.vue.d.ts → index.vue.d.ts} +15 -14
- package/dist/types/__VUE/collapse/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/collapseitem/{index.taro.vue.d.ts → index.vue.d.ts} +10 -2
- package/dist/types/__VUE/comment/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
- package/dist/types/__VUE/configprovider/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/countdown/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/countup/{index.taro.vue.d.ts → index.vue.d.ts} +7 -5
- package/dist/types/__VUE/datepicker/{index.taro.vue.d.ts → index.vue.d.ts} +5 -5
- package/dist/types/__VUE/dialog/index.d.ts +48 -0
- package/dist/types/__VUE/dialog/{index.taro.vue.d.ts → index.vue.d.ts} +12 -9
- package/dist/types/__VUE/divider/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/drag/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
- package/dist/types/__VUE/ecard/{index.taro.vue.d.ts → index.vue.d.ts} +3 -3
- package/dist/types/__VUE/elevator/{index.taro.vue.d.ts → index.vue.d.ts} +2 -11
- package/dist/types/__VUE/ellipsis/{index.taro.vue.d.ts → index.vue.d.ts} +0 -4
- package/dist/types/__VUE/empty/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/fixednav/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/form/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/grid/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/griditem/{index.taro.vue.d.ts → index.vue.d.ts} +27 -2
- package/dist/types/__VUE/image/index.vue.d.ts +117 -0
- package/dist/types/__VUE/image/type.d.ts +6 -0
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +109 -0
- package/dist/types/__VUE/imagepreview/index.d.ts +25 -0
- package/dist/types/__VUE/imagepreview/{index.taro.vue.d.ts → index.vue.d.ts} +44 -33
- package/dist/types/__VUE/indicator/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/infiniteloading/{index.taro.vue.d.ts → index.vue.d.ts} +8 -15
- package/dist/types/__VUE/input/{index.taro.vue.d.ts → index.vue.d.ts} +16 -34
- package/dist/types/__VUE/inputnumber/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/invoice/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/layout/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/list/{index.taro.vue.d.ts → index.vue.d.ts} +2 -2
- package/dist/types/__VUE/menu/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
- package/dist/types/__VUE/menuitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/navbar/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
- package/dist/types/__VUE/noticebar/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
- package/dist/types/__VUE/notify/index.d.ts +26 -0
- package/dist/types/__VUE/notify/{index.taro.vue.d.ts → index.vue.d.ts} +18 -5
- package/dist/types/__VUE/numberkeyboard/{index.taro.vue.d.ts → index.vue.d.ts} +29 -5
- package/dist/types/__VUE/oldpicker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +17 -28
- package/dist/types/__VUE/oldpicker/{index.taro.vue.d.ts → index.vue.d.ts} +44 -64
- package/dist/types/__VUE/pagination/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/picker/{ColumnTaro.vue.d.ts → Column.vue.d.ts} +4 -16
- package/dist/types/__VUE/picker/{index.taro.vue.d.ts → index.vue.d.ts} +28 -53
- package/dist/types/__VUE/popover/{index.taro.vue.d.ts → index.vue.d.ts} +12 -14
- package/dist/types/__VUE/popup/index.vue.d.ts +1 -1
- package/dist/types/__VUE/price/{index.taro.vue.d.ts → index.vue.d.ts} +0 -1
- package/dist/types/__VUE/progress/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/__VUE/radio/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/range/{index.taro.vue.d.ts → index.vue.d.ts} +6 -7
- package/dist/types/__VUE/rate/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/searchbar/{index.taro.vue.d.ts → index.vue.d.ts} +19 -19
- package/dist/types/__VUE/shortpassword/{index.taro.vue.d.ts → index.vue.d.ts} +21 -6
- package/dist/types/__VUE/sidenavbar/{index.taro.vue.d.ts → index.vue.d.ts} +5 -0
- package/dist/types/__VUE/signature/{index.taro.vue.d.ts → index.vue.d.ts} +5 -8
- package/dist/types/__VUE/skeleton/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/sku/index.vue.d.ts +310 -0
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/steps/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/sticky/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/swipe/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
- package/dist/types/__VUE/swiper/{index.taro.vue.d.ts → index.vue.d.ts} +1 -2
- package/dist/types/__VUE/swiperitem/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/switch/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabbar/{index.taro.vue.d.ts → index.vue.d.ts} +2 -1
- package/dist/types/__VUE/tabbaritem/{index.taro.vue.d.ts → index.vue.d.ts} +9 -9
- package/dist/types/__VUE/table/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/tabs/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/tag/{index.taro.vue.d.ts → index.vue.d.ts} +4 -4
- package/dist/types/__VUE/tag/type.d.ts +5 -0
- package/dist/types/__VUE/textarea/{index.taro.vue.d.ts → index.vue.d.ts} +3 -5
- package/dist/types/__VUE/timedetail/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/timepannel/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/timeselect/{index.taro.vue.d.ts → index.vue.d.ts} +8 -7
- package/dist/types/__VUE/toast/index.d.ts +16 -0
- package/dist/types/__VUE/toast/{index.taro.vue.d.ts → index.vue.d.ts} +22 -44
- package/dist/types/__VUE/trendarrow/{index.taro.vue.d.ts → index.vue.d.ts} +0 -0
- package/dist/types/__VUE/uploader/{index.taro.vue.d.ts → index.vue.d.ts} +11 -20
- package/dist/types/__VUE/watermark/{index.taro.vue.d.ts → index.vue.d.ts} +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +89 -89
- package/package.json +3 -2
- package/dist/packages/_es/use-lock-scroll.js +0 -23
- package/dist/types/__VUE/button/index.taro.vue.d.ts +0 -116
- package/dist/types/__VUE/icon/index.taro.vue.d.ts +0 -74
- package/dist/types/__VUE/image/index.taro.vue.d.ts +0 -33
- package/dist/types/__VUE/overlay/index.taro.vue.d.ts +0 -85
- package/dist/types/__VUE/popup/index.taro.vue.d.ts +0 -1728
- package/dist/types/__VUE/sku/index.taro.vue.d.ts +0 -182
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6
|
|
2
|
+
* @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { getCurrentInstance, reactive, watch, nextTick, onMounted, onUnmounted, toRefs, openBlock, createElementBlock, Fragment, normalizeStyle, renderList,
|
|
6
|
+
import { getCurrentInstance, ref, reactive, watch, nextTick, onMounted, onUnmounted, toRefs, openBlock, createElementBlock, Fragment, normalizeStyle, renderList, createCommentVNode, toDisplayString, createTextVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
@@ -80,7 +80,7 @@ const _sfc_main = create({
|
|
|
80
80
|
type: Number,
|
|
81
81
|
default: 0
|
|
82
82
|
},
|
|
83
|
-
|
|
83
|
+
machineTurnMore: {
|
|
84
84
|
type: Number,
|
|
85
85
|
default: 0
|
|
86
86
|
}
|
|
@@ -88,6 +88,11 @@ const _sfc_main = create({
|
|
|
88
88
|
components: {},
|
|
89
89
|
emits: ["click", "scroll-end"],
|
|
90
90
|
setup(props, { emit }) {
|
|
91
|
+
const runNumberImg = ref(null);
|
|
92
|
+
const numberItemRef = ref([]);
|
|
93
|
+
const setRef = (el) => {
|
|
94
|
+
numberItemRef.value.push(el);
|
|
95
|
+
};
|
|
91
96
|
const data = reactive({
|
|
92
97
|
valFlag: false,
|
|
93
98
|
current: 0,
|
|
@@ -173,20 +178,20 @@ const _sfc_main = create({
|
|
|
173
178
|
return m / baseNum;
|
|
174
179
|
}
|
|
175
180
|
};
|
|
176
|
-
const topNumber = (
|
|
181
|
+
const topNumber = (index2) => {
|
|
177
182
|
let { num_total_len, pointNum, initDigit1, initDigit2, sortFlag } = data;
|
|
178
|
-
let idx1 = sortFlag == "add" || sortFlag == "equal" ? String(initDigit2)[
|
|
179
|
-
let idx2 = sortFlag == "add" || sortFlag == "equal" ? String(initDigit1)[
|
|
180
|
-
let num =
|
|
183
|
+
let idx1 = sortFlag == "add" || sortFlag == "equal" ? String(initDigit2)[index2 - (num_total_len - pointNum)] : 10 - Number(String(initDigit2)[index2 - (num_total_len - pointNum)]);
|
|
184
|
+
let idx2 = sortFlag == "add" || sortFlag == "equal" ? String(initDigit1)[index2] : 10 - Number(String(initDigit1)[index2]);
|
|
185
|
+
let num = index2 > num_total_len - pointNum - 1 ? -idx1 * 100 + "%" : index2 <= String(initDigit1).length - 1 ? -idx2 * 100 + "%" : 0;
|
|
181
186
|
if (num == "-1000%") {
|
|
182
187
|
num = 0;
|
|
183
188
|
}
|
|
184
189
|
return num;
|
|
185
190
|
};
|
|
186
|
-
const turnNumber = (
|
|
191
|
+
const turnNumber = (index2) => {
|
|
187
192
|
let { num_total_len, pointNum, initDigit1, initDigit2, sortFlag } = data;
|
|
188
|
-
let idx1 = String(initDigit2)[
|
|
189
|
-
let num =
|
|
193
|
+
let idx1 = String(initDigit2)[index2 - (num_total_len - pointNum)];
|
|
194
|
+
let num = index2 > num_total_len - pointNum - 1 ? idx1 ? idx1 : 0 : index2 <= String(initDigit1).length - 1 ? String(initDigit1)[index2] : 0;
|
|
190
195
|
return num;
|
|
191
196
|
};
|
|
192
197
|
const countChange = () => {
|
|
@@ -194,21 +199,23 @@ const _sfc_main = create({
|
|
|
194
199
|
let countTimer = setInterval(() => {
|
|
195
200
|
if (initNum > endNum) {
|
|
196
201
|
if (data.current <= endNum || data.current <= speed) {
|
|
197
|
-
data.current =
|
|
202
|
+
data.current = endNum.toFixed(toFixed);
|
|
198
203
|
clearInterval(countTimer);
|
|
199
204
|
emit("scroll-end");
|
|
200
205
|
data.valFlag = false;
|
|
201
206
|
} else {
|
|
202
|
-
|
|
207
|
+
let num = parseFloat(String(data.current)) - parseFloat(String(speed));
|
|
208
|
+
data.current = num.toFixed(toFixed);
|
|
203
209
|
}
|
|
204
210
|
} else {
|
|
205
211
|
if (data.current >= endNum) {
|
|
206
|
-
data.current =
|
|
212
|
+
data.current = endNum.toFixed(toFixed);
|
|
207
213
|
clearInterval(countTimer);
|
|
208
214
|
emit("scroll-end");
|
|
209
215
|
data.valFlag = false;
|
|
210
216
|
} else {
|
|
211
|
-
|
|
217
|
+
let num = parseFloat(String(data.current)) + parseFloat(String(speed));
|
|
218
|
+
data.current = num.toFixed(toFixed);
|
|
212
219
|
}
|
|
213
220
|
}
|
|
214
221
|
}, props.during);
|
|
@@ -289,8 +296,7 @@ const _sfc_main = create({
|
|
|
289
296
|
if (data.sortFlag == "equal") {
|
|
290
297
|
return false;
|
|
291
298
|
}
|
|
292
|
-
let
|
|
293
|
-
let element = refsDom[data.num_total_len - 1];
|
|
299
|
+
let element = numberItemRef.value[data.num_total_len - 1];
|
|
294
300
|
runTurn(element);
|
|
295
301
|
});
|
|
296
302
|
} else {
|
|
@@ -316,21 +322,21 @@ const _sfc_main = create({
|
|
|
316
322
|
}, props.during);
|
|
317
323
|
};
|
|
318
324
|
const runStep = (el) => {
|
|
319
|
-
let currentTurn = el.
|
|
325
|
+
let currentTurn = el.getAttribute("turn-number");
|
|
320
326
|
let turningNum;
|
|
321
327
|
if (data.sortFlag == "add") {
|
|
322
328
|
turningNum = parseInt(String(currentTurn)) + 1;
|
|
323
329
|
} else {
|
|
324
330
|
turningNum = parseInt(String(currentTurn)) - 1 >= 0 ? parseInt(String(currentTurn)) - 1 : 9;
|
|
325
331
|
}
|
|
326
|
-
el.
|
|
327
|
-
if (el.style.transition == "none" || turningNum == 1 || !el.style.transition) {
|
|
332
|
+
el.setAttribute("turn-number", String(turningNum));
|
|
333
|
+
if (el.style.transition == "none 0s ease 0s" || turningNum == 1 || !el.style.transition) {
|
|
328
334
|
el.style.transition = `all linear ${props.during}ms`;
|
|
329
335
|
}
|
|
330
336
|
if (turningNum == 10 || data.sortFlag == "reduce" && turningNum == 0) {
|
|
331
337
|
var timeOut = null;
|
|
332
338
|
el.style.top = `-${data.sortFlag == "add" ? turningNum * 100 : (10 - turningNum) * 100}%`;
|
|
333
|
-
el.
|
|
339
|
+
el.setAttribute("turn-number", "0");
|
|
334
340
|
timeOut = setTimeout(() => {
|
|
335
341
|
timeOut && clearTimeout(timeOut);
|
|
336
342
|
el.style.transition = "none";
|
|
@@ -353,8 +359,7 @@ const _sfc_main = create({
|
|
|
353
359
|
Math.pow(10, data.pointNum);
|
|
354
360
|
}
|
|
355
361
|
nextTick(() => {
|
|
356
|
-
|
|
357
|
-
f.addEventListener("webkitTransitionEnd", () => {
|
|
362
|
+
runNumberImg.value.addEventListener("webkitTransitionEnd", () => {
|
|
358
363
|
emit("scroll-end");
|
|
359
364
|
data.valFlag = false;
|
|
360
365
|
});
|
|
@@ -370,14 +375,14 @@ const _sfc_main = create({
|
|
|
370
375
|
}
|
|
371
376
|
};
|
|
372
377
|
const machineLuck = () => {
|
|
373
|
-
const
|
|
378
|
+
const machineTurnMoreNum = props.machineTurnMore < 0 ? 0 : props.machineTurnMore;
|
|
374
379
|
let distance = props.numHeight * props.machinePrizeNum;
|
|
375
380
|
if (data.prizeLevelTrun < 0) {
|
|
376
381
|
generateRandom();
|
|
377
382
|
}
|
|
378
383
|
for (let i = 0; i < props.machineNum; i++) {
|
|
379
384
|
setTimeout(() => {
|
|
380
|
-
let turn = distance * (i + 1 + parseFloat(String(
|
|
385
|
+
let turn = distance * (i + 1 + parseFloat(String(machineTurnMoreNum)));
|
|
381
386
|
if (data.prizeYPrev.length != 0) {
|
|
382
387
|
data.prizeY[i] = data.prizeYPrev[i];
|
|
383
388
|
}
|
|
@@ -395,16 +400,16 @@ const _sfc_main = create({
|
|
|
395
400
|
}
|
|
396
401
|
};
|
|
397
402
|
useExtend({ machineLuck });
|
|
398
|
-
const scrollTime = (
|
|
403
|
+
const scrollTime = (index2, total, num) => {
|
|
399
404
|
let t = setInterval(() => {
|
|
400
405
|
if (num <= total) {
|
|
401
406
|
num += 10;
|
|
402
|
-
data.prizeY[
|
|
407
|
+
data.prizeY[index2] = parseFloat(String(num));
|
|
403
408
|
} else {
|
|
404
409
|
clearInterval(t);
|
|
405
410
|
t = null;
|
|
406
411
|
data.finshMachine += 1;
|
|
407
|
-
data.prizeY[
|
|
412
|
+
data.prizeY[index2] = total;
|
|
408
413
|
if (data.finshMachine == props.machineNum) {
|
|
409
414
|
let distance = props.numHeight * props.machinePrizeNum;
|
|
410
415
|
data.prizeYPrev = [];
|
|
@@ -443,6 +448,8 @@ const _sfc_main = create({
|
|
|
443
448
|
return {
|
|
444
449
|
...toRefs(data),
|
|
445
450
|
...toRefs(reactive(props)),
|
|
451
|
+
runNumberImg,
|
|
452
|
+
setRef,
|
|
446
453
|
topNumber,
|
|
447
454
|
turnNumber
|
|
448
455
|
};
|
|
@@ -458,41 +465,41 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
458
465
|
class: "run-number-machine-img",
|
|
459
466
|
style: normalizeStyle({ height: _ctx.numHeight + "px" })
|
|
460
467
|
}, [
|
|
461
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.machineNum, (val,
|
|
468
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.machineNum, (val, index2) => {
|
|
462
469
|
return openBlock(), createElementBlock("view", {
|
|
463
470
|
class: "run-number-machine-img-li",
|
|
464
471
|
ref_for: true,
|
|
465
472
|
ref: "run-number-machine-img-li",
|
|
466
|
-
key: "mImg" +
|
|
473
|
+
key: "mImg" + index2,
|
|
467
474
|
style: normalizeStyle({
|
|
468
475
|
width: _ctx.numWidth + "px",
|
|
469
476
|
height: _ctx.numHeight + "px",
|
|
470
|
-
|
|
471
|
-
|
|
477
|
+
backgroundImage: "url(" + _ctx.customBgImg + ")",
|
|
478
|
+
backgroundPositionY: _ctx.prizeY[index2] + "px"
|
|
472
479
|
})
|
|
473
480
|
}, null, 4);
|
|
474
|
-
}), 128))
|
|
475
|
-
createTextVNode()
|
|
481
|
+
}), 128))
|
|
476
482
|
], 4)) : (openBlock(), createElementBlock("view", {
|
|
477
483
|
key: 1,
|
|
484
|
+
ref: "runNumberImg",
|
|
478
485
|
class: "run-number-img",
|
|
479
486
|
style: normalizeStyle({ height: _ctx.numHeight + "px" })
|
|
480
487
|
}, [
|
|
481
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.num_total_len, (val,
|
|
488
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.num_total_len, (val, index2) => {
|
|
482
489
|
return openBlock(), createElementBlock("view", {
|
|
483
490
|
class: "run-number-img-li",
|
|
484
|
-
key: "cImg" +
|
|
491
|
+
key: "cImg" + index2,
|
|
485
492
|
style: normalizeStyle({
|
|
486
493
|
width: _ctx.numWidth + "px",
|
|
487
494
|
height: _ctx.numHeight + "px",
|
|
488
|
-
left: _ctx.numWidth * (
|
|
495
|
+
left: _ctx.numWidth * (index2 > _ctx.num_total_len - _ctx.pointNum - 1 ? index2 == _ctx.num_total_len - _ctx.pointNum ? index2 * 1.5 : index2 * 1.3 : index2) + "px",
|
|
489
496
|
backgroundImage: "url(" + _ctx.customBgImg + ")",
|
|
490
|
-
|
|
497
|
+
backgroundPositionX: "0",
|
|
498
|
+
backgroundPositionY: -(String(_ctx.relNum)[index2] * _ctx.numHeight + _ctx.customSpacNum * String(_ctx.relNum)[index2]) + "px",
|
|
491
499
|
transition: "all linear " + _ctx.during / 10 + "ms"
|
|
492
500
|
})
|
|
493
501
|
}, null, 4);
|
|
494
502
|
}), 128)),
|
|
495
|
-
createTextVNode(),
|
|
496
503
|
_ctx.pointNum > 0 ? (openBlock(), createElementBlock("view", {
|
|
497
504
|
key: 0,
|
|
498
505
|
class: "pointstyl",
|
|
@@ -514,18 +521,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
514
521
|
lineHeight: _ctx.numHeight + "px"
|
|
515
522
|
})
|
|
516
523
|
}, [
|
|
517
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.num_total_len, (val,
|
|
524
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.num_total_len, (val, index2) => {
|
|
518
525
|
return openBlock(), createElementBlock("view", {
|
|
519
526
|
ref_for: true,
|
|
520
|
-
ref:
|
|
527
|
+
ref: _ctx.setRef,
|
|
521
528
|
class: "numberItem",
|
|
522
529
|
key: val,
|
|
523
530
|
style: normalizeStyle({
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
left: _ctx.numWidth * (index > _ctx.num_total_len - _ctx.pointNum - 1 ? index * 1.1 : index) + "px"
|
|
531
|
+
top: _ctx.topNumber(index2),
|
|
532
|
+
left: _ctx.numWidth * (index2 > _ctx.num_total_len - _ctx.pointNum - 1 ? index2 * 1.1 : index2) + "px"
|
|
527
533
|
}),
|
|
528
|
-
"turn-number": _ctx.turnNumber(
|
|
534
|
+
"turn-number": _ctx.turnNumber(index2)
|
|
529
535
|
}, [
|
|
530
536
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.to0_10, (item, idx) => {
|
|
531
537
|
return openBlock(), createElementBlock("view", {
|
|
@@ -540,7 +546,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
540
546
|
}), 128))
|
|
541
547
|
], 12, _hoisted_2);
|
|
542
548
|
}), 128)),
|
|
543
|
-
createTextVNode(),
|
|
544
549
|
_ctx.pointNum > 0 ? (openBlock(), createElementBlock("view", {
|
|
545
550
|
key: 0,
|
|
546
551
|
class: "pointstyl",
|
|
@@ -558,5 +563,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
558
563
|
], 64))
|
|
559
564
|
]);
|
|
560
565
|
}
|
|
561
|
-
var
|
|
562
|
-
export {
|
|
566
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
567
|
+
export { index as default };
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6
|
|
2
|
+
* @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { reactive, computed, onBeforeMount, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, renderSlot
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
6
|
+
import { reactive, computed, onBeforeMount, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, renderSlot } from "vue";
|
|
7
|
+
import Picker from "./Picker.js";
|
|
8
|
+
import { popupProps } from "./Popup.js";
|
|
9
9
|
import { c as createComponent } from "./component.js";
|
|
10
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
|
-
import "./
|
|
12
|
-
import "./use-lock-scroll.js";
|
|
11
|
+
import "./index4.js";
|
|
13
12
|
import "./OverLay.js";
|
|
14
13
|
import "../locale/lang";
|
|
15
14
|
import "./Icon.js";
|
|
16
15
|
import "./pxCheck.js";
|
|
17
|
-
import "./index3.js";
|
|
18
|
-
import "./index.js";
|
|
19
|
-
import "@tarojs/taro";
|
|
20
16
|
function padZero(num, targetLength = 2) {
|
|
21
17
|
let str = num + "";
|
|
22
18
|
while (str.length < targetLength) {
|
|
@@ -24,22 +20,22 @@ function padZero(num, targetLength = 2) {
|
|
|
24
20
|
}
|
|
25
21
|
return str;
|
|
26
22
|
}
|
|
27
|
-
const { componentName, create } = createComponent("datepicker");
|
|
23
|
+
const { componentName, create, translate } = createComponent("datepicker");
|
|
28
24
|
const currentYear = new Date().getFullYear();
|
|
29
25
|
function isDate(val) {
|
|
30
26
|
return Object.prototype.toString.call(val) === "[object Date]" && !isNaN(val.getTime());
|
|
31
27
|
}
|
|
32
28
|
const zhCNType = {
|
|
33
|
-
day: "
|
|
34
|
-
year: "
|
|
35
|
-
month: "
|
|
36
|
-
hour: "
|
|
37
|
-
minute: "
|
|
38
|
-
seconds: "
|
|
29
|
+
day: translate("day"),
|
|
30
|
+
year: translate("year"),
|
|
31
|
+
month: translate("month"),
|
|
32
|
+
hour: translate("hour"),
|
|
33
|
+
minute: translate("minute"),
|
|
34
|
+
seconds: translate("seconds")
|
|
39
35
|
};
|
|
40
36
|
const _sfc_main = create({
|
|
41
37
|
components: {
|
|
42
|
-
|
|
38
|
+
[Picker.name]: Picker
|
|
43
39
|
},
|
|
44
40
|
props: {
|
|
45
41
|
...popupProps,
|
|
@@ -92,7 +88,7 @@ const _sfc_main = create({
|
|
|
92
88
|
},
|
|
93
89
|
filter: Function
|
|
94
90
|
},
|
|
95
|
-
emits: ["click", "update:visible", "change", "confirm", "update:
|
|
91
|
+
emits: ["click", "update:visible", "change", "confirm", "update:modelValue"],
|
|
96
92
|
setup(props, { emit }) {
|
|
97
93
|
const state = reactive({
|
|
98
94
|
show: props.visible,
|
|
@@ -115,12 +111,12 @@ const _sfc_main = create({
|
|
|
115
111
|
const boundary = props[`${type}Date`];
|
|
116
112
|
const year = boundary.getFullYear();
|
|
117
113
|
let month = 1;
|
|
118
|
-
let
|
|
114
|
+
let day = 1;
|
|
119
115
|
let hour = 0;
|
|
120
116
|
let minute = 0;
|
|
121
117
|
if (type === "max") {
|
|
122
118
|
month = 12;
|
|
123
|
-
|
|
119
|
+
day = getMonthEndDay(value.getFullYear(), value.getMonth() + 1);
|
|
124
120
|
hour = 23;
|
|
125
121
|
minute = 59;
|
|
126
122
|
}
|
|
@@ -128,27 +124,36 @@ const _sfc_main = create({
|
|
|
128
124
|
if (value.getFullYear() === year) {
|
|
129
125
|
month = boundary.getMonth() + 1;
|
|
130
126
|
if (value.getMonth() + 1 === month) {
|
|
131
|
-
|
|
132
|
-
if (value.getDate() ===
|
|
127
|
+
day = boundary.getDate();
|
|
128
|
+
if (value.getDate() === day) {
|
|
133
129
|
hour = boundary.getHours();
|
|
134
130
|
if (value.getHours() === hour) {
|
|
135
131
|
minute = boundary.getMinutes();
|
|
136
132
|
}
|
|
137
133
|
}
|
|
138
134
|
}
|
|
135
|
+
} else {
|
|
136
|
+
return {
|
|
137
|
+
[`${type}Year`]: year,
|
|
138
|
+
[`${type}Month`]: month,
|
|
139
|
+
[`${type}Day`]: day,
|
|
140
|
+
[`${type}Hour`]: hour,
|
|
141
|
+
[`${type}Minute`]: minute,
|
|
142
|
+
[`${type}Seconds`]: seconds
|
|
143
|
+
};
|
|
139
144
|
}
|
|
140
145
|
return {
|
|
141
146
|
[`${type}Year`]: year,
|
|
142
147
|
[`${type}Month`]: month,
|
|
143
|
-
[`${type}
|
|
148
|
+
[`${type}Day`]: day,
|
|
144
149
|
[`${type}Hour`]: hour,
|
|
145
150
|
[`${type}Minute`]: minute,
|
|
146
151
|
[`${type}Seconds`]: seconds
|
|
147
152
|
};
|
|
148
153
|
};
|
|
149
154
|
const ranges = computed(() => {
|
|
150
|
-
const { maxYear,
|
|
151
|
-
const { minYear,
|
|
155
|
+
const { maxYear, maxDay, maxMonth, maxHour, maxMinute, maxSeconds } = getBoundary("max", state.currentDate);
|
|
156
|
+
const { minYear, minDay, minMonth, minHour, minMinute, minSeconds } = getBoundary("min", state.currentDate);
|
|
152
157
|
let result = [
|
|
153
158
|
{
|
|
154
159
|
type: "year",
|
|
@@ -160,7 +165,7 @@ const _sfc_main = create({
|
|
|
160
165
|
},
|
|
161
166
|
{
|
|
162
167
|
type: "day",
|
|
163
|
-
range: [
|
|
168
|
+
range: [minDay, maxDay]
|
|
164
169
|
},
|
|
165
170
|
{
|
|
166
171
|
type: "hour",
|
|
@@ -213,11 +218,11 @@ const _sfc_main = create({
|
|
|
213
218
|
selectedValue.forEach((item) => {
|
|
214
219
|
formatDate.push(item);
|
|
215
220
|
});
|
|
216
|
-
if (props.type == "month-day") {
|
|
217
|
-
formatDate.unshift(new Date(
|
|
221
|
+
if (props.type == "month-day" && formatDate.length < 3) {
|
|
222
|
+
formatDate.unshift(new Date(state.currentDate || props.minDate || props.maxDate).getFullYear());
|
|
218
223
|
}
|
|
219
224
|
if (props.type == "year-month" && formatDate.length < 3) {
|
|
220
|
-
formatDate.push(new Date(
|
|
225
|
+
formatDate.push(new Date(state.currentDate || props.minDate || props.maxDate).getDate());
|
|
221
226
|
}
|
|
222
227
|
const year = Number(formatDate[0]);
|
|
223
228
|
const month = Number(formatDate[1]) - 1;
|
|
@@ -248,7 +253,7 @@ const _sfc_main = create({
|
|
|
248
253
|
};
|
|
249
254
|
const generateValue = (min, max, val, type, columnIndex) => {
|
|
250
255
|
const arr = [];
|
|
251
|
-
let
|
|
256
|
+
let index2 = 0;
|
|
252
257
|
while (min <= max) {
|
|
253
258
|
arr.push(formatterOption(type, min));
|
|
254
259
|
if (type === "minute") {
|
|
@@ -257,10 +262,10 @@ const _sfc_main = create({
|
|
|
257
262
|
min++;
|
|
258
263
|
}
|
|
259
264
|
if (min <= val) {
|
|
260
|
-
|
|
265
|
+
index2++;
|
|
261
266
|
}
|
|
262
267
|
}
|
|
263
|
-
state.selectedValue[columnIndex] = arr[
|
|
268
|
+
state.selectedValue[columnIndex] = arr[index2].value;
|
|
264
269
|
return props.filter ? props.filter(type, arr) : arr;
|
|
265
270
|
};
|
|
266
271
|
const getDateIndex = (type) => {
|
|
@@ -287,13 +292,25 @@ const _sfc_main = create({
|
|
|
287
292
|
emit("confirm", val);
|
|
288
293
|
};
|
|
289
294
|
onBeforeMount(() => {
|
|
290
|
-
console.log("\u5E73\u94FA\u5C55\u793A");
|
|
291
295
|
state.currentDate = formatValue(props.modelValue);
|
|
292
296
|
});
|
|
293
297
|
watch(
|
|
294
298
|
() => props.modelValue,
|
|
295
299
|
(value) => {
|
|
296
|
-
|
|
300
|
+
const newValues = formatValue(value);
|
|
301
|
+
const isSameValue = JSON.stringify(newValues) === JSON.stringify(state.currentDate);
|
|
302
|
+
if (!isSameValue) {
|
|
303
|
+
state.currentDate = newValues;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
watch(
|
|
308
|
+
() => state.currentDate,
|
|
309
|
+
(newValues) => {
|
|
310
|
+
const isSameValue = JSON.stringify(newValues) === JSON.stringify(props.modelValue);
|
|
311
|
+
if (!isSameValue) {
|
|
312
|
+
emit("update:modelValue", newValues);
|
|
313
|
+
}
|
|
297
314
|
}
|
|
298
315
|
);
|
|
299
316
|
watch(
|
|
@@ -323,6 +340,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
323
340
|
modelValue: _ctx.selectedValue,
|
|
324
341
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.selectedValue = $event),
|
|
325
342
|
visible: _ctx.show,
|
|
343
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.show = $event),
|
|
326
344
|
okText: _ctx.okText,
|
|
327
345
|
cancelText: _ctx.cancelText,
|
|
328
346
|
onClose: _ctx.closeHandler,
|
|
@@ -340,11 +358,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
340
358
|
renderSlot(_ctx.$slots, "top")
|
|
341
359
|
]),
|
|
342
360
|
default: withCtx(() => [
|
|
343
|
-
createTextVNode(),
|
|
344
361
|
renderSlot(_ctx.$slots, "default")
|
|
345
362
|
]),
|
|
346
363
|
_: 3
|
|
347
364
|
}, 8, ["modelValue", "visible", "okText", "cancelText", "onClose", "columns", "onChange", "title", "onConfirm", "isWrapTeleport", "threeDimensional", "swipeDuration", "safeAreaInsetBottom", "destroyOnClose"]);
|
|
348
365
|
}
|
|
349
|
-
var
|
|
350
|
-
export {
|
|
366
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
367
|
+
export { index as default };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6
|
|
2
|
+
* @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent } from "vue";
|
|
6
|
+
import { ref, onMounted, watch, computed, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, createElementBlock, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode, resolveDynamicComponent, createVNode, render, h } from "vue";
|
|
7
7
|
import { i as isPromise, c as createComponent } from "./component.js";
|
|
8
8
|
import Popup, { popupProps } from "./Popup.js";
|
|
9
9
|
import Button from "./Button.js";
|
|
10
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
11
11
|
import "../locale/lang";
|
|
12
|
-
import "./use-lock-scroll.js";
|
|
13
12
|
import "./OverLay.js";
|
|
14
13
|
import "./Icon.js";
|
|
15
14
|
import "./pxCheck.js";
|
|
@@ -133,8 +132,8 @@ const _sfc_main = create({
|
|
|
133
132
|
}
|
|
134
133
|
};
|
|
135
134
|
const onOk = () => {
|
|
136
|
-
closed("ok");
|
|
137
135
|
emit("ok");
|
|
136
|
+
closed("ok");
|
|
138
137
|
};
|
|
139
138
|
return {
|
|
140
139
|
closed,
|
|
@@ -177,7 +176,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
177
176
|
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
178
177
|
], 64))
|
|
179
178
|
])) : createCommentVNode("", true),
|
|
180
|
-
createTextVNode(),
|
|
181
179
|
createElementVNode("view", {
|
|
182
180
|
class: "nut-dialog__content",
|
|
183
181
|
style: normalizeStyle({ textAlign: _ctx.textAlign })
|
|
@@ -187,7 +185,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
187
185
|
innerHTML: _ctx.content
|
|
188
186
|
}, null, 8, _hoisted_2)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.content), { key: 2 }))
|
|
189
187
|
], 4),
|
|
190
|
-
createTextVNode(),
|
|
191
188
|
!_ctx.noFooter ? (openBlock(), createElementBlock("view", {
|
|
192
189
|
key: 1,
|
|
193
190
|
class: normalizeClass(["nut-dialog__footer", { [_ctx.footerDirection]: _ctx.footerDirection }])
|
|
@@ -206,7 +203,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
206
203
|
]),
|
|
207
204
|
_: 1
|
|
208
205
|
}, 8, ["onClick"])) : createCommentVNode("", true),
|
|
209
|
-
createTextVNode(),
|
|
210
206
|
!_ctx.noOkBtn ? (openBlock(), createBlock(_component_nut_button, {
|
|
211
207
|
key: 1,
|
|
212
208
|
size: "small",
|
|
@@ -226,5 +222,88 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
226
222
|
_: 3
|
|
227
223
|
}, 8, ["teleport", "visible", "close-on-click-overlay", "lock-scroll", "pop-class", "style", "overlay-class", "overlay-style", "onClickOverlay", "onClickCloseIcon"]);
|
|
228
224
|
}
|
|
229
|
-
var
|
|
230
|
-
|
|
225
|
+
var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
226
|
+
class DialogOptions {
|
|
227
|
+
constructor() {
|
|
228
|
+
this.title = "";
|
|
229
|
+
this.content = "";
|
|
230
|
+
this.cancelText = "";
|
|
231
|
+
this.okText = "";
|
|
232
|
+
this.textAlign = "center";
|
|
233
|
+
this.customClass = "";
|
|
234
|
+
this.overlayStyle = {};
|
|
235
|
+
this.overlayClass = "";
|
|
236
|
+
this.popStyle = {};
|
|
237
|
+
this.popClass = "";
|
|
238
|
+
this.teleport = "body";
|
|
239
|
+
this.id = new Date().getTime();
|
|
240
|
+
this.footerDirection = "horizontal";
|
|
241
|
+
this.onUpdate = (value) => {
|
|
242
|
+
};
|
|
243
|
+
this.onOk = () => {
|
|
244
|
+
};
|
|
245
|
+
this.onCancel = () => {
|
|
246
|
+
};
|
|
247
|
+
this.onOpened = () => {
|
|
248
|
+
};
|
|
249
|
+
this.onClosed = () => {
|
|
250
|
+
};
|
|
251
|
+
this.visible = true;
|
|
252
|
+
this.noFooter = false;
|
|
253
|
+
this.noOkBtn = false;
|
|
254
|
+
this.noCancelBtn = false;
|
|
255
|
+
this.okBtnDisabled = false;
|
|
256
|
+
this.closeOnPopstate = false;
|
|
257
|
+
this.lockScroll = false;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
class DialogFunction {
|
|
261
|
+
constructor(_options) {
|
|
262
|
+
this.options = new DialogOptions();
|
|
263
|
+
this.close = () => {
|
|
264
|
+
};
|
|
265
|
+
this.setDefaultOptions = (options2) => {
|
|
266
|
+
};
|
|
267
|
+
this.resetDefaultOptions = () => {
|
|
268
|
+
};
|
|
269
|
+
let options = Object.assign(this.options, _options);
|
|
270
|
+
let elWarp = document.body;
|
|
271
|
+
let teleport = options.teleport;
|
|
272
|
+
if (teleport != "body") {
|
|
273
|
+
if (typeof teleport == "string") {
|
|
274
|
+
elWarp = document.querySelector(teleport);
|
|
275
|
+
} else {
|
|
276
|
+
elWarp = options.teleport;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const root = document.createElement("view");
|
|
280
|
+
root.id = "dialog-" + options.id;
|
|
281
|
+
const Wrapper = {
|
|
282
|
+
setup() {
|
|
283
|
+
options.onUpdate = (val) => {
|
|
284
|
+
if (val == false) {
|
|
285
|
+
elWarp.removeChild(root);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
if (options == null ? void 0 : options.onOpened) {
|
|
289
|
+
options == null ? void 0 : options.onOpened();
|
|
290
|
+
}
|
|
291
|
+
options.teleport = `#${root.id}`;
|
|
292
|
+
return () => {
|
|
293
|
+
return h(Dialog, options);
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
this.instance = createVNode(Wrapper);
|
|
298
|
+
elWarp.appendChild(root);
|
|
299
|
+
render(this.instance, root);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
const _Dialog = function(options) {
|
|
303
|
+
return new DialogFunction(options);
|
|
304
|
+
};
|
|
305
|
+
_Dialog.install = (app) => {
|
|
306
|
+
app.use(Dialog);
|
|
307
|
+
app.config.globalProperties.$dialog = _Dialog;
|
|
308
|
+
};
|
|
309
|
+
export { Dialog, DialogOptions, _Dialog as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.6
|
|
2
|
+
* @nutui/nutui v3.2.6 Fri Nov 04 2022 18:06:53 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -66,5 +66,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
66
66
|
class: normalizeClass(_ctx.classes)
|
|
67
67
|
}, null, 2));
|
|
68
68
|
}
|
|
69
|
-
var
|
|
70
|
-
export {
|
|
69
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
70
|
+
export { index as default };
|