@nutui/nutui-react-taro 3.0.19-cpp.27 → 3.0.19-cpp.28-beta.1

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.
@@ -44,6 +44,7 @@ export interface BaseLang {
44
44
  today: string;
45
45
  loadPreviousMonth: string;
46
46
  noEarlierMonth: string;
47
+ dayAriaLabel?: Function;
47
48
  };
48
49
  shortpassword: {
49
50
  title: string;
@@ -63,7 +63,18 @@ var enUS = {
63
63
  },
64
64
  today: 'Today',
65
65
  loadPreviousMonth: 'Load Previous Month',
66
- noEarlierMonth: 'No Earlier Month'
66
+ noEarlierMonth: 'No Earlier Month',
67
+ dayAriaLabel: function dayAriaLabel(year, month, day, today, isActive, isDisable) {
68
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
69
+ var label = today ? "Today, ".concat(dateStr) : dateStr;
70
+ if (isActive) {
71
+ label = "Selected ".concat(label);
72
+ }
73
+ if (isDisable) {
74
+ label = "".concat(label, " disabled");
75
+ }
76
+ return label;
77
+ }
67
78
  },
68
79
  shortpassword: {
69
80
  title: 'Please input a password',
@@ -63,7 +63,18 @@ var idID = {
63
63
  },
64
64
  today: 'Hari ini',
65
65
  loadPreviousMonth: 'Muat Bulan Sebelumnya',
66
- noEarlierMonth: 'Tidak Ada Bulan Sebelumnya'
66
+ noEarlierMonth: 'Tidak Ada Bulan Sebelumnya',
67
+ dayAriaLabel: function dayAriaLabel(year, month, day, today, isActive, isDisable) {
68
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
69
+ var label = today ? "Hari ini, ".concat(dateStr) : dateStr;
70
+ if (isActive) {
71
+ label = "Dipilih ".concat(label);
72
+ }
73
+ if (isDisable) {
74
+ label = "".concat(label, " dinonaktifkan");
75
+ }
76
+ return label;
77
+ }
67
78
  },
68
79
  shortpassword: {
69
80
  title: 'SIlakan masukan kata sandi',
@@ -63,7 +63,16 @@ var jaJP = {
63
63
  },
64
64
  today: '今日',
65
65
  loadPreviousMonth: '前の月を読み込む',
66
- noEarlierMonth: 'これより前の月はありません'
66
+ noEarlierMonth: 'これより前の月はありません',
67
+ dayAriaLabel: function dayAriaLabel(year, month, day, today, isActive, isDisable) {
68
+ if (isActive) {
69
+ return today ? "今日".concat(month, "月").concat(day, "日を選択しました") : "".concat(month, "月").concat(day, "日を選択しました");
70
+ }
71
+ if (isDisable) {
72
+ return today ? "今日".concat(month, "月").concat(day, "日は無効です") : "".concat(month, "月").concat(day, "日は無効です");
73
+ }
74
+ return today ? "今日".concat(month, "月").concat(day, "日") : "".concat(month, "月").concat(day, "日");
75
+ }
67
76
  },
68
77
  shortpassword: {
69
78
  title: 'パスワードを入力してください',
@@ -63,7 +63,18 @@ var trTR = {
63
63
  },
64
64
  today: 'Bugün',
65
65
  loadPreviousMonth: 'Önceki ayı yükle',
66
- noEarlierMonth: 'Önceki ay yok'
66
+ noEarlierMonth: 'Önceki ay yok',
67
+ dayAriaLabel: function dayAriaLabel(year, month, day, today, isActive, isDisable) {
68
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
69
+ var label = today ? "Bug\xfcn, ".concat(dateStr) : dateStr;
70
+ if (isActive) {
71
+ label = "Se\xe7ili ".concat(label);
72
+ }
73
+ if (isDisable) {
74
+ label = "".concat(label, " devre dışı");
75
+ }
76
+ return label;
77
+ }
67
78
  },
