This commit is contained in:
2025-09-19 14:25:20 +08:00
parent 269893a435
commit fbf3f77229
24949 changed files with 2839404 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
import Calendar from './src/calendar.vue';
import type { SFCWithInstall } from 'element-plus/es/utils';
export declare const ElCalendar: SFCWithInstall<typeof Calendar>;
export default ElCalendar;
export * from './src/calendar';
export type { CalendarDateTableInstance, DateTableInstance, CalendarInstance, } from './src/instance';

View File

@@ -0,0 +1,15 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var calendar$1 = require('./src/calendar2.js');
var calendar = require('./src/calendar.js');
var install = require('../../utils/vue/install.js');
const ElCalendar = install.withInstall(calendar$1["default"]);
exports.calendarEmits = calendar.calendarEmits;
exports.calendarProps = calendar.calendarProps;
exports.ElCalendar = ElCalendar;
exports["default"] = ElCalendar;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../../../packages/components/calendar/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport Calendar from './src/calendar.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElCalendar: SFCWithInstall<typeof Calendar> = withInstall(Calendar)\nexport default ElCalendar\n\nexport * from './src/calendar'\nexport type {\n CalendarDateTableInstance,\n DateTableInstance,\n CalendarInstance,\n} from './src/instance'\n"],"names":["withInstall","Calendar"],"mappings":";;;;;;;;AAEY,MAAC,UAAU,GAAGA,mBAAW,CAACC,qBAAQ;;;;;;;"}

View File

