@nutui/nutui 3.3.0 → 3.3.1-beta.0

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 (177) hide show
  1. package/dist/nutui.es.js +324 -295
  2. package/dist/nutui.umd.js +320 -291
  3. package/dist/packages/_es/ActionSheet.js +1 -1
  4. package/dist/packages/_es/Address.js +1 -1
  5. package/dist/packages/_es/AddressList.js +2 -2
  6. package/dist/packages/_es/Animate.js +1 -1
  7. package/dist/packages/_es/Audio.js +1 -1
  8. package/dist/packages/_es/AudioOperate.js +1 -1
  9. package/dist/packages/_es/Avatar.js +1 -1
  10. package/dist/packages/_es/AvatarGroup.js +1 -1
  11. package/dist/packages/_es/BackTop.js +1 -1
  12. package/dist/packages/_es/Badge.js +1 -1
  13. package/dist/packages/_es/Barrage.js +1 -1
  14. package/dist/packages/_es/Button.js +1 -1
  15. package/dist/packages/_es/Calendar.js +1 -1
  16. package/dist/packages/_es/CalendarItem.js +1 -1
  17. package/dist/packages/_es/Card.js +1 -1
  18. package/dist/packages/_es/Cascader.js +1 -1
  19. package/dist/packages/_es/Category.js +1 -1
  20. package/dist/packages/_es/CategoryPane.js +1 -1
  21. package/dist/packages/_es/Cell.js +1 -1
  22. package/dist/packages/_es/CellGroup.js +1 -1
  23. package/dist/packages/_es/Checkbox.js +1 -1
  24. package/dist/packages/_es/CheckboxGroup.js +1 -1
  25. package/dist/packages/_es/CircleProgress.js +2 -2
  26. package/dist/packages/_es/Col.js +1 -1
  27. package/dist/packages/_es/Collapse.js +1 -1
  28. package/dist/packages/_es/CollapseItem.js +1 -1
  29. package/dist/packages/_es/Comment.js +1 -1
  30. package/dist/packages/_es/ConfigProvider.js +1 -1
  31. package/dist/packages/_es/CountDown.js +1 -1
  32. package/dist/packages/_es/CountUp.js +1 -1
  33. package/dist/packages/_es/DatePicker.js +1 -1
  34. package/dist/packages/_es/Dialog.js +1 -1
  35. package/dist/packages/_es/Divider.js +1 -1
  36. package/dist/packages/_es/Drag.js +1 -1
  37. package/dist/packages/_es/Ecard.js +1 -1
  38. package/dist/packages/_es/Elevator.js +1 -1
  39. package/dist/packages/_es/Ellipsis.js +1 -1
  40. package/dist/packages/_es/Empty.js +1 -1
  41. package/dist/packages/_es/FixedNav.js +1 -1
  42. package/dist/packages/_es/Form.js +2 -2
  43. package/dist/packages/_es/FormItem.js +1 -1
  44. package/dist/packages/_es/Grid.js +1 -1
  45. package/dist/packages/_es/GridItem.js +1 -1
  46. package/dist/packages/_es/Icon.js +1 -1
  47. package/dist/packages/_es/Image.js +1 -1
  48. package/dist/packages/_es/ImagePreview.js +3 -3
  49. package/dist/packages/_es/Indicator.js +1 -1
  50. package/dist/packages/_es/InfiniteLoading.js +18 -26
  51. package/dist/packages/_es/Input.js +1 -1
  52. package/dist/packages/_es/InputNumber.js +1 -1
  53. package/dist/packages/_es/Invoice.js +1 -1
  54. package/dist/packages/_es/Layout.js +1 -1
  55. package/dist/packages/_es/List.js +1 -1
  56. package/dist/packages/_es/Menu.js +1 -1
  57. package/dist/packages/_es/MenuItem.js +1 -1
  58. package/dist/packages/_es/Navbar.js +1 -1
  59. package/dist/packages/_es/NoticeBar.js +1 -1
  60. package/dist/packages/_es/Notify.js +1 -1
  61. package/dist/packages/_es/NumberKeyboard.js +1 -1
  62. package/dist/packages/_es/OverLay.js +1 -1
  63. package/dist/packages/_es/Pagination.js +1 -1
  64. package/dist/packages/_es/Picker.js +17 -7
  65. package/dist/packages/_es/Popover.js +171 -81
  66. package/dist/packages/_es/Popup.js +1 -1
  67. package/dist/packages/_es/Price.js +7 -2
  68. package/dist/packages/_es/Progress.js +1 -1
  69. package/dist/packages/_es/Radio.js +1 -1
  70. package/dist/packages/_es/RadioGroup.js +1 -1
  71. package/dist/packages/_es/Range.js +1 -1
  72. package/dist/packages/_es/Rate.js +1 -1
  73. package/dist/packages/_es/Row.js +1 -1
  74. package/dist/packages/_es/SearchBar.js +1 -1
  75. package/dist/packages/_es/ShortPassword.js +1 -1
  76. package/dist/packages/_es/SideNavBar.js +1 -1
  77. package/dist/packages/_es/SideNavBarItem.js +1 -1
  78. package/dist/packages/_es/Signature.js +1 -1
  79. package/dist/packages/_es/Skeleton.js +1 -1
  80. package/dist/packages/_es/Sku.js +1 -1
  81. package/dist/packages/_es/Step.js +1 -1
  82. package/dist/packages/_es/Steps.js +1 -1
  83. package/dist/packages/_es/Sticky.js +1 -1
  84. package/dist/packages/_es/SubSideNavBar.js +1 -1
  85. package/dist/packages/_es/Swipe.js +1 -1
  86. package/dist/packages/_es/Swiper.js +57 -115
  87. package/dist/packages/_es/SwiperItem.js +1 -1
  88. package/dist/packages/_es/Switch.js +1 -1
  89. package/dist/packages/_es/TabPane.js +1 -1
  90. package/dist/packages/_es/Tabbar.js +4 -8
  91. package/dist/packages/_es/TabbarItem.js +12 -13
  92. package/dist/packages/_es/Table.js +1 -1
  93. package/dist/packages/_es/Tabs.js +6 -9
  94. package/dist/packages/_es/Tag.js +1 -1
  95. package/dist/packages/_es/TextArea.js +1 -1
  96. package/dist/packages/_es/TimeDetail.js +1 -1
  97. package/dist/packages/_es/TimePannel.js +1 -1
  98. package/dist/packages/_es/TimeSelect.js +1 -1
  99. package/dist/packages/_es/Toast.js +1 -1
  100. package/dist/packages/_es/TrendArrow.js +1 -1
  101. package/dist/packages/_es/Uploader.js +1 -1
  102. package/dist/packages/_es/Video.js +1 -1
  103. package/dist/packages/_es/WaterMark.js +1 -1
  104. package/dist/packages/_es/common.js +1 -1
  105. package/dist/packages/_es/component.js +6 -2
  106. package/dist/packages/_es/index.js +1 -1
  107. package/dist/packages/_es/index2.js +1 -1
  108. package/dist/packages/_es/index3.js +1 -1
  109. package/dist/packages/_es/index4.js +1 -1
  110. package/dist/packages/_es/index5.js +1 -1
  111. package/dist/packages/_es/interceptor.js +2 -2
  112. package/dist/packages/_es/mountComponent.js +2 -2
  113. package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
  114. package/dist/packages/_es/props.js +1 -1
  115. package/dist/packages/_es/pxCheck.js +1 -1
  116. package/dist/packages/_es/raf.js +1 -1
  117. package/dist/packages/infiniteloading/index.scss +2 -0
  118. package/dist/packages/locale/lang/baseLang.js +1 -1
  119. package/dist/packages/locale/lang/en-US.js +1 -1
  120. package/dist/packages/locale/lang/id-ID.js +1 -1
  121. package/dist/packages/locale/lang/index.js +1 -1
  122. package/dist/packages/locale/lang/zh-CN.js +1 -1
  123. package/dist/packages/locale/lang/zh-TW.js +1 -1
  124. package/dist/packages/picker/index.scss +10 -4
  125. package/dist/packages/popover/index.scss +10 -38
  126. package/dist/packages/price/index.scss +5 -0
  127. package/dist/smartips/attributes.json +36 -8
  128. package/dist/smartips/tags.json +13 -6
  129. package/dist/smartips/web-types.json +72 -9
  130. package/dist/style.css +1 -1
  131. package/dist/styles/themes/default.scss +55 -55
  132. package/dist/styles/themes/jdb.scss +55 -55
  133. package/dist/styles/themes/jddkh.scss +55 -55
  134. package/dist/styles/themes/jdt.scss +55 -55
  135. package/dist/types/__VUE/actionsheet/index.vue.d.ts +1 -1
  136. package/dist/types/__VUE/address/index.vue.d.ts +2 -2
  137. package/dist/types/__VUE/audio/index.vue.d.ts +4 -4
  138. package/dist/types/__VUE/avatar/index.vue.d.ts +2 -2
  139. package/dist/types/__VUE/avatargroup/index.vue.d.ts +1 -1
  140. package/dist/types/__VUE/backtop/index.vue.d.ts +1 -1
  141. package/dist/types/__VUE/badge/index.vue.d.ts +1 -1
  142. package/dist/types/__VUE/button/index.vue.d.ts +1 -1
  143. package/dist/types/__VUE/calendaritem/index.vue.d.ts +4 -4
  144. package/dist/types/__VUE/cell/index.vue.d.ts +5 -5
  145. package/dist/types/__VUE/collapseitem/index.vue.d.ts +1 -1
  146. package/dist/types/__VUE/countup/index.vue.d.ts +2 -2
  147. package/dist/types/__VUE/datepicker/index.vue.d.ts +1 -1
  148. package/dist/types/__VUE/dialog/index.vue.d.ts +1 -1
  149. package/dist/types/__VUE/fixednav/index.vue.d.ts +1 -1
  150. package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
  151. package/dist/types/__VUE/image/index.vue.d.ts +1 -1
  152. package/dist/types/__VUE/imagepreview/index.vue.d.ts +2 -2
  153. package/dist/types/__VUE/infiniteloading/index.vue.d.ts +1 -1
  154. package/dist/types/__VUE/input/index.vue.d.ts +2 -2
  155. package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
  156. package/dist/types/__VUE/noticebar/index.vue.d.ts +4 -4
  157. package/dist/types/__VUE/picker/Column.vue.d.ts +4 -4
  158. package/dist/types/__VUE/picker/index.vue.d.ts +23 -5
  159. package/dist/types/__VUE/popover/index.vue.d.ts +33 -4
  160. package/dist/types/__VUE/popover/type.d.ts +7 -0
  161. package/dist/types/__VUE/price/index.vue.d.ts +9 -0
  162. package/dist/types/__VUE/range/index.vue.d.ts +7 -7
  163. package/dist/types/__VUE/rate/index.vue.d.ts +1 -1
  164. package/dist/types/__VUE/searchbar/index.vue.d.ts +1 -1
  165. package/dist/types/__VUE/step/index.vue.d.ts +1 -1
  166. package/dist/types/__VUE/swiper/index.vue.d.ts +9 -8
  167. package/dist/types/__VUE/swiperitem/index.vue.d.ts +2 -2
  168. package/dist/types/__VUE/switch/index.vue.d.ts +1 -1
  169. package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -11
  170. package/dist/types/__VUE/tabbaritem/index.vue.d.ts +4 -4
  171. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  172. package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
  173. package/dist/types/__VUE/uploader/index.vue.d.ts +3 -3
  174. package/dist/types/__VUE/video/index.vue.d.ts +3 -3
  175. package/dist/types/index.d.ts +1 -1
  176. package/package.json +1 -1
  177. package/dist/types/__VUE/swiper/use-touch.d.ts +0 -20
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
6
  import { ref, reactive, computed, watch, onMounted, toRefs, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode, onBeforeUnmount, resolveComponent, createVNode, withCtx, renderSlot } from "vue";
