react-science 19.10.4 → 20.0.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/lib/components/accordion/accordion.d.ts +2 -2
- package/lib/components/accordion/accordion.d.ts.map +1 -1
- package/lib/components/accordion/accordion_context_provider.d.ts +1 -1
- package/lib/components/accordion/accordion_context_provider.d.ts.map +1 -1
- package/lib/components/activity_bar/activity_bar.d.ts +2 -2
- package/lib/components/activity_bar/activity_bar.d.ts.map +1 -1
- package/lib/components/activity_bar/activity_bar.js +5 -1
- package/lib/components/activity_bar/activity_bar.js.map +1 -1
- package/lib/components/activity_panel/activity_panel.d.ts +2 -2
- package/lib/components/activity_panel/activity_panel.d.ts.map +1 -1
- package/lib/components/button/Button.d.ts +1 -1
- package/lib/components/button/Button.d.ts.map +1 -1
- package/lib/components/button/Button.js +30 -22
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts +3 -3
- package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts.map +1 -1
- package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js +2 -2
- package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js.map +1 -1
- package/lib/components/color-picker/gradient_select/gradient_select.d.ts +1 -1
- package/lib/components/color-picker/gradient_select/gradient_select.d.ts.map +1 -1
- package/lib/components/color-picker/gradient_select/gradient_select.js +1 -1
- package/lib/components/color-picker/gradient_select/gradient_select.js.map +1 -1
- package/lib/components/color-picker/preview/ColorPreview.d.ts +1 -1
- package/lib/components/color-picker/preview/ColorPreview.d.ts.map +1 -1
- package/lib/components/color-picker/preview/FixedColorPreview.d.ts +1 -1
- package/lib/components/color-picker/preview/FixedColorPreview.d.ts.map +1 -1
- package/lib/components/color-picker/preview/FixedGradientPreview.d.ts +1 -1
- package/lib/components/color-picker/preview/FixedGradientPreview.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/ColorPicker.d.ts +1 -1
- package/lib/components/color-picker/react-color/ColorPicker.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/ColorPicker.js +2 -2
- package/lib/components/color-picker/react-color/ColorPicker.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Alpha.d.ts +1 -1
- package/lib/components/color-picker/react-color/common/Alpha.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/CheckBoard.d.ts +1 -1
- package/lib/components/color-picker/react-color/common/CheckBoard.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/EditableInput.d.ts +1 -1
- package/lib/components/color-picker/react-color/common/EditableInput.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/EditableInput.js +2 -3
- package/lib/components/color-picker/react-color/common/EditableInput.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Hue.d.ts +1 -1
- package/lib/components/color-picker/react-color/common/Hue.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/Hue.js +7 -7
- package/lib/components/color-picker/react-color/common/Hue.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Saturation.d.ts +1 -1
- package/lib/components/color-picker/react-color/common/Saturation.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchFields.d.ts +2 -2
- package/lib/components/color-picker/react-color/sketch/SketchFields.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchPresetColors.d.ts +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchPresetColors.d.ts.map +1 -1
- package/lib/components/dialog/ConfirmDialog.d.ts +1 -1
- package/lib/components/dialog/ConfirmDialog.d.ts.map +1 -1
- package/lib/components/doi/doi.d.ts +1 -1
- package/lib/components/doi/doi.d.ts.map +1 -1
- package/lib/components/doi/doi_logo.d.ts +1 -1
- package/lib/components/doi/doi_logo.d.ts.map +1 -1
- package/lib/components/drop-zone/DropZone.d.ts +2 -2
- package/lib/components/drop-zone/DropZone.d.ts.map +1 -1
- package/lib/components/form/components/input/checkbox.d.ts +1 -1
- package/lib/components/form/components/input/checkbox.d.ts.map +1 -1
- package/lib/components/form/components/input/color_picker.d.ts +1 -1
- package/lib/components/form/components/input/color_picker.d.ts.map +1 -1
- package/lib/components/form/components/input/input.d.ts +1 -1
- package/lib/components/form/components/input/input.d.ts.map +1 -1
- package/lib/components/form/components/input/numeric_input.d.ts +1 -1
- package/lib/components/form/components/input/numeric_input.d.ts.map +1 -1
- package/lib/components/form/components/input/radio_group.d.ts +1 -1
- package/lib/components/form/components/input/radio_group.d.ts.map +1 -1
- package/lib/components/form/components/input/radio_group.js.map +1 -1
- package/lib/components/form/components/input/reset_button.d.ts +1 -1
- package/lib/components/form/components/input/reset_button.d.ts.map +1 -1
- package/lib/components/form/components/input/select.d.ts +1 -1
- package/lib/components/form/components/input/select.d.ts.map +1 -1
- package/lib/components/form/components/input/submit_button.d.ts +1 -1
- package/lib/components/form/components/input/submit_button.d.ts.map +1 -1
- package/lib/components/form/components/input/switch.d.ts +1 -1
- package/lib/components/form/components/input/switch.d.ts.map +1 -1
- package/lib/components/form/components/input_groups/form.d.ts +1 -1
- package/lib/components/form/components/input_groups/form.d.ts.map +1 -1
- package/lib/components/form/components/input_groups/form_group.d.ts +1 -1
- package/lib/components/form/components/input_groups/form_group.d.ts.map +1 -1
- package/lib/components/form/components/layout/Section.d.ts +1 -1
- package/lib/components/form/components/layout/Section.d.ts.map +1 -1
- package/lib/components/fullscreen/fullscreen_context.provider.d.ts +3 -3
- package/lib/components/fullscreen/fullscreen_context.provider.d.ts.map +1 -1
- package/lib/components/fullscreen/fullscreen_toolbar_button.d.ts +1 -1
- package/lib/components/fullscreen/fullscreen_toolbar_button.d.ts.map +1 -1
- package/lib/components/header/Header.d.ts +1 -1
- package/lib/components/header/Header.d.ts.map +1 -1
- package/lib/components/header/PanelHeader.d.ts +1 -1
- package/lib/components/header/PanelHeader.d.ts.map +1 -1
- package/lib/components/icon.d.ts +1 -1
- package/lib/components/icon.d.ts.map +1 -1
- package/lib/components/info-panel/InfoPanel.d.ts +1 -1
- package/lib/components/info-panel/InfoPanel.d.ts.map +1 -1
- package/lib/components/info-panel/InfoPanel.js +13 -10
- package/lib/components/info-panel/InfoPanel.js.map +1 -1
- package/lib/components/inline_editable_renderer/inline_editable_renderer.d.ts +1 -1
- package/lib/components/inline_editable_renderer/inline_editable_renderer.d.ts.map +1 -1
- package/lib/components/input/radio-button-group/RadioButton.d.ts +1 -1
- package/lib/components/input/radio-button-group/RadioButton.d.ts.map +1 -1
- package/lib/components/input/radio-button-group/RadioButtonGroup.d.ts +1 -1
- package/lib/components/input/radio-button-group/RadioButtonGroup.d.ts.map +1 -1
- package/lib/components/input/radio-button-group/RadioButtonGroup.js +5 -4
- package/lib/components/input/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/lib/components/input/utils/SubText.d.ts +1 -1
- package/lib/components/input/utils/SubText.d.ts.map +1 -1
- package/lib/components/logger/FifoLoggerDialog.d.ts +1 -1
- package/lib/components/logger/FifoLoggerDialog.d.ts.map +1 -1
- package/lib/components/logger/FifoLoggerProvider.d.ts +1 -1
- package/lib/components/logger/FifoLoggerProvider.d.ts.map +1 -1
- package/lib/components/logger/FifoLoggerToolbarItem.d.ts +1 -1
- package/lib/components/logger/FifoLoggerToolbarItem.d.ts.map +1 -1
- package/lib/components/root-layout/root_layout.d.ts +1 -1
- package/lib/components/root-layout/root_layout.d.ts.map +1 -1
- package/lib/components/root-layout/root_layout.js +1 -2
- package/lib/components/root-layout/root_layout.js.map +1 -1
- package/lib/components/root-layout/root_layout_context.provider.d.ts +1 -1
- package/lib/components/root-layout/root_layout_context.provider.d.ts.map +1 -1
- package/lib/components/selected-total/SelectedTotal.d.ts +1 -1
- package/lib/components/selected-total/SelectedTotal.d.ts.map +1 -1
- package/lib/components/split_pane/split_pane.d.ts +1 -1
- package/lib/components/split_pane/split_pane.d.ts.map +1 -1
- package/lib/components/split_pane/use_split_pane_size.d.ts +1 -1
- package/lib/components/split_pane/use_split_pane_size.d.ts.map +1 -1
- package/lib/components/svg/styled/svg_styled_line.d.ts +1 -1
- package/lib/components/svg/styled/svg_styled_line.d.ts.map +1 -1
- package/lib/components/svg/styled/svg_styled_path.d.ts +1 -1
- package/lib/components/svg/styled/svg_styled_path.d.ts.map +1 -1
- package/lib/components/svg/styled/svg_styled_text.d.ts +1 -1
- package/lib/components/svg/styled/svg_styled_text.d.ts.map +1 -1
- package/lib/components/table/default_table_cell.d.ts +1 -1
- package/lib/components/table/default_table_cell.d.ts.map +1 -1
- package/lib/components/table/flash_row/flashed_row_provider.d.ts +1 -1
- package/lib/components/table/flash_row/flashed_row_provider.d.ts.map +1 -1
- package/lib/components/table/flash_row/use_flash_row_effect.d.ts +1 -1
- package/lib/components/table/flash_row/use_flash_row_effect.d.ts.map +1 -1
- package/lib/components/table/flash_row/use_flash_row_effect.js.map +1 -1
- package/lib/components/table/preview_table.d.ts +1 -1
- package/lib/components/table/preview_table.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_context.d.ts +1 -1
- package/lib/components/table/reorder_rows/draggable_row_context.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_tr.d.ts +1 -1
- package/lib/components/table/reorder_rows/draggable_row_tr.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_tr.js.map +1 -1
- package/lib/components/table/reorder_rows/item_data.d.ts +1 -1
- package/lib/components/table/reorder_rows/item_data.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/item_data.js.map +1 -1
- package/lib/components/table/reorder_rows/item_order_provider.d.ts +1 -1
- package/lib/components/table/reorder_rows/item_order_provider.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/item_order_provider.js +10 -5
- package/lib/components/table/reorder_rows/item_order_provider.js.map +1 -1
- package/lib/components/table/reorder_rows/table_drag_row_handler.d.ts +1 -1
- package/lib/components/table/reorder_rows/table_drag_row_handler.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/use_drop_monitor.d.ts +1 -1
- package/lib/components/table/reorder_rows/use_drop_monitor.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/use_drop_monitor.js.map +1 -1
- package/lib/components/table/table_body.d.ts +1 -1
- package/lib/components/table/table_body.d.ts.map +1 -1
- package/lib/components/table/table_body.js +1 -1
- package/lib/components/table/table_body.js.map +1 -1
- package/lib/components/table/table_header.d.ts +1 -1
- package/lib/components/table/table_header.d.ts.map +1 -1
- package/lib/components/table/table_header_cell.d.ts +1 -1
- package/lib/components/table/table_header_cell.d.ts.map +1 -1
- package/lib/components/table/table_root.d.ts +2 -2
- package/lib/components/table/table_root.d.ts.map +1 -1
- package/lib/components/table/table_root.js +4 -1
- package/lib/components/table/table_root.js.map +1 -1
- package/lib/components/table/table_row.d.ts +3 -3
- package/lib/components/table/table_row.d.ts.map +1 -1
- package/lib/components/table/table_row.js.map +1 -1
- package/lib/components/table/table_row_cell.d.ts +1 -1
- package/lib/components/table/table_row_cell.d.ts.map +1 -1
- package/lib/components/table/table_scroll_container.d.ts +2 -2
- package/lib/components/table/table_scroll_container.d.ts.map +1 -1
- package/lib/components/table/use_table_scroll.d.ts +1 -1
- package/lib/components/table/use_table_scroll.d.ts.map +1 -1
- package/lib/components/table/use_table_scroll.js +0 -1
- package/lib/components/table/use_table_scroll.js.map +1 -1
- package/lib/components/toolbar/OverflowButton.d.ts +3 -3
- package/lib/components/toolbar/OverflowButton.d.ts.map +1 -1
- package/lib/components/toolbar/OverflowButton.js +2 -4
- package/lib/components/toolbar/OverflowButton.js.map +1 -1
- package/lib/components/toolbar/PanelPreferencesToolbar.d.ts +1 -1
- package/lib/components/toolbar/PanelPreferencesToolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.d.ts +10 -303
- package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.js +16 -16
- package/lib/components/toolbar/Toolbar.js.map +1 -1
- package/lib/components/toolbar/TooltipHelpContent.d.ts +1 -1
- package/lib/components/toolbar/TooltipHelpContent.d.ts.map +1 -1
- package/lib/components/toolbar/TooltipHelpContent.js +1 -3
- package/lib/components/toolbar/TooltipHelpContent.js.map +1 -1
- package/lib/components/toolbar/useCheckOverflow.d.ts +2 -1
- package/lib/components/toolbar/useCheckOverflow.d.ts.map +1 -1
- package/lib/components/toolbar/useCheckOverflow.js.map +1 -1
- package/lib/components/utils/index.d.ts +1 -0
- package/lib/components/utils/index.d.ts.map +1 -1
- package/lib/components/utils/index.js +1 -0
- package/lib/components/utils/index.js.map +1 -1
- package/lib/components/utils/svg.d.ts +42 -0
- package/lib/components/utils/svg.d.ts.map +1 -0
- package/lib/components/utils/svg.js +60 -0
- package/lib/components/utils/svg.js.map +1 -0
- package/lib/components/value-renderers/Boolean.d.ts +1 -1
- package/lib/components/value-renderers/Boolean.d.ts.map +1 -1
- package/lib/components/value-renderers/Color.d.ts +1 -1
- package/lib/components/value-renderers/Color.d.ts.map +1 -1
- package/lib/components/value-renderers/Component.d.ts +1 -1
- package/lib/components/value-renderers/Component.d.ts.map +1 -1
- package/lib/components/value-renderers/Number.d.ts +1 -1
- package/lib/components/value-renderers/Number.d.ts.map +1 -1
- package/lib/components/value-renderers/ObjectRenderer.d.ts +1 -1
- package/lib/components/value-renderers/ObjectRenderer.d.ts.map +1 -1
- package/lib/components/value-renderers/Text.d.ts +1 -1
- package/lib/components/value-renderers/Text.d.ts.map +1 -1
- package/lib/components/value-renderers/Title.d.ts +1 -1
- package/lib/components/value-renderers/Title.d.ts.map +1 -1
- package/package.json +58 -61
- package/src/components/activity_bar/activity_bar.tsx +5 -1
- package/src/components/button/Button.tsx +39 -42
- package/src/components/color-picker/color-picker-dropdown/ColorPickerDropdown.tsx +8 -6
- package/src/components/color-picker/gradient_select/gradient_select.tsx +1 -1
- package/src/components/color-picker/react-color/ColorPicker.tsx +8 -4
- package/src/components/color-picker/react-color/common/EditableInput.tsx +2 -4
- package/src/components/color-picker/react-color/common/Hue.tsx +16 -9
- package/src/components/color-picker/react-color/sketch/SketchFields.tsx +1 -1
- package/src/components/form/components/input/radio_group.tsx +2 -2
- package/src/components/fullscreen/fullscreen_context.provider.tsx +2 -2
- package/src/components/info-panel/InfoPanel.tsx +13 -12
- package/src/components/input/radio-button-group/RadioButtonGroup.tsx +9 -4
- package/src/components/root-layout/root_layout.tsx +2 -4
- package/src/components/split_pane/split_pane.tsx +1 -1
- package/src/components/split_pane/use_split_pane_size.tsx +1 -1
- package/src/components/table/flash_row/use_flash_row_effect.ts +1 -1
- package/src/components/table/reorder_rows/draggable_row_context.ts +1 -1
- package/src/components/table/reorder_rows/draggable_row_tr.tsx +1 -1
- package/src/components/table/reorder_rows/item_data.ts +4 -1
- package/src/components/table/reorder_rows/item_order_provider.tsx +8 -6
- package/src/components/table/reorder_rows/use_drop_monitor.ts +1 -1
- package/src/components/table/table_body.tsx +4 -2
- package/src/components/table/table_root.tsx +3 -1
- package/src/components/table/table_row.tsx +3 -3
- package/src/components/table/table_scroll_container.tsx +3 -3
- package/src/components/table/use_table_scroll.ts +1 -2
- package/src/components/toolbar/OverflowButton.tsx +9 -10
- package/src/components/toolbar/Toolbar.tsx +48 -31
- package/src/components/toolbar/useCheckOverflow.tsx +2 -1
- package/src/components/utils/index.ts +1 -0
- package/src/components/utils/svg.ts +120 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { PopoverNextProps } from '@blueprintjs/core';
|
|
2
|
+
import { PopoverNext } from '@blueprintjs/core';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
|
|
5
5
|
import FixedColorPreview from '../preview/FixedColorPreview.js';
|
|
@@ -16,7 +16,7 @@ export interface ColorPickerDropdownProps extends Pick<
|
|
|
16
16
|
| 'onChangeComplete'
|
|
17
17
|
| 'onBlur'
|
|
18
18
|
> {
|
|
19
|
-
popoverProps?: Omit<
|
|
19
|
+
popoverProps?: Omit<PopoverNextProps, 'content'>;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* To link with label
|
|
@@ -45,10 +45,12 @@ export function ColorPickerDropdown(props: ColorPickerDropdownProps) {
|
|
|
45
45
|
const { hex } = colorHelper.toState(color || 'white');
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
|
-
<
|
|
48
|
+
<PopoverNext
|
|
49
49
|
targetProps={{ style: { width: '100%' } }}
|
|
50
50
|
content={<ColorPicker color={color} {...otherProps} />}
|
|
51
|
-
|
|
51
|
+
shouldReturnFocusOnClose={false}
|
|
52
|
+
animation="minimal"
|
|
53
|
+
arrow={false}
|
|
52
54
|
{...popoverProps}
|
|
53
55
|
>
|
|
54
56
|
<ColorPickerRoot type="button" id={id}>
|
|
@@ -56,6 +58,6 @@ export function ColorPickerDropdown(props: ColorPickerDropdownProps) {
|
|
|
56
58
|
<FixedColorPreview color={hex} />
|
|
57
59
|
</ColorPickerPreview>
|
|
58
60
|
</ColorPickerRoot>
|
|
59
|
-
</
|
|
61
|
+
</PopoverNext>
|
|
60
62
|
);
|
|
61
63
|
}
|
|
@@ -6,6 +6,7 @@ import { defaultColorPalette } from '../palette.js';
|
|
|
6
6
|
|
|
7
7
|
import { Alpha, CheckBoard, Hue, Saturation } from './common/index.js';
|
|
8
8
|
import * as colorHelper from './helpers/color.js';
|
|
9
|
+
import type { SketchFieldsProps } from './sketch/SketchFields.js';
|
|
9
10
|
import SketchFields from './sketch/SketchFields.js';
|
|
10
11
|
import SketchPresetColors from './sketch/SketchPresetColors.js';
|
|
11
12
|
|
|
@@ -168,11 +169,14 @@ export function ColorPicker(props: ColorPickerProps) {
|
|
|
168
169
|
setState(colorHelper.toState(color, 0));
|
|
169
170
|
}
|
|
170
171
|
|
|
171
|
-
const handleChange = useCallback(
|
|
172
|
-
(data
|
|
172
|
+
const handleChange = useCallback<SketchFieldsProps['onChange']>(
|
|
173
|
+
(data, event) => {
|
|
173
174
|
const isValidColor = colorHelper.simpleCheckForValidColor(data);
|
|
174
175
|
if (isValidColor) {
|
|
175
|
-
const colors = colorHelper.toState(
|
|
176
|
+
const colors = colorHelper.toState(
|
|
177
|
+
data,
|
|
178
|
+
('h' in data && data.h) || state.oldHue,
|
|
179
|
+
);
|
|
176
180
|
setState(colors);
|
|
177
181
|
if (onChangeComplete) {
|
|
178
182
|
debounceRef.current(onChangeComplete, colors, event);
|
|
@@ -245,7 +249,7 @@ export function ColorPicker(props: ColorPickerProps) {
|
|
|
245
249
|
/>
|
|
246
250
|
<SketchPresetColors
|
|
247
251
|
colors={presetColors}
|
|
248
|
-
onClick={(data, e) => handleChange
|
|
252
|
+
onClick={(data, e) => handleChange(data, e)}
|
|
249
253
|
onSwatchHover={handleSwatchHover}
|
|
250
254
|
/>
|
|
251
255
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { useCallback, useEffect, useId, useRef, useState } from 'react';
|
|
5
5
|
|
|
6
6
|
const DEFAULT_ARROW_OFFSET = 1;
|
|
7
7
|
|
|
@@ -11,8 +11,6 @@ const VALID_KEY_CODES = new Set([UP_KEY_CODE, DOWN_KEY_CODE]);
|
|
|
11
11
|
const isValidKeyCode = (keyCode) => VALID_KEY_CODES.has(keyCode);
|
|
12
12
|
const getNumberValue = (value) => Number(String(value).replaceAll('%', ''));
|
|
13
13
|
|
|
14
|
-
let idCounter = 1;
|
|
15
|
-
|
|
16
14
|
const styles = {
|
|
17
15
|
wrap: {
|
|
18
16
|
position: 'relative',
|
|
@@ -27,7 +25,7 @@ const EditableInput = (props) => {
|
|
|
27
25
|
const inputRef = useRef();
|
|
28
26
|
const valueRef = useRef<number>(props.value);
|
|
29
27
|
|
|
30
|
-
const inputId =
|
|
28
|
+
const inputId = `rc-editable-input-${useId()}`;
|
|
31
29
|
|
|
32
30
|
useEffect(() => {
|
|
33
31
|
valueRef.current = props.value;
|
|
@@ -59,28 +59,35 @@ const styles = {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
const Hue = (props) => {
|
|
62
|
+
const {
|
|
63
|
+
direction = 'horizontal',
|
|
64
|
+
hsl,
|
|
65
|
+
style,
|
|
66
|
+
pointer,
|
|
67
|
+
onBlur,
|
|
68
|
+
onChange,
|
|
69
|
+
} = props;
|
|
70
|
+
const { borderRadius, boxShadow } = style;
|
|
71
|
+
|
|
62
72
|
const containerRef = useRef();
|
|
63
73
|
|
|
64
74
|
const handleChange = useCallback(
|
|
65
75
|
(e) => {
|
|
66
76
|
const change = hue.calculateChange(
|
|
67
77
|
e,
|
|
68
|
-
|
|
69
|
-
|
|
78
|
+
direction,
|
|
79
|
+
hsl,
|
|
70
80
|
containerRef.current,
|
|
71
81
|
);
|
|
72
|
-
if (change && typeof
|
|
73
|
-
|
|
82
|
+
if (change && typeof onChange === 'function') {
|
|
83
|
+
onChange(change, e);
|
|
74
84
|
}
|
|
75
85
|
},
|
|
76
|
-
[
|
|
86
|
+
[direction, hsl, onChange],
|
|
77
87
|
);
|
|
78
88
|
|
|
79
89
|
const handleMouseDown = useOnChange(handleChange);
|
|
80
90
|
|
|
81
|
-
const { direction = 'horizontal', hsl, style, pointer } = props;
|
|
82
|
-
const { borderRadius, boxShadow } = style;
|
|
83
|
-
|
|
84
91
|
return (
|
|
85
92
|
<div style={styles.hue(borderRadius, boxShadow)}>
|
|
86
93
|
<div
|
|
@@ -89,7 +96,7 @@ const Hue = (props) => {
|
|
|
89
96
|
onMouseDown={handleMouseDown}
|
|
90
97
|
onTouchMove={handleChange}
|
|
91
98
|
onTouchStart={handleChange}
|
|
92
|
-
onBlur={
|
|
99
|
+
onBlur={onBlur}
|
|
93
100
|
>
|
|
94
101
|
<div style={styles.pointer(direction, hsl)}>
|
|
95
102
|
{pointer ? (
|
|
@@ -5,7 +5,7 @@ import type { HSL, RGB } from '../ColorPicker.js';
|
|
|
5
5
|
import { EditableInput } from '../common/index.js';
|
|
6
6
|
import * as color from '../helpers/color.js';
|
|
7
7
|
|
|
8
|
-
interface SketchFieldsProps {
|
|
8
|
+
export interface SketchFieldsProps {
|
|
9
9
|
onChange: (
|
|
10
10
|
data: (RGB | HSL | { hex: string }) & { source: string },
|
|
11
11
|
e: Event,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RadioGroupProps as BPRadioGroupProps } from '@blueprintjs/core';
|
|
2
2
|
import { RadioGroup as BPRadioGroup } from '@blueprintjs/core';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ChangeEvent } from 'react';
|
|
4
4
|
|
|
5
5
|
import { useFieldContext } from '../../context/use_ts_form.ts';
|
|
6
6
|
import { useFormContext } from '../input_groups/form_context.ts';
|
|
@@ -41,7 +41,7 @@ export function RadioGroup(props: RadioGroupProps) {
|
|
|
41
41
|
.errors.map((e) => e.message)
|
|
42
42
|
.at(0);
|
|
43
43
|
|
|
44
|
-
function onChange(event:
|
|
44
|
+
function onChange(event: ChangeEvent<HTMLInputElement>) {
|
|
45
45
|
return field.handleChange(event.currentTarget.value);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode, RefObject } from 'react';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { useFullScreenHandle } from 'react-full-screen';
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ export interface FullscreenProviderProps {
|
|
|
9
9
|
* Callback providing the ref which should be passed to the element that can be displayed fullscreen.
|
|
10
10
|
* @param ref
|
|
11
11
|
*/
|
|
12
|
-
children: (ref:
|
|
12
|
+
children: (ref: RefObject<HTMLDivElement | null>) => ReactNode;
|
|
13
13
|
/**
|
|
14
14
|
* Callback which will be called in case toggling results in an error.
|
|
15
15
|
* @param error - The error that happened. Value is not necessarily an instance of `Error` and may even be `undefined`.
|
|
@@ -277,19 +277,20 @@ function valueSearch(
|
|
|
277
277
|
search: string,
|
|
278
278
|
lowerCase = true,
|
|
279
279
|
): boolean {
|
|
280
|
+
let stringValue = match(value)
|
|
281
|
+
.with(P.boolean, String)
|
|
282
|
+
.with(P.number, String)
|
|
283
|
+
.with(P.string, (value) => {
|
|
284
|
+
return value === 'true' ? 'yes' : value === 'false' ? 'no' : value;
|
|
285
|
+
})
|
|
286
|
+
.with({}, (value) => JSON.stringify(value))
|
|
287
|
+
.otherwise(() => null);
|
|
288
|
+
if (stringValue === null) {
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
280
291
|
if (lowerCase) {
|
|
281
|
-
|
|
292
|
+
stringValue = stringValue.toLowerCase();
|
|
282
293
|
search = search.toLowerCase();
|
|
283
294
|
}
|
|
284
|
-
return
|
|
285
|
-
.with(P.boolean, (value) => String(value).includes(search))
|
|
286
|
-
.with(P.number, (value) => String(value).includes(search))
|
|
287
|
-
.with(P.string, (value) => {
|
|
288
|
-
const newValue =
|
|
289
|
-
value === 'true' ? 'yes' : value === 'false' ? 'no' : value;
|
|
290
|
-
|
|
291
|
-
return newValue.includes(search);
|
|
292
|
-
})
|
|
293
|
-
.with({}, (value) => JSON.stringify(value).includes(search))
|
|
294
|
-
.otherwise(() => true);
|
|
295
|
+
return stringValue.includes(search);
|
|
295
296
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RadioGroupProps, RadioProps } from '@blueprintjs/core';
|
|
2
2
|
import { RadioGroup } from '@blueprintjs/core';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
|
+
import type { ReactElement } from 'react';
|
|
4
5
|
import { Children, cloneElement } from 'react';
|
|
5
6
|
|
|
6
7
|
import { RadioButton } from './RadioButton.js';
|
|
@@ -68,13 +69,17 @@ export function RadioButtonGroup(props: RadioButtonGroupProps) {
|
|
|
68
69
|
return child;
|
|
69
70
|
}
|
|
70
71
|
if (child.type === RadioButton) {
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
const radioChild = child as ReactElement<
|
|
73
|
+
RadioProps,
|
|
74
|
+
typeof RadioButton
|
|
75
|
+
>;
|
|
76
|
+
return cloneElement(radioChild, {
|
|
77
|
+
...radioChild.props,
|
|
73
78
|
size,
|
|
74
79
|
name,
|
|
75
80
|
onChange,
|
|
76
|
-
checked:
|
|
77
|
-
disabled: groupDisabled ||
|
|
81
|
+
checked: radioChild.props.value === selectedValue,
|
|
82
|
+
disabled: groupDisabled || radioChild.props.disabled,
|
|
78
83
|
});
|
|
79
84
|
}
|
|
80
85
|
return child;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlueprintProvider, FocusStyleManager } from '@blueprintjs/core';
|
|
2
|
-
import type { CSSProperties,
|
|
2
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
3
3
|
import { useCallback, useState } from 'react';
|
|
4
4
|
|
|
5
5
|
import { AccordionProvider } from '../accordion/index.js';
|
|
@@ -43,9 +43,7 @@ export function RootLayout(props: RootLayoutProps) {
|
|
|
43
43
|
id="root-layout"
|
|
44
44
|
ref={(node) => {
|
|
45
45
|
if (node) {
|
|
46
|
-
|
|
47
|
-
fullscreenRef as MutableRefObject<HTMLDivElement>;
|
|
48
|
-
mutableRef.current = node;
|
|
46
|
+
fullscreenRef.current = node;
|
|
49
47
|
refCallback(node);
|
|
50
48
|
}
|
|
51
49
|
}}
|
|
@@ -223,7 +223,7 @@ interface SplitterProps {
|
|
|
223
223
|
direction: SplitPaneDirection;
|
|
224
224
|
isOpen: boolean;
|
|
225
225
|
isResizing: boolean;
|
|
226
|
-
splitterRef: RefObject<HTMLDivElement>;
|
|
226
|
+
splitterRef: RefObject<HTMLDivElement | null>;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
function Splitter(props: SplitterProps) {
|
|
@@ -12,7 +12,7 @@ import { serializeSize } from './split_pane_helpers.js';
|
|
|
12
12
|
interface UseSplitPaneSizeOptions {
|
|
13
13
|
controlledSide: SplitPaneSide;
|
|
14
14
|
direction: SplitPaneDirection;
|
|
15
|
-
splitterRef: RefObject<HTMLDivElement>;
|
|
15
|
+
splitterRef: RefObject<HTMLDivElement | null>;
|
|
16
16
|
sizeType: SplitPaneType;
|
|
17
17
|
onSizeChange: (newSize: ParsedSplitPaneSize) => void;
|
|
18
18
|
onResize?: (newSize: SplitPaneSize) => void;
|
|
@@ -6,7 +6,7 @@ import { useFlashedRowContext } from './flashed_row_context.js';
|
|
|
6
6
|
|
|
7
7
|
export function useFlashRowEffect(
|
|
8
8
|
id: string,
|
|
9
|
-
tableRowRef: RefObject<HTMLTableRowElement>,
|
|
9
|
+
tableRowRef: RefObject<HTMLTableRowElement | null>,
|
|
10
10
|
) {
|
|
11
11
|
const [flashedItemId, setFlashedItemId] = useFlashedRowContext();
|
|
12
12
|
useEffect(() => {
|
|
@@ -5,7 +5,7 @@ import type { DraggableItemState } from './item_data.js';
|
|
|
5
5
|
|
|
6
6
|
export interface DraggableRowContext {
|
|
7
7
|
state: DraggableItemState;
|
|
8
|
-
dragHandleRef: RefObject<HTMLButtonElement>;
|
|
8
|
+
dragHandleRef: RefObject<HTMLButtonElement | null>;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export const draggableRowContext = createContext<DraggableRowContext | null>(
|
|
@@ -11,7 +11,10 @@ export interface ItemData {
|
|
|
11
11
|
[key: symbol]: unknown;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export function getItemData(
|
|
14
|
+
export function getItemData<RowType>(
|
|
15
|
+
row: Row<RowType>,
|
|
16
|
+
instanceId: symbol,
|
|
17
|
+
): ItemData {
|
|
15
18
|
return {
|
|
16
19
|
[itemKey]: true,
|
|
17
20
|
id: row.id,
|
|
@@ -43,14 +43,16 @@ export function ItemOrderProvider<T = unknown>(
|
|
|
43
43
|
[items, onOrderChanged],
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
-
const value = useMemo(
|
|
47
|
-
|
|
46
|
+
const value = useMemo(() => {
|
|
47
|
+
// This assertion is necessary because the provider cannot contain the
|
|
48
|
+
// T type instantiated by this component.
|
|
49
|
+
const contextItems = items as Array<Row<unknown>>;
|
|
50
|
+
return {
|
|
48
51
|
reorderItem,
|
|
49
|
-
items:
|
|
52
|
+
items: contextItems,
|
|
50
53
|
instanceId,
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
);
|
|
54
|
+
};
|
|
55
|
+
}, [reorderItem, items, instanceId]);
|
|
54
56
|
|
|
55
57
|
return (
|
|
56
58
|
<itemOrderContext.Provider value={value}>
|
|
@@ -21,7 +21,7 @@ import { useItemOrder } from './item_order_context.js';
|
|
|
21
21
|
* @param enabled Enable or disable the monitoring.
|
|
22
22
|
*/
|
|
23
23
|
export function useDropMonitor(
|
|
24
|
-
scrollElementRef: RefObject<Element>,
|
|
24
|
+
scrollElementRef: RefObject<Element | null>,
|
|
25
25
|
enabled: boolean,
|
|
26
26
|
) {
|
|
27
27
|
const { reorderItem, items } = useItemOrder();
|
|
@@ -40,9 +40,11 @@ export function TableBody<TData extends RowData>(props: TableBodyProps<TData>) {
|
|
|
40
40
|
rows,
|
|
41
41
|
tdStyle,
|
|
42
42
|
getTdProps,
|
|
43
|
+
isReorderingEnabled,
|
|
44
|
+
renderRowPreview,
|
|
43
45
|
renderRowTr = getDefaultRenderRowTr(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
isReorderingEnabled,
|
|
47
|
+
renderRowPreview as TableRowPreviewRenderer<unknown>,
|
|
46
48
|
) as TableRowTrRenderer<TData>,
|
|
47
49
|
virtualizer,
|
|
48
50
|
virtualizeRows,
|
|
@@ -215,7 +215,7 @@ interface RegularTableProps<
|
|
|
215
215
|
* By default, the table itself is used as the scrollable element, but
|
|
216
216
|
* you must style it to make it scrollable.
|
|
217
217
|
*/
|
|
218
|
-
scrollableElementRef?: RefObject<Element>;
|
|
218
|
+
scrollableElementRef?: RefObject<Element | null>;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
interface VirtualizedTableProps<
|
|
@@ -282,6 +282,7 @@ export function Table<TData extends RowData>(props: TableProps<TData>) {
|
|
|
282
282
|
count: data.length,
|
|
283
283
|
getScrollElement: () => virtualScrollElementRef.current,
|
|
284
284
|
estimateSize:
|
|
285
|
+
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
285
286
|
(props.virtualizeRows && props.estimatedRowHeight) || (() => 0),
|
|
286
287
|
overscan: 5,
|
|
287
288
|
});
|
|
@@ -338,6 +339,7 @@ export function Table<TData extends RowData>(props: TableProps<TData>) {
|
|
|
338
339
|
virtualScrollElementRef
|
|
339
340
|
: // When not virtualized, ScrollContainer does not render a container, only its children,
|
|
340
341
|
// And the scrollable element is provided by the user or by default, the <table> element.
|
|
342
|
+
// eslint-disable-next-line unicorn/consistent-destructuring
|
|
341
343
|
props.scrollableElementRef || tableRef
|
|
342
344
|
}
|
|
343
345
|
scrollToRowRef={scrollToRowRef}
|
|
@@ -4,12 +4,12 @@ import { useRef } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { useFlashRowEffect } from './flash_row/use_flash_row_effect.js';
|
|
6
6
|
|
|
7
|
-
export interface TableRowTrProps {
|
|
8
|
-
row: Row<
|
|
7
|
+
export interface TableRowTrProps<RowType> {
|
|
8
|
+
row: Row<RowType>;
|
|
9
9
|
trProps: JSX.IntrinsicElements['tr'];
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export function TableRowTr(props: TableRowTrProps) {
|
|
12
|
+
export function TableRowTr<RowType>(props: TableRowTrProps<RowType>) {
|
|
13
13
|
const { row, trProps } = props;
|
|
14
14
|
const tableRowRef = useRef<HTMLTableRowElement>(null);
|
|
15
15
|
useFlashRowEffect(row.id, tableRowRef);
|
|
@@ -28,7 +28,7 @@ interface ScrollContainerProps {
|
|
|
28
28
|
/**
|
|
29
29
|
* A ref to the effective scroll container.
|
|
30
30
|
*/
|
|
31
|
-
scrollRef: RefObject<Element>;
|
|
31
|
+
scrollRef: RefObject<Element | null>;
|
|
32
32
|
/**
|
|
33
33
|
* The user provided ref to attach the scroll callbacks to.
|
|
34
34
|
* It is set by the ScrollContainer component if the table is virtualized.
|
|
@@ -74,7 +74,7 @@ export function ScrollContainer(props: ScrollContainerProps) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
interface ContainerWithReorderingProps {
|
|
77
|
-
scrollElementRef: RefObject<Element>;
|
|
77
|
+
scrollElementRef: RefObject<Element | null>;
|
|
78
78
|
isReorderingEnabled: boolean;
|
|
79
79
|
children: ReactNode;
|
|
80
80
|
}
|
|
@@ -91,7 +91,7 @@ function ContainerVirtual(props: ContainerWithReorderingProps) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
interface NoContainerProps {
|
|
94
|
-
scrollElementRef: RefObject<Element>;
|
|
94
|
+
scrollElementRef: RefObject<Element | null>;
|
|
95
95
|
enabled: boolean;
|
|
96
96
|
children: ReactNode;
|
|
97
97
|
}
|
|
@@ -19,7 +19,7 @@ export function useTableScroll<TData extends RowData>(options: {
|
|
|
19
19
|
/**
|
|
20
20
|
* A ref to the effective scroll container.
|
|
21
21
|
*/
|
|
22
|
-
scrollRef: RefObject<Element>;
|
|
22
|
+
scrollRef: RefObject<Element | null>;
|
|
23
23
|
/*
|
|
24
24
|
Tanstack table instance.
|
|
25
25
|
*/
|
|
@@ -33,7 +33,6 @@ export function useTableScroll<TData extends RowData>(options: {
|
|
|
33
33
|
const { scrollToRowRef, virtualizeRows, scrollRef, table, virtualizer } =
|
|
34
34
|
options;
|
|
35
35
|
|
|
36
|
-
// @ts-expect-error We cannot call the hook conditionally to satisfy the type checker
|
|
37
36
|
useImperativeHandle(scrollToRowRef, () => {
|
|
38
37
|
if (virtualizeRows) {
|
|
39
38
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { PopoverNextProps, TooltipProps } from '@blueprintjs/core';
|
|
2
|
+
import { PopoverNext } from '@blueprintjs/core';
|
|
3
3
|
import type { ReactNode } from 'react';
|
|
4
4
|
|
|
5
5
|
import type { ButtonProps } from '../button/Button.tsx';
|
|
@@ -10,7 +10,7 @@ export type Placement = 'start' | 'end';
|
|
|
10
10
|
|
|
11
11
|
export interface BaseOverButtonProps extends ButtonProps {
|
|
12
12
|
placement?: Placement;
|
|
13
|
-
popoverProps?:
|
|
13
|
+
popoverProps?: PopoverNextProps;
|
|
14
14
|
}
|
|
15
15
|
export interface OverButtonProps extends BaseOverButtonProps {
|
|
16
16
|
vertical?: boolean;
|
|
@@ -21,7 +21,7 @@ export interface OverButtonProps extends BaseOverButtonProps {
|
|
|
21
21
|
function getPlacement(
|
|
22
22
|
placement: Placement,
|
|
23
23
|
vertical?: boolean,
|
|
24
|
-
):
|
|
24
|
+
): PopoverNextProps['placement'] {
|
|
25
25
|
const isEndPlacement = placement === 'end';
|
|
26
26
|
return vertical
|
|
27
27
|
? `${isEndPlacement ? 'top' : 'bottom'}-start`
|
|
@@ -41,17 +41,16 @@ export function OverflowButton(props: OverButtonProps) {
|
|
|
41
41
|
...otherProps
|
|
42
42
|
} = props;
|
|
43
43
|
return (
|
|
44
|
-
<
|
|
45
|
-
|
|
44
|
+
<PopoverNext
|
|
45
|
+
shouldReturnFocusOnClose={false}
|
|
46
|
+
animation="minimal"
|
|
47
|
+
arrow={false}
|
|
46
48
|
disabled={disabled}
|
|
47
49
|
placement={getPlacement(placement, vertical)}
|
|
48
50
|
interactionKind="hover"
|
|
49
51
|
hasBackdrop={false}
|
|
50
52
|
enforceFocus={false}
|
|
51
53
|
autoFocus={false}
|
|
52
|
-
modifiers={{
|
|
53
|
-
flip: { enabled: false },
|
|
54
|
-
}}
|
|
55
54
|
{...popoverProps}
|
|
56
55
|
content={
|
|
57
56
|
<Toolbar
|
|
@@ -75,7 +74,7 @@ export function OverflowButton(props: OverButtonProps) {
|
|
|
75
74
|
}}
|
|
76
75
|
{...otherProps}
|
|
77
76
|
/>
|
|
78
|
-
</
|
|
77
|
+
</PopoverNext>
|
|
79
78
|
);
|
|
80
79
|
}
|
|
81
80
|
|