@cloudscape-design/components 3.0.882 → 3.0.884
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/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts.map +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js +1 -1
- package/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js.map +1 -1
- package/breadcrumb-group/item/item.d.ts.map +1 -1
- package/breadcrumb-group/item/item.js +1 -1
- package/breadcrumb-group/item/item.js.map +1 -1
- package/button/internal.d.ts.map +1 -1
- package/button/internal.js +1 -1
- package/button/internal.js.map +1 -1
- package/button-group/file-input-item.d.ts +5 -3
- package/button-group/file-input-item.d.ts.map +1 -1
- package/button-group/file-input-item.js +2 -2
- package/button-group/file-input-item.js.map +1 -1
- package/button-group/icon-button-item.d.ts +5 -3
- package/button-group/icon-button-item.d.ts.map +1 -1
- package/button-group/icon-button-item.js +2 -2
- package/button-group/icon-button-item.js.map +1 -1
- package/button-group/icon-toggle-button-item.d.ts +5 -3
- package/button-group/icon-toggle-button-item.d.ts.map +1 -1
- package/button-group/icon-toggle-button-item.js +2 -2
- package/button-group/icon-toggle-button-item.js.map +1 -1
- package/button-group/item-element.d.ts.map +1 -1
- package/button-group/item-element.js +4 -4
- package/button-group/item-element.js.map +1 -1
- package/button-group/menu-dropdown-item.d.ts +1 -0
- package/button-group/menu-dropdown-item.d.ts.map +1 -1
- package/button-group/menu-dropdown-item.js +2 -2
- package/button-group/menu-dropdown-item.js.map +1 -1
- package/calendar/grid/index.d.ts.map +1 -1
- package/calendar/grid/index.js +1 -1
- package/calendar/grid/index.js.map +1 -1
- package/date-range-picker/calendar/grids/grid-cell.d.ts.map +1 -1
- package/date-range-picker/calendar/grids/grid-cell.js +2 -2
- package/date-range-picker/calendar/grids/grid-cell.js.map +1 -1
- package/date-range-picker/calendar/grids/grid.d.ts +18 -0
- package/date-range-picker/calendar/grids/grid.d.ts.map +1 -0
- package/date-range-picker/calendar/grids/grid.js +174 -0
- package/date-range-picker/calendar/grids/grid.js.map +1 -0
- package/date-range-picker/calendar/grids/index.d.ts +3 -20
- package/date-range-picker/calendar/grids/index.d.ts.map +1 -1
- package/date-range-picker/calendar/grids/index.js +51 -22
- package/date-range-picker/calendar/grids/index.js.map +1 -1
- package/date-range-picker/calendar/grids/interfaces.d.ts +47 -0
- package/date-range-picker/calendar/grids/interfaces.d.ts.map +1 -0
- package/date-range-picker/calendar/grids/interfaces.js +2 -0
- package/date-range-picker/calendar/grids/interfaces.js.map +1 -0
- package/date-range-picker/calendar/grids/intl.d.ts +17 -0
- package/date-range-picker/calendar/grids/intl.d.ts.map +1 -0
- package/date-range-picker/calendar/grids/intl.js +56 -0
- package/date-range-picker/calendar/grids/intl.js.map +1 -0
- package/date-range-picker/calendar/grids/styles.css.js +30 -24
- package/date-range-picker/calendar/grids/styles.scoped.css +62 -46
- package/date-range-picker/calendar/grids/styles.selectors.js +30 -24
- package/date-range-picker/calendar/header/header-button.d.ts +5 -4
- package/date-range-picker/calendar/header/header-button.d.ts.map +1 -1
- package/date-range-picker/calendar/header/header-button.js +6 -6
- package/date-range-picker/calendar/header/header-button.js.map +1 -1
- package/date-range-picker/calendar/header/index.d.ts +6 -4
- package/date-range-picker/calendar/header/index.d.ts.map +1 -1
- package/date-range-picker/calendar/header/index.js +18 -13
- package/date-range-picker/calendar/header/index.js.map +1 -1
- package/date-range-picker/calendar/index.d.ts +2 -1
- package/date-range-picker/calendar/index.d.ts.map +1 -1
- package/date-range-picker/calendar/index.js +49 -41
- package/date-range-picker/calendar/index.js.map +1 -1
- package/date-range-picker/calendar/range-inputs.d.ts +4 -3
- package/date-range-picker/calendar/range-inputs.d.ts.map +1 -1
- package/date-range-picker/calendar/range-inputs.js +23 -10
- package/date-range-picker/calendar/range-inputs.js.map +1 -1
- package/date-range-picker/calendar/utils.d.ts +2 -0
- package/date-range-picker/calendar/utils.d.ts.map +1 -1
- package/date-range-picker/calendar/utils.js +27 -1
- package/date-range-picker/calendar/utils.js.map +1 -1
- package/date-range-picker/dropdown.d.ts +3 -2
- package/date-range-picker/dropdown.d.ts.map +1 -1
- package/date-range-picker/dropdown.js +17 -12
- package/date-range-picker/dropdown.js.map +1 -1
- package/date-range-picker/index.d.ts.map +1 -1
- package/date-range-picker/index.js +17 -8
- package/date-range-picker/index.js.map +1 -1
- package/date-range-picker/interfaces.d.ts +89 -14
- package/date-range-picker/interfaces.d.ts.map +1 -1
- package/date-range-picker/interfaces.js.map +1 -1
- package/date-range-picker/mode-switcher.js +2 -2
- package/date-range-picker/mode-switcher.js.map +1 -1
- package/date-range-picker/relative-range/index.d.ts +2 -1
- package/date-range-picker/relative-range/index.d.ts.map +1 -1
- package/date-range-picker/relative-range/index.js +14 -8
- package/date-range-picker/relative-range/index.js.map +1 -1
- package/date-range-picker/relative-range/styles.css.js +6 -9
- package/date-range-picker/relative-range/styles.scoped.css +10 -19
- package/date-range-picker/relative-range/styles.selectors.js +6 -9
- package/date-range-picker/styles.css.js +23 -38
- package/date-range-picker/styles.scoped.css +32 -78
- package/date-range-picker/styles.selectors.js +23 -38
- package/date-range-picker/test-classes/styles.css.js +36 -2
- package/date-range-picker/test-classes/styles.scoped.css +36 -2
- package/date-range-picker/test-classes/styles.selectors.js +36 -2
- package/date-range-picker/utils.d.ts +9 -11
- package/date-range-picker/utils.d.ts.map +1 -1
- package/date-range-picker/utils.js +43 -32
- package/date-range-picker/utils.js.map +1 -1
- package/file-token-group/file-token.d.ts.map +1 -1
- package/file-token-group/file-token.js +1 -1
- package/file-token-group/file-token.js.map +1 -1
- package/i18n/messages/all.all.js +1 -1
- package/i18n/messages/all.all.json +1 -1
- package/i18n/messages/all.en.js +1 -1
- package/i18n/messages/all.en.json +1 -1
- package/i18n/messages-types.d.ts +9 -0
- package/i18n/messages-types.d.ts.map +1 -1
- package/i18n/messages-types.js.map +1 -1
- package/internal/components/tooltip/index.d.ts +2 -1
- package/internal/components/tooltip/index.d.ts.map +1 -1
- package/internal/components/tooltip/index.js +21 -2
- package/internal/components/tooltip/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/date-time/calendar.d.ts +22 -6
- package/internal/utils/date-time/calendar.d.ts.map +1 -1
- package/internal/utils/date-time/calendar.js +62 -11
- package/internal/utils/date-time/calendar.js.map +1 -1
- package/multiselect/index.d.ts.map +1 -1
- package/multiselect/index.js +2 -3
- package/multiselect/index.js.map +1 -1
- package/package.json +1 -1
- package/progress-bar/index.d.ts.map +1 -1
- package/progress-bar/index.js +4 -3
- package/progress-bar/index.js.map +1 -1
- package/progress-bar/internal.js +2 -2
- package/progress-bar/internal.js.map +1 -1
- package/segmented-control/segment.d.ts.map +1 -1
- package/segmented-control/segment.js +1 -1
- package/segmented-control/segment.js.map +1 -1
- package/select/parts/item.d.ts.map +1 -1
- package/select/parts/item.js +4 -2
- package/select/parts/item.js.map +1 -1
- package/select/parts/multiselect-item.d.ts.map +1 -1
- package/select/parts/multiselect-item.js +4 -2
- package/select/parts/multiselect-item.js.map +1 -1
- package/slider/internal.d.ts.map +1 -1
- package/slider/internal.js +1 -1
- package/slider/internal.js.map +1 -1
- package/tabs/tab-header-bar.d.ts.map +1 -1
- package/tabs/tab-header-bar.js +1 -1
- package/tabs/tab-header-bar.js.map +1 -1
- package/test-utils/dom/date-range-picker/index.d.ts +26 -0
- package/test-utils/dom/date-range-picker/index.js +58 -24
- package/test-utils/dom/date-range-picker/index.js.map +1 -1
- package/test-utils/selectors/date-range-picker/index.d.ts +26 -0
- package/test-utils/selectors/date-range-picker/index.js +58 -24
- package/test-utils/selectors/date-range-picker/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/date-range-picker/calendar/grids/monthly-grid.d.ts +0 -39
- package/date-range-picker/calendar/grids/monthly-grid.d.ts.map +0 -1
- package/date-range-picker/calendar/grids/monthly-grid.js +0 -97
- package/date-range-picker/calendar/grids/monthly-grid.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/date-range-picker/calendar/grids/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/E,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,SAAS,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,oBAAoB,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,SAAS,SAAS,CAAC,IAAU,EAAE,QAAc,EAAE,YAAqB;IAClE,IAAI,YAAY,EAAE;QAChB,OAAO,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;KACpC;IAED,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;IAE9C,OAAO,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACzE,CAAC;AAuBD,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EACpB,QAAQ,EACR,iBA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cAAc,EAAE,GAAG,eAAe,YAAY,GAC9C,CACH;YACD,oBAAC,WAAW,IACV,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,EAChC,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,EACtD,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,EAClD,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,GAAG,eAAe,eAAe,GACjD,CACmB,CACnB,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { addMonths, isAfter, isBefore, isSameMonth, max, min } from 'date-fns';\n\nimport {\n getBaseDay,\n moveNextDay,\n moveNextWeek,\n movePrevDay,\n movePrevWeek,\n} from '../../../calendar/utils/navigation-day';\nimport { useDateCache } from '../../../internal/hooks/use-date-cache';\nimport { KeyCode } from '../../../internal/keycode';\nimport handleKey from '../../../internal/utils/handle-key';\nimport { hasValue } from '../../../internal/utils/has-value';\nimport InternalSpaceBetween from '../../../space-between/internal';\nimport { DateRangePickerProps, DayIndex } from '../../interfaces';\nimport { findDateToFocus } from '../utils';\nimport { MonthlyGrid } from './monthly-grid';\n\nimport styles from '../../styles.css.js';\n\nfunction isVisible(date: Date, baseDate: Date, isSingleGrid: boolean) {\n if (isSingleGrid) {\n return isSameMonth(date, baseDate);\n }\n\n const previousMonth = addMonths(baseDate, -1);\n\n return isSameMonth(date, previousMonth) || isSameMonth(date, baseDate);\n}\n\ninterface GridProps {\n baseDate: Date;\n selectedStartDate: Date | null;\n selectedEndDate: Date | null;\n\n focusedDate: Date | null;\n onFocusedDateChange: React.Dispatch<React.SetStateAction<Date | null>>;\n\n isDateEnabled: DateRangePickerProps.IsDateEnabledFunction;\n dateDisabledReason: DateRangePickerProps.DateDisabledReasonFunction;\n isSingleGrid: boolean;\n\n onSelectDate: (date: Date) => void;\n onChangeMonth: (date: Date) => void;\n\n locale: string;\n startOfWeek: DayIndex;\n todayAriaLabel?: string;\n headingIdPrefix: string;\n}\n\nexport const Grids = ({\n baseDate,\n selectedStartDate,\n selectedEndDate,\n\n focusedDate,\n onFocusedDateChange,\n\n isDateEnabled,\n dateDisabledReason,\n isSingleGrid,\n\n onSelectDate,\n onChangeMonth,\n\n locale,\n startOfWeek,\n todayAriaLabel,\n headingIdPrefix,\n}: GridProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [gridHasFocus, setGridHasFocus] = useState(false);\n\n const focusedDateRef = useRef<HTMLTableCellElement>(null);\n\n const dateCache = useDateCache();\n baseDate = dateCache(baseDate);\n focusedDate = focusedDate ? dateCache(focusedDate) : null;\n\n const isDateFocusable = useCallback(\n (date: Date) => {\n return isDateEnabled(date) || (!isDateEnabled(date) && !!dateDisabledReason(date));\n },\n [isDateEnabled, dateDisabledReason]\n );\n\n useEffect(() => {\n if (focusedDate && !isVisible(focusedDate, baseDate, isSingleGrid)) {\n const direction = isAfter(focusedDate, baseDate) ? -1 : 1;\n\n const newMonth = !isSingleGrid && direction === -1 ? addMonths(baseDate, -1) : baseDate;\n const nearestBaseDate = getBaseDay(newMonth, isDateFocusable);\n\n const newFocusedDate = findDateToFocus(focusedDate, nearestBaseDate, isDateFocusable);\n\n onFocusedDateChange(newFocusedDate);\n }\n }, [baseDate, focusedDate, isSingleGrid, isDateFocusable, onFocusedDateChange]);\n\n const onGridKeyDownHandler = (event: React.KeyboardEvent<HTMLElement>) => {\n let updatedFocusDate;\n\n const keys = [KeyCode.up, KeyCode.down, KeyCode.left, KeyCode.right, KeyCode.space, KeyCode.enter];\n\n if (focusedDate === null || keys.indexOf(event.keyCode) === -1) {\n return;\n }\n\n event.preventDefault();\n\n handleKey(event, {\n onActivate: () => {\n if (!focusedDate || !isDateEnabled(focusedDate)) {\n return;\n }\n\n onSelectDate(focusedDate);\n },\n onBlockEnd: () => focusedDate && (updatedFocusDate = moveNextWeek(focusedDate, isDateFocusable)),\n onBlockStart: () => focusedDate && (updatedFocusDate = movePrevWeek(focusedDate, isDateFocusable)),\n onInlineEnd: () => focusedDate && (updatedFocusDate = moveNextDay(focusedDate, isDateFocusable)),\n onInlineStart: () => focusedDate && (updatedFocusDate = movePrevDay(focusedDate, isDateFocusable)),\n });\n\n if (!updatedFocusDate) {\n return;\n }\n\n const updatedDateIsVisible = isVisible(updatedFocusDate, baseDate, isSingleGrid);\n\n if (!updatedDateIsVisible) {\n const newMonthIsOnLeftSide = !isSingleGrid && isBefore(updatedFocusDate, baseDate);\n\n onChangeMonth(newMonthIsOnLeftSide ? addMonths(updatedFocusDate, 1) : updatedFocusDate);\n }\n onFocusedDateChange(updatedFocusDate);\n };\n\n useEffect(() => {\n // focus current date if the focus is already inside the calendar\n if (focusedDate !== null && gridHasFocus) {\n if (focusedDateRef.current && focusedDateRef.current !== document.activeElement) {\n focusedDateRef.current.focus();\n }\n }\n }, [focusedDate, gridHasFocus]);\n\n const onGridBlur = (event: React.FocusEvent) => {\n const newFocusTarget = event.relatedTarget || document.activeElement;\n const newFocusTargetIsInGrid = containerRef.current?.contains(newFocusTarget as Node);\n if (newFocusTarget && !newFocusTargetIsInGrid && gridHasFocus) {\n setGridHasFocus(false);\n }\n };\n\n const onGridFocus = () => {\n if (!gridHasFocus) {\n setGridHasFocus(true);\n }\n };\n\n const isRangeVisible = (selectedStartDate && selectedEndDate) || gridHasFocus;\n\n const rangeEnds: Date[] = [selectedStartDate ?? focusedDate, selectedEndDate ?? focusedDate].filter(hasValue);\n\n const rangeStartDate = min(rangeEnds);\n const rangeEndDate = max(rangeEnds);\n\n return (\n <div ref={containerRef} onFocus={onGridFocus} onBlur={onGridBlur}>\n <InternalSpaceBetween size=\"xs\" direction=\"horizontal\">\n {!isSingleGrid && (\n <MonthlyGrid\n padDates=\"before\"\n className={styles['first-grid']}\n baseDate={addMonths(baseDate, -1)}\n selectedEndDate={selectedEndDate}\n selectedStartDate={selectedStartDate}\n rangeStartDate={isRangeVisible ? rangeStartDate : null}\n rangeEndDate={isRangeVisible ? rangeEndDate : null}\n focusedDate={focusedDate}\n focusedDateRef={focusedDateRef}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n onSelectDate={onSelectDate}\n onGridKeyDownHandler={onGridKeyDownHandler}\n onFocusedDateChange={onFocusedDateChange}\n locale={locale}\n startOfWeek={startOfWeek}\n todayAriaLabel={todayAriaLabel}\n ariaLabelledby={`${headingIdPrefix}-prevmonth`}\n />\n )}\n <MonthlyGrid\n padDates=\"after\"\n className={styles['second-grid']}\n baseDate={baseDate}\n selectedEndDate={selectedEndDate}\n selectedStartDate={selectedStartDate}\n rangeStartDate={isRangeVisible ? rangeStartDate : null}\n rangeEndDate={isRangeVisible ? rangeEndDate : null}\n focusedDate={focusedDate}\n focusedDateRef={focusedDateRef}\n isDateEnabled={isDateEnabled}\n dateDisabledReason={dateDisabledReason}\n onSelectDate={onSelectDate}\n onGridKeyDownHandler={onGridKeyDownHandler}\n onFocusedDateChange={onFocusedDateChange}\n locale={locale}\n startOfWeek={startOfWeek}\n todayAriaLabel={todayAriaLabel}\n ariaLabelledby={`${headingIdPrefix}-currentmonth`}\n />\n </InternalSpaceBetween>\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/date-range-picker/calendar/grids/index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served.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { addMonths, addYears, isAfter, isBefore, isSameMonth, isSameYear, max, min } from 'date-fns';\n\nimport {\n getBaseDay,\n moveNextDay,\n moveNextWeek,\n movePrevDay,\n movePrevWeek,\n} from '../../../calendar/utils/navigation-day';\nimport {\n getBaseMonth,\n moveMonthDown,\n moveMonthUp,\n moveNextMonth,\n movePrevMonth,\n} from '../../../calendar/utils/navigation-month';\nimport { useDateCache } from '../../../internal/hooks/use-date-cache';\nimport { KeyCode } from '../../../internal/keycode';\nimport handleKey from '../../../internal/utils/handle-key';\nimport { hasValue } from '../../../internal/utils/has-value';\nimport InternalSpaceBetween from '../../../space-between/internal';\nimport { DateRangePickerProps } from '../../interfaces';\nimport { findDateToFocus } from '../utils';\nimport { Grid } from './grid';\nimport { SelectGridProps } from './interfaces';\n\nimport testutilStyles from '../../test-classes/styles.css.js';\n\nfunction isVisible(date: Date, baseDate: Date, isSingleGrid: boolean, granularity: DateRangePickerProps.Granularity) {\n const isSame = granularity === 'day' ? isSameMonth : isSameYear;\n const add = granularity === 'day' ? addMonths : addYears;\n if (isSingleGrid) {\n return isSame(date, baseDate);\n }\n\n const previous = add(baseDate, -1);\n\n return isSame(date, previous) || isSame(date, baseDate);\n}\n\nexport const Grids = ({\n baseDate,\n selectedStartDate,\n selectedEndDate,\n\n focusedDate,\n onFocusedDateChange,\n\n isDateEnabled,\n dateDisabledReason,\n isSingleGrid,\n\n onSelectDate,\n onPageChange,\n\n locale,\n todayAriaLabel,\n currentMonthAriaLabel,\n headingIdPrefix,\n startOfWeek = 0,\n granularity = 'day',\n}: SelectGridProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [gridHasFocus, setGridHasFocus] = useState(false);\n const isMonthPicker = granularity === 'month';\n\n const focusedDateRef = useRef<HTMLTableCellElement>(null);\n\n const addPages = !isMonthPicker ? addMonths : addYears;\n const getBase = !isMonthPicker ? getBaseDay : getBaseMonth;\n const moveDown = isMonthPicker ? moveMonthDown : moveNextWeek;\n const moveLeft = isMonthPicker ? movePrevMonth : movePrevDay;\n const moveRight = isMonthPicker ? moveNextMonth : moveNextDay;\n const moveUp = isMonthPicker ? moveMonthUp : movePrevWeek;\n\n const dateCache = useDateCache();\n baseDate = dateCache(baseDate);\n focusedDate = focusedDate ? dateCache(focusedDate) : null;\n\n const isDateFocusable = useCallback(\n (date: Date) => {\n return isDateEnabled(date) || (!isDateEnabled(date) && !!dateDisabledReason(date));\n },\n [isDateEnabled, dateDisabledReason]\n );\n\n useEffect(() => {\n if (focusedDate && !isVisible(focusedDate, baseDate, isSingleGrid, granularity)) {\n const direction = isAfter(focusedDate, baseDate) ? -1 : 1;\n\n const newPage = !isSingleGrid && direction === -1 ? addPages(baseDate, -1) : baseDate;\n const nearestBaseDate = getBase(newPage, isDateFocusable);\n\n const newFocusedDate = findDateToFocus(focusedDate, nearestBaseDate, isDateFocusable);\n\n onFocusedDateChange(newFocusedDate);\n }\n }, [baseDate, focusedDate, isSingleGrid, granularity, addPages, isDateFocusable, onFocusedDateChange, getBase]);\n\n const onGridKeyDownHandler = (event: React.KeyboardEvent<HTMLElement>) => {\n let updatedFocusDate: Date | null = null;\n\n const keys = [KeyCode.up, KeyCode.down, KeyCode.left, KeyCode.right, KeyCode.space, KeyCode.enter];\n\n if (focusedDate === null || keys.indexOf(event.keyCode) === -1) {\n return;\n }\n\n event.preventDefault();\n\n handleKey(event, {\n onActivate: () => {\n if (!focusedDate || !isDateEnabled(focusedDate)) {\n return;\n }\n onSelectDate(focusedDate);\n },\n onBlockEnd: () => focusedDate && (updatedFocusDate = moveDown(focusedDate, isDateFocusable)),\n onBlockStart: () => focusedDate && (updatedFocusDate = moveUp(focusedDate, isDateFocusable)),\n onInlineStart: () => focusedDate && (updatedFocusDate = moveLeft(focusedDate, isDateFocusable)),\n onInlineEnd: () => focusedDate && (updatedFocusDate = moveRight(focusedDate, isDateFocusable)),\n });\n\n if (!updatedFocusDate) {\n return;\n }\n\n const updatedDateIsVisible = isVisible(updatedFocusDate, baseDate, isSingleGrid, granularity);\n\n if (!updatedDateIsVisible) {\n const newPageIsOnLeftSide = !isSingleGrid && isBefore(updatedFocusDate, baseDate);\n onPageChange(newPageIsOnLeftSide ? addPages(updatedFocusDate, 1) : updatedFocusDate);\n }\n onFocusedDateChange(updatedFocusDate);\n };\n\n useEffect(() => {\n // focus current date if the focus is already inside the calendar\n if (focusedDate !== null && gridHasFocus) {\n if (focusedDateRef.current && focusedDateRef.current !== document.activeElement) {\n focusedDateRef.current.focus();\n }\n }\n }, [focusedDate, gridHasFocus]);\n\n const onGridBlur = (event: React.FocusEvent) => {\n const newFocusTarget = event.relatedTarget || document.activeElement;\n const newFocusTargetIsInGrid = containerRef.current?.contains(newFocusTarget as Node);\n if (newFocusTarget && !newFocusTargetIsInGrid && gridHasFocus) {\n setGridHasFocus(false);\n }\n };\n\n const onGridFocus = () => {\n if (!gridHasFocus) {\n setGridHasFocus(true);\n }\n };\n\n const isRangeVisible = (selectedStartDate && selectedEndDate) || gridHasFocus;\n\n const rangeEnds: Date[] = [selectedStartDate ?? focusedDate, selectedEndDate ?? focusedDate].filter(hasValue);\n const rangeStartDate = min(rangeEnds);\n const rangeEndDate = max(rangeEnds);\n const pageUnit = isMonthPicker ? 'year' : 'month';\n\n const sharedGridProps = {\n selectedEndDate,\n selectedStartDate,\n focusedDate,\n focusedDateRef,\n rangeStartDate: isRangeVisible ? rangeStartDate : null,\n rangeEndDate: isRangeVisible ? rangeEndDate : null,\n isDateEnabled,\n dateDisabledReason,\n onSelectDate,\n onGridKeyDownHandler,\n onFocusedDateChange,\n locale,\n granularity,\n currentMonthAriaLabel,\n startOfWeek,\n todayAriaLabel,\n };\n\n return (\n <div ref={containerRef} onFocus={onGridFocus} onBlur={onGridBlur}>\n <InternalSpaceBetween size=\"xs\" direction=\"horizontal\">\n {!isSingleGrid && (\n <Grid\n {...sharedGridProps}\n padDates={'before'}\n className={testutilStyles['first-grid']}\n baseDate={addPages(baseDate, -1)}\n ariaLabelledby={`${headingIdPrefix}-prev${pageUnit}`}\n />\n )}\n <Grid\n {...sharedGridProps}\n padDates={'after'}\n className={testutilStyles['second-grid']}\n baseDate={baseDate}\n ariaLabelledby={`${headingIdPrefix}-current${pageUnit}`}\n />\n </InternalSpaceBetween>\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DateRangePickerProps, DayIndex } from '../../interfaces';
|
|
3
|
+
export interface GridBaseProps {
|
|
4
|
+
baseDate: Date;
|
|
5
|
+
selectedStartDate: Date | null;
|
|
6
|
+
selectedEndDate: Date | null;
|
|
7
|
+
focusedDate: Date | null;
|
|
8
|
+
onFocusedDateChange: React.Dispatch<React.SetStateAction<Date | null>>;
|
|
9
|
+
onSelectDate: (date: Date) => void;
|
|
10
|
+
isDateEnabled: DateRangePickerProps.IsDateEnabledFunction;
|
|
11
|
+
dateDisabledReason: DateRangePickerProps.DateDisabledReasonFunction;
|
|
12
|
+
locale: string;
|
|
13
|
+
}
|
|
14
|
+
export interface GridProps extends GridBaseProps {
|
|
15
|
+
rangeStartDate: Date | null;
|
|
16
|
+
rangeEndDate: Date | null;
|
|
17
|
+
focusedDateRef: React.RefObject<HTMLTableCellElement>;
|
|
18
|
+
onGridKeyDownHandler: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
19
|
+
ariaLabelledby: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Used to only add the dates of previous and next months outside the month pages
|
|
23
|
+
*/
|
|
24
|
+
padDates: 'before' | 'after';
|
|
25
|
+
currentMonthAriaLabel?: string;
|
|
26
|
+
startOfWeek?: DayIndex;
|
|
27
|
+
todayAriaLabel?: string;
|
|
28
|
+
granularity: DateRangePickerProps.Granularity;
|
|
29
|
+
}
|
|
30
|
+
export interface SelectGridProps extends GridBaseProps {
|
|
31
|
+
/**
|
|
32
|
+
* changes the page/view of the calendar. Doing so will change to another month or year
|
|
33
|
+
* @param date
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
onPageChange: (date: Date) => void;
|
|
37
|
+
isSingleGrid: boolean;
|
|
38
|
+
headingIdPrefix: string;
|
|
39
|
+
/**
|
|
40
|
+
* not needed for grids with a month granularity
|
|
41
|
+
*/
|
|
42
|
+
startOfWeek?: DayIndex;
|
|
43
|
+
granularity?: DateRangePickerProps.Granularity;
|
|
44
|
+
todayAriaLabel?: string;
|
|
45
|
+
currentMonthAriaLabel?: string;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/date-range-picker/calendar/grids/interfaces.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,IAAI,CAAC;IACf,iBAAiB,EAAE,IAAI,GAAG,IAAI,CAAC;IAC/B,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAEzB,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC;IACvE,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,aAAa,EAAE,oBAAoB,CAAC,qBAAqB,CAAC;IAC1D,kBAAkB,EAAE,oBAAoB,CAAC,0BAA0B,CAAC;IAEpE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,cAAc,EAAE,IAAI,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;IAEtD,oBAAoB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAEpE,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,oBAAoB,CAAC,WAAW,CAAC;CAC/C;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAEnC,YAAY,EAAE,OAAO,CAAC;IAEtB,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,WAAW,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/date-range-picker/calendar/grids/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DateRangePickerProps, DayIndex } from '../../interfaces';\n\nexport interface GridBaseProps {\n baseDate: Date;\n selectedStartDate: Date | null;\n selectedEndDate: Date | null;\n focusedDate: Date | null;\n\n onFocusedDateChange: React.Dispatch<React.SetStateAction<Date | null>>;\n onSelectDate: (date: Date) => void;\n isDateEnabled: DateRangePickerProps.IsDateEnabledFunction;\n dateDisabledReason: DateRangePickerProps.DateDisabledReasonFunction;\n\n locale: string;\n}\n\nexport interface GridProps extends GridBaseProps {\n rangeStartDate: Date | null;\n rangeEndDate: Date | null;\n focusedDateRef: React.RefObject<HTMLTableCellElement>;\n\n onGridKeyDownHandler: (e: React.KeyboardEvent<HTMLElement>) => void;\n\n ariaLabelledby: string;\n className?: string;\n\n /**\n * Used to only add the dates of previous and next months outside the month pages\n */\n padDates: 'before' | 'after';\n currentMonthAriaLabel?: string;\n startOfWeek?: DayIndex;\n todayAriaLabel?: string;\n granularity: DateRangePickerProps.Granularity;\n}\n\nexport interface SelectGridProps extends GridBaseProps {\n /**\n * changes the page/view of the calendar. Doing so will change to another month or year\n * @param date\n * @returns\n */\n onPageChange: (date: Date) => void;\n\n isSingleGrid: boolean;\n\n headingIdPrefix: string;\n /**\n * not needed for grids with a month granularity\n */\n startOfWeek?: DayIndex;\n granularity?: DateRangePickerProps.Granularity;\n todayAriaLabel?: string;\n currentMonthAriaLabel?: string;\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DateRangePickerProps } from '../../interfaces';
|
|
2
|
+
export declare function setDayIndex(date: Date, dayIndex: number): void;
|
|
3
|
+
export declare function renderDayName(locale: string, dayIndex: number, mode: 'short' | 'long'): string;
|
|
4
|
+
export declare function renderMonthAndYear(locale: string, baseDate: Date): string;
|
|
5
|
+
export declare function renderYear(locale: string, date: Date): string;
|
|
6
|
+
export declare function getDateLabel(locale: string, date: Date, mode?: 'full' | 'short'): string;
|
|
7
|
+
export declare function renderTimeLabel(locale: string, date: Date, format?: DateRangePickerProps['timeInputFormat']): string;
|
|
8
|
+
interface RenderDateAnnouncementProps {
|
|
9
|
+
date: Date;
|
|
10
|
+
isCurrent: boolean;
|
|
11
|
+
locale: string;
|
|
12
|
+
granularity?: DateRangePickerProps['granularity'];
|
|
13
|
+
currentLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function renderDateAnnouncement({ date, isCurrent, locale, granularity, currentLabel, }: RenderDateAnnouncementProps): string;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=intl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intl.d.ts","sourceRoot":"","sources":["../../../../../src/date-range-picker/calendar/grids/intl.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAG9D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAI9F;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,GAAG,MAAM,CAOzE;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAI7D;AAGD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAE,MAAM,GAAG,OAAgB,GAAG,MAAM,CAchG;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAUpH;AAED,UAAU,2BAA2B;IACnC,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,SAAS,EACT,MAAM,EACN,WAAmB,EACnB,YAAY,GACb,EAAE,2BAA2B,GAAG,MAAM,CAStC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export function setDayIndex(date, dayIndex) {
|
|
2
|
+
const diff = dayIndex - date.getDay();
|
|
3
|
+
date.setDate(date.getDate() + diff);
|
|
4
|
+
}
|
|
5
|
+
export function renderDayName(locale, dayIndex, mode) {
|
|
6
|
+
const tempDate = new Date();
|
|
7
|
+
setDayIndex(tempDate, dayIndex);
|
|
8
|
+
return tempDate.toLocaleDateString(locale, { weekday: mode });
|
|
9
|
+
}
|
|
10
|
+
export function renderMonthAndYear(locale, baseDate) {
|
|
11
|
+
const result = baseDate.toLocaleDateString(locale, {
|
|
12
|
+
year: 'numeric',
|
|
13
|
+
month: 'long',
|
|
14
|
+
});
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
export function renderYear(locale, date) {
|
|
18
|
+
return date.toLocaleDateString(locale, {
|
|
19
|
+
year: 'numeric',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const dayLabelCache = new Map();
|
|
23
|
+
export function getDateLabel(locale, date, mode = 'full') {
|
|
24
|
+
const cacheKey = locale + date.getTime() + mode;
|
|
25
|
+
const cachedValue = dayLabelCache.get(cacheKey);
|
|
26
|
+
if (cachedValue) {
|
|
27
|
+
return cachedValue;
|
|
28
|
+
}
|
|
29
|
+
const value = date.toLocaleDateString(locale, {
|
|
30
|
+
weekday: mode === 'full' ? 'long' : undefined,
|
|
31
|
+
month: 'long',
|
|
32
|
+
day: 'numeric',
|
|
33
|
+
year: 'numeric',
|
|
34
|
+
});
|
|
35
|
+
dayLabelCache.set(cacheKey, value);
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
export function renderTimeLabel(locale, date, format) {
|
|
39
|
+
let options = {};
|
|
40
|
+
if (format === 'hh') {
|
|
41
|
+
options = { hour: '2-digit' };
|
|
42
|
+
}
|
|
43
|
+
if (format === 'hh:mm') {
|
|
44
|
+
options = { hour: '2-digit', minute: '2-digit' };
|
|
45
|
+
}
|
|
46
|
+
const value = date.toLocaleTimeString(locale, options);
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
export function renderDateAnnouncement({ date, isCurrent, locale, granularity = 'day', currentLabel, }) {
|
|
50
|
+
const formattedDate = granularity === 'month' ? renderMonthAndYear(locale, date) : getDateLabel(locale, date, 'short');
|
|
51
|
+
if (isCurrent && currentLabel) {
|
|
52
|
+
return `${formattedDate}. ${currentLabel}`;
|
|
53
|
+
}
|
|
54
|
+
return formattedDate;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=intl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intl.js","sourceRoot":"","sources":["../../../../../src/date-range-picker/calendar/grids/intl.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,WAAW,CAAC,IAAU,EAAE,QAAgB;IACtD,MAAM,IAAI,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACtC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,QAAgB,EAAE,IAAsB;IACpF,MAAM,QAAQ,GAAG,IAAI,IAAI,EAAE,CAAC;IAC5B,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAChC,OAAO,QAAQ,CAAC,kBAAkB,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAc,EAAE,QAAc;IAC/D,MAAM,MAAM,GAAG,QAAQ,CAAC,kBAAkB,CAAC,MAAM,EAAE;QACjD,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,MAAM;KACd,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,IAAU;IACnD,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE;QACrC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;IAC5B,MAAM,aAAa,GACjB,WAAW,KAAK,OAAO,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAEnG,IAAI,SAAS,IAAI,YAAY,EAAE;QAC7B,OAAO,GAAG,aAAa,KAAK,YAAY,EAAE,CAAC;KAC5C;IAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { DateRangePickerProps } from '../../interfaces';\n\nexport function setDayIndex(date: Date, dayIndex: number): void {\n const diff = dayIndex - date.getDay();\n date.setDate(date.getDate() + diff);\n}\n\nexport function renderDayName(locale: string, dayIndex: number, mode: 'short' | 'long'): string {\n const tempDate = new Date();\n setDayIndex(tempDate, dayIndex);\n return tempDate.toLocaleDateString(locale, { weekday: mode });\n}\n\nexport function renderMonthAndYear(locale: string, baseDate: Date): string {\n const result = baseDate.toLocaleDateString(locale, {\n year: 'numeric',\n month: 'long',\n });\n\n return result;\n}\n\nexport function renderYear(locale: string, date: Date): string {\n return date.toLocaleDateString(locale, {\n year: 'numeric',\n });\n}\n\nconst dayLabelCache = new Map<string, string>();\nexport function getDateLabel(locale: string, date: Date, mode: 'full' | 'short' = 'full'): string {\n const cacheKey = locale + date.getTime() + mode;\n const cachedValue = dayLabelCache.get(cacheKey);\n if (cachedValue) {\n return cachedValue;\n }\n const value = date.toLocaleDateString(locale, {\n weekday: mode === 'full' ? 'long' : undefined,\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n });\n dayLabelCache.set(cacheKey, value);\n return value;\n}\n\nexport function renderTimeLabel(locale: string, date: Date, format?: DateRangePickerProps['timeInputFormat']): string {\n let options: Intl.DateTimeFormatOptions = {};\n if (format === 'hh') {\n options = { hour: '2-digit' };\n }\n if (format === 'hh:mm') {\n options = { hour: '2-digit', minute: '2-digit' };\n }\n const value = date.toLocaleTimeString(locale, options);\n return value;\n}\n\ninterface RenderDateAnnouncementProps {\n date: Date;\n isCurrent: boolean;\n locale: string;\n granularity?: DateRangePickerProps['granularity'];\n currentLabel?: string;\n}\n\nexport function renderDateAnnouncement({\n date,\n isCurrent,\n locale,\n granularity = 'day',\n currentLabel,\n}: RenderDateAnnouncementProps): string {\n const formattedDate =\n granularity === 'month' ? renderMonthAndYear(locale, date) : getDateLabel(locale, date, 'short');\n\n if (isCurrent && currentLabel) {\n return `${formattedDate}. ${currentLabel}`;\n }\n\n return formattedDate;\n}\n"]}
|
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"grid": "
|
|
5
|
-
"grid-cell": "awsui_grid-
|
|
6
|
-
"day-header": "awsui_day-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"day-inner": "awsui_day-
|
|
10
|
-
"
|
|
11
|
-
"in-
|
|
12
|
-
"
|
|
13
|
-
"in-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"in-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"in-range
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
4
|
+
"grid": "awsui_grid_1mfbn_qy2o7_149",
|
|
5
|
+
"grid-cell": "awsui_grid-cell_1mfbn_qy2o7_154",
|
|
6
|
+
"day-header": "awsui_day-header_1mfbn_qy2o7_161",
|
|
7
|
+
"day": "awsui_day_1mfbn_qy2o7_161",
|
|
8
|
+
"month": "awsui_month_1mfbn_qy2o7_172",
|
|
9
|
+
"day-inner": "awsui_day-inner_1mfbn_qy2o7_220",
|
|
10
|
+
"month-inner": "awsui_month-inner_1mfbn_qy2o7_221",
|
|
11
|
+
"in-first-row": "awsui_in-first-row_1mfbn_qy2o7_228",
|
|
12
|
+
"in-previous-month": "awsui_in-previous-month_1mfbn_qy2o7_228",
|
|
13
|
+
"in-previous-year": "awsui_in-previous-year_1mfbn_qy2o7_229",
|
|
14
|
+
"last-day-of-month": "awsui_last-day-of-month_1mfbn_qy2o7_233",
|
|
15
|
+
"last-month-of-year": "awsui_last-month-of-year_1mfbn_qy2o7_234",
|
|
16
|
+
"in-next-month": "awsui_in-next-month_1mfbn_qy2o7_238",
|
|
17
|
+
"in-next-year": "awsui_in-next-year_1mfbn_qy2o7_239",
|
|
18
|
+
"in-first-column": "awsui_in-first-column_1mfbn_qy2o7_243",
|
|
19
|
+
"in-visible-calendar": "awsui_in-visible-calendar_1mfbn_qy2o7_246",
|
|
20
|
+
"in-current-month": "awsui_in-current-month_1mfbn_qy2o7_246",
|
|
21
|
+
"in-current-year": "awsui_in-current-year_1mfbn_qy2o7_246",
|
|
22
|
+
"enabled": "awsui_enabled_1mfbn_qy2o7_250",
|
|
23
|
+
"in-range": "awsui_in-range_1mfbn_qy2o7_256",
|
|
24
|
+
"end-date": "awsui_end-date_1mfbn_qy2o7_256",
|
|
25
|
+
"start-date": "awsui_start-date_1mfbn_qy2o7_256",
|
|
26
|
+
"no-range": "awsui_no-range_1mfbn_qy2o7_256",
|
|
27
|
+
"selected": "awsui_selected_1mfbn_qy2o7_266",
|
|
28
|
+
"today": "awsui_today_1mfbn_qy2o7_271",
|
|
29
|
+
"this-month": "awsui_this-month_1mfbn_qy2o7_272",
|
|
30
|
+
"in-range-border-block-start": "awsui_in-range-border-block-start_1mfbn_qy2o7_328",
|
|
31
|
+
"in-range-border-inline-end": "awsui_in-range-border-inline-end_1mfbn_qy2o7_331",
|
|
32
|
+
"in-range-border-block-end": "awsui_in-range-border-block-end_1mfbn_qy2o7_334",
|
|
33
|
+
"in-range-border-inline-start": "awsui_in-range-border-inline-start_1mfbn_qy2o7_337"
|
|
28
34
|
};
|
|
29
35
|
|
|
@@ -146,19 +146,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
146
146
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
147
147
|
SPDX-License-Identifier: Apache-2.0
|
|
148
148
|
*/
|
|
149
|
-
.
|
|
149
|
+
.awsui_grid_1mfbn_qy2o7_149:not(#\9) {
|
|
150
150
|
inline-size: var(--size-calendar-grid-width-lrunz7, 238px);
|
|
151
151
|
border-spacing: 0;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
.awsui_grid-
|
|
154
|
+
.awsui_grid-cell_1mfbn_qy2o7_154:not(#\9) {
|
|
155
155
|
inline-size: 14.2857142857%;
|
|
156
156
|
word-break: break-word;
|
|
157
157
|
text-align: center;
|
|
158
158
|
font-weight: unset;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
.awsui_day-
|
|
161
|
+
.awsui_day-header_1mfbn_qy2o7_161:not(#\9) {
|
|
162
162
|
padding-block-start: var(--space-s-34lx8l, 12px);
|
|
163
163
|
padding-block-end: var(--space-xxs-p8yyaw, 4px);
|
|
164
164
|
padding-inline: 0;
|
|
@@ -168,11 +168,8 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
168
168
|
letter-spacing: var(--letter-spacing-body-s-z9jkwp, 0.005em);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
.
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.awsui_day_1mfbn_x3enr_161:not(#\9) {
|
|
171
|
+
.awsui_day_1mfbn_qy2o7_161:not(#\9),
|
|
172
|
+
.awsui_month_1mfbn_qy2o7_172:not(#\9) {
|
|
176
173
|
border-block-end: 1px solid var(--color-border-calendar-grid-u86q1u, transparent);
|
|
177
174
|
border-inline-end: 1px solid var(--color-border-calendar-grid-u86q1u, transparent);
|
|
178
175
|
padding-block: var(--space-xxs-p8yyaw, 4px);
|
|
@@ -180,10 +177,12 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
180
177
|
color: var(--color-text-dropdown-item-disabled-7fg5u8, #b4b4bb);
|
|
181
178
|
position: relative;
|
|
182
179
|
}
|
|
183
|
-
.
|
|
180
|
+
.awsui_day_1mfbn_qy2o7_161:not(#\9):focus,
|
|
181
|
+
.awsui_month_1mfbn_qy2o7_172:not(#\9):focus {
|
|
184
182
|
outline: none;
|
|
185
183
|
}
|
|
186
|
-
.
|
|
184
|
+
.awsui_day_1mfbn_qy2o7_161:not(#\9)::after,
|
|
185
|
+
.awsui_month_1mfbn_qy2o7_172:not(#\9)::after {
|
|
187
186
|
content: "";
|
|
188
187
|
position: absolute;
|
|
189
188
|
z-index: 1;
|
|
@@ -193,15 +192,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
193
192
|
inset-inline-end: calc(-1 * var(--border-item-width-yel47s, 2px));
|
|
194
193
|
background-color: transparent;
|
|
195
194
|
}
|
|
196
|
-
body[data-awsui-focus-visible=true] .
|
|
195
|
+
body[data-awsui-focus-visible=true] .awsui_day_1mfbn_qy2o7_161:not(#\9):focus,
|
|
196
|
+
body[data-awsui-focus-visible=true] .awsui_month_1mfbn_qy2o7_172:not(#\9):focus {
|
|
197
197
|
z-index: 2;
|
|
198
198
|
position: relative;
|
|
199
199
|
}
|
|
200
|
-
body[data-awsui-focus-visible=true] .
|
|
200
|
+
body[data-awsui-focus-visible=true] .awsui_day_1mfbn_qy2o7_161:not(#\9):focus,
|
|
201
|
+
body[data-awsui-focus-visible=true] .awsui_month_1mfbn_qy2o7_172:not(#\9):focus {
|
|
201
202
|
outline: 2px dotted transparent;
|
|
202
203
|
outline-offset: calc(var(--space-calendar-grid-focus-outline-gutter-g00bgj, -5px) - 1px);
|
|
203
204
|
}
|
|
204
|
-
body[data-awsui-focus-visible=true] .
|
|
205
|
+
body[data-awsui-focus-visible=true] .awsui_day_1mfbn_qy2o7_161:not(#\9):focus::before,
|
|
206
|
+
body[data-awsui-focus-visible=true] .awsui_month_1mfbn_qy2o7_172:not(#\9):focus::before {
|
|
205
207
|
content: " ";
|
|
206
208
|
display: block;
|
|
207
209
|
position: absolute;
|
|
@@ -215,52 +217,59 @@ body[data-awsui-focus-visible=true] .awsui_day_1mfbn_x3enr_161:not(#\9):focus::b
|
|
|
215
217
|
border-end-end-radius: var(--border-radius-calendar-day-focus-ring-545h0w, 3px);
|
|
216
218
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-nv6mhz, #006ce0);
|
|
217
219
|
}
|
|
218
|
-
.
|
|
220
|
+
.awsui_day_1mfbn_qy2o7_161 > .awsui_day-inner_1mfbn_qy2o7_220:not(#\9),
|
|
221
|
+
.awsui_day_1mfbn_qy2o7_161 > .awsui_month-inner_1mfbn_qy2o7_221:not(#\9),
|
|
222
|
+
.awsui_month_1mfbn_qy2o7_172 > .awsui_day-inner_1mfbn_qy2o7_220:not(#\9),
|
|
223
|
+
.awsui_month_1mfbn_qy2o7_172 > .awsui_month-inner_1mfbn_qy2o7_221:not(#\9) {
|
|
219
224
|
position: relative;
|
|
220
225
|
z-index: 1;
|
|
221
226
|
}
|
|
222
227
|
|
|
223
|
-
.awsui_in-first-
|
|
228
|
+
.awsui_in-first-row_1mfbn_qy2o7_228:not(#\9):not(.awsui_in-previous-month_1mfbn_qy2o7_228),
|
|
229
|
+
.awsui_in-first-row_1mfbn_qy2o7_228:not(#\9):not(.awsui_in-previous-year_1mfbn_qy2o7_229) {
|
|
224
230
|
border-block-start: 1px solid var(--color-border-calendar-grid-u86q1u, transparent);
|
|
225
231
|
}
|
|
226
232
|
|
|
227
|
-
.awsui_in-previous-
|
|
233
|
+
.awsui_in-previous-month_1mfbn_qy2o7_228:not(#\9):not(.awsui_last-day-of-month_1mfbn_qy2o7_233),
|
|
234
|
+
.awsui_in-previous-year_1mfbn_qy2o7_229:not(#\9):not(.awsui_last-month-of-year_1mfbn_qy2o7_234) {
|
|
228
235
|
border-inline-end-color: transparent;
|
|
229
236
|
}
|
|
230
237
|
|
|
231
|
-
.awsui_in-next-
|
|
238
|
+
.awsui_in-next-month_1mfbn_qy2o7_238:not(#\9),
|
|
239
|
+
.awsui_in-next-year_1mfbn_qy2o7_239:not(#\9) {
|
|
232
240
|
border-color: transparent;
|
|
233
241
|
}
|
|
234
242
|
|
|
235
|
-
.awsui_in-first-
|
|
243
|
+
.awsui_in-first-column_1mfbn_qy2o7_243:not(#\9) {
|
|
236
244
|
border-inline-start: 1px solid 1px solid var(--color-border-calendar-grid-u86q1u, transparent);
|
|
237
245
|
}
|
|
238
|
-
.awsui_in-first-
|
|
246
|
+
.awsui_in-first-column_1mfbn_qy2o7_243.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246:not(#\9), .awsui_in-first-column_1mfbn_qy2o7_243.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246:not(#\9) {
|
|
239
247
|
border-inline-start: 1px solid var(--color-border-calendar-grid-u86q1u, transparent);
|
|
240
248
|
}
|
|
241
249
|
|
|
242
|
-
.
|
|
250
|
+
.awsui_enabled_1mfbn_qy2o7_250:not(#\9) {
|
|
243
251
|
cursor: pointer;
|
|
244
252
|
}
|
|
245
|
-
.
|
|
253
|
+
.awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246:not(#\9), .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246:not(#\9) {
|
|
246
254
|
color: var(--color-text-dropdown-item-default-wpxsrk, #0f141a);
|
|
247
255
|
}
|
|
248
|
-
.
|
|
256
|
+
.awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246:not(#\9):not(.awsui_in-range_1mfbn_qy2o7_256), .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246:not(#\9):not(.awsui_in-range_1mfbn_qy2o7_256)::after, .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246.awsui_end-date_1mfbn_qy2o7_256.awsui_start-date_1mfbn_qy2o7_256:not(#\9), .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246.awsui_end-date_1mfbn_qy2o7_256.awsui_start-date_1mfbn_qy2o7_256:not(#\9)::after, .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246.awsui_no-range_1mfbn_qy2o7_256:not(#\9), .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246.awsui_no-range_1mfbn_qy2o7_256:not(#\9)::after, .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246:not(#\9):not(.awsui_in-range_1mfbn_qy2o7_256), .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246:not(#\9):not(.awsui_in-range_1mfbn_qy2o7_256)::after, .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246.awsui_end-date_1mfbn_qy2o7_256.awsui_start-date_1mfbn_qy2o7_256:not(#\9), .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246.awsui_end-date_1mfbn_qy2o7_256.awsui_start-date_1mfbn_qy2o7_256:not(#\9)::after, .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246.awsui_no-range_1mfbn_qy2o7_256:not(#\9), .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246.awsui_no-range_1mfbn_qy2o7_256:not(#\9)::after {
|
|
249
257
|
border-start-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
250
258
|
border-start-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
251
259
|
border-end-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
252
260
|
border-end-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
253
261
|
}
|
|
254
|
-
.
|
|
262
|
+
.awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246:not(#\9):hover, .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246:not(#\9):hover {
|
|
255
263
|
color: var(--color-text-calendar-date-hover-qiity9, #0f141a);
|
|
256
264
|
background-color: var(--color-background-dropdown-item-hover-zhzc84, #f3f3f7);
|
|
257
265
|
}
|
|
258
|
-
.
|
|
266
|
+
.awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-month_1mfbn_qy2o7_246:not(#\9):hover:not(.awsui_selected_1mfbn_qy2o7_266)::after, .awsui_enabled_1mfbn_qy2o7_250.awsui_in-visible-calendar_1mfbn_qy2o7_246.awsui_in-current-year_1mfbn_qy2o7_246:not(#\9):hover:not(.awsui_selected_1mfbn_qy2o7_266)::after {
|
|
259
267
|
border-block: var(--border-item-width-yel47s, 2px) solid var(--color-border-dropdown-item-hover-4p0gsi, #8c8c94);
|
|
260
268
|
border-inline: var(--border-item-width-yel47s, 2px) solid var(--color-border-dropdown-item-hover-4p0gsi, #8c8c94);
|
|
261
269
|
}
|
|
262
270
|
|
|
263
|
-
.
|
|
271
|
+
.awsui_today_1mfbn_qy2o7_271:not(#\9):not(.awsui_in-range_1mfbn_qy2o7_256),
|
|
272
|
+
.awsui_this-month_1mfbn_qy2o7_272:not(#\9):not(.awsui_in-range_1mfbn_qy2o7_256) {
|
|
264
273
|
background-color: var(--color-background-calendar-current-date-a6ucrp, #f3f3f7);
|
|
265
274
|
border-start-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
266
275
|
border-start-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
@@ -269,20 +278,20 @@ body[data-awsui-focus-visible=true] .awsui_day_1mfbn_x3enr_161:not(#\9):focus::b
|
|
|
269
278
|
font-weight: 700;
|
|
270
279
|
}
|
|
271
280
|
|
|
272
|
-
.
|
|
281
|
+
.awsui_selected_1mfbn_qy2o7_266:not(#\9) {
|
|
273
282
|
border-color: transparent;
|
|
274
283
|
position: relative;
|
|
275
284
|
z-index: 2;
|
|
276
285
|
font-weight: 700;
|
|
277
286
|
}
|
|
278
|
-
body[data-awsui-focus-visible=true] .
|
|
287
|
+
body[data-awsui-focus-visible=true] .awsui_selected_1mfbn_qy2o7_266:not(#\9):focus {
|
|
279
288
|
position: relative;
|
|
280
289
|
}
|
|
281
|
-
body[data-awsui-focus-visible=true] .
|
|
290
|
+
body[data-awsui-focus-visible=true] .awsui_selected_1mfbn_qy2o7_266:not(#\9):focus {
|
|
282
291
|
outline: 2px dotted transparent;
|
|
283
292
|
outline-offset: calc(var(--space-calendar-grid-selected-focus-outline-gutter-hxbct6, -5px) - 1px);
|
|
284
293
|
}
|
|
285
|
-
body[data-awsui-focus-visible=true] .
|
|
294
|
+
body[data-awsui-focus-visible=true] .awsui_selected_1mfbn_qy2o7_266:not(#\9):focus::before {
|
|
286
295
|
content: " ";
|
|
287
296
|
display: block;
|
|
288
297
|
position: absolute;
|
|
@@ -296,53 +305,60 @@ body[data-awsui-focus-visible=true] .awsui_selected_1mfbn_x3enr_258:not(#\9):foc
|
|
|
296
305
|
border-end-end-radius: var(--border-radius-calendar-day-focus-ring-545h0w, 3px);
|
|
297
306
|
box-shadow: 0 0 0 2px var(--color-border-calendar-grid-selected-focus-ring-w7gc9h, #f9f9fa);
|
|
298
307
|
}
|
|
299
|
-
body[data-awsui-focus-visible=true] .
|
|
308
|
+
body[data-awsui-focus-visible=true] .awsui_selected_1mfbn_qy2o7_266:not(#\9):focus::before {
|
|
300
309
|
z-index: 1;
|
|
301
310
|
}
|
|
302
|
-
.
|
|
311
|
+
.awsui_selected_1mfbn_qy2o7_266:not(#\9)::after {
|
|
303
312
|
background-color: var(--color-background-control-checked-hz4k40, #006ce0);
|
|
304
313
|
border-block: var(--border-item-width-yel47s, 2px) solid var(--color-background-control-checked-hz4k40, #006ce0);
|
|
305
314
|
border-inline: var(--border-item-width-yel47s, 2px) solid var(--color-background-control-checked-hz4k40, #006ce0);
|
|
306
315
|
z-index: 0;
|
|
307
316
|
}
|
|
308
|
-
.
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
.awsui_selected_1mfbn_x3enr_258 > .awsui_day-inner_1mfbn_x3enr_218:not(#\9) {
|
|
317
|
+
.awsui_selected_1mfbn_qy2o7_266 > .awsui_day-inner_1mfbn_qy2o7_220:not(#\9),
|
|
318
|
+
.awsui_selected_1mfbn_qy2o7_266 > .awsui_month-inner_1mfbn_qy2o7_221:not(#\9) {
|
|
312
319
|
color: var(--color-background-control-default-5ol8rv, #ffffff);
|
|
313
320
|
position: relative;
|
|
314
321
|
z-index: 2;
|
|
315
322
|
}
|
|
316
323
|
|
|
317
|
-
.awsui_in-
|
|
324
|
+
.awsui_in-range_1mfbn_qy2o7_256:not(#\9) {
|
|
318
325
|
background-color: var(--color-background-dropdown-item-selected-idfej7, #f0fbff);
|
|
319
326
|
font-weight: 700;
|
|
320
327
|
}
|
|
321
|
-
.awsui_in-
|
|
328
|
+
.awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-start_1mfbn_qy2o7_328:not(#\9)::after {
|
|
322
329
|
border-block-start: var(--border-item-width-yel47s, 2px) solid var(--color-background-control-checked-hz4k40, #006ce0);
|
|
323
330
|
}
|
|
324
|
-
.awsui_in-
|
|
331
|
+
.awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-inline-end_1mfbn_qy2o7_331:not(#\9)::after {
|
|
325
332
|
border-inline-end: var(--border-item-width-yel47s, 2px) solid var(--color-background-control-checked-hz4k40, #006ce0);
|
|
326
333
|
}
|
|
327
|
-
.awsui_in-
|
|
334
|
+
.awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-end_1mfbn_qy2o7_334:not(#\9)::after {
|
|
328
335
|
border-block-end: var(--border-item-width-yel47s, 2px) solid var(--color-background-control-checked-hz4k40, #006ce0);
|
|
329
336
|
}
|
|
330
|
-
.awsui_in-
|
|
337
|
+
.awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-inline-start_1mfbn_qy2o7_337:not(#\9)::after {
|
|
331
338
|
border-inline-start: var(--border-item-width-yel47s, 2px) solid var(--color-background-control-checked-hz4k40, #006ce0);
|
|
332
339
|
}
|
|
333
|
-
.awsui_in-
|
|
340
|
+
.awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-start_1mfbn_qy2o7_328.awsui_in-range-border-inline-end_1mfbn_qy2o7_331:not(#\9), .awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-start_1mfbn_qy2o7_328.awsui_in-range-border-inline-end_1mfbn_qy2o7_331:not(#\9)::after {
|
|
334
341
|
border-start-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
335
342
|
}
|
|
336
|
-
.awsui_in-
|
|
343
|
+
.awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-end_1mfbn_qy2o7_334.awsui_in-range-border-inline-end_1mfbn_qy2o7_331:not(#\9), .awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-end_1mfbn_qy2o7_334.awsui_in-range-border-inline-end_1mfbn_qy2o7_331:not(#\9)::after {
|
|
337
344
|
border-end-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
338
345
|
}
|
|
339
|
-
.awsui_in-
|
|
346
|
+
.awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-end_1mfbn_qy2o7_334.awsui_in-range-border-inline-start_1mfbn_qy2o7_337:not(#\9), .awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-end_1mfbn_qy2o7_334.awsui_in-range-border-inline-start_1mfbn_qy2o7_337:not(#\9)::after {
|
|
340
347
|
border-end-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
341
348
|
}
|
|
342
|
-
.awsui_in-
|
|
349
|
+
.awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-start_1mfbn_qy2o7_328.awsui_in-range-border-inline-start_1mfbn_qy2o7_337:not(#\9), .awsui_in-range_1mfbn_qy2o7_256.awsui_in-range-border-block-start_1mfbn_qy2o7_328.awsui_in-range-border-inline-start_1mfbn_qy2o7_337:not(#\9)::after {
|
|
343
350
|
border-start-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
344
351
|
}
|
|
345
352
|
|
|
346
|
-
.
|
|
347
|
-
|
|
353
|
+
.awsui_no-range_1mfbn_qy2o7_256:not(#\9), .awsui_no-range_1mfbn_qy2o7_256:not(#\9)::after {
|
|
354
|
+
border-start-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
355
|
+
}
|
|
356
|
+
.awsui_no-range_1mfbn_qy2o7_256:not(#\9), .awsui_no-range_1mfbn_qy2o7_256:not(#\9)::after {
|
|
357
|
+
border-start-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
358
|
+
}
|
|
359
|
+
.awsui_no-range_1mfbn_qy2o7_256:not(#\9), .awsui_no-range_1mfbn_qy2o7_256:not(#\9)::after {
|
|
360
|
+
border-end-start-radius: var(--border-radius-item-05df9h, 8px);
|
|
361
|
+
}
|
|
362
|
+
.awsui_no-range_1mfbn_qy2o7_256:not(#\9), .awsui_no-range_1mfbn_qy2o7_256:not(#\9)::after {
|
|
363
|
+
border-end-end-radius: var(--border-radius-item-05df9h, 8px);
|
|
348
364
|
}
|
|
@@ -2,29 +2,35 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"grid": "
|
|
6
|
-
"grid-cell": "awsui_grid-
|
|
7
|
-
"day-header": "awsui_day-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"day-inner": "awsui_day-
|
|
11
|
-
"
|
|
12
|
-
"in-
|
|
13
|
-
"
|
|
14
|
-
"in-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"in-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"in-range
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
5
|
+
"grid": "awsui_grid_1mfbn_qy2o7_149",
|
|
6
|
+
"grid-cell": "awsui_grid-cell_1mfbn_qy2o7_154",
|
|
7
|
+
"day-header": "awsui_day-header_1mfbn_qy2o7_161",
|
|
8
|
+
"day": "awsui_day_1mfbn_qy2o7_161",
|
|
9
|
+
"month": "awsui_month_1mfbn_qy2o7_172",
|
|
10
|
+
"day-inner": "awsui_day-inner_1mfbn_qy2o7_220",
|
|
11
|
+
"month-inner": "awsui_month-inner_1mfbn_qy2o7_221",
|
|
12
|
+
"in-first-row": "awsui_in-first-row_1mfbn_qy2o7_228",
|
|
13
|
+
"in-previous-month": "awsui_in-previous-month_1mfbn_qy2o7_228",
|
|
14
|
+
"in-previous-year": "awsui_in-previous-year_1mfbn_qy2o7_229",
|
|
15
|
+
"last-day-of-month": "awsui_last-day-of-month_1mfbn_qy2o7_233",
|
|
16
|
+
"last-month-of-year": "awsui_last-month-of-year_1mfbn_qy2o7_234",
|
|
17
|
+
"in-next-month": "awsui_in-next-month_1mfbn_qy2o7_238",
|
|
18
|
+
"in-next-year": "awsui_in-next-year_1mfbn_qy2o7_239",
|
|
19
|
+
"in-first-column": "awsui_in-first-column_1mfbn_qy2o7_243",
|
|
20
|
+
"in-visible-calendar": "awsui_in-visible-calendar_1mfbn_qy2o7_246",
|
|
21
|
+
"in-current-month": "awsui_in-current-month_1mfbn_qy2o7_246",
|
|
22
|
+
"in-current-year": "awsui_in-current-year_1mfbn_qy2o7_246",
|
|
23
|
+
"enabled": "awsui_enabled_1mfbn_qy2o7_250",
|
|
24
|
+
"in-range": "awsui_in-range_1mfbn_qy2o7_256",
|
|
25
|
+
"end-date": "awsui_end-date_1mfbn_qy2o7_256",
|
|
26
|
+
"start-date": "awsui_start-date_1mfbn_qy2o7_256",
|
|
27
|
+
"no-range": "awsui_no-range_1mfbn_qy2o7_256",
|
|
28
|
+
"selected": "awsui_selected_1mfbn_qy2o7_266",
|
|
29
|
+
"today": "awsui_today_1mfbn_qy2o7_271",
|
|
30
|
+
"this-month": "awsui_this-month_1mfbn_qy2o7_272",
|
|
31
|
+
"in-range-border-block-start": "awsui_in-range-border-block-start_1mfbn_qy2o7_328",
|
|
32
|
+
"in-range-border-inline-end": "awsui_in-range-border-inline-end_1mfbn_qy2o7_331",
|
|
33
|
+
"in-range-border-block-end": "awsui_in-range-border-block-end_1mfbn_qy2o7_334",
|
|
34
|
+
"in-range-border-inline-start": "awsui_in-range-border-inline-start_1mfbn_qy2o7_337"
|
|
29
35
|
};
|
|
30
36
|
|