@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,44 +1,36 @@
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";
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";
26
19
  import "../locale/lang";
27
20
  import "./Overlay.js";
28
- import "./index-79c5dc33.js";
29
- const { componentName, create, translate } = createComponent("address");
30
- const _sfc_main = create({
21
+ import "./index-fadb0974.js";
22
+ const { componentName: os, create: Ce, translate: K } = he("address"), Te = Ce({
31
23
  components: {
32
- Location,
33
- Location2,
34
- Check,
35
- Close,
36
- Left,
37
- [Popup.name]: Popup,
38
- [Elevator.name]: Elevator
24
+ Location: _e,
25
+ Location2: ke,
26
+ Check: ge,
27
+ Close: we,
28
+ Left: be,
29
+ [H.name]: H,
30
+ [J.name]: J
39
31
  },
40
- inheritAttrs: false,
41
- props: __spreadProps(__spreadValues({}, popupProps), {
32
+ inheritAttrs: !1,
33
+ props: P(R({}, ye), {
42
34
  modelValue: {
43
35
  type: Array,
44
36
  default: () => []
@@ -72,7 +64,7 @@ const _sfc_main = create({
72
64
  // 镇
73
65
  isShowCustomAddress: {
74
66
  type: Boolean,
75
- default: true
67
+ default: !0
76
68
  },
77
69
  existAddress: {
78
70
  type: Array,
@@ -96,439 +88,322 @@ const _sfc_main = create({
96
88
  }
97
89
  }),
98
90
  emits: ["update:visible", "update:modelValue", "type", "change", "selected", "close", "close-mask", "switch-module"],
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) {
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) {
111
94
  case 0:
112
- return props.province;
95
+ return e.province;
113
96
  case 1:
114
- return props.city;
97
+ return e.city;
115
98
  case 2:
116
- return props.country;
99
+ return e.country;
117
100
  default:
118
- return props.town;
101
+ return e.town;
119
102
  }
120
- });
121
- const transformData = (data) => {
122
- if (!Array.isArray(data))
103
+ }), l = (s) => {
104
+ if (!Array.isArray(s))
123
105
  throw new TypeError("params muse be array.");
124
- if (!data.length)
106
+ if (!s.length)
125
107
  return [];
126
- data.forEach((item) => {
127
- if (!item.title) {
108
+ s.forEach((n) => {
109
+ if (!n.title) {
128
110
  console.warn("[NutUI] <Address> 请检查数组选项的 title 值是否有设置 ,title 为必填项 .");
129
111
  return;
130
112
  }
131
113
  });
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;
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;
146
122
  };
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;
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;
158
129
  return;
159
130
  }
160
- for (let index2 = 0; index2 < num; index2++) {
161
- let arr = [];
162
- switch (index2) {
131
+ for (let n = 0; n < t; n++) {
132
+ let a = [];
133
+ switch (n) {
163
134
  case 0:
164
- arr = props.province;
135
+ a = e.province;
165
136
  break;
166
137
  case 1:
167
- arr = props.city;
138
+ a = e.city;
168
139
  break;
169
140
  case 2:
170
- arr = props.country;
141
+ a = e.country;
171
142
  break;
172
143
  default:
173
- arr = props.town;
144
+ a = e.town;
174
145
  }
175
- selectedRegion.value[index2] = arr.filter((item) => item.id == defaultValue[index2])[0];
146
+ r.value[n] = a.filter((I) => I.id == s[n])[0];
176
147
  }
177
- lineAnimation();
148
+ L();
178
149
  }
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;
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;
196
156
  }
197
157
  });
198
- };
199
- const nextAreaList = (item) => {
200
- const tab = tabIndex.value;
201
- prevTabIndex.value = tabIndex.value;
202
- const callBackParams = {
203
- custom: tabName.value[tab]
158
+ }, U = (s) => {
159
+ const t = c.value;
160
+ C.value = c.value;
161
+ const n = {
162
+ custom: k.value[t]
204
163
  };
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,
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,
235
175
  behavior: "auto"
236
176
  });
237
177
  });
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 = {
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 = {
266
192
  addressIdStr: "",
267
193
  addressStr: "",
268
- province: selectedRegion.value[0],
269
- city: selectedRegion.value[1],
270
- country: selectedRegion.value[2],
271
- town: selectedRegion.value[3]
272
- };
273
- const callBackParams = {
194
+ province: r.value[0],
195
+ city: r.value[1],
196
+ country: r.value[2],
197
+ town: r.value[3]
198
+ }, t = {
274
199
  data: {},
275
- type: privateType.value
200
+ type: h.value
276
201
  };
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 });
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);
300
211
  };
301
- const handleElevatorItem = (key, item) => {
302
- nextAreaList(item);
303
- };
304
- watch(
305
- () => props.visible,
306
- (value) => {
307
- showPopup.value = value;
212
+ return q(
213
+ () => e.visible,
214
+ (s) => {
215
+ A.value = s;
308
216
  }
309
- );
310
- watch(
311
- () => showPopup.value,
312
- (value) => {
313
- if (value) {
314
- initCustomSelected();
315
- }
217
+ ), q(
218
+ () => A.value,
219
+ (s) => {
220
+ s && M();
316
221
  }
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
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
343
247
  });
344
248
  }
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 = {
249
+ }), Ee = { class: "nut-address" }, Se = { class: "nut-address__header" }, $e = { class: "nut-address__header__title" }, Le = {
350
250
  key: 0,
351
251
  class: "nut-address__custom"
352
- };
353
- const _hoisted_5 = {
252
+ }, Ne = {
354
253
  class: "nut-address__region",
355
254
  ref: "tabRegion"
356
- };
357
- const _hoisted_6 = ["onClick"];
358
- const _hoisted_7 = {
255
+ }, De = ["onClick"], Ie = {
359
256
  key: 0,
360
257
  class: "active nut-address__region-item"
361
- };
362
- const _hoisted_8 = {
258
+ }, Re = {
363
259
  key: 0,
364
260
  class: "nut-address__detail"
365
- };
366
- const _hoisted_9 = {
261
+ }, Pe = {
367
262
  class: "nut-address__detail-list",
368
263
  ref: "scrollDom"
369
- };
370
- const _hoisted_10 = ["onClick"];
371
- const _hoisted_11 = {
264
+ }, Ve = ["onClick"], ze = {
372
265
  key: 1,
373
266
  class: "nut-address__elevator-group"
374
- };
375
- const _hoisted_12 = {
267
+ }, Be = {
376
268
  key: 1,
377
269
  class: "nut-address__exist"
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 = {
270
+ }, Me = { class: "nut-address__exist-group" }, Oe = { class: "nut-address__exist-group-list" }, Ue = ["onClick"], We = { class: "nut-address__exist-item-info" }, Fe = {
384
271
  key: 0,
385
272
  class: "nut-address__exist-item-info-name"
386
- };
387
- const _hoisted_18 = {
273
+ }, je = {
388
274
  key: 1,
389
275
  class: "nut-address__exist-item-info-phone"
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, {
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($, {
401
280
  position: "bottom",
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
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
410
289
  }, {
411
- default: withCtx(() => [
412
- createElementVNode("view", _hoisted_1, [
413
- createElementVNode("view", _hoisted_2, [
414
- createElementVNode("view", {
290
+ default: ue(() => [
291
+ i("view", Ee, [
292
+ i("view", Se, [
293
+ i("view", {
415
294
  class: "nut-address__header-back",
416
- onClick: _cache[0] || (_cache[0] = (...args) => _ctx.switchModule && _ctx.switchModule(...args))
295
+ onClick: o[0] || (o[0] = (...l) => e.switchModule && e.switchModule(...l))
417
296
  }, [
418
- renderSlot(_ctx.$slots, "back-icon", {}, () => [
419
- withDirectives(createVNode(_component_Left, { size: "14px" }, null, 512), [
420
- [vShow, _ctx.type == "exist" && _ctx.privateType == "custom"]
297
+ w(e.$slots, "back-icon", {}, () => [
298
+ ve(b(c, { size: "14px" }, null, 512), [
299
+ [pe, e.type == "exist" && e.privateType == "custom"]
421
300
  ])
422
301
  ])
423
302
  ]),
424
- createElementVNode("view", _hoisted_3, toDisplayString(_ctx.privateType == "custom" ? _ctx.customAddressTitle || _ctx.translate("selectRegion") : _ctx.existAddressTitle || _ctx.translate("deliveryTo")), 1),
425
- createElementVNode("view", {
303
+ i("view", $e, m(e.privateType == "custom" ? e.customAddressTitle || e.translate("selectRegion") : e.existAddressTitle || e.translate("deliveryTo")), 1),
304
+ i("view", {
426
305
  class: "nut-address__header-close",
427
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.handClose("cross"))
306
+ onClick: o[1] || (o[1] = (l) => e.handClose("cross"))
428
307
  }, [
429
- renderSlot(_ctx.$slots, "close-icon", {}, () => [
430
- createVNode(_component_Close, {
308
+ w(e.$slots, "close-icon", {}, () => [
309
+ b(C, {
431
310
  color: "#cccccc",
432
311
  size: "14px"
433
312
  })
434
313
  ])
435
314
  ])
436
315
  ]),
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", {
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", {
452
329
  class: "nut-address__region-line",
453
330
  ref: "regionLine",
454
- style: normalizeStyle({ left: _ctx.lineDistance + "px" })
331
+ style: fe({ left: e.lineDistance + "px" })
455
332
  }, null, 4)
456
333
  ], 512),
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)
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)
465
342
  }, [
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, {
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, {
469
346
  class: "nut-address-select-icon",
470
347
  size: "13px"
471
348
  })
472
- ]) : createCommentVNode("", true),
473
- createTextVNode(toDisplayString(item.name), 1)
349
+ ]) : _("", !0),
350
+ me(m(l.name), 1)
474
351
  ])
475
- ], 10, _hoisted_10);
352
+ ], 10, Ve);
476
353
  }), 128))
477
354
  ], 512)
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
355
+ ])) : (d(), u("view", ze, [
356
+ b(E, {
357
+ height: e.height,
358
+ "index-list": e.transformData(e.regionList),
359
+ onClickItem: e.handleElevatorItem
483
360
  }, null, 8, ["height", "index-list", "onClickItem"])
484
361
  ]))
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
- ])
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)
512
387
  ])