@@ -0,0 +1,23 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
export type CalendarDateType = 'prev-month' | 'next-month' | 'prev-year' | 'next-year' | 'today';
export declare const calendarProps: {
readonly modelValue: {
readonly type: import("vue").PropType<Date>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly range: {
readonly type: import("vue").PropType<[Date, Date]>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
export type CalendarProps = ExtractPropTypes<typeof calendarProps>;
export type CalendarPropsPublic = __ExtractPublicPropTypes<typeof calendarProps>;
export declare const calendarEmits: {
"update:modelValue": (value: Date) => boolean;
input: (value: Date) => boolean;
};
export type CalendarEmits = typeof calendarEmits;

View File

@@ -0,0 +1,26 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var runtime = require('../../../utils/vue/props/runtime.js');
var shared = require('@vue/shared');
var event = require('../../../constants/event.js');
const isValidRange = (range) => shared.isArray(range) && range.length === 2 && range.every((item) => shared.isDate(item));
const calendarProps = runtime.buildProps({
modelValue: {
type: Date
},
range: {
type: runtime.definePropType(Array),
validator: isValidRange
}
});
const calendarEmits = {
[event.UPDATE_MODEL_EVENT]: (value) => shared.isDate(value),
[event.INPUT_EVENT]: (value) => shared.isDate(value)
};
exports.calendarEmits = calendarEmits;
exports.calendarProps = calendarProps;
//# sourceMappingURL=calendar.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"calendar.js","sources":["../../../../../../packages/components/calendar/src/calendar.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isArray,\n isDate,\n} from '@element-plus/utils'\nimport { INPUT_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\n\nexport type CalendarDateType =\n | 'prev-month'\n | 'next-month'\n | 'prev-year'\n | 'next-year'\n | 'today'\n\nconst isValidRange = (range: unknown): range is [Date, Date] =>\n isArray(range) && range.length === 2 && range.every((item) => isDate(item))\n\nexport const calendarProps = buildProps({\n /**\n * @description binding value\n */\n modelValue: {\n type: Date,\n },\n /**\n * @description time range, including start time and end time.\n * Start time must be start day of week, end time must be end day of week, the time span cannot exceed two months.\n */\n range: {\n type: definePropType<[Date, Date]>(Array),\n validator: isValidRange,\n },\n} as const)\nexport type CalendarProps = ExtractPropTypes<typeof calendarProps>\nexport type CalendarPropsPublic = __ExtractPublicPropTypes<typeof calendarProps>\n\nexport const calendarEmits = {\n [UPDATE_MODEL_EVENT]: (value: Date) => isDate(value),\n [INPUT_EVENT]: (value: Date) => isDate(value),\n}\nexport type CalendarEmits = typeof calendarEmits\n"],"names":["isArray","isDate","buildProps","definePropType","UPDATE_MODEL_EVENT","INPUT_EVENT"],"mappings":";;;;;;;;AAOA,MAAM,YAAY,GAAG,CAAC,KAAK,KAAKA,cAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,KAAKC,aAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAChG,MAAC,aAAa,GAAGC,kBAAU,CAAC;AACxC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,SAAS,EAAE,YAAY;AAC3B,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,CAACC,wBAAkB,GAAG,CAAC,KAAK,KAAKH,aAAM,CAAC,KAAK,CAAC;AAChD,EAAE,CAACI,iBAAW,GAAG,CAAC,KAAK,KAAKJ,aAAM,CAAC,KAAK,CAAC;AACzC;;;;;"}

View File

@@ -0,0 +1,70 @@
declare function __VLS_template(): {
header?(_: {
date: string;
}): any;
"date-cell"?(_: {
data: {
isSelected: boolean;
type: string;
day: string;
date: Date;
};
}): any;
"date-cell"?(_: {
data: {
isSelected: boolean;
type: string;
day: string;
date: Date;
};
}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly modelValue: {
readonly type: import("vue").PropType<Date>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly range: {
readonly type: import("vue").PropType<[Date, Date]>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}, {
/** @description currently selected date */
selectedDay: import("vue").WritableComputedRef<import("dayjs").Dayjs | undefined>;
/** @description select a specific date */
pickDay: (day: import("dayjs").Dayjs) => void;
/** @description select date */
selectDate: (type: import("./calendar").CalendarDateType) => void;
/** @description Calculate the validate date range according to the start and end dates */
calculateValidatedDateRange: (startDayjs: import("dayjs").Dayjs, endDayjs: import("dayjs").Dayjs) => [import("dayjs").Dayjs, import("dayjs").Dayjs][];
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
"update:modelValue": (value: Date) => void;
input: (value: Date) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly modelValue: {
readonly type: import("vue").PropType<Date>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly range: {
readonly type: import("vue").PropType<[Date, Date]>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}>> & {
"onUpdate:modelValue"?: ((value: Date) => any) | undefined;
onInput?: ((value: Date) => any) | undefined;
}, {}>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};

View File

@@ -0,0 +1,143 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var index$2 = require('../../button/index.js');
var dateTable = require('./date-table2.js');
var useCalendar = require('./use-calendar.js');
var calendar = require('./calendar.js');
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../hooks/use-namespace/index.js');
var index$1 = require('../../../hooks/use-locale/index.js');
const COMPONENT_NAME = "ElCalendar";
const __default__ = vue.defineComponent({
name: COMPONENT_NAME
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: calendar.calendarProps,
emits: calendar.calendarEmits,
setup(__props, { expose, emit }) {
const props = __props;
const ns = index.useNamespace("calendar");
const {
calculateValidatedDateRange,
date,
pickDay,
realSelectedDay,
selectDate,
validatedRange
} = useCalendar.useCalendar(props, emit);
const { t } = index$1.useLocale();
const i18nDate = vue.computed(() => {
const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
});
expose({
selectedDay: realSelectedDay,
pickDay,
selectDate,
calculateValidatedDateRange
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("div", {
class: vue.normalizeClass(vue.unref(ns).b())
}, [
vue.createElementVNode("div", {
class: vue.normalizeClass(vue.unref(ns).e("header"))
}, [
vue.renderSlot(_ctx.$slots, "header", { date: vue.unref(i18nDate) }, () => [
vue.createElementVNode("div", {
class: vue.normalizeClass(vue.unref(ns).e("title"))
}, vue.toDisplayString(vue.unref(i18nDate)), 3),
vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: vue.normalizeClass(vue.unref(ns).e("button-group"))
}, [
vue.createVNode(vue.unref(index$2.ElButtonGroup), null, {
default: vue.withCtx(() => [
vue.createVNode(vue.unref(index$2.ElButton), {
size: "small",
onClick: ($event) => vue.unref(selectDate)("prev-month")
}, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.prevMonth")), 1)
]),
_: 1
}, 8, ["onClick"]),
vue.createVNode(vue.unref(index$2.ElButton), {
size: "small",
onClick: ($event) => vue.unref(selectDate)("today")
}, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.today")), 1)
]),
_: 1
}, 8, ["onClick"]),
vue.createVNode(vue.unref(index$2.ElButton), {
size: "small",
onClick: ($event) => vue.unref(selectDate)("next-month")
}, {
default: vue.withCtx(() => [
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.nextMonth")), 1)
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
], 2)) : vue.createCommentVNode("v-if", true)
])
], 2),
vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
key: 0,
class: vue.normalizeClass(vue.unref(ns).e("body"))
}, [
vue.createVNode(dateTable["default"], {
date: vue.unref(date),
"selected-day": vue.unref(realSelectedDay),
onPick: vue.unref(pickDay)
}, vue.createSlots({
_: 2
}, [
_ctx.$slots["date-cell"] ? {
name: "date-cell",
fn: vue.withCtx((data) => [
vue.renderSlot(_ctx.$slots, "date-cell", vue.normalizeProps(vue.guardReactiveProps(data)))
])
} : void 0
]), 1032, ["date", "selected-day", "onPick"])
], 2)) : (vue.openBlock(), vue.createElementBlock("div", {
key: 1,
class: vue.normalizeClass(vue.unref(ns).e("body"))
}, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(validatedRange), (range_, index) => {
return vue.openBlock(), vue.createBlock(dateTable["default"], {
key: index,
date: range_[0],
"selected-day": vue.unref(realSelectedDay),
range: range_,
"hide-header": index !== 0,
onPick: vue.unref(pickDay)
}, vue.createSlots({
_: 2
}, [
_ctx.$slots["date-cell"] ? {
name: "date-cell",
fn: vue.withCtx((data) => [
vue.renderSlot(_ctx.$slots, "date-cell", vue.normalizeProps(vue.guardReactiveProps(data)))
])
} : void 0
]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
}), 128))
], 2))
], 2);
};
}
});
var Calendar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "calendar.vue"]]);
exports["default"] = Calendar;
//# sourceMappingURL=calendar2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"calendar2.js","sources":["../../../../../../packages/components/calendar/src/calendar.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div :class=\"ns.e('header')\">\n <slot name=\"header\" :date=\"i18nDate\">\n <div :class=\"ns.e('title')\">{{ i18nDate }}</div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('button-group')\">\n <el-button-group>\n <el-button size=\"small\" @click=\"selectDate('prev-month')\">\n {{ t('el.datepicker.prevMonth') }}\n </el-button>\n <el-button size=\"small\" @click=\"selectDate('today')\">\n {{ t('el.datepicker.today') }}\n </el-button>\n <el-button size=\"small\" @click=\"selectDate('next-month')\">\n {{ t('el.datepicker.nextMonth') }}\n </el-button>\n </el-button-group>\n </div>\n </slot>\n </div>\n <div v-if=\"validatedRange.length === 0\" :class=\"ns.e('body')\">\n <date-table :date=\"date\" :selected-day=\"realSelectedDay\" @pick=\"pickDay\">\n <template v-if=\"$slots['date-cell']\" #date-cell=\"data\">\n <slot name=\"date-cell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n <div v-else :class=\"ns.e('body')\">\n <date-table\n v-for=\"(range_, index) in validatedRange\"\n :key=\"index\"\n :date=\"range_[0]\"\n :selected-day=\"realSelectedDay\"\n :range=\"range_\"\n :hide-header=\"index !== 0\"\n @pick=\"pickDay\"\n >\n <template v-if=\"$slots['date-cell']\" #date-cell=\"data\">\n <slot name=\"date-cell\" v-bind=\"data\" />\n </template>\n </date-table>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { ElButton, ElButtonGroup } from '@element-plus/components/button'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport DateTable from './date-table.vue'\nimport { useCalendar } from './use-calendar'\nimport { calendarEmits, calendarProps } from './calendar'\n\nconst ns = useNamespace('calendar')\n\nconst COMPONENT_NAME = 'ElCalendar'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(calendarProps)\nconst emit = defineEmits(calendarEmits)\n\nconst {\n calculateValidatedDateRange,\n date,\n pickDay,\n realSelectedDay,\n selectDate,\n validatedRange,\n} = useCalendar(props, emit, COMPONENT_NAME)\n\nconst { t } = useLocale()\n\nconst i18nDate = computed(() => {\n const pickedMonth = `el.datepicker.month${date.value.format('M')}`\n return `${date.value.year()} ${t('el.datepicker.year')} ${t(pickedMonth)}`\n})\n\ndefineExpose({\n /** @description currently selected date */\n selectedDay: realSelectedDay,\n /** @description select a specific date */\n pickDay,\n /** @description select date */\n selectDate,\n /** @description Calculate the validate date range according to the start and end dates */\n calculateValidatedDateRange,\n})\n</script>\n"],"names":["useNamespace","useCalendar","useLocale","computed","_openBlock","_createElementBlock","_normalizeClass","_unref"],"mappings":";;;;;;;;;;;;;;uCAwDc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AALA,IAAM,MAAA,EAAA,GAAKA,mBAAa,UAAU,CAAA,CAAA;AAUlC,IAAM,MAAA;AAAA,MACJ,2BAAA;AAAA,MACA,IAAA;AAAA,MACA,OAAA;AAAA,MACA,eAAA;AAAA,MACA,UAAA;AAAA,MACA,cAAA;AAAA,KACE,GAAAC,uBAAA,CAAY,KAAO,EAAA,IAAoB,CAAA,CAAA;AAE3C,IAAM,MAAA,EAAE,CAAE,EAAA,GAAIC,iBAAU,EAAA,CAAA;AAExB,IAAM,MAAA,QAAA,GAAWC,aAAS,MAAM;AAC9B,MAAA,MAAM,cAAc,CAAsB,mBAAA,EAAA,IAAA,CAAK,KAAM,CAAA,MAAA,CAAO,GAAG,CAAC,CAAA,CAAA,CAAA;AAChE,MAAA,OAAO,CAAG,EAAA,IAAA,CAAK,KAAM,CAAA,IAAA,EAAM,CAAA,CAAA,EAAI,CAAE,CAAA,oBAAoB,CAAC,CAAA,CAAA,EAAI,CAAE,CAAA,WAAW,CAAC,CAAA,CAAA,CAAA;AAAA,KACzE,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MAAA,WAAA,EAAA,eAAA;AAAA,MAEX,OAAa;AAAA,MAAA,UAAA;AAAA,MAEb,2BAAA;AAAA,KAAA,CAAA,CAAA;AAAA,IAEA,OAAA,CAAA,IAAA,EAAA,MAAA,KAAA;AAAA,MAAA,OAAAC,aAAA,EAAA,EAAAC,sBAAA,CAAA,KAAA,EAAA;AAAA,QAEA,KAAA,EAAAC,kBAAA,CAAAC,SAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AAAA,OACD,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,42 @@
import type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue';
import type { Dayjs } from 'dayjs';
export type CalendarDateCellType = 'next' | 'prev' | 'current';
export type CalendarDateCell = {
text: number;
type: CalendarDateCellType;
};
export declare const getPrevMonthLastDays: (date: Dayjs, count: number) => number[];
export declare const getMonthDays: (date: Dayjs) => number[];
export declare const toNestedArr: (days: CalendarDateCell[]) => CalendarDateCell[][];
export declare const dateTableProps: {
readonly selectedDay: {
readonly type: import("vue").PropType<Dayjs>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly range: {
readonly type: import("vue").PropType<[Dayjs, Dayjs]>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly date: {
readonly type: import("vue").PropType<Dayjs>;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly hideHeader: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
};
export type DateTableProps = ExtractPropTypes<typeof dateTableProps>;
export type DateTablePropsPublic = __ExtractPublicPropTypes<typeof dateTableProps>;
export declare const dateTableEmits: {
pick: (value: Dayjs) => boolean;
};
export type DateTableEmits = typeof dateTableEmits;

View File

@@ -0,0 +1,45 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var utils = require('../../time-picker/src/utils.js');
var runtime = require('../../../utils/vue/props/runtime.js');
var shared = require('@vue/shared');
const getPrevMonthLastDays = (date, count) => {
const lastDay = date.subtract(1, "month").endOf("month").date();
return utils.rangeArr(count).map((_, index) => lastDay - (count - index - 1));
};
const getMonthDays = (date) => {
const days = date.daysInMonth();
return utils.rangeArr(days).map((_, index) => index + 1);
};
const toNestedArr = (days) => utils.rangeArr(days.length / 7).map((index) => {
const start = index * 7;
return days.slice(start, start + 7);
});
const dateTableProps = runtime.buildProps({
selectedDay: {
type: runtime.definePropType(Object)
},
range: {
type: runtime.definePropType(Array)
},
date: {
type: runtime.definePropType(Object),
required: true
},
hideHeader: {
type: Boolean
}
});
const dateTableEmits = {
pick: (value) => shared.isObject(value)
};
exports.dateTableEmits = dateTableEmits;
exports.dateTableProps = dateTableProps;
exports.getMonthDays = getMonthDays;
exports.getPrevMonthLastDays = getPrevMonthLastDays;
exports.toNestedArr = toNestedArr;
//# sourceMappingURL=date-table.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"date-table.js","sources":["../../../../../../packages/components/calendar/src/date-table.ts"],"sourcesContent":["import { buildProps, definePropType, isObject } from '@element-plus/utils'\nimport { rangeArr } from '@element-plus/components/time-picker'\n\nimport type { ExtractPropTypes, __ExtractPublicPropTypes } from 'vue'\nimport type { Dayjs } from 'dayjs'\n\nexport type CalendarDateCellType = 'next' | 'prev' | 'current'\nexport type CalendarDateCell = {\n text: number\n type: CalendarDateCellType\n}\n\nexport const getPrevMonthLastDays = (date: Dayjs, count: number) => {\n const lastDay = date.subtract(1, 'month').endOf('month').date()\n return rangeArr(count).map((_, index) => lastDay - (count - index - 1))\n}\n\nexport const getMonthDays = (date: Dayjs) => {\n const days = date.daysInMonth()\n return rangeArr(days).map((_, index) => index + 1)\n}\n\nexport const toNestedArr = (days: CalendarDateCell[]) =>\n rangeArr(days.length / 7).map((index) => {\n const start = index * 7\n return days.slice(start, start + 7)\n })\n\nexport const dateTableProps = buildProps({\n selectedDay: {\n type: definePropType<Dayjs>(Object),\n },\n range: {\n type: definePropType<[Dayjs, Dayjs]>(Array),\n },\n date: {\n type: definePropType<Dayjs>(Object),\n required: true,\n },\n hideHeader: {\n type: Boolean,\n },\n} as const)\nexport type DateTableProps = ExtractPropTypes<typeof dateTableProps>\nexport type DateTablePropsPublic = __ExtractPublicPropTypes<\n typeof dateTableProps\n>\n\nexport const dateTableEmits = {\n pick: (value: Dayjs) => isObject(value),\n}\nexport type DateTableEmits = typeof dateTableEmits\n"],"names":["rangeArr","buildProps","definePropType","isObject"],"mappings":";;;;;;;;AAEY,MAAC,oBAAoB,GAAG,CAAC,IAAI,EAAE,KAAK,KAAK;AACrD,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AAClE,EAAE,OAAOA,cAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,IAAI,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;AAC1E,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;AAClC,EAAE,OAAOA,cAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC;AACrD,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,IAAI,KAAKA,cAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK;AAC9E,EAAE,MAAM,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;AAC1B,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AACtC,CAAC,EAAE;AACS,MAAC,cAAc,GAAGC,kBAAU,CAAC;AACzC,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAEC,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEA,sBAAc,CAAC,MAAM,CAAC;AAChC,IAAI,QAAQ,EAAE,IAAI;AAClB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,cAAc,GAAG;AAC9B,EAAE,IAAI,EAAE,CAAC,KAAK,KAAKC,eAAQ,CAAC,KAAK,CAAC;AAClC;;;;;;;;"}

View File

@@ -0,0 +1,75 @@
declare function __VLS_template(): {
"date-cell"?(_: {
data: {
isSelected: boolean;
type: string;
day: string;
date: Date;
};
}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{
readonly selectedDay: {
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly range: {
readonly type: import("vue").PropType<[import("dayjs").Dayjs, import("dayjs").Dayjs]>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly date: {
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly hideHeader: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}, {
/** @description toggle date panel */
getFormattedDate: (day: number, type: import("./date-table").CalendarDateCellType) => import("dayjs").Dayjs;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
pick: (value: import("dayjs").Dayjs) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
readonly selectedDay: {
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly range: {
readonly type: import("vue").PropType<[import("dayjs").Dayjs, import("dayjs").Dayjs]>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly date: {
readonly type: import("vue").PropType<import("dayjs").Dayjs>;
readonly required: true;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
readonly hideHeader: {
readonly type: import("vue").PropType<import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
readonly required: false;
readonly validator: ((val: unknown) => boolean) | undefined;
__epPropKey: true;
};
}>> & {
onPick?: ((value: import("dayjs").Dayjs) => any) | undefined;
}, {}>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};

View File

@@ -0,0 +1,99 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var dateTable = require('./date-table.js');
var useDateTable = require('./use-date-table.js');
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
var index = require('../../../hooks/use-namespace/index.js');
const __default__ = vue.defineComponent({
name: "DateTable"
});
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
...__default__,
props: dateTable.dateTableProps,
emits: dateTable.dateTableEmits,
setup(__props, { expose, emit }) {
const props = __props;
const {
isInRange,
now,
rows,
weekDays,
getFormattedDate,
handlePickDay,
getSlotData
} = useDateTable.useDateTable(props, emit);
const nsTable = index.useNamespace("calendar-table");
const nsDay = index.useNamespace("calendar-day");
const getCellClass = ({ text, type }) => {
const classes = [type];
if (type === "current") {
const date = getFormattedDate(text, type);
if (date.isSame(props.selectedDay, "day")) {
classes.push(nsDay.is("selected"));
}
if (date.isSame(now, "day")) {
classes.push(nsDay.is("today"));
}
}
return classes;
};
expose({
getFormattedDate
});
return (_ctx, _cache) => {
return vue.openBlock(), vue.createElementBlock("table", {
class: vue.normalizeClass([vue.unref(nsTable).b(), vue.unref(nsTable).is("range", vue.unref(isInRange))]),
cellspacing: "0",
cellpadding: "0"
}, [
!_ctx.hideHeader ? (vue.openBlock(), vue.createElementBlock("thead", { key: 0 }, [
vue.createElementVNode("tr", null, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(weekDays), (day) => {
return vue.openBlock(), vue.createElementBlock("th", {
key: day,
scope: "col"
}, vue.toDisplayString(day), 1);
}), 128))
])
])) : vue.createCommentVNode("v-if", true),
vue.createElementVNode("tbody", null, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(rows), (row, index) => {
return vue.openBlock(), vue.createElementBlock("tr", {
key: index,
class: vue.normalizeClass({
[vue.unref(nsTable).e("row")]: true,
[vue.unref(nsTable).em("row", "hide-border")]: index === 0 && _ctx.hideHeader
})
}, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(row, (cell, key) => {
return vue.openBlock(), vue.createElementBlock("td", {
key,
class: vue.normalizeClass(getCellClass(cell)),
onClick: ($event) => vue.unref(handlePickDay)(cell)
}, [
vue.createElementVNode("div", {
class: vue.normalizeClass(vue.unref(nsDay).b())
}, [
vue.renderSlot(_ctx.$slots, "date-cell", {
data: vue.unref(getSlotData)(cell)
}, () => [
vue.createElementVNode("span", null, vue.toDisplayString(cell.text), 1)
])
], 2)
], 10, ["onClick"]);
}), 128))
], 2);
}), 128))
])
], 2);
};
}
});
var DateTable = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "date-table.vue"]]);
exports["default"] = DateTable;
//# sourceMappingURL=date-table2.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"date-table2.js","sources":["../../../../../../packages/components/calendar/src/date-table.vue"],"sourcesContent":["<template>\n <table\n :class=\"[nsTable.b(), nsTable.is('range', isInRange)]\"\n cellspacing=\"0\"\n cellpadding=\"0\"\n >\n <thead v-if=\"!hideHeader\">\n <tr>\n <th v-for=\"day in weekDays\" :key=\"day\" scope=\"col\">{{ day }}</th>\n </tr>\n </thead>\n\n <tbody>\n <tr\n v-for=\"(row, index) in rows\"\n :key=\"index\"\n :class=\"{\n [nsTable.e('row')]: true,\n [nsTable.em('row', 'hide-border')]: index === 0 && hideHeader,\n }\"\n >\n <td\n v-for=\"(cell, key) in row\"\n :key=\"key\"\n :class=\"getCellClass(cell)\"\n @click=\"handlePickDay(cell)\"\n >\n <div :class=\"nsDay.b()\">\n <slot name=\"date-cell\" :data=\"getSlotData(cell)\">\n <span>{{ cell.text }}</span>\n </slot>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useNamespace } from '@element-plus/hooks'\nimport { dateTableEmits, dateTableProps } from './date-table'\nimport { useDateTable } from './use-date-table'\n\nimport type { CalendarDateCell } from './date-table'\n\ndefineOptions({\n name: 'DateTable',\n})\n\nconst props = defineProps(dateTableProps)\nconst emit = defineEmits(dateTableEmits)\n\nconst {\n isInRange,\n now,\n rows,\n weekDays,\n getFormattedDate,\n handlePickDay,\n getSlotData,\n} = useDateTable(props, emit)\n\nconst nsTable = useNamespace('calendar-table')\nconst nsDay = useNamespace('calendar-day')\n\nconst getCellClass = ({ text, type }: CalendarDateCell) => {\n const classes: string[] = [type]\n if (type === 'current') {\n const date = getFormattedDate(text, type)\n if (date.isSame(props.selectedDay, 'day')) {\n classes.push(nsDay.is('selected'))\n }\n if (date.isSame(now, 'day')) {\n classes.push(nsDay.is('today'))\n }\n }\n return classes\n}\n\ndefineExpose({\n /** @description toggle date panel */\n getFormattedDate,\n})\n</script>\n"],"names":["useDateTable","useNamespace"],"mappings":";;;;;;;;;;uCA6Cc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA;AAAA,MACJ,SAAA;AAAA,MACA,GAAA;AAAA,MACA,IAAA;AAAA,MACA,QAAA;AAAA,MACA,gBAAA;AAAA,MACA,aAAA;AAAA,MACA,WAAA;AAAA,KACF,GAAIA,yBAAa,CAAA,KAAA,EAAO,IAAI,CAAA,CAAA;AAE5B,IAAM,MAAA,OAAA,GAAUC,mBAAa,gBAAgB,CAAA,CAAA;AAC7C,IAAM,MAAA,KAAA,GAAQA,mBAAa,cAAc,CAAA,CAAA;AAEzC,IAAA,MAAM,YAAe,GAAA,CAAC,EAAE,IAAA,EAAM,MAA6B,KAAA;AACzD,MAAM,MAAA,OAAA,GAAoB,CAAC,IAAI,CAAA,CAAA;AAC/B,MAAA,IAAI,SAAS,SAAW,EAAA;AACtB,QAAM,MAAA,IAAA,GAAO,gBAAiB,CAAA,IAAA,EAAM,IAAI,CAAA,CAAA;AACxC,QAAA,IAAI,IAAK,CAAA,MAAA,CAAO,KAAM,CAAA,WAAA,EAAa,KAAK,CAAG,EAAA;AACzC,UAAA,OAAA,CAAQ,IAAK,CAAA,KAAA,CAAM,EAAG,CAAA,UAAU,CAAC,CAAA,CAAA;AAAA,SACnC;AACA,QAAA,IAAI,IAAK,CAAA,MAAA,CAAO,GAAK,EAAA,KAAK,CAAG,EAAA;AAC3B,UAAA,OAAA,CAAQ,IAAK,CAAA,KAAA,CAAM,EAAG,CAAA,OAAO,CAAC,CAAA,CAAA;AAAA,SAChC;AAAA,OACF;AACA,MAAO,OAAA,OAAA,CAAA;AAAA,KACT,CAAA;AAEA,IAAa,MAAA,CAAA;AAAA,MAAA,gBAAA;AAAA,KAEX,CAAA,CAAA;AAAA,IACF,OAAC,CAAA,IAAA,EAAA,MAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

