@nutui/nutui 3.1.19-beta.0 → 3.1.19-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 (110) hide show
  1. package/dist/nutui.d.ts +38 -37
  2. package/dist/nutui.es.js +13439 -12616
  3. package/dist/nutui.umd.js +13431 -12695
  4. package/dist/packages/_es/ActionSheet.js +12 -18
  5. package/dist/packages/_es/Address.js +78 -69
  6. package/dist/packages/_es/Audio.js +12 -12
  7. package/dist/packages/_es/AudioOperate.js +1 -1
  8. package/dist/packages/_es/Avatar.js +3 -3
  9. package/dist/packages/_es/BackTop.js +68 -110
  10. package/dist/packages/_es/Badge.js +3 -3
  11. package/dist/packages/_es/Barrage.js +62 -55
  12. package/dist/packages/_es/Button.js +2 -2
  13. package/dist/packages/_es/Calendar.js +28 -23
  14. package/dist/packages/_es/CalendarItem.js +3 -3
  15. package/dist/packages/_es/Card.js +6 -5
  16. package/dist/packages/_es/Cascader.js +7 -7
  17. package/dist/packages/_es/Cell.js +4 -11
  18. package/dist/packages/_es/CellGroup.js +1 -1
  19. package/dist/packages/_es/Checkbox.js +1 -1
  20. package/dist/packages/_es/CheckboxGroup.js +1 -1
  21. package/dist/packages/_es/CircleProgress.js +149 -40
  22. package/dist/packages/_es/Col.js +1 -1
  23. package/dist/packages/_es/Collapse.js +34 -8
  24. package/dist/packages/_es/CollapseItem.js +90 -59
  25. package/dist/packages/_es/CountDown.js +5 -5
  26. package/dist/packages/_es/CountUp.js +43 -51
  27. package/dist/packages/_es/DatePicker.js +21 -20
  28. package/dist/packages/_es/Dialog.js +8 -86
  29. package/dist/packages/_es/Divider.js +4 -4
  30. package/dist/packages/_es/Drag.js +92 -54
  31. package/dist/packages/_es/Elevator.js +74 -49
  32. package/dist/packages/_es/Empty.js +3 -3
  33. package/dist/packages/_es/FixedNav.js +5 -5
  34. package/dist/packages/_es/Form.js +4 -4
  35. package/dist/packages/_es/FormItem.js +1 -1
  36. package/dist/packages/_es/Grid.js +1 -1
  37. package/dist/packages/_es/GridItem.js +8 -26
  38. package/dist/packages/_es/Icon.js +1 -1
  39. package/dist/packages/_es/ImagePreview.js +15 -84
  40. package/dist/packages/_es/Indicator.js +3 -3
  41. package/dist/packages/_es/InfiniteLoading.js +93 -107
  42. package/dist/packages/_es/Input.js +8 -8
  43. package/dist/packages/_es/InputNumber.js +23 -16
  44. package/dist/packages/_es/Layout.js +1 -1
  45. package/dist/packages/_es/List.js +41 -34
  46. package/dist/packages/_es/Menu.js +15 -12
  47. package/dist/packages/_es/MenuItem.js +9 -9
  48. package/dist/packages/_es/Navbar.js +3 -4
  49. package/dist/packages/_es/NoticeBar.js +47 -40
  50. package/dist/packages/_es/Notify.js +29 -168
  51. package/dist/packages/_es/NumberKeyboard.js +5 -10
  52. package/dist/packages/_es/OldPicker.js +122 -120
  53. package/dist/packages/_es/OverLay.js +5 -25
  54. package/dist/packages/_es/Pagination.js +7 -7
  55. package/dist/packages/_es/Picker.js +39 -16
  56. package/dist/packages/_es/Popover.js +155 -30
  57. package/dist/packages/_es/Popup.js +8 -71
  58. package/dist/packages/_es/Price.js +17 -5
  59. package/dist/packages/_es/Progress.js +18 -8
  60. package/dist/packages/_es/PullRefresh.js +1 -1
  61. package/dist/packages/_es/Radio.js +2 -2
  62. package/dist/packages/_es/RadioGroup.js +1 -1
  63. package/dist/packages/_es/Range.js +46 -33
  64. package/dist/packages/_es/Rate.js +16 -19
  65. package/dist/packages/_es/Row.js +1 -1
  66. package/dist/packages/_es/SearchBar.js +8 -6
  67. package/dist/packages/_es/ShortPassword.js +89 -67
  68. package/dist/packages/_es/SideNavBar.js +5 -16
  69. package/dist/packages/_es/SideNavBarItem.js +1 -1
  70. package/dist/packages/_es/Signature.js +69 -88
  71. package/dist/packages/_es/Skeleton.js +8 -11
  72. package/dist/packages/_es/Sku.js +47 -56
  73. package/dist/packages/_es/Step.js +1 -1
  74. package/dist/packages/_es/Steps.js +1 -1
  75. package/dist/packages/_es/Sticky.js +28 -23
  76. package/dist/packages/_es/SubSideNavBar.js +1 -1
  77. package/dist/packages/_es/Swipe.js +39 -26
  78. package/dist/packages/_es/Swiper.js +31 -13
  79. package/dist/packages/_es/SwiperItem.js +1 -1
  80. package/dist/packages/_es/Switch.js +3 -3
  81. package/dist/packages/_es/TabPane.js +1 -1
  82. package/dist/packages/_es/Tabbar.js +3 -3
  83. package/dist/packages/_es/TabbarItem.js +17 -23
  84. package/dist/packages/_es/Table.js +13 -13
  85. package/dist/packages/_es/Tabs.js +21 -20
  86. package/dist/packages/_es/Tag.js +4 -4
  87. package/dist/packages/_es/TextArea.js +44 -42
  88. package/dist/packages/_es/TimeDetail.js +4 -3
  89. package/dist/packages/_es/TimePannel.js +3 -3
  90. package/dist/packages/_es/TimeSelect.js +8 -7
  91. package/dist/packages/_es/Toast.js +41 -170
  92. package/dist/packages/_es/Uploader.js +109 -138
  93. package/dist/packages/_es/Video.js +3 -3
  94. package/dist/packages/_es/common.js +1 -1
  95. package/dist/packages/_es/component.js +1 -1
  96. package/dist/packages/_es/index.js +44 -6
  97. package/dist/packages/_es/{index5.js → index.taro.js} +127 -95
  98. package/dist/packages/_es/index2.js +1 -1
  99. package/dist/packages/_es/index3.js +56 -28
  100. package/dist/packages/_es/index4.js +413 -56
  101. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  102. package/dist/packages/_es/pxCheck.js +1 -1
  103. package/dist/packages/_es/use-lock-scroll.js +23 -0
  104. package/dist/packages/_es/util.js +1 -1
  105. package/dist/packages/uploader/index.scss +2 -2
  106. package/dist/style.css +1 -1
  107. package/dist/styles/themes/default.scss +61 -61
  108. package/dist/styles/themes/jdt.scss +61 -61
  109. package/package.json +1 -1
  110. package/dist/packages/_es/raf.js +0 -19
