@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
@@ -22,7 +22,7 @@ var __publicField = (obj, key, value) => {
22
22
  return value;
23
23
  };
24
24
  /*!
25
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
25
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
26
26
  * (c) 2021 @jdf2e.
27
27
  * Released under the MIT License.
28
28
  */
@@ -67,6 +67,10 @@ const _sfc_main = create({
67
67
  paginationColor: {
68
68
  type: String,
69
69
  default: "#fff"
70
+ },
71
+ autoplay: {
72
+ type: [Number, String],
73
+ default: 3e3
70
74
  }
71
75
  },
72
76
  emits: ["close"],
@@ -89,7 +93,13 @@ const _sfc_main = create({
89
93
  options: {
90
94
  muted: true,
91
95
  controls: true
92
- }
96
+ },
97
+ eleImg: null,
98
+ store: {
99
+ scale: 1,
100
+ moveable: false
101
+ },
102
+ lastTouchEndTime: 0
93
103
  });
94
104
  const slideChangeEnd = function(page) {
95
105
  state.active = page + 1;
@@ -101,11 +111,88 @@ const _sfc_main = create({
101
111
  };
102
112
  const onClose = () => {
103
113
  state.showPop = false;
114
+ state.store.scale = 1;
115
+ scaleNow();
104
116
  state.active = 1;
105
117
  emit("close");
106
118
  };
119
+ const getDistance = (first, second) => {
120
+ return Math.hypot(Math.abs(second.x - first.x), Math.abs(second.y - first.y));
121
+ };
122
+ const scaleNow = () => {
123
+ state.eleImg.style.transform = "scale(" + state.store.scale + ")";
124
+ };
125
+ const onTouchStart = (event) => {
126
+ console.log("start");
127
+ const curTouchTime = new Date().getTime();
128
+ if (curTouchTime - state.lastTouchEndTime < 300) {
129
+ const store2 = state.store;
130
+ if (store2.scale > 1) {
131
+ store2.scale = 1;
132
+ } else if (store2.scale == 1) {
133
+ store2.scale = 2;
134
+ }
135
+ scaleNow();
136
+ }
137
+ var touches = event.touches;
138
+ var events = touches[0];
139
+ var events2 = touches[1];
140
+ const store = state.store;
141
+ store.moveable = true;
142
+ if (events2) {
143
+ store.oriDistance = getDistance({
144
+ x: events.pageX,
145
+ y: events.pageY
146
+ }, {
147
+ x: events2.pageX,
148
+ y: events2.pageY
149
+ });
150
+ }
151
+ store.originScale = store.scale || 1;
152
+ };
153
+ const onTouchMove = (event) => {
154
+ if (!state.store.moveable) {
155
+ return;
156
+ }
157
+ const store = state.store;
158
+ var touches = event.touches;
159
+ var events = touches[0];
160
+ var events2 = touches[1];
161
+ if (events2) {
162
+ const curDistance = getDistance({
163
+ x: events.pageX,
164
+ y: events.pageY
165
+ }, {
166
+ x: events2.pageX,
167
+ y: events2.pageY
168
+ });
169
+ const curScale = curDistance / store.oriDistance;
170
+ store.scale = store.originScale * curScale;
171
+ if (store.scale > 3) {
172
+ store.scale = 3;
173
+ }
174
+ scaleNow();
175
+ }
176
+ };
177
+ const onTouchEnd = () => {
178
+ console.log("end");
179
+ state.lastTouchEndTime = new Date().getTime();
180
+ const store = state.store;
181
+ store.moveable = false;
182
+ if (store.scale < 1.1 && store.scale > 1 || store.scale < 1) {
183
+ store.scale = 1;
184
+ scaleNow();
185
+ }
186
+ };
187
+ const init = () => {
188
+ state.eleImg = document.querySelector(".nut-imagepreview");
189
+ document.addEventListener("touchmove", onTouchMove);
190
+ document.addEventListener("touchend", onTouchEnd);
191
+ document.addEventListener("touchcancel", onTouchEnd);
192
+ };
107
193
  watch(() => props.show, (val) => {
108
194
  state.showPop = val;
195
+ init();
109
196
  });
110
197
  onMounted(() => {
111
198
  state.active = props.initNo;
@@ -115,7 +202,12 @@ const _sfc_main = create({
115
202
  return __spreadProps(__spreadValues({}, toRefs(state)), {
116
203
  slideChangeEnd,
117
204
  onClose,
118
- closeOnImg
205
+ closeOnImg,
206
+ onTouchStart,
207
+ onTouchMove,
208
+ onTouchEnd,
209
+ getDistance,
210
+ scaleNow
119
211
  });
120
212
  }
121
213
  });
@@ -129,17 +221,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
129
221
  return openBlock(), createBlock(_component_nut_popup, {
130
222
  "pop-class": "custom-pop",
131
223
  visible: _ctx.showPop,
132
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPop = $event),
133
- onClick: _ctx.onClose
224
+ "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => _ctx.showPop = $event),
225
+ onClick: _ctx.onClose,
226
+ style: { "width": "100%" }
134
227
  }, {
135
228
  default: withCtx(() => [
136
229
  createElementVNode("view", {
137
230
  class: "nut-imagepreview",
138
- onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.closeOnImg && _ctx.closeOnImg(...args), ["stop"]))
231
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.closeOnImg && _ctx.closeOnImg(...args), ["stop"])),
232
+ onTouchstartCapture: _cache[1] || (_cache[1] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args))
139
233
  }, [
140
234
  _ctx.showPop ? (openBlock(), createBlock(_component_nut_swiper, {
141
235
  key: 0,
142
- "auto-play": 3e3,
236
+ "auto-play": _ctx.autoplay,
143
237
  class: "nut-imagepreview-swiper",
144
238
  loop: true,
145
239
  "is-preventDefault": false,
@@ -174,9 +268,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
174
268
  }), 128))
175
269
  ]),
