@nutui/nutui 3.1.12-beta.1 → 3.1.14

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 (131) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +139 -37
  3. package/dist/nutui.d.ts +9 -2
  4. package/dist/nutui.es.js +4830 -2950
  5. package/dist/nutui.umd.js +4910 -2953
  6. package/dist/packages/_es/ActionSheet.js +12 -13
  7. package/dist/packages/_es/Address.js +64 -77
  8. package/dist/packages/_es/Avatar.js +5 -4
  9. package/dist/packages/_es/BackTop.js +109 -72
  10. package/dist/packages/_es/Badge.js +5 -4
  11. package/dist/packages/_es/Barrage.js +57 -63
  12. package/dist/packages/_es/Button.js +6 -5
  13. package/dist/packages/_es/Calendar.js +18 -27
  14. package/dist/packages/_es/Card.js +8 -7
  15. package/dist/packages/_es/Cascader.js +547 -0
  16. package/dist/packages/_es/Cell.js +13 -5
  17. package/dist/packages/_es/CellGroup.js +14 -7
  18. package/dist/packages/_es/Checkbox.js +3 -3
  19. package/dist/packages/_es/CheckboxGroup.js +4 -9
  20. package/dist/packages/_es/CircleProgress.js +46 -142
  21. package/dist/packages/_es/Col.js +5 -4
  22. package/dist/packages/_es/Collapse.js +10 -35
  23. package/dist/packages/_es/CollapseItem.js +35 -80
  24. package/dist/packages/_es/CountDown.js +7 -10
  25. package/dist/packages/_es/CountUp.js +33 -34
  26. package/dist/packages/_es/DatePicker.js +219 -451
  27. package/dist/packages/_es/Dialog.js +98 -46
  28. package/dist/packages/_es/Divider.js +6 -5
  29. package/dist/packages/_es/Drag.js +50 -76
  30. package/dist/packages/_es/Elevator.js +53 -81
  31. package/dist/packages/_es/Empty.js +74 -0
  32. package/dist/packages/_es/FixedNav.js +9 -8
  33. package/dist/packages/_es/Form.js +23 -9
  34. package/dist/packages/_es/FormItem.js +5 -4
  35. package/dist/packages/_es/Grid.js +12 -0
  36. package/dist/packages/_es/GridItem.js +149 -0
  37. package/dist/packages/_es/Icon.js +40 -6
  38. package/dist/packages/_es/ImagePreview.js +158 -44
  39. package/dist/packages/_es/Indicator.js +66 -0
  40. package/dist/packages/_es/InfiniteLoading.js +109 -95
  41. package/dist/packages/_es/Input.js +21 -22
  42. package/dist/packages/_es/InputNumber.js +18 -24
  43. package/dist/packages/_es/Layout.js +2 -2
  44. package/dist/packages/_es/Menu.js +14 -16
  45. package/dist/packages/_es/MenuItem.js +11 -9
  46. package/dist/packages/_es/Navbar.js +7 -7
  47. package/dist/packages/_es/NoticeBar.js +31 -46
  48. package/dist/packages/_es/Notify.js +166 -30
  49. package/dist/packages/_es/NumberKeyboard.js +7 -9
  50. package/dist/packages/_es/OverLay.js +29 -22
  51. package/dist/packages/_es/Pagination.js +9 -8
  52. package/dist/packages/_es/Picker.js +447 -61
  53. package/dist/packages/_es/Popover.js +34 -161
  54. package/dist/packages/_es/Popup.js +77 -17
  55. package/dist/packages/_es/Price.js +7 -18
  56. package/dist/packages/_es/Progress.js +12 -23
  57. package/dist/packages/_es/Radio.js +3 -3
  58. package/dist/packages/_es/RadioGroup.js +2 -2
  59. package/dist/packages/_es/Range.js +31 -38
  60. package/dist/packages/_es/Rate.js +35 -17
  61. package/dist/packages/_es/Row.js +5 -4
  62. package/dist/packages/_es/SearchBar.js +5 -7
  63. package/dist/packages/_es/ShortPassword.js +59 -89
  64. package/dist/packages/_es/Signature.js +71 -70
  65. package/dist/packages/_es/Skeleton.js +138 -0
  66. package/dist/packages/_es/Sku.js +43 -53
  67. package/dist/packages/_es/Step.js +8 -10
  68. package/dist/packages/_es/Steps.js +2 -2
  69. package/dist/packages/_es/Swipe.js +28 -43
  70. package/dist/packages/_es/Swiper.js +418 -17
  71. package/dist/packages/_es/SwiperItem.js +39 -14
  72. package/dist/packages/_es/Switch.js +47 -16
  73. package/dist/packages/_es/TabPane.js +5 -4
  74. package/dist/packages/_es/Tabbar.js +5 -4
  75. package/dist/packages/_es/TabbarItem.js +9 -8
  76. package/dist/packages/_es/Table.js +191 -0
  77. package/dist/packages/_es/Tabs.js +21 -23
  78. package/dist/packages/_es/Tag.js +6 -5
  79. package/dist/packages/_es/TextArea.js +12 -16
  80. package/dist/packages/_es/TimeDetail.js +5 -7
  81. package/dist/packages/_es/TimePannel.js +5 -7
  82. package/dist/packages/_es/TimeSelect.js +7 -12
  83. package/dist/packages/_es/Toast.js +178 -46
  84. package/dist/packages/_es/Uploader.js +149 -109
  85. package/dist/packages/_es/Video.js +405 -0
  86. package/dist/packages/_es/common.js +136 -0
  87. package/dist/packages/_es/component.js +1 -1
  88. package/dist/packages/_es/index.js +7 -58
  89. package/dist/packages/_es/index2.js +58 -43
  90. package/dist/packages/_es/index3.js +28 -411
  91. package/dist/packages/_es/plugin-vue_export-helper.js +13 -0
  92. package/dist/packages/_es/pxCheck.js +1 -1
  93. package/dist/packages/_es/raf.js +1 -1
  94. package/dist/packages/_es/util.js +1 -1
  95. package/dist/packages/cascader/index.scss +81 -0
  96. package/dist/packages/cellgroup/index.scss +9 -0
  97. package/dist/packages/dialog/index.scss +17 -0
  98. package/dist/packages/drag/index.scss +4 -0
  99. package/dist/packages/empty/index.scss +33 -0
  100. package/dist/packages/fixednav/index.scss +6 -1
  101. package/dist/packages/formitem/index.scss +4 -1
  102. package/dist/packages/grid/index.scss +10 -0
  103. package/dist/packages/griditem/index.scss +92 -0
  104. package/dist/packages/icon/index.scss +2 -1
  105. package/dist/packages/indicator/index.scss +48 -0
  106. package/dist/packages/numberkeyboard/index.scss +1 -1
  107. package/dist/packages/popover/index.scss +2 -2
  108. package/dist/packages/rate/index.scss +1 -0
  109. package/dist/packages/skeleton/index.scss +57 -0
  110. package/dist/packages/table/index.scss +81 -0
  111. package/dist/packages/tabs/index.scss +16 -0
  112. package/dist/packages/textarea/index.scss +1 -0
  113. package/dist/packages/timedetail/index.scss +1 -2
  114. package/dist/packages/timeselect/index.scss +3 -0
  115. package/dist/packages/toast/index.scss +6 -0
  116. package/dist/style.css +1 -1
  117. package/dist/style.es.js +2 -1
  118. package/dist/styles/font/config.json +2 -1
  119. package/dist/styles/font/demo_index.html +26 -3
  120. package/dist/styles/font/iconfont.css +7 -3
  121. package/dist/styles/font/iconfont.js +31 -32
  122. package/dist/styles/font/iconfont.json +7 -0
  123. package/dist/styles/font/iconfont.ttf +0 -0
  124. package/dist/styles/font/iconfont.woff +0 -0
  125. package/dist/styles/font/iconfont.woff2 +0 -0
  126. package/dist/styles/themes/default.scss +40 -33
  127. package/dist/styles/variables.scss +54 -1
  128. package/package.json +2 -3
  129. package/dist/packages/_es/commonProps.js +0 -30
  130. package/dist/packages/_es/index.taro.vue_vue&type=script&lang.js +0 -44
  131. package/dist/packages/_es/use-lock-scroll.js +0 -23