513
- ], 10, _hoisted_15);
514
- }), 128))
388
+ ])
389
+ ], 10, Ue))), 128))
515
390
  ])
516
391
  ]),
517
- _ctx.isShowCustomAddress ? (openBlock(), createElementBlock("div", {
392
+ e.isShowCustomAddress ? (d(), u("div", {
518
393
  key: 0,
519
394
  class: "nut-address__exist-choose",
520
- onClick: _cache[2] || (_cache[2] = (...args) => _ctx.switchModule && _ctx.switchModule(...args))
395
+ onClick: o[2] || (o[2] = (...l) => e.switchModule && e.switchModule(...l))
521
396
  }, [
522
- createElementVNode("div", _hoisted_20, toDisplayString(_ctx.customAndExistTitle || _ctx.translate("chooseAnotherAddress")), 1)
523
- ])) : createCommentVNode("", true)
397
+ i("div", Ge, m(e.customAndExistTitle || e.translate("chooseAnotherAddress")), 1)
398
+ ])) : _("", !0)
524
399
  ])),
525
- renderSlot(_ctx.$slots, "bottom")
400
+ w(e.$slots, "bottom")
526
401
  ])
527
402
  ]),
528
403
  _: 3
529
404
  }, 8, ["lock-scroll", "onClose", "onClickOverlay", "visible", "teleportDisable", "teleport"]);
530
405
  }
531
- const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
406
+ const ls = /* @__PURE__ */ Ae(Te, [["render", He]]);
532
407
  export {
533
- index as default
408
+ ls as default
534
409
  };