@@ -15,11 +15,11 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  /*!
18
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
18
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
19
19
  * (c) 2022 @jdf2e.
20
20
  * Released under the MIT License.
21
21
  */
22
- import { computed, watch, onDeactivated, onBeforeUnmount, onMounted, onActivated, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, withModifiers, normalizeStyle, renderSlot, vShow } from "vue";
22
+ import { computed, openBlock, createBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, renderSlot, vShow } from "vue";
23
23
  import { c as createComponent } from "./component.js";
24
24
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
25
25
  const { componentName, create } = createComponent("overlay");
@@ -63,38 +63,19 @@ const _sfc_main = create({
63
63
  [props.overlayClass]: true
64
64
  };
65
65
  });
66
- watch(() => props.visible, (value) => {
67
- value ? lock() : unlock();
68
- });
69
- const lock = () => {
70
- if (props.lockScroll && props.visible) {
71
- document.body.classList.add("nut-overflow-hidden");
72
- }
73
- };
74
- const unlock = () => {
75
- document.body.classList.remove("nut-overflow-hidden");
76
- };
77
- onDeactivated(unlock);
78
- onBeforeUnmount(unlock);
79
- onMounted(lock);
80
- onActivated(lock);
81
66
  const style = computed(() => {
82
67
  return __spreadValues({
83
68
  animationDuration: `${props.duration}s`,
84
69
  zIndex: props.zIndex
85
70
  }, props.overlayStyle);
86
71
  });
