@nutui/nutui 3.1.23-beta.1 → 3.1.23-beta.2
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 +792 -561
- package/dist/nutui.umd.js +803 -571
- package/dist/packages/_es/ActionSheet.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +2 -1
- 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 +84 -56
- 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 +1 -0
- package/dist/packages/watermark/index.scss +13 -0
- package/dist/smartips/attributes.json +60 -0
- package/dist/smartips/tags.json +20 -1
- package/dist/smartips/web-types.json +143 -1
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -1
- package/dist/styles/themes/default.scss +49 -48
- package/dist/styles/themes/jdb.scss +49 -48
- package/dist/styles/themes/jdt.scss +49 -48
- package/dist/styles/variables-jdb.scss +2 -0
- package/dist/styles/variables-jdt.scss +2 -0
- package/dist/styles/variables.scss +3 -0
- package/dist/types/__VUE/categorypane/index.vue.d.ts +1 -1
- package/dist/types/__VUE/collapse/index.vue.d.ts +2 -2
- package/dist/types/__VUE/divider/index.vue.d.ts +2 -2
- package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
- package/dist/types/__VUE/menuitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/picker/Column.vue.d.ts +1 -0
- package/dist/types/__VUE/picker/index.vue.d.ts +1 -0
- 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/swiper/index.vue.d.ts +7 -0
- package/dist/types/__VUE/tabbar/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.2 Thu Jul 07 2022 19:06:52 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";
|
|
@@ -31,6 +32,7 @@ const _sfc_main$1 = create$1({
|
|
|
31
32
|
},
|
|
32
33
|
emits: ["click", "change"],
|
|
33
34
|
setup(props, { emit }) {
|
|
35
|
+
const touch = useTouch();
|
|
34
36
|
const wrapper = ref();
|
|
35
37
|
const state = reactive({
|
|
36
38
|
touchParams: {
|
|
@@ -51,54 +53,72 @@ const _sfc_main$1 = create$1({
|
|
|
51
53
|
const roller = ref(null);
|
|
52
54
|
const list = ref(null);
|
|
53
55
|
const listItem = ref(null);
|
|
56
|
+
const moving = ref(false);
|
|
54
57
|
const touchDeg = ref(0);
|
|
55
58
|
const touchTime = ref(0);
|
|
56
|
-
const
|
|
57
|
-
const
|
|
59
|
+
const INERTIA_TIME = 300;
|
|
60
|
+
const INERTIA_DISTANCE = 15;
|
|
61
|
+
const touchRollerStyle = computed(() => {
|
|
58
62
|
return {
|
|
59
|
-
transition: `transform ${touchTime.value}ms cubic-bezier(0.
|
|
60
|
-
transform: `
|
|
63
|
+
transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
64
|
+
transform: `rotate3d(1, 0, 0, ${touchDeg.value})`
|
|
61
65
|
};
|
|
62
66
|
});
|
|
63
|
-
const
|
|
67
|
+
const touchListStyle = computed(() => {
|
|
64
68
|
return {
|
|
65
|
-
transition: `transform ${touchTime.value}ms cubic-bezier(0.
|
|
66
|
-
transform: `
|
|
69
|
+
transition: `transform ${touchTime.value}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
70
|
+
transform: `translate3d(0, ${state.scrollDistance}px, 0)`
|
|
67
71
|
};
|
|
68
72
|
});
|
|
73
|
+
const setRollerStyle = (index) => {
|
|
74
|
+
return `transform: rotate3d(1, 0, 0, ${-state.rotation * index}deg) translate3d(0px, 0px, 104px)`;
|
|
75
|
+
};
|
|
69
76
|
const onTouchStart = (event) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
touch.start(event);
|
|
78
|
+
if (moving.value) {
|
|
79
|
+
const { transform } = window.getComputedStyle(list.value);
|
|
80
|
+
state.scrollDistance = +transform.slice(7, transform.length - 1).split(", ")[5];
|
|
81
|
+
}
|
|
82
|
+
state.touchParams.startY = touch.deltaY.value;
|
|
83
|
+
state.touchParams.startTime = Date.now();
|
|
74
84
|
state.transformY = state.scrollDistance;
|
|
75
85
|
};
|
|
76
86
|
const onTouchMove = (event) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
touch.move(event);
|
|
88
|
+
if (touch.isVertical) {
|
|
89
|
+
moving.value = true;
|
|
90
|
+
preventDefault(event, true);
|
|
91
|
+
}
|
|
92
|
+
state.touchParams.lastY = touch.deltaY.value;
|
|
93
|
+
const now = Date.now();
|
|
81
94
|
let move = state.touchParams.lastY - state.touchParams.startY;
|
|
82
95
|
setMove(move);
|
|
96
|
+
if (now - state.touchParams.startTime > INERTIA_TIME) {
|
|
97
|
+
state.touchParams.startTime = now;
|
|
98
|
+
state.touchParams.startY = state.touchParams.lastY;
|
|
99
|
+
}
|
|
83
100
|
};
|
|
84
101
|
const onTouchEnd = (event) => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
state.touchParams.lastY = changedTouches.pageY;
|
|
88
|
-
state.touchParams.lastTime = event.timeStamp || Date.now();
|
|
102
|
+
state.touchParams.lastY = touch.deltaY.value;
|
|
103
|
+
state.touchParams.lastTime = Date.now();
|
|
89
104
|
let move = state.touchParams.lastY - state.touchParams.startY;
|
|
90
105
|
let moveTime = state.touchParams.lastTime - state.touchParams.startTime;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
setMove(move, "end", moveTime);
|
|
106
|
+
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
107
|
+
const distance = momentum(move, moveTime);
|
|
108
|
+
setMove(distance, "end", moveTime + 1e3);
|
|
109
|
+
return;
|
|
96
110
|
} else {
|
|
97
111
|
setMove(move, "end");
|
|
98
112
|
}
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
touch.reset();
|
|
115
|
+
moving.value = false;
|
|
116
|
+
}, 0);
|
|
99
117
|
};
|
|
100
|
-
const
|
|
101
|
-
|
|
118
|
+
const momentum = (distance, duration) => {
|
|
119
|
+
const speed = Math.abs(distance / duration);
|
|
120
|
+
distance = speed / 3e-3 * (distance < 0 ? -1 : 1);
|
|
121
|
+
return distance;
|
|
102
122
|
};
|
|
103
123
|
const isHidden = (index) => {
|
|
104
124
|
if (index >= state.currIndex + 8 || index <= state.currIndex - 8) {
|
|
@@ -114,11 +134,9 @@ const _sfc_main$1 = create$1({
|
|
|
114
134
|
touchTime.value = 0;
|
|
115
135
|
}
|
|
116
136
|
touchDeg.value = deg;
|
|
117
|
-
touchTranslateY.value = translateY;
|
|
118
137
|
state.scrollDistance = translateY;
|
|
119
138
|
};
|
|
120
139
|
const setMove = (move, type, time) => {
|
|
121
|
-
console.log("setMove");
|
|
122
140
|
let updateMove = move + state.transformY;
|
|
123
141
|
if (type === "end") {
|
|
124
142
|
if (updateMove > 0) {
|
|
@@ -130,30 +148,15 @@ const _sfc_main$1 = create$1({
|
|
|
130
148
|
let endMove = Math.round(updateMove / state.lineSpacing) * state.lineSpacing;
|
|
131
149
|
let deg = `${(Math.abs(Math.round(endMove / state.lineSpacing)) + 1) * state.rotation}deg`;
|
|
132
150
|
setTransform(endMove, type, time, deg);
|
|
133
|
-
let t = time ? time / 2 : 0;
|
|
134
|
-
state.timer = setTimeout(() => {
|
|
135
|
-
setChooseValue();
|
|
136
|
-
}, t);
|
|
137
151
|
state.currIndex = Math.abs(Math.round(endMove / state.lineSpacing)) + 1;
|
|
138
152
|
} else {
|
|
139
153
|
let deg = "0deg";
|
|
140
|
-
let
|
|
141
|
-
if (updateMove < 0) {
|
|
142
|
-
degNum = (Math.abs(updateMove / state.lineSpacing) + 1) * state.rotation;
|
|
143
|
-
} else {
|
|
144
|
-
degNum = (-updateMove / state.lineSpacing + 1) * state.rotation;
|
|
145
|
-
}
|
|
154
|
+
let currentDeg = (-updateMove / state.lineSpacing + 1) * state.rotation;
|
|
146
155
|
const maxDeg = (props.column.length + 1) * state.rotation;
|
|
147
156
|
const minDeg = 0;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
deg = `${minDeg}deg`;
|
|
152
|
-
} else {
|
|
153
|
-
deg = `${degNum}deg`;
|
|
154
|
-
setTransform(updateMove, null, void 0, deg);
|
|
155
|
-
state.currIndex = Math.abs(Math.round(updateMove / state.lineSpacing)) + 1;
|
|
156
|
-
}
|
|
157
|
+
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg) + "deg";
|
|
158
|
+
setTransform(updateMove, null, void 0, deg);
|
|
159
|
+
state.currIndex = Math.abs(Math.round(updateMove / state.lineSpacing)) + 1;
|
|
157
160
|
}
|
|
158
161
|
};
|
|
159
162
|
const setChooseValue = () => {
|
|
@@ -167,6 +170,18 @@ const _sfc_main$1 = create$1({
|
|
|
167
170
|
type && setChooseValue();
|
|
168
171
|
setMove(-move);
|
|
169
172
|
};
|
|
173
|
+
const preventDefault = (event, isStopPropagation) => {
|
|
174
|
+
if (typeof event.cancelable !== "boolean" || event.cancelable) {
|
|
175
|
+
event.preventDefault();
|
|
176
|
+
}
|
|
177
|
+
if (isStopPropagation) {
|
|
178
|
+
event.stopPropagation();
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const stopMomentum = () => {
|
|
182
|
+
moving.value = false;
|
|
183
|
+
setChooseValue();
|
|
184
|
+
};
|
|
170
185
|
watch(() => props.column, (val) => {
|
|
171
186
|
console.log("props.column\u53D8\u5316", props.column);
|
|
172
187
|
state.transformY = 0;
|
|
@@ -191,22 +206,25 @@ const _sfc_main$1 = create$1({
|
|
|
191
206
|
onTouchEnd,
|
|
192
207
|
touchRollerStyle,
|
|
193
208
|
touchListStyle,
|
|
194
|
-
setMove
|
|
209
|
+
setMove,
|
|
210
|
+
stopMomentum
|
|
195
211
|
};
|
|
196
212
|
}
|
|
197
213
|
});
|
|
198
214
|
const _hoisted_1$1 = /* @__PURE__ */ createElementVNode("view", { class: "nut-picker-roller-mask" }, null, -1);
|
|
215
|
+
const _hoisted_2$1 = { class: "nut-picker-content" };
|
|
199
216
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
200
217
|
return openBlock(), createElementBlock("view", {
|
|
201
218
|
class: "nut-picker__list",
|
|
202
|
-
onTouchstart: _cache[
|
|
203
|
-
onTouchmove: _cache[
|
|
204
|
-
onTouchend: _cache[
|
|
219
|
+
onTouchstart: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
|
|
220
|
+
onTouchmove: _cache[2] || (_cache[2] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
|
|
221
|
+
onTouchend: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
205
222
|
}, [
|
|
206
223
|
createElementVNode("view", {
|
|
207
224
|
class: "nut-picker-roller",
|
|
208
225
|
ref: "roller",
|
|
209
|
-
style: normalizeStyle(_ctx.touchRollerStyle)
|
|
226
|
+
style: normalizeStyle(_ctx.touchRollerStyle),
|
|
227
|
+
onTransitionend: _cache[0] || (_cache[0] = (...args) => _ctx.stopMomentum && _ctx.stopMomentum(...args))
|
|
210
228
|
}, [
|
|
211
229
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
|
|
212
230
|
return openBlock(), createElementBlock(Fragment, {
|
|
@@ -219,8 +237,15 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
219
237
|
}, toDisplayString(item.text), 7)) : createCommentVNode("", true)
|
|
220
238
|
], 64);
|
|
221
239
|
}), 128))
|
|
222
|
-
],
|
|
223
|
-
_hoisted_1$1
|
|
240
|
+
], 36),
|
|
241
|
+
_hoisted_1$1,
|
|
242
|
+
createElementVNode("view", _hoisted_2$1, [
|
|
243
|
+
createElementVNode("view", {
|
|
244
|
+
class: "nut-picker-list-panel",
|
|
245
|
+
ref: "list",
|
|
246
|
+
style: normalizeStyle(_ctx.touchListStyle)
|
|
247
|
+
}, null, 4)
|
|
248
|
+
])
|
|
224
249
|
], 32);
|
|
225
250
|
}
|
|
226
251
|
var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
|
|
@@ -325,7 +350,10 @@ const _sfc_main = create({
|
|
|
325
350
|
return formatted;
|
|
326
351
|
};
|
|
327
352
|
const close = () => {
|
|
328
|
-
emit("close"
|
|
353
|
+
emit("close", {
|
|
354
|
+
selectedValue: defaultValues.value,
|
|
355
|
+
selectedOptions: selectedOptions.value
|
|
356
|
+
});
|
|
329
357
|
emit("update:visible", false);
|
|
330
358
|
};
|
|
331
359
|
const changeHandler = (columnIndex, option) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.23-beta.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.2 Thu Jul 07 2022 19:06:52 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
package/dist/packages/_es/Sku.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.23-beta.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.2 Thu Jul 07 2022 19:06:52 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -106,6 +106,10 @@ const _sfc_main = create({
|
|
|
106
106
|
isStopPropagation: {
|
|
107
107
|
type: Boolean,
|
|
108
108
|
default: true
|
|
109
|
+
},
|
|
110
|
+
isCenter: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: false
|
|
109
113
|
}
|
|
110
114
|
},
|
|
111
115
|
emits: ["change"],
|
|
@@ -151,9 +155,16 @@ const _sfc_main = create({
|
|
|
151
155
|
});
|
|
152
156
|
const activePagination = computed(() => (state.active + childCount.value) % childCount.value);
|
|
153
157
|
const getStyle = () => {
|
|
158
|
+
let offset = 0;
|
|
159
|
+
if (!props.isCenter) {
|
|
160
|
+
offset = state.offset;
|
|
161
|
+
} else {
|
|
162
|
+
let val = isVertical.value ? state.rect.height - size.value : state.rect.width - size.value;
|
|
163
|
+
offset = state.offset + (state.active === childCount.value - 1 ? -val / 2 : val / 2);
|
|
164
|
+
}
|
|
154
165
|
state.style = {
|
|
155
166
|
transitionDuration: `${state.moving ? 0 : props.duration}ms`,
|
|
156
|
-
transform: `translate${isVertical.value ? "Y" : "X"}(${
|
|
167
|
+
transform: `translate${isVertical.value ? "Y" : "X"}(${offset}px)`,
|
|
157
168
|
[isVertical.value ? "height" : "width"]: `${size.value * childCount.value}px`,
|
|
158
169
|
[isVertical.value ? "width" : "height"]: `${isVertical.value ? state.width : state.height}px`
|
|
159
170
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.23-beta.
|
|
2
|
+
* @nutui/nutui v3.1.23-beta.2 Thu Jul 07 2022 19:06:52 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, createCommentVNode, Fragment, withDirectives, toDisplayString, vShow } from "vue";
|
|
6
|
+
import { computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, createCommentVNode, Fragment, withDirectives, toDisplayString, vShow } 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";
|
|
@@ -76,14 +76,22 @@ const _sfc_main = create({
|
|
|
76
76
|
backgroundColor: isActive.value ? props.activeColor : props.inactiveColor
|
|
77
77
|
};
|
|
78
78
|
});
|
|
79
|
+
let updateType = "";
|
|
79
80
|
const onClick = (event) => {
|
|
80
81
|
if (props.disable || props.loading)
|
|
81
82
|
return;
|
|
82
83
|
const value = isActive.value ? props.inactiveValue : props.activeValue;
|
|
84
|
+
updateType = "click";
|
|
83
85
|
emit("update:modelValue", value);
|
|
84
|
-
emit("update:loading");
|
|
85
86
|
emit("change", value, event);
|
|
86
87
|
};
|
|
88
|
+
watch(() => props.modelValue, (v) => {
|
|
89
|
+
if (updateType == "click") {
|
|
90
|
+
updateType = "";
|
|
91
|
+
} else {
|
|
92
|
+
emit("change", v);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
87
95
|
return {
|
|
88
96
|
classes,
|
|
89
97
|
style,
|
package/dist/packages/_es/Tag.js
CHANGED