@nutui/nutui 4.0.10-beta.1 → 4.0.11

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 (160) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/nutui.es.js +1 -1
  3. package/dist/nutui.js +6316 -7237
  4. package/dist/nutui.umd.js +1 -1
  5. package/dist/packages/_es/ActionSheet.js +78 -111
  6. package/dist/packages/_es/Address.js +250 -375
  7. package/dist/packages/_es/AddressList.js +269 -354
  8. package/dist/packages/_es/Animate.js +41 -58
  9. package/dist/packages/_es/Audio.js +128 -197
  10. package/dist/packages/_es/AudioOperate.js +60 -71
  11. package/dist/packages/_es/Avatar.js +66 -89
  12. package/dist/packages/_es/AvatarGroup.js +23 -31
  13. package/dist/packages/_es/Backtop.js +59 -99
  14. package/dist/packages/_es/Badge.js +36 -47
  15. package/dist/packages/_es/Barrage.js +68 -147
  16. package/dist/packages/_es/Button.js +47 -66
  17. package/dist/packages/_es/Calendar.js +135 -157
  18. package/dist/packages/_es/CalendarItem.js +6 -6
  19. package/dist/packages/_es/Card.js +42 -56
  20. package/dist/packages/_es/Cascader.js +315 -474
  21. package/dist/packages/_es/Category.js +29 -39
  22. package/dist/packages/_es/CategoryPane.js +57 -83
  23. package/dist/packages/_es/Cell.js +56 -71
  24. package/dist/packages/_es/CellGroup.js +19 -27
  25. package/dist/packages/_es/Checkbox.js +109 -156
  26. package/dist/packages/_es/CheckboxGroup.js +38 -59
  27. package/dist/packages/_es/CircleProgress.js +67 -96
  28. package/dist/packages/_es/Col.js +23 -31
  29. package/dist/packages/_es/Collapse.js +33 -58
  30. package/dist/packages/_es/CollapseItem.js +78 -108
  31. package/dist/packages/_es/Comment.js +207 -279
  32. package/dist/packages/_es/ConfigProvider.js +37 -55
  33. package/dist/packages/_es/Countdown.js +100 -212
  34. package/dist/packages/_es/Countup.js +232 -445
  35. package/dist/packages/_es/DatePicker.js +162 -265
  36. package/dist/packages/_es/Dialog.js +161 -213
  37. package/dist/packages/_es/Divider.js +42 -57
  38. package/dist/packages/_es/Drag.js +70 -153
  39. package/dist/packages/_es/Ecard.js +64 -104
  40. package/dist/packages/_es/Elevator.js +143 -219
  41. package/dist/packages/_es/Ellipsis.js +95 -178
  42. package/dist/packages/_es/Empty.js +23 -39
  43. package/dist/packages/_es/FixedNav.js +93 -116
  44. package/dist/packages/_es/Form.js +107 -178
  45. package/dist/packages/_es/FormItem.js +48 -61
  46. package/dist/packages/_es/Grid.js +5 -6
  47. package/dist/packages/_es/GridItem.js +58 -84
  48. package/dist/packages/_es/Image.js +90 -129
  49. package/dist/packages/_es/ImagePreview.js +256 -412
  50. package/dist/packages/_es/Indicator.js +30 -34
  51. package/dist/packages/_es/InfiniteLoading.js +83 -136
  52. package/dist/packages/_es/Input.js +160 -264
  53. package/dist/packages/_es/InputNumber.js +81 -117
  54. package/dist/packages/_es/Interceptor-6e26b757.js +18 -0
  55. package/dist/packages/_es/Invoice.js +104 -130
  56. package/dist/packages/_es/Layout.js +3 -4
  57. package/dist/packages/_es/List.js +117 -215
  58. package/dist/packages/_es/Menu.js +95 -150
  59. package/dist/packages/_es/MenuItem.js +109 -154
  60. package/dist/packages/_es/Navbar.js +103 -119
  61. package/dist/packages/_es/Noticebar.js +197 -312
  62. package/dist/packages/_es/Notify.js +110 -166
  63. package/dist/packages/_es/NumberKeyboard.js +127 -202
  64. package/dist/packages/_es/Overlay.js +52 -80
  65. package/dist/packages/_es/Pagination.js +70 -100
  66. package/dist/packages/_es/Picker.js +275 -437
  67. package/dist/packages/_es/Popover.js +122 -225
  68. package/dist/packages/_es/Popup.js +4 -4
  69. package/dist/packages/_es/Price.js +44 -82
  70. package/dist/packages/_es/Progress.js +63 -79
  71. package/dist/packages/_es/PullRefresh.js +95 -173
  72. package/dist/packages/_es/Radio.js +4 -4
  73. package/dist/packages/_es/RadioGroup.js +3 -3
  74. package/dist/packages/_es/Range.js +204 -347
  75. package/dist/packages/_es/Rate.js +92 -141
  76. package/dist/packages/_es/Row.js +21 -27
  77. package/dist/packages/_es/Searchbar.js +123 -174
  78. package/dist/packages/_es/ShortPassword.js +69 -93
  79. package/dist/packages/_es/SideNavbar.js +49 -80
  80. package/dist/packages/_es/SideNavbarItem.js +22 -32
  81. package/dist/packages/_es/Signature.js +83 -146
  82. package/dist/packages/_es/Skeleton.js +110 -130
  83. package/dist/packages/_es/Sku.js +250 -343
  84. package/dist/packages/_es/Step.js +59 -86
  85. package/dist/packages/_es/Steps.js +26 -31
  86. package/dist/packages/_es/Sticky.js +4 -4
  87. package/dist/packages/_es/SubSideNavbar.js +52 -74
  88. package/dist/packages/_es/Swipe.js +83 -155
  89. package/dist/packages/_es/Swiper.js +174 -311
  90. package/dist/packages/_es/SwiperItem.js +28 -44
  91. package/dist/packages/_es/Switch.js +55 -68
  92. package/dist/packages/_es/TabPane.js +30 -41
  93. package/dist/packages/_es/Tabbar.js +41 -52
  94. package/dist/packages/_es/TabbarItem.js +61 -82
  95. package/dist/packages/_es/Table.js +109 -165
  96. package/dist/packages/_es/Tabs.js +240 -388
  97. package/dist/packages/_es/Tag.js +44 -61
  98. package/dist/packages/_es/Textarea.js +80 -124
  99. package/dist/packages/_es/TimeDetail.js +49 -76
  100. package/dist/packages/_es/TimePannel.js +34 -48
  101. package/dist/packages/_es/TimeSelect.js +47 -68
  102. package/dist/packages/_es/Toast.js +144 -218
  103. package/dist/packages/_es/Tour.js +138 -192
  104. package/dist/packages/_es/TrendArrow.js +57 -77
  105. package/dist/packages/_es/Uploader.js +234 -359
  106. package/dist/packages/_es/Video.js +191 -316
  107. package/dist/packages/_es/Watermark.js +84 -117
  108. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +9 -0
  109. package/dist/packages/_es/common-d218746f.js +116 -0
  110. package/dist/packages/_es/component-234624bc.js +89 -0
  111. package/dist/packages/_es/index-14dfadc4.js +561 -0
  112. package/dist/packages/_es/index-192a3ef6.js +29 -0
  113. package/dist/packages/_es/index-360c5092.js +210 -0
  114. package/dist/packages/_es/index-496e6e05.js +24 -0
  115. package/dist/packages/_es/index-50eed3d9.js +7 -0
  116. package/dist/packages/_es/index-53ec2d4d.js +34 -0
  117. package/dist/packages/_es/index-fadb0974.js +8 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +43 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +77 -0
  120. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +110 -0
  121. package/dist/packages/_es/mountComponent-6d4ff200.js +23 -0
  122. package/dist/packages/_es/pxCheck-38173291.js +4 -0
  123. package/dist/packages/_es/raf-a74f1a06.js +16 -0
  124. package/dist/packages/_es/renderIcon-47498b32.js +5 -0
  125. package/dist/smartips/web-types.json +1 -1
  126. package/dist/style.css +1 -1
  127. package/dist/styles/themes/default.scss +148 -45
  128. package/dist/styles/themes/jdb.scss +148 -45
  129. package/dist/styles/themes/jddkh.scss +148 -45
  130. package/dist/styles/themes/jdt.scss +148 -45
  131. package/dist/types/__VUE/address/index.vue.d.ts +1 -1
  132. package/dist/types/__VUE/collapseitem/index.vue.d.ts +110 -3
  133. package/dist/types/__VUE/image/index.vue.d.ts +2 -2
  134. package/dist/types/__VUE/rate/index.vue.d.ts +110 -3
  135. package/dist/types/__VUE/searchbar/index.vue.d.ts +110 -3
  136. package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -2
  137. package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
  138. package/dist/types/__VUE/table/common.d.ts +55 -2
  139. package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
  140. package/dist/types/__VUE/watermark/index.vue.d.ts +1 -1
  141. package/dist/types/index.d.ts +1 -1
  142. package/package.json +2 -2
  143. package/dist/packages/_es/Interceptor-956b24fc.js +0 -29
  144. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +0 -10
  145. package/dist/packages/_es/common-b9a5e726.js +0 -145
  146. package/dist/packages/_es/component-81a4c1d0.js +0 -145
  147. package/dist/packages/_es/index-29892cda.js +0 -33
  148. package/dist/packages/_es/index-43c34ac6.js +0 -30
  149. package/dist/packages/_es/index-54d03fc1.js +0 -8
  150. package/dist/packages/_es/index-79c5dc33.js +0 -10
  151. package/dist/packages/_es/index-7a7385e4.js +0 -67
  152. package/dist/packages/_es/index-87422be8.js +0 -942
  153. package/dist/packages/_es/index-da0a7662.js +0 -259
  154. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +0 -46
  155. package/dist/packages/_es/index.vue_vue_type_script_lang-442e4704.js +0 -98
  156. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +0 -151
  157. package/dist/packages/_es/mountComponent-8b24c346.js +0 -39
  158. package/dist/packages/_es/pxCheck-c6b9f6b7.js +0 -6
  159. package/dist/packages/_es/raf-729dad54.js +0 -25
  160. package/dist/packages/_es/renderIcon-3d0fd47c.js +0 -9