View File

@@ -0,0 +1,5 @@
import type DateTable from './date-table.vue';
import type Calendar from './calendar.vue';
export type DateTableInstance = InstanceType<typeof DateTable> & unknown;
export type CalendarDateTableInstance = DateTableInstance;
export type CalendarInstance = InstanceType<typeof Calendar> & unknown;

View File

@@ -0,0 +1,3 @@
'use strict';
//# sourceMappingURL=instance.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"instance.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}

View File

@@ -0,0 +1,12 @@
import dayjs from 'dayjs';
import type { ComputedRef, SetupContext } from 'vue';
import type { Dayjs } from 'dayjs';
import type { CalendarDateType, CalendarEmits, CalendarProps } from './calendar';
export declare const useCalendar: (props: CalendarProps, emit: SetupContext<CalendarEmits>["emit"], componentName: string) => {
calculateValidatedDateRange: (startDayjs: Dayjs, endDayjs: Dayjs) => [Dayjs, Dayjs][];
date: ComputedRef<dayjs.Dayjs>;
realSelectedDay: import("vue").WritableComputedRef<dayjs.Dayjs | undefined>;
pickDay: (day: Dayjs) => void;
selectDate: (type: CalendarDateType) => void;
validatedRange: ComputedRef<[dayjs.Dayjs, dayjs.Dayjs][]>;
};