68
79
  shortpassword: {
69
80
  title: 'Lütfen şifrenizi girin',
@@ -63,7 +63,16 @@ var zhCN = {
63
63
  },
64
64
  today: '今天',
65
65
  loadPreviousMonth: '加载上一个月',
66
- noEarlierMonth: '没有更早月份'
66
+ noEarlierMonth: '没有更早月份',
67
+ dayAriaLabel: function dayAriaLabel(year, month, day, today, isActive, isDisable) {
68
+ if (isActive) {
69
+ return today ? "已选定今日".concat(month, "月").concat(day, "号") : "已选定".concat(month, "月").concat(day, "号");
70
+ }
71
+ if (isDisable) {
72
+ return today ? "".concat(month, "月").concat(day, "号今日按钮变暗") : "".concat(month, "月").concat(day, "号按钮变暗");
73
+ }
74
+ return today ? "".concat(month, "月").concat(day, "号今日") : "".concat(month, "月").concat(day, "号");
75
+ }
67
76
  },
68
77
  shortpassword: {
69
78
  title: '请输入密码',
@@ -63,7 +63,16 @@ var zhCN = {
63
63
  },
64
64
  today: '今天',
65
65
  loadPreviousMonth: '加載上一個月',
66
- noEarlierMonth: '沒有更早月份'
66
+ noEarlierMonth: '沒有更早月份',
67
+ dayAriaLabel: function dayAriaLabel(year, month, day, today, isActive, isDisable) {
68
+ if (isActive) {
69
+ return today ? "已選定今日".concat(month, "月").concat(day, "號") : "已選定".concat(month, "月").concat(day, "號");
70
+ }
71
+ if (isDisable) {
72
+ return today ? "".concat(month, "月").concat(day, "號今日按鈕變暗") : "".concat(month, "月").concat(day, "號按鈕變暗");
73
+ }
74
+ return today ? "".concat(month, "月").concat(day, "號今日") : "".concat(month, "月").concat(day, "號");
75
+ }
67
76
  },
68
77
  shortpassword: {
69
78
  title: '請輸入密碼',
@@ -63,7 +63,18 @@ var zhUG = {
63
63
  },
64
64
  today: 'بۈگۈن',
65
65
  loadPreviousMonth: 'ئالدىنقى ئاي',
66
- noEarlierMonth: 'تۈگىدى'
66
+ noEarlierMonth: 'تۈگىدى',
67
+ dayAriaLabel: function dayAriaLabel(year, month, day, today, isActive, isDisable) {
68
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
69
+ var label = today ? "بۈگۈن, ".concat(dateStr) : dateStr;
70
+ if (isActive) {
71
+ label = "تاللانغان ".concat(label);
72
+ }
73
+ if (isDisable) {
74
+ label = "".concat(label, " چەكلەنگەن");
75
+ }
76
+ return label;
77
+ }
67
78
  },
