@nutui/nutui 3.3.0 → 3.3.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nutui.es.js +324 -295
- package/dist/nutui.umd.js +320 -291
- package/dist/packages/_es/ActionSheet.js +1 -1
- package/dist/packages/_es/Address.js +1 -1
- package/dist/packages/_es/AddressList.js +2 -2
- 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 +1 -1
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +1 -1
- package/dist/packages/_es/Cascader.js +1 -1
- 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 +1 -1
- package/dist/packages/_es/CollapseItem.js +1 -1
- package/dist/packages/_es/Comment.js +1 -1
- package/dist/packages/_es/ConfigProvider.js +1 -1
- package/dist/packages/_es/CountDown.js +1 -1
- package/dist/packages/_es/CountUp.js +1 -1
- package/dist/packages/_es/DatePicker.js +1 -1
- package/dist/packages/_es/Dialog.js +1 -1
- 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 +1 -1
- package/dist/packages/_es/Ellipsis.js +1 -1
- package/dist/packages/_es/Empty.js +1 -1
- package/dist/packages/_es/FixedNav.js +1 -1
- package/dist/packages/_es/Form.js +2 -2
- package/dist/packages/_es/FormItem.js +1 -1
- package/dist/packages/_es/Grid.js +1 -1
- 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 +3 -3
- package/dist/packages/_es/Indicator.js +1 -1
- package/dist/packages/_es/InfiniteLoading.js +18 -26
- package/dist/packages/_es/Input.js +1 -1
- 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 +1 -1
- package/dist/packages/_es/MenuItem.js +1 -1
- package/dist/packages/_es/Navbar.js +1 -1
- package/dist/packages/_es/NoticeBar.js +1 -1
- package/dist/packages/_es/Notify.js +1 -1
- package/dist/packages/_es/NumberKeyboard.js +1 -1
- package/dist/packages/_es/OverLay.js +1 -1
- package/dist/packages/_es/Pagination.js +1 -1
- package/dist/packages/_es/Picker.js +17 -7
- package/dist/packages/_es/Popover.js +171 -81
- package/dist/packages/_es/Popup.js +1 -1
- package/dist/packages/_es/Price.js +7 -2
- 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 +1 -1
- 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 +1 -1
- package/dist/packages/_es/Sku.js +1 -1
- 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 +57 -115
- 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 +4 -8
- package/dist/packages/_es/TabbarItem.js +12 -13
- package/dist/packages/_es/Table.js +1 -1
- package/dist/packages/_es/Tabs.js +6 -9
- 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 +1 -1
- package/dist/packages/_es/Toast.js +1 -1
- package/dist/packages/_es/TrendArrow.js +1 -1
- package/dist/packages/_es/Uploader.js +1 -1
- package/dist/packages/_es/Video.js +1 -1
- package/dist/packages/_es/WaterMark.js +1 -1
- package/dist/packages/_es/common.js +1 -1
- package/dist/packages/_es/component.js +6 -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 +1 -1
- package/dist/packages/_es/interceptor.js +2 -2
- package/dist/packages/_es/mountComponent.js +2 -2
- package/dist/packages/_es/plugin-vue_export-helper.js +1 -1
- package/dist/packages/_es/props.js +1 -1
- package/dist/packages/_es/pxCheck.js +1 -1
- package/dist/packages/_es/raf.js +1 -1
- package/dist/packages/infiniteloading/index.scss +2 -0
- 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/picker/index.scss +10 -4
- package/dist/packages/popover/index.scss +10 -38
- package/dist/packages/price/index.scss +5 -0
- package/dist/smartips/attributes.json +36 -8
- package/dist/smartips/tags.json +13 -6
- package/dist/smartips/web-types.json +72 -9
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +55 -55
- package/dist/styles/themes/jdb.scss +55 -55
- package/dist/styles/themes/jddkh.scss +55 -55
- package/dist/styles/themes/jdt.scss +55 -55
- package/dist/types/__VUE/actionsheet/index.vue.d.ts +1 -1
- package/dist/types/__VUE/address/index.vue.d.ts +2 -2
- 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/calendaritem/index.vue.d.ts +4 -4
- 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/countup/index.vue.d.ts +2 -2
- package/dist/types/__VUE/datepicker/index.vue.d.ts +1 -1
- package/dist/types/__VUE/dialog/index.vue.d.ts +1 -1
- package/dist/types/__VUE/fixednav/index.vue.d.ts +1 -1
- package/dist/types/__VUE/grid/index.vue.d.ts +1 -1
- package/dist/types/__VUE/image/index.vue.d.ts +1 -1
- package/dist/types/__VUE/imagepreview/index.vue.d.ts +2 -2
- package/dist/types/__VUE/infiniteloading/index.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- 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/picker/Column.vue.d.ts +4 -4
- package/dist/types/__VUE/picker/index.vue.d.ts +23 -5
- package/dist/types/__VUE/popover/index.vue.d.ts +33 -4
- package/dist/types/__VUE/popover/type.d.ts +7 -0
- package/dist/types/__VUE/price/index.vue.d.ts +9 -0
- package/dist/types/__VUE/range/index.vue.d.ts +7 -7
- package/dist/types/__VUE/rate/index.vue.d.ts +1 -1
- package/dist/types/__VUE/searchbar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/step/index.vue.d.ts +1 -1
- package/dist/types/__VUE/swiper/index.vue.d.ts +9 -8
- package/dist/types/__VUE/swiperitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +1 -1
- package/dist/types/__VUE/tabbar/index.vue.d.ts +2 -11
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +4 -4
- package/dist/types/__VUE/timeselect/index.vue.d.ts +1 -1
- package/dist/types/__VUE/toast/index.vue.d.ts +1 -1
- package/dist/types/__VUE/uploader/index.vue.d.ts +3 -3
- package/dist/types/__VUE/video/index.vue.d.ts +3 -3
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/__VUE/swiper/use-touch.d.ts +0 -20
package/dist/nutui.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.3.0 Fri Dec
|
|
2
|
+
* @nutui/nutui v3.3.1-beta.0 Fri Dec 16 2022 15:46:54 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -353,6 +353,10 @@
|
|
|
353
353
|
}
|
|
354
354
|
return num.toString();
|
|
355
355
|
};
|
|
356
|
+
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
|
357
|
+
const getScrollTopRoot = () => {
|
|
358
|
+
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
359
|
+
};
|
|
356
360
|
const langs = vue.reactive({
|
|
357
361
|
"zh-CN": new Lang$1(),
|
|
358
362
|
"en-US": new Lang()
|
|
@@ -579,7 +583,7 @@
|
|
|
579
583
|
}
|
|
580
584
|
});
|
|
581
585
|
const _hoisted_1$1f = { class: "nut-button__warp" };
|
|
582
|
-
function _sfc_render$
|
|
586
|
+
function _sfc_render$1A(_ctx, _cache, $props, $setup, $data, $options) {
|
|
583
587
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
584
588
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
585
589
|
class: vue.normalizeClass(_ctx.classes),
|
|
@@ -607,7 +611,7 @@
|
|
|
607
611
|
])
|
|
608
612
|
], 6);
|
|
609
613
|
}
|
|
610
|
-
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$1M, [["render", _sfc_render$
|
|
614
|
+
var Button = /* @__PURE__ */ _export_sfc(_sfc_main$1M, [["render", _sfc_render$1A]]);
|
|
611
615
|
function useRouter() {
|
|
612
616
|
const proxy = vue.getCurrentInstance().proxy;
|
|
613
617
|
return proxy.$router || null;
|
|
@@ -622,7 +626,7 @@
|
|
|
622
626
|
};
|
|
623
627
|
const _hoisted_3$N = { class: "title" };
|
|
624
628
|
const _hoisted_4$C = { class: "nut-cell__title-desc" };
|
|
625
|
-
function render$
|
|
629
|
+
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
626
630
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
627
631
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
628
632
|
class: vue.normalizeClass(_ctx.classes),
|
|
@@ -711,7 +715,7 @@
|
|
|
711
715
|
};
|
|
712
716
|
}
|
|
713
717
|
});
|
|
714
|
-
var Cell = /* @__PURE__ */ _export_sfc(_sfc_main$1L, [["render", render$
|
|
718
|
+
var Cell = /* @__PURE__ */ _export_sfc(_sfc_main$1L, [["render", render$2]]);
|
|
715
719
|
const { componentName: componentName$1g, create: create$1K } = createComponent("cell-group");
|
|
716
720
|
const _sfc_main$1K = create$1K({
|
|
717
721
|
props: {
|
|
@@ -739,7 +743,7 @@
|
|
|
739
743
|
class: "nut-cell-group__desc"
|
|
740
744
|
};
|
|
741
745
|
const _hoisted_3$M = { class: "nut-cell-group__warp" };
|
|
742
|
-
function _sfc_render$
|
|
746
|
+
function _sfc_render$1z(_ctx, _cache, $props, $setup, $data, $options) {
|
|
743
747
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
744
748
|
class: vue.normalizeClass(_ctx.classes)
|
|
745
749
|
}, [
|
|
@@ -750,7 +754,7 @@
|
|
|
750
754
|
])
|
|
751
755
|
], 2);
|
|
752
756
|
}
|
|
753
|
-
var CellGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1K, [["render", _sfc_render$
|
|
757
|
+
var CellGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1K, [["render", _sfc_render$1z]]);
|
|
754
758
|
let count = 0;
|
|
755
759
|
const CLSNAME = "nut-overflow-hidden";
|
|
756
760
|
const useLockScroll = (isLock) => {
|
|
@@ -828,7 +832,7 @@
|
|
|
828
832
|
return { classes, style, onClick };
|
|
829
833
|
}
|
|
830
834
|
});
|
|
831
|
-
function _sfc_render$
|
|
835
|
+
function _sfc_render$1y(_ctx, _cache, $props, $setup, $data, $options) {
|
|
832
836
|
return vue.openBlock(), vue.createBlock(vue.Transition, { name: "overlay-fade" }, {
|
|
833
837
|
default: vue.withCtx(() => [
|
|
834
838
|
vue.withDirectives(vue.createElementVNode("view", {
|
|
@@ -844,7 +848,7 @@
|
|
|
844
848
|
_: 3
|
|
845
849
|
});
|
|
846
850
|
}
|
|
847
|
-
var OverLay = /* @__PURE__ */ _export_sfc(_sfc_main$1J, [["render", _sfc_render$
|
|
851
|
+
var OverLay = /* @__PURE__ */ _export_sfc(_sfc_main$1J, [["render", _sfc_render$1y]]);
|
|
848
852
|
const popupProps = {
|
|
849
853
|
visible: {
|
|
850
854
|
type: Boolean,
|
|
@@ -1019,7 +1023,7 @@
|
|
|
1019
1023
|
};
|
|
1020
1024
|
const { componentName: componentName$1e, create: create$1I } = createComponent("popup");
|
|
1021
1025
|
const _sfc_main$1I = create$1I(component$9(componentName$1e));
|
|
1022
|
-
function _sfc_render$
|
|
1026
|
+
function _sfc_render$1x(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1023
1027
|
const _component_nut_overlay = vue.resolveComponent("nut-overlay");
|
|
1024
1028
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
1025
1029
|
return vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
@@ -1065,7 +1069,7 @@
|
|
|
1065
1069
|
}, 8, ["name", "onAfterEnter", "onAfterLeave"])
|
|
1066
1070
|
], 8, ["to", "disabled"]);
|
|
1067
1071
|
}
|
|
1068
|
-
var Popup = /* @__PURE__ */ _export_sfc(_sfc_main$1I, [["render", _sfc_render$
|
|
1072
|
+
var Popup = /* @__PURE__ */ _export_sfc(_sfc_main$1I, [["render", _sfc_render$1x]]);
|
|
1069
1073
|
const component$8 = {
|
|
1070
1074
|
props: {
|
|
1071
1075
|
theme: { type: String, default: "" },
|
|
@@ -1188,7 +1192,7 @@
|
|
|
1188
1192
|
key: 1,
|
|
1189
1193
|
class: "nut-img-error"
|
|
1190
1194
|
};
|
|
1191
|
-
function _sfc_render$
|
|
1195
|
+
function _sfc_render$1w(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1192
1196
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
1193
1197
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
1194
1198
|
class: vue.normalizeClass(_ctx.classes),
|
|
@@ -1219,7 +1223,7 @@
|
|
|
1219
1223
|
])) : vue.createCommentVNode("", true)
|
|
1220
1224
|
], 6);
|
|
1221
1225
|
}
|
|
1222
|
-
var Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["render", _sfc_render$
|
|
1226
|
+
var Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["render", _sfc_render$1w]]);
|
|
1223
1227
|
const { create: create$1F } = createComponent("layout");
|
|
1224
1228
|
const _sfc_main$1F = create$1F({});
|
|
1225
1229
|
const { componentName: componentName$1b, create: create$1E } = createComponent("col");
|
|
@@ -1258,7 +1262,7 @@
|
|
|
1258
1262
|
};
|
|
1259
1263
|
}
|
|
1260
1264
|
});
|
|
1261
|
-
function _sfc_render$
|
|
1265
|
+
function _sfc_render$1v(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1262
1266
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
1263
1267
|
class: vue.normalizeClass(_ctx.classes),
|
|
1264
1268
|
style: vue.normalizeStyle(_ctx.style)
|
|
@@ -1266,7 +1270,7 @@
|
|
|
1266
1270
|
vue.renderSlot(_ctx.$slots, "default")
|
|
1267
1271
|
], 6);
|
|
1268
1272
|
}
|
|
1269
|
-
var Col = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["render", _sfc_render$
|
|
1273
|
+
var Col = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["render", _sfc_render$1v]]);
|
|
1270
1274
|
const { componentName: componentName$1a, create: create$1D } = createComponent("row");
|
|
1271
1275
|
const _sfc_main$1D = create$1D({
|
|
1272
1276
|
props: {
|
|
@@ -1312,14 +1316,14 @@
|
|
|
1312
1316
|
};
|
|
1313
1317
|
}
|
|
1314
1318
|
});
|
|
1315
|
-
function _sfc_render$
|
|
1319
|
+
function _sfc_render$1u(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1316
1320
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
1317
1321
|
class: vue.normalizeClass(_ctx.getClasses())
|
|
1318
1322
|
}, [
|
|
1319
1323
|
vue.renderSlot(_ctx.$slots, "default")
|
|
1320
1324
|
], 2);
|
|
1321
1325
|
}
|
|
1322
|
-
var Row = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["render", _sfc_render$
|
|
1326
|
+
var Row = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["render", _sfc_render$1u]]);
|
|
1323
1327
|
function isWindow(val) {
|
|
1324
1328
|
return val === window;
|
|
1325
1329
|
}
|
|
@@ -1542,7 +1546,7 @@
|
|
|
1542
1546
|
return { classes };
|
|
1543
1547
|
}
|
|
1544
1548
|
});
|
|
1545
|
-
function _sfc_render$
|
|
1549
|
+
function _sfc_render$1t(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1546
1550
|
return _ctx.direction === "horizontal" ? (vue.openBlock(), vue.createElementBlock("view", {
|
|
1547
1551
|
key: 0,
|
|
1548
1552
|
class: vue.normalizeClass(_ctx.classes)
|
|
@@ -1553,7 +1557,7 @@
|
|
|
1553
1557
|
class: vue.normalizeClass(_ctx.classes)
|
|
1554
1558
|
}, null, 2));
|
|
1555
1559
|
}
|
|
1556
|
-
var Divider = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["render", _sfc_render$
|
|
1560
|
+
var Divider = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["render", _sfc_render$1t]]);
|
|
1557
1561
|
function flattenVNodes(children, childName) {
|
|
1558
1562
|
const result = [];
|
|
1559
1563
|
const traverse = (children2) => {
|
|
@@ -1807,7 +1811,7 @@
|
|
|
1807
1811
|
key: 3,
|
|
1808
1812
|
class: "nut-grid-item__text"
|
|
1809
1813
|
};
|
|
1810
|
-
function _sfc_render$
|
|
1814
|
+
function _sfc_render$1s(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1811
1815
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
1812
1816
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
1813
1817
|
class: vue.normalizeClass(_ctx.rootClass),
|
|
@@ -1830,7 +1834,7 @@
|
|
|
1830
1834
|
], 2)
|
|
1831
1835
|
], 6);
|
|
1832
1836
|
}
|
|
1833
|
-
var GridItem = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["render", _sfc_render$
|
|
1837
|
+
var GridItem = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["render", _sfc_render$1s]]);
|
|
1834
1838
|
const { componentName: componentName$15, create: create$1y } = createComponent("navbar");
|
|
1835
1839
|
const _sfc_main$1y = create$1y({
|
|
1836
1840
|
props: {
|
|
@@ -1936,7 +1940,7 @@
|
|
|
1936
1940
|
key: 0,
|
|
1937
1941
|
class: "nut-navbar__text"
|
|
1938
1942
|
};
|
|
1939
|
-
function _sfc_render$
|
|
1943
|
+
function _sfc_render$1r(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1940
1944
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
1941
1945
|
return _ctx.fixed && _ctx.placeholder ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_1$1a, [
|
|
1942
1946
|
vue.createElementVNode("view", {
|
|
@@ -2020,7 +2024,7 @@
|
|
|
2020
2024
|
])
|
|
2021
2025
|
], 6));
|
|
2022
2026
|
}
|
|
2023
|
-
var Navbar = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["render", _sfc_render$
|
|
2027
|
+
var Navbar = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["render", _sfc_render$1r]]);
|
|
2024
2028
|
const { componentName: componentName$14, translate: translate$s } = createComponent("fixednav");
|
|
2025
2029
|
const component$6 = {
|
|
2026
2030
|
props: {
|
|
@@ -2095,7 +2099,7 @@
|
|
|
2095
2099
|
class: "b"
|
|
2096
2100
|
};
|
|
2097
2101
|
const _hoisted_6$o = { class: "text" };
|
|
2098
|
-
function render$
|
|
2102
|
+
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2099
2103
|
const _component_nut_overlay = vue.resolveComponent("nut-overlay");
|
|
2100
2104
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
2101
2105
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
@@ -2141,7 +2145,7 @@
|
|
|
2141
2145
|
}
|
|
2142
2146
|
const { create: create$1x } = createComponent("fixednav");
|
|
2143
2147
|
const _sfc_main$1x = create$1x(component$6);
|
|
2144
|
-
var FixedNav = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["render", render$
|
|
2148
|
+
var FixedNav = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["render", render$1]]);
|
|
2145
2149
|
const { componentName: componentName$13, create: create$1w } = createComponent("menu");
|
|
2146
2150
|
const _sfc_main$1w = create$1w({
|
|
2147
2151
|
props: {
|
|
@@ -2293,7 +2297,7 @@
|
|
|
2293
2297
|
});
|
|
2294
2298
|
const _hoisted_1$18 = ["onClick"];
|
|
2295
2299
|
const _hoisted_2$Y = { class: "nut-menu__title-text" };
|
|
2296
|
-
function _sfc_render$
|
|
2300
|
+
function _sfc_render$1q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2297
2301
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
2298
2302
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
2299
2303
|
class: vue.normalizeClass(_ctx.classes)
|
|
@@ -2325,7 +2329,7 @@
|
|
|
2325
2329
|
vue.renderSlot(_ctx.$slots, "default")
|
|
2326
2330
|
], 2);
|
|
2327
2331
|
}
|
|
2328
|
-
var Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["render", _sfc_render$
|
|
2332
|
+
var Menu = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["render", _sfc_render$1q]]);
|
|
2329
2333
|
const { componentName: componentName$12, create: create$1v } = createComponent("menu-item");
|
|
2330
2334
|
const _sfc_main$1v = create$1v({
|
|
2331
2335
|
props: {
|
|
@@ -2442,7 +2446,7 @@
|
|
|
2442
2446
|
});
|
|
2443
2447
|
const _hoisted_1$17 = { class: "nut-menu-item__content nut-menu-item__overflow" };
|
|
2444
2448
|
const _hoisted_2$X = ["onClick"];
|
|
2445
|
-
function _sfc_render$
|
|
2449
|
+
function _sfc_render$1p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2446
2450
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
2447
2451
|
const _component_nut_popup = vue.resolveComponent("nut-popup");
|
|
2448
2452
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("view", {
|
|
@@ -2500,7 +2504,7 @@
|
|
|
2500
2504
|
[vue.vShow, _ctx.state.showWrapper]
|
|
2501
2505
|
]);
|
|
2502
2506
|
}
|
|
2503
|
-
var MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$1v, [["render", _sfc_render$
|
|
2507
|
+
var MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$1v, [["render", _sfc_render$1p]]);
|
|
2504
2508
|
const { create: create$1u } = createComponent("tabbar");
|
|
2505
2509
|
const _sfc_main$1u = create$1u({
|
|
2506
2510
|
props: {
|
|
@@ -2512,10 +2516,6 @@
|
|
|
2512
2516
|
type: Boolean,
|
|
2513
2517
|
default: false
|
|
2514
2518
|
},
|
|
2515
|
-
type: {
|
|
2516
|
-
type: String,
|
|
2517
|
-
default: "base"
|
|
2518
|
-
},
|
|
2519
2519
|
size: {
|
|
2520
2520
|
type: String,
|
|
2521
2521
|
default: "20px"
|
|
@@ -2545,7 +2545,7 @@
|
|
|
2545
2545
|
val: props.visible,
|
|
2546
2546
|
children: []
|
|
2547
2547
|
});
|
|
2548
|
-
const nutTabbar = vue.ref(
|
|
2548
|
+
const nutTabbar = vue.ref();
|
|
2549
2549
|
function changeIndex(index, active) {
|
|
2550
2550
|
emit("update:visible", active);
|
|
2551
2551
|
parentData.modelValue = active;
|
|
@@ -2569,8 +2569,7 @@
|
|
|
2569
2569
|
vue.onMounted(() => {
|
|
2570
2570
|
if (bottom.value && placeholder.value) {
|
|
2571
2571
|
vue.nextTick(() => {
|
|
2572
|
-
|
|
2573
|
-
height.value = (_a = nutTabbar == null ? void 0 : nutTabbar.value) == null ? void 0 : _a.getBoundingClientRect().height;
|
|
2572
|
+
height.value = useRect(nutTabbar).height;
|
|
2574
2573
|
});
|
|
2575
2574
|
}
|
|
2576
2575
|
});
|
|
@@ -2581,7 +2580,7 @@
|
|
|
2581
2580
|
};
|
|
2582
2581
|
}
|
|
2583
2582
|
});
|
|
2584
|
-
function _sfc_render$
|
|
2583
|
+
function _sfc_render$1o(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2585
2584
|
return _ctx.bottom && _ctx.placeholder ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2586
2585
|
key: 0,
|
|
2587
2586
|
class: "nut-tabbar__placeholder",
|
|
@@ -2600,7 +2599,7 @@
|
|
|
2600
2599
|
vue.renderSlot(_ctx.$slots, "default")
|
|
2601
2600
|
], 2));
|
|
2602
2601
|
}
|
|
2603
|
-
var Tabbar = /* @__PURE__ */ _export_sfc(_sfc_main$1u, [["render", _sfc_render$
|
|
2602
|
+
var Tabbar = /* @__PURE__ */ _export_sfc(_sfc_main$1u, [["render", _sfc_render$1o]]);
|
|
2604
2603
|
const { create: create$1t } = createComponent("tabbar-item");
|
|
2605
2604
|
const _sfc_main$1t = create$1t({
|
|
2606
2605
|
props: {
|
|
@@ -2620,7 +2619,7 @@
|
|
|
2620
2619
|
default: ""
|
|
2621
2620
|
},
|
|
2622
2621
|
num: {
|
|
2623
|
-
type:
|
|
2622
|
+
type: Number,
|
|
2624
2623
|
default: ""
|
|
2625
2624
|
},
|
|
2626
2625
|
activeImg: {
|
|
@@ -2662,8 +2661,8 @@
|
|
|
2662
2661
|
var _a;
|
|
2663
2662
|
if (child.proxy) {
|
|
2664
2663
|
parent.children.push(child.proxy);
|
|
2665
|
-
const index =
|
|
2666
|
-
state.index = (_a = props.name) != null ? _a : index
|
|
2664
|
+
const index = parent.children.indexOf(child.proxy);
|
|
2665
|
+
state.index = (_a = props.name) != null ? _a : index;
|
|
2667
2666
|
}
|
|
2668
2667
|
};
|
|
2669
2668
|
relation(vue.getCurrentInstance());
|
|
@@ -2734,7 +2733,7 @@
|
|
|
2734
2733
|
};
|
|
2735
2734
|
const _hoisted_6$n = { key: 3 };
|
|
2736
2735
|
const _hoisted_7$k = { key: 0 };
|
|
2737
|
-
function _sfc_render$
|
|
2736
|
+
function _sfc_render$1n(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2738
2737
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
2739
2738
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
2740
2739
|
class: vue.normalizeClass(["nut-tabbar-item", { "nut-tabbar-item__icon--unactive": !_ctx.active }]),
|
|
@@ -2745,13 +2744,12 @@
|
|
|
2745
2744
|
}, [
|
|
2746
2745
|
vue.createElementVNode("view", _hoisted_1$16, [
|
|
2747
2746
|
!_ctx.dot ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
2748
|
-
_ctx.num && _ctx.num <= 99 ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$W, vue.toDisplayString(_ctx.num), 1)) : _ctx.num && _ctx.num
|
|
2747
|
+
_ctx.num && _ctx.num <= 99 ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_2$W, vue.toDisplayString(_ctx.num), 1)) : _ctx.num && _ctx.num >= 100 ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_3$I, vue.toDisplayString("99+"))) : vue.createCommentVNode("", true)
|
|
2749
2748
|
], 64)) : vue.createCommentVNode("", true),
|
|
2750
2749
|
_ctx.dot ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$z)) : vue.createCommentVNode("", true),
|
|
2751
|
-
_ctx.
|
|
2750
|
+
_ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5$q, [
|
|
2752
2751
|
vue.renderSlot(_ctx.$slots, "icon", { active: _ctx.active })
|
|
2753
|
-
])) : vue.
|
|
2754
|
-
_ctx.icon && !_ctx.isHaveSlot("icon") ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_6$n, [
|
|
2752
|
+
])) : _ctx.icon ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_6$n, [
|
|
2755
2753
|
vue.createVNode(_component_nut_icon, {
|
|
2756
2754
|
class: "nut-tabbar-item_icon-box_icon",
|
|
2757
2755
|
size: _ctx.state.size,
|
|
@@ -2759,8 +2757,7 @@
|
|
|
2759
2757
|
"font-class-name": _ctx.fontClassName,
|
|
2760
2758
|
"class-prefix": _ctx.classPrefix
|
|
2761
2759
|
}, null, 8, ["size", "name", "font-class-name", "class-prefix"])
|
|
2762
|
-
])) : vue.
|
|
2763
|
-
!_ctx.icon && _ctx.activeImg && !_ctx.isHaveSlot("icon") ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2760
|
+
])) : _ctx.activeImg ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2764
2761
|
key: 4,
|
|
2765
2762
|
class: "nut-tabbar-item_icon-box_icon",
|
|
2766
2763
|
style: vue.normalizeStyle({
|
|
@@ -2772,16 +2769,17 @@
|
|
|
2772
2769
|
vue.createElementVNode("view", {
|
|
2773
2770
|
class: vue.normalizeClass([
|
|
2774
2771
|
"nut-tabbar-item_icon-box_nav-word",
|
|
2775
|
-
{ "nut-tabbar-item_icon-box_big-word": !_ctx.icon && !_ctx.activeImg && !_ctx.
|
|
2772
|
+
{ "nut-tabbar-item_icon-box_big-word": !_ctx.icon && !_ctx.activeImg && !_ctx.$slots.icon }
|
|
2776
2773
|
])
|
|
2777
2774
|
}, [
|
|
2778
|
-
|
|
2779
|
-
|
|
2775
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
2776
|
+
_ctx.tabTitle ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_7$k, vue.toDisplayString(_ctx.tabTitle), 1)) : vue.createCommentVNode("", true)
|
|
2777
|
+
])
|
|
2780
2778
|
], 2)
|
|
2781
2779
|
])
|
|
2782
2780
|
], 6);
|
|
2783
2781
|
}
|
|
2784
|
-
var TabbarItem = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["render", _sfc_render$
|
|
2782
|
+
var TabbarItem = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["render", _sfc_render$1n]]);
|
|
2785
2783
|
function useExpose(apis) {
|
|
2786
2784
|
const instance = vue.getCurrentInstance();
|
|
2787
2785
|
if (instance) {
|
|
@@ -2980,7 +2978,7 @@
|
|
|
2980
2978
|
const _hoisted_4$y = { class: "fixed-title" };
|
|
2981
2979
|
const _hoisted_5$p = { class: "nut-elevator__bars__inner" };
|
|
2982
2980
|
const _hoisted_6$m = ["data-index", "onClick"];
|
|
2983
|
-
function _sfc_render$
|
|
2981
|
+
function _sfc_render$1m(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2984
2982
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
2985
2983
|
class: vue.normalizeClass(_ctx.classes)
|
|
2986
2984
|
}, [
|
|
@@ -3051,7 +3049,7 @@
|
|
|
3051
3049
|
], 32)
|
|
3052
3050
|
], 2);
|
|
3053
3051
|
}
|
|
3054
|
-
var Elevator = /* @__PURE__ */ _export_sfc(_sfc_main$1s, [["render", _sfc_render$
|
|
3052
|
+
var Elevator = /* @__PURE__ */ _export_sfc(_sfc_main$1s, [["render", _sfc_render$1m]]);
|
|
3055
3053
|
const { create: create$1r, translate: translate$r } = createComponent("pagination");
|
|
3056
3054
|
const _sfc_main$1r = create$1r({
|
|
3057
3055
|
props: {
|
|
@@ -3170,7 +3168,7 @@
|
|
|
3170
3168
|
class: "nut-pagination-contain"
|
|
3171
3169
|
};
|
|
3172
3170
|
const _hoisted_5$o = { class: "nut-pagination-simple" };
|
|
3173
|
-
function _sfc_render$
|
|
3171
|
+
function _sfc_render$1l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3174
3172
|
return vue.openBlock(), vue.createElementBlock("view", _hoisted_1$14, [
|
|
3175
3173
|
vue.createElementVNode("view", {
|
|
3176
3174
|
class: vue.normalizeClass(["nut-pagination-prev", _ctx.mode == "multi" ? "" : "simple-border", _ctx.modelValue == 1 ? "disabled" : ""]),
|
|
@@ -3206,7 +3204,7 @@
|
|
|
3206
3204
|
], 2)
|
|
3207
3205
|
]);
|
|
3208
3206
|
}
|
|
3209
|
-
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["render", _sfc_render$
|
|
3207
|
+
var Pagination = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["render", _sfc_render$1l]]);
|
|
3210
3208
|
class Title {
|
|
3211
3209
|
constructor() {
|
|
3212
3210
|
this.title = "";
|
|
@@ -3333,9 +3331,6 @@
|
|
|
3333
3331
|
init(vnodes);
|
|
3334
3332
|
}
|
|
3335
3333
|
);
|
|
3336
|
-
const getScrollTopRoot = () => {
|
|
3337
|
-
return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
3338
|
-
};
|
|
3339
3334
|
vue.watch(
|
|
3340
3335
|
() => props.modelValue,
|
|
3341
3336
|
(value) => {
|
|
@@ -3398,9 +3393,11 @@
|
|
|
3398
3393
|
};
|
|
3399
3394
|
}
|
|
3400
3395
|
};
|
|
3396
|
+
const { create: create$1q } = createComponent("tabs");
|
|
3397
|
+
const _sfc_main$1q = create$1q(component$5);
|
|
3401
3398
|
const _hoisted_1$13 = ["onClick"];
|
|
3402
3399
|
const _hoisted_2$T = ["onClick"];
|
|
3403
|
-
function
|
|
3400
|
+
function _sfc_render$1k(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3404
3401
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
3405
3402
|
const _component_nut_sticky = vue.resolveComponent("nut-sticky");
|
|
3406
3403
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
@@ -3490,9 +3487,7 @@
|
|
|
3490
3487
|
], 4)
|
|
3491
3488
|
], 2);
|
|
3492
3489
|
}
|
|
3493
|
-
|
|
3494
|
-
const _sfc_main$1q = create$1q(component$5);
|
|
3495
|
-
var Tabs = /* @__PURE__ */ _export_sfc(_sfc_main$1q, [["render", render$1]]);
|
|
3490
|
+
var Tabs = /* @__PURE__ */ _export_sfc(_sfc_main$1q, [["render", _sfc_render$1k]]);
|
|
3496
3491
|
const { create: create$1p } = createComponent("tabpane");
|
|
3497
3492
|
const _sfc_main$1p = create$1p({
|
|
3498
3493
|
props: {
|
|
@@ -3789,7 +3784,7 @@
|
|
|
3789
3784
|
}
|
|
3790
3785
|
return "";
|
|
3791
3786
|
}
|
|
3792
|
-
function useTouch
|
|
3787
|
+
function useTouch() {
|
|
3793
3788
|
const startX = vue.ref(0);
|
|
3794
3789
|
const startY = vue.ref(0);
|
|
3795
3790
|
const moveX = vue.ref(0);
|
|
@@ -3893,7 +3888,7 @@
|
|
|
3893
3888
|
let currentValue;
|
|
3894
3889
|
const root = vue.ref();
|
|
3895
3890
|
const dragStatus = vue.ref();
|
|
3896
|
-
const touch = useTouch
|
|
3891
|
+
const touch = useTouch();
|
|
3897
3892
|
const marksList = vue.computed(() => {
|
|
3898
3893
|
const { marks, max, min } = props;
|
|
3899
3894
|
const marksKeys = Object.keys(marks);
|
|
@@ -6371,7 +6366,7 @@
|
|
|
6371
6366
|
},
|
|
6372
6367
|
emits: ["click", "change"],
|
|
6373
6368
|
setup(props, { emit }) {
|
|
6374
|
-
const touch = useTouch
|
|
6369
|
+
const touch = useTouch();
|
|
6375
6370
|
const wrapper = vue.ref();
|
|
6376
6371
|
const state = vue.reactive({
|
|
6377
6372
|
touchParams: {
|
|
@@ -6495,7 +6490,7 @@
|
|
|
6495
6490
|
let currentDeg = (-updateMove / state.lineSpacing + 1) * state.rotation;
|
|
6496
6491
|
const maxDeg = (props.column.length + 1) * state.rotation;
|
|
6497
6492
|
const minDeg = 0;
|
|
6498
|
-
deg =
|
|
6493
|
+
deg = clamp(currentDeg, minDeg, maxDeg);
|
|
6499
6494
|
if (minDeg < deg && deg < maxDeg) {
|
|
6500
6495
|
setTransform(updateMove, null, void 0, deg + "deg");
|
|
6501
6496
|
state.currIndex = Math.abs(Math.round(updateMove / state.lineSpacing)) + 1;
|
|
@@ -6636,6 +6631,14 @@
|
|
|
6636
6631
|
swipeDuration: {
|
|
6637
6632
|
type: [Number, String],
|
|
6638
6633
|
default: 1e3
|
|
6634
|
+
},
|
|
6635
|
+
showOkText: {
|
|
6636
|
+
type: Boolean,
|
|
6637
|
+
default: true
|
|
6638
|
+
},
|
|
6639
|
+
showCancelText: {
|
|
6640
|
+
type: Boolean,
|
|
6641
|
+
default: true
|
|
6639
6642
|
}
|
|
6640
6643
|
},
|
|
6641
6644
|
emits: ["close", "change", "confirm", "update:visible", "update:modelValue"],
|
|
@@ -6844,15 +6847,17 @@
|
|
|
6844
6847
|
}, {
|
|
6845
6848
|
default: vue.withCtx(() => [
|
|
6846
6849
|
vue.createElementVNode("view", _hoisted_1$V, [
|
|
6847
|
-
vue.
|
|
6850
|
+
_ctx.showCancelText ? (vue.openBlock(), vue.createElementBlock("view", {
|
|
6851
|
+
key: 0,
|
|
6848
6852
|
class: "nut-picker__left",
|
|
6849
6853
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
|
|
6850
|
-
}, vue.toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1),
|
|
6854
|
+
}, vue.toDisplayString(_ctx.cancelText || _ctx.translate("cancel")), 1)) : vue.createCommentVNode("", true),
|
|
6851
6855
|
vue.createElementVNode("view", _hoisted_2$K, vue.toDisplayString(_ctx.title), 1),
|
|
6852
|
-
vue.
|
|
6856
|
+
_ctx.showOkText ? (vue.openBlock(), vue.createElementBlock("view", {
|
|
6857
|
+
key: 1,
|
|
6853
6858
|
class: "nut-picker__right",
|
|
6854
6859
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.confirmHandler())
|
|
6855
|
-
}, vue.toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)
|
|
6860
|
+
}, vue.toDisplayString(_ctx.okText || _ctx.translate("confirm")), 1)) : vue.createCommentVNode("", true)
|
|
6856
6861
|
]),
|
|
6857
6862
|
vue.renderSlot(_ctx.$slots, "top"),
|
|
6858
6863
|
vue.createElementVNode("view", _hoisted_3$A, [
|
|
@@ -8073,7 +8078,7 @@
|
|
|
8073
8078
|
}
|
|
8074
8079
|
return v;
|
|
8075
8080
|
};
|
|
8076
|
-
const touch = useTouch
|
|
8081
|
+
const touch = useTouch();
|
|
8077
8082
|
const touchMethods = {
|
|
8078
8083
|
onTouchStart(event) {
|
|
8079
8084
|
if (!props.touchable)
|
|
@@ -9606,7 +9611,7 @@
|
|
|
9606
9611
|
}
|
|
9607
9612
|
state.offset = offset;
|
|
9608
9613
|
};
|
|
9609
|
-
const touch = useTouch
|
|
9614
|
+
const touch = useTouch();
|
|
9610
9615
|
const touchMethods = {
|
|
9611
9616
|
onTouchStart(event) {
|
|
9612
9617
|
if (props.disabled)
|
|
@@ -10504,7 +10509,7 @@
|
|
|
10504
10509
|
},
|
|
10505
10510
|
emits: ["scroll-change", "load-more", "refresh"],
|
|
10506
10511
|
setup(props, { emit, slots }) {
|
|
10507
|
-
const touch = useTouch
|
|
10512
|
+
const touch = useTouch();
|
|
10508
10513
|
const state = vue.reactive({
|
|
10509
10514
|
scrollEl: window,
|
|
10510
10515
|
scroller: null,
|
|
@@ -10526,17 +10531,9 @@
|
|
|
10526
10531
|
const getStyle = vue.computed(() => {
|
|
10527
10532
|
return {
|
|
10528
10533
|
height: state.distance < 0 ? `0px` : `${state.distance}px`,
|
|
10529
|
-
|
|
10534
|
+
transitionDuration: state.isTouching ? 0 : `0.2s`
|
|
10530
10535
|
};
|
|
10531
10536
|
});
|
|
10532
|
-
const requestAniFrame2 = () => {
|
|
10533
|
-
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
|
|
10534
|
-
window.setTimeout(callback, 1e3 / 60);
|
|
10535
|
-
};
|
|
10536
|
-
};
|
|
10537
|
-
const getWindowScrollTop = () => {
|
|
10538
|
-
return window.pageYOffset !== void 0 ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
|
|
10539
|
-
};
|
|
10540
10537
|
const calculateTopPosition = (el) => {
|
|
10541
10538
|
return !el ? 0 : el.offsetTop + calculateTopPosition(el.offsetParent);
|
|
10542
10539
|
};
|
|
@@ -10544,8 +10541,8 @@
|
|
|
10544
10541
|
let offsetDistance = 0;
|
|
10545
10542
|
let resScrollTop = 0;
|
|
10546
10543
|
let direction = "down";
|
|
10547
|
-
const windowScrollTop = getWindowScrollTop();
|
|
10548
10544
|
if (props.useWindow) {
|
|
10545
|
+
const windowScrollTop = getScrollTopRoot();
|
|
10549
10546
|
if (state.scroller) {
|
|
10550
10547
|
offsetDistance = calculateTopPosition(state.scroller) + state.scroller.offsetHeight - windowScrollTop - window.innerHeight;
|
|
10551
10548
|
}
|
|
@@ -10568,7 +10565,7 @@
|
|
|
10568
10565
|
state.isInfiniting = false;
|
|
10569
10566
|
};
|
|
10570
10567
|
const handleScroll = () => {
|
|
10571
|
-
|
|
10568
|
+
requestAniFrame$1(() => {
|
|
10572
10569
|
if (!isScrollAtBottom() || !props.hasMore || state.isInfiniting) {
|
|
10573
10570
|
return false;
|
|
10574
10571
|
} else {
|
|
@@ -10620,14 +10617,16 @@
|
|
|
10620
10617
|
const getParentElement = (el) => {
|
|
10621
10618
|
return !!props.containerId ? document.querySelector(`#${props.containerId}`) : el && el.parentNode;
|
|
10622
10619
|
};
|
|
10620
|
+
const removeScrollListener = () => {
|
|
10621
|
+
state.scrollEl.removeEventListener("scroll", handleScroll, props.useCapture);
|
|
10622
|
+
};
|
|
10623
10623
|
vue.onMounted(() => {
|
|
10624
10624
|
const parentElement = getParentElement(state.scroller);
|
|
10625
10625
|
state.scrollEl = props.useWindow ? window : parentElement;
|
|
10626
10626
|
scrollListener();
|
|
10627
|
-
console.log(slots);
|
|
10628
10627
|
});
|
|
10629
10628
|
vue.onUnmounted(() => {
|
|
10630
|
-
|
|
10629
|
+
removeScrollListener();
|
|
10631
10630
|
});
|
|
10632
10631
|
const isKeepAlive = vue.ref(false);
|
|
10633
10632
|
vue.onActivated(() => {
|
|
@@ -10638,7 +10637,7 @@
|
|
|
10638
10637
|
});
|
|
10639
10638
|
vue.onDeactivated(() => {
|
|
10640
10639
|
isKeepAlive.value = true;
|
|
10641
|
-
|
|
10640
|
+
removeScrollListener();
|
|
10642
10641
|
});
|
|
10643
10642
|
return {
|
|
10644
10643
|
classes,
|
|
@@ -10661,10 +10660,7 @@
|
|
|
10661
10660
|
class: "bottom-box"
|
|
10662
10661
|
};
|
|
10663
10662
|
const _hoisted_6$e = { class: "bottom-text" };
|
|
10664
|
-
const _hoisted_7$c = {
|
|
10665
|
-
key: 0,
|
|
10666
|
-
class: "tips"
|
|
10667
|
-
};
|
|
10663
|
+
const _hoisted_7$c = { class: "tips" };
|
|
10668
10664
|
function _sfc_render$U(_ctx, _cache, $props, $setup, $data, $options) {
|
|
10669
10665
|
const _component_nut_icon = vue.resolveComponent("nut-icon");
|
|
10670
10666
|
return vue.openBlock(), vue.createElementBlock("view", {
|
|
@@ -10689,13 +10685,13 @@
|
|
|
10689
10685
|
]),
|
|
10690
10686
|
vue.createElementVNode("view", _hoisted_4$n, [
|
|
10691
10687
|
_ctx.isInfiniting ? (vue.openBlock(), vue.createElementBlock("view", _hoisted_5$f, [
|
|
10692
|
-
|
|
10688
|
+
vue.renderSlot(_ctx.$slots, "loading", {}, () => [
|
|
10693
10689
|
vue.createVNode(_component_nut_icon, vue.mergeProps({ class: "bottom-img" }, _ctx.$attrs, { name: _ctx.loadIcon }), null, 16, ["name"]),
|
|
10694
10690
|
vue.createElementVNode("view", _hoisted_6$e, vue.toDisplayString(_ctx.loadTxt || _ctx.translate("loading")), 1)
|
|
10695
|
-
]
|
|
10696
|
-
])) : !_ctx.hasMore ?
|
|
10697
|
-
|
|
10698
|
-
]
|
|
10691
|
+
])
|
|
10692
|
+
])) : !_ctx.hasMore ? vue.renderSlot(_ctx.$slots, "finished", { key: 1 }, () => [
|
|
10693
|
+
vue.createElementVNode("view", _hoisted_7$c, vue.toDisplayString(_ctx.loadMoreTxt || _ctx.translate("loadMoreTxt")), 1)
|
|
10694
|
+
]) : vue.createCommentVNode("", true)
|
|
10699
10695
|
])
|
|
10700
10696
|
], 34);
|
|
10701
10697
|
}
|
|
@@ -13290,54 +13286,6 @@
|
|
|
13290
13286
|
], 2);
|
|
13291
13287
|
}
|
|
13292
13288
|
var Step = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$G]]);
|
|
13293
|
-
const DISTANCE = 5;
|
|
13294
|
-
function useTouch() {
|
|
13295
|
-
const state = vue.reactive({
|
|
13296
|
-
startX: 0,
|
|
13297
|
-
startY: 0,
|
|
13298
|
-
deltaX: 0,
|
|
13299
|
-
deltaY: 0,
|
|
13300
|
-
offsetX: 0,
|
|
13301
|
-
offsetY: 0,
|
|
13302
|
-
direction: ""
|
|
13303
|
-
});
|
|
13304
|
-
const getDirection2 = (x, y) => {
|
|
13305
|
-
if (x > y && x > DISTANCE)
|
|
13306
|
-
return "horizontal";
|
|
13307
|
-
if (y > x && y > DISTANCE)
|
|
13308
|
-
return "vertical";
|
|
13309
|
-
return "";
|
|
13310
|
-
};
|
|
13311
|
-
const reset = () => {
|
|
13312
|
-
state.startX = 0;
|
|
13313
|
-
state.startY = 0;
|
|
13314
|
-
state.deltaX = 0;
|
|
13315
|
-
state.deltaY = 0;
|
|
13316
|
-
state.offsetX = 0;
|
|
13317
|
-
state.offsetY = 0;
|
|
13318
|
-
state.direction = "";
|
|
13319
|
-
};
|
|
13320
|
-
const start = (e) => {
|
|
13321
|
-
reset();
|
|
13322
|
-
state.startX = e.touches[0].clientX;
|
|
13323
|
-
state.startY = e.touches[0].clientY;
|
|
13324
|
-
};
|
|
13325
|
-
const move = (e) => {
|
|
13326
|
-
state.deltaX = e.touches[0].clientX - state.startX;
|
|
13327
|
-
state.deltaY = e.touches[0].clientY - state.startY;
|
|
13328
|
-
state.offsetX = Math.abs(state.deltaX);
|
|
13329
|
-
state.offsetY = Math.abs(state.deltaY);
|
|
13330
|
-
if (!state.direction) {
|
|
13331
|
-
state.direction = getDirection2(state.offsetX, state.offsetY);
|
|
13332
|
-
}
|
|
13333
|
-
};
|
|
13334
|
-
return {
|
|
13335
|
-
state,
|
|
13336
|
-
start,
|
|
13337
|
-
reset,
|
|
13338
|
-
move
|
|
13339
|
-
};
|
|
13340
|
-
}
|
|
13341
13289
|
const { create: create$F, componentName: componentName$u } = createComponent("swiper");
|
|
13342
13290
|
const _sfc_main$F = create$F({
|
|
13343
13291
|
props: {
|
|
@@ -13350,7 +13298,7 @@
|
|
|
13350
13298
|
default: 0
|
|
13351
13299
|
},
|
|
13352
13300
|
direction: {
|
|
13353
|
-
type:
|
|
13301
|
+
type: String,
|
|
13354
13302
|
default: "horizontal"
|
|
13355
13303
|
},
|
|
13356
13304
|
paginationVisible: {
|
|
@@ -13419,11 +13367,25 @@
|
|
|
13419
13367
|
};
|
|
13420
13368
|
});
|
|
13421
13369
|
const isVertical = vue.computed(() => props.direction === "vertical");
|
|
13370
|
+
const classesInner = vue.computed(() => {
|
|
13371
|
+
const prefixCls = componentName$u;
|
|
13372
|
+
return {
|
|
13373
|
+
[`${prefixCls}-inner`]: true,
|
|
13374
|
+
[`${prefixCls}-vertical`]: isVertical.value
|
|
13375
|
+
};
|
|
13376
|
+
});
|
|
13377
|
+
const classesPagination = vue.computed(() => {
|
|
13378
|
+
const prefixCls = componentName$u;
|
|
13379
|
+
return {
|
|
13380
|
+
[`${prefixCls}-pagination`]: true,
|
|
13381
|
+
[`${prefixCls}-pagination-vertical`]: isVertical.value
|
|
13382
|
+
};
|
|
13383
|
+
});
|
|
13422
13384
|
const delTa = vue.computed(() => {
|
|
13423
|
-
return isVertical.value ? touch.
|
|
13385
|
+
return isVertical.value ? touch.deltaY.value : touch.deltaX.value;
|
|
13424
13386
|
});
|
|
13425
13387
|
const isCorrectDirection = vue.computed(() => {
|
|
13426
|
-
return touch.
|
|
13388
|
+
return touch.direction.value === props.direction;
|
|
13427
13389
|
});
|
|
13428
13390
|
const childCount = vue.computed(() => state.children.length);
|
|
13429
13391
|
const size = vue.computed(() => state[isVertical.value ? "height" : "width"]);
|
|
@@ -13438,12 +13400,7 @@
|
|
|
13438
13400
|
const activePagination = vue.computed(() => (state.active + childCount.value) % childCount.value);
|
|
13439
13401
|
const getStyle = () => {
|
|
13440
13402
|
let offset = 0;
|
|
13441
|
-
|
|
13442
|
-
offset = state.offset;
|
|
13443
|
-
} else {
|
|
13444
|
-
let val = isVertical.value ? state.rect.height - size.value : state.rect.width - size.value;
|
|
13445
|
-
offset = state.offset + (state.active === childCount.value - 1 ? -val / 2 : val / 2);
|
|
13446
|
-
}
|
|
13403
|
+
offset = state.offset;
|
|
13447
13404
|
state.style = {
|
|
13448
13405
|
transitionDuration: `${state.moving ? 0 : props.duration}ms`,
|
|
13449
13406
|
transform: `translate${isVertical.value ? "Y" : "X"}(${offset}px)`,
|
|
@@ -13454,26 +13411,27 @@
|
|
|
13454
13411
|
const relation = (child) => {
|
|
13455
13412
|
var _a;
|
|
13456
13413
|
let children = [];
|
|
13414
|
+
const childrenVNodeLen = state.childrenVNode.length;
|
|
13457
13415
|
let slot = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots);
|
|
13458
13416
|
slot = slot.filter((item) => item.children && Array.isArray(item.children));
|
|
13459
13417
|
slot.forEach((item) => {
|
|
13460
13418
|
children = children.concat(item.children);
|
|
13461
13419
|
});
|
|
13462
|
-
if (!
|
|
13420
|
+
if (!childrenVNodeLen) {
|
|
13463
13421
|
state.childrenVNode = children.slice();
|
|
13464
13422
|
child.proxy && state.children.push(child.proxy);
|
|
13465
13423
|
} else {
|
|
13466
|
-
if (
|
|
13424
|
+
if (childrenVNodeLen > children.length) {
|
|
13467
13425
|
state.children = state.children.filter((item) => child.proxy !== item);
|
|
13468
|
-
} else if (
|
|
13469
|
-
for (let i = 0; i <
|
|
13426
|
+
} else if (childrenVNodeLen < children.length) {
|
|
13427
|
+
for (let i = 0; i < childrenVNodeLen; i++) {
|
|
13470
13428
|
if (children[i].key !== state.childrenVNode[i].key) {
|
|
13471
13429
|
child.proxy && state.children.splice(i, 0, child.proxy);
|
|
13472
13430
|
child.vnode && state.childrenVNode.splice(i, 0, child.vnode);
|
|
13473
13431
|
break;
|
|
13474
13432
|
}
|
|
13475
13433
|
}
|
|
13476
|
-
if (
|
|
13434
|
+
if (childrenVNodeLen !== children.length) {
|
|
13477
13435
|
child.proxy && state.children.push(child.proxy);
|
|
13478
13436
|
child.vnode && state.childrenVNode.push(child.vnode);
|
|
13479
13437
|
}
|
|
@@ -13483,12 +13441,6 @@
|
|
|
13483
13441
|
}
|
|
13484
13442
|
}
|
|
13485
13443
|
};
|
|
13486
|
-
const range = (num, min, max) => {
|
|
13487
|
-
return Math.min(Math.max(num, min), max);
|
|
13488
|
-
};
|
|
13489
|
-
const requestFrame = (fn) => {
|
|
13490
|
-
window.requestAnimationFrame.call(window, fn);
|
|
13491
|
-
};
|
|
13492
13444
|
const getOffset = (active, offset = 0) => {
|
|
13493
13445
|
let currentPosition = active * size.value;
|
|
13494
13446
|
if (!props.loop) {
|
|
@@ -13496,7 +13448,7 @@
|
|
|
13496
13448
|
}
|
|
13497
13449
|
let targetOffset = offset - currentPosition;
|
|
13498
13450
|
if (!props.loop) {
|
|
13499
|
-
targetOffset =
|
|
13451
|
+
targetOffset = clamp(targetOffset, minOffset.value, 0);
|
|
13500
13452
|
}
|
|
13501
13453
|
return targetOffset;
|
|
13502
13454
|
};
|
|
@@ -13504,9 +13456,9 @@
|
|
|
13504
13456
|
const { active } = state;
|
|
13505
13457
|
if (pace) {
|
|
13506
13458
|
if (props.loop) {
|
|
13507
|
-
return
|
|
13459
|
+
return clamp(active + pace, -1, childCount.value);
|
|
13508
13460
|
}
|
|
13509
|
-
return
|
|
13461
|
+
return clamp(active + pace, 0, childCount.value - 1);
|
|
13510
13462
|
}
|
|
13511
13463
|
return active;
|
|
13512
13464
|
};
|
|
@@ -13545,48 +13497,39 @@
|
|
|
13545
13497
|
const stopAutoPlay = () => {
|
|
13546
13498
|
clearTimeout(state.autoplayTimer);
|
|
13547
13499
|
};
|
|
13548
|
-
const
|
|
13500
|
+
const jump = (pace) => {
|
|
13549
13501
|
resettPosition();
|
|
13550
13502
|
touch.reset();
|
|
13551
|
-
|
|
13552
|
-
|
|
13503
|
+
requestAniFrame$1(() => {
|
|
13504
|
+
requestAniFrame$1(() => {
|
|
13553
13505
|
state.moving = false;
|
|
13554
13506
|
move({
|
|
13555
|
-
pace
|
|
13507
|
+
pace,
|
|
13556
13508
|
isEmit: true
|
|
13557
13509
|
});
|
|
13558
13510
|
});
|
|
13559
13511
|
});
|
|
13560
13512
|
};
|
|
13513
|
+
const prev = () => {
|
|
13514
|
+
jump(-1);
|
|
13515
|
+
};
|
|
13561
13516
|
const next = () => {
|
|
13562
|
-
|
|
13563
|
-
touch.reset();
|
|
13564
|
-
requestFrame(() => {
|
|
13565
|
-
requestFrame(() => {
|
|
13566
|
-
state.moving = false;
|
|
13567
|
-
move({
|
|
13568
|
-
pace: 1,
|
|
13569
|
-
isEmit: true
|
|
13570
|
-
});
|
|
13571
|
-
});
|
|
13572
|
-
});
|
|
13517
|
+
jump(1);
|
|
13573
13518
|
};
|
|
13574
13519
|
const to = (index) => {
|
|
13575
13520
|
resettPosition();
|
|
13576
13521
|
touch.reset();
|
|
13577
|
-
|
|
13578
|
-
|
|
13579
|
-
|
|
13580
|
-
|
|
13581
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
isEmit: true
|
|
13589
|
-
});
|
|
13522
|
+
requestAniFrame$1(() => {
|
|
13523
|
+
state.moving = false;
|
|
13524
|
+
let targetIndex;
|
|
13525
|
+
if (props.loop && childCount.value === index) {
|
|
13526
|
+
targetIndex = state.active === 0 ? 0 : index;
|
|
13527
|
+
} else {
|
|
13528
|
+
targetIndex = index % childCount.value;
|
|
13529
|
+
}
|
|
13530
|
+
move({
|
|
13531
|
+
pace: targetIndex - state.active,
|
|
13532
|
+
isEmit: true
|
|
13590
13533
|
});
|
|
13591
13534
|
});
|
|
13592
13535
|
};
|
|
@@ -13640,7 +13583,7 @@
|
|
|
13640
13583
|
const isShouldMove = Math.abs(speed) > 0.3 || Math.abs(delTa.value) > +(size.value / 2).toFixed(2);
|
|
13641
13584
|
if (isShouldMove && isCorrectDirection.value) {
|
|
13642
13585
|
let pace = 0;
|
|
13643
|
-
const offset = isVertical.value ? touch.
|
|
13586
|
+
const offset = isVertical.value ? touch.offsetY.value : touch.offsetX.value;
|
|
13644
13587
|
if (props.loop) {
|
|
13645
13588
|
pace = offset > 0 ? delTa.value > 0 ? -1 : 1 : 0;
|
|
13646
13589
|
} else {
|
|
@@ -13698,10 +13641,9 @@
|
|
|
13698
13641
|
return {
|
|
13699
13642
|
state,
|
|
13700
13643
|
classes,
|
|
13644
|
+
classesInner,
|
|
13645
|
+
classesPagination,
|
|
13701
13646
|
container,
|
|
13702
|
-
componentName: componentName$u,
|
|
13703
|
-
isVertical,
|
|
13704
|
-
slots,
|
|
13705
13647
|
activePagination,
|
|
13706
13648
|
onTouchStart,
|
|
13707
13649
|
onTouchMove,
|
|
@@ -13719,21 +13661,15 @@
|
|
|
13719
13661
|
onTouchcancel: _cache[3] || (_cache[3] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args))
|
|
13720
13662
|
}, [
|
|
13721
13663
|
vue.createElementVNode("view", {
|
|
13722
|
-
class: vue.normalizeClass(
|
|
13723
|
-
[`${_ctx.componentName}-inner`]: true,
|
|
13724
|
-
[`${_ctx.componentName}-vertical`]: _ctx.isVertical
|
|
13725
|
-
}),
|
|
13664
|
+
class: vue.normalizeClass(_ctx.classesInner),
|
|
13726
13665
|
style: vue.normalizeStyle(_ctx.state.style)
|
|
13727
13666
|
}, [
|
|
13728
13667
|
vue.renderSlot(_ctx.$slots, "default")
|
|
13729
13668
|
], 6),
|
|
13730
13669
|
vue.renderSlot(_ctx.$slots, "page"),
|
|
13731
|
-
_ctx.paginationVisible && !_ctx
|
|
13670
|
+
_ctx.paginationVisible && !_ctx.$slots.page ? (vue.openBlock(), vue.createElementBlock("view", {
|
|
13732
13671
|
key: 0,
|
|
13733
|
-
class: vue.normalizeClass(
|
|
13734
|
-
[`${_ctx.componentName}-pagination`]: true,
|
|
13735
|
-
[`${_ctx.componentName}-pagination-vertical`]: _ctx.isVertical
|
|
13736
|
-
})
|
|
13672
|
+
class: vue.normalizeClass(_ctx.classesPagination)
|
|
13737
13673
|
}, [
|
|
13738
13674
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.state.children.length, (item, index) => {
|
|
13739
13675
|
return vue.openBlock(), vue.createElementBlock("i", {
|
|
@@ -13825,12 +13761,17 @@
|
|
|
13825
13761
|
size: {
|
|
13826
13762
|
type: String,
|
|
13827
13763
|
default: "large"
|
|
13764
|
+
},
|
|
13765
|
+
strikeThrough: {
|
|
13766
|
+
type: Boolean,
|
|
13767
|
+
default: false
|
|
13828
13768
|
}
|
|
13829
13769
|
},
|
|
13830
13770
|
setup(props) {
|
|
13831
13771
|
const classes = vue.computed(() => {
|
|
13832
13772
|
return {
|
|
13833
|
-
[componentName$s]: true
|
|
13773
|
+
[componentName$s]: true,
|
|
13774
|
+
[`${componentName$s}--strike`]: props.strikeThrough
|
|
13834
13775
|
};
|
|
13835
13776
|
});
|
|
13836
13777
|
const showSymbol = vue.computed(() => {
|
|
@@ -13949,7 +13890,7 @@
|
|
|
13949
13890
|
displayWidth: 0,
|
|
13950
13891
|
displayHeight: 0
|
|
13951
13892
|
});
|
|
13952
|
-
const touch = useTouch
|
|
13893
|
+
const touch = useTouch();
|
|
13953
13894
|
const vertical = vue.computed(() => {
|
|
13954
13895
|
const { rootWidth, rootHeight } = props;
|
|
13955
13896
|
const rootRatio = rootHeight / rootWidth;
|
|
@@ -14107,7 +14048,6 @@
|
|
|
14107
14048
|
checkTap();
|
|
14108
14049
|
touch.reset();
|
|
14109
14050
|
};
|
|
14110
|
-
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
|
14111
14051
|
const closeSwiper = () => {
|
|
14112
14052
|
emit("close");
|
|
14113
14053
|
};
|
|
@@ -15362,6 +15302,7 @@
|
|
|
15362
15302
|
theme: { type: String, default: "light" },
|
|
15363
15303
|
location: { type: String, default: "bottom" },
|
|
15364
15304
|
offset: { type: Array, default: [0, 12] },
|
|
15305
|
+
arrowOffset: { type: Number, default: 0 },
|
|
15365
15306
|
customClass: { type: String, default: "" },
|
|
15366
15307
|
showArrow: { type: Boolean, default: true },
|
|
15367
15308
|
iconPrefix: { type: String, default: "nut-icon" },
|
|
@@ -15371,52 +15312,128 @@
|
|
|
15371
15312
|
overlayStyle: { type: Object },
|
|
15372
15313
|
closeOnClickOverlay: { type: Boolean, default: true },
|
|
15373
15314
|
closeOnClickAction: { type: Boolean, default: true },
|
|
15374
|
-
closeOnClickOutside: { type: Boolean, default: true }
|
|
15315
|
+
closeOnClickOutside: { type: Boolean, default: true },
|
|
15316
|
+
targetId: { type: String, default: "" },
|
|
15317
|
+
bgColor: { type: String, default: "" }
|
|
15375
15318
|
},
|
|
15376
15319
|
emits: ["update", "update:visible", "close", "choose", "open"],
|
|
15377
15320
|
setup(props, { emit }) {
|
|
15378
15321
|
const popoverRef = vue.ref();
|
|
15379
15322
|
const popoverContentRef = vue.ref();
|
|
15380
15323
|
const showPopup = vue.ref(props.visible);
|
|
15381
|
-
|
|
15382
|
-
|
|
15383
|
-
rootHeight: 0
|
|
15384
|
-
});
|
|
15324
|
+
let rootRect = vue.ref();
|
|
15325
|
+
let conentRootRect = vue.ref();
|
|
15385
15326
|
const popoverArrow = vue.computed(() => {
|
|
15386
15327
|
const prefixCls = "nut-popover-arrow";
|
|
15387
15328
|
const loca = props.location;
|
|
15388
15329
|
const direction = loca.split("-")[0];
|
|
15389
15330
|
return `${prefixCls} ${prefixCls}-${direction} ${prefixCls}--${loca}`;
|
|
15390
15331
|
});
|
|
15391
|
-
const
|
|
15392
|
-
|
|
15393
|
-
|
|
15394
|
-
|
|
15332
|
+
const popoverArrowStyle = vue.computed(() => {
|
|
15333
|
+
const styles = {};
|
|
15334
|
+
const { bgColor, arrowOffset, location: location2 } = props;
|
|
15335
|
+
const direction = location2.split("-")[0];
|
|
15336
|
+
const skew = location2.split("-")[1];
|
|
15337
|
+
const base = 16;
|
|
15338
|
+
if (bgColor) {
|
|
15339
|
+
styles[`border${upperCaseFirst(direction)}Color`] = bgColor;
|
|
15340
|
+
}
|
|
15341
|
+
if (props.arrowOffset != 0) {
|
|
15342
|
+
if (["bottom", "top"].includes(direction)) {
|
|
15343
|
+
if (!skew) {
|
|
15344
|
+
styles.left = `calc(50% + ${arrowOffset}px)`;
|
|
15345
|
+
}
|
|
15346
|
+
if (skew == "start") {
|
|
15347
|
+
styles.left = `${base + arrowOffset}px`;
|
|
15348
|
+
}
|
|
15349
|
+
if (skew == "end") {
|
|
15350
|
+
styles.right = `${base - arrowOffset}px`;
|
|
15351
|
+
}
|
|
15352
|
+
}
|
|
15353
|
+
if (["left", "right"].includes(direction)) {
|
|
15354
|
+
if (!skew) {
|
|
15355
|
+
styles.top = `calc(50% - ${arrowOffset}px)`;
|
|
15356
|
+
}
|
|
15357
|
+
if (skew == "start") {
|
|
15358
|
+
styles.top = `${base - arrowOffset}px`;
|
|
15359
|
+
}
|
|
15360
|
+
if (skew == "end") {
|
|
15361
|
+
styles.bottom = `${base + arrowOffset}px`;
|
|
15362
|
+
}
|
|
15363
|
+
}
|
|
15364
|
+
}
|
|
15365
|
+
return styles;
|
|
15366
|
+
});
|
|
15367
|
+
const upperCaseFirst = (str) => {
|
|
15368
|
+
var str = str.toLowerCase();
|
|
15369
|
+
str = str.replace(/\b\w+\b/g, (word) => word.substring(0, 1).toUpperCase() + word.substring(1));
|
|
15370
|
+
return str;
|
|
15371
|
+
};
|
|
15372
|
+
const getRootPosition = vue.computed(() => {
|
|
15373
|
+
let styles = {};
|
|
15374
|
+
if (!rootRect.value || !conentRootRect.value)
|
|
15375
|
+
return {};
|
|
15376
|
+
const conentWidth = conentRootRect.value.width;
|
|
15377
|
+
const conentHeight = conentRootRect.value.height;
|
|
15378
|
+
const { width, height, left, top } = rootRect.value;
|
|
15379
|
+
const { location: location2, offset } = props;
|
|
15380
|
+
const direction = location2.split("-")[0];
|
|
15381
|
+
const skew = location2.split("-")[1];
|
|
15382
|
+
let cross = 0;
|
|
15383
|
+
let parallel = 0;
|
|
15395
15384
|
if (isArray(offset) && offset.length == 2) {
|
|
15396
15385
|
cross += +offset[1];
|
|
15397
|
-
|
|
15386
|
+
parallel += +offset[0];
|
|
15387
|
+
}
|
|
15388
|
+
if (width) {
|
|
15389
|
+
if (["bottom", "top"].includes(direction)) {
|
|
15390
|
+
const h = direction == "bottom" ? height + cross : -(conentHeight + cross);
|
|
15391
|
+
styles.top = `${top + h}px`;
|
|
15392
|
+
if (!skew) {
|
|
15393
|
+
styles.left = `${-(conentWidth - width) / 2 + left + parallel}px`;
|
|
15394
|
+
}
|
|
15395
|
+
if (skew == "start") {
|
|
15396
|
+
styles.left = `${left + parallel}px`;
|
|
15397
|
+
}
|
|
15398
|
+
if (skew == "end") {
|
|
15399
|
+
styles.left = `${rootRect.value.right + parallel}px`;
|
|
15400
|
+
}
|
|
15401
|
+
}
|
|
15402
|
+
if (["left", "right"].includes(direction)) {
|
|
15403
|
+
const contentW = direction == "left" ? -(conentWidth + cross) : width + cross;
|
|
15404
|
+
styles.left = `${left + contentW}px`;
|
|
15405
|
+
if (!skew) {
|
|
15406
|
+
styles.top = `${top - conentHeight / 2 + height / 2 - 4 + parallel}px`;
|
|
15407
|
+
}
|
|
15408
|
+
if (skew == "start") {
|
|
15409
|
+
styles.top = `${top + parallel}px`;
|
|
15410
|
+
}
|
|
15411
|
+
if (skew == "end") {
|
|
15412
|
+
styles.top = `${top + height + parallel}px`;
|
|
15413
|
+
}
|
|
15414
|
+
}
|
|
15398
15415
|
}
|
|
15399
|
-
|
|
15400
|
-
|
|
15401
|
-
|
|
15402
|
-
|
|
15403
|
-
|
|
15404
|
-
|
|
15405
|
-
right: "left"
|
|
15406
|
-
};
|
|
15407
|
-
if (["top", "bottom"].includes(direction)) {
|
|
15408
|
-
style[mapd[direction]] = `${cross}px`;
|
|
15409
|
-
style.marginLeft = `${offset[0]}px`;
|
|
15410
|
-
} else {
|
|
15411
|
-
style[mapd[direction]] = `${lengthways}px`;
|
|
15412
|
-
style.marginTop = `${offset[0]}px`;
|
|
15416
|
+
return styles;
|
|
15417
|
+
});
|
|
15418
|
+
const customStyle = vue.computed(() => {
|
|
15419
|
+
const styles = {};
|
|
15420
|
+
if (props.bgColor) {
|
|
15421
|
+
styles.background = props.bgColor;
|
|
15413
15422
|
}
|
|
15414
|
-
return
|
|
15423
|
+
return styles;
|
|
15415
15424
|
});
|
|
15416
15425
|
const getContentWidth = () => {
|
|
15417
|
-
|
|
15418
|
-
|
|
15419
|
-
|
|
15426
|
+
let rect2 = useRect(popoverRef.value);
|
|
15427
|
+
if (props.targetId) {
|
|
15428
|
+
rect2 = useRect(document.querySelector(`#${props.targetId}`));
|
|
15429
|
+
}
|
|
15430
|
+
rootRect.value = rect2;
|
|
15431
|
+
setTimeout(() => {
|
|
15432
|
+
conentRootRect.value = {
|
|
15433
|
+
height: popoverContentRef.value.clientHeight,
|
|
15434
|
+
width: popoverContentRef.value.clientWidth
|
|
15435
|
+
};
|
|
15436
|
+
}, 0);
|
|
15420
15437
|
};
|
|
15421
15438
|
vue.watch(
|
|
15422
15439
|
() => props.visible,
|
|
@@ -15451,7 +15468,12 @@
|
|
|
15451
15468
|
const clickAway = (event) => {
|
|
15452
15469
|
const element = popoverRef.value;
|
|
15453
15470
|
const elContent = popoverContentRef.value;
|
|
15454
|
-
|
|
15471
|
+
let el = element && !element.contains(event.target);
|
|
15472
|
+
if (props.targetId) {
|
|
15473
|
+
const dom = document.querySelector(`#${props.targetId}`);
|
|
15474
|
+
el = dom && !dom.contains(event.target);
|
|
15475
|
+
}
|
|
15476
|
+
if (el && elContent && !elContent.contains(event.target) && props.closeOnClickOutside) {
|
|
15455
15477
|
closePopover();
|
|
15456
15478
|
}
|
|
15457
15479
|
};
|
|
@@ -15462,8 +15484,10 @@
|
|
|
15462
15484
|
closePopover,
|
|
15463
15485
|
chooseItem,
|
|
15464
15486
|
popoverRef,
|
|
15465
|
-
|
|
15466
|
-
|
|
15487
|
+
popoverContentRef,
|
|
15488
|
+
getRootPosition,
|
|
15489
|
+
customStyle,
|
|
15490
|
+
popoverArrowStyle
|
|
15467
15491
|
};
|
|
15468
15492
|
}
|
|
15469
15493
|
});
|
|
@@ -15474,59 +15498,64 @@
|
|
|
15474
15498
|
const _hoisted_2$o = ["onClick"];
|
|
15475
15499
|
const _hoisted_3$m = { class: "nut-popover-menu-item-name" };
|
|
15476
15500
|
function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
|
|
15477
|
-
const
|
|
15501
|
+
const _component_Icon = vue.resolveComponent("Icon");
|
|
15478
15502
|
const _component_nut_popup = vue.resolveComponent("nut-popup");
|
|
15479
|
-
return vue.openBlock(), vue.createElementBlock(
|
|
15480
|
-
|
|
15481
|
-
|
|
15482
|
-
vue.createElementVNode("view", {
|
|
15503
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
15504
|
+
!_ctx.targetId ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
15505
|
+
key: 0,
|
|
15483
15506
|
class: "nut-popover-wrapper",
|
|
15484
15507
|
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.openPopover && _ctx.openPopover(...args)),
|
|
15485
15508
|
ref: "popoverRef"
|
|
15486
15509
|
}, [
|
|
15487
15510
|
vue.renderSlot(_ctx.$slots, "reference")
|
|
15488
|
-
], 512),
|
|
15489
|
-
vue.
|
|
15490
|
-
|
|
15491
|
-
style: vue.normalizeStyle(_ctx.
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
|
|
15495
|
-
|
|
15496
|
-
|
|
15497
|
-
|
|
15498
|
-
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
|
|
15504
|
-
|
|
15505
|
-
|
|
15506
|
-
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
|
-
|
|
15512
|
-
|
|
15513
|
-
|
|
15514
|
-
|
|
15515
|
-
|
|
15516
|
-
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15525
|
-
|
|
15526
|
-
|
|
15527
|
-
|
|
15528
|
-
|
|
15529
|
-
|
|
15511
|
+
], 512)) : vue.createCommentVNode("", true),
|
|
15512
|
+
vue.createElementVNode("view", {
|
|
15513
|
+
class: vue.normalizeClass(["nut-popover", `nut-popover--${_ctx.theme}`, `${_ctx.customClass}`]),
|
|
15514
|
+
style: vue.normalizeStyle(_ctx.getRootPosition)
|
|
15515
|
+
}, [
|
|
15516
|
+
vue.createVNode(_component_nut_popup, {
|
|
15517
|
+
popClass: `nut-popover-content nut-popover-content--${_ctx.location}`,
|
|
15518
|
+
style: vue.normalizeStyle(_ctx.customStyle),
|
|
15519
|
+
visible: _ctx.showPopup,
|
|
15520
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => _ctx.showPopup = $event),
|
|
15521
|
+
position: "",
|
|
15522
|
+
transition: "nut-popover",
|
|
15523
|
+
overlay: _ctx.overlay,
|
|
15524
|
+
duration: _ctx.duration,
|
|
15525
|
+
overlayStyle: _ctx.overlayStyle,
|
|
15526
|
+
overlayClass: _ctx.overlayClass,
|
|
15527
|
+
closeOnClickOverlay: _ctx.closeOnClickOverlay
|
|
15528
|
+
}, {
|
|
15529
|
+
default: vue.withCtx(() => [
|
|
15530
|
+
vue.createElementVNode("view", _hoisted_1$r, [
|
|
15531
|
+
_ctx.showArrow ? (vue.openBlock(), vue.createElementBlock("view", {
|
|
15532
|
+
key: 0,
|
|
15533
|
+
class: vue.normalizeClass(_ctx.popoverArrow),
|
|
15534
|
+
style: vue.normalizeStyle(_ctx.popoverArrowStyle)
|
|
15535
|
+
}, null, 6)) : vue.createCommentVNode("", true),
|
|
15536
|
+
vue.renderSlot(_ctx.$slots, "content"),
|
|
15537
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.list, (item, index) => {
|
|
15538
|
+
return vue.openBlock(), vue.createElementBlock("view", {
|
|
15539
|
+
key: index,
|
|
15540
|
+
class: vue.normalizeClass([item.className, item.disabled && "nut-popover-menu-disabled", "nut-popover-menu-item"]),
|
|
15541
|
+
onClick: vue.withModifiers(($event) => _ctx.chooseItem(item, index), ["stop"])
|
|
15542
|
+
}, [
|
|
15543
|
+
item.icon ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
|
|
15544
|
+
vue.createVNode(_component_Icon, vue.mergeProps(_ctx.$attrs, {
|
|
15545
|
+
class: "nut-popover-item-img",
|
|
15546
|
+
classPrefix: _ctx.iconPrefix,
|
|
15547
|
+
name: item.icon
|
|
15548
|
+
}), null, 16, ["classPrefix", "name"])
|
|
15549
|
+
]) : vue.createCommentVNode("", true),
|
|
15550
|
+
vue.createElementVNode("view", _hoisted_3$m, vue.toDisplayString(item.name), 1)
|
|
15551
|
+
], 10, _hoisted_2$o);
|
|
15552
|
+
}), 128))
|
|
15553
|
+
], 512)
|
|
15554
|
+
]),
|
|
15555
|
+
_: 3
|
|
15556
|
+
}, 8, ["popClass", "style", "visible", "overlay", "duration", "overlayStyle", "overlayClass", "closeOnClickOverlay"])
|
|
15557
|
+
], 6)
|
|
15558
|
+
], 64);
|
|
15530
15559
|
}
|
|
15531
15560
|
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$w]]);
|
|
15532
15561
|
const component$1 = {
|
|
@@ -19848,7 +19877,7 @@
|
|
|
19848
19877
|
}
|
|
19849
19878
|
});
|
|
19850
19879
|
}
|
|
19851
|
-
const version = "3.3.0";
|
|
19880
|
+
const version = "3.3.1-beta.0";
|
|
19852
19881
|
var nutui_vue_build = { install, version, Locale };
|
|
19853
19882
|
exports2.ActionSheet = ActionSheet;
|
|
19854
19883
|
exports2.Address = Address;
|