View File

@@ -0,0 +1,127 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var dayjs = require('dayjs');
var index = require('../../../hooks/use-locale/index.js');
var event = require('../../../constants/event.js');
var shared = require('@vue/shared');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
const adjacentMonth = (start, end) => {
const firstMonthLastDay = start.endOf("month");
const lastMonthFirstDay = end.startOf("month");
const isSameWeek = firstMonthLastDay.isSame(lastMonthFirstDay, "week");
const lastMonthStartDay = isSameWeek ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
return [
[start, firstMonthLastDay],
[lastMonthStartDay.startOf("week"), end]
];
};
const threeConsecutiveMonth = (start, end) => {
const firstMonthLastDay = start.endOf("month");
const secondMonthFirstDay = start.add(1, "month").startOf("month");
const secondMonthStartDay = firstMonthLastDay.isSame(secondMonthFirstDay, "week") ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay;
const secondMonthLastDay = secondMonthStartDay.endOf("month");
const lastMonthFirstDay = end.startOf("month");
const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
return [
[start, firstMonthLastDay],
[secondMonthStartDay.startOf("week"), secondMonthLastDay],
[lastMonthStartDay.startOf("week"), end]
];
};
const useCalendar = (props, emit, componentName) => {
const { lang } = index.useLocale();
const selectedDay = vue.ref();
const now = dayjs__default["default"]().locale(lang.value);
const realSelectedDay = vue.computed({
get() {
if (!props.modelValue)
return selectedDay.value;
return date.value;
},
set(val) {
if (!val)
return;
selectedDay.value = val;
const result = val.toDate();
emit(event.INPUT_EVENT, result);
emit(event.UPDATE_MODEL_EVENT, result);
}
});
const validatedRange = vue.computed(() => {
if (!props.range || !shared.isArray(props.range) || props.range.length !== 2 || props.range.some((item) => !shared.isDate(item)))
return [];
const rangeArrDayjs = props.range.map((_) => dayjs__default["default"](_).locale(lang.value));
const [startDayjs, endDayjs] = rangeArrDayjs;
if (startDayjs.isAfter(endDayjs)) {
return [];
}
if (startDayjs.isSame(endDayjs, "month")) {
return calculateValidatedDateRange(startDayjs, endDayjs);
} else {
if (startDayjs.add(1, "month").month() !== endDayjs.month()) {
return [];
}
return calculateValidatedDateRange(startDayjs, endDayjs);
}
});
const date = vue.computed(() => {
if (!props.modelValue) {
return realSelectedDay.value || (validatedRange.value.length ? validatedRange.value[0][0] : now);
} else {
return dayjs__default["default"](props.modelValue).locale(lang.value);
}
});
const prevMonthDayjs = vue.computed(() => date.value.subtract(1, "month").date(1));
const nextMonthDayjs = vue.computed(() => date.value.add(1, "month").date(1));
const prevYearDayjs = vue.computed(() => date.value.subtract(1, "year").date(1));
const nextYearDayjs = vue.computed(() => date.value.add(1, "year").date(1));
const calculateValidatedDateRange = (startDayjs, endDayjs) => {
const firstDay = startDayjs.startOf("week");
const lastDay = endDayjs.endOf("week");
const firstMonth = firstDay.get("month");
const lastMonth = lastDay.get("month");
if (firstMonth === lastMonth) {
return [[firstDay, lastDay]];
} else if ((firstMonth + 1) % 12 === lastMonth) {
return adjacentMonth(firstDay, lastDay);
} else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) {
return threeConsecutiveMonth(firstDay, lastDay);
} else {
return [];
}
};
const pickDay = (day) => {
realSelectedDay.value = day;
};
const selectDate = (type) => {
const dateMap = {
"prev-month": prevMonthDayjs.value,
"next-month": nextMonthDayjs.value,
"prev-year": prevYearDayjs.value,
"next-year": nextYearDayjs.value,
today: now
};
const day = dateMap[type];
if (!day.isSame(date.value, "day")) {
pickDay(day);
}
};
return {
calculateValidatedDateRange,
date,
realSelectedDay,
pickDay,
selectDate,
validatedRange
};
};
exports.useCalendar = useCalendar;
//# sourceMappingURL=use-calendar.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,18 @@
import dayjs from 'dayjs';
import type { SetupContext } from 'vue';
import type { Dayjs } from 'dayjs';
import type { CalendarDateCell, CalendarDateCellType, DateTableEmits, DateTableProps } from './date-table';
export declare const useDateTable: (props: DateTableProps, emit: SetupContext<DateTableEmits>["emit"]) => {
now: dayjs.Dayjs;
isInRange: import("vue").ComputedRef<boolean>;
rows: import("vue").ComputedRef<CalendarDateCell[][]>;
weekDays: import("vue").ComputedRef<string[]>;
getFormattedDate: (day: number, type: CalendarDateCellType) => Dayjs;
handlePickDay: ({ text, type }: CalendarDateCell) => void;
getSlotData: ({ text, type }: CalendarDateCell) => {
isSelected: boolean;
type: string;
day: string;
date: Date;
};
};