87
- const touchmove = (e) => {
88
- if (props.lockScroll)
89
- e.preventDefault();
90
- };
91
72
  const onClick = (e) => {
92
73
  emit("click", e);
93
74
  if (props.closeOnClickOverlay) {
94
75
  emit("update:visible", false);
95
76
  }
96
77
  };
97
- return { classes, style, touchmove, onClick };
78
+ return { classes, style, onClick };
98
79
  }
99
80
  });
100
81
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -102,12 +83,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
102
83
  default: withCtx(() => [
103
84
  withDirectives(createElementVNode("view", {
104
85
  class: normalizeClass(_ctx.classes),
105
- onTouchmove: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.touchmove && _ctx.touchmove(...args), ["stop"])),
106
- onClick: _cache[1] || (_cache[1] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
86
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
107
87
  style: normalizeStyle(_ctx.style)
108
88
  }, [
109
89
  renderSlot(_ctx.$slots, "default")
110
- ], 38), [
90
+ ], 6), [
111
91
  [vShow, _ctx.visible]
112
92
  ])
113
93
  ]),
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -67,13 +67,13 @@ const _sfc_main = create({
67
67
  return { number, text, active };
68
68
  };
69
69
  const pages = computed(() => {
70
- if (mode.value == "simple")
71
- return;
72
70
  let items = [];
73
71
  const pageCount = countRef.value;
74
72
  const pageSize = showPageSize.value;
75
73
  let startPage = 1;
76
74
  let endPage = pageCount;
75
+ if (mode.value == "simple")
76
+ return;
77
77
  const partialShow = pageCount > pageSize;
78
78
  if (partialShow) {
79
79
  startPage = Math.max(modelValue.value - Math.floor(pageSize / 2), 1);
@@ -134,9 +134,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
134
134
  ])
135
135
  ], 2),
136
136
  _ctx.mode == "multi" ? (openBlock(), createElementBlock("view", _hoisted_2, [
137
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item, index2) => {
137
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.pages, (item, index) => {
138
138
  return openBlock(), createElementBlock("view", {
139
- key: index2 + "pagination",
139
+ key: index + "pagination",
140
140
  class: normalizeClass(["nut-pagination-item", item.active ? "active" : ""]),
141
141
  onClick: ($event) => _ctx.select(item.number, true)
142
142
  }, [
@@ -159,5 +159,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
159
159
  ], 2)
160
160
  ]);
161
161
  }
162
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
163
- export { index as default };
162
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
163
+ export { index_taro as default };
@@ -18,14 +18,17 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
25
  import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx } from "vue";
26
26
  import { c as createComponent } from "./component.js";
27
- import popup, { popupProps } from "./Popup.js";
27
+ import { popupProps } from "./Popup.js";
28
+ import { u as useTaroRect } from "./index.js";
29
+ import Taro from "@tarojs/taro";
28
30
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
31
+ import "./use-lock-scroll.js";
29
32
  import "./OverLay.js";
30
33
  import "./Icon.js";
31
34
  import "./pxCheck.js";
