@cloudscape-design/components 3.0.41 → 3.0.44

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.
Files changed (57) hide show
  1. package/autosuggest/autosuggest-input.d.ts +28 -0
  2. package/autosuggest/autosuggest-input.d.ts.map +1 -0
  3. package/autosuggest/autosuggest-input.js +140 -0
  4. package/autosuggest/autosuggest-input.js.map +1 -0
  5. package/autosuggest/internal.d.ts.map +1 -1
  6. package/autosuggest/internal.js +45 -78
  7. package/autosuggest/internal.js.map +1 -1
  8. package/autosuggest/load-more-controller.d.ts.map +1 -1
  9. package/autosuggest/load-more-controller.js +1 -1
  10. package/autosuggest/load-more-controller.js.map +1 -1
  11. package/autosuggest/options-controller.d.ts.map +1 -1
  12. package/autosuggest/options-controller.js +0 -1
  13. package/autosuggest/options-controller.js.map +1 -1
  14. package/autosuggest/styles.css.js +5 -4
  15. package/autosuggest/styles.scoped.css +8 -4
  16. package/autosuggest/styles.selectors.js +5 -4
  17. package/code-editor/index.d.ts.map +1 -1
  18. package/code-editor/index.js +13 -14
  19. package/code-editor/index.js.map +1 -1
  20. package/code-editor/styles.css.js +32 -33
  21. package/code-editor/styles.scoped.css +116 -122
  22. package/code-editor/styles.selectors.js +32 -33
  23. package/date-range-picker/index.d.ts.map +1 -1
  24. package/date-range-picker/index.js +4 -9
  25. package/date-range-picker/index.js.map +1 -1
  26. package/header/interfaces.d.ts +1 -2
  27. package/header/interfaces.d.ts.map +1 -1
  28. package/header/interfaces.js.map +1 -1
  29. package/internal/environment.js +1 -1
  30. package/internal/utils/date-time/format-date-range.d.ts +2 -0
  31. package/internal/utils/date-time/format-date-range.d.ts.map +1 -0
  32. package/internal/utils/date-time/format-date-range.js +11 -0
  33. package/internal/utils/date-time/format-date-range.js.map +1 -0
  34. package/internal/utils/date-time/index.d.ts +1 -0
  35. package/internal/utils/date-time/index.d.ts.map +1 -1
  36. package/internal/utils/date-time/index.js +1 -0
  37. package/internal/utils/date-time/index.js.map +1 -1
  38. package/package.json +1 -1
  39. package/property-filter/controller.d.ts +2 -2
  40. package/property-filter/controller.d.ts.map +1 -1
  41. package/property-filter/controller.js +2 -2
  42. package/property-filter/controller.js.map +1 -1
  43. package/property-filter/index.d.ts.map +1 -1
  44. package/property-filter/index.js +1 -6
  45. package/property-filter/index.js.map +1 -1
  46. package/property-filter/property-filter-autosuggest.d.ts +2 -3
  47. package/property-filter/property-filter-autosuggest.d.ts.map +1 -1
  48. package/property-filter/property-filter-autosuggest.js +39 -77
  49. package/property-filter/property-filter-autosuggest.js.map +1 -1
  50. package/autosuggest/dropdown-controller.d.ts +0 -20
  51. package/autosuggest/dropdown-controller.d.ts.map +0 -1
  52. package/autosuggest/dropdown-controller.js +0 -29
  53. package/autosuggest/dropdown-controller.js.map +0 -1
  54. package/autosuggest/input-controller.d.ts +0 -12
  55. package/autosuggest/input-controller.d.ts.map +0 -1
  56. package/autosuggest/input-controller.js +0 -38
  57. package/autosuggest/input-controller.js.map +0 -1
@@ -2,38 +2,37 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "code-editor": "awsui_code-editor_1gl9c_1563r_98",
6
- "code-editor-refresh": "awsui_code-editor-refresh_1gl9c_1563r_342",
7
- "pane": "awsui_pane_1gl9c_1563r_354",
8
- "pane__close-container": "awsui_pane__close-container_1gl9c_1563r_365",
9
- "pane__list": "awsui_pane__list_1gl9c_1563r_370",
10
- "pane__table": "awsui_pane__table_1gl9c_1563r_377",
11
- "pane__item": "awsui_pane__item_1gl9c_1563r_382",
12
- "pane__cell": "awsui_pane__cell_1gl9c_1563r_382",
13
- "pane__item--highlighted": "awsui_pane__item--highlighted_1gl9c_1563r_396",
14
- "pane__location": "awsui_pane__location_1gl9c_1563r_417",
15
- "pane__description": "awsui_pane__description_1gl9c_1563r_417",
16
- "focus-lock": "awsui_focus-lock_1gl9c_1563r_432",
17
- "resizable-box": "awsui_resizable-box_1gl9c_1563r_455",
18
- "resizable-box-handle": "awsui_resizable-box-handle_1gl9c_1563r_460",
19
- "editor": "awsui_editor_1gl9c_1563r_485",
20
- "status-bar": "awsui_status-bar_1gl9c_1563r_518",
21
- "status-bar-with-hidden-pane": "awsui_status-bar-with-hidden-pane_1gl9c_1563r_527",
22
- "status-bar__left": "awsui_status-bar__left_1gl9c_1563r_531",
23
- "status-bar__left-virtual": "awsui_status-bar__left-virtual_1gl9c_1563r_538",
24
- "status-bar__right": "awsui_status-bar__right_1gl9c_1563r_542",
25
- "status-bar__language-mode": "awsui_status-bar__language-mode_1gl9c_1563r_546",
26
- "status-bar__cursor-position": "awsui_status-bar__cursor-position_1gl9c_1563r_546",
27
- "status-bar__cog-button": "awsui_status-bar__cog-button_1gl9c_1563r_551",
28
- "status-bar-virtual": "awsui_status-bar-virtual_1gl9c_1563r_555",
29
- "tab-button": "awsui_tab-button_1gl9c_1563r_561",
30
- "tab-button--refresh": "awsui_tab-button--refresh_1gl9c_1563r_574",
31
- "tab-button--active": "awsui_tab-button--active_1gl9c_1563r_588",
32
- "tab-button--disabled": "awsui_tab-button--disabled_1gl9c_1563r_608",
33
- "tab-button--divider": "awsui_tab-button--divider_1gl9c_1563r_638",
34
- "tab-button--errors": "awsui_tab-button--errors_1gl9c_1563r_645",
35
- "tab-button--warnings": "awsui_tab-button--warnings_1gl9c_1563r_645",
36
- "loading-screen": "awsui_loading-screen_1gl9c_1563r_649",
37
- "error-screen": "awsui_error-screen_1gl9c_1563r_650"
5
+ "code-editor": "awsui_code-editor_1gl9c_pjv1f_98",
6
+ "pane": "awsui_pane_1gl9c_pjv1f_351",
7
+ "pane__close-container": "awsui_pane__close-container_1gl9c_pjv1f_362",
8
+ "pane__list": "awsui_pane__list_1gl9c_pjv1f_367",
9
+ "pane__table": "awsui_pane__table_1gl9c_pjv1f_374",
10
+ "pane__item": "awsui_pane__item_1gl9c_pjv1f_379",
11
+ "pane__cell": "awsui_pane__cell_1gl9c_pjv1f_379",
12
+ "pane__item--highlighted": "awsui_pane__item--highlighted_1gl9c_pjv1f_393",
13
+ "pane__location": "awsui_pane__location_1gl9c_pjv1f_414",
14
+ "pane__description": "awsui_pane__description_1gl9c_pjv1f_414",
15
+ "focus-lock": "awsui_focus-lock_1gl9c_pjv1f_429",
16
+ "resizable-box": "awsui_resizable-box_1gl9c_pjv1f_452",
17
+ "resizable-box-handle": "awsui_resizable-box-handle_1gl9c_pjv1f_457",
18
+ "editor": "awsui_editor_1gl9c_pjv1f_482",
19
+ "status-bar": "awsui_status-bar_1gl9c_pjv1f_512",
20
+ "status-bar-with-hidden-pane": "awsui_status-bar-with-hidden-pane_1gl9c_pjv1f_521",
21
+ "status-bar__left": "awsui_status-bar__left_1gl9c_pjv1f_525",
22
+ "status-bar__left-virtual": "awsui_status-bar__left-virtual_1gl9c_pjv1f_532",
23
+ "status-bar__right": "awsui_status-bar__right_1gl9c_pjv1f_536",
24
+ "status-bar__language-mode": "awsui_status-bar__language-mode_1gl9c_pjv1f_540",
25
+ "status-bar__cursor-position": "awsui_status-bar__cursor-position_1gl9c_pjv1f_540",
26
+ "status-bar__cog-button": "awsui_status-bar__cog-button_1gl9c_pjv1f_545",
27
+ "status-bar-virtual": "awsui_status-bar-virtual_1gl9c_pjv1f_549",
28
+ "tab-button": "awsui_tab-button_1gl9c_pjv1f_555",
29
+ "tab-button--refresh": "awsui_tab-button--refresh_1gl9c_pjv1f_568",
30
+ "tab-button--active": "awsui_tab-button--active_1gl9c_pjv1f_582",
31
+ "tab-button--disabled": "awsui_tab-button--disabled_1gl9c_pjv1f_602",
32
+ "tab-button--divider": "awsui_tab-button--divider_1gl9c_pjv1f_632",
33
+ "tab-button--errors": "awsui_tab-button--errors_1gl9c_pjv1f_639",
34
+ "tab-button--warnings": "awsui_tab-button--warnings_1gl9c_pjv1f_639",
35
+ "loading-screen": "awsui_loading-screen_1gl9c_pjv1f_643",
36
+ "error-screen": "awsui_error-screen_1gl9c_pjv1f_644"
38
37
  };
