@hitachivantara/uikit-react-core 6.8.1 → 6.9.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/dist/Accordion/Accordion.js +69 -80
- package/dist/Accordion/Accordion.styles.js +21 -16
- package/dist/ActionBar/ActionBar.js +18 -17
- package/dist/ActionBar/ActionBar.styles.js +12 -15
- package/dist/ActionsGeneric/ActionsGeneric.js +72 -98
- package/dist/ActionsGeneric/ActionsGeneric.styles.js +17 -14
- package/dist/AppSwitcher/Action/Action.js +96 -111
- package/dist/AppSwitcher/Action/Action.styles.js +44 -48
- package/dist/AppSwitcher/AppSwitcher.js +70 -98
- package/dist/AppSwitcher/AppSwitcher.styles.js +50 -53
- package/dist/Avatar/Avatar.js +66 -111
- package/dist/Avatar/Avatar.styles.js +62 -52
- package/dist/AvatarGroup/AvatarGroup.js +49 -78
- package/dist/AvatarGroup/AvatarGroup.styles.js +40 -60
- package/dist/AvatarGroup/AvatarGroupContext.js +13 -16
- package/dist/Badge/Badge.js +40 -47
- package/dist/Badge/Badge.styles.js +50 -44
- package/dist/Banner/Banner.js +51 -83
- package/dist/Banner/Banner.styles.js +13 -22
- package/dist/Banner/BannerContent/BannerContent.js +35 -56
- package/dist/Banner/BannerContent/BannerContent.styles.js +31 -36
- package/dist/BaseCheckBox/BaseCheckBox.js +71 -88
- package/dist/BaseCheckBox/BaseCheckBox.styles.js +24 -31
- package/dist/BaseCheckBox/CheckBoxIcon.js +57 -73
- package/dist/BaseDropdown/BaseDropdown.js +147 -189
- package/dist/BaseDropdown/BaseDropdown.styles.js +72 -84
- package/dist/BaseDropdown/BaseDropdownPanel.js +69 -86
- package/dist/BaseDropdown/utils.js +77 -76
- package/dist/BaseInput/BaseInput.js +53 -89
- package/dist/BaseInput/BaseInput.styles.js +85 -105
- package/dist/BaseInput/validations.js +72 -69
- package/dist/BaseRadio/BaseRadio.js +61 -85
- package/dist/BaseRadio/BaseRadio.styles.js +26 -31
- package/dist/BaseRadio/RadioIcon.js +43 -48
- package/dist/BaseSwitch/BaseSwitch.js +70 -108
- package/dist/BaseSwitch/BaseSwitch.styles.js +94 -113
- package/dist/BreadCrumb/BreadCrumb.js +84 -106
- package/dist/BreadCrumb/BreadCrumb.styles.js +20 -17
- package/dist/BreadCrumb/Page/Page.js +24 -34
- package/dist/BreadCrumb/Page/Page.styles.js +20 -25
- package/dist/BreadCrumb/PathElement/PathElement.js +17 -17
- package/dist/BreadCrumb/PathElement/PathElement.styles.js +9 -7
- package/dist/BreadCrumb/utils.js +19 -27
- package/dist/BulkActions/BulkActions.js +57 -96
- package/dist/BulkActions/BulkActions.styles.js +37 -45
- package/dist/Button/Button.js +67 -95
- package/dist/Button/Button.styles.js +107 -124
- package/dist/ButtonBase/ButtonBase.js +32 -51
- package/dist/ButtonBase/ButtonBase.styles.js +21 -30
- package/dist/Calendar/Calendar.js +73 -101
- package/dist/Calendar/Calendar.styles.js +14 -32
- package/dist/Calendar/CalendarHeader/CalendarHeader.js +91 -118
- package/dist/Calendar/CalendarHeader/CalendarHeader.styles.js +11 -16
- package/dist/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.js +36 -50
- package/dist/Calendar/CalendarNavigation/ComposedNavigation/ComposedNavigation.styles.js +12 -18
- package/dist/Calendar/CalendarNavigation/MonthSelector/MonthSelector.js +23 -43
- package/dist/Calendar/CalendarNavigation/MonthSelector/MonthSelector.styles.js +21 -24
- package/dist/Calendar/CalendarNavigation/Navigation/Navigation.js +43 -59
- package/dist/Calendar/CalendarNavigation/Navigation/Navigation.styles.js +21 -24
- package/dist/Calendar/SingleCalendar/CalendarCell.js +60 -84
- package/dist/Calendar/SingleCalendar/CalendarCell.styles.js +39 -56
- package/dist/Calendar/SingleCalendar/SingleCalendar.js +121 -154
- package/dist/Calendar/SingleCalendar/SingleCalendar.styles.js +53 -68
- package/dist/Calendar/model.js +45 -62
- package/dist/Calendar/utils.js +233 -128
- package/dist/Card/Card.js +35 -53
- package/dist/Card/Card.styles.js +37 -50
- package/dist/Card/Content/Content.js +15 -27
- package/dist/Card/Content/Content.styles.js +5 -10
- package/dist/Card/Header/Header.js +22 -35
- package/dist/Card/Header/Header.styles.js +22 -25
- package/dist/Card/Media/Media.js +16 -26
- package/dist/Card/Media/Media.styles.js +6 -7
- package/dist/Carousel/Carousel.js +179 -207
- package/dist/Carousel/Carousel.styles.js +141 -166
- package/dist/Carousel/CarouselControls.js +48 -62
- package/dist/Carousel/CarouselSlide/CarouselSlide.js +19 -25
- package/dist/Carousel/CarouselSlide/CarouselSlide.styles.js +10 -11
- package/dist/Carousel/CarouselThumbnails.js +29 -36
- package/dist/CheckBox/CheckBox.js +112 -182
- package/dist/CheckBox/CheckBox.styles.js +48 -57
- package/dist/CheckBoxGroup/CheckBoxGroup.js +154 -245
- package/dist/CheckBoxGroup/CheckBoxGroup.styles.js +29 -35
- package/dist/ColorPicker/ColorPicker.js +146 -222
- package/dist/ColorPicker/ColorPicker.styles.js +40 -45
- package/dist/ColorPicker/Picker/Fields.js +125 -141
- package/dist/ColorPicker/Picker/Picker.js +51 -50
- package/dist/ColorPicker/Picker/Picker.styles.js +42 -42
- package/dist/ColorPicker/PresetColors/PresetColors.js +25 -28
- package/dist/ColorPicker/PresetColors/PresetColors.styles.js +17 -17
- package/dist/ColorPicker/SavedColors/SavedColors.js +37 -41
- package/dist/ColorPicker/SavedColors/SavedColors.styles.js +27 -29
- package/dist/ColorPicker/Swatch.js +22 -37
- package/dist/Container/Container.js +37 -58
- package/dist/Container/Container.styles.js +12 -13
- package/dist/Controls/Controls.js +50 -74
- package/dist/Controls/Controls.styles.js +16 -13
- package/dist/Controls/LeftControl/LeftControl.js +25 -38
- package/dist/Controls/LeftControl/LeftControl.styles.js +7 -7
- package/dist/Controls/RightControl/RightControl.js +31 -46
- package/dist/Controls/RightControl/RightControl.styles.js +9 -7
- package/dist/Controls/context/ControlsContext.js +5 -6
- package/dist/DatePicker/DatePicker.js +286 -339
- package/dist/DatePicker/DatePicker.styles.js +25 -40
- package/dist/DatePicker/useVisibleDate.js +142 -126
- package/dist/DatePicker/utils.js +17 -26
- package/dist/Dialog/Actions/Actions.js +19 -29
- package/dist/Dialog/Actions/Actions.styles.js +20 -20
- package/dist/Dialog/Content/Content.js +29 -46
- package/dist/Dialog/Content/Content.styles.js +14 -15
- package/dist/Dialog/Dialog.js +49 -69
- package/dist/Dialog/Dialog.styles.js +33 -46
- package/dist/Dialog/Title/Title.js +20 -42
- package/dist/Dialog/Title/Title.styles.js +14 -16
- package/dist/Dialog/context.js +5 -6
- package/dist/DotPagination/DotPagination.js +44 -59
- package/dist/DotPagination/DotPagination.styles.js +44 -47
- package/dist/Drawer/Drawer.js +37 -64
- package/dist/Drawer/Drawer.styles.js +18 -21
- package/dist/DropDownMenu/DropDownMenu.js +88 -124
- package/dist/DropDownMenu/DropDownMenu.styles.js +12 -21
- package/dist/Dropdown/Dropdown.js +221 -310
- package/dist/Dropdown/Dropdown.styles.js +39 -48
- package/dist/Dropdown/List/List.js +194 -176
- package/dist/Dropdown/List/List.styles.js +23 -24
- package/dist/Dropdown/utils.js +15 -16
- package/dist/DropdownButton/DropdownButton.js +42 -46
- package/dist/DropdownButton/DropdownButton.styles.js +37 -47
- package/dist/EmptyState/EmptyState.js +48 -61
- package/dist/EmptyState/EmptyState.styles.js +31 -31
- package/dist/FileUploader/DropZone/DropZone.js +141 -179
- package/dist/FileUploader/DropZone/DropZone.styles.js +55 -68
- package/dist/FileUploader/File/File.js +85 -75
- package/dist/FileUploader/File/File.styles.js +55 -60
- package/dist/FileUploader/FileList/FileList.js +19 -28
- package/dist/FileUploader/FileList/FileList.styles.js +15 -16
- package/dist/FileUploader/FileUploader.js +35 -55
- package/dist/FileUploader/FileUploader.styles.js +4 -7
- package/dist/FileUploader/Preview/Preview.js +37 -52
- package/dist/FileUploader/Preview/Preview.styles.js +22 -28
- package/dist/FileUploader/utils.js +24 -11
- package/dist/FilterGroup/Counter/Counter.js +31 -43
- package/dist/FilterGroup/Counter/Counter.styles.js +12 -15
- package/dist/FilterGroup/FilterContent/FilterContent.js +138 -177
- package/dist/FilterGroup/FilterContent/FilterContent.styles.js +46 -53
- package/dist/FilterGroup/FilterContent/HeaderButton.js +77 -100
- package/dist/FilterGroup/FilterGroup.js +87 -136
- package/dist/FilterGroup/FilterGroup.styles.js +9 -10
- package/dist/FilterGroup/FilterGroupContext.js +68 -73
- package/dist/FilterGroup/LeftPanel/LeftPanel.js +28 -31
- package/dist/FilterGroup/LeftPanel/LeftPanel.styles.js +6 -11
- package/dist/FilterGroup/RightPanel/RightPanel.js +118 -151
- package/dist/FilterGroup/RightPanel/RightPanel.styles.js +17 -27
- package/dist/Focus/Focus.js +248 -344
- package/dist/Focus/Focus.styles.js +28 -39
- package/dist/Focus/utils.js +14 -20
- package/dist/Footer/Footer.js +36 -38
- package/dist/Footer/Footer.styles.js +40 -43
- package/dist/FormElement/Adornment/Adornment.js +38 -49
- package/dist/FormElement/Adornment/Adornment.styles.js +14 -15
- package/dist/FormElement/CharCounter/CharCounter.js +51 -73
- package/dist/FormElement/CharCounter/CharCounter.styles.js +12 -10
- package/dist/FormElement/FormElement.js +53 -31
- package/dist/FormElement/FormElement.styles.js +4 -7
- package/dist/FormElement/InfoMessage/InfoMessage.js +26 -41
- package/dist/FormElement/InfoMessage/InfoMessage.styles.js +11 -9
- package/dist/FormElement/Label/Label.js +33 -56
- package/dist/FormElement/Label/Label.styles.js +11 -9
- package/dist/FormElement/LabelContainer.js +46 -55
- package/dist/FormElement/Suggestions/Suggestions.js +46 -71
- package/dist/FormElement/Suggestions/Suggestions.styles.js +9 -16
- package/dist/FormElement/WarningText/WarningText.js +41 -62
- package/dist/FormElement/WarningText/WarningText.styles.js +25 -28
- package/dist/FormElement/context.js +6 -10
- package/dist/FormElement/utils.js +54 -58
- package/dist/GlobalActions/GlobalActions.js +53 -59
- package/dist/GlobalActions/GlobalActions.styles.js +67 -76
- package/dist/Grid/Grid.js +82 -112
- package/dist/Grid/Grid.styles.js +37 -38
- package/dist/Header/Actions/Actions.js +15 -17
- package/dist/Header/Actions/Actions.styles.js +12 -15
- package/dist/Header/Brand/Brand.js +27 -23
- package/dist/Header/Brand/Brand.styles.js +16 -14
- package/dist/Header/Header.js +22 -31
- package/dist/Header/Header.styles.js +32 -30
- package/dist/Header/Navigation/MenuBar/Bar.js +23 -36
- package/dist/Header/Navigation/MenuBar/Bar.styles.js +54 -61
- package/dist/Header/Navigation/MenuBar/MenuBar.js +20 -26
- package/dist/Header/Navigation/MenuItem/MenuItem.js +104 -120
- package/dist/Header/Navigation/MenuItem/MenuItem.styles.js +48 -63
- package/dist/Header/Navigation/Navigation.js +32 -37
- package/dist/Header/Navigation/Navigation.styles.js +11 -17
- package/dist/Header/Navigation/useSelectionPath.js +17 -20
- package/dist/Header/Navigation/utils/FocusContext.js +23 -20
- package/dist/Header/Navigation/utils/SelectionContext.js +4 -4
- package/dist/IconButton/IconButton.js +25 -32
- package/dist/IconContainer/IconContainer.js +55 -76
- package/dist/InlineEditor/InlineEditor.js +105 -131
- package/dist/InlineEditor/InlineEditor.styles.js +44 -53
- package/dist/Input/Input.js +385 -461
- package/dist/Input/Input.styles.js +34 -47
- package/dist/Input/icons.js +16 -21
- package/dist/Input/utils.js +8 -11
- package/dist/List/List.js +196 -247
- package/dist/List/List.styles.js +44 -49
- package/dist/List/useSelectableList.js +11 -8
- package/dist/List/utils.js +24 -33
- package/dist/ListContainer/ListContainer.js +52 -65
- package/dist/ListContainer/ListContainer.styles.js +7 -10
- package/dist/ListContainer/ListContext/ListContext.js +4 -4
- package/dist/ListContainer/ListItem/ListItem.js +79 -117
- package/dist/ListContainer/ListItem/ListItem.styles.js +57 -78
- package/dist/Loading/Loading.js +31 -46
- package/dist/Loading/Loading.styles.js +41 -48
- package/dist/LoadingContainer/LoadingContainer.js +34 -40
- package/dist/LoadingContainer/LoadingContainer.styles.js +17 -18
- package/dist/Login/Login.js +22 -29
- package/dist/Login/Login.styles.js +20 -21
- package/dist/MultiButton/MultiButton.js +41 -59
- package/dist/MultiButton/MultiButton.styles.js +117 -137
- package/dist/NumberInput/NumberInput.js +51 -50
- package/dist/NumberInput/NumberInput.styles.js +5 -10
- package/dist/OverflowTooltip/OverflowTooltip.js +55 -75
- package/dist/OverflowTooltip/OverflowTooltip.styles.js +19 -23
- package/dist/Pagination/Pagination.js +176 -164
- package/dist/Pagination/Pagination.styles.js +86 -90
- package/dist/Pagination/Select.js +51 -60
- package/dist/Pagination/Select.styles.js +13 -19
- package/dist/Panel/Panel.js +19 -20
- package/dist/Panel/Panel.styles.js +12 -15
- package/dist/ProgressBar/ProgressBar.js +40 -53
- package/dist/ProgressBar/ProgressBar.styles.js +28 -40
- package/dist/QueryBuilder/ConfirmationDialog.js +35 -28
- package/dist/QueryBuilder/Context.js +308 -322
- package/dist/QueryBuilder/QueryBuilder.js +108 -137
- package/dist/QueryBuilder/QueryBuilder.styles.js +117 -108
- package/dist/QueryBuilder/Rule/Attribute.js +56 -62
- package/dist/QueryBuilder/Rule/Operator.js +53 -57
- package/dist/QueryBuilder/Rule/Rule.js +70 -96
- package/dist/QueryBuilder/Rule/Rule.styles.js +49 -54
- package/dist/QueryBuilder/RuleGroup.js +160 -206
- package/dist/QueryBuilder/Value/BooleanValue.js +38 -37
- package/dist/QueryBuilder/Value/DateTimeValue.js +233 -299
- package/dist/QueryBuilder/Value/EmptyValue.js +14 -14
- package/dist/QueryBuilder/Value/NumericValue.js +152 -204
- package/dist/QueryBuilder/Value/TextValue.js +38 -54
- package/dist/QueryBuilder/Value/Value.js +42 -67
- package/dist/QueryBuilder/types.js +4 -4
- package/dist/QueryBuilder/utils/index.js +40 -74
- package/dist/QueryBuilder/utils/reducer.js +86 -92
- package/dist/Radio/Radio.js +96 -145
- package/dist/Radio/Radio.styles.js +47 -55
- package/dist/RadioGroup/RadioGroup.js +98 -159
- package/dist/RadioGroup/RadioGroup.styles.js +28 -34
- package/dist/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.js +34 -51
- package/dist/ScrollToHorizontal/HorizontalScrollListItem/HorizontalScrollListItem.styles.js +39 -48
- package/dist/ScrollToHorizontal/ScrollToHorizontal.js +56 -91
- package/dist/ScrollToHorizontal/ScrollToHorizontal.styles.js +28 -32
- package/dist/ScrollToVertical/ScrollToVertical.js +45 -77
- package/dist/ScrollToVertical/ScrollToVertical.styles.js +31 -38
- package/dist/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.js +30 -39
- package/dist/ScrollToVertical/VerticalScrollListItem/VerticalScrollListItem.styles.js +44 -51
- package/dist/SearchInput/SearchInput.js +27 -25
- package/dist/SearchInput/SearchInput.styles.js +6 -7
- package/dist/Section/Section.js +69 -104
- package/dist/Section/Section.styles.js +53 -57
- package/dist/Select/Option.js +29 -46
- package/dist/Select/OptionGroup.js +18 -30
- package/dist/Select/Select.js +163 -219
- package/dist/Select/Select.styles.js +26 -32
- package/dist/SelectionList/SelectionList.js +162 -216
- package/dist/SelectionList/SelectionList.styles.js +36 -36
- package/dist/SimpleGrid/SimpleGrid.js +16 -27
- package/dist/SimpleGrid/SimpleGrid.styles.js +28 -39
- package/dist/Skeleton/Skeleton.js +26 -44
- package/dist/Skeleton/Skeleton.styles.js +43 -66
- package/dist/Slider/Slider.js +316 -431
- package/dist/Slider/Slider.styles.js +183 -216
- package/dist/Slider/SliderInput/SliderInput.js +38 -57
- package/dist/Slider/SliderInput/SliderInput.styles.js +13 -14
- package/dist/Slider/base.js +221 -243
- package/dist/Slider/utils.js +247 -233
- package/dist/Snackbar/Snackbar.js +59 -88
- package/dist/Snackbar/Snackbar.styles.js +25 -42
- package/dist/Snackbar/SnackbarContent/SnackbarContent.js +31 -50
- package/dist/Snackbar/SnackbarContent/SnackbarContent.styles.js +27 -30
- package/dist/SnackbarProvider/SnackbarProvider.js +73 -105
- package/dist/SnackbarProvider/SnackbarProvider.styles.js +20 -26
- package/dist/Stack/Stack.js +74 -84
- package/dist/Stack/Stack.styles.js +14 -33
- package/dist/StatusIcon/StatusIcon.js +78 -102
- package/dist/StatusIcon/StatusIcon.styles.js +42 -52
- package/dist/Switch/Switch.js +91 -138
- package/dist/Switch/Switch.styles.js +49 -60
- package/dist/Table/Table.js +62 -66
- package/dist/Table/Table.styles.js +23 -28
- package/dist/Table/TableBody/TableBody.js +45 -56
- package/dist/Table/TableBody/TableBody.styles.js +8 -7
- package/dist/Table/TableCell/TableCell.js +37 -66
- package/dist/Table/TableCell/TableCell.styles.js +125 -162
- package/dist/Table/TableContainer/TableContainer.js +18 -28
- package/dist/Table/TableContainer/TableContainer.styles.js +8 -12
- package/dist/Table/TableContext.js +4 -4
- package/dist/Table/TableHead/TableHead.js +27 -39
- package/dist/Table/TableHead/TableHead.styles.js +10 -7
- package/dist/Table/TableHeader/TableHeader.js +73 -124
- package/dist/Table/TableHeader/TableHeader.styles.js +135 -150
- package/dist/Table/TableHeader/utils.js +11 -15
- package/dist/Table/TableRow/TableRow.js +32 -51
- package/dist/Table/TableRow/TableRow.styles.js +64 -84
- package/dist/Table/TableSection/TableSection.js +21 -20
- package/dist/Table/TableSection/TableSection.styles.js +63 -96
- package/dist/Table/TableSectionContext.js +4 -4
- package/dist/Table/hooks/useHvBulkActions.js +54 -89
- package/dist/Table/hooks/useHvFilters.js +4 -4
- package/dist/Table/hooks/useHvGlobalFilter.js +4 -4
- package/dist/Table/hooks/useHvHeaderGroups.js +73 -82
- package/dist/Table/hooks/useHvPagination.js +31 -51
- package/dist/Table/hooks/useHvResizeColumns.js +25 -31
- package/dist/Table/hooks/useHvRowExpand.js +54 -69
- package/dist/Table/hooks/useHvRowSelection.js +294 -420
- package/dist/Table/hooks/useHvRowState.js +4 -4
- package/dist/Table/hooks/useHvSortBy.js +23 -30
- package/dist/Table/hooks/useHvSticky.js +114 -154
- package/dist/Table/hooks/useHvTable.js +40 -64
- package/dist/Table/hooks/useHvTableStyles.js +51 -82
- package/dist/Table/renderers/DateColumnCell.js +12 -13
- package/dist/Table/renderers/DefaultCell.js +13 -20
- package/dist/Table/renderers/DropdownColumnCell.js +4 -4
- package/dist/Table/renderers/ProgressColumnCell.js +43 -47
- package/dist/Table/renderers/SwitchColumnCell.js +37 -50
- package/dist/Table/renderers/renderers.js +146 -183
- package/dist/Tabs/Tab/Tab.js +21 -31
- package/dist/Tabs/Tab/Tab.styles.js +44 -54
- package/dist/Tabs/Tabs.js +23 -28
- package/dist/Tabs/Tabs.styles.js +9 -14
- package/dist/Tag/Tag.js +86 -129
- package/dist/Tag/Tag.styles.js +63 -88
- package/dist/TagsInput/TagsInput.js +349 -417
- package/dist/TagsInput/TagsInput.styles.js +77 -90
- package/dist/TextArea/TextArea.js +207 -274
- package/dist/TextArea/TextArea.styles.js +25 -20
- package/dist/TimeAgo/TimeAgo.js +24 -30
- package/dist/TimeAgo/TimeAgo.styles.js +4 -7
- package/dist/TimeAgo/formatUtils.js +57 -65
- package/dist/TimeAgo/useTimeAgo.js +18 -18
- package/dist/TimeAgo/useTimeout.js +14 -14
- package/dist/TimePicker/Placeholder.js +46 -52
- package/dist/TimePicker/TimePicker.js +164 -214
- package/dist/TimePicker/TimePicker.styles.js +30 -39
- package/dist/TimePicker/Unit/Unit.js +63 -49
- package/dist/TimePicker/Unit/Unit.styles.js +41 -46
- package/dist/ToggleButton/ToggleButton.js +25 -34
- package/dist/Tooltip/Tooltip.js +41 -51
- package/dist/Tooltip/Tooltip.styles.js +25 -26
- package/dist/TreeView/TreeItem/DefaultContent.js +51 -72
- package/dist/TreeView/TreeItem/TreeItem.js +102 -140
- package/dist/TreeView/TreeItem/TreeItem.styles.js +56 -70
- package/dist/TreeView/TreeItem/useHvTreeItem.js +38 -53
- package/dist/TreeView/TreeView.js +65 -62
- package/dist/TreeView/TreeView.styles.js +11 -13
- package/dist/TreeView/internals/DescendantProvider.js +120 -120
- package/dist/TreeView/internals/TreeViewProvider.js +32 -26
- package/dist/TreeView/internals/corePlugins.js +8 -4
- package/dist/TreeView/internals/hooks/plugins/defaultPlugins.js +10 -10
- package/dist/TreeView/internals/hooks/plugins/useTreeViewContextValueBuilder.js +20 -22
- package/dist/TreeView/internals/hooks/plugins/useTreeViewExpansion.js +39 -61
- package/dist/TreeView/internals/hooks/plugins/useTreeViewFocus.js +56 -80
- package/dist/TreeView/internals/hooks/plugins/useTreeViewKeyboardNavigation.js +149 -211
- package/dist/TreeView/internals/hooks/plugins/useTreeViewNodes.js +42 -68
- package/dist/TreeView/internals/hooks/plugins/useTreeViewSelection.js +162 -195
- package/dist/TreeView/internals/hooks/useInstanceEventHandler.js +52 -74
- package/dist/TreeView/internals/hooks/useTreeView.js +54 -69
- package/dist/TreeView/internals/hooks/useTreeViewInstanceEvents.js +28 -33
- package/dist/TreeView/internals/hooks/useTreeViewModels.js +34 -43
- package/dist/TreeView/internals/hooks/utils.js +28 -42
- package/dist/TreeView/internals/utils/EventManager.js +49 -58
- package/dist/TreeView/internals/utils/FinalizationRegistryBasedCleanupTracking.js +14 -18
- package/dist/TreeView/internals/utils/TimerBasedCleanupTracking.js +33 -37
- package/dist/TreeView/internals/utils/publishTreeViewEvent.js +5 -5
- package/dist/Typography/Typography.js +34 -51
- package/dist/Typography/Typography.styles.js +20 -23
- package/dist/VerticalNavigation/Actions/Action.js +23 -42
- package/dist/VerticalNavigation/Actions/Action.styles.js +21 -28
- package/dist/VerticalNavigation/Actions/Actions.js +15 -31
- package/dist/VerticalNavigation/Actions/Actions.styles.js +13 -19
- package/dist/VerticalNavigation/Header/Header.js +51 -91
- package/dist/VerticalNavigation/Header/Header.styles.js +22 -32
- package/dist/VerticalNavigation/Navigation/Navigation.js +183 -267
- package/dist/VerticalNavigation/Navigation/Navigation.styles.js +14 -24
- package/dist/VerticalNavigation/NavigationPopup/NavigationPopup.styles.js +9 -17
- package/dist/VerticalNavigation/NavigationPopup/NavigationPopupContainer.js +30 -32
- package/dist/VerticalNavigation/NavigationSlider/NavigationSlider.js +45 -63
- package/dist/VerticalNavigation/NavigationSlider/NavigationSlider.styles.js +23 -33
- package/dist/VerticalNavigation/NavigationSlider/utils.js +56 -39
- package/dist/VerticalNavigation/TreeView/TreeView.js +515 -664
- package/dist/VerticalNavigation/TreeView/TreeView.styles.js +10 -16
- package/dist/VerticalNavigation/TreeView/TreeViewContext.js +5 -6
- package/dist/VerticalNavigation/TreeView/TreeViewItem.js +319 -414
- package/dist/VerticalNavigation/TreeView/TreeViewItem.styles.js +91 -143
- package/dist/VerticalNavigation/VerticalNavigation.js +70 -97
- package/dist/VerticalNavigation/VerticalNavigation.styles.js +31 -45
- package/dist/VerticalNavigation/VerticalNavigationContext.js +8 -10
- package/dist/hooks/useClickOutside.js +21 -23
- package/dist/hooks/useComputation.js +13 -13
- package/dist/hooks/useControlled.js +10 -17
- package/dist/hooks/useEnhancedEffect.js +5 -5
- package/dist/hooks/useExpandable.js +24 -31
- package/dist/hooks/useFocus.js +31 -34
- package/dist/hooks/useForkRef.js +19 -19
- package/dist/hooks/useImageLoaded.js +26 -26
- package/dist/hooks/useIsMounted.js +13 -13
- package/dist/hooks/useLabels.js +7 -7
- package/dist/hooks/useScrollTo.js +101 -130
- package/dist/hooks/useUniqueId.js +6 -6
- package/dist/hooks/useWidth.js +10 -13
- package/dist/icons.js +77 -88
- package/dist/index.d.ts +8 -8
- package/dist/index.js +226 -554
- package/dist/providers/Provider.js +44 -75
- package/dist/providers/ThemeProvider.js +79 -71
- package/dist/providers/utils.js +40 -47
- package/dist/themes/index.js +6 -5
- package/dist/themes/next.js +132 -271
- package/dist/themes/pentaho.js +832 -1173
- package/dist/types/generic.js +5 -4
- package/dist/utils/Callout.js +123 -171
- package/dist/utils/CounterLabel.js +14 -15
- package/dist/utils/deepMerge.js +13 -15
- package/dist/utils/document.js +8 -8
- package/dist/utils/focusUtils.js +6 -7
- package/dist/utils/focusableElementFinder.js +23 -26
- package/dist/utils/helpers.js +15 -23
- package/dist/utils/iconVariant.js +15 -12
- package/dist/utils/keyboardUtils.js +28 -28
- package/dist/utils/multiSelectionEventHandler.js +37 -52
- package/dist/utils/scroll.js +50 -76
- package/dist/utils/setId.js +4 -4
- package/dist/utils/theme.js +11 -8
- package/dist/utils/useSavedState.js +19 -16
- package/package.json +5 -5
package/dist/Slider/utils.js
CHANGED
|
@@ -1,245 +1,259 @@
|
|
|
1
|
-
import { theme } from "@hitachivantara/uikit-styles";
|
|
2
1
|
import { sliderStyles } from "./Slider.styles.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
import { theme } from "@hitachivantara/uikit-styles";
|
|
3
|
+
//#region src/Slider/utils.ts
|
|
4
|
+
/**
|
|
5
|
+
* Transform the scaled values into knobs positions.
|
|
6
|
+
*
|
|
7
|
+
* @param {*} sliderValue - he value of the slider to be scaled
|
|
8
|
+
* @param {*} minPointVlue - The value of the first point in the slider from left to right.
|
|
9
|
+
* @param {*} stepVlue - The calculated separation between the values of the slider.
|
|
10
|
+
*/
|
|
11
|
+
var knobsPositionToScaledValue = (sliderValue, minPointValue, stepValue) => minPointValue + stepValue * sliderValue;
|
|
12
|
+
/**
|
|
13
|
+
* Transform the scaled values into knobs positions.
|
|
14
|
+
*
|
|
15
|
+
* @param {*} scaledValue - The value of the slider to be scaled
|
|
16
|
+
* @param {*} minPointValue - The value of the first point in
|
|
17
|
+
* the slider from left to right.
|
|
18
|
+
* @param {*} inverseStepValue - The inverse of calculated separation between
|
|
19
|
+
* the value of the points that compose the slider.
|
|
20
|
+
*/
|
|
21
|
+
var scaledValueToKnobsPositionValue = (scaledValue, minPointValue, inverseStepValue) => typeof scaledValue === "number" ? Math.floor((scaledValue - minPointValue) * inverseStepValue) : NaN;
|
|
22
|
+
/**
|
|
23
|
+
* Transform the received knobs values into knob positions
|
|
24
|
+
*
|
|
25
|
+
* @param {Object} values - The values of the slider.
|
|
26
|
+
* @param {Number} inverseStepValue - The inverse of calculated separation between
|
|
27
|
+
* the value of the points that compose the slider.
|
|
28
|
+
* @param {Integer} minPointValue - The value of the first point in the slider from
|
|
29
|
+
* left to right.
|
|
30
|
+
* @returns {Array} - The position of the knobs.
|
|
31
|
+
*/
|
|
32
|
+
var knobsValuesToKnobsPositions = (values, inverseStepValue, minPointValue) => {
|
|
33
|
+
const knobsPositions = [];
|
|
34
|
+
values.forEach((value, index) => {
|
|
35
|
+
knobsPositions[index] = scaledValueToKnobsPositionValue(value, minPointValue, inverseStepValue);
|
|
36
|
+
});
|
|
37
|
+
return knobsPositions;
|
|
26
38
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
} else {
|
|
48
|
-
const roundedMarkStep = Math.max(1, Math.floor(markStep));
|
|
49
|
-
for (let index = 0; index <= divisionQuantity; index += roundedMarkStep) {
|
|
50
|
-
let labelValue = knobsPositionToScaledValue(
|
|
51
|
-
index,
|
|
52
|
-
minPointValue,
|
|
53
|
-
stepValue
|
|
54
|
-
).toFixed(Math.max(0, Math.min(8, markDigits)));
|
|
55
|
-
values.push(labelValue);
|
|
56
|
-
labelValue = formatMark?.(labelValue) || labelValue;
|
|
57
|
-
marks[index] = disabled ? {
|
|
58
|
-
label: `${labelValue}`,
|
|
59
|
-
style: {
|
|
60
|
-
...sliderStyles.disabledMark
|
|
61
|
-
}
|
|
62
|
-
} : {
|
|
63
|
-
label: `${labelValue}`,
|
|
64
|
-
style: {
|
|
65
|
-
...sliderStyles.mark
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
if (!values.includes(maxPointValue.toString())) {
|
|
70
|
-
const lastMarkPosition = knobsValuesToKnobsPositions(
|
|
71
|
-
[maxPointValue],
|
|
72
|
-
1 / stepValue,
|
|
73
|
-
minPointValue
|
|
74
|
-
);
|
|
75
|
-
const lastMarkLabel = formatMark?.(maxPointValue.toFixed(markDigits));
|
|
76
|
-
marks[lastMarkPosition[0]] = disabled ? {
|
|
77
|
-
label: `${lastMarkLabel}`,
|
|
78
|
-
style: {
|
|
79
|
-
...sliderStyles.disabledMark
|
|
80
|
-
}
|
|
81
|
-
} : {
|
|
82
|
-
label: `${lastMarkLabel}`,
|
|
83
|
-
style: {
|
|
84
|
-
...sliderStyles.mark
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return marks;
|
|
39
|
+
/**
|
|
40
|
+
* Transform the received knobs positions into knob values
|
|
41
|
+
*
|
|
42
|
+
* @param {Object} knobPositions - The values of the slider.
|
|
43
|
+
* @param {Number} stepValue - The calculated separation between
|
|
44
|
+
* the value of the points that compose the slider.
|
|
45
|
+
* @param {Integer} minPointValue - The value of the first point in the slider from
|
|
46
|
+
* left to right.
|
|
47
|
+
* @returns {Array} - The position of the knobs.
|
|
48
|
+
*/
|
|
49
|
+
var knobsPositionsToKnobsValues = (knobPositions, stepValue, minPointValue) => {
|
|
50
|
+
const knobsValues = [];
|
|
51
|
+
knobPositions.forEach((value, index) => {
|
|
52
|
+
knobsValues[index] = knobsPositionToScaledValue(value, minPointValue, stepValue);
|
|
53
|
+
});
|
|
54
|
+
return knobsValues;
|
|
90
55
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
56
|
+
/**
|
|
57
|
+
* Calculates the separation between each value in the slider.
|
|
58
|
+
*
|
|
59
|
+
* @param {*} maxPointValue - The value of the last point in the slider from left to right.
|
|
60
|
+
* @param {*} minPointValue - The value of the first point in the slider from left to right.
|
|
61
|
+
* @param {*} divisionQuantity - How many subdivisions there are in the slider.
|
|
62
|
+
*/
|
|
63
|
+
var calculateStepValue = (maxPointValue, minPointValue, divisionQuantity) => Math.abs(maxPointValue - minPointValue) / divisionQuantity;
|
|
64
|
+
/**
|
|
65
|
+
* Generates the inline styles used for the track of each knob, applying colors if necessary.
|
|
66
|
+
*
|
|
67
|
+
* @param {Object} markProperties - The object provided by the user with
|
|
68
|
+
* the desired configuration for the marks.
|
|
69
|
+
* @param {Integer} markStep - The separation between marks.
|
|
70
|
+
* @param {Integer} divisionQuantity - How many subdivisions there are in the slider.
|
|
71
|
+
* @param {Integer} minPointValue - The value of the first point in the slider from
|
|
72
|
+
* left to right.
|
|
73
|
+
* @param {Integer} stepValue - The calculated separation between the values of the slider.
|
|
74
|
+
* @param {Integer} markDigits - How many decimals the mark will show.
|
|
75
|
+
* @param {Function} formatMark - A function provided by the user that is going to
|
|
76
|
+
* be executed to format the mark text.
|
|
77
|
+
* @param {Object} styles - the default styles for the marks.
|
|
78
|
+
* @returns {Object} - An object with the for the marks.
|
|
79
|
+
* @memberof HvSlider
|
|
80
|
+
*/
|
|
81
|
+
var createMark = (markProperties, markStep, divisionQuantity, minPointValue, maxPointValue, stepValue, markDigits, disabled, formatMark = (mark) => mark) => {
|
|
82
|
+
const marks = {};
|
|
83
|
+
const values = [];
|
|
84
|
+
if (markProperties.length > 0) markProperties.forEach((markProperty) => {
|
|
85
|
+
if (typeof markProperty.position === "number") marks[markProperty.position] = disabled ? {
|
|
86
|
+
label: `${markProperty.label}`,
|
|
87
|
+
style: { ...sliderStyles.disabledMark }
|
|
88
|
+
} : {
|
|
89
|
+
label: `${markProperty.label}`,
|
|
90
|
+
style: { ...sliderStyles.mark }
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
else {
|
|
94
|
+
const roundedMarkStep = Math.max(1, Math.floor(markStep));
|
|
95
|
+
for (let index = 0; index <= divisionQuantity; index += roundedMarkStep) {
|
|
96
|
+
let labelValue = knobsPositionToScaledValue(index, minPointValue, stepValue).toFixed(Math.max(0, Math.min(8, markDigits)));
|
|
97
|
+
values.push(labelValue);
|
|
98
|
+
labelValue = formatMark?.(labelValue) || labelValue;
|
|
99
|
+
marks[index] = disabled ? {
|
|
100
|
+
label: `${labelValue}`,
|
|
101
|
+
style: { ...sliderStyles.disabledMark }
|
|
102
|
+
} : {
|
|
103
|
+
label: `${labelValue}`,
|
|
104
|
+
style: { ...sliderStyles.mark }
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (!values.includes(maxPointValue.toString())) {
|
|
108
|
+
const lastMarkPosition = knobsValuesToKnobsPositions([maxPointValue], 1 / stepValue, minPointValue);
|
|
109
|
+
const lastMarkLabel = formatMark?.(maxPointValue.toFixed(markDigits));
|
|
110
|
+
marks[lastMarkPosition[0]] = disabled ? {
|
|
111
|
+
label: `${lastMarkLabel}`,
|
|
112
|
+
style: { ...sliderStyles.disabledMark }
|
|
113
|
+
} : {
|
|
114
|
+
label: `${lastMarkLabel}`,
|
|
115
|
+
style: { ...sliderStyles.mark }
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return marks;
|
|
102
120
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
knobInner[index].backgroundColor = knobProperty.color;
|
|
120
|
-
knobOuterStyle[index] = { ...sliderStyles.knobHidden };
|
|
121
|
-
knobOuterStyle[index].backgroundColor = knobProperty.color;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
return {
|
|
127
|
-
knobInner,
|
|
128
|
-
knobOuterStyle
|
|
129
|
-
};
|
|
121
|
+
/**
|
|
122
|
+
* Generates the inline styles used for the track of each knob, applying colors if necessary.
|
|
123
|
+
*
|
|
124
|
+
* @param {Object} knobProperties - The object provided by the user with
|
|
125
|
+
* the desired configuration for the knobs.
|
|
126
|
+
* @param {Object} styles - the default styles for the tracks.
|
|
127
|
+
* @returns {Object} - An object with the style for each track.
|
|
128
|
+
* @memberof HvSlider
|
|
129
|
+
*/
|
|
130
|
+
var createTrackStyles = (knobProperties) => {
|
|
131
|
+
const trackStyles = [];
|
|
132
|
+
if (knobProperties.length > 0) knobProperties.forEach((knobProperty, index) => {
|
|
133
|
+
trackStyles[index] = { ...sliderStyles.track };
|
|
134
|
+
if (knobProperty.color) trackStyles[index].backgroundColor = knobProperty.trackColor;
|
|
135
|
+
});
|
|
136
|
+
return trackStyles;
|
|
130
137
|
};
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
/**
|
|
139
|
+
* Generates the inline styles used for each knob, applying colors if specified.
|
|
140
|
+
*
|
|
141
|
+
* @param {Object} knobProperties - The object provided by the user with
|
|
142
|
+
* the desired configuration for the knobs.
|
|
143
|
+
* @param {Object} styles - the default styles for the knobs.
|
|
144
|
+
* @returns {Object} - An object with both the inner and outer styles for the knob.
|
|
145
|
+
* @memberof HvSlider
|
|
146
|
+
*/
|
|
147
|
+
var createKnobStyles = (knobProperties) => {
|
|
148
|
+
const knobInner = [];
|
|
149
|
+
const knobOuterStyle = [];
|
|
150
|
+
const lastItem = knobProperties.length - 1;
|
|
151
|
+
if (knobProperties.length > 0) knobProperties.forEach((knobProperty, index) => {
|
|
152
|
+
knobInner[index] = { ...sliderStyles.knobInner };
|
|
153
|
+
knobOuterStyle[index] = { ...sliderStyles.knobOuter };
|
|
154
|
+
if (knobProperty.color) {
|
|
155
|
+
knobInner[index].backgroundColor = knobProperty.color;
|
|
156
|
+
knobOuterStyle[index].backgroundColor = "transparent";
|
|
157
|
+
}
|
|
158
|
+
if (knobProperty.hidden) {
|
|
159
|
+
knobInner[index] = sliderStyles.knobHidden;
|
|
160
|
+
if (index === lastItem) {
|
|
161
|
+
knobInner[index] = { ...sliderStyles.knobHiddenLast };
|
|
162
|
+
knobInner[index].backgroundColor = knobProperty.color;
|
|
163
|
+
knobOuterStyle[index] = { ...sliderStyles.knobHidden };
|
|
164
|
+
knobOuterStyle[index].backgroundColor = knobProperty.color;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
return {
|
|
169
|
+
knobInner,
|
|
170
|
+
knobOuterStyle
|
|
171
|
+
};
|
|
136
172
|
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
color: theme.colors.textDisabled,
|
|
148
|
-
hoverColor: theme.colors.textDisabled,
|
|
149
|
-
trackColor: theme.colors.textDisabled,
|
|
150
|
-
dragColor: theme.colors.textDisabled,
|
|
151
|
-
knobRingColor: theme.colors.textDisabled
|
|
152
|
-
};
|
|
153
|
-
if (knobProperties.length > 0) {
|
|
154
|
-
knobProperties = knobProperties.slice(0, numberOfKnobs);
|
|
155
|
-
knobProperties = knobProperties.map((knobProperty) => {
|
|
156
|
-
if (!disabled) {
|
|
157
|
-
return {
|
|
158
|
-
...disabledKnobStyles,
|
|
159
|
-
...knobProperty
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
...defaultKnobStyles,
|
|
164
|
-
...knobProperty
|
|
165
|
-
};
|
|
166
|
-
});
|
|
167
|
-
} else {
|
|
168
|
-
for (let i = 0; i < numberOfKnobs; i += 1) {
|
|
169
|
-
if (!disabled) knobProperties.push(defaultKnobStyles);
|
|
170
|
-
if (disabled) knobProperties.push(disabledKnobStyles);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
return knobProperties;
|
|
173
|
+
/**
|
|
174
|
+
* Analyzes both the values and the default values to determine whether the slider is working in single mode.
|
|
175
|
+
*
|
|
176
|
+
* @param {Array} values - the values where the knobs are positioned when controlled.
|
|
177
|
+
* @param {Array} defaultValues - the values where the knobs start when uncontrolled.
|
|
178
|
+
* @returns {Boolean} - if true the slider should work as single slider
|
|
179
|
+
*/
|
|
180
|
+
var isSingleSlider = (values, defaultValues) => {
|
|
181
|
+
if (!(values?.length > 1)) return defaultValues.length === 1;
|
|
182
|
+
return values.length === 1;
|
|
174
183
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
184
|
+
/**
|
|
185
|
+
* Generates the default knob styles for each knob
|
|
186
|
+
*
|
|
187
|
+
* @param {Object} knobProperties - The object provided by the user with
|
|
188
|
+
* the desired configuration for the knobs.
|
|
189
|
+
* @param {Integer} numberOfKnobs - the default styles for the knobs.
|
|
190
|
+
* @param {Object} theme - The theme to extract the colors.
|
|
191
|
+
*
|
|
192
|
+
* @returns {Object} - An object with both the inner and outer styles for the knob.
|
|
193
|
+
* @memberof HvSlider
|
|
194
|
+
*/
|
|
195
|
+
var generateDefaultKnobProperties = (numberOfKnobs = 1, disabled = false, knobPropertiesProp) => {
|
|
196
|
+
let knobProperties = knobPropertiesProp || [];
|
|
197
|
+
const defaultKnobStyles = {
|
|
198
|
+
color: theme.colors.text,
|
|
199
|
+
hoverColor: theme.colors.text,
|
|
200
|
+
trackColor: theme.colors.text,
|
|
201
|
+
dragColor: theme.colors.text,
|
|
202
|
+
knobRingColor: theme.colors.textDimmed
|
|
203
|
+
};
|
|
204
|
+
const disabledKnobStyles = {
|
|
205
|
+
color: theme.colors.textDisabled,
|
|
206
|
+
hoverColor: theme.colors.textDisabled,
|
|
207
|
+
trackColor: theme.colors.textDisabled,
|
|
208
|
+
dragColor: theme.colors.textDisabled,
|
|
209
|
+
knobRingColor: theme.colors.textDisabled
|
|
210
|
+
};
|
|
211
|
+
if (knobProperties.length > 0) {
|
|
212
|
+
knobProperties = knobProperties.slice(0, numberOfKnobs);
|
|
213
|
+
knobProperties = knobProperties.map((knobProperty) => {
|
|
214
|
+
if (!disabled) return {
|
|
215
|
+
...disabledKnobStyles,
|
|
216
|
+
...knobProperty
|
|
217
|
+
};
|
|
218
|
+
return {
|
|
219
|
+
...defaultKnobStyles,
|
|
220
|
+
...knobProperty
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
} else for (let i = 0; i < numberOfKnobs; i += 1) {
|
|
224
|
+
if (!disabled) knobProperties.push(defaultKnobStyles);
|
|
225
|
+
if (disabled) knobProperties.push(disabledKnobStyles);
|
|
226
|
+
}
|
|
227
|
+
return knobProperties;
|
|
178
228
|
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
newKnobsPosition.forEach((value, index) => {
|
|
182
|
-
if (Number.isNaN(value) || value == null) {
|
|
183
|
-
newKnobsPosition[index] = pushSlider(
|
|
184
|
-
index,
|
|
185
|
-
inputIndex,
|
|
186
|
-
newKnobsPosition[inputIndex]
|
|
187
|
-
);
|
|
188
|
-
} else if (index < inputIndex && value > newKnobsPosition[inputIndex]) {
|
|
189
|
-
newKnobsPosition[index] = pushSlider(
|
|
190
|
-
index,
|
|
191
|
-
inputIndex,
|
|
192
|
-
newKnobsPosition[inputIndex]
|
|
193
|
-
);
|
|
194
|
-
} else if (index > inputIndex && value < newKnobsPosition[inputIndex]) {
|
|
195
|
-
newKnobsPosition[index] = pushSlider(
|
|
196
|
-
index,
|
|
197
|
-
inputIndex,
|
|
198
|
-
newKnobsPosition[inputIndex]
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
return newKnobsPosition;
|
|
229
|
+
var pushSlider = (index, inputIndex, inputValue) => {
|
|
230
|
+
return inputValue + (index - inputIndex);
|
|
203
231
|
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
result.arrayStatus = Array.from({ length }, () => status);
|
|
213
|
-
return result;
|
|
214
|
-
}
|
|
215
|
-
result.arrayStatus = status;
|
|
216
|
-
return result;
|
|
232
|
+
var ensureValuesConsistency = (knobPositions, inputIndex) => {
|
|
233
|
+
const newKnobsPosition = [...knobPositions];
|
|
234
|
+
newKnobsPosition.forEach((value, index) => {
|
|
235
|
+
if (Number.isNaN(value) || value == null) newKnobsPosition[index] = pushSlider(index, inputIndex, newKnobsPosition[inputIndex]);
|
|
236
|
+
else if (index < inputIndex && value > newKnobsPosition[inputIndex]) newKnobsPosition[index] = pushSlider(index, inputIndex, newKnobsPosition[inputIndex]);
|
|
237
|
+
else if (index > inputIndex && value < newKnobsPosition[inputIndex]) newKnobsPosition[index] = pushSlider(index, inputIndex, newKnobsPosition[inputIndex]);
|
|
238
|
+
});
|
|
239
|
+
return newKnobsPosition;
|
|
217
240
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
241
|
+
var convertStatusToArray = (length, status) => {
|
|
242
|
+
const result = { arrayDefaultStatus: Array.from({ length }, () => "standBy") };
|
|
243
|
+
if (status == null) return result;
|
|
244
|
+
if (!Array.isArray(status)) {
|
|
245
|
+
result.arrayStatus = Array.from({ length }, () => status);
|
|
246
|
+
return result;
|
|
247
|
+
}
|
|
248
|
+
result.arrayStatus = status;
|
|
249
|
+
return result;
|
|
224
250
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
);
|
|
228
|
-
|
|
229
|
-
export {
|
|
230
|
-
calculateStepValue,
|
|
231
|
-
convertStatusToArray,
|
|
232
|
-
createKnobStyles,
|
|
233
|
-
createMark,
|
|
234
|
-
createTrackStyles,
|
|
235
|
-
ensureValuesConsistency,
|
|
236
|
-
generateDefaultKnobProperties,
|
|
237
|
-
isSingleSlider,
|
|
238
|
-
knobsPositionToScaledValue,
|
|
239
|
-
knobsPositionsToKnobsValues,
|
|
240
|
-
knobsValuesToKnobsPositions,
|
|
241
|
-
knobsValuesToString,
|
|
242
|
-
scaledValueToKnobsPositionValue,
|
|
243
|
-
statusArrayToFormStatus,
|
|
244
|
-
stringValuesToKnobs
|
|
251
|
+
var statusArrayToFormStatus = (arrayStatus) => {
|
|
252
|
+
if (arrayStatus.some((status) => status === "invalid")) return "invalid";
|
|
253
|
+
if (arrayStatus.some((status) => status === "valid")) return "valid";
|
|
254
|
+
return "standBy";
|
|
245
255
|
};
|
|
256
|
+
var knobsValuesToString = (knobsValues, markDigits) => knobsValues.map((knobValue) => Number.isNaN(knobValue) ? "" : knobValue.toFixed(markDigits));
|
|
257
|
+
var stringValuesToKnobs = (inputsValues) => inputsValues.map((inputValue) => Number.parseFloat(inputValue));
|
|
258
|
+
//#endregion
|
|
259
|
+
export { calculateStepValue, convertStatusToArray, createKnobStyles, createMark, createTrackStyles, ensureValuesConsistency, generateDefaultKnobProperties, isSingleSlider, knobsPositionToScaledValue, knobsPositionsToKnobsValues, knobsValuesToKnobsPositions, knobsValuesToString, scaledValueToKnobsPositionValue, statusArrayToFormStatus, stringValuesToKnobs };
|
|
@@ -1,92 +1,63 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useCallback } from "react";
|
|
3
|
-
import Slide from "@mui/material/Slide";
|
|
4
|
-
import Snackbar from "@mui/material/Snackbar";
|
|
5
|
-
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
6
1
|
import { capitalize } from "../utils/helpers.js";
|
|
7
2
|
import { useClasses } from "./Snackbar.styles.js";
|
|
8
|
-
import { staticClasses } from "./Snackbar.styles.js";
|
|
9
3
|
import { HvSnackbarContent } from "./SnackbarContent/SnackbarContent.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
transitionDuration,
|
|
68
|
-
TransitionComponent: SlideTransition,
|
|
69
|
-
...others,
|
|
70
|
-
children: /* @__PURE__ */ jsx(
|
|
71
|
-
HvSnackbarContent,
|
|
72
|
-
{
|
|
73
|
-
title,
|
|
74
|
-
label,
|
|
75
|
-
variant,
|
|
76
|
-
customIcon,
|
|
77
|
-
showIcon,
|
|
78
|
-
showClose,
|
|
79
|
-
action,
|
|
80
|
-
onAction,
|
|
81
|
-
onClose,
|
|
82
|
-
size,
|
|
83
|
-
...snackbarContentProps
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
}
|
|
87
|
-
);
|
|
4
|
+
import { useDefaultProps } from "@hitachivantara/uikit-react-utils";
|
|
5
|
+
import { forwardRef, useCallback } from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
import Slide from "@mui/material/Slide";
|
|
8
|
+
import MuiSnackbar from "@mui/material/Snackbar";
|
|
9
|
+
//#region src/Snackbar/Snackbar.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A Snackbar displays brief messages about app processes and dismisses automatically after a set time.
|
|
12
|
+
*
|
|
13
|
+
* You can build a Snackbar using:
|
|
14
|
+
*
|
|
15
|
+
* - `HvSnackbar` – handles positioning, transitions, auto-hide, and more.
|
|
16
|
+
* - `HvSnackbarContent` – offers fine-grained control over the content and appearance.
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
var HvSnackbar = forwardRef(function HvSnackbar(props, ref) {
|
|
20
|
+
const { classes: classesProp, className, id, title, open = false, onClose, label, anchorOrigin = {
|
|
21
|
+
vertical: "top",
|
|
22
|
+
horizontal: "right"
|
|
23
|
+
}, autoHideDuration = 5e3, variant, showIcon, showClose, customIcon, action, onAction, transitionDuration = 300, transitionDirection = "left", container, offset = 60, snackbarContentProps, size, ...others } = useDefaultProps("HvSnackbar", props);
|
|
24
|
+
const { classes } = useClasses(classesProp);
|
|
25
|
+
const anchorOriginOffset = {
|
|
26
|
+
anchorOriginTop: { top: `${offset}px` },
|
|
27
|
+
anchorOriginBottom: { bottom: `${offset}px` }
|
|
28
|
+
};
|
|
29
|
+
const SlideTransition = useCallback((properties) => /* @__PURE__ */ jsx(Slide, {
|
|
30
|
+
...properties,
|
|
31
|
+
container,
|
|
32
|
+
direction: transitionDirection
|
|
33
|
+
}), [container, transitionDirection]);
|
|
34
|
+
return /* @__PURE__ */ jsx(MuiSnackbar, {
|
|
35
|
+
ref,
|
|
36
|
+
style: anchorOriginOffset[`anchorOrigin${capitalize(anchorOrigin.vertical)}`],
|
|
37
|
+
classes,
|
|
38
|
+
className,
|
|
39
|
+
id,
|
|
40
|
+
anchorOrigin,
|
|
41
|
+
open,
|
|
42
|
+
onClose,
|
|
43
|
+
autoHideDuration,
|
|
44
|
+
transitionDuration,
|
|
45
|
+
TransitionComponent: SlideTransition,
|
|
46
|
+
...others,
|
|
47
|
+
children: /* @__PURE__ */ jsx(HvSnackbarContent, {
|
|
48
|
+
title,
|
|
49
|
+
label,
|
|
50
|
+
variant,
|
|
51
|
+
customIcon,
|
|
52
|
+
showIcon,
|
|
53
|
+
showClose,
|
|
54
|
+
action,
|
|
55
|
+
onAction,
|
|
56
|
+
onClose,
|
|
57
|
+
size,
|
|
58
|
+
...snackbarContentProps
|
|
59
|
+
})
|
|
60
|
+
});
|
|
88
61
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
staticClasses as snackbarClasses
|
|
92
|
-
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { HvSnackbar };
|