@blueking/date-picker 2.0.0-beta.23 → 2.0.0-beta.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/date-picker",
3
- "version": "2.0.0-beta.23",
3
+ "version": "2.0.0-beta.25",
4
4
  "description": "蓝鲸监控平台日期时间选择",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",
@@ -30,9 +30,12 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
30
30
  "onUpdate:timezone"?: ((value: string, timezoneInfo: ITimezoneItem) => any) | undefined;
31
31
  }, {
32
32
  format: string;
33
+ commonUseList: {
34
+ id: DateValue;
35
+ name: string;
36
+ }[] | DateValue[];
33
37
  version: number | string;
34
38
  behavior: "normal" | "simplicity";
35
- commonUseList: DateValue[];
36
39
  needTimezone: boolean;
37
40
  }, {}>;
38
41
  export default _default;
@@ -22,6 +22,7 @@ export declare class DateRange {
22
22
  startDate: Dayjs | null;
23
23
  startNum: number | undefined;
24
24
  startUnit: DateUnit | undefined;
25
+ userDisplayName: string | undefined;
25
26
  constructor(dateValue?: DateValue, format?: string, timezome?: string);
26
27
  get dateMode(): DateMode;
27
28
  get endDisplayText(): string;
@@ -31,6 +32,7 @@ export declare class DateRange {
31
32
  get startDisplayText(): string;
32
33
  dateDuration(): number | undefined;
33
34
  isInValidDateRange(date: DateRange): boolean;
35
+ setUserDisplayName(v: string): void;
34
36
  toDisplayString(): string;
35
37
  toEmitValue(): [
36
38
  DateValue,
@@ -20,7 +20,10 @@ export type CommonDateValue = [string, string];
20
20
  export type DateValue = [Dayjs | number | string, Dayjs | number | string];
21
21
  export interface IDatePickerProps {
22
22
  behavior?: 'normal' | 'simplicity';
23
- commonUseList?: DateValue[];
23
+ commonUseList?: {
24
+ id: DateValue;
25
+ name: string;
26
+ }[] | DateValue[];
24
27
  disabled?: boolean;
25
28
  format?: string;
26
29
  modelValue: DateValue | undefined;
@@ -1,15 +1,15 @@
1
1
  import { type ComputedRef, type InjectionKey } from 'vue';
2
2
  import { type LangKey } from '../lang/lang';
3
3
  import { type ITimezoneItem } from './timezone';
4
- import { type DateValue } from './types';
4
+ import { type IDatePickerProps, type DateValue } from './types';
5
5
  export interface IDatePickerProvider {
6
- commonUseList: ComputedRef<DateValue[]>;
6
+ commonUseList: ComputedRef<IDatePickerProps['commonUseList']>;
7
7
  format: ComputedRef<string>;
8
8
  storeKey: ComputedRef<string>;
9
9
  t: (key: LangKey) => string;
10
10
  timezoneInfo: ComputedRef<ITimezoneItem>;
11
11
  version: ComputedRef<number | string>;
12
- vildateTimeRange: ComputedRef<DateValue | undefined>;
12
+ validateTimeRange: ComputedRef<DateValue | undefined>;
13
13
  }
14
14
  export declare const DATE_PICKER_PROVIDER_KEY: InjectionKey<IDatePickerProvider>;
15
15
  export declare const useDatePickerProvider: (data: IDatePickerProvider) => void;
@@ -23253,6 +23253,7 @@ class DateRange {
23253
23253
  __publicField(this, "startDate");
23254
23254
  __publicField(this, "startNum");
23255
23255
  __publicField(this, "startUnit");
23256
+ __publicField(this, "userDisplayName");
23256
23257
  this.dateValue = dateValue;
23257
23258
  this.format = format;
23258
23259
  this.timezome = timezome;
@@ -23351,6 +23352,9 @@ class DateRange {
23351
23352
  if (!this.startDate || !this.endDate) return false;
23352
23353
  return (this.startDate.isSame(date.startDate, "ms") || this.startDate.isBefore(date.startDate)) && (this.endDate.isSame(date.endDate, "ms") || this.endDate.isAfter(date.endDate));
23353
23354
  }
23355
+ setUserDisplayName(v2) {
23356
+ this.userDisplayName = v2;
23357
+ }
23354
23358
  toDisplayString() {
23355
23359
  var _a, _b;
23356
23360
  const {
@@ -23365,6 +23369,7 @@ class DateRange {
23365
23369
  startNum,
23366
23370
  startUnit
23367
23371
  } = this;
23372
+ if (this.userDisplayName) return this.userDisplayName;
23368
23373
  if (!startDate || !endDate || !isValidate) {
23369
23374
  return ((_a = this.dateValue) == null ? void 0 : _a.join(" ~ ")) || "";
23370
23375
  }
@@ -24964,16 +24969,16 @@ const useDatePickerProvider = (data2) => {
24964
24969
  };
24965
24970
  const useDatePickerInject = () => inject(DATE_PICKER_PROVIDER_KEY);
24966
24971
  const useValidate = () => {
24967
- const { format, timezoneInfo, vildateTimeRange } = useDatePickerInject();
24972
+ const { format, timezoneInfo, validateTimeRange } = useDatePickerInject();
24968
24973
  const validDateRange = customRef((track) => {
24969
- let date = new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
24974
+ let date = new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
24970
24975
  return {
24971
24976
  get() {
24972
24977
  var _a;
24973
24978
  track();
24974
- if (((_a = vildateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
24975
- if (vildateTimeRange.value.some((v2) => typeof v2 === "string" && v2.includes("now")))
24976
- return new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
24979
+ if (((_a = validateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
24980
+ if (validateTimeRange.value.some((v2) => typeof v2 === "string" && v2.includes("now")))
24981
+ return new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
24977
24982
  return date;
24978
24983
  },
24979
24984
  set() {
@@ -26716,9 +26721,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
26716
26721
  const browserTimezone = dayjs.tz.guess();
26717
26722
  const recentUseList = shallowRef(getStoreDateList(storeKey2.value));
26718
26723
  const dateList = computed(
26719
- () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map(
26720
- (date) => new DateRange(date, format.value, props2.timezone)
26721
- )
26724
+ () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map((date) => {
26725
+ if ((date == null ? void 0 : date.id) && date.name) {
26726
+ const dateRange = new DateRange(date.id, format.value, props2.timezone);
26727
+ dateRange.setUserDisplayName(date.name);
26728
+ return dateRange;
26729
+ }
26730
+ return new DateRange(date, format.value, props2.timezone);
26731
+ })
26722
26732
  );
26723
26733
  const handleChange = (date) => {
26724
26734
  emits("change", date);
@@ -26989,6 +26999,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26989
26999
  var _a;
26990
27000
  return ((_a = props2.commonUseList) == null ? void 0 : _a.length) ? props2.commonUseList : commonDateList;
26991
27001
  });
27002
+ const dateDetailDisplayString = computed(() => {
27003
+ var _a;
27004
+ const commonDate = commonDateUseList.value.find((item) => {
27005
+ var _a2, _b, _c, _d;
27006
+ return Array(item.id) && ((_b = (_a2 = item.id).join) == null ? void 0 : _b.call(_a2, "_")) === ((_d = (_c = dateDetail.value) == null ? void 0 : _c.dateValue) == null ? void 0 : _d.join("_"));
27007
+ });
27008
+ if (commonDate) {
27009
+ return commonDate.name;
27010
+ }
27011
+ return (_a = dateDetail.value) == null ? void 0 : _a.toDisplayString();
27012
+ });
26992
27013
  useDatePickerProvider({
26993
27014
  commonUseList: commonDateUseList,
26994
27015
  format,
@@ -26996,7 +27017,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
26996
27017
  t,
26997
27018
  timezoneInfo,
26998
27019
  version: computed(() => props2.version),
26999
- vildateTimeRange: computed(() => props2.validDateRange)
27020
+ validateTimeRange: computed(() => props2.validDateRange)
27000
27021
  });
27001
27022
  onBeforeUnmount(() => {
27002
27023
  tooltipsShow.value = false;
@@ -27027,7 +27048,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27027
27048
  dateDetail.value = new DateRange(val, format.value, props2.timezone);
27028
27049
  const emitValue = dateDetail.value.toEmitValue();
27029
27050
  emits("update:modelValue", ...emitValue);
27030
- const canStore = commonDateUseList.value.some((item) => item[0] === start2 && item[1] === end2);
27051
+ const canStore = commonDateUseList.value.some((item) => {
27052
+ const startDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[0] : item[0];
27053
+ const endDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[1] : item[1];
27054
+ return startDate === start2 && endDate === end2;
27055
+ });
27031
27056
  !canStore && dateDetail.value.isValidate && setStoreDateList(val, storeKey2.value);
27032
27057
  };
27033
27058
  const handleTimezoneChange = (val, info) => {
@@ -27133,7 +27158,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
27133
27158
  createElementVNode(
27134
27159
  "span",
27135
27160
  null,
27136
- toDisplayString(dateDetail.value.toDisplayString()),
27161
+ toDisplayString(dateDetailDisplayString.value),
27137
27162
  1
27138
27163
  /* TEXT */
27139
27164
  ),
@@ -30270,6 +30270,7 @@ ${$(r2)}`), n2;
30270
30270
  __publicField(this, "startDate");
30271
30271
  __publicField(this, "startNum");
30272
30272
  __publicField(this, "startUnit");
30273
+ __publicField(this, "userDisplayName");
30273
30274
  this.dateValue = dateValue;
30274
30275
  this.format = format;
30275
30276
  this.timezome = timezome;
@@ -30368,6 +30369,9 @@ ${$(r2)}`), n2;
30368
30369
  if (!this.startDate || !this.endDate) return false;
30369
30370
  return (this.startDate.isSame(date.startDate, "ms") || this.startDate.isBefore(date.startDate)) && (this.endDate.isSame(date.endDate, "ms") || this.endDate.isAfter(date.endDate));
30370
30371
  }
30372
+ setUserDisplayName(v2) {
30373
+ this.userDisplayName = v2;
30374
+ }
30371
30375
  toDisplayString() {
30372
30376
  var _a, _b;
30373
30377
  const {
@@ -30382,6 +30386,7 @@ ${$(r2)}`), n2;
30382
30386
  startNum,
30383
30387
  startUnit
30384
30388
  } = this;
30389
+ if (this.userDisplayName) return this.userDisplayName;
30385
30390
  if (!startDate || !endDate || !isValidate) {
30386
30391
  return ((_a = this.dateValue) == null ? void 0 : _a.join(" ~ ")) || "";
30387
30392
  }
@@ -31981,16 +31986,16 @@ ${$(r2)}`), n2;
31981
31986
  };
31982
31987
  const useDatePickerInject = () => inject(DATE_PICKER_PROVIDER_KEY);
31983
31988
  const useValidate = () => {
31984
- const { format, timezoneInfo, vildateTimeRange } = useDatePickerInject();
31989
+ const { format, timezoneInfo, validateTimeRange } = useDatePickerInject();
31985
31990
  const validDateRange = customRef((track2) => {
31986
- let date = new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
31991
+ let date = new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
31987
31992
  return {
31988
31993
  get() {
31989
31994
  var _a;
31990
31995
  track2();
31991
- if (((_a = vildateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
31992
- if (vildateTimeRange.value.some((v2) => typeof v2 === "string" && v2.includes("now")))
31993
- return new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
31996
+ if (((_a = validateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
31997
+ if (validateTimeRange.value.some((v2) => typeof v2 === "string" && v2.includes("now")))
31998
+ return new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
31994
31999
  return date;
31995
32000
  },
31996
32001
  set() {
@@ -33733,9 +33738,14 @@ ${$(r2)}`), n2;
33733
33738
  const browserTimezone = dayjs.tz.guess();
33734
33739
  const recentUseList = shallowRef(getStoreDateList(storeKey2.value));
33735
33740
  const dateList = computed(
33736
- () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map(
33737
- (date) => new DateRange(date, format.value, props2.timezone)
33738
- )
33741
+ () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map((date) => {
33742
+ if ((date == null ? void 0 : date.id) && date.name) {
33743
+ const dateRange = new DateRange(date.id, format.value, props2.timezone);
33744
+ dateRange.setUserDisplayName(date.name);
33745
+ return dateRange;
33746
+ }
33747
+ return new DateRange(date, format.value, props2.timezone);
33748
+ })
33739
33749
  );
33740
33750
  const handleChange = (date) => {
33741
33751
  emits("change", date);
@@ -34006,6 +34016,17 @@ ${$(r2)}`), n2;
34006
34016
  var _a;
34007
34017
  return ((_a = props2.commonUseList) == null ? void 0 : _a.length) ? props2.commonUseList : commonDateList;
34008
34018
  });
34019
+ const dateDetailDisplayString = computed(() => {
34020
+ var _a;
34021
+ const commonDate = commonDateUseList.value.find((item) => {
34022
+ var _a2, _b, _c, _d;
34023
+ return Array(item.id) && ((_b = (_a2 = item.id).join) == null ? void 0 : _b.call(_a2, "_")) === ((_d = (_c = dateDetail.value) == null ? void 0 : _c.dateValue) == null ? void 0 : _d.join("_"));
34024
+ });
34025
+ if (commonDate) {
34026
+ return commonDate.name;
34027
+ }
34028
+ return (_a = dateDetail.value) == null ? void 0 : _a.toDisplayString();
34029
+ });
34009
34030
  useDatePickerProvider({
34010
34031
  commonUseList: commonDateUseList,
34011
34032
  format,
@@ -34013,7 +34034,7 @@ ${$(r2)}`), n2;
34013
34034
  t,
34014
34035
  timezoneInfo,
34015
34036
  version: computed(() => props2.version),
34016
- vildateTimeRange: computed(() => props2.validDateRange)
34037
+ validateTimeRange: computed(() => props2.validDateRange)
34017
34038
  });
34018
34039
  onBeforeUnmount(() => {
34019
34040
  tooltipsShow.value = false;
@@ -34044,7 +34065,11 @@ ${$(r2)}`), n2;
34044
34065
  dateDetail.value = new DateRange(val, format.value, props2.timezone);
34045
34066
  const emitValue = dateDetail.value.toEmitValue();
34046
34067
  emits("update:modelValue", ...emitValue);
34047
- const canStore = commonDateUseList.value.some((item) => item[0] === start2 && item[1] === end2);
34068
+ const canStore = commonDateUseList.value.some((item) => {
34069
+ const startDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[0] : item[0];
34070
+ const endDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[1] : item[1];
34071
+ return startDate === start2 && endDate === end2;
34072
+ });
34048
34073
  !canStore && dateDetail.value.isValidate && setStoreDateList(val, storeKey2.value);
34049
34074
  };
34050
34075
  const handleTimezoneChange = (val, info) => {
@@ -34150,7 +34175,7 @@ ${$(r2)}`), n2;
34150
34175
  createBaseVNode(
34151
34176
  "span",
34152
34177
  null,
34153
- toDisplayString(dateDetail.value.toDisplayString()),
34178
+ toDisplayString(dateDetailDisplayString.value),
34154
34179
  1
34155
34180
  /* TEXT */
34156
34181
  ),
@@ -23268,6 +23268,7 @@ ${$(r2)}`), n2;
23268
23268
  __publicField(this, "startDate");
23269
23269
  __publicField(this, "startNum");
23270
23270
  __publicField(this, "startUnit");
23271
+ __publicField(this, "userDisplayName");
23271
23272
  this.dateValue = dateValue;
23272
23273
  this.format = format;
23273
23274
  this.timezome = timezome;
@@ -23366,6 +23367,9 @@ ${$(r2)}`), n2;
23366
23367
  if (!this.startDate || !this.endDate) return false;
23367
23368
  return (this.startDate.isSame(date.startDate, "ms") || this.startDate.isBefore(date.startDate)) && (this.endDate.isSame(date.endDate, "ms") || this.endDate.isAfter(date.endDate));
23368
23369
  }
23370
+ setUserDisplayName(v2) {
23371
+ this.userDisplayName = v2;
23372
+ }
23369
23373
  toDisplayString() {
23370
23374
  var _a, _b;
23371
23375
  const {
@@ -23380,6 +23384,7 @@ ${$(r2)}`), n2;
23380
23384
  startNum,
23381
23385
  startUnit
23382
23386
  } = this;
23387
+ if (this.userDisplayName) return this.userDisplayName;
23383
23388
  if (!startDate || !endDate || !isValidate) {
23384
23389
  return ((_a = this.dateValue) == null ? void 0 : _a.join(" ~ ")) || "";
23385
23390
  }
@@ -24979,16 +24984,16 @@ ${$(r2)}`), n2;
24979
24984
  };
24980
24985
  const useDatePickerInject = () => __WEBPACK_EXTERNAL_MODULE_vue__.inject(DATE_PICKER_PROVIDER_KEY);
24981
24986
  const useValidate = () => {
24982
- const { format, timezoneInfo, vildateTimeRange } = useDatePickerInject();
24987
+ const { format, timezoneInfo, validateTimeRange } = useDatePickerInject();
24983
24988
  const validDateRange = __WEBPACK_EXTERNAL_MODULE_vue__.customRef((track) => {
24984
- let date = new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
24989
+ let date = new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
24985
24990
  return {
24986
24991
  get() {
24987
24992
  var _a;
24988
24993
  track();
24989
- if (((_a = vildateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
24990
- if (vildateTimeRange.value.some((v2) => typeof v2 === "string" && v2.includes("now")))
24991
- return new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
24994
+ if (((_a = validateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
24995
+ if (validateTimeRange.value.some((v2) => typeof v2 === "string" && v2.includes("now")))
24996
+ return new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
24992
24997
  return date;
24993
24998
  },
24994
24999
  set() {
@@ -26731,9 +26736,14 @@ ${$(r2)}`), n2;
26731
26736
  const browserTimezone = dayjs.tz.guess();
26732
26737
  const recentUseList = __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef(getStoreDateList(storeKey2.value));
26733
26738
  const dateList = __WEBPACK_EXTERNAL_MODULE_vue__.computed(
26734
- () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map(
26735
- (date) => new DateRange(date, format.value, props2.timezone)
26736
- )
26739
+ () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map((date) => {
26740
+ if ((date == null ? void 0 : date.id) && date.name) {
26741
+ const dateRange = new DateRange(date.id, format.value, props2.timezone);
26742
+ dateRange.setUserDisplayName(date.name);
26743
+ return dateRange;
26744
+ }
26745
+ return new DateRange(date, format.value, props2.timezone);
26746
+ })
26737
26747
  );
26738
26748
  const handleChange = (date) => {
26739
26749
  emits("change", date);
@@ -27004,6 +27014,17 @@ ${$(r2)}`), n2;
27004
27014
  var _a;
27005
27015
  return ((_a = props2.commonUseList) == null ? void 0 : _a.length) ? props2.commonUseList : commonDateList;
27006
27016
  });
27017
+ const dateDetailDisplayString = __WEBPACK_EXTERNAL_MODULE_vue__.computed(() => {
27018
+ var _a;
27019
+ const commonDate = commonDateUseList.value.find((item) => {
27020
+ var _a2, _b, _c, _d;
27021
+ return Array(item.id) && ((_b = (_a2 = item.id).join) == null ? void 0 : _b.call(_a2, "_")) === ((_d = (_c = dateDetail.value) == null ? void 0 : _c.dateValue) == null ? void 0 : _d.join("_"));
27022
+ });
27023
+ if (commonDate) {
27024
+ return commonDate.name;
27025
+ }
27026
+ return (_a = dateDetail.value) == null ? void 0 : _a.toDisplayString();
27027
+ });
27007
27028
  useDatePickerProvider({
27008
27029
  commonUseList: commonDateUseList,
27009
27030
  format,
@@ -27011,7 +27032,7 @@ ${$(r2)}`), n2;
27011
27032
  t,
27012
27033
  timezoneInfo,
27013
27034
  version: __WEBPACK_EXTERNAL_MODULE_vue__.computed(() => props2.version),
27014
- vildateTimeRange: __WEBPACK_EXTERNAL_MODULE_vue__.computed(() => props2.validDateRange)
27035
+ validateTimeRange: __WEBPACK_EXTERNAL_MODULE_vue__.computed(() => props2.validDateRange)
27015
27036
  });
27016
27037
  __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount(() => {
27017
27038
  tooltipsShow.value = false;
@@ -27042,7 +27063,11 @@ ${$(r2)}`), n2;
27042
27063
  dateDetail.value = new DateRange(val, format.value, props2.timezone);
27043
27064
  const emitValue = dateDetail.value.toEmitValue();
27044
27065
  emits("update:modelValue", ...emitValue);
27045
- const canStore = commonDateUseList.value.some((item) => item[0] === start2 && item[1] === end2);
27066
+ const canStore = commonDateUseList.value.some((item) => {
27067
+ const startDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[0] : item[0];
27068
+ const endDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[1] : item[1];
27069
+ return startDate === start2 && endDate === end2;
27070
+ });
27046
27071
  !canStore && dateDetail.value.isValidate && setStoreDateList(val, storeKey2.value);
27047
27072
  };
27048
27073
  const handleTimezoneChange = (val, info) => {
@@ -27148,7 +27173,7 @@ ${$(r2)}`), n2;
27148
27173
  __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode(
27149
27174
  "span",
27150
27175
  null,
27151
- __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString(dateDetail.value.toDisplayString()),
27176
+ __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString(dateDetailDisplayString.value),
27152
27177
  1
27153
27178
  /* TEXT */
27154
27179
  ),
@@ -338,6 +338,7 @@ class DateRange {
338
338
  __publicField(this, "startDate");
339
339
  __publicField(this, "startNum");
340
340
  __publicField(this, "startUnit");
341
+ __publicField(this, "userDisplayName");
341
342
  this.dateValue = dateValue;
342
343
  this.format = format;
343
344
  this.timezome = timezome;
@@ -436,6 +437,9 @@ class DateRange {
436
437
  if (!this.startDate || !this.endDate) return false;
437
438
  return (this.startDate.isSame(date.startDate, "ms") || this.startDate.isBefore(date.startDate)) && (this.endDate.isSame(date.endDate, "ms") || this.endDate.isAfter(date.endDate));
438
439
  }
440
+ setUserDisplayName(v) {
441
+ this.userDisplayName = v;
442
+ }
439
443
  toDisplayString() {
440
444
  var _a, _b;
441
445
  const {
@@ -450,6 +454,7 @@ class DateRange {
450
454
  startNum,
451
455
  startUnit
452
456
  } = this;
457
+ if (this.userDisplayName) return this.userDisplayName;
453
458
  if (!startDate || !endDate || !isValidate) {
454
459
  return ((_a = this.dateValue) == null ? void 0 : _a.join(" ~ ")) || "";
455
460
  }
@@ -2049,16 +2054,16 @@ const useDatePickerProvider = (data) => {
2049
2054
  };
2050
2055
  const useDatePickerInject = () => inject(DATE_PICKER_PROVIDER_KEY);
2051
2056
  const useValidate = () => {
2052
- const { format, timezoneInfo, vildateTimeRange } = useDatePickerInject();
2057
+ const { format, timezoneInfo, validateTimeRange } = useDatePickerInject();
2053
2058
  const validDateRange = customRef((track) => {
2054
- let date = new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
2059
+ let date = new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
2055
2060
  return {
2056
2061
  get() {
2057
2062
  var _a;
2058
2063
  track();
2059
- if (((_a = vildateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
2060
- if (vildateTimeRange.value.some((v) => typeof v === "string" && v.includes("now")))
2061
- return new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
2064
+ if (((_a = validateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
2065
+ if (validateTimeRange.value.some((v) => typeof v === "string" && v.includes("now")))
2066
+ return new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
2062
2067
  return date;
2063
2068
  },
2064
2069
  set() {
@@ -3801,9 +3806,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
3801
3806
  const browserTimezone = dayjs.tz.guess();
3802
3807
  const recentUseList = shallowRef(getStoreDateList(storeKey2.value));
3803
3808
  const dateList = computed(
3804
- () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map(
3805
- (date) => new DateRange(date, format.value, props.timezone)
3806
- )
3809
+ () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map((date) => {
3810
+ if ((date == null ? void 0 : date.id) && date.name) {
3811
+ const dateRange = new DateRange(date.id, format.value, props.timezone);
3812
+ dateRange.setUserDisplayName(date.name);
3813
+ return dateRange;
3814
+ }
3815
+ return new DateRange(date, format.value, props.timezone);
3816
+ })
3807
3817
  );
3808
3818
  const handleChange = (date) => {
3809
3819
  emits("change", date);
@@ -4074,6 +4084,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4074
4084
  var _a;
4075
4085
  return ((_a = props.commonUseList) == null ? void 0 : _a.length) ? props.commonUseList : commonDateList;
4076
4086
  });
4087
+ const dateDetailDisplayString = computed(() => {
4088
+ var _a;
4089
+ const commonDate = commonDateUseList.value.find((item) => {
4090
+ var _a2, _b, _c, _d;
4091
+ return Array(item.id) && ((_b = (_a2 = item.id).join) == null ? void 0 : _b.call(_a2, "_")) === ((_d = (_c = dateDetail.value) == null ? void 0 : _c.dateValue) == null ? void 0 : _d.join("_"));
4092
+ });
4093
+ if (commonDate) {
4094
+ return commonDate.name;
4095
+ }
4096
+ return (_a = dateDetail.value) == null ? void 0 : _a.toDisplayString();
4097
+ });
4077
4098
  useDatePickerProvider({
4078
4099
  commonUseList: commonDateUseList,
4079
4100
  format,
@@ -4081,7 +4102,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4081
4102
  t,
4082
4103
  timezoneInfo,
4083
4104
  version: computed(() => props.version),
4084
- vildateTimeRange: computed(() => props.validDateRange)
4105
+ validateTimeRange: computed(() => props.validDateRange)
4085
4106
  });
4086
4107
  onBeforeUnmount(() => {
4087
4108
  tooltipsShow.value = false;
@@ -4112,7 +4133,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4112
4133
  dateDetail.value = new DateRange(val, format.value, props.timezone);
4113
4134
  const emitValue = dateDetail.value.toEmitValue();
4114
4135
  emits("update:modelValue", ...emitValue);
4115
- const canStore = commonDateUseList.value.some((item) => item[0] === start && item[1] === end);
4136
+ const canStore = commonDateUseList.value.some((item) => {
4137
+ const startDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[0] : item[0];
4138
+ const endDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[1] : item[1];
4139
+ return startDate === start && endDate === end;
4140
+ });
4116
4141
  !canStore && dateDetail.value.isValidate && setStoreDateList(val, storeKey2.value);
4117
4142
  };
4118
4143
  const handleTimezoneChange = (val, info) => {
@@ -4218,7 +4243,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4218
4243
  createElementVNode(
4219
4244
  "span",
4220
4245
  null,
4221
- toDisplayString(dateDetail.value.toDisplayString()),
4246
+ toDisplayString(dateDetailDisplayString.value),
4222
4247
  1
4223
4248
  /* TEXT */
4224
4249
  ),
@@ -23871,6 +23871,7 @@ ${$(r2)}`), n2;
23871
23871
  __publicField(this, "startDate");
23872
23872
  __publicField(this, "startNum");
23873
23873
  __publicField(this, "startUnit");
23874
+ __publicField(this, "userDisplayName");
23874
23875
  this.dateValue = dateValue;
23875
23876
  this.format = format;
23876
23877
  this.timezome = timezome;
@@ -23969,6 +23970,9 @@ ${$(r2)}`), n2;
23969
23970
  if (!this.startDate || !this.endDate) return false;
23970
23971
  return (this.startDate.isSame(date.startDate, "ms") || this.startDate.isBefore(date.startDate)) && (this.endDate.isSame(date.endDate, "ms") || this.endDate.isAfter(date.endDate));
23971
23972
  }
23973
+ setUserDisplayName(v2) {
23974
+ this.userDisplayName = v2;
23975
+ }
23972
23976
  toDisplayString() {
23973
23977
  var _a, _b;
23974
23978
  const {
@@ -23983,6 +23987,7 @@ ${$(r2)}`), n2;
23983
23987
  startNum,
23984
23988
  startUnit
23985
23989
  } = this;
23990
+ if (this.userDisplayName) return this.userDisplayName;
23986
23991
  if (!startDate || !endDate || !isValidate) {
23987
23992
  return ((_a = this.dateValue) == null ? void 0 : _a.join(" ~ ")) || "";
23988
23993
  }
@@ -25582,16 +25587,16 @@ ${$(r2)}`), n2;
25582
25587
  };
25583
25588
  const useDatePickerInject = () => __WEBPACK_EXTERNAL_MODULE_vue__.inject(DATE_PICKER_PROVIDER_KEY);
25584
25589
  const useValidate = () => {
25585
- const { format, timezoneInfo, vildateTimeRange } = useDatePickerInject();
25590
+ const { format, timezoneInfo, validateTimeRange } = useDatePickerInject();
25586
25591
  const validDateRange = __WEBPACK_EXTERNAL_MODULE_vue__.customRef((track) => {
25587
- let date = new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
25592
+ let date = new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
25588
25593
  return {
25589
25594
  get() {
25590
25595
  var _a;
25591
25596
  track();
25592
- if (((_a = vildateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
25593
- if (vildateTimeRange.value.some((v2) => typeof v2 === "string" && v2.includes("now")))
25594
- return new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
25597
+ if (((_a = validateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
25598
+ if (validateTimeRange.value.some((v2) => typeof v2 === "string" && v2.includes("now")))
25599
+ return new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
25595
25600
  return date;
25596
25601
  },
25597
25602
  set() {
@@ -27334,9 +27339,14 @@ ${$(r2)}`), n2;
27334
27339
  const browserTimezone = dayjs.tz.guess();
27335
27340
  const recentUseList = __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef(getStoreDateList(storeKey2.value));
27336
27341
  const dateList = __WEBPACK_EXTERNAL_MODULE_vue__.computed(
27337
- () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map(
27338
- (date) => new DateRange(date, format.value, props2.timezone)
27339
- )
27342
+ () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map((date) => {
27343
+ if ((date == null ? void 0 : date.id) && date.name) {
27344
+ const dateRange = new DateRange(date.id, format.value, props2.timezone);
27345
+ dateRange.setUserDisplayName(date.name);
27346
+ return dateRange;
27347
+ }
27348
+ return new DateRange(date, format.value, props2.timezone);
27349
+ })
27340
27350
  );
27341
27351
  const handleChange = (date) => {
27342
27352
  emits("change", date);
@@ -27607,6 +27617,17 @@ ${$(r2)}`), n2;
27607
27617
  var _a;
27608
27618
  return ((_a = props2.commonUseList) == null ? void 0 : _a.length) ? props2.commonUseList : commonDateList;
27609
27619
  });
27620
+ const dateDetailDisplayString = __WEBPACK_EXTERNAL_MODULE_vue__.computed(() => {
27621
+ var _a;
27622
+ const commonDate = commonDateUseList.value.find((item) => {
27623
+ var _a2, _b, _c, _d;
27624
+ return Array(item.id) && ((_b = (_a2 = item.id).join) == null ? void 0 : _b.call(_a2, "_")) === ((_d = (_c = dateDetail.value) == null ? void 0 : _c.dateValue) == null ? void 0 : _d.join("_"));
27625
+ });
27626
+ if (commonDate) {
27627
+ return commonDate.name;
27628
+ }
27629
+ return (_a = dateDetail.value) == null ? void 0 : _a.toDisplayString();
27630
+ });
27610
27631
  useDatePickerProvider({
27611
27632
  commonUseList: commonDateUseList,
27612
27633
  format,
@@ -27614,7 +27635,7 @@ ${$(r2)}`), n2;
27614
27635
  t,
27615
27636
  timezoneInfo,
27616
27637
  version: __WEBPACK_EXTERNAL_MODULE_vue__.computed(() => props2.version),
27617
- vildateTimeRange: __WEBPACK_EXTERNAL_MODULE_vue__.computed(() => props2.validDateRange)
27638
+ validateTimeRange: __WEBPACK_EXTERNAL_MODULE_vue__.computed(() => props2.validDateRange)
27618
27639
  });
27619
27640
  __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount(() => {
27620
27641
  tooltipsShow.value = false;
@@ -27645,7 +27666,11 @@ ${$(r2)}`), n2;
27645
27666
  dateDetail.value = new DateRange(val, format.value, props2.timezone);
27646
27667
  const emitValue = dateDetail.value.toEmitValue();
27647
27668
  emits("update:modelValue", ...emitValue);
27648
- const canStore = commonDateUseList.value.some((item) => item[0] === start2 && item[1] === end2);
27669
+ const canStore = commonDateUseList.value.some((item) => {
27670
+ const startDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[0] : item[0];
27671
+ const endDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[1] : item[1];
27672
+ return startDate === start2 && endDate === end2;
27673
+ });
27649
27674
  !canStore && dateDetail.value.isValidate && setStoreDateList(val, storeKey2.value);
27650
27675
  };
27651
27676
  const handleTimezoneChange = (val, info) => {
@@ -27751,7 +27776,7 @@ ${$(r2)}`), n2;
27751
27776
  __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode(
27752
27777
  "span",
27753
27778
  null,
27754
- __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString(dateDetail.value.toDisplayString()),
27779
+ __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString(dateDetailDisplayString.value),
27755
27780
  1
27756
27781
  /* TEXT */
27757
27782
  ),
@@ -334,6 +334,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
334
334
  __publicField(this, "startDate");
335
335
  __publicField(this, "startNum");
336
336
  __publicField(this, "startUnit");
337
+ __publicField(this, "userDisplayName");
337
338
  this.dateValue = dateValue;
338
339
  this.format = format;
339
340
  this.timezome = timezome;
@@ -432,6 +433,9 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
432
433
  if (!this.startDate || !this.endDate) return false;
433
434
  return (this.startDate.isSame(date.startDate, "ms") || this.startDate.isBefore(date.startDate)) && (this.endDate.isSame(date.endDate, "ms") || this.endDate.isAfter(date.endDate));
434
435
  }
436
+ setUserDisplayName(v) {
437
+ this.userDisplayName = v;
438
+ }
435
439
  toDisplayString() {
436
440
  var _a, _b;
437
441
  const {
@@ -446,6 +450,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
446
450
  startNum,
447
451
  startUnit
448
452
  } = this;
453
+ if (this.userDisplayName) return this.userDisplayName;
449
454
  if (!startDate || !endDate || !isValidate) {
450
455
  return ((_a = this.dateValue) == null ? void 0 : _a.join(" ~ ")) || "";
451
456
  }
@@ -2045,16 +2050,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
2045
2050
  };
2046
2051
  const useDatePickerInject = () => vue.inject(DATE_PICKER_PROVIDER_KEY);
2047
2052
  const useValidate = () => {
2048
- const { format, timezoneInfo, vildateTimeRange } = useDatePickerInject();
2053
+ const { format, timezoneInfo, validateTimeRange } = useDatePickerInject();
2049
2054
  const validDateRange = vue.customRef((track) => {
2050
- let date = new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
2055
+ let date = new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
2051
2056
  return {
2052
2057
  get() {
2053
2058
  var _a;
2054
2059
  track();
2055
- if (((_a = vildateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
2056
- if (vildateTimeRange.value.some((v) => typeof v === "string" && v.includes("now")))
2057
- return new DateRange(vildateTimeRange.value, format.value, timezoneInfo.value.label);
2060
+ if (((_a = validateTimeRange.value) == null ? void 0 : _a.length) !== 2) return void 0;
2061
+ if (validateTimeRange.value.some((v) => typeof v === "string" && v.includes("now")))
2062
+ return new DateRange(validateTimeRange.value, format.value, timezoneInfo.value.label);
2058
2063
  return date;
2059
2064
  },
2060
2065
  set() {
@@ -3797,9 +3802,14 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
3797
3802
  const browserTimezone = dayjs.tz.guess();
3798
3803
  const recentUseList = vue.shallowRef(getStoreDateList(storeKey2.value));
3799
3804
  const dateList = vue.computed(
3800
- () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map(
3801
- (date) => new DateRange(date, format.value, props.timezone)
3802
- )
3805
+ () => (activePanel.value === "common" ? commonUseList.value || commonDateList : recentUseList.value).map((date) => {
3806
+ if ((date == null ? void 0 : date.id) && date.name) {
3807
+ const dateRange = new DateRange(date.id, format.value, props.timezone);
3808
+ dateRange.setUserDisplayName(date.name);
3809
+ return dateRange;
3810
+ }
3811
+ return new DateRange(date, format.value, props.timezone);
3812
+ })
3803
3813
  );
3804
3814
  const handleChange = (date) => {
3805
3815
  emits("change", date);
@@ -4070,6 +4080,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4070
4080
  var _a;
4071
4081
  return ((_a = props.commonUseList) == null ? void 0 : _a.length) ? props.commonUseList : commonDateList;
4072
4082
  });
4083
+ const dateDetailDisplayString = vue.computed(() => {
4084
+ var _a;
4085
+ const commonDate = commonDateUseList.value.find((item) => {
4086
+ var _a2, _b, _c, _d;
4087
+ return Array(item.id) && ((_b = (_a2 = item.id).join) == null ? void 0 : _b.call(_a2, "_")) === ((_d = (_c = dateDetail.value) == null ? void 0 : _c.dateValue) == null ? void 0 : _d.join("_"));
4088
+ });
4089
+ if (commonDate) {
4090
+ return commonDate.name;
4091
+ }
4092
+ return (_a = dateDetail.value) == null ? void 0 : _a.toDisplayString();
4093
+ });
4073
4094
  useDatePickerProvider({
4074
4095
  commonUseList: commonDateUseList,
4075
4096
  format,
@@ -4077,7 +4098,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4077
4098
  t,
4078
4099
  timezoneInfo,
4079
4100
  version: vue.computed(() => props.version),
4080
- vildateTimeRange: vue.computed(() => props.validDateRange)
4101
+ validateTimeRange: vue.computed(() => props.validDateRange)
4081
4102
  });
4082
4103
  vue.onBeforeUnmount(() => {
4083
4104
  tooltipsShow.value = false;
@@ -4108,7 +4129,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4108
4129
  dateDetail.value = new DateRange(val, format.value, props.timezone);
4109
4130
  const emitValue = dateDetail.value.toEmitValue();
4110
4131
  emits("update:modelValue", ...emitValue);
4111
- const canStore = commonDateUseList.value.some((item) => item[0] === start && item[1] === end);
4132
+ const canStore = commonDateUseList.value.some((item) => {
4133
+ const startDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[0] : item[0];
4134
+ const endDate = Array.isArray(item == null ? void 0 : item.id) ? item.id[1] : item[1];
4135
+ return startDate === start && endDate === end;
4136
+ });
4112
4137
  !canStore && dateDetail.value.isValidate && setStoreDateList(val, storeKey2.value);
4113
4138
  };
4114
4139
  const handleTimezoneChange = (val, info) => {
@@ -4214,7 +4239,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4214
4239
  vue.createElementVNode(
4215
4240
  "span",
4216
4241
  null,
4217
- vue.toDisplayString(dateDetail.value.toDisplayString()),
4242
+ vue.toDisplayString(dateDetailDisplayString.value),
4218
4243
  1
4219
4244
  /* TEXT */
4220
4245
  ),