@@ -50,6 +53,7 @@ const _sfc_main$1 = create$1({
50
53
  emits: ["click", "change"],
51
54
  setup(props, { emit }) {
52
55
  const wrapper = ref();
56
+ const itemref = ref();
53
57
  const state = reactive({
54
58
  touchParams: {
55
59
  startY: 0,
@@ -68,7 +72,7 @@ const _sfc_main$1 = create$1({
68
72
  });
69
73
  const roller = ref(null);
70
74
  const list = ref(null);
71
- const listItem = ref(null);
75
+ const listitem = ref(null);
72
76
  const touchDeg = ref(0);
73
77
  const touchTime = ref(0);
74
78
  const touchTranslateY = ref(0);
@@ -173,33 +177,53 @@ const _sfc_main$1 = create$1({
173
177
  type && setChooseValue();
174
178
  setMove(-move);
175
179
  };
180
+ const getReference = async () => {
181
+ const refe = await useTaroRect(list, Taro);
182
+ state.lineSpacing = refe.height / props.column.length;
183
+ modifyStatus(true);
184
+ };
176
185
  watch(() => props.column, (val) => {
177
186
  state.transformY = 0;
178
187
  modifyStatus(false);
179
188
  }, {
180
189
  deep: true
181
190
  });
191
+ watch(() => props.itemShow, (val) => {
192
+ if (val) {
193
+ setTimeout(() => {
194
+ getReference();
195
+ }, 200);
196
+ }
197
+ }, {
198
+ deep: true
199
+ });
182
200
  onMounted(() => {
183
- modifyStatus(true);
201
+ setTimeout(() => {
202
+ getReference();
203
+ }, 200);
184
204
  });
205
+ const refRandomId = Math.random().toString(36).slice(-8);
185
206
  return __spreadProps(__spreadValues(__spreadValues({}, toRefs(state)), toRefs(props)), {
186
207
  wrapper,
208
+ itemref,
187
209
  setRollerStyle,
188
210
  isHidden,
189
211
  roller,
190
212
  list,
191
- listItem,
213
+ listitem,
192
214
  onTouchStart,
193
215
  onTouchMove,
194
216
  onTouchEnd,
195
217
  touchRollerStyle,
196
218
  touchListStyle,
197
- setMove
219
+ setMove,
220
+ refRandomId
198
221
  });
199
222
  }
200
223
  });
201
224
  const _hoisted_1$1 = { class: "nut-picker-content" };
202
- const _hoisted_2$1 = {
225
+ const _hoisted_2$1 = ["id"];
226
+ const _hoisted_3$1 = {
203
227
  key: 0,
204
228
  class: "nut-picker-placeholder"
205
229
  };
@@ -227,6 +251,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
227
251
  createElementVNode("view", {
228
252
  class: "nut-picker-list-panel",
229
253
  ref: "list",
254
+ id: "list" + _ctx.refRandomId,
230
255
  style: normalizeStyle(_ctx.touchListStyle)
231
256
  }, [
232
257
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.column, (item, index) => {
@@ -235,8 +260,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
235
260
  key: item.value ? item.value : index
236
261
  }, toDisplayString(item.text), 3);
237
262
  }), 128)),
238
- _ctx.column && _ctx.column.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_2$1)) : createCommentVNode("", true)
239
- ], 4)
263
+ _ctx.column && _ctx.column.length === 1 ? (openBlock(), createElementBlock("view", _hoisted_3$1)) : createCommentVNode("", true)
264
+ ], 12, _hoisted_2$1)
240
265
  ])
241
266
  ], 32);
242
267
  }
@@ -244,8 +269,7 @@ var column = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]
244
269
  const { componentName, create } = createComponent("picker");
245
270
  const _sfc_main = create({
246
271
  components: {
247
- [column.name]: column,
248
- [popup.name]: popup
272
+ [column.name]: column
249
273
  },
250
274
  props: __spreadProps(__spreadValues({}, popupProps), {
251
275
  modelValue: {
@@ -429,8 +453,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
429
453
  "lock-scroll": _ctx.lockScroll,
430
454
  "close-on-click-overlay": _ctx.closeOnClickOverlay,
431
455
  onClose: _ctx.close,
432
- round: true,
433
- isWrapTeleport: _ctx.isWrapTeleport
456
+ round: true
434
457
  }, {
435
458
  default: withCtx(() => [
436
459
  createElementVNode("view", _hoisted_1, [
@@ -466,8 +489,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
466
489
  ])
467
490
  ]),
468
491
  _: 1
469
- }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose", "isWrapTeleport"])
492
+ }, 8, ["visible", "teleport", "lock-scroll", "close-on-click-overlay", "onClose"])
470
493
  ], 2);