39
38
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AA2BpD,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAyDhC,QAAA,MAAM,eAAe,uGAgMpB,CAAC;AAGF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA2C,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AA2BpD,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAmDhC,QAAA,MAAM,eAAe,uGAgMpB,CAAC;AAGF,eAAe,eAAe,CAAC"}
@@ -26,13 +26,13 @@ import { isDevelopment } from '../internal/is-development.js';
26
26
  import { warnOnce } from '../internal/logging.js';
27
27
  import { usePrevious } from '../internal/hooks/use-previous/index.js';
28
28
  import { useUniqueId } from '../internal/hooks/use-unique-id';
29
- import { formatTimezoneOffset, isIsoDateOnly } from '../internal/utils/date-time';
29
+ import { formatDateRange, isIsoDateOnly } from '../internal/utils/date-time';
30
30
  import { formatValue } from './use-date-range-picker.js';
31
- function formatDateRange(range, placeholder, formatRelativeRange, timeOffset) {
31
+ function renderDateRange(range, placeholder, formatRelativeRange, timeOffset) {
32
32
  if (!range) {
33
33
  return (React.createElement("span", { className: styles['label-text'], "aria-disabled": true }, placeholder));
34
34
  }
35
- var formatted = range.type === 'relative' ? (formatRelativeRange(range)) : (React.createElement(BreakSpaces, { text: formatAbsoluteRange(range, timeOffset) }));
35
+ var formatted = range.type === 'relative' ? (formatRelativeRange(range)) : (React.createElement(BreakSpaces, { text: formatDateRange(range.startDate, range.endDate, timeOffset) }));
36
36
  return (React.createElement(InternalBox, { fontWeight: "normal", display: "inline", color: "inherit" }, formatted));
37
37
  }
38
38
  function BreakSpaces(_a) {
@@ -42,11 +42,6 @@ function BreakSpaces(_a) {
42
42
  token,
43
43
  token === ' ' && React.createElement("wbr", null))); })));
44
44
  }
45
- function formatAbsoluteRange(value, timeOffset) {
46
- var formattedStartOffset = isDateOnly(value) ? '' : formatTimezoneOffset(value.startDate, timeOffset);
47
- var formattedEndOffset = isDateOnly(value) ? '' : formatTimezoneOffset(value.endDate, timeOffset);
48
- return value.startDate + formattedStartOffset + ' ' + '—' + ' ' + value.endDate + formattedEndOffset;
49
- }
50
45
  function isDateOnly(value) {
51
46
  if (!value || value.type !== 'absolute') {
52
47
  return false;
@@ -129,7 +124,7 @@ var DateRangePicker = React.forwardRef(function (_a, ref) {
129
124
  React.createElement("span", { className: styles['trigger-flexbox'] },
130
125
  React.createElement("span", { className: styles['icon-wrapper'] },
131
126
  React.createElement(InternalIcon, { name: "calendar", variant: disabled || readOnly ? 'disabled' : 'normal' })),
132
- formatDateRange(value, placeholder !== null && placeholder !== void 0 ? placeholder : '', i18nStrings.formatRelativeRange, timeOffset)))));
127
+ renderDateRange(value, placeholder !== null && placeholder !== void 0 ? placeholder : '', i18nStrings.formatRelativeRange, timeOffset)))));
133
128
  var mergedRef = useMergeRefs(rootRef, __internalRootRef);
