react-science 23.1.1 → 24.0.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/lib/components/accordion/accordion_context.d.ts +1 -1
- package/lib/components/accordion/accordion_context.js +3 -3
- package/lib/components/accordion/accordion_context.js.map +1 -1
- package/lib/components/accordion/accordion_context_provider.d.ts.map +1 -1
- package/lib/components/accordion/accordion_context_provider.js +3 -3
- package/lib/components/accordion/accordion_context_provider.js.map +1 -1
- package/lib/components/accordion/accordion_hooks.js +3 -3
- package/lib/components/accordion/accordion_hooks.js.map +1 -1
- package/lib/components/button/Button.d.ts.map +1 -1
- package/lib/components/button/Button.js +3 -2
- package/lib/components/button/Button.js.map +1 -1
- package/lib/components/color-picker/react-color/ColorPicker.d.ts +2 -2
- package/lib/components/color-picker/react-color/ColorPicker.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/ColorPicker.js +25 -22
- package/lib/components/color-picker/react-color/ColorPicker.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Alpha.d.ts +1 -2
- package/lib/components/color-picker/react-color/common/Alpha.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/Alpha.js +5 -6
- package/lib/components/color-picker/react-color/common/Alpha.js.map +1 -1
- package/lib/components/color-picker/react-color/common/CheckBoard.d.ts +1 -2
- package/lib/components/color-picker/react-color/common/CheckBoard.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/CheckBoard.js +2 -3
- package/lib/components/color-picker/react-color/common/CheckBoard.js.map +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 +30 -26
- 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 -2
- package/lib/components/color-picker/react-color/common/Hue.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/Hue.js +5 -6
- 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 -2
- package/lib/components/color-picker/react-color/common/Saturation.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/Saturation.js +6 -7
- package/lib/components/color-picker/react-color/common/Saturation.js.map +1 -1
- package/lib/components/color-picker/react-color/common/Swatch.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/Swatch.js +10 -11
- package/lib/components/color-picker/react-color/common/Swatch.js.map +1 -1
- package/lib/components/color-picker/react-color/common/interaction.d.ts +1 -1
- package/lib/components/color-picker/react-color/common/interaction.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/common/interaction.js +9 -9
- package/lib/components/color-picker/react-color/common/interaction.js.map +1 -1
- package/lib/components/color-picker/react-color/common/useOnChange.js +2 -2
- package/lib/components/color-picker/react-color/common/useOnChange.js.map +1 -1
- package/lib/components/color-picker/react-color/helpers/alpha.d.ts +1 -1
- package/lib/components/color-picker/react-color/helpers/alpha.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/helpers/alpha.js +4 -5
- package/lib/components/color-picker/react-color/helpers/alpha.js.map +1 -1
- package/lib/components/color-picker/react-color/helpers/color.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/helpers/color.js +15 -13
- package/lib/components/color-picker/react-color/helpers/color.js.map +1 -1
- package/lib/components/color-picker/react-color/helpers/hue.d.ts +1 -1
- package/lib/components/color-picker/react-color/helpers/hue.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/helpers/hue.js +14 -23
- package/lib/components/color-picker/react-color/helpers/hue.js.map +1 -1
- package/lib/components/color-picker/react-color/helpers/saturation.d.ts +1 -1
- package/lib/components/color-picker/react-color/helpers/saturation.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/helpers/saturation.js +3 -3
- package/lib/components/color-picker/react-color/helpers/saturation.js.map +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchFields.d.ts +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchFields.d.ts.map +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchFields.js +6 -6
- package/lib/components/color-picker/react-color/sketch/SketchFields.js.map +1 -1
- package/lib/components/color-picker/react-color/sketch/SketchPresetColors.js +8 -8
- package/lib/components/color-picker/react-color/sketch/SketchPresetColors.js.map +1 -1
- package/lib/components/dialog/ConfirmDialog.js +2 -2
- package/lib/components/dialog/ConfirmDialog.js.map +1 -1
- package/lib/components/draggable/draggable.d.ts.map +1 -1
- package/lib/components/draggable/draggable.js +10 -9
- package/lib/components/draggable/draggable.js.map +1 -1
- package/lib/components/form/components/field_groups/svg_text_style.d.ts.map +1 -1
- package/lib/components/form/components/field_groups/svg_text_style.js +8 -8
- package/lib/components/form/components/field_groups/svg_text_style.js.map +1 -1
- package/lib/components/form/components/field_groups/svg_text_style.schema.js +1 -1
- package/lib/components/form/components/field_groups/svg_text_style.schema.js.map +1 -1
- package/lib/components/form/components/input/checkbox.js +3 -3
- package/lib/components/form/components/input/checkbox.js.map +1 -1
- package/lib/components/form/components/input/color_picker.js +1 -1
- package/lib/components/form/components/input/color_picker.js.map +1 -1
- package/lib/components/form/components/input/draggable_numeric_input.js +1 -1
- package/lib/components/form/components/input/draggable_numeric_input.js.map +1 -1
- package/lib/components/form/components/input/input.js +1 -1
- package/lib/components/form/components/input/input.js.map +1 -1
- package/lib/components/form/components/input/numeric_input.js +1 -1
- package/lib/components/form/components/input/numeric_input.js.map +1 -1
- package/lib/components/form/components/input/radio_group.js +1 -1
- package/lib/components/form/components/input/radio_group.js.map +1 -1
- package/lib/components/form/components/input/select.js +1 -1
- package/lib/components/form/components/input/select.js.map +1 -1
- package/lib/components/form/components/input/switch.js +1 -1
- package/lib/components/form/components/input/switch.js.map +1 -1
- package/lib/components/form/components/input/textarea.js +1 -1
- package/lib/components/form/components/input/textarea.js.map +1 -1
- package/lib/components/form/components/input_groups/form.js +2 -2
- package/lib/components/form/components/input_groups/form.js.map +1 -1
- package/lib/components/form/components/input_groups/form_context.d.ts +1 -1
- package/lib/components/form/components/input_groups/form_context.js +3 -3
- package/lib/components/form/components/input_groups/form_context.js.map +1 -1
- package/lib/components/form/components/layout/form.d.ts +1 -1
- package/lib/components/form/components/layout/form.d.ts.map +1 -1
- package/lib/components/form/components/layout/form.js +1 -4
- package/lib/components/form/components/layout/form.js.map +1 -1
- package/lib/components/form/utils/validators.d.ts +14 -8
- package/lib/components/form/utils/validators.d.ts.map +1 -1
- package/lib/components/form/utils/validators.js +11 -11
- package/lib/components/form/utils/validators.js.map +1 -1
- package/lib/components/fullscreen/fullscreen_context.d.ts +1 -1
- package/lib/components/fullscreen/fullscreen_context.js +3 -3
- package/lib/components/fullscreen/fullscreen_context.js.map +1 -1
- package/lib/components/fullscreen/fullscreen_context.provider.d.ts +1 -3
- package/lib/components/fullscreen/fullscreen_context.provider.d.ts.map +1 -1
- package/lib/components/fullscreen/fullscreen_context.provider.js +3 -3
- package/lib/components/fullscreen/fullscreen_context.provider.js.map +1 -1
- package/lib/components/hooks/useDoubleClick.js +8 -8
- package/lib/components/hooks/useDoubleClick.js.map +1 -1
- package/lib/components/hooks/useOnClickOutside.js +2 -2
- package/lib/components/hooks/useOnClickOutside.js.map +1 -1
- package/lib/components/hooks/useOnOff.d.ts +1 -1
- package/lib/components/hooks/useOnOff.d.ts.map +1 -1
- package/lib/components/hooks/useOnOff.js +5 -5
- package/lib/components/hooks/useOnOff.js.map +1 -1
- package/lib/components/hooks/useSelect.d.ts.map +1 -1
- package/lib/components/hooks/useSelect.js +4 -3
- package/lib/components/hooks/useSelect.js.map +1 -1
- package/lib/components/hooks/useToggle.d.ts +1 -1
- package/lib/components/hooks/useToggle.d.ts.map +1 -1
- package/lib/components/hooks/useToggle.js +2 -2
- package/lib/components/hooks/useToggle.js.map +1 -1
- package/lib/components/info-panel/InfoPanel.d.ts.map +1 -1
- package/lib/components/info-panel/InfoPanel.js +10 -13
- package/lib/components/info-panel/InfoPanel.js.map +1 -1
- package/lib/components/input/radio-button-group/RadioButtonGroup.d.ts.map +1 -1
- package/lib/components/input/radio-button-group/RadioButtonGroup.js +3 -2
- package/lib/components/input/radio-button-group/RadioButtonGroup.js.map +1 -1
- package/lib/components/logger/FifoLoggerDialog.d.ts.map +1 -1
- package/lib/components/logger/FifoLoggerDialog.js +3 -1
- package/lib/components/logger/FifoLoggerDialog.js.map +1 -1
- package/lib/components/logger/FifoLoggerProvider.d.ts.map +1 -1
- package/lib/components/logger/FifoLoggerProvider.js +2 -2
- package/lib/components/logger/FifoLoggerProvider.js.map +1 -1
- package/lib/components/logger/loggerContext.d.ts +1 -1
- package/lib/components/logger/loggerContext.js +1 -1
- package/lib/components/logger/useFifoLogger.d.ts.map +1 -1
- package/lib/components/logger/useFifoLogger.js +7 -5
- package/lib/components/logger/useFifoLogger.js.map +1 -1
- package/lib/components/root-layout/root_layout.d.ts.map +1 -1
- package/lib/components/root-layout/root_layout.js +5 -3
- package/lib/components/root-layout/root_layout.js.map +1 -1
- package/lib/components/root-layout/root_layout_context.d.ts +1 -1
- package/lib/components/root-layout/root_layout_context.js +3 -3
- package/lib/components/root-layout/root_layout_context.js.map +1 -1
- package/lib/components/root-layout/root_layout_context.provider.js +2 -2
- package/lib/components/root-layout/root_layout_context.provider.js.map +1 -1
- package/lib/components/selected-total/SelectedTotal.js +1 -1
- package/lib/components/selected-total/SelectedTotal.js.map +1 -1
- package/lib/components/split_pane/split_pane.d.ts.map +1 -1
- package/lib/components/split_pane/split_pane.js +14 -18
- package/lib/components/split_pane/split_pane.js.map +1 -1
- package/lib/components/split_pane/split_pane_helpers.d.ts.map +1 -1
- package/lib/components/split_pane/split_pane_helpers.js +5 -1
- package/lib/components/split_pane/split_pane_helpers.js.map +1 -1
- package/lib/components/split_pane/use_split_pane_size.d.ts.map +1 -1
- package/lib/components/split_pane/use_split_pane_size.js +4 -3
- package/lib/components/split_pane/use_split_pane_size.js.map +1 -1
- package/lib/components/table/default_table_cell.d.ts.map +1 -1
- package/lib/components/table/default_table_cell.js +6 -14
- package/lib/components/table/default_table_cell.js.map +1 -1
- package/lib/components/table/flash_row/flashed_row_context.d.ts +1 -1
- package/lib/components/table/flash_row/flashed_row_context.js +3 -3
- package/lib/components/table/flash_row/flashed_row_context.js.map +1 -1
- package/lib/components/table/flash_row/flashed_row_provider.d.ts.map +1 -1
- package/lib/components/table/flash_row/flashed_row_provider.js +5 -4
- package/lib/components/table/flash_row/flashed_row_provider.js.map +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 +6 -5
- package/lib/components/table/flash_row/use_flash_row_effect.js.map +1 -1
- package/lib/components/table/preview_table.js +2 -2
- package/lib/components/table/preview_table.js.map +1 -1
- package/lib/components/table/preview_table_context.d.ts +2 -2
- package/lib/components/table/preview_table_context.js +6 -6
- package/lib/components/table/preview_table_context.js.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_context.d.ts +4 -6
- package/lib/components/table/reorder_rows/draggable_row_context.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/draggable_row_context.js +3 -3
- package/lib/components/table/reorder_rows/draggable_row_context.js.map +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 +4 -3
- package/lib/components/table/reorder_rows/draggable_row_tr.js.map +1 -1
- package/lib/components/table/reorder_rows/item_order_context.d.ts +2 -2
- package/lib/components/table/reorder_rows/item_order_context.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/item_order_context.js +3 -3
- package/lib/components/table/reorder_rows/item_order_context.js.map +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 +2 -2
- package/lib/components/table/reorder_rows/item_order_provider.js.map +1 -1
- package/lib/components/table/reorder_rows/use_drop_monitor.d.ts +2 -2
- package/lib/components/table/reorder_rows/use_drop_monitor.d.ts.map +1 -1
- package/lib/components/table/reorder_rows/use_drop_monitor.js +4 -4
- package/lib/components/table/reorder_rows/use_drop_monitor.js.map +1 -1
- package/lib/components/table/table_body.d.ts.map +1 -1
- package/lib/components/table/table_body.js +10 -6
- package/lib/components/table/table_body.js.map +1 -1
- package/lib/components/table/table_features.js +7 -7
- package/lib/components/table/table_features.js.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 +12 -12
- package/lib/components/table/table_root.js.map +1 -1
- package/lib/components/table/table_utils.d.ts +1 -1
- package/lib/components/table/table_utils.d.ts.map +1 -1
- package/lib/components/table/table_utils.js.map +1 -1
- package/lib/components/table/use_table_columns.d.ts +2 -2
- package/lib/components/table/use_table_columns.d.ts.map +1 -1
- package/lib/components/table/use_table_columns.js +4 -4
- package/lib/components/table/use_table_columns.js.map +1 -1
- package/lib/components/table/use_table_scroll.d.ts.map +1 -1
- package/lib/components/table/use_table_scroll.js +13 -15
- package/lib/components/table/use_table_scroll.js.map +1 -1
- package/lib/components/toolbar/OverflowButton.js +5 -5
- package/lib/components/toolbar/OverflowButton.js.map +1 -1
- package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.js +5 -8
- package/lib/components/toolbar/Toolbar.js.map +1 -1
- package/lib/components/toolbar/TooltipHelpContent.d.ts.map +1 -1
- package/lib/components/toolbar/TooltipHelpContent.js +5 -2
- package/lib/components/toolbar/TooltipHelpContent.js.map +1 -1
- package/lib/components/toolbar/toolbarContext.d.ts +3 -3
- package/lib/components/toolbar/toolbarContext.d.ts.map +1 -1
- package/lib/components/toolbar/toolbarContext.js +4 -4
- package/lib/components/toolbar/toolbarContext.js.map +1 -1
- package/lib/components/toolbar/useCheckOverflow.d.ts.map +1 -1
- package/lib/components/toolbar/useCheckOverflow.js +1 -0
- package/lib/components/toolbar/useCheckOverflow.js.map +1 -1
- package/lib/components/utils/debounce.d.ts +1 -1
- package/lib/components/utils/debounce.d.ts.map +1 -1
- package/lib/components/utils/debounce.js +3 -3
- package/lib/components/utils/debounce.js.map +1 -1
- package/lib/components/utils/forward_all_props_except.d.ts +2 -0
- package/lib/components/utils/forward_all_props_except.d.ts.map +1 -0
- package/lib/components/utils/{shouldForwardPropExcept.js → forward_all_props_except.js} +2 -2
- package/lib/components/utils/forward_all_props_except.js.map +1 -0
- package/lib/components/utils/svg.d.ts.map +1 -1
- package/lib/components/utils/svg.js +12 -6
- package/lib/components/utils/svg.js.map +1 -1
- package/lib/components/utils/svg_path_builder.d.ts +8 -8
- package/lib/components/utils/svg_path_builder.d.ts.map +1 -1
- package/lib/components/utils/svg_path_builder.js +16 -14
- package/lib/components/utils/svg_path_builder.js.map +1 -1
- package/lib/components/utils/throttle.d.ts +1 -1
- package/lib/components/utils/throttle.d.ts.map +1 -1
- package/lib/components/utils/throttle.js +10 -9
- package/lib/components/utils/throttle.js.map +1 -1
- package/package.json +47 -47
- package/src/components/accordion/accordion_context.ts +3 -3
- package/src/components/accordion/accordion_context_provider.tsx +3 -7
- package/src/components/accordion/accordion_hooks.ts +3 -3
- package/src/components/button/Button.tsx +11 -2
- package/src/components/color-picker/react-color/ColorPicker.tsx +36 -30
- package/src/components/color-picker/react-color/common/Alpha.tsx +5 -7
- package/src/components/color-picker/react-color/common/CheckBoard.tsx +2 -4
- package/src/components/color-picker/react-color/common/EditableInput.tsx +35 -29
- package/src/components/color-picker/react-color/common/Hue.tsx +5 -7
- package/src/components/color-picker/react-color/common/Saturation.tsx +7 -9
- package/src/components/color-picker/react-color/common/Swatch.tsx +18 -9
- package/src/components/color-picker/react-color/common/interaction.tsx +12 -13
- package/src/components/color-picker/react-color/common/useOnChange.tsx +2 -2
- package/src/components/color-picker/react-color/helpers/alpha.ts +6 -5
- package/src/components/color-picker/react-color/helpers/color.ts +16 -13
- package/src/components/color-picker/react-color/helpers/hue.ts +16 -25
- package/src/components/color-picker/react-color/helpers/saturation.ts +5 -3
- package/src/components/color-picker/react-color/sketch/SketchFields.tsx +8 -8
- package/src/components/color-picker/react-color/sketch/SketchPresetColors.tsx +9 -9
- package/src/components/dialog/ConfirmDialog.tsx +2 -2
- package/src/components/draggable/draggable.tsx +20 -18
- package/src/components/form/components/field_groups/svg_text_style.schema.ts +1 -1
- package/src/components/form/components/field_groups/svg_text_style.tsx +17 -15
- package/src/components/form/components/input/checkbox.tsx +3 -3
- package/src/components/form/components/input/color_picker.tsx +1 -1
- package/src/components/form/components/input/draggable_numeric_input.tsx +1 -1
- package/src/components/form/components/input/input.tsx +1 -1
- package/src/components/form/components/input/numeric_input.tsx +1 -1
- package/src/components/form/components/input/radio_group.tsx +1 -1
- package/src/components/form/components/input/select.tsx +1 -1
- package/src/components/form/components/input/switch.tsx +1 -1
- package/src/components/form/components/input/textarea.tsx +1 -1
- package/src/components/form/components/input_groups/form.tsx +3 -3
- package/src/components/form/components/input_groups/form_context.ts +3 -3
- package/src/components/form/components/layout/form.tsx +4 -6
- package/src/components/form/utils/validators.ts +29 -23
- package/src/components/fullscreen/fullscreen_context.provider.tsx +4 -9
- package/src/components/fullscreen/fullscreen_context.ts +3 -3
- package/src/components/hooks/useDoubleClick.ts +8 -8
- package/src/components/hooks/useOnClickOutside.ts +2 -2
- package/src/components/hooks/useOnOff.ts +5 -5
- package/src/components/hooks/useSelect.tsx +5 -3
- package/src/components/hooks/useToggle.ts +2 -2
- package/src/components/info-panel/InfoPanel.tsx +12 -16
- package/src/components/input/radio-button-group/RadioButtonGroup.tsx +5 -2
- package/src/components/logger/FifoLoggerDialog.tsx +1 -0
- package/src/components/logger/FifoLoggerProvider.tsx +2 -4
- package/src/components/logger/loggerContext.ts +1 -1
- package/src/components/logger/useFifoLogger.ts +7 -5
- package/src/components/root-layout/root_layout.tsx +6 -3
- package/src/components/root-layout/root_layout_context.provider.tsx +3 -3
- package/src/components/root-layout/root_layout_context.ts +3 -3
- package/src/components/selected-total/SelectedTotal.tsx +1 -1
- package/src/components/split_pane/split_pane.tsx +17 -20
- package/src/components/split_pane/split_pane_helpers.ts +7 -2
- package/src/components/split_pane/use_split_pane_size.tsx +4 -3
- package/src/components/table/default_table_cell.tsx +10 -11
- package/src/components/table/flash_row/flashed_row_context.ts +3 -3
- package/src/components/table/flash_row/flashed_row_provider.tsx +8 -6
- package/src/components/table/flash_row/use_flash_row_effect.ts +7 -5
- package/src/components/table/preview_table.tsx +3 -3
- package/src/components/table/preview_table_context.ts +6 -6
- package/src/components/table/reorder_rows/draggable_row_context.ts +6 -10
- package/src/components/table/reorder_rows/draggable_row_tr.tsx +11 -6
- package/src/components/table/reorder_rows/item_order_context.ts +4 -4
- package/src/components/table/reorder_rows/item_order_provider.tsx +2 -6
- package/src/components/table/reorder_rows/use_drop_monitor.ts +4 -4
- package/src/components/table/table_body.tsx +19 -5
- package/src/components/table/table_features.ts +12 -12
- package/src/components/table/table_root.tsx +20 -18
- package/src/components/table/table_utils.ts +4 -5
- package/src/components/table/use_table_columns.ts +7 -7
- package/src/components/table/use_table_scroll.ts +18 -21
- package/src/components/toolbar/OverflowButton.tsx +5 -5
- package/src/components/toolbar/Toolbar.tsx +8 -20
- package/src/components/toolbar/TooltipHelpContent.tsx +10 -5
- package/src/components/toolbar/toolbarContext.ts +5 -7
- package/src/components/toolbar/useCheckOverflow.tsx +1 -0
- package/src/components/utils/debounce.ts +5 -5
- package/src/components/utils/{shouldForwardPropExcept.ts → forward_all_props_except.ts} +1 -1
- package/src/components/utils/svg.ts +5 -2
- package/src/components/utils/svg_path_builder.ts +22 -19
- package/src/components/utils/throttle.ts +13 -11
- package/lib/components/utils/shouldForwardPropExcept.d.ts +0 -2
- package/lib/components/utils/shouldForwardPropExcept.d.ts.map +0 -1
- package/lib/components/utils/shouldForwardPropExcept.js.map +0 -1
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
import { useEffect, useMemo, useRef } from 'react';
|
|
13
13
|
import { match } from 'ts-pattern';
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import { forwardAllPropsExcept } from '../utils/forward_all_props_except.ts';
|
|
16
16
|
|
|
17
17
|
import { FlashedRowProvider } from './flash_row/flashed_row_provider.js';
|
|
18
18
|
import type { PreviewTablePropsContextValue } from './preview_table_context.js';
|
|
@@ -27,7 +27,7 @@ import { ScrollContainer } from './table_scroll_container.js';
|
|
|
27
27
|
import type {
|
|
28
28
|
GetTdProps,
|
|
29
29
|
Scroller,
|
|
30
|
-
|
|
30
|
+
TableColumnDefinition,
|
|
31
31
|
TableRowPreviewRenderer,
|
|
32
32
|
TableRowTrRenderer,
|
|
33
33
|
VirtualScroller,
|
|
@@ -35,7 +35,7 @@ import type {
|
|
|
35
35
|
import { useTableColumns } from './use_table_columns.js';
|
|
36
36
|
|
|
37
37
|
const CustomHTMLTable = styled(HTMLTable, {
|
|
38
|
-
shouldForwardProp:
|
|
38
|
+
shouldForwardProp: forwardAllPropsExcept([
|
|
39
39
|
'striped',
|
|
40
40
|
'stickyHeader',
|
|
41
41
|
'noHeader',
|
|
@@ -83,7 +83,7 @@ interface TableBaseProps<TData extends RowData> {
|
|
|
83
83
|
* Tanstack table definition of columns in the table.
|
|
84
84
|
*/
|
|
85
85
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
86
|
-
columns: Array<
|
|
86
|
+
columns: Array<TableColumnDefinition<TData, any>>;
|
|
87
87
|
/**
|
|
88
88
|
* Show borders between each cell and row of the table.
|
|
89
89
|
*/
|
|
@@ -327,7 +327,7 @@ export function Table<TData extends RowData>(props: TableProps<TData>) {
|
|
|
327
327
|
virtualScrollElementRef
|
|
328
328
|
: // When not virtualized, ScrollContainer does not render a container, only its children,
|
|
329
329
|
// And the scrollable element is provided by the user or by default, the <table> element.
|
|
330
|
-
|
|
330
|
+
|
|
331
331
|
props.scrollableElementRef || tableRef
|
|
332
332
|
}
|
|
333
333
|
scrollToRowRef={scrollToRowRef}
|
|
@@ -380,19 +380,21 @@ function useCheckProps<TData extends RowData>(
|
|
|
380
380
|
) {
|
|
381
381
|
const { onRowOrderChanged, getRowId } = props;
|
|
382
382
|
useEffect(() => {
|
|
383
|
-
if (onRowOrderChanged) {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
383
|
+
if (!onRowOrderChanged) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (!getRowId) {
|
|
388
|
+
// eslint-disable-next-line no-console
|
|
389
|
+
console.warn(
|
|
390
|
+
'When reordering rows is enabled via the `onRowOrderChanged` prop, the `getRowId` prop must be provided to identify each row unambiguously.',
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
if (headers.some((header) => header.column.getCanSort())) {
|
|
394
|
+
// eslint-disable-next-line no-console
|
|
395
|
+
console.warn(
|
|
396
|
+
'When reordering rows is enabled via the `onRowOrderChanged` prop, none of the columns should be sortable as data order will be overriden by internal sorting.',
|
|
397
|
+
);
|
|
396
398
|
}
|
|
397
399
|
}, [onRowOrderChanged, getRowId, headers]);
|
|
398
400
|
}
|
|
@@ -5,11 +5,10 @@ import type { CSSProperties, ReactNode, TdHTMLAttributes } from 'react';
|
|
|
5
5
|
|
|
6
6
|
import type { ReactScienceTableFeatures } from './table_features.js';
|
|
7
7
|
|
|
8
|
-
export type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
>;
|
|
8
|
+
export type TableColumnDefinition<
|
|
9
|
+
TData extends RowData,
|
|
10
|
+
TValue = unknown,
|
|
11
|
+
> = ColumnDef<ReactScienceTableFeatures, TData, TValue>;
|
|
13
12
|
|
|
14
13
|
type TableTdProps = TdHTMLAttributes<HTMLTableCellElement>;
|
|
15
14
|
|
|
@@ -2,17 +2,17 @@ import type { RowData } from '@tanstack/react-table';
|
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
import { defaultTableCell } from './default_table_cell.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { TableColumnDefinition } from './table_utils.js';
|
|
6
6
|
|
|
7
7
|
export function useTableColumns<TData extends RowData, TValue>(
|
|
8
|
-
columnDefs: Array<
|
|
8
|
+
columnDefs: Array<TableColumnDefinition<TData, TValue>>,
|
|
9
9
|
) {
|
|
10
|
-
return useMemo<Array<
|
|
11
|
-
return columnDefs.map((
|
|
10
|
+
return useMemo<Array<TableColumnDefinition<TData, TValue>>>(() => {
|
|
11
|
+
return columnDefs.map((columnDefinition) => {
|
|
12
12
|
return {
|
|
13
|
-
...
|
|
14
|
-
cell:
|
|
15
|
-
enableSorting:
|
|
13
|
+
...columnDefinition,
|
|
14
|
+
cell: columnDefinition.cell ?? defaultTableCell,
|
|
15
|
+
enableSorting: columnDefinition.enableSorting ?? false,
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
18
|
}, [columnDefs]);
|
|
@@ -59,27 +59,24 @@ export function useTableScroll<TData extends RowData>(options: {
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
|
-
} else {
|
|
63
|
-
return {
|
|
64
|
-
scrollIntoView(
|
|
65
|
-
id: string,
|
|
66
|
-
options?: TableVirtualScrollIntoViewOptions,
|
|
67
|
-
) {
|
|
68
|
-
const element = scrollRef.current?.querySelector(
|
|
69
|
-
selector`tr[data-row-id="${id}"]`,
|
|
70
|
-
);
|
|
71
|
-
if (!element) {
|
|
72
|
-
// eslint-disable-next-line no-console
|
|
73
|
-
console.warn(
|
|
74
|
-
`Could not scroll to row with ID ${id}, the row does not exist`,
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
element?.scrollIntoView(options);
|
|
78
|
-
if (options?.flashRow && options.behavior !== 'smooth') {
|
|
79
|
-
setFlashedRow(id);
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
62
|
}
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
scrollIntoView(id: string, options?: TableVirtualScrollIntoViewOptions) {
|
|
66
|
+
const element = scrollRef.current?.querySelector(
|
|
67
|
+
selector`tr[data-row-id="${id}"]`,
|
|
68
|
+
);
|
|
69
|
+
if (!element) {
|
|
70
|
+
// eslint-disable-next-line no-console
|
|
71
|
+
console.warn(
|
|
72
|
+
`Could not scroll to row with ID ${id}, the row does not exist`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
element?.scrollIntoView(options);
|
|
76
|
+
if (options?.flashRow && options.behavior !== 'smooth') {
|
|
77
|
+
setFlashedRow(id);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
};
|
|
84
81
|
}, [virtualizeRows, scrollRef, table, virtualizer, setFlashedRow]);
|
|
85
82
|
}
|
|
@@ -20,10 +20,10 @@ export interface OverButtonProps extends BaseOverButtonProps {
|
|
|
20
20
|
|
|
21
21
|
function getPlacement(
|
|
22
22
|
placement: Placement,
|
|
23
|
-
|
|
23
|
+
isVertical?: boolean,
|
|
24
24
|
): PopoverNextProps['placement'] {
|
|
25
25
|
const isEndPlacement = placement === 'end';
|
|
26
|
-
return
|
|
26
|
+
return isVertical
|
|
27
27
|
? `${isEndPlacement ? 'top' : 'bottom'}-start`
|
|
28
28
|
: `${isEndPlacement ? 'left' : 'right'}-start`;
|
|
29
29
|
}
|
|
@@ -78,7 +78,7 @@ export function OverflowButton(props: OverButtonProps) {
|
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
function getOverflowShadow(placement: Placement,
|
|
81
|
+
function getOverflowShadow(placement: Placement, isVertical?: boolean) {
|
|
82
82
|
const color = 'rgba(0, 0, 0, 0.15)';
|
|
83
83
|
const offset = 8;
|
|
84
84
|
const blur = 8;
|
|
@@ -86,8 +86,8 @@ function getOverflowShadow(placement: Placement, vertical?: boolean) {
|
|
|
86
86
|
|
|
87
87
|
const sign = placement === 'start' ? 1 : -1;
|
|
88
88
|
|
|
89
|
-
const x =
|
|
90
|
-
const y =
|
|
89
|
+
const x = isVertical ? 0 : offset * sign;
|
|
90
|
+
const y = isVertical ? offset * sign : 0;
|
|
91
91
|
|
|
92
92
|
return `${x}px ${y}px ${blur}px -${spread}px ${color}`;
|
|
93
93
|
}
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from '@blueprintjs/core';
|
|
14
14
|
import type { StyledComponent } from '@emotion/styled';
|
|
15
15
|
import styled from '@emotion/styled';
|
|
16
|
-
import type { MouseEvent
|
|
16
|
+
import type { MouseEvent } from 'react';
|
|
17
17
|
import { useLayoutEffect, useMemo, useRef } from 'react';
|
|
18
18
|
|
|
19
19
|
import type { ButtonProps } from '../button/index.js';
|
|
@@ -22,8 +22,7 @@ import { normalizeIcon } from '../icon.js';
|
|
|
22
22
|
|
|
23
23
|
import type { BaseOverButtonProps, Placement } from './OverflowButton.tsx';
|
|
24
24
|
import { OverflowButton } from './OverflowButton.tsx';
|
|
25
|
-
import
|
|
26
|
-
import { toolbarContext, useToolbarContext } from './toolbarContext.js';
|
|
25
|
+
import { ToolbarContext, useToolbarContext } from './toolbarContext.js';
|
|
27
26
|
import { useCheckOverflow } from './useCheckOverflow.tsx';
|
|
28
27
|
|
|
29
28
|
export type Overflow = 'wrap' | 'collapse';
|
|
@@ -163,8 +162,8 @@ export function Toolbar(props: ToolbarProps) {
|
|
|
163
162
|
}
|
|
164
163
|
ref.current.style.width = 'initial';
|
|
165
164
|
const divRect = ref.current.getBoundingClientRect();
|
|
166
|
-
const
|
|
167
|
-
const width = `${
|
|
165
|
+
const lastElementRect = lastElement.getBoundingClientRect();
|
|
166
|
+
const width = `${lastElementRect.right - divRect.left}px`;
|
|
168
167
|
if (ref.current.style.width !== width) {
|
|
169
168
|
ref.current.style.width = width;
|
|
170
169
|
}
|
|
@@ -182,7 +181,7 @@ export function Toolbar(props: ToolbarProps) {
|
|
|
182
181
|
|
|
183
182
|
if (overflow === 'wrap') {
|
|
184
183
|
return (
|
|
185
|
-
<
|
|
184
|
+
<ToolbarContext value={contextValue}>
|
|
186
185
|
<ButtonGroup
|
|
187
186
|
role="toolbar"
|
|
188
187
|
aria-label={ariaLabel}
|
|
@@ -197,12 +196,12 @@ export function Toolbar(props: ToolbarProps) {
|
|
|
197
196
|
>
|
|
198
197
|
{children}
|
|
199
198
|
</ButtonGroup>
|
|
200
|
-
</
|
|
199
|
+
</ToolbarContext>
|
|
201
200
|
);
|
|
202
201
|
}
|
|
203
202
|
|
|
204
203
|
return (
|
|
205
|
-
<
|
|
204
|
+
<ToolbarContext value={contextValue}>
|
|
206
205
|
<Container vertical={vertical} placement={placement}>
|
|
207
206
|
<ButtonGroup
|
|
208
207
|
role="toolbar"
|
|
@@ -234,7 +233,7 @@ export function Toolbar(props: ToolbarProps) {
|
|
|
234
233
|
</OverflowButton>
|
|
235
234
|
)}
|
|
236
235
|
</Container>
|
|
237
|
-
</
|
|
236
|
+
</ToolbarContext>
|
|
238
237
|
);
|
|
239
238
|
}
|
|
240
239
|
|
|
@@ -351,14 +350,3 @@ Toolbar.PopoverItem = function ToolbarPopoverItem(
|
|
|
351
350
|
/>
|
|
352
351
|
);
|
|
353
352
|
};
|
|
354
|
-
|
|
355
|
-
function ToolbarProvider(props: {
|
|
356
|
-
value: ToolbarContext;
|
|
357
|
-
children: ReactNode;
|
|
358
|
-
}) {
|
|
359
|
-
return (
|
|
360
|
-
<toolbarContext.Provider value={props.value}>
|
|
361
|
-
{props.children}
|
|
362
|
-
</toolbarContext.Provider>
|
|
363
|
-
);
|
|
364
|
-
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
+
import type { Mandatory } from '@zakodium/utils';
|
|
2
3
|
import type { CSSProperties } from 'react';
|
|
3
4
|
|
|
4
5
|
const shortcutBoxSize = 1.5;
|
|
@@ -81,14 +82,18 @@ export interface TooltipItem {
|
|
|
81
82
|
style?: CSSProperties;
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
const defaultShortCuts: Mandatory<TooltipItem['shortcuts']> = [];
|
|
86
|
+
const defaultSubTitles: Mandatory<TooltipItem['subTitles']> = [];
|
|
87
|
+
const defaultStyle: Mandatory<TooltipItem['style']> = {};
|
|
88
|
+
|
|
84
89
|
export function TooltipHelpContent(props: TooltipItem) {
|
|
85
90
|
const {
|
|
86
91
|
title,
|
|
87
|
-
shortcuts =
|
|
88
|
-
subTitles =
|
|
92
|
+
shortcuts = defaultShortCuts,
|
|
93
|
+
subTitles = defaultSubTitles,
|
|
89
94
|
description = '',
|
|
90
95
|
link,
|
|
91
|
-
style =
|
|
96
|
+
style = defaultStyle,
|
|
92
97
|
} = props;
|
|
93
98
|
|
|
94
99
|
return (
|
|
@@ -135,8 +140,8 @@ function ShortCuts({ shortcuts }: { shortcuts: string[] }) {
|
|
|
135
140
|
>
|
|
136
141
|
{shortcuts.map((shortcut, index) => {
|
|
137
142
|
return (
|
|
138
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
139
|
-
<ShortcutItem key={
|
|
143
|
+
// eslint-disable-next-line @eslint-react/no-array-index-key
|
|
144
|
+
<ShortcutItem key={index}>
|
|
140
145
|
<span>{shortcut}</span>
|
|
141
146
|
</ShortcutItem>
|
|
142
147
|
);
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import type { Intent } from '@blueprintjs/core';
|
|
2
|
-
import { createContext,
|
|
2
|
+
import { createContext, use } from 'react';
|
|
3
3
|
|
|
4
4
|
import type { PopoverInteractionType } from './Toolbar.js';
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface ToolbarContextValue {
|
|
7
7
|
intent?: Intent;
|
|
8
8
|
vertical?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
popoverInteractionKind?: PopoverInteractionType;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const ToolbarContext = createContext<ToolbarContextValue | null>(null);
|
|
14
14
|
|
|
15
15
|
export function useToolbarContext() {
|
|
16
|
-
const ctx =
|
|
16
|
+
const ctx = use(ToolbarContext);
|
|
17
17
|
if (!ctx) {
|
|
18
|
-
throw new Error(
|
|
19
|
-
'useToolbarContext must be used within a ToolbarContextProvider',
|
|
20
|
-
);
|
|
18
|
+
throw new Error('useToolbarContext must be used within a ToolbarContext');
|
|
21
19
|
}
|
|
22
20
|
return ctx;
|
|
23
21
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export function debounce<T extends (...
|
|
2
|
-
|
|
1
|
+
export function debounce<T extends (...arguments_: any[]) => any>(
|
|
2
|
+
function_: T,
|
|
3
3
|
wait: number,
|
|
4
|
-
): (...
|
|
4
|
+
): (...arguments_: Parameters<T>) => void {
|
|
5
5
|
let timeout: ReturnType<typeof setTimeout> | null;
|
|
6
6
|
|
|
7
|
-
return (...
|
|
7
|
+
return (...arguments_: Parameters<T>) => {
|
|
8
8
|
if (timeout) {
|
|
9
9
|
clearTimeout(timeout);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
timeout = setTimeout(() => {
|
|
13
|
-
|
|
13
|
+
function_.apply({}, arguments_);
|
|
14
14
|
}, wait);
|
|
15
15
|
};
|
|
16
16
|
}
|
|
@@ -42,7 +42,9 @@ export function exportSVG(
|
|
|
42
42
|
options: ExportSVGOptions = {},
|
|
43
43
|
): string {
|
|
44
44
|
const {
|
|
45
|
+
// eslint-disable-next-line unicorn/no-non-function-verb-prefix
|
|
45
46
|
removeFromSelector,
|
|
47
|
+
// eslint-disable-next-line unicorn/no-non-function-verb-prefix
|
|
46
48
|
addBackground = false,
|
|
47
49
|
backgroundColor = 'white',
|
|
48
50
|
customMutations,
|
|
@@ -60,8 +62,6 @@ export function exportSVG(
|
|
|
60
62
|
|
|
61
63
|
if (addBackground) {
|
|
62
64
|
const background = document.createElementNS(
|
|
63
|
-
// XML namespaces are immutable. This false-positive is fixed in eslint-plugin-unicorn v66.
|
|
64
|
-
// eslint-disable-next-line unicorn/prefer-https
|
|
65
65
|
'http://www.w3.org/2000/svg',
|
|
66
66
|
'rect',
|
|
67
67
|
);
|
|
@@ -89,7 +89,9 @@ export async function exportSVGAsPNG(
|
|
|
89
89
|
options: ExportSVGOptions = {},
|
|
90
90
|
): Promise<Blob> {
|
|
91
91
|
const {
|
|
92
|
+
// eslint-disable-next-line unicorn/no-non-function-verb-prefix
|
|
92
93
|
removeFromSelector,
|
|
94
|
+
// eslint-disable-next-line unicorn/no-non-function-verb-prefix
|
|
93
95
|
addBackground = false,
|
|
94
96
|
backgroundColor = 'white',
|
|
95
97
|
customMutations,
|
|
@@ -104,6 +106,7 @@ export async function exportSVGAsPNG(
|
|
|
104
106
|
|
|
105
107
|
const img = new Image();
|
|
106
108
|
img.src = URL.createObjectURL(svgBlob);
|
|
109
|
+
// eslint-disable-next-line unicorn/prefer-await
|
|
107
110
|
await img.decode().finally(() => URL.revokeObjectURL(img.src));
|
|
108
111
|
|
|
109
112
|
const canvas = new OffscreenCanvas(img.naturalWidth, img.naturalHeight);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Better dom readability.
|
|
3
|
+
*/
|
|
2
4
|
const DEFAULT_SEPARATOR = '\n ';
|
|
3
5
|
const DEFAULT_CLAMP_VALUE = 1e5;
|
|
4
6
|
|
|
@@ -17,7 +19,23 @@ const DEFAULT_CLAMP_VALUE = 1e5;
|
|
|
17
19
|
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/d
|
|
18
20
|
*/
|
|
19
21
|
export class SVGPathBuilder {
|
|
22
|
+
/**
|
|
23
|
+
* Merge many path builders into a new single one.
|
|
24
|
+
*
|
|
25
|
+
* @param builders
|
|
26
|
+
*/
|
|
27
|
+
static concat(...builders: SVGPathBuilder[]): SVGPathBuilder {
|
|
28
|
+
const builder = new SVGPathBuilder();
|
|
29
|
+
|
|
30
|
+
builder.#buffer = builder.#buffer.concat(
|
|
31
|
+
builders.flatMap((path) => path.getBufferSlice()),
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return builder;
|
|
35
|
+
}
|
|
36
|
+
|
|
20
37
|
#buffer: string[] = [];
|
|
38
|
+
|
|
21
39
|
clampValue: number | null;
|
|
22
40
|
|
|
23
41
|
/**
|
|
@@ -51,10 +69,10 @@ export class SVGPathBuilder {
|
|
|
51
69
|
/**
|
|
52
70
|
* Get a shallow copy of internal the buffer.
|
|
53
71
|
*
|
|
54
|
-
* @param
|
|
72
|
+
* @param sliceArguments
|
|
55
73
|
*/
|
|
56
|
-
getBufferSlice(...
|
|
57
|
-
return this.#buffer.slice(...
|
|
74
|
+
getBufferSlice(...sliceArguments: [start?: number, end?: number]) {
|
|
75
|
+
return this.#buffer.slice(...sliceArguments);
|
|
58
76
|
}
|
|
59
77
|
|
|
60
78
|
/**
|
|
@@ -107,19 +125,4 @@ export class SVGPathBuilder {
|
|
|
107
125
|
toString(separator = DEFAULT_SEPARATOR): string {
|
|
108
126
|
return this.#buffer.join(separator);
|
|
109
127
|
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Merge many path builders into a new single one.
|
|
113
|
-
*
|
|
114
|
-
* @param builders
|
|
115
|
-
*/
|
|
116
|
-
static concat(...builders: SVGPathBuilder[]): SVGPathBuilder {
|
|
117
|
-
const builder = new SVGPathBuilder();
|
|
118
|
-
|
|
119
|
-
builder.#buffer = builder.#buffer.concat(
|
|
120
|
-
builders.flatMap((path) => path.getBufferSlice()),
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
return builder;
|
|
124
|
-
}
|
|
125
128
|
}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
export function throttle<T extends (...
|
|
2
|
-
|
|
1
|
+
export function throttle<T extends (...arguments_: any[]) => void>(
|
|
2
|
+
function_: T,
|
|
3
3
|
limit: number,
|
|
4
4
|
): T {
|
|
5
|
-
let
|
|
5
|
+
let isInThrottle: boolean;
|
|
6
6
|
|
|
7
|
-
const fun = (...
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
inThrottle = true;
|
|
11
|
-
|
|
12
|
-
setTimeout(() => {
|
|
13
|
-
inThrottle = false;
|
|
14
|
-
}, limit);
|
|
7
|
+
const fun = (...arguments_: any[]) => {
|
|
8
|
+
if (isInThrottle) {
|
|
9
|
+
return;
|
|
15
10
|
}
|
|
11
|
+
|
|
12
|
+
function_.apply({}, arguments_);
|
|
13
|
+
isInThrottle = true;
|
|
14
|
+
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
isInThrottle = false;
|
|
17
|
+
}, limit);
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
return fun as T;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shouldForwardPropExcept.d.ts","sourceRoot":"","sources":["../../../src/components/utils/shouldForwardPropExcept.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,IAElD,UAAU,MAAM,aAGzB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shouldForwardPropExcept.js","sourceRoot":"","sources":["../../../src/components/utils/shouldForwardPropExcept.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,uBAAuB,CAAC,UAAoB;IAC1D,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IACrC,OAAO,CAAC,QAAgB,EAAE,EAAE;QAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC"}
|