Skip to content

Commit 2576fc2

Browse files
authored
Merge pull request #20492 from apache/feat/calendar-label-silent
feat(calendar): add `silent` option for `dayLabel`/`monthLabel`/`yearLabel`
2 parents 23efa66 + 61f2e84 commit 2576fc2

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

src/component/calendar/CalendarView.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ class CalendarView extends ComponentView {
337337
z2: 30,
338338
style: createTextStyle(yearLabel, {
339339
text: content
340-
})
340+
}),
341+
silent: yearLabel.get('silent')
341342
});
342343
yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));
343344

@@ -422,6 +423,8 @@ class CalendarView extends ComponentView {
422423
margin = pos === 'start' ? -margin : margin;
423424
const isCenter = (align === 'center');
424425

426+
const labelSilent = monthLabel.get('silent');
427+
425428
for (let i = 0; i < termPoints[idx].length - 1; i++) {
426429

427430
const tmp = termPoints[idx][i].slice();
@@ -449,7 +452,8 @@ class CalendarView extends ComponentView {
449452
style: extend(
450453
createTextStyle(monthLabel, {text: content}),
451454
this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)
452-
)
455+
),
456+
silent: labelSilent
453457
});
454458

455459
group.add(monthText);
@@ -533,6 +537,8 @@ class CalendarView extends ComponentView {
533537
margin = -margin;
534538
}
535539

540+
const labelSilent = dayLabel.get('silent');
541+
536542
for (let i = 0; i < 7; i++) {
537543

538544
const tmpD = coordSys.getNextNDay(start, i);
@@ -544,7 +550,8 @@ class CalendarView extends ComponentView {
544550
style: extend(
545551
createTextStyle(dayLabel, {text: nameMap[day]}),
546552
this._weekTextPositionControl(point, orient, pos, margin, cellSize)
547-
)
553+
),
554+
silent: labelSilent
548555
});
549556

550557
group.add(weekText);

test/calendar-simple.html

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)