@nutui/nutui 3.2.6 → 3.2.8-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/README.md +11 -1
- package/dist/nutui.es.js +2685 -4599
- package/dist/nutui.umd.js +2684 -4600
- package/dist/packages/_es/ActionSheet.js +2 -5
- package/dist/packages/_es/Address.js +162 -250
- package/dist/packages/_es/AddressList.js +229 -307
- package/dist/packages/_es/Animate.js +1 -1
- package/dist/packages/_es/Audio.js +1 -1
- package/dist/packages/_es/AudioOperate.js +1 -1
- package/dist/packages/_es/Avatar.js +1 -1
- package/dist/packages/_es/AvatarGroup.js +1 -1
- package/dist/packages/_es/BackTop.js +1 -1
- package/dist/packages/_es/Badge.js +1 -1
- package/dist/packages/_es/Barrage.js +1 -1
- package/dist/packages/_es/Button.js +1 -1
- package/dist/packages/_es/Calendar.js +11 -4
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +1 -1
- package/dist/packages/_es/Cascader.js +2 -5
- package/dist/packages/_es/Category.js +1 -1
- package/dist/packages/_es/CategoryPane.js +1 -1
- package/dist/packages/_es/Cell.js +1 -1
- package/dist/packages/_es/CellGroup.js +1 -1
- package/dist/packages/_es/Checkbox.js +1 -1
- package/dist/packages/_es/CheckboxGroup.js +1 -1
- package/dist/packages/_es/CircleProgress.js +2 -2
- package/dist/packages/_es/Col.js +1 -1
- package/dist/packages/_es/Collapse.js +4 -11
- package/dist/packages/_es/CollapseItem.js +12 -12
- package/dist/packages/_es/Comment.js +1 -1
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +2 -10
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +8 -17
- package/dist/packages/_es/Dialog.js +38 -63
- package/dist/packages/_es/Divider.js +1 -1
- package/dist/packages/_es/Drag.js +1 -1
- package/dist/packages/_es/Ecard.js +1 -1
- package/dist/packages/_es/Elevator.js +9 -3
- package/dist/packages/_es/Ellipsis.js +3 -3
- package/dist/packages/_es/Empty.js +1 -1
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +39 -31
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +2 -2
- package/dist/packages/_es/GridItem.js +1 -1
- package/dist/packages/_es/Icon.js +1 -1
- package/dist/packages/_es/Image.js +1 -1
- package/dist/packages/_es/ImagePreview.js +131 -214
- package/dist/packages/_es/Indicator.js +4 -4
- package/dist/packages/_es/InfiniteLoading.js +9 -2
- package/dist/packages/_es/Input.js +109 -132
- package/dist/packages/_es/InputNumber.js +1 -1
- package/dist/packages/_es/Invoice.js +1 -1
- package/dist/packages/_es/Layout.js +1 -1
- package/dist/packages/_es/List.js +1 -1
- package/dist/packages/_es/Menu.js +14 -1
- package/dist/packages/_es/MenuItem.js +14 -8
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +1 -1
- package/dist/packages/_es/Notify.js +5 -7
- package/dist/packages/_es/NumberKeyboard.js +4 -4
- package/dist/packages/_es/OverLay.js +60 -63
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +25 -50
- package/dist/packages/_es/Popover.js +111 -930
- package/dist/packages/_es/Popup.js +108 -261
- package/dist/packages/_es/Price.js +1 -1
- package/dist/packages/_es/Progress.js +1 -1
- package/dist/packages/_es/Radio.js +1 -1
- package/dist/packages/_es/RadioGroup.js +1 -1
- package/dist/packages/_es/Range.js +1 -1
- package/dist/packages/_es/Rate.js +1 -1
- package/dist/packages/_es/Row.js +1 -1
- package/dist/packages/_es/SearchBar.js +1 -1
- package/dist/packages/_es/ShortPassword.js +4 -4
- package/dist/packages/_es/SideNavBar.js +1 -1
- package/dist/packages/_es/SideNavBarItem.js +1 -1
- package/dist/packages/_es/Signature.js +1 -1
- package/dist/packages/_es/Skeleton.js +19 -24
- package/dist/packages/_es/Sku.js +4 -7
- package/dist/packages/_es/Step.js +1 -1
- package/dist/packages/_es/Steps.js +1 -1
- package/dist/packages/_es/Sticky.js +1 -1
- package/dist/packages/_es/SubSideNavBar.js +1 -1
- package/dist/packages/_es/Swipe.js +1 -1
- package/dist/packages/_es/Swiper.js +1 -1
- package/dist/packages/_es/SwiperItem.js +1 -1
- package/dist/packages/_es/Switch.js +1 -1
- package/dist/packages/_es/TabPane.js +1 -1
- package/dist/packages/_es/Tabbar.js +1 -1
- package/dist/packages/_es/TabbarItem.js +24 -10
- package/dist/packages/_es/Table.js +1 -1
- package/dist/packages/_es/Tabs.js +2 -2
- package/dist/packages/_es/Tag.js +1 -1
- package/dist/packages/_es/TextArea.js +1 -1
- package/dist/packages/_es/TimeDetail.js +1 -1
- package/dist/packages/_es/TimePannel.js +1 -1
- package/dist/packages/_es/TimeSelect.js +4 -4
- package/dist/packages/_es/Toast.js +5 -6
- package/dist/packages/_es/TrendArrow.js +1 -1
- package/dist/packages/_es/Uploader.js +7 -7
- package/dist/packages/_es/Video.js +3 -2
- package/dist/packages/_es/WaterMark.js +1 -1
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +22 -2
- package/dist/packages/_es/index.js +1 -1
- package/dist/packages/_es/index2.js +1 -1
- package/dist/packages/_es/index3.js +1 -1
- package/dist/packages/_es/index4.js +1 -1
- package/dist/packages/_es/index5.js +8 -2
- package/dist/packages/_es/interceptor.js +32 -0
- package/dist/packages/_es/mountComponent.js +42 -0
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/props.js +80 -0
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/_es/style.css +1 -1
- package/dist/packages/address/index.scss +12 -3
- package/dist/packages/addresslist/index.scss +61 -101
- package/dist/packages/card/index.scss +1 -0
- package/dist/packages/ellipsis/index.scss +4 -0
- package/dist/packages/formitem/index.scss +2 -0
- package/dist/packages/imagepreview/index.scss +14 -1
- package/dist/packages/inputnumber/index.scss +5 -1
- package/dist/packages/locale/lang/baseLang.js +1 -1
- package/dist/packages/locale/lang/en-US.js +1 -1
- package/dist/packages/locale/lang/id-ID.js +1 -1
- package/dist/packages/locale/lang/index.js +1 -1
- package/dist/packages/locale/lang/zh-CN.js +1 -1
- package/dist/packages/locale/lang/zh-TW.js +1 -1
- package/dist/packages/menuitem/index.scss +0 -14
- package/dist/packages/notify/index.scss +2 -2
- package/dist/packages/overlay/index.scss +2 -1
- package/dist/packages/picker/index.scss +20 -12
- package/dist/packages/popover/index.scss +191 -363
- package/dist/packages/popup/index.scss +3 -14
- package/dist/packages/signature/index.scss +6 -2
- package/dist/packages/skeleton/index.scss +21 -19
- package/dist/packages/sticky/index.scss +3 -0
- package/dist/packages/tabbaritem/index.scss +4 -0
- package/dist/packages/timeselect/index.scss +0 -1
- package/dist/smartips/attributes.json +91 -111
- package/dist/smartips/tags.json +22 -35
- package/dist/smartips/web-types.json +162 -221
- package/dist/style.css +1 -1
- package/dist/styles/font/config.json +4 -0
- package/dist/styles/font/demo_index.html +118 -26
- package/dist/styles/font/iconfont.css +23 -7
- package/dist/styles/font/iconfont.js +6 -6
- package/dist/styles/font/iconfont.json +35 -7
- package/dist/styles/font/iconfont.ttf +0 -0
- package/dist/styles/font/iconfont.woff +0 -0
- package/dist/styles/font/iconfont.woff2 +0 -0
- package/dist/styles/themes/default.scss +52 -54
- package/dist/styles/themes/jdb.scss +52 -54
- package/dist/styles/themes/jddkh.scss +52 -54
- package/dist/styles/themes/jdt.scss +52 -54
- package/dist/styles/variables-jdb.scss +8 -1
- package/dist/styles/variables-jddkh.scss +8 -1
- package/dist/styles/variables-jdt.scss +8 -1
- package/dist/styles/variables.scss +17 -1
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +58 -54
- package/dist/types/__VUE/address/index.vue.d.ts +71 -91
- package/dist/types/__VUE/addresslist/components/GeneralShell.vue.d.ts +29 -9
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +4 -13
- package/dist/types/__VUE/addresslist/components/SwipeShell.vue.d.ts +9 -9
- package/dist/types/__VUE/addresslist/index.vue.d.ts +23 -20
- package/dist/types/__VUE/audio/index.vue.d.ts +4 -4
- package/dist/types/__VUE/avatar/index.vue.d.ts +2 -2
- package/dist/types/__VUE/avatargroup/index.vue.d.ts +1 -1
- package/dist/types/__VUE/backtop/index.vue.d.ts +1 -1
- package/dist/types/__VUE/badge/index.vue.d.ts +1 -1
- package/dist/types/__VUE/button/index.vue.d.ts +1 -1
- package/dist/types/__VUE/calendar/index.vue.d.ts +11 -0
- package/dist/types/__VUE/calendaritem/index.vue.d.ts +15 -5
- package/dist/types/__VUE/cascader/index.vue.d.ts +47 -52
- package/dist/types/__VUE/cell/index.vue.d.ts +5 -5
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/countdown/index.vue.d.ts +0 -1
- package/dist/types/__VUE/countdown/util.d.ts +0 -1
- package/dist/types/__VUE/countup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +55 -60
- package/dist/types/__VUE/dialog/index.d.ts +0 -3
- package/dist/types/__VUE/dialog/index.vue.d.ts +48 -57
- package/dist/types/__VUE/elevator/index.vue.d.ts +2 -1
- package/dist/types/__VUE/form/common.d.ts +4 -2
- package/dist/types/__VUE/form/index.vue.d.ts +4 -4
- package/dist/types/__VUE/grid/index.vue.d.ts +2 -2
- package/dist/types/__VUE/image/index.vue.d.ts +1 -1
- package/dist/types/__VUE/imagepreview/imagePreviewItem.vue.d.ts +27 -20
- package/dist/types/__VUE/imagepreview/index.d.ts +19 -5
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +56 -42
- package/dist/types/__VUE/imagepreview/types.d.ts +44 -0
- package/dist/types/__VUE/indicator/index.vue.d.ts +1 -0
- package/dist/types/__VUE/input/index.vue.d.ts +37 -26
- package/dist/types/__VUE/invoice/index.vue.d.ts +1 -1
- package/dist/types/__VUE/menuitem/index.vue.d.ts +3 -1
- package/dist/types/__VUE/navbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/noticebar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/notify/index.vue.d.ts +3 -3
- package/dist/types/__VUE/numberkeyboard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/overlay/index.vue.d.ts +11 -12
- package/dist/types/__VUE/picker/Column.vue.d.ts +4 -6
- package/dist/types/__VUE/picker/index.vue.d.ts +60 -67
- package/dist/types/__VUE/popover/index.vue.d.ts +36 -139
- package/dist/types/__VUE/popup/common.d.ts +103 -0
- package/dist/types/__VUE/popup/index.vue.d.ts +55 -1591
- package/dist/types/__VUE/popup/props.d.ts +82 -0
- package/dist/types/__VUE/range/index.vue.d.ts +7 -7
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +4 -4
- package/dist/types/__VUE/skeleton/common.d.ts +2 -3
- package/dist/types/__VUE/skeleton/index.vue.d.ts +2 -3
- package/dist/types/__VUE/sku/index.vue.d.ts +56 -61
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/swiper/index.vue.d.ts +1 -1
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -1
- package/dist/types/__VUE/timeselect/index.vue.d.ts +3 -3
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/__VUE/uploader/index.vue.d.ts +15 -6
- package/dist/types/__VUE/video/index.vue.d.ts +5 -5
- package/dist/types/index.d.ts +1 -1
- package/dist/types/nutui.d.ts +1 -3
- package/package.json +3 -3
- package/dist/packages/_es/OldPicker.js +0 -486
- package/dist/packages/_es/PullRefresh.js +0 -349
- package/dist/packages/oldpicker/index.scss +0 -133
- package/dist/packages/pullrefresh/index.scss +0 -71
- package/dist/types/__VUE/addresslist/components/LongPressShell.vue.d.ts +0 -47
- package/dist/types/__VUE/datepicker/utils.d.ts +0 -5
- package/dist/types/__VUE/oldpicker/Column.vue.d.ts +0 -96
- package/dist/types/__VUE/oldpicker/commonProps.d.ts +0 -22
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +0 -369
- package/dist/types/__VUE/oldpicker/types.d.ts +0 -24
- package/dist/types/__VUE/popup/use-lock-scroll.d.ts +0 -5
- package/dist/types/__VUE/pullrefresh/index.vue.d.ts +0 -128
- package/dist/types/__VUE/pullrefresh/use-touch.d.ts +0 -20
- package/dist/types/__VUE/pullrefresh/util.d.ts +0 -6
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.7 Fri Dec 02 2022 14:12:17 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
import { c as createComponent } from "./component.js";
|
|
7
7
|
import { useSlots, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, withCtx, createElementVNode, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, normalizeStyle, createBlock } from "vue";
|
|
8
|
-
import { popupProps } from "./
|
|
8
|
+
import { p as popupProps } from "./props.js";
|
|
9
9
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
10
|
import "../locale/lang";
|
|
11
|
-
import "./OverLay.js";
|
|
12
|
-
import "./Icon.js";
|
|
13
|
-
import "./pxCheck.js";
|
|
14
11
|
const { componentName, create } = createComponent("actionsheet");
|
|
15
12
|
const _sfc_main = create({
|
|
16
13
|
props: {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.2.
|
|
2
|
+
* @nutui/nutui v3.2.7 Fri Dec 02 2022 14:12:17 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { ref, computed, reactive,
|
|
6
|
+
import { ref, computed, reactive, watch, toRefs, h, nextTick, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, withDirectives, createVNode, mergeProps, vShow, toDisplayString, createCommentVNode, createElementBlock, Fragment, renderList, normalizeClass, normalizeStyle, resolveDynamicComponent, normalizeProps, createTextVNode, guardReactiveProps, renderSlot } from "vue";
|
|
7
7
|
import { c as createComponent } from "./component.js";
|
|
8
|
-
import { popupProps } from "./
|
|
8
|
+
import { p as popupProps } from "./props.js";
|
|
9
|
+
import _sfc_main$1 from "./Icon.js";
|
|
9
10
|
import { _ as _export_sfc } from "./plugin-vue_export-helper.js";
|
|
10
11
|
import "../locale/lang";
|
|
11
|
-
import "./OverLay.js";
|
|
12
|
-
import "./Icon.js";
|
|
13
12
|
import "./pxCheck.js";
|
|
14
13
|
const { componentName, create, translate } = createComponent("address");
|
|
15
14
|
const _sfc_main = create({
|
|
@@ -93,8 +92,26 @@ const _sfc_main = create({
|
|
|
93
92
|
const privateType = ref(props.type);
|
|
94
93
|
const tabIndex = ref(0);
|
|
95
94
|
const tabName = ref(["province", "city", "country", "town"]);
|
|
96
|
-
const
|
|
97
|
-
|
|
95
|
+
const regionList = computed(() => {
|
|
96
|
+
switch (tabIndex.value) {
|
|
97
|
+
case 0:
|
|
98
|
+
return props.province;
|
|
99
|
+
case 1:
|
|
100
|
+
return props.city;
|
|
101
|
+
case 2:
|
|
102
|
+
return props.country;
|
|
103
|
+
default:
|
|
104
|
+
return props.town;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
const renderIcon = (n) => {
|
|
108
|
+
return h(_sfc_main$1, {
|
|
109
|
+
class: `${componentName}-select-icon`,
|
|
110
|
+
type: "self",
|
|
111
|
+
size: "13px",
|
|
112
|
+
name: n
|
|
113
|
+
});
|
|
114
|
+
};
|
|
98
115
|
const transformData = (data) => {
|
|
99
116
|
if (!Array.isArray(data))
|
|
100
117
|
throw new TypeError("params muse be array.");
|
|
@@ -107,9 +124,7 @@ const _sfc_main = create({
|
|
|
107
124
|
}
|
|
108
125
|
});
|
|
109
126
|
const newData = [];
|
|
110
|
-
data = data.sort((a, b) =>
|
|
111
|
-
return a.title.localeCompare(b.title);
|
|
112
|
-
});
|
|
127
|
+
data = data.sort((a, b) => a.title.localeCompare(b.title));
|
|
113
128
|
data.forEach((item) => {
|
|
114
129
|
const index2 = newData.findIndex((value) => value.title === item.title);
|
|
115
130
|
if (index2 <= -1) {
|
|
@@ -118,90 +133,53 @@ const _sfc_main = create({
|
|
|
118
133
|
list: [].concat(item)
|
|
119
134
|
});
|
|
120
135
|
} else {
|
|
121
|
-
newData[index2]
|
|
122
|
-
title: item.title,
|
|
123
|
-
list: newData[index2].list.concat(item)
|
|
124
|
-
};
|
|
136
|
+
newData[index2].list.push(item);
|
|
125
137
|
}
|
|
126
138
|
});
|
|
127
139
|
return newData;
|
|
128
140
|
};
|
|
129
|
-
|
|
130
|
-
province: isCustom2.value ? transformData(props.province) : props.province,
|
|
131
|
-
city: isCustom2.value ? transformData(props.city) : props.city,
|
|
132
|
-
country: isCustom2.value ? transformData(props.country) : props.country,
|
|
133
|
-
town: isCustom2.value ? transformData(props.town) : props.town
|
|
134
|
-
});
|
|
135
|
-
const selectedRegion = reactive({
|
|
136
|
-
province: {},
|
|
137
|
-
city: {},
|
|
138
|
-
country: {},
|
|
139
|
-
town: {}
|
|
140
|
-
});
|
|
141
|
+
let selectedRegion = ref([]);
|
|
141
142
|
let selectedExistAddress = reactive({});
|
|
142
143
|
const closeWay = ref("self");
|
|
143
144
|
const lineDistance = ref(20);
|
|
144
|
-
onMounted(() => {
|
|
145
|
-
customPlaceholder();
|
|
146
|
-
});
|
|
147
145
|
const initCustomSelected = () => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
146
|
+
const defaultValue = props.modelValue;
|
|
147
|
+
const num = defaultValue.length;
|
|
148
|
+
if (num > 0) {
|
|
149
|
+
tabIndex.value = num - 1;
|
|
150
|
+
if (regionList.value.length == 0) {
|
|
151
|
+
tabIndex.value = 0;
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
for (let index2 = 0; index2 < num; index2++) {
|
|
155
|
+
let arr = [];
|
|
156
|
+
switch (index2) {
|
|
157
|
+
case 0:
|
|
158
|
+
arr = props.province;
|
|
159
|
+
break;
|
|
160
|
+
case 1:
|
|
161
|
+
arr = props.city;
|
|
162
|
+
break;
|
|
163
|
+
case 2:
|
|
164
|
+
arr = props.country;
|
|
165
|
+
break;
|
|
166
|
+
default:
|
|
167
|
+
arr = props.town;
|
|
166
168
|
}
|
|
169
|
+
selectedRegion.value[index2] = arr.filter((item) => item.id == defaultValue[index2])[0];
|
|
167
170
|
}
|
|
168
171
|
lineAnimation();
|
|
169
172
|
}
|
|
170
173
|
};
|
|
171
|
-
const customPlaceholder = () => {
|
|
172
|
-
let selectStr = translate("select");
|
|
173
|
-
let typeD = Object.prototype.toString.call(props.columnsPlaceholder || selectStr);
|
|
174
|
-
if (typeD == "[object String]") {
|
|
175
|
-
tabNameDefault.value = new Array(4).fill(props.columnsPlaceholder || selectStr);
|
|
176
|
-
} else if (typeD == "[object Array]") {
|
|
177
|
-
tabNameDefault.value = new Array(4).fill("");
|
|
178
|
-
tabNameDefault.value.forEach((val, index2) => {
|
|
179
|
-
if (props.columnsPlaceholder[index2]) {
|
|
180
|
-
tabNameDefault.value[index2] = props.columnsPlaceholder[index2];
|
|
181
|
-
} else {
|
|
182
|
-
tabNameDefault.value[index2] = selectStr;
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
174
|
const getTabName = (item, index2) => {
|
|
188
|
-
if (item.name)
|
|
175
|
+
if (item && item.name)
|
|
189
176
|
return item.name;
|
|
190
|
-
if (tabIndex.value < index2) {
|
|
177
|
+
if (tabIndex.value < index2 && item) {
|
|
191
178
|
return item.name;
|
|
192
179
|
} else {
|
|
193
|
-
return
|
|
180
|
+
return props.columnsPlaceholder[index2] || translate("select");
|
|
194
181
|
}
|
|
195
182
|
};
|
|
196
|
-
const handClose = (type = "self") => {
|
|
197
|
-
if (!props.closeBtnIcon)
|
|
198
|
-
return;
|
|
199
|
-
closeWay.value = type == "cross" ? "cross" : "self";
|
|
200
|
-
showPopup.value = false;
|
|
201
|
-
};
|
|
202
|
-
const clickOverlay = () => {
|
|
203
|
-
closeWay.value = "mask";
|
|
204
|
-
};
|
|
205
183
|
const lineAnimation = () => {
|
|
206
184
|
nextTick(() => {
|
|
207
185
|
const name = tabRegion.value && tabRegion.value.getElementsByClassName("active")[0];
|
|
@@ -212,27 +190,26 @@ const _sfc_main = create({
|
|
|
212
190
|
});
|
|
213
191
|
};
|
|
214
192
|
const nextAreaList = (item) => {
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
custom: tabName.value[tabIndex.value]
|
|
193
|
+
const tab = tabIndex.value;
|
|
194
|
+
const callBackParams = {
|
|
195
|
+
custom: tabName.value[tab]
|
|
219
196
|
};
|
|
220
|
-
selectedRegion
|
|
221
|
-
for (let i =
|
|
222
|
-
selectedRegion
|
|
197
|
+
selectedRegion.value[tab] = item;
|
|
198
|
+
for (let i = tab + 2; i < 4; i++) {
|
|
199
|
+
selectedRegion.value.splice(i, 1);
|
|
223
200
|
}
|
|
224
|
-
if (
|
|
225
|
-
tabIndex.value =
|
|
201
|
+
if (tab < 3) {
|
|
202
|
+
tabIndex.value = tab + 1;
|
|
226
203
|
lineAnimation();
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
emit("change",
|
|
204
|
+
callBackParams.next = tabName.value[tabIndex.value];
|
|
205
|
+
callBackParams.value = item;
|
|
206
|
+
emit("change", callBackParams);
|
|
230
207
|
} else {
|
|
231
208
|
handClose();
|
|
232
209
|
emit("update:modelValue");
|
|
233
210
|
}
|
|
234
211
|
};
|
|
235
|
-
const changeRegionTab = (item,
|
|
212
|
+
const changeRegionTab = (item, index2) => {
|
|
236
213
|
if (getTabName(item, index2)) {
|
|
237
214
|
tabIndex.value = index2;
|
|
238
215
|
lineAnimation();
|
|
@@ -241,10 +218,9 @@ const _sfc_main = create({
|
|
|
241
218
|
const selectedExist = (item) => {
|
|
242
219
|
const copyExistAdd = props.existAddress;
|
|
243
220
|
let prevExistAdd = {};
|
|
244
|
-
copyExistAdd.forEach((list
|
|
245
|
-
if (list && list.selectedAddress)
|
|
221
|
+
copyExistAdd.forEach((list) => {
|
|
222
|
+
if (list && list.selectedAddress)
|
|
246
223
|
prevExistAdd = list;
|
|
247
|
-
}
|
|
248
224
|
list.selectedAddress = false;
|
|
249
225
|
});
|
|
250
226
|
item.selectedAddress = true;
|
|
@@ -253,57 +229,53 @@ const _sfc_main = create({
|
|
|
253
229
|
handClose();
|
|
254
230
|
};
|
|
255
231
|
const initAddress = () => {
|
|
256
|
-
|
|
257
|
-
selectedRegion[tabName.value[i]] = {};
|
|
258
|
-
}
|
|
232
|
+
selectedRegion.value = [];
|
|
259
233
|
tabIndex.value = 0;
|
|
260
234
|
lineAnimation();
|
|
261
235
|
};
|
|
236
|
+
const handClose = (type = "self") => {
|
|
237
|
+
if (!props.closeBtnIcon)
|
|
238
|
+
return;
|
|
239
|
+
closeWay.value = type == "cross" ? "cross" : "self";
|
|
240
|
+
showPopup.value = false;
|
|
241
|
+
};
|
|
242
|
+
const clickOverlay = () => {
|
|
243
|
+
closeWay.value = "mask";
|
|
244
|
+
};
|
|
262
245
|
const close = () => {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
selectedRegion
|
|
270
|
-
|
|
271
|
-
const
|
|
246
|
+
const data = {
|
|
247
|
+
addressIdStr: "",
|
|
248
|
+
addressStr: "",
|
|
249
|
+
province: selectedRegion.value[0],
|
|
250
|
+
city: selectedRegion.value[1],
|
|
251
|
+
country: selectedRegion.value[2],
|
|
252
|
+
town: selectedRegion.value[3]
|
|
253
|
+
};
|
|
254
|
+
const callBackParams = {
|
|
272
255
|
data: {},
|
|
273
256
|
type: privateType.value
|
|
274
257
|
};
|
|
275
|
-
if (
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
].join("_");
|
|
283
|
-
resCopy.addressStr = [
|
|
284
|
-
province.name,
|
|
285
|
-
city.name,
|
|
286
|
-
country.name,
|
|
287
|
-
town.name
|
|
288
|
-
].join("");
|
|
289
|
-
res.data = resCopy;
|
|
258
|
+
if (["custom", "custom2"].includes(privateType.value)) {
|
|
259
|
+
[0, 1, 2, 3].forEach((i) => {
|
|
260
|
+
const item = selectedRegion.value[i];
|
|
261
|
+
data.addressIdStr += `${i ? "_" : ""}${item && item.id || 0}`;
|
|
262
|
+
data.addressStr += item && item.name || "";
|
|
263
|
+
});
|
|
264
|
+
callBackParams.data = data;
|
|
290
265
|
} else {
|
|
291
|
-
|
|
266
|
+
callBackParams.data = selectedExistAddress;
|
|
292
267
|
}
|
|
293
268
|
initAddress();
|
|
294
269
|
if (closeWay.value == "self") {
|
|
295
|
-
emit("close",
|
|
270
|
+
emit("close", callBackParams);
|
|
296
271
|
} else {
|
|
297
272
|
emit("close-mask", { closeWay });
|
|
298
273
|
}
|
|
299
274
|
emit("update:visible", false);
|
|
300
275
|
};
|
|
301
276
|
const switchModule = () => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
} else {
|
|
305
|
-
privateType.value = "exist";
|
|
306
|
-
}
|
|
277
|
+
const type = privateType.value;
|
|
278
|
+
privateType.value = type == "exist" ? "custom" : "exist";
|
|
307
279
|
initAddress();
|
|
308
280
|
emit("switch-module", { type: privateType.value });
|
|
309
281
|
};
|
|
@@ -319,56 +291,17 @@ const _sfc_main = create({
|
|
|
319
291
|
watch(
|
|
320
292
|
() => showPopup.value,
|
|
321
293
|
(value) => {
|
|
322
|
-
|
|
323
|
-
if (value == false)
|
|
324
|
-
;
|
|
325
|
-
else {
|
|
294
|
+
if (value) {
|
|
326
295
|
initCustomSelected();
|
|
327
296
|
}
|
|
328
297
|
}
|
|
329
298
|
);
|
|
330
|
-
watch(
|
|
331
|
-
() => props.province,
|
|
332
|
-
(value) => {
|
|
333
|
-
regionList.province = isCustom2.value ? transformData(value) : value;
|
|
334
|
-
}
|
|
335
|
-
);
|
|
336
|
-
watch(
|
|
337
|
-
() => props.city,
|
|
338
|
-
(value) => {
|
|
339
|
-
regionList.city = isCustom2.value ? transformData(value) : value;
|
|
340
|
-
}
|
|
341
|
-
);
|
|
342
|
-
watch(
|
|
343
|
-
() => props.country,
|
|
344
|
-
(value) => {
|
|
345
|
-
regionList.country = isCustom2.value ? transformData(value) : value;
|
|
346
|
-
}
|
|
347
|
-
);
|
|
348
|
-
watch(
|
|
349
|
-
() => props.town,
|
|
350
|
-
(value) => {
|
|
351
|
-
regionList.town = isCustom2.value ? transformData(value) : value;
|
|
352
|
-
}
|
|
353
|
-
);
|
|
354
|
-
watch(
|
|
355
|
-
() => props.existAddress,
|
|
356
|
-
(value) => {
|
|
357
|
-
value.forEach((item, index2) => {
|
|
358
|
-
if (item.selectedAddress) {
|
|
359
|
-
selectedExistAddress = item;
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
);
|
|
364
299
|
return {
|
|
365
300
|
showPopup,
|
|
366
301
|
privateType,
|
|
367
302
|
tabIndex,
|
|
368
303
|
tabName,
|
|
369
|
-
regionList,
|
|
370
304
|
selectedRegion,
|
|
371
|
-
selectedExistAddress,
|
|
372
305
|
switchModule,
|
|
373
306
|
closeWay,
|
|
374
307
|
close,
|
|
@@ -384,7 +317,10 @@ const _sfc_main = create({
|
|
|
384
317
|
handleElevatorItem,
|
|
385
318
|
initCustomSelected,
|
|
386
319
|
...toRefs(props),
|
|
387
|
-
translate
|
|
320
|
+
translate,
|
|
321
|
+
regionList,
|
|
322
|
+
transformData,
|
|
323
|
+
renderIcon
|
|
388
324
|
};
|
|
389
325
|
}
|
|
390
326
|
});
|
|
@@ -396,39 +332,42 @@ const _hoisted_4 = {
|
|
|
396
332
|
class: "custom-address"
|
|
397
333
|
};
|
|
398
334
|
const _hoisted_5 = {
|
|
399
|
-
class: "region-tab",
|
|
335
|
+
class: "nut-address-region-tab",
|
|
400
336
|
ref: "tabRegion"
|
|
401
337
|
};
|
|
402
338
|
const _hoisted_6 = ["onClick"];
|
|
403
|
-
const _hoisted_7 = {
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
const _hoisted_10 = {
|
|
407
|
-
key: 1,
|
|
408
|
-
class: "custom-address"
|
|
339
|
+
const _hoisted_7 = {
|
|
340
|
+
key: 0,
|
|
341
|
+
class: "active tab-item"
|
|
409
342
|
};
|
|
343
|
+
const _hoisted_8 = {
|
|
344
|
+
key: 0,
|
|
345
|
+
class: "region-con"
|
|
346
|
+
};
|
|
347
|
+
const _hoisted_9 = { class: "region-group" };
|
|
348
|
+
const _hoisted_10 = ["onClick"];
|
|
410
349
|
const _hoisted_11 = {
|
|
411
|
-
|
|
412
|
-
|
|
350
|
+
key: 1,
|
|
351
|
+
class: "elevator-group"
|
|
413
352
|
};
|
|
414
|
-
const _hoisted_12 =
|
|
415
|
-
|
|
416
|
-
const _hoisted_14 = {
|
|
417
|
-
key: 2,
|
|
353
|
+
const _hoisted_12 = {
|
|
354
|
+
key: 1,
|
|
418
355
|
class: "exist-address"
|
|
419
356
|
};
|
|
420
|
-
const
|
|
421
|
-
const
|
|
422
|
-
const
|
|
423
|
-
const
|
|
424
|
-
const
|
|
357
|
+
const _hoisted_13 = { class: "exist-address-group" };
|
|
358
|
+
const _hoisted_14 = { class: "exist-ul" };
|
|
359
|
+
const _hoisted_15 = ["onClick"];
|
|
360
|
+
const _hoisted_16 = { class: "exist-item-info" };
|
|
361
|
+
const _hoisted_17 = {
|
|
425
362
|
key: 0,
|
|
426
|
-
class: "exist-item-info-
|
|
363
|
+
class: "exist-item-info-name"
|
|
427
364
|
};
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
365
|
+
const _hoisted_18 = {
|
|
366
|
+
key: 1,
|
|
367
|
+
class: "exist-item-info-phone"
|
|
368
|
+
};
|
|
369
|
+
const _hoisted_19 = { class: "exist-item-info-bottom" };
|
|
370
|
+
const _hoisted_20 = { class: "btn" };
|
|
432
371
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
433
372
|
const _component_nut_icon = resolveComponent("nut-icon");
|
|
434
373
|
const _component_nut_elevator = resolveComponent("nut-elevator");
|
|
@@ -441,7 +380,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
441
380
|
onOpen: _cache[3] || (_cache[3] = ($event) => _ctx.closeWay = "self"),
|
|
442
381
|
visible: _ctx.showPopup,
|
|
443
382
|
"onUpdate:visible": _cache[4] || (_cache[4] = ($event) => _ctx.showPopup = $event),
|
|
444
|
-
|
|
383
|
+
teleportDisable: _ctx.teleportDisable,
|
|
445
384
|
teleport: _ctx.teleport
|
|
446
385
|
}, {
|
|
447
386
|
default: withCtx(() => [
|
|
@@ -470,94 +409,67 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
470
409
|
}), null, 16, ["name"])) : createCommentVNode("", true)
|
|
471
410
|
])
|
|
472
411
|
]),
|
|
473
|
-
_ctx.privateType
|
|
412
|
+
["custom", "custom2"].includes(_ctx.privateType) ? (openBlock(), createElementBlock("view", _hoisted_4, [
|
|
474
413
|
createElementVNode("view", _hoisted_5, [
|
|
475
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedRegion, (item,
|
|
414
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedRegion, (item, index2) => {
|
|
476
415
|
return openBlock(), createElementBlock("view", {
|
|
477
|
-
class: normalizeClass(["tab-item",
|
|
416
|
+
class: normalizeClass(["tab-item", index2 == _ctx.tabIndex ? "active" : ""]),
|
|
478
417
|
key: index2,
|
|
479
|
-
onClick: ($event) => _ctx.changeRegionTab(item,
|
|
418
|
+
onClick: ($event) => _ctx.changeRegionTab(item, index2)
|
|
480
419
|
}, [
|
|
481
420
|
createElementVNode("view", null, toDisplayString(_ctx.getTabName(item, index2)), 1)
|
|
482
421
|
], 10, _hoisted_6);
|
|
483
422
|
}), 128)),
|
|
423
|
+
_ctx.tabIndex == _ctx.selectedRegion.length ? (openBlock(), createElementBlock("view", _hoisted_7, [
|
|
424
|
+
createElementVNode("view", null, toDisplayString(_ctx.getTabName(null, _ctx.selectedRegion.length)), 1)
|
|
425
|
+
])) : createCommentVNode("", true),
|
|
484
426
|
createElementVNode("view", {
|
|
485
427
|
class: "region-tab-line",
|
|
486
428
|
ref: "regionLine",
|
|
487
429
|
style: normalizeStyle({ left: _ctx.lineDistance + "px" })
|
|
488
430
|
}, null, 4)
|
|
489
431
|
], 512),
|
|
490
|
-
|
|
491
|
-
createElementVNode("ul",
|
|
492
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.regionList
|
|
432
|
+
_ctx.privateType == "custom" ? (openBlock(), createElementBlock("view", _hoisted_8, [
|
|
433
|
+
createElementVNode("ul", _hoisted_9, [
|
|
434
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.regionList, (item, index2) => {
|
|
435
|
+
var _a, _b;
|
|
493
436
|
return openBlock(), createElementBlock("li", {
|
|
494
437
|
key: index2,
|
|
495
|
-
class: normalizeClass(["region-item",
|
|
438
|
+
class: normalizeClass(["region-item", ((_a = _ctx.selectedRegion[_ctx.tabIndex]) == null ? void 0 : _a.id) == item.id ? "active" : ""]),
|
|
496
439
|
onClick: ($event) => _ctx.nextAreaList(item)
|
|
497
440
|
}, [
|
|
498
|
-
|
|
499
|
-
key: 0,
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
name: _ctx.selectedIcon,
|
|
504
|
-
size: "13px"
|
|
505
|
-
}), null, 16, ["name"])) : createCommentVNode("", true),
|
|
506
|
-
createTextVNode(toDisplayString(item.name), 1)
|
|
507
|
-
], 10, _hoisted_9);
|
|
441
|
+
createElementVNode("div", null, [
|
|
442
|
+
((_b = _ctx.selectedRegion[_ctx.tabIndex]) == null ? void 0 : _b.id) == item.id ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(_ctx.selectedIcon)), normalizeProps(mergeProps({ key: 0 }, _ctx.$attrs)), null, 16)) : createCommentVNode("", true),
|
|
443
|
+
createTextVNode(" " + toDisplayString(item.name), 1)
|
|
444
|
+
])
|
|
445
|
+
], 10, _hoisted_10);
|
|
508
446
|
}), 128))
|
|
509
447
|
])
|
|
510
|
-
])
|
|
511
|
-
])) : _ctx.privateType == "custom2" ? (openBlock(), createElementBlock("view", _hoisted_10, [
|
|
512
|
-
createElementVNode("view", _hoisted_11, [
|
|
513
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selectedRegion, (item, key, index2) => {
|
|
514
|
-
return openBlock(), createElementBlock("view", {
|
|
515
|
-
class: normalizeClass(["tab-item", [index2 == _ctx.tabIndex ? "active" : ""]]),
|
|
516
|
-
key: index2,
|
|
517
|
-
onClick: ($event) => _ctx.changeRegionTab(item, key, index2)
|
|
518
|
-
}, [
|
|
519
|
-
createElementVNode("view", null, toDisplayString(_ctx.getTabName(item, index2)), 1)
|
|
520
|
-
], 10, _hoisted_12);
|
|
521
|
-
}), 128)),
|
|
522
|
-
createElementVNode("view", {
|
|
523
|
-
class: "region-tab-line",
|
|
524
|
-
ref: "regionLine",
|
|
525
|
-
style: normalizeStyle({ left: _ctx.lineDistance + "px" })
|
|
526
|
-
}, null, 4)
|
|
527
|
-
], 512),
|
|
528
|
-
createElementVNode("view", _hoisted_13, [
|
|
448
|
+
])) : (openBlock(), createElementBlock("view", _hoisted_11, [
|
|
529
449
|
createVNode(_component_nut_elevator, {
|
|
530
450
|
height: _ctx.height,
|
|
531
|
-
"index-list": _ctx.
|
|
451
|
+
"index-list": _ctx.transformData(_ctx.regionList),
|
|
532
452
|
onClickItem: _ctx.handleElevatorItem
|
|
533
453
|
}, null, 8, ["height", "index-list", "onClickItem"])
|
|
534
|
-
])
|
|
535
|
-
])) :
|
|
536
|
-
createElementVNode("div",
|
|
537
|
-
createElementVNode("ul",
|
|
454
|
+
]))
|
|
455
|
+
])) : (openBlock(), createElementBlock("view", _hoisted_12, [
|
|
456
|
+
createElementVNode("div", _hoisted_13, [
|
|
457
|
+
createElementVNode("ul", _hoisted_14, [
|
|
538
458
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.existAddress, (item, index2) => {
|
|
539
459
|
return openBlock(), createElementBlock("li", {
|
|
540
|
-
class: normalizeClass(["exist-item",
|
|
460
|
+
class: normalizeClass(["exist-item", item.selectedAddress ? "active" : ""]),
|
|
541
461
|
key: index2,
|
|
542
462
|
onClick: ($event) => _ctx.selectedExist(item)
|
|
543
463
|
}, [
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
size: "13px"
|
|
550
|
-
}), null, 16, ["name"]),
|
|
551
|
-
createElementVNode("div", _hoisted_18, [
|
|
552
|
-
item.name && item.phone ? (openBlock(), createElementBlock("div", _hoisted_19, [
|
|
553
|
-
createElementVNode("div", _hoisted_20, toDisplayString(item.name), 1),
|
|
554
|
-
createElementVNode("div", _hoisted_21, toDisplayString(item.phone), 1)
|
|
555
|
-
])) : createCommentVNode("", true),
|
|
556
|
-
createElementVNode("div", _hoisted_22, [
|
|
464
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.renderIcon(item.selectedAddress ? _ctx.selectedIcon : _ctx.defaultIcon)), normalizeProps(guardReactiveProps(_ctx.$attrs)), null, 16)),
|
|
465
|
+
createElementVNode("div", _hoisted_16, [
|
|
466
|
+
item.name ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(item.name), 1)) : createCommentVNode("", true),
|
|
467
|
+
item.phone ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(item.phone), 1)) : createCommentVNode("", true),
|
|
468
|
+
createElementVNode("div", _hoisted_19, [
|
|
557
469
|
createElementVNode("view", null, toDisplayString(item.provinceName + item.cityName + item.countyName + item.townName + item.addressDetail), 1)
|
|
558
470
|
])
|
|
559
471
|
])
|
|
560
|
-
], 10,
|
|
472
|
+
], 10, _hoisted_15);
|
|
561
473
|
}), 128))
|
|
562
474
|
])
|
|
563
475
|
]),
|
|
@@ -566,14 +478,14 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
566
478
|
class: "choose-other",
|
|
567
479
|
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.switchModule && _ctx.switchModule(...args))
|
|
568
480
|
}, [
|
|
569
|
-
createElementVNode("div",
|
|
481
|
+
createElementVNode("div", _hoisted_20, toDisplayString(_ctx.customAndExistTitle || _ctx.translate("chooseAnotherAddress")), 1)
|
|
570
482
|
])) : createCommentVNode("", true)
|
|
571
|
-
]))
|
|
483
|
+
])),
|
|
572
484
|
renderSlot(_ctx.$slots, "bottom")
|
|
573
485
|
])
|
|
574
486
|
]),
|
|
575
487
|
_: 3
|
|
576
|
-
}, 8, ["lock-scroll", "onClose", "onClickOverlay", "visible", "
|
|
488
|
+
}, 8, ["lock-scroll", "onClose", "onClickOverlay", "visible", "teleportDisable", "teleport"]);
|
|
577
489
|
}
|
|
578
490
|
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
579
491
|
export { index as default };
|