@nutui/nutui 3.1.12 → 3.1.15-beta.0
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 +29 -0
- package/README.md +139 -37
- package/dist/nutui.d.ts +8 -1
- package/dist/nutui.es.js +2143 -826
- package/dist/nutui.umd.js +2155 -831
- 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 +1 -1
- package/dist/packages/_es/Cascader.js +547 -0
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +1 -1
- package/dist/packages/_es/CircleProgress.js +1 -1
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +1 -1
- package/dist/packages/_es/CollapseItem.js +1 -1
- package/dist/packages/_es/CountDown.js +3 -4
- package/dist/packages/_es/CountUp.js +3 -1
- package/dist/packages/_es/DatePicker.js +1 -1
- package/dist/packages/_es/Dialog.js +1 -1
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/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 +18 -5
- package/dist/packages/_es/FormItem.js +1 -1
- 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 +104 -10
- 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 +1 -1
- 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 +1 -1
- package/dist/packages/_es/OverLay.js +1 -1
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +1 -1
- package/dist/packages/_es/Popover.js +1 -1
- 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 +1 -1
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +1 -1
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +138 -0
- package/dist/packages/_es/Sku.js +1 -1
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Swipe.js +1 -1
- package/dist/packages/_es/Swiper.js +1 -1
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +16 -6
- 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 +1 -1
- package/dist/packages/_es/Uploader.js +1 -1
- package/dist/packages/_es/Video.js +1 -1
- package/dist/packages/_es/common.js +136 -0
- package/dist/packages/_es/component.js +1 -1
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/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 +1 -1
- package/dist/packages/cascader/index.scss +81 -0
- package/dist/packages/empty/index.scss +33 -0
- package/dist/packages/formitem/index.scss +1 -1
- package/dist/packages/grid/index.scss +10 -0
- package/dist/packages/griditem/index.scss +92 -0
- package/dist/packages/imagepreview/index.scss +1 -0
- package/dist/packages/indicator/index.scss +48 -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/style.css +1 -1
- package/dist/styles/themes/default.scss +45 -38
- package/dist/styles/variables.scss +49 -0
- package/package.json +2 -3
|
@@ -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.15-beta.0 Thu Dec 23 2021 17:12:09 GMT+0800 (中国标准时间)
|
|
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.15-beta.0 Thu Dec 23 2021 17:12:09 GMT+0800 (中国标准时间)
|
|
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.15-beta.0 Thu Dec 23 2021 17:12:09 GMT+0800 (中国标准时间)
|
|
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.15-beta.0 Thu Dec 23 2021 17:12:09 GMT+0800 (中国标准时间)
|
|
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.15-beta.0 Thu Dec 23 2021 17:12:09 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -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.15-beta.0 Thu Dec 23 2021 17:12:09 GMT+0800 (中国标准时间)
|
|
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.15-beta.0 Thu Dec 23 2021 17:12:09 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2021 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @nutui/nutui v3.1.15-beta.0 Thu Dec 23 2021 17:12:09 GMT+0800 (中国标准时间)
|
|
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 };
|
package/dist/packages/_es/raf.js
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
.nut-cascader {
|
|
2
|
+
width: 100%;
|
|
3
|
+
font-size: $nut-cascader-font-size;
|
|
4
|
+
line-height: $nut-cascader-line-height;
|
|
5
|
+
|
|
6
|
+
.nut-tabpane {
|
|
7
|
+
padding: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.nut-tabs__titles-item {
|
|
11
|
+
flex: initial;
|
|
12
|
+
min-width: auto;
|
|
13
|
+
padding: $nut-cascader-tabs-item-padding;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.nut-tabs__titles {
|
|
18
|
+
padding: $nut-cascader-tabs-item-padding;
|
|
19
|
+
background: #fff;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__bar {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
padding: $nut-cascader-bar-padding;
|
|
27
|
+
text-align: center;
|
|
28
|
+
font-weight: bold;
|
|
29
|
+
line-height: $nut-cascader-bar-line-height;
|
|
30
|
+
color: $nut-cascader-bar-color;
|
|
31
|
+
font-size: $nut-cascader-bar-font-size;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&-pane {
|
|
35
|
+
display: block;
|
|
36
|
+
padding: 0;
|
|
37
|
+
margin: 0;
|
|
38
|
+
width: 100%;
|
|
39
|
+
padding-top: 10px;
|
|
40
|
+
height: 342px;
|
|
41
|
+
overflow-y: auto;
|
|
42
|
+
-webkit-overflow-scrolling: touch;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&-item {
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
padding: $nut-cascader-item-padding;
|
|
49
|
+
margin: 0;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
font-size: $nut-cascader-item-font-size;
|
|
52
|
+
color: $nut-cascader-item-color;
|
|
53
|
+
|
|
54
|
+
&__title {
|
|
55
|
+
flex: 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__icon-check {
|
|
59
|
+
margin-left: 10px;
|
|
60
|
+
visibility: hidden;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__icon-loading {
|
|
64
|
+
margin-left: 10px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.active:not(.disabled) {
|
|
68
|
+
color: $nut-cascader-item-active-color;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.active &__icon-check {
|
|
72
|
+
visibility: visible;
|
|
73
|
+
color: $nut-cascader-item-active-color;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&.disabled {
|
|
77
|
+
opacity: 0.6;
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.nut-empty {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
padding: $empty-padding;
|
|
8
|
+
|
|
9
|
+
&-image {
|
|
10
|
+
width: $empty-image-size;
|
|
11
|
+
height: $empty-image-size;
|
|
12
|
+
|
|
13
|
+
.img {
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// 兼容小程序标签和img-slot
|
|
19
|
+
img,
|
|
20
|
+
image {
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 100%;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&-description {
|
|
27
|
+
margin-top: $empty-description-margin-top;
|
|
28
|
+
padding: $empty-description-padding;
|
|
29
|
+
color: $empty-description-color;
|
|
30
|
+
font-size: $empty-description-font-size;
|
|
31
|
+
line-height: $empty-description-line-height;
|
|
32
|
+
}
|
|
33
|
+
}
|