@ibiz-template/vue3-components 0.7.26-alpha.3 → 0.7.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-28jZm-aB.js +4 -0
- package/dist/{index-8tGeBxpc.js → index-RwYoggQd.js} +1 -1
- package/dist/{index-CDgQJyai.js → index-s7g1-ymW.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-8_6qMs6z.js → xlsx-util-Rf5FMxyR.js} +1 -1
- package/es/common/emoji-select/components/categories/categories.css +1 -0
- package/es/common/emoji-select/components/categories/categories.d.ts +30 -0
- package/es/common/emoji-select/components/categories/categories.mjs +48 -0
- package/es/common/emoji-select/components/categories/index.d.ts +1 -0
- package/es/common/emoji-select/components/categories/index.mjs +3 -0
- package/es/common/emoji-select/components/category-label/category-label.css +1 -0
- package/es/common/emoji-select/components/category-label/category-label.d.ts +18 -0
- package/es/common/emoji-select/components/category-label/category-label.mjs +28 -0
- package/es/common/emoji-select/components/category-label/index.d.ts +1 -0
- package/es/common/emoji-select/components/category-label/index.mjs +3 -0
- package/es/common/emoji-select/components/emoji-item/emoji-item.css +1 -0
- package/es/common/emoji-select/components/emoji-item/emoji-item.d.ts +44 -0
- package/es/common/emoji-select/components/emoji-item/emoji-item.mjs +56 -0
- package/es/common/emoji-select/components/emoji-item/index.d.ts +1 -0
- package/es/common/emoji-select/components/emoji-item/index.mjs +3 -0
- package/es/common/emoji-select/components/emoji-list/emoji-list.css +1 -0
- package/es/common/emoji-select/components/emoji-list/emoji-list.d.ts +92 -0
- package/es/common/emoji-select/components/emoji-list/emoji-list.mjs +165 -0
- package/es/common/emoji-select/components/emoji-list/index.d.ts +1 -0
- package/es/common/emoji-select/components/emoji-list/index.mjs +3 -0
- package/es/common/emoji-select/components/index.d.ts +5 -0
- package/es/common/emoji-select/components/index.mjs +12 -0
- package/es/common/emoji-select/components/input-search/index.d.ts +1 -0
- package/es/common/emoji-select/components/input-search/index.mjs +3 -0
- package/es/common/emoji-select/components/input-search/input-search.css +1 -0
- package/es/common/emoji-select/components/input-search/input-search.d.ts +9 -0
- package/es/common/emoji-select/components/input-search/input-search.mjs +49 -0
- package/es/common/emoji-select/emoji-select.css +1 -0
- package/es/common/emoji-select/emoji-select.d.ts +142 -0
- package/es/common/emoji-select/emoji-select.mjs +234 -0
- package/es/common/emoji-select/icons/categories.d.ts +2 -0
- package/es/common/emoji-select/icons/categories.mjs +64 -0
- package/es/common/emoji-select/icons/emoji.d.ts +2 -0
- package/es/common/emoji-select/icons/emoji.mjs +1444 -0
- package/es/common/emoji-select/icons/index.d.ts +3 -0
- package/es/common/emoji-select/icons/index.mjs +5 -0
- package/es/common/emoji-select/icons/search.d.ts +1 -0
- package/es/common/emoji-select/icons/search.mjs +16 -0
- package/es/common/emoji-select/interface/category.d.ts +44 -0
- package/es/common/emoji-select/interface/category.mjs +22 -0
- package/es/common/emoji-select/interface/emoji.d.ts +37 -0
- package/es/common/emoji-select/interface/emoji.mjs +19 -0
- package/es/common/emoji-select/interface/index.d.ts +3 -0
- package/es/common/emoji-select/interface/index.mjs +5 -0
- package/es/common/emoji-select/interface/map-emojis.d.ts +17 -0
- package/es/common/emoji-select/interface/map-emojis.mjs +1 -0
- package/es/common/index.mjs +2 -0
- package/es/common/view-message/view-message.d.ts +1 -0
- package/es/control/calendar/calendar.css +1 -1
- package/es/control/calendar/calendar.d.ts +3 -2
- package/es/control/calendar/calendar.mjs +203 -86
- package/es/control/calendar/components/calendar-daily/calendar-daily.d.ts +1 -1
- package/es/control/calendar/components/calendar-daily/index.d.ts +1 -1
- package/es/control/calendar/components/calendar-week/calendar-week.d.ts +1 -1
- package/es/control/calendar/components/calendar-week/calendar-week.mjs +15 -12
- package/es/control/calendar/components/calendar-week/index.d.ts +1 -1
- package/es/control/calendar/components/calendar-week/use-calendar-week.mjs +1 -0
- package/es/control/calendar/components/custom-calendar/custom-calendar.mjs +4 -114
- package/es/control/calendar/components/interface/calendar-daily.mjs +0 -3
- package/es/control/calendar/components/interface/calendar-week.mjs +3 -2
- package/es/control/calendar/components/interface/custom-calendar.mjs +8 -3
- package/es/control/calendar/components/interface/index.d.ts +0 -1
- package/es/control/calendar/components/interface/index.mjs +0 -1
- package/es/control/calendar/index.d.ts +2 -1
- package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.d.ts +36 -2
- package/es/control/dashboard/custom-dashboard-container/custom-dashboard-container.mjs +17 -7
- package/es/control/dashboard/dashboard-design/dashboard-design.d.ts +10 -32
- package/es/control/dashboard/dashboard-design/dashboard-design.mjs +93 -56
- package/es/control/drtab/drtab-control.util.mjs +1 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.d.ts +25 -0
- package/es/control/grid/grid/grid-control.util.d.ts +8 -0
- package/es/control/grid/grid/grid-control.util.mjs +151 -1
- package/es/control/grid/grid/grid.css +1 -1
- package/es/control/grid/grid/grid.d.ts +8 -0
- package/es/control/grid/grid/grid.mjs +12 -2
- package/es/control/grid/grid/index.d.ts +8 -0
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.d.ts +1 -0
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.mjs +21 -1
- package/es/control/grid/grid-column/grid-field-column/index.d.ts +1 -0
- package/es/control/tree/tree.css +1 -1
- package/es/editor/dropdown-list/dropdown-list-editor.provider.d.ts +1 -0
- package/es/editor/dropdown-list/dropdown-list-editor.provider.mjs +10 -1
- package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.css +1 -0
- package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.d.ts +72 -0
- package/es/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.mjs +123 -0
- package/es/editor/dropdown-list/index.d.ts +1 -0
- package/es/editor/dropdown-list/index.mjs +1 -0
- package/es/editor/index.mjs +6 -0
- package/es/editor/text-box/input/input.d.ts +1 -1
- package/es/locale/en/index.d.ts +14 -0
- package/es/locale/en/index.mjs +14 -0
- package/es/locale/zh-CN/index.d.ts +14 -0
- package/es/locale/zh-CN/index.mjs +14 -0
- package/es/panel-component/nav-tabs/nav-tabs.controller.d.ts +7 -0
- package/es/panel-component/nav-tabs/nav-tabs.controller.mjs +19 -0
- package/lib/common/emoji-select/components/categories/categories.cjs +50 -0
- package/lib/common/emoji-select/components/categories/categories.css +1 -0
- package/lib/common/emoji-select/components/categories/index.cjs +7 -0
- package/lib/common/emoji-select/components/category-label/category-label.cjs +30 -0
- package/lib/common/emoji-select/components/category-label/category-label.css +1 -0
- package/lib/common/emoji-select/components/category-label/index.cjs +7 -0
- package/lib/common/emoji-select/components/emoji-item/emoji-item.cjs +58 -0
- package/lib/common/emoji-select/components/emoji-item/emoji-item.css +1 -0
- package/lib/common/emoji-select/components/emoji-item/index.cjs +7 -0
- package/lib/common/emoji-select/components/emoji-list/emoji-list.cjs +167 -0
- package/lib/common/emoji-select/components/emoji-list/emoji-list.css +1 -0
- package/lib/common/emoji-select/components/emoji-list/index.cjs +7 -0
- package/lib/common/emoji-select/components/index.cjs +20 -0
- package/lib/common/emoji-select/components/input-search/index.cjs +7 -0
- package/lib/common/emoji-select/components/input-search/input-search.cjs +51 -0
- package/lib/common/emoji-select/components/input-search/input-search.css +1 -0
- package/lib/common/emoji-select/emoji-select.cjs +236 -0
- package/lib/common/emoji-select/emoji-select.css +1 -0
- package/lib/common/emoji-select/icons/categories.cjs +66 -0
- package/lib/common/emoji-select/icons/emoji.cjs +1446 -0
- package/lib/common/emoji-select/icons/index.cjs +11 -0
- package/lib/common/emoji-select/icons/search.cjs +18 -0
- package/lib/common/emoji-select/interface/category.cjs +24 -0
- package/lib/common/emoji-select/interface/emoji.cjs +21 -0
- package/lib/common/emoji-select/interface/index.cjs +10 -0
- package/lib/common/emoji-select/interface/map-emojis.cjs +3 -0
- package/lib/common/index.cjs +2 -0
- package/lib/control/calendar/calendar.cjs +203 -86
- package/lib/control/calendar/calendar.css +1 -1
- package/lib/control/calendar/components/calendar-week/calendar-week.cjs +15 -12
- package/lib/control/calendar/components/calendar-week/use-calendar-week.cjs +1 -0
- package/lib/control/calendar/components/custom-calendar/custom-calendar.cjs +7 -117
- package/lib/control/calendar/components/interface/calendar-daily.cjs +0 -3
- package/lib/control/calendar/components/interface/calendar-week.cjs +3 -2
- package/lib/control/calendar/components/interface/custom-calendar.cjs +8 -3
- package/lib/control/calendar/components/interface/index.cjs +0 -3
- package/lib/control/dashboard/custom-dashboard-container/custom-dashboard-container.cjs +17 -7
- package/lib/control/dashboard/dashboard-design/dashboard-design.cjs +93 -56
- package/lib/control/drtab/drtab-control.util.cjs +1 -1
- package/lib/control/grid/grid/grid-control.util.cjs +151 -1
- package/lib/control/grid/grid/grid.cjs +12 -2
- package/lib/control/grid/grid/grid.css +1 -1
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.cjs +21 -1
- package/lib/control/tree/tree.css +1 -1
- package/lib/editor/dropdown-list/dropdown-list-editor.provider.cjs +10 -1
- package/lib/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.cjs +125 -0
- package/lib/editor/dropdown-list/ibiz-emoji-picker/ibiz-emoji-picker.css +1 -0
- package/lib/editor/dropdown-list/index.cjs +2 -0
- package/lib/editor/index.cjs +6 -0
- package/lib/locale/en/index.cjs +14 -0
- package/lib/locale/zh-CN/index.cjs +14 -0
- package/lib/panel-component/nav-tabs/nav-tabs.controller.cjs +19 -0
- package/package.json +8 -8
- package/dist/index-oBteffLj.js +0 -4
- package/es/_virtual/localeData.mjs +0 -3
- package/es/control/calendar/components/calendar-month/calendar-month.css +0 -1
- package/es/control/calendar/components/calendar-month/calendar-month.d.ts +0 -18
- package/es/control/calendar/components/calendar-month/calendar-month.mjs +0 -242
- package/es/control/calendar/components/calendar-month/index.d.ts +0 -18
- package/es/control/calendar/components/calendar-month/index.mjs +0 -9
- package/es/control/calendar/components/calendar-month/use-calendar-month.d.ts +0 -3
- package/es/control/calendar/components/calendar-month/use-calendar-month.mjs +0 -384
- package/es/control/calendar/components/interface/calendar-month.d.ts +0 -20
- package/es/control/calendar/components/interface/calendar-month.mjs +0 -43
- package/es/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/localeData.mjs +0 -13
- package/lib/_virtual/localeData.cjs +0 -5
- package/lib/control/calendar/components/calendar-month/calendar-month.cjs +0 -244
- package/lib/control/calendar/components/calendar-month/calendar-month.css +0 -1
- package/lib/control/calendar/components/calendar-month/index.cjs +0 -14
- package/lib/control/calendar/components/calendar-month/use-calendar-month.cjs +0 -386
- package/lib/control/calendar/components/interface/calendar-month.cjs +0 -46
- package/lib/node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/localeData.cjs +0 -17
- /package/es/node_modules/.pnpm/{@ibiz-template_core@0.7.25_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.26_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.mjs +0 -0
- /package/lib/node_modules/.pnpm/{@ibiz-template_core@0.7.25_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1 → @ibiz-template_core@0.7.26_axios@1.6.8_lodash-es@4.17.21_qs@6.11.2_qx-util@0.4.8_ramda@0.29.1}/node_modules/@ibiz-template/core/out/utils/namespace/namespace.cjs +0 -0
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
import { ref, computed } from 'vue';
|
|
2
|
-
import dayjs from 'dayjs';
|
|
3
|
-
import localeData from '../../../../node_modules/.pnpm/dayjs@1.11.10/node_modules/dayjs/plugin/localeData.mjs';
|
|
4
|
-
import { clone } from 'ramda';
|
|
5
|
-
import { useLocale } from 'element-plus';
|
|
6
|
-
import '../util/index.mjs';
|
|
7
|
-
import { rangeArr, getCurWeekDates, isToday, isTimeGreaterThan, isDateInCurWeek, handleBkColor, handleTimeRange, handleEVentClick } from '../util/util.mjs';
|
|
8
|
-
|
|
9
|
-
"use strict";
|
|
10
|
-
const useCalendarMonth = (props, emit) => {
|
|
11
|
-
dayjs.extend(localeData);
|
|
12
|
-
const firstDayOfWeek = dayjs.localeData().firstDayOfWeek();
|
|
13
|
-
const { lang } = useLocale();
|
|
14
|
-
const now = dayjs().locale(lang.value);
|
|
15
|
-
const rows = ref([]);
|
|
16
|
-
const multiple = computed(() => props.multiple === true);
|
|
17
|
-
const selectedData = ref([]);
|
|
18
|
-
const popVisible = ref(true);
|
|
19
|
-
const tableTd = ref();
|
|
20
|
-
const legends = ref([]);
|
|
21
|
-
const selectedDay = ref();
|
|
22
|
-
const hideHeader = computed(() => props.hideHeader);
|
|
23
|
-
const isInRange = computed(() => !!props.range && !!props.range.length);
|
|
24
|
-
const weekDays = computed(() => {
|
|
25
|
-
const start = firstDayOfWeek;
|
|
26
|
-
let tempValue;
|
|
27
|
-
const tempWeeks = [
|
|
28
|
-
"sunday",
|
|
29
|
-
"monday",
|
|
30
|
-
"tuesday",
|
|
31
|
-
"wednesday",
|
|
32
|
-
"thursday",
|
|
33
|
-
"friday",
|
|
34
|
-
"saturday"
|
|
35
|
-
];
|
|
36
|
-
if (start === 0) {
|
|
37
|
-
tempValue = tempWeeks.map((item) => {
|
|
38
|
-
return ibiz.i18n.t("control.calendar.calendarmonth.weeks.".concat(item));
|
|
39
|
-
});
|
|
40
|
-
} else {
|
|
41
|
-
tempValue = tempWeeks.slice(start).concat(tempWeeks.slice(0, start)).map((item) => {
|
|
42
|
-
return ibiz.i18n.t("control.calendar.calendarmonth.weeks.".concat(item));
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return tempValue;
|
|
46
|
-
});
|
|
47
|
-
const getPrevMonthLastDays = (date, count) => {
|
|
48
|
-
const lastDay = date.subtract(1, "month").endOf("month").date();
|
|
49
|
-
return rangeArr(count).map(
|
|
50
|
-
(_, index) => lastDay - (count - index - 1)
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
const getMonthDays = (date) => {
|
|
54
|
-
const days = date.daysInMonth();
|
|
55
|
-
return rangeArr(days).map((_, index) => index + 1);
|
|
56
|
-
};
|
|
57
|
-
const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
|
|
58
|
-
const start = index * 7;
|
|
59
|
-
return days.slice(start, start + 7);
|
|
60
|
-
});
|
|
61
|
-
const isDateRange = (curDate, event) => {
|
|
62
|
-
const startDate = new Date(event == null ? void 0 : event.beginTime);
|
|
63
|
-
const endDate = new Date(event == null ? void 0 : event.endTime);
|
|
64
|
-
startDate.setHours(0, 0, 0, 0);
|
|
65
|
-
endDate.setHours(0, 0, 0, 0);
|
|
66
|
-
return curDate && (event == null ? void 0 : event.beginTime) && (event == null ? void 0 : event.endTime) && curDate.getTime() <= new Date(endDate).getTime() && curDate.getTime() >= new Date(startDate).getTime() && startDate.getTime() !== endDate.getTime();
|
|
67
|
-
};
|
|
68
|
-
const handleCurDayEvent = (curDate, events, td) => {
|
|
69
|
-
let tempEvents = [];
|
|
70
|
-
const tempArray = [];
|
|
71
|
-
const todayEvents = [];
|
|
72
|
-
const rangeEvents = [];
|
|
73
|
-
const tempColors = /* @__PURE__ */ new Map();
|
|
74
|
-
const { firstDay, lastDay } = getCurWeekDates(curDate);
|
|
75
|
-
events.forEach((event) => {
|
|
76
|
-
const tempEvent = {};
|
|
77
|
-
Object.assign(tempEvent, event);
|
|
78
|
-
if (curDate && event.beginTime) {
|
|
79
|
-
if (!(event == null ? void 0 : event.endTime)) {
|
|
80
|
-
Object.assign(tempEvent, { endTime: event.beginTime });
|
|
81
|
-
}
|
|
82
|
-
if (isToday(tempEvent == null ? void 0 : tempEvent.beginTime, curDate) && isToday(tempEvent.beginTime, tempEvent.endTime)) {
|
|
83
|
-
todayEvents.push(tempEvent);
|
|
84
|
-
} else if (curDate && isDateRange(curDate, tempEvent)) {
|
|
85
|
-
Object.assign(tempEvent, { isRange: true });
|
|
86
|
-
rangeEvents.push(tempEvent);
|
|
87
|
-
} else if (!isToday(tempEvent.beginTime, tempEvent.endTime) && isTimeGreaterThan(curDate, tempEvent.beginTime) && (isDateInCurWeek(tempEvent.beginTime, firstDay, lastDay) || isDateInCurWeek(tempEvent.endTime, firstDay, lastDay))) {
|
|
88
|
-
Object.assign(tempEvent, { isShow: false });
|
|
89
|
-
rangeEvents.push(tempEvent);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
rangeEvents.sort((a, b) => {
|
|
94
|
-
const type = new Date(a.beginTime).getTime() - new Date(b.beginTime).getTime();
|
|
95
|
-
return type;
|
|
96
|
-
});
|
|
97
|
-
todayEvents.sort((a, b) => {
|
|
98
|
-
const type = new Date(a.beginTime).getTime() - new Date(b.beginTime).getTime();
|
|
99
|
-
return type;
|
|
100
|
-
});
|
|
101
|
-
tempEvents = tempEvents.concat(rangeEvents, todayEvents);
|
|
102
|
-
tempEvents.forEach((event, index) => {
|
|
103
|
-
handleBkColor(tempColors, event.itemType);
|
|
104
|
-
const legendIndex = legends.value.findIndex(
|
|
105
|
-
(legendItem) => Object.is(legendItem.id, event.itemType)
|
|
106
|
-
);
|
|
107
|
-
const targetEvent = selectedData.value.find(
|
|
108
|
-
(item) => item.id === event.id
|
|
109
|
-
);
|
|
110
|
-
const tempEvent = {};
|
|
111
|
-
Object.assign(tempEvent, event);
|
|
112
|
-
Object.assign(tempEvent, {
|
|
113
|
-
beginTime: event.beginTime,
|
|
114
|
-
end: event.endTime,
|
|
115
|
-
id: event.id
|
|
116
|
-
});
|
|
117
|
-
if (event.endTime) {
|
|
118
|
-
const format = isToday(event == null ? void 0 : event.beginTime, event.endTime) ? "YYYY-MM-DD HH:mm" : "YYYY-MM-DD";
|
|
119
|
-
const timeRange = handleTimeRange(
|
|
120
|
-
event.beginTime,
|
|
121
|
-
event.endTime,
|
|
122
|
-
format,
|
|
123
|
-
"~"
|
|
124
|
-
);
|
|
125
|
-
Object.assign(tempEvent, { timeRange });
|
|
126
|
-
}
|
|
127
|
-
if (!(event == null ? void 0 : event.bkColor)) {
|
|
128
|
-
const bkColor = legendIndex !== -1 ? legends.value[legendIndex].bkcolor : handleBkColor(tempColors, event.itemType);
|
|
129
|
-
Object.assign(tempEvent, { bkColor });
|
|
130
|
-
}
|
|
131
|
-
if (!(event == null ? void 0 : event.color)) {
|
|
132
|
-
Object.assign(tempEvent, { color: "#FFF" });
|
|
133
|
-
}
|
|
134
|
-
if (isToday(event == null ? void 0 : event.beginTime, curDate) && isToday(event == null ? void 0 : event.beginTime, event == null ? void 0 : event.endTime)) {
|
|
135
|
-
Object.assign(tempEvent, { isToday: true });
|
|
136
|
-
}
|
|
137
|
-
if (isDateRange(curDate, event) && (curDate.getDay() === 0 || isToday(event == null ? void 0 : event.beginTime, curDate))) {
|
|
138
|
-
if (td && index < 3) {
|
|
139
|
-
const currentDay = curDate.getDay();
|
|
140
|
-
const saturdayDate = new Date(curDate);
|
|
141
|
-
saturdayDate.setDate(curDate.getDate() + (6 - currentDay));
|
|
142
|
-
const endDate = new Date(event == null ? void 0 : event.endTime);
|
|
143
|
-
let week = 1;
|
|
144
|
-
if (currentDay === 0) {
|
|
145
|
-
if (endDate.getTime() > saturdayDate.getTime() || isToday(endDate, saturdayDate)) {
|
|
146
|
-
week = 7;
|
|
147
|
-
} else {
|
|
148
|
-
week = endDate.getDay() + 1;
|
|
149
|
-
}
|
|
150
|
-
} else if (endDate.getTime() > saturdayDate.getTime()) {
|
|
151
|
-
week = 7 - currentDay;
|
|
152
|
-
} else {
|
|
153
|
-
week = endDate.getDay() - currentDay;
|
|
154
|
-
week += 1;
|
|
155
|
-
}
|
|
156
|
-
const tempWidth = week * 100;
|
|
157
|
-
let tempVal = 0;
|
|
158
|
-
const fillUp = week - 1;
|
|
159
|
-
let widthDifference = 0;
|
|
160
|
-
if (currentDay === 0) {
|
|
161
|
-
widthDifference = 5;
|
|
162
|
-
tempVal += widthDifference * fillUp;
|
|
163
|
-
if (endDate.getTime() > saturdayDate.getTime()) {
|
|
164
|
-
tempVal += 3;
|
|
165
|
-
} else {
|
|
166
|
-
tempVal += 2;
|
|
167
|
-
}
|
|
168
|
-
} else if (week > 1) {
|
|
169
|
-
widthDifference = 4;
|
|
170
|
-
tempVal += widthDifference * fillUp;
|
|
171
|
-
}
|
|
172
|
-
const width = "calc(".concat(tempWidth, "% + ").concat(tempVal, "px)");
|
|
173
|
-
Object.assign(tempEvent, { width });
|
|
174
|
-
}
|
|
175
|
-
Object.assign(tempEvent, { isShow: true });
|
|
176
|
-
}
|
|
177
|
-
if (targetEvent) {
|
|
178
|
-
Object.assign(tempEvent, { isSelectedEvent: true });
|
|
179
|
-
} else {
|
|
180
|
-
Object.assign(tempEvent, { isSelectedEvent: false });
|
|
181
|
-
}
|
|
182
|
-
if (legendIndex !== -1 && legends.value[legendIndex].isShow || legendIndex === -1) {
|
|
183
|
-
tempArray.push(tempEvent);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
tempColors.clear();
|
|
187
|
-
return tempArray;
|
|
188
|
-
};
|
|
189
|
-
const handleMonthDraw = () => {
|
|
190
|
-
let days = [];
|
|
191
|
-
if (isInRange.value) {
|
|
192
|
-
const [start, end] = props.range;
|
|
193
|
-
const currentMonthRange = rangeArr(
|
|
194
|
-
end.date() - start.date() + 1
|
|
195
|
-
).map((index) => {
|
|
196
|
-
const curDate = new Date(
|
|
197
|
-
start.year(),
|
|
198
|
-
start.month(),
|
|
199
|
-
start.date() + index
|
|
200
|
-
);
|
|
201
|
-
const curDayEvents = handleCurDayEvent(
|
|
202
|
-
curDate,
|
|
203
|
-
props.events,
|
|
204
|
-
tableTd.value
|
|
205
|
-
);
|
|
206
|
-
return {
|
|
207
|
-
text: start.date() + index,
|
|
208
|
-
type: "current",
|
|
209
|
-
events: curDayEvents,
|
|
210
|
-
curDate: dayjs(curDate)
|
|
211
|
-
};
|
|
212
|
-
});
|
|
213
|
-
let remaining = currentMonthRange.length % 7;
|
|
214
|
-
remaining = remaining === 0 ? 0 : 7 - remaining;
|
|
215
|
-
const nextMonthRange = rangeArr(remaining).map(
|
|
216
|
-
(_, index) => {
|
|
217
|
-
const curDate = new Date(start.year(), start.month() + 1, index + 1);
|
|
218
|
-
const curDayEvents = handleCurDayEvent(
|
|
219
|
-
curDate,
|
|
220
|
-
props.events,
|
|
221
|
-
tableTd.value
|
|
222
|
-
);
|
|
223
|
-
return {
|
|
224
|
-
text: index + 1,
|
|
225
|
-
type: "next",
|
|
226
|
-
events: curDayEvents,
|
|
227
|
-
curDate: dayjs(curDate)
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
);
|
|
231
|
-
days = currentMonthRange.concat(nextMonthRange);
|
|
232
|
-
} else {
|
|
233
|
-
const firstDay = props.date.startOf("month").day();
|
|
234
|
-
const prevMonthDays = getPrevMonthLastDays(
|
|
235
|
-
props.date,
|
|
236
|
-
(firstDay - firstDayOfWeek + 7) % 7
|
|
237
|
-
).map((day) => {
|
|
238
|
-
const curDate = new Date(
|
|
239
|
-
props.date.year(),
|
|
240
|
-
props.date.month() - 1,
|
|
241
|
-
day
|
|
242
|
-
);
|
|
243
|
-
const curDayEvents = handleCurDayEvent(
|
|
244
|
-
curDate,
|
|
245
|
-
props.events,
|
|
246
|
-
tableTd.value
|
|
247
|
-
);
|
|
248
|
-
return {
|
|
249
|
-
text: day,
|
|
250
|
-
type: "prev",
|
|
251
|
-
events: curDayEvents,
|
|
252
|
-
curDate: dayjs(curDate)
|
|
253
|
-
};
|
|
254
|
-
});
|
|
255
|
-
const currentMonthDays = getMonthDays(props.date).map(
|
|
256
|
-
(day) => {
|
|
257
|
-
const curDate = new Date(props.date.year(), props.date.month(), day);
|
|
258
|
-
const curDayEvents = handleCurDayEvent(
|
|
259
|
-
curDate,
|
|
260
|
-
props.events,
|
|
261
|
-
tableTd.value
|
|
262
|
-
);
|
|
263
|
-
return {
|
|
264
|
-
text: day,
|
|
265
|
-
type: "current",
|
|
266
|
-
events: curDayEvents,
|
|
267
|
-
curDate: dayjs(curDate)
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
);
|
|
271
|
-
days = [...prevMonthDays, ...currentMonthDays];
|
|
272
|
-
const remaining = 7 - (days.length % 7 || 7);
|
|
273
|
-
const nextMonthDays = rangeArr(remaining).map(
|
|
274
|
-
(_, index) => {
|
|
275
|
-
const curDate = new Date(
|
|
276
|
-
props.date.year(),
|
|
277
|
-
props.date.month() + 1,
|
|
278
|
-
index + 1
|
|
279
|
-
);
|
|
280
|
-
const curDayEvents = handleCurDayEvent(
|
|
281
|
-
curDate,
|
|
282
|
-
props.events,
|
|
283
|
-
tableTd.value
|
|
284
|
-
);
|
|
285
|
-
return {
|
|
286
|
-
text: index + 1,
|
|
287
|
-
type: "next",
|
|
288
|
-
events: curDayEvents,
|
|
289
|
-
curDate: dayjs(curDate)
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
);
|
|
293
|
-
days = days.concat(nextMonthDays);
|
|
294
|
-
}
|
|
295
|
-
rows.value = toNestedArr(days);
|
|
296
|
-
};
|
|
297
|
-
const getFormattedDate = (day, type) => {
|
|
298
|
-
switch (type) {
|
|
299
|
-
case "prev":
|
|
300
|
-
return props.date.startOf("month").subtract(1, "month").date(day);
|
|
301
|
-
case "next":
|
|
302
|
-
return props.date.startOf("month").add(1, "month").date(day);
|
|
303
|
-
case "current":
|
|
304
|
-
return props.date.date(day);
|
|
305
|
-
default:
|
|
306
|
-
return null;
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
const handlePickDay = ({ text, type }) => {
|
|
310
|
-
const date = getFormattedDate(text, type);
|
|
311
|
-
selectedDay.value = date;
|
|
312
|
-
if (type === "prev" || type === "next") {
|
|
313
|
-
emit("pickEvent", date);
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
const getSlotData = ({ text, type, events }) => {
|
|
317
|
-
const day = getFormattedDate(text, type);
|
|
318
|
-
return {
|
|
319
|
-
isSelected: day.isSame(props.selectedDay),
|
|
320
|
-
type: "".concat(type, "-month"),
|
|
321
|
-
day: day.format("YYYY-MM-DD"),
|
|
322
|
-
date: day.toDate(),
|
|
323
|
-
events
|
|
324
|
-
};
|
|
325
|
-
};
|
|
326
|
-
const getCellClass = ({ text, type }) => {
|
|
327
|
-
const classes = [type];
|
|
328
|
-
if (type === "current") {
|
|
329
|
-
const date = getFormattedDate(text, type);
|
|
330
|
-
if (date.isSame(selectedDay.value, "day")) {
|
|
331
|
-
classes.push("is-selected");
|
|
332
|
-
}
|
|
333
|
-
if (date.isSame(now, "day")) {
|
|
334
|
-
classes.push("is-today");
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
return classes;
|
|
338
|
-
};
|
|
339
|
-
const eventClick = async (item, location) => {
|
|
340
|
-
const res = await handleEVentClick(
|
|
341
|
-
item,
|
|
342
|
-
location,
|
|
343
|
-
props.events,
|
|
344
|
-
multiple.value,
|
|
345
|
-
selectedData.value,
|
|
346
|
-
emit
|
|
347
|
-
);
|
|
348
|
-
const { tempSelectedData } = res;
|
|
349
|
-
selectedData.value = tempSelectedData;
|
|
350
|
-
handleMonthDraw();
|
|
351
|
-
};
|
|
352
|
-
const handleEventsMoreData = (cell) => {
|
|
353
|
-
let events = clone(cell.events);
|
|
354
|
-
const { curDate } = cell;
|
|
355
|
-
const tempEvents = [];
|
|
356
|
-
events = events.splice(3, events.length);
|
|
357
|
-
events.forEach((event) => {
|
|
358
|
-
if (curDate && isDateRange(new Date(curDate), event) || isToday(event.beginTime, event.endTime)) {
|
|
359
|
-
tempEvents.push(event);
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
return tempEvents;
|
|
363
|
-
};
|
|
364
|
-
return {
|
|
365
|
-
isInRange,
|
|
366
|
-
rows,
|
|
367
|
-
weekDays,
|
|
368
|
-
hideHeader,
|
|
369
|
-
tableTd,
|
|
370
|
-
legends,
|
|
371
|
-
selectedDay,
|
|
372
|
-
selectedData,
|
|
373
|
-
popVisible,
|
|
374
|
-
getFormattedDate,
|
|
375
|
-
handlePickDay,
|
|
376
|
-
getSlotData,
|
|
377
|
-
getCellClass,
|
|
378
|
-
eventClick,
|
|
379
|
-
handleMonthDraw,
|
|
380
|
-
handleEventsMoreData
|
|
381
|
-
};
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
export { useCalendarMonth };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { ExtractPropTypes } from 'vue';
|
|
2
|
-
import type { Dayjs } from 'dayjs';
|
|
3
|
-
import { IUIEvent } from './common';
|
|
4
|
-
type CalendarDateCellType = 'next' | 'prev' | 'current';
|
|
5
|
-
type CalendarDateCell = {
|
|
6
|
-
text: number;
|
|
7
|
-
type: CalendarDateCellType;
|
|
8
|
-
events: IUIEvent[];
|
|
9
|
-
curDate: Dayjs;
|
|
10
|
-
};
|
|
11
|
-
declare const calendarMonthProps: IParams;
|
|
12
|
-
type CalendarMonthProps = ExtractPropTypes<typeof calendarMonthProps>;
|
|
13
|
-
declare const calendarMonthEmits: {
|
|
14
|
-
pickEvent: (value: Dayjs) => Dayjs;
|
|
15
|
-
eventClick: (value: IParams) => IParams;
|
|
16
|
-
eventDblClick: (value: IParams) => IParams;
|
|
17
|
-
};
|
|
18
|
-
type CalendarMonthEmits = typeof calendarMonthEmits;
|
|
19
|
-
export { calendarMonthEmits, calendarMonthProps };
|
|
20
|
-
export type { CalendarMonthProps, CalendarMonthEmits, CalendarDateCellType, CalendarDateCell, };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import '../util/index.mjs';
|
|
2
|
-
import { definePropType, handleProps } from '../util/util.mjs';
|
|
3
|
-
|
|
4
|
-
"use strict";
|
|
5
|
-
const calendarMonthProps = handleProps({
|
|
6
|
-
controller: {
|
|
7
|
-
type: Object
|
|
8
|
-
},
|
|
9
|
-
selectedDay: {
|
|
10
|
-
type: definePropType(Object)
|
|
11
|
-
},
|
|
12
|
-
range: {
|
|
13
|
-
type: definePropType(Array)
|
|
14
|
-
},
|
|
15
|
-
date: {
|
|
16
|
-
type: definePropType(Object),
|
|
17
|
-
required: true
|
|
18
|
-
},
|
|
19
|
-
hideHeader: {
|
|
20
|
-
type: Boolean
|
|
21
|
-
},
|
|
22
|
-
events: {
|
|
23
|
-
type: Array,
|
|
24
|
-
default: []
|
|
25
|
-
},
|
|
26
|
-
legends: {
|
|
27
|
-
type: Array,
|
|
28
|
-
default: []
|
|
29
|
-
},
|
|
30
|
-
multiple: {
|
|
31
|
-
type: Boolean
|
|
32
|
-
},
|
|
33
|
-
selectedData: {
|
|
34
|
-
type: Object
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const calendarMonthEmits = {
|
|
38
|
-
pickEvent: (value) => value,
|
|
39
|
-
eventClick: (value) => value,
|
|
40
|
-
eventDblClick: (value) => value
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export { calendarMonthEmits, calendarMonthProps };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { commonjsGlobal, getDefaultExportFromCjs } from '../../../../../../_virtual/_commonjsHelpers.mjs';
|
|
2
|
-
import { __module as localeData$2 } from '../../../../../../_virtual/localeData.mjs';
|
|
3
|
-
|
|
4
|
-
var localeData = localeData$2.exports;
|
|
5
|
-
|
|
6
|
-
(function (module, exports) {
|
|
7
|
-
!function(n,e){"object"=='object'&&"undefined"!='object'?module.exports=e():"function"==typeof undefined&&undefined.amd?undefined(e):(n="undefined"!=typeof globalThis?globalThis:n||self).dayjs_plugin_localeData=e();}(commonjsGlobal,(function(){"use strict";return function(n,e,t){var r=e.prototype,o=function(n){return n&&(n.indexOf?n:n.s)},u=function(n,e,t,r,u){var i=n.name?n:n.$locale(),a=o(i[e]),s=o(i[t]),f=a||s.map((function(n){return n.slice(0,r)}));if(!u)return f;var d=i.weekStart;return f.map((function(n,e){return f[(e+(d||0))%7]}))},i=function(){return t.Ls[t.locale()]},a=function(n,e){return n.formats[e]||function(n){return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(n,e,t){return e||t.slice(1)}))}(n.formats[e.toUpperCase()])},s=function(){var n=this;return {months:function(e){return e?e.format("MMMM"):u(n,"months")},monthsShort:function(e){return e?e.format("MMM"):u(n,"monthsShort","months",3)},firstDayOfWeek:function(){return n.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):u(n,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):u(n,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):u(n,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return a(n.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s.bind(this)()},t.localeData=function(){var n=i();return {firstDayOfWeek:function(){return n.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e){return a(n,e)},meridiem:n.meridiem,ordinal:n.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n){return u(i(),"weekdays",null,null,n)},t.weekdaysShort=function(n){return u(i(),"weekdaysShort","weekdays",3,n)},t.weekdaysMin=function(n){return u(i(),"weekdaysMin","weekdays",2,n)};}}));
|
|
8
|
-
} (localeData$2, localeData$2.exports));
|
|
9
|
-
|
|
10
|
-
var localeDataExports = localeData$2.exports;
|
|
11
|
-
var localeData$1 = /*@__PURE__*/getDefaultExportFromCjs(localeDataExports);
|
|
12
|
-
|
|
13
|
-
export { localeData$1 as default };
|