@cloudscape-design/components 3.0.296 → 3.0.298
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/alert/interfaces.d.ts +1 -0
- package/alert/interfaces.d.ts.map +1 -1
- package/alert/interfaces.js.map +1 -1
- package/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +30 -30
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/interfaces.d.ts +1 -0
- package/app-layout/interfaces.d.ts.map +1 -1
- package/app-layout/interfaces.js.map +1 -1
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/visual-refresh/background.d.ts +1 -5
- package/app-layout/visual-refresh/background.d.ts.map +1 -1
- package/app-layout/visual-refresh/background.js +8 -13
- package/app-layout/visual-refresh/background.js.map +1 -1
- package/app-layout/visual-refresh/breadcrumbs.d.ts +3 -0
- package/app-layout/visual-refresh/breadcrumbs.d.ts.map +1 -0
- package/app-layout/visual-refresh/breadcrumbs.js +17 -0
- package/app-layout/visual-refresh/breadcrumbs.js.map +1 -0
- package/app-layout/visual-refresh/context.js +3 -3
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/header.d.ts +0 -4
- package/app-layout/visual-refresh/header.d.ts.map +1 -1
- package/app-layout/visual-refresh/header.js +0 -4
- package/app-layout/visual-refresh/header.js.map +1 -1
- package/app-layout/visual-refresh/index.d.ts +0 -8
- package/app-layout/visual-refresh/index.d.ts.map +1 -1
- package/app-layout/visual-refresh/index.js +4 -13
- package/app-layout/visual-refresh/index.js.map +1 -1
- package/app-layout/visual-refresh/layout.d.ts.map +1 -1
- package/app-layout/visual-refresh/layout.js +31 -19
- package/app-layout/visual-refresh/layout.js.map +1 -1
- package/app-layout/visual-refresh/main.d.ts.map +1 -1
- package/app-layout/visual-refresh/main.js +2 -6
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/mobile-toolbar.d.ts +3 -0
- package/app-layout/visual-refresh/mobile-toolbar.d.ts.map +1 -0
- package/app-layout/visual-refresh/{app-bar.js → mobile-toolbar.js} +9 -18
- package/app-layout/visual-refresh/mobile-toolbar.js.map +1 -0
- package/app-layout/visual-refresh/navigation.js +1 -1
- package/app-layout/visual-refresh/navigation.js.map +1 -1
- package/app-layout/visual-refresh/notifications.d.ts +0 -4
- package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
- package/app-layout/visual-refresh/notifications.js +4 -9
- package/app-layout/visual-refresh/notifications.js.map +1 -1
- package/app-layout/visual-refresh/split-panel.js +1 -1
- package/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +68 -72
- package/app-layout/visual-refresh/styles.scoped.css +400 -576
- package/app-layout/visual-refresh/styles.selectors.js +68 -72
- package/attribute-editor/interfaces.d.ts +2 -1
- package/attribute-editor/interfaces.d.ts.map +1 -1
- package/attribute-editor/interfaces.js.map +1 -1
- package/attribute-editor/row.d.ts +1 -1
- package/attribute-editor/row.d.ts.map +1 -1
- package/attribute-editor/row.js +3 -1
- package/attribute-editor/row.js.map +1 -1
- package/autosuggest/autosuggest-option.d.ts +1 -1
- package/autosuggest/autosuggest-option.d.ts.map +1 -1
- package/autosuggest/autosuggest-option.js +3 -1
- package/autosuggest/autosuggest-option.js.map +1 -1
- package/autosuggest/interfaces.d.ts +3 -1
- package/autosuggest/interfaces.d.ts.map +1 -1
- package/autosuggest/interfaces.js.map +1 -1
- package/autosuggest/internal.d.ts.map +1 -1
- package/autosuggest/internal.js +4 -0
- package/autosuggest/internal.js.map +1 -1
- package/autosuggest/plain-list.d.ts +1 -1
- package/autosuggest/plain-list.d.ts.map +1 -1
- package/autosuggest/plain-list.js.map +1 -1
- package/breadcrumb-group/interfaces.d.ts +1 -0
- package/breadcrumb-group/interfaces.d.ts.map +1 -1
- package/breadcrumb-group/interfaces.js.map +1 -1
- package/calendar/interfaces.d.ts +3 -0
- package/calendar/interfaces.d.ts.map +1 -1
- package/calendar/interfaces.js.map +1 -1
- package/cards/interfaces.d.ts +1 -0
- package/cards/interfaces.d.ts.map +1 -1
- package/cards/interfaces.js.map +1 -1
- package/cards/styles.css.js +37 -37
- package/cards/styles.scoped.css +53 -53
- package/cards/styles.selectors.js +37 -37
- package/code-editor/interfaces.d.ts +1 -0
- package/code-editor/interfaces.d.ts.map +1 -1
- package/code-editor/interfaces.js.map +1 -1
- package/collection-preferences/content-display/index.d.ts.map +1 -1
- package/collection-preferences/content-display/index.js +14 -9
- package/collection-preferences/content-display/index.js.map +1 -1
- package/collection-preferences/index.d.ts.map +1 -1
- package/collection-preferences/index.js +6 -4
- package/collection-preferences/index.js.map +1 -1
- package/collection-preferences/interfaces.d.ts +21 -12
- package/collection-preferences/interfaces.d.ts.map +1 -1
- package/collection-preferences/interfaces.js.map +1 -1
- package/collection-preferences/utils.d.ts +1 -1
- package/collection-preferences/utils.d.ts.map +1 -1
- package/collection-preferences/utils.js +19 -6
- package/collection-preferences/utils.js.map +1 -1
- package/content-layout/internal.d.ts.map +1 -1
- package/content-layout/internal.js +1 -3
- package/content-layout/internal.js.map +1 -1
- package/content-layout/styles.css.js +6 -7
- package/content-layout/styles.scoped.css +9 -19
- package/content-layout/styles.selectors.js +6 -7
- package/date-range-picker/calendar/grids/grid.d.ts +1 -1
- package/date-range-picker/calendar/grids/grid.d.ts.map +1 -1
- 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/header-button.d.ts +1 -1
- package/date-range-picker/calendar/header/header-button.d.ts.map +1 -1
- package/date-range-picker/calendar/header/header-button.js.map +1 -1
- package/date-range-picker/calendar/header/index.d.ts +2 -2
- package/date-range-picker/calendar/header/index.d.ts.map +1 -1
- package/date-range-picker/calendar/header/index.js.map +1 -1
- package/date-range-picker/calendar/index.d.ts +1 -1
- package/date-range-picker/calendar/index.d.ts.map +1 -1
- package/date-range-picker/calendar/index.js +11 -8
- package/date-range-picker/calendar/index.js.map +1 -1
- package/date-range-picker/calendar/range-inputs.d.ts +1 -1
- package/date-range-picker/calendar/range-inputs.d.ts.map +1 -1
- package/date-range-picker/calendar/range-inputs.js +7 -5
- package/date-range-picker/calendar/range-inputs.js.map +1 -1
- package/date-range-picker/dropdown.d.ts +2 -1
- package/date-range-picker/dropdown.d.ts.map +1 -1
- package/date-range-picker/dropdown.js +7 -5
- 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 +13 -4
- package/date-range-picker/index.js.map +1 -1
- package/date-range-picker/interfaces.d.ts +22 -21
- 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.d.ts +1 -1
- package/date-range-picker/mode-switcher.d.ts.map +1 -1
- package/date-range-picker/mode-switcher.js +4 -2
- package/date-range-picker/mode-switcher.js.map +1 -1
- package/date-range-picker/relative-range/index.d.ts +1 -1
- package/date-range-picker/relative-range/index.d.ts.map +1 -1
- package/date-range-picker/relative-range/index.js +14 -10
- package/date-range-picker/relative-range/index.js.map +1 -1
- package/expandable-section/interfaces.d.ts +1 -1
- package/expandable-section/interfaces.js.map +1 -1
- package/flashbar/interfaces.d.ts +1 -0
- package/flashbar/interfaces.d.ts.map +1 -1
- package/flashbar/interfaces.js.map +1 -1
- package/flashbar/styles.css.js +45 -45
- package/flashbar/styles.scoped.css +169 -169
- package/flashbar/styles.selectors.js +45 -45
- package/form/interfaces.d.ts +1 -0
- package/form/interfaces.d.ts.map +1 -1
- package/form/interfaces.js.map +1 -1
- package/form-field/interfaces.d.ts +1 -0
- package/form-field/interfaces.d.ts.map +1 -1
- package/form-field/interfaces.js.map +1 -1
- package/help-panel/interfaces.d.ts +1 -0
- package/help-panel/interfaces.d.ts.map +1 -1
- package/help-panel/interfaces.js.map +1 -1
- package/i18n/context.d.ts +20 -0
- package/i18n/context.d.ts.map +1 -0
- package/i18n/context.js +17 -0
- package/i18n/context.js.map +1 -0
- package/i18n/index.d.ts +2 -0
- package/i18n/index.d.ts.map +1 -0
- package/i18n/index.js +4 -0
- package/i18n/index.js.map +1 -0
- package/i18n/messages/all.all.d.ts +3 -0
- package/i18n/messages/all.all.js +5473 -0
- package/i18n/messages/all.all.json +5518 -0
- package/i18n/messages/all.de.d.ts +3 -0
- package/i18n/messages/all.de.js +446 -0
- package/i18n/messages/all.de.json +454 -0
- package/i18n/messages/all.en-GB.d.ts +3 -0
- package/i18n/messages/all.en-GB.js +436 -0
- package/i18n/messages/all.en-GB.json +439 -0
- package/i18n/messages/all.en.d.ts +3 -0
- package/i18n/messages/all.en.js +722 -0
- package/i18n/messages/all.en.json +721 -0
- package/i18n/messages/all.es.d.ts +3 -0
- package/i18n/messages/all.es.js +437 -0
- package/i18n/messages/all.es.json +439 -0
- package/i18n/messages/all.fr.d.ts +3 -0
- package/i18n/messages/all.fr.js +451 -0
- package/i18n/messages/all.fr.json +452 -0
- package/i18n/messages/all.id.d.ts +3 -0
- package/i18n/messages/all.id.js +427 -0
- package/i18n/messages/all.id.json +435 -0
- package/i18n/messages/all.it.d.ts +3 -0
- package/i18n/messages/all.it.js +437 -0
- package/i18n/messages/all.it.json +441 -0
- package/i18n/messages/all.ja.d.ts +3 -0
- package/i18n/messages/all.ja.js +441 -0
- package/i18n/messages/all.ja.json +445 -0
- package/i18n/messages/all.ko.d.ts +3 -0
- package/i18n/messages/all.ko.js +419 -0
- package/i18n/messages/all.ko.json +426 -0
- package/i18n/messages/all.pt-BR.d.ts +3 -0
- package/i18n/messages/all.pt-BR.js +444 -0
- package/i18n/messages/all.pt-BR.json +443 -0
- package/i18n/messages/all.zh-CN.d.ts +3 -0
- package/i18n/messages/all.zh-CN.js +429 -0
- package/i18n/messages/all.zh-CN.json +434 -0
- package/i18n/messages/all.zh-TW.d.ts +3 -0
- package/i18n/messages/all.zh-TW.js +428 -0
- package/i18n/messages/all.zh-TW.json +433 -0
- package/i18n/provider.d.ts +20 -0
- package/i18n/provider.d.ts.map +1 -0
- package/i18n/provider.js +105 -0
- package/i18n/provider.js.map +1 -0
- package/i18n/testing.d.ts +8 -0
- package/i18n/testing.d.ts.map +1 -0
- package/i18n/testing.js +8 -0
- package/i18n/testing.js.map +1 -0
- package/input/interfaces.d.ts +1 -0
- package/input/interfaces.d.ts.map +1 -1
- package/input/interfaces.js.map +1 -1
- package/internal/base-component/styles.scoped.css +0 -2
- package/internal/components/dropdown-status/interfaces.d.ts +3 -0
- package/internal/components/dropdown-status/interfaces.d.ts.map +1 -1
- package/internal/components/dropdown-status/interfaces.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +37 -32
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/i18n/context.d.ts +1 -19
- package/internal/i18n/context.d.ts.map +1 -1
- package/internal/i18n/context.js +1 -14
- package/internal/i18n/context.js.map +1 -1
- package/internal/i18n/index.d.ts +1 -1
- package/internal/i18n/index.js +1 -1
- package/internal/i18n/index.js.map +1 -1
- package/internal/i18n/messages/all.all.js +3541 -30
- package/internal/i18n/messages/all.all.json +3599 -52
- package/internal/i18n/messages/all.de.js +280 -1
- package/internal/i18n/messages/all.de.json +290 -3
- package/internal/i18n/messages/all.en-GB.js +270 -1
- package/internal/i18n/messages/all.en-GB.json +275 -3
- package/internal/i18n/messages/all.en.js +556 -1
- package/internal/i18n/messages/all.en.json +558 -4
- package/internal/i18n/messages/all.es.js +271 -1
- package/internal/i18n/messages/all.es.json +275 -3
- package/internal/i18n/messages/all.fr.js +289 -5
- package/internal/i18n/messages/all.fr.json +292 -7
- package/internal/i18n/messages/all.id.js +261 -1
- package/internal/i18n/messages/all.id.json +271 -3
- package/internal/i18n/messages/all.it.js +271 -1
- package/internal/i18n/messages/all.it.json +277 -3
- package/internal/i18n/messages/all.ja.js +267 -1
- package/internal/i18n/messages/all.ja.json +273 -3
- package/internal/i18n/messages/all.ko.js +257 -2
- package/internal/i18n/messages/all.ko.json +263 -4
- package/internal/i18n/messages/all.pt-BR.js +280 -3
- package/internal/i18n/messages/all.pt-BR.json +281 -5
- package/internal/i18n/messages/all.zh-CN.js +272 -9
- package/internal/i18n/messages/all.zh-CN.json +276 -11
- package/internal/i18n/messages/all.zh-TW.js +264 -1
- package/internal/i18n/messages/all.zh-TW.json +268 -3
- package/internal/i18n/provider.d.ts +1 -19
- package/internal/i18n/provider.d.ts.map +1 -1
- package/internal/i18n/provider.js +1 -102
- package/internal/i18n/provider.js.map +1 -1
- package/internal/i18n/testing.d.ts +1 -7
- package/internal/i18n/testing.d.ts.map +1 -1
- package/internal/i18n/testing.js +1 -5
- package/internal/i18n/testing.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/link/interfaces.d.ts +1 -0
- package/link/interfaces.d.ts.map +1 -1
- package/link/interfaces.js.map +1 -1
- package/modal/interfaces.d.ts +1 -0
- package/modal/interfaces.d.ts.map +1 -1
- package/modal/interfaces.js.map +1 -1
- package/multiselect/interfaces.d.ts +1 -0
- package/multiselect/interfaces.d.ts.map +1 -1
- package/multiselect/interfaces.js.map +1 -1
- package/package.json +28 -1
- package/pagination/interfaces.d.ts +1 -0
- package/pagination/interfaces.d.ts.map +1 -1
- package/pagination/interfaces.js.map +1 -1
- package/property-filter/interfaces.d.ts +1 -0
- package/property-filter/interfaces.d.ts.map +1 -1
- package/property-filter/interfaces.js.map +1 -1
- package/s3-resource-selector/interfaces.d.ts +48 -47
- package/s3-resource-selector/interfaces.d.ts.map +1 -1
- package/s3-resource-selector/interfaces.js.map +1 -1
- package/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
- package/s3-resource-selector/s3-in-context/index.js +11 -9
- package/s3-resource-selector/s3-in-context/index.js.map +1 -1
- package/s3-resource-selector/s3-in-context/validation.d.ts +2 -1
- package/s3-resource-selector/s3-in-context/validation.d.ts.map +1 -1
- package/s3-resource-selector/s3-in-context/validation.js +2 -2
- package/s3-resource-selector/s3-in-context/validation.js.map +1 -1
- package/s3-resource-selector/s3-modal/basic-table.d.ts +2 -1
- package/s3-resource-selector/s3-modal/basic-table.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/basic-table.js +7 -7
- package/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
- package/s3-resource-selector/s3-modal/buckets-table.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/buckets-table.js +10 -7
- package/s3-resource-selector/s3-modal/buckets-table.js.map +1 -1
- package/s3-resource-selector/s3-modal/index.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/index.js +8 -6
- package/s3-resource-selector/s3-modal/index.js.map +1 -1
- package/s3-resource-selector/s3-modal/objects-table.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/objects-table.js +10 -7
- package/s3-resource-selector/s3-modal/objects-table.js.map +1 -1
- package/s3-resource-selector/s3-modal/table-utils.d.ts +2 -1
- package/s3-resource-selector/s3-modal/table-utils.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/table-utils.js +5 -9
- package/s3-resource-selector/s3-modal/table-utils.js.map +1 -1
- package/s3-resource-selector/s3-modal/versions-table.d.ts.map +1 -1
- package/s3-resource-selector/s3-modal/versions-table.js +10 -7
- package/s3-resource-selector/s3-modal/versions-table.js.map +1 -1
- package/select/interfaces.d.ts +2 -0
- package/select/interfaces.d.ts.map +1 -1
- package/select/interfaces.js.map +1 -1
- package/split-panel/index.d.ts.map +1 -1
- package/split-panel/index.js +16 -13
- package/split-panel/index.js.map +1 -1
- package/split-panel/interfaces.d.ts +4 -3
- package/split-panel/interfaces.d.ts.map +1 -1
- package/split-panel/interfaces.js.map +1 -1
- package/split-panel/side.d.ts +3 -3
- package/split-panel/side.d.ts.map +1 -1
- package/split-panel/side.js +2 -2
- package/split-panel/side.js.map +1 -1
- package/table/body-cell/index.d.ts.map +1 -1
- package/table/body-cell/index.js +3 -1
- package/table/body-cell/index.js.map +1 -1
- package/table/body-cell/inline-editor.d.ts.map +1 -1
- package/table/body-cell/inline-editor.js +5 -1
- package/table/body-cell/inline-editor.js.map +1 -1
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +3 -1
- package/table/header-cell/index.js.map +1 -1
- package/table/interfaces.d.ts +2 -0
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
- package/table/styles.css.js +36 -35
- package/table/styles.scoped.css +46 -43
- package/table/styles.selectors.js +36 -35
- package/tabs/interfaces.d.ts +1 -0
- package/tabs/interfaces.d.ts.map +1 -1
- package/tabs/interfaces.js.map +1 -1
- package/tag-editor/index.d.ts.map +1 -1
- package/tag-editor/index.js +19 -16
- package/tag-editor/index.js.map +1 -1
- package/tag-editor/interfaces.d.ts +33 -32
- package/tag-editor/interfaces.d.ts.map +1 -1
- package/tag-editor/interfaces.js.map +1 -1
- package/tag-editor/internal.d.ts +6 -6
- package/tag-editor/internal.d.ts.map +1 -1
- package/tag-editor/internal.js.map +1 -1
- package/tag-editor/validation.d.ts +2 -1
- package/tag-editor/validation.d.ts.map +1 -1
- package/tag-editor/validation.js +8 -8
- package/tag-editor/validation.js.map +1 -1
- package/token-group/interfaces.d.ts +1 -0
- package/token-group/interfaces.d.ts.map +1 -1
- package/token-group/interfaces.js.map +1 -1
- package/top-navigation/interfaces.d.ts +4 -3
- package/top-navigation/interfaces.d.ts.map +1 -1
- package/top-navigation/interfaces.js.map +1 -1
- package/top-navigation/internal.d.ts.map +1 -1
- package/top-navigation/internal.js +6 -4
- package/top-navigation/internal.js.map +1 -1
- package/top-navigation/parts/overflow-menu/index.d.ts.map +1 -1
- package/top-navigation/parts/overflow-menu/index.js +6 -2
- package/top-navigation/parts/overflow-menu/index.js.map +1 -1
- package/wizard/interfaces.d.ts +1 -0
- package/wizard/interfaces.d.ts.map +1 -1
- package/wizard/interfaces.js.map +1 -1
- package/wizard/styles.css.js +31 -32
- package/wizard/styles.scoped.css +64 -67
- package/wizard/styles.selectors.js +31 -32
- package/wizard/wizard-form.d.ts.map +1 -1
- package/wizard/wizard-form.js +1 -1
- package/wizard/wizard-form.js.map +1 -1
- package/app-layout/visual-refresh/app-bar.d.ts +0 -7
- package/app-layout/visual-refresh/app-bar.d.ts.map +0 -1
- package/app-layout/visual-refresh/app-bar.js.map +0 -1
|
@@ -37,8 +37,9 @@ export interface DateRangePickerBaseProps {
|
|
|
37
37
|
startOfWeek?: number;
|
|
38
38
|
/**
|
|
39
39
|
* An object containing all the necessary localized strings required by the component.
|
|
40
|
+
* @i18n
|
|
40
41
|
*/
|
|
41
|
-
i18nStrings
|
|
42
|
+
i18nStrings?: DateRangePickerProps.I18nStrings;
|
|
42
43
|
/**
|
|
43
44
|
* Hides time inputs and changes the input format to date-only, e.g. 2021-04-06.
|
|
44
45
|
*
|
|
@@ -219,95 +220,95 @@ export declare namespace DateRangePickerProps {
|
|
|
219
220
|
/**
|
|
220
221
|
* Segment title of the relative range selection mode
|
|
221
222
|
*/
|
|
222
|
-
relativeModeTitle
|
|
223
|
+
relativeModeTitle?: string;
|
|
223
224
|
/**
|
|
224
225
|
* Segment title of the absolute range selection mode
|
|
225
226
|
*/
|
|
226
|
-
absoluteModeTitle
|
|
227
|
+
absoluteModeTitle?: string;
|
|
227
228
|
/**
|
|
228
229
|
* Heading for the relative range selection area
|
|
229
230
|
*/
|
|
230
|
-
relativeRangeSelectionHeading
|
|
231
|
+
relativeRangeSelectionHeading?: string;
|
|
231
232
|
/**
|
|
232
233
|
* Visible label of the Cancel button
|
|
233
234
|
*/
|
|
234
|
-
cancelButtonLabel
|
|
235
|
+
cancelButtonLabel?: string;
|
|
235
236
|
/**
|
|
236
237
|
* Visible label of the Clear and dismiss button
|
|
237
238
|
*/
|
|
238
|
-
clearButtonLabel
|
|
239
|
+
clearButtonLabel?: string;
|
|
239
240
|
/**
|
|
240
241
|
* Visible label of the Apply button
|
|
241
242
|
*/
|
|
242
|
-
applyButtonLabel
|
|
243
|
+
applyButtonLabel?: string;
|
|
243
244
|
/**
|
|
244
245
|
* Formatting function for relative ranges.
|
|
245
246
|
* This function must convert a relative range to a human-readable string.
|
|
246
247
|
*/
|
|
247
|
-
formatRelativeRange
|
|
248
|
+
formatRelativeRange?: (value: RelativeValue) => string;
|
|
248
249
|
/**
|
|
249
250
|
* Formatting function for time units.
|
|
250
251
|
*
|
|
251
252
|
* This function must return a localized form of the unit that fits the provided time value.
|
|
252
253
|
*/
|
|
253
|
-
formatUnit
|
|
254
|
+
formatUnit?: (unit: TimeUnit, value: number) => string;
|
|
254
255
|
/**
|
|
255
256
|
* Visible label for the option for selecting
|
|
256
257
|
* a custom relative range.
|
|
257
258
|
*/
|
|
258
|
-
customRelativeRangeOptionLabel
|
|
259
|
+
customRelativeRangeOptionLabel?: string;
|
|
259
260
|
/**
|
|
260
261
|
* Visible description for the option for selecting
|
|
261
262
|
* a custom relative range.
|
|
262
263
|
*/
|
|
263
|
-
customRelativeRangeOptionDescription
|
|
264
|
+
customRelativeRangeOptionDescription?: string;
|
|
264
265
|
/**
|
|
265
266
|
* Visible label for the duration selector for
|
|
266
267
|
* the custom relative range.
|
|
267
268
|
*/
|
|
268
|
-
customRelativeRangeDurationLabel
|
|
269
|
+
customRelativeRangeDurationLabel?: string;
|
|
269
270
|
/**
|
|
270
271
|
* Placeholder for the duration selector for
|
|
271
272
|
* the custom relative range.
|
|
272
273
|
*/
|
|
273
|
-
customRelativeRangeDurationPlaceholder
|
|
274
|
+
customRelativeRangeDurationPlaceholder?: string;
|
|
274
275
|
/**
|
|
275
276
|
* Visible label for the unit selector for the
|
|
276
277
|
* custom relative range.
|
|
277
278
|
*/
|
|
278
|
-
customRelativeRangeUnitLabel
|
|
279
|
+
customRelativeRangeUnitLabel?: string;
|
|
279
280
|
/**
|
|
280
281
|
* Used as part of the aria label for today's date in the calendar.
|
|
281
282
|
*/
|
|
282
|
-
todayAriaLabel
|
|
283
|
+
todayAriaLabel?: string;
|
|
283
284
|
/**
|
|
284
285
|
* An aria label for the 'next month' button.
|
|
285
286
|
*/
|
|
286
|
-
nextMonthAriaLabel
|
|
287
|
+
nextMonthAriaLabel?: string;
|
|
287
288
|
/**
|
|
288
289
|
* An aria label for the 'previous month' button.
|
|
289
290
|
*/
|
|
290
|
-
previousMonthAriaLabel
|
|
291
|
+
previousMonthAriaLabel?: string;
|
|
291
292
|
/**
|
|
292
293
|
* Visible label for the Start Date input for the
|
|
293
294
|
* absolute range.
|
|
294
295
|
*/
|
|
295
|
-
startDateLabel
|
|
296
|
+
startDateLabel?: string;
|
|
296
297
|
/**
|
|
297
298
|
* Visible label for the Start Time input for the
|
|
298
299
|
* absolute range.
|
|
299
300
|
*/
|
|
300
|
-
startTimeLabel
|
|
301
|
+
startTimeLabel?: string;
|
|
301
302
|
/**
|
|
302
303
|
* Visible label for the End Date input for the
|
|
303
304
|
* absolute range.
|
|
304
305
|
*/
|
|
305
|
-
endDateLabel
|
|
306
|
+
endDateLabel?: string;
|
|
306
307
|
/**
|
|
307
308
|
* Visible label for the End Time input for the
|
|
308
309
|
* absolute range.
|
|
309
310
|
*/
|
|
310
|
-
endTimeLabel
|
|
311
|
+
endTimeLabel?: string;
|
|
311
312
|
/**
|
|
312
313
|
* Constraint text for the input fields for the
|
|
313
314
|
* absolute range.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["date-range-picker/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4C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AAC,EAAE,MAAM,CAAC;QACxB;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB;;;WAGG;QACH,YAAY,CAAC,EAAE,MAAM,CAAC;QAEtB;;;WAGG;QACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAEhC;;WAEG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAE5B;;WAEG;QACH,mCAAmC,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;KACtF;CACF;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjD,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,oBAAoB,CAAC,WAAW,EAC9B,gBAAgB,GAChB,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,wBAAwB,GACxB,qCAAqC,CACxC,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["date-range-picker/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { TimeInputProps } from '../time-input/interfaces';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport React from 'react';\n\nexport interface DateRangePickerBaseProps {\n /**\n * The current date range value. Can be either an absolute time range\n * or a relative time range.\n */\n value: null | DateRangePickerProps.Value;\n\n /**\n * A list of relative time ranges that are shown as suggestions.\n */\n relativeOptions: ReadonlyArray<DateRangePickerProps.RelativeOption>;\n\n /**\n * A function that defines whether a particular date should be enabled\n * in the calendar or not. Note that disabling a date in the calendar\n * still allows users to enter this date via keyboard. We therefore\n * recommend that you also validate these constraints client- and\n * server-side, in the same way as for other form elements.\n */\n isDateEnabled?: DateRangePickerProps.IsDateEnabledFunction;\n\n /**\n * The locale to be used for rendering month names and defining the\n * starting date of the week. If not provided, it will be determined\n * from the page and browser locales. Supported values and formats\n * are as-per the [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 * Starting day of the week. [0-6] maps to [Sunday-Saturday].\n * By default the starting day of the week is defined by the locale,\n * but you can override it using this property.\n */\n startOfWeek?: number;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings: DateRangePickerProps.I18nStrings;\n\n /**\n * Hides time inputs and changes the input format to date-only, e.g. 2021-04-06.\n *\n * Do not use `dateOnly` flag conditionally. The component does not trigger the value update\n * when the flag changes which means the value format can become inconsistent.\n *\n * Default: `false`.\n */\n dateOnly?: boolean;\n\n /**\n * Determines the range selector mode as follows:\n * * `default` for combined absolute/relative range selector.\n * * `absolute-only` for absolute-only range selector.\n * * `relative-only` for relative-only range selector.\n *\n * By default, the range selector mode is `default`.\n */\n rangeSelectorMode?: DateRangePickerProps.RangeSelectorMode;\n\n /**\n * Specifies the format of the time input for absolute ranges.\n *\n * Use to restrict the granularity of time that the user can enter.\n *\n * Has no effect when `dateOnly` is true.\n */\n timeInputFormat?: TimeInputProps.Format;\n\n /**\n * Fired whenever a user changes the component's value.\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<DateRangePickerProps.ChangeDetail>;\n\n /**\n * The time offset from UTC in minutes that should be used to\n * display and produce values.\n *\n * Has no effect when `dateOnly` is true.\n *\n * Default: the user's current time offset as provided by the browser.\n *\n * @deprecated Use `getTimeOffset` instead.\n */\n timeOffset?: number;\n\n /**\n * A function that defines timezone offset from UTC in minutes for selected dates.\n * Use it to define time relative to the desired timezone.\n *\n * The function is called for the start date and the end date and takes a UTC date\n * corresponding the selected value as an argument.\n *\n * Has no effect when `dateOnly` is true.\n *\n * Default: the user's current time offset as provided by the browser.\n */\n getTimeOffset?: DateRangePickerProps.GetTimeOffsetFunction;\n}\nexport interface DateRangePickerProps\n extends BaseComponentProps,\n FormFieldValidationControlProps,\n ExpandToViewport,\n DateRangePickerBaseProps {\n /**\n * Specifies the placeholder text that is rendered when the value is empty.\n */\n placeholder?: string;\n\n /**\n * Specifies that the component is disabled, preventing the user from\n * modifying the value. A disabled component cannot receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies that the component is read-only, preventing the user from\n * modifying the value. A read-only component can receive focus.\n */\n readOnly?: boolean;\n\n /**\n * Fired when keyboard focus is set onto the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Fired when keyboard focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * A function that defines whether a particular range is valid or not.\n *\n * Ensure that your function checks for missing fields in the value.\n */\n isValidRange: DateRangePickerProps.ValidationFunction;\n\n /**\n * Specifies whether the component should show a button that\n * allows the user to clear the selected value.\n */\n showClearButton?: boolean;\n\n /**\n * Specifies an additional control displayed in the dropdown, located below the range calendar.\n */\n customAbsoluteRangeControl?: DateRangePickerProps.AbsoluteRangeControl;\n}\n\nexport namespace DateRangePickerProps {\n export type Value = AbsoluteValue | RelativeValue;\n export interface AbsoluteValue {\n /**\n * In ISO8601 format, e.g.: 2021-04-06T17:23:50+02:00 (or 2021-04-06 when `dateOnly` is true)\n */\n startDate: string;\n /**\n * In ISO8601 format, e.g.: 2021-04-06T17:23:50+02:00 (or 2021-04-06 when `dateOnly` is true)\n */\n endDate: string;\n type: 'absolute';\n }\n\n export interface RelativeValue {\n /**\n * If provided, used to match this value\n * to a provided relative option.\n */\n key?: string;\n amount: number;\n unit: TimeUnit;\n type: 'relative';\n }\n export interface RelativeOption {\n /**\n * Used to uniquely identify this relative option.\n */\n key: string;\n amount: number;\n unit: TimeUnit;\n type: 'relative';\n }\n\n export type TimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';\n\n export type ValidationFunction = (value: Value | null) => ValidationResult;\n\n export type ValidationResult = ValidRangeResult | InvalidRangeResult;\n\n export interface ValidRangeResult {\n valid: true;\n }\n\n export interface InvalidRangeResult {\n valid: false;\n errorMessage: string;\n }\n\n export interface ChangeDetail {\n /**\n * The newly selected range of this date range picker.\n */\n value: null | Value;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n\n export interface GetTimeOffsetFunction {\n (date: Date): number;\n }\n\n export interface DateTimeStrings {\n date: string;\n time: string;\n }\n\n export interface PendingAbsoluteValue {\n start: DateTimeStrings;\n end: DateTimeStrings;\n }\n\n export type AbsoluteRangeControl = (\n selectedRange: PendingAbsoluteValue,\n setSelectedRange: React.Dispatch<React.SetStateAction<PendingAbsoluteValue>>\n ) => React.ReactNode;\n\n export type RangeSelectorMode = 'default' | 'absolute-only' | 'relative-only';\n\n export interface Ref {\n /**\n * Sets the browser focus on the UI control\n */\n focus(): void;\n }\n\n export interface I18nStrings {\n /**\n * Adds `aria-label` to the trigger and dropdown.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the trigger and dropdown.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the trigger and dropdown.\n */\n ariaDescribedby?: string;\n\n /**\n * Segment title of the relative range selection mode\n */\n relativeModeTitle: string;\n\n /**\n * Segment title of the absolute range selection mode\n */\n absoluteModeTitle: string;\n\n /**\n * Heading for the relative range selection area\n */\n relativeRangeSelectionHeading: string;\n\n /**\n * Visible label of the Cancel button\n */\n cancelButtonLabel: string;\n /**\n * Visible label of the Clear and dismiss button\n */\n clearButtonLabel: string;\n /**\n * Visible label of the Apply button\n */\n applyButtonLabel: string;\n\n /**\n * Formatting function for relative ranges.\n * This function must convert a relative range to a human-readable string.\n */\n formatRelativeRange: (value: RelativeValue) => string;\n\n /**\n * Formatting function for time units.\n *\n * This function must return a localized form of the unit that fits the provided time value.\n */\n formatUnit: (unit: TimeUnit, value: number) => string;\n\n /**\n * Visible label for the option for selecting\n * a custom relative range.\n */\n customRelativeRangeOptionLabel: string;\n\n /**\n * Visible description for the option for selecting\n * a custom relative range.\n */\n customRelativeRangeOptionDescription: string;\n\n /**\n * Visible label for the duration selector for\n * the custom relative range.\n */\n customRelativeRangeDurationLabel: string;\n /**\n * Placeholder for the duration selector for\n * the custom relative range.\n */\n customRelativeRangeDurationPlaceholder: string;\n /**\n * Visible label for the unit selector for the\n * custom relative range.\n */\n customRelativeRangeUnitLabel: string;\n\n /**\n * Used as part of the aria label for today's date in the calendar.\n */\n todayAriaLabel: string;\n\n /**\n * An aria label for the 'next month' button.\n */\n nextMonthAriaLabel: string;\n\n /**\n * An aria label for the 'previous month' button.\n */\n previousMonthAriaLabel: string;\n\n /**\n * Visible label for the Start Date input for the\n * absolute range.\n */\n startDateLabel: string;\n /**\n * Visible label for the Start Time input for the\n * absolute range.\n */\n startTimeLabel: string;\n /**\n * Visible label for the End Date input for the\n * absolute range.\n */\n endDateLabel: string;\n /**\n * Visible label for the End Time input for the\n * absolute range.\n */\n endTimeLabel: string;\n\n /**\n * Constraint text for the input fields for the\n * absolute range.\n */\n dateTimeConstraintText?: string;\n\n /**\n * Provides a text alternative for the error icon in the error alert.\n */\n errorIconAriaLabel?: string;\n\n /**\n * When the property is set, screen readers announce the selected range when the absolute range gets selected.\n */\n renderSelectedAbsoluteRangeAriaLive?: (startDate: string, endDate: string) => string;\n }\n}\n\nexport type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type RangeCalendarI18nStrings = Pick<\n DateRangePickerProps.I18nStrings,\n | 'todayAriaLabel'\n | 'nextMonthAriaLabel'\n | 'previousMonthAriaLabel'\n | 'startDateLabel'\n | 'startTimeLabel'\n | 'endDateLabel'\n | 'endTimeLabel'\n | 'dateTimeConstraintText'\n | 'renderSelectedAbsoluteRangeAriaLive'\n>;\n\nexport interface Focusable {\n focus(): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["date-range-picker/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { FormFieldValidationControlProps } from '../internal/context/form-field-context';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { TimeInputProps } from '../time-input/interfaces';\nimport { ExpandToViewport } from '../internal/components/dropdown/interfaces';\nimport React from 'react';\n\nexport interface DateRangePickerBaseProps {\n /**\n * The current date range value. Can be either an absolute time range\n * or a relative time range.\n */\n value: null | DateRangePickerProps.Value;\n\n /**\n * A list of relative time ranges that are shown as suggestions.\n */\n relativeOptions: ReadonlyArray<DateRangePickerProps.RelativeOption>;\n\n /**\n * A function that defines whether a particular date should be enabled\n * in the calendar or not. Note that disabling a date in the calendar\n * still allows users to enter this date via keyboard. We therefore\n * recommend that you also validate these constraints client- and\n * server-side, in the same way as for other form elements.\n */\n isDateEnabled?: DateRangePickerProps.IsDateEnabledFunction;\n\n /**\n * The locale to be used for rendering month names and defining the\n * starting date of the week. If not provided, it will be determined\n * from the page and browser locales. Supported values and formats\n * are as-per the [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 * Starting day of the week. [0-6] maps to [Sunday-Saturday].\n * By default the starting day of the week is defined by the locale,\n * but you can override it using this property.\n */\n startOfWeek?: number;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: DateRangePickerProps.I18nStrings;\n\n /**\n * Hides time inputs and changes the input format to date-only, e.g. 2021-04-06.\n *\n * Do not use `dateOnly` flag conditionally. The component does not trigger the value update\n * when the flag changes which means the value format can become inconsistent.\n *\n * Default: `false`.\n */\n dateOnly?: boolean;\n\n /**\n * Determines the range selector mode as follows:\n * * `default` for combined absolute/relative range selector.\n * * `absolute-only` for absolute-only range selector.\n * * `relative-only` for relative-only range selector.\n *\n * By default, the range selector mode is `default`.\n */\n rangeSelectorMode?: DateRangePickerProps.RangeSelectorMode;\n\n /**\n * Specifies the format of the time input for absolute ranges.\n *\n * Use to restrict the granularity of time that the user can enter.\n *\n * Has no effect when `dateOnly` is true.\n */\n timeInputFormat?: TimeInputProps.Format;\n\n /**\n * Fired whenever a user changes the component's value.\n * The event `detail` contains the current value of the field.\n */\n onChange?: NonCancelableEventHandler<DateRangePickerProps.ChangeDetail>;\n\n /**\n * The time offset from UTC in minutes that should be used to\n * display and produce values.\n *\n * Has no effect when `dateOnly` is true.\n *\n * Default: the user's current time offset as provided by the browser.\n *\n * @deprecated Use `getTimeOffset` instead.\n */\n timeOffset?: number;\n\n /**\n * A function that defines timezone offset from UTC in minutes for selected dates.\n * Use it to define time relative to the desired timezone.\n *\n * The function is called for the start date and the end date and takes a UTC date\n * corresponding the selected value as an argument.\n *\n * Has no effect when `dateOnly` is true.\n *\n * Default: the user's current time offset as provided by the browser.\n */\n getTimeOffset?: DateRangePickerProps.GetTimeOffsetFunction;\n}\nexport interface DateRangePickerProps\n extends BaseComponentProps,\n FormFieldValidationControlProps,\n ExpandToViewport,\n DateRangePickerBaseProps {\n /**\n * Specifies the placeholder text that is rendered when the value is empty.\n */\n placeholder?: string;\n\n /**\n * Specifies that the component is disabled, preventing the user from\n * modifying the value. A disabled component cannot receive focus.\n */\n disabled?: boolean;\n\n /**\n * Specifies that the component is read-only, preventing the user from\n * modifying the value. A read-only component can receive focus.\n */\n readOnly?: boolean;\n\n /**\n * Fired when keyboard focus is set onto the UI control.\n */\n onFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Fired when keyboard focus is removed from the UI control.\n */\n onBlur?: NonCancelableEventHandler<null>;\n\n /**\n * A function that defines whether a particular range is valid or not.\n *\n * Ensure that your function checks for missing fields in the value.\n */\n isValidRange: DateRangePickerProps.ValidationFunction;\n\n /**\n * Specifies whether the component should show a button that\n * allows the user to clear the selected value.\n */\n showClearButton?: boolean;\n\n /**\n * Specifies an additional control displayed in the dropdown, located below the range calendar.\n */\n customAbsoluteRangeControl?: DateRangePickerProps.AbsoluteRangeControl;\n}\n\nexport namespace DateRangePickerProps {\n export type Value = AbsoluteValue | RelativeValue;\n export interface AbsoluteValue {\n /**\n * In ISO8601 format, e.g.: 2021-04-06T17:23:50+02:00 (or 2021-04-06 when `dateOnly` is true)\n */\n startDate: string;\n /**\n * In ISO8601 format, e.g.: 2021-04-06T17:23:50+02:00 (or 2021-04-06 when `dateOnly` is true)\n */\n endDate: string;\n type: 'absolute';\n }\n\n export interface RelativeValue {\n /**\n * If provided, used to match this value\n * to a provided relative option.\n */\n key?: string;\n amount: number;\n unit: TimeUnit;\n type: 'relative';\n }\n export interface RelativeOption {\n /**\n * Used to uniquely identify this relative option.\n */\n key: string;\n amount: number;\n unit: TimeUnit;\n type: 'relative';\n }\n\n export type TimeUnit = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';\n\n export type ValidationFunction = (value: Value | null) => ValidationResult;\n\n export type ValidationResult = ValidRangeResult | InvalidRangeResult;\n\n export interface ValidRangeResult {\n valid: true;\n }\n\n export interface InvalidRangeResult {\n valid: false;\n errorMessage: string;\n }\n\n export interface ChangeDetail {\n /**\n * The newly selected range of this date range picker.\n */\n value: null | Value;\n }\n\n export interface IsDateEnabledFunction {\n (date: Date): boolean;\n }\n\n export interface GetTimeOffsetFunction {\n (date: Date): number;\n }\n\n export interface DateTimeStrings {\n date: string;\n time: string;\n }\n\n export interface PendingAbsoluteValue {\n start: DateTimeStrings;\n end: DateTimeStrings;\n }\n\n export type AbsoluteRangeControl = (\n selectedRange: PendingAbsoluteValue,\n setSelectedRange: React.Dispatch<React.SetStateAction<PendingAbsoluteValue>>\n ) => React.ReactNode;\n\n export type RangeSelectorMode = 'default' | 'absolute-only' | 'relative-only';\n\n export interface Ref {\n /**\n * Sets the browser focus on the UI control\n */\n focus(): void;\n }\n\n export interface I18nStrings {\n /**\n * Adds `aria-label` to the trigger and dropdown.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the trigger and dropdown.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the trigger and dropdown.\n */\n ariaDescribedby?: string;\n\n /**\n * Segment title of the relative range selection mode\n */\n relativeModeTitle?: string;\n\n /**\n * Segment title of the absolute range selection mode\n */\n absoluteModeTitle?: string;\n\n /**\n * Heading for the relative range selection area\n */\n relativeRangeSelectionHeading?: string;\n\n /**\n * Visible label of the Cancel button\n */\n cancelButtonLabel?: string;\n /**\n * Visible label of the Clear and dismiss button\n */\n clearButtonLabel?: string;\n /**\n * Visible label of the Apply button\n */\n applyButtonLabel?: string;\n\n /**\n * Formatting function for relative ranges.\n * This function must convert a relative range to a human-readable string.\n */\n formatRelativeRange?: (value: RelativeValue) => string;\n\n /**\n * Formatting function for time units.\n *\n * This function must return a localized form of the unit that fits the provided time value.\n */\n formatUnit?: (unit: TimeUnit, value: number) => string;\n\n /**\n * Visible label for the option for selecting\n * a custom relative range.\n */\n customRelativeRangeOptionLabel?: string;\n\n /**\n * Visible description for the option for selecting\n * a custom relative range.\n */\n customRelativeRangeOptionDescription?: string;\n\n /**\n * Visible label for the duration selector for\n * the custom relative range.\n */\n customRelativeRangeDurationLabel?: string;\n /**\n * Placeholder for the duration selector for\n * the custom relative range.\n */\n customRelativeRangeDurationPlaceholder?: string;\n /**\n * Visible label for the unit selector for the\n * custom relative range.\n */\n customRelativeRangeUnitLabel?: string;\n\n /**\n * Used as part of the aria label for today's date in the calendar.\n */\n todayAriaLabel?: string;\n\n /**\n * An aria label for the 'next month' button.\n */\n nextMonthAriaLabel?: string;\n\n /**\n * An aria label for the 'previous month' button.\n */\n previousMonthAriaLabel?: string;\n\n /**\n * Visible label for the Start Date input for the\n * absolute range.\n */\n startDateLabel?: string;\n /**\n * Visible label for the Start Time input for the\n * absolute range.\n */\n startTimeLabel?: string;\n /**\n * Visible label for the End Date input for the\n * absolute range.\n */\n endDateLabel?: string;\n /**\n * Visible label for the End Time input for the\n * absolute range.\n */\n endTimeLabel?: string;\n\n /**\n * Constraint text for the input fields for the\n * absolute range.\n */\n dateTimeConstraintText?: string;\n\n /**\n * Provides a text alternative for the error icon in the error alert.\n */\n errorIconAriaLabel?: string;\n\n /**\n * When the property is set, screen readers announce the selected range when the absolute range gets selected.\n */\n renderSelectedAbsoluteRangeAriaLive?: (startDate: string, endDate: string) => string;\n }\n}\n\nexport type DayIndex = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type RangeCalendarI18nStrings = Pick<\n DateRangePickerProps.I18nStrings,\n | 'todayAriaLabel'\n | 'nextMonthAriaLabel'\n | 'previousMonthAriaLabel'\n | 'startDateLabel'\n | 'startTimeLabel'\n | 'endDateLabel'\n | 'endTimeLabel'\n | 'dateTimeConstraintText'\n | 'renderSelectedAbsoluteRangeAriaLive'\n>;\n\nexport interface Focusable {\n focus(): void;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DateRangePickerProps } from './interfaces';
|
|
3
|
-
interface ModeSwitcherProps extends Pick<
|
|
3
|
+
interface ModeSwitcherProps extends Pick<DateRangePickerProps, 'i18nStrings'> {
|
|
4
4
|
mode: 'absolute' | 'relative';
|
|
5
5
|
onChange: (mode: 'absolute' | 'relative') => void;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mode-switcher.d.ts","sourceRoot":"lib/default/","sources":["date-range-picker/mode-switcher.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"mode-switcher.d.ts","sourceRoot":"lib/default/","sources":["date-range-picker/mode-switcher.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAMpD,UAAU,iBAAkB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC;IAC3E,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC;CACnD;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,iBAAiB,eActF"}
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import InternalSegmentedControl from '../segmented-control/internal';
|
|
5
5
|
import styles from './styles.css.js';
|
|
6
|
+
import { useInternalI18n } from '../internal/i18n/context';
|
|
6
7
|
export default function ModeSwitcher({ i18nStrings, mode, onChange }) {
|
|
8
|
+
const i18n = useInternalI18n('date-range-picker');
|
|
7
9
|
return (React.createElement(InternalSegmentedControl, { className: styles['mode-switch'], selectedId: mode, options: [
|
|
8
|
-
{ id: 'relative', text: i18nStrings.relativeModeTitle },
|
|
9
|
-
{ id: 'absolute', text: i18nStrings.absoluteModeTitle },
|
|
10
|
+
{ id: 'relative', text: i18n('i18nStrings.relativeModeTitle', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.relativeModeTitle) },
|
|
11
|
+
{ id: 'absolute', text: i18n('i18nStrings.absoluteModeTitle', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.absoluteModeTitle) },
|
|
10
12
|
], onChange: e => onChange(e.detail.selectedId) }));
|
|
11
13
|
}
|
|
12
14
|
//# sourceMappingURL=mode-switcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mode-switcher.js","sourceRoot":"lib/default/","sources":["date-range-picker/mode-switcher.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AAErE,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"mode-switcher.js","sourceRoot":"lib/default/","sources":["date-range-picker/mode-switcher.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,wBAAwB,MAAM,+BAA+B,CAAC;AAErE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAO3D,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAqB;IACrF,MAAM,IAAI,GAAG,eAAe,CAAC,mBAAmB,CAAC,CAAC;IAElD,OAAO,CACL,oBAAC,wBAAwB,IACvB,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,EAChC,UAAU,EAAE,IAAI,EAChB,OAAO,EAAE;YACP,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,+BAA+B,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,iBAAiB,CAAC,EAAE;YAC/F,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,+BAA+B,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,iBAAiB,CAAC,EAAE;SAChG,EACD,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAqC,CAAC,GACvE,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { DateRangePickerProps } from './interfaces';\nimport InternalSegmentedControl from '../segmented-control/internal';\n\nimport styles from './styles.css.js';\nimport { useInternalI18n } from '../internal/i18n/context';\n\ninterface ModeSwitcherProps extends Pick<DateRangePickerProps, 'i18nStrings'> {\n mode: 'absolute' | 'relative';\n onChange: (mode: 'absolute' | 'relative') => void;\n}\n\nexport default function ModeSwitcher({ i18nStrings, mode, onChange }: ModeSwitcherProps) {\n const i18n = useInternalI18n('date-range-picker');\n\n return (\n <InternalSegmentedControl\n className={styles['mode-switch']}\n selectedId={mode}\n options={[\n { id: 'relative', text: i18n('i18nStrings.relativeModeTitle', i18nStrings?.relativeModeTitle) },\n { id: 'absolute', text: i18n('i18nStrings.absoluteModeTitle', i18nStrings?.absoluteModeTitle) },\n ]}\n onChange={e => onChange(e.detail.selectedId as 'absolute' | 'relative')}\n />\n );\n}\n"]}
|
|
@@ -5,7 +5,7 @@ export interface RelativeRangePickerProps {
|
|
|
5
5
|
options: ReadonlyArray<DateRangePickerProps.RelativeOption>;
|
|
6
6
|
initialSelection: DateRangePickerProps.RelativeValue | null;
|
|
7
7
|
onChange: (range: DateRangePickerProps.RelativeValue) => void;
|
|
8
|
-
i18nStrings
|
|
8
|
+
i18nStrings?: DateRangePickerProps.I18nStrings;
|
|
9
9
|
isSingleGrid: boolean;
|
|
10
10
|
}
|
|
11
11
|
export default function RelativeRangePicker({ dateOnly, options: clientOptions, initialSelection: initialRange, onChange: onChangeRangeSize, i18nStrings, isSingleGrid, }: RelativeRangePickerProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["date-range-picker/relative-range/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["date-range-picker/relative-range/index.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAWrD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IAC5D,gBAAgB,EAAE,oBAAoB,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5D,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,aAAa,KAAK,IAAI,CAAC;IAC9D,WAAW,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC;IAC/C,YAAY,EAAE,OAAO,CAAC;CACvB;AAYD,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAC1C,QAAQ,EACR,OAAO,EAAE,aAAkB,EAC3B,gBAAgB,EAAE,YAAY,EAC9B,QAAQ,EAAE,iBAAiB,EAC3B,WAAW,EACX,YAAY,GACb,EAAE,wBAAwB,eAkK1B"}
|
|
@@ -9,19 +9,23 @@ import InternalRadioGroup from '../../radio-group/internal';
|
|
|
9
9
|
import InternalSelect from '../../select/internal';
|
|
10
10
|
import InternalSpaceBetween from '../../space-between/internal';
|
|
11
11
|
import styles from './styles.css.js';
|
|
12
|
+
import { useInternalI18n } from '../../internal/i18n/context';
|
|
12
13
|
const dayUnits = ['day', 'week', 'month', 'year'];
|
|
13
14
|
const units = ['second', 'minute', 'hour', ...dayUnits];
|
|
14
15
|
const CUSTOM_OPTION_SELECT_KEY = 'awsui-internal-custom-duration-key';
|
|
15
16
|
export default function RelativeRangePicker({ dateOnly, options: clientOptions = [], initialSelection: initialRange, onChange: onChangeRangeSize, i18nStrings, isSingleGrid, }) {
|
|
16
17
|
var _a;
|
|
18
|
+
const i18n = useInternalI18n('date-range-picker');
|
|
19
|
+
const formatRelativeRange = i18n('i18nStrings.formatRelativeRange', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.formatRelativeRange, format => ({ amount, unit }) => format({ amount, unit }));
|
|
20
|
+
const formatUnit = i18n('i18nStrings.formatUnit', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.formatUnit, format => (unit, amount) => format({ amount, unit }));
|
|
17
21
|
const radioOptions = clientOptions.map(option => ({
|
|
18
22
|
value: option.key,
|
|
19
|
-
label:
|
|
23
|
+
label: formatRelativeRange === null || formatRelativeRange === void 0 ? void 0 : formatRelativeRange(option),
|
|
20
24
|
}));
|
|
21
25
|
radioOptions.push({
|
|
22
26
|
value: CUSTOM_OPTION_SELECT_KEY,
|
|
23
|
-
label: i18nStrings.customRelativeRangeOptionLabel,
|
|
24
|
-
description: i18nStrings.customRelativeRangeOptionDescription,
|
|
27
|
+
label: i18n('i18nStrings.customRelativeRangeOptionLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeOptionLabel),
|
|
28
|
+
description: i18n('i18nStrings.customRelativeRangeOptionDescription', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeOptionDescription),
|
|
25
29
|
});
|
|
26
30
|
const [selectedRadio, setSelectedRadio] = useState(() => {
|
|
27
31
|
var _a;
|
|
@@ -43,7 +47,7 @@ export default function RelativeRangePicker({ dateOnly, options: clientOptions =
|
|
|
43
47
|
const showCustomControls = clientOptions.length === 0 || selectedRadio === CUSTOM_OPTION_SELECT_KEY;
|
|
44
48
|
return (React.createElement("div", null,
|
|
45
49
|
React.createElement(InternalSpaceBetween, { size: "xs", direction: "vertical" },
|
|
46
|
-
showRadioControl && (React.createElement(InternalFormField, { label: i18nStrings.relativeRangeSelectionHeading },
|
|
50
|
+
showRadioControl && (React.createElement(InternalFormField, { label: i18n('i18nStrings.relativeRangeSelectionHeading', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.relativeRangeSelectionHeading) },
|
|
47
51
|
React.createElement(InternalRadioGroup, { className: styles['relative-range-radio-group'], onChange: ({ detail }) => {
|
|
48
52
|
setSelectedRadio(detail.value);
|
|
49
53
|
if (detail.value === CUSTOM_OPTION_SELECT_KEY) {
|
|
@@ -61,7 +65,7 @@ export default function RelativeRangePicker({ dateOnly, options: clientOptions =
|
|
|
61
65
|
}
|
|
62
66
|
}, value: selectedRadio, items: radioOptions }))),
|
|
63
67
|
showCustomControls && (React.createElement(InternalSpaceBetween, { direction: "vertical", size: "xs" },
|
|
64
|
-
!showRadioControl && (React.createElement(InternalBox, { fontSize: "body-m", color: "text-body-secondary" }, i18nStrings.customRelativeRangeOptionDescription)),
|
|
68
|
+
!showRadioControl && (React.createElement(InternalBox, { fontSize: "body-m", color: "text-body-secondary" }, i18n('i18nStrings.customRelativeRangeOptionDescription', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeOptionDescription))),
|
|
65
69
|
React.createElement("div", { className: clsx(styles['custom-range'], {
|
|
66
70
|
[styles['custom-range--no-padding']]: !showRadioControl,
|
|
67
71
|
}) },
|
|
@@ -69,24 +73,24 @@ export default function RelativeRangePicker({ dateOnly, options: clientOptions =
|
|
|
69
73
|
[styles.vertical]: isSingleGrid,
|
|
70
74
|
}) },
|
|
71
75
|
React.createElement("div", { className: styles['custom-range-duration'] },
|
|
72
|
-
React.createElement(InternalFormField, { label: i18nStrings.customRelativeRangeDurationLabel },
|
|
76
|
+
React.createElement(InternalFormField, { label: i18n('i18nStrings.customRelativeRangeDurationLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeDurationLabel) },
|
|
73
77
|
React.createElement(InternalInput, { type: "number", className: styles['custom-range-duration-input'], value: isNaN(customDuration) || customDuration === 0 ? '' : customDuration === null || customDuration === void 0 ? void 0 : customDuration.toString(), onChange: e => {
|
|
74
78
|
const amount = Number(e.detail.value);
|
|
75
79
|
setCustomDuration(amount);
|
|
76
80
|
onChangeRangeSize({ amount, unit: customUnitOfTime, type: 'relative' });
|
|
77
|
-
}, placeholder: i18nStrings.customRelativeRangeDurationPlaceholder, __inheritFormFieldProps: true }))),
|
|
81
|
+
}, placeholder: i18n('i18nStrings.customRelativeRangeDurationPlaceholder', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeDurationPlaceholder), __inheritFormFieldProps: true }))),
|
|
78
82
|
React.createElement("div", { className: styles['custom-range-unit'] },
|
|
79
|
-
React.createElement(InternalFormField, { label: i18nStrings.customRelativeRangeUnitLabel },
|
|
83
|
+
React.createElement(InternalFormField, { label: i18n('i18nStrings.customRelativeRangeUnitLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.customRelativeRangeUnitLabel) },
|
|
80
84
|
React.createElement(InternalSelect, { className: styles['custom-range-unit-select'], selectedOption: {
|
|
81
85
|
value: customUnitOfTime,
|
|
82
|
-
label:
|
|
86
|
+
label: formatUnit === null || formatUnit === void 0 ? void 0 : formatUnit(customUnitOfTime, customDuration),
|
|
83
87
|
}, onChange: e => {
|
|
84
88
|
const { value: unit } = e.detail.selectedOption;
|
|
85
89
|
setCustomUnitOfTime(unit);
|
|
86
90
|
onChangeRangeSize({ amount: customDuration, unit, type: 'relative' });
|
|
87
91
|
}, options: (dateOnly ? dayUnits : units).map(unit => ({
|
|
88
92
|
value: unit,
|
|
89
|
-
label:
|
|
93
|
+
label: formatUnit === null || formatUnit === void 0 ? void 0 : formatUnit(unit, customDuration),
|
|
90
94
|
})), renderHighlightedAriaLive: option => option.label || option.value || '' }))))))))));
|
|
91
95
|
}
|
|
92
96
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["date-range-picker/relative-range/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAEjD,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,cAAc,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E,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;oCAC1E,CAAC,EACD,WAAW,EAAE,WAAW,CAAC,sCAAsC,EAC/D,uBAAuB,EAAE,IAAI,GAC7B,CACgB,CAChB;wBAEN,6BAAK,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC;4BACzC,oBAAC,iBAAiB,IAAC,KAAK,EAAE,WAAW,CAAC,4BAA4B;gCAChE,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,0BAA0B,CAAC,EAC7C,cAAc,EACZ;wCACE,KAAK,EAAE,gBAAgB;wCACvB,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,gBAAgB,EAAE,cAAc,CAAC;qCAC5C,EAEvB,QAAQ,EAAE,CAAC,CAAC,EAAE;wCACZ,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,cAAkC,CAAC;wCAEpE,mBAAmB,CAAC,IAAI,CAAC,CAAC;wCAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;oCACxE,CAAC,EACD,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wCAClD,KAAK,EAAE,IAAI;wCACX,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC;qCACpD,CAAC,CAAC,EACH,yBAAyB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,GACvE,CACgB,CAChB,CACF,CACF,CACe,CACxB,CACoB,CACnB,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useState } from 'react';\nimport { DateRangePickerProps } from '../interfaces';\nimport InternalBox from '../../box/internal';\nimport InternalFormField from '../../form-field/internal';\nimport InternalInput from '../../input/internal';\nimport { RadioGroupProps } from '../../radio-group/interfaces';\nimport InternalRadioGroup from '../../radio-group/internal';\nimport InternalSelect from '../../select/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport styles from './styles.css.js';\n\nexport interface RelativeRangePickerProps {\n dateOnly: boolean;\n options: ReadonlyArray<DateRangePickerProps.RelativeOption>;\n initialSelection: DateRangePickerProps.RelativeValue | null;\n onChange: (range: DateRangePickerProps.RelativeValue) => void;\n i18nStrings: DateRangePickerProps.I18nStrings;\n isSingleGrid: boolean;\n}\n\ninterface UnitSelectOption {\n value: DateRangePickerProps.TimeUnit;\n label: string;\n}\n\nconst dayUnits: ReadonlyArray<DateRangePickerProps.TimeUnit> = ['day', 'week', 'month', 'year'];\nconst units: ReadonlyArray<DateRangePickerProps.TimeUnit> = ['second', 'minute', 'hour', ...dayUnits];\n\nconst CUSTOM_OPTION_SELECT_KEY = 'awsui-internal-custom-duration-key';\n\nexport default function RelativeRangePicker({\n dateOnly,\n options: clientOptions = [],\n initialSelection: initialRange,\n onChange: onChangeRangeSize,\n i18nStrings,\n isSingleGrid,\n}: RelativeRangePickerProps) {\n const radioOptions: RadioGroupProps.RadioButtonDefinition[] = clientOptions.map(option => ({\n value: option.key,\n label: i18nStrings.formatRelativeRange(option),\n }));\n radioOptions.push({\n value: CUSTOM_OPTION_SELECT_KEY,\n label: i18nStrings.customRelativeRangeOptionLabel,\n description: i18nStrings.customRelativeRangeOptionDescription,\n });\n\n const [selectedRadio, setSelectedRadio] = useState(() => {\n if (initialRange && !initialRange.key) {\n return CUSTOM_OPTION_SELECT_KEY;\n }\n return initialRange?.key ?? null;\n });\n\n const [customDuration, setCustomDuration] = useState(() => {\n if (initialRange) {\n return initialRange.amount;\n }\n // NaN represents an empty duration\n return NaN;\n });\n\n const initialCustomTimeUnit = dateOnly ? 'day' : 'minute';\n const [customUnitOfTime, setCustomUnitOfTime] = useState<DateRangePickerProps.TimeUnit>(\n initialRange?.unit ?? initialCustomTimeUnit\n );\n\n const showRadioControl = clientOptions.length > 0;\n const showCustomControls = clientOptions.length === 0 || selectedRadio === CUSTOM_OPTION_SELECT_KEY;\n\n return (\n <div>\n <InternalSpaceBetween size=\"xs\" direction=\"vertical\">\n {showRadioControl && (\n <InternalFormField label={i18nStrings.relativeRangeSelectionHeading}>\n <InternalRadioGroup\n className={styles['relative-range-radio-group']}\n onChange={({ detail }) => {\n setSelectedRadio(detail.value);\n\n if (detail.value === CUSTOM_OPTION_SELECT_KEY) {\n setCustomDuration(NaN);\n setCustomUnitOfTime(initialCustomTimeUnit);\n onChangeRangeSize({\n amount: NaN,\n unit: initialCustomTimeUnit,\n type: 'relative',\n });\n } else {\n const option = clientOptions.filter(o => o.key === detail.value)[0];\n onChangeRangeSize(option);\n }\n }}\n value={selectedRadio}\n items={radioOptions}\n />\n </InternalFormField>\n )}\n\n {showCustomControls && (\n <InternalSpaceBetween direction=\"vertical\" size=\"xs\">\n {!showRadioControl && (\n <InternalBox fontSize=\"body-m\" color=\"text-body-secondary\">\n {i18nStrings.customRelativeRangeOptionDescription}\n </InternalBox>\n )}\n\n <div\n className={clsx(styles['custom-range'], {\n [styles['custom-range--no-padding']]: !showRadioControl,\n })}\n >\n <div\n className={clsx(styles['custom-range-form-controls'], {\n [styles.vertical]: isSingleGrid,\n })}\n >\n <div className={styles['custom-range-duration']}>\n <InternalFormField label={i18nStrings.customRelativeRangeDurationLabel}>\n <InternalInput\n type=\"number\"\n className={styles['custom-range-duration-input']}\n value={isNaN(customDuration) || customDuration === 0 ? '' : customDuration?.toString()}\n onChange={e => {\n const amount = Number(e.detail.value);\n\n setCustomDuration(amount);\n onChangeRangeSize({ amount, unit: customUnitOfTime, type: 'relative' });\n }}\n placeholder={i18nStrings.customRelativeRangeDurationPlaceholder}\n __inheritFormFieldProps={true}\n />\n </InternalFormField>\n </div>\n\n <div className={styles['custom-range-unit']}>\n <InternalFormField label={i18nStrings.customRelativeRangeUnitLabel}>\n <InternalSelect\n className={styles['custom-range-unit-select']}\n selectedOption={\n {\n value: customUnitOfTime,\n label: i18nStrings.formatUnit(customUnitOfTime, customDuration),\n } as UnitSelectOption\n }\n onChange={e => {\n const { value: unit } = e.detail.selectedOption as UnitSelectOption;\n\n setCustomUnitOfTime(unit);\n onChangeRangeSize({ amount: customDuration, unit, type: 'relative' });\n }}\n options={(dateOnly ? dayUnits : units).map(unit => ({\n value: unit,\n label: i18nStrings.formatUnit(unit, customDuration),\n }))}\n renderHighlightedAriaLive={option => option.label || option.value || ''}\n />\n </InternalFormField>\n </div>\n </div>\n </div>\n </InternalSpaceBetween>\n )}\n </InternalSpaceBetween>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"lib/default/","sources":["date-range-picker/relative-range/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAEjD,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAChE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAgB9D,MAAM,QAAQ,GAAiD,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAChG,MAAM,KAAK,GAAiD,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC;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;wCAEpE,mBAAmB,CAAC,IAAI,CAAC,CAAC;wCAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;oCACxE,CAAC,EACD,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wCAClD,KAAK,EAAE,IAAI;wCACX,KAAK,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,IAAI,EAAE,cAAc,CAAC;qCAC1C,CAAC,CAAC,EACH,yBAAyB,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,IAAI,EAAE,GACvE,CACgB,CAChB,CACF,CACF,CACe,CACxB,CACoB,CACnB,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useState } from 'react';\nimport { DateRangePickerProps } from '../interfaces';\nimport InternalBox from '../../box/internal';\nimport InternalFormField from '../../form-field/internal';\nimport InternalInput from '../../input/internal';\nimport { RadioGroupProps } from '../../radio-group/interfaces';\nimport InternalRadioGroup from '../../radio-group/internal';\nimport InternalSelect from '../../select/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport styles from './styles.css.js';\nimport { useInternalI18n } from '../../internal/i18n/context';\n\nexport interface RelativeRangePickerProps {\n dateOnly: boolean;\n options: ReadonlyArray<DateRangePickerProps.RelativeOption>;\n initialSelection: DateRangePickerProps.RelativeValue | null;\n onChange: (range: DateRangePickerProps.RelativeValue) => void;\n i18nStrings?: DateRangePickerProps.I18nStrings;\n isSingleGrid: boolean;\n}\n\ninterface UnitSelectOption {\n value: DateRangePickerProps.TimeUnit;\n label: string;\n}\n\nconst dayUnits: ReadonlyArray<DateRangePickerProps.TimeUnit> = ['day', 'week', 'month', 'year'];\nconst units: ReadonlyArray<DateRangePickerProps.TimeUnit> = ['second', 'minute', 'hour', ...dayUnits];\n\nconst CUSTOM_OPTION_SELECT_KEY = 'awsui-internal-custom-duration-key';\n\nexport default function RelativeRangePicker({\n dateOnly,\n options: clientOptions = [],\n initialSelection: initialRange,\n onChange: onChangeRangeSize,\n i18nStrings,\n isSingleGrid,\n}: RelativeRangePickerProps) {\n const i18n = useInternalI18n('date-range-picker');\n const formatRelativeRange = i18n(\n 'i18nStrings.formatRelativeRange',\n i18nStrings?.formatRelativeRange,\n format =>\n ({ amount, unit }) =>\n format({ amount, unit })\n );\n const formatUnit = i18n(\n 'i18nStrings.formatUnit',\n i18nStrings?.formatUnit,\n format => (unit, amount) => format({ amount, unit })\n );\n\n const radioOptions: RadioGroupProps.RadioButtonDefinition[] = clientOptions.map(option => ({\n value: option.key,\n label: formatRelativeRange?.(option),\n }));\n radioOptions.push({\n value: CUSTOM_OPTION_SELECT_KEY,\n label: i18n('i18nStrings.customRelativeRangeOptionLabel', i18nStrings?.customRelativeRangeOptionLabel),\n description: i18n(\n 'i18nStrings.customRelativeRangeOptionDescription',\n i18nStrings?.customRelativeRangeOptionDescription\n ),\n });\n\n const [selectedRadio, setSelectedRadio] = useState(() => {\n if (initialRange && !initialRange.key) {\n return CUSTOM_OPTION_SELECT_KEY;\n }\n return initialRange?.key ?? null;\n });\n\n const [customDuration, setCustomDuration] = useState(() => {\n if (initialRange) {\n return initialRange.amount;\n }\n // NaN represents an empty duration\n return NaN;\n });\n\n const initialCustomTimeUnit = dateOnly ? 'day' : 'minute';\n const [customUnitOfTime, setCustomUnitOfTime] = useState<DateRangePickerProps.TimeUnit>(\n initialRange?.unit ?? initialCustomTimeUnit\n );\n\n const showRadioControl = clientOptions.length > 0;\n const showCustomControls = clientOptions.length === 0 || selectedRadio === CUSTOM_OPTION_SELECT_KEY;\n\n return (\n <div>\n <InternalSpaceBetween size=\"xs\" direction=\"vertical\">\n {showRadioControl && (\n <InternalFormField\n label={i18n('i18nStrings.relativeRangeSelectionHeading', i18nStrings?.relativeRangeSelectionHeading)}\n >\n <InternalRadioGroup\n className={styles['relative-range-radio-group']}\n onChange={({ detail }) => {\n setSelectedRadio(detail.value);\n\n if (detail.value === CUSTOM_OPTION_SELECT_KEY) {\n setCustomDuration(NaN);\n setCustomUnitOfTime(initialCustomTimeUnit);\n onChangeRangeSize({\n amount: NaN,\n unit: initialCustomTimeUnit,\n type: 'relative',\n });\n } else {\n const option = clientOptions.filter(o => o.key === detail.value)[0];\n onChangeRangeSize(option);\n }\n }}\n value={selectedRadio}\n items={radioOptions}\n />\n </InternalFormField>\n )}\n\n {showCustomControls && (\n <InternalSpaceBetween direction=\"vertical\" size=\"xs\">\n {!showRadioControl && (\n <InternalBox fontSize=\"body-m\" color=\"text-body-secondary\">\n {i18n(\n 'i18nStrings.customRelativeRangeOptionDescription',\n i18nStrings?.customRelativeRangeOptionDescription\n )}\n </InternalBox>\n )}\n\n <div\n className={clsx(styles['custom-range'], {\n [styles['custom-range--no-padding']]: !showRadioControl,\n })}\n >\n <div\n className={clsx(styles['custom-range-form-controls'], {\n [styles.vertical]: isSingleGrid,\n })}\n >\n <div className={styles['custom-range-duration']}>\n <InternalFormField\n label={i18n(\n 'i18nStrings.customRelativeRangeDurationLabel',\n i18nStrings?.customRelativeRangeDurationLabel\n )}\n >\n <InternalInput\n type=\"number\"\n className={styles['custom-range-duration-input']}\n value={isNaN(customDuration) || customDuration === 0 ? '' : customDuration?.toString()}\n onChange={e => {\n const amount = Number(e.detail.value);\n\n setCustomDuration(amount);\n onChangeRangeSize({ amount, unit: customUnitOfTime, type: 'relative' });\n }}\n placeholder={i18n(\n 'i18nStrings.customRelativeRangeDurationPlaceholder',\n i18nStrings?.customRelativeRangeDurationPlaceholder\n )}\n __inheritFormFieldProps={true}\n />\n </InternalFormField>\n </div>\n\n <div className={styles['custom-range-unit']}>\n <InternalFormField\n label={i18n('i18nStrings.customRelativeRangeUnitLabel', i18nStrings?.customRelativeRangeUnitLabel)}\n >\n <InternalSelect\n className={styles['custom-range-unit-select']}\n selectedOption={\n {\n value: customUnitOfTime,\n label: formatUnit?.(customUnitOfTime, customDuration),\n } as UnitSelectOption\n }\n onChange={e => {\n const { value: unit } = e.detail.selectedOption as UnitSelectOption;\n\n setCustomUnitOfTime(unit);\n onChangeRangeSize({ amount: customDuration, unit, type: 'relative' });\n }}\n options={(dateOnly ? dayUnits : units).map(unit => ({\n value: unit,\n label: formatUnit?.(unit, customDuration),\n }))}\n renderHighlightedAriaLive={option => option.label || option.value || ''}\n />\n </InternalFormField>\n </div>\n </div>\n </div>\n </InternalSpaceBetween>\n )}\n </InternalSpaceBetween>\n </div>\n );\n}\n"]}
|
|
@@ -41,7 +41,7 @@ export interface ExpandableSectionProps extends BaseComponentProps {
|
|
|
41
41
|
*/
|
|
42
42
|
header?: React.ReactNode;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* The heading text. Use plain text. When using the container variant, you can use additional header props like `headerDescription` and `headerCounter` to display other elements in the header.
|
|
45
45
|
*/
|
|
46
46
|
headerText?: React.ReactNode;
|
|
47
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["expandable-section/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport namespace ExpandableSectionProps {\n export type Variant = 'default' | 'footer' | 'container' | 'navigation';\n export interface ChangeDetail {\n expanded: boolean;\n }\n export type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';\n}\n\nexport interface ExpandableSectionProps extends BaseComponentProps {\n /**\n * Determines whether the component initially displays in expanded state (that is, with content visible). The component operates in an uncontrolled\n * manner even if you provide a value for this property.\n */\n defaultExpanded?: boolean;\n\n /**\n * Determines whether the component is in the expanded state (that is, with content visible). The component operates in a controlled\n * manner if you provide a value for this property.\n */\n expanded?: boolean;\n\n /**\n * The possible variants of an expandable section are as follows:\n * * `default` - Use this variant in any context.\n * * `footer` - Use this variant in container footers.\n * * `container` - Use this variant in a detail page alongside other containers.\n * * `navigation` - Use this variant in the navigation panel with anchors and custom styled content.\n * It doesn't have any default styles.\n * */\n variant?: ExpandableSectionProps.Variant;\n\n /**\n * Determines whether the content section's default padding is removed. This default padding is only present for the `container` variant.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Primary content displayed in the expandable section element.\n */\n children?: React.ReactNode;\n\n /**\n * @deprecated Use `headerText` instead.\n */\n header?: React.ReactNode;\n\n /**\n *
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["expandable-section/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport namespace ExpandableSectionProps {\n export type Variant = 'default' | 'footer' | 'container' | 'navigation';\n export interface ChangeDetail {\n expanded: boolean;\n }\n export type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';\n}\n\nexport interface ExpandableSectionProps extends BaseComponentProps {\n /**\n * Determines whether the component initially displays in expanded state (that is, with content visible). The component operates in an uncontrolled\n * manner even if you provide a value for this property.\n */\n defaultExpanded?: boolean;\n\n /**\n * Determines whether the component is in the expanded state (that is, with content visible). The component operates in a controlled\n * manner if you provide a value for this property.\n */\n expanded?: boolean;\n\n /**\n * The possible variants of an expandable section are as follows:\n * * `default` - Use this variant in any context.\n * * `footer` - Use this variant in container footers.\n * * `container` - Use this variant in a detail page alongside other containers.\n * * `navigation` - Use this variant in the navigation panel with anchors and custom styled content.\n * It doesn't have any default styles.\n * */\n variant?: ExpandableSectionProps.Variant;\n\n /**\n * Determines whether the content section's default padding is removed. This default padding is only present for the `container` variant.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Primary content displayed in the expandable section element.\n */\n children?: React.ReactNode;\n\n /**\n * @deprecated Use `headerText` instead.\n */\n header?: React.ReactNode;\n\n /**\n * The heading text. Use plain text. When using the container variant, you can use additional header props like `headerDescription` and `headerCounter` to display other elements in the header.\n */\n headerText?: React.ReactNode;\n\n /**\n * Supplementary text below the heading. Use with container variant.\n */\n headerDescription?: string;\n\n /**\n * Specifies secondary text that's displayed to the right of the heading title. Use with container variant.\n * Behaves similar to the Header component counter.\n */\n headerCounter?: string;\n\n /**\n * Overrides the default [HTML heading tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements).\n * Use with container variant (which defaults to H2) or default/footer variants (which default to DIV). Note that this only\n * works with the `headerText` slot (not with the deprecated `header`), and not with the navigation variant.\n */\n headingTagOverride?: ExpandableSectionProps.HeadingTag;\n\n /**\n * Adds `aria-label` to the header element.\n * Use to assign unique labels when there are multiple expandable sections with the same header text on one page.\n */\n headerAriaLabel?: string;\n\n /**\n * Called when the state changes (that is, when the user expands or collapses the component).\n * The event `detail` contains the current value of the `expanded` property.\n */\n onChange?: NonCancelableEventHandler<ExpandableSectionProps.ChangeDetail>;\n}\n"]}
|
package/flashbar/interfaces.d.ts
CHANGED
|
@@ -77,6 +77,7 @@ export interface FlashbarProps extends BaseComponentProps {
|
|
|
77
77
|
* * `infoIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `info`.
|
|
78
78
|
* * `successIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `success`.
|
|
79
79
|
* * `inProgressIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of in-progress items (where `loading` is set to `true`).
|
|
80
|
+
* @i18n
|
|
80
81
|
*/
|
|
81
82
|
i18nStrings?: FlashbarProps.I18nStrings;
|
|
82
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W;QAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC/B;IAED,KAAY,IAAI,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IAC5D,KAAY,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC3C;AAED,MAAM,WAAW,aAAc,SAAQ,kBAAkB;IACvD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAEtD;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC;CACzC;AAED,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,GAAG,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["flashbar/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport React from 'react';\nimport { ButtonProps } from '../button/interfaces';\n\nexport namespace FlashbarProps {\n export interface MessageDefinition {\n header?: React.ReactNode;\n content?: React.ReactNode;\n dismissible?: boolean;\n dismissLabel?: string;\n statusIconAriaLabel?: string;\n loading?: boolean;\n type?: FlashbarProps.Type;\n ariaRole?: FlashbarProps.AriaRole;\n action?: React.ReactNode;\n id?: string;\n buttonText?: ButtonProps['children'];\n onButtonClick?: ButtonProps['onClick'];\n onDismiss?: ButtonProps['onClick'];\n }\n\n export interface I18nStrings {\n ariaLabel?: string;\n errorIconAriaLabel?: string;\n infoIconAriaLabel?: string;\n inProgressIconAriaLabel?: string;\n notificationBarAriaLabel?: string;\n notificationBarText?: string;\n successIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n }\n\n export type Type = 'success' | 'warning' | 'info' | 'error';\n export type AriaRole = 'alert' | 'status';\n}\n\nexport interface FlashbarProps extends BaseComponentProps {\n /**\n * Specifies flash messages that appear in the same order that they are listed.\n * The value is an array of flash message definition objects.\n *\n * A flash message object contains the following properties:\n * * `header` (ReactNode) - Specifies the heading text.\n * * `content` (ReactNode) - Specifies the primary text displayed in the flash element.\n * * `type` (string) - Indicates the type of the message to be displayed. Allowed values are as follows: `success, error, warning, info`. The default is `info`.\n * * `loading` (boolean) - Replaces the status icon with a spinner and forces the type to `info`.\n * * `dismissible` (boolean) - Determines whether the component includes a close button icon. By default, the close button is not included.\n * When a user clicks on this button the `onDismiss` handler is called.\n * * `dismissLabel` (string) - Specifies an `aria-label` for to the dismiss icon button for improved accessibility.\n * * `statusIconAriaLabel` (string) - Specifies an `aria-label` for to the status icon for improved accessibility.\n * * `ariaRole` (string) - For flash messages added after page load, specifies how this message is communicated to assistive\n * technology. Use \"status\" for status updates or informational content. Use \"alert\" for important messages that need the\n * user's attention.\n * * `action` (ReactNode) - Specifies an action for the flash message. Although it is technically possible to insert any content,\n * our UX guidelines only allow you to add a button.\n * * `buttonText` (string) - Specifies that an action button should be displayed, with the specified text.\n * When a user clicks on this button the `onButtonClick` handler is called.\n * If the `action` property is set, this property is ignored. **Deprecated**, replaced by `action`.\n * * `onButtonClick` (event => void) - Called when a user clicks on the action button. This is not called if you create a custom button\n * using the `action` property. **Deprecated**, replaced by `action`.\n * * `id` (string) - Specifies a unique flash message identifier. This property is used in two ways:\n * 1. As a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering.\n * 2. To identify which flash message will be removed from the DOM when it is dismissed, to animate it out.\n */\n items: ReadonlyArray<FlashbarProps.MessageDefinition>;\n\n /**\n * Specifies whether flash messages should be stacked.\n */\n stackItems?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component. The object should contain:\n *\n * * `ariaLabel` - Specifies the ARIA label for the list of notifications.\n *\n * If `stackItems` is set to `true`, it should also contain:\n *\n * * `notificationBarAriaLabel` - (optional) Specifies the ARIA label for the notification bar\n * * `notificationBarText` - (optional) Specifies the text shown in the notification bar\n * * `errorIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `error`.\n * * `warningIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `warning`.\n * * `infoIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `info`.\n * * `successIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `success`.\n * * `inProgressIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of in-progress items (where `loading` is set to `true`).\n */\n i18nStrings?: FlashbarProps.I18nStrings;\n}\n\nexport type FlashType = FlashbarProps.Type | 'progress';\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["flashbar/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport React from 'react';\nimport { ButtonProps } from '../button/interfaces';\n\nexport namespace FlashbarProps {\n export interface MessageDefinition {\n header?: React.ReactNode;\n content?: React.ReactNode;\n dismissible?: boolean;\n dismissLabel?: string;\n statusIconAriaLabel?: string;\n loading?: boolean;\n type?: FlashbarProps.Type;\n ariaRole?: FlashbarProps.AriaRole;\n action?: React.ReactNode;\n id?: string;\n buttonText?: ButtonProps['children'];\n onButtonClick?: ButtonProps['onClick'];\n onDismiss?: ButtonProps['onClick'];\n }\n\n export interface I18nStrings {\n ariaLabel?: string;\n errorIconAriaLabel?: string;\n infoIconAriaLabel?: string;\n inProgressIconAriaLabel?: string;\n notificationBarAriaLabel?: string;\n notificationBarText?: string;\n successIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n }\n\n export type Type = 'success' | 'warning' | 'info' | 'error';\n export type AriaRole = 'alert' | 'status';\n}\n\nexport interface FlashbarProps extends BaseComponentProps {\n /**\n * Specifies flash messages that appear in the same order that they are listed.\n * The value is an array of flash message definition objects.\n *\n * A flash message object contains the following properties:\n * * `header` (ReactNode) - Specifies the heading text.\n * * `content` (ReactNode) - Specifies the primary text displayed in the flash element.\n * * `type` (string) - Indicates the type of the message to be displayed. Allowed values are as follows: `success, error, warning, info`. The default is `info`.\n * * `loading` (boolean) - Replaces the status icon with a spinner and forces the type to `info`.\n * * `dismissible` (boolean) - Determines whether the component includes a close button icon. By default, the close button is not included.\n * When a user clicks on this button the `onDismiss` handler is called.\n * * `dismissLabel` (string) - Specifies an `aria-label` for to the dismiss icon button for improved accessibility.\n * * `statusIconAriaLabel` (string) - Specifies an `aria-label` for to the status icon for improved accessibility.\n * * `ariaRole` (string) - For flash messages added after page load, specifies how this message is communicated to assistive\n * technology. Use \"status\" for status updates or informational content. Use \"alert\" for important messages that need the\n * user's attention.\n * * `action` (ReactNode) - Specifies an action for the flash message. Although it is technically possible to insert any content,\n * our UX guidelines only allow you to add a button.\n * * `buttonText` (string) - Specifies that an action button should be displayed, with the specified text.\n * When a user clicks on this button the `onButtonClick` handler is called.\n * If the `action` property is set, this property is ignored. **Deprecated**, replaced by `action`.\n * * `onButtonClick` (event => void) - Called when a user clicks on the action button. This is not called if you create a custom button\n * using the `action` property. **Deprecated**, replaced by `action`.\n * * `id` (string) - Specifies a unique flash message identifier. This property is used in two ways:\n * 1. As a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering.\n * 2. To identify which flash message will be removed from the DOM when it is dismissed, to animate it out.\n */\n items: ReadonlyArray<FlashbarProps.MessageDefinition>;\n\n /**\n * Specifies whether flash messages should be stacked.\n */\n stackItems?: boolean;\n\n /**\n * An object containing all the necessary localized strings required by the component. The object should contain:\n *\n * * `ariaLabel` - Specifies the ARIA label for the list of notifications.\n *\n * If `stackItems` is set to `true`, it should also contain:\n *\n * * `notificationBarAriaLabel` - (optional) Specifies the ARIA label for the notification bar\n * * `notificationBarText` - (optional) Specifies the text shown in the notification bar\n * * `errorIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `error`.\n * * `warningIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `warning`.\n * * `infoIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `info`.\n * * `successIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of items of type `success`.\n * * `inProgressIconAriaLabel` - (optional) Specifies the ARIA label for the icon displayed next to the number of in-progress items (where `loading` is set to `true`).\n * @i18n\n */\n i18nStrings?: FlashbarProps.I18nStrings;\n}\n\nexport type FlashType = FlashbarProps.Type | 'progress';\n"]}
|
package/flashbar/styles.css.js
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"flash-with-motion": "awsui_flash-with-
|
|
5
|
-
"enter": "
|
|
6
|
-
"flash-body": "awsui_flash-
|
|
7
|
-
"flash-message": "awsui_flash-
|
|
8
|
-
"flash-header": "awsui_flash-
|
|
9
|
-
"flash-content": "awsui_flash-
|
|
10
|
-
"action-button-wrapper": "awsui_action-button-
|
|
11
|
-
"dismiss-button-wrapper": "awsui_dismiss-button-
|
|
12
|
-
"flash-icon": "awsui_flash-
|
|
13
|
-
"entering": "
|
|
14
|
-
"entered": "
|
|
15
|
-
"exiting": "
|
|
16
|
-
"stack": "
|
|
17
|
-
"animation-running": "awsui_animation-
|
|
18
|
-
"item": "
|
|
19
|
-
"flash-list-item": "awsui_flash-list-
|
|
20
|
-
"notification-bar": "awsui_notification-
|
|
21
|
-
"collapsed": "
|
|
22
|
-
"animation-ready": "awsui_animation-
|
|
23
|
-
"expanded-only": "awsui_expanded-
|
|
24
|
-
"expanded": "
|
|
25
|
-
"flash": "
|
|
26
|
-
"collapsible": "
|
|
27
|
-
"short-list": "awsui_short-
|
|
28
|
-
"visual-refresh": "awsui_visual-
|
|
29
|
-
"status": "
|
|
30
|
-
"header": "
|
|
31
|
-
"item-count": "awsui_item-
|
|
32
|
-
"button": "
|
|
33
|
-
"type-count": "awsui_type-
|
|
34
|
-
"count-number": "awsui_count-
|
|
35
|
-
"icon": "
|
|
36
|
-
"floating": "
|
|
37
|
-
"flashbar": "
|
|
38
|
-
"flash-refresh": "awsui_flash-
|
|
39
|
-
"flash-list": "awsui_flash-
|
|
40
|
-
"flash-focus-container": "awsui_flash-focus-
|
|
41
|
-
"flash-text": "awsui_flash-
|
|
42
|
-
"dismiss-button": "awsui_dismiss-
|
|
43
|
-
"breakpoint-default": "awsui_breakpoint-
|
|
44
|
-
"action-button": "awsui_action-
|
|
45
|
-
"flash-type-success": "awsui_flash-type-
|
|
46
|
-
"flash-type-error": "awsui_flash-type-
|
|
47
|
-
"flash-type-warning": "awsui_flash-type-
|
|
48
|
-
"flash-type-info": "awsui_flash-type-
|
|
4
|
+
"flash-with-motion": "awsui_flash-with-motion_1q84n_vjilu_93",
|
|
5
|
+
"enter": "awsui_enter_1q84n_vjilu_93",
|
|
6
|
+
"flash-body": "awsui_flash-body_1q84n_vjilu_107",
|
|
7
|
+
"flash-message": "awsui_flash-message_1q84n_vjilu_107",
|
|
8
|
+
"flash-header": "awsui_flash-header_1q84n_vjilu_107",
|
|
9
|
+
"flash-content": "awsui_flash-content_1q84n_vjilu_108",
|
|
10
|
+
"action-button-wrapper": "awsui_action-button-wrapper_1q84n_vjilu_109",
|
|
11
|
+
"dismiss-button-wrapper": "awsui_dismiss-button-wrapper_1q84n_vjilu_110",
|
|
12
|
+
"flash-icon": "awsui_flash-icon_1q84n_vjilu_133",
|
|
13
|
+
"entering": "awsui_entering_1q84n_vjilu_146",
|
|
14
|
+
"entered": "awsui_entered_1q84n_vjilu_167",
|
|
15
|
+
"exiting": "awsui_exiting_1q84n_vjilu_272",
|
|
16
|
+
"stack": "awsui_stack_1q84n_vjilu_294",
|
|
17
|
+
"animation-running": "awsui_animation-running_1q84n_vjilu_294",
|
|
18
|
+
"item": "awsui_item_1q84n_vjilu_294",
|
|
19
|
+
"flash-list-item": "awsui_flash-list-item_1q84n_vjilu_295",
|
|
20
|
+
"notification-bar": "awsui_notification-bar_1q84n_vjilu_296",
|
|
21
|
+
"collapsed": "awsui_collapsed_1q84n_vjilu_316",
|
|
22
|
+
"animation-ready": "awsui_animation-ready_1q84n_vjilu_316",
|
|
23
|
+
"expanded-only": "awsui_expanded-only_1q84n_vjilu_316",
|
|
24
|
+
"expanded": "awsui_expanded_1q84n_vjilu_316",
|
|
25
|
+
"flash": "awsui_flash_1q84n_vjilu_93",
|
|
26
|
+
"collapsible": "awsui_collapsible_1q84n_vjilu_380",
|
|
27
|
+
"short-list": "awsui_short-list_1q84n_vjilu_386",
|
|
28
|
+
"visual-refresh": "awsui_visual-refresh_1q84n_vjilu_386",
|
|
29
|
+
"status": "awsui_status_1q84n_vjilu_603",
|
|
30
|
+
"header": "awsui_header_1q84n_vjilu_603",
|
|
31
|
+
"item-count": "awsui_item-count_1q84n_vjilu_604",
|
|
32
|
+
"button": "awsui_button_1q84n_vjilu_605",
|
|
33
|
+
"type-count": "awsui_type-count_1q84n_vjilu_640",
|
|
34
|
+
"count-number": "awsui_count-number_1q84n_vjilu_640",
|
|
35
|
+
"icon": "awsui_icon_1q84n_vjilu_674",
|
|
36
|
+
"floating": "awsui_floating_1q84n_vjilu_712",
|
|
37
|
+
"flashbar": "awsui_flashbar_1q84n_vjilu_720",
|
|
38
|
+
"flash-refresh": "awsui_flash-refresh_1q84n_vjilu_766",
|
|
39
|
+
"flash-list": "awsui_flash-list_1q84n_vjilu_295",
|
|
40
|
+
"flash-focus-container": "awsui_flash-focus-container_1q84n_vjilu_785",
|
|
41
|
+
"flash-text": "awsui_flash-text_1q84n_vjilu_812",
|
|
42
|
+
"dismiss-button": "awsui_dismiss-button_1q84n_vjilu_110",
|
|
43
|
+
"breakpoint-default": "awsui_breakpoint-default_1q84n_vjilu_853",
|
|
44
|
+
"action-button": "awsui_action-button_1q84n_vjilu_109",
|
|
45
|
+
"flash-type-success": "awsui_flash-type-success_1q84n_vjilu_866",
|
|
46
|
+
"flash-type-error": "awsui_flash-type-error_1q84n_vjilu_870",
|
|
47
|
+
"flash-type-warning": "awsui_flash-type-warning_1q84n_vjilu_874",
|
|
48
|
+
"flash-type-info": "awsui_flash-type-info_1q84n_vjilu_878"
|
|
49
49
|
};
|
|
50
50
|
|