@nutui/nutui 3.1.13-beta.1 → 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 +27 -0
- package/README.md +7 -16
- package/dist/nutui.d.ts +5 -1
- package/dist/nutui.es.js +1276 -841
- package/dist/nutui.umd.js +1287 -848
- package/dist/packages/_es/ActionSheet.js +1 -1
- package/dist/packages/_es/Address.js +18 -19
- 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 +1 -1
- 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 +2 -3
- package/dist/packages/_es/CountUp.js +1 -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 +1 -1
- 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 +1 -1
- package/dist/packages/_es/GridItem.js +1 -1
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/ImagePreview.js +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/empty/index.scss +33 -0
- package/dist/packages/formitem/index.scss +1 -1
- 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/style.css +1 -1
- package/dist/styles/.DS_Store +0 -0
- package/dist/styles/themes/default.scss +43 -39
- package/dist/styles/variables.scss +23 -0
- package/package.json +1 -1
|
@@ -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.13
|
|
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.13
|
|
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
|
*/
|
|
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
/*!
|
|
18
|
-
* @nutui/nutui v3.1.13
|
|
18
|
+
* @nutui/nutui v3.1.13 Wed Dec 22 2021 20:42:09 GMT+0800 (GMT+08:00)
|
|
19
19
|
* (c) 2021 @jdf2e.
|
|
20
20
|
* Released under the MIT License.
|
|
21
21
|
*/
|
|
@@ -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.13
|
|
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.13
|
|
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.13
|
|
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.13
|
|
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
|
*/
|
package/dist/packages/_es/Row.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.13
|
|
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
|
*/
|
|
@@ -0,0 +1,138 @@
|
|
|
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 { c as createComponent } from "./component.js";
|
|
7
|
+
import { toRefs, computed, onMounted, resolveComponent, openBlock, createElementBlock, renderSlot, createElementVNode, createBlock, normalizeClass, normalizeStyle, createCommentVNode, Fragment, renderList } from "vue";
|
|
8
|
+
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
9
|
+
const component = {
|
|
10
|
+
props: {
|
|
11
|
+
width: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "100px"
|
|
14
|
+
},
|
|
15
|
+
height: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "100px"
|
|
18
|
+
},
|
|
19
|
+
animated: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
23
|
+
avatar: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false
|
|
26
|
+
},
|
|
27
|
+
avatarShape: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "round"
|
|
30
|
+
},
|
|
31
|
+
avatarSize: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "50px"
|
|
34
|
+
},
|
|
35
|
+
loading: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: true
|
|
38
|
+
},
|
|
39
|
+
round: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false
|
|
42
|
+
},
|
|
43
|
+
row: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "1"
|
|
46
|
+
},
|
|
47
|
+
title: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
setup(props) {
|
|
53
|
+
const { avatarShape, round, avatarSize } = toRefs(props);
|
|
54
|
+
const avatarClass = computed(() => {
|
|
55
|
+
const prefixCls = "avatarClass";
|
|
56
|
+
return {
|
|
57
|
+
[prefixCls]: true,
|
|
58
|
+
[`${prefixCls}--${avatarShape.value}`]: avatarShape.value
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
const blockClass = computed(() => {
|
|
62
|
+
const prefixCls = "blockClass";
|
|
63
|
+
return {
|
|
64
|
+
[prefixCls]: true,
|
|
65
|
+
[`${prefixCls}--round`]: round.value
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
const getStyle = () => {
|
|
69
|
+
if (avatarSize == null ? void 0 : avatarSize.value) {
|
|
70
|
+
return {
|
|
71
|
+
width: avatarSize.value,
|
|
72
|
+
height: avatarSize.value
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
width: "50px",
|
|
77
|
+
height: "50px"
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
onMounted(() => {
|
|
81
|
+
console.log("row", props.row);
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
avatarShape,
|
|
85
|
+
avatarClass,
|
|
86
|
+
blockClass,
|
|
87
|
+
getStyle
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const { create } = createComponent("skeleton");
|
|
92
|
+
const _sfc_main = create(component);
|
|
93
|
+
const _hoisted_1 = { key: 0 };
|
|
94
|
+
const _hoisted_2 = {
|
|
95
|
+
key: 1,
|
|
96
|
+
class: "skeleton"
|
|
97
|
+
};
|
|
98
|
+
const _hoisted_3 = /* @__PURE__ */ createElementVNode("view", { class: "skeleton-animation" }, null, -1);
|
|
99
|
+
const _hoisted_4 = { class: "content" };
|
|
100
|
+
const _hoisted_5 = { class: "content-line" };
|
|
101
|
+
const _hoisted_6 = {
|
|
102
|
+
key: 0,
|
|
103
|
+
class: "title"
|
|
104
|
+
};
|
|
105
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
106
|
+
const _component_nut_avatar = resolveComponent("nut-avatar");
|
|
107
|
+
return !_ctx.loading ? (openBlock(), createElementBlock("view", _hoisted_1, [
|
|
108
|
+
renderSlot(_ctx.$slots, "default")
|
|
109
|
+
])) : (openBlock(), createElementBlock("view", _hoisted_2, [
|
|
110
|
+
_hoisted_3,
|
|
111
|
+
createElementVNode("view", _hoisted_4, [
|
|
112
|
+
_ctx.avatar ? (openBlock(), createBlock(_component_nut_avatar, {
|
|
113
|
+
key: 0,
|
|
114
|
+
class: normalizeClass(_ctx.avatarClass),
|
|
115
|
+
shape: _ctx.avatarShape,
|
|
116
|
+
style: normalizeStyle(_ctx.getStyle()),
|
|
117
|
+
"bg-color": "rgb(239, 239, 239)"
|
|
118
|
+
}, null, 8, ["class", "shape", "style"])) : createCommentVNode("", true),
|
|
119
|
+
Number(_ctx.row) == 1 ? (openBlock(), createElementBlock("view", {
|
|
120
|
+
key: 1,
|
|
121
|
+
class: normalizeClass(_ctx.blockClass),
|
|
122
|
+
style: normalizeStyle({ width: _ctx.width, height: _ctx.height })
|
|
123
|
+
}, null, 6)) : createCommentVNode("", true),
|
|
124
|
+
createElementVNode("view", _hoisted_5, [
|
|
125
|
+
_ctx.title ? (openBlock(), createElementBlock("view", _hoisted_6)) : createCommentVNode("", true),
|
|
126
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(Number(_ctx.row), (item, index2) => {
|
|
127
|
+
return openBlock(), createElementBlock("view", {
|
|
128
|
+
key: index2,
|
|
129
|
+
class: normalizeClass(_ctx.blockClass),
|
|
130
|
+
style: normalizeStyle({ width: _ctx.width, height: _ctx.height })
|
|
131
|
+
}, null, 6);
|
|
132
|
+
}), 128))
|
|
133
|
+
])
|
|
134
|
+
])
|
|
135
|
+
]));
|
|
136
|
+
}
|
|
137
|
+
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
138
|
+
export { index as default };
|
package/dist/packages/_es/Sku.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.13
|
|
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.13
|
|
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
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.13
|
|
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
|
*/
|
|
@@ -10,7 +10,7 @@ const { componentName, create } = createComponent("switch");
|
|
|
10
10
|
const _sfc_main = create({
|
|
11
11
|
props: {
|
|
12
12
|
modelValue: {
|
|
13
|
-
type: Boolean,
|
|
13
|
+
type: [String, Number, Boolean],
|
|
14
14
|
default: false
|
|
15
15
|
},
|
|
16
16
|
disable: {
|
|
@@ -33,6 +33,14 @@ const _sfc_main = create({
|
|
|
33
33
|
type: String,
|
|
34
34
|
default: ""
|
|
35
35
|
},
|
|
36
|
+
activeValue: {
|
|
37
|
+
type: [String, Number, Boolean],
|
|
38
|
+
default: true
|
|
39
|
+
},
|
|
40
|
+
inactiveValue: {
|
|
41
|
+
type: [String, Number, Boolean],
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
36
44
|
loading: {
|
|
37
45
|
type: Boolean,
|
|
38
46
|
default: false
|
|
@@ -52,26 +60,28 @@ const _sfc_main = create({
|
|
|
52
60
|
},
|
|
53
61
|
emits: ["change", "update:modelValue"],
|
|
54
62
|
setup(props, { emit }) {
|
|
63
|
+
const isActive = computed(() => props.modelValue === props.activeValue);
|
|
55
64
|
const classes = computed(() => {
|
|
56
65
|
const prefixCls = componentName;
|
|
57
66
|
return {
|
|
58
67
|
[prefixCls]: true,
|
|
59
|
-
[
|
|
68
|
+
[isActive.value ? "switch-open" : "switch-close"]: true,
|
|
60
69
|
[`${prefixCls}-disable`]: props.disable,
|
|
61
70
|
[`${prefixCls}-base`]: true
|
|
62
71
|
};
|
|
63
72
|
});
|
|
64
73
|
const style = computed(() => {
|
|
65
74
|
return {
|
|
66
|
-
backgroundColor:
|
|
75
|
+
backgroundColor: isActive.value ? props.activeColor : props.inactiveColor
|
|
67
76
|
};
|
|
68
77
|
});
|
|
69
78
|
const onClick = (event) => {
|
|
70
79
|
if (props.disable || props.loading)
|
|
71
80
|
return;
|
|
72
|
-
|
|
81
|
+
const value = isActive.value ? props.inactiveValue : props.activeValue;
|
|
82
|
+
emit("update:modelValue", value);
|
|
73
83
|
emit("update:loading");
|
|
74
|
-
emit("change",
|
|
84
|
+
emit("change", value, event);
|
|
75
85
|
};
|
|
76
86
|
return {
|
|
77
87
|
classes,
|
|
@@ -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.13
|
|
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
|
*/
|