jb-mobile-ui 1.4.2 → 1.4.3
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 +10 -1
- package/dist/components/JbMobileDatePicker.vue.d.ts +5 -5
- 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/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 +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +23 -39
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref, onMounted, reactive, getCurrentInstance, nextTick, onActivated, onUnmounted, onDeactivated, isRef, watch, inject, computed, provide, unref, isVNode, defineComponent, createVNode, onBeforeUnmount, watchEffect, mergeProps, Transition, Teleport, withDirectives, vShow, Fragment, onBeforeUpdate, Comment, createApp, useAttrs,
|
|
1
|
+
import { ref, onMounted, reactive, getCurrentInstance, nextTick, onActivated, onUnmounted, onDeactivated, isRef, watch, inject, computed, provide, unref, isVNode, defineComponent, createVNode, onBeforeUnmount, watchEffect, mergeProps, Transition, Teleport, withDirectives, vShow, Fragment, onBeforeUpdate, Comment, createApp, useAttrs, createBlock, openBlock, withCtx, renderSlot, createElementVNode, createElementBlock, createCommentVNode, toDisplayString, normalizeStyle as normalizeStyle$1, normalizeClass as normalizeClass$1, createTextVNode, renderList, vModelDynamic, useSlots, customRef } from "vue";
|
|
2
2
|
import { showToast as showToast$1 } from "vant";
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
4
|
import weekOfYear from "dayjs/plugin/weekOfYear";
|
|
@@ -4707,19 +4707,16 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4707
4707
|
__name: "JbMobileButton",
|
|
4708
4708
|
setup(__props) {
|
|
4709
4709
|
const attrs = useAttrs();
|
|
4710
|
-
const slots = useSlots();
|
|
4711
4710
|
return (_ctx, _cache) => {
|
|
4712
4711
|
const _component_van_button = Button;
|
|
4713
|
-
return openBlock(), createBlock(_component_van_button, mergeProps({ class: "jb-mobile-button" }, unref(attrs)),
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
})
|
|
4722
|
-
]), 1040);
|
|
4712
|
+
return openBlock(), createBlock(_component_van_button, mergeProps({ class: "jb-mobile-button" }, unref(attrs)), {
|
|
4713
|
+
default: withCtx(() => [
|
|
4714
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true),
|
|
4715
|
+
renderSlot(_ctx.$slots, "icon", {}, void 0, true),
|
|
4716
|
+
renderSlot(_ctx.$slots, "loading", {}, void 0, true)
|
|
4717
|
+
]),
|
|
4718
|
+
_: 3
|
|
4719
|
+
}, 16);
|
|
4723
4720
|
};
|
|
4724
4721
|
}
|
|
4725
4722
|
});
|
|
@@ -4730,7 +4727,7 @@ const _export_sfc = (sfc, props) => {
|
|
|
4730
4727
|
}
|
|
4731
4728
|
return target;
|
|
4732
4729
|
};
|
|
4733
|
-
const JbMobileButton = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-
|
|
4730
|
+
const JbMobileButton = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-3768c8dc"]]);
|
|
4734
4731
|
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
4732
|
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
4733
|
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";
|
|
@@ -4890,7 +4887,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
4890
4887
|
};
|
|
4891
4888
|
}
|
|
4892
4889
|
});
|
|
4893
|
-
const JbMobilePopup = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-
|
|
4890
|
+
const JbMobilePopup = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-2c28244d"]]);
|
|
4894
4891
|
const _hoisted_1$6 = {
|
|
4895
4892
|
key: 0,
|
|
4896
4893
|
class: "jb-mobile-date-picker"
|
|
@@ -5505,6 +5502,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
5505
5502
|
"max-date": maxDate.value,
|
|
5506
5503
|
"default-date": defaultDate.value,
|
|
5507
5504
|
formatter,
|
|
5505
|
+
"lazy-render": false,
|
|
5508
5506
|
onSelect: handleSelectDate,
|
|
5509
5507
|
onConfirm: handleFinishSelectDate
|
|
5510
5508
|
}, {
|
|
@@ -5545,7 +5543,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
5545
5543
|
};
|
|
5546
5544
|
}
|
|
5547
5545
|
});
|
|
5548
|
-
const JbMobileTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-
|
|
5546
|
+
const JbMobileTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-87a0b52f"]]);
|
|
5549
5547
|
const _hoisted_1$5 = { class: "jb-mobile-date-picker" };
|
|
5550
5548
|
const _hoisted_2$4 = { class: "jb-mobile-date-picker__value" };
|
|
5551
5549
|
const _hoisted_3$3 = ["src"];
|
|
@@ -6011,7 +6009,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6011
6009
|
title: __props.popupTitle,
|
|
6012
6010
|
"grey-bg": true,
|
|
6013
6011
|
"foot-button": false,
|
|
6014
|
-
|
|
6012
|
+
height: 434
|
|
6015
6013
|
}), {
|
|
6016
6014
|
default: withCtx(() => [
|
|
6017
6015
|
__props.options.length ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
@@ -6032,7 +6030,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6032
6030
|
};
|
|
6033
6031
|
}
|
|
6034
6032
|
});
|
|
6035
|
-
const JbMobileSelect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
6033
|
+
const JbMobileSelect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-a148a345"]]);
|
|
6036
6034
|
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
6035
|
const _hoisted_1$1 = { class: "jb-mobile-tree-select-popup__search" };
|
|
6038
6036
|
const _hoisted_2$1 = { class: "jb-mobile-tree-select-popup__list" };
|
|
@@ -6740,7 +6738,6 @@ function useInfiniteScroll(options = {}) {
|
|
|
6740
6738
|
bottomThreshold = 100,
|
|
6741
6739
|
topThreshold = 100,
|
|
6742
6740
|
throttleDelay = 300,
|
|
6743
|
-
scrollDirectionThreshold = 5,
|
|
6744
6741
|
disabled = ref(false),
|
|
6745
6742
|
onLoadMore,
|
|
6746
6743
|
onLoadPrevious,
|
|
@@ -6751,14 +6748,12 @@ function useInfiniteScroll(options = {}) {
|
|
|
6751
6748
|
const isLoadingPrevious = ref(false);
|
|
6752
6749
|
const hasMoreData = ref(true);
|
|
6753
6750
|
const hasPreviousData = ref(true);
|
|
6754
|
-
const isProcessingScroll = ref(false);
|
|
6755
6751
|
let lastScrollTop = 0;
|
|
6756
6752
|
const executeLoadMore = async () => {
|
|
6757
6753
|
if (isLoadingMore.value || !hasMoreData.value || !onLoadMore) {
|
|
6758
6754
|
return;
|
|
6759
6755
|
}
|
|
6760
6756
|
isLoadingMore.value = true;
|
|
6761
|
-
isProcessingScroll.value = true;
|
|
6762
6757
|
try {
|
|
6763
6758
|
await onLoadMore();
|
|
6764
6759
|
if (debug) console.log("✅ 向下加载更多完成");
|
|
@@ -6766,7 +6761,6 @@ function useInfiniteScroll(options = {}) {
|
|
|
6766
6761
|
console.error("❌ 向下加载更多失败:", error);
|
|
6767
6762
|
} finally {
|
|
6768
6763
|
isLoadingMore.value = false;
|
|
6769
|
-
isProcessingScroll.value = false;
|
|
6770
6764
|
}
|
|
6771
6765
|
};
|
|
6772
6766
|
const executeLoadPrevious = async () => {
|
|
@@ -6774,7 +6768,6 @@ function useInfiniteScroll(options = {}) {
|
|
|
6774
6768
|
return;
|
|
6775
6769
|
}
|
|
6776
6770
|
isLoadingPrevious.value = true;
|
|
6777
|
-
isProcessingScroll.value = true;
|
|
6778
6771
|
try {
|
|
6779
6772
|
await onLoadPrevious();
|
|
6780
6773
|
if (debug) console.log("✅ 向上加载完成");
|
|
@@ -6782,11 +6775,10 @@ function useInfiniteScroll(options = {}) {
|
|
|
6782
6775
|
console.error("❌ 向上加载失败:", error);
|
|
6783
6776
|
} finally {
|
|
6784
6777
|
isLoadingPrevious.value = false;
|
|
6785
|
-
isProcessingScroll.value = false;
|
|
6786
6778
|
}
|
|
6787
6779
|
};
|
|
6788
6780
|
const handleScroll = throttle(async (event) => {
|
|
6789
|
-
if (disabled.value
|
|
6781
|
+
if (disabled.value) return;
|
|
6790
6782
|
const target = event.target;
|
|
6791
6783
|
if (!target) return;
|
|
6792
6784
|
const { scrollTop, scrollHeight, clientHeight } = target;
|
|
@@ -6795,18 +6787,12 @@ function useInfiniteScroll(options = {}) {
|
|
|
6795
6787
|
const isNearBottom = distanceToBottom < bottomThreshold;
|
|
6796
6788
|
const isNearTop = distanceToTop < topThreshold;
|
|
6797
6789
|
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
|
-
}
|
|
6790
|
+
if (scrollTop > lastScrollTop) {
|
|
6791
|
+
scrollDirection = "down";
|
|
6792
|
+
} else if (scrollTop < lastScrollTop) {
|
|
6793
|
+
scrollDirection = "up";
|
|
6809
6794
|
}
|
|
6795
|
+
lastScrollTop = scrollTop;
|
|
6810
6796
|
const scrollInfo = {
|
|
6811
6797
|
scrollTop,
|
|
6812
6798
|
scrollHeight,
|
|
@@ -6819,15 +6805,14 @@ function useInfiniteScroll(options = {}) {
|
|
|
6819
6805
|
};
|
|
6820
6806
|
if (debug) {
|
|
6821
6807
|
console.log("📊 滚动信息:", scrollInfo);
|
|
6822
|
-
console.log(`🔄 加载状态: 向下加载=${isLoadingMore.value}, 向上加载=${isLoadingPrevious.value}, 处理中=${isProcessingScroll.value}`);
|
|
6823
6808
|
}
|
|
6824
6809
|
if (isNearBottom && scrollDirection === "down") {
|
|
6825
6810
|
if (debug) console.log("🔽 触发向下加载");
|
|
6826
|
-
executeLoadMore();
|
|
6811
|
+
await executeLoadMore();
|
|
6827
6812
|
}
|
|
6828
6813
|
if (isNearTop && scrollDirection === "up") {
|
|
6829
6814
|
if (debug) console.log("🔼 触发向上加载");
|
|
6830
|
-
executeLoadPrevious();
|
|
6815
|
+
await executeLoadPrevious();
|
|
6831
6816
|
}
|
|
6832
6817
|
scrollInfoRef.value = scrollInfo;
|
|
6833
6818
|
}, throttleDelay);
|
|
@@ -6836,7 +6821,6 @@ function useInfiniteScroll(options = {}) {
|
|
|
6836
6821
|
isLoadingPrevious.value = false;
|
|
6837
6822
|
hasMoreData.value = true;
|
|
6838
6823
|
hasPreviousData.value = true;
|
|
6839
|
-
isProcessingScroll.value = false;
|
|
6840
6824
|
lastScrollTop = 0;
|
|
6841
6825
|
};
|
|
6842
6826
|
const triggerLoadMore = async () => {
|