471
494
  }
472
- var picker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
473
- export { picker as default };
495
+ var nutPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
496
+ export { nutPicker as default };
@@ -18,23 +18,145 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { ref, reactive, toRefs, computed, onMounted, watch, resolveComponent, openBlock, createElementBlock, withModifiers, normalizeClass, createElementVNode, renderSlot, Fragment, normalizeStyle, renderList, createVNode, createCommentVNode, toDisplayString } from "vue";
25
+ import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, createBlock, createCommentVNode, renderSlot, ref, reactive, onMounted, watch, withModifiers, Fragment, renderList, createVNode, toDisplayString } from "vue";
26
26
  import { c as createComponent } from "./component.js";
27
- import popup, { popupProps } from "./Popup.js";
28
- import Button from "./Button.js";
27
+ import { _ as _sfc_main$2, P as Popup, p as popupProps } from "./index4.js";
29
28
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
30
- import "./OverLay.js";
31
- import "./Icon.js";
29
+ import { u as useTaroRect } from "./index.js";
30
+ import Taro from "@tarojs/taro";
31
+ import "./use-lock-scroll.js";
32
32
  import "./pxCheck.js";
33
+ const { componentName: componentName$1, create: create$1 } = createComponent("button");
34
+ const _sfc_main$1 = create$1({
35
+ components: {
36
+ [_sfc_main$2.name]: _sfc_main$2
37
+ },
38
+ props: {
39
+ color: String,
40
+ shape: {
41
+ type: String,
42
+ default: "round"
43
+ },
44
+ plain: {
45
+ type: Boolean,
46
+ default: false
47
+ },
48
+ loading: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ disabled: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ type: {
57
+ type: String,
58
+ default: "default"
59
+ },
60
+ size: {
61
+ type: String,
62
+ default: "normal"
63
+ },
64
+ block: {
65
+ type: Boolean,
66
+ default: false
67
+ },
68
+ icon: {
69
+ type: String,
70
+ default: ""
71
+ },
72
+ iconClassPrefix: {
73
+ type: String,
74
+ default: "nut-icon"
75
+ },
76
+ iconFontClassName: {
77
+ type: String,
78
+ default: "nutui-iconfont"
79
+ }
80
+ },
81
+ emits: ["click"],
82
+ setup(props, { emit, slots }) {
83
+ const { type, size, shape, disabled, loading, color, plain, block } = toRefs(props);
84
+ const handleClick = (event) => {
85
+ if (!loading.value && !disabled.value) {
86
+ emit("click", event);
87
+ }
88
+ };
89
+ const classes = computed(() => {
90
+ const prefixCls = componentName$1;
91
+ return {
92
+ [prefixCls]: true,
93
+ [`${prefixCls}--${type.value}`]: type.value,
94
+ [`${prefixCls}--${size.value}`]: size.value,
95
+ [`${prefixCls}--${shape.value}`]: shape.value,
96
+ [`${prefixCls}--plain`]: plain.value,
97
+ [`${prefixCls}--block`]: block.value,
98
+ [`${prefixCls}--disabled`]: disabled.value,
99
+ [`${prefixCls}--loading`]: loading.value
100
+ };
101
+ });
102
+ const getStyle = computed(() => {
103
+ var _a;
104
+ const style = {};
105
+ if (color == null ? void 0 : color.value) {
106
+ if (plain.value) {
107
+ style.color = color.value;
108
+ style.background = "#fff";
109
+ if (!((_a = color.value) == null ? void 0 : _a.includes("gradient"))) {
110
+ style.borderColor = color.value;
111
+ }
112
+ } else {
113
+ style.color = "#fff";
114
+ style.background = color.value;
115
+ }
116
+ }
117
+ return style;
118
+ });
119
+ return {
120
+ handleClick,
121
+ classes,
122
+ getStyle
123
+ };
124
+ }
125
+ });
126
+ const _hoisted_1$1 = { class: "nut-button__warp" };
127
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
128
+ const _component_nut_icon = resolveComponent("nut-icon");
129
+ return openBlock(), createElementBlock("view", {
130
+ class: normalizeClass(_ctx.classes),
131
+ style: normalizeStyle(_ctx.getStyle),
132
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
133
+ }, [
134
+ createElementVNode("view", _hoisted_1$1, [
135
+ _ctx.loading ? (openBlock(), createBlock(_component_nut_icon, {
136
+ key: 0,
137
+ class: "nut-icon-loading"
138
+ })) : createCommentVNode("", true),
139
+ _ctx.icon && !_ctx.loading ? (openBlock(), createBlock(_component_nut_icon, {
140
+ key: 1,
141
+ name: _ctx.icon,
142
+ "class-prefix": _ctx.iconClassPrefix,
143
+ "font-class-name": _ctx.iconFontClassName
144
+ }, null, 8, ["name", "class-prefix", "font-class-name"])) : createCommentVNode("", true),
145
+ _ctx.$slots.default ? (openBlock(), createElementBlock("view", {
146
+ key: 2,
147
+ class: normalizeClass({ text: _ctx.icon || _ctx.loading })
148
+ }, [
149
+ renderSlot(_ctx.$slots, "default")
150
+ ], 2)) : createCommentVNode("", true)
151
+ ])
152
+ ], 6);
153
+ }
154
+ var Button = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
33
155
  const { componentName, create } = createComponent("popover");
