@nutui/nutui 3.1.12-beta.1 → 3.1.14
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 +56 -0
- package/README.md +139 -37
- package/dist/nutui.d.ts +9 -2
- package/dist/nutui.es.js +4830 -2950
- package/dist/nutui.umd.js +4910 -2953
- package/dist/packages/_es/ActionSheet.js +12 -13
- package/dist/packages/_es/Address.js +64 -77
- package/dist/packages/_es/Avatar.js +5 -4
- package/dist/packages/_es/BackTop.js +109 -72
- package/dist/packages/_es/Badge.js +5 -4
- package/dist/packages/_es/Barrage.js +57 -63
- package/dist/packages/_es/Button.js +6 -5
- package/dist/packages/_es/Calendar.js +18 -27
- package/dist/packages/_es/Card.js +8 -7
- package/dist/packages/_es/Cascader.js +547 -0
- package/dist/packages/_es/Cell.js +13 -5
- package/dist/packages/_es/CellGroup.js +14 -7
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +4 -9
- package/dist/packages/_es/CircleProgress.js +46 -142
- package/dist/packages/_es/Col.js +5 -4
- package/dist/packages/_es/Collapse.js +10 -35
- package/dist/packages/_es/CollapseItem.js +35 -80
- package/dist/packages/_es/CountDown.js +7 -10
- package/dist/packages/_es/CountUp.js +33 -34
- package/dist/packages/_es/DatePicker.js +219 -451
- package/dist/packages/_es/Dialog.js +98 -46
- package/dist/packages/_es/Divider.js +6 -5
- package/dist/packages/_es/Drag.js +50 -76
- package/dist/packages/_es/Elevator.js +53 -81
- package/dist/packages/_es/Empty.js +74 -0
- package/dist/packages/_es/FixedNav.js +9 -8
- package/dist/packages/_es/Form.js +23 -9
- package/dist/packages/_es/FormItem.js +5 -4
- package/dist/packages/_es/Grid.js +12 -0
- package/dist/packages/_es/GridItem.js +149 -0
- package/dist/packages/_es/Icon.js +40 -6
- package/dist/packages/_es/ImagePreview.js +158 -44
- package/dist/packages/_es/Indicator.js +66 -0
- package/dist/packages/_es/InfiniteLoading.js +109 -95
- package/dist/packages/_es/Input.js +21 -22
- package/dist/packages/_es/InputNumber.js +18 -24
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +14 -16
- package/dist/packages/_es/MenuItem.js +11 -9
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +31 -46
- package/dist/packages/_es/Notify.js +166 -30
- package/dist/packages/_es/NumberKeyboard.js +7 -9
- package/dist/packages/_es/OverLay.js +29 -22
- package/dist/packages/_es/Pagination.js +9 -8
- package/dist/packages/_es/Picker.js +447 -61
- package/dist/packages/_es/Popover.js +34 -161
- package/dist/packages/_es/Popup.js +77 -17
- package/dist/packages/_es/Price.js +7 -18
- package/dist/packages/_es/Progress.js +12 -23
- package/dist/packages/_es/Radio.js +3 -3
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +31 -38
- package/dist/packages/_es/Rate.js +35 -17
- package/dist/packages/_es/Row.js +5 -4
- package/dist/packages/_es/SearchBar.js +5 -7
- package/dist/packages/_es/ShortPassword.js +59 -89
- package/dist/packages/_es/Signature.js +71 -70
- package/dist/packages/_es/Skeleton.js +138 -0
- package/dist/packages/_es/Sku.js +43 -53
- package/dist/packages/_es/Step.js +8 -10
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +28 -43
- package/dist/packages/_es/Swiper.js +418 -17
- package/dist/packages/_es/SwiperItem.js +39 -14
- package/dist/packages/_es/Switch.js +47 -16
- package/dist/packages/_es/TabPane.js +5 -4
- package/dist/packages/_es/Tabbar.js +5 -4
- package/dist/packages/_es/TabbarItem.js +9 -8
- package/dist/packages/_es/Table.js +191 -0
- package/dist/packages/_es/Tabs.js +21 -23
- package/dist/packages/_es/Tag.js +6 -5
- package/dist/packages/_es/TextArea.js +12 -16
- package/dist/packages/_es/TimeDetail.js +5 -7
- package/dist/packages/_es/TimePannel.js +5 -7
- package/dist/packages/_es/TimeSelect.js +7 -12
- package/dist/packages/_es/Toast.js +178 -46
- package/dist/packages/_es/Uploader.js +149 -109
- package/dist/packages/_es/Video.js +405 -0
- package/dist/packages/_es/common.js +136 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +7 -58
- package/dist/packages/_es/index2.js +58 -43
- package/dist/packages/_es/index3.js +28 -411
- package/dist/packages/_es/plugin-vue_export-helper.js +13 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/util.js +1 -1
- package/dist/packages/cascader/index.scss +81 -0
- package/dist/packages/cellgroup/index.scss +9 -0
- package/dist/packages/dialog/index.scss +17 -0
- package/dist/packages/drag/index.scss +4 -0
- package/dist/packages/empty/index.scss +33 -0
- package/dist/packages/fixednav/index.scss +6 -1
- package/dist/packages/formitem/index.scss +4 -1
- package/dist/packages/grid/index.scss +10 -0
- package/dist/packages/griditem/index.scss +92 -0
- package/dist/packages/icon/index.scss +2 -1
- package/dist/packages/indicator/index.scss +48 -0
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/popover/index.scss +2 -2
- package/dist/packages/rate/index.scss +1 -0
- package/dist/packages/skeleton/index.scss +57 -0
- package/dist/packages/table/index.scss +81 -0
- package/dist/packages/tabs/index.scss +16 -0
- package/dist/packages/textarea/index.scss +1 -0
- package/dist/packages/timedetail/index.scss +1 -2
- package/dist/packages/timeselect/index.scss +3 -0
- package/dist/packages/toast/index.scss +6 -0
- package/dist/style.css +1 -1
- package/dist/style.es.js +2 -1
- package/dist/styles/font/config.json +2 -1
- package/dist/styles/font/demo_index.html +26 -3
- package/dist/styles/font/iconfont.css +7 -3
- package/dist/styles/font/iconfont.js +31 -32
- package/dist/styles/font/iconfont.json +7 -0
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +40 -33
- package/dist/styles/variables.scss +54 -1
- package/package.json +2 -3
- package/dist/packages/_es/commonProps.js +0 -30
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +0 -44
- package/dist/packages/_es/use-lock-scroll.js +0 -23
|
@@ -1,19 +1,38 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1
20
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
|
|
3
22
|
* (c) 2021 @jdf2e.
|
|
4
23
|
* Released under the MIT License.
|
|
5
24
|
*/
|
|
6
|
-
import { watch, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, vShow } from "vue";
|
|
25
|
+
import { reactive, onMounted, watch, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, Fragment, createTextVNode, toDisplayString, vShow, createVNode, render } from "vue";
|
|
7
26
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import
|
|
9
|
-
import "./
|
|
27
|
+
import Popup from "./Popup.js";
|
|
28
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
29
|
import "./OverLay.js";
|
|
11
|
-
import "./
|
|
30
|
+
import "./Icon.js";
|
|
12
31
|
import "./pxCheck.js";
|
|
13
32
|
const { componentName, create } = createComponent("notify");
|
|
14
|
-
|
|
33
|
+
const _sfc_main = create({
|
|
15
34
|
components: {
|
|
16
|
-
[
|
|
35
|
+
[Popup.name]: Popup
|
|
17
36
|
},
|
|
18
37
|
props: {
|
|
19
38
|
id: String,
|
|
@@ -29,16 +48,24 @@ var _sfc_main = create({
|
|
|
29
48
|
type: String,
|
|
30
49
|
default: "danger"
|
|
31
50
|
},
|
|
32
|
-
|
|
51
|
+
showPopup: {
|
|
33
52
|
type: Boolean,
|
|
34
53
|
default: false
|
|
35
|
-
}
|
|
54
|
+
},
|
|
55
|
+
onClose: Function,
|
|
56
|
+
onClick: Function,
|
|
57
|
+
unmount: Function
|
|
36
58
|
},
|
|
37
|
-
|
|
38
|
-
setup(props, { emit }) {
|
|
59
|
+
setup(props, { slots }) {
|
|
39
60
|
let timer = null;
|
|
40
|
-
const
|
|
41
|
-
|
|
61
|
+
const state = reactive({
|
|
62
|
+
mounted: false
|
|
63
|
+
});
|
|
64
|
+
onMounted(() => {
|
|
65
|
+
state.mounted = true;
|
|
66
|
+
});
|
|
67
|
+
const clickCover = () => {
|
|
68
|
+
props.onClick && props.onClick();
|
|
42
69
|
};
|
|
43
70
|
const clearTimer = () => {
|
|
44
71
|
if (timer) {
|
|
@@ -47,14 +74,8 @@ var _sfc_main = create({
|
|
|
47
74
|
}
|
|
48
75
|
};
|
|
49
76
|
const hide = () => {
|
|
50
|
-
|
|
51
|
-
emit("closed");
|
|
77
|
+
state.mounted = false;
|
|
52
78
|
};
|
|
53
|
-
watch(() => props.visible, (value) => {
|
|
54
|
-
if (value) {
|
|
55
|
-
show();
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
79
|
const show = () => {
|
|
59
80
|
clearTimer();
|
|
60
81
|
if (props.duration) {
|
|
@@ -63,35 +84,150 @@ var _sfc_main = create({
|
|
|
63
84
|
}, props.duration);
|
|
64
85
|
}
|
|
65
86
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
87
|
+
if (props.duration) {
|
|
88
|
+
show();
|
|
89
|
+
}
|
|
90
|
+
watch(() => props.duration, (val) => {
|
|
91
|
+
if (val) {
|
|
92
|
+
show();
|
|
70
93
|
}
|
|
94
|
+
});
|
|
95
|
+
const onAfterLeave = () => {
|
|
96
|
+
clearTimer();
|
|
97
|
+
props.unmount && props.unmount(props.id);
|
|
98
|
+
props.onClose && props.onClose();
|
|
71
99
|
};
|
|
72
|
-
return { hide, onAfterLeave,
|
|
100
|
+
return { state, hide, onAfterLeave, clickCover };
|
|
73
101
|
}
|
|
74
102
|
});
|
|
75
103
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
76
104
|
return openBlock(), createBlock(Transition, {
|
|
77
|
-
name: "
|
|
105
|
+
name: "toast-fade",
|
|
78
106
|
onAfterLeave: _ctx.onAfterLeave
|
|
79
107
|
}, {
|
|
80
108
|
default: withCtx(() => [
|
|
81
109
|
withDirectives(createElementVNode("view", {
|
|
82
110
|
class: normalizeClass(["popup-top", "nut-notify", `nut-notify--${_ctx.type}`, { className: _ctx.className }]),
|
|
83
111
|
style: normalizeStyle({ color: _ctx.color, background: _ctx.background }),
|
|
84
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.
|
|
112
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
|
|
85
113
|
}, [
|
|
86
114
|
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
87
115
|
createTextVNode(toDisplayString(_ctx.msg), 1)
|
|
88
116
|
], 64))
|
|
89
117
|
], 6), [
|
|
90
|
-
[vShow, _ctx.
|
|
118
|
+
[vShow, _ctx.state.mounted]
|
|
91
119
|
])
|
|
92
120
|
]),
|
|
93
121
|
_: 3
|
|
94
122
|
}, 8, ["onAfterLeave"]);
|
|
95
123
|
}
|
|
96
|
-
_sfc_main
|
|
97
|
-
|
|
124
|
+
var Notify = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
125
|
+
const defaultOptions = {
|
|
126
|
+
type: "base",
|
|
127
|
+
showPopup: false,
|
|
128
|
+
msg: "",
|
|
129
|
+
color: void 0,
|
|
130
|
+
background: void 0,
|
|
131
|
+
duration: 3e3,
|
|
132
|
+
className: "",
|
|
133
|
+
onClosed: null,
|
|
134
|
+
onClick: null,
|
|
135
|
+
onOpened: null,
|
|
136
|
+
textTimer: null,
|
|
137
|
+
unmount: null
|
|
138
|
+
};
|
|
139
|
+
let idsMap = [];
|
|
140
|
+
let optsMap = [];
|
|
141
|
+
const clearNotify = (id) => {
|
|
142
|
+
if (id) {
|
|
143
|
+
const container = document.getElementById(id);
|
|
144
|
+
optsMap = optsMap.filter((item) => item.id !== id);
|
|
145
|
+
idsMap = idsMap.filter((item) => item !== id);
|
|
146
|
+
if (container) {
|
|
147
|
+
document.body.removeChild(container);
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
idsMap.forEach((item) => {
|
|
151
|
+
const container = document.getElementById(item);
|
|
152
|
+
if (container) {
|
|
153
|
+
document.body.removeChild(container);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
optsMap = [];
|
|
157
|
+
idsMap = [];
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const updateNotify = (opts) => {
|
|
161
|
+
const container = document.getElementById(opts.id);
|
|
162
|
+
if (container) {
|
|
163
|
+
const currentOpt = optsMap.find((item) => item.id === opts.id);
|
|
164
|
+
if (currentOpt) {
|
|
165
|
+
opts = __spreadValues(__spreadValues(__spreadValues({}, defaultOptions), currentOpt), opts);
|
|
166
|
+
} else {
|
|
167
|
+
opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
|
|
168
|
+
}
|
|
169
|
+
const instance = createVNode(Notify, opts);
|
|
170
|
+
render(instance, container);
|
|
171
|
+
return instance.component.ctx;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const mountNotify = (opts) => {
|
|
175
|
+
opts.unmount = clearNotify;
|
|
176
|
+
let _id;
|
|
177
|
+
if (opts.id) {
|
|
178
|
+
_id = opts.id;
|
|
179
|
+
if (idsMap.find((item) => item === opts.id)) {
|
|
180
|
+
return updateNotify(opts);
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
_id = new Date().getTime() + "";
|
|
184
|
+
}
|
|
185
|
+
opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
|
|
186
|
+
opts.id = _id;
|
|
187
|
+
idsMap.push(opts.id);
|
|
188
|
+
optsMap.push(opts);
|
|
189
|
+
const container = document.createElement("view");
|
|
190
|
+
container.id = opts.id;
|
|
191
|
+
const instance = createVNode(Notify, opts);
|
|
192
|
+
render(instance, container);
|
|
193
|
+
document.body.appendChild(container);
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
instance.showPopup = true;
|
|
196
|
+
}, 0);
|
|
197
|
+
return instance.component.ctx;
|
|
198
|
+
};
|
|
199
|
+
const errorMsg = (msg) => {
|
|
200
|
+
if (!msg) {
|
|
201
|
+
console.warn("[NutUI Notify]: msg\u4E0D\u80FD\u4E3A\u7A7A");
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
const NotifyFunction = {
|
|
206
|
+
text(msg, obj = {}) {
|
|
207
|
+
errorMsg(msg);
|
|
208
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg }));
|
|
209
|
+
},
|
|
210
|
+
primary(msg, obj = {}) {
|
|
211
|
+
errorMsg(msg);
|
|
212
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "primary" }));
|
|
213
|
+
},
|
|
214
|
+
success(msg, obj = {}) {
|
|
215
|
+
errorMsg(msg);
|
|
216
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "success" }));
|
|
217
|
+
},
|
|
218
|
+
danger(msg, obj = {}) {
|
|
219
|
+
errorMsg(msg);
|
|
220
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "danger" }));
|
|
221
|
+
},
|
|
222
|
+
warn(msg, obj = {}) {
|
|
223
|
+
errorMsg(msg);
|
|
224
|
+
return mountNotify(__spreadProps(__spreadValues({}, obj), { msg, type: "warning" }));
|
|
225
|
+
},
|
|
226
|
+
hide() {
|
|
227
|
+
clearNotify();
|
|
228
|
+
},
|
|
229
|
+
install(app) {
|
|
230
|
+
app.config.globalProperties.$notify = NotifyFunction;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
export { Notify, NotifyFunction, NotifyFunction as default };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { ref, computed, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList, normalizeClass, createTextVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
8
9
|
const { create } = createComponent("numberkeyboard");
|
|
9
|
-
|
|
10
|
+
const _sfc_main = create({
|
|
10
11
|
props: {
|
|
11
12
|
title: {
|
|
12
13
|
type: String,
|
|
@@ -43,6 +44,7 @@ var _sfc_main = create({
|
|
|
43
44
|
},
|
|
44
45
|
emits: ["input", "delete", "close", "update:value"],
|
|
45
46
|
setup(props, { emit }) {
|
|
47
|
+
console.log(props.overlay);
|
|
46
48
|
const clickKeyIndex = ref(void 0);
|
|
47
49
|
const show = ref(props.visible);
|
|
48
50
|
const root = ref();
|
|
@@ -234,11 +236,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
234
236
|
onClick: _cache[5] || (_cache[5] = ($event) => _ctx.closeBoard())
|
|
235
237
|
}, [
|
|
236
238
|
createElementVNode("div", {
|
|
237
|
-
class: normalizeClass([
|
|
238
|
-
"key",
|
|
239
|
-
"finish",
|
|
240
|
-
{ activeFinsh: _ctx.clickKeyIndex == "finish" }
|
|
241
|
-
])
|
|
239
|
+
class: normalizeClass(["key", "finish", { activeFinsh: _ctx.clickKeyIndex == "finish" }])
|
|
242
240
|
}, " \u5B8C\u6210 ", 2)
|
|
243
241
|
])) : createCommentVNode("", true)
|
|
244
242
|
])) : createCommentVNode("", true)
|
|
@@ -248,5 +246,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
248
246
|
_: 1
|
|
249
247
|
}, 8, ["visible", "overlay"]);
|
|
250
248
|
}
|
|
251
|
-
_sfc_main
|
|
252
|
-
export {
|
|
249
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
250
|
+
export { index as default };
|
|
@@ -14,16 +14,14 @@ var __spreadValues = (a, b) => {
|
|
|
14
14
|
}
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
|
-
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
18
|
-
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
19
|
-
};
|
|
20
17
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
18
|
+
* @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
|
|
22
19
|
* (c) 2021 @jdf2e.
|
|
23
20
|
* Released under the MIT License.
|
|
24
21
|
*/
|
|
25
|
-
import { computed, openBlock, createBlock, Transition, withCtx, withDirectives,
|
|
22
|
+
import { computed, watch, onDeactivated, onBeforeUnmount, onMounted, onActivated, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, withModifiers, normalizeStyle, renderSlot, vShow } from "vue";
|
|
26
23
|
import { c as createComponent } from "./component.js";
|
|
24
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
27
25
|
const { componentName, create } = createComponent("overlay");
|
|
28
26
|
const overlayProps = {
|
|
29
27
|
visible: {
|
|
@@ -54,7 +52,7 @@ const overlayProps = {
|
|
|
54
52
|
default: true
|
|
55
53
|
}
|
|
56
54
|
};
|
|
57
|
-
|
|
55
|
+
const _sfc_main = create({
|
|
58
56
|
props: overlayProps,
|
|
59
57
|
emits: ["click", "update:visible"],
|
|
60
58
|
setup(props, { emit }) {
|
|
@@ -65,47 +63,56 @@ var _sfc_main = create({
|
|
|
65
63
|
[props.overlayClass]: true
|
|
66
64
|
};
|
|
67
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);
|
|
68
81
|
const style = computed(() => {
|
|
69
82
|
return __spreadValues({
|
|
70
83
|
animationDuration: `${props.duration}s`,
|
|
71
84
|
zIndex: props.zIndex
|
|
72
85
|
}, props.overlayStyle);
|
|
73
86
|
});
|
|
87
|
+
const touchmove = (e) => {
|
|
88
|
+
if (props.lockScroll)
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
};
|
|
74
91
|
const onClick = (e) => {
|
|
75
92
|
emit("click", e);
|
|
76
93
|
if (props.closeOnClickOverlay) {
|
|
77
94
|
emit("update:visible", false);
|
|
78
95
|
}
|
|
79
96
|
};
|
|
80
|
-
return { classes, style, onClick };
|
|
97
|
+
return { classes, style, touchmove, onClick };
|
|
81
98
|
}
|
|
82
99
|
});
|
|
83
100
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
84
101
|
return openBlock(), createBlock(Transition, { name: "overlay-fade" }, {
|
|
85
102
|
default: withCtx(() => [
|
|
86
|
-
|
|
87
|
-
key: 0,
|
|
88
|
-
class: normalizeClass(_ctx.classes),
|
|
89
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
|
|
90
|
-
style: normalizeStyle(_ctx.style),
|
|
91
|
-
"catch-move": true
|
|
92
|
-
}, [
|
|
93
|
-
renderSlot(_ctx.$slots, "default")
|
|
94
|
-
], 6)), [
|
|
95
|
-
[vShow, _ctx.visible]
|
|
96
|
-
]) : withDirectives((openBlock(), createElementBlock("view", {
|
|
97
|
-
key: 1,
|
|
103
|
+
withDirectives(createElementVNode("view", {
|
|
98
104
|
class: normalizeClass(_ctx.classes),
|
|
105
|
+
onTouchmove: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.touchmove && _ctx.touchmove(...args), ["stop"])),
|
|
99
106
|
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
|
|
100
107
|
style: normalizeStyle(_ctx.style)
|
|
101
108
|
}, [
|
|
102
109
|
renderSlot(_ctx.$slots, "default")
|
|
103
|
-
],
|
|
110
|
+
], 38), [
|
|
104
111
|
[vShow, _ctx.visible]
|
|
105
112
|
])
|
|
106
113
|
]),
|
|
107
114
|
_: 3
|
|
108
115
|
});
|
|
109
116
|
}
|
|
110
|
-
_sfc_main
|
|
111
|
-
export {
|
|
117
|
+
var overlay = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
118
|
+
export { overlay as default, overlayProps };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @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
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
8
9
|
const { componentName, create } = createComponent("pagination");
|
|
9
|
-
|
|
10
|
+
const _sfc_main = create({
|
|
10
11
|
props: {
|
|
11
12
|
modelValue: {
|
|
12
13
|
type: Number,
|
|
@@ -66,13 +67,13 @@ var _sfc_main = create({
|
|
|
66
67
|
return { number, text, active };
|
|
67
68
|
};
|
|
68
69
|
const pages = computed(() => {
|
|
70
|
+
if (mode.value == "simple")
|
|
71
|
+
return;
|
|
69
72
|
let items = [];
|
|
70
73
|
const pageCount = countRef.value;
|
|
71
74
|
const pageSize = showPageSize.value;
|
|
72
75
|
let startPage = 1;
|
|
73
76
|
let endPage = pageCount;
|
|
74
|
-
if (mode.value == "simple")
|
|
75
|
-
return;
|
|
76
77
|
const partialShow = pageCount > pageSize;
|
|
77
78
|
if (partialShow) {
|
|
78
79
|
startPage = Math.max(modelValue.value - Math.floor(pageSize / 2), 1);
|
|
@@ -133,9 +134,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
133
134
|
])
|
|
134
135
|
], 2),
|
|
135
136
|
_ctx.mode == "multi" ? (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
136
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item,
|
|
137
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item, index2) => {
|
|
137
138
|
return openBlock(), createElementBlock("view", {
|
|
138
|
-
key:
|
|
139
|
+
key: index2 + "pagination",
|
|
139
140
|
class: normalizeClass(["nut-pagination-item", item.active ? "active" : ""]),
|
|
140
141
|
onClick: ($event) => _ctx.select(item.number, true)
|
|
141
142
|
}, [
|
|
@@ -158,5 +159,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
158
159
|
], 2)
|
|
159
160
|
]);
|
|
160
161
|
}
|
|
161
|
-
_sfc_main
|
|
162
|
-
export {
|
|
162
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
163
|
+
export { index as default };
|