@gooddata/sdk-ui-kit 10.38.0-alpha.2 → 10.39.0-alpha.1
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/esm/@ui/@types/icon.d.ts +1 -1
- package/esm/@ui/@types/icon.d.ts.map +1 -1
- package/esm/@ui/@types/themeColors.d.ts +1 -1
- package/esm/@ui/@types/themeColors.d.ts.map +1 -1
- package/esm/@ui/@types/themeColors.js +1 -1
- package/esm/@ui/@types/themeColors.js.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTable.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTable.js +6 -18
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTable.js.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableDropdownItem.d.ts +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableDropdownItem.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableDropdownItem.js +3 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableDropdownItem.js.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableFilter.d.ts +2 -2
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableFilter.d.ts.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableFilter.js +3 -4
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableFilter.js.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableRow.js +4 -2
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableRow.js.map +1 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableToolbar.js +3 -3
- package/esm/@ui/UiAsyncTable/UiAsyncTable/UiAsyncTableToolbar.js.map +1 -1
- package/esm/@ui/UiAsyncTable/types.d.ts +3 -4
- package/esm/@ui/UiAsyncTable/types.d.ts.map +1 -1
- package/esm/@ui/UiFocusManager/UiAutofocus.d.ts.map +1 -1
- package/esm/@ui/UiFocusManager/UiAutofocus.js +4 -4
- package/esm/@ui/UiFocusManager/UiAutofocus.js.map +1 -1
- package/esm/@ui/UiFocusManager/UiFocusManager.d.ts +2 -1
- package/esm/@ui/UiFocusManager/UiFocusManager.d.ts.map +1 -1
- package/esm/@ui/UiFocusManager/UiFocusManager.js +2 -2
- package/esm/@ui/UiFocusManager/UiFocusManager.js.map +1 -1
- package/esm/@ui/UiFocusManager/UiFocusTrap.d.ts +2 -1
- package/esm/@ui/UiFocusManager/UiFocusTrap.d.ts.map +1 -1
- package/esm/@ui/UiFocusManager/UiFocusTrap.js +5 -5
- package/esm/@ui/UiFocusManager/UiFocusTrap.js.map +1 -1
- package/esm/@ui/UiFocusManager/utils.d.ts +9 -1
- package/esm/@ui/UiFocusManager/utils.d.ts.map +1 -1
- package/esm/@ui/UiFocusManager/utils.js +14 -2
- package/esm/@ui/UiFocusManager/utils.js.map +1 -1
- package/esm/@ui/UiIcon/icons.d.ts.map +1 -1
- package/esm/@ui/UiIcon/icons.js +8 -0
- package/esm/@ui/UiIcon/icons.js.map +1 -1
- package/esm/@ui/UiIconButton/UiIconButtonRenderer.d.ts +1 -0
- package/esm/@ui/UiIconButton/UiIconButtonRenderer.d.ts.map +1 -1
- package/esm/@ui/UiIconButton/UiIconButtonRenderer.js +2 -2
- package/esm/@ui/UiIconButton/UiIconButtonRenderer.js.map +1 -1
- package/esm/@ui/UiTooltip/UiTooltip.d.ts.map +1 -1
- package/esm/@ui/UiTooltip/UiTooltip.js +6 -1
- package/esm/@ui/UiTooltip/UiTooltip.js.map +1 -1
- package/esm/@ui/UiTooltip/types.d.ts +2 -0
- package/esm/@ui/UiTooltip/types.d.ts.map +1 -1
- package/esm/@ui/UiTreeview/UITreeviewItem.d.ts +4 -1
- package/esm/@ui/UiTreeview/UITreeviewItem.d.ts.map +1 -1
- package/esm/@ui/UiTreeview/UITreeviewItem.js +22 -21
- package/esm/@ui/UiTreeview/UITreeviewItem.js.map +1 -1
- package/esm/@ui/UiTreeview/UiTreeview.d.ts.map +1 -1
- package/esm/@ui/UiTreeview/UiTreeview.js +21 -20
- package/esm/@ui/UiTreeview/UiTreeview.js.map +1 -1
- package/esm/@ui/UiTreeview/UiTreeviewRoot.d.ts +3 -3
- package/esm/@ui/UiTreeview/UiTreeviewRoot.d.ts.map +1 -1
- package/esm/@ui/UiTreeview/UiTreeviewRoot.js +2 -2
- package/esm/@ui/UiTreeview/UiTreeviewRoot.js.map +1 -1
- package/esm/@ui/UiTreeview/defaults/DefaultUiTreeViewItemComponent.d.ts +1 -1
- package/esm/@ui/UiTreeview/defaults/DefaultUiTreeViewItemComponent.d.ts.map +1 -1
- package/esm/@ui/UiTreeview/defaults/DefaultUiTreeViewItemComponent.js +11 -2
- package/esm/@ui/UiTreeview/defaults/DefaultUiTreeViewItemComponent.js.map +1 -1
- package/esm/@ui/UiTreeview/types.d.ts +18 -11
- package/esm/@ui/UiTreeview/types.d.ts.map +1 -1
- package/esm/@ui/UiTreeview/utils.d.ts +14 -4
- package/esm/@ui/UiTreeview/utils.d.ts.map +1 -1
- package/esm/@ui/UiTreeview/utils.js +58 -22
- package/esm/@ui/UiTreeview/utils.js.map +1 -1
- package/esm/AutoSize/AutoSize.d.ts +2 -13
- package/esm/AutoSize/AutoSize.d.ts.map +1 -1
- package/esm/AutoSize/AutoSize.js +21 -24
- package/esm/AutoSize/AutoSize.js.map +1 -1
- package/esm/Bubble/Bubble.d.ts +1 -30
- package/esm/Bubble/Bubble.d.ts.map +1 -1
- package/esm/Bubble/Bubble.js +79 -82
- package/esm/Bubble/Bubble.js.map +1 -1
- package/esm/Button/Button.d.ts.map +1 -1
- package/esm/Button/Button.js +10 -2
- package/esm/Button/Button.js.map +1 -1
- package/esm/Button/typings.d.ts +1 -0
- package/esm/Button/typings.d.ts.map +1 -1
- package/esm/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/esm/ColorPicker/ColorPicker.js +29 -39
- package/esm/ColorPicker/ColorPicker.js.map +1 -1
- package/esm/ColorPicker/components/ColorPickerMatrix.d.ts +2 -4
- package/esm/ColorPicker/components/ColorPickerMatrix.d.ts.map +1 -1
- package/esm/ColorPicker/components/ColorPickerMatrix.js +23 -21
- package/esm/ColorPicker/components/ColorPickerMatrix.js.map +1 -1
- package/esm/ColorPicker/components/ColorsPreview.d.ts +2 -5
- package/esm/ColorPicker/components/ColorsPreview.d.ts.map +1 -1
- package/esm/ColorPicker/components/ColorsPreview.js +12 -20
- package/esm/ColorPicker/components/ColorsPreview.js.map +1 -1
- package/esm/ColorPicker/components/HexColorInput.d.ts +2 -6
- package/esm/ColorPicker/components/HexColorInput.d.ts.map +1 -1
- package/esm/ColorPicker/components/HexColorInput.js +12 -17
- package/esm/ColorPicker/components/HexColorInput.js.map +1 -1
- package/esm/ColorPicker/components/HueColorPicker.d.ts +2 -14
- package/esm/ColorPicker/components/HueColorPicker.d.ts.map +1 -1
- package/esm/ColorPicker/components/HueColorPicker.js +38 -46
- package/esm/ColorPicker/components/HueColorPicker.js.map +1 -1
- package/esm/Dialog/ConfirmDialog.d.ts +2 -4
- package/esm/Dialog/ConfirmDialog.d.ts.map +1 -1
- package/esm/Dialog/ConfirmDialog.js +9 -12
- package/esm/Dialog/ConfirmDialog.js.map +1 -1
- package/esm/Dialog/ConfirmDialogBase.d.ts.map +1 -1
- package/esm/Dialog/ConfirmDialogBase.js +1 -1
- package/esm/Dialog/ConfirmDialogBase.js.map +1 -1
- package/esm/Dialog/DialogBase.d.ts.map +1 -1
- package/esm/Dialog/DialogBase.js +3 -2
- package/esm/Dialog/DialogBase.js.map +1 -1
- package/esm/Dialog/ShareDialog/ShareDialogBase/AddGranteeButton.d.ts.map +1 -1
- package/esm/Dialog/ShareDialog/ShareDialogBase/AddGranteeButton.js +5 -6
- package/esm/Dialog/ShareDialog/ShareDialogBase/AddGranteeButton.js.map +1 -1
- package/esm/Dialog/typings.d.ts +5 -0
- package/esm/Dialog/typings.d.ts.map +1 -1
- package/esm/Dropdown/Dropdown.d.ts +1 -1
- package/esm/Dropdown/Dropdown.d.ts.map +1 -1
- package/esm/Dropdown/Dropdown.js.map +1 -1
- package/esm/FilterLabel/FilterLabel.d.ts.map +1 -1
- package/esm/FilterLabel/FilterLabel.js +41 -60
- package/esm/FilterLabel/FilterLabel.js.map +1 -1
- package/esm/FlexDimensions/FlexDimensions.js +1 -1
- package/esm/Form/Checkbox.d.ts +8 -20
- package/esm/Form/Checkbox.d.ts.map +1 -1
- package/esm/Form/Checkbox.js +15 -27
- package/esm/Form/Checkbox.js.map +1 -1
- package/esm/Form/InputPure.d.ts +20 -20
- package/esm/Form/InputPure.d.ts.map +1 -1
- package/esm/Form/InputPure.js +1 -1
- package/esm/Form/InputPure.js.map +1 -1
- package/esm/Header/Header.d.ts.map +1 -1
- package/esm/Header/Header.js +262 -219
- package/esm/Header/Header.js.map +1 -1
- package/esm/Header/HeaderMenu.d.ts +1 -3
- package/esm/Header/HeaderMenu.d.ts.map +1 -1
- package/esm/Header/HeaderMenu.js +19 -25
- package/esm/Header/HeaderMenu.js.map +1 -1
- package/esm/List/InsightListItem.d.ts +1 -14
- package/esm/List/InsightListItem.d.ts.map +1 -1
- package/esm/List/InsightListItem.js +34 -41
- package/esm/List/InsightListItem.js.map +1 -1
- package/esm/List/InvertableSelect/InvertableSelectSelectionStatus.d.ts.map +1 -1
- package/esm/List/InvertableSelect/InvertableSelectSelectionStatus.js +5 -4
- package/esm/List/InvertableSelect/InvertableSelectSelectionStatus.js.map +1 -1
- package/esm/List/InvertableSelect/InvertableSelectVirtualised.d.ts.map +1 -1
- package/esm/List/InvertableSelect/InvertableSelectVirtualised.js +11 -6
- package/esm/List/InvertableSelect/InvertableSelectVirtualised.js.map +1 -1
- package/esm/List/LegacyInvertableList.d.ts +3 -74
- package/esm/List/LegacyInvertableList.d.ts.map +1 -1
- package/esm/List/LegacyInvertableList.js +189 -169
- package/esm/List/LegacyInvertableList.js.map +1 -1
- package/esm/List/LegacyList.d.ts +2 -16
- package/esm/List/LegacyList.d.ts.map +1 -1
- package/esm/List/LegacyList.js +40 -65
- package/esm/List/LegacyList.js.map +1 -1
- package/esm/List/LegacyListItem.d.ts +2 -7
- package/esm/List/LegacyListItem.d.ts.map +1 -1
- package/esm/List/LegacyListItem.js +11 -17
- package/esm/List/LegacyListItem.js.map +1 -1
- package/esm/List/LegacyMultiSelectList.d.ts +1 -47
- package/esm/List/LegacyMultiSelectList.d.ts.map +1 -1
- package/esm/List/LegacyMultiSelectList.js +78 -108
- package/esm/List/LegacyMultiSelectList.js.map +1 -1
- package/esm/List/LegacyMultiSelectListItem.d.ts +2 -20
- package/esm/List/LegacyMultiSelectListItem.d.ts.map +1 -1
- package/esm/List/LegacyMultiSelectListItem.js +29 -49
- package/esm/List/LegacyMultiSelectListItem.js.map +1 -1
- package/esm/List/LegacySingleSelectList.d.ts +2 -27
- package/esm/List/LegacySingleSelectList.d.ts.map +1 -1
- package/esm/List/LegacySingleSelectList.js +32 -45
- package/esm/List/LegacySingleSelectList.js.map +1 -1
- package/esm/List/LegacySingleSelectListItem.d.ts +2 -21
- package/esm/List/LegacySingleSelectListItem.d.ts.map +1 -1
- package/esm/List/LegacySingleSelectListItem.js +37 -52
- package/esm/List/LegacySingleSelectListItem.js.map +1 -1
- package/esm/List/MultiSelectList.d.ts.map +1 -1
- package/esm/List/MultiSelectList.js +51 -53
- package/esm/List/MultiSelectList.js.map +1 -1
- package/esm/List/MultiSelectListItem.d.ts +2 -6
- package/esm/List/MultiSelectListItem.d.ts.map +1 -1
- package/esm/List/MultiSelectListItem.js +19 -23
- package/esm/List/MultiSelectListItem.js.map +1 -1
- package/esm/Menu/ControlledMenu.d.ts +1 -9
- package/esm/Menu/ControlledMenu.d.ts.map +1 -1
- package/esm/Menu/ControlledMenu.js +21 -33
- package/esm/Menu/ControlledMenu.js.map +1 -1
- package/esm/Menu/MenuState.d.ts +1 -9
- package/esm/Menu/MenuState.d.ts.map +1 -1
- package/esm/Menu/MenuState.js +19 -28
- package/esm/Menu/MenuState.js.map +1 -1
- package/esm/Menu/menuOpener/MenuOpenedByClick.d.ts.map +1 -1
- package/esm/Menu/menuOpener/MenuOpenedByClick.js +6 -5
- package/esm/Menu/menuOpener/MenuOpenedByClick.js.map +1 -1
- package/esm/Menu/menuOpener/MenuOpenedByHover.d.ts +1 -9
- package/esm/Menu/menuOpener/MenuOpenedByHover.d.ts.map +1 -1
- package/esm/Menu/menuOpener/MenuOpenedByHover.js +28 -28
- package/esm/Menu/menuOpener/MenuOpenedByHover.js.map +1 -1
- package/esm/Menu/menuOpener/MenuOpener.d.ts +1 -5
- package/esm/Menu/menuOpener/MenuOpener.d.ts.map +1 -1
- package/esm/Menu/menuOpener/MenuOpener.js +26 -17
- package/esm/Menu/menuOpener/MenuOpener.js.map +1 -1
- package/esm/Menu/positioning/MenuPosition.d.ts +1 -13
- package/esm/Menu/positioning/MenuPosition.d.ts.map +1 -1
- package/esm/Menu/positioning/MenuPosition.js +17 -26
- package/esm/Menu/positioning/MenuPosition.js.map +1 -1
- package/esm/Menu/positioning/PositionedMenuContent.d.ts +1 -11
- package/esm/Menu/positioning/PositionedMenuContent.d.ts.map +1 -1
- package/esm/Menu/positioning/PositionedMenuContent.js +47 -48
- package/esm/Menu/positioning/PositionedMenuContent.js.map +1 -1
- package/esm/Menu/utils/OutsideClickHandler.d.ts +1 -13
- package/esm/Menu/utils/OutsideClickHandler.d.ts.map +1 -1
- package/esm/Menu/utils/OutsideClickHandler.js +23 -37
- package/esm/Menu/utils/OutsideClickHandler.js.map +1 -1
- package/esm/Menu/utils/RenderChildrenInPortal.d.ts +1 -7
- package/esm/Menu/utils/RenderChildrenInPortal.d.ts.map +1 -1
- package/esm/Menu/utils/RenderChildrenInPortal.js +20 -19
- package/esm/Menu/utils/RenderChildrenInPortal.js.map +1 -1
- package/esm/Messages/Messages.d.ts +7 -1
- package/esm/Messages/Messages.d.ts.map +1 -1
- package/esm/Messages/Messages.js +31 -3
- package/esm/Messages/Messages.js.map +1 -1
- package/esm/Messages/ToastMessages.d.ts.map +1 -1
- package/esm/Messages/ToastMessages.js +7 -6
- package/esm/Messages/ToastMessages.js.map +1 -1
- package/esm/Messages/typings.d.ts +5 -0
- package/esm/Messages/typings.d.ts.map +1 -1
- package/esm/Messages/typings.js +1 -1
- package/esm/Overlay/ErrorOverlay.d.ts +1 -3
- package/esm/Overlay/ErrorOverlay.d.ts.map +1 -1
- package/esm/Overlay/ErrorOverlay.js +9 -11
- package/esm/Overlay/ErrorOverlay.js.map +1 -1
- package/esm/RecurrenceForm/DateTime.d.ts.map +1 -1
- package/esm/RecurrenceForm/DateTime.js +37 -23
- package/esm/RecurrenceForm/DateTime.js.map +1 -1
- package/esm/ResponsiveText/ResponsiveText.d.ts +1 -0
- package/esm/ResponsiveText/ResponsiveText.d.ts.map +1 -1
- package/esm/ResponsiveText/ResponsiveText.js +3 -3
- package/esm/ResponsiveText/ResponsiveText.js.map +1 -1
- package/esm/ShortenedText/ShortenedText.js +1 -1
- package/esm/Spinner/Spinner.d.ts +2 -8
- package/esm/Spinner/Spinner.d.ts.map +1 -1
- package/esm/Spinner/Spinner.js +13 -19
- package/esm/Spinner/Spinner.js.map +1 -1
- package/esm/Tabs/Tabs.d.ts +2 -14
- package/esm/Tabs/Tabs.d.ts.map +1 -1
- package/esm/Tabs/Tabs.js +31 -43
- package/esm/Tabs/Tabs.js.map +1 -1
- package/esm/TextAreaWithSubmit/TextAreaWithSubmit.d.ts +3 -46
- package/esm/TextAreaWithSubmit/TextAreaWithSubmit.d.ts.map +1 -1
- package/esm/TextAreaWithSubmit/TextAreaWithSubmit.js +100 -133
- package/esm/TextAreaWithSubmit/TextAreaWithSubmit.js.map +1 -1
- package/esm/Timepicker/Timepicker.d.ts +3 -29
- package/esm/Timepicker/Timepicker.d.ts.map +1 -1
- package/esm/Timepicker/Timepicker.js +79 -102
- package/esm/Timepicker/Timepicker.js.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/CustomFormatDialog.d.ts +1 -11
- package/esm/measureNumberFormat/customFormatDialog/CustomFormatDialog.d.ts.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/CustomFormatDialog.js +28 -37
- package/esm/measureNumberFormat/customFormatDialog/CustomFormatDialog.js.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/FormatInput.d.ts.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/FormatInput.js +12 -14
- package/esm/measureNumberFormat/customFormatDialog/FormatInput.js.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/formatTemplatesDropdown/DropdownItem.d.ts +2 -12
- package/esm/measureNumberFormat/customFormatDialog/formatTemplatesDropdown/DropdownItem.d.ts.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/formatTemplatesDropdown/DropdownItem.js +21 -28
- package/esm/measureNumberFormat/customFormatDialog/formatTemplatesDropdown/DropdownItem.js.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/formatTemplatesDropdown/FormatTemplatesDropdown.d.ts +1 -13
- package/esm/measureNumberFormat/customFormatDialog/formatTemplatesDropdown/FormatTemplatesDropdown.d.ts.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/formatTemplatesDropdown/FormatTemplatesDropdown.js +20 -26
- package/esm/measureNumberFormat/customFormatDialog/formatTemplatesDropdown/FormatTemplatesDropdown.js.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/previewSection/ExtendedPreview.d.ts +1 -8
- package/esm/measureNumberFormat/customFormatDialog/previewSection/ExtendedPreview.d.ts.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/previewSection/ExtendedPreview.js +16 -22
- package/esm/measureNumberFormat/customFormatDialog/previewSection/ExtendedPreview.js.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/previewSection/Preview.d.ts +1 -8
- package/esm/measureNumberFormat/customFormatDialog/previewSection/Preview.d.ts.map +1 -1
- package/esm/measureNumberFormat/customFormatDialog/previewSection/Preview.js +15 -19
- package/esm/measureNumberFormat/customFormatDialog/previewSection/Preview.js.map +1 -1
- package/esm/measureNumberFormat/presetsDropdown/PresetsDropdown.d.ts +1 -6
- package/esm/measureNumberFormat/presetsDropdown/PresetsDropdown.d.ts.map +1 -1
- package/esm/measureNumberFormat/presetsDropdown/PresetsDropdown.js +19 -25
- package/esm/measureNumberFormat/presetsDropdown/PresetsDropdown.js.map +1 -1
- package/esm/measureNumberFormat/presetsDropdown/PresetsDropdownItem.d.ts +1 -5
- package/esm/measureNumberFormat/presetsDropdown/PresetsDropdownItem.d.ts.map +1 -1
- package/esm/measureNumberFormat/presetsDropdown/PresetsDropdownItem.js +13 -20
- package/esm/measureNumberFormat/presetsDropdown/PresetsDropdownItem.js.map +1 -1
- package/esm/sdk-ui-kit.d.ts +102 -264
- package/esm/typings/accessibility.d.ts +2 -1
- package/esm/typings/accessibility.d.ts.map +1 -1
- package/esm/utils/domUtilities.d.ts +2 -2
- package/esm/utils/domUtilities.d.ts.map +1 -1
- package/esm/utils/domUtilities.js +28 -4
- package/esm/utils/domUtilities.js.map +1 -1
- package/package.json +8 -8
- package/src/@ui/UiAsyncTable/asyncTable.scss +19 -2
- package/src/@ui/themeColorsMap.scss +1 -0
- package/styles/css/invertableSelect.css +13 -0
- package/styles/css/invertableSelect.css.map +1 -1
- package/styles/css/main.css +33 -1
- package/styles/css/main.css.map +1 -1
- package/styles/scss/invertableSelect.scss +15 -0
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableFilter.d.ts +0 -7
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableFilter.d.ts.map +0 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableFilter.js +0 -32
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableFilter.js.map +0 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableRow.d.ts +0 -6
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableRow.d.ts.map +0 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableRow.js +0 -86
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableRow.js.map +0 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableToolbar.d.ts +0 -6
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableToolbar.d.ts.map +0 -1
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableToolbar.js +0 -72
- package/esm/@ui/UiAsyncTable/UiAsyncTable/AsyncTableToolbar.js.map +0 -1
package/esm/Bubble/Bubble.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
// (C) 2020-2025 GoodData Corporation
|
2
|
-
import React from "react";
|
2
|
+
import React, { memo, useState, useMemo, useCallback } from "react";
|
3
3
|
import keys from "lodash/keys.js";
|
4
4
|
import cloneDeep from "lodash/cloneDeep.js";
|
5
|
-
import isEqual from "lodash/isEqual.js";
|
6
5
|
import isReactEqual from "react-fast-compare";
|
7
6
|
import result from "lodash/result.js";
|
8
7
|
import noop from "lodash/noop.js";
|
@@ -36,92 +35,90 @@ const ARROW_OFFSETS = {
|
|
36
35
|
".. bl": [-Y_SHIFT, -X_SHIFT],
|
37
36
|
".. br": [Y_SHIFT, -X_SHIFT],
|
38
37
|
};
|
38
|
+
const defaultProps = {
|
39
|
+
alignPoints: [
|
40
|
+
{
|
41
|
+
align: "bl tl",
|
42
|
+
},
|
43
|
+
],
|
44
|
+
alignTo: "body",
|
45
|
+
arrowOffsets: {},
|
46
|
+
arrowDirections: {},
|
47
|
+
arrowStyle: {},
|
48
|
+
className: "bubble-primary",
|
49
|
+
closeOnOutsideClick: false,
|
50
|
+
closeOnParentScroll: true,
|
51
|
+
closeOnEscape: false,
|
52
|
+
onClose: noop,
|
53
|
+
onMouseEnter: noop,
|
54
|
+
onMouseLeave: noop,
|
55
|
+
overlayClassName: "",
|
56
|
+
};
|
39
57
|
/**
|
40
58
|
* @internal
|
41
59
|
*/
|
42
|
-
export
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
className: "bubble-primary",
|
54
|
-
closeOnOutsideClick: false,
|
55
|
-
closeOnParentScroll: true,
|
56
|
-
closeOnEscape: false,
|
57
|
-
onClose: noop,
|
58
|
-
onMouseEnter: noop,
|
59
|
-
onMouseLeave: noop,
|
60
|
-
overlayClassName: "",
|
61
|
-
};
|
62
|
-
// identifier for BubbleTrigger
|
63
|
-
static identifier = "Bubble";
|
64
|
-
arrowOffsets;
|
65
|
-
arrowDirections;
|
66
|
-
constructor(props) {
|
67
|
-
super(props);
|
68
|
-
this.arrowOffsets = { ...props.arrowOffsets, ...ARROW_OFFSETS };
|
69
|
-
this.arrowDirections = { ...props.arrowDirections, ...ARROW_DIRECTIONS };
|
70
|
-
const alignPoints = this.addOffsetToAlignPoints(cloneDeep(props.alignPoints));
|
71
|
-
this.state = {
|
72
|
-
alignPoints,
|
73
|
-
optimalAlignPoints: props.alignPoints[0].align,
|
74
|
-
};
|
75
|
-
}
|
76
|
-
shouldComponentUpdate(nextProps, nextState) {
|
77
|
-
const propsChanged = !isReactEqual(this.props, nextProps);
|
78
|
-
const alignmentChanged = !isEqual(this.state.optimalAlignPoints, nextState.optimalAlignPoints);
|
79
|
-
return propsChanged || alignmentChanged;
|
80
|
-
}
|
81
|
-
onAlign = (alignment) => {
|
82
|
-
this.setState({ optimalAlignPoints: alignment.align });
|
83
|
-
};
|
84
|
-
getClassnames() {
|
85
|
-
return cx({
|
86
|
-
[this.props.className]: !!this.props.className,
|
87
|
-
[this.getArrowsClassname(this.state.optimalAlignPoints)]: true,
|
88
|
-
"gd-bubble": true,
|
89
|
-
bubble: true,
|
90
|
-
});
|
91
|
-
}
|
92
|
-
getArrowsClassname(alignPoints) {
|
93
|
-
const myAlignPoint = alignPoints.split(" ")[1];
|
94
|
-
const direction = this.getArrowDirection(alignPoints);
|
95
|
-
return `arrow-${direction}-direction arrow-${myAlignPoint}`;
|
96
|
-
}
|
97
|
-
getArrowDirection(alignPoints) {
|
98
|
-
const key = keys(this.arrowDirections).find((arrowDirection) => alignPoints.match(arrowDirection));
|
99
|
-
return this.arrowDirections[key] || "none";
|
100
|
-
}
|
101
|
-
addOffsetToAlignPoints(alignPoints) {
|
102
|
-
const { arrowOffsets } = this;
|
60
|
+
export const Bubble = memo(function Bubble(props) {
|
61
|
+
const { id, alignPoints: alignPointsProp, alignTo, arrowOffsets: arrowOffsetsProp, arrowDirections: arrowDirectionsProp, arrowStyle: arrowStyleProp, className, closeOnOutsideClick, closeOnParentScroll, closeOnEscape, ignoreClicksOn, ignoreClicksOnByClass, onClose, onMouseEnter, onMouseLeave, onKeyDown, overlayClassName, children, overlayPositionType, ensureVisibility, } = { ...defaultProps, ...props };
|
62
|
+
const arrowOffsets = useMemo(() => ({
|
63
|
+
...arrowOffsetsProp,
|
64
|
+
...ARROW_OFFSETS,
|
65
|
+
}), [arrowOffsetsProp]);
|
66
|
+
const arrowDirections = useMemo(() => ({
|
67
|
+
...arrowDirectionsProp,
|
68
|
+
...ARROW_DIRECTIONS,
|
69
|
+
}), [arrowDirectionsProp]);
|
70
|
+
const addOffsetToAlignPoints = useCallback((alignPoints) => {
|
103
71
|
const arrowOffsetsKeys = keys(arrowOffsets);
|
104
72
|
const getKey = (align, re) => {
|
105
73
|
return align.match(re) !== null;
|
106
74
|
};
|
107
75
|
return alignPoints.map((item) => {
|
108
|
-
const key = arrowOffsetsKeys.find(getKey.bind(
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
76
|
+
const key = arrowOffsetsKeys.find(getKey.bind(null, item.align));
|
77
|
+
const existingOffset = item.offset || { x: 0, y: 0 };
|
78
|
+
return {
|
79
|
+
...item,
|
80
|
+
offset: {
|
81
|
+
x: existingOffset.x + arrowOffsets[key][0],
|
82
|
+
y: existingOffset.y + arrowOffsets[key][1],
|
83
|
+
},
|
84
|
+
};
|
85
|
+
});
|
86
|
+
}, [arrowOffsets]);
|
87
|
+
const initialAlignPoints = useMemo(() => addOffsetToAlignPoints(cloneDeep(alignPointsProp)), [addOffsetToAlignPoints, alignPointsProp]);
|
88
|
+
const [alignPoints] = useState(initialAlignPoints);
|
89
|
+
const [optimalAlignPoints, setOptimalAlignPoints] = useState(alignPointsProp[0].align);
|
90
|
+
const onAlign = useCallback((alignment) => {
|
91
|
+
setOptimalAlignPoints(alignment.align);
|
92
|
+
}, []);
|
93
|
+
const getArrowDirection = useCallback((alignPoints) => {
|
94
|
+
const key = keys(arrowDirections).find((arrowDirection) => alignPoints.match(arrowDirection));
|
95
|
+
return arrowDirections[key] || "none";
|
96
|
+
}, [arrowDirections]);
|
97
|
+
const getArrowsClassname = useCallback((alignPoints) => {
|
98
|
+
const myAlignPoint = alignPoints.split(" ")[1];
|
99
|
+
const direction = getArrowDirection(alignPoints);
|
100
|
+
return `arrow-${direction}-direction arrow-${myAlignPoint}`;
|
101
|
+
}, [getArrowDirection]);
|
102
|
+
const classNames = useMemo(() => {
|
103
|
+
return cx({
|
104
|
+
[className]: !!className,
|
105
|
+
[getArrowsClassname(optimalAlignPoints)]: true,
|
106
|
+
"gd-bubble": true,
|
107
|
+
bubble: true,
|
108
|
+
});
|
109
|
+
}, [className, getArrowsClassname, optimalAlignPoints]);
|
110
|
+
const arrowStyle = useMemo(() => result({ arrowStyle: arrowStyleProp }, "arrowStyle", {}), [arrowStyleProp]);
|
111
|
+
return (React.createElement(ZoomAwareOverlay, { id: id, className: overlayClassName, alignTo: alignTo, onAlign: onAlign, alignPoints: alignPoints, closeOnParentScroll: closeOnParentScroll, closeOnMouseDrag: true, closeOnOutsideClick: closeOnOutsideClick, ignoreClicksOn: ignoreClicksOn, ignoreClicksOnByClass: ignoreClicksOnByClass, onClose: onClose, closeOnEscape: closeOnEscape, positionType: overlayPositionType, ensureVisibility: ensureVisibility },
|
112
|
+
React.createElement("div", { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onKeyDown: onKeyDown, className: classNames },
|
113
|
+
React.createElement("div", { className: "bubble-content" },
|
114
|
+
React.createElement("div", { className: "helper" }),
|
115
|
+
React.createElement("div", { className: "arrow-position", style: arrowStyle },
|
116
|
+
React.createElement("div", { className: "arrow-border" }),
|
117
|
+
React.createElement("div", { className: "arrow" })),
|
118
|
+
React.createElement("div", { className: "content" }, children)))));
|
119
|
+
}, (prevProps, nextProps) => {
|
120
|
+
return isReactEqual(prevProps, nextProps);
|
121
|
+
});
|
122
|
+
// identifier for BubbleTrigger
|
123
|
+
Bubble.identifier = "Bubble";
|
127
124
|
//# sourceMappingURL=Bubble.js.map
|
package/esm/Bubble/Bubble.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Bubble.js","sourceRoot":"","sources":["../../src/Bubble/Bubble.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"Bubble.js","sourceRoot":"","sources":["../../src/Bubble/Bubble.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,SAAS,MAAM,qBAAqB,CAAC;AAC5C,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,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xB,mBAAmB,EAAE,mBAAmB,EACxC,gBAAgB,QAChB,mBAAmB,EAAE,mBAAmB,EACxC,cAAc,EAAE,cAAc,EAC9B,qBAAqB,EAAE,qBAAqB,EAC5C,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,mBAAmB,EACjC,gBAAgB,EAAE,gBAAgB;QAElC,6BACI,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,UAAU;YAErB,6BAAK,SAAS,EAAC,gBAAgB;gBAC3B,6BAAK,SAAS,EAAC,QAAQ,GAAG;gBAC1B,6BAAK,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAE,UAAU;oBAC7C,6BAAK,SAAS,EAAC,cAAc,GAAG;oBAChC,6BAAK,SAAS,EAAC,OAAO,GAAG,CACvB;gBACN,6BAAK,SAAS,EAAC,SAAS,IAAE,QAAQ,CAAO,CACvC,CACJ,CACS,CACtB,CAAC;AACN,CAAC,EACD,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IACrB,OAAO,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAC9C,CAAC,CACJ,CAAC;AAEF,+BAA+B;AAC9B,MAAc,CAAC,UAAU,GAAG,QAAQ,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAkB5C;;GAEG;AACH,eAAO,MAAM,MAAM,kFA4GjB,CAAC"}
|
package/esm/Button/Button.js
CHANGED
@@ -3,6 +3,7 @@ import React from "react";
|
|
3
3
|
import cx from "classnames";
|
4
4
|
import { stringUtils } from "@gooddata/util";
|
5
5
|
import noop from "lodash/noop.js";
|
6
|
+
import { ValidationContextStore } from "@gooddata/sdk-ui";
|
6
7
|
const getGeneratedTestId = (effectiveValue, title, ariaLabel) => {
|
7
8
|
if (effectiveValue && typeof effectiveValue === "string") {
|
8
9
|
return `${stringUtils.simplifyText(effectiveValue)}`;
|
@@ -18,8 +19,8 @@ const Icon = ({ icon }) => {
|
|
18
19
|
/**
|
19
20
|
* @internal
|
20
21
|
*/
|
21
|
-
export const Button = React.forwardRef(function Button({ className, disabled = false, onClick = noop, tabIndex = 0, tagName = "button", type = "button", id, title, iconLeft, iconRight, accessibilityConfig, dataId, dataTestId, intent, size, variant, value, children, }, ref) {
|
22
|
-
const { isExpanded, popupId, ariaLabel, ariaLabelledBy, ariaDescribedBy, popupType, role = "button", } = accessibilityConfig ?? {};
|
22
|
+
export const Button = React.forwardRef(function Button({ className, describedByFromValidation: isDescribedByFromValidation = false, disabled = false, onClick = noop, tabIndex = 0, tagName = "button", type = "button", id, title, iconLeft, iconRight, accessibilityConfig, dataId, dataTestId, intent, size, variant, value, children, }, ref) {
|
23
|
+
const { isExpanded, popupId, ariaLabel, ariaLabelledBy, ariaDescribedBy: ariaDescribedByFromConfig, popupType, role = "button", } = accessibilityConfig ?? {};
|
23
24
|
const ariaDropdownProps = {
|
24
25
|
...(popupId && isExpanded ? { "aria-controls": popupId } : {}),
|
25
26
|
...(popupId ? { "aria-haspopup": popupType ?? !!popupId } : {}),
|
@@ -31,6 +32,13 @@ export const Button = React.forwardRef(function Button({ className, disabled = f
|
|
31
32
|
}
|
32
33
|
onClick(e);
|
33
34
|
}, [disabled, onClick]);
|
35
|
+
const describedByFromValidation = ValidationContextStore.useContextStoreOptional((ctx) => ctx
|
36
|
+
.getInvalidDatapoints({ recursive: true })
|
37
|
+
.map((datapoint) => datapoint.id)
|
38
|
+
.join(" "));
|
39
|
+
const ariaDescribedBy = isDescribedByFromValidation
|
40
|
+
? `${describedByFromValidation ?? ""} ${ariaDescribedByFromConfig ?? ""}`
|
41
|
+
: ariaDescribedByFromConfig;
|
34
42
|
const effectiveValue = React.useMemo(() => value ?? children, [children, value]);
|
35
43
|
const testId = dataTestId ? dataTestId : getGeneratedTestId(effectiveValue, title, ariaLabel);
|
36
44
|
const classNames = React.useMemo(() => {
|
package/esm/Button/Button.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,IAAI,MAAM,gBAAgB,CAAC;
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,kBAAkB,GAAG,CAAC,cAA+B,EAAE,KAAa,EAAE,SAAiB,EAAE,EAAE;IAC7F,IAAI,cAAc,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE,CAAC;QACvD,OAAO,GAAG,WAAW,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE,CAAC;IACzD,CAAC;IACD,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,YAAY,CAA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C,EAAE,OAAO,CAAC;CACvC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../src/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AACA,OAAO,
|
1
|
+
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../src/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAc,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAU/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAgEjD;;GAEG;AACH,eAAO,MAAM,WAAW;;CAAiC,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
// (C) 2007-
|
2
|
-
import React, {
|
1
|
+
// (C) 2007-2025 GoodData Corporation
|
2
|
+
import React, { useState, useCallback } from "react";
|
3
3
|
import isEqual from "lodash/isEqual.js";
|
4
4
|
import { injectIntl } from "react-intl";
|
5
5
|
import { Button } from "../Button/index.js";
|
@@ -8,47 +8,37 @@ import { HexColorInput } from "./components/HexColorInput.js";
|
|
8
8
|
import { HueColorPicker } from "./components/HueColorPicker.js";
|
9
9
|
import { ColorsPreview } from "./components/ColorsPreview.js";
|
10
10
|
import { getRgbFromHslColor, getHslFromRgbColor, isHslColorBlackOrWhite } from "./utils.js";
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
this.onColorSelected = this.onColorSelected.bind(this);
|
19
|
-
this.onHexInputColorSelected = this.onHexInputColorSelected.bind(this);
|
20
|
-
}
|
21
|
-
onColorSelected(selectedColor) {
|
22
|
-
this.setState({
|
23
|
-
draftHslColor: selectedColor,
|
24
|
-
});
|
25
|
-
}
|
26
|
-
onHexInputColorSelected(selectedColor) {
|
11
|
+
function WrappedColorPicker(props) {
|
12
|
+
const currentHslColor = getHslFromRgbColor(props.initialRgbColor);
|
13
|
+
const [draftHslColor, setDraftHslColor] = useState(currentHslColor);
|
14
|
+
const onColorSelected = useCallback((selectedColor) => {
|
15
|
+
setDraftHslColor(selectedColor);
|
16
|
+
}, []);
|
17
|
+
const onHexInputColorSelected = useCallback((selectedColor) => {
|
27
18
|
if (isHslColorBlackOrWhite(selectedColor)) {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
},
|
33
|
-
});
|
19
|
+
setDraftHslColor((prevColor) => ({
|
20
|
+
...selectedColor,
|
21
|
+
h: prevColor.h,
|
22
|
+
}));
|
34
23
|
}
|
35
24
|
else {
|
36
|
-
|
25
|
+
setDraftHslColor(selectedColor);
|
37
26
|
}
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
27
|
+
}, []);
|
28
|
+
const handleSubmit = useCallback(() => {
|
29
|
+
props.onSubmit(getRgbFromHslColor(draftHslColor));
|
30
|
+
}, [props, draftHslColor]);
|
31
|
+
const currentHslColorForPreview = getHslFromRgbColor(props.initialRgbColor);
|
32
|
+
const { intl } = props;
|
33
|
+
return (React.createElement("div", { className: "color-picker-container", "aria-label": "Color picker" },
|
34
|
+
React.createElement(ColorPickerMatrix, { initColor: draftHslColor, onColorSelected: onColorSelected }),
|
35
|
+
React.createElement("div", { className: "color-picker-control-wrapper" },
|
36
|
+
React.createElement(HueColorPicker, { initColor: draftHslColor, onChange: onColorSelected }),
|
37
|
+
React.createElement(HexColorInput, { initColor: draftHslColor, onInputChanged: onHexInputColorSelected, placeholder: intl.formatMessage({ id: "gs.color-picker.inputPlaceholder" }), label: intl.formatMessage({ id: "gs.color-picker.hex" }), key: `${draftHslColor.h}-${draftHslColor.s}-${draftHslColor.l}` }),
|
38
|
+
React.createElement(ColorsPreview, { currentHslColor: currentHslColorForPreview, draftHslColor: draftHslColor, currentTextLabel: intl.formatMessage({ id: "gs.color-picker.currentColor" }), draftTextLabel: intl.formatMessage({ id: "gs.color-picker.newColor" }) }),
|
39
|
+
React.createElement("div", { className: "color-picker-buttons-wrapper" },
|
40
|
+
React.createElement(Button, { value: intl.formatMessage({ id: "gs.color-picker.cancelButton" }), className: "gd-button-secondary gd-button color-picker-button", onClick: props.onCancel }),
|
41
|
+
React.createElement(Button, { value: intl.formatMessage({ id: "gs.color-picker.okButton" }), disabled: isEqual(props.initialRgbColor, getRgbFromHslColor(draftHslColor)), className: "gd-button-action gd-button color-picker-ok-button", onClick: handleSubmit })))));
|
52
42
|
}
|
53
43
|
/**
|
54
44
|
* @internal
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../src/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,
|
1
|
+
{"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../src/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,OAAO,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAyB,MAAM,YAAY,CAAC;AAG/D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAG5F,SAAS,kBAAkB,CAAC,KAAgD;IACxE,MAAM,eAAe,GAAG,kBAAkB,CAAC,KAA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,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,kCAAkC,EAAE,CAAC,EAC3E,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,qBAAqB,EAAE,CAAC,EACxD,GAAG,EAAE,GAAG,aAAa,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,EAAE,GACjE;YACF,oBAAC,aAAa,IACV,eAAe,EAAE,yBAAyB,EAC1C,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,8BAA8B,EAAE,CAAC,EAC5E,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,0BAA0B,EAAE,CAAC,GACxE;YACF,6BAAK,SAAS,EAAC,8BAA8B;gBACzC,oBAAC,MAAM,IACH,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,8BAA8B,EAAE,CAAC,EACjE,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,KAAK,CAAC,QAAQ,GACzB;gBACF,oBAAC,MAAM,IACH,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,EAAE,0BAA0B,EAAE,CAAC,EAC7D,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC,EAC3E,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,YAAY,GACvB,CACA,CACJ,CACJ,CACT,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC"}
|
@@ -1,10 +1,8 @@
|
|
1
|
-
import
|
1
|
+
import React from "react";
|
2
2
|
import { ColorFormats } from "tinycolor2";
|
3
3
|
export interface IColorPickerMatrixProps {
|
4
4
|
initColor: ColorFormats.HSL;
|
5
5
|
onColorSelected: (color: ColorFormats.HSL) => void;
|
6
6
|
}
|
7
|
-
export declare
|
8
|
-
render(): ReactNode;
|
9
|
-
}
|
7
|
+
export declare const ColorPickerMatrix: React.NamedExoticComponent<IColorPickerMatrixProps>;
|
10
8
|
//# sourceMappingURL=ColorPickerMatrix.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorPickerMatrix.d.ts","sourceRoot":"","sources":["../../../src/ColorPicker/components/ColorPickerMatrix.tsx"],"names":[],"mappings":"AACA,
|
1
|
+
{"version":3,"file":"ColorPickerMatrix.d.ts","sourceRoot":"","sources":["../../../src/ColorPicker/components/ColorPickerMatrix.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1C,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC;IAC5B,eAAe,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,KAAK,IAAI,CAAC;CACtD;AAED,eAAO,MAAM,iBAAiB,qDAoB5B,CAAC"}
|
@@ -1,28 +1,30 @@
|
|
1
|
-
// (C) 2007-
|
2
|
-
import React, {
|
1
|
+
// (C) 2007-2025 GoodData Corporation
|
2
|
+
import React, { memo, useCallback, useMemo } from "react";
|
3
3
|
import cx from "classnames";
|
4
4
|
import { getColorStyle, SATURATION_ARRAY } from "../utils.js";
|
5
|
-
export
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
class ColorPickerRow extends PureComponent {
|
14
|
-
getCellClassNames(hslColor) {
|
5
|
+
export const ColorPickerMatrix = memo(function ColorPickerMatrix(props) {
|
6
|
+
return (React.createElement("div", { className: "color-picker-component" },
|
7
|
+
React.createElement(ColorPickerRow, { lightness: 0.7, initColor: props.initColor, onColorSelected: props.onColorSelected }),
|
8
|
+
React.createElement(ColorPickerRow, { lightness: 0.5, initColor: props.initColor, onColorSelected: props.onColorSelected }),
|
9
|
+
React.createElement(ColorPickerRow, { lightness: 0.3, initColor: props.initColor, onColorSelected: props.onColorSelected })));
|
10
|
+
});
|
11
|
+
const ColorPickerRow = memo(function ColorPickerRow({ onColorSelected, initColor, lightness, }) {
|
12
|
+
const getCellClassNames = useCallback((hslColor) => {
|
15
13
|
return cx("color-picker-cell", `s-color-${Math.floor(hslColor.h + (hslColor.s + hslColor.l) * 100)}`);
|
16
|
-
}
|
17
|
-
|
18
|
-
|
14
|
+
}, []);
|
15
|
+
const handleColorClick = useCallback((color) => () => {
|
16
|
+
onColorSelected(color);
|
17
|
+
}, [onColorSelected]);
|
18
|
+
const colorCells = useMemo(() => {
|
19
|
+
return SATURATION_ARRAY.map((saturation) => {
|
19
20
|
const newColor = {
|
20
|
-
h:
|
21
|
+
h: initColor.h,
|
21
22
|
s: saturation,
|
22
|
-
l:
|
23
|
+
l: lightness,
|
23
24
|
};
|
24
|
-
return (React.createElement("div", { role: "color", tabIndex: -1, key:
|
25
|
-
})
|
26
|
-
}
|
27
|
-
}
|
25
|
+
return (React.createElement("div", { role: "color", tabIndex: -1, key: lightness + saturation, className: getCellClassNames(newColor), style: getColorStyle(newColor), onClick: handleColorClick(newColor) }));
|
26
|
+
});
|
27
|
+
}, [initColor.h, lightness, getCellClassNames, handleColorClick]);
|
28
|
+
return React.createElement("div", { className: "color-picker-row" }, colorCells);
|
29
|
+
});
|
28
30
|
//# sourceMappingURL=ColorPickerMatrix.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorPickerMatrix.js","sourceRoot":"","sources":["../../../src/ColorPicker/components/ColorPickerMatrix.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,
|
1
|
+
{"version":3,"file":"ColorPickerMatrix.js","sourceRoot":"","sources":["../../../src/ColorPicker/components/ColorPickerMatrix.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAA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CAAC;IAEF,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5B,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;YACvC,MAAM,QAAQ,GAAG;gBACb,CAAC,EAAE,SAAS,CAAC,CAAC;gBACd,CAAC,EAAE,UAAU;gBACb,CAAC,EAAE,SAAS;aACf,CAAC;YAEF,OAAO,CACH,6BACI,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,CAAC,CAAC,EACZ,GAAG,EAAE,SAAS,GAAG,UAAU,EAC3B,SAAS,EAAE,iBAAiB,CAAC,QAAQ,CAAC,EACtC,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,EAC9B,OAAO,EAAE,gBAAgB,CAAC,QAAQ,CAAC,GACrC,CACL,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAElE,OAAO,6BAAK,SAAS,EAAC,kBAAkB,IAAE,UAAU,CAAO,CAAC;AAChE,CAAC,CAAC,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import React from "react";
|
2
2
|
import { ColorFormats } from "tinycolor2";
|
3
3
|
export interface IColorsPreviewProps {
|
4
4
|
currentHslColor: ColorFormats.HSL;
|
@@ -6,8 +6,5 @@ export interface IColorsPreviewProps {
|
|
6
6
|
currentTextLabel?: string;
|
7
7
|
draftTextLabel?: string;
|
8
8
|
}
|
9
|
-
export declare
|
10
|
-
static defaultProps: Pick<IColorsPreviewProps, "currentTextLabel" | "draftTextLabel">;
|
11
|
-
render(): ReactNode;
|
12
|
-
}
|
9
|
+
export declare const ColorsPreview: React.NamedExoticComponent<IColorsPreviewProps>;
|
13
10
|
//# sourceMappingURL=ColorsPreview.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorsPreview.d.ts","sourceRoot":"","sources":["../../../src/ColorPicker/components/ColorsPreview.tsx"],"names":[],"mappings":"AACA,
|
1
|
+
{"version":3,"file":"ColorsPreview.d.ts","sourceRoot":"","sources":["../../../src/ColorPicker/components/ColorsPreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1C,MAAM,WAAW,mBAAmB;IAChC,eAAe,EAAE,YAAY,CAAC,GAAG,CAAC;IAClC,aAAa,EAAE,YAAY,CAAC,GAAG,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,iDAYxB,CAAC"}
|
@@ -1,22 +1,14 @@
|
|
1
|
-
// (C) 2007-
|
2
|
-
import React, {
|
1
|
+
// (C) 2007-2025 GoodData Corporation
|
2
|
+
import React, { memo } from "react";
|
3
3
|
import { getColorStyle } from "../utils.js";
|
4
|
-
export
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
15
|
-
class ColorItem extends PureComponent {
|
16
|
-
render() {
|
17
|
-
return (React.createElement("div", { className: "color-picker-value-wrapper" },
|
18
|
-
React.createElement("div", { "aria-label": this.props.id, className: `color-value s-${this.props.id}`, style: getColorStyle(this.props.hslColor) }),
|
19
|
-
React.createElement("span", null, this.props.textLabel)));
|
20
|
-
}
|
21
|
-
}
|
4
|
+
export const ColorsPreview = memo(function ColorsPreview({ currentHslColor, draftHslColor, currentTextLabel = "current", draftTextLabel = "new", }) {
|
5
|
+
return (React.createElement("div", { className: "color-picker-preview" },
|
6
|
+
React.createElement(ColorItem, { id: "current-color", hslColor: currentHslColor, textLabel: currentTextLabel }),
|
7
|
+
React.createElement(ColorItem, { id: "new-color", hslColor: draftHslColor, textLabel: draftTextLabel })));
|
8
|
+
});
|
9
|
+
const ColorItem = memo(function ColorItem({ id, hslColor, textLabel }) {
|
10
|
+
return (React.createElement("div", { className: "color-picker-value-wrapper" },
|
11
|
+
React.createElement("div", { "aria-label": id, className: `color-value s-${id}`, style: getColorStyle(hslColor) }),
|
12
|
+
React.createElement("span", null, textLabel)));
|
13
|
+
});
|
22
14
|
//# sourceMappingURL=ColorsPreview.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ColorsPreview.js","sourceRoot":"","sources":["../../../src/ColorPicker/components/ColorsPreview.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,
|
1
|
+
{"version":3,"file":"ColorsPreview.js","sourceRoot":"","sources":["../../../src/ColorPicker/components/ColorsPreview.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,EAAE,EAAE,IAAI,EAAa,MAAM,OAAO,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAS5C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,aAAa,CAAC,EACrD,eAAe,EACf,aAAa,EACb,gBAAgB,GAAG,SAAS,EAC5B,cAAc,GAAG,KAAK,GACJ;IAClB,OAAO,CACH,6BAAK,SAAS,EAAC,sBAAsB;QACjC,oBAAC,SAAS,IAAC,EAAE,EAAC,eAAe,EAAC,QAAQ,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,GAAI;QACxF,oBAAC,SAAS,IAAC,EAAE,EAAC,WAAW,EAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,GAAI,CAC9E,CACT,CAAC;AACN,CAAC,CAAC,CAAC;AAQH,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,SAAS,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAmB;IAClF,OAAO,CACH,6BAAK,SAAS,EAAC,4BAA4B;QACvC,2CAAiB,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAI;QACzF,kCAAO,SAAS,CAAQ,CACtB,CACT,CAAC;AACN,CAAC,CAAC,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import React from "react";
|
2
2
|
import { ColorFormats } from "tinycolor2";
|
3
3
|
export interface IHexColorInputProps {
|
4
4
|
initColor: ColorFormats.HSL;
|
@@ -6,9 +6,5 @@ export interface IHexColorInputProps {
|
|
6
6
|
placeholder?: string;
|
7
7
|
label?: string;
|
8
8
|
}
|
9
|
-
export declare
|
10
|
-
static defaultProps: Pick<IHexColorInputProps, "label" | "placeholder">;
|
11
|
-
onInputChange: (value: string) => void;
|
12
|
-
render(): ReactNode;
|
13
|
-
}
|
9
|
+
export declare const HexColorInput: React.NamedExoticComponent<IHexColorInputProps>;
|
14
10
|
//# sourceMappingURL=HexColorInput.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HexColorInput.d.ts","sourceRoot":"","sources":["../../../src/ColorPicker/components/HexColorInput.tsx"],"names":[],"mappings":"AACA,
|
1
|
+
{"version":3,"file":"HexColorInput.d.ts","sourceRoot":"","sources":["../../../src/ColorPicker/components/HexColorInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK1C,MAAM,WAAW,mBAAmB;IAChC,SAAS,EAAE,YAAY,CAAC,GAAG,CAAC;IAC5B,cAAc,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,aAAa,iDA0BxB,CAAC"}
|