intergalactic 15.122.0 → 15.124.0-prerelease.0
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/CHANGELOG.md +62 -0
- package/accordion/lib/cjs/Accordion.js +9 -9
- package/accordion/lib/es6/Accordion.js +9 -9
- package/accordion/package.json +1 -1
- package/add-filter/AddFilter.d.ts +3 -0
- package/add-filter/AddFilter.types.d.ts +62 -0
- package/add-filter/components/AddFilterDropdown.d.ts +4 -0
- package/add-filter/components/AddFilterInput.d.ts +4 -0
- package/add-filter/components/AddFilterSelect.d.ts +3 -0
- package/add-filter/index.d.ts +3 -0
- package/add-filter/index.js +8 -0
- package/add-filter/index.mjs +2 -0
- package/add-filter/lib/cjs/AddFilter.js +336 -0
- package/add-filter/lib/cjs/AddFilter.js.map +1 -0
- package/add-filter/lib/cjs/AddFilter.types.js +2 -0
- package/add-filter/lib/cjs/AddFilter.types.js.map +1 -0
- package/add-filter/lib/cjs/components/AddFilterDropdown.js +92 -0
- package/add-filter/lib/cjs/components/AddFilterDropdown.js.map +1 -0
- package/add-filter/lib/cjs/components/AddFilterInput.js +87 -0
- package/add-filter/lib/cjs/components/AddFilterInput.js.map +1 -0
- package/add-filter/lib/cjs/components/AddFilterSelect.js +103 -0
- package/add-filter/lib/cjs/components/AddFilterSelect.js.map +1 -0
- package/add-filter/lib/cjs/index.js +38 -0
- package/add-filter/lib/cjs/index.js.map +1 -0
- package/add-filter/lib/cjs/translations/__intergalactic-dynamic-locales.js +39 -0
- package/add-filter/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -0
- package/add-filter/lib/cjs/translations/de.json +4 -0
- package/add-filter/lib/cjs/translations/en.json +5 -0
- package/add-filter/lib/cjs/translations/es.json +4 -0
- package/add-filter/lib/cjs/translations/fr.json +4 -0
- package/add-filter/lib/cjs/translations/it.json +4 -0
- package/add-filter/lib/cjs/translations/ja.json +4 -0
- package/add-filter/lib/cjs/translations/ko.json +4 -0
- package/add-filter/lib/cjs/translations/nl.json +4 -0
- package/add-filter/lib/cjs/translations/pl.json +4 -0
- package/add-filter/lib/cjs/translations/pt.json +4 -0
- package/add-filter/lib/cjs/translations/sv.json +4 -0
- package/add-filter/lib/cjs/translations/tr.json +4 -0
- package/add-filter/lib/cjs/translations/vi.json +4 -0
- package/add-filter/lib/cjs/translations/zh.json +4 -0
- package/add-filter/lib/es6/AddFilter.js +328 -0
- package/add-filter/lib/es6/AddFilter.js.map +1 -0
- package/add-filter/lib/es6/AddFilter.types.js +2 -0
- package/add-filter/lib/es6/AddFilter.types.js.map +1 -0
- package/add-filter/lib/es6/components/AddFilterDropdown.js +84 -0
- package/add-filter/lib/es6/components/AddFilterDropdown.js.map +1 -0
- package/add-filter/lib/es6/components/AddFilterInput.js +80 -0
- package/add-filter/lib/es6/components/AddFilterInput.js.map +1 -0
- package/add-filter/lib/es6/components/AddFilterSelect.js +95 -0
- package/add-filter/lib/es6/components/AddFilterSelect.js.map +1 -0
- package/add-filter/lib/es6/index.js +4 -0
- package/add-filter/lib/es6/index.js.map +1 -0
- package/add-filter/lib/es6/translations/__intergalactic-dynamic-locales.js +31 -0
- package/add-filter/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -0
- package/add-filter/lib/es6/translations/de.json +4 -0
- package/add-filter/lib/es6/translations/en.json +5 -0
- package/add-filter/lib/es6/translations/es.json +4 -0
- package/add-filter/lib/es6/translations/fr.json +4 -0
- package/add-filter/lib/es6/translations/it.json +4 -0
- package/add-filter/lib/es6/translations/ja.json +4 -0
- package/add-filter/lib/es6/translations/ko.json +4 -0
- package/add-filter/lib/es6/translations/nl.json +4 -0
- package/add-filter/lib/es6/translations/pl.json +4 -0
- package/add-filter/lib/es6/translations/pt.json +4 -0
- package/add-filter/lib/es6/translations/sv.json +4 -0
- package/add-filter/lib/es6/translations/tr.json +4 -0
- package/add-filter/lib/es6/translations/vi.json +4 -0
- package/add-filter/lib/es6/translations/zh.json +4 -0
- package/add-filter/lib/types/AddFilter.d.ts +3 -0
- package/add-filter/lib/types/AddFilter.types.d.ts +62 -0
- package/add-filter/lib/types/components/AddFilterDropdown.d.ts +4 -0
- package/add-filter/lib/types/components/AddFilterInput.d.ts +4 -0
- package/add-filter/lib/types/components/AddFilterSelect.d.ts +3 -0
- package/add-filter/lib/types/index.d.ts +3 -0
- package/add-filter/lib/types/translations/__intergalactic-dynamic-locales.d.ts +59 -0
- package/add-filter/package.json +1 -0
- package/add-filter/translations/__intergalactic-dynamic-locales.d.ts +59 -0
- package/animation/lib/cjs/Animation.js +11 -11
- package/animation/lib/cjs/Collapse.js +28 -28
- package/animation/lib/cjs/FadeInOut.js +28 -28
- package/animation/lib/cjs/Scale.js +28 -28
- package/animation/lib/cjs/Slide.js +28 -28
- package/animation/lib/cjs/Transform.js +28 -28
- package/animation/lib/es6/Animation.js +11 -11
- package/animation/lib/es6/Collapse.js +28 -28
- package/animation/lib/es6/FadeInOut.js +28 -28
- package/animation/lib/es6/Scale.js +28 -28
- package/animation/lib/es6/Slide.js +28 -28
- package/animation/lib/es6/Transform.js +28 -28
- package/animation/package.json +1 -1
- package/badge/lib/cjs/Badge.js +6 -6
- package/badge/lib/es6/Badge.js +6 -6
- package/badge/package.json +1 -1
- package/base-trigger/lib/cjs/BaseTrigger.js +18 -18
- package/base-trigger/lib/cjs/ButtonTrigger.js +3 -3
- package/base-trigger/lib/cjs/FilterTrigger.js +7 -7
- package/base-trigger/lib/cjs/LinkTrigger.js +12 -12
- package/base-trigger/lib/es6/BaseTrigger.js +18 -18
- package/base-trigger/lib/es6/ButtonTrigger.js +3 -3
- package/base-trigger/lib/es6/FilterTrigger.js +7 -7
- package/base-trigger/lib/es6/LinkTrigger.js +12 -12
- package/base-trigger/package.json +1 -1
- package/breadcrumbs/lib/cjs/Breadcrumbs.js +8 -8
- package/breadcrumbs/lib/es6/Breadcrumbs.js +8 -8
- package/breadcrumbs/package.json +1 -1
- package/breakpoints/package.json +1 -1
- package/bulk-textarea/BulkTextarea.d.ts +3 -0
- package/bulk-textarea/BulkTextarea.types.d.ts +33 -0
- package/bulk-textarea/components/ClearAll.d.ts +7 -0
- package/bulk-textarea/components/Counter.d.ts +10 -0
- package/bulk-textarea/components/ErrorsNavigation.d.ts +15 -0
- package/bulk-textarea/components/InputField/InputField.d.ts +98 -0
- package/bulk-textarea/components/InputField/InputField.types.d.ts +157 -0
- package/bulk-textarea/index.d.ts +3 -0
- package/bulk-textarea/index.js +8 -0
- package/bulk-textarea/index.mjs +2 -0
- package/bulk-textarea/lib/cjs/BulkTextarea.js +318 -0
- package/bulk-textarea/lib/cjs/BulkTextarea.js.map +1 -0
- package/bulk-textarea/lib/cjs/BulkTextarea.types.js +2 -0
- package/bulk-textarea/lib/cjs/BulkTextarea.types.js.map +1 -0
- package/bulk-textarea/lib/cjs/components/ClearAll.js +23 -0
- package/bulk-textarea/lib/cjs/components/ClearAll.js.map +1 -0
- package/bulk-textarea/lib/cjs/components/Counter.js +27 -0
- package/bulk-textarea/lib/cjs/components/Counter.js.map +1 -0
- package/bulk-textarea/lib/cjs/components/ErrorsNavigation.js +57 -0
- package/bulk-textarea/lib/cjs/components/ErrorsNavigation.js.map +1 -0
- package/bulk-textarea/lib/cjs/components/InputField/InputField.js +1110 -0
- package/bulk-textarea/lib/cjs/components/InputField/InputField.js.map +1 -0
- package/bulk-textarea/lib/cjs/components/InputField/InputField.types.js +2 -0
- package/bulk-textarea/lib/cjs/components/InputField/InputField.types.js.map +1 -0
- package/bulk-textarea/lib/cjs/components/InputField/inputField.shadow.css +160 -0
- package/bulk-textarea/lib/cjs/index.js +14 -0
- package/bulk-textarea/lib/cjs/index.js.map +1 -0
- package/bulk-textarea/lib/cjs/translations/__intergalactic-dynamic-locales.js +39 -0
- package/bulk-textarea/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -0
- package/bulk-textarea/lib/cjs/translations/de.json +10 -0
- package/bulk-textarea/lib/cjs/translations/en.json +10 -0
- package/bulk-textarea/lib/cjs/translations/es.json +10 -0
- package/bulk-textarea/lib/cjs/translations/fr.json +10 -0
- package/bulk-textarea/lib/cjs/translations/it.json +10 -0
- package/bulk-textarea/lib/cjs/translations/ja.json +10 -0
- package/bulk-textarea/lib/cjs/translations/ko.json +10 -0
- package/bulk-textarea/lib/cjs/translations/nl.json +10 -0
- package/bulk-textarea/lib/cjs/translations/pl.json +10 -0
- package/bulk-textarea/lib/cjs/translations/pt.json +10 -0
- package/bulk-textarea/lib/cjs/translations/sv.json +10 -0
- package/bulk-textarea/lib/cjs/translations/tr.json +10 -0
- package/bulk-textarea/lib/cjs/translations/vi.json +10 -0
- package/bulk-textarea/lib/cjs/translations/zh.json +10 -0
- package/bulk-textarea/lib/es6/BulkTextarea.js +310 -0
- package/bulk-textarea/lib/es6/BulkTextarea.js.map +1 -0
- package/bulk-textarea/lib/es6/BulkTextarea.types.js +2 -0
- package/bulk-textarea/lib/es6/BulkTextarea.types.js.map +1 -0
- package/bulk-textarea/lib/es6/components/ClearAll.js +17 -0
- package/bulk-textarea/lib/es6/components/ClearAll.js.map +1 -0
- package/bulk-textarea/lib/es6/components/Counter.js +21 -0
- package/bulk-textarea/lib/es6/components/Counter.js.map +1 -0
- package/bulk-textarea/lib/es6/components/ErrorsNavigation.js +50 -0
- package/bulk-textarea/lib/es6/components/ErrorsNavigation.js.map +1 -0
- package/bulk-textarea/lib/es6/components/InputField/InputField.js +1104 -0
- package/bulk-textarea/lib/es6/components/InputField/InputField.js.map +1 -0
- package/bulk-textarea/lib/es6/components/InputField/InputField.types.js +2 -0
- package/bulk-textarea/lib/es6/components/InputField/InputField.types.js.map +1 -0
- package/bulk-textarea/lib/es6/components/InputField/inputField.shadow.css +160 -0
- package/bulk-textarea/lib/es6/index.js +2 -0
- package/bulk-textarea/lib/es6/index.js.map +1 -0
- package/bulk-textarea/lib/es6/translations/__intergalactic-dynamic-locales.js +31 -0
- package/bulk-textarea/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -0
- package/bulk-textarea/lib/es6/translations/de.json +10 -0
- package/bulk-textarea/lib/es6/translations/en.json +10 -0
- package/bulk-textarea/lib/es6/translations/es.json +10 -0
- package/bulk-textarea/lib/es6/translations/fr.json +10 -0
- package/bulk-textarea/lib/es6/translations/it.json +10 -0
- package/bulk-textarea/lib/es6/translations/ja.json +10 -0
- package/bulk-textarea/lib/es6/translations/ko.json +10 -0
- package/bulk-textarea/lib/es6/translations/nl.json +10 -0
- package/bulk-textarea/lib/es6/translations/pl.json +10 -0
- package/bulk-textarea/lib/es6/translations/pt.json +10 -0
- package/bulk-textarea/lib/es6/translations/sv.json +10 -0
- package/bulk-textarea/lib/es6/translations/tr.json +10 -0
- package/bulk-textarea/lib/es6/translations/vi.json +10 -0
- package/bulk-textarea/lib/es6/translations/zh.json +10 -0
- package/bulk-textarea/lib/types/BulkTextarea.d.ts +3 -0
- package/bulk-textarea/lib/types/BulkTextarea.types.d.ts +33 -0
- package/bulk-textarea/lib/types/components/ClearAll.d.ts +7 -0
- package/bulk-textarea/lib/types/components/Counter.d.ts +10 -0
- package/bulk-textarea/lib/types/components/ErrorsNavigation.d.ts +15 -0
- package/bulk-textarea/lib/types/components/InputField/InputField.d.ts +98 -0
- package/bulk-textarea/lib/types/components/InputField/InputField.types.d.ts +157 -0
- package/bulk-textarea/lib/types/index.d.ts +3 -0
- package/bulk-textarea/lib/types/translations/__intergalactic-dynamic-locales.d.ts +142 -0
- package/bulk-textarea/package.json +1 -0
- package/bulk-textarea/translations/__intergalactic-dynamic-locales.d.ts +142 -0
- package/button/lib/cjs/component/Button/Button.js +27 -27
- package/button/lib/cjs/component/Button/button.shadow.css +1 -1
- package/button/lib/cjs/component/ButtonLink/ButtonLink.js +20 -20
- package/button/lib/es6/component/Button/Button.js +27 -27
- package/button/lib/es6/component/Button/button.shadow.css +1 -1
- package/button/lib/es6/component/ButtonLink/ButtonLink.js +20 -20
- package/button/package.json +1 -1
- package/card/lib/cjs/Card.js +6 -6
- package/card/lib/es6/Card.js +6 -6
- package/card/package.json +1 -1
- package/carousel/lib/cjs/Carousel.js +21 -21
- package/carousel/lib/es6/Carousel.js +21 -21
- package/carousel/package.json +1 -1
- package/checkbox/lib/cjs/Checkbox.js +18 -18
- package/checkbox/lib/es6/Checkbox.js +18 -18
- package/checkbox/package.json +1 -1
- package/color-picker/lib/cjs/ColorPicker.js +24 -24
- package/color-picker/lib/cjs/PaletteManager.js +24 -24
- package/color-picker/lib/cjs/components/InputColor.js +24 -24
- package/color-picker/lib/es6/ColorPicker.js +24 -24
- package/color-picker/lib/es6/PaletteManager.js +24 -24
- package/color-picker/lib/es6/components/InputColor.js +24 -24
- package/color-picker/package.json +1 -1
- package/components.json +75 -73
- package/core/package.json +1 -1
- package/counter/lib/cjs/Counter.js +11 -11
- package/counter/lib/cjs/style/counter.shadow.css +1 -0
- package/counter/lib/es6/Counter.js +11 -11
- package/counter/lib/es6/style/counter.shadow.css +1 -0
- package/counter/package.json +1 -1
- package/d3-chart/lib/cjs/Area.js +11 -11
- package/d3-chart/lib/cjs/Axis.js +14 -14
- package/d3-chart/lib/cjs/Bar.js +16 -16
- package/d3-chart/lib/cjs/Bubble.js +12 -12
- package/d3-chart/lib/cjs/CompactHorizontalBar.js +16 -16
- package/d3-chart/lib/cjs/Donut.js +9 -9
- package/d3-chart/lib/cjs/Dots.js +8 -8
- package/d3-chart/lib/cjs/HorizontalBar.js +16 -16
- package/d3-chart/lib/cjs/Hover.js +3 -3
- package/d3-chart/lib/cjs/Line.js +9 -9
- package/d3-chart/lib/cjs/Plot.js +3 -3
- package/d3-chart/lib/cjs/Radar.js +19 -19
- package/d3-chart/lib/cjs/RadialTree.js +12 -12
- package/d3-chart/lib/cjs/Reference.js +12 -12
- package/d3-chart/lib/cjs/ScatterPlot.js +9 -9
- package/d3-chart/lib/cjs/Tooltip.js +9 -9
- package/d3-chart/lib/cjs/Venn.js +9 -9
- package/d3-chart/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/d3-chart/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/d3-chart/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/d3-chart/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/d3-chart/lib/es6/Area.js +11 -11
- package/d3-chart/lib/es6/Axis.js +14 -14
- package/d3-chart/lib/es6/Bar.js +16 -16
- package/d3-chart/lib/es6/Bubble.js +12 -12
- package/d3-chart/lib/es6/CompactHorizontalBar.js +16 -16
- package/d3-chart/lib/es6/Donut.js +9 -9
- package/d3-chart/lib/es6/Dots.js +8 -8
- package/d3-chart/lib/es6/HorizontalBar.js +16 -16
- package/d3-chart/lib/es6/Hover.js +3 -3
- package/d3-chart/lib/es6/Line.js +9 -9
- package/d3-chart/lib/es6/Plot.js +3 -3
- package/d3-chart/lib/es6/Radar.js +19 -19
- package/d3-chart/lib/es6/RadialTree.js +12 -12
- package/d3-chart/lib/es6/Reference.js +12 -12
- package/d3-chart/lib/es6/ScatterPlot.js +9 -9
- package/d3-chart/lib/es6/Tooltip.js +9 -9
- package/d3-chart/lib/es6/Venn.js +9 -9
- package/d3-chart/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/d3-chart/lib/es6/a11y/PlotA11yView.js +2 -2
- package/d3-chart/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/d3-chart/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/d3-chart/package.json +1 -1
- package/data-table/lib/cjs/Body.js +4 -4
- package/data-table/lib/cjs/Body.js.map +1 -1
- package/data-table/lib/cjs/DataTable.js +36 -36
- package/data-table/lib/es6/Body.js +4 -4
- package/data-table/lib/es6/Body.js.map +1 -1
- package/data-table/lib/es6/DataTable.js +36 -36
- package/data-table/package.json +1 -1
- package/date-picker/lib/cjs/components/Calendar.js +21 -21
- package/date-picker/lib/cjs/components/DateRangeComparatorAbstract.js +29 -29
- package/date-picker/lib/cjs/components/InputTrigger.js +31 -30
- package/date-picker/lib/cjs/components/InputTrigger.js.map +1 -1
- package/date-picker/lib/cjs/components/PickerAbstract.js +29 -29
- package/date-picker/lib/cjs/components/RangePickerAbstract.js +29 -29
- package/date-picker/lib/es6/components/Calendar.js +21 -21
- package/date-picker/lib/es6/components/DateRangeComparatorAbstract.js +29 -29
- package/date-picker/lib/es6/components/InputTrigger.js +31 -30
- package/date-picker/lib/es6/components/InputTrigger.js.map +1 -1
- package/date-picker/lib/es6/components/PickerAbstract.js +29 -29
- package/date-picker/lib/es6/components/RangePickerAbstract.js +29 -29
- package/date-picker/package.json +1 -1
- package/divider/lib/cjs/Divider.js +10 -10
- package/divider/lib/es6/Divider.js +10 -10
- package/divider/package.json +1 -1
- package/dot/lib/cjs/Dot.js +10 -10
- package/dot/lib/es6/Dot.js +10 -10
- package/dot/package.json +1 -1
- package/drag-and-drop/lib/cjs/DragAndDrop.js +17 -17
- package/drag-and-drop/lib/es6/DragAndDrop.js +17 -17
- package/drag-and-drop/package.json +1 -1
- package/dropdown/lib/cjs/Dropdown.js +16 -16
- package/dropdown/lib/es6/Dropdown.js +16 -16
- package/dropdown/package.json +1 -1
- package/dropdown-menu/lib/cjs/DropdownMenu.js +18 -18
- package/dropdown-menu/lib/es6/DropdownMenu.js +18 -18
- package/dropdown-menu/package.json +1 -1
- package/ellipsis/lib/cjs/Ellipsis.js +10 -10
- package/ellipsis/lib/es6/Ellipsis.js +10 -10
- package/ellipsis/package.json +1 -1
- package/errors/lib/cjs/Error.js +9 -9
- package/errors/lib/es6/Error.js +9 -9
- package/errors/package.json +1 -1
- package/feature-popover/lib/cjs/FeaturePopover.js +11 -11
- package/feature-popover/lib/es6/FeaturePopover.js +11 -11
- package/feature-popover/package.json +1 -1
- package/feedback-form/component/feedback-rating/FeedbackRating.type.d.ts +3 -1
- package/feedback-form/lib/cjs/FeedbackForm.js +7 -7
- package/feedback-form/lib/cjs/component/checkbox-button/CheckboxButton.js +3 -3
- package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.js +14 -9
- package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/feedback-form/lib/cjs/component/feedback-rating/FeedbackRating.type.js.map +1 -1
- package/feedback-form/lib/cjs/component/slider-rating/SliderRating.js +7 -7
- package/feedback-form/lib/es6/FeedbackForm.js +7 -7
- package/feedback-form/lib/es6/component/checkbox-button/CheckboxButton.js +3 -3
- package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.js +14 -9
- package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/feedback-form/lib/es6/component/feedback-rating/FeedbackRating.type.js.map +1 -1
- package/feedback-form/lib/es6/component/slider-rating/SliderRating.js +7 -7
- package/feedback-form/lib/types/component/feedback-rating/FeedbackRating.type.d.ts +3 -1
- package/feedback-form/package.json +1 -1
- package/flags/lib/cjs/Flags.js +3 -3
- package/flags/lib/es6/Flags.js +3 -3
- package/flags/lib/sprites/sprite@1x.css +256 -256
- package/flags/lib/sprites/sprite@2x.css +257 -257
- package/flags/package.json +1 -1
- package/flex-box/lib/cjs/Box/useBox.js +3 -3
- package/flex-box/lib/cjs/Flex/useFlex.js +3 -3
- package/flex-box/lib/cjs/invalid-state-box/InvalidStateBox.js +2 -2
- package/flex-box/lib/cjs/screen-reader-only-box/ScreenReaderOnlyBox.js +2 -2
- package/flex-box/lib/es6/Box/useBox.js +3 -3
- package/flex-box/lib/es6/Flex/useFlex.js +3 -3
- package/flex-box/lib/es6/invalid-state-box/InvalidStateBox.js +2 -2
- package/flex-box/lib/es6/screen-reader-only-box/ScreenReaderOnlyBox.js +2 -2
- package/flex-box/package.json +1 -1
- package/format-text/lib/cjs/FormatText.js +5 -5
- package/format-text/lib/es6/FormatText.js +5 -5
- package/format-text/package.json +1 -1
- package/fullscreen-modal/lib/cjs/FullscreenModal.js +13 -13
- package/fullscreen-modal/lib/es6/FullscreenModal.js +13 -13
- package/fullscreen-modal/package.json +1 -1
- package/grid/lib/cjs/Grid.js +114 -114
- package/grid/lib/es6/Grid.js +114 -114
- package/grid/package.json +1 -1
- package/i18n-unplugin/package.json +1 -1
- package/icon/color/Confluence/l/index.js +4 -4
- package/icon/color/Confluence/l/index.mjs +4 -4
- package/icon/color/Confluence/m/index.js +4 -4
- package/icon/color/Confluence/m/index.mjs +4 -4
- package/icon/color/Copilot/l/index.d.ts +6 -0
- package/icon/color/Copilot/l/index.js +79 -0
- package/icon/color/Copilot/l/index.mjs +67 -0
- package/icon/color/Copilot/m/index.d.ts +6 -0
- package/icon/color/Copilot/m/index.js +79 -0
- package/icon/color/Copilot/m/index.mjs +67 -0
- package/icon/color/MetaColored/l/index.js +4 -4
- package/icon/color/MetaColored/l/index.mjs +4 -4
- package/icon/color/MetaColored/m/index.js +4 -4
- package/icon/color/MetaColored/m/index.mjs +4 -4
- package/icon/color/MicrosoftOffice/l/index.js +10 -10
- package/icon/color/MicrosoftOffice/l/index.mjs +10 -10
- package/icon/color/MicrosoftOffice/m/index.js +10 -10
- package/icon/color/MicrosoftOffice/m/index.mjs +10 -10
- package/icon/lib/cjs/Icon.js +5 -5
- package/icon/lib/es6/Icon.js +5 -5
- package/icon/package.json +1 -1
- package/icon/pay/Discover/l/index.js +1 -1
- package/icon/pay/Discover/l/index.mjs +1 -1
- package/icon/pay/Discover/m/index.js +1 -1
- package/icon/pay/Discover/m/index.mjs +1 -1
- package/icon/pay/JCB/l/index.js +10 -10
- package/icon/pay/JCB/l/index.mjs +10 -10
- package/icon/pay/JCB/m/index.js +10 -10
- package/icon/pay/JCB/m/index.mjs +10 -10
- package/icon/pay/Visa/l/index.js +2 -2
- package/icon/pay/Visa/l/index.mjs +2 -2
- package/icon/pay/Visa/m/index.js +2 -2
- package/icon/pay/Visa/m/index.mjs +2 -2
- package/illustration/lib/cjs/index.js +1 -1
- package/illustration/lib/es6/index.js +1 -1
- package/illustration/package.json +1 -1
- package/inline-edit/lib/cjs/InlineEdit.js +4 -4
- package/inline-edit/lib/es6/InlineEdit.js +4 -4
- package/inline-edit/package.json +1 -1
- package/inline-input/lib/cjs/InlineInput.js +14 -14
- package/inline-input/lib/es6/InlineInput.js +14 -14
- package/inline-input/package.json +1 -1
- package/input/lib/cjs/Input.js +17 -17
- package/input/lib/es6/Input.js +17 -17
- package/input/package.json +1 -1
- package/input-mask/InputMask.d.ts +1 -1
- package/input-mask/lib/cjs/InputMask.js +6 -6
- package/input-mask/lib/cjs/InputMask.js.map +1 -1
- package/input-mask/lib/es6/InputMask.js +6 -6
- package/input-mask/lib/es6/InputMask.js.map +1 -1
- package/input-mask/lib/types/InputMask.d.ts +1 -1
- package/input-mask/package.json +1 -1
- package/input-number/lib/cjs/InputNumber.js +10 -10
- package/input-number/lib/cjs/InputNumber.js.map +1 -1
- package/input-number/lib/es6/InputNumber.js +10 -10
- package/input-number/lib/es6/InputNumber.js.map +1 -1
- package/input-number/package.json +1 -1
- package/input-tags/lib/cjs/InputTags.js +12 -12
- package/input-tags/lib/es6/InputTags.js +12 -12
- package/input-tags/package.json +1 -1
- package/link/lib/cjs/Link.js +12 -12
- package/link/lib/es6/Link.js +12 -12
- package/link/package.json +1 -1
- package/mini-chart/lib/cjs/component/score/Donut.js +9 -9
- package/mini-chart/lib/cjs/component/score/Line.js +18 -18
- package/mini-chart/lib/cjs/component/trend/Bar.js +7 -7
- package/mini-chart/lib/cjs/component/trend/Line.js +7 -7
- package/mini-chart/lib/es6/component/score/Donut.js +9 -9
- package/mini-chart/lib/es6/component/score/Line.js +18 -18
- package/mini-chart/lib/es6/component/trend/Bar.js +7 -7
- package/mini-chart/lib/es6/component/trend/Line.js +7 -7
- package/mini-chart/package.json +1 -1
- package/modal/lib/cjs/Modal.js +8 -8
- package/modal/lib/es6/Modal.js +8 -8
- package/modal/package.json +1 -1
- package/neighbor-location/package.json +1 -1
- package/notice/lib/cjs/Notice.js +16 -16
- package/notice/lib/es6/Notice.js +16 -16
- package/notice/package.json +1 -1
- package/notice-bubble/lib/cjs/NoticeBubble.js +15 -15
- package/notice-bubble/lib/es6/NoticeBubble.js +15 -15
- package/notice-bubble/package.json +1 -1
- package/notice-global/lib/cjs/NoticeGlobal.js +11 -11
- package/notice-global/lib/es6/NoticeGlobal.js +11 -11
- package/notice-global/package.json +1 -1
- package/outside-click/package.json +1 -1
- package/package.json +3 -1
- package/pagination/lib/cjs/Pagination.js +10 -10
- package/pagination/lib/es6/Pagination.js +10 -10
- package/pagination/package.json +1 -1
- package/pills/lib/cjs/Pills.js +13 -13
- package/pills/lib/es6/Pills.js +13 -13
- package/pills/package.json +1 -1
- package/popper/index.d.ts +3 -1
- package/popper/lib/cjs/Popper.js +16 -6
- package/popper/lib/cjs/Popper.js.map +1 -1
- package/popper/lib/cjs/createPopper.js +3 -1
- package/popper/lib/cjs/createPopper.js.map +1 -1
- package/popper/lib/cjs/index.d.js.map +1 -1
- package/popper/lib/cjs/modifiers/applyMaxSize.js +34 -0
- package/popper/lib/cjs/modifiers/applyMaxSize.js.map +1 -0
- package/popper/lib/cjs/style/popper.shadow.css +1 -1
- package/popper/lib/es6/Popper.js +16 -6
- package/popper/lib/es6/Popper.js.map +1 -1
- package/popper/lib/es6/createPopper.js +3 -1
- package/popper/lib/es6/createPopper.js.map +1 -1
- package/popper/lib/es6/index.d.js.map +1 -1
- package/popper/lib/es6/modifiers/applyMaxSize.js +26 -0
- package/popper/lib/es6/modifiers/applyMaxSize.js.map +1 -0
- package/popper/lib/es6/style/popper.shadow.css +1 -1
- package/popper/lib/types/index.d.ts +3 -1
- package/popper/package.json +1 -1
- package/portal/package.json +1 -1
- package/product-head/lib/cjs/Info.js +4 -4
- package/product-head/lib/cjs/ProductHead.js +5 -5
- package/product-head/lib/cjs/Title.js +4 -4
- package/product-head/lib/es6/Info.js +4 -4
- package/product-head/lib/es6/ProductHead.js +5 -5
- package/product-head/lib/es6/Title.js +4 -4
- package/product-head/package.json +1 -1
- package/progress-bar/lib/cjs/ProgressBar.js +15 -15
- package/progress-bar/lib/es6/ProgressBar.js +15 -15
- package/progress-bar/package.json +1 -1
- package/radio/lib/cjs/Radio.js +16 -16
- package/radio/lib/es6/Radio.js +16 -16
- package/radio/package.json +1 -1
- package/scroll-area/lib/cjs/ScrollArea.js +21 -21
- package/scroll-area/lib/cjs/ScrollBar.js +6 -6
- package/scroll-area/lib/es6/ScrollArea.js +21 -21
- package/scroll-area/lib/es6/ScrollBar.js +6 -6
- package/scroll-area/package.json +1 -1
- package/select/lib/cjs/InputSearch.js +6 -6
- package/select/lib/cjs/Select.js +8 -8
- package/select/lib/es6/InputSearch.js +6 -6
- package/select/lib/es6/Select.js +8 -8
- package/select/package.json +1 -1
- package/side-panel/lib/cjs/SidePanel.js +16 -16
- package/side-panel/lib/es6/SidePanel.js +16 -16
- package/side-panel/package.json +1 -1
- package/skeleton/lib/cjs/Charts/Area.js +9 -9
- package/skeleton/lib/cjs/Charts/Bar.js +9 -9
- package/skeleton/lib/cjs/Charts/Bubble.js +9 -9
- package/skeleton/lib/cjs/Charts/CompactHorizontalBar.js +9 -9
- package/skeleton/lib/cjs/Charts/Donut.js +9 -9
- package/skeleton/lib/cjs/Charts/Histogram.js +9 -9
- package/skeleton/lib/cjs/Charts/Line.js +9 -9
- package/skeleton/lib/cjs/Charts/RadialTree.js +9 -9
- package/skeleton/lib/cjs/Charts/ScatterPlot.js +9 -9
- package/skeleton/lib/cjs/Charts/Venn.js +9 -9
- package/skeleton/lib/cjs/Skeleton.js +8 -8
- package/skeleton/lib/es6/Charts/Area.js +9 -9
- package/skeleton/lib/es6/Charts/Bar.js +9 -9
- package/skeleton/lib/es6/Charts/Bubble.js +9 -9
- package/skeleton/lib/es6/Charts/CompactHorizontalBar.js +9 -9
- package/skeleton/lib/es6/Charts/Donut.js +9 -9
- package/skeleton/lib/es6/Charts/Histogram.js +9 -9
- package/skeleton/lib/es6/Charts/Line.js +9 -9
- package/skeleton/lib/es6/Charts/RadialTree.js +9 -9
- package/skeleton/lib/es6/Charts/ScatterPlot.js +9 -9
- package/skeleton/lib/es6/Charts/Venn.js +9 -9
- package/skeleton/lib/es6/Skeleton.js +8 -8
- package/skeleton/package.json +1 -1
- package/slider/lib/cjs/Slider.js +8 -8
- package/slider/lib/es6/Slider.js +8 -8
- package/slider/package.json +1 -1
- package/spin/lib/cjs/Spin.js +13 -13
- package/spin/lib/es6/Spin.js +13 -13
- package/spin/package.json +1 -1
- package/spin-container/lib/cjs/SpinContainer.js +42 -12
- package/spin-container/lib/cjs/SpinContainer.js.map +1 -1
- package/spin-container/lib/es6/SpinContainer.js +42 -12
- package/spin-container/lib/es6/SpinContainer.js.map +1 -1
- package/spin-container/package.json +1 -1
- package/sticky/lib/cjs/Sticky.js +2 -2
- package/sticky/lib/es6/Sticky.js +2 -2
- package/sticky/package.json +1 -1
- package/switch/lib/cjs/Switch.js +21 -21
- package/switch/lib/es6/Switch.js +21 -21
- package/switch/package.json +1 -1
- package/tab-line/lib/cjs/TabLine.js +13 -13
- package/tab-line/lib/es6/TabLine.js +13 -13
- package/tab-line/package.json +1 -1
- package/tab-panel/lib/cjs/TabPanel.js +8 -8
- package/tab-panel/lib/es6/TabPanel.js +8 -8
- package/tab-panel/package.json +1 -1
- package/tag/lib/cjs/Tag.js +23 -23
- package/tag/lib/es6/Tag.js +23 -23
- package/tag/package.json +1 -1
- package/textarea/lib/cjs/Textarea.js +8 -8
- package/textarea/lib/es6/Textarea.js +8 -8
- package/textarea/package.json +1 -1
- package/time-picker/lib/cjs/PickerInput.js +1 -0
- package/time-picker/lib/cjs/PickerInput.js.map +1 -1
- package/time-picker/lib/cjs/TimePicker.js +12 -12
- package/time-picker/lib/es6/PickerInput.js +1 -0
- package/time-picker/lib/es6/PickerInput.js.map +1 -1
- package/time-picker/lib/es6/TimePicker.js +12 -12
- package/time-picker/package.json +1 -1
- package/tooltip/lib/cjs/Tooltip.js +9 -9
- package/tooltip/lib/es6/Tooltip.js +9 -9
- package/tooltip/package.json +1 -1
- package/typography/lib/cjs/Blockquote.js +4 -4
- package/typography/lib/cjs/Hint.js +7 -7
- package/typography/lib/cjs/List.js +5 -5
- package/typography/lib/cjs/Text.js +34 -34
- package/typography/lib/es6/Blockquote.js +4 -4
- package/typography/lib/es6/Hint.js +7 -7
- package/typography/lib/es6/List.js +5 -5
- package/typography/lib/es6/Text.js +34 -34
- package/typography/package.json +1 -1
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.js +2 -2
- package/utils/lib/components/invalid-state-pattern/InvalidStatePattern.mjs +2 -2
- package/utils/lib/enhances/WithI18n.js +15 -5
- package/utils/lib/enhances/WithI18n.js.map +1 -1
- package/utils/lib/enhances/WithI18n.mjs +16 -6
- package/utils/lib/enhances/WithI18n.mjs.map +1 -1
- package/utils/lib/enhances/i18nEnhance.d.ts +0 -1
- package/utils/lib/enhances/i18nEnhance.js +1 -33
- package/utils/lib/enhances/i18nEnhance.js.map +1 -1
- package/utils/lib/enhances/i18nEnhance.mjs +0 -30
- package/utils/lib/enhances/i18nEnhance.mjs.map +1 -1
- package/utils/lib/injectStyle.js +1 -1
- package/utils/lib/injectStyle.mjs +1 -1
- package/utils/lib/inputProps.js +1 -1
- package/utils/lib/inputProps.js.map +1 -1
- package/utils/lib/inputProps.mjs +1 -1
- package/utils/lib/inputProps.mjs.map +1 -1
- package/widget-empty/lib/cjs/WidgetEmpty.js +5 -5
- package/widget-empty/lib/es6/WidgetEmpty.js +5 -5
- package/widget-empty/package.json +1 -1
- package/wizard/lib/cjs/Wizard.js +12 -12
- package/wizard/lib/es6/Wizard.js +12 -12
- package/wizard/package.json +1 -1
@@ -0,0 +1,328 @@
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
4
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
6
|
+
import _createSuper from "@babel/runtime/helpers/createSuper";
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
8
|
+
import { assignProps as _assignProps } from 'intergalactic/core';
|
9
|
+
import React from 'react';
|
10
|
+
import { Flex, ScreenReaderOnly } from 'intergalactic/flex-box';
|
11
|
+
import Button from 'intergalactic/button';
|
12
|
+
import createComponent, { Component, Root } from 'intergalactic/core';
|
13
|
+
import DropdownMenu from 'intergalactic/dropdown-menu';
|
14
|
+
import MathPlusM from 'intergalactic/icon/MathPlus/m';
|
15
|
+
import CloseM from 'intergalactic/icon/Close/m';
|
16
|
+
import AddFilterSelect from './components/AddFilterSelect';
|
17
|
+
import AddFilterInput from './components/AddFilterInput';
|
18
|
+
import AddFilterDropdown from './components/AddFilterDropdown';
|
19
|
+
import { extractFrom } from 'intergalactic/utils/lib/findComponent';
|
20
|
+
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
21
|
+
import i18nEnhance from 'intergalactic/utils/lib/enhances/i18nEnhance';
|
22
|
+
import focusSourceEnhance from 'intergalactic/utils/lib/enhances/focusSourceEnhance';
|
23
|
+
var RootAddFilter = /*#__PURE__*/function (_Component) {
|
24
|
+
_inherits(RootAddFilter, _Component);
|
25
|
+
var _super = _createSuper(RootAddFilter);
|
26
|
+
function RootAddFilter(props) {
|
27
|
+
var _this;
|
28
|
+
_classCallCheck(this, RootAddFilter);
|
29
|
+
_this = _super.call(this, props);
|
30
|
+
_defineProperty(_assertThisInitialized(_this), "addFilterTrigger", /*#__PURE__*/React.createRef());
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "filtersFocusMap", new Map());
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "clearMessageTimer", void 0);
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "addDropdownItems", void 0);
|
34
|
+
_this.state = {
|
35
|
+
visibleFilters: new Set(),
|
36
|
+
clearFiltersMessage: ''
|
37
|
+
};
|
38
|
+
_this.addDropdownItems = RootAddFilter.getDefaultAddDropdownOptions(props.children);
|
39
|
+
return _this;
|
40
|
+
}
|
41
|
+
_createClass(RootAddFilter, [{
|
42
|
+
key: "componentWillUnmount",
|
43
|
+
value: function componentWillUnmount() {
|
44
|
+
clearTimeout(this.clearMessageTimer);
|
45
|
+
}
|
46
|
+
}, {
|
47
|
+
key: "focusFilterAfterItemCleared",
|
48
|
+
value: function focusFilterAfterItemCleared(name) {
|
49
|
+
var _this2 = this;
|
50
|
+
var focusSourceRef = this.asProps.focusSourceRef;
|
51
|
+
if (focusSourceRef.current !== 'keyboard') {
|
52
|
+
return;
|
53
|
+
}
|
54
|
+
var deletedIndex = Array.from(this.state.visibleFilters).findIndex(function (n) {
|
55
|
+
return n === name;
|
56
|
+
});
|
57
|
+
setTimeout(function () {
|
58
|
+
var _this2$filtersFocusMa;
|
59
|
+
var currentVisibleFiltersList = Array.from(_this2.state.visibleFilters);
|
60
|
+
var focusFilterName = currentVisibleFiltersList.at(deletedIndex);
|
61
|
+
var itemToFocus = (_this2$filtersFocusMa = _this2.filtersFocusMap.get(focusFilterName)) !== null && _this2$filtersFocusMa !== void 0 ? _this2$filtersFocusMa : _this2.addFilterTrigger.current;
|
62
|
+
itemToFocus === null || itemToFocus === void 0 ? void 0 : itemToFocus.focus();
|
63
|
+
}, 20);
|
64
|
+
}
|
65
|
+
}, {
|
66
|
+
key: "getVisibleFilters",
|
67
|
+
value: function getVisibleFilters(allFilters) {
|
68
|
+
return Array.from(this.state.visibleFilters).map(function (name) {
|
69
|
+
return allFilters.find(function (_ref2) {
|
70
|
+
var props = _ref2.props;
|
71
|
+
return props.name === name;
|
72
|
+
});
|
73
|
+
});
|
74
|
+
}
|
75
|
+
}, {
|
76
|
+
key: "getItemCommonProps",
|
77
|
+
value: function getItemCommonProps(props) {
|
78
|
+
var _this3 = this;
|
79
|
+
var name = props.name;
|
80
|
+
var filterData = this.asProps.filterData;
|
81
|
+
return {
|
82
|
+
name: name,
|
83
|
+
value: filterData[name],
|
84
|
+
setFocusRef: function setFocusRef(ref) {
|
85
|
+
_this3.filtersFocusMap.set(name, ref);
|
86
|
+
},
|
87
|
+
onClear: function onClear() {
|
88
|
+
_this3.hideFilter(name);
|
89
|
+
_this3.focusFilterAfterItemCleared(name);
|
90
|
+
}
|
91
|
+
};
|
92
|
+
}
|
93
|
+
}, {
|
94
|
+
key: "getInputProps",
|
95
|
+
value: function getInputProps(props) {
|
96
|
+
return this.getItemCommonProps(props);
|
97
|
+
}
|
98
|
+
}, {
|
99
|
+
key: "getDropdownAndSelectProps",
|
100
|
+
value: function getDropdownAndSelectProps(props, isEmpty) {
|
101
|
+
var _this4 = this;
|
102
|
+
var _this$getItemCommonPr = this.getItemCommonProps(props),
|
103
|
+
setFocusRef = _this$getItemCommonPr.setFocusRef,
|
104
|
+
value = _this$getItemCommonPr.value,
|
105
|
+
onClear = _this$getItemCommonPr.onClear;
|
106
|
+
return {
|
107
|
+
value: value,
|
108
|
+
onClear: onClear,
|
109
|
+
setFocusRef: setFocusRef,
|
110
|
+
onVisibleChange: function onVisibleChange(visible) {
|
111
|
+
// waiting for filterData update
|
112
|
+
setTimeout(function () {
|
113
|
+
var _this4$getItemCommonP = _this4.getItemCommonProps(props),
|
114
|
+
onClear = _this4$getItemCommonP.onClear;
|
115
|
+
if (!visible && isEmpty()) {
|
116
|
+
onClear();
|
117
|
+
}
|
118
|
+
}, 0);
|
119
|
+
}
|
120
|
+
};
|
121
|
+
}
|
122
|
+
}, {
|
123
|
+
key: "getSelectProps",
|
124
|
+
value: function getSelectProps(props) {
|
125
|
+
var _this5 = this;
|
126
|
+
var isEmpty = function isEmpty() {
|
127
|
+
var multiselect = props.multiselect;
|
128
|
+
var _this5$getItemCommonP = _this5.getItemCommonProps(props),
|
129
|
+
value = _this5$getItemCommonP.value;
|
130
|
+
return multiselect && Array.isArray(value) ? !(value !== null && value !== void 0 && value.length) : !value;
|
131
|
+
};
|
132
|
+
return this.getDropdownAndSelectProps(props, isEmpty);
|
133
|
+
}
|
134
|
+
}, {
|
135
|
+
key: "getDropdownProps",
|
136
|
+
value: function getDropdownProps(props) {
|
137
|
+
var _this6 = this;
|
138
|
+
var isEmpty = function isEmpty() {
|
139
|
+
var _this6$getItemCommonP = _this6.getItemCommonProps(props),
|
140
|
+
value = _this6$getItemCommonP.value;
|
141
|
+
return value == null;
|
142
|
+
};
|
143
|
+
return this.getDropdownAndSelectProps(props, isEmpty);
|
144
|
+
}
|
145
|
+
}, {
|
146
|
+
key: "clearAll",
|
147
|
+
value: function clearAll() {
|
148
|
+
var _this7 = this;
|
149
|
+
this.setState({
|
150
|
+
visibleFilters: new Set()
|
151
|
+
});
|
152
|
+
this.props.onClearAll();
|
153
|
+
this.announceClearMessageToSR();
|
154
|
+
|
155
|
+
// waiting for AddFilter button appear in the DOM
|
156
|
+
setTimeout(function () {
|
157
|
+
var _this7$addFilterTrigg;
|
158
|
+
(_this7$addFilterTrigg = _this7.addFilterTrigger.current) === null || _this7$addFilterTrigg === void 0 ? void 0 : _this7$addFilterTrigg.focus();
|
159
|
+
}, 20);
|
160
|
+
}
|
161
|
+
}, {
|
162
|
+
key: "announceClearMessageToSR",
|
163
|
+
value: function announceClearMessageToSR() {
|
164
|
+
var _this8 = this;
|
165
|
+
var getI18nText = this.asProps.getI18nText;
|
166
|
+
var clearFiltersMessage = getI18nText('AddFilter.ScreenReaderMessage.FiltersCleared');
|
167
|
+
this.setState({
|
168
|
+
clearFiltersMessage: clearFiltersMessage
|
169
|
+
});
|
170
|
+
this.clearMessageTimer = setTimeout(function () {
|
171
|
+
_this8.setState({
|
172
|
+
clearFiltersMessage: ''
|
173
|
+
});
|
174
|
+
}, 300);
|
175
|
+
}
|
176
|
+
}, {
|
177
|
+
key: "toggleFieldVisibility",
|
178
|
+
value: function toggleFieldVisibility(name, status) {
|
179
|
+
var visibleFilters = new Set(Array.from(this.state.visibleFilters));
|
180
|
+
if (status) {
|
181
|
+
visibleFilters.add(name);
|
182
|
+
} else {
|
183
|
+
visibleFilters["delete"](name);
|
184
|
+
}
|
185
|
+
this.setState({
|
186
|
+
visibleFilters: visibleFilters
|
187
|
+
});
|
188
|
+
}
|
189
|
+
}, {
|
190
|
+
key: "hideFilter",
|
191
|
+
value: function hideFilter(name) {
|
192
|
+
this.toggleFieldVisibility(name, false);
|
193
|
+
}
|
194
|
+
}, {
|
195
|
+
key: "getFilterSelectionMenuProps",
|
196
|
+
value: function getFilterSelectionMenuProps() {
|
197
|
+
var _this9 = this;
|
198
|
+
var getI18nText = this.asProps.getI18nText;
|
199
|
+
return {
|
200
|
+
ref: this.addFilterTrigger,
|
201
|
+
options: this.addDropdownItems,
|
202
|
+
toggleFieldVisibility: function toggleFieldVisibility(name, status) {
|
203
|
+
return _this9.toggleFieldVisibility(name, status);
|
204
|
+
},
|
205
|
+
visibleFilters: this.state.visibleFilters,
|
206
|
+
getI18nText: getI18nText
|
207
|
+
};
|
208
|
+
}
|
209
|
+
}, {
|
210
|
+
key: "getClearAllFiltersProps",
|
211
|
+
value: function getClearAllFiltersProps() {
|
212
|
+
var _this10 = this;
|
213
|
+
var _this$asProps = this.asProps,
|
214
|
+
getI18nText = _this$asProps.getI18nText,
|
215
|
+
filterData = _this$asProps.filterData;
|
216
|
+
return {
|
217
|
+
hasFilterData: Object.values(filterData).filter(function (value) {
|
218
|
+
return Array.isArray(value) ? value === null || value === void 0 ? void 0 : value.length : value;
|
219
|
+
}).length > 0,
|
220
|
+
clearAll: function clearAll() {
|
221
|
+
_this10.clearAll();
|
222
|
+
},
|
223
|
+
getI18nText: getI18nText
|
224
|
+
};
|
225
|
+
}
|
226
|
+
}, {
|
227
|
+
key: "render",
|
228
|
+
value: function render() {
|
229
|
+
var _ref = this.asProps;
|
230
|
+
var Children = this.asProps.Children;
|
231
|
+
var _RootAddFilter$getFil = RootAddFilter.getFilterPatternItems(Children),
|
232
|
+
_RootAddFilter$getFil2 = _slicedToArray(_RootAddFilter$getFil, 2),
|
233
|
+
filters = _RootAddFilter$getFil2[0],
|
234
|
+
persistentFilters = _RootAddFilter$getFil2[1];
|
235
|
+
var VisibleFilteredChildren = this.getVisibleFilters(filters);
|
236
|
+
var filtersSelectionDropdown = this.getFilterSelectionMenuProps();
|
237
|
+
var clearAllFiltersProps = this.getClearAllFiltersProps();
|
238
|
+
return /*#__PURE__*/React.createElement(Flex, _assignProps({
|
239
|
+
"gap": 2,
|
240
|
+
"flexWrap": true
|
241
|
+
}, _ref), persistentFilters, VisibleFilteredChildren, /*#__PURE__*/React.createElement(AddFilterDropdownMenu, filtersSelectionDropdown), /*#__PURE__*/React.createElement(ClearAllFilters, clearAllFiltersProps), /*#__PURE__*/React.createElement(ScreenReaderOnly, {
|
242
|
+
"aria-live": "polite",
|
243
|
+
role: "status"
|
244
|
+
}, this.state.clearFiltersMessage));
|
245
|
+
}
|
246
|
+
}]);
|
247
|
+
return RootAddFilter;
|
248
|
+
}(Component);
|
249
|
+
_defineProperty(RootAddFilter, "displayName", 'AddFilter');
|
250
|
+
_defineProperty(RootAddFilter, "enhance", [i18nEnhance(localizedMessages), focusSourceEnhance()]);
|
251
|
+
_defineProperty(RootAddFilter, "defaultProps", {
|
252
|
+
i18n: localizedMessages,
|
253
|
+
locale: 'en'
|
254
|
+
});
|
255
|
+
_defineProperty(RootAddFilter, "componentsNames", ['AddFilter.Input', 'AddFilter.Select', 'AddFilter.Dropdown']);
|
256
|
+
_defineProperty(RootAddFilter, "getFilterPatternItems", function (children) {
|
257
|
+
return extractFrom(children, RootAddFilter.componentsNames);
|
258
|
+
});
|
259
|
+
_defineProperty(RootAddFilter, "getDefaultAddDropdownOptions", function (children) {
|
260
|
+
var _RootAddFilter$getFil3 = RootAddFilter.getFilterPatternItems(children),
|
261
|
+
_RootAddFilter$getFil4 = _slicedToArray(_RootAddFilter$getFil3, 1),
|
262
|
+
filters = _RootAddFilter$getFil4[0];
|
263
|
+
return filters.map(function (_ref5) {
|
264
|
+
var props = _ref5.props;
|
265
|
+
var name = props.name,
|
266
|
+
displayName = props.displayName;
|
267
|
+
return {
|
268
|
+
label: displayName !== null && displayName !== void 0 ? displayName : name,
|
269
|
+
value: name
|
270
|
+
};
|
271
|
+
});
|
272
|
+
});
|
273
|
+
var AddFilterDropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
274
|
+
var options = props.options,
|
275
|
+
toggleFieldVisibility = props.toggleFieldVisibility,
|
276
|
+
visibleFilters = props.visibleFilters,
|
277
|
+
getI18nText = props.getI18nText;
|
278
|
+
var _React$useState = React.useState(false),
|
279
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
280
|
+
visible = _React$useState2[0],
|
281
|
+
setVisible = _React$useState2[1];
|
282
|
+
var optionsWithoutVisible = React.useMemo(function () {
|
283
|
+
return options.filter(function (filter) {
|
284
|
+
return !Array.from(visibleFilters).includes(filter.value);
|
285
|
+
});
|
286
|
+
}, [options, visibleFilters]);
|
287
|
+
if (!optionsWithoutVisible.length) {
|
288
|
+
return null;
|
289
|
+
}
|
290
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
291
|
+
visible: visible,
|
292
|
+
onVisibleChange: setVisible
|
293
|
+
}, /*#__PURE__*/React.createElement(DropdownMenu.Trigger, {
|
294
|
+
ref: ref,
|
295
|
+
tag: Button,
|
296
|
+
use: "tertiary",
|
297
|
+
addonLeft: MathPlusM
|
298
|
+
}, getI18nText('AddFilter.DropdownTrigger.Text')), /*#__PURE__*/React.createElement(DropdownMenu.Menu, null, optionsWithoutVisible.map(function (_ref3) {
|
299
|
+
var label = _ref3.label,
|
300
|
+
value = _ref3.value;
|
301
|
+
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
302
|
+
key: value,
|
303
|
+
onClick: function onClick() {
|
304
|
+
toggleFieldVisibility(value, true);
|
305
|
+
setVisible(false);
|
306
|
+
}
|
307
|
+
}, label);
|
308
|
+
})));
|
309
|
+
});
|
310
|
+
function ClearAllFilters(_ref4) {
|
311
|
+
var hasFilterData = _ref4.hasFilterData,
|
312
|
+
clearAll = _ref4.clearAll,
|
313
|
+
getI18nText = _ref4.getI18nText;
|
314
|
+
return hasFilterData ? /*#__PURE__*/React.createElement(Button, {
|
315
|
+
use: "tertiary",
|
316
|
+
theme: "muted",
|
317
|
+
addonLeft: CloseM,
|
318
|
+
ml: "auto",
|
319
|
+
onClick: clearAll
|
320
|
+
}, getI18nText('AddFilter.Button.Text')) : null;
|
321
|
+
}
|
322
|
+
var AddFilter = createComponent(RootAddFilter, {
|
323
|
+
Select: AddFilterSelect,
|
324
|
+
Input: AddFilterInput,
|
325
|
+
Dropdown: AddFilterDropdown
|
326
|
+
});
|
327
|
+
export default AddFilter;
|
328
|
+
//# sourceMappingURL=AddFilter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AddFilter.js","names":["React","Flex","ScreenReaderOnly","Button","createComponent","Component","Root","DropdownMenu","MathPlusM","CloseM","AddFilterSelect","AddFilterInput","AddFilterDropdown","extractFrom","localizedMessages","i18nEnhance","focusSourceEnhance","RootAddFilter","_Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","_defineProperty","_assertThisInitialized","createRef","Map","state","visibleFilters","Set","clearFiltersMessage","addDropdownItems","getDefaultAddDropdownOptions","children","_createClass","key","value","componentWillUnmount","clearTimeout","clearMessageTimer","focusFilterAfterItemCleared","name","_this2","focusSourceRef","asProps","current","deletedIndex","Array","from","findIndex","n","setTimeout","_this2$filtersFocusMa","currentVisibleFiltersList","focusFilterName","at","itemToFocus","filtersFocusMap","get","addFilterTrigger","focus","getVisibleFilters","allFilters","map","find","_ref2","getItemCommonProps","_this3","filterData","setFocusRef","ref","set","onClear","hideFilter","getInputProps","getDropdownAndSelectProps","isEmpty","_this4","_this$getItemCommonPr","onVisibleChange","visible","_this4$getItemCommonP","getSelectProps","_this5","multiselect","_this5$getItemCommonP","isArray","length","getDropdownProps","_this6","_this6$getItemCommonP","clearAll","_this7","setState","onClearAll","announceClearMessageToSR","_this7$addFilterTrigg","_this8","getI18nText","toggleFieldVisibility","status","add","getFilterSelectionMenuProps","_this9","options","getClearAllFiltersProps","_this10","_this$asProps","hasFilterData","Object","values","filter","render","_ref","Children","_RootAddFilter$getFil","getFilterPatternItems","_RootAddFilter$getFil2","_slicedToArray","filters","persistentFilters","VisibleFilteredChildren","filtersSelectionDropdown","clearAllFiltersProps","createElement","_assignProps","AddFilterDropdownMenu","ClearAllFilters","role","i18n","locale","componentsNames","_RootAddFilter$getFil3","_RootAddFilter$getFil4","_ref5","displayName","label","forwardRef","_React$useState","useState","_React$useState2","setVisible","optionsWithoutVisible","useMemo","includes","Trigger","tag","use","addonLeft","Menu","_ref3","Item","onClick","_ref4","theme","ml","AddFilter","Select","Input","Dropdown"],"sources":["../../src/AddFilter.tsx"],"sourcesContent":["import React from 'react';\nimport { Flex, ScreenReaderOnly } from '@semcore/flex-box';\nimport Button from '@semcore/button';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport DropdownMenu from '@semcore/dropdown-menu';\nimport MathPlusM from '@semcore/icon/MathPlus/m';\nimport CloseM from '@semcore/icon/Close/m';\nimport AddFilterType, { AddFilterProps, AddFilterItemProps } from './AddFilter.types';\nimport AddFilterSelect from './components/AddFilterSelect';\nimport AddFilterInput from './components/AddFilterInput';\nimport AddFilterDropdown from './components/AddFilterDropdown';\nimport { extractFrom } from '@semcore/utils/lib/findComponent';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';\nimport { SelectProps } from '@semcore/select';\nimport focusSourceEnhance from '@semcore/utils/lib/enhances/focusSourceEnhance';\n\ntype SelectItemProps = SelectProps & AddFilterItemProps;\n\ntype AddFilterDropdownOption = { label: string; value: string };\ntype AddFilterDropdownMenuProps = {\n options: AddFilterDropdownOption[];\n toggleFieldVisibility: (name: string, status: boolean) => void;\n visibleFilters: Set<string>;\n getI18nText: (key: string) => string;\n};\n\ntype ClearAllFiltersButtonProps = {\n hasFilterData: boolean;\n clearAll: () => void;\n getI18nText: (key: string) => string;\n};\n\ntype AddFilterState = {\n visibleFilters: Set<string>;\n clearFiltersMessage: string;\n};\n\nclass RootAddFilter extends Component<\n AddFilterProps,\n {},\n AddFilterState,\n typeof RootAddFilter.enhance\n> {\n addFilterTrigger = React.createRef<HTMLButtonElement>();\n filtersFocusMap: Map<string | undefined, HTMLElement> = new Map();\n clearMessageTimer: ReturnType<typeof setTimeout> | undefined;\n addDropdownItems: AddFilterDropdownOption[];\n\n static displayName = 'AddFilter';\n static enhance = [i18nEnhance(localizedMessages), focusSourceEnhance()] as const;\n static defaultProps = {\n i18n: localizedMessages,\n locale: 'en',\n };\n\n static componentsNames = ['AddFilter.Input', 'AddFilter.Select', 'AddFilter.Dropdown'];\n static getFilterPatternItems = (children: React.ReactNode) => {\n return extractFrom(children, RootAddFilter.componentsNames);\n };\n\n static getDefaultAddDropdownOptions = (children: React.ReactNode) => {\n const [filters] = RootAddFilter.getFilterPatternItems(children);\n\n return filters.map(({ props }: { props: AddFilterItemProps }) => {\n const { name, displayName } = props;\n return { label: displayName ?? name, value: name };\n });\n };\n\n constructor(props: AddFilterProps) {\n super(props);\n\n this.state = {\n visibleFilters: new Set(),\n clearFiltersMessage: '',\n };\n\n this.addDropdownItems = RootAddFilter.getDefaultAddDropdownOptions(props.children);\n }\n\n componentWillUnmount() {\n clearTimeout(this.clearMessageTimer);\n }\n\n focusFilterAfterItemCleared(name?: string) {\n const { focusSourceRef } = this.asProps;\n\n if (focusSourceRef.current !== 'keyboard') {\n return;\n }\n\n const deletedIndex = Array.from(this.state.visibleFilters).findIndex((n) => n === name);\n setTimeout(() => {\n const currentVisibleFiltersList = Array.from(this.state.visibleFilters);\n const focusFilterName = currentVisibleFiltersList.at(deletedIndex);\n\n const itemToFocus =\n this.filtersFocusMap.get(focusFilterName) ?? this.addFilterTrigger.current;\n itemToFocus?.focus();\n }, 20);\n }\n\n getVisibleFilters(allFilters: React.ReactElement<AddFilterItemProps>[]) {\n return Array.from(this.state.visibleFilters).map((name) => {\n return allFilters.find(({ props }) => props.name === name);\n });\n }\n\n getItemCommonProps(props: AddFilterItemProps) {\n const { name } = props;\n const { filterData } = this.asProps;\n\n return {\n name,\n value: filterData[name],\n setFocusRef: (ref: HTMLElement) => {\n this.filtersFocusMap.set(name, ref);\n },\n onClear: () => {\n this.hideFilter(name);\n this.focusFilterAfterItemCleared(name);\n },\n };\n }\n\n getInputProps(props: AddFilterItemProps) {\n return this.getItemCommonProps(props);\n }\n\n getDropdownAndSelectProps(props: AddFilterItemProps, isEmpty: () => boolean) {\n const { setFocusRef, value, onClear } = this.getItemCommonProps(props);\n return {\n value,\n onClear,\n setFocusRef,\n onVisibleChange: (visible: boolean) => {\n // waiting for filterData update\n setTimeout(() => {\n const { onClear } = this.getItemCommonProps(props);\n\n if (!visible && isEmpty()) {\n onClear();\n }\n }, 0);\n },\n };\n }\n\n getSelectProps(props: SelectItemProps) {\n const isEmpty = () => {\n const { multiselect } = props;\n const { value } = this.getItemCommonProps(props);\n return multiselect && Array.isArray(value) ? !value?.length : !value;\n };\n\n return this.getDropdownAndSelectProps(props, isEmpty);\n }\n\n getDropdownProps(props: AddFilterItemProps) {\n const isEmpty = () => {\n const { value } = this.getItemCommonProps(props);\n return value == null;\n };\n return this.getDropdownAndSelectProps(props, isEmpty);\n }\n\n clearAll() {\n this.setState({\n visibleFilters: new Set(),\n });\n this.props.onClearAll();\n this.announceClearMessageToSR();\n\n // waiting for AddFilter button appear in the DOM\n setTimeout(() => {\n this.addFilterTrigger.current?.focus();\n }, 20);\n }\n\n announceClearMessageToSR() {\n const { getI18nText } = this.asProps;\n const clearFiltersMessage = getI18nText('AddFilter.ScreenReaderMessage.FiltersCleared');\n this.setState({ clearFiltersMessage });\n\n this.clearMessageTimer = setTimeout(() => {\n this.setState({ clearFiltersMessage: '' });\n }, 300);\n }\n\n toggleFieldVisibility(name: string, status: boolean) {\n const visibleFilters = new Set(Array.from(this.state.visibleFilters));\n if (status) {\n visibleFilters.add(name);\n } else {\n visibleFilters.delete(name);\n }\n\n this.setState({ visibleFilters });\n }\n\n hideFilter(name: string) {\n this.toggleFieldVisibility(name, false);\n }\n\n getFilterSelectionMenuProps() {\n const { getI18nText } = this.asProps;\n\n return {\n ref: this.addFilterTrigger,\n options: this.addDropdownItems,\n toggleFieldVisibility: (name: string, status: boolean) =>\n this.toggleFieldVisibility(name, status),\n visibleFilters: this.state.visibleFilters,\n getI18nText,\n };\n }\n\n getClearAllFiltersProps() {\n const { getI18nText, filterData } = this.asProps;\n\n return {\n hasFilterData:\n Object.values(filterData).filter((value) => (Array.isArray(value) ? value?.length : value))\n .length > 0,\n clearAll: () => {\n this.clearAll();\n },\n getI18nText,\n };\n }\n\n render() {\n const { Children } = this.asProps;\n const [filters, persistentFilters] = RootAddFilter.getFilterPatternItems(Children);\n const VisibleFilteredChildren = this.getVisibleFilters(filters);\n\n const filtersSelectionDropdown = this.getFilterSelectionMenuProps();\n const clearAllFiltersProps = this.getClearAllFiltersProps();\n return (\n <Root render={Flex} gap={2} flexWrap>\n {persistentFilters}\n {VisibleFilteredChildren}\n <AddFilterDropdownMenu {...filtersSelectionDropdown} />\n <ClearAllFilters {...clearAllFiltersProps} />\n\n <ScreenReaderOnly aria-live='polite' role='status'>\n {this.state.clearFiltersMessage}\n </ScreenReaderOnly>\n </Root>\n );\n }\n}\n\nconst AddFilterDropdownMenu = React.forwardRef<HTMLButtonElement, AddFilterDropdownMenuProps>(\n function (props, ref) {\n const { options, toggleFieldVisibility, visibleFilters, getI18nText } = props;\n const [visible, setVisible] = React.useState(false);\n\n const optionsWithoutVisible = React.useMemo(() => {\n return options.filter((filter) => {\n return !Array.from(visibleFilters).includes(filter.value);\n });\n }, [options, visibleFilters]);\n\n if (!optionsWithoutVisible.length) {\n return null;\n }\n\n return (\n <DropdownMenu visible={visible} onVisibleChange={setVisible}>\n <DropdownMenu.Trigger ref={ref} tag={Button} use='tertiary' addonLeft={MathPlusM}>\n {getI18nText('AddFilter.DropdownTrigger.Text')}\n </DropdownMenu.Trigger>\n <DropdownMenu.Menu>\n {optionsWithoutVisible.map(({ label, value }) => (\n <DropdownMenu.Item\n key={value}\n onClick={() => {\n toggleFieldVisibility(value, true);\n setVisible(false);\n }}\n >\n {label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Menu>\n </DropdownMenu>\n );\n },\n);\n\nfunction ClearAllFilters({ hasFilterData, clearAll, getI18nText }: ClearAllFiltersButtonProps) {\n return hasFilterData ? (\n <Button use='tertiary' theme='muted' addonLeft={CloseM} ml='auto' onClick={clearAll}>\n {getI18nText('AddFilter.Button.Text')}\n </Button>\n ) : null;\n}\n\nconst AddFilter: typeof AddFilterType = createComponent(RootAddFilter, {\n Select: AddFilterSelect,\n Input: AddFilterInput,\n Dropdown: AddFilterDropdown,\n});\n\nexport default AddFilter;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,gBAAgB,QAAQ,mBAAmB;AAC1D,OAAOC,MAAM,MAAM,iBAAiB;AACpC,OAAOC,eAAe,IAAIC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAChE,OAAOC,YAAY,MAAM,wBAAwB;AACjD,OAAOC,SAAS,MAAM,0BAA0B;AAChD,OAAOC,MAAM,MAAM,uBAAuB;AAE1C,OAAOC,eAAe,MAAM,8BAA8B;AAC1D,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,SAASC,WAAW,QAAQ,kCAAkC;AAC9D,SAASC,iBAAiB,QAAQ,gDAAgD;AAClF,OAAOC,WAAW,MAAM,yCAAyC;AAEjE,OAAOC,kBAAkB,MAAM,gDAAgD;AAAC,IAuB1EC,aAAa,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,aAAA;EAgCjB,SAAAA,cAAYK,KAAqB,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,aAAA;IACjCM,KAAA,G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AAA,IAAGd,KAAK,GAAAc,KAAA,CAALd,KAAK;MAAEpG,KAAK,GAAAkH,KAAA,CAALlH,KAAK;IAAA,oBACxCvC,KAAA,CAAA+H,aAAA,CAACxH,YAAY,CAACmJ,IAAI;MAChBpH,GAAG,EAAEC,KAAM;MACXoH,OAAO,EAAE,SAAAA,QAAA,EAAM;QACbrD,qBAAqB,CAAC/D,KAAK,EAAE,IAAI,CAAC;QAClCyG,UAAU,CAAC,KAAK,CAAC;MACnB;IAAE,GAEDL,KAAK,CACY;EAAA,CACrB,CAAC,CACgB,CACP;AAEnB,CAAC,CACF;AAED,SAAST,eAAeA,CAAA0B,KAAA,EAAuE;EAAA,IAApE7C,aAAa,GAAA6C,KAAA,CAAb7C,aAAa;IAAEjB,QAAQ,GAAA8D,KAAA,CAAR9D,QAAQ;IAAEO,WAAW,GAAAuD,KAAA,CAAXvD,WAAW;EAC7D,OAAOU,aAAa,gBAClB/G,KAAA,CAAA+H,aAAA,CAAC5H,MAAM;IAACmJ,GAAG,EAAC,UAAU;IAACO,KAAK,EAAC,OAAO;IAACN,SAAS,EAAE9I,MAAO;IAACqJ,EAAE,EAAC,MAAM;IAACH,OAAO,EAAE7D;EAAS,GACjFO,WAAW,CAAC,uBAAuB,CAAC,CAC9B,GACP,IAAI;AACV;AAEA,IAAM0D,SAA+B,GAAG3J,eAAe,CAACa,aAAa,EAAE;EACrE+I,MAAM,EAAEtJ,eAAe;EACvBuJ,KAAK,EAAEtJ,cAAc;EACrBuJ,QAAQ,EAAEtJ;AACZ,CAAC,CAAC;AAEF,eAAemJ,SAAS"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AddFilter.types.js","names":[],"sources":["../../src/AddFilter.types.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/utils/lib/core';\nimport { FlexProps } from '@semcore/flex-box';\nimport Select from '@semcore/select';\nimport Input from '@semcore/input';\nimport Dropdown, { DropdownTriggerProps } from '@semcore/dropdown';\nimport { FilterTrigger } from '@semcore/base-trigger';\nimport { ButtonLink } from '@semcore/button';\n\nexport type AddFilterItemProps = {\n /**\n * Non-persistent filter item unique `name`. Should be the same as related `key` in `FilterData` item related to Filter Control.\n */\n name: string;\n /**\n * Optional `displayName` to be displayed inside `Add filter` dropdown menu. If not specified, `name` will be used instead.\n */\n displayName?: string;\n /**\n * Action to perform on filter item unmount.\n */\n onUnmount?: () => void;\n};\n\ndeclare const AddFilterSelectType: Intergalactic.Component<typeof Select, AddFilterItemProps> & {\n Trigger: typeof FilterTrigger;\n Popper: Intergalactic.Component<typeof Select.Popper, {}, { onApply: () => void }>;\n Option: typeof Select.Option;\n Menu: typeof Select.Menu;\n List: typeof Select.List;\n InputSearch: typeof Select.InputSearch;\n};\n\ndeclare const AddFilterInputType: Intergalactic.Component<typeof Input, AddFilterItemProps> & {\n Addon: typeof Input.Addon;\n Value: typeof Input.Value;\n Clear: typeof ButtonLink;\n};\n\ndeclare const AddFilterDropdownType: Intergalactic.Component<\n typeof Dropdown,\n AddFilterItemProps\n> & {\n Trigger: Intergalactic.Component<\n typeof Dropdown.Trigger,\n DropdownTriggerProps & { onClear: () => void }\n >;\n Popper: Intergalactic.Component<typeof Dropdown.Popper, {}, { onApply: () => void }>;\n};\n\nexport type FilterData = Record<string, any>;\nexport type AddFilterProps = FlexProps & {\n /**\n * Action to perform on `Clear filters` button click.\n */\n onClearAll: () => void;\n /**\n * `FilterData` object.\n */\n filterData: FilterData;\n};\n\ndeclare const AddFilterType: Intergalactic.Component<'div', AddFilterProps> & {\n Dropdown: typeof AddFilterDropdownType;\n Input: typeof AddFilterInputType;\n Select: typeof AddFilterSelectType;\n};\n\nexport { AddFilterInputType, AddFilterSelectType, AddFilterDropdownType };\nexport default AddFilterType;\n"],"mappings":""}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
3
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
4
|
+
import _createSuper from "@babel/runtime/helpers/createSuper";
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
6
|
+
import { assignProps as _assignProps } from 'intergalactic/core';
|
7
|
+
import React from 'react';
|
8
|
+
import createComponent, { Component, Root } from 'intergalactic/core';
|
9
|
+
import Dropdown from 'intergalactic/dropdown';
|
10
|
+
import { FilterTrigger } from 'intergalactic/base-trigger';
|
11
|
+
var AddFilterDropdownRoot = /*#__PURE__*/function (_Component) {
|
12
|
+
_inherits(AddFilterDropdownRoot, _Component);
|
13
|
+
var _super = _createSuper(AddFilterDropdownRoot);
|
14
|
+
function AddFilterDropdownRoot() {
|
15
|
+
_classCallCheck(this, AddFilterDropdownRoot);
|
16
|
+
return _super.apply(this, arguments);
|
17
|
+
}
|
18
|
+
_createClass(AddFilterDropdownRoot, [{
|
19
|
+
key: "uncontrolledProps",
|
20
|
+
value: function uncontrolledProps() {
|
21
|
+
return {
|
22
|
+
visible: [null]
|
23
|
+
};
|
24
|
+
}
|
25
|
+
}, {
|
26
|
+
key: "componentWillUnmount",
|
27
|
+
value: function componentWillUnmount() {
|
28
|
+
var _this$asProps$onUnmou, _this$asProps;
|
29
|
+
(_this$asProps$onUnmou = (_this$asProps = this.asProps).onUnmount) === null || _this$asProps$onUnmou === void 0 ? void 0 : _this$asProps$onUnmou.call(_this$asProps);
|
30
|
+
}
|
31
|
+
}, {
|
32
|
+
key: "getTriggerProps",
|
33
|
+
value: function getTriggerProps() {
|
34
|
+
var _ref2 = this.asProps,
|
35
|
+
value = _ref2.value,
|
36
|
+
onClear = _ref2.onClear,
|
37
|
+
setFocusRef = _ref2.setFocusRef;
|
38
|
+
return {
|
39
|
+
tag: FilterTrigger,
|
40
|
+
triggerRef: setFocusRef,
|
41
|
+
empty: value == null,
|
42
|
+
onClear: onClear,
|
43
|
+
autoFocus: true
|
44
|
+
};
|
45
|
+
}
|
46
|
+
}, {
|
47
|
+
key: "getPopperProps",
|
48
|
+
value: function getPopperProps() {
|
49
|
+
var _this = this;
|
50
|
+
var _ref3 = this.asProps,
|
51
|
+
value = _ref3.value,
|
52
|
+
onClear = _ref3.onClear;
|
53
|
+
return {
|
54
|
+
onKeyDown: function onKeyDown(e) {
|
55
|
+
if (!value && e.key === 'Escape') {
|
56
|
+
onClear();
|
57
|
+
}
|
58
|
+
},
|
59
|
+
onApply: function onApply() {
|
60
|
+
_this.handlers.visible(false);
|
61
|
+
}
|
62
|
+
};
|
63
|
+
}
|
64
|
+
}, {
|
65
|
+
key: "render",
|
66
|
+
value: function render() {
|
67
|
+
var _ref = this.asProps;
|
68
|
+
return /*#__PURE__*/React.createElement(Dropdown, _assignProps({}, _ref));
|
69
|
+
}
|
70
|
+
}]);
|
71
|
+
return AddFilterDropdownRoot;
|
72
|
+
}(Component);
|
73
|
+
_defineProperty(AddFilterDropdownRoot, "displayName", 'AddFilterDropdown');
|
74
|
+
_defineProperty(AddFilterDropdownRoot, "defaultProps", function () {
|
75
|
+
return {
|
76
|
+
defaultVisible: true
|
77
|
+
};
|
78
|
+
});
|
79
|
+
var AddFilterDropdown = createComponent(AddFilterDropdownRoot, {
|
80
|
+
Trigger: Dropdown.Trigger,
|
81
|
+
Popper: Dropdown.Popper
|
82
|
+
});
|
83
|
+
export default AddFilterDropdown;
|
84
|
+
//# sourceMappingURL=AddFilterDropdown.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AddFilterDropdown.js","names":["React","createComponent","Component","Root","Dropdown","FilterTrigger","AddFilterDropdownRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","uncontrolledProps","visible","componentWillUnmount","_this$asProps$onUnmou","_this$asProps","asProps","onUnmount","call","getTriggerProps","_ref2","onClear","setFocusRef","tag","triggerRef","empty","autoFocus","getPopperProps","_this","_ref3","onKeyDown","e","onApply","handlers","render","_ref","createElement","_assignProps","_defineProperty","defaultVisible","AddFilterDropdown","Trigger","Popper"],"sources":["../../../src/components/AddFilterDropdown.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport Dropdown from '@semcore/dropdown';\nimport { AddFilterItemProps } from '../AddFilter.types';\nimport { FilterTrigger } from '@semcore/base-trigger';\n\ntype AsPropsTypeWithHandlers<T> = T & {\n onClear: () => void;\n unsetFocusRef: () => void;\n setFocusRef: (el: HTMLElement) => {};\n};\n\nclass AddFilterDropdownRoot extends Component<AddFilterItemProps> {\n static displayName = 'AddFilterDropdown';\n\n static defaultProps = () => {\n return {\n defaultVisible: true,\n };\n };\n\n uncontrolledProps() {\n return {\n visible: [null],\n };\n }\n\n componentWillUnmount() {\n this.asProps.onUnmount?.();\n }\n\n getTriggerProps() {\n const { value, onClear, setFocusRef } = this.asProps as AsPropsTypeWithHandlers<\n typeof this.asProps\n >;\n\n return {\n tag: FilterTrigger,\n triggerRef: setFocusRef,\n empty: value == null,\n onClear,\n autoFocus: true,\n };\n }\n\n getPopperProps() {\n const { value, onClear } = this.asProps as AsPropsTypeWithHandlers<typeof this.asProps>;\n\n return {\n onKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (!value && e.key === 'Escape') {\n onClear();\n }\n },\n onApply: () => {\n this.handlers.visible(false);\n },\n };\n }\n\n render() {\n return <Root render={Dropdown} />;\n }\n}\n\nconst AddFilterDropdown = createComponent(AddFilterDropdownRoot, {\n Trigger: Dropdown.Trigger,\n Popper: Dropdown.Popper,\n});\n\nexport default AddFilterDropdown;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAChE,OAAOC,QAAQ,MAAM,mBAAmB;AAExC,SAASC,aAAa,QAAQ,uBAAuB;AAAC,IAQhDC,qBAAqB,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,qBAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,qBAAA;EAAA,SAAAA,sBAA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,QAAA,EAAM;UACbJ,KAAI,CAACK,QAAQ,CAACrB,OAAO,CAAC,KAAK,CAAC;QAC9B;MACF,CAAC;IACH;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAwB,OAAA,EAAS;MAAA,IAAAC,IAAA,QAAAnB,OAAA;MACP,oBAAOtB,KAAA,CAAA0C,aAAA,CAActC,QAAQ,EAAAuC,YAAA,KAAAF,IAAA,EAAI;IACnC;EAAC;EAAA,OAAAnC,qBAAA;AAAA,EAlDiCJ,SAAS;AAAA0C,eAAA,CAAvCtC,qBAAqB,iBACJ,mBAAmB;AAAAsC,eAAA,CADpCtC,qBAAqB,kBAGH,YAAM;EAC1B,OAAO;IACLuC,cAAc,EAAE;EAClB,CAAC;AACH,CAAC;AA8CH,IAAMC,iBAAiB,GAAG7C,eAAe,CAACK,qBAAqB,EAAE;EAC/DyC,OAAO,EAAE3C,QAAQ,CAAC2C,OAAO;EACzBC,MAAM,EAAE5C,QAAQ,CAAC4C;AACnB,CAAC,CAAC;AAEF,eAAeF,iBAAiB"}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
2
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
3
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
5
|
+
import _createSuper from "@babel/runtime/helpers/createSuper";
|
6
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
7
|
+
import { assignProps as _assignProps2 } from 'intergalactic/core';
|
8
|
+
import { assignProps as _assignProps } from 'intergalactic/core';
|
9
|
+
import React from 'react';
|
10
|
+
import createComponent, { Component, Root } from 'intergalactic/core';
|
11
|
+
import Input from 'intergalactic/input';
|
12
|
+
import { ButtonLink } from 'intergalactic/button';
|
13
|
+
var AddFilterInputRoot = /*#__PURE__*/function (_Component) {
|
14
|
+
_inherits(AddFilterInputRoot, _Component);
|
15
|
+
var _super = _createSuper(AddFilterInputRoot);
|
16
|
+
function AddFilterInputRoot() {
|
17
|
+
_classCallCheck(this, AddFilterInputRoot);
|
18
|
+
return _super.apply(this, arguments);
|
19
|
+
}
|
20
|
+
_createClass(AddFilterInputRoot, [{
|
21
|
+
key: "componentWillUnmount",
|
22
|
+
value: function componentWillUnmount() {
|
23
|
+
var _this$asProps$onUnmou, _this$asProps;
|
24
|
+
(_this$asProps$onUnmou = (_this$asProps = this.asProps).onUnmount) === null || _this$asProps$onUnmou === void 0 ? void 0 : _this$asProps$onUnmou.call(_this$asProps);
|
25
|
+
}
|
26
|
+
}, {
|
27
|
+
key: "getValueProps",
|
28
|
+
value: function getValueProps(props) {
|
29
|
+
var _ref3 = this.asProps,
|
30
|
+
value = _ref3.value,
|
31
|
+
onClear = _ref3.onClear,
|
32
|
+
setFocusRef = _ref3.setFocusRef;
|
33
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
34
|
+
ref: setFocusRef,
|
35
|
+
onBlur: function onBlur() {
|
36
|
+
if (!value) {
|
37
|
+
setTimeout(onClear, 200);
|
38
|
+
}
|
39
|
+
},
|
40
|
+
onKeyDown: function onKeyDown(e) {
|
41
|
+
if (!value && e.key === 'Escape') {
|
42
|
+
onClear();
|
43
|
+
}
|
44
|
+
},
|
45
|
+
autoFocus: true
|
46
|
+
});
|
47
|
+
}
|
48
|
+
}, {
|
49
|
+
key: "getClearProps",
|
50
|
+
value: function getClearProps() {
|
51
|
+
var _ref4 = this.asProps,
|
52
|
+
onClear = _ref4.onClear;
|
53
|
+
return {
|
54
|
+
onClick: onClear
|
55
|
+
};
|
56
|
+
}
|
57
|
+
}, {
|
58
|
+
key: "render",
|
59
|
+
value: function render() {
|
60
|
+
var _ref = this.asProps;
|
61
|
+
return /*#__PURE__*/React.createElement(Input, _assignProps({
|
62
|
+
"w": 'auto',
|
63
|
+
"inline": false
|
64
|
+
}, _ref));
|
65
|
+
}
|
66
|
+
}]);
|
67
|
+
return AddFilterInputRoot;
|
68
|
+
}(Component);
|
69
|
+
_defineProperty(AddFilterInputRoot, "displayName", 'AddFilterInput');
|
70
|
+
var Clear = function Clear() {
|
71
|
+
var _ref2 = arguments[0];
|
72
|
+
return /*#__PURE__*/React.createElement(ButtonLink, _assignProps2({}, _ref2));
|
73
|
+
};
|
74
|
+
var AddFilterInput = createComponent(AddFilterInputRoot, {
|
75
|
+
Value: Input.Value,
|
76
|
+
Addon: Input.Addon,
|
77
|
+
Clear: Clear
|
78
|
+
});
|
79
|
+
export default AddFilterInput;
|
80
|
+
//# sourceMappingURL=AddFilterInput.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AddFilterInput.js","names":["React","createComponent","Component","Root","Input","ButtonLink","AddFilterInputRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","componentWillUnmount","_this$asProps$onUnmou","_this$asProps","asProps","onUnmount","call","getValueProps","props","_ref3","onClear","setFocusRef","_objectSpread","ref","onBlur","setTimeout","onKeyDown","e","autoFocus","getClearProps","_ref4","onClick","render","_ref","createElement","_assignProps","_defineProperty","Clear","_ref2","arguments[0]","_assignProps2","AddFilterInput","Value","Addon"],"sources":["../../../src/components/AddFilterInput.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, Root } from '@semcore/core';\nimport Input from '@semcore/input';\nimport { AddFilterItemProps } from '../AddFilter.types';\nimport { InputValueProps } from '@semcore/input';\nimport { ButtonLink } from '@semcore/button';\n\ntype AsPropsWithOnClear<T> = T & {\n onClear: () => void;\n unsetFocusRef: () => void;\n setFocusRef: (el: HTMLElement) => {};\n};\nclass AddFilterInputRoot extends Component<AddFilterItemProps> {\n static displayName = 'AddFilterInput';\n\n componentWillUnmount() {\n this.asProps.onUnmount?.();\n }\n\n getValueProps(props: InputValueProps) {\n const { value, onClear, setFocusRef } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n ...props,\n ref: setFocusRef,\n onBlur: () => {\n if (!value) {\n setTimeout(onClear, 200);\n }\n },\n onKeyDown: (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (!value && e.key === 'Escape') {\n onClear();\n }\n },\n autoFocus: true,\n };\n }\n\n getClearProps() {\n const { onClear } = this.asProps as AsPropsWithOnClear<typeof this.asProps>;\n\n return {\n onClick: onClear,\n };\n }\n\n render() {\n return <Root render={Input} w={'auto'} inline={false} />;\n }\n}\n\nconst Clear = () => {\n return <Root render={ButtonLink} />;\n};\n\nconst AddFilterInput = createComponent(AddFilterInputRoot, {\n Value: Input.Value,\n Addon: Input.Addon,\n Clear,\n});\n\nexport default AddFilterInput;\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,IAAI,QAAQ,eAAe;AAChE,OAAOC,KAAK,MAAM,gBAAgB;AAGlC,SAASC,UAAU,QAAQ,iBAAiB;AAAC,IAOvCC,kBAAkB,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,kBAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,kBAAA;EAAA,SAAAA,mBAAA;IAAAK,eAAA,OAAAL,kBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,kBAAA;IAAAS,GAAA;IAAAC,KAAA,EAGtB,SAAAC,qBAAA,EAAuB;MAAA,IAAAC,qBAAA,EAAAC,aAAA;MACrB,CAAAD,qBAAA,IAAAC,aAAA,OAAI,CAACC,OAAO,EAACC,SAAS,cAAAH,qBAAA,uBAAtBA,qBAAA,CAAAI,IAAA,CAAAH,aAAA,CAA0B;IAC5B;EAAC;IAAAJ,GAAA;IAAAC,KAAA,EAED,SAAAO,cAAcC,KAAsB,EAAE;MACpC,IAAAC,KAAA,GAAwC,IAAI,CAACL,OAAO;QAA5CJ,KAAK,GAAAS,KAAA,CAALT,KAAK;QAAEU,OAAO,GAAAD,KAAA,CAAPC,OAAO;QAAEC,WAA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