@nutui/nutui 4.0.11 → 4.0.12

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 (158) hide show
  1. package/dist/nutui.es.js +1 -1
  2. package/dist/nutui.js +2 -2
  3. package/dist/nutui.umd.js +1 -1
  4. package/dist/packages/_es/ActionSheet.js +111 -78
  5. package/dist/packages/_es/Address.js +375 -250
  6. package/dist/packages/_es/AddressList.js +354 -269
  7. package/dist/packages/_es/Animate.js +58 -41
  8. package/dist/packages/_es/Audio.js +197 -128
  9. package/dist/packages/_es/AudioOperate.js +71 -60
  10. package/dist/packages/_es/Avatar.js +89 -66
  11. package/dist/packages/_es/AvatarGroup.js +31 -23
  12. package/dist/packages/_es/Backtop.js +99 -59
  13. package/dist/packages/_es/Badge.js +47 -36
  14. package/dist/packages/_es/Barrage.js +147 -68
  15. package/dist/packages/_es/Button.js +66 -47
  16. package/dist/packages/_es/Calendar.js +157 -135
  17. package/dist/packages/_es/CalendarItem.js +6 -6
  18. package/dist/packages/_es/Card.js +56 -42
  19. package/dist/packages/_es/Cascader.js +474 -315
  20. package/dist/packages/_es/Category.js +39 -29
  21. package/dist/packages/_es/CategoryPane.js +83 -57
  22. package/dist/packages/_es/Cell.js +71 -56
  23. package/dist/packages/_es/CellGroup.js +27 -19
  24. package/dist/packages/_es/Checkbox.js +156 -109
  25. package/dist/packages/_es/CheckboxGroup.js +59 -38
  26. package/dist/packages/_es/CircleProgress.js +96 -67
  27. package/dist/packages/_es/Col.js +31 -23
  28. package/dist/packages/_es/Collapse.js +58 -33
  29. package/dist/packages/_es/CollapseItem.js +108 -78
  30. package/dist/packages/_es/Comment.js +279 -207
  31. package/dist/packages/_es/ConfigProvider.js +55 -37
  32. package/dist/packages/_es/Countdown.js +212 -100
  33. package/dist/packages/_es/Countup.js +445 -232
  34. package/dist/packages/_es/DatePicker.js +265 -162
  35. package/dist/packages/_es/Dialog.js +213 -161
  36. package/dist/packages/_es/Divider.js +57 -42
  37. package/dist/packages/_es/Drag.js +153 -70
  38. package/dist/packages/_es/Ecard.js +104 -64
  39. package/dist/packages/_es/Elevator.js +219 -143
  40. package/dist/packages/_es/Ellipsis.js +178 -95
  41. package/dist/packages/_es/Empty.js +39 -23
  42. package/dist/packages/_es/FixedNav.js +116 -93
  43. package/dist/packages/_es/Form.js +178 -107
  44. package/dist/packages/_es/FormItem.js +61 -48
  45. package/dist/packages/_es/Grid.js +6 -5
  46. package/dist/packages/_es/GridItem.js +84 -58
  47. package/dist/packages/_es/Image.js +130 -90
  48. package/dist/packages/_es/ImagePreview.js +412 -256
  49. package/dist/packages/_es/Indicator.js +34 -30
  50. package/dist/packages/_es/InfiniteLoading.js +136 -83
  51. package/dist/packages/_es/Input.js +264 -160
  52. package/dist/packages/_es/InputNumber.js +117 -81
  53. package/dist/packages/_es/Interceptor-956b24fc.js +29 -0
  54. package/dist/packages/_es/Invoice.js +130 -104
  55. package/dist/packages/_es/Layout.js +4 -3
  56. package/dist/packages/_es/List.js +215 -117
  57. package/dist/packages/_es/Menu.js +150 -95
  58. package/dist/packages/_es/MenuItem.js +154 -109
  59. package/dist/packages/_es/Navbar.js +119 -103
  60. package/dist/packages/_es/Noticebar.js +312 -197
  61. package/dist/packages/_es/Notify.js +166 -110
  62. package/dist/packages/_es/NumberKeyboard.js +202 -127
  63. package/dist/packages/_es/Overlay.js +80 -52
  64. package/dist/packages/_es/Pagination.js +100 -70
  65. package/dist/packages/_es/Picker.js +437 -275
  66. package/dist/packages/_es/Popover.js +225 -122
  67. package/dist/packages/_es/Popup.js +4 -4
  68. package/dist/packages/_es/Price.js +82 -44
  69. package/dist/packages/_es/Progress.js +79 -63
  70. package/dist/packages/_es/PullRefresh.js +173 -95
  71. package/dist/packages/_es/Radio.js +4 -4
  72. package/dist/packages/_es/RadioGroup.js +3 -3
  73. package/dist/packages/_es/Range.js +347 -204
  74. package/dist/packages/_es/Rate.js +141 -92
  75. package/dist/packages/_es/Row.js +27 -21
  76. package/dist/packages/_es/Searchbar.js +174 -123
  77. package/dist/packages/_es/ShortPassword.js +93 -69
  78. package/dist/packages/_es/SideNavbar.js +80 -49
  79. package/dist/packages/_es/SideNavbarItem.js +32 -22
  80. package/dist/packages/_es/Signature.js +146 -83
  81. package/dist/packages/_es/Skeleton.js +130 -110
  82. package/dist/packages/_es/Sku.js +343 -250
  83. package/dist/packages/_es/Step.js +86 -59
  84. package/dist/packages/_es/Steps.js +31 -26
  85. package/dist/packages/_es/Sticky.js +4 -4
  86. package/dist/packages/_es/SubSideNavbar.js +74 -52
  87. package/dist/packages/_es/Swipe.js +155 -83
  88. package/dist/packages/_es/Swiper.js +311 -174
  89. package/dist/packages/_es/SwiperItem.js +44 -28
  90. package/dist/packages/_es/Switch.js +68 -55
  91. package/dist/packages/_es/TabPane.js +41 -30
  92. package/dist/packages/_es/Tabbar.js +52 -41
  93. package/dist/packages/_es/TabbarItem.js +82 -61
  94. package/dist/packages/_es/Table.js +165 -109
  95. package/dist/packages/_es/Tabs.js +388 -240
  96. package/dist/packages/_es/Tag.js +61 -44
  97. package/dist/packages/_es/Textarea.js +124 -80
  98. package/dist/packages/_es/TimeDetail.js +76 -49
  99. package/dist/packages/_es/TimePannel.js +48 -34
  100. package/dist/packages/_es/TimeSelect.js +68 -47
  101. package/dist/packages/_es/Toast.js +218 -144
  102. package/dist/packages/_es/Tour.js +192 -138
  103. package/dist/packages/_es/TrendArrow.js +77 -57
  104. package/dist/packages/_es/Uploader.js +359 -234
  105. package/dist/packages/_es/Video.js +316 -191
  106. package/dist/packages/_es/Watermark.js +117 -84
  107. package/dist/packages/_es/_plugin-vue_export-helper-cc2b3d55.js +10 -0
  108. package/dist/packages/_es/common-b9a5e726.js +145 -0
  109. package/dist/packages/_es/component-81a4c1d0.js +145 -0
  110. package/dist/packages/_es/index-29892cda.js +33 -0
  111. package/dist/packages/_es/index-43c34ac6.js +30 -0
  112. package/dist/packages/_es/index-54d03fc1.js +8 -0
  113. package/dist/packages/_es/index-79c5dc33.js +10 -0
  114. package/dist/packages/_es/index-7a7385e4.js +67 -0
  115. package/dist/packages/_es/index-87422be8.js +942 -0
  116. package/dist/packages/_es/index-da0a7662.js +259 -0
  117. package/dist/packages/_es/index.vue_vue_type_script_lang-22dfc112.js +46 -0
  118. package/dist/packages/_es/index.vue_vue_type_script_lang-a8856969.js +97 -0
  119. package/dist/packages/_es/index.vue_vue_type_script_lang-cc5c4086.js +151 -0
  120. package/dist/packages/_es/mountComponent-8b24c346.js +39 -0
  121. package/dist/packages/_es/pxCheck-c6b9f6b7.js +6 -0
  122. package/dist/packages/_es/raf-729dad54.js +25 -0
  123. package/dist/packages/_es/renderIcon-3d0fd47c.js +9 -0
  124. package/dist/packages/locale/lang/baseLang-3a8457ac.js +5 -0
  125. package/dist/packages/locale/lang/en-US.js +39 -36
  126. package/dist/packages/locale/lang/id-ID.js +39 -36
  127. package/dist/packages/locale/lang/index.js +44 -22
  128. package/dist/packages/locale/lang/zh-CN.js +38 -35
  129. package/dist/packages/locale/lang/zh-TW.js +38 -35
  130. package/dist/resolver/index.js +26 -1
  131. package/dist/resolver/index.mjs +17 -14
  132. package/dist/smartips/web-types.json +1 -1
  133. package/dist/style.css +1 -1
  134. package/dist/styles/themes/default.scss +48 -48
  135. package/dist/styles/themes/jdb.scss +48 -48
  136. package/dist/styles/themes/jddkh.scss +48 -48
  137. package/dist/styles/themes/jdt.scss +48 -48
  138. package/dist/types/index.d.ts +1 -1
  139. package/package.json +3 -4
  140. package/dist/packages/_es/Interceptor-6e26b757.js +0 -18
  141. package/dist/packages/_es/_plugin-vue_export-helper-dad06003.js +0 -9
  142. package/dist/packages/_es/common-d218746f.js +0 -116
  143. package/dist/packages/_es/component-234624bc.js +0 -89
  144. package/dist/packages/_es/index-14dfadc4.js +0 -561
  145. package/dist/packages/_es/index-192a3ef6.js +0 -29
  146. package/dist/packages/_es/index-360c5092.js +0 -210
  147. package/dist/packages/_es/index-496e6e05.js +0 -24
  148. package/dist/packages/_es/index-50eed3d9.js +0 -7
  149. package/dist/packages/_es/index-53ec2d4d.js +0 -34
  150. package/dist/packages/_es/index-fadb0974.js +0 -8
  151. package/dist/packages/_es/index.vue_vue_type_script_lang-1139b29a.js +0 -43
  152. package/dist/packages/_es/index.vue_vue_type_script_lang-43b774dd.js +0 -77
  153. package/dist/packages/_es/index.vue_vue_type_script_lang-f44c159d.js +0 -110
  154. package/dist/packages/_es/mountComponent-6d4ff200.js +0 -23
  155. package/dist/packages/_es/pxCheck-38173291.js +0 -4
  156. package/dist/packages/_es/raf-a74f1a06.js +0 -16
  157. package/dist/packages/_es/renderIcon-47498b32.js +0 -5
  158. package/dist/packages/locale/lang/baseLang-0bdc6353.js +0 -5