View File

@@ -0,0 +1,102 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
var dayjs = require('dayjs');
var localeData = require('dayjs/plugin/localeData.js');
var dateTable = require('./date-table.js');
var date = require('../../../constants/date.js');
var index = require('../../../hooks/use-locale/index.js');
var utils = require('../../time-picker/src/utils.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
var localeData__default = /*#__PURE__*/_interopDefaultLegacy(localeData);
const useDateTable = (props, emit) => {
dayjs__default["default"].extend(localeData__default["default"]);
const firstDayOfWeek = dayjs__default["default"].localeData().firstDayOfWeek();
const { t, lang } = index.useLocale();
const now = dayjs__default["default"]().locale(lang.value);
const isInRange = vue.computed(() => !!props.range && !!props.range.length);
const rows = vue.computed(() => {
let days = [];
if (isInRange.value) {
const [start, end] = props.range;
const currentMonthRange = utils.rangeArr(end.date() - start.date() + 1).map((index) => ({
text: start.date() + index,
type: "current"
}));
let remaining = currentMonthRange.length % 7;
remaining = remaining === 0 ? 0 : 7 - remaining;
const nextMonthRange = utils.rangeArr(remaining).map((_, index) => ({
text: index + 1,
type: "next"
}));
days = currentMonthRange.concat(nextMonthRange);
} else {
const firstDay = props.date.startOf("month").day();
const prevMonthDays = dateTable.getPrevMonthLastDays(props.date, (firstDay - firstDayOfWeek + 7) % 7).map((day) => ({
text: day,
type: "prev"
}));
const currentMonthDays = dateTable.getMonthDays(props.date).map((day) => ({
text: day,
type: "current"
}));
days = [...prevMonthDays, ...currentMonthDays];
const remaining = 7 - (days.length % 7 || 7);
const nextMonthDays = utils.rangeArr(remaining).map((_, index) => ({
text: index + 1,
type: "next"
}));
days = days.concat(nextMonthDays);
}
return dateTable.toNestedArr(days);
});
const weekDays = vue.computed(() => {
const start = firstDayOfWeek;
if (start === 0) {
return date.WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`));
} else {
return date.WEEK_DAYS.slice(start).concat(date.WEEK_DAYS.slice(0, start)).map((_) => t(`el.datepicker.weeks.${_}`));
}
});
const getFormattedDate = (day, type) => {
switch (type) {
case "prev":
return props.date.startOf("month").subtract(1, "month").date(day);
case "next":
return props.date.startOf("month").add(1, "month").date(day);
case "current":
return props.date.date(day);
}
};
const handlePickDay = ({ text, type }) => {
const date = getFormattedDate(text, type);
emit("pick", date);
};
const getSlotData = ({ text, type }) => {
const day = getFormattedDate(text, type);
return {
isSelected: day.isSame(props.selectedDay),
type: `${type}-month`,
day: day.format("YYYY-MM-DD"),
date: day.toDate()
};
};
return {
now,
isInRange,
rows,
weekDays,
getFormattedDate,
handlePickDay,
getSlotData
};
};
exports.useDateTable = useDateTable;
//# sourceMappingURL=use-date-table.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
import 'element-plus/es/components/base/style/css';
import 'element-plus/theme-chalk/el-calendar.css';
import 'element-plus/es/components/button/style/css';
import 'element-plus/es/components/button-group/style/css';

View File

@@ -0,0 +1,8 @@
'use strict';
require('../../base/style/css.js');
require('element-plus/theme-chalk/el-calendar.css');
require('../../button/style/css.js');
require('../../button-group/style/css.js');
//# sourceMappingURL=css.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1,4 @@
import 'element-plus/es/components/base/style';
import 'element-plus/theme-chalk/src/calendar.scss';
import 'element-plus/es/components/button/style';
import 'element-plus/es/components/button-group/style';

View File

@@ -0,0 +1,8 @@
'use strict';
require('../../base/style/index.js');
require('element-plus/theme-chalk/src/calendar.scss');
require('../../button/style/index.js');
require('../../button-group/style/index.js');
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}