测试
This commit is contained in:
6
frontend/node_modules/element-plus/es/components/calendar/index.d.ts
generated
vendored
Normal file
6
frontend/node_modules/element-plus/es/components/calendar/index.d.ts
generated
vendored
Normal 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';
|
||||
8
frontend/node_modules/element-plus/es/components/calendar/index.mjs
generated
vendored
Normal file
8
frontend/node_modules/element-plus/es/components/calendar/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import Calendar from './src/calendar2.mjs';
|
||||
export { calendarEmits, calendarProps } from './src/calendar.mjs';
|
||||
import { withInstall } from '../../utils/vue/install.mjs';
|
||||
|
||||
const ElCalendar = withInstall(Calendar);
|
||||
|
||||
export { ElCalendar, ElCalendar as default };
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/index.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","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":[],"mappings":";;;;AAEY,MAAC,UAAU,GAAG,WAAW,CAAC,QAAQ;;;;"}
|
||||
23
frontend/node_modules/element-plus/es/components/calendar/src/calendar.d.ts
generated
vendored
Normal file
23
frontend/node_modules/element-plus/es/components/calendar/src/calendar.d.ts
generated
vendored
Normal 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;
|
||||
21
frontend/node_modules/element-plus/es/components/calendar/src/calendar.mjs
generated
vendored
Normal file
21
frontend/node_modules/element-plus/es/components/calendar/src/calendar.mjs
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
||||
import { isArray, isDate } from '@vue/shared';
|
||||
import { UPDATE_MODEL_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
|
||||
|
||||
const isValidRange = (range) => isArray(range) && range.length === 2 && range.every((item) => isDate(item));
|
||||
const calendarProps = buildProps({
|
||||
modelValue: {
|
||||
type: Date
|
||||
},
|
||||
range: {
|
||||
type: definePropType(Array),
|
||||
validator: isValidRange
|
||||
}
|
||||
});
|
||||
const calendarEmits = {
|
||||
[UPDATE_MODEL_EVENT]: (value) => isDate(value),
|
||||
[INPUT_EVENT]: (value) => isDate(value)
|
||||
};
|
||||
|
||||
export { calendarEmits, calendarProps };
|
||||
//# sourceMappingURL=calendar.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/src/calendar.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/src/calendar.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"calendar.mjs","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":[],"mappings":";;;;AAOA,MAAM,YAAY,GAAG,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAChG,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,SAAS,EAAE,YAAY;AAC3B,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC;AAChD,EAAE,CAAC,WAAW,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC;AACzC;;;;"}
|
||||
70
frontend/node_modules/element-plus/es/components/calendar/src/calendar.vue.d.ts
generated
vendored
Normal file
70
frontend/node_modules/element-plus/es/components/calendar/src/calendar.vue.d.ts
generated
vendored
Normal 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;
|
||||
};
|
||||
};
|
||||
139
frontend/node_modules/element-plus/es/components/calendar/src/calendar2.mjs
generated
vendored
Normal file
139
frontend/node_modules/element-plus/es/components/calendar/src/calendar2.mjs
generated
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, toDisplayString, createVNode, withCtx, createTextVNode, createCommentVNode, createSlots, normalizeProps, guardReactiveProps, Fragment, renderList, createBlock } from 'vue';
|
||||
import { ElButtonGroup, ElButton } from '../../button/index.mjs';
|
||||
import DateTable from './date-table2.mjs';
|
||||
import { useCalendar } from './use-calendar.mjs';
|
||||
import { calendarProps, calendarEmits } from './calendar.mjs';
|
||||
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
||||
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
||||
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
||||
|
||||
const COMPONENT_NAME = "ElCalendar";
|
||||
const __default__ = defineComponent({
|
||||
name: COMPONENT_NAME
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
...__default__,
|
||||
props: calendarProps,
|
||||
emits: calendarEmits,
|
||||
setup(__props, { expose, emit }) {
|
||||
const props = __props;
|
||||
const ns = useNamespace("calendar");
|
||||
const {
|
||||
calculateValidatedDateRange,
|
||||
date,
|
||||
pickDay,
|
||||
realSelectedDay,
|
||||
selectDate,
|
||||
validatedRange
|
||||
} = useCalendar(props, emit);
|
||||
const { t } = useLocale();
|
||||
const i18nDate = 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 openBlock(), createElementBlock("div", {
|
||||
class: normalizeClass(unref(ns).b())
|
||||
}, [
|
||||
createElementVNode("div", {
|
||||
class: normalizeClass(unref(ns).e("header"))
|
||||
}, [
|
||||
renderSlot(_ctx.$slots, "header", { date: unref(i18nDate) }, () => [
|
||||
createElementVNode("div", {
|
||||
class: normalizeClass(unref(ns).e("title"))
|
||||
}, toDisplayString(unref(i18nDate)), 3),
|
||||
unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", {
|
||||
key: 0,
|
||||
class: normalizeClass(unref(ns).e("button-group"))
|
||||
}, [
|
||||
createVNode(unref(ElButtonGroup), null, {
|
||||
default: withCtx(() => [
|
||||
createVNode(unref(ElButton), {
|
||||
size: "small",
|
||||
onClick: ($event) => unref(selectDate)("prev-month")
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(t)("el.datepicker.prevMonth")), 1)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(unref(ElButton), {
|
||||
size: "small",
|
||||
onClick: ($event) => unref(selectDate)("today")
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(t)("el.datepicker.today")), 1)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"]),
|
||||
createVNode(unref(ElButton), {
|
||||
size: "small",
|
||||
onClick: ($event) => unref(selectDate)("next-month")
|
||||
}, {
|
||||
default: withCtx(() => [
|
||||
createTextVNode(toDisplayString(unref(t)("el.datepicker.nextMonth")), 1)
|
||||
]),
|
||||
_: 1
|
||||
}, 8, ["onClick"])
|
||||
]),
|
||||
_: 1
|
||||
})
|
||||
], 2)) : createCommentVNode("v-if", true)
|
||||
])
|
||||
], 2),
|
||||
unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", {
|
||||
key: 0,
|
||||
class: normalizeClass(unref(ns).e("body"))
|
||||
}, [
|
||||
createVNode(DateTable, {
|
||||
date: unref(date),
|
||||
"selected-day": unref(realSelectedDay),
|
||||
onPick: unref(pickDay)
|
||||
}, createSlots({
|
||||
_: 2
|
||||
}, [
|
||||
_ctx.$slots["date-cell"] ? {
|
||||
name: "date-cell",
|
||||
fn: withCtx((data) => [
|
||||
renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(data)))
|
||||
])
|
||||
} : void 0
|
||||
]), 1032, ["date", "selected-day", "onPick"])
|
||||
], 2)) : (openBlock(), createElementBlock("div", {
|
||||
key: 1,
|
||||
class: normalizeClass(unref(ns).e("body"))
|
||||
}, [
|
||||
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(validatedRange), (range_, index) => {
|
||||
return openBlock(), createBlock(DateTable, {
|
||||
key: index,
|
||||
date: range_[0],
|
||||
"selected-day": unref(realSelectedDay),
|
||||
range: range_,
|
||||
"hide-header": index !== 0,
|
||||
onPick: unref(pickDay)
|
||||
}, createSlots({
|
||||
_: 2
|
||||
}, [
|
||||
_ctx.$slots["date-cell"] ? {
|
||||
name: "date-cell",
|
||||
fn: withCtx((data) => [
|
||||
renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(data)))
|
||||
])
|
||||
} : void 0
|
||||
]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
|
||||
}), 128))
|
||||
], 2))
|
||||
], 2);
|
||||
};
|
||||
}
|
||||
});
|
||||
var Calendar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "calendar.vue"]]);
|
||||
|
||||
export { Calendar as default };
|
||||
//# sourceMappingURL=calendar2.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/src/calendar2.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/src/calendar2.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"calendar2.mjs","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":["_openBlock","_createElementBlock","_normalizeClass","_unref"],"mappings":";;;;;;;;;;mCAwDc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AALA,IAAM,MAAA,EAAA,GAAK,aAAa,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,GAAA,WAAA,CAAY,KAAO,EAAA,IAAoB,CAAA,CAAA;AAE3C,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AAExB,IAAM,MAAA,QAAA,GAAW,SAAS,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,OAAAA,SAAA,EAAA,EAAAC,kBAAA,CAAA,KAAA,EAAA;AAAA,QAEA,KAAA,EAAAC,cAAA,CAAAC,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AAAA,OACD,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
42
frontend/node_modules/element-plus/es/components/calendar/src/date-table.d.ts
generated
vendored
Normal file
42
frontend/node_modules/element-plus/es/components/calendar/src/date-table.d.ts
generated
vendored
Normal 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;
|
||||
37
frontend/node_modules/element-plus/es/components/calendar/src/date-table.mjs
generated
vendored
Normal file
37
frontend/node_modules/element-plus/es/components/calendar/src/date-table.mjs
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import { rangeArr } from '../../time-picker/src/utils.mjs';
|
||||
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
||||
import { isObject } from '@vue/shared';
|
||||
|
||||
const getPrevMonthLastDays = (date, count) => {
|
||||
const lastDay = date.subtract(1, "month").endOf("month").date();
|
||||
return rangeArr(count).map((_, index) => lastDay - (count - index - 1));
|
||||
};
|
||||
const getMonthDays = (date) => {
|
||||
const days = date.daysInMonth();
|
||||
return rangeArr(days).map((_, index) => index + 1);
|
||||
};
|
||||
const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
|
||||
const start = index * 7;
|
||||
return days.slice(start, start + 7);
|
||||
});
|
||||
const dateTableProps = buildProps({
|
||||
selectedDay: {
|
||||
type: definePropType(Object)
|
||||
},
|
||||
range: {
|
||||
type: definePropType(Array)
|
||||
},
|
||||
date: {
|
||||
type: definePropType(Object),
|
||||
required: true
|
||||
},
|
||||
hideHeader: {
|
||||
type: Boolean
|
||||
}
|
||||
});
|
||||
const dateTableEmits = {
|
||||
pick: (value) => isObject(value)
|
||||
};
|
||||
|
||||
export { dateTableEmits, dateTableProps, getMonthDays, getPrevMonthLastDays, toNestedArr };
|
||||
//# sourceMappingURL=date-table.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/src/date-table.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/src/date-table.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"date-table.mjs","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":[],"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,OAAO,QAAQ,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,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,GAAG,CAAC,CAAC,CAAC;AACrD,EAAE;AACU,MAAC,WAAW,GAAG,CAAC,IAAI,KAAK,QAAQ,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,GAAG,UAAU,CAAC;AACzC,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,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,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClC;;;;"}
|
||||
75
frontend/node_modules/element-plus/es/components/calendar/src/date-table.vue.d.ts
generated
vendored
Normal file
75
frontend/node_modules/element-plus/es/components/calendar/src/date-table.vue.d.ts
generated
vendored
Normal 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;
|
||||
};
|
||||
};
|
||||
95
frontend/node_modules/element-plus/es/components/calendar/src/date-table2.mjs
generated
vendored
Normal file
95
frontend/node_modules/element-plus/es/components/calendar/src/date-table2.mjs
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, Fragment, renderList, toDisplayString, createCommentVNode, renderSlot } from 'vue';
|
||||
import { dateTableProps, dateTableEmits } from './date-table.mjs';
|
||||
import { useDateTable } from './use-date-table.mjs';
|
||||
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
||||
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
||||
|
||||
const __default__ = defineComponent({
|
||||
name: "DateTable"
|
||||
});
|
||||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||||
...__default__,
|
||||
props: dateTableProps,
|
||||
emits: dateTableEmits,
|
||||
setup(__props, { expose, emit }) {
|
||||
const props = __props;
|
||||
const {
|
||||
isInRange,
|
||||
now,
|
||||
rows,
|
||||
weekDays,
|
||||
getFormattedDate,
|
||||
handlePickDay,
|
||||
getSlotData
|
||||
} = useDateTable(props, emit);
|
||||
const nsTable = useNamespace("calendar-table");
|
||||
const nsDay = 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 openBlock(), createElementBlock("table", {
|
||||
class: normalizeClass([unref(nsTable).b(), unref(nsTable).is("range", unref(isInRange))]),
|
||||
cellspacing: "0",
|
||||
cellpadding: "0"
|
||||
}, [
|
||||
!_ctx.hideHeader ? (openBlock(), createElementBlock("thead", { key: 0 }, [
|
||||
createElementVNode("tr", null, [
|
||||
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(weekDays), (day) => {
|
||||
return openBlock(), createElementBlock("th", {
|
||||
key: day,
|
||||
scope: "col"
|
||||
}, toDisplayString(day), 1);
|
||||
}), 128))
|
||||
])
|
||||
])) : createCommentVNode("v-if", true),
|
||||
createElementVNode("tbody", null, [
|
||||
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, index) => {
|
||||
return openBlock(), createElementBlock("tr", {
|
||||
key: index,
|
||||
class: normalizeClass({
|
||||
[unref(nsTable).e("row")]: true,
|
||||
[unref(nsTable).em("row", "hide-border")]: index === 0 && _ctx.hideHeader
|
||||
})
|
||||
}, [
|
||||
(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key) => {
|
||||
return openBlock(), createElementBlock("td", {
|
||||
key,
|
||||
class: normalizeClass(getCellClass(cell)),
|
||||
onClick: ($event) => unref(handlePickDay)(cell)
|
||||
}, [
|
||||
createElementVNode("div", {
|
||||
class: normalizeClass(unref(nsDay).b())
|
||||
}, [
|
||||
renderSlot(_ctx.$slots, "date-cell", {
|
||||
data: unref(getSlotData)(cell)
|
||||
}, () => [
|
||||
createElementVNode("span", null, toDisplayString(cell.text), 1)
|
||||
])
|
||||
], 2)
|
||||
], 10, ["onClick"]);
|
||||
}), 128))
|
||||
], 2);
|
||||
}), 128))
|
||||
])
|
||||
], 2);
|
||||
};
|
||||
}
|
||||
});
|
||||
var DateTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "date-table.vue"]]);
|
||||
|
||||
export { DateTable as default };
|
||||
//# sourceMappingURL=date-table2.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/src/date-table2.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/src/date-table2.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"date-table2.mjs","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":[],"mappings":";;;;;;mCA6Cc,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,GAAI,YAAa,CAAA,KAAA,EAAO,IAAI,CAAA,CAAA;AAE5B,IAAM,MAAA,OAAA,GAAU,aAAa,gBAAgB,CAAA,CAAA;AAC7C,IAAM,MAAA,KAAA,GAAQ,aAAa,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
||||
5
frontend/node_modules/element-plus/es/components/calendar/src/instance.d.ts
generated
vendored
Normal file
5
frontend/node_modules/element-plus/es/components/calendar/src/instance.d.ts
generated
vendored
Normal 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;
|
||||
2
frontend/node_modules/element-plus/es/components/calendar/src/instance.mjs
generated
vendored
Normal file
2
frontend/node_modules/element-plus/es/components/calendar/src/instance.mjs
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
//# sourceMappingURL=instance.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/src/instance.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/src/instance.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"instance.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
||||
12
frontend/node_modules/element-plus/es/components/calendar/src/use-calendar.d.ts
generated
vendored
Normal file
12
frontend/node_modules/element-plus/es/components/calendar/src/use-calendar.d.ts
generated
vendored
Normal 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][]>;
|
||||
};
|
||||
119
frontend/node_modules/element-plus/es/components/calendar/src/use-calendar.mjs
generated
vendored
Normal file
119
frontend/node_modules/element-plus/es/components/calendar/src/use-calendar.mjs
generated
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
import { ref, computed } from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
||||
import { INPUT_EVENT, UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
|
||||
import { isArray, isDate } from '@vue/shared';
|
||||
|
||||
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 } = useLocale();
|
||||
const selectedDay = ref();
|
||||
const now = dayjs().locale(lang.value);
|
||||
const realSelectedDay = computed({
|
||||
get() {
|
||||
if (!props.modelValue)
|
||||
return selectedDay.value;
|
||||
return date.value;
|
||||
},
|
||||
set(val) {
|
||||
if (!val)
|
||||
return;
|
||||
selectedDay.value = val;
|
||||
const result = val.toDate();
|
||||
emit(INPUT_EVENT, result);
|
||||
emit(UPDATE_MODEL_EVENT, result);
|
||||
}
|
||||
});
|
||||
const validatedRange = computed(() => {
|
||||
if (!props.range || !isArray(props.range) || props.range.length !== 2 || props.range.some((item) => !isDate(item)))
|
||||
return [];
|
||||
const rangeArrDayjs = props.range.map((_) => dayjs(_).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 = computed(() => {
|
||||
if (!props.modelValue) {
|
||||
return realSelectedDay.value || (validatedRange.value.length ? validatedRange.value[0][0] : now);
|
||||
} else {
|
||||
return dayjs(props.modelValue).locale(lang.value);
|
||||
}
|
||||
});
|
||||
const prevMonthDayjs = computed(() => date.value.subtract(1, "month").date(1));
|
||||
const nextMonthDayjs = computed(() => date.value.add(1, "month").date(1));
|
||||
const prevYearDayjs = computed(() => date.value.subtract(1, "year").date(1));
|
||||
const nextYearDayjs = 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
|
||||
};
|
||||
};
|
||||
|
||||
export { useCalendar };
|
||||
//# sourceMappingURL=use-calendar.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/src/use-calendar.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/src/use-calendar.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
18
frontend/node_modules/element-plus/es/components/calendar/src/use-date-table.d.ts
generated
vendored
Normal file
18
frontend/node_modules/element-plus/es/components/calendar/src/use-date-table.d.ts
generated
vendored
Normal 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;
|
||||
};
|
||||
};
|
||||
93
frontend/node_modules/element-plus/es/components/calendar/src/use-date-table.mjs
generated
vendored
Normal file
93
frontend/node_modules/element-plus/es/components/calendar/src/use-date-table.mjs
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
import { computed } from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
import localeData from 'dayjs/plugin/localeData.js';
|
||||
import { getPrevMonthLastDays, getMonthDays, toNestedArr } from './date-table.mjs';
|
||||
import { WEEK_DAYS } from '../../../constants/date.mjs';
|
||||
import { useLocale } from '../../../hooks/use-locale/index.mjs';
|
||||
import { rangeArr } from '../../time-picker/src/utils.mjs';
|
||||
|
||||
const useDateTable = (props, emit) => {
|
||||
dayjs.extend(localeData);
|
||||
const firstDayOfWeek = dayjs.localeData().firstDayOfWeek();
|
||||
const { t, lang } = useLocale();
|
||||
const now = dayjs().locale(lang.value);
|
||||
const isInRange = computed(() => !!props.range && !!props.range.length);
|
||||
const rows = computed(() => {
|
||||
let days = [];
|
||||
if (isInRange.value) {
|
||||
const [start, end] = props.range;
|
||||
const currentMonthRange = 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 = rangeArr(remaining).map((_, index) => ({
|
||||
text: index + 1,
|
||||
type: "next"
|
||||
}));
|
||||
days = currentMonthRange.concat(nextMonthRange);
|
||||
} else {
|
||||
const firstDay = props.date.startOf("month").day();
|
||||
const prevMonthDays = getPrevMonthLastDays(props.date, (firstDay - firstDayOfWeek + 7) % 7).map((day) => ({
|
||||
text: day,
|
||||
type: "prev"
|
||||
}));
|
||||
const currentMonthDays = getMonthDays(props.date).map((day) => ({
|
||||
text: day,
|
||||
type: "current"
|
||||
}));
|
||||
days = [...prevMonthDays, ...currentMonthDays];
|
||||
const remaining = 7 - (days.length % 7 || 7);
|
||||
const nextMonthDays = rangeArr(remaining).map((_, index) => ({
|
||||
text: index + 1,
|
||||
type: "next"
|
||||
}));
|
||||
days = days.concat(nextMonthDays);
|
||||
}
|
||||
return toNestedArr(days);
|
||||
});
|
||||
const weekDays = computed(() => {
|
||||
const start = firstDayOfWeek;
|
||||
if (start === 0) {
|
||||
return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`));
|
||||
} else {
|
||||
return WEEK_DAYS.slice(start).concat(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
|
||||
};
|
||||
};
|
||||
|
||||
export { useDateTable };
|
||||
//# sourceMappingURL=use-date-table.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/src/use-date-table.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/src/use-date-table.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
frontend/node_modules/element-plus/es/components/calendar/style/css.d.ts
generated
vendored
Normal file
4
frontend/node_modules/element-plus/es/components/calendar/style/css.d.ts
generated
vendored
Normal 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';
|
||||
5
frontend/node_modules/element-plus/es/components/calendar/style/css.mjs
generated
vendored
Normal file
5
frontend/node_modules/element-plus/es/components/calendar/style/css.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import '../../base/style/css.mjs';
|
||||
import 'element-plus/theme-chalk/el-calendar.css';
|
||||
import '../../button/style/css.mjs';
|
||||
import '../../button-group/style/css.mjs';
|
||||
//# sourceMappingURL=css.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/style/css.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/style/css.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
||||
4
frontend/node_modules/element-plus/es/components/calendar/style/index.d.ts
generated
vendored
Normal file
4
frontend/node_modules/element-plus/es/components/calendar/style/index.d.ts
generated
vendored
Normal 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';
|
||||
5
frontend/node_modules/element-plus/es/components/calendar/style/index.mjs
generated
vendored
Normal file
5
frontend/node_modules/element-plus/es/components/calendar/style/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import '../../base/style/index.mjs';
|
||||
import 'element-plus/theme-chalk/src/calendar.scss';
|
||||
import '../../button/style/index.mjs';
|
||||
import '../../button-group/style/index.mjs';
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
1
frontend/node_modules/element-plus/es/components/calendar/style/index.mjs.map
generated
vendored
Normal file
1
frontend/node_modules/element-plus/es/components/calendar/style/index.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
||||
Reference in New Issue
Block a user