134
129
  return (React.createElement("div", __assign({}, baseProps, { ref: mergedRef, className: clsx(baseProps.className, styles.root), onKeyDown: onWrapperKeyDownHandler }),
135
130
  React.createElement(Dropdown, { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: function () { return closeDropdown(); }, trigger: trigger, stretchToTriggerWidth: false, expandToViewport: expandToViewport, dropdownId: dropdownId }, isDropDownOpen && (React.createElement(DateRangePickerDropdown, { startOfWeek: startOfWeek, locale: normalizedLocale, isSingleGrid: isSingleGrid, onDropdownClose: function () { return closeDropdown(true); }, value: value, showClearButton: showClearButton, isDateEnabled: isDateEnabled, i18nStrings: i18nStrings, onClear: onClear, onApply: onApply, relativeOptions: relativeOptions, isValidRange: isValidRange, dateOnly: dateOnly, timeInputFormat: timeInputFormat, rangeSelectorMode: rangeSelectorMode, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby })))));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAO,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,aAAa,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BA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IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EACjD,SAAS,EAAE,uBAAuB;QAElC,oBAAC,QAAQ,IACP,YAAY,EAAE,IAAI,EAClB,aAAa,EAAE,IAAI,EACnB,IAAI,EAAE,cAAc,EACpB,eAAe,EAAE,cAAM,OAAA,aAAa,EAAE,EAAf,CAAe,EACtC,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,KAAK,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,IAErB,cAAc,IAAI,CACjB,oBAAC,uBAAuB,IACtB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,gBAAgB,EACxB,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,cAAM,OAAA,aAAa,CAAC,IAAI,CAAC,EAAnB,CAAmB,EAC1C,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,GAChC,CACH,CACQ,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AACrD,eAAe,eAAe,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useEffect, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DateRangePickerProps } from './interfaces';\nimport { normalizeLocale } from '../date-picker/calendar/utils/locales';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { KeyCode } from '../internal/keycode';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport InternalBox from '../box/internal';\nimport { DateRangePickerDropdown } from './dropdown';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport Dropdown from '../internal/components/dropdown';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport ButtonTrigger from '../internal/components/button-trigger';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport InternalIcon from '../icon/internal';\nimport { shiftTimeOffset } from './time-offset';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { fireNonCancelableEvent } from '../internal/events/index.js';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { warnOnce } from '../internal/logging.js';\nimport { usePrevious } from '../internal/hooks/use-previous/index.js';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { formatTimezoneOffset, isIsoDateOnly } from '../internal/utils/date-time';\nimport { formatValue } from './use-date-range-picker.js';\n\nexport { DateRangePickerProps };\n\nfunction formatDateRange(\n range: null | DateRangePickerProps.Value,\n placeholder: string,\n formatRelativeRange: DateRangePickerProps.I18nStrings['formatRelativeRange'],\n timeOffset?: number\n) {\n if (!range) {\n return (\n <span className={styles['label-text']} aria-disabled={true}>\n {placeholder}\n </span>\n );\n }\n\n const formatted =\n range.type === 'relative' ? (\n formatRelativeRange(range)\n ) : (\n <BreakSpaces text={formatAbsoluteRange(range, timeOffset)} />\n );\n\n return (\n <InternalBox fontWeight=\"normal\" display=\"inline\" color=\"inherit\">\n {formatted}\n </InternalBox>\n );\n}\n\nfunction BreakSpaces({ text }: { text: string }) {\n const tokens = text.split(/( )/);\n return (\n <div style={{ whiteSpace: 'nowrap' }}>\n {tokens.map((token, index) => (\n <React.Fragment key={index}>\n {token}\n {token === ' ' && <wbr />}\n </React.Fragment>\n ))}\n </div>\n );\n}\n\nfunction formatAbsoluteRange(value: DateRangePickerProps.AbsoluteValue, timeOffset?: number): string {\n const formattedStartOffset = isDateOnly(value) ? '' : formatTimezoneOffset(value.startDate, timeOffset);\n const formattedEndOffset = isDateOnly(value) ? '' : formatTimezoneOffset(value.endDate, timeOffset);\n return value.startDate + formattedStartOffset + ' ' + '—' + ' ' + value.endDate + formattedEndOffset;\n}\n\nfunction isDateOnly(value: null | DateRangePickerProps.Value) {\n if (!value || value.type !== 'absolute') {\n return false;\n }\n return isIsoDateOnly(value.startDate) && isIsoDateOnly(value.endDate);\n}\n\nconst DateRangePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n value,\n placeholder,\n readOnly = false,\n disabled = false,\n onChange,\n onBlur,\n onFocus,\n relativeOptions = [],\n i18nStrings,\n isValidRange = () => ({ valid: true }),\n showClearButton = true,\n dateOnly = false,\n timeOffset,\n timeInputFormat = 'hh:mm:ss',\n expandToViewport = false,\n rangeSelectorMode = 'default',\n ...rest\n }: DateRangePickerProps,\n ref: Ref<DateRangePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DateRangePicker');\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n value = isDateOnly(value) ? value : shiftTimeOffset(value, timeOffset);\n\n const baseProps = getBaseProps(rest);\n const { invalid, controlId, ariaDescribedby, ariaLabelledby } = useFormFieldContext({\n ariaLabelledby: rest.ariaLabelledby ?? i18nStrings.ariaLabelledby,\n ariaDescribedby: rest.ariaDescribedby ?? i18nStrings.ariaDescribedby,\n ...rest,\n });\n const isSingleGrid = useMobile();\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n useForwardFocus(ref, triggerRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('date-range-picker-dropdown');\n\n useFocusTracker({ rootRef, onBlur, onFocus, viewportId: expandToViewport ? dropdownId : '' });\n\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n\n const normalizedLocale = normalizeLocale('DateRangePicker', locale ?? '');\n\n const closeDropdown = (focusTrigger = false) => {\n setIsDropDownOpen(false);\n if (focusTrigger) {\n triggerRef.current?.focus();\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape) {\n closeDropdown(true);\n }\n };\n\n const onClear = () => {\n fireNonCancelableEvent(onChange, { value: null });\n };\n\n const onApply = (newValue: null | DateRangePickerProps.Value): DateRangePickerProps.ValidationResult => {\n const validationResult = isValidRange(newValue);\n if (validationResult?.valid === false) {\n return validationResult;\n }\n\n if (isDevelopment) {\n if (newValue?.type === 'absolute') {\n const [startDateWithoutTime] = newValue.startDate.split('T');\n const [endDateWithoutTime] = newValue.endDate.split('T');\n if (!startDateWithoutTime || !endDateWithoutTime) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided an `isValidRange` prop that did not catch a missing start or end date.'\n );\n }\n }\n }\n fireNonCancelableEvent(onChange, { value: formatValue(newValue, { dateOnly, timeOffset }) });\n return validationResult || { valid: true };\n };\n\n const prevDateOnly = usePrevious(dateOnly);\n useEffect(() => {\n if (prevDateOnly !== undefined && prevDateOnly !== dateOnly) {\n warnOnce(\n 'DateRangePicker',\n `The provided \\`dateOnly\\` flag has been changed from \"${prevDateOnly}\" to \"${dateOnly}\" which can lead to unexpected value format. Consider using separate components.`\n );\n }\n }, [prevDateOnly, dateOnly]);\n\n if (value && value.type !== 'absolute' && value.type !== 'relative') {\n warnOnce('DateRangePicker', 'You provided an invalid value. Reverting back to default.');\n value = null;\n }\n\n if (\n (value?.type === 'absolute' && rangeSelectorMode === 'relative-only') ||\n (value?.type === 'relative' && rangeSelectorMode === 'absolute-only')\n ) {\n warnOnce(\n 'DateRangePicker',\n 'The provided value does not correspond to the current range selector mode. Reverting back to default.'\n );\n value = null;\n }\n\n const trigger = (\n <div className={styles['trigger-wrapper']}>\n <ButtonTrigger\n ref={triggerRef}\n id={controlId}\n invalid={invalid}\n ariaLabel={i18nStrings.ariaLabel}\n ariaDescribedby={ariaDescribedby}\n ariaLabelledby={ariaLabelledby}\n className={clsx(styles.label, {\n [styles['label-enabled']]: !readOnly && !disabled,\n })}\n hideCaret={true}\n onClick={() => {\n if (!readOnly && !disabled) {\n setIsDropDownOpen(true);\n }\n }}\n disabled={disabled}\n readOnly={readOnly}\n ariaHasPopup=\"true\"\n >\n <span className={styles['trigger-flexbox']}>\n <span className={styles['icon-wrapper']}>\n <InternalIcon name=\"calendar\" variant={disabled || readOnly ? 'disabled' : 'normal'} />\n </span>\n {formatDateRange(value, placeholder ?? '', i18nStrings.formatRelativeRange, timeOffset)}\n </span>\n </ButtonTrigger>\n </div>\n );\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(baseProps.className, styles.root)}\n onKeyDown={onWrapperKeyDownHandler}\n >\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={() => closeDropdown()}\n trigger={trigger}\n stretchToTriggerWidth={false}\n expandToViewport={expandToViewport}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <DateRangePickerDropdown\n startOfWeek={startOfWeek}\n locale={normalizedLocale}\n isSingleGrid={isSingleGrid}\n onDropdownClose={() => closeDropdown(true)}\n value={value}\n showClearButton={showClearButton}\n isDateEnabled={isDateEnabled}\n i18nStrings={i18nStrings}\n onClear={onClear}\n onApply={onApply}\n relativeOptions={relativeOptions}\n isValidRange={isValidRange}\n dateOnly={dateOnly}\n timeInputFormat={timeInputFormat}\n rangeSelectorMode={rangeSelectorMode}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n />\n )}\n </Dropdown>\n </div>\n );\n }\n);\n\napplyDisplayName(DateRangePicker, 'DateRangePicker');\nexport default DateRangePicker;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-range-picker/index.tsx"],"names":[],"mappings":";AAAA,qE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B,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,GAChC,CACH,CACQ,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;AACrD,eAAe,eAAe,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { Ref, useEffect, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DateRangePickerProps } from './interfaces';\nimport { normalizeLocale } from '../date-picker/calendar/utils/locales';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { KeyCode } from '../internal/keycode';\nimport clsx from 'clsx';\nimport { getBaseProps } from '../internal/base-component';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport InternalBox from '../box/internal';\nimport { DateRangePickerDropdown } from './dropdown';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport Dropdown from '../internal/components/dropdown';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport ButtonTrigger from '../internal/components/button-trigger';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport InternalIcon from '../icon/internal';\nimport { shiftTimeOffset } from './time-offset';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { fireNonCancelableEvent } from '../internal/events/index.js';\nimport { isDevelopment } from '../internal/is-development.js';\nimport { warnOnce } from '../internal/logging.js';\nimport { usePrevious } from '../internal/hooks/use-previous/index.js';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { formatDateRange, isIsoDateOnly } from '../internal/utils/date-time';\nimport { formatValue } from './use-date-range-picker.js';\n\nexport { DateRangePickerProps };\n\nfunction renderDateRange(\n range: null | DateRangePickerProps.Value,\n placeholder: string,\n formatRelativeRange: DateRangePickerProps.I18nStrings['formatRelativeRange'],\n timeOffset?: number\n) {\n if (!range) {\n return (\n <span className={styles['label-text']} aria-disabled={true}>\n {placeholder}\n </span>\n );\n }\n\n const formatted =\n range.type === 'relative' ? (\n formatRelativeRange(range)\n ) : (\n <BreakSpaces text={formatDateRange(range.startDate, range.endDate, timeOffset)} />\n );\n\n return (\n <InternalBox fontWeight=\"normal\" display=\"inline\" color=\"inherit\">\n {formatted}\n </InternalBox>\n );\n}\n\nfunction BreakSpaces({ text }: { text: string }) {\n const tokens = text.split(/( )/);\n return (\n <div style={{ whiteSpace: 'nowrap' }}>\n {tokens.map((token, index) => (\n <React.Fragment key={index}>\n {token}\n {token === ' ' && <wbr />}\n </React.Fragment>\n ))}\n </div>\n );\n}\n\nfunction isDateOnly(value: null | DateRangePickerProps.Value) {\n if (!value || value.type !== 'absolute') {\n return false;\n }\n return isIsoDateOnly(value.startDate) && isIsoDateOnly(value.endDate);\n}\n\nconst DateRangePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled = () => true,\n value,\n placeholder,\n readOnly = false,\n disabled = false,\n onChange,\n onBlur,\n onFocus,\n relativeOptions = [],\n i18nStrings,\n isValidRange = () => ({ valid: true }),\n showClearButton = true,\n dateOnly = false,\n timeOffset,\n timeInputFormat = 'hh:mm:ss',\n expandToViewport = false,\n rangeSelectorMode = 'default',\n ...rest\n }: DateRangePickerProps,\n ref: Ref<DateRangePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DateRangePicker');\n checkControlled('DateRangePicker', 'value', value, 'onChange', onChange);\n\n value = isDateOnly(value) ? value : shiftTimeOffset(value, timeOffset);\n\n const baseProps = getBaseProps(rest);\n const { invalid, controlId, ariaDescribedby, ariaLabelledby } = useFormFieldContext({\n ariaLabelledby: rest.ariaLabelledby ?? i18nStrings.ariaLabelledby,\n ariaDescribedby: rest.ariaDescribedby ?? i18nStrings.ariaDescribedby,\n ...rest,\n });\n const isSingleGrid = useMobile();\n\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n useForwardFocus(ref, triggerRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('date-range-picker-dropdown');\n\n useFocusTracker({ rootRef, onBlur, onFocus, viewportId: expandToViewport ? dropdownId : '' });\n\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n\n const normalizedLocale = normalizeLocale('DateRangePicker', locale ?? '');\n\n const closeDropdown = (focusTrigger = false) => {\n setIsDropDownOpen(false);\n if (focusTrigger) {\n triggerRef.current?.focus();\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape) {\n closeDropdown(true);\n }\n };\n\n const onClear = () => {\n fireNonCancelableEvent(onChange, { value: null });\n };\n\n const onApply = (newValue: null | DateRangePickerProps.Value): DateRangePickerProps.ValidationResult => {\n const validationResult = isValidRange(newValue);\n if (validationResult?.valid === false) {\n return validationResult;\n }\n\n if (isDevelopment) {\n if (newValue?.type === 'absolute') {\n const [startDateWithoutTime] = newValue.startDate.split('T');\n const [endDateWithoutTime] = newValue.endDate.split('T');\n if (!startDateWithoutTime || !endDateWithoutTime) {\n warnOnce(\n 'DateRangePicker',\n 'You have provided an `isValidRange` prop that did not catch a missing start or end date.'\n );\n }\n }\n }\n fireNonCancelableEvent(onChange, { value: formatValue(newValue, { dateOnly, timeOffset }) });\n return validationResult || { valid: true };\n };\n\n const prevDateOnly = usePrevious(dateOnly);\n useEffect(() => {\n if (prevDateOnly !== undefined && prevDateOnly !== dateOnly) {\n warnOnce(\n 'DateRangePicker',\n `The provided \\`dateOnly\\` flag has been changed from \"${prevDateOnly}\" to \"${dateOnly}\" which can lead to unexpected value format. Consider using separate components.`\n );\n }\n }, [prevDateOnly, dateOnly]);\n\n if (value && value.type !== 'absolute' && value.type !== 'relative') {\n warnOnce('DateRangePicker', 'You provided an invalid value. Reverting back to default.');\n value = null;\n }\n\n if (\n (value?.type === 'absolute' && rangeSelectorMode === 'relative-only') ||\n (value?.type === 'relative' && rangeSelectorMode === 'absolute-only')\n ) {\n warnOnce(\n 'DateRangePicker',\n 'The provided value does not correspond to the current range selector mode. Reverting back to default.'\n );\n value = null;\n }\n\n const trigger = (\n <div className={styles['trigger-wrapper']}>\n <ButtonTrigger\n ref={triggerRef}\n id={controlId}\n invalid={invalid}\n ariaLabel={i18nStrings.ariaLabel}\n ariaDescribedby={ariaDescribedby}\n ariaLabelledby={ariaLabelledby}\n className={clsx(styles.label, {\n [styles['label-enabled']]: !readOnly && !disabled,\n })}\n hideCaret={true}\n onClick={() => {\n if (!readOnly && !disabled) {\n setIsDropDownOpen(true);\n }\n }}\n disabled={disabled}\n readOnly={readOnly}\n ariaHasPopup=\"true\"\n >\n <span className={styles['trigger-flexbox']}>\n <span className={styles['icon-wrapper']}>\n <InternalIcon name=\"calendar\" variant={disabled || readOnly ? 'disabled' : 'normal'} />\n </span>\n {renderDateRange(value, placeholder ?? '', i18nStrings.formatRelativeRange, timeOffset)}\n </span>\n </ButtonTrigger>\n </div>\n );\n\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n return (\n <div\n {...baseProps}\n ref={mergedRef}\n className={clsx(baseProps.className, styles.root)}\n onKeyDown={onWrapperKeyDownHandler}\n >\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={() => closeDropdown()}\n trigger={trigger}\n stretchToTriggerWidth={false}\n expandToViewport={expandToViewport}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <DateRangePickerDropdown\n startOfWeek={startOfWeek}\n locale={normalizedLocale}\n isSingleGrid={isSingleGrid}\n onDropdownClose={() => closeDropdown(true)}\n value={value}\n showClearButton={showClearButton}\n isDateEnabled={isDateEnabled}\n i18nStrings={i18nStrings}\n onClear={onClear}\n onApply={onApply}\n relativeOptions={relativeOptions}\n isValidRange={isValidRange}\n dateOnly={dateOnly}\n timeInputFormat={timeInputFormat}\n rangeSelectorMode={rangeSelectorMode}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n />\n )}\n </Dropdown>\n </div>\n );\n }\n);\n\napplyDisplayName(DateRangePicker, 'DateRangePicker');\nexport default DateRangePicker;\n"]}
