@nutui/nutui 3.1.23-beta.0 → 3.1.23-beta.3
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/dist/nutui.es.js +839 -584
- package/dist/nutui.umd.js +850 -594
- package/dist/packages/_es/ActionSheet.js +8 -3
- package/dist/packages/_es/Address.js +1 -1
- package/dist/packages/_es/AddressList.js +1 -1
- package/dist/packages/_es/Animate.js +1 -1
- package/dist/packages/_es/Audio.js +1 -1
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +1 -1
- package/dist/packages/_es/AvatarGroup.js +1 -1
- package/dist/packages/_es/BackTop.js +1 -1
- package/dist/packages/_es/Badge.js +1 -1
- package/dist/packages/_es/Barrage.js +1 -1
- package/dist/packages/_es/Button.js +1 -1
- package/dist/packages/_es/Calendar.js +1 -1
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +7 -4
- package/dist/packages/_es/Cascader.js +1 -1
- package/dist/packages/_es/Category.js +1 -1
- package/dist/packages/_es/CategoryPane.js +24 -22
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +11 -2
- package/dist/packages/_es/CheckboxGroup.js +1 -1
- package/dist/packages/_es/CircleProgress.js +1 -1
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +1 -1
- package/dist/packages/_es/CollapseItem.js +1 -1
- package/dist/packages/_es/Comment.js +4 -3
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +1 -1
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +9 -3
- package/dist/packages/_es/Dialog.js +1 -1
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Ecard.js +1 -1
- package/dist/packages/_es/Elevator.js +1 -1
- package/dist/packages/_es/Ellipsis.js +1 -1
- package/dist/packages/_es/Empty.js +1 -1
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +1 -1
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- package/dist/packages/_es/GridItem.js +1 -1
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +1 -1
- package/dist/packages/_es/ImagePreview.js +1 -1
- package/dist/packages/_es/Indicator.js +1 -1
- package/dist/packages/_es/InfiniteLoading.js +1 -1
- package/dist/packages/_es/Input.js +1 -1
- package/dist/packages/_es/InputNumber.js +1 -1
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +1 -1
- package/dist/packages/_es/Menu.js +1 -1
- package/dist/packages/_es/MenuItem.js +1 -1
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +1 -1
- package/dist/packages/_es/Notify.js +1 -1
- package/dist/packages/_es/NumberKeyboard.js +1 -1
- package/dist/packages/_es/OldPicker.js +1 -1
- package/dist/packages/_es/OverLay.js +1 -1
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +117 -79
- package/dist/packages/_es/Popover.js +1 -1
- package/dist/packages/_es/Popup.js +14 -18
- package/dist/packages/_es/Price.js +1 -1
- package/dist/packages/_es/Progress.js +1 -1
- package/dist/packages/_es/PullRefresh.js +1 -1
- package/dist/packages/_es/Radio.js +1 -1
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +1 -1
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +1 -1
- package/dist/packages/_es/SideNavBar.js +1 -1
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +1 -1
- package/dist/packages/_es/Sku.js +1 -1
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +1 -1
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +1 -1
- package/dist/packages/_es/Swiper.js +13 -2
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +11 -3
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +1 -1
- package/dist/packages/_es/TabbarItem.js +1 -1
- package/dist/packages/_es/Table.js +1 -1
- package/dist/packages/_es/Tabs.js +1 -1
- package/dist/packages/_es/Tag.js +1 -1
- package/dist/packages/_es/TextArea.js +1 -1
- package/dist/packages/_es/TimeDetail.js +1 -1
- package/dist/packages/_es/TimePannel.js +1 -1
- package/dist/packages/_es/TimeSelect.js +1 -1
- package/dist/packages/_es/Toast.js +1 -1
- package/dist/packages/_es/Uploader.js +1 -1
- package/dist/packages/_es/Video.js +1 -1
- package/dist/packages/_es/WaterMark.js +187 -0
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/index4.js +1 -1
- package/dist/packages/_es/index5.js +2 -1
- 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/imagepreview/index.scss +0 -1
- 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/picker/index.scss +23 -0
- package/dist/packages/watermark/index.scss +13 -0
- package/dist/smartips/attributes.json +68 -0
- package/dist/smartips/tags.json +24 -3
- package/dist/smartips/web-types.json +161 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +58 -57
- package/dist/styles/themes/jdb.scss +58 -57
- package/dist/styles/themes/jdt.scss +58 -57
- package/dist/styles/variables-jdb.scss +3 -1
- package/dist/styles/variables-jdt.scss +3 -1
- package/dist/styles/variables.scss +4 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +7 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +2 -2
- package/dist/types/__VUE/categorypane/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cell/index.vue.d.ts +4 -4
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +7 -0
- package/dist/types/__VUE/grid/index.vue.d.ts +2 -2
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/picker/Column.vue.d.ts +11 -3
- package/dist/types/__VUE/picker/index.vue.d.ts +18 -3
- package/dist/types/__VUE/popup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/swiper/index.vue.d.ts +7 -0
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +2 -2
- package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
- package/dist/types/__VUE/watermark/index.vue.d.ts +143 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +2 -1
- package/package.json +8 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.23-beta.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.3 Fri Jul 08 2022 17:15:25 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
8
|
import Popup, { popupProps } from "./Popup.js";
|
|
9
|
+
import { u as useTouch } from "./index4.js";
|
|
9
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
11
|
import "../locale/lang";
|
|
11
12
|
import "./OverLay.js";
|
|
@@ -27,10 +28,15 @@ const _sfc_main$1 = create$1({
|
|
|
27
28
|
readonly: {
|
|
28
29
|
type: Boolean,
|
|
29
30
|
default: false
|
|
31
|
+
},
|
|
32
|
+
threeDimensional: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true
|
|
30
35
|
}
|
|
31
36
|
},
|
|
32
37
|
emits: ["click", "change"],
|
|
33
38
|
setup(props, { emit }) {
|
|
39
|
+
const touch = useTouch();
|
|
34
40
|
const wrapper = ref();
|
|
35
41
|
const state = reactive({
|
|
36
42
|
touchParams: {
|
|
@@ -50,54 +56,71 @@ const _sfc_main$1 = create$1({
|
|
|
50
56
|
});
|
|
51
57
|
const roller = ref(null);
|
|
52
58
|
const list = ref(null);
|
|
53
|
-
const
|
|
59
|
+
const moving = ref(false);
|
|
54
60
|
const touchDeg = ref(0);
|
|
55
61
|
const touchTime = ref(0);
|
|
56
|
-
const
|
|
57
|
-
const
|
|
62
|
+
const INERTIA_TIME = 300;
|
|
63
|
+
const INERTIA_DISTANCE = 15;
|
|
64
|
+
const touchRollerStyle = computed(() => {
|
|
58
65
|
return {
|
|
59
|
-
transition: `transform ${touchTime.value}ms cubic-bezier(0.
|
|
60
|
-
transform: `
|
|
66
|
+
transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
67
|
+
transform: `rotate3d(1, 0, 0, ${touchDeg.value})`
|
|
61
68
|
};
|
|
62
69
|
});
|
|
63
|
-
const
|
|
70
|
+
const touchTileStyle = computed(() => {
|
|
64
71
|
return {
|
|
65
|
-
transition: `transform ${touchTime.value}ms cubic-bezier(0.
|
|
66
|
-
transform: `
|
|
72
|
+
transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
73
|
+
transform: `translate3d(0, ${state.scrollDistance}px, 0)`
|
|
67
74
|
};
|
|
68
75
|
});
|
|
76
|
+
const setRollerStyle = (index) => {
|
|
77
|
+
return `transform: rotate3d(1, 0, 0, ${-state.rotation * index}deg) translate3d(0px, 0px, 104px)`;
|
|
78
|
+
};
|
|
69
79
|
const onTouchStart = (event) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
touch.start(event);
|
|
81
|
+
if (moving.value) {
|
|
82
|
+
let dom = list.value;
|
|
83
|
+
if (!props.threeDimensional) {
|
|
84
|
+
dom = roller.value;
|
|
85
|
+
}
|
|
86
|
+
const { transform } = window.getComputedStyle(dom);
|
|
87
|
+
state.scrollDistance = +transform.slice(7, transform.length - 1).split(", ")[5];
|
|
88
|
+
}
|
|
89
|
+
state.touchParams.startY = touch.deltaY.value;
|
|
90
|
+
state.touchParams.startTime = Date.now();
|
|
74
91
|
state.transformY = state.scrollDistance;
|
|
75
92
|
};
|
|
76
93
|
const onTouchMove = (event) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
94
|
+
touch.move(event);
|
|
95
|
+
if (touch.isVertical) {
|
|
96
|
+
moving.value = true;
|
|
97
|
+
preventDefault(event, true);
|
|
98
|
+
}
|
|
99
|
+
state.touchParams.lastY = touch.deltaY.value;
|
|
81
100
|
let move = state.touchParams.lastY - state.touchParams.startY;
|
|
82
101
|
setMove(move);
|
|
83
102
|
};
|
|
84
103
|
const onTouchEnd = (event) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
state.touchParams.lastY = changedTouches.pageY;
|
|
88
|
-
state.touchParams.lastTime = event.timeStamp || Date.now();
|
|
104
|
+
state.touchParams.lastY = touch.deltaY.value;
|
|
105
|
+
state.touchParams.lastTime = Date.now();
|
|
89
106
|
let move = state.touchParams.lastY - state.touchParams.startY;
|
|
90
107
|
let moveTime = state.touchParams.lastTime - state.touchParams.startTime;
|
|
91
|
-
if (moveTime <=
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
108
|
+
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
109
|
+
const distance = momentum(move, moveTime);
|
|
110
|
+
setMove(distance, "end", moveTime + 1e3);
|
|
111
|
+
return;
|
|
95
112
|
} else {
|
|
96
113
|
setMove(move, "end");
|
|
97
114
|
}
|
|
115
|
+
setTimeout(() => {
|
|
116
|
+
touch.reset();
|
|
117
|
+
moving.value = false;
|
|
118
|
+
}, 0);
|
|
98
119
|
};
|
|
99
|
-
const
|
|
100
|
-
|
|
120
|
+
const momentum = (distance, duration) => {
|
|
121
|
+
const speed = Math.abs(distance / duration);
|
|
122
|
+
distance = speed / 3e-3 * (distance < 0 ? -1 : 1);
|
|
123
|
+
return distance;
|
|
101
124
|
};
|
|
102
125
|
const isHidden = (index) => {
|
|
103
126
|
if (index >= state.currIndex + 8 || index <= state.currIndex - 8) {
|
|
@@ -113,7 +136,6 @@ const _sfc_main$1 = create$1({
|
|
|
113
136
|
touchTime.value = 0;
|
|
114
137
|
}
|
|
115
138
|
touchDeg.value = deg;
|
|
116
|
-
touchTranslateY.value = translateY;
|
|
117
139
|
state.scrollDistance = translateY;
|
|
118
140
|
};
|
|
119
141
|
const setMove = (move, type, time) => {
|
|
@@ -128,20 +150,17 @@ const _sfc_main$1 = create$1({
|
|
|
128
150
|
let endMove = Math.round(updateMove / state.lineSpacing) * state.lineSpacing;
|
|
129
151
|
let deg = `${(Math.abs(Math.round(endMove / state.lineSpacing)) + 1) * state.rotation}deg`;
|
|
130
152
|
setTransform(endMove, type, time, deg);
|
|
131
|
-
let t = time ? time / 2 : 0;
|
|
132
|
-
state.timer = setTimeout(() => {
|
|
133
|
-
setChooseValue();
|
|
134
|
-
}, t);
|
|
135
153
|
state.currIndex = Math.abs(Math.round(endMove / state.lineSpacing)) + 1;
|
|
136
154
|
} else {
|
|
137
|
-
let deg =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
155
|
+
let deg = 0;
|
|
156
|
+
let currentDeg = (-updateMove / state.lineSpacing + 1) * state.rotation;
|
|
157
|
+
const maxDeg = (props.column.length + 1) * state.rotation;
|
|
158
|
+
const minDeg = 0;
|
|
159
|
+
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
160
|
+
if (minDeg < deg && deg < maxDeg) {
|
|
161
|
+
setTransform(updateMove, null, void 0, deg + "deg");
|
|
162
|
+
state.currIndex = Math.abs(Math.round(updateMove / state.lineSpacing)) + 1;
|
|
142
163
|
}
|
|
143
|
-
setTransform(updateMove, null, void 0, deg);
|
|
144
|
-
state.currIndex = Math.abs(Math.round(updateMove / state.lineSpacing)) + 1;
|
|
145
164
|
}
|
|
146
165
|
};
|
|
147
166
|
const setChooseValue = () => {
|
|
@@ -155,18 +174,25 @@ const _sfc_main$1 = create$1({
|
|
|
155
174
|
type && setChooseValue();
|
|
156
175
|
setMove(-move);
|
|
157
176
|
};
|
|
177
|
+
const preventDefault = (event, isStopPropagation) => {
|
|
178
|
+
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
}
|
|
181
|
+
if (isStopPropagation) {
|
|
182
|
+
event.stopPropagation();
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
const stopMomentum = () => {
|
|
186
|
+
moving.value = false;
|
|
187
|
+
setChooseValue();
|
|
188
|
+
};
|
|
158
189
|
watch(() => props.column, (val) => {
|
|
190
|
+
console.log("props.column\u53D8\u5316", props.column);
|
|
159
191
|
state.transformY = 0;
|
|
160
192
|
modifyStatus(false);
|
|
161
193
|
}, {
|
|
162
194
|
deep: true
|
|
163
195
|
});
|
|
164
|
-
watch(() => props.value, (val) => {
|
|
165
|
-
console.log("\u5217\u66F4\u65B0", val);
|
|
166
|
-
modifyStatus(true);
|
|
167
|
-
}, {
|
|
168
|
-
deep: true
|
|
169
|
-
});
|
|
170
196
|
onMounted(() => {
|
|
171
197
|
modifyStatus(true);
|
|
172
198
|
});
|
|
@@ -178,56 +204,59 @@ const _sfc_main$1 = create$1({
|
|
|
178
204
|
isHidden,
|
|
179
205
|
roller,
|
|
180
206
|
list,
|
|
181
|
-
listItem,
|
|
182
207
|
onTouchStart,
|
|
183
208
|
onTouchMove,
|
|
184
209
|
onTouchEnd,
|
|
185
210
|
touchRollerStyle,
|
|
186
|
-
|
|
187
|
-
setMove
|
|
211
|
+
touchTileStyle,
|
|
212
|
+
setMove,
|
|
213
|
+
stopMomentum
|
|
188
214
|
};
|
|
189
215
|
}
|
|
190
216
|
});
|
|
191
|
-
const _hoisted_1$1 = {
|
|
192
|
-
|
|
217
|
+
const _hoisted_1$1 = {
|
|
218
|
+
key: 1,
|
|
219
|
+
class: "nut-picker-roller-item-tile"
|
|
220
|
+
};
|
|
221
|
+
const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker-roller-mask" }, null, -1);
|
|
222
|
+
const _hoisted_3$1 = {
|
|
193
223
|
key: 0,
|
|
194
|
-
class: "nut-picker-
|
|
224
|
+
class: "nut-picker-content"
|
|
195
225
|
};
|
|
196
226
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
197
227
|
return openBlock(), createElementBlock("view", {
|
|
198
228
|
class: "nut-picker__list",
|
|
199
|
-
onTouchstart: _cache[
|
|
200
|
-
onTouchmove: _cache[
|
|
201
|
-
onTouchend: _cache[
|
|
229
|
+
onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
|
|
230
|
+
onTouchmove: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
|
|
231
|
+
onTouchend: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
202
232
|
}, [
|
|
203
233
|
createElementVNode("view", {
|
|
204
234
|
class: "nut-picker-roller",
|
|
205
235
|
ref: "roller",
|
|
206
|
-
style: normalizeStyle(_ctx.touchRollerStyle)
|
|
236
|
+
style: normalizeStyle(_ctx.threeDimensional ? _ctx.touchRollerStyle : _ctx.touchTileStyle),
|
|
237
|
+
onTransitionend: _cache[0] || (_cache[0] = (...args) => _ctx.stopMomentum && _ctx.stopMomentum(...args))
|
|
207
238
|
}, [
|
|
208
239
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
|
|
209
|
-
return openBlock(), createElementBlock(
|
|
210
|
-
class: normalizeClass(["nut-picker-roller-item", { "nut-picker-roller-item-hidden": _ctx.isHidden(index + 1) }]),
|
|
211
|
-
style: normalizeStyle(_ctx.setRollerStyle(index + 1)),
|
|
240
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
212
241
|
key: item.value ? item.value : index
|
|
213
|
-
},
|
|
242
|
+
}, [
|
|
243
|
+
item && item.text && _ctx.threeDimensional ? (openBlock(), createElementBlock("view", {
|
|
244
|
+
key: 0,
|
|
245
|
+
class: normalizeClass(["nut-picker-roller-item", { "nut-picker-roller-item-hidden": _ctx.isHidden(index + 1) }]),
|
|
246
|
+
style: normalizeStyle(_ctx.setRollerStyle(index + 1))
|
|
247
|
+
}, toDisplayString(item.text), 7)) : createCommentVNode("", true),
|
|
248
|
+
item && item.text && !_ctx.threeDimensional ? (openBlock(), createElementBlock("view", _hoisted_1$1, toDisplayString(item.text), 1)) : createCommentVNode("", true)
|
|
249
|
+
], 64);
|
|
214
250
|
}), 128))
|
|
215
|
-
],
|
|
216
|
-
|
|
251
|
+
], 36),
|
|
252
|
+
_hoisted_2$1,
|
|
253
|
+
_ctx.threeDimensional ? (openBlock(), createElementBlock("view", _hoisted_3$1, [
|
|
217
254
|
createElementVNode("view", {
|
|
218
255
|
class: "nut-picker-list-panel",
|
|
219
256
|
ref: "list",
|
|
220
|
-
style: normalizeStyle(_ctx.
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
return openBlock(), createElementBlock("view", {
|
|
224
|
-
class: normalizeClass(["nut-picker-item", "nut-picker-item-ref", item.className]),
|
|
225
|
-
key: item.value ? item.value : index
|
|
226
|
-
}, toDisplayString(item.text), 3);
|
|
227
|
-
}), 128)),
|
|
228
|
-
_ctx.column && _ctx.column.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true)
|
|
229
|
-
], 4)
|
|
230
|
-
])
|
|
257
|
+
style: normalizeStyle(_ctx.touchTileStyle)
|
|
258
|
+
}, null, 4)
|
|
259
|
+
])) : createCommentVNode("", true)
|
|
231
260
|
], 32);
|
|
232
261
|
}
|
|
233
262
|
var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
@@ -264,6 +293,10 @@ const _sfc_main = create({
|
|
|
264
293
|
readonly: {
|
|
265
294
|
type: Boolean,
|
|
266
295
|
default: false
|
|
296
|
+
},
|
|
297
|
+
threeDimensional: {
|
|
298
|
+
type: Boolean,
|
|
299
|
+
default: true
|
|
267
300
|
}
|
|
268
301
|
},
|
|
269
302
|
emits: ["close", "change", "confirm", "update:visible", "update:modelValue"],
|
|
@@ -273,6 +306,7 @@ const _sfc_main = create({
|
|
|
273
306
|
formattedColumns: props.columns
|
|
274
307
|
});
|
|
275
308
|
let defaultValues = ref(props.modelValue);
|
|
309
|
+
ref();
|
|
276
310
|
const classes = computed(() => {
|
|
277
311
|
const prefixCls = componentName;
|
|
278
312
|
return {
|
|
@@ -331,7 +365,10 @@ const _sfc_main = create({
|
|
|
331
365
|
return formatted;
|
|
332
366
|
};
|
|
333
367
|
const close = () => {
|
|
334
|
-
emit("close"
|
|
368
|
+
emit("close", {
|
|
369
|
+
selectedValue: defaultValues.value,
|
|
370
|
+
selectedOptions: selectedOptions.value
|
|
371
|
+
});
|
|
335
372
|
emit("update:visible", false);
|
|
336
373
|
};
|
|
337
374
|
const changeHandler = (columnIndex, option) => {
|
|
@@ -363,7 +400,6 @@ const _sfc_main = create({
|
|
|
363
400
|
emit("update:visible", false);
|
|
364
401
|
};
|
|
365
402
|
onMounted(() => {
|
|
366
|
-
console.log(11, props.modelValue);
|
|
367
403
|
if (props.visible)
|
|
368
404
|
state.show = props.visible;
|
|
369
405
|
});
|
|
@@ -372,7 +408,6 @@ const _sfc_main = create({
|
|
|
372
408
|
state.show = false;
|
|
373
409
|
});
|
|
374
410
|
watch(() => props.modelValue, (newValues) => {
|
|
375
|
-
console.log("change", newValues, defaultValues.value);
|
|
376
411
|
const isSameValue = JSON.stringify(newValues) === JSON.stringify(defaultValues.value);
|
|
377
412
|
if (!isSameValue) {
|
|
378
413
|
defaultValues.value = newValues;
|
|
@@ -385,7 +420,6 @@ const _sfc_main = create({
|
|
|
385
420
|
}
|
|
386
421
|
}, { immediate: true });
|
|
387
422
|
watch(() => props.visible, (val) => {
|
|
388
|
-
console.log("props\u66F4\u65B0", props.columns);
|
|
389
423
|
state.show = val;
|
|
390
424
|
});
|
|
391
425
|
watch(() => props.columns, (val) => {
|
|
@@ -408,7 +442,10 @@ const _sfc_main = create({
|
|
|
408
442
|
});
|
|
409
443
|
const _hoisted_1 = { class: "nut-picker__bar" };
|
|
410
444
|
const _hoisted_2 = { class: "nut-picker__title" };
|
|
411
|
-
const _hoisted_3 = {
|
|
445
|
+
const _hoisted_3 = {
|
|
446
|
+
class: "nut-picker__column",
|
|
447
|
+
ref: "wrapHeight"
|
|
448
|
+
};
|
|
412
449
|
const _hoisted_4 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker__hairline" }, null, -1);
|
|
413
450
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
414
451
|
const _component_nut_picker_column = resolveComponent("nut-picker-column");
|
|
@@ -453,13 +490,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
453
490
|
readonly: _ctx.readonly,
|
|
454
491
|
columnsType: _ctx.columnsType,
|
|
455
492
|
value: _ctx.defaultValues[columnIndex],
|
|
493
|
+
threeDimensional: _ctx.threeDimensional,
|
|
456
494
|
onChange: (option) => {
|
|
457
495
|
_ctx.changeHandler(columnIndex, option);
|
|
458
496
|
}
|
|
459
|
-
}, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "onChange"])
|
|
497
|
+
}, null, 8, ["itemShow", "column", "readonly", "columnsType", "value", "threeDimensional", "onChange"])
|
|
460
498
|
]);
|
|
461
499
|
}), 128))
|
|
462
|
-
]),
|
|
500
|
+
], 512),
|
|
463
501
|
renderSlot(_ctx.$slots, "default")
|
|
464
502
|
]),
|
|
465
503
|
_: 3
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.23-beta.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.3 Fri Jul 08 2022 17:15:25 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -92,7 +92,7 @@ const _sfc_main = create({
|
|
|
92
92
|
setup(props, { emit }) {
|
|
93
93
|
const popupRef = ref();
|
|
94
94
|
const state = reactive({
|
|
95
|
-
zIndex: props.zIndex
|
|
95
|
+
zIndex: props.zIndex,
|
|
96
96
|
showSlot: true,
|
|
97
97
|
transitionName: `popup-fade-${props.position}`,
|
|
98
98
|
overLayCount: 1,
|
|
@@ -118,29 +118,25 @@ const _sfc_main = create({
|
|
|
118
118
|
};
|
|
119
119
|
});
|
|
120
120
|
const open = () => {
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
_zIndex = Number(props.zIndex);
|
|
124
|
-
}
|
|
125
|
-
emit("update:visible", true);
|
|
126
|
-
lockScroll();
|
|
127
|
-
state.zIndex = ++_zIndex;
|
|
121
|
+
if (props.zIndex != 2e3) {
|
|
122
|
+
_zIndex = Number(props.zIndex);
|
|
128
123
|
}
|
|
124
|
+
emit("update:visible", true);
|
|
125
|
+
lockScroll();
|
|
126
|
+
state.zIndex = ++_zIndex;
|
|
129
127
|
if (props.destroyOnClose) {
|
|
130
128
|
state.showSlot = true;
|
|
131
129
|
}
|
|
132
130
|
emit("open");
|
|
133
131
|
};
|
|
134
132
|
const close = () => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}, +props.duration * 1e3);
|
|
143
|
-
}
|
|
133
|
+
unlockScroll();
|
|
134
|
+
emit("update:visible", false);
|
|
135
|
+
if (props.destroyOnClose) {
|
|
136
|
+
setTimeout(() => {
|
|
137
|
+
state.showSlot = false;
|
|
138
|
+
emit("close");
|
|
139
|
+
}, +props.duration * 1e3);
|
|
144
140
|
}
|
|
145
141
|
};
|
|
146
142
|
const onClick = (e) => {
|
package/dist/packages/_es/Row.js
CHANGED