68
79
  shortpassword: {
69
80
  title: 'مەخپى نومۇرنى كىرگۈزۈڭ',
@@ -24,12 +24,13 @@ var _index = require("../configprovider/index");
24
24
  var _usepropsvalue = require("../../hooks/use-props-value");
25
25
  var defaultProps = (0, _object_spread_props._)((0, _object_spread._)({}, _typings.ComponentDefaults), {
26
26
  type: 'single',
27
- firstDayOfWeek: 0
27
+ firstDayOfWeek: 0,
28
+ weekdays: []
28
29
  });
29
30
  var prefixCls = 'nut-calendarcard';
30
31
  var CalendarCard = /*#__PURE__*/ _react.default.forwardRef(function(props, ref) {
31
32
  var locale = (0, _index.useConfig)().locale;
32
- var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), style = _$_object_spread.style, className = _$_object_spread.className, type = _$_object_spread.type, title = _$_object_spread.title, value = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, firstDayOfWeek = _$_object_spread.firstDayOfWeek, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, disableDay = _$_object_spread.disableDay, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange, onChange = _$_object_spread.onChange;
33
+ var _$_object_spread = (0, _object_spread._)({}, defaultProps, props), style = _$_object_spread.style, className = _$_object_spread.className, type = _$_object_spread.type, title = _$_object_spread.title, value = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, firstDayOfWeek = _$_object_spread.firstDayOfWeek, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, disableDay = _$_object_spread.disableDay, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, renderDayAriaLabel = _$_object_spread.renderDayAriaLabel, weekdays = _$_object_spread.weekdays, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange, onChange = _$_object_spread.onChange;
33
34
  var onPageChangeRef = (0, _react.useRef)(onPageChange);
34
35
  // 当前月份信息
35
36
  var _useState = (0, _sliced_to_array._)((0, _react.useState)(function() {
@@ -179,6 +180,19 @@ var CalendarCard = /*#__PURE__*/ _react.default.forwardRef(function(props, ref)
179
180
  var d = new Date(day.year, day.month - 1, day.date).getDay();
180
181
  return d === 0 || d === 6;
181
182
  };
183
+ var isToday = function isToday(day) {
184
+ var today = new Date();
185
+ return day.year === today.getFullYear() && day.month === today.getMonth() + 1 && day.date === today.getDate();
186
+ };
187
+ // 日期无障碍朗读
188
+ var getAriaLabel = function getAriaLabel(day) {
189
+ var _locale_calendaritem_dayAriaLabel, _locale_calendaritem;
190
+ if (renderDayAriaLabel) {
191
+ return renderDayAriaLabel(day);
192
+ }
193
+ var today = isToday(day);
194
+ return (_locale_calendaritem_dayAriaLabel = (_locale_calendaritem = locale.calendaritem).dayAriaLabel) === null || _locale_calendaritem_dayAriaLabel === void 0 ? void 0 : _locale_calendaritem_dayAriaLabel.call(_locale_calendaritem, day.year, day.month, day.date, today, isActive(day), isDisable(day));
195
+ };
182
196
  var getClasses = function getClasses(day) {
183
197
  /**
184
198
  * active: single、multiple 激活日期
@@ -363,15 +377,20 @@ var CalendarCard = /*#__PURE__*/ _react.default.forwardRef(function(props, ref)
363
377
  }
364
378
  }, /*#__PURE__*/ _react.default.createElement(_icon.DoubleRight, null))));
365
379
  };
366
- var _useState2 = (0, _sliced_to_array._)((0, _react.useState)(function() {
367
- var weekdays = locale.calendaritem.weekdays.map(function(day, index) {
380
+ var weekHeader = (0, _react.useMemo)(function() {
381
+ var weekdaysList = weekdays.length > 0 ? weekdays : locale.calendaritem.weekdays;
382
+ var weekdaysData = weekdaysList.map(function(day, index) {
368
383
  return {
369
384
  name: day,
370
385
  key: index
371
386
  };
372
387
  });
373
- return (0, _to_consumable_array._)(weekdays.slice(firstDayOfWeek, 7)).concat((0, _to_consumable_array._)(weekdays.slice(0, firstDayOfWeek)));
374
- }), 1), weekHeader = _useState2[0];
388
+ return (0, _to_consumable_array._)(weekdaysData.slice(firstDayOfWeek, 7)).concat((0, _to_consumable_array._)(weekdaysData.slice(0, firstDayOfWeek)));
389
+ }, [
390
+ weekdays,
391
+ firstDayOfWeek,
392
+ locale.calendaritem.weekdays
393
+ ]);
375
394
  var renderContent = function renderContent() {
376
395
  return /*#__PURE__*/ _react.default.createElement(_components.View, {
377
396
  className: "".concat(prefixCls, "-content")
@@ -392,11 +411,14 @@ var CalendarCard = /*#__PURE__*/ _react.default.forwardRef(function(props, ref)
392
411
  key: "".concat(day.year, "-").concat(day.month, "-").concat(day.date),
393
412
  onClick: function onClick() {
394
413
  return handleDayClick(day);
395
- }
414
+ },
415
+ ariaLabel: getAriaLabel(day),
416
+ ariaRole: "button"
396
417
  }, /*#__PURE__*/ _react.default.createElement(_components.View, {
397
418
  className: "".concat(prefixCls, "-day-top")
398
419
  }, renderDayTop ? renderDayTop(day) : ''), /*#__PURE__*/ _react.default.createElement(_components.View, {
399
- className: "".concat(prefixCls, "-day-inner")
420
+ className: "".concat(prefixCls, "-day-inner"),
421
+ ariaHidden: true
400
422
  }, renderDay ? renderDay(day) : day.date), /*#__PURE__*/ _react.default.createElement(_components.View, {
401
423
  className: "".concat(prefixCls, "-day-bottom")
402
424
  }, renderDayBottom ? renderDayBottom(day) : ''));
@@ -23,10 +23,12 @@ export interface BaseCalendarCard extends BaseProps {
23
23
  firstDayOfWeek: number;
24
24
  startDate: Date;
25
25
  endDate: Date;
26
+ weekdays?: string[];
26
27
  disableDay: (day: CalendarCardDay) => boolean;
27
28
  renderDay: (day: CalendarCardDay) => ReactNode;
28
29
  renderDayTop: (day: CalendarCardDay) => ReactNode;
29
30
  renderDayBottom: (day: CalendarCardDay) => ReactNode;
31
+ renderDayAriaLabel?: (day: CalendarCardDay) => string;
30
32
  onDayClick: (day: CalendarCardDay) => void;
31
33
  onPageChange: (data: CalendarCardMonth) => void;
32
34
  onChange: (value: CalendarCardValue) => void;
@@ -44,6 +44,7 @@ export interface BaseLang {
44
44
  today: string;
45
45
  loadPreviousMonth: string;
46
46
  noEarlierMonth: string;
47
+ dayAriaLabel?: Function;
47
48
  };
48
49
  shortpassword: {
49
50
  title: string;
@@ -53,7 +53,18 @@ var enUS = {
53
53
  },
54
54
  today: 'Today',
55
55
  loadPreviousMonth: 'Load Previous Month',
56
- noEarlierMonth: 'No Earlier Month'
56
+ noEarlierMonth: 'No Earlier Month',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
59
+ var label = today ? "Today, ".concat(dateStr) : dateStr;
60
+ if (isActive) {
61
+ label = "Selected ".concat(label);
62
+ }
63
+ if (isDisable) {
64
+ label = "".concat(label, " disabled");
65
+ }
66
+ return label;
67
+ }
57
68
  },
58
69
  shortpassword: {
59
70
  title: 'Please input a password',
@@ -53,7 +53,18 @@ var idID = {
53
53
  },
54
54
  today: 'Hari ini',
55
55
  loadPreviousMonth: 'Muat Bulan Sebelumnya',
56
- noEarlierMonth: 'Tidak Ada Bulan Sebelumnya'
56
+ noEarlierMonth: 'Tidak Ada Bulan Sebelumnya',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
59
+ var label = today ? "Hari ini, ".concat(dateStr) : dateStr;
60
+ if (isActive) {
61
+ label = "Dipilih ".concat(label);
62
+ }
63
+ if (isDisable) {
64
+ label = "".concat(label, " dinonaktifkan");
65
+ }
66
+ return label;
67
+ }
57
68
  },
58
69
  shortpassword: {
59
70
  title: 'SIlakan masukan kata sandi',
@@ -53,7 +53,16 @@ var jaJP = {
53
53
  },
54
54
  today: '今日',
55
55
  loadPreviousMonth: '前の月を読み込む',
56
- noEarlierMonth: 'これより前の月はありません'
56
+ noEarlierMonth: 'これより前の月はありません',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ if (isActive) {
59
+ return today ? "今日".concat(month, "月").concat(day, "日を選択しました") : "".concat(month, "月").concat(day, "日を選択しました");
60
+ }
61
+ if (isDisable) {
62
+ return today ? "今日".concat(month, "月").concat(day, "日は無効です") : "".concat(month, "月").concat(day, "日は無効です");
63
+ }
64
+ return today ? "今日".concat(month, "月").concat(day, "日") : "".concat(month, "月").concat(day, "日");
65
+ }
57
66
  },
58
67
  shortpassword: {
59
68
  title: 'パスワードを入力してください',
@@ -53,7 +53,18 @@ var trTR = {
53
53
  },
54
54
  today: 'Bugün',
55
55
  loadPreviousMonth: 'Önceki ayı yükle',
56
- noEarlierMonth: 'Önceki ay yok'
56
+ noEarlierMonth: 'Önceki ay yok',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
59
+ var label = today ? "Bug\xfcn, ".concat(dateStr) : dateStr;
60
+ if (isActive) {
61
+ label = "Se\xe7ili ".concat(label);
62
+ }
63
+ if (isDisable) {
64
+ label = "".concat(label, " devre dışı");
65
+ }
66
+ return label;
67
+ }
57
68
  },
58
69
  shortpassword: {
59
70
  title: 'Lütfen şifrenizi girin',
@@ -53,7 +53,16 @@ var zhCN = {
53
53
  },
54
54
  today: '今天',
55
55
  loadPreviousMonth: '加载上一个月',
56
- noEarlierMonth: '没有更早月份'
56
+ noEarlierMonth: '没有更早月份',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ if (isActive) {
59
+ return today ? "已选定今日".concat(month, "月").concat(day, "号") : "已选定".concat(month, "月").concat(day, "号");
60
+ }
61
+ if (isDisable) {
62
+ return today ? "".concat(month, "月").concat(day, "号今日按钮变暗") : "".concat(month, "月").concat(day, "号按钮变暗");
63
+ }
64
+ return today ? "".concat(month, "月").concat(day, "号今日") : "".concat(month, "月").concat(day, "号");
65
+ }
57
66
  },
