@neo4j-ndl/react 4.3.6 → 4.4.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/cjs/_common/types.js.map +1 -1
- package/lib/cjs/_common/utils.js +4 -4
- package/lib/cjs/_common/utils.js.map +1 -1
- package/lib/cjs/accordion/Accordion.js +5 -5
- package/lib/cjs/accordion/Accordion.js.map +1 -1
- package/lib/cjs/accordion/accordion-context.js +1 -1
- package/lib/cjs/accordion/accordion-context.js.map +1 -1
- package/lib/cjs/accordion/stories/accordion.stories.js +20 -20
- package/lib/cjs/accordion/stories/accordion.stories.js.map +1 -1
- package/lib/cjs/ai/presence/Presence.js +1 -0
- package/lib/cjs/ai/presence/Presence.js.map +1 -1
- package/lib/cjs/avatar/stories/avatar.stories.js +18 -18
- package/lib/cjs/avatar/stories/avatar.stories.js.map +1 -1
- package/lib/cjs/banner/Banner.js +1 -1
- package/lib/cjs/banner/Banner.js.map +1 -1
- package/lib/cjs/breadcrumbs/stories/breadcrumbs.stories.js +1 -1
- package/lib/cjs/breadcrumbs/stories/breadcrumbs.stories.js.map +1 -1
- package/lib/cjs/checkbox/stories/checkbox-full.story.js +2 -2
- package/lib/cjs/checkbox/stories/checkbox-full.story.js.map +1 -1
- package/lib/cjs/checkbox/stories/checkbox.stories.js +19 -19
- package/lib/cjs/checkbox/stories/checkbox.stories.js.map +1 -1
- package/lib/cjs/clean-icon-button/stories/clean-icon-button.stories.js +11 -11
- package/lib/cjs/clean-icon-button/stories/clean-icon-button.stories.js.map +1 -1
- package/lib/cjs/code-block/stories/code-disabled.story.js +2 -2
- package/lib/cjs/code-block/stories/code-disabled.story.js.map +1 -1
- package/lib/cjs/code-block/stories/code-full.story.js +2 -2
- package/lib/cjs/code-block/stories/code-full.story.js.map +1 -1
- package/lib/cjs/code-block/stories/code-with-actions.story.js +2 -2
- package/lib/cjs/code-block/stories/code-with-actions.story.js.map +1 -1
- package/lib/cjs/code-block/themes/ndl-code-dark.js +64 -64
- package/lib/cjs/code-block/themes/ndl-code-dark.js.map +1 -1
- package/lib/cjs/code-block/themes/ndl-code-light.js +64 -64
- package/lib/cjs/code-block/themes/ndl-code-light.js.map +1 -1
- package/lib/cjs/color-picker/ColorPicker.js +1 -1
- package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
- package/lib/cjs/color-picker/stories/color-picker.stories.js +4 -4
- package/lib/cjs/color-picker/stories/color-picker.stories.js.map +1 -1
- package/lib/cjs/data-grid/Components.js +14 -12
- package/lib/cjs/data-grid/Components.js.map +1 -1
- package/lib/cjs/data-grid/DataGrid.js.map +1 -1
- package/lib/cjs/data-grid/data-grid-context.js +1 -1
- package/lib/cjs/data-grid/data-grid-context.js.map +1 -1
- package/lib/cjs/data-grid/data-grid-nav/index.js +1 -1
- package/lib/cjs/data-grid/data-grid-nav/index.js.map +1 -1
- package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js +1 -1
- package/lib/cjs/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
- package/lib/cjs/data-grid/stories/datagrid-single-selectable.story.js +0 -24
- package/lib/cjs/data-grid/stories/datagrid-single-selectable.story.js.map +1 -1
- package/lib/cjs/date-picker/DatePicker.js.map +1 -1
- package/lib/cjs/date-picker/stories/date-picker-full.story.js +9 -9
- package/lib/cjs/date-picker/stories/date-picker-full.story.js.map +1 -1
- package/lib/cjs/divider/stories/divider-horizontal.story.js +1 -1
- package/lib/cjs/divider/stories/divider-horizontal.story.js.map +1 -1
- package/lib/cjs/divider/stories/divider-vertical.story.js +1 -1
- package/lib/cjs/divider/stories/divider-vertical.story.js.map +1 -1
- package/lib/cjs/drawer/stories/drawer.stories.js +19 -19
- package/lib/cjs/drawer/stories/drawer.stories.js.map +1 -1
- package/lib/cjs/dropdown-button/DropdownButton.js.map +1 -1
- package/lib/cjs/dropdown-button/stories/dropdown-button.stories.js +18 -18
- package/lib/cjs/dropdown-button/stories/dropdown-button.stories.js.map +1 -1
- package/lib/cjs/dropzone/stories/dropzone-disabled.story.js +1 -1
- package/lib/cjs/dropzone/stories/dropzone-disabled.story.js.map +1 -1
- package/lib/cjs/dropzone/stories/dropzone-full.story.js +11 -11
- package/lib/cjs/dropzone/stories/dropzone-full.story.js.map +1 -1
- package/lib/cjs/dropzone/stories/dropzone.stories.js +10 -10
- package/lib/cjs/dropzone/stories/dropzone.stories.js.map +1 -1
- package/lib/cjs/flex/Flex.js +4 -4
- package/lib/cjs/flex/Flex.js.map +1 -1
- package/lib/cjs/graph-label/stories/graph-label.stories.js +20 -20
- package/lib/cjs/graph-label/stories/graph-label.stories.js.map +1 -1
- package/lib/cjs/hooks/index.js +3 -3
- package/lib/cjs/hooks/index.js.map +1 -1
- package/lib/cjs/icon-button/stories/icon-button.stories.js +12 -12
- package/lib/cjs/icon-button/stories/icon-button.stories.js.map +1 -1
- package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js +16 -16
- package/lib/cjs/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
- package/lib/cjs/icon-button-base/IconButtonBase.js +5 -3
- package/lib/cjs/icon-button-base/IconButtonBase.js.map +1 -1
- package/lib/cjs/icons/generated/custom/DatabaseCross.js +1 -1
- package/lib/cjs/icons/generated/custom/DatabaseCross.js.map +1 -1
- package/lib/cjs/icons/generated/custom/DatabasePlus.js +1 -1
- package/lib/cjs/icons/generated/custom/DatabasePlus.js.map +1 -1
- package/lib/cjs/icons/generated/custom/GlobePin.js +1 -1
- package/lib/cjs/icons/generated/custom/GlobePin.js.map +1 -1
- package/lib/cjs/icons/generated/custom/PanelBottom.js +1 -1
- package/lib/cjs/icons/generated/custom/PanelBottom.js.map +1 -1
- package/lib/cjs/icons/generated/custom/PanelLeftCollapsed.js +30 -0
- package/lib/cjs/icons/generated/custom/PanelLeftCollapsed.js.map +1 -0
- package/lib/cjs/icons/generated/custom/PanelLeftExpanded.js +30 -0
- package/lib/cjs/icons/generated/custom/PanelLeftExpanded.js.map +1 -0
- package/lib/cjs/icons/generated/custom/PanelRightCollapsed.js +30 -0
- package/lib/cjs/icons/generated/custom/PanelRightCollapsed.js.map +1 -0
- package/lib/cjs/icons/generated/custom/PanelRightExpanded.js +30 -0
- package/lib/cjs/icons/generated/custom/PanelRightExpanded.js.map +1 -0
- package/lib/cjs/icons/generated/custom/ThreePanel.js +1 -1
- package/lib/cjs/icons/generated/custom/ThreePanel.js.map +1 -1
- package/lib/cjs/icons/generated/custom/index.js +9 -1
- package/lib/cjs/icons/generated/custom/index.js.map +1 -1
- package/lib/cjs/icons/wrapIcon.js +2 -2
- package/lib/cjs/icons/wrapIcon.js.map +1 -1
- package/lib/cjs/kbd/stories/kbd.stories.js +7 -7
- package/lib/cjs/kbd/stories/kbd.stories.js.map +1 -1
- package/lib/cjs/loading-spinner/LoadingSpinner.js +2 -2
- package/lib/cjs/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/cjs/loading-spinner/stories/loading-spinner.stories.js +10 -10
- package/lib/cjs/loading-spinner/stories/loading-spinner.stories.js.map +1 -1
- package/lib/cjs/logo/Logo.js +6 -6
- package/lib/cjs/logo/Logo.js.map +1 -1
- package/lib/cjs/logo/stories/logo.stories.js +9 -9
- package/lib/cjs/logo/stories/logo.stories.js.map +1 -1
- package/lib/cjs/menu/Menu.js +3 -3
- package/lib/cjs/menu/Menu.js.map +1 -1
- package/lib/cjs/menu/stories/menu-custom-items.story.js +3 -1
- package/lib/cjs/menu/stories/menu-custom-items.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-default.story.js +3 -1
- package/lib/cjs/menu/stories/menu-default.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-in-dialog.story.js +5 -1
- package/lib/cjs/menu/stories/menu-in-dialog.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-in-popover.story.js +3 -1
- package/lib/cjs/menu/stories/menu-in-popover.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-nested.story.js +3 -1
- package/lib/cjs/menu/stories/menu-nested.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-placements.story.js +3 -1
- package/lib/cjs/menu/stories/menu-placements.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-with-category.story.js +1 -2
- package/lib/cjs/menu/stories/menu-with-category.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-with-disabled-item.story.js +1 -2
- package/lib/cjs/menu/stories/menu-with-disabled-item.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-with-divider.story.js +1 -2
- package/lib/cjs/menu/stories/menu-with-divider.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-with-icon.story.js +3 -1
- package/lib/cjs/menu/stories/menu-with-icon.story.js.map +1 -1
- package/lib/cjs/menu/stories/menu-with-keyboard-shortcuts.story.js +3 -1
- package/lib/cjs/menu/stories/menu-with-keyboard-shortcuts.story.js.map +1 -1
- package/lib/cjs/popover/Popover.js +15 -15
- package/lib/cjs/popover/Popover.js.map +1 -1
- package/lib/cjs/popover/use-popover.js +9 -9
- package/lib/cjs/popover/use-popover.js.map +1 -1
- package/lib/cjs/progress-bar/stories/progress-bar.stories.js +3 -3
- package/lib/cjs/progress-bar/stories/progress-bar.stories.js.map +1 -1
- package/lib/cjs/segmented-control/SegmentedControl.js +1 -1
- package/lib/cjs/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/cjs/select/Overrides.js +41 -41
- package/lib/cjs/select/Overrides.js.map +1 -1
- package/lib/cjs/select/Select.js +25 -3
- package/lib/cjs/select/Select.js.map +1 -1
- package/lib/cjs/select/stories/select-async.story.js +4 -4
- package/lib/cjs/select/stories/select-async.story.js.map +1 -1
- package/lib/cjs/select/stories/select-controlled.story.js +4 -4
- package/lib/cjs/select/stories/select-controlled.story.js.map +1 -1
- package/lib/cjs/select/stories/select-creatable.story.js +1 -1
- package/lib/cjs/select/stories/select-creatable.story.js.map +1 -1
- package/lib/cjs/select/stories/select-custom-label.story.js +1 -1
- package/lib/cjs/select/stories/select-custom-label.story.js.map +1 -1
- package/lib/cjs/select/stories/select-disabled.story.js +1 -1
- package/lib/cjs/select/stories/select-disabled.story.js.map +1 -1
- package/lib/cjs/select/stories/select-inside-dialog.story.js +1 -1
- package/lib/cjs/select/stories/select-inside-dialog.story.js.map +1 -1
- package/lib/cjs/side-navigation/SideNavigation.js +1 -1
- package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
- package/lib/cjs/side-navigation/stories/side-nav.stories.js +1 -1
- package/lib/cjs/side-navigation/stories/side-nav.stories.js.map +1 -1
- package/lib/cjs/skeleton/stories/skeleton.stories.js +28 -28
- package/lib/cjs/skeleton/stories/skeleton.stories.js.map +1 -1
- package/lib/cjs/slider/Slider.js +2 -1
- package/lib/cjs/slider/Slider.js.map +1 -1
- package/lib/cjs/status-indicator/stories/status-indicator.stories.js +2 -2
- package/lib/cjs/status-indicator/stories/status-indicator.stories.js.map +1 -1
- package/lib/cjs/switch/stories/switch.stories.js +7 -7
- package/lib/cjs/switch/stories/switch.stories.js.map +1 -1
- package/lib/cjs/tabs/Tabs.js +2 -2
- package/lib/cjs/tabs/Tabs.js.map +1 -1
- package/lib/cjs/tabs/stories/tabs-overflow.story.js +1 -1
- package/lib/cjs/tabs/stories/tabs-overflow.story.js.map +1 -1
- package/lib/cjs/tag/Tag.js +2 -2
- package/lib/cjs/tag/Tag.js.map +1 -1
- package/lib/cjs/tag/stories/tag.stories.js +10 -10
- package/lib/cjs/tag/stories/tag.stories.js.map +1 -1
- package/lib/cjs/text-area/TextArea.js +5 -5
- package/lib/cjs/text-area/TextArea.js.map +1 -1
- package/lib/cjs/text-area/stories/text-area.stories.js +25 -25
- package/lib/cjs/text-area/stories/text-area.stories.js.map +1 -1
- package/lib/cjs/text-input/stories/text-input-number.story.js +2 -2
- package/lib/cjs/text-input/stories/text-input-number.story.js.map +1 -1
- package/lib/cjs/text-link/stories/text-link.stories.js +11 -11
- package/lib/cjs/text-link/stories/text-link.stories.js.map +1 -1
- package/lib/cjs/text-overflow/stories/text-overflow.stories.js +1 -1
- package/lib/cjs/text-overflow/stories/text-overflow.stories.js.map +1 -1
- package/lib/cjs/theme/ThemeProvider.js.map +1 -1
- package/lib/cjs/theme/agnostic.js +1 -1
- package/lib/cjs/theme/agnostic.js.map +1 -1
- package/lib/cjs/time-picker/TimePicker.js +4 -4
- package/lib/cjs/time-picker/TimePicker.js.map +1 -1
- package/lib/cjs/time-picker/time-picker-hooks.js +1 -1
- package/lib/cjs/time-picker/time-picker-hooks.js.map +1 -1
- package/lib/cjs/timezone-picker/TimeZonePicker.js +5 -5
- package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js +7 -7
- package/lib/cjs/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
- package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
- package/lib/cjs/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
- package/lib/cjs/toast/Toast.js +12 -12
- package/lib/cjs/toast/Toast.js.map +1 -1
- package/lib/cjs/toast/stories/toast-action-story.js +1 -1
- package/lib/cjs/toast/stories/toast-action-story.js.map +1 -1
- package/lib/cjs/toast/stories/toast-controlled-story.js +2 -2
- package/lib/cjs/toast/stories/toast-controlled-story.js.map +1 -1
- package/lib/cjs/toast/stories/toast-progress-bar.js +1 -1
- package/lib/cjs/toast/stories/toast-progress-bar.js.map +1 -1
- package/lib/cjs/toast/stories/toast.stories.js +18 -18
- package/lib/cjs/toast/stories/toast.stories.js.map +1 -1
- package/lib/cjs/tooltip/Tooltip.js +1 -1
- package/lib/cjs/tooltip/Tooltip.js.map +1 -1
- package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js +1 -1
- package/lib/cjs/tooltip/stories/tooltip-hover-delay.story.js.map +1 -1
- package/lib/cjs/tooltip/stories/tooltip-placements.story.js +8 -8
- package/lib/cjs/tooltip/stories/tooltip-placements.story.js.map +1 -1
- package/lib/cjs/tooltip/stories/tooltip.stories.js +29 -29
- package/lib/cjs/tooltip/stories/tooltip.stories.js.map +1 -1
- package/lib/cjs/tooltip/use-tooltip.js +10 -10
- package/lib/cjs/tooltip/use-tooltip.js.map +1 -1
- package/lib/cjs/tree-view/TreeItemWrapper.js +2 -2
- package/lib/cjs/tree-view/TreeItemWrapper.js.map +1 -1
- package/lib/cjs/tree-view/TreeView.js +12 -12
- package/lib/cjs/tree-view/TreeView.js.map +1 -1
- package/lib/cjs/tree-view/TreeViewItem.js +1 -1
- package/lib/cjs/tree-view/TreeViewItem.js.map +1 -1
- package/lib/cjs/tree-view/TreeViewTextItem.js +1 -1
- package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
- package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js +2 -2
- package/lib/cjs/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
- package/lib/cjs/wizard/Wizard.js +3 -3
- package/lib/cjs/wizard/Wizard.js.map +1 -1
- package/lib/cjs/wizard/stories/wizard.stories.js +14 -14
- package/lib/cjs/wizard/stories/wizard.stories.js.map +1 -1
- package/lib/esm/_common/types.js.map +1 -1
- package/lib/esm/_common/utils.js +4 -4
- package/lib/esm/_common/utils.js.map +1 -1
- package/lib/esm/accordion/Accordion.js +5 -5
- package/lib/esm/accordion/Accordion.js.map +1 -1
- package/lib/esm/accordion/accordion-context.js +1 -1
- package/lib/esm/accordion/accordion-context.js.map +1 -1
- package/lib/esm/accordion/stories/accordion.stories.js +20 -20
- package/lib/esm/accordion/stories/accordion.stories.js.map +1 -1
- package/lib/esm/ai/presence/Presence.js +1 -0
- package/lib/esm/ai/presence/Presence.js.map +1 -1
- package/lib/esm/avatar/stories/avatar.stories.js +18 -18
- package/lib/esm/avatar/stories/avatar.stories.js.map +1 -1
- package/lib/esm/banner/Banner.js +1 -1
- package/lib/esm/banner/Banner.js.map +1 -1
- package/lib/esm/breadcrumbs/stories/breadcrumbs.stories.js +1 -1
- package/lib/esm/breadcrumbs/stories/breadcrumbs.stories.js.map +1 -1
- package/lib/esm/checkbox/stories/checkbox-full.story.js +2 -2
- package/lib/esm/checkbox/stories/checkbox-full.story.js.map +1 -1
- package/lib/esm/checkbox/stories/checkbox.stories.js +19 -19
- package/lib/esm/checkbox/stories/checkbox.stories.js.map +1 -1
- package/lib/esm/clean-icon-button/stories/clean-icon-button.stories.js +11 -11
- package/lib/esm/clean-icon-button/stories/clean-icon-button.stories.js.map +1 -1
- package/lib/esm/code-block/stories/code-disabled.story.js +2 -2
- package/lib/esm/code-block/stories/code-disabled.story.js.map +1 -1
- package/lib/esm/code-block/stories/code-full.story.js +2 -2
- package/lib/esm/code-block/stories/code-full.story.js.map +1 -1
- package/lib/esm/code-block/stories/code-with-actions.story.js +2 -2
- package/lib/esm/code-block/stories/code-with-actions.story.js.map +1 -1
- package/lib/esm/code-block/themes/ndl-code-dark.js +64 -64
- package/lib/esm/code-block/themes/ndl-code-dark.js.map +1 -1
- package/lib/esm/code-block/themes/ndl-code-light.js +64 -64
- package/lib/esm/code-block/themes/ndl-code-light.js.map +1 -1
- package/lib/esm/color-picker/ColorPicker.js +1 -1
- package/lib/esm/color-picker/ColorPicker.js.map +1 -1
- package/lib/esm/color-picker/stories/color-picker.stories.js +4 -4
- package/lib/esm/color-picker/stories/color-picker.stories.js.map +1 -1
- package/lib/esm/data-grid/Components.js +14 -12
- package/lib/esm/data-grid/Components.js.map +1 -1
- package/lib/esm/data-grid/DataGrid.js.map +1 -1
- package/lib/esm/data-grid/data-grid-context.js +1 -1
- package/lib/esm/data-grid/data-grid-context.js.map +1 -1
- package/lib/esm/data-grid/data-grid-nav/index.js +1 -1
- package/lib/esm/data-grid/data-grid-nav/index.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js +1 -1
- package/lib/esm/data-grid/stories/datagrid-kitchen-sink.story.js.map +1 -1
- package/lib/esm/data-grid/stories/datagrid-single-selectable.story.js +0 -24
- package/lib/esm/data-grid/stories/datagrid-single-selectable.story.js.map +1 -1
- package/lib/esm/date-picker/DatePicker.js.map +1 -1
- package/lib/esm/date-picker/stories/date-picker-full.story.js +9 -9
- package/lib/esm/date-picker/stories/date-picker-full.story.js.map +1 -1
- package/lib/esm/divider/stories/divider-horizontal.story.js +1 -1
- package/lib/esm/divider/stories/divider-horizontal.story.js.map +1 -1
- package/lib/esm/divider/stories/divider-vertical.story.js +1 -1
- package/lib/esm/divider/stories/divider-vertical.story.js.map +1 -1
- package/lib/esm/drawer/stories/drawer.stories.js +19 -19
- package/lib/esm/drawer/stories/drawer.stories.js.map +1 -1
- package/lib/esm/dropdown-button/DropdownButton.js.map +1 -1
- package/lib/esm/dropdown-button/stories/dropdown-button.stories.js +18 -18
- package/lib/esm/dropdown-button/stories/dropdown-button.stories.js.map +1 -1
- package/lib/esm/dropzone/stories/dropzone-disabled.story.js +1 -1
- package/lib/esm/dropzone/stories/dropzone-disabled.story.js.map +1 -1
- package/lib/esm/dropzone/stories/dropzone-full.story.js +11 -11
- package/lib/esm/dropzone/stories/dropzone-full.story.js.map +1 -1
- package/lib/esm/dropzone/stories/dropzone.stories.js +10 -10
- package/lib/esm/dropzone/stories/dropzone.stories.js.map +1 -1
- package/lib/esm/flex/Flex.js +4 -4
- package/lib/esm/flex/Flex.js.map +1 -1
- package/lib/esm/graph-label/stories/graph-label.stories.js +20 -20
- package/lib/esm/graph-label/stories/graph-label.stories.js.map +1 -1
- package/lib/esm/hooks/index.js +3 -3
- package/lib/esm/hooks/index.js.map +1 -1
- package/lib/esm/icon-button/stories/icon-button.stories.js +12 -12
- package/lib/esm/icon-button/stories/icon-button.stories.js.map +1 -1
- package/lib/esm/icon-button-array/stories/icon-button-array.stories.js +16 -16
- package/lib/esm/icon-button-array/stories/icon-button-array.stories.js.map +1 -1
- package/lib/esm/icon-button-base/IconButtonBase.js +5 -3
- package/lib/esm/icon-button-base/IconButtonBase.js.map +1 -1
- package/lib/esm/icons/generated/custom/DatabaseCross.js +2 -2
- package/lib/esm/icons/generated/custom/DatabaseCross.js.map +1 -1
- package/lib/esm/icons/generated/custom/DatabasePlus.js +1 -1
- package/lib/esm/icons/generated/custom/DatabasePlus.js.map +1 -1
- package/lib/esm/icons/generated/custom/GlobePin.js +1 -1
- package/lib/esm/icons/generated/custom/GlobePin.js.map +1 -1
- package/lib/esm/icons/generated/custom/PanelBottom.js +1 -1
- package/lib/esm/icons/generated/custom/PanelBottom.js.map +1 -1
- package/lib/esm/icons/generated/custom/PanelLeftCollapsed.js +28 -0
- package/lib/esm/icons/generated/custom/PanelLeftCollapsed.js.map +1 -0
- package/lib/esm/icons/generated/custom/PanelLeftExpanded.js +28 -0
- package/lib/esm/icons/generated/custom/PanelLeftExpanded.js.map +1 -0
- package/lib/esm/icons/generated/custom/PanelRightCollapsed.js +28 -0
- package/lib/esm/icons/generated/custom/PanelRightCollapsed.js.map +1 -0
- package/lib/esm/icons/generated/custom/PanelRightExpanded.js +28 -0
- package/lib/esm/icons/generated/custom/PanelRightExpanded.js.map +1 -0
- package/lib/esm/icons/generated/custom/ThreePanel.js +1 -1
- package/lib/esm/icons/generated/custom/ThreePanel.js.map +1 -1
- package/lib/esm/icons/generated/custom/index.js +4 -0
- package/lib/esm/icons/generated/custom/index.js.map +1 -1
- package/lib/esm/icons/wrapIcon.js +2 -2
- package/lib/esm/icons/wrapIcon.js.map +1 -1
- package/lib/esm/kbd/stories/kbd.stories.js +7 -7
- package/lib/esm/kbd/stories/kbd.stories.js.map +1 -1
- package/lib/esm/loading-spinner/LoadingSpinner.js +2 -2
- package/lib/esm/loading-spinner/LoadingSpinner.js.map +1 -1
- package/lib/esm/loading-spinner/stories/loading-spinner.stories.js +10 -10
- package/lib/esm/loading-spinner/stories/loading-spinner.stories.js.map +1 -1
- package/lib/esm/logo/Logo.js +6 -6
- package/lib/esm/logo/Logo.js.map +1 -1
- package/lib/esm/logo/stories/logo.stories.js +9 -9
- package/lib/esm/logo/stories/logo.stories.js.map +1 -1
- package/lib/esm/menu/Menu.js +3 -3
- package/lib/esm/menu/Menu.js.map +1 -1
- package/lib/esm/menu/stories/menu-custom-items.story.js +3 -1
- package/lib/esm/menu/stories/menu-custom-items.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-default.story.js +3 -1
- package/lib/esm/menu/stories/menu-default.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-in-dialog.story.js +5 -1
- package/lib/esm/menu/stories/menu-in-dialog.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-in-popover.story.js +3 -1
- package/lib/esm/menu/stories/menu-in-popover.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-nested.story.js +3 -1
- package/lib/esm/menu/stories/menu-nested.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-placements.story.js +3 -1
- package/lib/esm/menu/stories/menu-placements.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-with-category.story.js +1 -2
- package/lib/esm/menu/stories/menu-with-category.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-with-disabled-item.story.js +1 -2
- package/lib/esm/menu/stories/menu-with-disabled-item.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-with-divider.story.js +1 -2
- package/lib/esm/menu/stories/menu-with-divider.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-with-icon.story.js +3 -1
- package/lib/esm/menu/stories/menu-with-icon.story.js.map +1 -1
- package/lib/esm/menu/stories/menu-with-keyboard-shortcuts.story.js +3 -1
- package/lib/esm/menu/stories/menu-with-keyboard-shortcuts.story.js.map +1 -1
- package/lib/esm/popover/Popover.js +15 -15
- package/lib/esm/popover/Popover.js.map +1 -1
- package/lib/esm/popover/use-popover.js +9 -9
- package/lib/esm/popover/use-popover.js.map +1 -1
- package/lib/esm/progress-bar/stories/progress-bar.stories.js +3 -3
- package/lib/esm/progress-bar/stories/progress-bar.stories.js.map +1 -1
- package/lib/esm/segmented-control/SegmentedControl.js +1 -1
- package/lib/esm/segmented-control/SegmentedControl.js.map +1 -1
- package/lib/esm/select/Overrides.js +41 -41
- package/lib/esm/select/Overrides.js.map +1 -1
- package/lib/esm/select/Select.js +26 -4
- package/lib/esm/select/Select.js.map +1 -1
- package/lib/esm/select/stories/select-async.story.js +4 -4
- package/lib/esm/select/stories/select-async.story.js.map +1 -1
- package/lib/esm/select/stories/select-controlled.story.js +4 -4
- package/lib/esm/select/stories/select-controlled.story.js.map +1 -1
- package/lib/esm/select/stories/select-creatable.story.js +1 -1
- package/lib/esm/select/stories/select-creatable.story.js.map +1 -1
- package/lib/esm/select/stories/select-custom-label.story.js +1 -1
- package/lib/esm/select/stories/select-custom-label.story.js.map +1 -1
- package/lib/esm/select/stories/select-disabled.story.js +1 -1
- package/lib/esm/select/stories/select-disabled.story.js.map +1 -1
- package/lib/esm/select/stories/select-inside-dialog.story.js +1 -1
- package/lib/esm/select/stories/select-inside-dialog.story.js.map +1 -1
- package/lib/esm/side-navigation/SideNavigation.js +1 -1
- package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
- package/lib/esm/side-navigation/stories/side-nav.stories.js +1 -1
- package/lib/esm/side-navigation/stories/side-nav.stories.js.map +1 -1
- package/lib/esm/skeleton/stories/skeleton.stories.js +28 -28
- package/lib/esm/skeleton/stories/skeleton.stories.js.map +1 -1
- package/lib/esm/slider/Slider.js +2 -1
- package/lib/esm/slider/Slider.js.map +1 -1
- package/lib/esm/status-indicator/stories/status-indicator.stories.js +2 -2
- package/lib/esm/status-indicator/stories/status-indicator.stories.js.map +1 -1
- package/lib/esm/switch/stories/switch.stories.js +7 -7
- package/lib/esm/switch/stories/switch.stories.js.map +1 -1
- package/lib/esm/tabs/Tabs.js +2 -2
- package/lib/esm/tabs/Tabs.js.map +1 -1
- package/lib/esm/tabs/stories/tabs-overflow.story.js +1 -1
- package/lib/esm/tabs/stories/tabs-overflow.story.js.map +1 -1
- package/lib/esm/tag/Tag.js +2 -2
- package/lib/esm/tag/Tag.js.map +1 -1
- package/lib/esm/tag/stories/tag.stories.js +10 -10
- package/lib/esm/tag/stories/tag.stories.js.map +1 -1
- package/lib/esm/text-area/TextArea.js +5 -5
- package/lib/esm/text-area/TextArea.js.map +1 -1
- package/lib/esm/text-area/stories/text-area.stories.js +25 -25
- package/lib/esm/text-area/stories/text-area.stories.js.map +1 -1
- package/lib/esm/text-input/stories/text-input-number.story.js +2 -2
- package/lib/esm/text-input/stories/text-input-number.story.js.map +1 -1
- package/lib/esm/text-link/stories/text-link.stories.js +11 -11
- package/lib/esm/text-link/stories/text-link.stories.js.map +1 -1
- package/lib/esm/text-overflow/stories/text-overflow.stories.js +1 -1
- package/lib/esm/text-overflow/stories/text-overflow.stories.js.map +1 -1
- package/lib/esm/theme/ThemeProvider.js.map +1 -1
- package/lib/esm/theme/agnostic.js +1 -1
- package/lib/esm/theme/agnostic.js.map +1 -1
- package/lib/esm/time-picker/TimePicker.js +4 -4
- package/lib/esm/time-picker/TimePicker.js.map +1 -1
- package/lib/esm/time-picker/time-picker-hooks.js +1 -1
- package/lib/esm/time-picker/time-picker-hooks.js.map +1 -1
- package/lib/esm/timezone-picker/TimeZonePicker.js +5 -5
- package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
- package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js +7 -7
- package/lib/esm/timezone-picker/stories/timezone-picker-dst-aware.story.js.map +1 -1
- package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js +1 -1
- package/lib/esm/timezone-picker/stories/timezone-picker-fluid.story.js.map +1 -1
- package/lib/esm/toast/Toast.js +12 -12
- package/lib/esm/toast/Toast.js.map +1 -1
- package/lib/esm/toast/stories/toast-action-story.js +1 -1
- package/lib/esm/toast/stories/toast-action-story.js.map +1 -1
- package/lib/esm/toast/stories/toast-controlled-story.js +2 -2
- package/lib/esm/toast/stories/toast-controlled-story.js.map +1 -1
- package/lib/esm/toast/stories/toast-progress-bar.js +1 -1
- package/lib/esm/toast/stories/toast-progress-bar.js.map +1 -1
- package/lib/esm/toast/stories/toast.stories.js +18 -18
- package/lib/esm/toast/stories/toast.stories.js.map +1 -1
- package/lib/esm/tooltip/Tooltip.js +1 -1
- package/lib/esm/tooltip/Tooltip.js.map +1 -1
- package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js +1 -1
- package/lib/esm/tooltip/stories/tooltip-hover-delay.story.js.map +1 -1
- package/lib/esm/tooltip/stories/tooltip-placements.story.js +8 -8
- package/lib/esm/tooltip/stories/tooltip-placements.story.js.map +1 -1
- package/lib/esm/tooltip/stories/tooltip.stories.js +29 -29
- package/lib/esm/tooltip/stories/tooltip.stories.js.map +1 -1
- package/lib/esm/tooltip/use-tooltip.js +10 -10
- package/lib/esm/tooltip/use-tooltip.js.map +1 -1
- package/lib/esm/tree-view/TreeItemWrapper.js +2 -2
- package/lib/esm/tree-view/TreeItemWrapper.js.map +1 -1
- package/lib/esm/tree-view/TreeView.js +12 -12
- package/lib/esm/tree-view/TreeView.js.map +1 -1
- package/lib/esm/tree-view/TreeViewItem.js +1 -1
- package/lib/esm/tree-view/TreeViewItem.js.map +1 -1
- package/lib/esm/tree-view/TreeViewTextItem.js +1 -1
- package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
- package/lib/esm/tree-view/tree-view-keyboard-coordinates.js +2 -2
- package/lib/esm/tree-view/tree-view-keyboard-coordinates.js.map +1 -1
- package/lib/esm/wizard/Wizard.js +3 -3
- package/lib/esm/wizard/Wizard.js.map +1 -1
- package/lib/esm/wizard/stories/wizard.stories.js +14 -14
- package/lib/esm/wizard/stories/wizard.stories.js.map +1 -1
- package/lib/types/accordion/stories/accordion.stories.d.ts +3 -3
- package/lib/types/ai/presence/Presence.d.ts.map +1 -1
- package/lib/types/breadcrumbs/stories/breadcrumbs.stories.d.ts +1 -1
- package/lib/types/data-grid/Components.d.ts.map +1 -1
- package/lib/types/data-grid/stories/datagrid-single-selectable.story.d.ts.map +1 -1
- package/lib/types/dropdown-button/DropdownButton.d.ts +1 -1
- package/lib/types/dropdown-button/DropdownButton.d.ts.map +1 -1
- package/lib/types/icon-button-base/IconButtonBase.d.ts.map +1 -1
- package/lib/types/icons/generated/custom/DatabaseCross.d.ts.map +1 -1
- package/lib/types/icons/generated/custom/DatabasePlus.d.ts.map +1 -1
- package/lib/types/icons/generated/custom/GlobePin.d.ts.map +1 -1
- package/lib/types/icons/generated/custom/PanelLeftCollapsed.d.ts +29 -0
- package/lib/types/icons/generated/custom/PanelLeftCollapsed.d.ts.map +1 -0
- package/lib/types/icons/generated/custom/PanelLeftExpanded.d.ts +29 -0
- package/lib/types/icons/generated/custom/PanelLeftExpanded.d.ts.map +1 -0
- package/lib/types/icons/generated/custom/PanelRightCollapsed.d.ts +29 -0
- package/lib/types/icons/generated/custom/PanelRightCollapsed.d.ts.map +1 -0
- package/lib/types/icons/generated/custom/PanelRightExpanded.d.ts +29 -0
- package/lib/types/icons/generated/custom/PanelRightExpanded.d.ts.map +1 -0
- package/lib/types/icons/generated/custom/index.d.ts +4 -0
- package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
- package/lib/types/icons/wrapIcon.d.ts.map +1 -1
- package/lib/types/logo/stories/logo.stories.d.ts +3 -3
- package/lib/types/menu/stories/menu-custom-items.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-default.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-in-dialog.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-in-popover.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-nested.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-placements.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-with-category.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-with-disabled-item.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-with-divider.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-with-icon.story.d.ts.map +1 -1
- package/lib/types/menu/stories/menu-with-keyboard-shortcuts.story.d.ts.map +1 -1
- package/lib/types/select/Select.d.ts.map +1 -1
- package/lib/types/side-navigation/SideNavigation.d.ts.map +1 -1
- package/lib/types/side-navigation/stories/side-nav.stories.d.ts +1 -1
- package/lib/types/skeleton/stories/skeleton.stories.d.ts +3 -3
- package/lib/types/slider/Slider.d.ts.map +1 -1
- package/lib/types/tabs/Tabs.d.ts.map +1 -1
- package/lib/types/tabs/stories/tabs-overflow.story.d.ts.map +1 -1
- package/lib/types/time-picker/time-picker-hooks.d.ts +1 -1
- package/lib/types/time-picker/time-picker-hooks.d.ts.map +1 -1
- package/lib/types/toast/stories/toast.stories.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["../../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAwBA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,cAAc,EACd,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,UAAU,EACV,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,eAAe,GAEhB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,IAAK,eAKJ;AALD,WAAK,eAAe;IAClB,yCAAsB,CAAA;IACtB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;IACrB,gCAAa,CAAA;AACf,CAAC,EALI,eAAe,KAAf,eAAe,QAKnB;AAID,IAAK,eAGJ;AAHD,WAAK,eAAe;IAClB,oCAAiB,CAAA;I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,CAAE,UAAU,KAAI,KAAC,UAAU,CAAC,UAAU,KAAG,KAChD,GACmB,CAC5B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,YAAY;IACZ,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,cAAc;IACd,YAAY;IACZ,MAAM;IACN,UAAU;IACV,WAAW;IACX,cAAc;IACd,kBAAkB;IAClB,UAAU;IACV,UAAU;IACV,iBAAiB;IACjB,+BAA+B;IAC/B,UAAU;IACV,qBAAqB;IACrB,uBAAuB;IACvB,wBAAwB;IACxB,WAAW;IACX,WAAW;IACX,UAAU;IACV,YAAY;CACb,CAAC;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport classNames from 'classnames';\nimport {\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useResizeObserver } from '../hooks';\nimport { type Skeleton } from '../skeleton';\nimport {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n} from './Components';\nimport {\n type DataGridComponentsInterface,\n DataGridContext,\n type DataGridContextType,\n} from './data-grid-context';\nimport { useTableNav } from './data-grid-nav';\nimport { updateColumnWidths } from './helpers';\n\nenum BorderStyleEnum {\n AllSides = 'all-sides',\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n None = 'none',\n}\n\nexport type BorderStyle = `${BorderStyleEnum}`;\n\nenum HeaderStyleEnum {\n Filled = 'filled',\n Clean = 'clean',\n}\n\nexport type HeaderStyle = `${HeaderStyleEnum}`;\n\nexport type DataGridProps<T extends RowData> = {\n styling?: Partial<{\n /** Alternate the background color of rows */\n hasZebraStriping: boolean;\n /** Type of border that will be used */\n borderStyle: BorderStyle;\n /** If header should have styles or not (Aura example) */\n headerStyle: HeaderStyle;\n /** If background hover effects should be enabled on rows and header cells */\n hasHoverEffects: boolean;\n }>;\n /** Resizing the width of columns */\n isResizable?: boolean;\n /** Enables table's loading state */\n isLoading?: boolean;\n /**\n * Enables keyboard navigation.\n * To control keyboard navigation programmatically\n * for edge cases, pass a `ref` to `tableNavRef`\n */\n isKeyboardNavigable?: boolean;\n /**\n * Enables automatic resizing of columns.\n * If `isResizable` is `true`, the columns will only be automatically resized on initial render of the table.\n * If `isResizable` is `false`, the columns will be resized automatically to always fit the table width (assuming that column maxWidths allow for it).\n * Note: Action columns are a fixed size of 40px, and Pinned columns are not resized automatically.\n * @defaultValue true\n */\n isAutoResizingColumns?: boolean;\n /**\n * Reference to the tableNav instance\n * for programmatic control\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n tableNavRef?: React.RefObject<any>;\n /** Table instance created from `useTable`*/\n tableInstance: DataGridType<T>;\n /** Table sub-component overrides */\n components?: DataGridComponentsInterface<T>;\n /** @deprecated Use htmlAttributes, className and style on the root element instead */\n rootProps?: HtmlAttributes<'div'>;\n isSkeletonLoading?: boolean;\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n /** The target element for portaled elements to be rendered in, e.g. the modal root if the data grid is inside a modal.\n * This is used in for example the DropdownCell, RowsPerPage, and ColumnControls.\n */\n portalTarget?: HTMLElement | null;\n ref?: React.Ref<HTMLDivElement>;\n};\n\nconst DEFAULT_STYLING: Required<DataGridProps<unknown>['styling']> = {\n borderStyle: BorderStyleEnum.Horizontal,\n hasHoverEffects: true,\n hasZebraStriping: false,\n headerStyle: HeaderStyleEnum.Filled,\n};\n\nconst DataGridComponent = function DataGrid<T extends RowData = unknown>({\n isResizable = true,\n isLoading = false,\n isKeyboardNavigable = true,\n isAutoResizingColumns = true,\n tableInstance,\n components,\n rootProps,\n styling = {},\n tableNavRef,\n isSkeletonLoading = false,\n skeletonProps,\n ref,\n portalTarget = document.body,\n htmlAttributes,\n className,\n style,\n ...restProps\n}: CommonProps<'div', DataGridProps<T>>) {\n const { className: rootClassName = '', style: rootStyle = {} } =\n rootProps || {};\n\n const [isScrollable, setIsScrollable] = useState(false);\n const [isMediumNavigation, setIsMediumNavigation] = useState(false);\n const [isSmallNavigation, setIsSmallNavigation] = useState(false);\n const tableRef = useRef<HTMLDivElement>(null);\n const scrollableContainerRef = useRef<HTMLDivElement>(null);\n\n tableInstance.setOptions((prevOptions) => {\n return {\n ...prevOptions,\n enableSorting: isSkeletonLoading ? false : prevOptions.enableSorting,\n };\n });\n\n // Triggers when the whole container is resized\n useResizeObserver({\n onResize: (entry) => {\n if (entry.width === undefined) {\n return;\n }\n isAutoResizingColumns &&\n !isResizable &&\n updateColumnWidths(tableInstance, entry.width); // don't resize columns when the table is resizable due to problems with the resize handler.\n setIsScrollable(tableInstance.getTotalSize() > entry.width);\n setIsMediumNavigation(entry.width <= 680);\n setIsSmallNavigation(entry.width <= 480);\n },\n ref: scrollableContainerRef as React.RefObject<HTMLElement>,\n });\n\n // Triggers when the individual columns are resized\n useResizeObserver({\n onResize: () => {\n if (scrollableContainerRef.current === null) {\n return;\n }\n setIsScrollable(\n tableInstance.getTotalSize() >\n scrollableContainerRef.current.clientWidth,\n );\n },\n ref: tableRef as React.RefObject<HTMLElement>,\n });\n\n const Styling = useMemo(\n () => ({\n ...DEFAULT_STYLING,\n ...styling,\n }),\n [styling],\n );\n\n const Components = useMemo(\n () =>\n ({\n ...DataGridComponents,\n ...components,\n }) as DataGridContextType<T>['components'],\n [components],\n );\n const ScrollableContainer = Components?.Scrollable\n ? Components.Scrollable\n : Scrollable;\n\n const { listeners, tableNav } = useTableNav({\n isDebug: false,\n });\n\n /** Surface the tableNav instance for programmatic control if needed */\n useImperativeHandle(tableNavRef, () => tableNav, [tableNav]);\n\n useEffect(() => {\n if (isAutoResizingColumns && isResizable) {\n updateColumnWidths(\n tableInstance,\n scrollableContainerRef.current?.clientWidth\n ? scrollableContainerRef.current.clientWidth - 1 // -1 to avoid horizontal scrollbar\n : 0,\n );\n }\n }, [isAutoResizingColumns, tableInstance, isResizable]);\n\n return (\n <DataGridContext.Provider\n value={\n {\n components: Components,\n dataGridNav: tableNav,\n hasResizeColumns: isAutoResizingColumns,\n isKeyboardNavigationEnabled: isKeyboardNavigable,\n isLoading: isLoading,\n isMediumNavigation,\n isResizable: isResizable,\n isSkeletonLoading,\n isSmallNavigation,\n portalTarget: portalTarget,\n skeletonProps,\n tableProps: tableInstance,\n } as DataGridContextType<T>\n }\n >\n <div\n // Root props needs to be first in order to override className\n {...rootProps}\n className={classNames('ndl-data-grid-root', rootClassName, className, {\n 'ndl-data-grid-border-horizontal':\n Styling.borderStyle === BorderStyleEnum.Horizontal ||\n Styling.borderStyle === BorderStyleEnum.AllSides,\n 'ndl-data-grid-border-vertical':\n Styling.borderStyle === BorderStyleEnum.Vertical ||\n Styling.borderStyle === BorderStyleEnum.AllSides,\n 'ndl-data-grid-focusable-cells': isKeyboardNavigable,\n 'ndl-data-grid-header-filled':\n Styling.headerStyle === HeaderStyleEnum.Filled,\n 'ndl-data-grid-hover-effects': Styling.hasHoverEffects,\n 'ndl-data-grid-zebra-striping': Styling.hasZebraStriping,\n })}\n ref={ref}\n style={{ ...rootStyle, ...style }}\n {...restProps}\n {...htmlAttributes}\n {...(isKeyboardNavigable ? listeners : {})}\n >\n {/* Make DataGrid horizontally scrollable and avoid horizontal scrollbar have an extra vertical scrollbar (esp. Safari) */}\n {/* This behavior can be overridden by consumers through replacing the scrolling container */}\n <ScrollableContainer\n ref={scrollableContainerRef}\n htmlAttributes={{\n onKeyDown: (e) => {\n if (isScrollable && !isKeyboardNavigable) {\n if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {\n e.stopPropagation();\n }\n }\n },\n // Ensure that the user can focus and scroll inside the table with arrow keys even if there is no interactive element inside\n tabIndex: isScrollable && !isKeyboardNavigable ? 0 : undefined,\n }}\n >\n {/* Table content Area */}\n <div\n className=\"ndl-div-table\"\n role={isKeyboardNavigable ? 'grid' : 'table'}\n aria-busy={isLoading ? 'true' : 'false'}\n ref={tableRef}\n >\n {/* DataGrid Header Area */}\n {Components?.Header && <Components.Header />}\n {Components?.Body && <Components.Body />}\n </div>\n </ScrollableContainer>\n {/* Bottom Navigation Area */}\n {Components?.Navigation && <Components.Navigation />}\n </div>\n </DataGridContext.Provider>\n );\n};\n\nconst DataGridComponents = {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n};\n\nconst DataGrid = Object.assign(DataGridComponent, DataGridComponents);\n\nexport { DataGrid };\n"]}
|
|
1
|
+
{"version":3,"file":"DataGr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V,iBAAiB;IACjB,+BAA+B;IAC/B,UAAU;IACV,qBAAqB;IACrB,uBAAuB;IACvB,wBAAwB;IACxB,WAAW;IACX,WAAW;IACX,UAAU;IACV,YAAY;CACb,CAAC;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport classNames from 'classnames';\nimport {\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useResizeObserver } from '../hooks';\nimport { type Skeleton } from '../skeleton';\nimport {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n} from './Components';\nimport {\n type DataGridComponentsInterface,\n DataGridContext,\n type DataGridContextType,\n} from './data-grid-context';\nimport { useTableNav } from './data-grid-nav';\nimport { updateColumnWidths } from './helpers';\n\nenum BorderStyleEnum {\n AllSides = 'all-sides',\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n None = 'none',\n}\n\nexport type BorderStyle = `${BorderStyleEnum}`;\n\nenum HeaderStyleEnum {\n Filled = 'filled',\n Clean = 'clean',\n}\n\nexport type HeaderStyle = `${HeaderStyleEnum}`;\n\nexport type DataGridProps<T extends RowData> = {\n styling?: Partial<{\n /** Alternate the background color of rows */\n hasZebraStriping: boolean;\n /** Type of border that will be used */\n borderStyle: BorderStyle;\n /** If header should have styles or not (Aura example) */\n headerStyle: HeaderStyle;\n /** If background hover effects should be enabled on rows and header cells */\n hasHoverEffects: boolean;\n }>;\n /** Resizing the width of columns */\n isResizable?: boolean;\n /** Enables table's loading state */\n isLoading?: boolean;\n /**\n * Enables keyboard navigation.\n * To control keyboard navigation programmatically\n * for edge cases, pass a `ref` to `tableNavRef`\n */\n isKeyboardNavigable?: boolean;\n /**\n * Enables automatic resizing of columns.\n * If `isResizable` is `true`, the columns will only be automatically resized on initial render of the table.\n * If `isResizable` is `false`, the columns will be resized automatically to always fit the table width (assuming that column maxWidths allow for it).\n * Note: Action columns are a fixed size of 40px, and Pinned columns are not resized automatically.\n * @defaultValue true\n */\n isAutoResizingColumns?: boolean;\n /**\n * Reference to the tableNav instance\n * for programmatic control\n */\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n tableNavRef?: React.RefObject<any>;\n /** Table instance created from `useTable`*/\n tableInstance: DataGridType<T>;\n /** Table sub-component overrides */\n components?: DataGridComponentsInterface<T>;\n /** @deprecated Use htmlAttributes, className and style on the root element instead */\n rootProps?: HtmlAttributes<'div'>;\n isSkeletonLoading?: boolean;\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n /** The target element for portaled elements to be rendered in, e.g. the modal root if the data grid is inside a modal.\n * This is used in for example the DropdownCell, RowsPerPage, and ColumnControls.\n */\n portalTarget?: HTMLElement | null;\n ref?: React.Ref<HTMLDivElement>;\n};\n\nconst DEFAULT_STYLING: Required<DataGridProps<unknown>['styling']> = {\n borderStyle: BorderStyleEnum.Horizontal,\n hasHoverEffects: true,\n hasZebraStriping: false,\n headerStyle: HeaderStyleEnum.Filled,\n};\n\nconst DataGridComponent = function DataGrid<T extends RowData = unknown>({\n isResizable = true,\n isLoading = false,\n isKeyboardNavigable = true,\n isAutoResizingColumns = true,\n tableInstance,\n components,\n rootProps,\n styling = {},\n tableNavRef,\n isSkeletonLoading = false,\n skeletonProps,\n ref,\n portalTarget = document.body,\n htmlAttributes,\n className,\n style,\n ...restProps\n}: CommonProps<'div', DataGridProps<T>>) {\n const { className: rootClassName = '', style: rootStyle = {} } =\n rootProps || {};\n\n const [isScrollable, setIsScrollable] = useState(false);\n const [isMediumNavigation, setIsMediumNavigation] = useState(false);\n const [isSmallNavigation, setIsSmallNavigation] = useState(false);\n const tableRef = useRef<HTMLDivElement>(null);\n const scrollableContainerRef = useRef<HTMLDivElement>(null);\n\n tableInstance.setOptions((prevOptions) => {\n return {\n ...prevOptions,\n enableSorting: isSkeletonLoading ? false : prevOptions.enableSorting,\n };\n });\n\n // Triggers when the whole container is resized\n useResizeObserver({\n onResize: (entry) => {\n if (entry.width === undefined) {\n return;\n }\n isAutoResizingColumns &&\n !isResizable &&\n updateColumnWidths(tableInstance, entry.width); // don't resize columns when the table is resizable due to problems with the resize handler.\n setIsScrollable(tableInstance.getTotalSize() > entry.width);\n setIsMediumNavigation(entry.width <= 680);\n setIsSmallNavigation(entry.width <= 480);\n },\n ref: scrollableContainerRef as React.RefObject<HTMLElement>,\n });\n\n // Triggers when the individual columns are resized\n useResizeObserver({\n onResize: () => {\n if (scrollableContainerRef.current === null) {\n return;\n }\n setIsScrollable(\n tableInstance.getTotalSize() >\n scrollableContainerRef.current.clientWidth,\n );\n },\n ref: tableRef as React.RefObject<HTMLElement>,\n });\n\n const Styling = useMemo(\n () => ({\n ...DEFAULT_STYLING,\n ...styling,\n }),\n [styling],\n );\n\n const Components = useMemo(\n () =>\n ({\n ...DataGridComponents,\n ...components,\n }) as DataGridContextType<T>['components'],\n [components],\n );\n const ScrollableContainer = Components?.Scrollable\n ? Components.Scrollable\n : Scrollable;\n\n const { listeners, tableNav } = useTableNav({\n isDebug: false,\n });\n\n /** Surface the tableNav instance for programmatic control if needed */\n useImperativeHandle(tableNavRef, () => tableNav, [tableNav]);\n\n useEffect(() => {\n if (isAutoResizingColumns && isResizable) {\n updateColumnWidths(\n tableInstance,\n scrollableContainerRef.current?.clientWidth\n ? scrollableContainerRef.current.clientWidth - 1 // -1 to avoid horizontal scrollbar\n : 0,\n );\n }\n }, [isAutoResizingColumns, tableInstance, isResizable]);\n\n return (\n <DataGridContext.Provider\n value={\n {\n components: Components,\n dataGridNav: tableNav,\n hasResizeColumns: isAutoResizingColumns,\n isKeyboardNavigationEnabled: isKeyboardNavigable,\n isLoading: isLoading,\n isMediumNavigation,\n isResizable: isResizable,\n isSkeletonLoading,\n isSmallNavigation,\n portalTarget: portalTarget,\n skeletonProps,\n tableProps: tableInstance,\n } as DataGridContextType<T>\n }\n >\n <div\n // Root props needs to be first in order to override className\n {...rootProps}\n className={classNames('ndl-data-grid-root', rootClassName, className, {\n 'ndl-data-grid-border-horizontal':\n Styling.borderStyle === BorderStyleEnum.Horizontal ||\n Styling.borderStyle === BorderStyleEnum.AllSides,\n 'ndl-data-grid-border-vertical':\n Styling.borderStyle === BorderStyleEnum.Vertical ||\n Styling.borderStyle === BorderStyleEnum.AllSides,\n 'ndl-data-grid-focusable-cells': isKeyboardNavigable,\n 'ndl-data-grid-header-filled':\n Styling.headerStyle === HeaderStyleEnum.Filled,\n 'ndl-data-grid-hover-effects': Styling.hasHoverEffects,\n 'ndl-data-grid-zebra-striping': Styling.hasZebraStriping,\n })}\n ref={ref}\n style={{ ...rootStyle, ...style }}\n {...restProps}\n {...htmlAttributes}\n {...(isKeyboardNavigable ? listeners : {})}\n >\n {/* Make DataGrid horizontally scrollable and avoid horizontal scrollbar have an extra vertical scrollbar (esp. Safari) */}\n {/* This behavior can be overridden by consumers through replacing the scrolling container */}\n <ScrollableContainer\n ref={scrollableContainerRef}\n htmlAttributes={{\n onKeyDown: (e) => {\n if (isScrollable && !isKeyboardNavigable) {\n if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {\n e.stopPropagation();\n }\n }\n },\n // Ensure that the user can focus and scroll inside the table with arrow keys even if there is no interactive element inside\n tabIndex: isScrollable && !isKeyboardNavigable ? 0 : undefined,\n }}\n >\n {/* Table content Area */}\n <div\n className=\"ndl-div-table\"\n role={isKeyboardNavigable ? 'grid' : 'table'}\n aria-busy={isLoading ? 'true' : 'false'}\n ref={tableRef}\n >\n {/* DataGrid Header Area */}\n {Components?.Header && <Components.Header />}\n {Components?.Body && <Components.Body />}\n </div>\n </ScrollableContainer>\n {/* Bottom Navigation Area */}\n {Components?.Navigation && <Components.Navigation />}\n </div>\n </DataGridContext.Provider>\n );\n};\n\nconst DataGridComponents = {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n};\n\nconst DataGrid = Object.assign(DataGridComponent, DataGridComponents);\n\nexport { DataGrid };\n"]}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
import { createContext, useContext } from 'react';
|
|
23
|
-
//
|
|
23
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
24
|
export const DataGridContext = createContext(null);
|
|
25
25
|
export function useDataGridContext() {
|
|
26
26
|
const context = useContext(DataGridContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-grid-context.js","sourceRoot":"","sources":["../../../src/data-grid/data-grid-context.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA4ElD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAA2B,IAAK,CAAC,CAAC;AAE9E,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,UAAU,CAAyB,eAAe,CAAC,CAAC;IACpE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport { createContext, useContext } from 'react';\n\nimport { type Skeleton } from '../skeleton';\nimport {\n type ActionButton,\n type ActionCell,\n type Body,\n type BodyCell,\n type BodyRow,\n type ColumnControls,\n type Header,\n type HeaderCell,\n type HeaderTitle,\n type LoadingPlaceholder,\n type Navigation,\n type NoDataPlaceholder,\n type Pagination,\n type PaginationArrowButton,\n type PaginationNumericButton,\n type PaginationNumericButtons,\n type ResizingBar,\n type RowsPerPage,\n type Scrollable,\n type TableResults,\n} from './Components';\nimport { type DataGridNav } from './data-grid-nav/data-grid-nav';\n\ntype Nullable<T> = T | null;\n\nexport interface DataGridComponentsInterface<T extends RowData> {\n ResizingBar?: Nullable<typeof ResizingBar<T>>;\n /**\n * Header Section\n */\n Header?: Nullable<typeof Header>;\n HeaderCell?: Nullable<typeof HeaderCell<T>>;\n HeaderTitle?: Nullable<typeof HeaderTitle<T>>;\n ActionButton?: Nullable<typeof ActionButton>;\n ColumnControls?: Nullable<typeof ColumnControls>;\n /**\n * Body Section\n */\n Scrollable?: Nullable<typeof Scrollable>;\n Body?: Nullable<typeof Body>;\n BodyCell?: Nullable<typeof BodyCell<T>>;\n BodyRow?: Nullable<typeof BodyRow<T>>;\n ActionCell?: Nullable<typeof ActionCell<T>>;\n LoadingPlaceholder?: Nullable<typeof LoadingPlaceholder>;\n NoDataPlaceholder?: Nullable<typeof NoDataPlaceholder>;\n /**\n * Navigation Section\n */\n Navigation?: Nullable<typeof Navigation>;\n Pagination?: Nullable<typeof Pagination>;\n PaginationArrowButton?: Nullable<typeof PaginationArrowButton>;\n TableResults?: Nullable<typeof TableResults>;\n RowsPerPage?: Nullable<typeof RowsPerPage>;\n PaginationNumericButtons?: Nullable<typeof PaginationNumericButtons>;\n PaginationNumericButton?: Nullable<typeof PaginationNumericButton>;\n}\n\nexport interface DataGridContextType<T extends RowData> {\n isResizable: boolean;\n tableProps: DataGridType<T>;\n components: DataGridComponentsInterface<T>;\n isLoading: boolean;\n hasResizeColumns: boolean;\n isKeyboardNavigationEnabled: boolean;\n isSkeletonLoading: boolean;\n skeletonProps: React.ComponentProps<typeof Skeleton>;\n dataGridNav: DataGridNav;\n portalTarget: HTMLElement | null;\n isMediumNavigation: boolean;\n isSmallNavigation: boolean;\n}\n\n//
|
|
1
|
+
{"version":3,"file":"data-grid-context.js","sourceRoot":"","sources":["../../../src/data-grid/data-grid-context.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA4ElD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAA2B,IAAK,CAAC,CAAC;AAE9E,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,UAAU,CAAyB,eAAe,CAAC,CAAC;IACpE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport { createContext, useContext } from 'react';\n\nimport { type Skeleton } from '../skeleton';\nimport {\n type ActionButton,\n type ActionCell,\n type Body,\n type BodyCell,\n type BodyRow,\n type ColumnControls,\n type Header,\n type HeaderCell,\n type HeaderTitle,\n type LoadingPlaceholder,\n type Navigation,\n type NoDataPlaceholder,\n type Pagination,\n type PaginationArrowButton,\n type PaginationNumericButton,\n type PaginationNumericButtons,\n type ResizingBar,\n type RowsPerPage,\n type Scrollable,\n type TableResults,\n} from './Components';\nimport { type DataGridNav } from './data-grid-nav/data-grid-nav';\n\ntype Nullable<T> = T | null;\n\nexport interface DataGridComponentsInterface<T extends RowData> {\n ResizingBar?: Nullable<typeof ResizingBar<T>>;\n /**\n * Header Section\n */\n Header?: Nullable<typeof Header>;\n HeaderCell?: Nullable<typeof HeaderCell<T>>;\n HeaderTitle?: Nullable<typeof HeaderTitle<T>>;\n ActionButton?: Nullable<typeof ActionButton>;\n ColumnControls?: Nullable<typeof ColumnControls>;\n /**\n * Body Section\n */\n Scrollable?: Nullable<typeof Scrollable>;\n Body?: Nullable<typeof Body>;\n BodyCell?: Nullable<typeof BodyCell<T>>;\n BodyRow?: Nullable<typeof BodyRow<T>>;\n ActionCell?: Nullable<typeof ActionCell<T>>;\n LoadingPlaceholder?: Nullable<typeof LoadingPlaceholder>;\n NoDataPlaceholder?: Nullable<typeof NoDataPlaceholder>;\n /**\n * Navigation Section\n */\n Navigation?: Nullable<typeof Navigation>;\n Pagination?: Nullable<typeof Pagination>;\n PaginationArrowButton?: Nullable<typeof PaginationArrowButton>;\n TableResults?: Nullable<typeof TableResults>;\n RowsPerPage?: Nullable<typeof RowsPerPage>;\n PaginationNumericButtons?: Nullable<typeof PaginationNumericButtons>;\n PaginationNumericButton?: Nullable<typeof PaginationNumericButton>;\n}\n\nexport interface DataGridContextType<T extends RowData> {\n isResizable: boolean;\n tableProps: DataGridType<T>;\n components: DataGridComponentsInterface<T>;\n isLoading: boolean;\n hasResizeColumns: boolean;\n isKeyboardNavigationEnabled: boolean;\n isSkeletonLoading: boolean;\n skeletonProps: React.ComponentProps<typeof Skeleton>;\n dataGridNav: DataGridNav;\n portalTarget: HTMLElement | null;\n isMediumNavigation: boolean;\n isSmallNavigation: boolean;\n}\n\n// oxlint-disable-next-line @typescript-eslint/no-explicit-any\nexport const DataGridContext = createContext<DataGridContextType<any>>(null!);\n\nexport function useDataGridContext<T extends RowData>() {\n const context = useContext<DataGridContextType<T>>(DataGridContext);\n if (!context) {\n throw new Error(\n 'useDataGridContext should be used under Table component provider',\n );\n }\n return context;\n}\n"]}
|
|
@@ -37,7 +37,7 @@ export function useTableNav(options) {
|
|
|
37
37
|
const value = Reflect.get(target, prop, receiver);
|
|
38
38
|
// If it's a function (a class method), we can intercept calls:
|
|
39
39
|
if (typeof value === 'function') {
|
|
40
|
-
//
|
|
40
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
41
|
return (...args) => {
|
|
42
42
|
// Call the original method
|
|
43
43
|
const result = value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I,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;4BACjD,WAAW,EAAE,CAAC;wBAChB,CAAC;wBACD,OAAO,MAAM,CAAC;oBAChB,CAAC,CAAC;gBACJ,CAAC;gBAED,8CAA8C;gBAC9C,OAAO,KAAK,CAAC;YACf,CAAC;YAED,mEAAmE;YACnE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ;gBAClC,gEAAgE;gBAChE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAC7D,+CAA+C;gBAC/C,WAAW,EAAE,CAAC;gBACd,OAAO,MAAM,CAAC;YAChB,CAAC;SACF,CAAC;QAEF,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,OAAsB,EAAE,OAAO,CAAC,CAAC;QAC9D,+EAA+E;IACjF,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO;QACL,SAAS,EAAE;YACT,SAAS,EAAE,CAAC,CAAsB,EAAE,EAAE,CACpC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;YAC7C,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE;SAC5C;QACD,QAAQ,EAAE,eAAe;KAC1B,CAAC;AACJ,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport type React from 'react';\nimport { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { type Config, DataGridNav } from './data-grid-nav';\n\nexport function useTableNav(options?: Config) {\n // Store the actual class instance in a ref so we only create it once\n const instanceRef = useRef<DataGridNav | null>(null);\n if (instanceRef.current === null) {\n instanceRef.current = new DataGridNav(options);\n }\n\n // A piece of state to force a re-render when you want to react to instance changes\n const [, setVersion] = useState(0);\n const forceUpdate = useCallback(() => setVersion((v) => v + 1), []);\n\n // Wrap the instance in a proxy that intercepts reads/writes\n const proxiedInstance = useMemo(() => {\n const handler: ProxyHandler<DataGridNav> = {\n get(target, prop, receiver) {\n const value = Reflect.get(target, prop, receiver);\n\n // If it's a function (a class method), we can intercept calls:\n if (typeof value === 'function') {\n //
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-grid/data-grid-nav/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAe,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,qEAAqE;IACrE,MAAM,WAAW,GAAG,MAAM,CAAqB,IAAI,CAAC,CAAC;IACrD,IAAI,WAAW,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QACjC,WAAW,CAAC,OAAO,GAAG,IAAI,WAAW,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,mFAAmF;IACnF,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEpE,4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C,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC;YAC7C,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE;SAC5C;QACD,QAAQ,EAAE,eAAe;KAC1B,CAAC;AACJ,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport type React from 'react';\nimport { useCallback, useMemo, useRef, useState } from 'react';\n\nimport { type Config, DataGridNav } from './data-grid-nav';\n\nexport function useTableNav(options?: Config) {\n // Store the actual class instance in a ref so we only create it once\n const instanceRef = useRef<DataGridNav | null>(null);\n if (instanceRef.current === null) {\n instanceRef.current = new DataGridNav(options);\n }\n\n // A piece of state to force a re-render when you want to react to instance changes\n const [, setVersion] = useState(0);\n const forceUpdate = useCallback(() => setVersion((v) => v + 1), []);\n\n // Wrap the instance in a proxy that intercepts reads/writes\n const proxiedInstance = useMemo(() => {\n const handler: ProxyHandler<DataGridNav> = {\n get(target, prop, receiver) {\n const value = Reflect.get(target, prop, receiver);\n\n // If it's a function (a class method), we can intercept calls:\n if (typeof value === 'function') {\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n return (...args: any[]) => {\n // Call the original method\n const result = value.apply(target, args);\n\n // Example: force re-render if the method is known to change internal state\n // or if you want to force re-render after *every* method call, remove the condition\n if (['enable', 'disable'].includes(String(prop))) {\n forceUpdate();\n }\n return result;\n };\n }\n\n // Otherwise, it's a property. Just return it.\n return value;\n },\n\n // Trap for property assignments, so React can re-render on changes\n set(target, prop, newValue, receiver) {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const result = Reflect.set(target, prop, newValue, receiver);\n // Force re-render after setting *any* property\n forceUpdate();\n return result;\n },\n };\n\n return new Proxy(instanceRef.current as DataGridNav, handler);\n // We only want to create a new Proxy if the instanceRef or forceUpdate changes\n }, [forceUpdate]);\n\n return {\n listeners: {\n onKeyDown: (e: React.KeyboardEvent) =>\n proxiedInstance.tableKeyDown(e.nativeEvent),\n onKeyUp: () => proxiedInstance.tableKeyUp(),\n },\n tableNav: proxiedInstance,\n };\n}\n"]}
|
|
@@ -39,7 +39,7 @@ const ColumnActions = {
|
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
const COMMON_COLUMNS = (options) => {
|
|
42
|
-
//
|
|
42
|
+
// oxlint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
43
|
const columns = [
|
|
44
44
|
columnHelper.accessor('name', {
|
|
45
45
|
cell: (info) => info.getValue(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datagrid-kitchen-sink.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-kitchen-sink.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAGL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EAEjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,MAAM,YAAY,GAAG,kBAAkB,EAAkB,CAAC;AAE1D,MAAM,aAAa,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ACD,KAAK,EAAE,aAAa;aACrB;SACF;KACF;CAC+C,CAAC;AAEnD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EACJ,QAAQ,EAAE,mBAAmB,EAC7B,aAAa,EAAE,gBAAgB,EAC/B,WAAW,EACX,WAAW,EACX,sBAAsB,EAAE,4BAA4B,GACrD,GAAG,WAAW,CAAC;QACd,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,CAAC;YACxD,KAAK,EAAE,WAAW;SACnB;QACD,WAAW,EAAE;YACX,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC;YAC5B,KAAK,EAAE,QAAQ;SAChB;QACD,sBAAsB,EAAE,KAAK;QAC7B,QAAQ,EAAE,KAAK;QACf,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,aAAa,iCACtB,kBAAkB,KACrB,OAAO,EAAE,cAAc,CAAC;YACtB,4BAA4B;SAC7B,CAAC,EACF,aAAa,EAAE,IAAI,EACnB,iBAAiB,EAAE,iBAAiB,EAAE,IACtC,CAAC;IAEH,OAAO,CACL,eAAK,SAAS,EAAC,yDAAyD,aACtE,KAAC,IAAI,IAAC,MAAM,SAAG,EACf,KAAC,QAAQ,IACP,WAAW,EAAE,IAAI,EACjB,aAAa,EAAE,KAAK,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,OAAO,EAAE;oBACP,WAAW,EAAE,WAA0B;oBACvC,gBAAgB;oBAChB,WAAW,EAAE,WAA0B;iBACxC,GACD,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DataGrid, Menu } from '@neo4j-ndl/react';\nimport { ChevronDownIconSolid } from '@neo4j-ndl/react/icons';\nimport {\n type ColumnDef,\n type ColumnMeta,\n createColumnHelper,\n getCoreRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n type TableOptions,\n useReactTable,\n} from '@tanstack/react-table';\nimport { Leva, useControls } from 'leva';\n\nimport { type BorderStyle, type HeaderStyle } from '../DataGrid';\nimport { TABLE_DEMO_DATA } from './staticData';\n\ntype TestDataFormat = {\n name: string;\n age: number;\n cypherCommand: string;\n};\n\nconst columnHelper = createColumnHelper<TestDataFormat>();\n\nconst ColumnActions: ColumnMeta<TestDataFormat, unknown> = {\n columnActions: {\n actions: [\n {\n onClick: () => {\n alert('Action triggered');\n },\n title: 'Example Column Action',\n },\n ],\n },\n};\n\ntype ColumnGeneratorOptions = {\n shouldIncludeRowActionColumn: boolean;\n};\nconst COMMON_COLUMNS = (options: ColumnGeneratorOptions) => {\n //
|
|
1
|
+
{"version":3,"file":"datagrid-kitchen-sink.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-kitchen-sink.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAGL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EAEjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B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Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DataGrid, Menu } from '@neo4j-ndl/react';\nimport { ChevronDownIconSolid } from '@neo4j-ndl/react/icons';\nimport {\n type ColumnDef,\n type ColumnMeta,\n createColumnHelper,\n getCoreRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n type TableOptions,\n useReactTable,\n} from '@tanstack/react-table';\nimport { Leva, useControls } from 'leva';\n\nimport { type BorderStyle, type HeaderStyle } from '../DataGrid';\nimport { TABLE_DEMO_DATA } from './staticData';\n\ntype TestDataFormat = {\n name: string;\n age: number;\n cypherCommand: string;\n};\n\nconst columnHelper = createColumnHelper<TestDataFormat>();\n\nconst ColumnActions: ColumnMeta<TestDataFormat, unknown> = {\n columnActions: {\n actions: [\n {\n onClick: () => {\n alert('Action triggered');\n },\n title: 'Example Column Action',\n },\n ],\n },\n};\n\ntype ColumnGeneratorOptions = {\n shouldIncludeRowActionColumn: boolean;\n};\nconst COMMON_COLUMNS = (options: ColumnGeneratorOptions) => {\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n const columns: ColumnDef<TestDataFormat, any>[] = [\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n maxSize: 300,\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.getValue(),\n header: () => <div>Age</div>,\n minSize: 80,\n ...(options.shouldIncludeRowActionColumn\n ? {\n meta: {\n ...ColumnActions,\n },\n }\n : {}),\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n minSize: 400,\n size: 400,\n }),\n ];\n\n if (options.shouldIncludeRowActionColumn) {\n columns.push(\n columnHelper.display({\n cell: (cell) => {\n const isSpecialRow =\n cell.row.original.name === TABLE_DEMO_DATA[3].name || undefined;\n return (\n <DataGrid.ActionCell\n cell={cell}\n innerCleanIconButtonProps={{\n children: isSpecialRow && <ChevronDownIconSolid />,\n description: `Actions for ${cell.row.original.name}`,\n }}\n innerMenuProps={\n isSpecialRow && {\n children: <Menu.Item title=\"Custom icon and menu props\" />,\n }\n }\n />\n );\n },\n id: 'actions',\n meta: {\n isActionCell: {\n actions: [\n {\n onClick: (_event, cell) => {\n alert(\n `Row Action triggered for row with index: ${\n cell.row.index\n }`,\n );\n },\n title: 'Example Row Action',\n },\n ],\n onOpenChange: (open) => console.info(`onOpenChange: ${open}`),\n },\n },\n }),\n );\n }\n\n return columns;\n};\n\nconst COMMON_TABLE_PROPS = {\n columnResizeMode: 'onChange',\n data: TABLE_DEMO_DATA,\n // https://tanstack.com/table/v8/docs/guide/column-sizing#overview\n defaultColumn: {\n minSize: 80,\n },\n enableSorting: false,\n getCoreRowModel: getCoreRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n initialState: {\n pagination: {\n pageSize: 5,\n },\n },\n meta: {\n actions: [\n {\n onClick: () => {\n alert('wowowow');\n },\n title: \"Let's party\",\n },\n ],\n },\n} as Omit<TableOptions<TestDataFormat>, 'columns'>;\n\nconst Component = () => {\n const {\n keyboard: isKeyboardNavigable,\n zebraStriping: hasZebraStriping,\n borderStyle,\n headerStyle,\n includeRowActionColumn: shouldIncludeRowActionColumn,\n } = useControls({\n borderStyle: {\n options: ['all-sides', 'horizontal', 'vertical', 'none'],\n value: 'all-sides',\n },\n headerStyle: {\n options: ['filled', 'clean'],\n value: 'filled',\n },\n includeRowActionColumn: false,\n keyboard: false,\n zebraStriping: false,\n });\n\n const table = useReactTable({\n ...COMMON_TABLE_PROPS,\n columns: COMMON_COLUMNS({\n shouldIncludeRowActionColumn,\n }),\n enableSorting: true,\n getSortedRowModel: getSortedRowModel(),\n });\n\n return (\n <div className=\"n-h-[1000px] n-w-full n-bg-primary-bg-weak n-p-token-32\">\n <Leva isRoot />\n <DataGrid\n isResizable={true}\n tableInstance={table}\n isKeyboardNavigable={isKeyboardNavigable}\n styling={{\n borderStyle: borderStyle as BorderStyle,\n hasZebraStriping,\n headerStyle: headerStyle as HeaderStyle,\n }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
2
|
/**
|
|
14
3
|
*
|
|
@@ -72,18 +61,6 @@ const columns = [
|
|
|
72
61
|
cell: (info) => info.getValue(),
|
|
73
62
|
}),
|
|
74
63
|
];
|
|
75
|
-
const CustomHeaderCell = (_a) => {
|
|
76
|
-
var { htmlAttributes, cell } = _a, restProps = __rest(_a, ["htmlAttributes", "cell"]);
|
|
77
|
-
const tabIndex = cell.index === 0 ? 0 : -1;
|
|
78
|
-
return (_jsx(DataGrid.HeaderCell, Object.assign({}, restProps, { cell: cell, htmlAttributes: Object.assign(Object.assign(Object.assign({}, htmlAttributes), { tabIndex: tabIndex }), (cell.index === 0
|
|
79
|
-
? {
|
|
80
|
-
role: 'presentation',
|
|
81
|
-
style: {
|
|
82
|
-
pointerEvents: 'none',
|
|
83
|
-
},
|
|
84
|
-
}
|
|
85
|
-
: {})) })));
|
|
86
|
-
};
|
|
87
64
|
const CustomBodyRow = ({ row, }) => {
|
|
88
65
|
const { components } = useDataGridContext();
|
|
89
66
|
return (_jsx("div", { role: "row", className: "ndl-data-grid-tr", children: row.getVisibleCells().map((cell) => components.BodyCell && (_jsx(components.BodyCell, { cell: cell, htmlAttributes: {
|
|
@@ -107,7 +84,6 @@ const Component = () => {
|
|
|
107
84
|
});
|
|
108
85
|
return (_jsx("div", { className: "n-w-full", children: _jsx(DataGrid, { components: {
|
|
109
86
|
BodyRow: CustomBodyRow,
|
|
110
|
-
HeaderCell: CustomHeaderCell,
|
|
111
87
|
Navigation: null,
|
|
112
88
|
}, isKeyboardNavigable: false, isResizable: false, tableInstance: table }) }));
|
|
113
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datagrid-single-selectable.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-single-selectable.story.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"datagrid-single-selectable.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-single-selectable.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAS/B,MAAM,YAAY,GAAG,kBAAkB,EAAgB,CAAC;AAExD,MAAM,YAAY,GAAmB;IACnC;QACE,QAAQ,EAAE,CAAC;QACX,EAAE,EAAE,CAAC;QACL,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,OAA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AAC,GAAG,CACxB,CAAC,IAAI,EAAE,EAAE,CACP,UAAU,CAAC,QAAQ,IAAI,CACrB,KAAC,UAAU,CAAC,QAAQ,IAElB,IAAI,EAAE,IAAI,EACV,cAAc,EAAE;gBACd,OAAO,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;aACxD,IAJI,IAAI,CAAC,EAAE,CAKZ,CACH,CACJ,IAZO,GAAG,CAAC,EAAE,CAaV,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,KAAK,GAAG,aAAa,CAAC;QAC1B,gBAAgB,EAAE,UAAU;QAC5B,OAAO;QACP,IAAI,EAAE,YAAY;QAClB,uBAAuB,EAAE,KAAK;QAC9B,aAAa,EAAE,KAAK;QACpB,eAAe,EAAE,eAAe,EAAE;QAClC,qBAAqB,EAAE,qBAAqB,EAAE;QAC9C,YAAY,EAAE;YACZ,YAAY,EAAE;gBACZ,CAAC,EAAE,IAAI;aACR;SACF;KACF,CAAC,CAAC;IAEH,OAAO,CACL,cAAK,SAAS,EAAC,UAAU,YACvB,KAAC,QAAQ,IACP,UAAU,EAAE;gBACV,OAAO,EAAE,aAAa;gBACtB,UAAU,EAAE,IAAI;aACjB,EACD,mBAAmB,EAAE,KAAK,EAC1B,WAAW,EAAE,KAAK,EAClB,aAAa,EAAE,KAAK,GACpB,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DataGrid, Radio, useDataGridContext } from '@neo4j-ndl/react';\nimport {\n createColumnHelper,\n getCoreRowModel,\n getPaginationRowModel,\n useReactTable,\n} from '@tanstack/react-table';\n\ntype PricingEntry = {\n cpuCount: number;\n id: number;\n memory: string;\n storage: string;\n};\n\nconst columnHelper = createColumnHelper<PricingEntry>();\n\nconst DEMO_PRICING: PricingEntry[] = [\n {\n cpuCount: 1,\n id: 1,\n memory: '1 GB',\n storage: '10 GB',\n },\n {\n cpuCount: 2,\n id: 2,\n memory: '2 GB',\n storage: '20 GB',\n },\n {\n cpuCount: 3,\n id: 3,\n memory: '3 GB',\n storage: '30 GB',\n },\n];\n\nconst columns = [\n columnHelper.accessor('id', {\n cell: ({ cell, row }) => (\n <Radio\n ariaLabel={`value-${cell.getValue()}`}\n isChecked={row.getIsSelected()}\n />\n ),\n header: () => null,\n maxSize: 50,\n size: 50,\n }),\n columnHelper.accessor('memory', {\n cell: (info) => info.getValue(),\n minSize: 120,\n }),\n columnHelper.accessor('cpuCount', {\n cell: (info) => info.getValue(),\n }),\n columnHelper.accessor('storage', {\n cell: (info) => info.getValue(),\n }),\n];\n\nconst CustomBodyRow = ({\n row,\n}: React.ComponentProps<typeof DataGrid.BodyRow<PricingEntry>>) => {\n const { components } = useDataGridContext<PricingEntry>();\n\n return (\n <div key={row.id} role=\"row\" className=\"ndl-data-grid-tr\">\n {row.getVisibleCells().map(\n (cell) =>\n components.BodyCell && (\n <components.BodyCell\n key={cell.id}\n cell={cell}\n htmlAttributes={{\n onClick: () => row.toggleSelected(!row.getIsSelected()),\n }}\n />\n ),\n )}\n </div>\n );\n};\n\nconst Component = () => {\n const table = useReactTable({\n columnResizeMode: 'onChange',\n columns,\n data: DEMO_PRICING,\n enableMultiRowSelection: false,\n enableSorting: false,\n getCoreRowModel: getCoreRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n initialState: {\n rowSelection: {\n 0: true,\n },\n },\n });\n\n return (\n <div className=\"n-w-full\">\n <DataGrid\n components={{\n BodyRow: CustomBodyRow,\n Navigation: null,\n }}\n isKeyboardNavigable={false}\n isResizable={false}\n tableInstance={table}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../src/date-picker/DatePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAiC;AACjC,yDAAyD;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,eAEN,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAwB,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAQ5D,2EAA2E;AAC3E,6EAA6E;AAC7E,8DAA8D;AAC9D,MAA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,QAAQ,EAAE,oBAAoB,EAC9B,aAAa,EAAE,eAAe,IAAI,SAAS,IACvC,mBAAmB,IACvB,gBAAgB,EAAC,UAAU,EAC3B,UAAU,EAAE,KAAK,IACjB,CACH,IACI,EAET,QAAQ,EAAE,UAAU,EACpB,eAAe,EAAE,KAAK,EACtB,mBAAmB,EAAE,MAAM,KAAK,OAAO,EACvC,cAAc,EAAE,MAAM,KAAK,MAAM,EACjC,mBAAmB,EACjB,MAAM,KAAK,KAAK,IAAI,CAAC,CAAC,MAAA,oBAAoB,CAAC,aAAa,mCAAI,KAAK,CAAC,EAEpE,YAAY,EAAE,GAAG,EAAE,CAAC,oBAAoB,EACxC,kBAAkB,EAAE,YAAY,IAC5B,eAAe,IACnB,eAAe,EAAE,UAAU,CACzB,uBAAuB,EACvB,oBAAoB,CAAC,eAAe,CACrC,EACD,WAAW,kBACT,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,IAC5C,oBAAoB,CAAC,WAAW,KAErC,IACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// TODO: try to fix as some point\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport { format } from 'date-fns';\nimport { useCallback, useRef, useState } from 'react';\nimport ReactDatePicker, {\n type ReactDatePickerCustomHeaderProps,\n} from 'react-datepicker';\n\nimport type { CommonProps } from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { Divider } from '../divider';\nimport {\n ArrowLeftIconOutline,\n ArrowRightIconOutline,\n CalendarDaysIconOutline,\n ChevronDownIconOutline,\n} from '../icons';\nimport { TextInput } from '../text-input';\nimport { NeedleTime, TimePicker, type TimePickerProps } from '../time-picker';\nimport { TimeZonePicker } from '../timezone-picker';\nimport { Typography } from '../typography';\nimport { daysInMonth, getYearsPeriodString } from './utils';\n\ntype DatePickerTextInputWrapperProps = React.ComponentProps<'input'> & {\n textInputProps?: React.ComponentProps<typeof TextInput>;\n isDisabled?: boolean;\n value?: string;\n};\n\n// This wrapper is needed due to react-datepicker injecting html attributes\n// into the custom input component on root level, since we use htmlAttributes\n// we need to help spread them there instead of the root level\nconst DatePickerTextInputWrapper = ({\n textInputProps,\n isDisabled,\n value,\n placeholder,\n ...restProps\n}: DatePickerTextInputWrapperProps) => {\n // deconstruct textInputProps to avoid bugs with react-datepicker injecting props\n const {\n placeholder: textInputPlaceholder,\n htmlAttributes: textInputHtmlAttributes,\n ref,\n ...restTextInputProps\n } = textInputProps ?? {};\n\n return (\n <TextInput\n ref={ref}\n trailingElement={\n <CalendarDaysIconOutline className=\"ndl-datepicker-icon\" />\n }\n value={value}\n placeholder={placeholder ?? textInputPlaceholder}\n isDisabled={isDisabled}\n // react-datepicker injects html attributes into the custom input\n htmlAttributes={{\n 'aria-label': 'Date picker input',\n ...textInputHtmlAttributes,\n ...restProps,\n }}\n {...restTextInputProps}\n />\n );\n};\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype PickerType = 'day' | 'month' | 'year';\n\n// Define a more flexible type for onChange\ntype DatePickerChangeHandler = (\n date: Date | null | [Date | null, Date | null] | Date[],\n event?: React.SyntheticEvent | undefined,\n) => void;\n\ninterface DatePickerProps {\n /** Props for the embedded `TextInput` component. */\n textInputProps?: React.ComponentProps<typeof TextInput>;\n /** Whether the date picker is disabled. */\n isDisabled?: boolean;\n /** Props for the embedded `TimePicker` component. */\n timePickerProps?: TimePickerProps;\n /** Props for the embedded `TimeZonePicker` component. */\n timeZonePickerProps?: React.ComponentProps<typeof TimeZonePicker>;\n /** Props forwarded to underlying `react-datepicker` component. */\n reactDatePickerProps: React.ComponentProps<typeof ReactDatePicker>;\n}\n\nexport const DatePicker = ({\n reactDatePickerProps,\n textInputProps,\n timePickerProps,\n timeZonePickerProps,\n isDisabled,\n ref,\n className,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', DatePickerProps>) => {\n const classes = classNames(`ndl-datepicker`, className, {});\n const datetimeRef = useRef<ReactDatePicker>(null);\n const [picker, setPicker] = useState<PickerType>('day');\n const [preSelectedDate, setPreSelectedDate] = useState<Date | null>(\n (reactDatePickerProps.selected as Date | null) ||\n (reactDatePickerProps.startDate as Date | null),\n );\n const [selectedTimeZone, setSelectedTimeZone] = useState<string | undefined>(\n timeZonePickerProps?.value,\n );\n\n const isInsideDialog = useIsInsideDialog();\n\n const headerAction = useCallback(\n (action: PickerType) => {\n setPicker(picker === action ? 'day' : action);\n },\n [picker],\n );\n\n const CustomHeader = useCallback(\n (props: ReactDatePickerCustomHeaderProps) => {\n const {\n decreaseMonth,\n increaseMonth,\n increaseYear,\n decreaseYear,\n nextMonthButtonDisabled,\n nextYearButtonDisabled,\n prevMonthButtonDisabled,\n prevYearButtonDisabled,\n } = props;\n\n const prevCallback = picker === 'year' ? decreaseYear : decreaseMonth;\n const nextCallback = picker === 'year' ? increaseYear : increaseMonth;\n const prevDisabled =\n picker === 'year' ? prevYearButtonDisabled : prevMonthButtonDisabled;\n const nextDisabled =\n picker === 'year' ? nextYearButtonDisabled : nextMonthButtonDisabled;\n\n return (\n <div className=\"ndl-datepicker-header\">\n <div className=\"ndl-datepicker-selects\">\n {picker !== 'year' && (\n <button\n aria-label={`${picker === 'month' ? 'Close' : 'Open'} month picker`}\n aria-pressed={picker === 'month'}\n onClick={() => headerAction('month')}\n >\n <div className=\"n-flex n-items-center n-gap-token-4\">\n <Typography variant=\"subheading-small\">\n {format(props.date, 'MMM')}\n </Typography>\n <ChevronDownIconOutline\n className={classNames('ndl-datepicker-chevron', {\n 'n-rotate-180': picker === 'month',\n })}\n aria-label=\"Chevron icon\"\n />\n </div>\n </button>\n )}\n {picker !== 'month' && (\n <button\n aria-label={`${picker === 'year' ? 'Close' : 'Open'} year picker`}\n onClick={() => headerAction('year')}\n >\n <div className=\"n-flex n-items-center n-gap-token-4\">\n <Typography variant=\"subheading-small\">\n {picker === 'year'\n ? getYearsPeriodString(\n props.date,\n reactDatePickerProps?.yearItemNumber,\n )\n : format(props.date, 'yyyy')}\n </Typography>\n <ChevronDownIconOutline\n className={classNames('ndl-datepicker-chevron', {\n 'n-rotate-180': picker === 'year',\n })}\n aria-label=\"Chevron icon\"\n />\n </div>\n </button>\n )}\n </div>\n {picker !== 'month' && (\n <div className=\"n-flex n-justify-center n-gap-token-16\">\n <CleanIconButton\n description={\n picker === 'year' ? 'Previous period' : 'Previous month'\n }\n onClick={prevCallback}\n isDisabled={prevDisabled}\n className=\"n-text-neutral-text-weak\"\n size=\"small\"\n >\n <ArrowLeftIconOutline />\n </CleanIconButton>\n <CleanIconButton\n description={picker === 'year' ? 'Next period' : 'Next month'}\n onClick={nextCallback}\n isDisabled={nextDisabled}\n className=\"n-text-neutral-text-weak\"\n size=\"small\"\n >\n <ArrowRightIconOutline />\n </CleanIconButton>\n </div>\n )}\n </div>\n );\n },\n [picker, headerAction, reactDatePickerProps?.yearItemNumber],\n );\n\n const handleTimeChange = (newTime: NeedleTime) => {\n if (\n reactDatePickerProps.selectsRange ||\n reactDatePickerProps.selectsMultiple\n ) {\n // this is consistent with the behavior of react-datepicker\n return;\n }\n\n if (!preSelectedDate) {\n return;\n }\n\n const newDate = new Date(preSelectedDate);\n newDate.setHours(newTime.hour, newTime.minute, 0, 0);\n setPreSelectedDate(newDate);\n\n if (reactDatePickerProps.onChange) {\n // For single date selection\n reactDatePickerProps.onChange(newDate, undefined);\n }\n };\n\n const handleTimeZoneChange = (timezone: string) => {\n setSelectedTimeZone(timezone);\n if (timeZonePickerProps?.onChange) {\n timeZonePickerProps.onChange(timezone);\n }\n };\n\n /**\n * Intercept onChange so we can work with\n * Month and Year pickers\n */\n const interceptedChange: DatePickerChangeHandler = useCallback(\n (\n date: Date | null | [Date | null, Date | null] | Date[],\n event?: React.SyntheticEvent,\n ) => {\n if (picker !== 'day') {\n // setTimeout to prevent picker change before the handleMonthChange logic\n setTimeout(() => {\n setPicker('day');\n });\n } else if (picker === 'day') {\n if (date instanceof Date) {\n setPreSelectedDate(date);\n } else if (\n Array.isArray(date) &&\n date.length > 0 &&\n date[0] instanceof Date\n ) {\n setPreSelectedDate(date[0]);\n } else if (date === null) {\n setPreSelectedDate(null);\n }\n\n if (reactDatePickerProps.onChange && date !== null) {\n (reactDatePickerProps.onChange as DatePickerChangeHandler)(\n date,\n event,\n );\n }\n }\n },\n [picker, reactDatePickerProps],\n );\n\n /**\n * Intercept onCalendarClose so we can\n * switch to \"day\" picker if we close on \"month\" or \"year\"\n * view\n */\n const interceptedOnCalendarClose = useCallback(() => {\n if (picker !== 'day') {\n setPicker('day');\n }\n reactDatePickerProps?.onCalendarClose?.();\n }, [picker, reactDatePickerProps]);\n\n const handleMonthChange = useCallback(\n (date: Date) => {\n if (picker === 'month') {\n const selectedDay = preSelectedDate?.getDate() ?? 1;\n const daysInNewMonth = daysInMonth(date.getMonth(), date.getFullYear());\n date.setDate(Math.min(selectedDay, daysInNewMonth));\n reactDatePickerProps?.onMonthChange?.(date);\n } else if (picker === 'year') {\n const selectedDay = preSelectedDate?.getDate() ?? 1;\n const selectedMonth = preSelectedDate?.getMonth() ?? 0;\n const daysInNewMonth = daysInMonth(selectedMonth, date.getFullYear());\n date.setMonth(selectedMonth, Math.min(selectedDay, daysInNewMonth));\n reactDatePickerProps?.onMonthChange?.(date);\n }\n setPreSelectedDate(date);\n },\n [picker, preSelectedDate, reactDatePickerProps],\n );\n\n /**\n * Intercept onChangeRaw to handle clearing the input\n * When the user clears the text input, set the date to null\n */\n const interceptedOnChangeRaw = useCallback(\n (\n event?:\n | React.KeyboardEvent<HTMLElement>\n | React.MouseEvent<HTMLElement, MouseEvent>,\n ) => {\n const target = event?.target as HTMLInputElement | undefined;\n if (target?.value === '') {\n setPreSelectedDate(null);\n if (reactDatePickerProps.onChange) {\n (reactDatePickerProps.onChange as DatePickerChangeHandler)(\n null,\n event,\n );\n }\n }\n reactDatePickerProps?.onChangeRaw?.(event);\n },\n [reactDatePickerProps],\n );\n\n const datePickerProps = {\n ...reactDatePickerProps,\n onCalendarClose: interceptedOnCalendarClose,\n onChange: interceptedChange,\n onChangeRaw: interceptedOnChangeRaw,\n onMonthChange: handleMonthChange,\n };\n\n return (\n <div\n className={classes}\n ref={ref}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <ReactDatePicker\n ref={datetimeRef}\n customInput={\n <DatePickerTextInputWrapper\n isDisabled={isDisabled}\n textInputProps={textInputProps}\n />\n }\n customTimeInput={\n <span className=\"ndl-time-picker-wrapper\">\n <Divider />\n <TimePicker\n isFluid\n value={\n preSelectedDate\n ? new NeedleTime(\n preSelectedDate.getHours(),\n preSelectedDate.getMinutes(),\n )\n : undefined\n }\n onChange={handleTimeChange}\n {...timePickerProps}\n floatingStrategy=\"absolute\"\n isPortaled={false}\n />\n {timeZonePickerProps && (\n <TimeZonePicker\n isFluid\n value={selectedTimeZone}\n onChange={handleTimeZoneChange}\n referenceDate={preSelectedDate || undefined}\n {...timeZonePickerProps}\n floatingStrategy=\"absolute\"\n isPortaled={false}\n />\n )}\n </span>\n }\n disabled={isDisabled}\n showPopperArrow={false}\n showMonthYearPicker={picker === 'month'}\n showYearPicker={picker === 'year'}\n shouldCloseOnSelect={\n picker === 'day' && !(reactDatePickerProps.showTimeInput ?? false)\n }\n dayClassName={() => 'ndl-datepicker-day'}\n renderCustomHeader={CustomHeader}\n {...datePickerProps}\n popperClassName={classNames(\n 'ndl-datepicker-popper',\n reactDatePickerProps.popperClassName,\n )}\n popperProps={{\n strategy: isInsideDialog ? 'fixed' : 'absolute',\n ...reactDatePickerProps.popperProps,\n }}\n />\n </div>\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"DatePicker.js","sourceRoot":"","sources":["../../../src/date-picker/DatePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iCAAiC;AACjC,yDAAyD;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,eAEN,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAwB,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAQ5D,2EAA2E;AAC3E,6EAA6E;AAC7E,8DAA8D;AAC9D,MAAM,0BAA0B,GAAG,CAAC,EAMF,EAAE,EAAE;QANF,EAClC,cAAc,EACd,UAAU,EACV,KAAK,EACL,WAAW,OAEqB,EAD7B,SAAS,cALsB,wDAMnC,CADa;IAEZ,iFAAiF;IAC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AAQ,EAAE,UAAU,EACpB,eAAe,EAAE,KAAK,EACtB,mBAAmB,EAAE,MAAM,KAAK,OAAO,EACvC,cAAc,EAAE,MAAM,KAAK,MAAM,EACjC,mBAAmB,EACjB,MAAM,KAAK,KAAK,IAAI,CAAC,CAAC,MAAA,oBAAoB,CAAC,aAAa,mCAAI,KAAK,CAAC,EAEpE,YAAY,EAAE,GAAG,EAAE,CAAC,oBAAoB,EACxC,kBAAkB,EAAE,YAAY,IAC5B,eAAe,IACnB,eAAe,EAAE,UAAU,CACzB,uBAAuB,EACvB,oBAAoB,CAAC,eAAe,CACrC,EACD,WAAW,kBACT,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,IAC5C,oBAAoB,CAAC,WAAW,KAErC,IACE,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// TODO: try to fix as some point\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport { format } from 'date-fns';\nimport { useCallback, useRef, useState } from 'react';\nimport ReactDatePicker, {\n type ReactDatePickerCustomHeaderProps,\n} from 'react-datepicker';\n\nimport type { CommonProps } from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { Divider } from '../divider';\nimport {\n ArrowLeftIconOutline,\n ArrowRightIconOutline,\n CalendarDaysIconOutline,\n ChevronDownIconOutline,\n} from '../icons';\nimport { TextInput } from '../text-input';\nimport { NeedleTime, TimePicker, type TimePickerProps } from '../time-picker';\nimport { TimeZonePicker } from '../timezone-picker';\nimport { Typography } from '../typography';\nimport { daysInMonth, getYearsPeriodString } from './utils';\n\ntype DatePickerTextInputWrapperProps = React.ComponentProps<'input'> & {\n textInputProps?: React.ComponentProps<typeof TextInput>;\n isDisabled?: boolean;\n value?: string;\n};\n\n// This wrapper is needed due to react-datepicker injecting html attributes\n// into the custom input component on root level, since we use htmlAttributes\n// we need to help spread them there instead of the root level\nconst DatePickerTextInputWrapper = ({\n textInputProps,\n isDisabled,\n value,\n placeholder,\n ...restProps\n}: DatePickerTextInputWrapperProps) => {\n // deconstruct textInputProps to avoid bugs with react-datepicker injecting props\n const {\n placeholder: textInputPlaceholder,\n htmlAttributes: textInputHtmlAttributes,\n ref,\n ...restTextInputProps\n } = textInputProps ?? {};\n\n return (\n <TextInput\n ref={ref}\n trailingElement={\n <CalendarDaysIconOutline className=\"ndl-datepicker-icon\" />\n }\n value={value}\n placeholder={placeholder ?? textInputPlaceholder}\n isDisabled={isDisabled}\n // react-datepicker injects html attributes into the custom input\n htmlAttributes={{\n 'aria-label': 'Date picker input', // TODO: shouldn't be added by default, conflicts with the actual label.\n ...textInputHtmlAttributes,\n ...restProps,\n }}\n {...restTextInputProps}\n />\n );\n};\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype PickerType = 'day' | 'month' | 'year';\n\n// Define a more flexible type for onChange\ntype DatePickerChangeHandler = (\n date: Date | null | [Date | null, Date | null] | Date[],\n event?: React.SyntheticEvent | undefined,\n) => void;\n\ninterface DatePickerProps {\n /** Props for the embedded `TextInput` component. */\n textInputProps?: React.ComponentProps<typeof TextInput>;\n /** Whether the date picker is disabled. */\n isDisabled?: boolean;\n /** Props for the embedded `TimePicker` component. */\n timePickerProps?: TimePickerProps;\n /** Props for the embedded `TimeZonePicker` component. */\n timeZonePickerProps?: React.ComponentProps<typeof TimeZonePicker>;\n /** Props forwarded to underlying `react-datepicker` component. */\n reactDatePickerProps: React.ComponentProps<typeof ReactDatePicker>;\n}\n\nexport const DatePicker = ({\n reactDatePickerProps,\n textInputProps,\n timePickerProps,\n timeZonePickerProps,\n isDisabled,\n ref,\n className,\n style,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', DatePickerProps>) => {\n const classes = classNames(`ndl-datepicker`, className, {});\n const datetimeRef = useRef<ReactDatePicker>(null);\n const [picker, setPicker] = useState<PickerType>('day');\n const [preSelectedDate, setPreSelectedDate] = useState<Date | null>(\n (reactDatePickerProps.selected as Date | null) ||\n (reactDatePickerProps.startDate as Date | null),\n );\n const [selectedTimeZone, setSelectedTimeZone] = useState<string | undefined>(\n timeZonePickerProps?.value,\n );\n\n const isInsideDialog = useIsInsideDialog();\n\n const headerAction = useCallback(\n (action: PickerType) => {\n setPicker(picker === action ? 'day' : action);\n },\n [picker],\n );\n\n const CustomHeader = useCallback(\n (props: ReactDatePickerCustomHeaderProps) => {\n const {\n decreaseMonth,\n increaseMonth,\n increaseYear,\n decreaseYear,\n nextMonthButtonDisabled,\n nextYearButtonDisabled,\n prevMonthButtonDisabled,\n prevYearButtonDisabled,\n } = props;\n\n const prevCallback = picker === 'year' ? decreaseYear : decreaseMonth;\n const nextCallback = picker === 'year' ? increaseYear : increaseMonth;\n const prevDisabled =\n picker === 'year' ? prevYearButtonDisabled : prevMonthButtonDisabled;\n const nextDisabled =\n picker === 'year' ? nextYearButtonDisabled : nextMonthButtonDisabled;\n\n return (\n <div className=\"ndl-datepicker-header\">\n <div className=\"ndl-datepicker-selects\">\n {picker !== 'year' && (\n <button\n aria-label={`${picker === 'month' ? 'Close' : 'Open'} month picker`}\n aria-pressed={picker === 'month'}\n onClick={() => headerAction('month')}\n >\n <div className=\"n-flex n-items-center n-gap-token-4\">\n <Typography variant=\"subheading-small\">\n {format(props.date, 'MMM')}\n </Typography>\n <ChevronDownIconOutline\n className={classNames('ndl-datepicker-chevron', {\n 'n-rotate-180': picker === 'month',\n })}\n aria-label=\"Chevron icon\"\n />\n </div>\n </button>\n )}\n {picker !== 'month' && (\n <button\n aria-label={`${picker === 'year' ? 'Close' : 'Open'} year picker`}\n onClick={() => headerAction('year')}\n >\n <div className=\"n-flex n-items-center n-gap-token-4\">\n <Typography variant=\"subheading-small\">\n {picker === 'year'\n ? getYearsPeriodString(\n props.date,\n reactDatePickerProps?.yearItemNumber,\n )\n : format(props.date, 'yyyy')}\n </Typography>\n <ChevronDownIconOutline\n className={classNames('ndl-datepicker-chevron', {\n 'n-rotate-180': picker === 'year',\n })}\n aria-label=\"Chevron icon\"\n />\n </div>\n </button>\n )}\n </div>\n {picker !== 'month' && (\n <div className=\"n-flex n-justify-center n-gap-token-16\">\n <CleanIconButton\n description={\n picker === 'year' ? 'Previous period' : 'Previous month'\n }\n onClick={prevCallback}\n isDisabled={prevDisabled}\n className=\"n-text-neutral-text-weak\"\n size=\"small\"\n >\n <ArrowLeftIconOutline />\n </CleanIconButton>\n <CleanIconButton\n description={picker === 'year' ? 'Next period' : 'Next month'}\n onClick={nextCallback}\n isDisabled={nextDisabled}\n className=\"n-text-neutral-text-weak\"\n size=\"small\"\n >\n <ArrowRightIconOutline />\n </CleanIconButton>\n </div>\n )}\n </div>\n );\n },\n [picker, headerAction, reactDatePickerProps?.yearItemNumber],\n );\n\n const handleTimeChange = (newTime: NeedleTime) => {\n if (\n reactDatePickerProps.selectsRange ||\n reactDatePickerProps.selectsMultiple\n ) {\n // this is consistent with the behavior of react-datepicker\n return;\n }\n\n if (!preSelectedDate) {\n return;\n }\n\n const newDate = new Date(preSelectedDate);\n newDate.setHours(newTime.hour, newTime.minute, 0, 0);\n setPreSelectedDate(newDate);\n\n if (reactDatePickerProps.onChange) {\n // For single date selection\n reactDatePickerProps.onChange(newDate, undefined);\n }\n };\n\n const handleTimeZoneChange = (timezone: string) => {\n setSelectedTimeZone(timezone);\n if (timeZonePickerProps?.onChange) {\n timeZonePickerProps.onChange(timezone);\n }\n };\n\n /**\n * Intercept onChange so we can work with\n * Month and Year pickers\n */\n const interceptedChange: DatePickerChangeHandler = useCallback(\n (\n date: Date | null | [Date | null, Date | null] | Date[],\n event?: React.SyntheticEvent,\n ) => {\n if (picker !== 'day') {\n // setTimeout to prevent picker change before the handleMonthChange logic\n setTimeout(() => {\n setPicker('day');\n });\n } else if (picker === 'day') {\n if (date instanceof Date) {\n setPreSelectedDate(date);\n } else if (\n Array.isArray(date) &&\n date.length > 0 &&\n date[0] instanceof Date\n ) {\n setPreSelectedDate(date[0]);\n } else if (date === null) {\n setPreSelectedDate(null);\n }\n\n if (reactDatePickerProps.onChange && date !== null) {\n (reactDatePickerProps.onChange as DatePickerChangeHandler)(\n date,\n event,\n );\n }\n }\n },\n [picker, reactDatePickerProps],\n );\n\n /**\n * Intercept onCalendarClose so we can\n * switch to \"day\" picker if we close on \"month\" or \"year\"\n * view\n */\n const interceptedOnCalendarClose = useCallback(() => {\n if (picker !== 'day') {\n setPicker('day');\n }\n reactDatePickerProps?.onCalendarClose?.();\n }, [picker, reactDatePickerProps]);\n\n const handleMonthChange = useCallback(\n (date: Date) => {\n if (picker === 'month') {\n const selectedDay = preSelectedDate?.getDate() ?? 1;\n const daysInNewMonth = daysInMonth(date.getMonth(), date.getFullYear());\n date.setDate(Math.min(selectedDay, daysInNewMonth));\n reactDatePickerProps?.onMonthChange?.(date);\n } else if (picker === 'year') {\n const selectedDay = preSelectedDate?.getDate() ?? 1;\n const selectedMonth = preSelectedDate?.getMonth() ?? 0;\n const daysInNewMonth = daysInMonth(selectedMonth, date.getFullYear());\n date.setMonth(selectedMonth, Math.min(selectedDay, daysInNewMonth));\n reactDatePickerProps?.onMonthChange?.(date);\n }\n setPreSelectedDate(date);\n },\n [picker, preSelectedDate, reactDatePickerProps],\n );\n\n /**\n * Intercept onChangeRaw to handle clearing the input\n * When the user clears the text input, set the date to null\n */\n const interceptedOnChangeRaw = useCallback(\n (\n event?:\n | React.KeyboardEvent<HTMLElement>\n | React.MouseEvent<HTMLElement, MouseEvent>,\n ) => {\n const target = event?.target as HTMLInputElement | undefined;\n if (target?.value === '') {\n setPreSelectedDate(null);\n if (reactDatePickerProps.onChange) {\n (reactDatePickerProps.onChange as DatePickerChangeHandler)(\n null,\n event,\n );\n }\n }\n reactDatePickerProps?.onChangeRaw?.(event);\n },\n [reactDatePickerProps],\n );\n\n const datePickerProps = {\n ...reactDatePickerProps,\n onCalendarClose: interceptedOnCalendarClose,\n onChange: interceptedChange,\n onChangeRaw: interceptedOnChangeRaw,\n onMonthChange: handleMonthChange,\n };\n\n return (\n <div\n className={classes}\n ref={ref}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <ReactDatePicker\n ref={datetimeRef}\n customInput={\n <DatePickerTextInputWrapper\n isDisabled={isDisabled}\n textInputProps={textInputProps}\n />\n }\n customTimeInput={\n <span className=\"ndl-time-picker-wrapper\">\n <Divider />\n <TimePicker\n isFluid\n value={\n preSelectedDate\n ? new NeedleTime(\n preSelectedDate.getHours(),\n preSelectedDate.getMinutes(),\n )\n : undefined\n }\n onChange={handleTimeChange}\n {...timePickerProps}\n floatingStrategy=\"absolute\"\n isPortaled={false}\n />\n {timeZonePickerProps && (\n <TimeZonePicker\n isFluid\n value={selectedTimeZone}\n onChange={handleTimeZoneChange}\n referenceDate={preSelectedDate || undefined}\n {...timeZonePickerProps}\n floatingStrategy=\"absolute\"\n isPortaled={false}\n />\n )}\n </span>\n }\n disabled={isDisabled}\n showPopperArrow={false}\n showMonthYearPicker={picker === 'month'}\n showYearPicker={picker === 'year'}\n shouldCloseOnSelect={\n picker === 'day' && !(reactDatePickerProps.showTimeInput ?? false)\n }\n dayClassName={() => 'ndl-datepicker-day'}\n renderCustomHeader={CustomHeader}\n {...datePickerProps}\n popperClassName={classNames(\n 'ndl-datepicker-popper',\n reactDatePickerProps.popperClassName,\n )}\n popperProps={{\n strategy: isInsideDialog ? 'fixed' : 'absolute',\n ...reactDatePickerProps.popperProps,\n }}\n />\n </div>\n );\n};\n"]}
|
|
@@ -28,28 +28,28 @@ const Component = () => {
|
|
|
28
28
|
setSelectedDate(date);
|
|
29
29
|
};
|
|
30
30
|
return (_jsx(DatePicker, { textInputProps: {
|
|
31
|
-
label: 'This one has a label',
|
|
32
31
|
helpText: 'With help text',
|
|
33
|
-
showRequiredOrOptionalLabel: false,
|
|
34
32
|
isDisabled: false,
|
|
35
|
-
isRequired: false,
|
|
36
|
-
isReadOnly: false,
|
|
37
33
|
isFluid: false,
|
|
34
|
+
isReadOnly: false,
|
|
35
|
+
isRequired: false,
|
|
36
|
+
label: 'This one has a label',
|
|
38
37
|
moreInformationText: 'With information icon text',
|
|
38
|
+
showRequiredOrOptionalLabel: false,
|
|
39
39
|
}, timePickerProps: {
|
|
40
|
-
timeInterval: 20,
|
|
41
40
|
format: 'hh:mm aa',
|
|
42
41
|
isDisabled: false,
|
|
43
|
-
isRequired: false,
|
|
44
|
-
isReadOnly: false,
|
|
45
42
|
isFluid: false,
|
|
43
|
+
isReadOnly: false,
|
|
44
|
+
isRequired: false,
|
|
45
|
+
timeInterval: 20,
|
|
46
46
|
}, reactDatePickerProps: {
|
|
47
|
-
selected: selectedDate,
|
|
48
47
|
onChange: handleOnChange,
|
|
49
|
-
showTimeInput: true,
|
|
50
48
|
popperProps: {
|
|
51
49
|
strategy: 'fixed',
|
|
52
50
|
},
|
|
51
|
+
selected: selectedDate,
|
|
52
|
+
showTimeInput: true,
|
|
53
53
|
} }));
|
|
54
54
|
};
|
|
55
55
|
export default Component;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker-full.story.js","sourceRoot":"","sources":["../../../../src/date-picker/stories/date-picker-full.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAC9C,IAAI,IAAI,CAAC,YAAY,CAAC,CACvB,CAAC;IACF,MAAM,cAAc,GAAG,CAAC,IAAiB,EAAE,EAAE;QAC3C,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,UAAU,IACT,cAAc,EAAE;YACd,
|
|
1
|
+
{"version":3,"file":"date-picker-full.story.js","sourceRoot":"","sources":["../../../../src/date-picker/stories/date-picker-full.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAC9C,IAAI,IAAI,CAAC,YAAY,CAAC,CACvB,CAAC;IACF,MAAM,cAAc,GAAG,CAAC,IAAiB,EAAE,EAAE;QAC3C,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,CAAC;IAEF,OAAO,CACL,KAAC,UAAU,IACT,cAAc,EAAE;YACd,QAAQ,EAAE,gBAAgB;YAC1B,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,KAAK;YACjB,KAAK,EAAE,sBAAsB;YAC7B,mBAAmB,EAAE,4BAA4B;YACjD,2BAA2B,EAAE,KAAK;SACnC,EACD,eAAe,EAAE;YACf,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,EAAE;SACjB,EACD,oBAAoB,EAAE;YACpB,QAAQ,EAAE,cAAc;YACxB,WAAW,EAAE;gBACX,QAAQ,EAAE,OAAO;aAClB;YACD,QAAQ,EAAE,YAAY;YACtB,aAAa,EAAE,IAAI;SACpB,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DatePicker } from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [selectedDate, setSelectedDate] = useState<Date | null>(\n new Date('2023-05-27'),\n );\n const handleOnChange = (date: Date | null) => {\n setSelectedDate(date);\n };\n\n return (\n <DatePicker\n textInputProps={{\n helpText: 'With help text',\n isDisabled: false,\n isFluid: false,\n isReadOnly: false,\n isRequired: false,\n label: 'This one has a label',\n moreInformationText: 'With information icon text',\n showRequiredOrOptionalLabel: false,\n }}\n timePickerProps={{\n format: 'hh:mm aa',\n isDisabled: false,\n isFluid: false,\n isReadOnly: false,\n isRequired: false,\n timeInterval: 20,\n }}\n reactDatePickerProps={{\n onChange: handleOnChange,\n popperProps: {\n strategy: 'fixed',\n },\n selected: selectedDate,\n showTimeInput: true,\n }}\n />\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -23,10 +23,10 @@ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
|
23
23
|
import { Divider } from '@neo4j-ndl/react';
|
|
24
24
|
const Component = () => {
|
|
25
25
|
return (_jsxs("div", { style: {
|
|
26
|
-
width: '100%',
|
|
27
26
|
display: 'flex',
|
|
28
27
|
flexDirection: 'column',
|
|
29
28
|
gap: '4px',
|
|
29
|
+
width: '100%',
|
|
30
30
|
}, children: [_jsx("p", { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." }), _jsx(Divider, { orientation: "horizontal" }), _jsx("p", { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." })] }));
|
|
31
31
|
};
|
|
32
32
|
export default Component;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider-horizontal.story.js","sourceRoot":"","sources":["../../../../src/divider/stories/divider-horizontal.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,eACE,KAAK,EAAE;YACL,
|
|
1
|
+
{"version":3,"file":"divider-horizontal.story.js","sourceRoot":"","sources":["../../../../src/divider/stories/divider-horizontal.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,eACE,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,QAAQ;YACvB,GAAG,EAAE,KAAK;YACV,KAAK,EAAE,MAAM;SACd,aAED,mFAA+D,EAC/D,KAAC,OAAO,IAAC,WAAW,EAAC,YAAY,GAAG,EACpC,mFAA+D,IAC3D,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Divider } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <div\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '4px',\n width: '100%',\n }}\n >\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n <Divider orientation=\"horizontal\" />\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -23,10 +23,10 @@ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
|
|
|
23
23
|
import { Divider } from '@neo4j-ndl/react';
|
|
24
24
|
const Component = () => {
|
|
25
25
|
return (_jsxs("div", { style: {
|
|
26
|
-
width: '100%',
|
|
27
26
|
display: 'flex',
|
|
28
27
|
flexDirection: 'row',
|
|
29
28
|
gap: '4px',
|
|
29
|
+
width: '100%',
|
|
30
30
|
}, children: [_jsx("p", { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." }), _jsx(Divider, { orientation: "vertical" }), _jsx("p", { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit." })] }));
|
|
31
31
|
};
|
|
32
32
|
export default Component;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider-vertical.story.js","sourceRoot":"","sources":["../../../../src/divider/stories/divider-vertical.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,eACE,KAAK,EAAE;YACL,
|
|
1
|
+
{"version":3,"file":"divider-vertical.story.js","sourceRoot":"","sources":["../../../../src/divider/stories/divider-vertical.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,eACE,KAAK,EAAE;YACL,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,KAAK;YACV,KAAK,EAAE,MAAM;SACd,aAED,mFAA+D,EAC/D,KAAC,OAAO,IAAC,WAAW,EAAC,UAAU,GAAG,EAClC,mFAA+D,IAC3D,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { Divider } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <div\n style={{\n display: 'flex',\n flexDirection: 'row',\n gap: '4px',\n width: '100%',\n }}\n >\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n <Divider orientation=\"vertical\" />\n <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>\n </div>\n );\n};\n\nexport default Component;\n"]}
|