@cloudscape-design/components 3.0.56 → 3.0.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/{date-picker/calendar → calendar}/grid/day/index.d.ts +1 -1
- package/calendar/grid/day/index.d.ts.map +1 -0
- package/{date-picker/calendar → calendar}/grid/day/index.js +1 -1
- package/calendar/grid/day/index.js.map +1 -0
- package/{date-picker/calendar → calendar}/grid/index.d.ts +2 -2
- package/calendar/grid/index.d.ts.map +1 -0
- package/{date-picker/calendar → calendar}/grid/index.js +2 -2
- package/calendar/grid/index.js.map +1 -0
- package/{date-picker/calendar → calendar}/header/button/index.d.ts +0 -0
- package/calendar/header/button/index.d.ts.map +1 -0
- package/{date-picker/calendar → calendar}/header/button/index.js +2 -2
- package/calendar/header/button/index.js.map +1 -0
- package/{date-picker/calendar → calendar}/header/index.d.ts +1 -2
- package/calendar/header/index.d.ts.map +1 -0
- package/{date-picker/calendar → calendar}/header/index.js +3 -3
- package/calendar/header/index.js.map +1 -0
- package/calendar/index.d.ts +4 -0
- package/calendar/index.d.ts.map +1 -0
- package/calendar/index.js +14 -0
- package/calendar/index.js.map +1 -0
- package/calendar/interfaces.d.ts +56 -0
- package/calendar/interfaces.d.ts.map +1 -0
- package/calendar/interfaces.js +4 -0
- package/calendar/interfaces.js.map +1 -0
- package/calendar/internal.d.ts +4 -0
- package/calendar/internal.d.ts.map +1 -0
- package/{date-picker/calendar/index.js → calendar/internal.js} +9 -13
- package/calendar/internal.js.map +1 -0
- package/calendar/styles.css.js +25 -0
- package/calendar/styles.scoped.css +291 -0
- package/calendar/styles.selectors.js +26 -0
- package/{date-picker/calendar → calendar}/utils/intl.d.ts +2 -2
- package/calendar/utils/intl.d.ts.map +1 -0
- package/{date-picker/calendar → calendar}/utils/intl.js +2 -0
- package/calendar/utils/intl.js.map +1 -0
- package/{date-picker/calendar → calendar}/utils/locales.d.ts +1 -1
- package/calendar/utils/locales.d.ts.map +1 -0
- package/{date-picker/calendar → calendar}/utils/locales.js +1 -1
- package/calendar/utils/locales.js.map +1 -0
- package/{date-picker/calendar → calendar}/utils/memoized-date.d.ts +0 -0
- package/calendar/utils/memoized-date.d.ts.map +1 -0
- package/{date-picker/calendar → calendar}/utils/memoized-date.js +1 -1
- package/calendar/utils/memoized-date.js.map +1 -0
- package/{date-picker/calendar → calendar}/utils/move-focus-handler.d.ts +1 -1
- package/calendar/utils/move-focus-handler.d.ts.map +1 -0
- package/{date-picker/calendar → calendar}/utils/move-focus-handler.js +0 -0
- package/calendar/utils/move-focus-handler.js.map +1 -0
- package/calendar/utils/rotate-day-indexes.d.ts +3 -0
- package/calendar/utils/rotate-day-indexes.d.ts.map +1 -0
- package/{date-picker/calendar → calendar}/utils/rotate-day-indexes.js +2 -0
- package/calendar/utils/rotate-day-indexes.js.map +1 -0
- package/date-picker/index.d.ts.map +1 -1
- package/date-picker/index.js +16 -10
- package/date-picker/index.js.map +1 -1
- package/date-picker/interfaces.d.ts +2 -44
- package/date-picker/interfaces.d.ts.map +1 -1
- package/date-picker/interfaces.js.map +1 -1
- package/date-picker/styles.css.js +7 -24
- package/date-picker/styles.scoped.css +21 -210
- package/date-picker/styles.selectors.js +7 -24
- package/date-range-picker/calendar/get-base-date.js +1 -1
- package/date-range-picker/calendar/get-base-date.js.map +1 -1
- package/date-range-picker/calendar/grids/day/index.js +1 -1
- package/date-range-picker/calendar/grids/day/index.js.map +1 -1
- package/date-range-picker/calendar/grids/grid.js +2 -2
- package/date-range-picker/calendar/grids/grid.js.map +1 -1
- package/date-range-picker/calendar/grids/index.d.ts +1 -1
- package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
- package/date-range-picker/calendar/grids/index.js.map +1 -1
- package/date-range-picker/calendar/header/index.js +1 -1
- package/date-range-picker/calendar/header/index.js.map +1 -1
- package/date-range-picker/calendar/index.js +3 -3
- package/date-range-picker/calendar/index.js.map +1 -1
- package/date-range-picker/index.js +1 -1
- package/date-range-picker/index.js.map +1 -1
- package/input/internal.js +1 -1
- package/input/internal.js.map +1 -1
- package/internal/environment.js +1 -1
- package/package.json +1 -1
- package/test-utils/dom/calendar/index.d.ts +16 -0
- package/test-utils/dom/calendar/index.js +53 -0
- package/test-utils/dom/calendar/index.js.map +1 -0
- package/test-utils/dom/date-picker/index.d.ts +2 -14
- package/test-utils/dom/date-picker/index.js +4 -33
- package/test-utils/dom/date-picker/index.js.map +1 -1
- package/test-utils/selectors/calendar/index.d.ts +16 -0
- package/test-utils/selectors/calendar/index.js +53 -0
- package/test-utils/selectors/calendar/index.js.map +1 -0
- package/test-utils/selectors/date-picker/index.d.ts +2 -14
- package/test-utils/selectors/date-picker/index.js +2 -31
- package/test-utils/selectors/date-picker/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/date-picker/calendar/grid/day/index.d.ts.map +0 -1
- package/date-picker/calendar/grid/day/index.js.map +0 -1
- package/date-picker/calendar/grid/index.d.ts.map +0 -1
- package/date-picker/calendar/grid/index.js.map +0 -1
- package/date-picker/calendar/header/button/index.d.ts.map +0 -1
- package/date-picker/calendar/header/button/index.js.map +0 -1
- package/date-picker/calendar/header/index.d.ts.map +0 -1
- package/date-picker/calendar/header/index.js.map +0 -1
- package/date-picker/calendar/index.d.ts +0 -17
- package/date-picker/calendar/index.d.ts.map +0 -1
- package/date-picker/calendar/index.js.map +0 -1
- package/date-picker/calendar/utils/intl.d.ts.map +0 -1
- package/date-picker/calendar/utils/intl.js.map +0 -1
- package/date-picker/calendar/utils/locales.d.ts.map +0 -1
- package/date-picker/calendar/utils/locales.js.map +0 -1
- package/date-picker/calendar/utils/memoized-date.d.ts.map +0 -1
- package/date-picker/calendar/utils/memoized-date.js.map +0 -1
- package/date-picker/calendar/utils/move-focus-handler.d.ts.map +0 -1
- package/date-picker/calendar/utils/move-focus-handler.js.map +0 -1
- package/date-picker/calendar/utils/rotate-day-indexes.d.ts +0 -3
- package/date-picker/calendar/utils/rotate-day-indexes.d.ts.map +0 -1
- package/date-picker/calendar/utils/rotate-day-indexes.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/calendar/grid/day/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKlE,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,IAAI,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,YAAY,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,eAAe,CAAC,qBAAqB,CAAC;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,QAAA,MAAM,OAAO,0HAUV,YAAY,gBAwCd,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { __assign } from "tslib";
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import styles from '
|
|
5
|
+
import styles from '../../styles.css.js';
|
|
6
6
|
import { isSameDay, isSameMonth } from 'date-fns';
|
|
7
7
|
import { getDateLabel } from '../../utils/intl';
|
|
8
8
|
import clsx from 'clsx';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/calendar/grid/day/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAA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,MAAM,CAAC;KAC7C;IAED,IAAI,eAAe,EAAE;QACnB,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;KAC7B;IAED,IAAI,SAAS,EAAE;QACb,kBAAkB,CAAC,OAAO,GAAG,cAAM,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB,CAAC;QACtD,kBAAkB,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;KAClC;SAAM;QACL,kBAAkB,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;KAC5C;IAED,IAAI,WAAW,IAAI,SAAS,EAAE;QAC5B,kBAAkB,CAAC,QAAQ,GAAG,CAAC,CAAC;KACjC;IAED,OAAO,CACL,sCAAK,SAAS,EAAE,UAAU,gBAAc,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAC,QAAQ,IAAK,kBAAkB;QAC7F,8BAAM,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,IAAG,IAAI,CAAC,OAAO,EAAE,CAAQ,CACzD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from '../../styles.css.js';\nimport { DatePickerProps } from '../../../date-picker/interfaces';\nimport { isSameDay, isSameMonth } from 'date-fns';\nimport { getDateLabel } from '../../utils/intl';\nimport clsx from 'clsx';\n\ninterface GridDayProps {\n locale: string;\n baseDate: Date;\n date: Date;\n selectedDate?: Date | null;\n focusedDate: Date | null;\n isDateEnabled?: DatePickerProps.IsDateEnabledFunction;\n todayAriaLabel: string;\n onSelectDate: (date: Date) => void;\n isDateInLastWeek: boolean;\n}\n\nconst GridDay = ({\n locale,\n baseDate,\n date,\n selectedDate,\n focusedDate,\n isDateEnabled,\n todayAriaLabel,\n onSelectDate,\n isDateInLastWeek,\n}: GridDayProps) => {\n const labels = [getDateLabel(locale, date)];\n const isFocusable = !!focusedDate && isSameDay(date, focusedDate);\n const isSelected = !!selectedDate && isSameDay(date, selectedDate);\n const isEnabled = !isDateEnabled || isDateEnabled(date);\n const isDateOnSameDay = isSameDay(date, new Date());\n const computedAttributes: React.HTMLAttributes<HTMLDivElement> = {};\n const classNames = clsx(styles['calendar-day'], {\n [styles['calendar-day-in-last-week']]: isDateInLastWeek,\n [styles['calendar-day-current-month']]: isSameMonth(date, baseDate),\n [styles['calendar-day-enabled']]: isEnabled,\n [styles['calendar-day-selected']]: isSelected,\n [styles['calendar-day-today']]: isDateOnSameDay,\n [styles['calendar-day-focusable']]: isFocusable && isEnabled,\n });\n\n if (isSelected) {\n computedAttributes['aria-current'] = 'date';\n }\n\n if (isDateOnSameDay) {\n labels.push(todayAriaLabel);\n }\n\n if (isEnabled) {\n computedAttributes.onClick = () => onSelectDate(date);\n computedAttributes.tabIndex = -1;\n } else {\n computedAttributes['aria-disabled'] = true;\n }\n\n if (isFocusable && isEnabled) {\n computedAttributes.tabIndex = 0;\n }\n\n return (\n <div className={classNames} aria-label={labels.join('. ')} role=\"button\" {...computedAttributes}>\n <span className={styles['day-inner']}>{date.getDate()}</span>\n </div>\n );\n};\n\nexport default GridDay;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DayIndex } from '../
|
|
1
|
+
import { DayIndex } from '../internal';
|
|
2
2
|
import { MoveFocusHandler } from '../utils/move-focus-handler';
|
|
3
|
-
import { DatePickerProps } from '../../interfaces';
|
|
3
|
+
import { DatePickerProps } from '../../date-picker/interfaces';
|
|
4
4
|
export interface GridProps {
|
|
5
5
|
locale: string;
|
|
6
6
|
baseDate: Date;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/calendar/grid/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAI/D,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,IAAI,CAAC;IACf,aAAa,EAAE,eAAe,CAAC,qBAAqB,CAAC;IACrD,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACpC,WAAW,EAAE,QAAQ,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,eAAe,EAAE,gBAAgB,CAAC;CACnC;AAED,QAAA,MAAM,IAAI,4JAYP,SAAS,gBAoFX,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
|
-
import styles from '
|
|
4
|
+
import styles from '../styles.css.js';
|
|
5
5
|
import GridDay from './day';
|
|
6
|
-
import { KeyCode } from '
|
|
6
|
+
import { KeyCode } from '../../internal/keycode';
|
|
7
7
|
import { addDays, addWeeks, isSameMonth } from 'date-fns';
|
|
8
8
|
import { getCalendarMonth } from 'mnth';
|
|
9
9
|
import rotateDayIndexes from '../utils/rotate-day-indexes';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/calendar/grid/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,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AAC,CAAC,CACrB,CACP,EAJuC,CAIvC,CAAC,CACE;QACN,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,SAAS,EAAE,oBAAoB,IACtE,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,SAAS;YACzB,IAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,SAAS,CAAC;YAExD,OAAO,CACL,6BAAK,GAAG,EAAE,eAAQ,SAAS,CAAE,EAAE,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,IAC9D,IAAI,CAAC,GAAG,CAAC,UAAC,IAAI,EAAE,SAAS;gBACxB,OAAO,CACL,oBAAC,OAAO,IACN,GAAG,EAAE,eAAQ,SAAS,cAAI,SAAS,CAAE,EACrC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,UAAA,IAAI,IAAI,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB,EACxC,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;YACJ,CAAC,CAAC,CACE,CACP,CAAC;QACJ,CAAC,CAAC,CACE,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\nimport styles from '../styles.css.js';\nimport GridDay from './day';\nimport { KeyCode } from '../../internal/keycode';\nimport { addDays, addWeeks, isSameMonth } from 'date-fns';\nimport { getCalendarMonth } from 'mnth';\nimport { DayIndex } from '../internal';\nimport { MoveFocusHandler } from '../utils/move-focus-handler';\nimport { DatePickerProps } from '../../date-picker/interfaces';\nimport rotateDayIndexes from '../utils/rotate-day-indexes';\nimport { renderDayName } from '../utils/intl';\n\nexport interface GridProps {\n locale: string;\n baseDate: Date;\n isDateEnabled: DatePickerProps.IsDateEnabledFunction;\n focusedDate: Date | null;\n onSelectDate: (date: Date) => void;\n onFocusDate: (date: null | Date) => void;\n onChangeMonth: (date: Date) => void;\n startOfWeek: DayIndex;\n todayAriaLabel: string;\n selectedDate: Date | null;\n handleFocusMove: MoveFocusHandler;\n}\n\nconst Grid = ({\n locale,\n baseDate,\n isDateEnabled,\n focusedDate,\n onSelectDate,\n onFocusDate,\n onChangeMonth,\n startOfWeek,\n todayAriaLabel,\n selectedDate,\n handleFocusMove,\n}: GridProps) => {\n const onGridKeyDownHandler = (event: React.KeyboardEvent) => {\n let updatedFocusDate;\n\n if (focusedDate === null) {\n return;\n }\n\n switch (event.keyCode) {\n case KeyCode.enter:\n event.preventDefault();\n if (focusedDate) {\n onFocusDate(null);\n onSelectDate(focusedDate);\n }\n return;\n case KeyCode.right:\n event.preventDefault();\n updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, date => addDays(date, 1));\n break;\n case KeyCode.left:\n event.preventDefault();\n updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, date => addDays(date, -1));\n break;\n case KeyCode.up:\n event.preventDefault();\n updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, date => addWeeks(date, -1));\n break;\n case KeyCode.down:\n event.preventDefault();\n updatedFocusDate = handleFocusMove(focusedDate, isDateEnabled, date => addWeeks(date, 1));\n break;\n default:\n return;\n }\n\n if (!isSameMonth(updatedFocusDate, baseDate)) {\n onChangeMonth(updatedFocusDate);\n }\n onFocusDate(updatedFocusDate);\n };\n\n const weeks = useMemo<Date[][]>(\n () => getCalendarMonth(baseDate, { firstDayOfWeek: startOfWeek }),\n [baseDate, startOfWeek]\n );\n\n return (\n <div>\n <div className={styles['calendar-day-names']}>\n {rotateDayIndexes(startOfWeek).map(i => (\n <div key={`day-name-${i}`} className={styles['calendar-day-name']}>\n {renderDayName(locale, i)}\n </div>\n ))}\n </div>\n <div className={styles['calendar-dates']} onKeyDown={onGridKeyDownHandler}>\n {weeks.map((week, weekIndex) => {\n const isDateInLastWeek = weeks.length - 1 === weekIndex;\n\n return (\n <div key={`week-${weekIndex}`} className={styles['calendar-week']}>\n {week.map((date, dateIndex) => {\n return (\n <GridDay\n key={`date-${weekIndex}-${dateIndex}`}\n locale={locale}\n baseDate={baseDate}\n selectedDate={selectedDate}\n date={date}\n focusedDate={focusedDate}\n todayAriaLabel={todayAriaLabel}\n onSelectDate={date => onSelectDate(date)}\n isDateEnabled={isDateEnabled}\n isDateInLastWeek={isDateInLastWeek}\n />\n );\n })}\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nexport default Grid;\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/calendar/header/button/index.tsx"],"names":[],"mappings":"AAQA,UAAU,iBAAiB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,QAAA,MAAM,YAAY,6CAA8C,iBAAiB,gBAoBhF,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { __assign } from "tslib";
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { InternalButton } from '
|
|
6
|
-
import styles from '
|
|
5
|
+
import { InternalButton } from '../../../button/internal';
|
|
6
|
+
import styles from '../../styles.css.js';
|
|
7
7
|
var HeaderButton = function (_a) {
|
|
8
8
|
var ariaLabel = _a.ariaLabel, isPrevious = _a.isPrevious, onChangeMonth = _a.onChangeMonth;
|
|
9
9
|
var iconName = isPrevious ? 'angle-left' : 'angle-right';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/calendar/header/button/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAQzC,IAAM,YAAY,GAAG,UAAC,EAA2D;QAAzD,SAAS,eAAA,EAAE,UAAU,gBAAA,EAAE,aAAa,mBAAA;IAC1D,IAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC;IAC3D,IAAM,oBAAoB,GAA4C;QACpE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC;KAC9F,CAAC;IAEF,IAAM,OAAO,GAAoD,UAAA,CAAC;QAChE,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,aAAa,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,cAAc,eACT,oBAAoB,IACxB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,IAChB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { CancelableEventHandler } from '../../../internal/events';\nimport { ButtonProps } from '../../../button/interfaces';\nimport { InternalButton } from '../../../button/internal';\nimport styles from '../../styles.css.js';\n\ninterface HeaderButtonProps {\n ariaLabel: string;\n isPrevious: boolean;\n onChangeMonth: (isPrevious: boolean) => void;\n}\n\nconst HeaderButton = ({ ariaLabel, isPrevious, onChangeMonth }: HeaderButtonProps) => {\n const iconName = isPrevious ? 'angle-left' : 'angle-right';\n const additionalAttributes: React.HTMLAttributes<HTMLButtonElement> = {\n className: isPrevious ? styles['calendar-prev-month-btn'] : styles['calendar-next-month-btn'],\n };\n\n const onClick: CancelableEventHandler<ButtonProps.ClickDetail> = e => {\n e.preventDefault();\n onChangeMonth(isPrevious);\n };\n\n return (\n <InternalButton\n {...additionalAttributes}\n iconName={iconName}\n ariaLabel={ariaLabel}\n variant={'icon'}\n onClick={onClick}\n />\n );\n};\n\nexport default HeaderButton;\n"]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
interface CalendarHeaderProps {
|
|
2
|
-
headerId: string;
|
|
3
2
|
baseDate: Date;
|
|
4
3
|
locale: string;
|
|
5
4
|
onChangeMonth: (prev?: boolean) => void;
|
|
6
5
|
previousMonthLabel: string;
|
|
7
6
|
nextMonthLabel: string;
|
|
8
7
|
}
|
|
9
|
-
declare const CalendarHeader: ({
|
|
8
|
+
declare const CalendarHeader: ({ baseDate, locale, onChangeMonth, previousMonthLabel, nextMonthLabel, }: CalendarHeaderProps) => JSX.Element;
|
|
10
9
|
export default CalendarHeader;
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/calendar/header/index.tsx"],"names":[],"mappings":"AAOA,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,IAAI,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,cAAc,6EAMjB,mBAAmB,gBAQrB,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import styles from '
|
|
4
|
+
import styles from '../styles.css.js';
|
|
5
5
|
import { renderMonthAndYear } from '../utils/intl';
|
|
6
6
|
import HeaderButton from './button';
|
|
7
7
|
var CalendarHeader = function (_a) {
|
|
8
|
-
var
|
|
8
|
+
var baseDate = _a.baseDate, locale = _a.locale, onChangeMonth = _a.onChangeMonth, previousMonthLabel = _a.previousMonthLabel, nextMonthLabel = _a.nextMonthLabel;
|
|
9
9
|
return (React.createElement("div", { className: styles['calendar-header'] },
|
|
10
10
|
React.createElement(HeaderButton, { ariaLabel: previousMonthLabel, isPrevious: true, onChangeMonth: onChangeMonth }),
|
|
11
|
-
React.createElement("div", { className: styles['calendar-header-month']
|
|
11
|
+
React.createElement("div", { className: styles['calendar-header-month'] }, renderMonthAndYear(locale, baseDate)),
|
|
12
12
|
React.createElement(HeaderButton, { ariaLabel: nextMonthLabel, isPrevious: false, onChangeMonth: onChangeMonth })));
|
|
13
13
|
};
|
|
14
14
|
export default CalendarHeader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/calendar/header/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,YAAY,MAAM,UAAU,CAAC;AAUpC,IAAM,cAAc,GAAG,UAAC,EAMF;QALpB,QAAQ,cAAA,EACR,MAAM,YAAA,EACN,aAAa,mBAAA,EACb,kBAAkB,wBAAA,EAClB,cAAc,oBAAA;IAEd,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC;QACvC,oBAAC,YAAY,IAAC,SAAS,EAAE,kBAAkB,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,aAAa,GAAI;QAC/F,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAO;QAC7F,oBAAC,YAAY,IAAC,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,GAAI,CACxF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from '../styles.css.js';\nimport { renderMonthAndYear } from '../utils/intl';\nimport HeaderButton from './button';\n\ninterface CalendarHeaderProps {\n baseDate: Date;\n locale: string;\n onChangeMonth: (prev?: boolean) => void;\n previousMonthLabel: string;\n nextMonthLabel: string;\n}\n\nconst CalendarHeader = ({\n baseDate,\n locale,\n onChangeMonth,\n previousMonthLabel,\n nextMonthLabel,\n}: CalendarHeaderProps) => {\n return (\n <div className={styles['calendar-header']}>\n <HeaderButton ariaLabel={previousMonthLabel} isPrevious={true} onChangeMonth={onChangeMonth} />\n <div className={styles['calendar-header-month']}>{renderMonthAndYear(locale, baseDate)}</div>\n <HeaderButton ariaLabel={nextMonthLabel} isPrevious={false} onChangeMonth={onChangeMonth} />\n </div>\n );\n};\n\nexport default CalendarHeader;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/calendar/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,MAAW,EAAE,aAA0B,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,eAGpG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { __assign, __rest } from "tslib";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
6
|
+
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
7
|
+
import InternalCalendar from './internal';
|
|
8
|
+
export default function Calendar(_a) {
|
|
9
|
+
var _b = _a.locale, locale = _b === void 0 ? '' : _b, _c = _a.isDateEnabled, isDateEnabled = _c === void 0 ? function () { return true; } : _c, props = __rest(_a, ["locale", "isDateEnabled"]);
|
|
10
|
+
var baseComponentProps = useBaseComponent('Calendar');
|
|
11
|
+
return React.createElement(InternalCalendar, __assign({}, props, baseComponentProps, { locale: locale, isDateEnabled: isDateEnabled }));
|
|
12
|
+
}
|
|
13
|
+
applyDisplayName(Calendar, 'Calendar');
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/calendar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAI1C,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAoE;IAAlE,IAAA,cAAW,EAAX,MAAM,mBAAG,EAAE,KAAA,EAAE,qBAA0B,EAA1B,aAAa,mBAAG,cAAM,OAAA,IAAI,EAAJ,CAAI,KAAA,EAAK,KAAK,cAAnD,2BAAqD,CAAF;IAClF,IAAM,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACxD,OAAO,oBAAC,gBAAgB,eAAK,KAAK,EAAM,kBAAkB,IAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,IAAI,CAAC;AAC/G,CAAC;AAED,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { CalendarProps } from './interfaces';\nimport InternalCalendar from './internal';\n\nexport { CalendarProps };\n\nexport default function Calendar({ locale = '', isDateEnabled = () => true, ...props }: CalendarProps) {\n const baseComponentProps = useBaseComponent('Calendar');\n return <InternalCalendar {...props} {...baseComponentProps} locale={locale} isDateEnabled={isDateEnabled} />;\n}\n\napplyDisplayName(Calendar, 'Calendar');\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { NonCancelableEventHandler } from '../internal/events';
|
|
2
|
+
export interface CalendarProps {
|
|
3
|
+
/**
|
|
4
|
+
* The current input value, in YYYY-MM-DD format.
|
|
5
|
+
*/
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* Defines whether a particular date is enabled in the calendar or not.
|
|
9
|
+
* If you disable a date in the calendar, users can still enter this date using a keyboard.
|
|
10
|
+
* We recommend that you also validate these constraints on the client-side and server-side
|
|
11
|
+
* as you would for other form elements.
|
|
12
|
+
* @param date
|
|
13
|
+
*/
|
|
14
|
+
isDateEnabled?: CalendarProps.IsDateEnabledFunction;
|
|
15
|
+
/**
|
|
16
|
+
* Specifies the locale to use to render month names and determine the starting day of the week.
|
|
17
|
+
* If you don't provide this, the locale is determined by the page and browser locales.
|
|
18
|
+
* Supported values and formats are listed in the
|
|
19
|
+
* [JavaScript Intl API specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).
|
|
20
|
+
*/
|
|
21
|
+
locale?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Determines the starting day of the week. The values 0-6 map to Sunday-Saturday.
|
|
24
|
+
* By default the starting day of the week is defined by the locale, but you can use this property to override it.
|
|
25
|
+
*/
|
|
26
|
+
startOfWeek?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Used as part of the `aria-label` for today's date in the calendar.
|
|
29
|
+
*/
|
|
30
|
+
todayAriaLabel: string;
|
|
31
|
+
/**
|
|
32
|
+
* Specifies an `aria-label` for the 'next month' button.
|
|
33
|
+
*/
|
|
34
|
+
nextMonthAriaLabel: string;
|
|
35
|
+
/**
|
|
36
|
+
* Specifies an `aria-label` for the 'previous month' button.
|
|
37
|
+
*/
|
|
38
|
+
previousMonthAriaLabel: string;
|
|
39
|
+
/**
|
|
40
|
+
* Called whenever a user changes the input value (by typing, pasting, or selecting a value).
|
|
41
|
+
* The event `detail` contains the current value of the field.
|
|
42
|
+
*/
|
|
43
|
+
onChange?: NonCancelableEventHandler<CalendarProps.ChangeDetail>;
|
|
44
|
+
}
|
|
45
|
+
export declare namespace CalendarProps {
|
|
46
|
+
interface ChangeDetail {
|
|
47
|
+
/**
|
|
48
|
+
* The new value of this component.
|
|
49
|
+
*/
|
|
50
|
+
value: string;
|
|
51
|
+
}
|
|
52
|
+
interface IsDateEnabledFunction {
|
|
53
|
+
(date: Date): boolean;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/calendar/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC;IAEpD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;CAClE;AAED,yBAAiB,aAAa,CAAC;IAC7B,UAAiB,YAAY;QAC3B;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,qBAAqB;QACpC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/calendar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface CalendarProps {\n /**\n * The current input value, in YYYY-MM-DD format.\n */\n value: string;\n\n /**\n * Defines whether a particular date is enabled in the calendar or not.\n * If you disable a date in the calendar, users can still enter this date using a keyboard.\n * We recommend that you also validate these constraints on the client-side and server-side\n * as you would for other form elements.\n * @param date\n */\n isDateEnabled?: CalendarProps.IsDateEnabledFunction;\n\n /**\n * Specifies the locale to use to render month names and determine the starting day of the week.\n * If you don't provide this, the locale is determined by the page and browser locales.\n * Supported values and formats are listed in the\n * [JavaScript Intl API specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation).\n */\n locale?: string;\n\n /**\n * Determines the starting day of the week. The values 0-6 map to Sunday-Saturday.\n * By default the starting day of the week is defined by the locale, but you can use this property to override it.\n */\n startOfWeek?: number;\n\n /**\n * Used as part of the `aria-label` for today's date in the calendar.\n */\n todayAriaLabel: string;\n\n /**\n * Specifies an `aria-label` for the 'next month' button.\n */\n nextMonthAriaLabel: string;\n\n /**\n * Specifies an `aria-label` for the 'previous month' button.\n */\n previousMonthAriaLabel: string;\n\n /**\n * Called whenever a user changes the input value (by typing, pasting, or selecting a value).\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<CalendarProps.ChangeDetail>;\n}\n\nexport namespace CalendarProps {\n export interface ChangeDetail {\n /**\n * The new value of this component.\n */\n value: string;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CalendarProps } from './interfaces.js';
|
|
2
|
+
export declare type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
|
+
export default function Calendar({ value, locale, startOfWeek, isDateEnabled, todayAriaLabel, nextMonthAriaLabel, previousMonthAriaLabel, onChange, }: CalendarProps): JSX.Element;
|
|
4
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/calendar/internal.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,oBAAY,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,KAAK,EACL,MAAW,EACX,WAAW,EACX,aAA0B,EAC1B,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,QAAQ,GACT,EAAE,aAAa,eAkHf"}
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
5
4
|
import { addDays, addMonths, getDaysInMonth, isSameMonth, startOfMonth } from 'date-fns';
|
|
6
|
-
import styles from '
|
|
7
|
-
import useFocusVisible from '../../internal/hooks/focus-visible/index.js';
|
|
5
|
+
import styles from './styles.css.js';
|
|
8
6
|
import CalendarHeader from './header';
|
|
9
7
|
import Grid from './grid';
|
|
10
8
|
import moveFocusHandler from './utils/move-focus-handler';
|
|
11
|
-
import { useUniqueId } from '../../internal/hooks/use-unique-id/index.js';
|
|
12
9
|
import { memoizedDate } from './utils/memoized-date.js';
|
|
13
|
-
import { useEffectOnUpdate } from '
|
|
10
|
+
import { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update.js';
|
|
14
11
|
import { normalizeLocale, normalizeStartOfWeek } from './utils/locales.js';
|
|
15
|
-
import { formatDate } from '
|
|
16
|
-
import { fireNonCancelableEvent } from '
|
|
17
|
-
import checkControlled from '
|
|
12
|
+
import { formatDate } from '../internal/utils/date-time';
|
|
13
|
+
import { fireNonCancelableEvent } from '../internal/events/index.js';
|
|
14
|
+
import checkControlled from '../internal/hooks/check-controlled/index.js';
|
|
15
|
+
import clsx from 'clsx';
|
|
18
16
|
export default function Calendar(_a) {
|
|
19
17
|
var value = _a.value, _b = _a.locale, locale = _b === void 0 ? '' : _b, startOfWeek = _a.startOfWeek, _c = _a.isDateEnabled, isDateEnabled = _c === void 0 ? function () { return true; } : _c, todayAriaLabel = _a.todayAriaLabel, nextMonthAriaLabel = _a.nextMonthAriaLabel, previousMonthAriaLabel = _a.previousMonthAriaLabel, onChange = _a.onChange;
|
|
20
18
|
checkControlled('Calendar', 'value', value, 'onChange', onChange);
|
|
21
19
|
var normalizedLocale = normalizeLocale('Calendar', locale);
|
|
22
20
|
var normalizedStartOfWeek = normalizeStartOfWeek(startOfWeek, locale);
|
|
23
|
-
var focusVisible = useFocusVisible();
|
|
24
|
-
var headerId = useUniqueId('calendar-dialog-title-');
|
|
25
21
|
var elementRef = useRef(null);
|
|
26
22
|
var gridWrapperRef = useRef(null);
|
|
27
23
|
var _d = useState(null), focusedDate = _d[0], setFocusedDate = _d[1];
|
|
@@ -93,10 +89,10 @@ export default function Calendar(_a) {
|
|
|
93
89
|
setFocusedDate(null);
|
|
94
90
|
}
|
|
95
91
|
};
|
|
96
|
-
return (React.createElement("div",
|
|
92
|
+
return (React.createElement("div", { className: clsx(styles.root, styles.calendar), ref: elementRef },
|
|
97
93
|
React.createElement("div", { className: styles['calendar-inner'] },
|
|
98
|
-
React.createElement(CalendarHeader, {
|
|
94
|
+
React.createElement(CalendarHeader, { baseDate: baseDate, locale: normalizedLocale, onChangeMonth: onHeaderChangeMonthHandler, previousMonthLabel: previousMonthAriaLabel, nextMonthLabel: nextMonthAriaLabel }),
|
|
99
95
|
React.createElement("div", { onBlur: onGridBlur, ref: gridWrapperRef },
|
|
100
96
|
React.createElement(Grid, { locale: normalizedLocale, baseDate: baseDate, isDateEnabled: isDateEnabled, focusedDate: focusedOrSelectedDate, onSelectDate: onGridSelectDateHandler, onFocusDate: onGridFocusDateHandler, onChangeMonth: onGridChangeMonthHandler, startOfWeek: normalizedStartOfWeek, todayAriaLabel: todayAriaLabel, selectedDate: memoizedValue, handleFocusMove: moveFocusHandler })))));
|
|
101
97
|
}
|
|
102
|
-
//# sourceMappingURL=
|
|
98
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/calendar/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACzF,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO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C,WAAW,CAAC,CAAC,CAAC;IAElB,IAAM,UAAU,GAAG,UAAC,KAAuB;;QACzC,IAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,KAAI,MAAA,cAAc,CAAC,OAAO,0CAAE,QAAQ,CAAC,KAAK,CAAC,aAAqB,CAAC,CAAA,CAAC;QACpH,IAAI,CAAC,sBAAsB,EAAE;YAC3B,cAAc,CAAC,IAAI,CAAC,CAAC;SACtB;IACH,CAAC,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,UAAU;QACjE,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC;YACtC,oBAAC,cAAc,IACb,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,gBAAgB,EACxB,aAAa,EAAE,0BAA0B,EACzC,kBAAkB,EAAE,sBAAsB,EAC1C,cAAc,EAAE,kBAAkB,GAClC;YACF,6BAAK,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,cAAc;gBAC1C,oBAAC,IAAI,IACH,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,qBAAqB,EAClC,YAAY,EAAE,uBAAuB,EACrC,WAAW,EAAE,sBAAsB,EACnC,aAAa,EAAE,wBAAwB,EACvC,WAAW,EAAE,qBAAqB,EAClC,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,aAAa,EAC3B,eAAe,EAAE,gBAAgB,GACjC,CACE,CACF,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useEffect, useRef, useState } from 'react';\nimport { addDays, addMonths, getDaysInMonth, isSameMonth, startOfMonth } from 'date-fns';\nimport styles from './styles.css.js';\nimport CalendarHeader from './header';\nimport Grid from './grid';\nimport moveFocusHandler from './utils/move-focus-handler';\nimport { memoizedDate } from './utils/memoized-date.js';\nimport { useEffectOnUpdate } from '../internal/hooks/use-effect-on-update.js';\nimport { normalizeLocale, normalizeStartOfWeek } from './utils/locales.js';\nimport { formatDate } from '../internal/utils/date-time';\nimport { fireNonCancelableEvent } from '../internal/events/index.js';\nimport checkControlled from '../internal/hooks/check-controlled/index.js';\nimport clsx from 'clsx';\nimport { CalendarProps } from './interfaces.js';\n\nexport type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport default function Calendar({\n value,\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n todayAriaLabel,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n onChange,\n}: CalendarProps) {\n checkControlled('Calendar', 'value', value, 'onChange', onChange);\n\n const normalizedLocale = normalizeLocale('Calendar', locale);\n const normalizedStartOfWeek = normalizeStartOfWeek(startOfWeek, locale);\n const elementRef = useRef<HTMLDivElement>(null);\n const gridWrapperRef = useRef<HTMLDivElement>(null);\n const [focusedDate, setFocusedDate] = useState<Date | null>(null);\n\n // Set displayed date to value if defined or to current date otherwise.\n const memoizedValue = memoizedDate('value', value);\n const defaultDisplayedDate = memoizedValue ?? new Date();\n const [displayedDate, setDisplayedDate] = useState(defaultDisplayedDate);\n\n // Update displayed date if value changes.\n useEffect(() => {\n memoizedValue && setDisplayedDate(prev => (prev.getTime() !== memoizedValue.getTime() ? memoizedValue : prev));\n }, [memoizedValue]);\n\n const selectFocusedDate = (selected: Date | null, baseDate: Date): Date | null => {\n if (selected && isDateEnabled(selected) && isSameMonth(selected, baseDate)) {\n return selected;\n }\n const today = new Date();\n if (isDateEnabled(today) && isSameMonth(today, baseDate)) {\n return today;\n }\n if (isDateEnabled(baseDate)) {\n return baseDate;\n }\n return null;\n };\n\n // Get the first enabled date of the month. If no day is enabled in the given month, return the first day of the month.\n // This is needed because `baseDate` is used as the first focusable date, for example when navigating to the calendar area.\n const getBaseDate = (date: Date) => {\n const startDate = startOfMonth(date);\n for (let i = 0; i < getDaysInMonth(date); i++) {\n const currentDate = addDays(startDate, i);\n if (isDateEnabled(currentDate)) {\n return currentDate;\n }\n }\n return startDate;\n };\n\n const baseDate: Date = getBaseDate(displayedDate);\n const focusedOrSelectedDate = focusedDate || selectFocusedDate(memoizedValue, baseDate);\n\n const onHeaderChangeMonthHandler = (isPreviousButtonClick?: boolean) => {\n setDisplayedDate(addMonths(baseDate, isPreviousButtonClick ? -1 : 1));\n setFocusedDate(null);\n };\n\n const onGridChangeMonthHandler = (newMonth: Date) => {\n setDisplayedDate(newMonth);\n setFocusedDate(null);\n };\n\n const onGridFocusDateHandler = (date: null | Date) => {\n if (date) {\n const value = memoizedDate('focused', formatDate(date));\n setFocusedDate(value);\n }\n };\n\n const onGridSelectDateHandler = (date: Date) => {\n fireNonCancelableEvent(onChange, { value: formatDate(date) });\n setFocusedDate(null);\n };\n\n // The focused date changes as a feedback to keyboard navigation in the grid.\n // Once changed, the corresponding day button needs to receive the actual focus.\n useEffectOnUpdate(() => {\n if (focusedDate) {\n (elementRef.current?.querySelector(`.${styles['calendar-day-focusable']}`) as HTMLDivElement)?.focus();\n }\n }, [focusedDate]);\n\n const onGridBlur = (event: React.FocusEvent) => {\n const newFocusTargetIsInGrid = event.relatedTarget && gridWrapperRef.current?.contains(event.relatedTarget as Node);\n if (!newFocusTargetIsInGrid) {\n setFocusedDate(null);\n }\n };\n\n return (\n <div className={clsx(styles.root, styles.calendar)} ref={elementRef}>\n <div className={styles['calendar-inner']}>\n <CalendarHeader\n baseDate={baseDate}\n locale={normalizedLocale}\n onChangeMonth={onHeaderChangeMonthHandler}\n previousMonthLabel={previousMonthAriaLabel}\n nextMonthLabel={nextMonthAriaLabel}\n />\n <div onBlur={onGridBlur} ref={gridWrapperRef}>\n <Grid\n locale={normalizedLocale}\n baseDate={baseDate}\n isDateEnabled={isDateEnabled}\n focusedDate={focusedOrSelectedDate}\n onSelectDate={onGridSelectDateHandler}\n onFocusDate={onGridFocusDateHandler}\n onChangeMonth={onGridChangeMonthHandler}\n startOfWeek={normalizedStartOfWeek}\n todayAriaLabel={todayAriaLabel}\n selectedDate={memoizedValue}\n handleFocusMove={moveFocusHandler}\n />\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import './styles.scoped.css';
|
|
3
|
+
export default {
|
|
4
|
+
"calendar": "awsui_calendar_1ykar_3ngtd_93",
|
|
5
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1ykar_3ngtd_1",
|
|
6
|
+
"root": "awsui_root_1ykar_3ngtd_120",
|
|
7
|
+
"calendar-inner": "awsui_calendar-inner_1ykar_3ngtd_137",
|
|
8
|
+
"calendar-header": "awsui_calendar-header_1ykar_3ngtd_140",
|
|
9
|
+
"calendar-header-month": "awsui_calendar-header-month_1ykar_3ngtd_145",
|
|
10
|
+
"calendar-next-month-btn": "awsui_calendar-next-month-btn_1ykar_3ngtd_151",
|
|
11
|
+
"calendar-prev-month-btn": "awsui_calendar-prev-month-btn_1ykar_3ngtd_154",
|
|
12
|
+
"calendar-day-names": "awsui_calendar-day-names_1ykar_3ngtd_157",
|
|
13
|
+
"calendar-day-name": "awsui_calendar-day-name_1ykar_3ngtd_157",
|
|
14
|
+
"calendar-dates": "awsui_calendar-dates_1ykar_3ngtd_172",
|
|
15
|
+
"calendar-week": "awsui_calendar-week_1ykar_3ngtd_175",
|
|
16
|
+
"calendar-day": "awsui_calendar-day_1ykar_3ngtd_157",
|
|
17
|
+
"calendar-day-in-last-week": "awsui_calendar-day-in-last-week_1ykar_3ngtd_194",
|
|
18
|
+
"calendar-day-focusable": "awsui_calendar-day-focusable_1ykar_3ngtd_197",
|
|
19
|
+
"calendar-day-enabled": "awsui_calendar-day-enabled_1ykar_3ngtd_200",
|
|
20
|
+
"calendar-day-current-month": "awsui_calendar-day-current-month_1ykar_3ngtd_204",
|
|
21
|
+
"calendar-day-selected": "awsui_calendar-day-selected_1ykar_3ngtd_211",
|
|
22
|
+
"calendar-day-today": "awsui_calendar-day-today_1ykar_3ngtd_215",
|
|
23
|
+
"day-inner": "awsui_day-inner_1ykar_3ngtd_227"
|
|
24
|
+
};
|
|
25
|
+
|