58
67
  shortpassword: {
59
68
  title: '请输入密码',
@@ -53,7 +53,16 @@ var zhCN = {
53
53
  },
54
54
  today: '今天',
55
55
  loadPreviousMonth: '加載上一個月',
56
- noEarlierMonth: '沒有更早月份'
56
+ noEarlierMonth: '沒有更早月份',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ if (isActive) {
59
+ return today ? "已選定今日".concat(month, "月").concat(day, "號") : "已選定".concat(month, "月").concat(day, "號");
60
+ }
61
+ if (isDisable) {
62
+ return today ? "".concat(month, "月").concat(day, "號今日按鈕變暗") : "".concat(month, "月").concat(day, "號按鈕變暗");
63
+ }
64
+ return today ? "".concat(month, "月").concat(day, "號今日") : "".concat(month, "月").concat(day, "號");
65
+ }
57
66
  },
58
67
  shortpassword: {
59
68
  title: '請輸入密碼',
@@ -53,7 +53,18 @@ var zhUG = {
53
53
  },
54
54
  today: 'بۈگۈن',
55
55
  loadPreviousMonth: 'ئالدىنقى ئاي',
56
- noEarlierMonth: 'تۈگىدى'
56
+ noEarlierMonth: 'تۈگىدى',
57
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
58
+ var dateStr = "".concat(year, "-").concat(month, "-").concat(day);
59
+ var label = today ? "بۈگۈن, ".concat(dateStr) : dateStr;
60
+ if (isActive) {
61
+ label = "تاللانغان ".concat(label);
62
+ }
63
+ if (isDisable) {
64
+ label = "".concat(label, " چەكلەنگەن");
65
+ }
66
+ return label;
67
+ }
57
68
  },
