@ysgroup/ui 0.1.56 → 0.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/components/YsCalendar.vue +495 -97
- package/src/index.ts +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ysgroup/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.58",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"@ysgroup/contracts": ">=0.1.50",
|
|
14
|
-
"@ysgroup/core": ">=0.1.
|
|
14
|
+
"@ysgroup/core": ">=0.1.32",
|
|
15
15
|
"@ysgroup/theme": ">=0.3.3",
|
|
16
16
|
"element-plus": ">=2.9",
|
|
17
17
|
"vue": ">=3.5"
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@ysgroup/contracts": "^0.1.
|
|
29
|
-
"@ysgroup/core": "^0.1.
|
|
28
|
+
"@ysgroup/contracts": "^0.1.52",
|
|
29
|
+
"@ysgroup/core": "^0.1.32",
|
|
30
30
|
"@ysgroup/theme": "^0.3.3",
|
|
31
31
|
"docx-preview": "^0.4.1"
|
|
32
32
|
}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 月历:每天右上角一个状态标签,底色跟着状态走,一眼分清能不能交易、要不要上班。
|
|
4
4
|
*
|
|
5
|
-
* -
|
|
6
|
-
*
|
|
5
|
+
* - mark="trading" 交易日视图:交易日浅绿底、蓝色「交易日」标签(showOrdinal 时旁边写本月第几个,默认不写);
|
|
6
|
+
* 休市日(周末、放假、法定补班的周末)不上底色,写灰色「休市」。
|
|
7
|
+
* - mark="work" 工作日视图:工作日和法定补班(调休上班的周末)浅绿底,分别写「工作日」「法定补班」
|
|
8
|
+
* (实心标签,最醒目);周末不上底色写「休息」,法定放假浅橙底写「放假」和节日名。
|
|
9
|
+
* - 不传 mark(或 mark="none")是默认视图:只当普通月历用,只显示日期和事件。
|
|
10
|
+
* - 上月、下月的格子只留淡底色和日期,不写标签。
|
|
11
|
+
* - 标签文字可以用 labels 改(如把「法定补班」改成「调休上班」);showLabel、showOrdinal 控制标签和序号显不显示。
|
|
12
|
+
* - 日期信息(days)由服务端 ys_base.calendar 下发,组件只显示,不自己按周一到周五猜;某天 covered 为 false 表示这一年
|
|
13
|
+
* 还没有放假安排,顶部写明、格子不标状态。序号由 @ysgroup/core 的 ysTradingMarks 按 trading 字段推出,只对完整月份标。
|
|
14
|
+
* - 图例可以点:悬停或点一项,只突出这一类日子,再点一次取消。
|
|
7
15
|
* - v-model 是选中日期,v-model:month 是显示的月份(`YYYY-MM`);翻月后按 ysMonthRange(month) 取这一屏的日期信息。
|
|
8
16
|
* - 键盘:方向键移动一天或一周,PageUp / PageDown 翻月,Home / End 到本周一 / 周日,Enter 或空格选中;跨月自动翻页。
|
|
9
17
|
* - 事件条(events)每格最多 maxEvents 条,其余收成「+N」(触发 more);要完全自定义格子内容用 #day 插槽。
|
|
@@ -11,17 +19,21 @@
|
|
|
11
19
|
import { computed, nextTick, ref, watch } from "vue";
|
|
12
20
|
import {
|
|
13
21
|
YS_DAY_KIND_LABELS,
|
|
22
|
+
YS_TRADING_TAG_LABELS,
|
|
14
23
|
YS_WEEKDAY_LABELS,
|
|
15
24
|
ysAddDays,
|
|
16
25
|
ysDateTitle,
|
|
17
26
|
ysIsDate,
|
|
18
27
|
ysMonthGrid,
|
|
19
28
|
ysMonthOf,
|
|
29
|
+
ysMonthSummary,
|
|
20
30
|
ysShiftMonth,
|
|
21
31
|
ysToday,
|
|
32
|
+
ysTradingMarks,
|
|
22
33
|
ysWeekday,
|
|
23
34
|
type YsCalendarDay,
|
|
24
35
|
type YsMonthCell,
|
|
36
|
+
type YsTradingMark,
|
|
25
37
|
} from "@ysgroup/core";
|
|
26
38
|
|
|
27
39
|
export interface YsCalendarEvent {
|
|
@@ -31,6 +43,26 @@ export interface YsCalendarEvent {
|
|
|
31
43
|
tone?: "primary" | "success" | "warning" | "danger" | "info";
|
|
32
44
|
}
|
|
33
45
|
|
|
46
|
+
/** 格子状态:交易日视图 trading / closed,工作日视图 workday / adjusted / weekend / holiday。 */
|
|
47
|
+
export type YsCalendarStatus =
|
|
48
|
+
| "trading"
|
|
49
|
+
| "closed"
|
|
50
|
+
| "workday"
|
|
51
|
+
| "adjusted"
|
|
52
|
+
| "weekend"
|
|
53
|
+
| "holiday";
|
|
54
|
+
/** 各状态标签上的文字。 */
|
|
55
|
+
export type YsCalendarLabels = Record<YsCalendarStatus, string>;
|
|
56
|
+
|
|
57
|
+
const DEFAULT_LABELS: YsCalendarLabels = {
|
|
58
|
+
trading: "交易日",
|
|
59
|
+
closed: "休市",
|
|
60
|
+
workday: "工作日",
|
|
61
|
+
adjusted: "法定补班",
|
|
62
|
+
weekend: "休息",
|
|
63
|
+
holiday: "放假",
|
|
64
|
+
};
|
|
65
|
+
|
|
34
66
|
const props = withDefaults(
|
|
35
67
|
defineProps<{
|
|
36
68
|
modelValue?: string;
|
|
@@ -40,8 +72,18 @@ const props = withDefaults(
|
|
|
40
72
|
today?: string;
|
|
41
73
|
loading?: boolean;
|
|
42
74
|
size?: "default" | "small";
|
|
43
|
-
/**
|
|
75
|
+
/** 视图:none 默认(不标状态)、work 工作日、trading 交易日。 */
|
|
76
|
+
mark?: "work" | "trading" | "none";
|
|
77
|
+
/** 旧写法,等于 mark="trading"。 */
|
|
44
78
|
trading?: boolean;
|
|
79
|
+
/** 改标签文字,只写要改的几项,如 { adjusted: "调休上班" }。 */
|
|
80
|
+
labels?: Partial<YsCalendarLabels>;
|
|
81
|
+
/** 每格右上角显示状态标签(迷你模式不显示,只留底色)。 */
|
|
82
|
+
showLabel?: boolean;
|
|
83
|
+
/** 交易日视图在标签旁写本月第几个交易日(默认不写,选中日详情里写)。 */
|
|
84
|
+
showOrdinal?: boolean;
|
|
85
|
+
/** 顶部显示本月统计(工作日视图:工作日、法定补班、放假;交易日视图:交易日、休市)。 */
|
|
86
|
+
summary?: boolean;
|
|
45
87
|
maxEvents?: number;
|
|
46
88
|
/** 不能选的日期(如非交易日):变淡、点了不选中。 */
|
|
47
89
|
disabledDate?: (date: string, info?: YsCalendarDay) => boolean;
|
|
@@ -56,7 +98,12 @@ const props = withDefaults(
|
|
|
56
98
|
today: "",
|
|
57
99
|
loading: false,
|
|
58
100
|
size: "default",
|
|
101
|
+
mark: undefined,
|
|
59
102
|
trading: false,
|
|
103
|
+
labels: () => ({}),
|
|
104
|
+
showLabel: true,
|
|
105
|
+
showOrdinal: false,
|
|
106
|
+
summary: false,
|
|
60
107
|
maxEvents: 3,
|
|
61
108
|
disabledDate: undefined,
|
|
62
109
|
legend: null,
|
|
@@ -99,6 +146,19 @@ const eventMap = computed(() => {
|
|
|
99
146
|
}
|
|
100
147
|
return map;
|
|
101
148
|
});
|
|
149
|
+
const small = computed(() => props.size === "small");
|
|
150
|
+
const view = computed(() => props.mark ?? (props.trading ? "trading" : "none"));
|
|
151
|
+
const tradingView = computed(() => view.value === "trading");
|
|
152
|
+
const labelText = computed<YsCalendarLabels>(() => ({
|
|
153
|
+
...DEFAULT_LABELS,
|
|
154
|
+
...props.labels,
|
|
155
|
+
}));
|
|
156
|
+
const marks = computed(() =>
|
|
157
|
+
tradingView.value
|
|
158
|
+
? ysTradingMarks(props.days)
|
|
159
|
+
: new Map<string, YsTradingMark>(),
|
|
160
|
+
);
|
|
161
|
+
|
|
102
162
|
/** 这一屏里还没有放假安排的年份。 */
|
|
103
163
|
const missingYears = computed(() => {
|
|
104
164
|
const years = new Set<string>();
|
|
@@ -107,10 +167,31 @@ const missingYears = computed(() => {
|
|
|
107
167
|
years.add(cell.date.slice(0, 4));
|
|
108
168
|
return [...years].sort();
|
|
109
169
|
});
|
|
110
|
-
const
|
|
111
|
-
() =>
|
|
170
|
+
const todayVisible = computed(() =>
|
|
171
|
+
cells.value.some((cell) => cell.date === todayText.value),
|
|
112
172
|
);
|
|
113
|
-
|
|
173
|
+
|
|
174
|
+
/** 顶部统计:拆成「名称 + 数字」几段,数字加粗。月份信息不全时不显示。 */
|
|
175
|
+
const summaryParts = computed(() => {
|
|
176
|
+
if (!props.summary || small.value || view.value === "none") return [];
|
|
177
|
+
const value = ysMonthSummary(props.days, shownMonth.value);
|
|
178
|
+
if (!value.complete) return [];
|
|
179
|
+
const labels = labelText.value;
|
|
180
|
+
if (tradingView.value)
|
|
181
|
+
return [
|
|
182
|
+
{ label: labels.trading, value: value.trading },
|
|
183
|
+
{ label: labels.closed, value: value.closed },
|
|
184
|
+
];
|
|
185
|
+
// 和图例一致:工作日不含法定补班,法定补班单列
|
|
186
|
+
const parts = [
|
|
187
|
+
{ label: labels.workday, value: value.workdays - value.adjusted },
|
|
188
|
+
];
|
|
189
|
+
if (value.adjusted)
|
|
190
|
+
parts.push({ label: labels.adjusted, value: value.adjusted });
|
|
191
|
+
if (value.holidays)
|
|
192
|
+
parts.push({ label: labels.holiday, value: value.holidays });
|
|
193
|
+
return parts;
|
|
194
|
+
});
|
|
114
195
|
|
|
115
196
|
function setMonth(month: string) {
|
|
116
197
|
if (!month || month === innerMonth.value) return;
|
|
@@ -126,21 +207,55 @@ function eventsOf(date: string): YsCalendarEvent[] {
|
|
|
126
207
|
return eventMap.value.get(date) ?? [];
|
|
127
208
|
}
|
|
128
209
|
function covered(date: string): boolean {
|
|
129
|
-
|
|
210
|
+
const item = info(date);
|
|
211
|
+
return Boolean(item) && item?.covered !== false;
|
|
130
212
|
}
|
|
131
|
-
|
|
213
|
+
/** 这一天的状态;没有日期信息、这一年没有放假安排或 mark="none" 时为空。 */
|
|
214
|
+
function status(date: string): YsCalendarStatus | "" {
|
|
215
|
+
if (view.value === "none" || !covered(date)) return "";
|
|
132
216
|
const item = info(date);
|
|
133
|
-
if (!item
|
|
134
|
-
if (item.
|
|
135
|
-
|
|
136
|
-
return "";
|
|
217
|
+
if (!item) return "";
|
|
218
|
+
if (tradingView.value) return item.trading ? "trading" : "closed";
|
|
219
|
+
return item.kind;
|
|
137
220
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
221
|
+
/** 上月、下月的格子只留淡底色和日期,标签、序号、节日名只在本月写。 */
|
|
222
|
+
function inShownMonth(date: string): boolean {
|
|
223
|
+
return date.startsWith(shownMonth.value);
|
|
224
|
+
}
|
|
225
|
+
function statusLabel(date: string): string {
|
|
226
|
+
if (!inShownMonth(date)) return "";
|
|
227
|
+
const value = status(date);
|
|
228
|
+
return value ? labelText.value[value] : "";
|
|
229
|
+
}
|
|
230
|
+
/** 迷你模式工作日视图在数字右上角挂「休」「班」小角标。 */
|
|
231
|
+
function badge(date: string): "休" | "班" | "" {
|
|
232
|
+
if (!inShownMonth(date)) return "";
|
|
233
|
+
const value = status(date);
|
|
234
|
+
return value === "holiday" ? "休" : value === "adjusted" ? "班" : "";
|
|
235
|
+
}
|
|
236
|
+
function isWeekendCell(cell: YsMonthCell): boolean {
|
|
237
|
+
const value = status(cell.date);
|
|
238
|
+
if (value) return value === "weekend" || value === "holiday";
|
|
142
239
|
return cell.weekday >= 5;
|
|
143
240
|
}
|
|
241
|
+
/** 状态标签下面那一行:节日名;交易日视图休市日写「国庆节 · 休市」,法定补班写「国庆节调休」。 */
|
|
242
|
+
function subline(date: string): string {
|
|
243
|
+
if (!inShownMonth(date)) return "";
|
|
244
|
+
const value = status(date);
|
|
245
|
+
const name = info(date)?.name ?? "";
|
|
246
|
+
if (!value || !name) return "";
|
|
247
|
+
if (value === "closed") return `${name} · ${labelText.value.closed}`;
|
|
248
|
+
if (value === "adjusted") return `${name}调休`;
|
|
249
|
+
return name;
|
|
250
|
+
}
|
|
251
|
+
function ordinalOf(date: string): number | undefined {
|
|
252
|
+
return props.showOrdinal && inShownMonth(date)
|
|
253
|
+
? marks.value.get(date)?.ordinal
|
|
254
|
+
: undefined;
|
|
255
|
+
}
|
|
256
|
+
function markOf(date: string): YsTradingMark | undefined {
|
|
257
|
+
return marks.value.get(date);
|
|
258
|
+
}
|
|
144
259
|
function disabled(date: string): boolean {
|
|
145
260
|
return Boolean(props.disabledDate?.(date, info(date)));
|
|
146
261
|
}
|
|
@@ -148,13 +263,24 @@ function ariaLabel(cell: YsMonthCell): string {
|
|
|
148
263
|
const item = info(cell.date);
|
|
149
264
|
const parts = [ysDateTitle(cell.date)];
|
|
150
265
|
if (item?.covered === false) parts.push("放假安排还没有");
|
|
151
|
-
else if (item) {
|
|
266
|
+
else if (item && view.value !== "none") {
|
|
152
267
|
parts.push(
|
|
153
268
|
item.name
|
|
154
269
|
? `${YS_DAY_KIND_LABELS[item.kind]} ${item.name}`
|
|
155
270
|
: YS_DAY_KIND_LABELS[item.kind],
|
|
156
271
|
);
|
|
157
|
-
if (
|
|
272
|
+
if (tradingView.value) {
|
|
273
|
+
const mark = markOf(cell.date);
|
|
274
|
+
parts.push(
|
|
275
|
+
item.trading
|
|
276
|
+
? mark?.ordinal
|
|
277
|
+
? `本月第 ${mark.ordinal} 个交易日`
|
|
278
|
+
: "交易日"
|
|
279
|
+
: "休市",
|
|
280
|
+
);
|
|
281
|
+
for (const tag of mark?.tags ?? [])
|
|
282
|
+
parts.push(YS_TRADING_TAG_LABELS[tag].full);
|
|
283
|
+
}
|
|
158
284
|
}
|
|
159
285
|
if (cell.date === todayText.value) parts.push("今天");
|
|
160
286
|
const count = eventsOf(cell.date).length;
|
|
@@ -163,6 +289,43 @@ function ariaLabel(cell: YsMonthCell): string {
|
|
|
163
289
|
return parts.join(",");
|
|
164
290
|
}
|
|
165
291
|
|
|
292
|
+
// ---------- 图例:悬停或点一项,只突出这一类 ----------
|
|
293
|
+
const legendItems = computed<{ key: YsCalendarStatus; text: string }[]>(() => {
|
|
294
|
+
if (tradingView.value)
|
|
295
|
+
return [
|
|
296
|
+
{ key: "trading", text: props.showOrdinal ? "旁边是本月第几个" : "" },
|
|
297
|
+
{ key: "closed", text: `周末、放假和${labelText.value.adjusted}的周末` },
|
|
298
|
+
];
|
|
299
|
+
if (view.value === "work")
|
|
300
|
+
return [
|
|
301
|
+
{ key: "workday", text: "" },
|
|
302
|
+
{ key: "adjusted", text: "调休上班的周末" },
|
|
303
|
+
{ key: "weekend", text: "" },
|
|
304
|
+
{ key: "holiday", text: "法定节假日" },
|
|
305
|
+
];
|
|
306
|
+
return [];
|
|
307
|
+
});
|
|
308
|
+
const showLegend = computed(
|
|
309
|
+
() =>
|
|
310
|
+
!small.value &&
|
|
311
|
+
(props.legend ?? props.days.length > 0) &&
|
|
312
|
+
(legendItems.value.length > 0 || todayVisible.value),
|
|
313
|
+
);
|
|
314
|
+
const legendHover = ref<YsCalendarStatus | "">("");
|
|
315
|
+
const legendPinned = ref<YsCalendarStatus | "">("");
|
|
316
|
+
const focusStatus = computed(() => legendHover.value || legendPinned.value);
|
|
317
|
+
watch(view, () => {
|
|
318
|
+
legendHover.value = "";
|
|
319
|
+
legendPinned.value = "";
|
|
320
|
+
});
|
|
321
|
+
function togglePinned(key: YsCalendarStatus) {
|
|
322
|
+
legendPinned.value = legendPinned.value === key ? "" : key;
|
|
323
|
+
}
|
|
324
|
+
function legendCount(key: YsCalendarStatus): number {
|
|
325
|
+
return cells.value.filter((cell) => cell.inMonth && status(cell.date) === key)
|
|
326
|
+
.length;
|
|
327
|
+
}
|
|
328
|
+
|
|
166
329
|
// ---------- 选择与键盘 ----------
|
|
167
330
|
const grid = ref<HTMLElement | null>(null);
|
|
168
331
|
const focusDate = ref(
|
|
@@ -237,7 +400,14 @@ function goToday() {
|
|
|
237
400
|
</script>
|
|
238
401
|
|
|
239
402
|
<template>
|
|
240
|
-
<div
|
|
403
|
+
<div
|
|
404
|
+
class="ys-calendar"
|
|
405
|
+
:class="{
|
|
406
|
+
'is-small': small,
|
|
407
|
+
'is-trading-view': tradingView,
|
|
408
|
+
'is-focusing': Boolean(focusStatus),
|
|
409
|
+
}"
|
|
410
|
+
>
|
|
241
411
|
<header class="ys-calendar__head">
|
|
242
412
|
<div class="ys-calendar__nav">
|
|
243
413
|
<el-button
|
|
@@ -272,6 +442,19 @@ function goToday() {
|
|
|
272
442
|
>今天</el-button
|
|
273
443
|
>
|
|
274
444
|
</div>
|
|
445
|
+
<div
|
|
446
|
+
v-if="summaryParts.length"
|
|
447
|
+
class="ys-calendar__summary"
|
|
448
|
+
aria-label="本月统计"
|
|
449
|
+
>
|
|
450
|
+
<span
|
|
451
|
+
v-for="part in summaryParts"
|
|
452
|
+
:key="part.label"
|
|
453
|
+
class="ys-calendar__summary-item"
|
|
454
|
+
><span>{{ part.label }}</span
|
|
455
|
+
><strong>{{ part.value }}</strong></span
|
|
456
|
+
>
|
|
457
|
+
</div>
|
|
275
458
|
<div v-if="$slots.extra" class="ys-calendar__extra">
|
|
276
459
|
<slot name="extra" />
|
|
277
460
|
</div>
|
|
@@ -283,7 +466,7 @@ function goToday() {
|
|
|
283
466
|
role="status"
|
|
284
467
|
>
|
|
285
468
|
{{ missingYears.join("、") }} 年的放假安排还没有(国务院办公厅一般在上一年
|
|
286
|
-
10–11
|
|
469
|
+
10–11 月发布),这些日期暂不标工作日和交易日。
|
|
287
470
|
</p>
|
|
288
471
|
|
|
289
472
|
<div
|
|
@@ -321,19 +504,20 @@ function goToday() {
|
|
|
321
504
|
:aria-selected="cell.date === modelValue"
|
|
322
505
|
:aria-disabled="disabled(cell.date) || undefined"
|
|
323
506
|
:aria-label="ariaLabel(cell)"
|
|
324
|
-
:title="
|
|
325
|
-
:class="
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
507
|
+
:title="ariaLabel(cell)"
|
|
508
|
+
:class="[
|
|
509
|
+
status(cell.date) ? `is-${status(cell.date)}` : '',
|
|
510
|
+
{
|
|
511
|
+
'is-outside': !cell.inMonth,
|
|
512
|
+
'is-today': cell.date === todayText,
|
|
513
|
+
'is-selected': cell.date === modelValue,
|
|
514
|
+
'is-weekend-day': isWeekendCell(cell),
|
|
515
|
+
'is-uncovered': info(cell.date)?.covered === false,
|
|
516
|
+
'is-disabled': disabled(cell.date),
|
|
517
|
+
'is-dimmed':
|
|
518
|
+
Boolean(focusStatus) && status(cell.date) !== focusStatus,
|
|
519
|
+
},
|
|
520
|
+
]"
|
|
337
521
|
@click="select(cell.date)"
|
|
338
522
|
@focus="focusDate = cell.date"
|
|
339
523
|
>
|
|
@@ -342,29 +526,44 @@ function goToday() {
|
|
|
342
526
|
:cell="cell"
|
|
343
527
|
:info="info(cell.date)"
|
|
344
528
|
:events="eventsOf(cell.date)"
|
|
529
|
+
:mark="markOf(cell.date)"
|
|
530
|
+
:status="status(cell.date)"
|
|
345
531
|
>
|
|
346
532
|
<div class="ys-calendar__top">
|
|
347
533
|
<span class="ys-calendar__date">{{
|
|
348
534
|
Number(cell.date.slice(8))
|
|
349
535
|
}}</span>
|
|
350
536
|
<span
|
|
351
|
-
v-if="badge(cell.date)"
|
|
537
|
+
v-if="small && badge(cell.date)"
|
|
352
538
|
class="ys-calendar__badge"
|
|
353
539
|
:class="badge(cell.date) === '休' ? 'is-off' : 'is-work'"
|
|
354
540
|
>{{ badge(cell.date) }}</span
|
|
355
541
|
>
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
542
|
+
<span
|
|
543
|
+
v-else-if="
|
|
544
|
+
!small &&
|
|
545
|
+
(ordinalOf(cell.date) ||
|
|
546
|
+
(showLabel && statusLabel(cell.date)))
|
|
547
|
+
"
|
|
548
|
+
class="ys-calendar__status"
|
|
361
549
|
>
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
550
|
+
<span
|
|
551
|
+
v-if="ordinalOf(cell.date)"
|
|
552
|
+
class="ys-calendar__ordinal"
|
|
553
|
+
aria-hidden="true"
|
|
554
|
+
>第 {{ ordinalOf(cell.date) }} 个</span
|
|
365
555
|
>
|
|
366
|
-
|
|
556
|
+
<span
|
|
557
|
+
v-if="showLabel && statusLabel(cell.date)"
|
|
558
|
+
class="ys-calendar__label"
|
|
559
|
+
aria-hidden="true"
|
|
560
|
+
>{{ statusLabel(cell.date) }}</span
|
|
367
561
|
>
|
|
562
|
+
</span>
|
|
563
|
+
</div>
|
|
564
|
+
<template v-if="!small">
|
|
565
|
+
<div v-if="subline(cell.date)" class="ys-calendar__name">
|
|
566
|
+
{{ subline(cell.date) }}
|
|
368
567
|
</div>
|
|
369
568
|
<ul v-if="eventsOf(cell.date).length" class="ys-calendar__events">
|
|
370
569
|
<li
|
|
@@ -398,39 +597,84 @@ function goToday() {
|
|
|
398
597
|
</div>
|
|
399
598
|
|
|
400
599
|
<footer v-if="showLegend" class="ys-calendar__legend">
|
|
401
|
-
<
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
600
|
+
<button
|
|
601
|
+
v-for="item in legendItems"
|
|
602
|
+
:key="item.key"
|
|
603
|
+
type="button"
|
|
604
|
+
class="ys-calendar__legend-item"
|
|
605
|
+
:class="[`is-${item.key}`, { 'is-active': legendPinned === item.key }]"
|
|
606
|
+
:aria-pressed="legendPinned === item.key"
|
|
607
|
+
:title="`只突出${labelText[item.key]},再点一次取消`"
|
|
608
|
+
@mouseenter="legendHover = item.key"
|
|
609
|
+
@mouseleave="legendHover = ''"
|
|
610
|
+
@focus="legendHover = item.key"
|
|
611
|
+
@blur="legendHover = ''"
|
|
612
|
+
@click="togglePinned(item.key)"
|
|
405
613
|
>
|
|
406
|
-
|
|
614
|
+
<i class="ys-calendar__swatch">{{ labelText[item.key] }}</i>
|
|
615
|
+
<strong>{{ legendCount(item.key) }}</strong>
|
|
616
|
+
<span v-if="item.text" class="ys-calendar__legend-note">{{
|
|
617
|
+
item.text
|
|
618
|
+
}}</span>
|
|
619
|
+
</button>
|
|
620
|
+
<span v-if="todayVisible" class="ys-calendar__legend-today">今天</span>
|
|
407
621
|
</footer>
|
|
408
622
|
</div>
|
|
409
623
|
</template>
|
|
410
624
|
|
|
411
625
|
<style scoped>
|
|
412
626
|
.ys-calendar {
|
|
413
|
-
|
|
627
|
+
/* 每种状态一个色调:交易日、工作日和法定补班绿,放假橙,休息、休市灰 */
|
|
628
|
+
--cal-trading: var(--ys-color-success);
|
|
629
|
+
--cal-workday: var(--ys-color-success);
|
|
630
|
+
--cal-holiday: var(--ys-color-warning);
|
|
631
|
+
--cal-rest: var(--ys-color-text-3);
|
|
632
|
+
/* 底色:不支持相对颜色的浏览器用混色兜底 */
|
|
633
|
+
--cal-open-bg: color-mix(
|
|
414
634
|
in srgb,
|
|
415
|
-
var(--ys-color-success)
|
|
416
|
-
var(--ys-color-
|
|
635
|
+
var(--ys-color-success) 6%,
|
|
636
|
+
var(--ys-color-bg-elevated)
|
|
417
637
|
);
|
|
418
|
-
--cal-
|
|
638
|
+
--cal-open-hover: color-mix(
|
|
419
639
|
in srgb,
|
|
420
|
-
var(--ys-color-
|
|
421
|
-
var(--ys-color-
|
|
640
|
+
var(--ys-color-success) 10%,
|
|
641
|
+
var(--ys-color-bg-elevated)
|
|
642
|
+
);
|
|
643
|
+
--cal-holiday-bg: color-mix(
|
|
644
|
+
in srgb,
|
|
645
|
+
var(--ys-color-warning) 6%,
|
|
646
|
+
var(--ys-color-bg-elevated)
|
|
647
|
+
);
|
|
648
|
+
--cal-holiday-hover: color-mix(
|
|
649
|
+
in srgb,
|
|
650
|
+
var(--ys-color-warning) 10%,
|
|
651
|
+
var(--ys-color-bg-elevated)
|
|
422
652
|
);
|
|
423
653
|
display: flex;
|
|
424
654
|
flex-direction: column;
|
|
425
655
|
gap: 8px;
|
|
426
656
|
min-width: 0;
|
|
427
657
|
}
|
|
658
|
+
/* 支持相对颜色时,底色固定亮度和饱和度:柔和的浅绿和浅橙,不发灰也不刺眼 */
|
|
659
|
+
@supports (color: oklch(from red l c h)) {
|
|
660
|
+
.ys-calendar {
|
|
661
|
+
--cal-open-bg: oklch(from var(--ys-color-success) 0.976 0.018 h);
|
|
662
|
+
--cal-open-hover: oklch(from var(--ys-color-success) 0.952 0.03 h);
|
|
663
|
+
--cal-holiday-bg: oklch(from var(--ys-color-warning) 0.975 0.02 h);
|
|
664
|
+
--cal-holiday-hover: oklch(from var(--ys-color-warning) 0.952 0.032 h);
|
|
665
|
+
}
|
|
666
|
+
html[data-theme="dark"] .ys-calendar {
|
|
667
|
+
--cal-open-bg: oklch(from var(--ys-color-success) 0.25 0.028 h);
|
|
668
|
+
--cal-open-hover: oklch(from var(--ys-color-success) 0.29 0.04 h);
|
|
669
|
+
--cal-holiday-bg: oklch(from var(--ys-color-warning) 0.25 0.028 h);
|
|
670
|
+
--cal-holiday-hover: oklch(from var(--ys-color-warning) 0.29 0.04 h);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
428
673
|
.ys-calendar__head {
|
|
429
674
|
display: flex;
|
|
430
675
|
flex-wrap: wrap;
|
|
431
|
-
gap: 8px
|
|
676
|
+
gap: 8px 16px;
|
|
432
677
|
align-items: center;
|
|
433
|
-
justify-content: space-between;
|
|
434
678
|
}
|
|
435
679
|
.ys-calendar__nav {
|
|
436
680
|
display: flex;
|
|
@@ -450,16 +694,33 @@ function goToday() {
|
|
|
450
694
|
:deep(.el-date-editor.ys-calendar__month) {
|
|
451
695
|
width: 112px;
|
|
452
696
|
}
|
|
697
|
+
.ys-calendar__summary {
|
|
698
|
+
display: flex;
|
|
699
|
+
flex-wrap: wrap;
|
|
700
|
+
gap: 4px 14px;
|
|
701
|
+
color: var(--ys-color-text-2);
|
|
702
|
+
font-size: 12px;
|
|
703
|
+
}
|
|
704
|
+
.ys-calendar__summary-item {
|
|
705
|
+
display: inline-flex;
|
|
706
|
+
gap: 4px;
|
|
707
|
+
align-items: baseline;
|
|
708
|
+
}
|
|
709
|
+
.ys-calendar__summary-item strong {
|
|
710
|
+
color: var(--ys-color-text-1);
|
|
711
|
+
font-size: 14px;
|
|
712
|
+
font-variant-numeric: tabular-nums;
|
|
713
|
+
}
|
|
453
714
|
.ys-calendar__extra {
|
|
454
715
|
display: flex;
|
|
455
716
|
flex-wrap: wrap;
|
|
456
717
|
gap: 8px;
|
|
457
718
|
align-items: center;
|
|
719
|
+
margin-left: auto;
|
|
458
720
|
}
|
|
459
721
|
.ys-calendar__missing {
|
|
460
722
|
margin: 0;
|
|
461
723
|
padding: 6px 10px;
|
|
462
|
-
border-left: 3px solid var(--ys-color-warning);
|
|
463
724
|
border-radius: var(--ys-radius-s);
|
|
464
725
|
color: var(--ys-color-text-2);
|
|
465
726
|
background: color-mix(in srgb, var(--ys-color-warning) 8%, transparent);
|
|
@@ -495,60 +756,102 @@ function goToday() {
|
|
|
495
756
|
font-weight: 600;
|
|
496
757
|
}
|
|
497
758
|
.ys-calendar__weekday.is-weekend {
|
|
498
|
-
color: var(--
|
|
759
|
+
color: var(--ys-color-text-3);
|
|
499
760
|
}
|
|
761
|
+
|
|
762
|
+
/* 格子:--tone 是状态色调(标签、节日名用),--bg 是底色 */
|
|
500
763
|
.ys-calendar__cell {
|
|
764
|
+
--tone: transparent;
|
|
765
|
+
--bg: transparent;
|
|
766
|
+
--ring: 0 0 0 0 transparent;
|
|
501
767
|
position: relative;
|
|
502
768
|
display: flex;
|
|
503
769
|
flex-direction: column;
|
|
504
|
-
gap:
|
|
770
|
+
gap: 3px;
|
|
505
771
|
min-width: 0;
|
|
506
|
-
|
|
772
|
+
/* 格子随宽度略微变高,大屏不显得扁 */
|
|
773
|
+
min-height: clamp(88px, 6.8vw, 128px);
|
|
507
774
|
padding: 6px;
|
|
508
775
|
cursor: pointer;
|
|
509
776
|
outline: none;
|
|
510
|
-
|
|
777
|
+
background-color: var(--bg);
|
|
778
|
+
box-shadow: var(--ring);
|
|
779
|
+
transition: box-shadow 0.15s ease;
|
|
511
780
|
}
|
|
512
781
|
.ys-calendar__cell + .ys-calendar__cell {
|
|
513
782
|
border-left: 1px solid var(--ys-color-border);
|
|
514
783
|
}
|
|
515
784
|
.ys-calendar__cell:hover {
|
|
516
|
-
|
|
785
|
+
--bg: color-mix(in srgb, var(--ys-color-primary) 5%, transparent);
|
|
517
786
|
}
|
|
518
|
-
|
|
519
|
-
|
|
787
|
+
/* 能上班、能交易的日子浅绿底;放假浅橙底;休息、休市白底,和绿色一深一浅 */
|
|
788
|
+
.ys-calendar__cell.is-trading,
|
|
789
|
+
.ys-calendar__cell.is-workday,
|
|
790
|
+
.ys-calendar__cell.is-adjusted {
|
|
791
|
+
--tone: var(--cal-workday);
|
|
792
|
+
--bg: var(--cal-open-bg);
|
|
520
793
|
}
|
|
521
|
-
.ys-calendar__cell.is-
|
|
522
|
-
|
|
794
|
+
.ys-calendar__cell.is-holiday {
|
|
795
|
+
--tone: var(--cal-holiday);
|
|
796
|
+
--bg: var(--cal-holiday-bg);
|
|
523
797
|
}
|
|
524
|
-
.ys-calendar__cell.is-
|
|
525
|
-
|
|
798
|
+
.ys-calendar__cell.is-closed,
|
|
799
|
+
.ys-calendar__cell.is-weekend {
|
|
800
|
+
--tone: var(--cal-rest);
|
|
801
|
+
--bg: transparent;
|
|
526
802
|
}
|
|
527
|
-
.ys-calendar__cell.is-
|
|
528
|
-
|
|
803
|
+
.ys-calendar__cell.is-trading:hover,
|
|
804
|
+
.ys-calendar__cell.is-workday:hover,
|
|
805
|
+
.ys-calendar__cell.is-adjusted:hover {
|
|
806
|
+
--bg: var(--cal-open-hover);
|
|
529
807
|
}
|
|
530
|
-
.ys-calendar__cell.is-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
808
|
+
.ys-calendar__cell.is-holiday:hover {
|
|
809
|
+
--bg: var(--cal-holiday-hover);
|
|
810
|
+
}
|
|
811
|
+
.ys-calendar__cell.is-closed:hover,
|
|
812
|
+
.ys-calendar__cell.is-weekend:hover {
|
|
813
|
+
--bg: color-mix(in srgb, var(--cal-rest) 7%, transparent);
|
|
814
|
+
}
|
|
815
|
+
/* 上月、下月的日期:底色减半、内容变淡 */
|
|
816
|
+
.ys-calendar__cell.is-outside {
|
|
817
|
+
background-color: color-mix(in srgb, var(--bg) 45%, transparent);
|
|
534
818
|
}
|
|
535
819
|
.ys-calendar__cell.is-outside > * {
|
|
536
820
|
opacity: 0.42;
|
|
537
821
|
}
|
|
822
|
+
.ys-calendar__cell:focus-visible {
|
|
823
|
+
--ring: inset 0 0 0 2px var(--ys-color-primary);
|
|
824
|
+
}
|
|
825
|
+
.ys-calendar__cell.is-selected {
|
|
826
|
+
--ring: inset 0 0 0 1.5px var(--ys-color-primary);
|
|
827
|
+
}
|
|
828
|
+
.ys-calendar__cell.is-selected:focus-visible {
|
|
829
|
+
--ring: inset 0 0 0 2px var(--ys-color-primary);
|
|
830
|
+
}
|
|
538
831
|
.ys-calendar__cell.is-disabled {
|
|
539
832
|
cursor: not-allowed;
|
|
540
833
|
}
|
|
541
834
|
.ys-calendar__cell.is-disabled > * {
|
|
542
835
|
opacity: 0.38;
|
|
543
836
|
}
|
|
837
|
+
/* 图例突出某一类时,其余格子去掉底色、内容变淡 */
|
|
838
|
+
.ys-calendar__cell.is-dimmed {
|
|
839
|
+
background-color: transparent;
|
|
840
|
+
}
|
|
841
|
+
.ys-calendar__cell.is-dimmed > * {
|
|
842
|
+
opacity: 0.22;
|
|
843
|
+
}
|
|
844
|
+
|
|
544
845
|
.ys-calendar__top {
|
|
545
846
|
display: flex;
|
|
546
847
|
gap: 4px;
|
|
547
848
|
align-items: center;
|
|
548
849
|
justify-content: space-between;
|
|
850
|
+
min-width: 0;
|
|
549
851
|
}
|
|
550
852
|
.ys-calendar__date {
|
|
551
853
|
display: inline-flex;
|
|
854
|
+
flex: none;
|
|
552
855
|
align-items: center;
|
|
553
856
|
justify-content: center;
|
|
554
857
|
min-width: 24px;
|
|
@@ -556,12 +859,14 @@ function goToday() {
|
|
|
556
859
|
padding: 0 4px;
|
|
557
860
|
border-radius: 999px;
|
|
558
861
|
color: var(--ys-color-text-1);
|
|
559
|
-
font-size:
|
|
862
|
+
font-size: 14px;
|
|
560
863
|
font-variant-numeric: tabular-nums;
|
|
561
864
|
font-weight: 600;
|
|
562
865
|
}
|
|
563
|
-
.ys-calendar__cell.is-
|
|
564
|
-
|
|
866
|
+
.ys-calendar__cell.is-weekend-day .ys-calendar__date,
|
|
867
|
+
.ys-calendar__cell.is-closed .ys-calendar__date {
|
|
868
|
+
color: var(--ys-color-text-2);
|
|
869
|
+
font-weight: 500;
|
|
565
870
|
}
|
|
566
871
|
.ys-calendar__cell.is-uncovered .ys-calendar__date {
|
|
567
872
|
text-decoration: underline dotted var(--ys-color-text-3);
|
|
@@ -571,36 +876,88 @@ function goToday() {
|
|
|
571
876
|
color: var(--ys-color-on-solid);
|
|
572
877
|
background: var(--ys-color-primary);
|
|
573
878
|
}
|
|
574
|
-
.ys-
|
|
879
|
+
.ys-calendar__status {
|
|
575
880
|
display: inline-flex;
|
|
881
|
+
gap: 4px;
|
|
576
882
|
align-items: center;
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
883
|
+
min-width: 0;
|
|
884
|
+
overflow: hidden;
|
|
885
|
+
}
|
|
886
|
+
.ys-calendar__ordinal {
|
|
887
|
+
overflow: hidden;
|
|
888
|
+
color: var(--ys-color-text-2);
|
|
889
|
+
font-size: 11px;
|
|
890
|
+
font-variant-numeric: tabular-nums;
|
|
891
|
+
white-space: nowrap;
|
|
892
|
+
}
|
|
893
|
+
/* 状态标签:白底同色调描边深字,在有底色的格子上也清楚;法定补班是实心,最醒目 */
|
|
894
|
+
.ys-calendar__label,
|
|
895
|
+
.ys-calendar__swatch {
|
|
896
|
+
flex: none;
|
|
897
|
+
padding: 0 5px;
|
|
898
|
+
border: 1px solid color-mix(in srgb, var(--tone) 60%, transparent);
|
|
580
899
|
border-radius: var(--ys-radius-s);
|
|
900
|
+
color: color-mix(in srgb, var(--tone) 88%, var(--ys-color-text-1));
|
|
901
|
+
background: var(--ys-color-bg-elevated);
|
|
581
902
|
font-size: 11px;
|
|
582
903
|
font-style: normal;
|
|
583
904
|
font-weight: 600;
|
|
584
|
-
line-height:
|
|
905
|
+
line-height: 16px;
|
|
906
|
+
white-space: nowrap;
|
|
585
907
|
}
|
|
586
|
-
.ys-
|
|
587
|
-
|
|
588
|
-
|
|
908
|
+
.ys-calendar__cell.is-closed .ys-calendar__label,
|
|
909
|
+
.ys-calendar__cell.is-weekend .ys-calendar__label,
|
|
910
|
+
.ys-calendar__legend-item.is-closed .ys-calendar__swatch,
|
|
911
|
+
.ys-calendar__legend-item.is-weekend .ys-calendar__swatch {
|
|
912
|
+
border-color: transparent;
|
|
913
|
+
color: var(--ys-color-text-2);
|
|
914
|
+
background: color-mix(in srgb, var(--cal-rest) 14%, transparent);
|
|
589
915
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
916
|
+
/* 「交易日」标签用主色蓝,格子仍是浅绿底 */
|
|
917
|
+
.ys-calendar__cell.is-trading .ys-calendar__label,
|
|
918
|
+
.ys-calendar__legend-item.is-trading .ys-calendar__swatch {
|
|
919
|
+
color: color-mix(
|
|
920
|
+
in srgb,
|
|
921
|
+
var(--ys-color-primary) 85%,
|
|
922
|
+
var(--ys-color-text-1)
|
|
923
|
+
);
|
|
924
|
+
border-color: color-mix(in srgb, var(--ys-color-primary) 60%, transparent);
|
|
925
|
+
background: var(--ys-color-bg-elevated);
|
|
926
|
+
}
|
|
927
|
+
.ys-calendar__cell.is-adjusted .ys-calendar__label,
|
|
928
|
+
.ys-calendar__legend-item.is-adjusted .ys-calendar__swatch {
|
|
929
|
+
border-color: var(--cal-workday);
|
|
930
|
+
color: var(--ys-color-on-solid);
|
|
931
|
+
background: var(--cal-workday);
|
|
593
932
|
}
|
|
594
933
|
.ys-calendar__name {
|
|
595
934
|
overflow: hidden;
|
|
596
|
-
color: var(--
|
|
935
|
+
color: color-mix(in srgb, var(--tone) 75%, var(--ys-color-text-1));
|
|
597
936
|
font-size: 11px;
|
|
598
937
|
line-height: 1.5;
|
|
599
938
|
white-space: nowrap;
|
|
600
939
|
text-overflow: ellipsis;
|
|
601
940
|
}
|
|
602
|
-
.ys-calendar__cell.is-
|
|
603
|
-
|
|
941
|
+
.ys-calendar__cell.is-closed .ys-calendar__name,
|
|
942
|
+
.ys-calendar__cell.is-weekend .ys-calendar__name {
|
|
943
|
+
color: var(--ys-color-text-3);
|
|
944
|
+
}
|
|
945
|
+
.ys-calendar__badge {
|
|
946
|
+
display: inline-flex;
|
|
947
|
+
align-items: center;
|
|
948
|
+
justify-content: center;
|
|
949
|
+
border-radius: var(--ys-radius-s);
|
|
950
|
+
font-style: normal;
|
|
951
|
+
font-weight: 600;
|
|
952
|
+
line-height: 1;
|
|
953
|
+
}
|
|
954
|
+
.ys-calendar__badge.is-off {
|
|
955
|
+
color: color-mix(in srgb, var(--cal-holiday) 80%, var(--ys-color-text-1));
|
|
956
|
+
background: color-mix(in srgb, var(--cal-holiday) 20%, transparent);
|
|
957
|
+
}
|
|
958
|
+
.ys-calendar__badge.is-work {
|
|
959
|
+
color: var(--ys-color-on-solid);
|
|
960
|
+
background: var(--cal-workday);
|
|
604
961
|
}
|
|
605
962
|
.ys-calendar__events {
|
|
606
963
|
display: flex;
|
|
@@ -618,7 +975,7 @@ function goToday() {
|
|
|
618
975
|
border-left: 3px solid var(--tone);
|
|
619
976
|
border-radius: var(--ys-radius-s);
|
|
620
977
|
color: var(--ys-color-text-1);
|
|
621
|
-
background: color-mix(in srgb, var(--tone) 10%,
|
|
978
|
+
background: color-mix(in srgb, var(--tone) 10%, var(--ys-color-bg-elevated));
|
|
622
979
|
font-size: 12px;
|
|
623
980
|
line-height: 18px;
|
|
624
981
|
white-space: nowrap;
|
|
@@ -650,18 +1007,59 @@ function goToday() {
|
|
|
650
1007
|
.ys-calendar__more:hover {
|
|
651
1008
|
background: color-mix(in srgb, var(--ys-color-primary) 10%, transparent);
|
|
652
1009
|
}
|
|
1010
|
+
|
|
1011
|
+
/* 图例:每项是按钮,悬停或点一下只突出这一类 */
|
|
653
1012
|
.ys-calendar__legend {
|
|
654
1013
|
display: flex;
|
|
655
1014
|
flex-wrap: wrap;
|
|
656
|
-
gap: 4px
|
|
1015
|
+
gap: 4px 6px;
|
|
657
1016
|
align-items: center;
|
|
658
1017
|
color: var(--ys-color-text-3);
|
|
659
1018
|
font-size: 12px;
|
|
660
1019
|
}
|
|
661
|
-
.ys-calendar__legend
|
|
1020
|
+
.ys-calendar__legend-item {
|
|
1021
|
+
--tone: var(--cal-rest);
|
|
662
1022
|
display: inline-flex;
|
|
663
|
-
gap:
|
|
1023
|
+
gap: 5px;
|
|
1024
|
+
align-items: center;
|
|
1025
|
+
padding: 2px 8px 2px 3px;
|
|
1026
|
+
border: 1px solid transparent;
|
|
1027
|
+
border-radius: var(--ys-radius-s);
|
|
1028
|
+
color: inherit;
|
|
1029
|
+
background: none;
|
|
1030
|
+
font: inherit;
|
|
1031
|
+
cursor: pointer;
|
|
1032
|
+
}
|
|
1033
|
+
.ys-calendar__legend-item:hover,
|
|
1034
|
+
.ys-calendar__legend-item:focus-visible {
|
|
1035
|
+
border-color: var(--ys-color-border);
|
|
1036
|
+
outline: none;
|
|
1037
|
+
}
|
|
1038
|
+
.ys-calendar__legend-item.is-active {
|
|
1039
|
+
border-color: color-mix(in srgb, var(--tone) 50%, var(--ys-color-border));
|
|
1040
|
+
color: var(--ys-color-text-1);
|
|
1041
|
+
background: color-mix(in srgb, var(--tone) 8%, transparent);
|
|
1042
|
+
}
|
|
1043
|
+
.ys-calendar__legend-item strong {
|
|
1044
|
+
color: var(--ys-color-text-1);
|
|
1045
|
+
font-variant-numeric: tabular-nums;
|
|
1046
|
+
font-weight: 600;
|
|
1047
|
+
}
|
|
1048
|
+
.ys-calendar__legend-item.is-trading {
|
|
1049
|
+
--tone: var(--cal-trading);
|
|
1050
|
+
}
|
|
1051
|
+
.ys-calendar__legend-item.is-workday,
|
|
1052
|
+
.ys-calendar__legend-item.is-adjusted {
|
|
1053
|
+
--tone: var(--cal-workday);
|
|
1054
|
+
}
|
|
1055
|
+
.ys-calendar__legend-item.is-holiday {
|
|
1056
|
+
--tone: var(--cal-holiday);
|
|
1057
|
+
}
|
|
1058
|
+
.ys-calendar__legend-today {
|
|
1059
|
+
display: inline-flex;
|
|
1060
|
+
gap: 5px;
|
|
664
1061
|
align-items: center;
|
|
1062
|
+
margin-left: 6px;
|
|
665
1063
|
}
|
|
666
1064
|
.ys-calendar__legend-today::before {
|
|
667
1065
|
display: inline-block;
|
|
@@ -672,7 +1070,7 @@ function goToday() {
|
|
|
672
1070
|
content: "";
|
|
673
1071
|
}
|
|
674
1072
|
|
|
675
|
-
/*
|
|
1073
|
+
/* 迷你模式:只有日期、底色、休、班角标和事件圆点,悬停看完整信息 */
|
|
676
1074
|
.ys-calendar.is-small .ys-calendar__weekday {
|
|
677
1075
|
padding: 4px 0;
|
|
678
1076
|
text-align: center;
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,11 @@ export { default as YsCrudTable } from "./components/YsCrudTable.vue";
|
|
|
4
4
|
export { default as YsTableToolbar } from "./components/YsTableToolbar.vue";
|
|
5
5
|
export { default as YsStatusFilter } from "./components/YsStatusFilter.vue";
|
|
6
6
|
export { default as YsCalendar } from "./components/YsCalendar.vue";
|
|
7
|
-
export type {
|
|
7
|
+
export type {
|
|
8
|
+
YsCalendarEvent,
|
|
9
|
+
YsCalendarLabels,
|
|
10
|
+
YsCalendarStatus,
|
|
11
|
+
} from "./components/YsCalendar.vue";
|
|
8
12
|
export { default as YsTablePagination } from "./components/YsTablePagination.vue";
|
|
9
13
|
export { default as YsRowActionMenu } from "./components/YsRowActionMenu.vue";
|
|
10
14
|
export type { YsRowAction } from "./components/YsRowActionMenu.vue";
|