7
- import { c as createComponent, a as preventDefault } from "./component.js";
7
+ import { c as createComponent, a as preventDefault, d as clamp } from "./component.js";
8
8
  import Popup from "./Popup.js";
9
9
  import { p as popupProps } from "./props.js";
10
10
  import { u as useTouch } from "./index4.js";
@@ -162,7 +162,7 @@ const _sfc_main$1 = create$1({
162
162
  let currentDeg = (-updateMove / state.lineSpacing + 1) * state.rotation;
163
163
  const maxDeg = (props.column.length + 1) * state.rotation;
164
164
  const minDeg = 0;
165
- deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
165
+ deg = clamp(currentDeg, minDeg, maxDeg);
166
166
  if (minDeg < deg && deg < maxDeg) {
167
167
  setTransform(updateMove, null, void 0, deg + "deg");
168
168
  state.currIndex = Math.abs(Math.round(updateMove / state.lineSpacing)) + 1;
@@ -303,6 +303,14 @@ const _sfc_main = create({
303
303
  swipeDuration: {
304
304
  type: [Number, String],
305
305
  default: 1e3
306
+ },
307
+ showOkText: {
308
+ type: Boolean,
309
+ default: true
310
+ },
311
+ showCancelText: {
312
+ type: Boolean,
313
+ default: true
306
314
  }
307
315
  },
308
316
  emits: ["close", "change", "confirm", "update:visible", "update:modelValue"],
@@ -511,15 +519,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
511
519
  }, {
512
520
  default: withCtx(() => [
513
521
  createElementVNode("view", _hoisted_1, [
514
- createElementVNode("view", {
522
+ _ctx.showCancelText ? (openBlock(), createElementBlock("view", {
523
+ key: 0,
515
524
  class: "nut-picker__left",
516
525
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
517
- }, toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1),
526
+ }, toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1)) : createCommentVNode("", true),
518
527
  createElementVNode("view", _hoisted_2, toDisplayString(_ctx.title), 1),
519
- createElementVNode("view", {
528
+ _ctx.showOkText ? (openBlock(), createElementBlock("view", {
529
+ key: 1,
520
530
  class: "nut-picker__right",
521
531
  onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirmHandler())
522
- }, toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)
532
+ }, toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)) : createCommentVNode("", true)
523
533
  ]),
524
534
  renderSlot(_ctx.$slots, "top"),
525
535
  createElementVNode("view", _hoisted_3, [
@@ -1,10 +1,11 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
6
- import { ref, reactive, computed, watch, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, renderSlot, createVNode, normalizeStyle, withCtx, createCommentVNode, Fragment, renderList, withModifiers, mergeProps, toDisplayString } from "vue";
7
- import { j as isArray, c as createComponent } from "./component.js";
6
+ import { ref, computed, watch, resolveComponent, openBlock, createElementBlock, Fragment, renderSlot, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, createVNode, withCtx, renderList, withModifiers, mergeProps, toDisplayString } from "vue";
7
+ import { l as isArray, c as createComponent } from "./component.js";
8
+ import { u as useRect } from "./index2.js";
8
9
  import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
9
10
  import "../locale/lang";
10
11
  const { create } = createComponent("popover");
@@ -16,6 +17,7 @@ const _sfc_main = create({
16
17
  theme: { type: String, default: "light" },
17
18
  location: { type: String, default: "bottom" },
18
19
  offset: { type: Array, default: [0, 12] },
20
+ arrowOffset: { type: Number, default: 0 },
19
21
  customClass: { type: String, default: "" },
20
22
  showArrow: { type: Boolean, default: true },
21
23
  iconPrefix: { type: String, default: "nut-icon" },
@@ -25,52 +27,128 @@ const _sfc_main = create({
25
27
  overlayStyle: { type: Object },
26
28
  closeOnClickOverlay: { type: Boolean, default: true },
27
29
  closeOnClickAction: { type: Boolean, default: true },
28
- closeOnClickOutside: { type: Boolean, default: true }
30
+ closeOnClickOutside: { type: Boolean, default: true },
31
+ targetId: { type: String, default: "" },
32
+ bgColor: { type: String, default: "" }
29
33
  },
30
34
  emits: ["update", "update:visible", "close", "choose", "open"],
31
35
  setup(props, { emit }) {
32
36
  const popoverRef = ref();
33
37
  const popoverContentRef = ref();
34
38
  const showPopup = ref(props.visible);
35
- const state = reactive({
36
- rootWidth: 0,
37
- rootHeight: 0
38
- });
39
+ let rootRect = ref();
40
+ let conentRootRect = ref();
39
41
  const popoverArrow = computed(() => {
40
42
  const prefixCls = "nut-popover-arrow";
41
43
  const loca = props.location;
42
44
  const direction = loca.split("-")[0];
43
45
  return `${prefixCls} ${prefixCls}-${direction} ${prefixCls}--${loca}`;
44
46
  });
45
- const getStyles = computed(() => {
46
- let cross = +state.rootHeight;
47
- let lengthways = +state.rootWidth;
48
- let { offset, location } = props;
47
+ const popoverArrowStyle = computed(() => {
48
+ const styles = {};
49
+ const { bgColor, arrowOffset, location } = props;
50
+ const direction = location.split("-")[0];
51
+ const skew = location.split("-")[1];
52
+ const base = 16;
53
+ if (bgColor) {
54
+ styles[`border${upperCaseFirst(direction)}Color`] = bgColor;
55
+ }
56
+ if (props.arrowOffset != 0) {
57
+ if (["bottom", "top"].includes(direction)) {
58
+ if (!skew) {
59
+ styles.left = `calc(50% + ${arrowOffset}px)`;
60
+ }
61
+ if (skew == "start") {
62
+ styles.left = `${base + arrowOffset}px`;
63
+ }
64
+ if (skew == "end") {
65
+ styles.right = `${base - arrowOffset}px`;
66
+ }
67
+ }
68
+ if (["left", "right"].includes(direction)) {
69
+ if (!skew) {
70
+ styles.top = `calc(50% - ${arrowOffset}px)`;
71
+ }
72
+ if (skew == "start") {
73
+ styles.top = `${base - arrowOffset}px`;
74
+ }
75
+ if (skew == "end") {
76
+ styles.bottom = `${base + arrowOffset}px`;
77
+ }
78
+ }
79
+ }
80
+ return styles;
81
+ });
82
+ const upperCaseFirst = (str) => {
83
+ var str = str.toLowerCase();
84
+ str = str.replace(/\b\w+\b/g, (word) => word.substring(0, 1).toUpperCase() + word.substring(1));
85
+ return str;
86
+ };
87
+ const getRootPosition = computed(() => {
88
+ let styles = {};
89
+ if (!rootRect.value || !conentRootRect.value)
90
+ return {};
91
+ const conentWidth = conentRootRect.value.width;
92
+ const conentHeight = conentRootRect.value.height;
93
+ const { width, height, left, top } = rootRect.value;
94
+ const { location, offset } = props;
95
+ const direction = location.split("-")[0];
96
+ const skew = location.split("-")[1];
97
+ let cross = 0;
98
+ let parallel = 0;
49
99
  if (isArray(offset) && offset.length == 2) {
50
100
  cross += +offset[1];
51
- lengthways += +offset[1];
101
+ parallel += +offset[0];
52
102
  }
53
- const direction = location.split("-")[0];
54
- const style = {};
55
- const mapd = {
56
- top: "bottom",
57
- bottom: "top",
58
- left: "right",
59
- right: "left"
60
- };
61
- if (["top", "bottom"].includes(direction)) {
62
- style[mapd[direction]] = `${cross}px`;
63
- style.marginLeft = `${offset[0]}px`;
64
- } else {
65
- style[mapd[direction]] = `${lengthways}px`;
66
- style.marginTop = `${offset[0]}px`;
103
+ if (width) {
104
+ if (["bottom", "top"].includes(direction)) {
105
+ const h = direction == "bottom" ? height + cross : -(conentHeight + cross);
106
+ styles.top = `${top + h}px`;
107
+ if (!skew) {
108
+ styles.left = `${-(conentWidth - width) / 2 + left + parallel}px`;
109
+ }
110
+ if (skew == "start") {
111
+ styles.left = `${left + parallel}px`;
112
+ }
113
+ if (skew == "end") {
114
+ styles.left = `${rootRect.value.right + parallel}px`;
115
+ }
116
+ }
117
+ if (["left", "right"].includes(direction)) {
118
+ const contentW = direction == "left" ? -(conentWidth + cross) : width + cross;
119
+ styles.left = `${left + contentW}px`;
120
+ if (!skew) {
121
+ styles.top = `${top - conentHeight / 2 + height / 2 - 4 + parallel}px`;
122
+ }
123
+ if (skew == "start") {
124
+ styles.top = `${top + parallel}px`;
125
+ }
126
+ if (skew == "end") {
127
+ styles.top = `${top + height + parallel}px`;
128
+ }
129
+ }
67
130
  }
68
- return style;
131
+ return styles;
132
+ });
133
+ const customStyle = computed(() => {
134
+ const styles = {};
135
+ if (props.bgColor) {
136
+ styles.background = props.bgColor;
137
+ }
138
+ return styles;
69
139
  });
70
140
  const getContentWidth = () => {
71
- const { offsetHeight, offsetWidth } = popoverRef.value;
72
- state.rootHeight = offsetHeight;
73
- state.rootWidth = offsetWidth;
141
+ let rect2 = useRect(popoverRef.value);
142
+ if (props.targetId) {
143
+ rect2 = useRect(document.querySelector(`#${props.targetId}`));
144
+ }
145
+ rootRect.value = rect2;
146
+ setTimeout(() => {
147
+ conentRootRect.value = {
148
+ height: popoverContentRef.value.clientHeight,
149
+ width: popoverContentRef.value.clientWidth
150
+ };
151
+ }, 0);
74
152
  };
75
153
  watch(
76
154
  () => props.visible,
@@ -105,7 +183,12 @@ const _sfc_main = create({
105
183
  const clickAway = (event) => {
106
184
  const element = popoverRef.value;
107
185
  const elContent = popoverContentRef.value;
108
- if (element && !element.contains(event.target) && elContent && !elContent.contains(event.target) && props.closeOnClickOutside) {
186
+ let el = element && !element.contains(event.target);
187
+ if (props.targetId) {
188
+ const dom = document.querySelector(`#${props.targetId}`);
189
+ el = dom && !dom.contains(event.target);
190
+ }
191
+ if (el && elContent && !elContent.contains(event.target) && props.closeOnClickOutside) {
109
192
  closePopover();
110
193
  }
111
194
  };
@@ -116,8 +199,10 @@ const _sfc_main = create({
116
199
  closePopover,
117
200
  chooseItem,
118
201
  popoverRef,
119
- getStyles,
120
- popoverContentRef
202
+ popoverContentRef,
203
+ getRootPosition,
204
+ customStyle,
205
+ popoverArrowStyle
121
206
  };
122
207
  }
123
208
  });
@@ -128,59 +213,64 @@ const _hoisted_1 = {
128
213
  const _hoisted_2 = ["onClick"];
129
214
  const _hoisted_3 = { class: "nut-popover-menu-item-name" };
130
215
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
131
- const _component_nut_icon = resolveComponent("nut-icon");
216
+ const _component_Icon = resolveComponent("Icon");
132
217
  const _component_nut_popup = resolveComponent("nut-popup");
133
- return openBlock(), createElementBlock("view", {
134
- class: normalizeClass(["nut-popover", `nut-popover--${_ctx.theme}`, `${_ctx.customClass}`])
135
- }, [
136
- createElementVNode("view", {
218
+ return openBlock(), createElementBlock(Fragment, null, [
219
+ !_ctx.targetId ? (openBlock(), createElementBlock("div", {
220
+ key: 0,
137
221
  class: "nut-popover-wrapper",
138
222
  onClick: _cache[0] || (_cache[0] = (...args) => _ctx.openPopover && _ctx.openPopover(...args)),
139
223
  ref: "popoverRef"
140
224
  }, [
141
225
  renderSlot(_ctx.$slots, "reference")
142
- ], 512),
143
- createVNode(_component_nut_popup, {
144
- popClass: `nut-popover-content nut-popover-content--${_ctx.location}`,
145
- style: normalizeStyle(_ctx.getStyles),
146
- visible: _ctx.showPopup,
147
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPopup = $event),
148
- position: "",
149
- transition: "nut-popover",
150
- overlay: _ctx.overlay,
151
- duration: _ctx.duration,
152
- overlayStyle: _ctx.overlayStyle,
153
- overlayClass: _ctx.overlayClass,
154
- closeOnClickOverlay: _ctx.closeOnClickOverlay
155
- }, {
156
- default: withCtx(() => [
157
- createElementVNode("view", _hoisted_1, [
158
- _ctx.showArrow ? (openBlock(), createElementBlock("view", {
159
- key: 0,
160
- class: normalizeClass(_ctx.popoverArrow)
161
- }, null, 2)) : createCommentVNode("", true),
162
- renderSlot(_ctx.$slots, "content"),
163
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index2) => {
164
- return openBlock(), createElementBlock("view", {
165
- key: index2,
166
- class: normalizeClass([item.className, item.disabled && "nut-popover-menu-disabled", "nut-popover-menu-item"]),
167
- onClick: withModifiers(($event) => _ctx.chooseItem(item, index2), ["stop"])
168
- }, [
169
- item.icon ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
170
- createVNode(_component_nut_icon, mergeProps(_ctx.$attrs, {
171
- class: "nut-popover-item-img",
172
- classPrefix: _ctx.iconPrefix,
173
- name: item.icon
174
- }), null, 16, ["classPrefix", "name"])
175
- ]) : createCommentVNode("", true),
176
- createElementVNode("view", _hoisted_3, toDisplayString(item.name), 1)
177
- ], 10, _hoisted_2);
178
- }), 128))
179
- ], 512)
180
- ]),
181
- _: 3
182
- }, 8, ["popClass", "style", "visible", "overlay", "duration", "overlayStyle", "overlayClass", "closeOnClickOverlay"])
183
- ], 2);
226
+ ], 512)) : createCommentVNode("", true),
227
+ createElementVNode("view", {
228
+ class: normalizeClass(["nut-popover", `nut-popover--${_ctx.theme}`, `${_ctx.customClass}`]),
229
+ style: normalizeStyle(_ctx.getRootPosition)
230
+ }, [
231
+ createVNode(_component_nut_popup, {
232
+ popClass: `nut-popover-content nut-popover-content--${_ctx.location}`,
233
+ style: normalizeStyle(_ctx.customStyle),
234
+ visible: _ctx.showPopup,
235
+ "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPopup = $event),
236
+ position: "",
237
+ transition: "nut-popover",
238
+ overlay: _ctx.overlay,
239
+ duration: _ctx.duration,
240
+ overlayStyle: _ctx.overlayStyle,
241
+ overlayClass: _ctx.overlayClass,
242
+ closeOnClickOverlay: _ctx.closeOnClickOverlay
243
+ }, {
244
+ default: withCtx(() => [
245
+ createElementVNode("view", _hoisted_1, [
246
+ _ctx.showArrow ? (openBlock(), createElementBlock("view", {
247
+ key: 0,
248
+ class: normalizeClass(_ctx.popoverArrow),
249
+ style: normalizeStyle(_ctx.popoverArrowStyle)
250
+ }, null, 6)) : createCommentVNode("", true),
251
+ renderSlot(_ctx.$slots, "content"),
252
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index2) => {
253
+ return openBlock(), createElementBlock("view", {
254
+ key: index2,
255
+ class: normalizeClass([item.className, item.disabled && "nut-popover-menu-disabled", "nut-popover-menu-item"]),
256
+ onClick: withModifiers(($event) => _ctx.chooseItem(item, index2), ["stop"])
257
+ }, [
258
+ item.icon ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
259
+ createVNode(_component_Icon, mergeProps(_ctx.$attrs, {
260
+ class: "nut-popover-item-img",
261
+ classPrefix: _ctx.iconPrefix,
262
+ name: item.icon
263
+ }), null, 16, ["classPrefix", "name"])
264
+ ]) : createCommentVNode("", true),
265
+ createElementVNode("view", _hoisted_3, toDisplayString(item.name), 1)
266
+ ], 10, _hoisted_2);
267
+ }), 128))
268
+ ], 512)
269
+ ]),
270
+ _: 3
271
+ }, 8, ["popClass", "style", "visible", "overlay", "duration", "overlayStyle", "overlayClass", "closeOnClickOverlay"])
272
+ ], 6)
273
+ ], 64);
184
274
  }
185
275
  var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
186
276
  export { index as default };
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -37,12 +37,17 @@ const _sfc_main = create({
37
37
  size: {
38
38
  type: String,
39
39
  default: "large"
40
+ },
41
+ strikeThrough: {
42
+ type: Boolean,
43
+ default: false
40
44
  }
41
45
  },
42
46
  setup(props) {
43
47
  const classes = computed(() => {
44
48
  return {
45
- [componentName]: true
49
+ [componentName]: true,
50
+ [`${componentName}--strike`]: props.strikeThrough
46
51
  };
47
52
  });
48
53
  const showSymbol = computed(() => {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui v3.3.0 Fri Dec 02 2022 20:55:46 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:47:05 GMT+0800 (中国标准时间)
3
3
  * (c) 2022 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */