@nutui/nutui 3.1.13-beta.1 → 3.1.15-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.
Files changed (121) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +10 -19
  3. package/dist/nutui.d.ts +12 -5
  4. package/dist/nutui.es.js +1586 -859
  5. package/dist/nutui.umd.js +1600 -866
  6. package/dist/packages/_es/ActionSheet.js +1 -1
  7. package/dist/packages/_es/Address.js +19 -22
  8. package/dist/packages/_es/Avatar.js +1 -1
  9. package/dist/packages/_es/BackTop.js +1 -1
  10. package/dist/packages/_es/Badge.js +1 -1
  11. package/dist/packages/_es/Barrage.js +1 -1
  12. package/dist/packages/_es/Button.js +1 -1
  13. package/dist/packages/_es/Calendar.js +1 -1
  14. package/dist/packages/_es/Card.js +1 -1
  15. package/dist/packages/_es/Cascader.js +1 -1
  16. package/dist/packages/_es/Cell.js +1 -1
  17. package/dist/packages/_es/CellGroup.js +1 -1
  18. package/dist/packages/_es/Checkbox.js +1 -1
  19. package/dist/packages/_es/CheckboxGroup.js +1 -1
  20. package/dist/packages/_es/CircleProgress.js +1 -1
  21. package/dist/packages/_es/Col.js +1 -1
  22. package/dist/packages/_es/Collapse.js +1 -1
  23. package/dist/packages/_es/CollapseItem.js +1 -1
  24. package/dist/packages/_es/CountDown.js +2 -3
  25. package/dist/packages/_es/CountUp.js +1 -1
  26. package/dist/packages/_es/DatePicker.js +1 -1
  27. package/dist/packages/_es/Dialog.js +1 -1
  28. package/dist/packages/_es/Divider.js +1 -1
  29. package/dist/packages/_es/Drag.js +1 -1
  30. package/dist/packages/_es/Elevator.js +1 -1
  31. package/dist/packages/_es/Empty.js +74 -0
  32. package/dist/packages/_es/FixedNav.js +1 -1
  33. package/dist/packages/_es/Form.js +21 -5
  34. package/dist/packages/_es/FormItem.js +1 -1
  35. package/dist/packages/_es/Grid.js +1 -1
  36. package/dist/packages/_es/GridItem.js +1 -1
  37. package/dist/packages/_es/Icon.js +1 -1
  38. package/dist/packages/_es/ImagePreview.js +104 -10
  39. package/dist/packages/_es/Indicator.js +66 -0
  40. package/dist/packages/_es/InfiniteLoading.js +1 -1
  41. package/dist/packages/_es/Input.js +1 -1
  42. package/dist/packages/_es/InputNumber.js +2 -2
  43. package/dist/packages/_es/Layout.js +1 -1
  44. package/dist/packages/_es/Menu.js +3 -3
  45. package/dist/packages/_es/MenuItem.js +1 -1
  46. package/dist/packages/_es/Navbar.js +1 -1
  47. package/dist/packages/_es/NoticeBar.js +1 -1
  48. package/dist/packages/_es/Notify.js +1 -1
  49. package/dist/packages/_es/NumberKeyboard.js +1 -1
  50. package/dist/packages/_es/OverLay.js +1 -1
  51. package/dist/packages/_es/Pagination.js +1 -1
  52. package/dist/packages/_es/Picker.js +1 -1
  53. package/dist/packages/_es/Popover.js +1 -1
  54. package/dist/packages/_es/Popup.js +8 -4
  55. package/dist/packages/_es/Price.js +1 -1
  56. package/dist/packages/_es/Progress.js +1 -1
  57. package/dist/packages/_es/Radio.js +1 -1
  58. package/dist/packages/_es/RadioGroup.js +1 -1
  59. package/dist/packages/_es/Range.js +1 -1
  60. package/dist/packages/_es/Rate.js +1 -1
  61. package/dist/packages/_es/Row.js +1 -1
  62. package/dist/packages/_es/SearchBar.js +1 -1
  63. package/dist/packages/_es/ShortPassword.js +1 -1
  64. package/dist/packages/_es/SideNavBar.js +104 -0
  65. package/dist/packages/_es/SideNavBarItem.js +50 -0
  66. package/dist/packages/_es/Signature.js +1 -1
  67. package/dist/packages/_es/Skeleton.js +138 -0
  68. package/dist/packages/_es/Sku.js +1 -1
  69. package/dist/packages/_es/Step.js +1 -1
  70. package/dist/packages/_es/Steps.js +1 -1
  71. package/dist/packages/_es/SubSideNavBar.js +104 -0
  72. package/dist/packages/_es/Swipe.js +1 -1
  73. package/dist/packages/_es/Swiper.js +1 -1
  74. package/dist/packages/_es/SwiperItem.js +1 -1
  75. package/dist/packages/_es/Switch.js +16 -6
  76. package/dist/packages/_es/TabPane.js +1 -1
  77. package/dist/packages/_es/Tabbar.js +1 -1
  78. package/dist/packages/_es/TabbarItem.js +1 -1
  79. package/dist/packages/_es/Table.js +191 -0
  80. package/dist/packages/_es/Tabs.js +1 -1
  81. package/dist/packages/_es/Tag.js +1 -1
  82. package/dist/packages/_es/TextArea.js +2 -2
  83. package/dist/packages/_es/TimeDetail.js +1 -1
  84. package/dist/packages/_es/TimePannel.js +1 -1
  85. package/dist/packages/_es/TimeSelect.js +1 -1
  86. package/dist/packages/_es/Toast.js +1 -1
  87. package/dist/packages/_es/Uploader.js +1 -1
  88. package/dist/packages/_es/Video.js +1 -1
  89. package/dist/packages/_es/common.js +1 -1
  90. package/dist/packages/_es/component.js +1 -1
  91. package/dist/packages/_es/index.js +1 -1
  92. package/dist/packages/_es/index2.js +1 -1
  93. package/dist/packages/_es/index3.js +1 -1
  94. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  95. package/dist/packages/_es/pxCheck.js +1 -1
  96. package/dist/packages/_es/raf.js +1 -1
  97. package/dist/packages/_es/util.js +1 -1
  98. package/dist/packages/actionsheet/index.scss +2 -2
  99. package/dist/packages/address/index.scss +2 -0
  100. package/dist/packages/cascader/index.scss +13 -13
  101. package/dist/packages/empty/index.scss +33 -0
  102. package/dist/packages/formitem/index.scss +1 -1
  103. package/dist/packages/imagepreview/index.scss +1 -0
  104. package/dist/packages/indicator/index.scss +48 -0
  105. package/dist/packages/menu/index.scss +10 -6
  106. package/dist/packages/menuitem/index.scss +8 -7
  107. package/dist/packages/noticebar/index.scss +11 -11
  108. package/dist/packages/picker/index.scss +2 -6
  109. package/dist/packages/progress/index.scss +2 -8
  110. package/dist/packages/shortpassword/index.scss +6 -6
  111. package/dist/packages/sidenavbar/index.scss +14 -0
  112. package/dist/packages/sidenavbaritem/index.scss +10 -0
  113. package/dist/packages/skeleton/index.scss +57 -0
  114. package/dist/packages/sku/index.scss +1 -1
  115. package/dist/packages/subsidenavbar/index.scss +39 -0
  116. package/dist/packages/table/index.scss +81 -0
  117. package/dist/style.css +1 -1
  118. package/dist/styles/themes/default.scss +44 -37
  119. package/dist/styles/themes/jdd.scss +2 -0
  120. package/dist/styles/variables.scss +95 -68
  121. package/package.json +5 -2