58
69
  shortpassword: {
59
70
  title: 'مەخپى نومۇرنى كىرگۈزۈڭ',
@@ -2,7 +2,7 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
2
2
  import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
3
3
  import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
4
4
  import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
5
- import React, { useCallback, useEffect, useState, useRef } from "react";
5
+ import React, { useCallback, useEffect, useState, useRef, useMemo } from "react";
6
6
  import classNames from "classnames";
7
7
  import { View } from "@tarojs/components";
8
8
  import { ArrowLeft, ArrowRight, DoubleLeft, DoubleRight } from "./icon";
@@ -12,12 +12,13 @@ import { useConfig } from "../configprovider/index";
12
12
  import { usePropsValue } from "../../hooks/use-props-value";
13
13
  var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
14
14
  type: 'single',
15
- firstDayOfWeek: 0
15
+ firstDayOfWeek: 0,
16
+ weekdays: []
16
17
  });
17
18
  var prefixCls = 'nut-calendarcard';
18
19
  export var CalendarCard = /*#__PURE__*/ React.forwardRef(function(props, ref) {
19
20
  var locale = useConfig().locale;
20
- var _$_object_spread = _object_spread({}, defaultProps, props), style = _$_object_spread.style, className = _$_object_spread.className, type = _$_object_spread.type, title = _$_object_spread.title, value = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, firstDayOfWeek = _$_object_spread.firstDayOfWeek, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, disableDay = _$_object_spread.disableDay, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange, onChange = _$_object_spread.onChange;
21
+ var _$_object_spread = _object_spread({}, defaultProps, props), style = _$_object_spread.style, className = _$_object_spread.className, type = _$_object_spread.type, title = _$_object_spread.title, value = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, firstDayOfWeek = _$_object_spread.firstDayOfWeek, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, disableDay = _$_object_spread.disableDay, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, renderDayAriaLabel = _$_object_spread.renderDayAriaLabel, weekdays = _$_object_spread.weekdays, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange, onChange = _$_object_spread.onChange;
21
22
  var onPageChangeRef = useRef(onPageChange);
22
23
  // 当前月份信息
23
24
  var _useState = _sliced_to_array(useState(function() {
@@ -167,6 +168,19 @@ export var CalendarCard = /*#__PURE__*/ React.forwardRef(function(props, ref) {
167
168
  var d = new Date(day.year, day.month - 1, day.date).getDay();
168
169
  return d === 0 || d === 6;
169
170
  };
171
+ var isToday = function(day) {
172
+ var today = new Date();
173
+ return day.year === today.getFullYear() && day.month === today.getMonth() + 1 && day.date === today.getDate();
174
+ };
175
+ // 日期无障碍朗读
176
+ var getAriaLabel = function(day) {
177
+ var _locale_calendaritem_dayAriaLabel, _locale_calendaritem;
178
+ if (renderDayAriaLabel) {
179
+ return renderDayAriaLabel(day);
180
+ }
181
+ var today = isToday(day);
182
+ return (_locale_calendaritem_dayAriaLabel = (_locale_calendaritem = locale.calendaritem).dayAriaLabel) === null || _locale_calendaritem_dayAriaLabel === void 0 ? void 0 : _locale_calendaritem_dayAriaLabel.call(_locale_calendaritem, day.year, day.month, day.date, today, isActive(day), isDisable(day));
183
+ };
170
184
  var getClasses = function(day) {
171
185
  /**
172
186
  * active: single、multiple 激活日期
@@ -351,15 +365,20 @@ export var CalendarCard = /*#__PURE__*/ React.forwardRef(function(props, ref) {
351
365
  }
352
366
  }, /*#__PURE__*/ React.createElement(DoubleRight, null))));
353
367
  };
354
- var _useState2 = _sliced_to_array(useState(function() {
355
- var weekdays = locale.calendaritem.weekdays.map(function(day, index) {
368
+ var weekHeader = useMemo(function() {
369
+ var weekdaysList = weekdays.length > 0 ? weekdays : locale.calendaritem.weekdays;
370
+ var weekdaysData = weekdaysList.map(function(day, index) {
356
371
  return {
357
372
  name: day,
358
373
  key: index
359
374
  };
360
375
  });
361
- return _to_consumable_array(weekdays.slice(firstDayOfWeek, 7)).concat(_to_consumable_array(weekdays.slice(0, firstDayOfWeek)));
362
- }), 1), weekHeader = _useState2[0];
376
+ return _to_consumable_array(weekdaysData.slice(firstDayOfWeek, 7)).concat(_to_consumable_array(weekdaysData.slice(0, firstDayOfWeek)));
377
+ }, [
378
+ weekdays,
379
+ firstDayOfWeek,
380
+ locale.calendaritem.weekdays
381
+ ]);
363
382
  var renderContent = function() {
364
383
  return /*#__PURE__*/ React.createElement(View, {
365
384
  className: "".concat(prefixCls, "-content")
@@ -380,11 +399,14 @@ export var CalendarCard = /*#__PURE__*/ React.forwardRef(function(props, ref) {
380
399
  key: "".concat(day.year, "-").concat(day.month, "-").concat(day.date),
381
400
  onClick: function() {
382
401
  return handleDayClick(day);
383
- }
402
+ },
403
+ ariaLabel: getAriaLabel(day),
404
+ ariaRole: "button"
384
405
  }, /*#__PURE__*/ React.createElement(View, {
385
406
  className: "".concat(prefixCls, "-day-top")
386
407
  }, renderDayTop ? renderDayTop(day) : ''), /*#__PURE__*/ React.createElement(View, {
387
- className: "".concat(prefixCls, "-day-inner")
408
+ className: "".concat(prefixCls, "-day-inner"),
409
+ ariaHidden: true
388
410
  }, renderDay ? renderDay(day) : day.date), /*#__PURE__*/ React.createElement(View, {
389
411
  className: "".concat(prefixCls, "-day-bottom")
390
412
  }, renderDayBottom ? renderDayBottom(day) : ''));
@@ -44,6 +44,7 @@ export interface BaseCalendarCard extends BaseProps {
44
44
  * 限制范围结束日期
45
45
  */
46
46
  endDate: Date
47
+ weekdays?: string[];
47
48
  /**
48
49
  * 设置不可选日期
49
50
  */
@@ -60,6 +61,7 @@ export interface BaseCalendarCard extends BaseProps {
60
61
  * 日期底部信息
61
62
  */
62
63
  renderDayBottom: (day: CalendarCardDay) => ReactNode
64
+ renderDayAriaLabel?: (day: CalendarCardDay) => string;
63
65
  /**
64
66
  * 点击后触发
65
67
  */
@@ -1975,7 +1975,16 @@
1975
1975
  },
1976
1976
  today: "今天",
1977
1977
  loadPreviousMonth: "加载上一个月",
1978
- noEarlierMonth: "没有更早月份"
1978
+ noEarlierMonth: "没有更早月份",
1979
+ dayAriaLabel: function(year, month, day, today, isActive, isDisable) {
1980
+ if (isActive) {
1981
+ return today ? "已选定今日".concat(month, "月").concat(day, "号") : "已选定".concat(month, "月").concat(day, "号");
1982
+ }
1983
+ if (isDisable) {
1984
+ return today ? "".concat(month, "月").concat(day, "号今日按钮变暗") : "".concat(month, "月").concat(day, "号按钮变暗");
1985
+ }
1986
+ return today ? "".concat(month, "月").concat(day, "号今日") : "".concat(month, "月").concat(day, "号");
1987
+ }
1979
1988
  },
1980
1989
  shortpassword: {
1981
1990
  title: "请输入密码",
@@ -7685,12 +7694,13 @@
7685
7694
  };
7686
7695
  var defaultProps$16 = _object_spread_props(_object_spread({}, ComponentDefaults), {
7687
7696
  type: "single",
7688
- firstDayOfWeek: 0
7697
+ firstDayOfWeek: 0,
7698
+ weekdays: []
7689
7699
  });
7690
7700
  var prefixCls = "nut-calendarcard";
7691
7701
  var CalendarCard = /* @__PURE__ */ React.forwardRef(function(props, ref) {
7692
7702
  var locale = useConfig().locale;
7693
- var _$_object_spread = _object_spread({}, defaultProps$16, props), style = _$_object_spread.style, className = _$_object_spread.className, type2 = _$_object_spread.type, title = _$_object_spread.title, value2 = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, firstDayOfWeek = _$_object_spread.firstDayOfWeek, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, disableDay = _$_object_spread.disableDay, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange, onChange = _$_object_spread.onChange;
7703
+ var _$_object_spread = _object_spread({}, defaultProps$16, props), style = _$_object_spread.style, className = _$_object_spread.className, type2 = _$_object_spread.type, title = _$_object_spread.title, value2 = _$_object_spread.value, defaultValue = _$_object_spread.defaultValue, firstDayOfWeek = _$_object_spread.firstDayOfWeek, startDate = _$_object_spread.startDate, endDate = _$_object_spread.endDate, disableDay = _$_object_spread.disableDay, renderDay = _$_object_spread.renderDay, renderDayTop = _$_object_spread.renderDayTop, renderDayBottom = _$_object_spread.renderDayBottom, renderDayAriaLabel = _$_object_spread.renderDayAriaLabel, weekdays = _$_object_spread.weekdays, onDayClick = _$_object_spread.onDayClick, onPageChange = _$_object_spread.onPageChange, onChange = _$_object_spread.onChange;
7694
7704
  var onPageChangeRef = React.useRef(onPageChange);
7695
7705
  var _useState = _sliced_to_array(React.useState(function() {
7696
7706
  var date2 = new Date(Date.now());
@@ -7837,6 +7847,18 @@
7837
7847
  var d = new Date(day.year, day.month - 1, day.date).getDay();
7838
7848
  return d === 0 || d === 6;
7839
7849
  };
7850
+ var isToday = function(day) {
7851
+ var today = /* @__PURE__ */ new Date();
7852
+ return day.year === today.getFullYear() && day.month === today.getMonth() + 1 && day.date === today.getDate();
7853
+ };
7854
+ var getAriaLabel = function(day) {
7855
+ var _locale_calendaritem_dayAriaLabel, _locale_calendaritem;
7856
+ if (renderDayAriaLabel) {
7857
+ return renderDayAriaLabel(day);
7858
+ }
7859
+ var today = isToday(day);
7860
+ return (_locale_calendaritem_dayAriaLabel = (_locale_calendaritem = locale.calendaritem).dayAriaLabel) === null || _locale_calendaritem_dayAriaLabel === void 0 ? void 0 : _locale_calendaritem_dayAriaLabel.call(_locale_calendaritem, day.year, day.month, day.date, today, isActive(day), isDisable(day));
7861
+ };
7840
7862
  var getClasses = function(day) {
7841
7863
  if (isDisable(day)) {
7842
7864
  return [
@@ -8011,15 +8033,20 @@
8011
8033
  }
8012
8034
  }, /* @__PURE__ */ React.createElement(DoubleRight, null))));
8013
8035
  };
8014
- var _useState2 = _sliced_to_array(React.useState(function() {
8015
- var weekdays = locale.calendaritem.weekdays.map(function(day, index2) {
8036
+ var weekHeader = React.useMemo(function() {
8037
+ var weekdaysList = weekdays.length > 0 ? weekdays : locale.calendaritem.weekdays;
8038
+ var weekdaysData = weekdaysList.map(function(day, index2) {
8016
8039
  return {
8017
8040
  name: day,
8018
8041
  key: index2
8019
8042
  };
8020
8043
  });
8021
- return _to_consumable_array(weekdays.slice(firstDayOfWeek, 7)).concat(_to_consumable_array(weekdays.slice(0, firstDayOfWeek)));
8022
- }), 1), weekHeader = _useState2[0];
8044
+ return _to_consumable_array(weekdaysData.slice(firstDayOfWeek, 7)).concat(_to_consumable_array(weekdaysData.slice(0, firstDayOfWeek)));
8045
+ }, [
8046
+ weekdays,
8047
+ firstDayOfWeek,
8048
+ locale.calendaritem.weekdays
8049
+ ]);
8023
8050
  var renderContent = function() {
8024
8051
  return /* @__PURE__ */ React.createElement(components.View, {
8025
8052
  className: "".concat(prefixCls, "-content")
@@ -8040,11 +8067,14 @@
8040
8067
  key: "".concat(day.year, "-").concat(day.month, "-").concat(day.date),
8041
8068
  onClick: function() {
8042
8069
  return handleDayClick(day);
8043
- }
8070
+ },
8071
+ ariaLabel: getAriaLabel(day),
8072
+ ariaRole: "button"
8044
8073
  }, /* @__PURE__ */ React.createElement(components.View, {
8045
8074
  className: "".concat(prefixCls, "-day-top")
8046
8075
  }, renderDayTop ? renderDayTop(day) : ""), /* @__PURE__ */ React.createElement(components.View, {
8047
- className: "".concat(prefixCls, "-day-inner")
8076
+ className: "".concat(prefixCls, "-day-inner"),
8077
+ ariaHidden: true
8048
8078
  }, renderDay ? renderDay(day) : day.date), /* @__PURE__ */ React.createElement(components.View, {
8049
8079
  className: "".concat(prefixCls, "-day-bottom")
8050
8080
  }, renderDayBottom ? renderDayBottom(day) : ""));