@@ -1,272 +1,169 @@
1
- import { ref, computed, onMounted, watch, resolveComponent, openBlock, createElementBlock, Fragment, renderSlot, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, createVNode, withCtx, renderList, withModifiers, createBlock, resolveDynamicComponent, toDisplayString } from "vue";
2
- import { i as isArray, c as createComponent } from "./component-81a4c1d0.js";
3
- import { r as renderIcon } from "./renderIcon-3d0fd47c.js";
4
- import { u as useRect } from "./index-29892cda.js";
5
- import { P as Popup } from "./index-da0a7662.js";
6
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { ref as g, computed as k, onMounted as j, watch as G, resolveComponent as J, openBlock as d, createElementBlock as C, Fragment as V, renderSlot as q, createCommentVNode as P, createElementVNode as I, normalizeClass as R, normalizeStyle as B, createVNode as K, withCtx as Q, renderList as X, withModifiers as Y, createBlock as Z, resolveDynamicComponent as x, toDisplayString as _ } from "vue";
2
+ import { i as ee, c as te } from "./component-234624bc.js";
3
+ import { r as oe } from "./renderIcon-47498b32.js";
4
+ import { u as z } from "./index-192a3ef6.js";
5
+ import { P as D } from "./index-360c5092.js";
6
+ import { _ as ne } from "./_plugin-vue_export-helper-dad06003.js";
7
7
  import "../locale/lang";