176
270
  _: 1
177
- }, 8, ["onChange", "init-page", "pagination-visible", "pagination-color"])) : createCommentVNode("", true),
178
- createElementVNode("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length + _ctx.videos.length), 1)
179
- ])
271
+ }, 8, ["auto-play", "onChange", "init-page", "pagination-visible", "pagination-color"])) : createCommentVNode("", true)
272
+ ], 32),
273
+ createElementVNode("view", _hoisted_2, toDisplayString(_ctx.active) + " / " + toDisplayString(_ctx.images.length + _ctx.videos.length), 1)
180
274
  ]),
181
275
  _: 1
182
276
  }, 8, ["visible", "onClick"]);
@@ -0,0 +1,66 @@
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 { toRefs, computed, openBlock, createElementBlock, normalizeClass, Fragment, renderList, 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("indicator");
10
+ const _sfc_main = create({
11
+ props: {
12
+ size: {
13
+ type: Number,
14
+ default: 3,
15
+ required: true
16
+ },
17
+ current: {
18
+ type: Number,
19
+ default: 1,
20
+ required: true
21
+ },
22
+ block: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ align: {
27
+ type: String,
28
+ default: "center"
29
+ },
30
+ fillZero: {
31
+ type: Boolean,
32
+ default: true
33
+ }
34
+ },
35
+ setup(props) {
36
+ const { block, align } = toRefs(props);
37
+ const classes = computed(() => {
38
+ const prefixCls = componentName;
39
+ return {
40
+ [prefixCls]: true,
41
+ [`${prefixCls}--block`]: block.value,
42
+ [`${prefixCls}--align__${align.value}`]: block.value && align.value
43
+ };
44
+ });
45
+ return { classes, componentName };
46
+ }
47
+ });
48
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
49
+ return openBlock(), createElementBlock("view", {
50
+ class: normalizeClass(_ctx.classes)
51
+ }, [
52
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.size, (item) => {
53
+ return openBlock(), createElementBlock(Fragment, { key: item }, [
54
+ item === _ctx.current ? (openBlock(), createElementBlock("view", {
55
+ key: 0,
56
+ class: normalizeClass(`${_ctx.componentName}--number`)
57
+ }, toDisplayString(_ctx.fillZero && item < 10 ? `0${item}` : item), 3)) : (openBlock(), createElementBlock("view", {
58
+ key: 1,
59
+ class: normalizeClass(`${_ctx.componentName}--dot`)
60
+ }, null, 2))
61
+ ], 64);
62
+ }), 128))
63
+ ], 2);
64
+ }
65
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
66
+ 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
  */
