@nutui/nutui 3.1.18-beta.0 → 3.1.19-beta.1
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 +41 -0
- package/LICENSE +1 -1
- package/README.md +6 -0
- package/dist/nutui.d.ts +39 -36
- package/dist/nutui.es.js +13149 -11288
- package/dist/nutui.umd.js +13156 -11381
- package/dist/packages/_es/ActionSheet.js +13 -19
- package/dist/packages/_es/Address.js +70 -55
- package/dist/packages/_es/Audio.js +13 -13
- package/dist/packages/_es/AudioOperate.js +125 -0
- package/dist/packages/_es/Avatar.js +4 -4
- package/dist/packages/_es/BackTop.js +69 -108
- package/dist/packages/_es/Badge.js +4 -4
- package/dist/packages/_es/Barrage.js +63 -56
- package/dist/packages/_es/Button.js +3 -3
- package/dist/packages/_es/Calendar.js +30 -702
- package/dist/packages/_es/CalendarItem.js +10 -0
- package/dist/packages/_es/Card.js +7 -6
- package/dist/packages/_es/Cascader.js +8 -8
- package/dist/packages/_es/Cell.js +27 -27
- package/dist/packages/_es/CellGroup.js +2 -2
- package/dist/packages/_es/Checkbox.js +4 -4
- package/dist/packages/_es/CheckboxGroup.js +3 -3
- package/dist/packages/_es/CircleProgress.js +150 -41
- package/dist/packages/_es/Col.js +2 -2
- package/dist/packages/_es/Collapse.js +35 -9
- package/dist/packages/_es/CollapseItem.js +79 -38
- package/dist/packages/_es/CountDown.js +8 -6
- package/dist/packages/_es/CountUp.js +31 -30
- package/dist/packages/_es/DatePicker.js +81 -44
- package/dist/packages/_es/Dialog.js +7 -83
- package/dist/packages/_es/Divider.js +5 -5
- package/dist/packages/_es/Drag.js +93 -55
- package/dist/packages/_es/Elevator.js +75 -50
- package/dist/packages/_es/Empty.js +4 -4
- package/dist/packages/_es/FixedNav.js +6 -6
- package/dist/packages/_es/Form.js +11 -9
- package/dist/packages/_es/FormItem.js +9 -6
- package/dist/packages/_es/Grid.js +2 -2
- package/dist/packages/_es/GridItem.js +9 -27
- package/dist/packages/_es/Icon.js +2 -2
- package/dist/packages/_es/ImagePreview.js +14 -83
- package/dist/packages/_es/Indicator.js +4 -4
- package/dist/packages/_es/InfiniteLoading.js +94 -108
- package/dist/packages/_es/Input.js +297 -73
- package/dist/packages/_es/InputNumber.js +24 -17
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/List.js +131 -0
- package/dist/packages/_es/Menu.js +16 -13
- package/dist/packages/_es/MenuItem.js +8 -8
- package/dist/packages/_es/Navbar.js +17 -12
- package/dist/packages/_es/NoticeBar.js +47 -39
- package/dist/packages/_es/Notify.js +28 -163
- package/dist/packages/_es/NumberKeyboard.js +4 -4
- package/dist/packages/_es/OldPicker.js +486 -0
- package/dist/packages/_es/OverLay.js +6 -26
- package/dist/packages/_es/Pagination.js +8 -8
- package/dist/packages/_es/Picker.js +192 -163
- package/dist/packages/_es/Popover.js +155 -30
- package/dist/packages/_es/Popup.js +7 -70
- package/dist/packages/_es/Price.js +18 -6
- package/dist/packages/_es/Progress.js +29 -27
- package/dist/packages/_es/PullRefresh.js +363 -0
- package/dist/packages/_es/Radio.js +4 -4
- package/dist/packages/_es/RadioGroup.js +2 -2
- package/dist/packages/_es/Range.js +169 -46
- package/dist/packages/_es/Rate.js +17 -20
- package/dist/packages/_es/Row.js +2 -2
- package/dist/packages/_es/SearchBar.js +9 -7
- package/dist/packages/_es/ShortPassword.js +90 -68
- package/dist/packages/_es/SideNavBar.js +6 -17
- package/dist/packages/_es/SideNavBarItem.js +2 -2
- package/dist/packages/_es/Signature.js +70 -70
- package/dist/packages/_es/Skeleton.js +9 -12
- package/dist/packages/_es/Sku.js +40 -31
- package/dist/packages/_es/Step.js +28 -12
- package/dist/packages/_es/Steps.js +8 -3
- package/dist/packages/_es/Sticky.js +29 -24
- package/dist/packages/_es/SubSideNavBar.js +2 -2
- package/dist/packages/_es/Swipe.js +40 -27
- package/dist/packages/_es/Swiper.js +32 -14
- package/dist/packages/_es/SwiperItem.js +2 -2
- package/dist/packages/_es/Switch.js +4 -4
- package/dist/packages/_es/TabPane.js +2 -2
- package/dist/packages/_es/Tabbar.js +4 -4
- package/dist/packages/_es/TabbarItem.js +28 -23
- package/dist/packages/_es/Table.js +14 -14
- package/dist/packages/_es/Tabs.js +19 -15
- package/dist/packages/_es/Tag.js +14 -8
- package/dist/packages/_es/TextArea.js +49 -15
- package/dist/packages/_es/TimeDetail.js +5 -4
- package/dist/packages/_es/TimePannel.js +4 -4
- package/dist/packages/_es/TimeSelect.js +9 -8
- package/dist/packages/_es/Toast.js +42 -171
- package/dist/packages/_es/Uploader.js +108 -139
- package/dist/packages/_es/Video.js +14 -10
- package/dist/packages/_es/common.js +2 -2
- package/dist/packages/_es/component.js +2 -2
- package/dist/packages/_es/index.js +45 -7
- package/dist/packages/_es/index.taro.js +719 -0
- package/dist/packages/_es/index2.js +2 -2
- package/dist/packages/_es/index3.js +57 -29
- package/dist/packages/_es/index4.js +414 -57
- package/dist/packages/_es/plugin-vue_export-helper.js +2 -2
- package/dist/packages/_es/pxCheck.js +2 -2
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/_es/util.js +2 -2
- package/dist/packages/badge/index.scss +11 -13
- package/dist/packages/button/index.scss +1 -0
- package/dist/packages/calendar/index.scss +9 -4
- package/dist/packages/calendaritem/index.scss +0 -207
- package/dist/packages/cell/index.scss +6 -6
- package/dist/packages/checkbox/index.scss +4 -3
- package/dist/packages/collapseitem/index.scss +21 -11
- package/dist/packages/countdown/index.scss +3 -1
- package/dist/packages/divider/index.scss +8 -8
- package/dist/packages/elevator/index.scss +36 -36
- package/dist/packages/formitem/index.scss +15 -8
- package/dist/packages/indicator/index.scss +1 -1
- package/dist/packages/input/index.scss +70 -24
- package/dist/packages/inputnumber/index.scss +4 -2
- package/dist/packages/list/index.scss +24 -0
- package/dist/packages/menu/index.scss +3 -3
- package/dist/packages/navbar/index.scss +28 -8
- package/dist/packages/noticebar/index.scss +7 -8
- package/dist/packages/notify/index.scss +9 -0
- package/dist/packages/numberkeyboard/index.scss +22 -21
- package/dist/packages/oldpicker/index.scss +131 -0
- package/dist/packages/picker/index.scss +38 -32
- package/dist/packages/progress/index.scss +6 -5
- package/dist/packages/radio/index.scss +7 -6
- package/dist/packages/range/index.scss +109 -2
- package/dist/packages/searchbar/index.scss +7 -7
- package/dist/packages/sidenavbaritem/index.scss +5 -5
- package/dist/packages/step/index.scss +29 -29
- package/dist/packages/subsidenavbar/index.scss +10 -8
- package/dist/packages/tabbaritem/index.scss +15 -0
- package/dist/packages/timedetail/index.scss +13 -13
- package/dist/packages/timepannel/index.scss +7 -7
- package/dist/packages/timeselect/index.scss +3 -3
- package/dist/packages/uploader/index.scss +6 -6
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +64 -62
- package/dist/styles/themes/jdt.scss +91 -0
- package/dist/styles/variables-jdt.scss +728 -0
- package/dist/styles/variables.scss +250 -44
- package/package.json +2 -1
- package/dist/packages/_es/raf.js +0 -19
- package/dist/styles/themes/jdd.scss +0 -2
|
@@ -1,28 +1,9 @@
|
|
|
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));
|
|
20
1
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
22
|
-
* (c)
|
|
2
|
+
* @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
|
|
3
|
+
* (c) 2022 @jdf2e.
|
|
23
4
|
* Released under the MIT License.
|
|
24
5
|
*/
|
|
25
|
-
import {
|
|
6
|
+
import { watch, computed, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, createElementBlock, createVNode, createCommentVNode, toDisplayString, vShow } from "vue";
|
|
26
7
|
import { c as createComponent } from "./component.js";
|
|
27
8
|
import _sfc_main$1 from "./Icon.js";
|
|
28
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
@@ -43,7 +24,10 @@ const _sfc_main = create({
|
|
|
43
24
|
type: Boolean,
|
|
44
25
|
default: true
|
|
45
26
|
},
|
|
46
|
-
type:
|
|
27
|
+
type: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "text"
|
|
30
|
+
},
|
|
47
31
|
customClass: String,
|
|
48
32
|
bottom: {
|
|
49
33
|
type: String,
|
|
@@ -53,10 +37,6 @@ const _sfc_main = create({
|
|
|
53
37
|
type: [String, Number],
|
|
54
38
|
default: "base"
|
|
55
39
|
},
|
|
56
|
-
iconSize: {
|
|
57
|
-
type: String,
|
|
58
|
-
default: "20"
|
|
59
|
-
},
|
|
60
40
|
icon: String,
|
|
61
41
|
textAlignCenter: {
|
|
62
42
|
type: Boolean,
|
|
@@ -87,17 +67,15 @@ const _sfc_main = create({
|
|
|
87
67
|
closeOnClickOverlay: {
|
|
88
68
|
type: Boolean,
|
|
89
69
|
default: false
|
|
70
|
+
},
|
|
71
|
+
visible: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false
|
|
90
74
|
}
|
|
91
75
|
},
|
|
92
|
-
emits: ["
|
|
76
|
+
emits: ["update:visible", "closed"],
|
|
93
77
|
setup(props, { emit }) {
|
|
94
78
|
let timer;
|
|
95
|
-
const state = reactive({
|
|
96
|
-
mounted: false
|
|
97
|
-
});
|
|
98
|
-
onMounted(() => {
|
|
99
|
-
state.mounted = true;
|
|
100
|
-
});
|
|
101
79
|
const clearTimer = () => {
|
|
102
80
|
if (timer) {
|
|
103
81
|
clearTimeout(timer);
|
|
@@ -105,7 +83,8 @@ const _sfc_main = create({
|
|
|
105
83
|
}
|
|
106
84
|
};
|
|
107
85
|
const hide = () => {
|
|
108
|
-
|
|
86
|
+
emit("update:visible", false);
|
|
87
|
+
emit("closed");
|
|
109
88
|
};
|
|
110
89
|
const show = () => {
|
|
111
90
|
clearTimer();
|
|
@@ -118,13 +97,9 @@ const _sfc_main = create({
|
|
|
118
97
|
const clickCover = () => {
|
|
119
98
|
if (props.closeOnClickOverlay) {
|
|
120
99
|
hide();
|
|
121
|
-
emit("close");
|
|
122
100
|
}
|
|
123
101
|
};
|
|
124
|
-
|
|
125
|
-
show();
|
|
126
|
-
}
|
|
127
|
-
watch(() => props.duration, (val) => {
|
|
102
|
+
watch(() => props.visible, (val) => {
|
|
128
103
|
if (val) {
|
|
129
104
|
show();
|
|
130
105
|
}
|
|
@@ -136,6 +111,18 @@ const _sfc_main = create({
|
|
|
136
111
|
return !!props.icon;
|
|
137
112
|
}
|
|
138
113
|
});
|
|
114
|
+
const iconName = computed(() => {
|
|
115
|
+
if (props.icon) {
|
|
116
|
+
return props.icon;
|
|
117
|
+
} else {
|
|
118
|
+
return {
|
|
119
|
+
success: "success",
|
|
120
|
+
fail: "failure",
|
|
121
|
+
warn: "tips",
|
|
122
|
+
loading: "loading"
|
|
123
|
+
}[props.type];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
139
126
|
const toastBodyClass = computed(() => {
|
|
140
127
|
return [
|
|
141
128
|
"nut-toast",
|
|
@@ -148,15 +135,15 @@ const _sfc_main = create({
|
|
|
148
135
|
];
|
|
149
136
|
});
|
|
150
137
|
const onAfterLeave = () => {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
138
|
+
if (props.visible) {
|
|
139
|
+
clearTimer();
|
|
140
|
+
hide();
|
|
141
|
+
}
|
|
154
142
|
};
|
|
155
143
|
return {
|
|
156
|
-
state,
|
|
157
|
-
hide,
|
|
158
144
|
clickCover,
|
|
159
145
|
hasIcon,
|
|
146
|
+
iconName,
|
|
160
147
|
toastBodyClass,
|
|
161
148
|
onAfterLeave
|
|
162
149
|
};
|
|
@@ -186,7 +173,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
186
173
|
}),
|
|
187
174
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
|
|
188
175
|
}, [
|
|
189
|
-
|
|
176
|
+
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock("view", {
|
|
177
|
+
key: 1,
|
|
190
178
|
class: "nut-toast-inner",
|
|
191
179
|
style: normalizeStyle({
|
|
192
180
|
"text-align": _ctx.textAlignCenter ? "center" : "left",
|
|
@@ -195,140 +183,23 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
195
183
|
}, [
|
|
196
184
|
_ctx.hasIcon ? (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
197
185
|
createVNode(_component_nut_icon, {
|
|
198
|
-
size:
|
|
186
|
+
size: "20",
|
|
199
187
|
color: "#ffffff",
|
|
200
|
-
name: _ctx.
|
|
201
|
-
}, null, 8, ["
|
|
188
|
+
name: _ctx.iconName
|
|
189
|
+
}, null, 8, ["name"])
|
|
202
190
|
])) : createCommentVNode("", true),
|
|
203
191
|
_ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
|
|
204
192
|
createElementVNode("view", {
|
|
205
193
|
class: "nut-toast-text",
|
|
206
194
|
innerHTML: _ctx.msg
|
|
207
195
|
}, null, 8, _hoisted_3)
|
|
208
|
-
], 4)
|
|
196
|
+
], 4))
|
|
209
197
|
], 6), [
|
|
210
|
-
[vShow, _ctx.
|
|
198
|
+
[vShow, _ctx.visible]
|
|
211
199
|
])
|
|
212
200
|
]),
|
|
213
|
-
_:
|
|
201
|
+
_: 3
|
|
214
202
|
}, 8, ["onAfterLeave"]);
|
|
215
203
|
}
|
|
216
|
-
var
|
|
217
|
-
|
|
218
|
-
msg: "",
|
|
219
|
-
id: "",
|
|
220
|
-
duration: 2e3,
|
|
221
|
-
center: true,
|
|
222
|
-
type: "text",
|
|
223
|
-
title: "",
|
|
224
|
-
customClass: "",
|
|
225
|
-
bottom: "30px",
|
|
226
|
-
size: "base",
|
|
227
|
-
iconSize: "20",
|
|
228
|
-
icon: null,
|
|
229
|
-
textAlignCenter: true,
|
|
230
|
-
loadingRotate: true,
|
|
231
|
-
bgColor: "",
|
|
232
|
-
onClose: null,
|
|
233
|
-
unmount: null,
|
|
234
|
-
cover: false,
|
|
235
|
-
coverColor: "",
|
|
236
|
-
closeOnClickOverlay: false
|
|
237
|
-
};
|
|
238
|
-
let idsMap = [];
|
|
239
|
-
let optsMap = [];
|
|
240
|
-
const clearToast = (id) => {
|
|
241
|
-
if (id) {
|
|
242
|
-
const container = document.getElementById(id);
|
|
243
|
-
optsMap = optsMap.filter((item) => item.id !== id);
|
|
244
|
-
idsMap = idsMap.filter((item) => item !== id);
|
|
245
|
-
if (container) {
|
|
246
|
-
document.body.removeChild(container);
|
|
247
|
-
}
|
|
248
|
-
} else {
|
|
249
|
-
idsMap.forEach((item) => {
|
|
250
|
-
const container = document.getElementById(item);
|
|
251
|
-
if (container) {
|
|
252
|
-
document.body.removeChild(container);
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
optsMap = [];
|
|
256
|
-
idsMap = [];
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
const updateToast = (opts) => {
|
|
260
|
-
const container = document.getElementById(opts.id);
|
|
261
|
-
if (container) {
|
|
262
|
-
const currentOpt = optsMap.find((item) => item.id === opts.id);
|
|
263
|
-
if (currentOpt) {
|
|
264
|
-
opts = __spreadValues(__spreadValues(__spreadValues({}, defaultOptions), currentOpt), opts);
|
|
265
|
-
} else {
|
|
266
|
-
opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
|
|
267
|
-
}
|
|
268
|
-
const instance = createVNode(Toast, opts);
|
|
269
|
-
render(instance, container);
|
|
270
|
-
return instance.component.ctx;
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
const mountToast = (opts) => {
|
|
274
|
-
opts.unmount = clearToast;
|
|
275
|
-
let _id;
|
|
276
|
-
if (opts.id) {
|
|
277
|
-
_id = opts.id;
|
|
278
|
-
if (idsMap.find((item) => item === opts.id)) {
|
|
279
|
-
return updateToast(opts);
|
|
280
|
-
}
|
|
281
|
-
} else {
|
|
282
|
-
_id = new Date().getTime() + "";
|
|
283
|
-
}
|
|
284
|
-
opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
|
|
285
|
-
opts.id = _id;
|
|
286
|
-
idsMap.push(opts.id);
|
|
287
|
-
optsMap.push(opts);
|
|
288
|
-
const container = document.createElement("div");
|
|
289
|
-
container.id = opts.id;
|
|
290
|
-
const instance = createVNode(Toast, opts);
|
|
291
|
-
render(instance, container);
|
|
292
|
-
document.body.appendChild(container);
|
|
293
|
-
return instance.component.ctx;
|
|
294
|
-
};
|
|
295
|
-
const errorMsg = (msg) => {
|
|
296
|
-
if (!msg) {
|
|
297
|
-
console.warn("[NutUI Toast]: msg\u4E0D\u80FD\u4E3A\u7A7A");
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
const ToastFunction = {
|
|
302
|
-
text(msg, opts = {}) {
|
|
303
|
-
errorMsg(msg);
|
|
304
|
-
return mountToast(__spreadProps(__spreadValues({}, opts), { type: "text", msg }));
|
|
305
|
-
},
|
|
306
|
-
success(msg, opts = {}) {
|
|
307
|
-
errorMsg(msg);
|
|
308
|
-
return mountToast(__spreadProps(__spreadValues({ icon: "success" }, opts), { msg, type: "success" }));
|
|
309
|
-
},
|
|
310
|
-
fail(msg, opts = {}) {
|
|
311
|
-
errorMsg(msg);
|
|
312
|
-
return mountToast(__spreadProps(__spreadValues({ icon: "failure" }, opts), { msg, type: "fail" }));
|
|
313
|
-
},
|
|
314
|
-
warn(msg, opts = {}) {
|
|
315
|
-
errorMsg(msg);
|
|
316
|
-
return mountToast(__spreadProps(__spreadValues({ icon: "tips" }, opts), { msg, type: "warn" }));
|
|
317
|
-
},
|
|
318
|
-
loading(msg, opts = {}) {
|
|
319
|
-
return mountToast(__spreadProps(__spreadValues({
|
|
320
|
-
icon: "loading"
|
|
321
|
-
}, opts), {
|
|
322
|
-
msg,
|
|
323
|
-
type: "loading"
|
|
324
|
-
}));
|
|
325
|
-
},
|
|
326
|
-
hide(id) {
|
|
327
|
-
clearToast(id);
|
|
328
|
-
},
|
|
329
|
-
install(app) {
|
|
330
|
-
app.use(Toast);
|
|
331
|
-
app.config.globalProperties.$toast = ToastFunction;
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
export { Toast, ToastFunction, ToastFunction as default };
|
|
204
|
+
var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
205
|
+
export { index_taro as default };
|