jb-mobile-ui 1.4.2 → 1.4.4
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/components/JbMobileButton.vue.d.ts +6 -1
- package/dist/components/JbMobileDatePicker.vue.d.ts +5 -5
- package/dist/components/JbMobilePopup.vue.d.ts +1 -0
- package/dist/components/JbMobileTimePicker.vue.d.ts +4 -4
- package/dist/font/D-DIN-PRO-Bold.otf +0 -0
- package/dist/font/D-DIN-PRO-Regular.woff2 +0 -0
- package/dist/font/D-DIN-PRO-SemiBold.otf +0 -0
- package/dist/font/Noto-Sans-CJK-Thin.woff2 +0 -0
- package/dist/font/NotoSansSC[wght].woff2 +0 -0
- package/dist/hooks/useInfiniteScroll.d.ts +0 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.es.js +19 -30
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -4730,7 +4730,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
4730
4730
|
}
|
|
4731
4731
|
return target;
|
|
4732
4732
|
};
|
|
4733
|
-
const JbMobileButton = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
4733
|
+
const JbMobileButton = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-6a838dd2"]]);
|
|
4734
4734
|
const _imports_0$5 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e编组%2017%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='按地区'%20transform='translate(-26,%20-254)'%3e%3cg%20id='编组-17'%20transform='translate(26,%20254)'%3e%3ccircle%20id='椭圆形'%20fill='%23F4F4F4'%20cx='12'%20cy='12'%20r='12'%3e%3c/circle%3e%3cpolyline%20id='路径'%20stroke='%23000000'%20stroke-width='1.33333333'%20stroke-linecap='round'%20stroke-linejoin='round'%20points='14%2016%2010%2012%2014%208'%3e%3c/polyline%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
4735
4735
|
const forwardDisabledSvg = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e编组%2017备份%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='总部'%20transform='translate(-325,%20-254)'%3e%3cg%20id='编组-11'%20transform='translate(26,%20254)'%3e%3cg%20id='编组-17备份'%20transform='translate(299,%200)'%3e%3ccircle%20id='椭圆形'%20fill='%23F4F4F4'%20cx='12'%20cy='12'%20r='12'%3e%3c/circle%3e%3cpolyline%20id='路径'%20stroke='%23C9C9C9'%20stroke-width='1.33333333'%20stroke-linecap='round'%20stroke-linejoin='round'%20transform='translate(12,%2012)%20scale(-1,%201)%20translate(-12,%20-12)'%20points='14%2016%2010%2012%2014%208'%3e%3c/polyline%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
4736
4736
|
const forwardSvg = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e编组%2017备份%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='按地区'%20transform='translate(-325,%20-254)'%3e%3cg%20id='编组-11'%20transform='translate(26,%20254)'%3e%3cg%20id='编组-17备份'%20transform='translate(299,%200)'%3e%3ccircle%20id='椭圆形'%20fill='%23F4F4F4'%20cx='12'%20cy='12'%20r='12'%3e%3c/circle%3e%3cpolyline%20id='路径'%20stroke='%23000000'%20stroke-width='1.33333333'%20stroke-linecap='round'%20stroke-linejoin='round'%20transform='translate(12,%2012)%20scale(-1,%201)%20translate(-12,%20-12)'%20points='14%2016%2010%2012%2014%208'%3e%3c/polyline%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
@@ -4806,6 +4806,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
4806
4806
|
],
|
|
4807
4807
|
setup(__props, { emit: __emit }) {
|
|
4808
4808
|
const attrs = useAttrs();
|
|
4809
|
+
const slots = useSlots();
|
|
4809
4810
|
const emits = __emit;
|
|
4810
4811
|
const props = __props;
|
|
4811
4812
|
const bodyDom = ref();
|
|
@@ -4867,11 +4868,12 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
4867
4868
|
}, [
|
|
4868
4869
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
4869
4870
|
], 6),
|
|
4870
|
-
__props.footButton ? (openBlock(), createElementBlock("div", {
|
|
4871
|
+
unref(slots).footButton || __props.footButton ? (openBlock(), createElementBlock("div", {
|
|
4871
4872
|
key: 0,
|
|
4872
4873
|
class: normalizeClass$1(["jb-mobile-popup__bottom", { "safe-area-inset-bottom": unref(checkHasSafeAreaInsetBottom)() }])
|
|
4873
4874
|
}, [
|
|
4874
|
-
|
|
4875
|
+
unref(slots).footButton ? renderSlot(_ctx.$slots, "footButton", { key: 0 }, void 0, true) : (openBlock(), createBlock(JbMobileButton, {
|
|
4876
|
+
key: 1,
|
|
4875
4877
|
type: "primary",
|
|
4876
4878
|
block: "",
|
|
4877
4879
|
round: "",
|
|
@@ -4882,7 +4884,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
4882
4884
|
])),
|
|
4883
4885
|
_: 1,
|
|
4884
4886
|
__: [2]
|
|
4885
|
-
})
|
|
4887
|
+
}))
|
|
4886
4888
|
], 2)) : createCommentVNode("", true)
|
|
4887
4889
|
]),
|
|
4888
4890
|
_: 3
|
|
@@ -4890,7 +4892,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
4890
4892
|
};
|
|
4891
4893
|
}
|
|
4892
4894
|
});
|
|
4893
|
-
const JbMobilePopup = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
4895
|
+
const JbMobilePopup = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-3ac7045d"]]);
|
|
4894
4896
|
const _hoisted_1$6 = {
|
|
4895
4897
|
key: 0,
|
|
4896
4898
|
class: "jb-mobile-date-picker"
|
|
@@ -5505,6 +5507,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
5505
5507
|
"max-date": maxDate.value,
|
|
5506
5508
|
"default-date": defaultDate.value,
|
|
5507
5509
|
formatter,
|
|
5510
|
+
"lazy-render": false,
|
|
5508
5511
|
onSelect: handleSelectDate,
|
|
5509
5512
|
onConfirm: handleFinishSelectDate
|
|
5510
5513
|
}, {
|
|
@@ -5545,7 +5548,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
5545
5548
|
};
|
|
5546
5549
|
}
|
|
5547
5550
|
});
|
|
5548
|
-
const JbMobileTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
5551
|
+
const JbMobileTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-87a0b52f"]]);
|
|
5549
5552
|
const _hoisted_1$5 = { class: "jb-mobile-date-picker" };
|
|
5550
5553
|
const _hoisted_2$4 = { class: "jb-mobile-date-picker__value" };
|
|
5551
5554
|
const _hoisted_3$3 = ["src"];
|
|
@@ -6011,7 +6014,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6011
6014
|
title: __props.popupTitle,
|
|
6012
6015
|
"grey-bg": true,
|
|
6013
6016
|
"foot-button": false,
|
|
6014
|
-
|
|
6017
|
+
height: 434
|
|
6015
6018
|
}), {
|
|
6016
6019
|
default: withCtx(() => [
|
|
6017
6020
|
__props.options.length ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
@@ -6032,7 +6035,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6032
6035
|
};
|
|
6033
6036
|
}
|
|
6034
6037
|
});
|
|
6035
|
-
const JbMobileSelect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
6038
|
+
const JbMobileSelect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-a148a345"]]);
|
|
6036
6039
|
const _imports_0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3e图标(24)/巡检%3c/title%3e%3cg%20id='页面-1'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='我的服务备份-14'%20transform='translate(-339,%20-371)'%20fill='%237B52FE'%20fill-rule='nonzero'%3e%3cg%20id='编组-28'%20transform='translate(0,%20134)'%3e%3cg%20id='编组-28备份'%20transform='translate(0,%2051)'%3e%3cg%20id='编组-32备份-4'%20transform='translate(0,%20176)'%3e%3cg%20id='编组-27'%20transform='translate(132,%200)'%3e%3cg%20id='编组'%20transform='translate(211.3571,%2016)'%3e%3cpath%20d='M0.127476811,5.43301045%20L5.51144105,11.8129903%20C5.70234462,12.0384575%206.03582177,12.0632342%206.25572336,11.8699765%20C6.27022237,11.8575882%206.28472138,11.8427223%206.29680387,11.8278563%20L16.146462,0.901366518%20C16.3325325,0.695720566%2016.3325325,0.37610216%2016.1440455,0.170456209%20C15.9555584,-0.0351897433%2015.6438297,-0.0574886986%2015.4287612,0.118425301%20L6.19289432,7.77687878%20C6.01407325,7.92553851%205.76275714,7.93792683%205.57185357,7.80908838%20L0.813763084,4.63520326%20C0.593861494,4.4890212%200.303881373,4.52866379%200.12989331,4.72935442%20C-0.0416782539,4.93004505%20-0.0440947695,5.22984216%200.127476811,5.43301045%20Z'%20id='路径'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
6037
6040
|
const _hoisted_1$1 = { class: "jb-mobile-tree-select-popup__search" };
|
|
6038
6041
|
const _hoisted_2$1 = { class: "jb-mobile-tree-select-popup__list" };
|
|
@@ -6740,7 +6743,6 @@ function useInfiniteScroll(options = {}) {
|
|
|
6740
6743
|
bottomThreshold = 100,
|
|
6741
6744
|
topThreshold = 100,
|
|
6742
6745
|
throttleDelay = 300,
|
|
6743
|
-
scrollDirectionThreshold = 5,
|
|
6744
6746
|
disabled = ref(false),
|
|
6745
6747
|
onLoadMore,
|
|
6746
6748
|
onLoadPrevious,
|
|
@@ -6751,14 +6753,12 @@ function useInfiniteScroll(options = {}) {
|
|
|
6751
6753
|
const isLoadingPrevious = ref(false);
|
|
6752
6754
|
const hasMoreData = ref(true);
|
|
6753
6755
|
const hasPreviousData = ref(true);
|
|
6754
|
-
const isProcessingScroll = ref(false);
|
|
6755
6756
|
let lastScrollTop = 0;
|
|
6756
6757
|
const executeLoadMore = async () => {
|
|
6757
6758
|
if (isLoadingMore.value || !hasMoreData.value || !onLoadMore) {
|
|
6758
6759
|
return;
|
|
6759
6760
|
}
|
|
6760
6761
|
isLoadingMore.value = true;
|
|
6761
|
-
isProcessingScroll.value = true;
|
|
6762
6762
|
try {
|
|
6763
6763
|
await onLoadMore();
|
|
6764
6764
|
if (debug) console.log("✅ 向下加载更多完成");
|
|
@@ -6766,7 +6766,6 @@ function useInfiniteScroll(options = {}) {
|
|
|
6766
6766
|
console.error("❌ 向下加载更多失败:", error);
|
|
6767
6767
|
} finally {
|
|
6768
6768
|
isLoadingMore.value = false;
|
|
6769
|
-
isProcessingScroll.value = false;
|
|
6770
6769
|
}
|
|
6771
6770
|
};
|
|
6772
6771
|
const executeLoadPrevious = async () => {
|
|
@@ -6774,7 +6773,6 @@ function useInfiniteScroll(options = {}) {
|
|
|
6774
6773
|
return;
|
|
6775
6774
|
}
|
|
6776
6775
|
isLoadingPrevious.value = true;
|
|
6777
|
-
isProcessingScroll.value = true;
|
|
6778
6776
|
try {
|
|
6779
6777
|
await onLoadPrevious();
|
|
6780
6778
|
if (debug) console.log("✅ 向上加载完成");
|
|
@@ -6782,11 +6780,10 @@ function useInfiniteScroll(options = {}) {
|
|
|
6782
6780
|
console.error("❌ 向上加载失败:", error);
|
|
6783
6781
|
} finally {
|
|
6784
6782
|
isLoadingPrevious.value = false;
|
|
6785
|
-
isProcessingScroll.value = false;
|
|
6786
6783
|
}
|
|
6787
6784
|
};
|
|
6788
6785
|
const handleScroll = throttle(async (event) => {
|
|
6789
|
-
if (disabled.value
|
|
6786
|
+
if (disabled.value) return;
|
|
6790
6787
|
const target = event.target;
|
|
6791
6788
|
if (!target) return;
|
|
6792
6789
|
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
@@ -6795,18 +6792,12 @@ function useInfiniteScroll(options = {}) {
|
|
|
6795
6792
|
const isNearBottom = distanceToBottom < bottomThreshold;
|
|
6796
6793
|
const isNearTop = distanceToTop < topThreshold;
|
|
6797
6794
|
let scrollDirection = "none";
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
} else {
|
|
6803
|
-
scrollDirection = "up";
|
|
6804
|
-
}
|
|
6805
|
-
lastScrollTop = scrollTop;
|
|
6806
|
-
if (debug) {
|
|
6807
|
-
console.log(`🔄 滚动方向变化: ${scrollDirection}, 滚动距离: ${scrollDelta}px`);
|
|
6808
|
-
}
|
|
6795
|
+
if (scrollTop > lastScrollTop) {
|
|
6796
|
+
scrollDirection = "down";
|
|
6797
|
+
} else if (scrollTop < lastScrollTop) {
|
|
6798
|
+
scrollDirection = "up";
|
|
6809
6799
|
}
|
|
6800
|
+
lastScrollTop = scrollTop;
|
|
6810
6801
|
const scrollInfo = {
|
|
6811
6802
|
scrollTop,
|
|
6812
6803
|
scrollHeight,
|
|
@@ -6819,15 +6810,14 @@ function useInfiniteScroll(options = {}) {
|
|
|
6819
6810
|
};
|
|
6820
6811
|
if (debug) {
|
|
6821
6812
|
console.log("📊 滚动信息:", scrollInfo);
|
|
6822
|
-
console.log(`🔄 加载状态: 向下加载=${isLoadingMore.value}, 向上加载=${isLoadingPrevious.value}, 处理中=${isProcessingScroll.value}`);
|
|
6823
6813
|
}
|
|
6824
6814
|
if (isNearBottom && scrollDirection === "down") {
|
|
6825
6815
|
if (debug) console.log("🔽 触发向下加载");
|
|
6826
|
-
executeLoadMore();
|
|
6816
|
+
await executeLoadMore();
|
|
6827
6817
|
}
|
|
6828
6818
|
if (isNearTop && scrollDirection === "up") {
|
|
6829
6819
|
if (debug) console.log("🔼 触发向上加载");
|
|
6830
|
-
executeLoadPrevious();
|
|
6820
|
+
await executeLoadPrevious();
|
|
6831
6821
|
}
|
|
6832
6822
|
scrollInfoRef.value = scrollInfo;
|
|
6833
6823
|
}, throttleDelay);
|
|
@@ -6836,7 +6826,6 @@ function useInfiniteScroll(options = {}) {
|
|
|
6836
6826
|
isLoadingPrevious.value = false;
|
|
6837
6827
|
hasMoreData.value = true;
|
|
6838
6828
|
hasPreviousData.value = true;
|
|
6839
|
-
isProcessingScroll.value = false;
|
|
6840
6829
|
lastScrollTop = 0;
|
|
6841
6830
|
};
|
|
6842
6831
|
const triggerLoadMore = async () => {
|