@@ -39,9 +39,8 @@ export interface HeaderProps extends BaseComponentProps {
39
39
  */
40
40
  info?: React.ReactNode;
41
41
  }
42
- declare namespace HeaderProps {
42
+ export declare namespace HeaderProps {
43
43
  type Variant = 'h1' | 'h2' | 'h3' | 'awsui-h1-sticky';
44
44
  type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
45
45
  }
46
- export {};
47
46
  //# sourceMappingURL=interfaces.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/header/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC;IAC5C;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,kBAAU,WAAW,CAAC;IACpB,KAAY,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,iBAAiB,CAAC;IAC7D,KAAY,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3D"}
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/header/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,WAAY,SAAQ,kBAAkB;IACrD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC;IAC5C;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,yBAAiB,WAAW,CAAC;IAC3B,KAAY,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,iBAAiB,CAAC;IAC7D,KAAY,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/header/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';\n\nexport interface HeaderProps extends BaseComponentProps {\n /**\n * The heading text. Plain text is recommended. The component renders the\n * HTML heading tag based on the specified `variant` or `headingTagOverride`.\n * @displayname title\n */\n children?: React.ReactNode;\n /**\n * Specifies the variant of the header:\n * * `h1` - Use this for page level headers.\n * * `h2` - Use this for container level headers.\n * * `h3` - Use this for section level headers.\n * * `awsui-h1-sticky` - Use this for sticky headers in cards and tables.\n * @visualrefresh `awsui-h1-sticky` variant\n */\n variant?: HeaderProps.Variant;\n /**\n * Overrides the default [HTML heading tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements)\n * provided by the variant.\n */\n headingTagOverride?: HeaderProps.HeadingTag;\n /**\n * Supplementary text below the heading.\n */\n description?: React.ReactNode;\n /**\n * Actions for the container.\n */\n actions?: React.ReactNode;\n /**\n * Specifies secondary text that's displayed to the right of the heading title. This is commonly used\n * to display resource counters in table and cards components.\n */\n counter?: string;\n /**\n * Area next to the heading to display an Info link.\n */\n info?: React.ReactNode;\n}\n\nnamespace HeaderProps {\n export type Variant = 'h1' | 'h2' | 'h3' | 'awsui-h1-sticky';\n export type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/header/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';\n\nexport interface HeaderProps extends BaseComponentProps {\n /**\n * The heading text. Plain text is recommended. The component renders the\n * HTML heading tag based on the specified `variant` or `headingTagOverride`.\n * @displayname title\n */\n children?: React.ReactNode;\n /**\n * Specifies the variant of the header:\n * * `h1` - Use this for page level headers.\n * * `h2` - Use this for container level headers.\n * * `h3` - Use this for section level headers.\n * * `awsui-h1-sticky` - Use this for sticky headers in cards and tables.\n * @visualrefresh `awsui-h1-sticky` variant\n */\n variant?: HeaderProps.Variant;\n /**\n * Overrides the default [HTML heading tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements)\n * provided by the variant.\n */\n headingTagOverride?: HeaderProps.HeadingTag;\n /**\n * Supplementary text below the heading.\n */\n description?: React.ReactNode;\n /**\n * Actions for the container.\n */\n actions?: React.ReactNode;\n /**\n * Specifies secondary text that's displayed to the right of the heading title. This is commonly used\n * to display resource counters in table and cards components.\n */\n counter?: string;\n /**\n * Area next to the heading to display an Info link.\n */\n info?: React.ReactNode;\n}\n\nexport namespace HeaderProps {\n export type Variant = 'h1' | 'h2' | 'h3' | 'awsui-h1-sticky';\n export type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';\n}\n"]}
@@ -1,5 +1,5 @@
1
1
 
2
- export var PACKAGE_VERSION = '3.0.0 (296f455)';
2
+ export var PACKAGE_VERSION = '3.0.0 (d710d07)';
3
3
  export var THEME = 'open-source-visual-refresh';
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
5
5
 
@@ -0,0 +1,2 @@
1
+ export declare function formatDateRange(startDate: string, endDate: string, timeOffset?: number): string;
2
+ //# sourceMappingURL=format-date-range.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-date-range.d.ts","sourceRoot":"","sources":["../../../../../src/internal/utils/date-time/format-date-range.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAK/F"}
@@ -0,0 +1,11 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { formatTimezoneOffset } from './format-timezone-offset';
4
+ import { isIsoDateOnly } from './is-iso-date-only';
5
+ export function formatDateRange(startDate, endDate, timeOffset) {
6
+ var isDateOnly = isIsoDateOnly(startDate) && isIsoDateOnly(endDate);
7
+ var formattedStartOffset = isDateOnly ? '' : formatTimezoneOffset(startDate, timeOffset);
8
+ var formattedEndOffset = isDateOnly ? '' : formatTimezoneOffset(endDate, timeOffset);
9
+ return startDate + formattedStartOffset + ' ' + '—' + ' ' + endDate + formattedEndOffset;
10
+ }
11
+ //# sourceMappingURL=format-date-range.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-date-range.js","sourceRoot":"","sources":["../../../../../src/internal/utils/date-time/format-date-range.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAE,OAAe,EAAE,UAAmB;IACrF,IAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;IACtE,IAAM,oBAAoB,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC3F,IAAM,kBAAkB,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACvF,OAAO,SAAS,GAAG,oBAAoB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,OAAO,GAAG,kBAAkB,CAAC;AAC3F,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { formatTimezoneOffset } from './format-timezone-offset';\nimport { isIsoDateOnly } from './is-iso-date-only';\n\nexport function formatDateRange(startDate: string, endDate: string, timeOffset?: number): string {\n const isDateOnly = isIsoDateOnly(startDate) && isIsoDateOnly(endDate);\n const formattedStartOffset = isDateOnly ? '' : formatTimezoneOffset(startDate, timeOffset);\n const formattedEndOffset = isDateOnly ? '' : formatTimezoneOffset(endDate, timeOffset);\n return startDate + formattedStartOffset + ' ' + '—' + ' ' + endDate + formattedEndOffset;\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  export { isoToDisplay, displayToIso } from './display-format';
2
+ export { formatDateRange } from './format-date-range';
2
3
  export { formatDate } from './format-date';
3
4
  export { formatTime } from './format-time';
4
5
  export { formatTimezoneOffset } from './format-timezone-offset';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/utils/date-time/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/utils/date-time/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export { isoToDisplay, displayToIso } from './display-format';
4
+ export { formatDateRange } from './format-date-range';
4
5
  export { formatDate } from './format-date';
5
6
  export { formatTime } from './format-time';
6
7
  export { formatTimezoneOffset } from './format-timezone-offset';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/utils/date-time/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport { isoToDisplay, displayToIso } from './display-format';\nexport { formatDate } from './format-date';\nexport { formatTime } from './format-time';\nexport { formatTimezoneOffset } from './format-timezone-offset';\nexport { isIsoDateOnly } from './is-iso-date-only';\nexport { joinDateTime } from './join-date-time';\nexport { parseDate } from './parse-date';\nexport { parseTimezoneOffset } from './parse-timezone-offset';\nexport { shiftTimezoneOffset } from './shift-timezone-offset';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/utils/date-time/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport { isoToDisplay, displayToIso } from './display-format';\nexport { formatDateRange } from './format-date-range';\nexport { formatDate } from './format-date';\nexport { formatTime } from './format-time';\nexport { formatTimezoneOffset } from './format-timezone-offset';\nexport { isIsoDateOnly } from './is-iso-date-only';\nexport { joinDateTime } from './join-date-time';\nexport { parseDate } from './parse-date';\nexport { parseTimezoneOffset } from './parse-timezone-offset';\nexport { shiftTimezoneOffset } from './shift-timezone-offset';\n"]}
package/package.json CHANGED
@@ -111,6 +111,6 @@
111
111
  "./internal/base-component/index.js",
112
112
  "./internal/base-component/styles.css.js"
113
113
  ],
