jb-mobile-ui 1.5.0 → 1.5.2
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/index.cjs.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.es.js +37 -18
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -5391,6 +5391,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5391
5391
|
const timeKey = computed(() => timeKeyMap[props.timePickerType]);
|
|
5392
5392
|
const defaultValueFirst = computed(() => Array.isArray(props.defaultValue) ? props.defaultValue[0] : props.defaultValue);
|
|
5393
5393
|
const defaultValueSecond = computed(() => Array.isArray(props.defaultValue) ? props.defaultValue[1] : props.defaultValue);
|
|
5394
|
+
const calendarKey = ref(0);
|
|
5394
5395
|
const defaultDate = computed(() => {
|
|
5395
5396
|
return props.timePickerType === "dateRange" ? [
|
|
5396
5397
|
dayjs(defaultValueFirst.value).startOf(timeKey.value).toDate(),
|
|
@@ -5590,7 +5591,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5590
5591
|
var _a, _b;
|
|
5591
5592
|
if (["dateRange", "week"].includes(props.timePickerType)) {
|
|
5592
5593
|
(_a = calendarRef.value) == null ? void 0 : _a.scrollToDate(
|
|
5593
|
-
Array.isArray(defaultDate.value) ? defaultDate.value[0] : defaultDate.value
|
|
5594
|
+
props.timePickerType === "week" ? weekStartDate : Array.isArray(defaultDate.value) ? defaultDate.value[0] : defaultDate.value
|
|
5594
5595
|
);
|
|
5595
5596
|
} else {
|
|
5596
5597
|
const selectedItem = (_b = timePickerContentRef.value) == null ? void 0 : _b.querySelector(".selected");
|
|
@@ -5682,20 +5683,36 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5682
5683
|
return dayjs(startTime).isSame(dayjs(minDate.value), timeKey.value);
|
|
5683
5684
|
};
|
|
5684
5685
|
const toPrevDate = () => {
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5686
|
+
const date = dayjs(endTime).subtract(1, timeKey.value).toDate();
|
|
5687
|
+
if (props.timePickerType === "week") {
|
|
5688
|
+
setWeekStartAndEndDate(date);
|
|
5689
|
+
}
|
|
5690
|
+
handleFinishSelectDate(date);
|
|
5688
5691
|
selectedTimeValue.value = dayjs(props.timePickerType === "examine" ? endTime : startTime).format("YYYY-MM-DD");
|
|
5689
|
-
|
|
5692
|
+
if (!props.withSelectTab) {
|
|
5693
|
+
handleConfirm();
|
|
5694
|
+
} else {
|
|
5695
|
+
calendarKey.value++;
|
|
5696
|
+
nextTick(() => {
|
|
5697
|
+
setSelectedScrollIntoView();
|
|
5698
|
+
});
|
|
5699
|
+
}
|
|
5690
5700
|
};
|
|
5691
5701
|
const toNextDate = () => {
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5702
|
+
const date = dayjs(endTime).add(1, timeKey.value).toDate();
|
|
5703
|
+
if (props.timePickerType === "week") {
|
|
5704
|
+
setWeekStartAndEndDate(date);
|
|
5705
|
+
}
|
|
5706
|
+
handleFinishSelectDate(date);
|
|
5707
|
+
selectedTimeValue.value = dayjs(props.timePickerType === "examine" ? endTime : startTime).format("YYYY-MM-DD");
|
|
5708
|
+
if (!props.withSelectTab) {
|
|
5697
5709
|
handleConfirm();
|
|
5698
|
-
}
|
|
5710
|
+
} else {
|
|
5711
|
+
calendarKey.value++;
|
|
5712
|
+
nextTick(() => {
|
|
5713
|
+
setSelectedScrollIntoView();
|
|
5714
|
+
});
|
|
5715
|
+
}
|
|
5699
5716
|
};
|
|
5700
5717
|
const confirmSelectDate = () => {
|
|
5701
5718
|
setDateValueFormat([startTime, endTime], timePickerTypeObj.value.format);
|
|
@@ -5843,11 +5860,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5843
5860
|
])) : createCommentVNode("", true)
|
|
5844
5861
|
])
|
|
5845
5862
|
])) : createCommentVNode("", true),
|
|
5846
|
-
withDirectives(
|
|
5863
|
+
withDirectives((openBlock(), createBlock(_component_van_calendar, {
|
|
5847
5864
|
ref_key: "calendarRef",
|
|
5848
5865
|
ref: calendarRef,
|
|
5849
5866
|
class: "jb-mobile-time-picker__calendar",
|
|
5850
5867
|
"allow-same-day": "",
|
|
5868
|
+
key: calendarKey.value,
|
|
5851
5869
|
type: timePickerTypeObj.value.calendarType,
|
|
5852
5870
|
poppable: false,
|
|
5853
5871
|
"show-mark": false,
|
|
@@ -5867,7 +5885,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5867
5885
|
createElementVNode("div", _hoisted_6$5, toDisplayString(text), 1)
|
|
5868
5886
|
]),
|
|
5869
5887
|
_: 1
|
|
5870
|
-
}, 8, ["type", "min-date", "max-date", "default-date", "first-day-of-week"]), [
|
|
5888
|
+
}, 8, ["type", "min-date", "max-date", "default-date", "first-day-of-week"])), [
|
|
5871
5889
|
[vShow, isShowCalendar.value]
|
|
5872
5890
|
]),
|
|
5873
5891
|
withDirectives(createElementVNode("div", _hoisted_7$4, [
|
|
@@ -5902,7 +5920,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5902
5920
|
};
|
|
5903
5921
|
}
|
|
5904
5922
|
});
|
|
5905
|
-
const JbMobileTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-
|
|
5923
|
+
const JbMobileTimePicker = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-2322ec22"]]);
|
|
5906
5924
|
const _hoisted_1$9 = { class: "jb-mobile-date-picker" };
|
|
5907
5925
|
const _hoisted_2$7 = { class: "jb-mobile-date-picker__value" };
|
|
5908
5926
|
const _hoisted_3$6 = ["src"];
|
|
@@ -7493,14 +7511,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
7493
7511
|
const { selectedOptions } = data;
|
|
7494
7512
|
selectedOptionsList.value = selectedOptions;
|
|
7495
7513
|
};
|
|
7496
|
-
watch(() => modelValue.value, (newValue) => {
|
|
7514
|
+
watch(() => [isShowPopup.value, modelValue.value], (newValue) => {
|
|
7515
|
+
if (!newValue[0]) return;
|
|
7497
7516
|
if (!props.multiple) {
|
|
7498
|
-
defaultValue.value = newValue;
|
|
7517
|
+
defaultValue.value = newValue[1];
|
|
7499
7518
|
return;
|
|
7500
7519
|
}
|
|
7501
7520
|
nextTick(() => {
|
|
7502
7521
|
handleReset();
|
|
7503
|
-
setDefaultSelectedValue(options.value, newValue);
|
|
7522
|
+
setDefaultSelectedValue(options.value, newValue[1]);
|
|
7504
7523
|
updateAllParentCheckedStatus(options.value);
|
|
7505
7524
|
selectedValueList.value = getCheckedBottomLevelItems(options.value);
|
|
7506
7525
|
});
|
|
@@ -7678,7 +7697,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
7678
7697
|
};
|
|
7679
7698
|
}
|
|
7680
7699
|
});
|
|
7681
|
-
const JbMobileCascader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
7700
|
+
const JbMobileCascader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-fca7f37c"]]);
|
|
7682
7701
|
const _hoisted_1$1 = { class: "jb-mobile-steps__item" };
|
|
7683
7702
|
const _hoisted_2 = { class: "jb-mobile-steps__item__left flex-column-center" };
|
|
7684
7703
|
const _hoisted_3 = {
|