@nutui/nutui 3.1.19-beta.1 → 3.1.19-beta.4
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/README.md +9 -8
- package/dist/nutui.es.js +3044 -3533
- package/dist/nutui.umd.js +3135 -3536
- package/dist/packages/_es/ActionSheet.js +64 -42
- package/dist/packages/_es/Address.js +69 -78
- package/dist/packages/_es/Audio.js +12 -12
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +3 -3
- package/dist/packages/_es/BackTop.js +110 -68
- package/dist/packages/_es/Badge.js +3 -3
- package/dist/packages/_es/Barrage.js +55 -62
- package/dist/packages/_es/Button.js +2 -2
- package/dist/packages/_es/Calendar.js +27 -32
- package/dist/packages/_es/CalendarItem.js +3 -3
- package/dist/packages/_es/Card.js +5 -6
- package/dist/packages/_es/Cascader.js +9 -9
- package/dist/packages/_es/Cell.js +11 -4
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +13 -3
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- package/dist/packages/_es/CircleProgress.js +40 -149
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +8 -34
- package/dist/packages/_es/CollapseItem.js +59 -90
- package/dist/packages/_es/CountDown.js +11 -10
- package/dist/packages/_es/CountUp.js +51 -43
- package/dist/packages/_es/DatePicker.js +22 -23
- package/dist/packages/_es/Dialog.js +91 -12
- package/dist/packages/_es/Divider.js +4 -4
- package/dist/packages/_es/Drag.js +54 -92
- package/dist/packages/_es/Ecard.js +153 -0
- package/dist/packages/_es/Elevator.js +50 -75
- package/dist/packages/_es/Empty.js +8 -7
- package/dist/packages/_es/FixedNav.js +10 -11
- package/dist/packages/_es/Form.js +5 -9
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +26 -8
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/ImagePreview.js +83 -14
- package/dist/packages/_es/Indicator.js +3 -3
- package/dist/packages/_es/InfiniteLoading.js +107 -93
- package/dist/packages/_es/Input.js +21 -20
- package/dist/packages/_es/InputNumber.js +16 -23
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +34 -41
- package/dist/packages/_es/Menu.js +12 -15
- package/dist/packages/_es/MenuItem.js +7 -7
- package/dist/packages/_es/Navbar.js +5 -4
- package/dist/packages/_es/NoticeBar.js +40 -47
- package/dist/packages/_es/Notify.js +166 -27
- package/dist/packages/_es/NumberKeyboard.js +22 -11
- package/dist/packages/_es/OldPicker.js +120 -122
- package/dist/packages/_es/OverLay.js +25 -5
- package/dist/packages/_es/Pagination.js +14 -13
- package/dist/packages/_es/Picker.js +23 -45
- package/dist/packages/_es/Popover.js +29 -154
- package/dist/packages/_es/Popup.js +69 -6
- package/dist/packages/_es/Price.js +5 -17
- package/dist/packages/_es/Progress.js +23 -19
- package/dist/packages/_es/PullRefresh.js +1 -1
- package/dist/packages/_es/Radio.js +14 -4
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +33 -46
- package/dist/packages/_es/Rate.js +19 -16
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +11 -12
- package/dist/packages/_es/ShortPassword.js +75 -96
- package/dist/packages/_es/SideNavBar.js +16 -5
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +88 -69
- package/dist/packages/_es/Skeleton.js +11 -8
- package/dist/packages/_es/Sku.js +57 -49
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +23 -28
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +26 -39
- package/dist/packages/_es/Swiper.js +14 -32
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +3 -3
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +3 -3
- package/dist/packages/_es/TabbarItem.js +21 -11
- package/dist/packages/_es/Table.js +18 -17
- package/dist/packages/_es/Tabs.js +20 -21
- package/dist/packages/_es/Tag.js +4 -4
- package/dist/packages/_es/TextArea.js +47 -48
- package/dist/packages/_es/TimeDetail.js +3 -4
- package/dist/packages/_es/TimePannel.js +3 -3
- package/dist/packages/_es/TimeSelect.js +7 -8
- package/dist/packages/_es/Toast.js +170 -41
- package/dist/packages/_es/Uploader.js +145 -116
- package/dist/packages/_es/Video.js +9 -8
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +165 -3
- package/dist/packages/_es/index.js +6 -44
- package/dist/packages/_es/index2.js +31 -8
- package/dist/packages/_es/index3.js +7 -58
- package/dist/packages/_es/index4.js +56 -413
- package/dist/packages/_es/{index.taro.js → index5.js} +113 -140
- 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 +19 -0
- package/dist/packages/actionsheet/index.scss +8 -0
- package/dist/packages/ecard/index.scss +83 -0
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +48 -47
- package/dist/styles/themes/jdt.scss +48 -47
- package/dist/styles/variables-jdt.scss +3 -0
- package/dist/styles/variables.scss +3 -0
- package/dist/types/__VUE/actionsheet/index.d.ts +280 -0
- package/dist/types/__VUE/address/index.d.ts +386 -0
- package/dist/types/__VUE/audio/index.d.ts +92 -0
- package/dist/types/__VUE/audiooperate/index.d.ts +68 -0
- package/dist/types/__VUE/avatar/index.d.ts +66 -0
- package/dist/types/__VUE/backtop/index.d.ts +105 -0
- package/dist/types/__VUE/badge/index.d.ts +94 -0
- package/dist/types/__VUE/barrage/index.d.ts +80 -0
- package/dist/types/__VUE/button/index.d.ts +116 -0
- package/dist/types/__VUE/calendar/index.d.ts +155 -0
- package/dist/types/__VUE/calendaritem/index.d.ts +195 -0
- package/dist/types/__VUE/card/index.d.ts +81 -0
- package/dist/types/__VUE/cascader/cascader-item.d.ts +76 -0
- package/dist/types/__VUE/cascader/helper.d.ts +8 -0
- package/dist/types/__VUE/cascader/index.d.ts +76 -0
- package/dist/types/__VUE/cascader/tree.d.ts +17 -0
- package/dist/types/__VUE/cascader/types.d.ts +30 -0
- package/dist/types/__VUE/cell/index.d.ts +109 -0
- package/dist/types/__VUE/cellgroup/index.d.ts +38 -0
- package/dist/types/__VUE/checkbox/index.d.ts +102 -0
- package/dist/types/__VUE/checkboxgroup/index.d.ts +39 -0
- package/dist/types/__VUE/circleprogress/index.d.ts +66 -0
- package/dist/types/__VUE/col/index.d.ts +42 -0
- package/dist/types/__VUE/collapse/index.d.ts +104 -0
- package/dist/types/__VUE/collapseitem/index.d.ts +83 -0
- package/dist/types/__VUE/countdown/index.d.ts +91 -0
- package/dist/types/__VUE/countup/index.d.ts +216 -0
- package/dist/types/__VUE/datepicker/index.d.ts +347 -0
- package/dist/types/__VUE/datepicker/utils.d.ts +5 -0
- package/dist/types/__VUE/dialog/index.d.ts +306 -0
- package/dist/types/__VUE/divider/index.d.ts +47 -0
- package/dist/types/__VUE/drag/index.d.ts +61 -0
- package/dist/types/__VUE/ecard/index.d.ts +123 -0
- package/dist/types/__VUE/elevator/index.d.ts +71 -0
- package/dist/types/__VUE/empty/index.d.ts +47 -0
- package/dist/types/__VUE/fixednav/index.d.ts +96 -0
- package/dist/types/__VUE/form/common.d.ts +20 -0
- package/dist/types/__VUE/form/index.d.ts +32 -0
- package/dist/types/__VUE/form/types.d.ts +13 -0
- package/dist/types/__VUE/formitem/index.d.ts +120 -0
- package/dist/types/__VUE/formitem/types.d.ts +10 -0
- package/dist/types/__VUE/grid/common.d.ts +91 -0
- package/dist/types/__VUE/grid/index.d.ts +100 -0
- package/dist/types/__VUE/griditem/index.d.ts +80 -0
- package/dist/types/__VUE/icon/index.d.ts +74 -0
- package/dist/types/__VUE/imagepreview/index.d.ts +125 -0
- package/dist/types/__VUE/indicator/index.d.ts +70 -0
- package/dist/types/__VUE/infiniteloading/index.d.ts +140 -0
- package/dist/types/__VUE/input/index.d.ts +337 -0
- package/dist/types/__VUE/input/util.d.ts +5 -0
- package/dist/types/__VUE/inputnumber/index.d.ts +117 -0
- package/dist/types/__VUE/layout/index.d.ts +13 -0
- package/dist/types/__VUE/list/index.d.ts +48 -0
- package/dist/types/__VUE/menu/index.d.ts +51 -0
- package/dist/types/__VUE/menuitem/index.d.ts +77 -0
- package/dist/types/__VUE/navbar/index.d.ts +83 -0
- package/dist/types/__VUE/noticebar/index.d.ts +209 -0
- package/dist/types/__VUE/notify/index.d.ts +103 -0
- package/dist/types/__VUE/numberkeyboard/index.d.ts +124 -0
- package/dist/types/__VUE/oldpicker/Column.d.ts +96 -0
- package/dist/types/__VUE/oldpicker/commonProps.d.ts +22 -0
- package/dist/types/__VUE/oldpicker/index.d.ts +360 -0
- package/dist/types/__VUE/oldpicker/types.d.ts +24 -0
- package/dist/types/__VUE/overlay/index.d.ts +1614 -0
- package/dist/types/__VUE/pagination/index.d.ts +112 -0
- package/dist/types/__VUE/picker/Column.d.ts +90 -0
- package/dist/types/__VUE/picker/index.d.ts +343 -0
- package/dist/types/__VUE/picker/types.d.ts +26 -0
- package/dist/types/__VUE/popover/index.d.ts +233 -0
- package/dist/types/__VUE/popup/index.d.ts +1734 -0
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +5 -0
- package/dist/types/__VUE/price/index.d.ts +87 -0
- package/dist/types/__VUE/progress/index.d.ts +138 -0
- package/dist/types/__VUE/pullrefresh/index.d.ts +128 -0
- package/dist/types/__VUE/pullrefresh/use-touch.d.ts +20 -0
- package/dist/types/__VUE/pullrefresh/util.d.ts +6 -0
- package/dist/types/__VUE/radio/index.d.ts +90 -0
- package/dist/types/__VUE/radiogroup/index.d.ts +48 -0
- package/dist/types/__VUE/range/index.d.ts +156 -0
- package/dist/types/__VUE/rate/index.d.ts +142 -0
- package/dist/types/__VUE/row/index.d.ts +63 -0
- package/dist/types/__VUE/searchbar/index.d.ts +100 -0
- package/dist/types/__VUE/shortpassword/index.d.ts +137 -0
- package/dist/types/__VUE/sidenavbar/index.d.ts +36 -0
- package/dist/types/__VUE/sidenavbaritem/index.d.ts +41 -0
- package/dist/types/__VUE/signature/index.d.ts +73 -0
- package/dist/types/__VUE/skeleton/common.d.ts +63 -0
- package/dist/types/__VUE/skeleton/index.d.ts +117 -0
- package/dist/types/__VUE/sku/components/SkuHeader.d.ts +27 -0
- package/dist/types/__VUE/sku/components/SkuOperate.d.ts +70 -0
- package/dist/types/__VUE/sku/components/SkuSelect.d.ts +30 -0
- package/dist/types/__VUE/sku/components/SkuStepper.d.ts +67 -0
- package/dist/types/__VUE/sku/index.d.ts +300 -0
- package/dist/types/__VUE/step/index.d.ts +70 -0
- package/dist/types/__VUE/steps/index.d.ts +47 -0
- package/dist/types/__VUE/sticky/index.d.ts +63 -0
- package/dist/types/__VUE/subsidenavbar/index.d.ts +54 -0
- package/dist/types/__VUE/swipe/index.d.ts +69 -0
- package/dist/types/__VUE/swiper/index.d.ts +163 -0
- package/dist/types/__VUE/swiper/use-touch.d.ts +20 -0
- package/dist/types/__VUE/swiperitem/index.d.ts +24 -0
- package/dist/types/__VUE/switch/index.d.ts +136 -0
- package/dist/types/__VUE/tabbar/index.d.ts +84 -0
- package/dist/types/__VUE/tabbaritem/index.d.ts +108 -0
- package/dist/types/__VUE/table/common.d.ts +55 -0
- package/dist/types/__VUE/table/index.d.ts +76 -0
- package/dist/types/__VUE/table/renderColumn.d.ts +20 -0
- package/dist/types/__VUE/table/types.d.ts +19 -0
- package/dist/types/__VUE/tabpane/index.d.ts +47 -0
- package/dist/types/__VUE/tabs/index.d.ts +128 -0
- package/dist/types/__VUE/tag/index.d.ts +89 -0
- package/dist/types/__VUE/textarea/index.d.ts +121 -0
- package/dist/types/__VUE/timedetail/index.d.ts +48 -0
- package/dist/types/__VUE/timepannel/index.d.ts +43 -0
- package/dist/types/__VUE/timeselect/index.d.ts +82 -0
- package/dist/types/__VUE/toast/index.d.ts +149 -0
- package/dist/types/__VUE/uploader/index.d.ts +258 -0
- package/dist/types/__VUE/uploader/uploader.d.ts +25 -0
- package/dist/types/__VUE/video/index.d.ts +123 -0
- package/dist/{index.d.ts → types/index.d.ts} +0 -0
- package/dist/types/nutui.d.ts +93 -0
- package/package.json +14 -5
- package/dist/nutui.d.ts +0 -104
- package/dist/packages/_es/use-lock-scroll.js +0 -23
- package/dist/packages/_es/util.js +0 -47
|
@@ -18,47 +18,40 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.19-beta.
|
|
21
|
+
* @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, toRaw, resolveComponent,
|
|
25
|
+
import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, toRaw, resolveComponent, createVNode, withCtx } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { u as useTaroRect } from "./index.js";
|
|
28
|
-
import Taro from "@tarojs/taro";
|
|
29
27
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
|
-
import {
|
|
31
|
-
import "./
|
|
28
|
+
import Popup, { popupProps } from "./Popup.js";
|
|
29
|
+
import "./OverLay.js";
|
|
30
|
+
import "./Icon.js";
|
|
32
31
|
import "./pxCheck.js";
|
|
33
|
-
const commonProps = {
|
|
34
|
-
listData: {
|
|
35
|
-
type: Array,
|
|
36
|
-
default: () => {
|
|
37
|
-
return [];
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
readonly: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: false
|
|
43
|
-
},
|
|
44
|
-
defaultIndex: {
|
|
45
|
-
type: [Number, String],
|
|
46
|
-
default: 0
|
|
47
|
-
},
|
|
48
|
-
itemHeight: {
|
|
49
|
-
type: [Number, String],
|
|
50
|
-
default: 35
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
32
|
const { create: create$1 } = createComponent("oldpicker-column");
|
|
54
33
|
const _sfc_main$1 = create$1({
|
|
55
|
-
props:
|
|
34
|
+
props: {
|
|
56
35
|
dataType: String,
|
|
57
36
|
itemShow: {
|
|
58
37
|
type: Boolean,
|
|
59
38
|
default: false
|
|
39
|
+
},
|
|
40
|
+
listData: {
|
|
41
|
+
type: Object,
|
|
42
|
+
default: () => {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
readonly: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
defaultIndex: {
|
|
51
|
+
type: [Number, String],
|
|
52
|
+
default: 0
|
|
60
53
|
}
|
|
61
|
-
},
|
|
54
|
+
},
|
|
62
55
|
emits: ["click", "change"],
|
|
63
56
|
setup(props, { emit }) {
|
|
64
57
|
const wrapper = ref();
|
|
@@ -68,8 +61,7 @@ const _sfc_main$1 = create$1({
|
|
|
68
61
|
endY: 0,
|
|
69
62
|
startTime: 0,
|
|
70
63
|
endTime: 0,
|
|
71
|
-
lastY: 0
|
|
72
|
-
lastTime: 0
|
|
64
|
+
lastY: 0
|
|
73
65
|
},
|
|
74
66
|
currIndex: 1,
|
|
75
67
|
transformY: 0,
|
|
@@ -97,7 +89,6 @@ const _sfc_main$1 = create$1({
|
|
|
97
89
|
};
|
|
98
90
|
});
|
|
99
91
|
const onTouchStart = (event) => {
|
|
100
|
-
console.log(event);
|
|
101
92
|
event.preventDefault();
|
|
102
93
|
let changedTouches = event.changedTouches[0];
|
|
103
94
|
state.touchParams.startY = changedTouches.pageY;
|
|
@@ -116,7 +107,7 @@ const _sfc_main$1 = create$1({
|
|
|
116
107
|
event.preventDefault();
|
|
117
108
|
let changedTouches = event.changedTouches[0];
|
|
118
109
|
state.touchParams.lastY = changedTouches.pageY;
|
|
119
|
-
state.touchParams.lastTime = event.
|
|
110
|
+
state.touchParams.lastTime = event.timestamp || Date.now();
|
|
120
111
|
let move = state.touchParams.lastY - state.touchParams.startY;
|
|
121
112
|
let moveTime = state.touchParams.lastTime - state.touchParams.startTime;
|
|
122
113
|
if (moveTime <= 300) {
|
|
@@ -127,11 +118,11 @@ const _sfc_main$1 = create$1({
|
|
|
127
118
|
setMove(move, "end");
|
|
128
119
|
}
|
|
129
120
|
};
|
|
130
|
-
const setRollerStyle = (
|
|
131
|
-
return `transform: rotate3d(1, 0, 0, ${-state.rotation *
|
|
121
|
+
const setRollerStyle = (index2) => {
|
|
122
|
+
return `transform: rotate3d(1, 0, 0, ${-state.rotation * index2}deg) translate3d(0px, 0px, 104px)`;
|
|
132
123
|
};
|
|
133
|
-
const isHidden = (
|
|
134
|
-
if (
|
|
124
|
+
const isHidden = (index2) => {
|
|
125
|
+
if (index2 >= state.currIndex + 8 || index2 <= state.currIndex - 8) {
|
|
135
126
|
return true;
|
|
136
127
|
} else {
|
|
137
128
|
return false;
|
|
@@ -179,42 +170,25 @@ const _sfc_main$1 = create$1({
|
|
|
179
170
|
emit("change", state.currIndex - 1);
|
|
180
171
|
};
|
|
181
172
|
const modifyStatus = (type) => {
|
|
182
|
-
let
|
|
183
|
-
state.currIndex =
|
|
184
|
-
let move =
|
|
173
|
+
let index2 = props.defaultIndex;
|
|
174
|
+
state.currIndex = index2 === -1 ? 1 : index2 + 1;
|
|
175
|
+
let move = index2 === -1 ? 0 : index2 * state.lineSpacing;
|
|
185
176
|
type && setChooseValue();
|
|
186
177
|
setMove(-move);
|
|
187
178
|
};
|
|
188
|
-
const getReference = async () => {
|
|
189
|
-
const refe = await useTaroRect(list, Taro);
|
|
190
|
-
state.lineSpacing = refe.height / props.listData.values.length;
|
|
191
|
-
modifyStatus(true);
|
|
192
|
-
};
|
|
193
179
|
watch(() => props.listData, (val) => {
|
|
194
180
|
state.transformY = 0;
|
|
195
181
|
modifyStatus(false);
|
|
196
182
|
}, {
|
|
197
183
|
deep: true
|
|
198
184
|
});
|
|
199
|
-
watch(() => props.itemShow, (val) => {
|
|
200
|
-
if (val) {
|
|
201
|
-
setTimeout(() => {
|
|
202
|
-
getReference();
|
|
203
|
-
}, 200);
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
deep: true
|
|
207
|
-
});
|
|
208
185
|
watch(() => props.defaultIndex, (val) => {
|
|
209
186
|
state.transformY = 0;
|
|
210
187
|
modifyStatus(false);
|
|
211
188
|
});
|
|
212
189
|
onMounted(() => {
|
|
213
|
-
|
|
214
|
-
getReference();
|
|
215
|
-
}, 200);
|
|
190
|
+
modifyStatus(true);
|
|
216
191
|
});
|
|
217
|
-
const refRandomId = Math.random().toString(36).slice(-8);
|
|
218
192
|
return __spreadProps(__spreadValues(__spreadValues({}, toRefs(state)), toRefs(props)), {
|
|
219
193
|
wrapper,
|
|
220
194
|
setRollerStyle,
|
|
@@ -227,19 +201,17 @@ const _sfc_main$1 = create$1({
|
|
|
227
201
|
onTouchEnd,
|
|
228
202
|
touchRollerStyle,
|
|
229
203
|
touchListStyle,
|
|
230
|
-
|
|
204
|
+
setMove
|
|
231
205
|
});
|
|
232
206
|
}
|
|
233
207
|
});
|
|
234
208
|
const _hoisted_1$1 = { class: "nut-oldpicker-content" };
|
|
235
|
-
const _hoisted_2$1 =
|
|
236
|
-
const _hoisted_3$1 = {
|
|
209
|
+
const _hoisted_2$1 = {
|
|
237
210
|
key: 0,
|
|
238
211
|
class: "nut-oldpicker-placeholder"
|
|
239
212
|
};
|
|
240
213
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
241
|
-
return
|
|
242
|
-
key: 0,
|
|
214
|
+
return openBlock(), createElementBlock("view", {
|
|
243
215
|
class: "nut-oldpicker__list",
|
|
244
216
|
onTouchstart: _cache[0] || (_cache[0] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
|
|
245
217
|
onTouchmove: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
|
|
@@ -250,11 +222,11 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
250
222
|
ref: "roller",
|
|
251
223
|
style: normalizeStyle(_ctx.touchRollerStyle)
|
|
252
224
|
}, [
|
|
253
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item,
|
|
225
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item, index2) => {
|
|
254
226
|
return openBlock(), createElementBlock("view", {
|
|
255
|
-
class: normalizeClass(["nut-oldpicker-roller-item", { "nut-oldpicker-roller-item-hidden": _ctx.isHidden(
|
|
256
|
-
style: normalizeStyle(_ctx.setRollerStyle(
|
|
257
|
-
key: item.label ? item.label :
|
|
227
|
+
class: normalizeClass(["nut-oldpicker-roller-item", { "nut-oldpicker-roller-item-hidden": _ctx.isHidden(index2 + 1) }]),
|
|
228
|
+
style: normalizeStyle(_ctx.setRollerStyle(index2 + 1)),
|
|
229
|
+
key: item.label ? item.label : index2
|
|
258
230
|
}, toDisplayString(_ctx.dataType === "cascade" ? item.text : item), 7);
|
|
259
231
|
}), 128))
|
|
260
232
|
], 4),
|
|
@@ -262,27 +234,27 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
262
234
|
createElementVNode("view", {
|
|
263
235
|
class: "nut-oldpicker-list-panel",
|
|
264
236
|
ref: "list",
|
|
265
|
-
id: "list" + _ctx.refRandomId,
|
|
266
237
|
style: normalizeStyle(_ctx.touchListStyle)
|
|
267
238
|
}, [
|
|
268
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item,
|
|
239
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.listData.values, (item, index2) => {
|
|
269
240
|
return openBlock(), createElementBlock("view", {
|
|
270
241
|
class: "nut-oldpicker-item nut-oldpicker-item-ref",
|
|
271
|
-
key: item.label ? item.label :
|
|
242
|
+
key: item.label ? item.label : index2
|
|
272
243
|
}, toDisplayString(_ctx.dataType === "cascade" ? item.text : item), 1);
|
|
273
244
|
}), 128)),
|
|
274
|
-
_ctx.listData && _ctx.listData.length === 1 ? (openBlock(), createElementBlock("view",
|
|
275
|
-
],
|
|
245
|
+
_ctx.listData && _ctx.listData.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true)
|
|
246
|
+
], 4)
|
|
276
247
|
])
|
|
277
|
-
], 32)
|
|
248
|
+
], 32);
|
|
278
249
|
}
|
|
279
250
|
var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
280
251
|
const { create, componentName } = createComponent("oldpicker");
|
|
281
252
|
const _sfc_main = create({
|
|
282
253
|
components: {
|
|
283
|
-
[column.name]: column
|
|
254
|
+
[column.name]: column,
|
|
255
|
+
[Popup.name]: Popup
|
|
284
256
|
},
|
|
285
|
-
props:
|
|
257
|
+
props: __spreadProps(__spreadValues({}, popupProps), {
|
|
286
258
|
title: {
|
|
287
259
|
type: String,
|
|
288
260
|
default: ""
|
|
@@ -294,8 +266,22 @@ const _sfc_main = create({
|
|
|
294
266
|
okText: {
|
|
295
267
|
type: String,
|
|
296
268
|
default: "\u786E\u5B9A"
|
|
269
|
+
},
|
|
270
|
+
listData: {
|
|
271
|
+
type: Array,
|
|
272
|
+
default: () => {
|
|
273
|
+
return [];
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
readonly: {
|
|
277
|
+
type: Boolean,
|
|
278
|
+
default: false
|
|
279
|
+
},
|
|
280
|
+
defaultIndex: {
|
|
281
|
+
type: [Number, String],
|
|
282
|
+
default: 0
|
|
297
283
|
}
|
|
298
|
-
}),
|
|
284
|
+
}),
|
|
299
285
|
emits: ["close", "change", "confirm", "update:visible"],
|
|
300
286
|
setup(props, { emit }) {
|
|
301
287
|
const childrenKey = "children";
|
|
@@ -410,6 +396,14 @@ const _sfc_main = create({
|
|
|
410
396
|
}
|
|
411
397
|
emit("update:visible", false);
|
|
412
398
|
};
|
|
399
|
+
onMounted(() => {
|
|
400
|
+
if (props.visible)
|
|
401
|
+
state.show = props.visible;
|
|
402
|
+
});
|
|
403
|
+
onBeforeUnmount(() => {
|
|
404
|
+
if (props.visible)
|
|
405
|
+
state.show = false;
|
|
406
|
+
});
|
|
413
407
|
watch(() => props.visible, (val) => {
|
|
414
408
|
state.show = val;
|
|
415
409
|
});
|
|
@@ -435,52 +429,56 @@ const _hoisted_4 = /* @__PURE__ */ createElementVNode("view", { class: "nut-oldp
|
|
|
435
429
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
436
430
|
const _component_nut_oldpicker_column = resolveComponent("nut-oldpicker-column");
|
|
437
431
|
const _component_nut_popup = resolveComponent("nut-popup");
|
|
438
|
-
return openBlock(),
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
432
|
+
return openBlock(), createElementBlock("view", {
|
|
433
|
+
class: normalizeClass(_ctx.classes)
|
|
434
|
+
}, [
|
|
435
|
+
createVNode(_component_nut_popup, {
|
|
436
|
+
position: "bottom",
|
|
437
|
+
visible: _ctx.show,
|
|
438
|
+
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => _ctx.show = $event),
|
|
439
|
+
teleport: _ctx.teleport,
|
|
440
|
+
"lock-scroll": _ctx.lockScroll,
|
|
441
|
+
"close-on-click-overlay": _ctx.closeOnClickOverlay,
|
|
442
|
+
onClose: _ctx.close,
|
|
443
|
+
round: true,
|
|
444
|
+
isWrapTeleport: _ctx.isWrapTeleport
|
|
445
|
+
}, {
|
|
446
|
+
default: withCtx(() => [
|
|
447
|
+
createElementVNode("view", _hoisted_1, [
|
|
448
|
+
createElementVNode("view", {
|
|
449
|
+
class: "nut-oldpicker__cancel nut-oldpicker__left nut-oldpicker__button",
|
|
450
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
|
|
451
|
+
}, toDisplayString(_ctx.cancelText), 1),
|
|
452
|
+
createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
|
|
453
|
+
createElementVNode("view", {
|
|
454
|
+
class: "nut-oldpicker__confirm nut-oldpicker__button nut-oldpicker__right",
|
|
455
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirm())
|
|
456
|
+
}, toDisplayString(_ctx.okText), 1)
|
|
457
|
+
]),
|
|
458
|
+
createElementVNode("view", _hoisted_3, [
|
|
459
|
+
_hoisted_4,
|
|
460
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columnList, (item, columnIndex) => {
|
|
461
|
+
return openBlock(), createElementBlock("view", {
|
|
462
|
+
class: "nut-oldpicker__columnitem",
|
|
463
|
+
key: columnIndex
|
|
464
|
+
}, [
|
|
465
|
+
createVNode(_component_nut_oldpicker_column, {
|
|
466
|
+
itemShow: _ctx.show,
|
|
467
|
+
"list-data": item,
|
|
468
|
+
readonly: _ctx.readonly,
|
|
469
|
+
"default-index": item.defaultIndex,
|
|
470
|
+
"data-type": _ctx.dataType,
|
|
471
|
+
onChange: (dataIndex) => {
|
|
472
|
+
_ctx.changeHandler(columnIndex, dataIndex);
|
|
473
|
+
}
|
|
474
|
+
}, null, 8, ["itemShow", "list-data", "readonly", "default-index", "data-type", "onChange"])
|
|
475
|
+
]);
|
|
476
|
+
}), 128))
|
|
477
|
+
])
|
|
459
478
|
]),
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
return openBlock(), createElementBlock("view", {
|
|
464
|
-
class: "nut-oldpicker__columnitem",
|
|
465
|
-
key: columnIndex
|
|
466
|
-
}, [
|
|
467
|
-
createVNode(_component_nut_oldpicker_column, {
|
|
468
|
-
itemShow: _ctx.show,
|
|
469
|
-
"list-data": item,
|
|
470
|
-
readonly: _ctx.readonly,
|
|
471
|
-
"default-index": item.defaultIndex,
|
|
472
|
-
"visible-item-count": _ctx.visibleItemCount,
|
|
473
|
-
"data-type": _ctx.dataType,
|
|
474
|
-
onChange: (dataIndex) => {
|
|
475
|
-
_ctx.changeHandler(columnIndex, dataIndex);
|
|
476
|
-
}
|
|
477
|
-
}, null, 8, ["itemShow", "list-data", "readonly", "default-index", "visible-item-count", "data-type", "onChange"])
|
|
478
|
-
]);
|
|
479
|
-
}), 128))
|
|
480
|
-
])
|
|
481
|
-
]),
|
|
482
|
-
_: 1
|
|
483
|
-
}, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose"]);
|
|
479
|
+
_: 1
|
|
480
|
+
}, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "isWrapTeleport"])
|
|
481
|
+
], 2);
|
|
484
482
|
}
|
|
485
|
-
var
|
|
486
|
-
export {
|
|
483
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
484
|
+
export { index as default };
|
|
@@ -15,11 +15,11 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
/*!
|
|
18
|
-
* @nutui/nutui v3.1.19-beta.
|
|
18
|
+
* @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
|
|
19
19
|
* (c) 2022 @jdf2e.
|
|
20
20
|
* Released under the MIT License.
|
|
21
21
|
*/
|
|
22
|
-
import { computed, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, vShow } from "vue";
|
|
22
|
+
import { computed, watch, onDeactivated, onBeforeUnmount, onMounted, onActivated, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, withModifiers, normalizeStyle, renderSlot, vShow } from "vue";
|
|
23
23
|
import { c as createComponent } from "./component.js";
|
|
24
24
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
25
25
|
const { componentName, create } = createComponent("overlay");
|
|
@@ -63,19 +63,38 @@ const _sfc_main = create({
|
|
|
63
63
|
[props.overlayClass]: true
|
|
64
64
|
};
|
|
65
65
|
});
|
|
66
|
+
watch(() => props.visible, (value) => {
|
|
67
|
+
value ? lock() : unlock();
|
|
68
|
+
});
|
|
69
|
+
const lock = () => {
|
|
70
|
+
if (props.lockScroll && props.visible) {
|
|
71
|
+
document.body.classList.add("nut-overflow-hidden");
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const unlock = () => {
|
|
75
|
+
document.body.classList.remove("nut-overflow-hidden");
|
|
76
|
+
};
|
|
77
|
+
onDeactivated(unlock);
|
|
78
|
+
onBeforeUnmount(unlock);
|
|
79
|
+
onMounted(lock);
|
|
80
|
+
onActivated(lock);
|
|
66
81
|
const style = computed(() => {
|
|
67
82
|
return __spreadValues({
|
|
68
83
|
animationDuration: `${props.duration}s`,
|
|
69
84
|
zIndex: props.zIndex
|
|
70
85
|
}, props.overlayStyle);
|
|
71
86
|
});
|
|
87
|
+
const touchmove = (e) => {
|
|
88
|
+
if (props.lockScroll)
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
};
|
|
72
91
|
const onClick = (e) => {
|
|
73
92
|
emit("click", e);
|
|
74
93
|
if (props.closeOnClickOverlay) {
|
|
75
94
|
emit("update:visible", false);
|
|
76
95
|
}
|
|
77
96
|
};
|
|
78
|
-
return { classes, style, onClick };
|
|
97
|
+
return { classes, style, touchmove, onClick };
|
|
79
98
|
}
|
|
80
99
|
});
|
|
81
100
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
@@ -83,11 +102,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
83
102
|
default: withCtx(() => [
|
|
84
103
|
withDirectives(createElementVNode("view", {
|
|
85
104
|
class: normalizeClass(_ctx.classes),
|
|
86
|
-
|
|
105
|
+
onTouchmove: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.touchmove && _ctx.touchmove(...args), ["stop"])),
|
|
106
|
+
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
|
|
87
107
|
style: normalizeStyle(_ctx.style)
|
|
88
108
|
}, [
|
|
89
109
|
renderSlot(_ctx.$slots, "default")
|
|
90
|
-
],
|
|
110
|
+
], 38), [
|
|
91
111
|
[vShow, _ctx.visible]
|
|
92
112
|
])
|
|
93
113
|
]),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.19-beta.
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.4 Tue Apr 12 2022 17:39:20 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { toRefs, computed, watchEffect, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, createTextVNode, toDisplayString, Fragment, renderList, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
-
const { componentName, create } = createComponent("pagination");
|
|
9
|
+
const { componentName, create, translate } = createComponent("pagination");
|
|
10
10
|
const _sfc_main = create({
|
|
11
11
|
props: {
|
|
12
12
|
modelValue: {
|
|
@@ -19,11 +19,11 @@ const _sfc_main = create({
|
|
|
19
19
|
},
|
|
20
20
|
prevText: {
|
|
21
21
|
type: String,
|
|
22
|
-
default: "
|
|
22
|
+
default: ""
|
|
23
23
|
},
|
|
24
24
|
nextText: {
|
|
25
25
|
type: String,
|
|
26
|
-
default: "
|
|
26
|
+
default: ""
|
|
27
27
|
},
|
|
28
28
|
pageCount: {
|
|
29
29
|
type: [String, Number],
|
|
@@ -67,13 +67,13 @@ const _sfc_main = create({
|
|
|
67
67
|
return { number, text, active };
|
|
68
68
|
};
|
|
69
69
|
const pages = computed(() => {
|
|
70
|
+
if (mode.value == "simple")
|
|
71
|
+
return;
|
|
70
72
|
let items = [];
|
|
71
73
|
const pageCount = countRef.value;
|
|
72
74
|
const pageSize = showPageSize.value;
|
|
73
75
|
let startPage = 1;
|
|
74
76
|
let endPage = pageCount;
|
|
75
|
-
if (mode.value == "simple")
|
|
76
|
-
return;
|
|
77
77
|
const partialShow = pageCount > pageSize;
|
|
78
78
|
if (partialShow) {
|
|
79
79
|
startPage = Math.max(modelValue.value - Math.floor(pageSize / 2), 1);
|
|
@@ -108,7 +108,8 @@ const _sfc_main = create({
|
|
|
108
108
|
countRef,
|
|
109
109
|
mode,
|
|
110
110
|
pages,
|
|
111
|
-
forceEllipses
|
|
111
|
+
forceEllipses,
|
|
112
|
+
translate
|
|
112
113
|
};
|
|
113
114
|
}
|
|
114
115
|
});
|
|
@@ -130,13 +131,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
130
131
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.select(_ctx.modelValue - 1, true))
|
|
131
132
|
}, [
|
|
132
133
|
renderSlot(_ctx.$slots, "prev-text", {}, () => [
|
|
133
|
-
createTextVNode(toDisplayString(_ctx.prevText), 1)
|
|
134
|
+
createTextVNode(toDisplayString(_ctx.prevText || _ctx.translate("prev")), 1)
|
|
134
135
|
])
|
|
135
136
|
], 2),
|
|
136
137
|
_ctx.mode == "multi" ? (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
137
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item,
|
|
138
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item, index2) => {
|
|
138
139
|
return openBlock(), createElementBlock("view", {
|
|
139
|
-
key:
|
|
140
|
+
key: index2 + "pagination",
|
|
140
141
|
class: normalizeClass(["nut-pagination-item", item.active ? "active" : ""]),
|
|
141
142
|
onClick: ($event) => _ctx.select(item.number, true)
|
|
142
143
|
}, [
|
|
@@ -154,10 +155,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
154
155
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.select(_ctx.modelValue + 1, true))
|
|
155
156
|
}, [
|
|
156
157
|
renderSlot(_ctx.$slots, "next-text", {}, () => [
|
|
157
|
-
createTextVNode(toDisplayString(_ctx.nextText), 1)
|
|
158
|
+
createTextVNode(toDisplayString(_ctx.nextText || _ctx.translate("next")), 1)
|
|
158
159
|
])
|
|
159
160
|
], 2)
|
|
160
161
|
]);
|
|
161
162
|
}
|
|
162
|
-
var
|
|
163
|
-
export {
|
|
163
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
164
|
+
export { index as default };
|