114
- "version": "3.0.41",
114
+ "version": "3.0.44",
115
115
  "license": "Apache-2.0"
116
116
  }
@@ -1,7 +1,7 @@
1
1
  import { PropertyFilterProps } from './interfaces';
2
2
  import { AutosuggestProps } from '../autosuggest/interfaces';
3
- import { InputProps } from '../input/interfaces';
4
- export declare const getQueryActions: (query: PropertyFilterProps['query'], onChange: PropertyFilterProps['onChange'], inputRef: React.RefObject<InputProps.Ref>, preventFocus: React.MutableRefObject<boolean>) => {
3
+ import { AutosuggestInputRef } from '../autosuggest/autosuggest-input';
4
+ export declare const getQueryActions: (query: PropertyFilterProps['query'], onChange: PropertyFilterProps['onChange'], inputRef: React.RefObject<AutosuggestInputRef>, preventFocus: React.MutableRefObject<boolean>) => {
5
5
  setToken: (index: number, newToken: PropertyFilterProps.Token) => void;
6
6
  removeToken: (index: number) => void;
7
7
  removeAllTokens: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../../src/property-filter/controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGjD,eAAO,MAAM,eAAe,UACnB,mBAAmB,CAAC,OAAO,CAAC,YACzB,mBAAmB,CAAC,UAAU,CAAC,YAC/B,MAAM,SAAS,CAAC,WAAW,GAAG,CAAC,gBAC3B,MAAM,gBAAgB,CAAC,OAAO,CAAC;sBAKpB,MAAM,YAAY,oBAAoB,KAAK;yBAOxC,MAAM;;yBAWN,oBAAoB,KAAK;iCAKjB,oBAAoB,aAAa;CAUtE,CAAC;AAEF,oBAAY,UAAU,GAClB;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,mBAAmB,CAAC,iBAAiB,CAAC;IAChD,QAAQ,EAAE,mBAAmB,CAAC,kBAAkB,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,mBAAmB,CAAC,i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qB,CAAC,EAC5E,yBAAyB,EAAE,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,iBAAiB,KAAK,CAAC,oBA2B3F;AAED,oBAAY,eAAe,GACvB,kBAAkB,GAClB,yBAAyB,GACzB,qBAAqB,GACrB,4BAA4B,GAC5B,sBAAsB,GACtB,4BAA4B,GAC5B,oBAAoB,GACpB,0BAA0B,CAAC;AAC/B,eAAO,MAAM,qBAAqB,eACpB,UAAU,oBACJ,mBAAmB,CAAC,kBAAkB,CAAC,uBACpC,mBAAmB,CAAC,qBAAqB,CAAC,oBAC7C,mBAAmB,CAAC,kBAAkB,CAAC,eAC5C,KACX,mBAAmB,CAAC,aAAa,CAAC,EAClC,qBAAqB,GAAG,iBAAiB,GAAG,eAAe,GAAG,eAAe,CAC9E;;;;;;;;;;;;;;;;CAqEF,CAAC;AAEF,eAAO,MAAM,qBAAqB,aACtB,oBAAoB,kBAAkB,eACnC,KAAK,mBAAmB,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC,WAavE,CAAC"}
@@ -18,13 +18,13 @@ export var getQueryActions = function (query, onChange, inputRef, preventFocus)
18
18
  var newTokens = tokens.filter(function (_, i) { return i !== index; });
19
19
  fireOnChange(newTokens, operation);
20
20
  preventFocus.current = true;
21
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
21
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focusNoOpen();
22
22
  };
23
23
  var removeAllTokens = function () {
24
24
  var _a;
25
25
  fireOnChange([], operation);
26
26
  preventFocus.current = true;
27
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
27
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focusNoOpen();
28
28
  };
29
29
  var addToken = function (newToken) {
30
30
  var newTokens = __spreadArray([], tokens, true);
@@ -1 +1 @@
1
- {"version":3,"file":"controller.js","sourceRoot":"","sources":["../../../src/property-filter/controller.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,sBAAsB,EAA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G,WAAW,CAAC,mBAAmB;QACtC,GAAC,IAAI,IAAG,WAAW,CAAC,0BAA0B;QAC9C,GAAC,GAAG,IAAG,WAAW,CAAC,oBAAoB;QACvC,GAAC,IAAI,IAAG,WAAW,CAAC,0BAA0B;QAC9C,GAAC,GAAG,IAAG,WAAW,CAAC,kBAAkB;QACrC,GAAC,IAAI,IAAG,WAAW,CAAC,wBAAwB;WAC7C,CAAC;IACF,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { PropertyFilterProps } from './interfaces';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { InputProps } from '../input/interfaces';\nimport { matchFilteringProperty, matchOperator, matchOperatorPrefix, trimFirstSpace, trimStart } from './utils';\n\nexport const getQueryActions = (\n query: PropertyFilterProps['query'],\n onChange: PropertyFilterProps['onChange'],\n inputRef: React.RefObject<InputProps.Ref>,\n preventFocus: React.MutableRefObject<boolean>\n) => {\n const { tokens, operation } = query;\n const fireOnChange = (tokens: readonly PropertyFilterProps.Token[], operation: PropertyFilterProps.JoinOperation) =>\n fireNonCancelableEvent(onChange, { tokens, operation });\n const setToken = (index: number, newToken: PropertyFilterProps.Token) => {\n const newTokens = [...tokens];\n if (newTokens && index < newTokens.length) {\n newTokens[index] = newToken;\n }\n fireOnChange(newTokens, operation);\n };\n const removeToken = (index: number) => {\n const newTokens = tokens.filter((_, i) => i !== index);\n fireOnChange(newTokens, operation);\n preventFocus.current = true;\n inputRef.current?.focus();\n };\n const removeAllTokens = () => {\n fireOnChange([], operation);\n preventFocus.current = true;\n inputRef.current?.focus();\n };\n const addToken = (newToken: PropertyFilterProps.Token) => {\n const newTokens = [...tokens];\n newTokens.push(newToken);\n fireOnChange(newTokens, operation);\n };\n const setOperation = (newOperation: PropertyFilterProps.JoinOperation) => {\n fireOnChange(tokens, newOperation);\n };\n return {\n setToken,\n removeToken,\n removeAllTokens,\n addToken,\n setOperation,\n };\n};\n\nexport type ParsedText =\n | {\n step: 'property';\n property: PropertyFilterProps.FilteringProperty;\n operator: PropertyFilterProps.ComparisonOperator;\n value: string;\n }\n | { step: 'operator'; property: PropertyFilterProps.FilteringProperty; operatorPrefix: string }\n | { step: 'free-text'; operator?: PropertyFilterProps.ComparisonOperator; value: string };\n\nexport const getAllowedOperators = (\n property: PropertyFilterProps.FilteringProperty\n): PropertyFilterProps.ComparisonOperator[] => {\n const { operators, defaultOperator } = property;\n const operatorOrder = ['=', '!=', ':', '!:', '>=', '<=', '<', '>'] as const;\n const operatorSet: { [key: string]: true } = { [defaultOperator ?? '=']: true };\n // TODO: remove unknown type annotation once extended operators are supported.\n operators?.forEach((op: unknown) => {\n if (typeof op === 'string') {\n operatorSet[op] = true;\n }\n });\n return operatorOrder.filter(op => operatorSet[op]);\n};\n\n/*\n * parses the value of the filtering input to figure out the current step of entering the token:\n * - \"property\": means that a filter on a particular column is being added, with operator already finalized\n * - \"operator\": means that a filter on a particular column is being added, with operator not yet finalized\n * - \"free-text\": means that a \"free text\" token is being added\n */\nexport const parseText = (\n filteringText: string,\n filteringProperties: PropertyFilterProps['filteringProperties'] = [],\n disableFreeTextFiltering: boolean\n): ParsedText => {\n const negatedGlobalQuery = /^(!:|!)(.*)/.exec(filteringText);\n if (!disableFreeTextFiltering && negatedGlobalQuery) {\n return {\n step: 'free-text',\n operator: '!:',\n value: negatedGlobalQuery[2],\n };\n }\n\n const property = matchFilteringProperty(filteringProperties, filteringText);\n if (!property) {\n return {\n step: 'free-text',\n value: filteringText,\n };\n }\n\n const allowedOps = getAllowedOperators(property);\n const textWithoutProperty = filteringText.substring(property.propertyLabel.length);\n const operator = matchOperator(allowedOps, trimStart(textWithoutProperty));\n if (operator) {\n const operatorLastIndex = textWithoutProperty.indexOf(operator) + operator.length;\n const textWithoutPropertyAndOperator = textWithoutProperty.slice(operatorLastIndex);\n return {\n step: 'property',\n property,\n operator,\n // We need to remove the first leading space in case the user presses space\n // after the operator, for example: Owner: admin, will result in value of ` admin`\n // and we need to remove the first space, if the user added any more spaces only the\n // first one will be removed.\n value: trimFirstSpace(textWithoutPropertyAndOperator),\n };\n }\n\n const operatorPrefix = matchOperatorPrefix(allowedOps, trimStart(textWithoutProperty));\n if (operatorPrefix !== null) {\n return { step: 'operator', property, operatorPrefix };\n }\n\n return {\n step: 'free-text',\n value: filteringText,\n };\n};\n\nexport const getPropertyOptions = (\n filteringProperty: PropertyFilterProps.FilteringProperty,\n filteringOptions: PropertyFilterProps['filteringOptions']\n) => {\n return filteringOptions?.filter(option => option.propertyKey === filteringProperty.key);\n};\n\ninterface OptionGroup<T> {\n label: string;\n options: T[];\n}\n\ninterface ExtendedAutosuggestOption extends AutosuggestProps.Option {\n tokenValue: string;\n}\n\nexport const getAllValueSuggestions = (\n filteringOptions: PropertyFilterProps['filteringOptions'],\n filteringProperties: PropertyFilterProps['filteringProperties'],\n operator: PropertyFilterProps.ComparisonOperator | undefined = '=',\n i18nStrings: Pick<PropertyFilterProps.I18nStrings, 'groupValuesText'>,\n customGroupsText: PropertyFilterProps['customGroupsText']\n) => {\n const defaultGroup: OptionGroup<ExtendedAutosuggestOption> = {\n label: i18nStrings.groupValuesText,\n options: [],\n };\n const customGroups: { [K in string]: OptionGroup<ExtendedAutosuggestOption> } = {};\n filteringOptions?.forEach(filteringOption => {\n const property = getPropertyByKey(filteringProperties, filteringOption.propertyKey);\n // given option refers to a non-existent filtering property\n if (!property) {\n return;\n }\n // this option's filtering property does not support current operator\n if (getAllowedOperators(property).indexOf(operator) === -1) {\n return;\n }\n if (property.group && !customGroups[property.group]) {\n const label =\n customGroupsText?.reduce<string>(\n (acc, customGroup) => (customGroup.group === property.group ? customGroup.values : acc),\n ''\n ) || '';\n customGroups[property.group] = {\n label,\n options: [],\n };\n }\n const propertyGroup = property.group ? customGroups[property.group] : defaultGroup;\n propertyGroup.options.push({\n tokenValue: property.propertyLabel + (operator || '=') + filteringOption.value,\n label: filteringOption.value,\n __labelPrefix: property.propertyLabel + ' ' + (operator || '='),\n });\n });\n return [defaultGroup, ...Object.keys(customGroups).map(group => customGroups[group])];\n};\n\nexport const getPropertyByKey = (filteringProperties: PropertyFilterProps['filteringProperties'], key: string) => {\n const propertyMap = filteringProperties.reduce<{ [K: string]: PropertyFilterProps.FilteringProperty }>(\n (acc, property) => {\n acc[property.key] = property;\n return acc;\n },\n {}\n );\n return propertyMap[key] as PropertyFilterProps.FilteringProperty | undefined;\n};\n\nconst filteringPropertyToAutosuggestOption = (filteringProperty: PropertyFilterProps.FilteringProperty) => ({\n value: filteringProperty.propertyLabel,\n keepOpenOnSelect: true,\n});\n\nexport function getPropertySuggestions<T>(\n filteringProperties: PropertyFilterProps['filteringProperties'],\n customGroupsText: PropertyFilterProps['customGroupsText'],\n i18nStrings: Pick<PropertyFilterProps['i18nStrings'], 'groupPropertiesText'>,\n filteringPropertyToOption: (filteringProperty: PropertyFilterProps.FilteringProperty) => T\n) {\n const defaultGroup: OptionGroup<T> = {\n label: i18nStrings.groupPropertiesText,\n options: [],\n };\n const customGroups: { [K in string]: OptionGroup<T> } = {};\n\n filteringProperties.forEach(filteringProperty => {\n const { group } = filteringProperty;\n let optionsGroup = defaultGroup;\n if (group) {\n if (!customGroups[group]) {\n const label =\n customGroupsText?.reduce<string>(\n (acc, customGroup) => (customGroup.group === group ? customGroup.properties : acc),\n ''\n ) || '';\n customGroups[group] = { options: [], label };\n }\n optionsGroup = customGroups[group];\n }\n optionsGroup.options.push(filteringPropertyToOption(filteringProperty));\n });\n const defaultGroupArray = defaultGroup.options.length ? [defaultGroup] : [];\n const customGroupsArray = Object.keys(customGroups).map(groupKey => customGroups[groupKey]);\n return [...defaultGroupArray, ...customGroupsArray];\n}\n\nexport type OperatorStrings =\n | 'operatorLessText'\n | 'operatorLessOrEqualText'\n | 'operatorGreaterText'\n | 'operatorGreaterOrEqualText'\n | 'operatorContainsText'\n | 'operatorDoesNotContainText'\n | 'operatorEqualsText'\n | 'operatorDoesNotEqualText';\nexport const getAutosuggestOptions = (\n parsedText: ParsedText,\n filteringOptions: PropertyFilterProps['filteringOptions'],\n filteringProperties: PropertyFilterProps['filteringProperties'],\n customGroupsText: PropertyFilterProps['customGroupsText'],\n i18nStrings: Pick<\n PropertyFilterProps['i18nStrings'],\n 'groupPropertiesText' | 'groupValuesText' | 'operatorsText' | OperatorStrings\n >\n) => {\n switch (parsedText.step) {\n case 'property': {\n const { propertyLabel, groupValuesLabel } = parsedText.property;\n const options = getPropertyOptions(parsedText.property, filteringOptions);\n return {\n filterText: parsedText.value,\n options: [\n {\n options: (options || []).map(({ value }) => ({\n tokenValue: propertyLabel + parsedText.operator + value,\n label: value,\n __labelPrefix: propertyLabel + ' ' + parsedText.operator,\n })),\n label: groupValuesLabel,\n },\n ],\n };\n }\n case 'operator': {\n return {\n filterText: parsedText.property.propertyLabel + ' ' + parsedText.operatorPrefix,\n options: [\n ...getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n filteringPropertyToAutosuggestOption\n ),\n {\n options: getAllowedOperators(parsedText.property).map(value => ({\n value: parsedText.property.propertyLabel + ' ' + value + ' ',\n label: parsedText.property.propertyLabel + ' ' + value,\n description: operatorToDescription(value, i18nStrings),\n keepOpenOnSelect: true,\n })),\n label: i18nStrings.operatorsText,\n },\n ],\n };\n }\n case 'free-text': {\n const needsValueSuggestions = !!parsedText.value;\n const needsPropertySuggestions = !(parsedText.step === 'free-text' && parsedText.operator === '!:');\n return {\n filterText: parsedText.value,\n options: [\n ...(needsPropertySuggestions\n ? getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n filteringPropertyToAutosuggestOption\n )\n : []),\n ...(needsValueSuggestions\n ? getAllValueSuggestions(\n filteringOptions,\n filteringProperties,\n parsedText.operator,\n i18nStrings,\n customGroupsText\n )\n : []),\n ],\n };\n }\n }\n};\n\nexport const operatorToDescription = (\n operator: PropertyFilterProps.ComparisonOperator,\n i18nStrings: Pick<PropertyFilterProps['i18nStrings'], OperatorStrings>\n) => {\n const mapping: { [K in PropertyFilterProps.ComparisonOperator]: string } = {\n ['<']: i18nStrings.operatorLessText,\n ['<=']: i18nStrings.operatorLessOrEqualText,\n ['>']: i18nStrings.operatorGreaterText,\n ['>=']: i18nStrings.operatorGreaterOrEqualText,\n [':']: i18nStrings.operatorContainsText,\n ['!:']: i18nStrings.operatorDoesNotContainText,\n ['=']: i18nStrings.operatorEqualsText,\n ['!=']: i18nStrings.operatorDoesNotEqualText,\n };\n return mapping[operator];\n};\n"]}
1
+ {"version":3,"file":"controller.js","sourceRoot":"","sources":["../../../src/property-filter/controller.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGhH,MAAM,CAAC,IAAM,eAAe,GAAG,UAC7B,KAAmC,EACnC,QAAyC,EACzC,QAA8C,EAC9C,YAA6C;IAErC,IAAA,MAAM,GAAgB,KAAK,OAArB,EAAE,SAAS,GAAK,KAAK,UAAV,CAAW;IACpC,IAAM,YAAY,GAAG,UAAC,MAA4C,EAAE,SAA4C;QAC9G,OAAA,sBAAsB,CAAC,QAAQ,EAAE,EAAE,MAAM,QAAA,EAAE,SAAS,WAAA,EAAE,CAAC;IAAvD,CAAuD,CAAC;IAC1D,IAAM,QAAQ,GAAG,UAAC,KAAa,EAAE,QAAmC;QAClE,IAAM,SAAS,qBAAO,MAAM,OAAC,CAAC;QAC9B,IAAI,SAAS,IAAI,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE;YACzC,SAAS,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;SAC7B;QACD,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACrC,CAAC,CAAC;IACF,IAAM,WA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B,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,oCAAoC,CACrC;oBACH,CAAC,CAAC,EAAE,CAAC,SACJ,CAAC,qBAAqB;oBACvB,CAAC,CAAC,sBAAsB,CACpB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,CAAC,QAAQ,EACnB,WAAW,EACX,gBAAgB,CACjB;oBACH,CAAC,CAAC,EAAE,CAAC,OACR;aACF,CAAC;SACH;KACF;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,IAAM,qBAAqB,GAAG,UACnC,QAAgD,EAChD,WAAsE;;IAEtE,IAAM,OAAO;QACX,GAAC,GAAG,IAAG,WAAW,CAAC,gBAAgB;QACnC,GAAC,IAAI,IAAG,WAAW,CAAC,uBAAuB;QAC3C,GAAC,GAAG,IAAG,WAAW,CAAC,mBAAmB;QACtC,GAAC,IAAI,IAAG,WAAW,CAAC,0BAA0B;QAC9C,GAAC,GAAG,IAAG,WAAW,CAAC,oBAAoB;QACvC,GAAC,IAAI,IAAG,WAAW,CAAC,0BAA0B;QAC9C,GAAC,GAAG,IAAG,WAAW,CAAC,kBAAkB;QACrC,GAAC,IAAI,IAAG,WAAW,CAAC,wBAAwB;WAC7C,CAAC;IACF,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { PropertyFilterProps } from './interfaces';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { AutosuggestProps } from '../autosuggest/interfaces';\nimport { matchFilteringProperty, matchOperator, matchOperatorPrefix, trimFirstSpace, trimStart } from './utils';\nimport { AutosuggestInputRef } from '../autosuggest/autosuggest-input';\n\nexport const getQueryActions = (\n query: PropertyFilterProps['query'],\n onChange: PropertyFilterProps['onChange'],\n inputRef: React.RefObject<AutosuggestInputRef>,\n preventFocus: React.MutableRefObject<boolean>\n) => {\n const { tokens, operation } = query;\n const fireOnChange = (tokens: readonly PropertyFilterProps.Token[], operation: PropertyFilterProps.JoinOperation) =>\n fireNonCancelableEvent(onChange, { tokens, operation });\n const setToken = (index: number, newToken: PropertyFilterProps.Token) => {\n const newTokens = [...tokens];\n if (newTokens && index < newTokens.length) {\n newTokens[index] = newToken;\n }\n fireOnChange(newTokens, operation);\n };\n const removeToken = (index: number) => {\n const newTokens = tokens.filter((_, i) => i !== index);\n fireOnChange(newTokens, operation);\n preventFocus.current = true;\n inputRef.current?.focusNoOpen();\n };\n const removeAllTokens = () => {\n fireOnChange([], operation);\n preventFocus.current = true;\n inputRef.current?.focusNoOpen();\n };\n const addToken = (newToken: PropertyFilterProps.Token) => {\n const newTokens = [...tokens];\n newTokens.push(newToken);\n fireOnChange(newTokens, operation);\n };\n const setOperation = (newOperation: PropertyFilterProps.JoinOperation) => {\n fireOnChange(tokens, newOperation);\n };\n return {\n setToken,\n removeToken,\n removeAllTokens,\n addToken,\n setOperation,\n };\n};\n\nexport type ParsedText =\n | {\n step: 'property';\n property: PropertyFilterProps.FilteringProperty;\n operator: PropertyFilterProps.ComparisonOperator;\n value: string;\n }\n | { step: 'operator'; property: PropertyFilterProps.FilteringProperty; operatorPrefix: string }\n | { step: 'free-text'; operator?: PropertyFilterProps.ComparisonOperator; value: string };\n\nexport const getAllowedOperators = (\n property: PropertyFilterProps.FilteringProperty\n): PropertyFilterProps.ComparisonOperator[] => {\n const { operators, defaultOperator } = property;\n const operatorOrder = ['=', '!=', ':', '!:', '>=', '<=', '<', '>'] as const;\n const operatorSet: { [key: string]: true } = { [defaultOperator ?? '=']: true };\n // TODO: remove unknown type annotation once extended operators are supported.\n operators?.forEach((op: unknown) => {\n if (typeof op === 'string') {\n operatorSet[op] = true;\n }\n });\n return operatorOrder.filter(op => operatorSet[op]);\n};\n\n/*\n * parses the value of the filtering input to figure out the current step of entering the token:\n * - \"property\": means that a filter on a particular column is being added, with operator already finalized\n * - \"operator\": means that a filter on a particular column is being added, with operator not yet finalized\n * - \"free-text\": means that a \"free text\" token is being added\n */\nexport const parseText = (\n filteringText: string,\n filteringProperties: PropertyFilterProps['filteringProperties'] = [],\n disableFreeTextFiltering: boolean\n): ParsedText => {\n const negatedGlobalQuery = /^(!:|!)(.*)/.exec(filteringText);\n if (!disableFreeTextFiltering && negatedGlobalQuery) {\n return {\n step: 'free-text',\n operator: '!:',\n value: negatedGlobalQuery[2],\n };\n }\n\n const property = matchFilteringProperty(filteringProperties, filteringText);\n if (!property) {\n return {\n step: 'free-text',\n value: filteringText,\n };\n }\n\n const allowedOps = getAllowedOperators(property);\n const textWithoutProperty = filteringText.substring(property.propertyLabel.length);\n const operator = matchOperator(allowedOps, trimStart(textWithoutProperty));\n if (operator) {\n const operatorLastIndex = textWithoutProperty.indexOf(operator) + operator.length;\n const textWithoutPropertyAndOperator = textWithoutProperty.slice(operatorLastIndex);\n return {\n step: 'property',\n property,\n operator,\n // We need to remove the first leading space in case the user presses space\n // after the operator, for example: Owner: admin, will result in value of ` admin`\n // and we need to remove the first space, if the user added any more spaces only the\n // first one will be removed.\n value: trimFirstSpace(textWithoutPropertyAndOperator),\n };\n }\n\n const operatorPrefix = matchOperatorPrefix(allowedOps, trimStart(textWithoutProperty));\n if (operatorPrefix !== null) {\n return { step: 'operator', property, operatorPrefix };\n }\n\n return {\n step: 'free-text',\n value: filteringText,\n };\n};\n\nexport const getPropertyOptions = (\n filteringProperty: PropertyFilterProps.FilteringProperty,\n filteringOptions: PropertyFilterProps['filteringOptions']\n) => {\n return filteringOptions?.filter(option => option.propertyKey === filteringProperty.key);\n};\n\ninterface OptionGroup<T> {\n label: string;\n options: T[];\n}\n\ninterface ExtendedAutosuggestOption extends AutosuggestProps.Option {\n tokenValue: string;\n}\n\nexport const getAllValueSuggestions = (\n filteringOptions: PropertyFilterProps['filteringOptions'],\n filteringProperties: PropertyFilterProps['filteringProperties'],\n operator: PropertyFilterProps.ComparisonOperator | undefined = '=',\n i18nStrings: Pick<PropertyFilterProps.I18nStrings, 'groupValuesText'>,\n customGroupsText: PropertyFilterProps['customGroupsText']\n) => {\n const defaultGroup: OptionGroup<ExtendedAutosuggestOption> = {\n label: i18nStrings.groupValuesText,\n options: [],\n };\n const customGroups: { [K in string]: OptionGroup<ExtendedAutosuggestOption> } = {};\n filteringOptions?.forEach(filteringOption => {\n const property = getPropertyByKey(filteringProperties, filteringOption.propertyKey);\n // given option refers to a non-existent filtering property\n if (!property) {\n return;\n }\n // this option's filtering property does not support current operator\n if (getAllowedOperators(property).indexOf(operator) === -1) {\n return;\n }\n if (property.group && !customGroups[property.group]) {\n const label =\n customGroupsText?.reduce<string>(\n (acc, customGroup) => (customGroup.group === property.group ? customGroup.values : acc),\n ''\n ) || '';\n customGroups[property.group] = {\n label,\n options: [],\n };\n }\n const propertyGroup = property.group ? customGroups[property.group] : defaultGroup;\n propertyGroup.options.push({\n tokenValue: property.propertyLabel + (operator || '=') + filteringOption.value,\n label: filteringOption.value,\n __labelPrefix: property.propertyLabel + ' ' + (operator || '='),\n });\n });\n return [defaultGroup, ...Object.keys(customGroups).map(group => customGroups[group])];\n};\n\nexport const getPropertyByKey = (filteringProperties: PropertyFilterProps['filteringProperties'], key: string) => {\n const propertyMap = filteringProperties.reduce<{ [K: string]: PropertyFilterProps.FilteringProperty }>(\n (acc, property) => {\n acc[property.key] = property;\n return acc;\n },\n {}\n );\n return propertyMap[key] as PropertyFilterProps.FilteringProperty | undefined;\n};\n\nconst filteringPropertyToAutosuggestOption = (filteringProperty: PropertyFilterProps.FilteringProperty) => ({\n value: filteringProperty.propertyLabel,\n keepOpenOnSelect: true,\n});\n\nexport function getPropertySuggestions<T>(\n filteringProperties: PropertyFilterProps['filteringProperties'],\n customGroupsText: PropertyFilterProps['customGroupsText'],\n i18nStrings: Pick<PropertyFilterProps['i18nStrings'], 'groupPropertiesText'>,\n filteringPropertyToOption: (filteringProperty: PropertyFilterProps.FilteringProperty) => T\n) {\n const defaultGroup: OptionGroup<T> = {\n label: i18nStrings.groupPropertiesText,\n options: [],\n };\n const customGroups: { [K in string]: OptionGroup<T> } = {};\n\n filteringProperties.forEach(filteringProperty => {\n const { group } = filteringProperty;\n let optionsGroup = defaultGroup;\n if (group) {\n if (!customGroups[group]) {\n const label =\n customGroupsText?.reduce<string>(\n (acc, customGroup) => (customGroup.group === group ? customGroup.properties : acc),\n ''\n ) || '';\n customGroups[group] = { options: [], label };\n }\n optionsGroup = customGroups[group];\n }\n optionsGroup.options.push(filteringPropertyToOption(filteringProperty));\n });\n const defaultGroupArray = defaultGroup.options.length ? [defaultGroup] : [];\n const customGroupsArray = Object.keys(customGroups).map(groupKey => customGroups[groupKey]);\n return [...defaultGroupArray, ...customGroupsArray];\n}\n\nexport type OperatorStrings =\n | 'operatorLessText'\n | 'operatorLessOrEqualText'\n | 'operatorGreaterText'\n | 'operatorGreaterOrEqualText'\n | 'operatorContainsText'\n | 'operatorDoesNotContainText'\n | 'operatorEqualsText'\n | 'operatorDoesNotEqualText';\nexport const getAutosuggestOptions = (\n parsedText: ParsedText,\n filteringOptions: PropertyFilterProps['filteringOptions'],\n filteringProperties: PropertyFilterProps['filteringProperties'],\n customGroupsText: PropertyFilterProps['customGroupsText'],\n i18nStrings: Pick<\n PropertyFilterProps['i18nStrings'],\n 'groupPropertiesText' | 'groupValuesText' | 'operatorsText' | OperatorStrings\n >\n) => {\n switch (parsedText.step) {\n case 'property': {\n const { propertyLabel, groupValuesLabel } = parsedText.property;\n const options = getPropertyOptions(parsedText.property, filteringOptions);\n return {\n filterText: parsedText.value,\n options: [\n {\n options: (options || []).map(({ value }) => ({\n tokenValue: propertyLabel + parsedText.operator + value,\n label: value,\n __labelPrefix: propertyLabel + ' ' + parsedText.operator,\n })),\n label: groupValuesLabel,\n },\n ],\n };\n }\n case 'operator': {\n return {\n filterText: parsedText.property.propertyLabel + ' ' + parsedText.operatorPrefix,\n options: [\n ...getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n filteringPropertyToAutosuggestOption\n ),\n {\n options: getAllowedOperators(parsedText.property).map(value => ({\n value: parsedText.property.propertyLabel + ' ' + value + ' ',\n label: parsedText.property.propertyLabel + ' ' + value,\n description: operatorToDescription(value, i18nStrings),\n keepOpenOnSelect: true,\n })),\n label: i18nStrings.operatorsText,\n },\n ],\n };\n }\n case 'free-text': {\n const needsValueSuggestions = !!parsedText.value;\n const needsPropertySuggestions = !(parsedText.step === 'free-text' && parsedText.operator === '!:');\n return {\n filterText: parsedText.value,\n options: [\n ...(needsPropertySuggestions\n ? getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n filteringPropertyToAutosuggestOption\n )\n : []),\n ...(needsValueSuggestions\n ? getAllValueSuggestions(\n filteringOptions,\n filteringProperties,\n parsedText.operator,\n i18nStrings,\n customGroupsText\n )\n : []),\n ],\n };\n }\n }\n};\n\nexport const operatorToDescription = (\n operator: PropertyFilterProps.ComparisonOperator,\n i18nStrings: Pick<PropertyFilterProps['i18nStrings'], OperatorStrings>\n) => {\n const mapping: { [K in PropertyFilterProps.ComparisonOperator]: string } = {\n ['<']: i18nStrings.operatorLessText,\n ['<=']: i18nStrings.operatorLessOrEqualText,\n ['>']: i18nStrings.operatorGreaterText,\n ['>=']: i18nStrings.operatorGreaterOrEqualText,\n [':']: i18nStrings.operatorContainsText,\n ['!:']: i18nStrings.operatorDoesNotContainText,\n ['=']: i18nStrings.operatorEqualsText,\n ['!=']: i18nStrings.operatorDoesNotEqualText,\n };\n return mapping[operator];\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/property-filter/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAYzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAQnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,QAAA,MAAM,cAAc,qGA+PnB,CAAC;AAGF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/property-filter/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAYzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AASnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,QAAA,MAAM,cAAc,qGAyPnB,CAAC;AAGF,eAAe,cAAc,CAAC"}
@@ -134,12 +134,7 @@ var PropertyFilter = React.forwardRef(function (_a, ref) {
134
134
  return (React.createElement("span", __assign({}, baseProps, { className: clsx(baseProps.className, styles.root), ref: __internalRootRef }),
135
135
  React.createElement("div", { className: styles['search-field'] },
136
136
  customControl && React.createElement("div", { className: styles['custom-control'] }, customControl),
137
- React.createElement(PropertyFilterAutosuggest, __assign({ ref: inputRef, virtualScroll: virtualScroll, enteredTextLabel: i18nStrings.enteredTextLabel, className: styles.input, ariaLabel: i18nStrings.filteringAriaLabel, placeholder: i18nStrings.filteringPlaceholder, value: filteringText, disabled: disabled, onKeyDown: handleKeyDown }, autosuggestOptions, { onChange: function (event) { return setFilteringText(event.detail.value); }, empty: filteringEmpty }, asyncAutosuggestProps, { expandToViewport: expandToViewport, onOptionClick: handleSelected, onOpen: function (e) {
138
- if (preventFocus.current) {
139
- e.preventDefault();
140
- preventFocus.current = false;
141
- }
142
- }, hideEnteredTextOption: disableFreeTextFiltering && parsedText.step !== 'property' })),
137
+ React.createElement(PropertyFilterAutosuggest, __assign({ ref: inputRef, virtualScroll: virtualScroll, enteredTextLabel: i18nStrings.enteredTextLabel, className: styles.input, ariaLabel: i18nStrings.filteringAriaLabel, placeholder: i18nStrings.filteringPlaceholder, value: filteringText, disabled: disabled, onKeyDown: handleKeyDown }, autosuggestOptions, { onChange: function (event) { return setFilteringText(event.detail.value); }, empty: filteringEmpty }, asyncAutosuggestProps, { expandToViewport: expandToViewport, onOptionClick: handleSelected, hideEnteredTextOption: disableFreeTextFiltering && parsedText.step !== 'property' })),
143
138
  React.createElement("span", { "aria-live": "polite", "aria-atomic": "true", className: clsx(styles.results, showResults && styles['results-visible']) }, showResults ? countText : '')),
144
139
  tokens && tokens.length > 0 && (React.createElement("div", { className: styles.tokens },
145
140
  React.createElement(InternalSpaceBetween, { size: "xs", direction: "horizontal", id: controlId },