@@ -65,8 +65,8 @@ const _sfc_main = create({
65
65
  };
66
66
  const emitChange = (value, event) => {
67
67
  let output_value = fixedDecimalPlaces(value);
68
- emit("change", output_value, event);
69
68
  emit("update:modelValue", output_value, event);
69
+ emit("change", output_value, event);
70
70
  };
71
71
  const addAllow = (value = Number(props.modelValue)) => {
72
72
  return value < Number(props.max) && !props.disabled;
@@ -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
  */
@@ -12,7 +12,7 @@ const _sfc_main = create({
12
12
  props: {
13
13
  activeColor: {
14
14
  type: String,
15
- default: "#FA2C19"
15
+ default: ""
16
16
  },
17
17
  overlay: {
18
18
  type: Boolean,
@@ -95,7 +95,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
95
95
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.children, (item, index2) => {
96
96
  return openBlock(), createElementBlock("view", {
97
97
  key: index2,
98
- class: normalizeClass(["nut-menu__item", { disabled: item.disabled }]),
98
+ class: normalizeClass(["nut-menu__item", { disabled: item.disabled, active: item.state.showPopup }]),
99
99
  onClick: ($event) => !item.disabled && _ctx.toggleItem(index2),
100
100
  style: normalizeStyle({ color: item.state.showPopup ? _ctx.activeColor : "" })
101
101
  }, [
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  /*!
18
- * @nutui/nutui v3.1.13-beta.1 Mon Dec 13 2021 11:01:35 GMT+0800 (中国标准时间)
18
+ * @nutui/nutui v3.1.15-beta.1 Mon Jan 10 2022 12:18:44 GMT+0800 (中国标准时间)
19
19
  * (c) 2021 @jdf2e.
20
20
  * Released under the MIT License.
21
21
  */
@@ -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
  */
@@ -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
  */
@@ -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
  */
@@ -106,7 +106,8 @@ const _sfc_main = create({
106
106
  showSlot: true,
107
107
  transitionName: `popup-fade-${props.position}`,
108
108
  overLayCount: 1,
109
- keepAlive: false
109
+ keepAlive: false,
110
+ closed: props.closeable
110
111
  });
111
112
  const [lockScroll, unlockScroll] = useLockScroll(() => props.lockScroll);
112
113
  const classes = computed(() => {
@@ -203,6 +204,9 @@ const _sfc_main = create({
203
204
  watch(() => props.position, (value) => {
204
205
  value === "center" ? state.transitionName = "popup-fade" : state.transitionName = `popup-slide-${value}`;
205
206
  });
207
+ watch(() => props.closeable, (value) => {
208
+ state.closed = value;
209
+ });
206
210
  return __spreadProps(__spreadValues({}, toRefs(state)), {
207
211
  popStyle,
208
212
  classes,
@@ -245,7 +249,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
245
249
  onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args))
246
250
  }, [
247
251
  _ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
248
- _ctx.closeable ? (openBlock(), createElementBlock("view", {
252
+ _ctx.closed ? (openBlock(), createElementBlock("view", {
249
253
  key: 1,
250
254
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
251
255
  class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
@@ -285,7 +289,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
285
289
  onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onClick && _ctx.onClick(...args))
286
290
  }, [
287
291
  _ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
288
- _ctx.closeable ? (openBlock(), createElementBlock("view", {
292
+ _ctx.closed ? (openBlock(), createElementBlock("view", {
289
293
  key: 1,
290
294
  onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
291
295
  class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
@@ -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
  */
@@ -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
  */
@@ -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 { ref, reactive, computed, onMounted, toRefs, openBlock, createElementBlock, normalizeClass, createElementVNode, 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("sidenavbar");
29
+ const _sfc_main = create({
30
+ props: {
31
+ offset: {
32
+ type: [String, Number],
33
+ default: 15
34
+ }
35
+ },
36
+ emits: [],
37
+ setup: (props, context) => {
38
+ const list = ref(null);
39
+ const state = reactive({
40
+ count: 1,
41
+ observer: null
42
+ });
43
+ const classes = computed(() => {
44
+ const prefixCls = componentName;
45
+ return {
46
+ [prefixCls]: true
47
+ };
48
+ });
49
+ const setPaddingLeft = (nodeList, level = 1) => {
50
+ for (let i = 0; i < nodeList.length; i++) {
51
+ let item = nodeList[i];
52
+ item.children[0].style.paddingLeft = props.offset * level + "px";
53
+ if (!item.className.includes("nut-sidenavbaritem")) {
54
+ setPaddingLeft(Array.from(item.children[1].children), ++state.count);
55
+ }
56
+ }
57
+ state.count--;
58
+ };
59
+ const handleSlots = () => {
60
+ let childNodes = list.value.childNodes;
61
+ if (childNodes.length) {
62
+ childNodes = Array.from(childNodes).filter((item) => item.nodeType !== 3).map((item) => {
63
+ return item;
64
+ });
65
+ setPaddingLeft(childNodes);
66
+ }
67
+ };
68
+ onMounted(() => {
69
+ handleSlots();
70
+ state.observer = new MutationObserver(function() {
71
+ state.count = 1;
72
+ handleSlots();
73
+ });
74
+ state.observer.observe(list.value, {
75
+ attributes: false,
76
+ childList: true,
77
+ characterData: false,
78
+ subtree: false
79
+ });
80
+ });
81
+ return __spreadProps(__spreadValues({}, toRefs(state)), {
82
+ list,
83
+ classes
84
+ });
85
+ }
86
+ });
87
+ const _hoisted_1 = { class: "nut-sidenavbar__content" };
88
+ const _hoisted_2 = {
89
+ class: "nut-sidenavbar__content__list",
90
+ ref: "list"
91
+ };
92
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
93
+ return openBlock(), createElementBlock("view", {
94
+ class: normalizeClass(_ctx.classes)
95
+ }, [
96
+ createElementVNode("view", _hoisted_1, [
97
+ createElementVNode("view", _hoisted_2, [
98
+ renderSlot(_ctx.$slots, "default")
99
+ ], 512)
100
+ ])
101
+ ], 2);
102
+ }
103
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
104
+ export { index as default };