@@ -17,18 +17,17 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __require = typeof require !== "undefined" ? require : (x) => {
21
- throw new Error('Dynamic require of "' + x + '" is not supported');
22
- };
23
20
  /*!
24
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
25
22
  * (c) 2021 @jdf2e.
26
23
  * Released under the MIT License.
27
24
  */
28
25
  import { c as createComponent } from "./component.js";
29
26
  import { computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, normalizeStyle, createTextVNode } from "vue";
30
- import { p as popupProps } from "./index3.js";
31
- import "./use-lock-scroll.js";
27
+ import { popupProps } from "./Popup.js";
28
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
29
+ import "./OverLay.js";
30
+ import "./Icon.js";
32
31
  import "./pxCheck.js";
33
32
  const { componentName, create } = createComponent("actionsheet");
34
33
  const _sfc_main = create({
@@ -81,9 +80,9 @@ const _sfc_main = create({
81
80
  emit("cancel");
82
81
  emit("update:visible", false);
83
82
  };
84
- const chooseItem = (item, index) => {
83
+ const chooseItem = (item, index2) => {
85
84
  if (!item.disable) {
86
- emit("choose", item, index);
85
+ emit("choose", item, index2);
87
86
  emit("update:visible", false);
88
87
  }
89
88
  };
@@ -132,12 +131,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
132
131
  _ctx.title ? (openBlock(), createElementBlock("view", _hoisted_2, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
133
132
  _ctx.description ? (openBlock(), createElementBlock("view", _hoisted_3, toDisplayString(_ctx.description), 1)) : createCommentVNode("", true),
134
133
  _ctx.menuItems.length ? (openBlock(), createElementBlock("view", _hoisted_4, [
135
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuItems, (item, index) => {
134
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuItems, (item, index2) => {
136
135
  return openBlock(), createElementBlock("view", {
137
136
  class: normalizeClass(["nut-actionsheet-item", { "nut-actionsheet-item-disabled": item.disable }]),
138
137
  style: normalizeStyle({ color: _ctx.isHighlight(item) }),
139
- key: index,
140
- onClick: ($event) => _ctx.chooseItem(item, index)
138
+ key: index2,
139
+ onClick: ($event) => _ctx.chooseItem(item, index2)
141
140
  }, [
142
141
  createTextVNode(toDisplayString(item[_ctx.optionTag]), 1),
143
142
  createElementVNode("view", _hoisted_6, toDisplayString(item[_ctx.optionSubTag]), 1)
@@ -155,5 +154,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
155
154
  }, 8, ["visible", "onClickOverlay"])
156
155
  ], 2);
157
156
  }
158
- _sfc_main.render = _sfc_render;
159
- export { _sfc_main as default };
157
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
158
+ export { index as default };
@@ -14,19 +14,16 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
- var __require = typeof require !== "undefined" ? require : (x) => {
18
- throw new Error('Dynamic require of "' + x + '" is not supported');
19
- };
20
17
  /*!
21
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
18
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
22
19
  * (c) 2021 @jdf2e.
23
20
  * Released under the MIT License.
24
21
  */
25
- import { computed, ref, reactive, watch, toRefs, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, createCommentVNode, toDisplayString, createElementBlock, Fragment, renderList, normalizeStyle, createTextVNode, createVNode } from "vue";
22
+ import { ref, computed, reactive, watch, toRefs, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withDirectives, createVNode, vShow, toDisplayString, createCommentVNode, createElementBlock, Fragment, renderList, normalizeClass, normalizeStyle, createTextVNode, nextTick } from "vue";
26
23
  import { c as createComponent } from "./component.js";
27
- import Taro from "@tarojs/taro";
28
- const { create, componentName } = createComponent("address");
29
- var _sfc_main = create({
24
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
25
+ const { componentName, create } = createComponent("address");
26
+ const _sfc_main = create({
30
27
  inheritAttrs: false,
31
28
  props: {
32
29
  visible: {
@@ -96,19 +93,8 @@ var _sfc_main = create({
96
93
  },
97
94
  emits: ["update:visible", "type", "change", "selected", "close", "close-mask", "switch-module"],
98
95
  setup(props, { emit }) {
99
- const classes = computed(() => {
100
- const prefixCls = componentName;
101
- return {
102
- [prefixCls]: true
103
- };
104
- });
105
96
  const regionLine = ref(null);
106
- const tabItemRef = reactive({
107
- province: ref(null),
108
- city: ref(null),
109
- country: ref(null),
110
- town: ref(null)
111
- });
97
+ const tabRegion = ref(null);
112
98
  const showPopup = ref(props.visible);
113
99
  const privateType = ref(props.type);
114
100
  const tabIndex = ref(0);
@@ -130,16 +116,16 @@ var _sfc_main = create({
130
116
  return a.title.localeCompare(b.title);
131
117
  });
132
118
  data.forEach((item) => {
133
- const index = newData.findIndex((value) => value.title === item.title);
134
- if (index <= -1) {
119
+ const index2 = newData.findIndex((value) => value.title === item.title);
120
+ if (index2 <= -1) {
135
121
  newData.push({
136
122
  title: item.title,
137
123
  list: [].concat(item)
138
124
  });
139
125
  } else {
140
- newData[index] = {
126
+ newData[index2] = {
141
127
  title: item.title,
142
- list: newData[index].list.concat(item)
128
+ list: newData[index2].list.concat(item)
143
129
  };
144
130
  }
145
131
  });
@@ -160,10 +146,10 @@ var _sfc_main = create({
160
146
  let selectedExistAddress = reactive({});
161
147
  const closeWay = ref("self");
162
148
  const lineDistance = ref(20);
163
- const getTabName = (item, index) => {
149
+ const getTabName = (item, index2) => {
164
150
  if (item.name)
165
151
  return item.name;
166
- if (tabIndex.value < index) {
152
+ if (tabIndex.value < index2) {
167
153
  return item.name;
168
154
  } else {
169
155
  return "\u8BF7\u9009\u62E9";
@@ -179,14 +165,14 @@ var _sfc_main = create({
179
165
  closeWay.value = "mask";
180
166
  };
181
167
  const lineAnimation = () => {
182
- setTimeout(() => {
183
- Taro.createSelectorQuery().selectAll(`.${tabName.value[tabIndex.value]}`).boundingClientRect((rects) => {
184
- rects.forEach((rect) => {
185
- if (rect.width > 0)
186
- lineDistance.value = rect.left;
187
- });
188
- }).exec();
189
- }, 100);
168
+ console.log("\u6ED1\u52A8\u7EA2\u7EBF");
169
+ nextTick(() => {
170
+ const name = tabRegion.value && tabRegion.value.getElementsByClassName("active")[0];
171
+ if (name) {
172
+ const distance = name.offsetLeft;
173
+ lineDistance.value = distance ? distance : 20;
174
+ }
175
+ });
190
176
  };
191
177
  const nextAreaList = (item) => {
192
178
  const calBack = {
@@ -208,16 +194,16 @@ var _sfc_main = create({
208
194
  handClose();
209
195
  }
210
196
  };
211
- const changeRegionTab = (item, key, index) => {
212
- if (getTabName(item, index)) {
213
- tabIndex.value = index;
197
+ const changeRegionTab = (item, key, index2) => {
198
+ if (getTabName(item, index2)) {
199
+ tabIndex.value = index2;
214
200
  lineAnimation();
215
201
  }
216
202
  };
217
203
  const selectedExist = (item) => {
218
204
  const copyExistAdd = props.existAddress;
219
205
  let prevExistAdd = {};
220
- copyExistAdd.forEach((list, index) => {
206
+ copyExistAdd.forEach((list, index2) => {
221
207
  if (list && list.selectedAddress) {
222
208
  prevExistAdd = list;
223
209
  }
@@ -303,14 +289,13 @@ var _sfc_main = create({
303
289
  regionList.town = isCustom2.value ? transformData(value) : value;
304
290
  });
305
291
  watch(() => props.existAddress, (value) => {
306
- value.forEach((item, index) => {
292
+ value.forEach((item, index2) => {
307
293
  if (item.selectedAddress) {
308
294
  selectedExistAddress = item;
309
295
  }
310
296
  });
311
297
  });
312
- return __spreadValues(__spreadValues({
313
- classes,
298
+ return __spreadValues({
314
299
  showPopup,
315
300
  privateType,
316
301
  tabIndex,
@@ -324,13 +309,14 @@ var _sfc_main = create({
324
309
  getTabName,
325
310
  nextAreaList,
326
311
  regionLine,
312
+ tabRegion,
327
313
  lineDistance,
328
314
  changeRegionTab,
329
315
  selectedExist,
330
316
  clickOverlay,
331
317
  handClose,
332
318
  handleElevatorItem
333
- }, toRefs(props)), toRefs(tabItemRef));
319
+ }, toRefs(props));
334
320
  }
335
321
  });
336
322
  const _hoisted_1 = { class: "nut-address" };
@@ -340,7 +326,10 @@ const _hoisted_4 = {
340
326
  key: 0,
341
327
  class: "custom-address"
342
328
  };
343
- const _hoisted_5 = { class: "region-tab" };
329
+ const _hoisted_5 = {
330
+ class: "region-tab",
331
+ ref: "tabRegion"
332
+ };
344
333
  const _hoisted_6 = ["onClick"];
345
334
  const _hoisted_7 = { class: "region-con" };
346
335
  const _hoisted_8 = { class: "region-group" };
@@ -349,12 +338,12 @@ const _hoisted_10 = {
349
338
  key: 1,
350
339
  class: "custom-address"
351
340
  };
352
- const _hoisted_11 = { class: "region-tab" };
353
- const _hoisted_12 = ["onClick"];
354
- const _hoisted_13 = {
355
- key: 0,
356
- class: "elevator-group"
341
+ const _hoisted_11 = {
342
+ class: "region-tab",
343
+ ref: "tabRegion"
357
344
  };
345
+ const _hoisted_12 = ["onClick"];
346
+ const _hoisted_13 = { class: "elevator-group" };
358
347
  const _hoisted_14 = {
359
348
  key: 2,
360
349
  class: "exist-address"
@@ -381,8 +370,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
381
370
  onClickOverlay: _ctx.clickOverlay,
382
371
  onOpen: _cache[3] || (_cache[3] = ($event) => _ctx.closeWay = "self"),
383
372
  visible: _ctx.showPopup,
384
- "onUpdate:visible": _cache[4] || (_cache[4] = ($event) => _ctx.showPopup = $event),
385
- class: normalizeClass(_ctx.classes)
373
+ "onUpdate:visible": _cache[4] || (_cache[4] = ($event) => _ctx.showPopup = $event)
386
374
  }, {
387
375
  default: withCtx(() => [
388
376
  createElementVNode("view", _hoisted_1, [
@@ -391,11 +379,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
391
379
  class: "arrow-back",
392
380
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.switchModule && _ctx.switchModule(...args))
393
381
  }, [
394
- _ctx.privateType == "custom" && _ctx.type == "exist" && _ctx.backBtnIcon ? (openBlock(), createBlock(_component_nut_icon, {
395
- key: 0,
382
+ withDirectives(createVNode(_component_nut_icon, {
396
383
  name: _ctx.backBtnIcon,
397
384
  color: "#cccccc"
398
- }, null, 8, ["name"])) : createCommentVNode("", true)
385
+ }, null, 8, ["name"]), [
386
+ [vShow, _ctx.privateType == "custom" && _ctx.backBtnIcon]
387
+ ])
399
388
  ]),
400
389
  createElementVNode("view", _hoisted_3, toDisplayString(_ctx.privateType == "custom" ? _ctx.customAddressTitle : _ctx.existAddressTitle), 1),
401
390
  createElementVNode("view", {
@@ -412,14 +401,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
412
401
  ]),
413
402
  _ctx.privateType == "custom" ? (openBlock(), createElementBlock("view", _hoisted_4, [
414
403
  createElementVNode("view", _hoisted_5, [
415
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedRegion, (item, key, index) => {
404
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedRegion, (item, key, index2) => {
416
405
  return openBlock(), createElementBlock("view", {
417
- class: normalizeClass(["tab-item", [index == _ctx.tabIndex ? "active" : "", key]]),
418
- key: index,
419
- ref: key,
420
- onClick: ($event) => _ctx.changeRegionTab(item, key, index)
406
+ class: normalizeClass(["tab-item", [index2 == _ctx.tabIndex ? "active" : ""]]),
407
+ key: index2,
408
+ onClick: ($event) => _ctx.changeRegionTab(item, key, index2)
421
409
  }, [
422
- createElementVNode("view", null, toDisplayString(_ctx.getTabName(item, index)), 1)
410
+ createElementVNode("view", null, toDisplayString(_ctx.getTabName(item, index2)), 1)
423
411
  ], 10, _hoisted_6);
424
412
  }), 128)),
425
413
  createElementVNode("view", {
@@ -427,12 +415,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
427
415
  ref: "regionLine",
428
416
  style: normalizeStyle({ left: _ctx.lineDistance + "px" })
429
417
  }, null, 4)
430
- ]),
418
+ ], 512),
431
419
  createElementVNode("view", _hoisted_7, [
432
420
  createElementVNode("ul", _hoisted_8, [
433
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.regionList[_ctx.tabName[_ctx.tabIndex]], (item, index) => {
421
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.regionList[_ctx.tabName[_ctx.tabIndex]], (item, index2) => {
434
422
  return openBlock(), createElementBlock("li", {
435
- key: index,
423
+ key: index2,
436
424
  class: normalizeClass(["region-item", [_ctx.selectedRegion[_ctx.tabName[_ctx.tabIndex]].id == item.id ? "active" : ""]]),
437
425
  onClick: ($event) => _ctx.nextAreaList(item)
438
426
  }, [
@@ -449,16 +437,15 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
449
437
  }), 128))
450
438
  ])
451
439
  ])
452
- ])) : _ctx.privateType === "custom2" ? (openBlock(), createElementBlock("view", _hoisted_10, [
440
+ ])) : _ctx.privateType == "custom2" ? (openBlock(), createElementBlock("view", _hoisted_10, [
453
441
  createElementVNode("view", _hoisted_11, [
454
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedRegion, (item, key, index) => {
442
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedRegion, (item, key, index2) => {
455
443
  return openBlock(), createElementBlock("view", {
456
- class: normalizeClass(["tab-item", [index == _ctx.tabIndex ? "active" : ""]]),
457
- key: index,
458
- ref: key,
459
- onClick: ($event) => _ctx.changeRegionTab(item, key, index)
444
+ class: normalizeClass(["tab-item", [index2 == _ctx.tabIndex ? "active" : ""]]),
445
+ key: index2,
446
+ onClick: ($event) => _ctx.changeRegionTab(item, key, index2)
460
447
  }, [
461
- createElementVNode("view", null, toDisplayString(_ctx.getTabName(item, index)), 1)
448
+ createElementVNode("view", null, toDisplayString(_ctx.getTabName(item, index2)), 1)
462
449
  ], 10, _hoisted_12);
463
450
  }), 128)),
464
451
  createElementVNode("view", {
@@ -466,21 +453,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
466
453
  ref: "regionLine",
467
454
  style: normalizeStyle({ left: _ctx.lineDistance + "px" })
468
455
  }, null, 4)
469
- ]),
470
- _ctx.showPopup ? (openBlock(), createElementBlock("view", _hoisted_13, [
456
+ ], 512),
457
+ createElementVNode("view", _hoisted_13, [
471
458
  createVNode(_component_nut_elevator, {
472
459
  height: _ctx.height,
473
460
  "index-list": _ctx.regionList[_ctx.tabName[_ctx.tabIndex]],
474
461
  onClickItem: _ctx.handleElevatorItem
475
462
  }, null, 8, ["height", "index-list", "onClickItem"])
476
- ])) : createCommentVNode("", true)
463
+ ])
477
464
  ])) : _ctx.privateType == "exist" ? (openBlock(), createElementBlock("view", _hoisted_14, [
478
465
  createElementVNode("div", _hoisted_15, [
479
466
  createElementVNode("ul", _hoisted_16, [
480
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.existAddress, (item, index) => {
467
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.existAddress, (item, index2) => {
481
468
  return openBlock(), createElementBlock("li", {
482
469
  class: normalizeClass(["exist-item", [item.selectedAddress ? "active" : ""]]),
483
- key: index,
470
+ key: index2,
484
471
  onClick: ($event) => _ctx.selectedExist(item)
485
472
  }, [
486
473
  createVNode(_component_nut_icon, {
@@ -514,7 +501,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
514
501
  ])
515
502
  ]),
516
503
  _: 1
517
- }, 8, ["onClose", "onClickOverlay", "visible", "class"]);
504
+ }, 8, ["onClose", "onClickOverlay", "visible"]);
518
505
  }
519
- _sfc_main.render = _sfc_render;
520
- export { _sfc_main as default };
506
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
507
+ export { index as default };
@@ -1,12 +1,13 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeStyle, normalizeClass, createVNode, renderSlot, createCommentVNode } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
8
9
  const { componentName, create } = createComponent("avatar");
9
- var _sfc_main = create({
10
+ const _sfc_main = create({
10
11
  props: {
11
12
  size: {
12
13
  type: String,
@@ -82,5 +83,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
82
83
  ])) : createCommentVNode("", true)
83
84
  ], 6);
84
85
  }
85
- _sfc_main.render = _sfc_render;
86
- export { _sfc_main as default };
86
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
87
+ export { index as default };
@@ -1,39 +1,14 @@
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
- var __require = typeof require !== "undefined" ? require : (x) => {
21
- throw new Error('Dynamic require of "' + x + '" is not supported');
22
- };
23
1
  /*!
24
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
25
3
  * (c) 2021 @jdf2e.
26
4
  * Released under the MIT License.
27
5
  */
28
- import { reactive, computed, toRefs, resolveComponent, openBlock, createElementBlock, createVNode, normalizeStyle, withCtx, renderSlot, createElementVNode, normalizeClass, withModifiers } from "vue";
6
+ import { reactive, computed, onMounted, onUnmounted, onActivated, onDeactivated, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, withModifiers, renderSlot, createVNode } from "vue";
29
7
  import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
30
9
  const { componentName, create } = createComponent("backtop");
31
- var _sfc_main = create({
10
+ const _sfc_main = create({
32
11
  props: {
33
- height: {
34
- type: String,
35
- default: "100vh"
36
- },
37
12
  bottom: {
38
13
  type: Number,
39
14
  default: 20
@@ -42,20 +17,35 @@ var _sfc_main = create({
42
17
  type: Number,
43
18
  default: 10
44
19
  },
20
+ elId: {
21
+ type: String,
22
+ default: ""
23
+ },
24
+ distance: {
25
+ type: Number,
26
+ default: 200
27
+ },
45
28
  zIndex: {
46
29
  type: Number,
47
30
  default: 10
48
31
  },
49
- distance: {
32
+ isAnimation: {
33
+ type: Boolean,
34
+ default: true
35
+ },
36
+ duration: {
50
37
  type: Number,
51
- default: 200
38
+ default: 1e3
52
39
  }
53
40
  },
54
41
  emits: ["click"],
55
42
  setup(props, { emit }) {
56
43
  const state = reactive({
57
44
  backTop: false,
58
- scrollTop: 1
45
+ scrollTop: 0,
46
+ scrollEl: window,
47
+ startTime: 0,
48
+ keepAlive: false
59
49
  });
60
50
  const classes = computed(() => {
61
51
  const prefixCls = componentName;
@@ -71,52 +61,99 @@ var _sfc_main = create({
71
61
  zIndex: props.zIndex
72
62
  };
73
63
  });
74
- const scroll = (e) => {
75
- state.scrollTop = 2;
76
- state.backTop = e.detail.scrollTop >= props.distance;
77
- };
78
- const click = (e) => {
79
- state.scrollTop = 1;
64
+ function scrollListener() {
65
+ if (state.scrollEl instanceof Window) {
66
+ state.scrollTop = state.scrollEl.pageYOffset;
67
+ } else {
68
+ state.scrollTop = state.scrollEl.scrollTop;
69
+ }
70
+ state.backTop = state.scrollTop >= props.distance;
71
+ }
72
+ function scroll(y = 0) {
73
+ if (state.scrollEl instanceof Window) {
74
+ window.scrollTo(0, y);
75
+ } else {
76
+ state.scrollEl.scrollTop = y;
77
+ }
78
+ }
79
+ function scrollAnimation() {
80
+ let cid = requestAniFrame()(function fn() {
81
+ var t = props.duration - Math.max(0, state.startTime - +new Date() + props.duration);
82
+ var y = t * -state.scrollTop / props.duration + state.scrollTop;
83
+ scroll(y);
84
+ cid = requestAniFrame()(fn);
85
+ if (t == props.duration || y == 0) {
86
+ window.cancelAnimationFrame(cid);
87
+ }
88
+ });
89
+ }
90
+ function addEventListener() {
91
+ state.scrollEl.addEventListener("scroll", scrollListener, false);
92
+ state.scrollEl.addEventListener("resize", scrollListener, false);
93
+ }
94
+ function removeEventListener() {
95
+ state.scrollEl.removeEventListener("scroll", scrollListener, false);
96
+ state.scrollEl.removeEventListener("resize", scrollListener, false);
97
+ }
98
+ function initCancelAniFrame() {
99
+ window.cancelAnimationFrame = window.webkitCancelAnimationFrame;
100
+ }
101
+ function requestAniFrame() {
102
+ return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
103
+ window.setTimeout(callback, 1e3 / 60);
104
+ };
105
+ }
106
+ function click(e) {
107
+ state.startTime = +new Date();
108
+ props.isAnimation && props.duration > 0 ? scrollAnimation() : scroll();
80
109
  emit("click", e);
81
- };
82
- return __spreadProps(__spreadValues({}, toRefs(state)), {
110
+ }
111
+ function init() {
112
+ if (props.elId && document.getElementById(props.elId)) {
113
+ state.scrollEl = document.getElementById(props.elId);
114
+ }
115
+ addEventListener();
116
+ initCancelAniFrame();
117
+ }
118
+ onMounted(() => {
119
+ init();
120
+ });
121
+ onUnmounted(() => {
122
+ removeEventListener();
123
+ });
124
+ onActivated(() => {
125
+ if (state.keepAlive) {
126
+ state.keepAlive = false;
127
+ init();
128
+ }
129
+ });
130
+ onDeactivated(() => {
131
+ state.keepAlive = true;
132
+ removeEventListener();
133
+ });
134
+ return {
135
+ state,
83
136
  classes,
84
137
  style,
85
- scroll,
86
138
  click
87
- });
139
+ };
88
140
  }
89
141
  });
90
142
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
91
- const _component_scroll_view = resolveComponent("scroll-view");
92
143
  const _component_nut_icon = resolveComponent("nut-icon");
93
- return openBlock(), createElementBlock("view", null, [
94
- createVNode(_component_scroll_view, {
95
- "scroll-y": true,
96
- style: normalizeStyle({ height: _ctx.height }),
97
- onScroll: _ctx.scroll,
98
- "scroll-top": _ctx.scrollTop,
99
- "scroll-with-animation": "true"
100
- }, {
101
- default: withCtx(() => [
102
- renderSlot(_ctx.$slots, "content")
103
- ]),
104
- _: 3
105
- }, 8, ["style", "onScroll", "scroll-top"]),
106
- createElementVNode("view", {
107
- class: normalizeClass(_ctx.classes),
108
- style: normalizeStyle(_ctx.style),
109
- onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.click && _ctx.click(...args), ["stop"]))
110
- }, [
111
- renderSlot(_ctx.$slots, "icon", {}, () => [
112
- createVNode(_component_nut_icon, {
113
- size: "19px",
114
- class: "nut-backtop-main",
115
- name: "top"
116
- })
117
- ])
118
- ], 6)
119
- ]);
144
+ return openBlock(), createElementBlock("div", {
145
+ class: normalizeClass(_ctx.classes),
146
+ style: normalizeStyle(_ctx.style),
147
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.click && _ctx.click(...args), ["stop"]))
148
+ }, [
149
+ renderSlot(_ctx.$slots, "default", {}, () => [
150
+ createVNode(_component_nut_icon, {
151
+ size: "19px",
152
+ class: "nut-backtop-main",
153
+ name: "top"
154
+ })
155
+ ])
156
+ ], 6);
120
157
  }
121
- _sfc_main.render = _sfc_render;
122
- export { _sfc_main as default };
158
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
159
+ export { index as default };
@@ -1,12 +1,13 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.11 Wed Nov 24 2021 14:54:38 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.14 Wed Dec 22 2021 20:49:10 GMT+0800 (中国标准时间)
3
3
  * (c) 2021 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { reactive, computed, openBlock, createElementBlock, createElementVNode, renderSlot, withDirectives, toDisplayString, normalizeClass, normalizeStyle, vShow } from "vue";
7
7
  import { c as createComponent } from "./component.js";
8
+ import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
8
9
  const { create } = createComponent("badge");
9
- var _sfc_main = create({
10
+ const _sfc_main = create({
10
11
  props: {
11
12
  value: {
12
13
  type: [String, Number]
@@ -85,5 +86,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
85
86
  ])
86
87
  ]);
87
88
  }
88
- _sfc_main.render = _sfc_render;
89
- export { _sfc_main as default };
89
+ var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
90
+ export { index as default };