@@ -0,0 +1,50 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
+ * (c) 2021 @jdf2e.
4
+ * Released under the MIT License.
5
+ */
6
+ import { computed, openBlock, createElementBlock, withModifiers, createElementVNode, toDisplayString } from "vue";
7
+ import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
+ const { componentName, create } = createComponent("sidenavbaritem");
10
+ const _sfc_main = create({
11
+ props: {
12
+ title: {
13
+ type: String,
14
+ default: ""
15
+ },
16
+ ikey: {
17
+ type: String,
18
+ default: ""
19
+ }
20
+ },
21
+ emits: ["click"],
22
+ setup: (props, context) => {
23
+ const classes = computed(() => {
24
+ const prefixCls = componentName;
25
+ return {
26
+ [prefixCls]: true
27
+ };
28
+ });
29
+ const handleClick = () => {
30
+ context.emit("click");
31
+ };
32
+ return {
33
+ classes,
34
+ handleClick
35
+ };
36
+ }
37
+ });
38
+ const _hoisted_1 = ["ikey"];
39
+ const _hoisted_2 = { class: "nut-sidenavbaritem__title" };
40
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
41
+ return openBlock(), createElementBlock("view", {
42
+ class: "nut-sidenavbaritem",
43
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"])),
44
+ ikey: _ctx.ikey
45
+ }, [
46
+ createElementVNode("span", _hoisted_2, toDisplayString(_ctx.title), 1)
47
+ ], 8, _hoisted_1);
48
+ }
49
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
50
+ export { index as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -0,0 +1,138 @@
1
+ /*!
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
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 };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -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-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
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-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -0,0 +1,104 @@
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.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
22
+ * (c) 2021 @jdf2e.
23
+ * Released under the MIT License.
24
+ */
25
+ import { reactive, computed, onMounted, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withModifiers, toDisplayString, createVNode, normalizeStyle, renderSlot } from "vue";
26
+ import { c as createComponent } from "./component.js";
27
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
28
+ const { componentName, create } = createComponent("subsidenavbar");
29
+ const _sfc_main = create({
30
+ props: {
31
+ title: {
32
+ type: String,
33
+ default: ""
34
+ },
35
+ ikey: {
36
+ type: [String, Number],
37
+ default: ""
38
+ },
39
+ open: {
40
+ type: Boolean,
41
+ default: true
42
+ }
43
+ },
44
+ emits: ["title-click"],
45
+ setup: (props, context) => {
46
+ const state = reactive({
47
+ direction: ""
48
+ });
49
+ const classes = computed(() => {
50
+ const prefixCls = componentName;
51
+ return {
52
+ [prefixCls]: true
53
+ };
54
+ });
55
+ const style = computed(() => {
56
+ return {
57
+ height: !state.direction ? "auto" : "0px"
58
+ };
59
+ });
60
+ const handleClick = () => {
61
+ context.emit("title-click");
62
+ state.direction = !state.direction ? "up" : "";
63
+ };
64
+ onMounted(() => {
65
+ state.direction = props.open ? "" : "up";
66
+ });
67
+ return __spreadProps(__spreadValues({}, toRefs(state)), {
68
+ classes,
69
+ style,
70
+ handleClick
71
+ });
72
+ }
73
+ });
74
+ const _hoisted_1 = ["ikey"];
75
+ const _hoisted_2 = { class: "nut-subsidenavbar__title__text" };
76
+ const _hoisted_3 = { class: "nut-subsidenavbar__title__icon" };
77
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
78
+ const _component_nut_icon = resolveComponent("nut-icon");
79
+ return openBlock(), createElementBlock("view", {
80
+ class: normalizeClass(_ctx.classes),
81
+ ikey: _ctx.ikey
82
+ }, [
83
+ createElementVNode("view", {
84
+ class: "nut-subsidenavbar__title",
85
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"]))
86
+ }, [
87
+ createElementVNode("span", _hoisted_2, toDisplayString(_ctx.title), 1),
88
+ createElementVNode("span", _hoisted_3, [
89
+ createVNode(_component_nut_icon, {
90
+ name: "down-arrow",
91
+ class: normalizeClass(_ctx.direction)
92
+ }, null, 8, ["class"])
93
+ ])
94
+ ]),
95
+ createElementVNode("view", {
96
+ class: normalizeClass(["nut-subsidenavbar__list", !_ctx.direction ? "nutFadeIn" : "nutFadeOut"]),
97
+ style: normalizeStyle(_ctx.style)
98
+ }, [
99
+ renderSlot(_ctx.$slots, "default")
100
+ ], 6)
101
+ ], 10, _hoisted_1);
102
+ }
103
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
104
+ export { index as default };
@@ -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-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
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-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
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
- [props.modelValue ? "switch-open" : "switch-close"]: true,
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: props.modelValue ? props.activeColor : props.inactiveColor
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
- emit("update:modelValue", !props.modelValue);
81
+ const value = isActive.value ? props.inactiveValue : props.activeValue;
82
+ emit("update:modelValue", value);
73
83
  emit("update:loading");
74
- emit("change", !props.modelValue, event);
84
+ emit("change", value, event);
75
85
  };
76
86
  return {
77
87
  classes,
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -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.1 Mon Jan 10 2022 12:18:44 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.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
22
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
23
23
  * (c) 2021 @jdf2e.
24
24
  * Released under the MIT License.
25
25
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -65,8 +65,8 @@ const _sfc_main = create({
65
65
  if (props.maxLength && value.length > Number(props.maxLength)) {
66
66
  value = value.substring(0, Number(props.maxLength));
67
67
  }
68
- emit("change", value, event);
69
68
  emit("update:modelValue", value, event);
69
+ emit("change", value, event);
70
70
  };
71
71
  const change = (event) => {
72
72
  const input = event.target;
@@ -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-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
22
22
  * (c) 2021 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */