@nutui/nutui 3.1.10 → 3.1.12-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 +17 -0
- package/dist/nutui.d.ts +5 -1
- package/dist/nutui.es.js +4041 -3518
- package/dist/nutui.umd.js +4084 -3627
- package/dist/packages/_es/ActionSheet.js +13 -12
- package/dist/packages/_es/Address.js +63 -49
- package/dist/packages/_es/Avatar.js +4 -5
- package/dist/packages/_es/BackTop.js +72 -109
- package/dist/packages/_es/Badge.js +4 -5
- package/dist/packages/_es/Barrage.js +63 -57
- package/dist/packages/_es/Button.js +5 -6
- package/dist/packages/_es/Calendar.js +27 -18
- package/dist/packages/_es/Card.js +104 -0
- package/dist/packages/_es/Cell.js +5 -13
- package/dist/packages/_es/CellGroup.js +4 -5
- package/dist/packages/_es/Checkbox.js +3 -3
- package/dist/packages/_es/CheckboxGroup.js +9 -4
- package/dist/packages/_es/CircleProgress.js +142 -46
- package/dist/packages/_es/Col.js +4 -5
- package/dist/packages/_es/Collapse.js +35 -10
- package/dist/packages/_es/CollapseItem.js +80 -35
- package/dist/packages/_es/CountDown.js +7 -5
- package/dist/packages/_es/CountUp.js +34 -31
- package/dist/packages/_es/DatePicker.js +451 -219
- package/dist/packages/_es/Dialog.js +13 -87
- package/dist/packages/_es/Divider.js +5 -6
- package/dist/packages/_es/Drag.js +76 -50
- package/dist/packages/_es/Elevator.js +81 -52
- package/dist/packages/_es/FixedNav.js +8 -9
- package/dist/packages/_es/Form.js +137 -0
- package/dist/packages/_es/FormItem.js +109 -0
- package/dist/packages/_es/Icon.js +6 -40
- package/dist/packages/_es/ImagePreview.js +23 -21
- package/dist/packages/_es/InfiniteLoading.js +95 -109
- package/dist/packages/_es/Input.js +22 -21
- package/dist/packages/_es/InputNumber.js +24 -18
- package/dist/packages/_es/Layout.js +2 -2
- package/dist/packages/_es/Menu.js +89 -171
- package/dist/packages/_es/MenuItem.js +155 -18
- package/dist/packages/_es/Navbar.js +7 -7
- package/dist/packages/_es/NoticeBar.js +39 -26
- package/dist/packages/_es/Notify.js +30 -166
- package/dist/packages/_es/NumberKeyboard.js +10 -6
- package/dist/packages/_es/OverLay.js +22 -29
- package/dist/packages/_es/Pagination.js +8 -9
- package/dist/packages/_es/Picker.js +61 -447
- package/dist/packages/_es/Popover.js +146 -25
- package/dist/packages/_es/Popup.js +18 -39
- package/dist/packages/_es/Price.js +18 -7
- package/dist/packages/_es/Progress.js +23 -12
- package/dist/packages/_es/Radio.js +20 -7
- package/dist/packages/_es/RadioGroup.js +7 -3
- package/dist/packages/_es/Range.js +38 -59
- package/dist/packages/_es/Rate.js +16 -20
- package/dist/packages/_es/Row.js +4 -5
- package/dist/packages/_es/SearchBar.js +7 -5
- package/dist/packages/_es/ShortPassword.js +89 -59
- package/dist/packages/_es/Signature.js +70 -71
- package/dist/packages/_es/Sku.js +508 -0
- package/dist/packages/_es/Step.js +10 -8
- package/dist/packages/_es/Steps.js +2 -2
- package/dist/packages/_es/Swipe.js +42 -27
- package/dist/packages/_es/Swiper.js +17 -418
- package/dist/packages/_es/SwiperItem.js +14 -39
- package/dist/packages/_es/Switch.js +4 -5
- package/dist/packages/_es/TabPane.js +4 -5
- package/dist/packages/_es/Tabbar.js +4 -5
- package/dist/packages/_es/TabbarItem.js +8 -9
- package/dist/packages/_es/Tabs.js +23 -17
- package/dist/packages/_es/Tag.js +5 -6
- package/dist/packages/_es/TextArea.js +16 -12
- package/dist/packages/_es/TimeDetail.js +7 -5
- package/dist/packages/_es/TimePannel.js +7 -5
- package/dist/packages/_es/TimeSelect.js +12 -7
- package/dist/packages/_es/Toast.js +41 -163
- package/dist/packages/_es/Uploader.js +210 -164
- package/dist/packages/_es/commonProps.js +30 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +44 -0
- package/dist/packages/_es/index2.js +44 -8
- package/dist/packages/_es/index3.js +419 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/use-lock-scroll.js +23 -0
- package/dist/packages/_es/util.js +47 -0
- package/dist/packages/button/index.scss +9 -0
- package/dist/packages/card/index.scss +97 -0
- package/dist/packages/checkbox/index.scss +1 -1
- package/dist/packages/form/index.scss +2 -0
- package/dist/packages/formitem/index.scss +60 -0
- package/dist/packages/menu/index.scss +32 -60
- package/dist/packages/menuitem/index.scss +36 -99
- package/dist/packages/numberkeyboard/index.scss +1 -1
- package/dist/packages/progress/index.scss +2 -0
- package/dist/packages/radio/index.scss +32 -4
- package/dist/packages/radiogroup/index.scss +20 -0
- package/dist/packages/sku/index.scss +147 -0
- package/dist/packages/switch/index.scss +1 -1
- package/dist/packages/uploader/index.scss +95 -8
- package/dist/style.css +1 -1
- package/dist/style.es.js +1 -2
- package/dist/styles/mixins/index.scss +0 -4
- package/dist/styles/themes/default.scss +34 -30
- package/dist/styles/variables.scss +45 -3
- package/package.json +3 -2
- package/dist/packages/_es/Video.js +0 -405
- package/dist/packages/_es/plugin-vue_export-helper.js +0 -12
- package/dist/packages/_es/style.css +0 -160
|
@@ -14,19 +14,21 @@ 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
|
+
};
|
|
17
20
|
var __publicField = (obj, key, value) => {
|
|
18
21
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
22
|
return value;
|
|
20
23
|
};
|
|
21
24
|
/*!
|
|
22
|
-
* @nutui/nutui v3.1.
|
|
25
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
23
26
|
* (c) 2021 @jdf2e.
|
|
24
27
|
* Released under the MIT License.
|
|
25
28
|
*/
|
|
26
29
|
import { p as pxCheck } from "./pxCheck.js";
|
|
27
30
|
import { provide, computed, ref, watch, onMounted, onActivated, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode, createVNode, toDisplayString } from "vue";
|
|
28
31
|
import { c as createComponent } from "./component.js";
|
|
29
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
30
32
|
const { create } = createComponent("tabs");
|
|
31
33
|
class Title {
|
|
32
34
|
constructor() {
|
|
@@ -36,7 +38,7 @@ class Title {
|
|
|
36
38
|
__publicField(this, "disabled", false);
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
|
|
41
|
+
var _sfc_main = create({
|
|
40
42
|
props: {
|
|
41
43
|
modelValue: {
|
|
42
44
|
type: [String, Number],
|
|
@@ -54,6 +56,10 @@ const _sfc_main = create({
|
|
|
54
56
|
type: String,
|
|
55
57
|
default: "line"
|
|
56
58
|
},
|
|
59
|
+
lineWidth: {
|
|
60
|
+
type: [String, Number],
|
|
61
|
+
default: ""
|
|
62
|
+
},
|
|
57
63
|
titleScroll: {
|
|
58
64
|
type: Boolean,
|
|
59
65
|
default: false
|
|
@@ -80,9 +86,9 @@ const _sfc_main = create({
|
|
|
80
86
|
setup(props, { emit, slots }) {
|
|
81
87
|
provide("activeKey", { activeKey: computed(() => props.modelValue) });
|
|
82
88
|
const titles = ref([]);
|
|
83
|
-
const currentIndex = ref(0);
|
|
89
|
+
const currentIndex = ref(props.modelValue || 0);
|
|
84
90
|
const renderTitles = (vnodes) => {
|
|
85
|
-
vnodes.forEach((vnode,
|
|
91
|
+
vnodes.forEach((vnode, index) => {
|
|
86
92
|
var _a, _b, _c, _d, _e;
|
|
87
93
|
let type = vnode.type;
|
|
88
94
|
type = type.name || type;
|
|
@@ -90,7 +96,7 @@ const _sfc_main = create({
|
|
|
90
96
|
let title = new Title();
|
|
91
97
|
if (((_a = vnode.props) == null ? void 0 : _a.title) || ((_b = vnode.props) == null ? void 0 : _b["pane-key"])) {
|
|
92
98
|
title.title = (_c = vnode.props) == null ? void 0 : _c.title;
|
|
93
|
-
title.paneKey = ((_d = vnode.props) == null ? void 0 : _d["pane-key"]) ||
|
|
99
|
+
title.paneKey = ((_d = vnode.props) == null ? void 0 : _d["pane-key"]) || index;
|
|
94
100
|
title.disabled = (_e = vnode.props) == null ? void 0 : _e.disabled;
|
|
95
101
|
}
|
|
96
102
|
titles.value.push(title);
|
|
@@ -109,11 +115,11 @@ const _sfc_main = create({
|
|
|
109
115
|
init(vnodes);
|
|
110
116
|
});
|
|
111
117
|
watch(() => props.modelValue, (value) => {
|
|
112
|
-
let
|
|
113
|
-
if (
|
|
118
|
+
let index = titles.value.findIndex((item) => item.paneKey == value);
|
|
119
|
+
if (index == -1) {
|
|
114
120
|
console.error("[NutUI] <Tabs> \u8BF7\u68C0\u67E5 v-model \u503C\u662F\u5426\u4E3A paneKey ,\u5982 paneKey \u672A\u8BBE\u7F6E\uFF0C\u8BF7\u91C7\u7528\u4E0B\u6807\u63A7\u5236 .");
|
|
115
121
|
} else {
|
|
116
|
-
currentIndex.value =
|
|
122
|
+
currentIndex.value = index;
|
|
117
123
|
}
|
|
118
124
|
});
|
|
119
125
|
onMounted(init);
|
|
@@ -142,12 +148,12 @@ const _sfc_main = create({
|
|
|
142
148
|
};
|
|
143
149
|
});
|
|
144
150
|
const methods = {
|
|
145
|
-
tabChange: (item,
|
|
151
|
+
tabChange: (item, index) => {
|
|
146
152
|
emit("click", item);
|
|
147
153
|
if (item.disabled) {
|
|
148
154
|
return;
|
|
149
155
|
}
|
|
150
|
-
currentIndex.value =
|
|
156
|
+
currentIndex.value = index;
|
|
151
157
|
emit("update:modelValue", item.paneKey);
|
|
152
158
|
emit("change", item);
|
|
153
159
|
}
|
|
@@ -156,8 +162,8 @@ const _sfc_main = create({
|
|
|
156
162
|
titles,
|
|
157
163
|
contentStyle,
|
|
158
164
|
tabsNavStyle,
|
|
159
|
-
|
|
160
|
-
|
|
165
|
+
titleStyle,
|
|
166
|
+
tabsActiveStyle
|
|
161
167
|
}, methods);
|
|
162
168
|
}
|
|
163
169
|
});
|
|
@@ -171,11 +177,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
171
177
|
class: normalizeClass(["nut-tabs__titles", { [_ctx.type]: _ctx.type, scrollable: _ctx.titleScroll }]),
|
|
172
178
|
style: normalizeStyle(_ctx.tabsNavStyle)
|
|
173
179
|
}, [
|
|
174
|
-
_ctx.$slots.titles ? renderSlot(_ctx.$slots, "titles", { key: 0 }) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.titles, (item,
|
|
180
|
+
_ctx.$slots.titles ? renderSlot(_ctx.$slots, "titles", { key: 0 }) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.titles, (item, index) => {
|
|
175
181
|
return openBlock(), createElementBlock("view", {
|
|
176
182
|
class: normalizeClass(["nut-tabs__titles-item", { active: item.paneKey == _ctx.modelValue, disabled: item.disabled }]),
|
|
177
183
|
style: normalizeStyle(_ctx.titleStyle),
|
|
178
|
-
onClick: ($event) => _ctx.tabChange(item,
|
|
184
|
+
onClick: ($event) => _ctx.tabChange(item, index),
|
|
179
185
|
key: item.paneKey
|
|
180
186
|
}, [
|
|
181
187
|
_ctx.type == "line" ? (openBlock(), createElementBlock("view", {
|
|
@@ -207,5 +213,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
207
213
|
], 4)
|
|
208
214
|
], 2);
|
|
209
215
|
}
|
|
210
|
-
|
|
211
|
-
export {
|
|
216
|
+
_sfc_main.render = _sfc_render;
|
|
217
|
+
export { _sfc_main as default };
|
package/dist/packages/_es/Tag.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createBlock, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
8
|
const { componentName, create } = createComponent("tag");
|
|
10
|
-
|
|
9
|
+
var _sfc_main = create({
|
|
11
10
|
props: {
|
|
12
11
|
color: { type: String, default: "" },
|
|
13
12
|
textColor: { type: String, default: "" },
|
|
@@ -86,10 +85,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
86
85
|
key: 0,
|
|
87
86
|
class: "nut-tag--close",
|
|
88
87
|
name: "close",
|
|
89
|
-
size: "
|
|
88
|
+
size: "11",
|
|
90
89
|
onClick: _ctx.onClose
|
|
91
90
|
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
92
91
|
], 6);
|
|
93
92
|
}
|
|
94
|
-
|
|
95
|
-
export {
|
|
93
|
+
_sfc_main.render = _sfc_render;
|
|
94
|
+
export { _sfc_main as default };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { computed, openBlock, createElementBlock, normalizeClass,
|
|
6
|
+
import { computed, openBlock, createElementBlock, normalizeClass, toDisplayString, normalizeStyle, createCommentVNode } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
8
|
const { componentName, create } = createComponent("textarea");
|
|
10
|
-
|
|
9
|
+
var _sfc_main = create({
|
|
11
10
|
props: {
|
|
12
11
|
modelValue: {
|
|
13
12
|
type: [String, Number],
|
|
@@ -87,7 +86,7 @@ const _sfc_main = create({
|
|
|
87
86
|
const input = event.target;
|
|
88
87
|
let value = input.value;
|
|
89
88
|
emitChange(value, event);
|
|
90
|
-
emit("blur",
|
|
89
|
+
emit("blur", event);
|
|
91
90
|
};
|
|
92
91
|
return {
|
|
93
92
|
classes,
|
|
@@ -98,16 +97,21 @@ const _sfc_main = create({
|
|
|
98
97
|
};
|
|
99
98
|
}
|
|
100
99
|
});
|
|
101
|
-
const _hoisted_1 =
|
|
102
|
-
const _hoisted_2 = {
|
|
100
|
+
const _hoisted_1 = {
|
|
103
101
|
key: 0,
|
|
102
|
+
class: "nut-textarea__textarea"
|
|
103
|
+
};
|
|
104
|
+
const _hoisted_2 = ["rows", "disabled", "readonly", "value", "maxlength", "placeholder"];
|
|
105
|
+
const _hoisted_3 = {
|
|
106
|
+
key: 2,
|
|
104
107
|
class: "nut-textarea__limit"
|
|
105
108
|
};
|
|
106
109
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
107
110
|
return openBlock(), createElementBlock("view", {
|
|
108
111
|
class: normalizeClass(_ctx.classes)
|
|
109
112
|
}, [
|
|
110
|
-
|
|
113
|
+
_ctx.readonly ? (openBlock(), createElementBlock("view", _hoisted_1, toDisplayString(_ctx.modelValue), 1)) : (openBlock(), createElementBlock("textarea", {
|
|
114
|
+
key: 1,
|
|
111
115
|
class: "nut-textarea__textarea",
|
|
112
116
|
style: normalizeStyle(_ctx.styles),
|
|
113
117
|
rows: _ctx.rows,
|
|
@@ -119,9 +123,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
119
123
|
onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args)),
|
|
120
124
|
maxlength: _ctx.maxLength,
|
|
121
125
|
placeholder: _ctx.placeholder
|
|
122
|
-
}, null, 44,
|
|
123
|
-
_ctx.limitShow ? (openBlock(), createElementBlock("view",
|
|
126
|
+
}, null, 44, _hoisted_2)),
|
|
127
|
+
_ctx.limitShow ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.modelValue ? _ctx.modelValue.length : 0) + "/" + toDisplayString(_ctx.maxLength), 1)) : createCommentVNode("", true)
|
|
124
128
|
], 2);
|
|
125
129
|
}
|
|
126
|
-
|
|
127
|
-
export {
|
|
130
|
+
_sfc_main.render = _sfc_render;
|
|
131
|
+
export { _sfc_main as default };
|
|
@@ -17,16 +17,18 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
+
};
|
|
20
23
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
24
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
22
25
|
* (c) 2021 @jdf2e.
|
|
23
26
|
* Released under the MIT License.
|
|
24
27
|
*/
|
|
25
28
|
import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, toDisplayString } from "vue";
|
|
26
29
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
30
|
const { componentName, create } = createComponent("timedetail");
|
|
29
|
-
|
|
31
|
+
var _sfc_main = create({
|
|
30
32
|
name: "timedetail",
|
|
31
33
|
props: {
|
|
32
34
|
times: {
|
|
@@ -98,5 +100,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
98
100
|
])
|
|
99
101
|
], 2);
|
|
100
102
|
}
|
|
101
|
-
|
|
102
|
-
export {
|
|
103
|
+
_sfc_main.render = _sfc_render;
|
|
104
|
+
export { _sfc_main as default };
|
|
@@ -17,16 +17,18 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __require = typeof require !== "undefined" ? require : (x) => {
|
|
21
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
22
|
+
};
|
|
20
23
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
24
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
22
25
|
* (c) 2021 @jdf2e.
|
|
23
26
|
* Released under the MIT License.
|
|
24
27
|
*/
|
|
25
28
|
import { inject, reactive, computed, toRefs, openBlock, createElementBlock, normalizeClass, toDisplayString } from "vue";
|
|
26
29
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
30
|
const { componentName, create } = createComponent("timepannel");
|
|
29
|
-
|
|
31
|
+
var _sfc_main = create({
|
|
30
32
|
name: "timepannel",
|
|
31
33
|
props: {
|
|
32
34
|
name: {
|
|
@@ -66,5 +68,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
66
68
|
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handlePannel(_ctx.pannelKey))
|
|
67
69
|
}, toDisplayString(_ctx.name), 3);
|
|
68
70
|
}
|
|
69
|
-
|
|
70
|
-
export {
|
|
71
|
+
_sfc_main.render = _sfc_render;
|
|
72
|
+
export { _sfc_main as default };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { computed, provide, resolveComponent, openBlock, createBlock, normalizeStyle, withCtx, createElementVNode, normalizeClass, toDisplayString, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
8
|
const { componentName, create } = createComponent("timeselect");
|
|
10
|
-
|
|
9
|
+
var _sfc_main = create({
|
|
11
10
|
props: {
|
|
12
11
|
visible: {
|
|
13
12
|
type: Boolean,
|
|
@@ -30,9 +29,13 @@ const _sfc_main = create({
|
|
|
30
29
|
default: () => {
|
|
31
30
|
return [];
|
|
32
31
|
}
|
|
32
|
+
},
|
|
33
|
+
muti: {
|
|
34
|
+
type: [Boolean],
|
|
35
|
+
default: false
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
|
-
emits: ["update:visible", "
|
|
38
|
+
emits: ["update:visible", "selected"],
|
|
36
39
|
setup: (props, context) => {
|
|
37
40
|
const classes = computed(() => {
|
|
38
41
|
const prefixCls = componentName;
|
|
@@ -48,12 +51,14 @@ const _sfc_main = create({
|
|
|
48
51
|
});
|
|
49
52
|
const currentKey = computed(() => props.currentKey);
|
|
50
53
|
const currentTime = computed(() => props.currentTime);
|
|
54
|
+
const muti = computed(() => props.muti);
|
|
51
55
|
const close = () => {
|
|
52
56
|
context.emit("update:visible", false);
|
|
53
|
-
context.emit("
|
|
57
|
+
context.emit("selected", currentTime.value);
|
|
54
58
|
};
|
|
55
59
|
provide("currentKey", currentKey);
|
|
56
60
|
provide("currentTime", currentTime);
|
|
61
|
+
provide("muti", muti);
|
|
57
62
|
return {
|
|
58
63
|
classes,
|
|
59
64
|
popStyle,
|
|
@@ -97,5 +102,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
97
102
|
_: 3
|
|
98
103
|
}, 8, ["visible", "style", "onClickOverlay", "onClickCloseIcon"]);
|
|
99
104
|
}
|
|
100
|
-
|
|
101
|
-
export {
|
|
105
|
+
_sfc_main.render = _sfc_render;
|
|
106
|
+
export { _sfc_main as default };
|
|
@@ -1,31 +1,11 @@
|
|
|
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.
|
|
2
|
+
* @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
|
|
22
3
|
* (c) 2021 @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, vShow } from "vue";
|
|
26
7
|
import { c as createComponent } from "./component.js";
|
|
27
|
-
import _sfc_main$1 from "./
|
|
28
|
-
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
8
|
+
import { _ as _sfc_main$1 } from "./index.taro.vue_vue&type=script&lang.js";
|
|
29
9
|
import "./pxCheck.js";
|
|
30
10
|
const { create } = createComponent("toast");
|
|
31
11
|
const _sfc_main = create({
|
|
@@ -43,7 +23,10 @@ const _sfc_main = create({
|
|
|
43
23
|
type: Boolean,
|
|
44
24
|
default: true
|
|
45
25
|
},
|
|
46
|
-
type:
|
|
26
|
+
type: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "text"
|
|
29
|
+
},
|
|
47
30
|
customClass: String,
|
|
48
31
|
bottom: {
|
|
49
32
|
type: Number,
|
|
@@ -79,16 +62,15 @@ const _sfc_main = create({
|
|
|
79
62
|
closeOnClickOverlay: {
|
|
80
63
|
type: Boolean,
|
|
81
64
|
default: false
|
|
65
|
+
},
|
|
66
|
+
visible: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
82
69
|
}
|
|
83
70
|
},
|
|
84
|
-
|
|
71
|
+
emits: ["update:visible", "closed"],
|
|
72
|
+
setup(props, { emit }) {
|
|
85
73
|
let timer;
|
|
86
|
-
const state = reactive({
|
|
87
|
-
mounted: false
|
|
88
|
-
});
|
|
89
|
-
onMounted(() => {
|
|
90
|
-
state.mounted = true;
|
|
91
|
-
});
|
|
92
74
|
const clearTimer = () => {
|
|
93
75
|
if (timer) {
|
|
94
76
|
clearTimeout(timer);
|
|
@@ -96,7 +78,8 @@ const _sfc_main = create({
|
|
|
96
78
|
}
|
|
97
79
|
};
|
|
98
80
|
const hide = () => {
|
|
99
|
-
|
|
81
|
+
emit("update:visible", false);
|
|
82
|
+
emit("closed");
|
|
100
83
|
};
|
|
101
84
|
const show = () => {
|
|
102
85
|
clearTimer();
|
|
@@ -111,10 +94,7 @@ const _sfc_main = create({
|
|
|
111
94
|
hide();
|
|
112
95
|
}
|
|
113
96
|
};
|
|
114
|
-
|
|
115
|
-
show();
|
|
116
|
-
}
|
|
117
|
-
watch(() => props.duration, (val) => {
|
|
97
|
+
watch(() => props.visible, (val) => {
|
|
118
98
|
if (val) {
|
|
119
99
|
show();
|
|
120
100
|
}
|
|
@@ -126,6 +106,18 @@ const _sfc_main = create({
|
|
|
126
106
|
return !!props.icon;
|
|
127
107
|
}
|
|
128
108
|
});
|
|
109
|
+
const iconName = computed(() => {
|
|
110
|
+
if (props.icon) {
|
|
111
|
+
return props.icon;
|
|
112
|
+
} else {
|
|
113
|
+
return {
|
|
114
|
+
success: "success",
|
|
115
|
+
fail: "failure",
|
|
116
|
+
warn: "tips",
|
|
117
|
+
loading: "loading"
|
|
118
|
+
}[props.type];
|
|
119
|
+
}
|
|
120
|
+
});
|
|
129
121
|
const toastBodyClass = computed(() => {
|
|
130
122
|
return [
|
|
131
123
|
"nut-toast",
|
|
@@ -138,15 +130,15 @@ const _sfc_main = create({
|
|
|
138
130
|
];
|
|
139
131
|
});
|
|
140
132
|
const onAfterLeave = () => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
133
|
+
if (props.visible) {
|
|
134
|
+
clearTimer();
|
|
135
|
+
hide();
|
|
136
|
+
}
|
|
144
137
|
};
|
|
145
138
|
return {
|
|
146
|
-
state,
|
|
147
|
-
hide,
|
|
148
139
|
clickCover,
|
|
149
140
|
hasIcon,
|
|
141
|
+
iconName,
|
|
150
142
|
toastBodyClass,
|
|
151
143
|
onAfterLeave
|
|
152
144
|
};
|
|
@@ -172,7 +164,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
172
164
|
}),
|
|
173
165
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
|
|
174
166
|
}, [
|
|
175
|
-
|
|
167
|
+
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock("view", {
|
|
168
|
+
key: 1,
|
|
176
169
|
class: "nut-toast-inner",
|
|
177
170
|
style: normalizeStyle({
|
|
178
171
|
"text-align": _ctx.textAlignCenter ? "center" : "left",
|
|
@@ -183,135 +176,20 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
183
176
|
createVNode(_component_nut_icon, {
|
|
184
177
|
size: "20",
|
|
185
178
|
color: "#ffffff",
|
|
186
|
-
name: _ctx.
|
|
179
|
+
name: _ctx.iconName
|
|
187
180
|
}, null, 8, ["name"])
|
|
188
181
|
])) : createCommentVNode("", true),
|
|
189
182
|
createElementVNode("view", {
|
|
190
183
|
class: "nut-toast-text",
|
|
191
184
|
innerHTML: _ctx.msg
|
|
192
185
|
}, null, 8, _hoisted_2)
|
|
193
|
-
], 4)
|
|
186
|
+
], 4))
|
|
194
187
|
], 6), [
|
|
195
|
-
[vShow, _ctx.
|
|
188
|
+
[vShow, _ctx.visible]
|
|
196
189
|
])
|
|
197
190
|
]),
|
|
198
|
-
_:
|
|
191
|
+
_: 3
|
|
199
192
|
}, 8, ["onAfterLeave"]);
|
|
200
193
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
msg: "",
|
|
204
|
-
id: "",
|
|
205
|
-
duration: 2e3,
|
|
206
|
-
center: true,
|
|
207
|
-
type: "text",
|
|
208
|
-
customClass: "",
|
|
209
|
-
bottom: 30,
|
|
210
|
-
size: "base",
|
|
211
|
-
icon: null,
|
|
212
|
-
textAlignCenter: true,
|
|
213
|
-
loadingRotate: true,
|
|
214
|
-
bgColor: "rgba(0, 0, 0, .8)",
|
|
215
|
-
onClose: null,
|
|
216
|
-
unmount: null,
|
|
217
|
-
cover: false,
|
|
218
|
-
coverColor: "rgba(0, 0, 0, 0)",
|
|
219
|
-
closeOnClickOverlay: false
|
|
220
|
-
};
|
|
221
|
-
let idsMap = [];
|
|
222
|
-
let optsMap = [];
|
|
223
|
-
const clearToast = (id) => {
|
|
224
|
-
if (id) {
|
|
225
|
-
const container = document.getElementById(id);
|
|
226
|
-
optsMap = optsMap.filter((item) => item.id !== id);
|
|
227
|
-
idsMap = idsMap.filter((item) => item !== id);
|
|
228
|
-
if (container) {
|
|
229
|
-
document.body.removeChild(container);
|
|
230
|
-
}
|
|
231
|
-
} else {
|
|
232
|
-
idsMap.forEach((item) => {
|
|
233
|
-
const container = document.getElementById(item);
|
|
234
|
-
if (container) {
|
|
235
|
-
document.body.removeChild(container);
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
optsMap = [];
|
|
239
|
-
idsMap = [];
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
const updateToast = (opts) => {
|
|
243
|
-
const container = document.getElementById(opts.id);
|
|
244
|
-
if (container) {
|
|
245
|
-
const currentOpt = optsMap.find((item) => item.id === opts.id);
|
|
246
|
-
if (currentOpt) {
|
|
247
|
-
opts = __spreadValues(__spreadValues(__spreadValues({}, defaultOptions), currentOpt), opts);
|
|
248
|
-
} else {
|
|
249
|
-
opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
|
|
250
|
-
}
|
|
251
|
-
const instance = createVNode(Toast, opts);
|
|
252
|
-
render(instance, container);
|
|
253
|
-
return instance.component.ctx;
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
const mountToast = (opts) => {
|
|
257
|
-
opts.unmount = clearToast;
|
|
258
|
-
let _id;
|
|
259
|
-
if (opts.id) {
|
|
260
|
-
_id = opts.id;
|
|
261
|
-
if (idsMap.find((item) => item === opts.id)) {
|
|
262
|
-
return updateToast(opts);
|
|
263
|
-
}
|
|
264
|
-
} else {
|
|
265
|
-
_id = new Date().getTime() + "";
|
|
266
|
-
}
|
|
267
|
-
opts = __spreadValues(__spreadValues({}, defaultOptions), opts);
|
|
268
|
-
opts.id = _id;
|
|
269
|
-
idsMap.push(opts.id);
|
|
270
|
-
optsMap.push(opts);
|
|
271
|
-
const container = document.createElement("div");
|
|
272
|
-
container.id = opts.id;
|
|
273
|
-
const instance = createVNode(Toast, opts);
|
|
274
|
-
render(instance, container);
|
|
275
|
-
document.body.appendChild(container);
|
|
276
|
-
return instance.component.ctx;
|
|
277
|
-
};
|
|
278
|
-
const errorMsg = (msg) => {
|
|
279
|
-
if (!msg) {
|
|
280
|
-
console.warn("[NutUI Toast]: msg\u4E0D\u80FD\u4E3A\u7A7A");
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
const ToastFunction = {
|
|
285
|
-
text(msg, opts = {}) {
|
|
286
|
-
errorMsg(msg);
|
|
287
|
-
return mountToast(__spreadProps(__spreadValues({}, opts), { type: "text", msg }));
|
|
288
|
-
},
|
|
289
|
-
success(msg, opts = {}) {
|
|
290
|
-
errorMsg(msg);
|
|
291
|
-
return mountToast(__spreadProps(__spreadValues({ icon: "success" }, opts), { msg, type: "success" }));
|
|
292
|
-
},
|
|
293
|
-
fail(msg, opts = {}) {
|
|
294
|
-
errorMsg(msg);
|
|
295
|
-
return mountToast(__spreadProps(__spreadValues({ icon: "failure" }, opts), { msg, type: "fail" }));
|
|
296
|
-
},
|
|
297
|
-
warn(msg, opts = {}) {
|
|
298
|
-
errorMsg(msg);
|
|
299
|
-
return mountToast(__spreadProps(__spreadValues({ icon: "tips" }, opts), { msg, type: "warn" }));
|
|
300
|
-
},
|
|
301
|
-
loading(msg, opts = {}) {
|
|
302
|
-
return mountToast(__spreadProps(__spreadValues({
|
|
303
|
-
icon: "loading"
|
|
304
|
-
}, opts), {
|
|
305
|
-
msg,
|
|
306
|
-
type: "loading"
|
|
307
|
-
}));
|
|
308
|
-
},
|
|
309
|
-
hide() {
|
|
310
|
-
clearToast();
|
|
311
|
-
},
|
|
312
|
-
install(app) {
|
|
313
|
-
app.use(Toast);
|
|
314
|
-
app.config.globalProperties.$toast = ToastFunction;
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
export { Toast, ToastFunction, ToastFunction as default };
|
|
194
|
+
_sfc_main.render = _sfc_render;
|
|
195
|
+
export { _sfc_main as default };
|