8
8
  import "./Overlay.js";
9
9
  import "@nutui/icons-vue";
10
- const { create } = createComponent("popover");
11
- const _sfc_main = create({
10
+ const { create: re } = te("popover"), le = re({
12
11
  components: {
13
- [Popup.name]: Popup
12
+ [D.name]: D
14
13
  },
15
14
  props: {
16
- visible: { type: Boolean, default: false },
15
+ visible: { type: Boolean, default: !1 },
17
16
  list: { type: Array, default: [] },
18
17
  theme: { type: String, default: "light" },
19
18
  location: { type: String, default: "bottom" },
20
19
  offset: { type: Array, default: [0, 12] },
21
20
  arrowOffset: { type: Number, default: 0 },
22
21
  customClass: { type: String, default: "" },
23
- showArrow: { type: Boolean, default: true },
22
+ showArrow: { type: Boolean, default: !0 },
24
23
  duration: { type: [Number, String], default: 0.3 },
25
- overlay: { type: Boolean, default: false },
24
+ overlay: { type: Boolean, default: !1 },
26
25
  overlayClass: { type: String, default: "" },
27
26
  overlayStyle: { type: Object },
28
- closeOnClickOverlay: { type: Boolean, default: true },
29
- closeOnClickAction: { type: Boolean, default: true },
30
- closeOnClickOutside: { type: Boolean, default: true },
27
+ closeOnClickOverlay: { type: Boolean, default: !0 },
28
+ closeOnClickAction: { type: Boolean, default: !0 },
29
+ closeOnClickOutside: { type: Boolean, default: !0 },
31
30
  targetId: { type: String, default: "" },
32
31
  bgColor: { type: String, default: "" }
33
32
  },
34
33
  emits: ["update", "update:visible", "close", "choose", "open"],
35
- setup(props, { emit }) {
36
- const popoverRef = ref();
37
- const popoverContentRef = ref();
38
- const showPopup = ref(props.visible);
39
- let rootRect = ref();
40
- let conentRootRect = ref();
41
- const popoverArrow = computed(() => {
42
- const prefixCls = "nut-popover-arrow";
43
- const loca = props.location;
44
- const direction = loca.split("-")[0];
45
- return `${prefixCls} ${prefixCls}-${direction} ${prefixCls}--${loca}`;
46
- });
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)
34
+ setup(t, { emit: l }) {
35
+ const h = g(), v = g(), S = g(t.visible);
36
+ let y = g(), u = g();
37
+ const r = k(() => {
38
+ const e = "nut-popover-arrow", o = t.location, n = o.split("-")[0];
39
+ return `${e} ${e}-${n} ${e}--${o}`;
40
+ }), w = k(() => {
41
+ const e = {}, { bgColor: o, arrowOffset: n, location: a } = t, s = a.split("-")[0], i = a.split("-")[1], p = 16;
42
+ return o && (e[`border${N(s)}Color`] = o), t.arrowOffset != 0 && (["bottom", "top"].includes(s) && (i || (e.left = `calc(50% + ${n}px)`), i == "start" && (e.left = `${p + n}px`), i == "end" && (e.right = `${p - n}px`)), ["left", "right"].includes(s) && (i || (e.top = `calc(50% - ${n}px)`), i == "start" && (e.top = `${p - n}px`), i == "end" && (e.bottom = `${p + n}px`))), e;
43
+ }), N = (o) => {
44
+ var o = o.toLowerCase();
45
+ return o = o.replace(/\b\w+\b/g, (n) => n.substring(0, 1).toUpperCase() + n.substring(1)), o;
46
+ }, F = k(() => {
47
+ let e = {};
48
+ if (!y.value || !u.value)
90
49
  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;
99
- if (isArray(offset) && offset.length == 2) {
100
- cross += +offset[1];
101
- parallel += +offset[0];
102
- }
103
- if (width) {
104
- if (["bottom", "top"].includes(direction)) {
105
- const h2 = direction == "bottom" ? height + cross : -(conentHeight + cross);
106
- styles.top = `${top + h2}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
- }
50
+ const o = u.value.width, n = u.value.height, { width: a, height: s, left: i, top: p } = y.value, { location: W, offset: b } = t, $ = W.split("-")[0], f = W.split("-")[1];
51
+ let m = 0, c = 0;
52
+ if (ee(b) && b.length == 2 && (m += +b[1], c += +b[0]), a) {
53
+ if (["bottom", "top"].includes($)) {
54
+ const A = $ == "bottom" ? s + m : -(n + m);
55
+ e.top = `${p + A}px`, f || (e.left = `${-(o - a) / 2 + i + c}px`), f == "start" && (e.left = `${i + c}px`), f == "end" && (e.left = `${y.value.right + c}px`);
116
56
  }
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
- }
57
+ if (["left", "right"].includes($)) {
58
+ const A = $ == "left" ? -(o + m) : a + m;
59
+ e.left = `${i + A}px`, f || (e.top = `${p - n / 2 + s / 2 - 4 + c}px`), f == "start" && (e.top = `${p + c}px`), f == "end" && (e.top = `${p + s + c}px`);
129
60
  }
130
61
  }
131
- return styles;
132
- });
133
- const customStyle = computed(() => {
134
- const styles = {};
135
- if (props.bgColor) {
136
- styles.background = props.bgColor;
137
- }
138
- return styles;
139
- });
140
- const getContentWidth = () => {
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
62
+ return e;
63
+ }), H = k(() => {
64
+ const e = {};
65
+ return t.bgColor && (e.background = t.bgColor), e;
66
+ }), E = () => {
67
+ let e = z(h.value);
68
+ t.targetId && (e = z(document.querySelector(`#${t.targetId}`))), y.value = e, setTimeout(() => {
69
+ u.value = {
70
+ height: v.value.clientHeight,
71
+ width: v.value.clientWidth
150
72
  };
151
73
  }, 0);
152
74
  };
153
- onMounted(() => {
75
+ j(() => {
154
76
  setTimeout(() => {
155
- getContentWidth();
77
+ E();
156
78
  }, 200);
157
- });
158
- watch(
159
- () => props.visible,
160
- (value) => {
161
- showPopup.value = value;
162
- if (value) {
163
- window.addEventListener("touchstart", clickAway, true);
164
- getContentWidth();
165
- } else {
166
- window.removeEventListener("touchstart", clickAway, true);
167
- }
79
+ }), G(
80
+ () => t.visible,
81
+ (e) => {
82
+ S.value = e, e ? (window.addEventListener("touchstart", L, !0), E()) : window.removeEventListener("touchstart", L, !0);
168
83
  }
169
84
  );
170
- const update = (val) => {
171
- emit("update", val);
172
- emit("update:visible", val);
173
- };
174
- const openPopover = () => {
175
- update(!props.visible);
176
- emit("open");
177
- };
178
- const closePopover = () => {
179
- emit("update:visible", false);
180
- emit("close");
181
- };
182
- const chooseItem = (item, index) => {
183
- !item.disabled && emit("choose", item, index);
184
- if (props.closeOnClickAction) {
185
- closePopover();
186
- }
187
- };
188
- const clickAway = (event) => {
189
- const element = popoverRef.value;
190
- const elContent = popoverContentRef.value;
191
- let el = element && !element.contains(event.target);
192
- if (props.targetId) {
193
- const dom = document.querySelector(`#${props.targetId}`);
194
- el = dom && !dom.contains(event.target);
195
- }
196
- if (el && elContent && !elContent.contains(event.target) && props.closeOnClickOutside) {
197
- closePopover();
85
+ const M = (e) => {
86
+ l("update", e), l("update:visible", e);
87
+ }, T = () => {
88
+ M(!t.visible), l("open");
89
+ }, O = () => {
90
+ l("update:visible", !1), l("close");
91
+ }, U = (e, o) => {
92
+ !e.disabled && l("choose", e, o), t.closeOnClickAction && O();
93
+ }, L = (e) => {
94
+ const o = h.value, n = v.value;
95
+ let a = o && !o.contains(e.target);
96
+ if (t.targetId) {
97
+ const s = document.querySelector(`#${t.targetId}`);
98
+ a = s && !s.contains(e.target);
198
99
  }
100
+ a && n && !n.contains(e.target) && t.closeOnClickOutside && O();
199
101
  };
200
102
  return {
201
- showPopup,
202
- openPopover,
203
- popoverArrow,
204
- closePopover,
205
- chooseItem,
206
- popoverRef,
207
- popoverContentRef,
208
- getRootPosition,
209
- customStyle,
210
- popoverArrowStyle,
211
- renderIcon
103
+ showPopup: S,
104
+ openPopover: T,
105
+ popoverArrow: r,
106
+ closePopover: O,
107
+ chooseItem: U,
108
+ popoverRef: h,
109
+ popoverContentRef: v,
110
+ getRootPosition: F,
111
+ customStyle: H,
112
+ popoverArrowStyle: w,
113
+ renderIcon: oe
212
114
  };
213
115
  }
214
- });
215
- const _hoisted_1 = {
116
+ }), se = {
216
117
  ref: "popoverContentRef",
217
118
  class: "nut-popover-content-group"
218
- };
219
- const _hoisted_2 = ["onClick"];
220
- const _hoisted_3 = { class: "nut-popover-menu-item-name" };
221
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
222
- const _component_nut_popup = resolveComponent("nut-popup");
223
- return openBlock(), createElementBlock(Fragment, null, [
224
- !_ctx.targetId ? (openBlock(), createElementBlock("div", {
119
+ }, ie = ["onClick"], ae = { class: "nut-popover-menu-item-name" };
120
+ function pe(t, l, h, v, S, y) {
121
+ const u = J("nut-popup");
122
+ return d(), C(V, null, [
123
+ t.targetId ? P("", !0) : (d(), C("div", {
225
124
  key: 0,
226
125
  class: "nut-popover-wrapper",
227
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.openPopover && _ctx.openPopover(...args)),
126
+ onClick: l[0] || (l[0] = (...r) => t.openPopover && t.openPopover(...r)),
228
127
  ref: "popoverRef"
229
128
  }, [
230
- renderSlot(_ctx.$slots, "reference")
231
- ], 512)) : createCommentVNode("", true),
232
- createElementVNode("view", {
233
- class: normalizeClass(["nut-popover", `nut-popover--${_ctx.theme}`, `${_ctx.customClass}`]),
234
- style: normalizeStyle(_ctx.getRootPosition)
129
+ q(t.$slots, "reference")
130
+ ], 512)),
131
+ I("view", {
132
+ class: R(["nut-popover", `nut-popover--${t.theme}`, `${t.customClass}`]),
133
+ style: B(t.getRootPosition)
235
134
  }, [
236
- createVNode(_component_nut_popup, {
237
- popClass: `nut-popover-content nut-popover-content--${_ctx.location}`,
238
- style: normalizeStyle(_ctx.customStyle),
239
- visible: _ctx.showPopup,
240
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPopup = $event),
135
+ K(u, {
136
+ popClass: `nut-popover-content nut-popover-content--${t.location}`,
137
+ style: B(t.customStyle),
138
+ visible: t.showPopup,
139
+ "onUpdate:visible": l[1] || (l[1] = (r) => t.showPopup = r),
241
140
  position: "",
242
141
  transition: "nut-popover",
243
- overlay: _ctx.overlay,
244
- duration: _ctx.duration,
245
- overlayStyle: _ctx.overlayStyle,
246
- overlayClass: _ctx.overlayClass,
247
- closeOnClickOverlay: _ctx.closeOnClickOverlay
142
+ overlay: t.overlay,
143
+ duration: t.duration,
144
+ overlayStyle: t.overlayStyle,
145
+ overlayClass: t.overlayClass,
146
+ closeOnClickOverlay: t.closeOnClickOverlay
248
147
  }, {
249
- default: withCtx(() => [
250
- createElementVNode("view", _hoisted_1, [
251
- _ctx.showArrow ? (openBlock(), createElementBlock("view", {
148
+ default: Q(() => [
149
+ I("view", se, [
150
+ t.showArrow ? (d(), C("view", {
252
151
  key: 0,
253
- class: normalizeClass(_ctx.popoverArrow),
254
- style: normalizeStyle(_ctx.popoverArrowStyle)
255
- }, null, 6)) : createCommentVNode("", true),
256
- renderSlot(_ctx.$slots, "content"),
257
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.list, (item, index) => {
258
- return openBlock(), createElementBlock("view", {
259
- key: index,
260
- class: normalizeClass([item.className, item.disabled && "nut-popover-menu-disabled", "nut-popover-menu-item"]),
261
- onClick: withModifiers(($event) => _ctx.chooseItem(item, index), ["stop"])
262
- }, [
263
- item.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(item.icon)), {
264
- key: 0,
265
- class: "nut-popover-item-img"
266
- })) : createCommentVNode("", true),
267
- createElementVNode("view", _hoisted_3, toDisplayString(item.name), 1)
268
- ], 10, _hoisted_2);
269
- }), 128))
152
+ class: R(t.popoverArrow),
153
+ style: B(t.popoverArrowStyle)
154
+ }, null, 6)) : P("", !0),
155
+ q(t.$slots, "content"),
156
+ (d(!0), C(V, null, X(t.list, (r, w) => (d(), C("view", {
157
+ key: w,
158
+ class: R([r.className, r.disabled && "nut-popover-menu-disabled", "nut-popover-menu-item"]),
159
+ onClick: Y((N) => t.chooseItem(r, w), ["stop"])
160
+ }, [
161
+ r.icon ? (d(), Z(x(t.renderIcon(r.icon)), {
162
+ key: 0,
163
+ class: "nut-popover-item-img"
164
+ })) : P("", !0),
165
+ I("view", ae, _(r.name), 1)
166
+ ], 10, ie))), 128))
270
167
  ], 512)
271
168
  ]),
272
169
  _: 3
@@ -274,7 +171,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
274
171
  ], 6)
275
172
  ], 64);
276
173
  }
277
- const Popover = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
174
+ const he = /* @__PURE__ */ ne(le, [["render", pe]]);
278
175
  export {
279
- Popover as default
176
+ he as default
280
177
  };
@@ -1,10 +1,10 @@
1
- import { P } from "./index-da0a7662.js";
1
+ import { P as f } from "./index-360c5092.js";
2
2
  import "vue";
3
- import "./_plugin-vue_export-helper-cc2b3d55.js";
4
- import "./component-81a4c1d0.js";
3
+ import "./_plugin-vue_export-helper-dad06003.js";
4
+ import "./component-234624bc.js";
5
5
  import "../locale/lang";
6
6
  import "./Overlay.js";
7
7
  import "@nutui/icons-vue";
8
8
  export {
9
- P as default
9
+ f as default
10
10
  };
@@ -1,9 +1,8 @@
1
- import { computed, openBlock, createElementBlock, normalizeClass, createCommentVNode, createElementVNode, toDisplayString } from "vue";
2
- import { c as createComponent } from "./component-81a4c1d0.js";
3
- import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
1
+ import { computed as c, openBlock as r, createElementBlock as i, normalizeClass as s, createCommentVNode as n, createElementVNode as f, toDisplayString as d } from "vue";
2
+ import { c as g } from "./component-234624bc.js";
3
+ import { _ as h } from "./_plugin-vue_export-helper-dad06003.js";
4
4
  import "../locale/lang";
5
- const { componentName, create } = createComponent("price");
6
- const _sfc_main = create({
5
+ const { componentName: u, create: S } = g("price"), $ = S({
7
6
  props: {
8
7
  price: {
9
8
  type: [Number, String],
@@ -11,7 +10,7 @@ const _sfc_main = create({
11
10
  },
12
11
  needSymbol: {
13
12
  type: Boolean,
14
- default: true
13
+ default: !0
15
14
  },
16
15
  symbol: {
17
16
  type: String,
@@ -23,7 +22,7 @@ const _sfc_main = create({
23
22
  },
24
23
  thousands: {
25
24
  type: Boolean,
26
- default: false
25
+ default: !1
27
26
  },
28
27
  position: {
29
28
  type: String,
@@ -35,91 +34,54 @@ const _sfc_main = create({
35
34
  },
36
35
  strikeThrough: {
37
36
  type: Boolean,
38
- default: false
37
+ default: !1
39
38
  }
40
39
  },
41
- setup(props) {
42
- const classes = computed(() => {
43
- return {
44
- [componentName]: true,
45
- [`${componentName}--strike`]: props.strikeThrough
46
- };
47
- });
48
- const showSymbol = computed(() => {
49
- const symbol = props.needSymbol ? props.symbol : "";
50
- return symbol;
51
- });
52
- const checkPoint = (price) => {
53
- return String(price).indexOf(".") > 0;
54
- };
55
- const formatThousands = (num) => {
56
- if (Number(num) == 0) {
57
- num = 0;
58
- }
59
- if (checkPoint(num)) {
60
- num = Number(num).toFixed(props.decimalDigits);
61
- num = typeof num.split(".") === "string" ? num.split(".") : num.split(".")[0];
62
- } else {
63
- num = num.toString();
64
- }
65
- if (props.thousands) {
66
- return (num || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,");
67
- } else {
68
- return num;
69
- }
70
- };
71
- const formatDecimal = (decimalNum) => {
72
- if (Number(decimalNum) == 0) {
73
- decimalNum = 0;
74
- }
75
- if (checkPoint(decimalNum)) {
76
- decimalNum = Number(decimalNum).toFixed(props.decimalDigits);
77
- decimalNum = typeof decimalNum.split(".") === "string" ? 0 : decimalNum.split(".")[1] ? decimalNum.split(".")[1] : 0;
78
- } else {
79
- decimalNum = 0;
80
- }
81
- const result = "0." + decimalNum;
82
- const resultFixed = Number(result).toFixed(props.decimalDigits);
83
- return String(resultFixed).substring(2, resultFixed.length);
84
- };
40
+ setup(t) {
41
+ const l = c(() => ({
42
+ [u]: !0,
43
+ [`${u}--strike`]: t.strikeThrough
44
+ })), a = c(() => t.needSymbol ? t.symbol : ""), o = (e) => String(e).indexOf(".") > 0;
85
45
  return {
86
- classes,
87
- showSymbol,
88
- checkPoint,
89
- formatThousands,
90
- formatDecimal
46
+ classes: l,
47
+ showSymbol: a,
48
+ checkPoint: o,
49
+ formatThousands: (e) => (Number(e) == 0 && (e = 0), o(e) ? (e = Number(e).toFixed(t.decimalDigits), e = typeof e.split(".") == "string" ? e.split(".") : e.split(".")[0]) : e = e.toString(), t.thousands ? (e || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") : e),
50
+ formatDecimal: (e) => {
51
+ Number(e) == 0 && (e = 0), o(e) ? (e = Number(e).toFixed(t.decimalDigits), e = typeof e.split(".") == "string" ? 0 : e.split(".")[1] ? e.split(".")[1] : 0) : e = 0;
52
+ const m = "0." + e, p = Number(m).toFixed(t.decimalDigits);
53
+ return String(p).substring(2, p.length);
54
+ }
91
55
  };
92
56
  }
93
- });
94
- const _hoisted_1 = ["innerHTML"];
95
- const _hoisted_2 = ["innerHTML"];
96
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
97
- return openBlock(), createElementBlock("view", {
98
- class: normalizeClass(_ctx.classes)
57
+ }), k = ["innerHTML"], w = ["innerHTML"];
58
+ function D(t, l, a, o, y, b) {
59
+ return r(), i("view", {
60
+ class: s(t.classes)
99
61
  }, [
100
- _ctx.needSymbol && _ctx.position == "before" ? (openBlock(), createElementBlock("view", {
62
+ t.needSymbol && t.position == "before" ? (r(), i("view", {
101
63
  key: 0,
102
- class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
103
- innerHTML: _ctx.showSymbol
104
- }, null, 10, _hoisted_1)) : createCommentVNode("", true),
105
- createElementVNode("view", {
106
- class: normalizeClass(`nut-price--${_ctx.size}`)
107
- }, toDisplayString(_ctx.formatThousands(_ctx.price)), 3),
108
- _ctx.decimalDigits != 0 ? (openBlock(), createElementBlock("view", {
64
+ class: s(["nut-price--symbol", `nut-price--symbol-${t.size}`]),
65
+ innerHTML: t.showSymbol
66
+ }, null, 10, k)) : n("", !0),
67
+ f("view", {
68
+ class: s(`nut-price--${t.size}`)
69
+ }, d(t.formatThousands(t.price)), 3),
70
+ t.decimalDigits != 0 ? (r(), i("view", {
109
71
  key: 1,
110
- class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
111
- }, ".", 2)) : createCommentVNode("", true),
112
- createElementVNode("view", {
113
- class: normalizeClass(`nut-price--decimal-${_ctx.size}`)
114
- }, toDisplayString(_ctx.formatDecimal(_ctx.price)), 3),
115
- _ctx.needSymbol && _ctx.position == "after" ? (openBlock(), createElementBlock("view", {
72
+ class: s(`nut-price--decimal-${t.size}`)
73
+ }, ".", 2)) : n("", !0),
74
+ f("view", {
75
+ class: s(`nut-price--decimal-${t.size}`)
76
+ }, d(t.formatDecimal(t.price)), 3),
77
+ t.needSymbol && t.position == "after" ? (r(), i("view", {
116
78
  key: 2,
117
- class: normalizeClass(["nut-price--symbol", `nut-price--symbol-${_ctx.size}`]),
118
- innerHTML: _ctx.showSymbol
119
- }, null, 10, _hoisted_2)) : createCommentVNode("", true)
79
+ class: s(["nut-price--symbol", `nut-price--symbol-${t.size}`]),
80
+ innerHTML: t.showSymbol
81
+ }, null, 10, w)) : n("", !0)
120
82
  ], 2);
121
83
  }
122
- const Price = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
84
+ const F = /* @__PURE__ */ h($, [["render", D]]);
123
85
  export {
124
- Price as default
86
+ F as default
125
87
  };