@@ -1,36 +1,44 @@
1
- var te = Object.defineProperty, oe = Object.defineProperties;
2
- var le = Object.getOwnPropertyDescriptors;
3
- var F = Object.getOwnPropertySymbols;
4
- var ne = Object.prototype.hasOwnProperty, ae = Object.prototype.propertyIsEnumerable;
5
- var j = (e, o, v) => o in e ? te(e, o, { enumerable: !0, configurable: !0, writable: !0, value: v }) : e[o] = v, R = (e, o) => {
6
- for (var v in o || (o = {}))
7
- ne.call(o, v) && j(e, v, o[v]);
8
- if (F)
9
- for (var v of F(o))
10
- ae.call(o, v) && j(e, v, o[v]);
11
- return e;
12
- }, P = (e, o) => oe(e, le(o));
13
- import { ref as p, computed as re, reactive as ie, watch as q, toRefs as ce, nextTick as G, resolveComponent as g, openBlock as d, createBlock as de, withCtx as ue, createElementVNode as i, renderSlot as w, withDirectives as ve, createVNode as b, vShow as pe, toDisplayString as m, createElementBlock as u, Fragment as V, renderList as z, normalizeClass as B, createCommentVNode as _, normalizeStyle as fe, createTextVNode as me } from "vue";
14
- import { c as he } from "./component-234624bc.js";
15
- import { P as H, p as ye } from "./index-360c5092.js";
16
- import J from "./Elevator.js";
17
- import { Location as _e, Location2 as ke, Check as ge, Close as we, Left as be } from "@nutui/icons-vue";
18
- import { _ as Ae } from "./_plugin-vue_export-helper-dad06003.js";
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ import { ref, computed, reactive, watch, toRefs, nextTick, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, renderSlot, withDirectives, createVNode, vShow, toDisplayString, createElementBlock, Fragment, renderList, normalizeClass, createCommentVNode, normalizeStyle, createTextVNode } from "vue";
21
+ import { c as createComponent } from "./component-81a4c1d0.js";
22
+ import { P as Popup, p as popupProps } from "./index-da0a7662.js";
23
+ import Elevator from "./Elevator.js";
24
+ import { Location, Location2, Check, Close, Left } from "@nutui/icons-vue";
25
+ import { _ as _export_sfc } from "./_plugin-vue_export-helper-cc2b3d55.js";
19
26
  import "../locale/lang";