34
156
  const _sfc_main = create({
35
157
  inheritAttrs: false,
36
158
  components: {
37
- [popup.name]: popup,
159
+ [Popup.name]: Popup,
38
160
  [Button.name]: Button
39
161
  },
40
162
  props: __spreadProps(__spreadValues({}, popupProps), {
@@ -81,15 +203,15 @@ const _sfc_main = create({
81
203
  [`${prefixCls}--${location.value}`]: location.value
82
204
  };
83
205
  });
84
- function getReference() {
85
- state.elWidth = reference.value.offsetWidth;
86
- state.elHeight = reference.value.offsetHeight;
87
- }
206
+ const getReference = async () => {
207
+ const refe = await useTaroRect(reference, Taro);
208
+ state.elWidth = refe.width;
209
+ state.elHeight = refe.height;
210
+ };
88
211
  const getStyle = computed(() => {
89
212
  const style = {};
90
213
  if (location.value == "top") {
91
- style.bottom = state.elHeight + 20 + "px";
92
- style.left = 0 + "px";
214
+ style.bottom = state.elHeight + 10 + "px";
93
215
  } else if (location.value == "right") {
94
216
  style.top = 0 + "px";
95
217
  style.right = -state.elWidth + "px";
@@ -97,8 +219,7 @@ const _sfc_main = create({
97
219
  style.top = 0 + "px";
98
220
  style.left = -state.elWidth + "px";
99
221
  } else {
100
- style.top = state.elHeight + 20 + "px";
101
- style.left = 0 + "px";
222
+ style.top = state.elHeight + 10 + "px";
102
223
  }
103
224
  return style;
104
225
  });
@@ -120,7 +241,9 @@ const _sfc_main = create({
120
241
  return style;
121
242
  });
122
243
  onMounted(() => {
123
- getReference();
244
+ setTimeout(() => {
245
+ getReference();
246
+ }, 200);
124
247
  });
125
248
  watch(() => props.visible, (value) => {
126
249
  showPopup.value = value;
@@ -137,12 +260,10 @@ const _sfc_main = create({
137
260
  emit("close");
138
261
  emit("update:visible", false);
139
262
  };
140
- const chooseItem = (item, index2) => {
141
- if (item.disabled) {
142
- return;
143
- }
144
- emit("choose", item, index2);
263
+ const chooseItem = (item, index) => {
264
+ emit("choose", item, index);
145
265
  };
266
+ const refRandomId = Math.random().toString(36).slice(-8);
146
267
  return {
147
268
  classes,
148
269
  showPopup,
@@ -154,11 +275,12 @@ const _sfc_main = create({
154
275
  getReference,
155
276
  reference,
156
277
  getStyle,
157
- getArrowStyle
278
+ getArrowStyle,
279
+ refRandomId
158
280
  };
159
281
  }
160
282
  });
161
- const _hoisted_1 = { ref: "reference" };
283
+ const _hoisted_1 = ["id"];
162
284
  const _hoisted_2 = ["onClick"];
163
285
  const _hoisted_3 = { class: "title-name" };
164
286
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
@@ -167,9 +289,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
167
289
  onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.openPopover && _ctx.openPopover(...args), ["stop"])),
168
290
  class: normalizeClass(_ctx.classes)
169
291
  }, [
170
- createElementVNode("div", _hoisted_1, [
292
+ createElementVNode("div", {
293
+ ref: "reference",
294
+ id: "reference-" + _ctx.refRandomId
295
+ }, [
171
296
  renderSlot(_ctx.$slots, "reference")
172
- ], 512),
297
+ ], 8, _hoisted_1),
173
298
  _ctx.showPopup ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
174
299
  createElementVNode("view", {
175
300
  class: "more-background",
@@ -184,11 +309,11 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
184
309
  style: normalizeStyle(_ctx.getArrowStyle)
185
310
  }, null, 6),
186
311
  renderSlot(_ctx.$slots, "content"),
187
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index2) => {
312
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index) => {
188
313
  return openBlock(), createElementBlock("view", {
189
- key: index2,
314
+ key: index,
190
315
  class: normalizeClass({ "title-item": true, disabled: item.disabled }),
191
- onClick: withModifiers(($event) => _ctx.chooseItem(item, index2), ["stop"])
316
+ onClick: withModifiers(($event) => _ctx.chooseItem(item, index), ["stop"])
192
317
  }, [
193
318
  item.icon ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
194
319
  createVNode(_component_nut_icon, {
@@ -203,5 +328,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
203
328
  ], 64)) : createCommentVNode("", true)
204
329
  ], 2);
205
330
  }
206
- var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
207
- export { index as default };
331
+ var index_taro = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
332
+ export { index_taro as default };
@@ -18,33 +18,17 @@ var __spreadValues = (a, b) => {
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
  /*!
21
- * @nutui/nutui v3.1.19-beta.0 Mon Mar 28 2022 17:50:21 GMT+0800 (中国标准时间)
21
+ * @nutui/nutui v3.1.19-beta.1 Sat Apr 02 2022 16:26:37 GMT+0800 (中国标准时间)
22
22
  * (c) 2022 @jdf2e.
23
23
  * Released under the MIT License.
24
24
  */
25
- import { reactive, computed, onMounted, onBeforeUnmount, onBeforeMount, onActivated, onDeactivated, watch, toRefs, resolveComponent, openBlock, createBlock, Teleport, normalizeClass, normalizeStyle, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, renderSlot, createElementBlock, vShow } from "vue";
25
+ import { reactive, computed, onMounted, onBeforeUnmount, onBeforeMount, onActivated, onDeactivated, watch, toRefs, resolveComponent, openBlock, createElementBlock, createBlock, normalizeClass, normalizeStyle, createCommentVNode, createVNode, Transition, withCtx, withDirectives, createElementVNode, renderSlot, vShow } from "vue";
26
+ import { u as useLockScroll } from "./use-lock-scroll.js";
26
27
  import overlay, { overlayProps } from "./OverLay.js";
27
28
  import _sfc_main$1 from "./Icon.js";
28
29
  import { c as createComponent } from "./component.js";
29
30
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
30
31
  import "./pxCheck.js";
31
- let count = 0;
32
- const CLSNAME = "nut-overflow-hidden";
33
- const useLockScroll = (isLock) => {
34
- const lock = () => {
35
- if (isLock()) {
36
- !count && document.body.classList.add(CLSNAME);
37
- count++;
38
- }
39
- };
40
- const unlock = () => {
41
- if (isLock() && count) {
42
- count--;
43
- !count && document.body.classList.remove(CLSNAME);
44
- }
45
- };
46
- return [lock, unlock];
47
- };
48
32
  const { componentName, create } = createComponent("popup");
49
33
  let _zIndex = 2e3;
50
34
  const popupProps = __spreadProps(__spreadValues({}, overlayProps), {
@@ -87,13 +71,10 @@ const popupProps = __spreadProps(__spreadValues({}, overlayProps), {
87
71
  round: {
88
72
  type: Boolean,
89
73
  default: false
90
- },
91
- isWrapTeleport: {
92
- type: Boolean,
93
- default: true
94
74
  }
95
75
  });
96
76
  const _sfc_main = create({
77
+ children: [overlay],
97
78
  components: {
98
79
  [overlay.name]: overlay,
99
80
  [_sfc_main$1.name]: _sfc_main$1
@@ -218,14 +199,10 @@ const _sfc_main = create({
218
199
  });
219
200
  }
220
201
  });
221
- const _hoisted_1 = { key: 1 };
222
202
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
223
203
  const _component_nut_overlay = resolveComponent("nut-overlay");
224
204
  const _component_nut_icon = resolveComponent("nut-icon");
225
- return _ctx.isWrapTeleport ? (openBlock(), createBlock(Teleport, {
226
- key: 0,
227
- to: _ctx.teleport
228
- }, [
205
+ return openBlock(), createElementBlock("view", null, [
229
206
  _ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
230
207
  key: 0,
231
208
  visible: _ctx.visible,
@@ -265,47 +242,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
265
242
  ]),
266
243
  _: 3
267
244
  }, 8, ["name", "onAfterEnter", "onAfterLeave"])
268
- ], 8, ["to"])) : (openBlock(), createElementBlock("view", _hoisted_1, [
269
- _ctx.overlay ? (openBlock(), createBlock(_component_nut_overlay, {
270
- key: 0,
271
- visible: _ctx.visible,
272
- "close-on-click-overlay": _ctx.closeOnClickOverlay,
273
- class: normalizeClass(_ctx.overlayClass),
274
- style: normalizeStyle(_ctx.overlayStyle),
275
- "z-index": _ctx.zIndex,
276
- "lock-scroll": _ctx.lockScroll,
277
- duration: _ctx.duration,
278
- onClick: _ctx.onClickOverlay
279
- }, null, 8, ["visible", "close-on-click-overlay", "class", "style", "z-index", "lock-scroll", "duration", "onClick"])) : createCommentVNode("", true),
280
- createVNode(Transition, {
281
- name: _ctx.transitionName,
282
- onAfterEnter: _ctx.onOpened,
283
- onAfterLeave: _ctx.onClosed
284
- }, {
285
- default: withCtx(() => [
286
- withDirectives(createElementVNode("view", {
287
- class: normalizeClass(_ctx.classes),
288
- style: normalizeStyle(_ctx.popStyle),
289
- onClick: _cache[3] || (_cache[3] = (...args) => _ctx.onClick && _ctx.onClick(...args))
290
- }, [
291
- _ctx.showSlot ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true),
292
- _ctx.closed ? (openBlock(), createElementBlock("view", {
293
- key: 1,
294
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.onClickCloseIcon && _ctx.onClickCloseIcon(...args)),
295
- class: normalizeClass(["nutui-popup__close-icon", "nutui-popup__close-icon--" + _ctx.closeIconPosition])
296
- }, [
297
- createVNode(_component_nut_icon, {
298
- name: _ctx.closeIcon,
299
- size: "12px"
300
- }, null, 8, ["name"])
301
- ], 2)) : createCommentVNode("", true)
302
- ], 6), [
303
- [vShow, _ctx.visible]
304
- ])
305
- ]),
306
- _: 3
307
- }, 8, ["name", "onAfterEnter", "onAfterLeave"])
308
- ]));
245
+ ]);
309
246
  }
310
- var popup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
311
- export { popup as default, popupProps };
247
+ var Popup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
248
+ export { Popup as default, popupProps };