@nutui/nutui 3.1.12-beta.0 → 3.1.13
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 +54 -0
- package/README.md +139 -37
- package/dist/nutui.d.ts +12 -2
- package/dist/nutui.es.js +6704 -5011
- package/dist/nutui.umd.js +6720 -5017
- package/dist/packages/_es/ActionSheet.js +1 -1
- package/dist/packages/_es/Address.js +18 -17
- package/dist/packages/_es/Avatar.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/Card.js +105 -0
- package/dist/packages/_es/Cascader.js +547 -0
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +10 -4
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +2 -2
- 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/CountDown.js +3 -4
- package/dist/packages/_es/CountUp.js +3 -1
- package/dist/packages/_es/DatePicker.js +2 -2
- package/dist/packages/_es/Dialog.js +10 -23
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Elevator.js +3 -2
- package/dist/packages/_es/Empty.js +74 -0
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +151 -0
- package/dist/packages/_es/FormItem.js +110 -0
- package/dist/packages/_es/Grid.js +12 -0
- package/dist/packages/_es/GridItem.js +149 -0
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/ImagePreview.js +148 -32
- package/dist/packages/_es/Indicator.js +66 -0
- 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/Menu.js +2 -2
- package/dist/packages/_es/MenuItem.js +1 -1
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +6 -8
- package/dist/packages/_es/Notify.js +1 -1
- package/dist/packages/_es/NumberKeyboard.js +9 -7
- package/dist/packages/_es/OverLay.js +1 -1
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +2 -2
- package/dist/packages/_es/Popover.js +11 -17
- package/dist/packages/_es/Popup.js +1 -1
- package/dist/packages/_es/Price.js +1 -1
- package/dist/packages/_es/Progress.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 +3 -3
- package/dist/packages/_es/Rate.js +19 -5
- 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/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +138 -0
- package/dist/packages/_es/Sku.js +2 -37
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Swipe.js +2 -2
- package/dist/packages/_es/Swiper.js +11 -11
- package/dist/packages/_es/SwiperItem.js +3 -3
- package/dist/packages/_es/Switch.js +43 -13
- 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 +191 -0
- package/dist/packages/_es/Tabs.js +6 -2
- 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 +18 -8
- package/dist/packages/_es/Uploader.js +1 -1
- package/dist/packages/_es/Video.js +3 -3
- 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 +56 -28
- package/dist/packages/_es/index3.js +31 -8
- 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/_es/util.js +47 -0
- package/dist/packages/button/index.scss +6 -0
- package/dist/packages/card/index.scss +97 -0
- package/dist/packages/cascader/index.scss +81 -0
- package/dist/packages/cellgroup/index.scss +9 -0
- package/dist/packages/checkbox/index.scss +1 -1
- 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/form/index.scss +2 -0
- package/dist/packages/formitem/index.scss +63 -0
- 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/switch/index.scss +1 -1
- 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/styles/.DS_Store +0 -0
- 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 +44 -34
- package/dist/styles/variables.scss +64 -1
- package/package.json +3 -4
|
@@ -0,0 +1,191 @@
|
|
|
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
|
+
/*!
|
|
21
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
22
|
+
* (c) 2021 @jdf2e.
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*/
|
|
25
|
+
import { c as createComponent } from "./component.js";
|
|
26
|
+
import { h, reactive, computed, watch, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createTextVNode, toDisplayString, renderSlot, createBlock, createCommentVNode } from "vue";
|
|
27
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
28
|
+
var RenderColumn = {
|
|
29
|
+
setup(props) {
|
|
30
|
+
return () => h(`view`, {}, props.slots());
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
slots: Object
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const component = (componentName2) => {
|
|
37
|
+
return {
|
|
38
|
+
components: {
|
|
39
|
+
RenderColumn
|
|
40
|
+
},
|
|
41
|
+
props: {
|
|
42
|
+
bordered: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
columns: {
|
|
47
|
+
type: Array,
|
|
48
|
+
default: () => {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
data: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: () => {
|
|
55
|
+
return {};
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
summary: {
|
|
59
|
+
type: Function,
|
|
60
|
+
default: null
|
|
61
|
+
},
|
|
62
|
+
striped: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
emits: ["sorter"],
|
|
68
|
+
setup(props, { emit, slots }) {
|
|
69
|
+
const state = reactive({
|
|
70
|
+
curData: props.data
|
|
71
|
+
});
|
|
72
|
+
const classes = computed(() => {
|
|
73
|
+
const prefixCls = componentName2;
|
|
74
|
+
return {
|
|
75
|
+
[prefixCls]: true
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
const cellClasses = (item) => {
|
|
79
|
+
return {
|
|
80
|
+
"nut-table__main__head__tr--border": props.bordered,
|
|
81
|
+
[`nut-table__main__head__tr--align${item.align ? item.align : ""}`]: true
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
const getColumnItem = (value) => {
|
|
85
|
+
return props.columns.filter((item) => item.key === value)[0];
|
|
86
|
+
};
|
|
87
|
+
const handleSorterClick = (item) => {
|
|
88
|
+
if (item.sorter) {
|
|
89
|
+
emit("sorter", item);
|
|
90
|
+
state.curData = typeof item.sorter === "function" ? state.curData.sort(item.sorter) : item.sorter === "default" ? state.curData.sort() : state.curData;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
watch(() => props.data, (val) => {
|
|
94
|
+
state.curData = val.slice();
|
|
95
|
+
});
|
|
96
|
+
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
97
|
+
classes,
|
|
98
|
+
cellClasses,
|
|
99
|
+
getColumnItem,
|
|
100
|
+
handleSorterClick
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
const { componentName, create } = createComponent("table");
|
|
106
|
+
const _sfc_main = create(component(componentName));
|
|
107
|
+
const _hoisted_1 = { class: "nut-table__main__head" };
|
|
108
|
+
const _hoisted_2 = { class: "nut-table__main__head__tr" };
|
|
109
|
+
const _hoisted_3 = ["onClick"];
|
|
110
|
+
const _hoisted_4 = { class: "nut-table__main__body" };
|
|
111
|
+
const _hoisted_5 = {
|
|
112
|
+
key: 0,
|
|
113
|
+
class: "nut-table__summary"
|
|
114
|
+
};
|
|
115
|
+
const _hoisted_6 = ["innerHTML"];
|
|
116
|
+
const _hoisted_7 = {
|
|
117
|
+
key: 1,
|
|
118
|
+
class: "nut-table__nodata"
|
|
119
|
+
};
|
|
120
|
+
const _hoisted_8 = {
|
|
121
|
+
key: 0,
|
|
122
|
+
class: "nut-table__nodata__text"
|
|
123
|
+
};
|
|
124
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
125
|
+
const _component_nut_icon = resolveComponent("nut-icon");
|
|
126
|
+
const _component_RenderColumn = resolveComponent("RenderColumn");
|
|
127
|
+
return openBlock(), createElementBlock("view", {
|
|
128
|
+
class: normalizeClass(_ctx.classes)
|
|
129
|
+
}, [
|
|
130
|
+
createElementVNode("view", {
|
|
131
|
+
class: normalizeClass(["nut-table__main", { "nut-table__main--striped": _ctx.striped }])
|
|
132
|
+
}, [
|
|
133
|
+
createElementVNode("view", _hoisted_1, [
|
|
134
|
+
createElementVNode("view", _hoisted_2, [
|
|
135
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (item) => {
|
|
136
|
+
return openBlock(), createElementBlock("span", {
|
|
137
|
+
class: normalizeClass(["nut-table__main__head__tr__th", _ctx.cellClasses(item)]),
|
|
138
|
+
key: item.key,
|
|
139
|
+
onClick: ($event) => _ctx.handleSorterClick(item)
|
|
140
|
+
}, [
|
|
141
|
+
createTextVNode(toDisplayString(item.title) + " ", 1),
|
|
142
|
+
renderSlot(_ctx.$slots, "icon"),
|
|
143
|
+
!_ctx.$slots.icon && item.sorter ? (openBlock(), createBlock(_component_nut_icon, {
|
|
144
|
+
key: 0,
|
|
145
|
+
name: "down-arrow",
|
|
146
|
+
size: "12px"
|
|
147
|
+
})) : createCommentVNode("", true)
|
|
148
|
+
], 10, _hoisted_3);
|
|
149
|
+
}), 128))
|
|
150
|
+
])
|
|
151
|
+
]),
|
|
152
|
+
createElementVNode("view", _hoisted_4, [
|
|
153
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.curData, (item) => {
|
|
154
|
+
return openBlock(), createElementBlock("view", {
|
|
155
|
+
class: "nut-table__main__body__tr",
|
|
156
|
+
key: item
|
|
157
|
+
}, [
|
|
158
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(Object.keys(item), (value) => {
|
|
159
|
+
return openBlock(), createElementBlock("span", {
|
|
160
|
+
class: normalizeClass(["nut-table__main__body__tr__td", _ctx.cellClasses(_ctx.getColumnItem(value))]),
|
|
161
|
+
key: value
|
|
162
|
+
}, [
|
|
163
|
+
createTextVNode(toDisplayString(typeof item[value] !== "function" ? item[value] : "") + " ", 1),
|
|
164
|
+
typeof item[value] === "function" ? (openBlock(), createBlock(_component_RenderColumn, {
|
|
165
|
+
key: 0,
|
|
166
|
+
slots: item[value]
|
|
167
|
+
}, null, 8, ["slots"])) : createCommentVNode("", true)
|
|
168
|
+
], 2);
|
|
169
|
+
}), 128))
|
|
170
|
+
]);
|
|
171
|
+
}), 128))
|
|
172
|
+
])
|
|
173
|
+
], 2),
|
|
174
|
+
_ctx.summary ? (openBlock(), createElementBlock("view", _hoisted_5, [
|
|
175
|
+
createElementVNode("span", {
|
|
176
|
+
class: "nut-table__summary__text",
|
|
177
|
+
innerHTML: _ctx.summary().value
|
|
178
|
+
}, null, 8, _hoisted_6)
|
|
179
|
+
])) : createCommentVNode("", true),
|
|
180
|
+
!_ctx.curData.length ? (openBlock(), createElementBlock("view", _hoisted_7, [
|
|
181
|
+
createElementVNode("div", {
|
|
182
|
+
class: normalizeClass(["nut-table__nodata", { "nut-table__nodata--border": _ctx.bordered }])
|
|
183
|
+
}, [
|
|
184
|
+
renderSlot(_ctx.$slots, "nodata"),
|
|
185
|
+
!_ctx.$slots.nodata ? (openBlock(), createElementBlock("div", _hoisted_8, " \u6682\u65E0\u6570\u636E ")) : createCommentVNode("", true)
|
|
186
|
+
], 2)
|
|
187
|
+
])) : createCommentVNode("", true)
|
|
188
|
+
], 2);
|
|
189
|
+
}
|
|
190
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
191
|
+
export { index as default };
|
|
@@ -19,7 +19,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19
19
|
return value;
|
|
20
20
|
};
|
|
21
21
|
/*!
|
|
22
|
-
* @nutui/nutui v3.1.
|
|
22
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
23
23
|
* (c) 2021 @jdf2e.
|
|
24
24
|
* Released under the MIT License.
|
|
25
25
|
*/
|
|
@@ -50,6 +50,10 @@ const _sfc_main = create({
|
|
|
50
50
|
type: String,
|
|
51
51
|
default: "horizontal"
|
|
52
52
|
},
|
|
53
|
+
size: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: "normal"
|
|
56
|
+
},
|
|
53
57
|
type: {
|
|
54
58
|
type: String,
|
|
55
59
|
default: "line"
|
|
@@ -168,7 +172,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
168
172
|
class: normalizeClass(["nut-tabs", [_ctx.direction]])
|
|
169
173
|
}, [
|
|
170
174
|
createElementVNode("view", {
|
|
171
|
-
class: normalizeClass(["nut-tabs__titles", { [_ctx.type]: _ctx.type, scrollable: _ctx.titleScroll }]),
|
|
175
|
+
class: normalizeClass(["nut-tabs__titles", { [_ctx.type]: _ctx.type, scrollable: _ctx.titleScroll, [_ctx.size]: _ctx.size }]),
|
|
172
176
|
style: normalizeStyle(_ctx.tabsNavStyle)
|
|
173
177
|
}, [
|
|
174
178
|
_ctx.$slots.titles ? renderSlot(_ctx.$slots, "titles", { key: 0 }) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.titles, (item, index2) => {
|
package/dist/packages/_es/Tag.js
CHANGED
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -18,11 +18,11 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { reactive, onMounted, watch, computed, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, createElementBlock, createVNode, createCommentVNode, vShow, render } from "vue";
|
|
25
|
+
import { reactive, onMounted, watch, computed, resolveComponent, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, createElementBlock, createVNode, createCommentVNode, toDisplayString, vShow, render } from "vue";
|
|
26
26
|
import { c as createComponent } from "./component.js";
|
|
27
27
|
import _sfc_main$1 from "./Icon.js";
|
|
28
28
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
@@ -46,8 +46,8 @@ const _sfc_main = create({
|
|
|
46
46
|
type: String,
|
|
47
47
|
customClass: String,
|
|
48
48
|
bottom: {
|
|
49
|
-
type:
|
|
50
|
-
default:
|
|
49
|
+
type: String,
|
|
50
|
+
default: "30px"
|
|
51
51
|
},
|
|
52
52
|
size: {
|
|
53
53
|
type: [String, Number],
|
|
@@ -76,6 +76,10 @@ const _sfc_main = create({
|
|
|
76
76
|
type: String,
|
|
77
77
|
default: "rgba(0, 0, 0, 0)"
|
|
78
78
|
},
|
|
79
|
+
title: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: ""
|
|
82
|
+
},
|
|
79
83
|
closeOnClickOverlay: {
|
|
80
84
|
type: Boolean,
|
|
81
85
|
default: false
|
|
@@ -156,7 +160,11 @@ const _hoisted_1 = {
|
|
|
156
160
|
key: 0,
|
|
157
161
|
class: "nut-toast-icon-wrapper"
|
|
158
162
|
};
|
|
159
|
-
const _hoisted_2 =
|
|
163
|
+
const _hoisted_2 = {
|
|
164
|
+
key: 1,
|
|
165
|
+
class: "nut-toast-title"
|
|
166
|
+
};
|
|
167
|
+
const _hoisted_3 = ["innerHTML"];
|
|
160
168
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
161
169
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
162
170
|
return openBlock(), createBlock(Transition, {
|
|
@@ -167,7 +175,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
167
175
|
withDirectives(createElementVNode("view", {
|
|
168
176
|
class: normalizeClass(_ctx.toastBodyClass),
|
|
169
177
|
style: normalizeStyle({
|
|
170
|
-
bottom: _ctx.center ? "auto" : _ctx.bottom
|
|
178
|
+
bottom: _ctx.center ? "auto" : _ctx.bottom,
|
|
171
179
|
"background-color": _ctx.coverColor
|
|
172
180
|
}),
|
|
173
181
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.clickCover && _ctx.clickCover(...args))
|
|
@@ -186,10 +194,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
186
194
|
name: _ctx.icon
|
|
187
195
|
}, null, 8, ["name"])
|
|
188
196
|
])) : createCommentVNode("", true),
|
|
197
|
+
_ctx.title ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
|
|
189
198
|
createElementVNode("view", {
|
|
190
199
|
class: "nut-toast-text",
|
|
191
200
|
innerHTML: _ctx.msg
|
|
192
|
-
}, null, 8,
|
|
201
|
+
}, null, 8, _hoisted_3)
|
|
193
202
|
], 4)
|
|
194
203
|
], 6), [
|
|
195
204
|
[vShow, _ctx.state.mounted]
|
|
@@ -205,8 +214,9 @@ const defaultOptions = {
|
|
|
205
214
|
duration: 2e3,
|
|
206
215
|
center: true,
|
|
207
216
|
type: "text",
|
|
217
|
+
title: "",
|
|
208
218
|
customClass: "",
|
|
209
|
-
bottom:
|
|
219
|
+
bottom: "30px",
|
|
210
220
|
size: "base",
|
|
211
221
|
icon: null,
|
|
212
222
|
textAlignCenter: true,
|
|
@@ -19,7 +19,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19
19
|
return value;
|
|
20
20
|
};
|
|
21
21
|
/*!
|
|
22
|
-
* @nutui/nutui v3.1.
|
|
22
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
23
23
|
* (c) 2021 @jdf2e.
|
|
24
24
|
* Released under the MIT License.
|
|
25
25
|
*/
|
|
@@ -18,7 +18,7 @@ var __spreadValues = (a, b) => {
|
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.
|
|
21
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -401,5 +401,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
401
401
|
])
|
|
402
402
|
], 512);
|
|
403
403
|
}
|
|
404
|
-
var
|
|
405
|
-
export {
|
|
404
|
+
var Video = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
405
|
+
export { Video as default };
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
3
|
+
* (c) 2021 @jdf2e.
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import { provide, shallowReactive, getCurrentInstance, markRaw, isVNode, computed, h } from "vue";
|
|
7
|
+
import { c as createComponent } from "./component.js";
|
|
8
|
+
import { p as pxCheck } from "./pxCheck.js";
|
|
9
|
+
function flattenVNodes(children, childName) {
|
|
10
|
+
const result = [];
|
|
11
|
+
const traverse = (children2) => {
|
|
12
|
+
if (!Array.isArray(children2))
|
|
13
|
+
return;
|
|
14
|
+
children2.forEach((child) => {
|
|
15
|
+
var _a;
|
|
16
|
+
if (!isVNode(child))
|
|
17
|
+
return;
|
|
18
|
+
if (childName) {
|
|
19
|
+
if (child.type && child.type.name === childName) {
|
|
20
|
+
result.push(child);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
result.push(child);
|
|
25
|
+
}
|
|
26
|
+
if ((_a = child.component) == null ? void 0 : _a.subTree) {
|
|
27
|
+
traverse(child.component.subTree.children);
|
|
28
|
+
}
|
|
29
|
+
if (child.children) {
|
|
30
|
+
traverse(child.children);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
traverse(children);
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
function sortChildren(parent, internalChildren, childName) {
|
|
38
|
+
const vnodes = flattenVNodes(parent.subTree.children, childName);
|
|
39
|
+
internalChildren.sort((a, b) => {
|
|
40
|
+
return vnodes.indexOf(a.vnode) - vnodes.indexOf(b.vnode);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function useProvide(key, childName) {
|
|
44
|
+
const internalChildren = shallowReactive([]);
|
|
45
|
+
const parent = getCurrentInstance();
|
|
46
|
+
const add = (child) => {
|
|
47
|
+
if (!child.proxy)
|
|
48
|
+
return;
|
|
49
|
+
internalChildren.push(markRaw(child));
|
|
50
|
+
sortChildren(parent, internalChildren, childName);
|
|
51
|
+
};
|
|
52
|
+
const remove = (child) => {
|
|
53
|
+
internalChildren.splice(internalChildren.indexOf(markRaw(child)), 1);
|
|
54
|
+
};
|
|
55
|
+
const extend = Object.assign;
|
|
56
|
+
return (value) => {
|
|
57
|
+
provide(key, extend({
|
|
58
|
+
add,
|
|
59
|
+
remove,
|
|
60
|
+
internalChildren
|
|
61
|
+
}, value));
|
|
62
|
+
return {
|
|
63
|
+
internalChildren
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const { componentName } = createComponent("grid");
|
|
68
|
+
const GRID_KEY = Symbol("grid");
|
|
69
|
+
const gridProps = {
|
|
70
|
+
columnNum: {
|
|
71
|
+
type: [Number, String],
|
|
72
|
+
default: 4
|
|
73
|
+
},
|
|
74
|
+
iconSize: {
|
|
75
|
+
type: [Number, String],
|
|
76
|
+
default: 28
|
|
77
|
+
},
|
|
78
|
+
iconColor: {
|
|
79
|
+
type: String
|
|
80
|
+
},
|
|
81
|
+
border: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: true
|
|
84
|
+
},
|
|
85
|
+
gutter: {
|
|
86
|
+
type: [Number, String],
|
|
87
|
+
default: 0
|
|
88
|
+
},
|
|
89
|
+
center: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: true
|
|
92
|
+
},
|
|
93
|
+
square: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
97
|
+
reverse: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false
|
|
100
|
+
},
|
|
101
|
+
direction: {
|
|
102
|
+
type: String
|
|
103
|
+
},
|
|
104
|
+
clickable: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: false
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const component = {
|
|
110
|
+
props: gridProps,
|
|
111
|
+
setup(props, { slots }) {
|
|
112
|
+
useProvide(GRID_KEY, `${componentName}-item`)({ props });
|
|
113
|
+
const rootClass = computed(() => {
|
|
114
|
+
const prefixCls = componentName;
|
|
115
|
+
return {
|
|
116
|
+
[prefixCls]: true,
|
|
117
|
+
[`${prefixCls}--border`]: props.border && !props.gutter
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
const rootStyle = computed(() => {
|
|
121
|
+
const style = {};
|
|
122
|
+
if (props.gutter) {
|
|
123
|
+
style.paddingLeft = pxCheck(props.gutter);
|
|
124
|
+
}
|
|
125
|
+
return style;
|
|
126
|
+
});
|
|
127
|
+
return () => {
|
|
128
|
+
var _a;
|
|
129
|
+
return h("view", {
|
|
130
|
+
class: rootClass.value,
|
|
131
|
+
style: rootStyle.value
|
|
132
|
+
}, (_a = slots.default) == null ? void 0 : _a.call(slots));
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
export { GRID_KEY as G, component as c };
|
|
@@ -1,64 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
|
|
6
|
+
import { getCurrentInstance } from "vue";
|
|
7
|
+
function useExpose(apis) {
|
|
8
|
+
const instance = getCurrentInstance();
|
|
9
|
+
if (instance) {
|
|
10
|
+
Object.assign(instance.proxy, apis);
|
|
11
11
|
}
|
|
12
|
-
if (y > x && y > MIN_DISTANCE) {
|
|
13
|
-
return "vertical";
|
|
14
|
-
}
|
|
15
|
-
return "";
|
|
16
|
-
}
|
|
17
|
-
function useTouch() {
|
|
18
|
-
const startX = ref(0);
|
|
19
|
-
const startY = ref(0);
|
|
20
|
-
const deltaX = ref(0);
|
|
21
|
-
const deltaY = ref(0);
|
|
22
|
-
const offsetX = ref(0);
|
|
23
|
-
const offsetY = ref(0);
|
|
24
|
-
const direction = ref("");
|
|
25
|
-
const isVertical = () => direction.value === "vertical";
|
|
26
|
-
const isHorizontal = () => direction.value === "horizontal";
|
|
27
|
-
const reset = () => {
|
|
28
|
-
deltaX.value = 0;
|
|
29
|
-
deltaY.value = 0;
|
|
30
|
-
offsetX.value = 0;
|
|
31
|
-
offsetY.value = 0;
|
|
32
|
-
direction.value = "";
|
|
33
|
-
};
|
|
34
|
-
const start = (event) => {
|
|
35
|
-
reset();
|
|
36
|
-
startX.value = event.touches[0].clientX;
|
|
37
|
-
startY.value = event.touches[0].clientY;
|
|
38
|
-
};
|
|
39
|
-
const move = (event) => {
|
|
40
|
-
const touch = event.touches[0];
|
|
41
|
-
deltaX.value = touch.clientX - startX.value;
|
|
42
|
-
deltaY.value = touch.clientY - startY.value;
|
|
43
|
-
offsetX.value = Math.abs(deltaX.value);
|
|
44
|
-
offsetY.value = Math.abs(deltaY.value);
|
|
45
|
-
if (!direction.value) {
|
|
46
|
-
direction.value = getDirection(offsetX.value, offsetY.value);
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
return {
|
|
50
|
-
move,
|
|
51
|
-
start,
|
|
52
|
-
reset,
|
|
53
|
-
startX,
|
|
54
|
-
startY,
|
|
55
|
-
deltaX,
|
|
56
|
-
deltaY,
|
|
57
|
-
offsetX,
|
|
58
|
-
offsetY,
|
|
59
|
-
direction,
|
|
60
|
-
isVertical,
|
|
61
|
-
isHorizontal
|
|
62
|
-
};
|
|
63
12
|
}
|
|
64
|
-
export {
|
|
13
|
+
export { useExpose as u };
|
|
@@ -1,36 +1,64 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.
|
|
2
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
3
3
|
* (c) 2021 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const element = unref(elementRef);
|
|
12
|
-
if (isWindow(element)) {
|
|
13
|
-
const width = element.innerWidth;
|
|
14
|
-
const height = element.innerHeight;
|
|
15
|
-
return {
|
|
16
|
-
top: 0,
|
|
17
|
-
left: 0,
|
|
18
|
-
right: width,
|
|
19
|
-
bottom: height,
|
|
20
|
-
width,
|
|
21
|
-
height
|
|
22
|
-
};
|
|
6
|
+
import { ref } from "vue";
|
|
7
|
+
const MIN_DISTANCE = 10;
|
|
8
|
+
function getDirection(x, y) {
|
|
9
|
+
if (x > y && x > MIN_DISTANCE) {
|
|
10
|
+
return "horizontal";
|
|
23
11
|
}
|
|
24
|
-
if (
|
|
25
|
-
return
|
|
12
|
+
if (y > x && y > MIN_DISTANCE) {
|
|
13
|
+
return "vertical";
|
|
26
14
|
}
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
function useTouch() {
|
|
18
|
+
const startX = ref(0);
|
|
19
|
+
const startY = ref(0);
|
|
20
|
+
const deltaX = ref(0);
|
|
21
|
+
const deltaY = ref(0);
|
|
22
|
+
const offsetX = ref(0);
|
|
23
|
+
const offsetY = ref(0);
|
|
24
|
+
const direction = ref("");
|
|
25
|
+
const isVertical = () => direction.value === "vertical";
|
|
26
|
+
const isHorizontal = () => direction.value === "horizontal";
|
|
27
|
+
const reset = () => {
|
|
28
|
+
deltaX.value = 0;
|
|
29
|
+
deltaY.value = 0;
|
|
30
|
+
offsetX.value = 0;
|
|
31
|
+
offsetY.value = 0;
|
|
32
|
+
direction.value = "";
|
|
33
|
+
};
|
|
34
|
+
const start = (event) => {
|
|
35
|
+
reset();
|
|
36
|
+
startX.value = event.touches[0].clientX;
|
|
37
|
+
startY.value = event.touches[0].clientY;
|
|
38
|
+
};
|
|
39
|
+
const move = (event) => {
|
|
40
|
+
const touch = event.touches[0];
|
|
41
|
+
deltaX.value = touch.clientX - startX.value;
|
|
42
|
+
deltaY.value = touch.clientY - startY.value;
|
|
43
|
+
offsetX.value = Math.abs(deltaX.value);
|
|
44
|
+
offsetY.value = Math.abs(deltaY.value);
|
|
45
|
+
if (!direction.value) {
|
|
46
|
+
direction.value = getDirection(offsetX.value, offsetY.value);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
27
49
|
return {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
50
|
+
move,
|
|
51
|
+
start,
|
|
52
|
+
reset,
|
|
53
|
+
startX,
|
|
54
|
+
startY,
|
|
55
|
+
deltaX,
|
|
56
|
+
deltaY,
|
|
57
|
+
offsetX,
|
|
58
|
+
offsetY,
|
|
59
|
+
direction,
|
|
60
|
+
isVertical,
|
|
61
|
+
isHorizontal
|
|
34
62
|
};
|
|
35
|
-
}
|
|
36
|
-
export {
|
|
63
|
+
}
|
|
64
|
+
export { useTouch as u };
|