20
27
  import "./Overlay.js";
21
- import "./index-fadb0974.js";
22
- const { componentName: os, create: Ce, translate: K } = he("address"), Te = Ce({
28
+ import "./index-79c5dc33.js";
29
+ const { componentName, create, translate } = createComponent("address");
30
+ const _sfc_main = create({
23
31
  components: {
24
- Location: _e,
25
- Location2: ke,
26
- Check: ge,
27
- Close: we,
28
- Left: be,
29
- [H.name]: H,
30
- [J.name]: J
32
+ Location,
33
+ Location2,
34
+ Check,
35
+ Close,
36
+ Left,
37
+ [Popup.name]: Popup,
38
+ [Elevator.name]: Elevator
31
39
  },
32
- inheritAttrs: !1,
33
- props: P(R({}, ye), {
40
+ inheritAttrs: false,
41
+ props: __spreadProps(__spreadValues({}, popupProps), {
34
42
  modelValue: {
35
43
  type: Array,
36
44
  default: () => []
@@ -64,7 +72,7 @@ const { componentName: os, create: Ce, translate: K } = he("address"), Te = Ce({
64
72
  // 镇
65
73
  isShowCustomAddress: {
66
74
  type: Boolean,
67
- default: !0
75
+ default: true
68
76
  },
69
77
  existAddress: {
70
78
  type: Array,
@@ -88,322 +96,439 @@ const { componentName: os, create: Ce, translate: K } = he("address"), Te = Ce({
88
96
  }
89
97
  }),
90
98
  emits: ["update:visible", "update:modelValue", "type", "change", "selected", "close", "close-mask", "switch-module"],
91
- setup(e, { emit: o }) {
92
- const v = p(null), T = p(null), A = p(e.visible), h = p(e.type), c = p(0), C = p(0), k = p(["province", "city", "country", "town"]), E = p(null), S = p([0, 0, 0, 0]), $ = re(() => {
93
- switch (c.value) {
99
+ setup(props, { emit }) {
100
+ const regionLine = ref(null);
101
+ const tabRegion = ref(null);
102
+ const showPopup = ref(props.visible);
103
+ const privateType = ref(props.type);
104
+ const tabIndex = ref(0);
105
+ const prevTabIndex = ref(0);
106
+ const tabName = ref(["province", "city", "country", "town"]);
107
+ const scrollDom = ref(null);
108
+ const scrollDis = ref([0, 0, 0, 0]);
109
+ const regionList = computed(() => {
110
+ switch (tabIndex.value) {
94
111
  case 0:
95
- return e.province;
112
+ return props.province;
96
113
  case 1:
97
- return e.city;
114
+ return props.city;
98
115
  case 2:
99
- return e.country;
116
+ return props.country;
100
117
  default:
101
- return e.town;
118
+ return props.town;
102
119
  }
103
- }), l = (s) => {
104
- if (!Array.isArray(s))
120
+ });
121
+ const transformData = (data) => {
122
+ if (!Array.isArray(data))
105
123
  throw new TypeError("params muse be array.");
106
- if (!s.length)
124
+ if (!data.length)
107
125
  return [];
108
- s.forEach((n) => {
109
- if (!n.title) {
126
+ data.forEach((item) => {
127
+ if (!item.title) {
110
128
  console.warn("[NutUI] <Address> 请检查数组选项的 title 值是否有设置 ,title 为必填项 .");
111
129
  return;
112
130
  }
113
131
  });
114
- const t = [];
115
- return s = s.sort((n, a) => n.title.localeCompare(a.title)), s.forEach((n) => {
116
- const a = t.findIndex((I) => I.title === n.title);
117
- a <= -1 ? t.push({
118
- title: n.title,
119
- list: [].concat(n)
120
- }) : t[a].list.push(n);
121
- }), t;
132
+ const newData = [];
133
+ data = data.sort((a, b) => a.title.localeCompare(b.title));
134
+ data.forEach((item) => {
135
+ const index2 = newData.findIndex((value) => value.title === item.title);
136
+ if (index2 <= -1) {
137
+ newData.push({
138
+ title: item.title,
139
+ list: [].concat(item)
140
+ });
141
+ } else {
142
+ newData[index2].list.push(item);
143
+ }
144
+ });
145
+ return newData;
122
146
  };
123
- let r = p([]), y = ie({});
124
- const f = p("self"), N = p(20), M = () => {
125
- const s = e.modelValue, t = s.length;
126
- if (t > 0) {
127
- if (c.value = t - 1, $.value.length == 0) {
128
- c.value = 0;
147
+ let selectedRegion = ref([]);
148
+ let selectedExistAddress = reactive({});
149
+ const closeWay = ref("self");
150
+ const lineDistance = ref(20);
151
+ const initCustomSelected = () => {
152
+ const defaultValue = props.modelValue;
153
+ const num = defaultValue.length;
154
+ if (num > 0) {
155
+ tabIndex.value = num - 1;
156
+ if (regionList.value.length == 0) {
157
+ tabIndex.value = 0;
129
158
  return;
130
159
  }
131
- for (let n = 0; n < t; n++) {
132
- let a = [];
133
- switch (n) {
160
+ for (let index2 = 0; index2 < num; index2++) {
161
+ let arr = [];
162
+ switch (index2) {
134
163
  case 0:
135
- a = e.province;
164
+ arr = props.province;
136
165
  break;
137
166
  case 1:
138
- a = e.city;
167
+ arr = props.city;
139
168
  break;
140
169
  case 2:
141
- a = e.country;
170
+ arr = props.country;
142
171
  break;
143
172
  default:
144
- a = e.town;
173
+ arr = props.town;
145
174
  }
146
- r.value[n] = a.filter((I) => I.id == s[n])[0];
175
+ selectedRegion.value[index2] = arr.filter((item) => item.id == defaultValue[index2])[0];
147
176
  }
148
- L();
177
+ lineAnimation();
149
178
  }
150
- }, O = (s, t) => s && s.name || c.value < t && s ? s.name : e.columnsPlaceholder[t] || K("select"), L = () => {
151
- X(), G(() => {
152
- const s = T.value && T.value.getElementsByClassName("active")[0];
153
- if (s) {
154
- const t = s.offsetLeft;
155
- N.value = t || 20;
179
+ };
180
+ const getTabName = (item, index2) => {
181
+ if (item && item.name)
182
+ return item.name;
183
+ if (tabIndex.value < index2 && item) {
184
+ return item.name;
185
+ } else {
186
+ return props.columnsPlaceholder[index2] || translate("select");
187
+ }
188
+ };
189
+ const lineAnimation = () => {
190
+ scrollTo();
191
+ nextTick(() => {
192
+ const name = tabRegion.value && tabRegion.value.getElementsByClassName("active")[0];
193
+ if (name) {
194
+ const distance = name.offsetLeft;
195
+ lineDistance.value = distance ? distance : 20;
156
196
  }
157
197
  });
158
- }, U = (s) => {
159
- const t = c.value;
160
- C.value = c.value;
161
- const n = {
162
- custom: k.value[t]
198
+ };
199
+ const nextAreaList = (item) => {
200
+ const tab = tabIndex.value;
201
+ prevTabIndex.value = tabIndex.value;
202
+ const callBackParams = {
203
+ custom: tabName.value[tab]
163
204
  };
164
- r.value[t] = s;
165
- for (let a = t + 2; a < 4; a++)
166
- r.value.splice(a, 1);
167
- t < 3 ? (c.value = t + 1, L(), n.next = k.value[c.value], n.value = s, o("change", n)) : (D(), o("update:modelValue"));
168
- }, Q = (s, t) => {
169
- C.value = c.value, O(s, t) && (c.value = t, L());
170
- }, X = () => {
171
- const s = E.value, t = C.value, n = S.value[c.value];
172
- s != null && s.scrollTop && (S.value[t] = s == null ? void 0 : s.scrollTop), G(() => {
173
- s == null || s.scrollTo({
174
- top: n,
205
+ selectedRegion.value[tab] = item;
206
+ for (let i = tab + 2; i < 4; i++) {
207
+ selectedRegion.value.splice(i, 1);
208
+ }
209
+ if (tab < 3) {
210
+ tabIndex.value = tab + 1;
211
+ lineAnimation();
212
+ callBackParams.next = tabName.value[tabIndex.value];
213
+ callBackParams.value = item;
214
+ emit("change", callBackParams);
215
+ } else {
216
+ handClose();
217
+ emit("update:modelValue");
218
+ }
219
+ };
220
+ const changeRegionTab = (item, index2) => {
221
+ prevTabIndex.value = tabIndex.value;
222
+ if (getTabName(item, index2)) {
223
+ tabIndex.value = index2;
224
+ lineAnimation();
225
+ }
226
+ };
227
+ const scrollTo = () => {
228
+ const dom = scrollDom.value;
229
+ const prev = prevTabIndex.value;
230
+ const cur = scrollDis.value[tabIndex.value];
231
+ (dom == null ? void 0 : dom.scrollTop) && (scrollDis.value[prev] = dom == null ? void 0 : dom.scrollTop);
232
+ nextTick(() => {
233
+ dom == null ? void 0 : dom.scrollTo({
234
+ top: cur,
175
235
  behavior: "auto"
176
236
  });
177
237
  });
178
- }, Y = (s) => {
179
- const t = e.existAddress;
180
- let n = {};
181
- t.forEach((a) => {
182
- a && a.selectedAddress && (n = a), a.selectedAddress = !1;
183
- }), s.selectedAddress = !0, y = s, o("selected", n, s, t), D();
184
- }, W = () => {
185
- r.value = [], c.value = 0, L();
186
- }, D = (s = "self") => {
187
- f.value = s == "cross" ? "cross" : "self", A.value = !1;
188
- }, Z = () => {
189
- f.value = "mask";
190
- }, x = () => {
191
- const s = {
238
+ };
239
+ const selectedExist = (item) => {
240
+ const copyExistAdd = props.existAddress;
241
+ let prevExistAdd = {};
242
+ copyExistAdd.forEach((list) => {
243
+ if (list && list.selectedAddress)
244
+ prevExistAdd = list;
245
+ list.selectedAddress = false;
246
+ });
247
+ item.selectedAddress = true;
248
+ selectedExistAddress = item;
249
+ emit("selected", prevExistAdd, item, copyExistAdd);
250
+ handClose();
251
+ };
252
+ const initAddress = () => {
253
+ selectedRegion.value = [];
254
+ tabIndex.value = 0;
255
+ lineAnimation();
256
+ };
257
+ const handClose = (type = "self") => {
258
+ closeWay.value = type == "cross" ? "cross" : "self";
259
+ showPopup.value = false;
260
+ };
261
+ const clickOverlay = () => {
262
+ closeWay.value = "mask";
263
+ };
264
+ const close = () => {
265
+ const data = {
192
266
  addressIdStr: "",
193
267
  addressStr: "",
194
- province: r.value[0],
195
- city: r.value[1],
196
- country: r.value[2],
197
- town: r.value[3]
198
- }, t = {
268
+ province: selectedRegion.value[0],
269
+ city: selectedRegion.value[1],
270
+ country: selectedRegion.value[2],
271
+ town: selectedRegion.value[3]
272
+ };
273
+ const callBackParams = {
199
274
  data: {},
200
- type: h.value
275
+ type: privateType.value
201
276
  };
202
- ["custom", "custom2"].includes(h.value) ? ([0, 1, 2, 3].forEach((n) => {
203
- const a = r.value[n];
204
- s.addressIdStr += `${n ? "_" : ""}${a && a.id || 0}`, s.addressStr += a && a.name || "";
205
- }), t.data = s) : t.data = y, W(), f.value == "self" ? o("close", t) : o("close-mask", { closeWay: f }), o("update:visible", !1);
206
- }, ee = () => {
207
- const s = h.value;
208
- h.value = s == "exist" ? "custom" : "exist", W(), o("switch-module", { type: h.value });
209
- }, se = (s, t) => {
210
- U(t);
277
+ if (["custom", "custom2"].includes(privateType.value)) {
278
+ [0, 1, 2, 3].forEach((i) => {
279
+ const item = selectedRegion.value[i];
280
+ data.addressIdStr += `${i ? "_" : ""}${item && item.id || 0}`;
281
+ data.addressStr += item && item.name || "";
282
+ });
283
+ callBackParams.data = data;
284
+ } else {
285
+ callBackParams.data = selectedExistAddress;
286
+ }
287
+ initAddress();
288
+ if (closeWay.value == "self") {
289
+ emit("close", callBackParams);
290
+ } else {
291
+ emit("close-mask", { closeWay });
292
+ }
293
+ emit("update:visible", false);
294
+ };
295
+ const switchModule = () => {
296
+ const type = privateType.value;
297
+ privateType.value = type == "exist" ? "custom" : "exist";
298
+ initAddress();
299
+ emit("switch-module", { type: privateType.value });
211
300
  };
212
- return q(
213
- () => e.visible,
214
- (s) => {
215
- A.value = s;
301
+ const handleElevatorItem = (key, item) => {
302
+ nextAreaList(item);
303
+ };
304
+ watch(
305
+ () => props.visible,
306
+ (value) => {
307
+ showPopup.value = value;
216
308
  }
217
- ), q(
218
- () => A.value,
219
- (s) => {
220
- s && M();
309
+ );
310
+ watch(
311
+ () => showPopup.value,
312
+ (value) => {
313
+ if (value) {
314
+ initCustomSelected();
315
+ }
221
316
  }
222
- ), P(R({
223
- showPopup: A,
224
- privateType: h,
225
- tabIndex: c,
226
- tabName: k,
227
- selectedRegion: r,
228
- switchModule: ee,
229
- closeWay: f,
230
- close: x,
231
- getTabName: O,
232
- nextAreaList: U,
233
- regionLine: v,
234
- tabRegion: T,
235
- lineDistance: N,
236
- changeRegionTab: Q,
237
- selectedExist: Y,
238
- clickOverlay: Z,
239
- handClose: D,
240
- handleElevatorItem: se,
241
- initCustomSelected: M
242
- }, ce(e)), {
243
- translate: K,
244
- regionList: $,
245
- transformData: l,
246
- scrollDom: E
317
+ );
318
+ return __spreadProps(__spreadValues({
319
+ showPopup,
320
+ privateType,
321
+ tabIndex,
322
+ tabName,
323
+ selectedRegion,
324
+ switchModule,
325
+ closeWay,
326
+ close,
327
+ getTabName,
328
+ nextAreaList,
329
+ regionLine,
330
+ tabRegion,
331
+ lineDistance,
332
+ changeRegionTab,
333
+ selectedExist,
334
+ clickOverlay,
335
+ handClose,
336
+ handleElevatorItem,
337
+ initCustomSelected
338
+ }, toRefs(props)), {
339
+ translate,
340
+ regionList,
341
+ transformData,
342
+ scrollDom
247
343
  });
248
344
  }
249
- }), Ee = { class: "nut-address" }, Se = { class: "nut-address__header" }, $e = { class: "nut-address__header__title" }, Le = {
345
+ });
346
+ const _hoisted_1 = { class: "nut-address" };
347
+ const _hoisted_2 = { class: "nut-address__header" };
348
+ const _hoisted_3 = { class: "nut-address__header__title" };
349
+ const _hoisted_4 = {
250
350
  key: 0,
251
351
  class: "nut-address__custom"
252
- }, Ne = {
352
+ };
353
+ const _hoisted_5 = {
253
354
  class: "nut-address__region",
254
355
  ref: "tabRegion"
255
- }, De = ["onClick"], Ie = {
356
+ };
357
+ const _hoisted_6 = ["onClick"];
358
+ const _hoisted_7 = {
256
359
  key: 0,
257
360
  class: "active nut-address__region-item"
258
- }, Re = {
361
+ };
362
+ const _hoisted_8 = {
259
363
  key: 0,
260
364
  class: "nut-address__detail"
261
- }, Pe = {
365
+ };
366
+ const _hoisted_9 = {
262
367
  class: "nut-address__detail-list",
263
368
  ref: "scrollDom"
264
- }, Ve = ["onClick"], ze = {
369
+ };
370
+ const _hoisted_10 = ["onClick"];
371
+ const _hoisted_11 = {
265
372
  key: 1,
266
373
  class: "nut-address__elevator-group"
267
- }, Be = {
374
+ };
375
+ const _hoisted_12 = {
268
376
  key: 1,
269
377
  class: "nut-address__exist"
270
- }, Me = { class: "nut-address__exist-group" }, Oe = { class: "nut-address__exist-group-list" }, Ue = ["onClick"], We = { class: "nut-address__exist-item-info" }, Fe = {
378
+ };
379
+ const _hoisted_13 = { class: "nut-address__exist-group" };
380
+ const _hoisted_14 = { class: "nut-address__exist-group-list" };
381
+ const _hoisted_15 = ["onClick"];
382
+ const _hoisted_16 = { class: "nut-address__exist-item-info" };
383
+ const _hoisted_17 = {
271
384
  key: 0,
272
385
  class: "nut-address__exist-item-info-name"
273
- }, je = {
386
+ };
387
+ const _hoisted_18 = {
274
388
  key: 1,
275
389
  class: "nut-address__exist-item-info-phone"
276
- }, qe = { class: "nut-address__exist-item-info-bottom" }, Ge = { class: "nut-address__exist-choose-btn" };
277
- function He(e, o, v, T, A, h) {
278
- const c = g("Left"), C = g("Close"), k = g("Check"), E = g("nut-elevator"), S = g("Location2"), $ = g("nut-popup");
279
- return d(), de($, {
390
+ };
391
+ const _hoisted_19 = { class: "nut-address__exist-item-info-bottom" };
392
+ const _hoisted_20 = { class: "nut-address__exist-choose-btn" };
393
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
394
+ const _component_Left = resolveComponent("Left");
395
+ const _component_Close = resolveComponent("Close");
396
+ const _component_Check = resolveComponent("Check");
397
+ const _component_nut_elevator = resolveComponent("nut-elevator");
398
+ const _component_Location2 = resolveComponent("Location2");
399
+ const _component_nut_popup = resolveComponent("nut-popup");
400
+ return openBlock(), createBlock(_component_nut_popup, {
280
401
  position: "bottom",
281
- "lock-scroll": e.lockScroll,
282
- onClose: e.close,
283
- onClickOverlay: e.clickOverlay,
284
- onOpen: o[3] || (o[3] = (l) => e.closeWay = "self"),
285
- visible: e.showPopup,
286
- "onUpdate:visible": o[4] || (o[4] = (l) => e.showPopup = l),
287
- teleportDisable: e.teleportDisable,
288
- teleport: e.teleport
402
+ "lock-scroll": _ctx.lockScroll,
403
+ onClose: _ctx.close,
404
+ onClickOverlay: _ctx.clickOverlay,
405
+ onOpen: _cache[3] || (_cache[3] = ($event) => _ctx.closeWay = "self"),
406
+ visible: _ctx.showPopup,
407
+ "onUpdate:visible": _cache[4] || (_cache[4] = ($event) => _ctx.showPopup = $event),
408
+ teleportDisable: _ctx.teleportDisable,
409
+ teleport: _ctx.teleport
289
410
  }, {
290
- default: ue(() => [
291
- i("view", Ee, [
292
- i("view", Se, [
293
- i("view", {
411
+ default: withCtx(() => [
412
+ createElementVNode("view", _hoisted_1, [
413
+ createElementVNode("view", _hoisted_2, [
414
+ createElementVNode("view", {
294
415
  class: "nut-address__header-back",
295
- onClick: o[0] || (o[0] = (...l) => e.switchModule && e.switchModule(...l))
416
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.switchModule && _ctx.switchModule(...args))
296
417
  }, [
297
- w(e.$slots, "back-icon", {}, () => [
298
- ve(b(c, { size: "14px" }, null, 512), [
299
- [pe, e.type == "exist" && e.privateType == "custom"]
418
+ renderSlot(_ctx.$slots, "back-icon", {}, () => [
419
+ withDirectives(createVNode(_component_Left, { size: "14px" }, null, 512), [
420
+ [vShow, _ctx.type == "exist" && _ctx.privateType == "custom"]
300
421
  ])
301
422
  ])
302
423
  ]),
303
- i("view", $e, m(e.privateType == "custom" ? e.customAddressTitle || e.translate("selectRegion") : e.existAddressTitle || e.translate("deliveryTo")), 1),
304
- i("view", {
424
+ createElementVNode("view", _hoisted_3, toDisplayString(_ctx.privateType == "custom" ? _ctx.customAddressTitle || _ctx.translate("selectRegion") : _ctx.existAddressTitle || _ctx.translate("deliveryTo")), 1),
425
+ createElementVNode("view", {
305
426
  class: "nut-address__header-close",
306
- onClick: o[1] || (o[1] = (l) => e.handClose("cross"))
427
+ onClick: _cache[1] || (_cache[1] = ($event) => _ctx.handClose("cross"))
307
428
  }, [
308
- w(e.$slots, "close-icon", {}, () => [
309
- b(C, {
429
+ renderSlot(_ctx.$slots, "close-icon", {}, () => [
430
+ createVNode(_component_Close, {
310
431
  color: "#cccccc",
311
432
  size: "14px"
312
433
  })
313
434
  ])
314
435
  ])
315
436
  ]),
316
- ["custom", "custom2"].includes(e.privateType) ? (d(), u("view", Le, [
317
- i("view", Ne, [
318
- (d(!0), u(V, null, z(e.selectedRegion, (l, r) => (d(), u("view", {
319
- class: B(["nut-address__region-item", r == e.tabIndex ? "active" : ""]),
320
- key: r,
321
- onClick: (y) => e.changeRegionTab(l, r)
322
- }, [
323
- i("view", null, m(e.getTabName(l, r)), 1)
324
- ], 10, De))), 128)),
325
- e.tabIndex == e.selectedRegion.length ? (d(), u("view", Ie, [
326
- i("view", null, m(e.getTabName(null, e.selectedRegion.length)), 1)
327
- ])) : _("", !0),
328
- i("view", {
437
+ ["custom", "custom2"].includes(_ctx.privateType) ? (openBlock(), createElementBlock("view", _hoisted_4, [
438
+ createElementVNode("view", _hoisted_5, [
439
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedRegion, (item, index2) => {
440
+ return openBlock(), createElementBlock("view", {
441
+ class: normalizeClass(["nut-address__region-item", index2 == _ctx.tabIndex ? "active" : ""]),
442
+ key: index2,
443
+ onClick: ($event) => _ctx.changeRegionTab(item, index2)
444
+ }, [
445
+ createElementVNode("view", null, toDisplayString(_ctx.getTabName(item, index2)), 1)
446
+ ], 10, _hoisted_6);
447
+ }), 128)),
448
+ _ctx.tabIndex == _ctx.selectedRegion.length ? (openBlock(), createElementBlock("view", _hoisted_7, [
449
+ createElementVNode("view", null, toDisplayString(_ctx.getTabName(null, _ctx.selectedRegion.length)), 1)
450
+ ])) : createCommentVNode("", true),
451
+ createElementVNode("view", {
329
452
  class: "nut-address__region-line",
330
453
  ref: "regionLine",
331
- style: fe({ left: e.lineDistance + "px" })
454
+ style: normalizeStyle({ left: _ctx.lineDistance + "px" })
332
455
  }, null, 4)
333
456
  ], 512),
334
- e.privateType == "custom" ? (d(), u("view", Re, [
335
- i("ul", Pe, [
336
- (d(!0), u(V, null, z(e.regionList, (l, r) => {
337
- var y, f;
338
- return d(), u("li", {
339
- key: r,
340
- class: B(["nut-address__detail-item", ((y = e.selectedRegion[e.tabIndex]) == null ? void 0 : y.id) == l.id ? "active" : ""]),
341
- onClick: (N) => e.nextAreaList(l)
457
+ _ctx.privateType == "custom" ? (openBlock(), createElementBlock("view", _hoisted_8, [
458
+ createElementVNode("ul", _hoisted_9, [
459
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.regionList, (item, index2) => {
460
+ var _a, _b;
461
+ return openBlock(), createElementBlock("li", {
462
+ key: index2,
463
+ class: normalizeClass(["nut-address__detail-item", ((_a = _ctx.selectedRegion[_ctx.tabIndex]) == null ? void 0 : _a.id) == item.id ? "active" : ""]),
464
+ onClick: ($event) => _ctx.nextAreaList(item)
342
465
  }, [
343
- i("div", null, [
344
- ((f = e.selectedRegion[e.tabIndex]) == null ? void 0 : f.id) == l.id ? w(e.$slots, "icon", { key: 0 }, () => [
345
- b(k, {
466
+ createElementVNode("div", null, [
467
+ ((_b = _ctx.selectedRegion[_ctx.tabIndex]) == null ? void 0 : _b.id) == item.id ? renderSlot(_ctx.$slots, "icon", { key: 0 }, () => [
468
+ createVNode(_component_Check, {
346
469
  class: "nut-address-select-icon",
347
470
  size: "13px"
348
471
  })
349
- ]) : _("", !0),
350
- me(m(l.name), 1)
472
+ ]) : createCommentVNode("", true),
473
+ createTextVNode(toDisplayString(item.name), 1)
351
474
  ])
352
- ], 10, Ve);
475
+ ], 10, _hoisted_10);
353
476
  }), 128))
354
477
  ], 512)
355
- ])) : (d(), u("view", ze, [
356
- b(E, {
357
- height: e.height,
358
- "index-list": e.transformData(e.regionList),
359
- onClickItem: e.handleElevatorItem
478
+ ])) : (openBlock(), createElementBlock("view", _hoisted_11, [
479
+ createVNode(_component_nut_elevator, {
480
+ height: _ctx.height,
481
+ "index-list": _ctx.transformData(_ctx.regionList),
482
+ onClickItem: _ctx.handleElevatorItem
360
483
  }, null, 8, ["height", "index-list", "onClickItem"])
361
484
  ]))
362
- ])) : (d(), u("view", Be, [
363
- i("div", Me, [
364
- i("ul", Oe, [
365
- (d(!0), u(V, null, z(e.existAddress, (l, r) => (d(), u("li", {
366
- class: B(["nut-address__exist-group-item", l.selectedAddress ? "active" : ""]),
367
- key: r,
368
- onClick: (y) => e.selectedExist(l)
369
- }, [
370
- l.selectedAddress ? _("", !0) : w(e.$slots, "unselected-icon", { key: 0 }, () => [
371
- b(S, {
372
- class: "nut-address-select-icon",
373
- size: "13px"
374
- })
375
- ]),
376
- l.selectedAddress ? w(e.$slots, "icon", { key: 1 }, () => [
377
- b(k, {
378
- class: "nut-address-select-icon",
379
- size: "13px"
380
- })
381
- ]) : _("", !0),
382
- i("div", We, [
383
- l.name ? (d(), u("div", Fe, m(l.name), 1)) : _("", !0),
384
- l.phone ? (d(), u("div", je, m(l.phone), 1)) : _("", !0),
385
- i("div", qe, [
386
- i("view", null, m(l.provinceName + l.cityName + l.countyName + l.townName + l.addressDetail), 1)
485
+ ])) : (openBlock(), createElementBlock("view", _hoisted_12, [
486
+ createElementVNode("div", _hoisted_13, [
487
+ createElementVNode("ul", _hoisted_14, [
488
+ (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.existAddress, (item, index2) => {
489
+ return openBlock(), createElementBlock("li", {
490
+ class: normalizeClass(["nut-address__exist-group-item", item.selectedAddress ? "active" : ""]),
491
+ key: index2,
492
+ onClick: ($event) => _ctx.selectedExist(item)
493
+ }, [
494
+ !item.selectedAddress ? renderSlot(_ctx.$slots, "unselected-icon", { key: 0 }, () => [
495
+ createVNode(_component_Location2, {
496
+ class: "nut-address-select-icon",
497
+ size: "13px"
498
+ })
499
+ ]) : createCommentVNode("", true),
500
+ item.selectedAddress ? renderSlot(_ctx.$slots, "icon", { key: 1 }, () => [
501
+ createVNode(_component_Check, {
502
+ class: "nut-address-select-icon",
503
+ size: "13px"
504
+ })
505
+ ]) : createCommentVNode("", true),
506
+ createElementVNode("div", _hoisted_16, [
507
+ item.name ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(item.name), 1)) : createCommentVNode("", true),
508
+ item.phone ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(item.phone), 1)) : createCommentVNode("", true),
509
+ createElementVNode("div", _hoisted_19, [
510
+ createElementVNode("view", null, toDisplayString(item.provinceName + item.cityName + item.countyName + item.townName + item.addressDetail), 1)
511
+ ])
387
512
  ])
388
- ])
389
- ], 10, Ue))), 128))
513
+ ], 10, _hoisted_15);
514
+ }), 128))
390
515
  ])
391
516
  ]),
392
- e.isShowCustomAddress ? (d(), u("div", {
517
+ _ctx.isShowCustomAddress ? (openBlock(), createElementBlock("div", {
393
518
  key: 0,
394
519
  class: "nut-address__exist-choose",
395
- onClick: o[2] || (o[2] = (...l) => e.switchModule && e.switchModule(...l))
520
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.switchModule && _ctx.switchModule(...args))
396
521
  }, [
397
- i("div", Ge, m(e.customAndExistTitle || e.translate("chooseAnotherAddress")), 1)
398
- ])) : _("", !0)
522
+ createElementVNode("div", _hoisted_20, toDisplayString(_ctx.customAndExistTitle || _ctx.translate("chooseAnotherAddress")), 1)
523
+ ])) : createCommentVNode("", true)
399
524
  ])),
400
- w(e.$slots, "bottom")
525
+ renderSlot(_ctx.$slots, "bottom")
401
526
  ])
402
527
  ]),
403
528
  _: 3
404
529
  }, 8, ["lock-scroll", "onClose", "onClickOverlay", "visible", "teleportDisable", "teleport"]);
405
530
  }
406
- const ls = /* @__PURE__ */ Ae(Te, [["render", He]]);
531
+ const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
407
532
  export {
408
- ls as default
533
+ index as default
409
534
  };