@neo4j-ndl/react 4.9.1 → 4.9.3

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.
Files changed (33) hide show
  1. package/lib/cjs/data-grid/DataGrid.js +2 -0
  2. package/lib/cjs/data-grid/DataGrid.js.map +1 -1
  3. package/lib/cjs/data-grid/stories/datagrid-compact-mode.story.js +82 -0
  4. package/lib/cjs/data-grid/stories/datagrid-compact-mode.story.js.map +1 -0
  5. package/lib/cjs/data-grid/stories/index.js +5 -1
  6. package/lib/cjs/data-grid/stories/index.js.map +1 -1
  7. package/lib/cjs/menu/Menu.js +24 -1
  8. package/lib/cjs/menu/Menu.js.map +1 -1
  9. package/lib/cjs/menu/menu-types.js.map +1 -1
  10. package/lib/cjs/tree-view/TreeViewTrail.js +1 -1
  11. package/lib/cjs/tree-view/TreeViewTrail.js.map +1 -1
  12. package/lib/esm/data-grid/DataGrid.js +2 -0
  13. package/lib/esm/data-grid/DataGrid.js.map +1 -1
  14. package/lib/esm/data-grid/stories/datagrid-compact-mode.story.js +80 -0
  15. package/lib/esm/data-grid/stories/datagrid-compact-mode.story.js.map +1 -0
  16. package/lib/esm/data-grid/stories/index.js +3 -0
  17. package/lib/esm/data-grid/stories/index.js.map +1 -1
  18. package/lib/esm/menu/Menu.js +25 -2
  19. package/lib/esm/menu/Menu.js.map +1 -1
  20. package/lib/esm/menu/menu-types.js.map +1 -1
  21. package/lib/esm/tree-view/TreeViewTrail.js +1 -1
  22. package/lib/esm/tree-view/TreeViewTrail.js.map +1 -1
  23. package/lib/types/data-grid/DataGrid.d.ts +2 -0
  24. package/lib/types/data-grid/DataGrid.d.ts.map +1 -1
  25. package/lib/types/data-grid/stories/datagrid-compact-mode.story.d.ts +24 -0
  26. package/lib/types/data-grid/stories/datagrid-compact-mode.story.d.ts.map +1 -0
  27. package/lib/types/data-grid/stories/index.d.ts +2 -0
  28. package/lib/types/data-grid/stories/index.d.ts.map +1 -1
  29. package/lib/types/menu/Menu.d.ts.map +1 -1
  30. package/lib/types/menu/menu-types.d.ts +1 -1
  31. package/lib/types/menu/menu-types.d.ts.map +1 -1
  32. package/lib/types/tree-view/TreeViewTrail.d.ts.map +1 -1
  33. package/package.json +4 -4
@@ -61,6 +61,7 @@ const DEFAULT_STYLING = {
61
61
  hasHoverEffects: true,
62
62
  hasZebraStriping: false,
63
63
  headerStyle: HeaderStyleEnum.Filled,
64
+ isCompact: false,
64
65
  };
65
66
  const DataGridComponent = function DataGrid(_a) {
66
67
  var { isResizable = true, isLoading = false, isKeyboardNavigable = true, isAutoResizingColumns = true, tableInstance, components, rootProps, styling = {}, tableNavRef, isSkeletonLoading = false, skeletonProps, ref, portalTarget = document.body, htmlAttributes, className, style } = _a, restProps = __rest(_a, ["isResizable", "isLoading", "isKeyboardNavigable", "isAutoResizingColumns", "tableInstance", "components", "rootProps", "styling", "tableNavRef", "isSkeletonLoading", "skeletonProps", "ref", "portalTarget", "htmlAttributes", "className", "style"]);
@@ -135,6 +136,7 @@ const DataGridComponent = function DataGrid(_a) {
135
136
  Styling.borderStyle === BorderStyleEnum.AllSides,
136
137
  'ndl-data-grid-border-vertical': Styling.borderStyle === BorderStyleEnum.Vertical ||
137
138
  Styling.borderStyle === BorderStyleEnum.AllSides,
139
+ 'ndl-data-grid-compact': Styling.isCompact,
138
140
  'ndl-data-grid-focusable-cells': isKeyboardNavigable,
139
141
  'ndl-data-grid-header-filled': Styling.headerStyle === HeaderStyleEnum.Filled,
140
142
  'ndl-data-grid-hover-effects': Styling.hasHoverEffects,
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["../../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,4DAAoC;AACpC,iCAMe;AAGf,oCAA6C;AAE7C,6CAyBsB;AACtB,2DAI6B;AAC7B,mDAA8C;AAC9C,uCAA+C;AAE/C,IAAK,eAKJ;AALD,WAAK,eAAe;IAClB,yCAAs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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"]}
1
+ {"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["../../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,4DAAoC;AACpC,iCAMe;AAGf,oCAA6C;AAE7C,6CAyBsB;AACtB,2DAI6B;AAC7B,mDAA8C;AAC9C,uCAA+C;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;IACjB,kCAAe,CAAA;AACjB,CAAC,EAHI,eAAe,KAAf,eAAe,QAGnB;AAwDD,MAAM,eAAe,GAAgD;IACnE,WAAW,EAAE,eAAe,CAAC,UAAU;IACvC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,KAAK;IACvB,WAAW,EAAE,eAAe,CAAC,MAAM;IACnC,SAAS,EAAE,KAAK;CACjB,CAAC;A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ACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,YAAY,EAAZ,yBAAY;IACZ,UAAU,EAAV,uBAAU;IACV,IAAI,EAAJ,iBAAI;IACJ,QAAQ,EAAR,qBAAQ;IACR,OAAO,EAAP,oBAAO;IACP,cAAc,EAAd,2BAAc;IACd,YAAY,EAAZ,yBAAY;IACZ,MAAM,EAAN,mBAAM;IACN,UAAU,EAAV,uBAAU;IACV,WAAW,EAAX,wBAAW;IACX,cAAc,EAAd,2BAAc;IACd,kBAAkB,EAAlB,+BAAkB;IAClB,UAAU,EAAV,uBAAU;IACV,UAAU,EAAV,uBAAU;IACV,iBAAiB,EAAjB,8BAAiB;IACjB,+BAA+B,EAA/B,4CAA+B;IAC/B,UAAU,EAAV,uBAAU;IACV,qBAAqB,EAArB,kCAAqB;IACrB,uBAAuB,EAAvB,oCAAuB;IACvB,wBAAwB,EAAxB,qCAAwB;IACxB,WAAW,EAAX,wBAAW;IACX,WAAW,EAAX,wBAAW;IACX,UAAU,EAAV,uBAAU;IACV,YAAY,EAAZ,yBAAY;CACb,CAAC;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAE7D,4BAAQ","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 /** If table should have less padding */\n isCompact: 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 isCompact: false,\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-compact': Styling.isCompact,\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"]}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ /**
5
+ *
6
+ * Copyright (c) "Neo4j"
7
+ * Neo4j Sweden AB [http://neo4j.com]
8
+ *
9
+ * This file is part of Neo4j.
10
+ *
11
+ * Neo4j is free software: you can redistribute it and/or modify
12
+ * it under the terms of the GNU General Public License as published by
13
+ * the Free Software Foundation, either version 3 of the License, or
14
+ * (at your option) any later version.
15
+ *
16
+ * This program is distributed in the hope that it will be useful,
17
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
+ * GNU General Public License for more details.
20
+ *
21
+ * You should have received a copy of the GNU General Public License
22
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
23
+ */
24
+ require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
25
+ const react_1 = require("@neo4j-ndl/react");
26
+ const react_table_1 = require("@tanstack/react-table");
27
+ const staticData_1 = require("./staticData");
28
+ const Component = () => {
29
+ const columnHelper = (0, react_table_1.createColumnHelper)();
30
+ const columns = [
31
+ columnHelper.accessor('name', {
32
+ cell: (info) => info.getValue(),
33
+ footer: (info) => info.column.id,
34
+ header: () => 'Name',
35
+ maxSize: 300,
36
+ minSize: 180,
37
+ size: 220,
38
+ }),
39
+ columnHelper.accessor('age', {
40
+ cell: (info) => info.renderValue(),
41
+ footer: (info) => info.column.id,
42
+ header: () => 'Age',
43
+ minSize: 80,
44
+ }),
45
+ columnHelper.accessor('cypherCommand', {
46
+ cell: (info) => info.getValue(),
47
+ footer: (info) => info.column.id,
48
+ header: () => 'Cypher Command',
49
+ minSize: 400,
50
+ size: 400,
51
+ }),
52
+ ];
53
+ const table = (0, react_table_1.useReactTable)({
54
+ columnResizeMode: 'onChange',
55
+ columns,
56
+ data: staticData_1.TABLE_DEMO_DATA,
57
+ debugColumns: true,
58
+ debugHeaders: true,
59
+ debugTable: true,
60
+ defaultColumn: {
61
+ maxSize: 800,
62
+ minSize: 80,
63
+ },
64
+ enableSorting: true,
65
+ getCoreRowModel: (0, react_table_1.getCoreRowModel)(),
66
+ getPaginationRowModel: (0, react_table_1.getPaginationRowModel)(),
67
+ getSortedRowModel: (0, react_table_1.getSortedRowModel)(),
68
+ initialState: {
69
+ pagination: {
70
+ pageSize: 5,
71
+ },
72
+ },
73
+ });
74
+ return ((0, jsx_runtime_1.jsx)("div", { className: "n-w-full n-bg-light-neutral-text-weakest", children: (0, jsx_runtime_1.jsx)(react_1.DataGrid, { isResizable: false, tableInstance: table, isKeyboardNavigable: false, styling: {
75
+ borderStyle: 'all-sides',
76
+ hasHoverEffects: true,
77
+ hasZebraStriping: false,
78
+ isCompact: true,
79
+ } }) }));
80
+ };
81
+ exports.default = Component;
82
+ //# sourceMappingURL=datagrid-compact-mode.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datagrid-compact-mode.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-compact-mode.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAA4C;AAC5C,uDAM+B;AAE/B,6CAA+C;AAQ/C,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,YAAY,GAAG,IAAA,gCAAkB,GAAkB,CAAC;IAE1D,MAAM,OAAO,GAAG;QACd,YAAY,CAAC,QAAQ,CAAC,MAAM,EAAE;YAC5B,IAAI,EAAE,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AAE;QACtC,YAAY,EAAE;YACZ,UAAU,EAAE;gBACV,QAAQ,EAAE,CAAC;aACZ;SACF;KACF,CAAC,CAAC;IAEH,OAAO,CACL,gCAAK,SAAS,EAAC,0CAA0C,YACvD,uBAAC,gBAAQ,IACP,WAAW,EAAE,KAAK,EAClB,aAAa,EAAE,KAAK,EACpB,mBAAmB,EAAE,KAAK,EAC1B,OAAO,EAAE;gBACP,WAAW,EAAE,WAAW;gBACxB,eAAe,EAAE,IAAI;gBACrB,gBAAgB,EAAE,KAAK;gBACvB,SAAS,EAAE,IAAI;aAChB,GACD,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,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 } from '@neo4j-ndl/react';\nimport {\n createColumnHelper,\n getCoreRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\n\nimport { TABLE_DEMO_DATA } from './staticData';\n\ntype TestDataFormat = {\n name: string;\n age: number;\n cypherCommand: string;\n};\n\nconst Component = () => {\n const columnHelper = createColumnHelper<TestDataFormat>();\n\n const columns = [\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n footer: (info) => info.column.id,\n header: () => 'Name',\n maxSize: 300,\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.renderValue(),\n footer: (info) => info.column.id,\n header: () => 'Age',\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\n footer: (info) => info.column.id,\n header: () => 'Cypher Command',\n minSize: 400,\n size: 400,\n }),\n ];\n\n const table = useReactTable({\n columnResizeMode: 'onChange',\n columns,\n data: TABLE_DEMO_DATA,\n debugColumns: true,\n debugHeaders: true,\n debugTable: true,\n defaultColumn: {\n maxSize: 800,\n minSize: 80,\n },\n enableSorting: true,\n getCoreRowModel: getCoreRowModel(),\n getPaginationRowModel: getPaginationRowModel(),\n getSortedRowModel: getSortedRowModel(),\n initialState: {\n pagination: {\n pageSize: 5,\n },\n },\n });\n\n return (\n <div className=\"n-w-full n-bg-light-neutral-text-weakest\">\n <DataGrid\n isResizable={false}\n tableInstance={table}\n isKeyboardNavigable={false}\n styling={{\n borderStyle: 'all-sides',\n hasHoverEffects: true,\n hasZebraStriping: false,\n isCompact: true,\n }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -23,7 +23,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.DataGridUsingEditableCellsSource = exports.DataGridSingleSelectableSource = exports.DataGridNoPaginationTableSource = exports.DataGridPinnedColumnsSource = exports.DataGridPercentageWidthColumnsSource = exports.DataGridKeyboardNavigationSource = exports.DataGridComponentOverridingSource = exports.DataGridColumnFilteringSource = exports.DataGridResizableColumnSource = exports.DataGridPlaceholderStatesSource = exports.DataGridSkeletonLoadingSource = exports.DataGridVirtualizationSource = exports.DataGridKitchenSinkSource = exports.DataGridInDialogSource = exports.DataGridSearchableSource = exports.DataGridSelectableSource = exports.DataGridSortableSource = exports.DataGridSimpleSource = exports.DataGridUsingEditableCells = exports.DataGridSingleSelectable = exports.DataGridNoPaginationTable = exports.DataGridPinnedRightSide = exports.DataGridPinnedLeftSide = exports.DataGridPinnedBothSides = exports.DataGridPercentageWidthColumns = exports.DataGridKeyboardNavigation = exports.DataGridComponentOverriding = exports.DataGridResizableColumn = exports.DataGridPlaceholderStates = exports.DataGridSkeletonLoading = exports.DataGridVirtualization = exports.DataGridKitchenSink = exports.DataGridInDialog = exports.DataGridColumnFiltering = exports.DataGridSearchable = exports.DataGridSelectable = exports.DataGridSortable = exports.DataGridSimple = void 0;
26
+ exports.DataGridUsingEditableCellsSource = exports.DataGridSingleSelectableSource = exports.DataGridNoPaginationTableSource = exports.DataGridPinnedColumnsSource = exports.DataGridPercentageWidthColumnsSource = exports.DataGridKeyboardNavigationSource = exports.DataGridComponentOverridingSource = exports.DataGridColumnFilteringSource = exports.DataGridResizableColumnSource = exports.DataGridPlaceholderStatesSource = exports.DataGridSkeletonLoadingSource = exports.DataGridVirtualizationSource = exports.DataGridKitchenSinkSource = exports.DataGridInDialogSource = exports.DataGridSearchableSource = exports.DataGridSelectableSource = exports.DataGridSortableSource = exports.DataGridCompactModeSource = exports.DataGridSimpleSource = exports.DataGridUsingEditableCells = exports.DataGridSingleSelectable = exports.DataGridNoPaginationTable = exports.DataGridPinnedRightSide = exports.DataGridPinnedLeftSide = exports.DataGridPinnedBothSides = exports.DataGridPercentageWidthColumns = exports.DataGridKeyboardNavigation = exports.DataGridComponentOverriding = exports.DataGridResizableColumn = exports.DataGridPlaceholderStates = exports.DataGridSkeletonLoading = exports.DataGridVirtualization = exports.DataGridKitchenSink = exports.DataGridInDialog = exports.DataGridColumnFiltering = exports.DataGridSearchable = exports.DataGridSelectable = exports.DataGridSortable = exports.DataGridSimple = exports.DataGridCompactMode = void 0;
27
+ var datagrid_compact_mode_story_1 = require("./datagrid-compact-mode.story");
28
+ Object.defineProperty(exports, "DataGridCompactMode", { enumerable: true, get: function () { return __importDefault(datagrid_compact_mode_story_1).default; } });
27
29
  var datagrid_simple_story_1 = require("./datagrid-simple.story");
28
30
  Object.defineProperty(exports, "DataGridSimple", { enumerable: true, get: function () { return __importDefault(datagrid_simple_story_1).default; } });
29
31
  var datagrid_sortable_story_1 = require("./datagrid-sortable.story");
@@ -63,6 +65,7 @@ var datagrid_using_editable_cells_story_1 = require("./datagrid-using-editable-c
63
65
  Object.defineProperty(exports, "DataGridUsingEditableCells", { enumerable: true, get: function () { return __importDefault(datagrid_using_editable_cells_story_1).default; } });
64
66
  const export_stories_utils_1 = require("../../_common/export-stories-utils");
65
67
  const datagrid_column_filtering_story_raw_1 = __importDefault(require("./datagrid-column-filtering.story?raw"));
68
+ const datagrid_compact_mode_story_raw_1 = __importDefault(require("./datagrid-compact-mode.story?raw"));
66
69
  const datagrid_component_overriding_story_raw_1 = __importDefault(require("./datagrid-component-overriding.story?raw"));
67
70
  const datagrid_in_dialog_story_raw_1 = __importDefault(require("./datagrid-in-dialog.story?raw"));
68
71
  const datagrid_keyboard_navigation_story_raw_1 = __importDefault(require("./datagrid-keyboard-navigation.story?raw"));
@@ -81,6 +84,7 @@ const datagrid_sortable_story_raw_1 = __importDefault(require("./datagrid-sortab
81
84
  const datagrid_using_editable_cells_story_raw_1 = __importDefault(require("./datagrid-using-editable-cells.story?raw"));
82
85
  const datagrid_virtualization_story_raw_1 = __importDefault(require("./datagrid-virtualization.story?raw"));
83
86
  exports.DataGridSimpleSource = (0, export_stories_utils_1.removeLicenseHeader)(datagrid_simple_story_raw_1.default);
87
+ exports.DataGridCompactModeSource = (0, export_stories_utils_1.removeLicenseHeader)(datagrid_compact_mode_story_raw_1.default);
84
88
  exports.DataGridSortableSource = (0, export_stories_utils_1.removeLicenseHeader)(datagrid_sortable_story_raw_1.default);
85
89
  exports.DataGridSelectableSource = (0, export_stories_utils_1.removeLicenseHeader)(datagrid_selectable_story_raw_1.default);
86
90
  exports.DataGridSearchableSource = (0, export_stories_utils_1.removeLicenseHeader)(datagrid_search_and_filters_stories_raw_1.default);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/index.ts"],"names":[],"mapp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CAAmB,EACvD,qCAAyB,CAC1B,CAAC;AACW,QAAA,wBAAwB,GAAG,IAAA,0CAAmB,EACzD,uCAA2B,CAC5B,CAAC;AACW,QAAA,wBAAwB,GAAG,IAAA,0CAAmB,EACzD,iDAA2B,CAC5B,CAAC;AACW,QAAA,sBAAsB,GAAG,IAAA,0CAAmB,EACvD,sCAAyB,CAC1B,CAAC;AACW,QAAA,yBAAyB,GAAG,IAAA,0CAAmB,EAC1D,yCAA4B,CAC7B,CAAC;AACW,QAAA,4BAA4B,GAAG,IAAA,0CAAmB,EAC7D,2CAA+B,CAChC,CAAC;AACW,QAAA,6BAA6B,GAAG,IAAA,0CAAmB,EAC9D,6CAAgC,CACjC,CAAC;AACW,QAAA,+BAA+B,GAAG,IAAA,0CAAmB,EAChE,+CAAkC,CACnC,CAAC;AACW,QAAA,6BAA6B,GAAG,IAAA,0CAAmB,EAC9D,6CAAgC,CACjC,CAAC;AACW,QAAA,6BAA6B,GAAG,IAAA,0CAAmB,EAC9D,6CAAgC,CACjC,CAAC;AACW,QAAA,iCAAiC,GAAG,IAAA,0CAAmB,EAClE,iDAAoC,CACrC,CAAC;AACW,QAAA,gCAAgC,GAAG,IAAA,0CAAmB,EACjE,gDAAmC,CACpC,CAAC;AACW,QAAA,oCAAoC,GAAG,IAAA,0CAAmB,EACrE,qDAAuC,CACxC,CAAC;AACW,QAAA,2BAA2B,GAAG,IAAA,0CAAmB,EAC5D,6CAA8B,CAC/B,CAAC;AACW,QAAA,+BAA+B,GAAG,IAAA,0CAAmB,EAChE,gDAA4B,CAC7B,CAAC;AACW,QAAA,8BAA8B,GAAG,IAAA,0CAAmB,EAC/D,8CAAiC,CAClC,CAAC;AACW,QAAA,gCAAgC,GAAG,IAAA,0CAAmB,EACjE,iDAAmC,CACpC,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\nexport { default as DataGridSimple } from './datagrid-simple.story';\nexport { default as DataGridSortable } from './datagrid-sortable.story';\nexport { default as DataGridSelectable } from './datagrid-selectable.story';\nexport {\n Searchable as DataGridSearchable,\n ColumnFiltering as DataGridColumnFiltering,\n} from './datagrid-search-and-filters.stories';\nexport { default as DataGridInDialog } from './datagrid-in-dialog.story';\nexport { default as DataGridKitchenSink } from './datagrid-kitchen-sink.story';\nexport { default as DataGridVirtualization } from './datagrid-virtualization.story';\nexport { default as DataGridSkeletonLoading } from './datagrid-skeleton-loading.story';\nexport { default as DataGridPlaceholderStates } from './datagrid-placeholder-states.story';\nexport { default as DataGridResizableColumn } from './datagrid-resizable-column.story';\nexport { default as DataGridComponentOverriding } from './datagrid-component-overriding.story';\nexport { default as DataGridKeyboardNavigation } from './datagrid-keyboard-navigation.story';\nexport { default as DataGridPercentageWidthColumns } from './datagrid-percentage-width-columns.story';\nexport {\n PinnedBothSides as DataGridPinnedBothSides,\n PinnedLeftSide as DataGridPinnedLeftSide,\n PinnedRightSide as DataGridPinnedRightSide,\n} from './datagrid-pinned-columns.stories';\nexport { default as DataGridNoPaginationTable } from './datagrid-no-pagination-table.story';\nexport { default as DataGridSingleSelectable } from './datagrid-single-selectable.story';\nexport { default as DataGridUsingEditableCells } from './datagrid-using-editable-cells.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport DataGridColumnFilteringSourceRaw from './datagrid-column-filtering.story?raw';\nimport DataGridComponentOverridingSourceRaw from './datagrid-component-overriding.story?raw';\nimport DataGridInDialogSourceRaw from './datagrid-in-dialog.story?raw';\nimport DataGridKeyboardNavigationSourceRaw from './datagrid-keyboard-navigation.story?raw';\nimport DataGridKitchenSinkSourceRaw from './datagrid-kitchen-sink.story?raw';\nimport DataGridNoPaginationTableRaw from './datagrid-no-pagination-table.story?raw';\nimport DataGridPercentageWidthColumnsSourceRaw from './datagrid-percentage-width-columns.story?raw';\nimport DataGridPinnedColumnsSourceRaw from './datagrid-pinned-columns.stories?raw';\nimport DataGridPlaceholderStatesSourceRaw from './datagrid-placeholder-states.story?raw';\nimport DataGridResizableColumnSourceRaw from './datagrid-resizable-column.story?raw';\nimport DataGridSearchableSourceRaw from './datagrid-search-and-filters.stories?raw';\nimport DataGridSelectableSourceRaw from './datagrid-selectable.story?raw';\nimport DataGridSimpleSourceRaw from './datagrid-simple.story?raw';\nimport DataGridSingleSelectableSourceRaw from './datagrid-single-selectable.story?raw';\nimport DataGridSkeletonLoadingSourceRaw from './datagrid-skeleton-loading.story?raw';\nimport DataGridSortableSourceRaw from './datagrid-sortable.story?raw';\nimport DataGridUsingEditableCellsSourceRaw from './datagrid-using-editable-cells.story?raw';\nimport DataGridVirtualizationSourceRaw from './datagrid-virtualization.story?raw';\n\nexport const DataGridSimpleSource = removeLicenseHeader(\n DataGridSimpleSourceRaw,\n);\nexport const DataGridSortableSource = removeLicenseHeader(\n DataGridSortableSourceRaw,\n);\nexport const DataGridSelectableSource = removeLicenseHeader(\n DataGridSelectableSourceRaw,\n);\nexport const DataGridSearchableSource = removeLicenseHeader(\n DataGridSearchableSourceRaw,\n);\nexport const DataGridInDialogSource = removeLicenseHeader(\n DataGridInDialogSourceRaw,\n);\nexport const DataGridKitchenSinkSource = removeLicenseHeader(\n DataGridKitchenSinkSourceRaw,\n);\nexport const DataGridVirtualizationSource = removeLicenseHeader(\n DataGridVirtualizationSourceRaw,\n);\nexport const DataGridSkeletonLoadingSource = removeLicenseHeader(\n DataGridSkeletonLoadingSourceRaw,\n);\nexport const DataGridPlaceholderStatesSource = removeLicenseHeader(\n DataGridPlaceholderStatesSourceRaw,\n);\nexport const DataGridResizableColumnSource = removeLicenseHeader(\n DataGridResizableColumnSourceRaw,\n);\nexport const DataGridColumnFilteringSource = removeLicenseHeader(\n DataGridColumnFilteringSourceRaw,\n);\nexport const DataGridComponentOverridingSource = removeLicenseHeader(\n DataGridComponentOverridingSourceRaw,\n);\nexport const DataGridKeyboardNavigationSource = removeLicenseHeader(\n DataGridKeyboardNavigationSourceRaw,\n);\nexport const DataGridPercentageWidthColumnsSource = removeLicenseHeader(\n DataGridPercentageWidthColumnsSourceRaw,\n);\nexport const DataGridPinnedColumnsSource = removeLicenseHeader(\n DataGridPinnedColumnsSourceRaw,\n);\nexport const DataGridNoPaginationTableSource = removeLicenseHeader(\n DataGridNoPaginationTableRaw,\n);\nexport const DataGridSingleSelectableSource = removeLicenseHeader(\n DataGridSingleSelectableSourceRaw,\n);\nexport const DataGridUsingEditableCellsSource = removeLicenseHeader(\n DataGridUsingEditableCellsSourceRaw,\n);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;AAEH,6EAA+E;AAAtE,mJAAA,OAAO,OAAuB;AACvC,iEAAoE;AAA3D,wIAAA,OAAO,OAAkB;AAClC,qEAAwE;AAA/D,4IAAA,OAAO,OAAoB;AACpC,yEAA4E;AAAnE,gJAAA,OAAO,OAAsB;AACtC,6FAG+C;AAF7C,yIAAA,UAAU,OAAsB;AAChC,8IAAA,eAAe,OAA2B;AAE5C,uEAAyE;AAAhE,6IAAA,OAAO,OAAoB;AACpC,6EAA+E;AAAtE,mJAAA,OAAO,OAAuB;AACvC,iFAAoF;AAA3E,wJAAA,OAAO,OAA0B;AAC1C,qFAAuF;AAA9E,2JAAA,OAAO,OAA2B;AAC3C,yFAA2F;AAAlF,+JAAA,OAAO,OAA6B;AAC7C,qFAAuF;AAA9E,2JAAA,OAAO,OAA2B;AAC3C,6FA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AgC,CACjC,CAAC;AACW,QAAA,+BAA+B,GAAG,IAAA,0CAAmB,EAChE,+CAAkC,CACnC,CAAC;AACW,QAAA,6BAA6B,GAAG,IAAA,0CAAmB,EAC9D,6CAAgC,CACjC,CAAC;AACW,QAAA,6BAA6B,GAAG,IAAA,0CAAmB,EAC9D,6CAAgC,CACjC,CAAC;AACW,QAAA,iCAAiC,GAAG,IAAA,0CAAmB,EAClE,iDAAoC,CACrC,CAAC;AACW,QAAA,gCAAgC,GAAG,IAAA,0CAAmB,EACjE,gDAAmC,CACpC,CAAC;AACW,QAAA,oCAAoC,GAAG,IAAA,0CAAmB,EACrE,qDAAuC,CACxC,CAAC;AACW,QAAA,2BAA2B,GAAG,IAAA,0CAAmB,EAC5D,6CAA8B,CAC/B,CAAC;AACW,QAAA,+BAA+B,GAAG,IAAA,0CAAmB,EAChE,gDAA4B,CAC7B,CAAC;AACW,QAAA,8BAA8B,GAAG,IAAA,0CAAmB,EAC/D,8CAAiC,CAClC,CAAC;AACW,QAAA,gCAAgC,GAAG,IAAA,0CAAmB,EACjE,iDAAmC,CACpC,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\nexport { default as DataGridCompactMode } from './datagrid-compact-mode.story';\nexport { default as DataGridSimple } from './datagrid-simple.story';\nexport { default as DataGridSortable } from './datagrid-sortable.story';\nexport { default as DataGridSelectable } from './datagrid-selectable.story';\nexport {\n Searchable as DataGridSearchable,\n ColumnFiltering as DataGridColumnFiltering,\n} from './datagrid-search-and-filters.stories';\nexport { default as DataGridInDialog } from './datagrid-in-dialog.story';\nexport { default as DataGridKitchenSink } from './datagrid-kitchen-sink.story';\nexport { default as DataGridVirtualization } from './datagrid-virtualization.story';\nexport { default as DataGridSkeletonLoading } from './datagrid-skeleton-loading.story';\nexport { default as DataGridPlaceholderStates } from './datagrid-placeholder-states.story';\nexport { default as DataGridResizableColumn } from './datagrid-resizable-column.story';\nexport { default as DataGridComponentOverriding } from './datagrid-component-overriding.story';\nexport { default as DataGridKeyboardNavigation } from './datagrid-keyboard-navigation.story';\nexport { default as DataGridPercentageWidthColumns } from './datagrid-percentage-width-columns.story';\nexport {\n PinnedBothSides as DataGridPinnedBothSides,\n PinnedLeftSide as DataGridPinnedLeftSide,\n PinnedRightSide as DataGridPinnedRightSide,\n} from './datagrid-pinned-columns.stories';\nexport { default as DataGridNoPaginationTable } from './datagrid-no-pagination-table.story';\nexport { default as DataGridSingleSelectable } from './datagrid-single-selectable.story';\nexport { default as DataGridUsingEditableCells } from './datagrid-using-editable-cells.story';\n\nimport { removeLicenseHeader } from '../../_common/export-stories-utils';\nimport DataGridColumnFilteringSourceRaw from './datagrid-column-filtering.story?raw';\nimport DataGridCompactModeSourceRaw from './datagrid-compact-mode.story?raw';\nimport DataGridComponentOverridingSourceRaw from './datagrid-component-overriding.story?raw';\nimport DataGridInDialogSourceRaw from './datagrid-in-dialog.story?raw';\nimport DataGridKeyboardNavigationSourceRaw from './datagrid-keyboard-navigation.story?raw';\nimport DataGridKitchenSinkSourceRaw from './datagrid-kitchen-sink.story?raw';\nimport DataGridNoPaginationTableRaw from './datagrid-no-pagination-table.story?raw';\nimport DataGridPercentageWidthColumnsSourceRaw from './datagrid-percentage-width-columns.story?raw';\nimport DataGridPinnedColumnsSourceRaw from './datagrid-pinned-columns.stories?raw';\nimport DataGridPlaceholderStatesSourceRaw from './datagrid-placeholder-states.story?raw';\nimport DataGridResizableColumnSourceRaw from './datagrid-resizable-column.story?raw';\nimport DataGridSearchableSourceRaw from './datagrid-search-and-filters.stories?raw';\nimport DataGridSelectableSourceRaw from './datagrid-selectable.story?raw';\nimport DataGridSimpleSourceRaw from './datagrid-simple.story?raw';\nimport DataGridSingleSelectableSourceRaw from './datagrid-single-selectable.story?raw';\nimport DataGridSkeletonLoadingSourceRaw from './datagrid-skeleton-loading.story?raw';\nimport DataGridSortableSourceRaw from './datagrid-sortable.story?raw';\nimport DataGridUsingEditableCellsSourceRaw from './datagrid-using-editable-cells.story?raw';\nimport DataGridVirtualizationSourceRaw from './datagrid-virtualization.story?raw';\n\nexport const DataGridSimpleSource = removeLicenseHeader(\n DataGridSimpleSourceRaw,\n);\nexport const DataGridCompactModeSource = removeLicenseHeader(\n DataGridCompactModeSourceRaw,\n);\nexport const DataGridSortableSource = removeLicenseHeader(\n DataGridSortableSourceRaw,\n);\nexport const DataGridSelectableSource = removeLicenseHeader(\n DataGridSelectableSourceRaw,\n);\nexport const DataGridSearchableSource = removeLicenseHeader(\n DataGridSearchableSourceRaw,\n);\nexport const DataGridInDialogSource = removeLicenseHeader(\n DataGridInDialogSourceRaw,\n);\nexport const DataGridKitchenSinkSource = removeLicenseHeader(\n DataGridKitchenSinkSourceRaw,\n);\nexport const DataGridVirtualizationSource = removeLicenseHeader(\n DataGridVirtualizationSourceRaw,\n);\nexport const DataGridSkeletonLoadingSource = removeLicenseHeader(\n DataGridSkeletonLoadingSourceRaw,\n);\nexport const DataGridPlaceholderStatesSource = removeLicenseHeader(\n DataGridPlaceholderStatesSourceRaw,\n);\nexport const DataGridResizableColumnSource = removeLicenseHeader(\n DataGridResizableColumnSourceRaw,\n);\nexport const DataGridColumnFilteringSource = removeLicenseHeader(\n DataGridColumnFilteringSourceRaw,\n);\nexport const DataGridComponentOverridingSource = removeLicenseHeader(\n DataGridComponentOverridingSourceRaw,\n);\nexport const DataGridKeyboardNavigationSource = removeLicenseHeader(\n DataGridKeyboardNavigationSourceRaw,\n);\nexport const DataGridPercentageWidthColumnsSource = removeLicenseHeader(\n DataGridPercentageWidthColumnsSourceRaw,\n);\nexport const DataGridPinnedColumnsSource = removeLicenseHeader(\n DataGridPinnedColumnsSourceRaw,\n);\nexport const DataGridNoPaginationTableSource = removeLicenseHeader(\n DataGridNoPaginationTableRaw,\n);\nexport const DataGridSingleSelectableSource = removeLicenseHeader(\n DataGridSingleSelectableSourceRaw,\n);\nexport const DataGridUsingEditableCellsSource = removeLicenseHeader(\n DataGridUsingEditableCellsSourceRaw,\n);\n"]}
@@ -114,6 +114,9 @@ const MenuComponent = ({ children, isOpen: controlledOpen, onClose, isRoot, anch
114
114
  else if (event instanceof KeyboardEvent) {
115
115
  onClose === null || onClose === void 0 ? void 0 : onClose(event, { type: 'escapeKeyDown' });
116
116
  }
117
+ else if (event instanceof FocusEvent) {
118
+ onClose === null || onClose === void 0 ? void 0 : onClose(event, { type: 'focusOut' });
119
+ }
117
120
  }
118
121
  },
119
122
  open: isOpen,
@@ -178,6 +181,24 @@ const MenuComponent = ({ children, isOpen: controlledOpen, onClose, isRoot, anch
178
181
  tree.events.emit('menuopen', { nodeId, parentId });
179
182
  }
180
183
  }, [tree, isOpen, nodeId, parentId]);
184
+ // Workaround for floating-ui bug where Shift+Tab doesn't trigger
185
+ // closeOnFocusOut.
186
+ // We detect Shift+Tab and check after guards redirect focus whether
187
+ // focus has actually left the floating element.
188
+ // TODO: check every now and then if floating ui addresses this
189
+ const handleShiftTabClose = (0, react_2.useCallback)((event) => {
190
+ if (event.key === 'Tab' && event.shiftKey) {
191
+ requestAnimationFrame(() => {
192
+ const floatingEl = refs.floating.current;
193
+ if (floatingEl && !floatingEl.contains(document.activeElement)) {
194
+ if (controlledOpen === undefined) {
195
+ setIsOpen(false);
196
+ }
197
+ onClose === null || onClose === void 0 ? void 0 : onClose(undefined, { type: 'focusOut' });
198
+ }
199
+ });
200
+ }
201
+ }, [controlledOpen, onClose, refs]);
181
202
  const menuClasses = (0, classnames_1.default)('ndl-menu', themeClassName, className);
182
203
  const ref = (0, react_1.useMergeRefs)([refs.setReference, item.ref, forwardedRef]);
183
204
  return ((0, jsx_runtime_1.jsxs)(react_1.FloatingNode, { id: nodeId, children: [isRoot !== true && ((0, jsx_runtime_1.jsx)(NestedMenuItem, { ref: ref, className: isNested ? 'MenuItem' : 'RootMenu', isDisabled: isDisabled, style: style, htmlAttributes: Object.assign(Object.assign({ 'data-focus-inside': hasFocusInside ? '' : undefined, 'data-nested': isNested ? '' : undefined, 'data-open': isOpen ? '' : undefined, role: isNested ? 'menuitem' : undefined, tabIndex: !isNested
@@ -197,7 +218,9 @@ const MenuComponent = ({ children, isOpen: controlledOpen, onClose, isRoot, anch
197
218
  isOpen: isDisabled === true ? false : isOpen,
198
219
  setActiveIndex,
199
220
  setHasFocusInside,
200
- }, children: (0, jsx_runtime_1.jsx)(react_1.FloatingList, { elementsRef: elementsRef, labelsRef: labelsRef, children: isOpen && ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { root: portalTarget, children: wrapChildren })), children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: context, modal: false, initialFocus: 0, returnFocus: !isNested, closeOnFocusOut: true, guards: true, children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ ref: refs.setFloating, className: menuClasses, style: Object.assign(Object.assign({ minWidth: minWidth !== undefined ? `${minWidth}px` : undefined }, floatingStyles), style) }, getFloatingProps(), { children: children })) }) })) }) })] }));
221
+ }, children: (0, jsx_runtime_1.jsx)(react_1.FloatingList, { elementsRef: elementsRef, labelsRef: labelsRef, children: isOpen && ((0, jsx_runtime_1.jsx)(conditional_wrap_1.ConditionalWrap, { shouldWrap: isPortaled, wrap: (wrapChildren) => ((0, jsx_runtime_1.jsx)(react_1.FloatingPortal, { root: portalTarget, children: wrapChildren })), children: (0, jsx_runtime_1.jsx)(react_1.FloatingFocusManager, { context: context, modal: false, initialFocus: 0, returnFocus: !isNested, closeOnFocusOut: true, guards: true, children: (0, jsx_runtime_1.jsx)(Component, Object.assign({ ref: refs.setFloating, className: menuClasses, style: Object.assign(Object.assign({ minWidth: minWidth !== undefined ? `${minWidth}px` : undefined }, floatingStyles), style) }, getFloatingProps({
222
+ onKeyDown: handleShiftTabClose,
223
+ }), { children: children })) }) })) }) })] }));
201
224
  };
202
225
  /**
203
226
  * @internal This is used to build the menu item components. Do not export this component.
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/menu/Menu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,8CAwB4B;AAC5B,4DAAoC;AAEpC,iCAA+E;AAM/E,0DAAsD;AACtD,6DAA6D;AAC7D,wCAAqC;AACrC,oCAAqE;AACrE,wCAAkD;AAClD,oCAA0C;AAY1C,MAAM,WAAW,GAAG,IAAA,qBAAa,EAQ9B;IACD,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,MAAM,EAAE,KAAK;IACb,gEAAgE;IAChE,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gEAAgE;IAChE,iBAAiB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,CAAC,KAAiD,EAAE,EAAE;IACxE,MAAM,QAAQ,GAAG,IAAA,+BAAuB,GAAE,CAAC;IAE3C,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,CACL,uBAAC,oBAAY,cACX,uBAAC,aAAa,oBAAK,KAAK,IAAE,MAAM,UAAG,GACtB,CAChB,CAAC;IACJ,CAAC;IAED,OAAO,uBAAC,aAAa,oBAAK,KAAK,EAAI,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAsC,EAC1D,QAAQ,EACR,MAA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R,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,IACJ,SAAS,EACT,cAAc,cAEjB,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EACjB,QAAQ,EACR,SAAS,EACT,cAAc,EACd,KAAK,EACL,GAAG,OAEgC,EADhC,SAAS,cANK,2DAOlB,CADa;IAEZ,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACxD,OAAO,CACL,8CACE,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,OAAO,IACR,SAAS,EACT,cAAc,cAEjB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IACtC,YAAY,EAAE,YAAY;IAC1B,OAAO,EAAE,iBAAO;IAChB,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,QAAQ;IACd;;OAEG;IACH,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AACM,oBAAI","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 autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n FloatingTree,\n offset,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useRole,\n useTypeahead,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { createContext, useContext, useEffect, useRef, useState } from 'react';\n\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { Divider } from '../divider';\nimport { CheckIconOutline, ChevronRightIconOutline } from '../icons';\nimport { placementTranslation } from '../popover';\nimport { useNeedleTheme } from '../theme';\nimport type {\n CategoryItemProps,\n MenuGroupProps,\n MenuItemComponentProps,\n MenuItemProps,\n MenuItemsProps,\n MenuProps,\n NestedMenuItemProps,\n RadioItemProps,\n} from './menu-types';\n\nconst MenuContext = createContext<{\n getItemProps: (\n userProps?: React.HTMLProps<HTMLElement>,\n ) => Record<string, unknown>;\n activeIndex: number | null;\n setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;\n setHasFocusInside: React.Dispatch<React.SetStateAction<boolean>>;\n isOpen: boolean;\n}>({\n activeIndex: null,\n getItemProps: () => ({}),\n isOpen: false,\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n setActiveIndex: () => {},\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n setHasFocusInside: () => {},\n});\n\nconst MenuWrapper = (props: React.ComponentProps<typeof MenuComponent>) => {\n const parentId = useFloatingParentNodeId();\n\n if (parentId === null) {\n return (\n <FloatingTree>\n <MenuComponent {...props} isRoot />\n </FloatingTree>\n );\n }\n\n return <MenuComponent {...props} />;\n};\n\nconst MenuComponent = <T extends React.ElementType = 'div'>({\n children,\n isOpen: controlledOpen,\n onClose,\n isRoot,\n anchorRef,\n as,\n className,\n placement,\n minWidth,\n title,\n isDisabled,\n description,\n icon,\n isPortaled = true,\n portalTarget,\n htmlAttributes,\n strategy,\n ref: forwardedRef,\n style,\n}: PolymorphicCommonProps<T, MenuProps>) => {\n const [isOpen, setIsOpen] = useState(false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const elementsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const labelsRef = useRef<Array<string | null>>([]);\n const parent = useContext(MenuContext);\n\n const isInsideDialog = useIsInsideDialog();\n const tree = useFloatingTree();\n const nodeId = useFloatingNodeId();\n const parentId = useFloatingParentNodeId();\n const item = useListItem();\n const { themeClassName } = useNeedleTheme();\n useEffect(() => {\n if (controlledOpen === undefined) {\n return;\n }\n setIsOpen(controlledOpen);\n }, [controlledOpen]);\n\n useEffect(() => {\n if (isOpen) {\n setActiveIndex(0);\n }\n }, [isOpen]);\n\n const Component = as ?? 'div';\n\n const isNested = parentId !== null;\n\n const defaultPlacement = isNested ? 'right-start' : 'bottom-start';\n\n const { floatingStyles, refs, context } = useFloating<HTMLButtonElement>({\n elements: {\n reference: anchorRef?.current,\n },\n middleware: [\n offset({\n alignmentAxis: isNested ? -4 : 0,\n mainAxis: isNested ? 0 : 4,\n }),\n flip({\n fallbackPlacements: ['left-start', 'right-start'],\n }),\n shift(),\n ],\n nodeId,\n onOpenChange: (open, event) => {\n if (controlledOpen === undefined) {\n setIsOpen(open);\n }\n\n if (!open) {\n if (event instanceof PointerEvent) {\n onClose?.(event, { type: 'backdropClick' });\n } else if (event instanceof KeyboardEvent) {\n onClose?.(event, { type: 'escapeKeyDown' });\n }\n }\n },\n open: isOpen,\n placement: placement ? placementTranslation[placement] : defaultPlacement,\n strategy: strategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n\n const hover = useHover(context, {\n delay: { open: 75 },\n enabled: isNested,\n handleClose: safePolygon({ blockPointerEvents: true }),\n });\n const click = useClick(context, {\n event: 'mousedown',\n ignoreMouse: isNested,\n toggle: !isNested,\n });\n const role = useRole(context, { role: 'menu' });\n const dismiss = useDismiss(context, { bubbles: true });\n const listNavigation = useListNavigation(context, {\n activeIndex,\n listRef: elementsRef,\n nested: isNested,\n onNavigate: setActiveIndex,\n });\n const typeahead = useTypeahead(context, {\n activeIndex,\n listRef: labelsRef,\n onMatch: isOpen ? setActiveIndex : undefined,\n });\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(\n [hover, click, role, dismiss, listNavigation, typeahead],\n );\n\n // Event emitter allows you to communicate across tree components.\n // This effect closes all menus when an item gets clicked anywhere\n // in the tree.\n useEffect(() => {\n if (!tree) {\n return;\n }\n\n function handleTreeClick(data: { id?: string }) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { id: data?.id, type: 'itemClick' });\n }\n\n function onSubMenuOpen(event: { nodeId: string; parentId: string }) {\n if (event.nodeId !== nodeId && event.parentId === parentId) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { type: 'itemClick' });\n }\n }\n\n tree.events.on('click', handleTreeClick);\n tree.events.on('menuopen', onSubMenuOpen);\n\n return () => {\n tree.events.off('click', handleTreeClick);\n tree.events.off('menuopen', onSubMenuOpen);\n };\n }, [tree, nodeId, parentId, onClose, controlledOpen]);\n\n useEffect(() => {\n if (isOpen && tree) {\n tree.events.emit('menuopen', { nodeId, parentId });\n }\n }, [tree, isOpen, nodeId, parentId]);\n\n const menuClasses = classNames('ndl-menu', themeClassName, className);\n const ref = useMergeRefs([refs.setReference, item.ref, forwardedRef]);\n\n return (\n <FloatingNode id={nodeId}>\n {isRoot !== true && (\n <NestedMenuItem\n ref={ref}\n className={isNested ? 'MenuItem' : 'RootMenu'}\n isDisabled={isDisabled}\n style={style}\n htmlAttributes={{\n 'data-focus-inside': hasFocusInside ? '' : undefined,\n 'data-nested': isNested ? '' : undefined,\n 'data-open': isOpen ? '' : undefined,\n role: isNested ? 'menuitem' : undefined,\n tabIndex: !isNested\n ? undefined\n : parent.activeIndex === item.index\n ? 0\n : -1,\n ...htmlAttributes,\n ...getReferenceProps(\n parent.getItemProps({\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n htmlAttributes?.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n }),\n ),\n }}\n title={title}\n description={description}\n leadingVisual={icon}\n />\n )}\n <MenuContext.Provider\n value={{\n activeIndex,\n getItemProps,\n isOpen: isDisabled === true ? false : isOpen,\n setActiveIndex,\n setHasFocusInside,\n }}\n >\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isOpen && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal root={portalTarget}>\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={0}\n returnFocus={!isNested}\n closeOnFocusOut={true}\n guards={true}\n >\n <Component\n ref={refs.setFloating}\n className={menuClasses}\n style={{\n minWidth:\n minWidth !== undefined ? `${minWidth}px` : undefined,\n ...floatingStyles,\n ...style,\n }}\n {...getFloatingProps()}\n >\n {children}\n </Component>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n );\n};\n\n/**\n * @internal This is used to build the menu item components. Do not export this component.\n */\nconst MenuItemComponent = <T extends React.ElementType = 'button'>({\n title,\n leadingContent,\n trailingContent,\n preLeadingContent,\n description,\n isDisabled,\n as,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemComponentProps>) => {\n const classes = classNames(`ndl-menu-item`, className, {\n 'ndl-disabled': isDisabled,\n });\n\n const Component = as ?? 'button';\n\n return (\n <Component\n className={classes}\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n disabled={isDisabled}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-menu-item-inner\">\n {Boolean(preLeadingContent) && (\n <div className=\"ndl-menu-item-pre-leading-content\">\n {preLeadingContent}\n </div>\n )}\n {Boolean(leadingContent) && (\n <div className=\"ndl-menu-item-leading-content\">{leadingContent}</div>\n )}\n\n <div className=\"ndl-menu-item-title-wrapper\">\n <div className=\"ndl-menu-item-title\">{title}</div>\n {Boolean(description) && (\n <div className=\"ndl-menu-item-description\">{description}</div>\n )}\n </div>\n\n {Boolean(trailingContent) && (\n <div className=\"ndl-menu-item-trailing-content\">\n {trailingContent}\n </div>\n )}\n </div>\n </Component>\n );\n};\n\nconst MenuItem = <T extends React.ElementType = 'button'>({\n title,\n className,\n style,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n as,\n onClick,\n onFocus,\n htmlAttributes,\n id,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n id: id,\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n }),\n }}\n {...restProps}\n />\n );\n};\n\nconst NestedMenuItem = <T extends React.ElementType = 'button'>({\n title,\n isDisabled,\n description,\n leadingVisual,\n as,\n onFocus,\n onClick,\n className,\n style,\n htmlAttributes,\n id,\n ref,\n}: PolymorphicCommonProps<T, NestedMenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const isActive = item.index === menu.activeIndex;\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={\n <ChevronRightIconOutline className=\"ndl-menu-item-chevron\" />\n }\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n onTouchStart() {\n menu.setHasFocusInside(true);\n },\n }),\n id: id,\n }}\n />\n );\n};\n\nconst CategoryItem = <T extends React.ElementType = 'button'>({\n children,\n className,\n style,\n as,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, CategoryItemProps>) => {\n const classes = classNames('ndl-menu-category-item', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst RadioItem = <T extends React.ElementType = 'button'>({\n title,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n isChecked = false,\n onClick,\n onFocus,\n className,\n style,\n as,\n id,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, RadioItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n const classes = classNames('ndl-menu-radio-item', className, {\n 'ndl-checked': isChecked,\n });\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={classes}\n ref={mergedRefs}\n title={title}\n description={description}\n preLeadingContent={\n isChecked ? (\n <CheckIconOutline className=\"n-size-5 n-shrink-0 n-self-center\" />\n ) : null\n }\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n 'aria-checked': isChecked,\n role: 'menuitemradio',\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n id: id,\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n }),\n }}\n {...restProps}\n />\n );\n};\n\nconst MenuItems = <T extends React.ElementType = 'div'>({\n as,\n children,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemsProps>) => {\n const classes = classNames('ndl-menu-items', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst MenuGroup = ({\n children,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: CommonProps<'div', MenuGroupProps>) => {\n const classes = classNames('ndl-menu-group', className);\n return (\n <div\n className={classes}\n style={style}\n ref={ref}\n role=\"group\"\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nconst Menu = Object.assign(MenuWrapper, {\n CategoryItem: CategoryItem,\n Divider: Divider,\n Group: MenuGroup,\n Item: MenuItem,\n /**\n * @deprecated Use Menu.Group instead if you want to group items together. If not, you can just omit this component in your implementation.\n */\n Items: MenuItems,\n RadioItem: RadioItem,\n});\nexport { Menu };\n"]}
1
+ {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/menu/Menu.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;G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AChB,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC;AACM,oBAAI","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 autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingList,\n FloatingNode,\n FloatingPortal,\n FloatingTree,\n offset,\n safePolygon,\n shift,\n useClick,\n useDismiss,\n useFloating,\n useFloatingNodeId,\n useFloatingParentNodeId,\n useFloatingTree,\n useHover,\n useInteractions,\n useListItem,\n useListNavigation,\n useMergeRefs,\n useRole,\n useTypeahead,\n} from '@floating-ui/react';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { Divider } from '../divider';\nimport { CheckIconOutline, ChevronRightIconOutline } from '../icons';\nimport { placementTranslation } from '../popover';\nimport { useNeedleTheme } from '../theme';\nimport type {\n CategoryItemProps,\n MenuGroupProps,\n MenuItemComponentProps,\n MenuItemProps,\n MenuItemsProps,\n MenuProps,\n NestedMenuItemProps,\n RadioItemProps,\n} from './menu-types';\n\nconst MenuContext = createContext<{\n getItemProps: (\n userProps?: React.HTMLProps<HTMLElement>,\n ) => Record<string, unknown>;\n activeIndex: number | null;\n setActiveIndex: React.Dispatch<React.SetStateAction<number | null>>;\n setHasFocusInside: React.Dispatch<React.SetStateAction<boolean>>;\n isOpen: boolean;\n}>({\n activeIndex: null,\n getItemProps: () => ({}),\n isOpen: false,\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n setActiveIndex: () => {},\n // oxlint-disable-next-line @typescript-eslint/no-empty-function\n setHasFocusInside: () => {},\n});\n\nconst MenuWrapper = (props: React.ComponentProps<typeof MenuComponent>) => {\n const parentId = useFloatingParentNodeId();\n\n if (parentId === null) {\n return (\n <FloatingTree>\n <MenuComponent {...props} isRoot />\n </FloatingTree>\n );\n }\n\n return <MenuComponent {...props} />;\n};\n\nconst MenuComponent = <T extends React.ElementType = 'div'>({\n children,\n isOpen: controlledOpen,\n onClose,\n isRoot,\n anchorRef,\n as,\n className,\n placement,\n minWidth,\n title,\n isDisabled,\n description,\n icon,\n isPortaled = true,\n portalTarget,\n htmlAttributes,\n strategy,\n ref: forwardedRef,\n style,\n}: PolymorphicCommonProps<T, MenuProps>) => {\n const [isOpen, setIsOpen] = useState(false);\n const [hasFocusInside, setHasFocusInside] = useState(false);\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n\n const elementsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const labelsRef = useRef<Array<string | null>>([]);\n const parent = useContext(MenuContext);\n\n const isInsideDialog = useIsInsideDialog();\n const tree = useFloatingTree();\n const nodeId = useFloatingNodeId();\n const parentId = useFloatingParentNodeId();\n const item = useListItem();\n const { themeClassName } = useNeedleTheme();\n useEffect(() => {\n if (controlledOpen === undefined) {\n return;\n }\n setIsOpen(controlledOpen);\n }, [controlledOpen]);\n\n useEffect(() => {\n if (isOpen) {\n setActiveIndex(0);\n }\n }, [isOpen]);\n\n const Component = as ?? 'div';\n\n const isNested = parentId !== null;\n\n const defaultPlacement = isNested ? 'right-start' : 'bottom-start';\n\n const { floatingStyles, refs, context } = useFloating<HTMLButtonElement>({\n elements: {\n reference: anchorRef?.current,\n },\n middleware: [\n offset({\n alignmentAxis: isNested ? -4 : 0,\n mainAxis: isNested ? 0 : 4,\n }),\n flip({\n fallbackPlacements: ['left-start', 'right-start'],\n }),\n shift(),\n ],\n nodeId,\n onOpenChange: (open, event) => {\n if (controlledOpen === undefined) {\n setIsOpen(open);\n }\n\n if (!open) {\n if (event instanceof PointerEvent) {\n onClose?.(event, { type: 'backdropClick' });\n } else if (event instanceof KeyboardEvent) {\n onClose?.(event, { type: 'escapeKeyDown' });\n } else if (event instanceof FocusEvent) {\n onClose?.(event, { type: 'focusOut' });\n }\n }\n },\n open: isOpen,\n placement: placement ? placementTranslation[placement] : defaultPlacement,\n strategy: strategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n\n const hover = useHover(context, {\n delay: { open: 75 },\n enabled: isNested,\n handleClose: safePolygon({ blockPointerEvents: true }),\n });\n const click = useClick(context, {\n event: 'mousedown',\n ignoreMouse: isNested,\n toggle: !isNested,\n });\n const role = useRole(context, { role: 'menu' });\n const dismiss = useDismiss(context, { bubbles: true });\n const listNavigation = useListNavigation(context, {\n activeIndex,\n listRef: elementsRef,\n nested: isNested,\n onNavigate: setActiveIndex,\n });\n const typeahead = useTypeahead(context, {\n activeIndex,\n listRef: labelsRef,\n onMatch: isOpen ? setActiveIndex : undefined,\n });\n\n const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(\n [hover, click, role, dismiss, listNavigation, typeahead],\n );\n\n // Event emitter allows you to communicate across tree components.\n // This effect closes all menus when an item gets clicked anywhere\n // in the tree.\n useEffect(() => {\n if (!tree) {\n return;\n }\n\n function handleTreeClick(data: { id?: string }) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { id: data?.id, type: 'itemClick' });\n }\n\n function onSubMenuOpen(event: { nodeId: string; parentId: string }) {\n if (event.nodeId !== nodeId && event.parentId === parentId) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { type: 'itemClick' });\n }\n }\n\n tree.events.on('click', handleTreeClick);\n tree.events.on('menuopen', onSubMenuOpen);\n\n return () => {\n tree.events.off('click', handleTreeClick);\n tree.events.off('menuopen', onSubMenuOpen);\n };\n }, [tree, nodeId, parentId, onClose, controlledOpen]);\n\n useEffect(() => {\n if (isOpen && tree) {\n tree.events.emit('menuopen', { nodeId, parentId });\n }\n }, [tree, isOpen, nodeId, parentId]);\n\n // Workaround for floating-ui bug where Shift+Tab doesn't trigger\n // closeOnFocusOut.\n // We detect Shift+Tab and check after guards redirect focus whether\n // focus has actually left the floating element.\n // TODO: check every now and then if floating ui addresses this\n const handleShiftTabClose = useCallback(\n (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.key === 'Tab' && event.shiftKey) {\n requestAnimationFrame(() => {\n const floatingEl = refs.floating.current;\n if (floatingEl && !floatingEl.contains(document.activeElement)) {\n if (controlledOpen === undefined) {\n setIsOpen(false);\n }\n onClose?.(undefined, { type: 'focusOut' });\n }\n });\n }\n },\n [controlledOpen, onClose, refs],\n );\n\n const menuClasses = classNames('ndl-menu', themeClassName, className);\n const ref = useMergeRefs([refs.setReference, item.ref, forwardedRef]);\n\n return (\n <FloatingNode id={nodeId}>\n {isRoot !== true && (\n <NestedMenuItem\n ref={ref}\n className={isNested ? 'MenuItem' : 'RootMenu'}\n isDisabled={isDisabled}\n style={style}\n htmlAttributes={{\n 'data-focus-inside': hasFocusInside ? '' : undefined,\n 'data-nested': isNested ? '' : undefined,\n 'data-open': isOpen ? '' : undefined,\n role: isNested ? 'menuitem' : undefined,\n tabIndex: !isNested\n ? undefined\n : parent.activeIndex === item.index\n ? 0\n : -1,\n ...htmlAttributes,\n ...getReferenceProps(\n parent.getItemProps({\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n htmlAttributes?.onFocus?.(event);\n setHasFocusInside(false);\n parent.setHasFocusInside(true);\n },\n }),\n ),\n }}\n title={title}\n description={description}\n leadingVisual={icon}\n />\n )}\n <MenuContext.Provider\n value={{\n activeIndex,\n getItemProps,\n isOpen: isDisabled === true ? false : isOpen,\n setActiveIndex,\n setHasFocusInside,\n }}\n >\n <FloatingList elementsRef={elementsRef} labelsRef={labelsRef}>\n {isOpen && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal root={portalTarget}>\n {wrapChildren}\n </FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={0}\n returnFocus={!isNested}\n closeOnFocusOut={true}\n guards={true}\n >\n <Component\n ref={refs.setFloating}\n className={menuClasses}\n style={{\n minWidth:\n minWidth !== undefined ? `${minWidth}px` : undefined,\n ...floatingStyles,\n ...style,\n }}\n {...getFloatingProps({\n onKeyDown: handleShiftTabClose,\n })}\n >\n {children}\n </Component>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </FloatingList>\n </MenuContext.Provider>\n </FloatingNode>\n );\n};\n\n/**\n * @internal This is used to build the menu item components. Do not export this component.\n */\nconst MenuItemComponent = <T extends React.ElementType = 'button'>({\n title,\n leadingContent,\n trailingContent,\n preLeadingContent,\n description,\n isDisabled,\n as,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemComponentProps>) => {\n const classes = classNames(`ndl-menu-item`, className, {\n 'ndl-disabled': isDisabled,\n });\n\n const Component = as ?? 'button';\n\n return (\n <Component\n className={classes}\n ref={ref}\n type=\"button\"\n role=\"menuitem\"\n disabled={isDisabled}\n style={style}\n {...restProps}\n {...htmlAttributes}\n >\n <div className=\"ndl-menu-item-inner\">\n {Boolean(preLeadingContent) && (\n <div className=\"ndl-menu-item-pre-leading-content\">\n {preLeadingContent}\n </div>\n )}\n {Boolean(leadingContent) && (\n <div className=\"ndl-menu-item-leading-content\">{leadingContent}</div>\n )}\n\n <div className=\"ndl-menu-item-title-wrapper\">\n <div className=\"ndl-menu-item-title\">{title}</div>\n {Boolean(description) && (\n <div className=\"ndl-menu-item-description\">{description}</div>\n )}\n </div>\n\n {Boolean(trailingContent) && (\n <div className=\"ndl-menu-item-trailing-content\">\n {trailingContent}\n </div>\n )}\n </div>\n </Component>\n );\n};\n\nconst MenuItem = <T extends React.ElementType = 'button'>({\n title,\n className,\n style,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n as,\n onClick,\n onFocus,\n htmlAttributes,\n id,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n id: id,\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n }),\n }}\n {...restProps}\n />\n );\n};\n\nconst NestedMenuItem = <T extends React.ElementType = 'button'>({\n title,\n isDisabled,\n description,\n leadingVisual,\n as,\n onFocus,\n onClick,\n className,\n style,\n htmlAttributes,\n id,\n ref,\n}: PolymorphicCommonProps<T, NestedMenuItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const isActive = item.index === menu.activeIndex;\n const mergedRefs = useMergeRefs([item.ref, ref]);\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={className}\n ref={mergedRefs}\n title={title}\n description={description}\n leadingContent={leadingVisual}\n trailingContent={\n <ChevronRightIconOutline className=\"ndl-menu-item-chevron\" />\n }\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n onTouchStart() {\n menu.setHasFocusInside(true);\n },\n }),\n id: id,\n }}\n />\n );\n};\n\nconst CategoryItem = <T extends React.ElementType = 'button'>({\n children,\n className,\n style,\n as,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, CategoryItemProps>) => {\n const classes = classNames('ndl-menu-category-item', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst RadioItem = <T extends React.ElementType = 'button'>({\n title,\n leadingVisual,\n trailingContent,\n description,\n isDisabled,\n isChecked = false,\n onClick,\n onFocus,\n className,\n style,\n as,\n id,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, RadioItemProps>) => {\n const menu = useContext(MenuContext);\n const itemLabel = typeof title === 'string' ? title : undefined;\n const item = useListItem({ label: isDisabled === true ? null : itemLabel });\n const tree = useFloatingTree();\n const isActive = item.index === menu.activeIndex;\n\n const mergedRefs = useMergeRefs([item.ref, ref]);\n const classes = classNames('ndl-menu-radio-item', className, {\n 'ndl-checked': isChecked,\n });\n\n return (\n <MenuItemComponent\n as={as ?? 'button'}\n style={style}\n className={classes}\n ref={mergedRefs}\n title={title}\n description={description}\n preLeadingContent={\n isChecked ? (\n <CheckIconOutline className=\"n-size-5 n-shrink-0 n-self-center\" />\n ) : null\n }\n leadingContent={leadingVisual}\n trailingContent={trailingContent}\n isDisabled={isDisabled}\n htmlAttributes={{\n ...htmlAttributes,\n 'aria-checked': isChecked,\n role: 'menuitemradio',\n tabIndex: isActive ? 0 : -1,\n ...menu.getItemProps({\n id: id,\n onClick(event: React.MouseEvent<HTMLButtonElement>) {\n onClick?.(event);\n tree?.events.emit('click', { id });\n },\n onFocus(event: React.FocusEvent<HTMLButtonElement>) {\n onFocus?.(event);\n menu.setHasFocusInside(true);\n },\n }),\n }}\n {...restProps}\n />\n );\n};\n\nconst MenuItems = <T extends React.ElementType = 'div'>({\n as,\n children,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, MenuItemsProps>) => {\n const classes = classNames('ndl-menu-items', className);\n const Component: React.ElementType = as ?? 'div';\n return (\n <Component\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </Component>\n );\n};\n\nconst MenuGroup = ({\n children,\n className,\n htmlAttributes,\n style,\n ref,\n ...restProps\n}: CommonProps<'div', MenuGroupProps>) => {\n const classes = classNames('ndl-menu-group', className);\n return (\n <div\n className={classes}\n style={style}\n ref={ref}\n role=\"group\"\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\nconst Menu = Object.assign(MenuWrapper, {\n CategoryItem: CategoryItem,\n Divider: Divider,\n Group: MenuGroup,\n Item: MenuItem,\n /**\n * @deprecated Use Menu.Group instead if you want to group items together. If not, you can just omit this component in your implementation.\n */\n Items: MenuItems,\n RadioItem: RadioItem,\n});\nexport { Menu };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"menu-types.js","sourceRoot":"","sources":["../../../src/menu/menu-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG","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 { type Popover } from '../popover';\n\nexport interface MenuProps {\n /** Whether the menu is open or closed (uncontrolled when omitted) */\n isOpen?: boolean;\n /** Callback function that is called when the menu closes */\n onClose?: (\n event: Event | undefined,\n closeReason: {\n type: 'backdropClick' | 'itemClick' | 'escapeKeyDown';\n id?: string;\n },\n ) => void;\n /** Anchor element ref for positioning */\n anchorRef?: React.RefObject<HTMLElement | null>;\n /** Content displayed inside the menu */\n children?: React.ReactNode;\n /** Whether the menu is a root menu instance. This is set internally by the component based on nesting */\n isRoot?: boolean;\n /** The placement of the floating element is determined by two sets of words. The first set of words specifies the point on the anchor element where the floating element will be attached. The second set of coordinates specifies the point on the floating element that will attach to the anchor element.*/\n placement?: React.ComponentProps<typeof Popover>['placement'];\n /** Minimum width in pixels for the menu component */\n minWidth?: number;\n /** Optional title for nested trigger rendering */\n title?: string;\n /** Whether the menu trigger is disabled */\n isDisabled?: boolean;\n /** Optional description for nested trigger rendering */\n description?: React.ReactNode;\n /** Optional icon for nested trigger rendering */\n icon?: React.ReactNode;\n /** Whether the menu should be wrapped in a floating portal */\n isPortaled?: boolean;\n /** Portal target element (defaults to `document.body`) */\n portalTarget?: HTMLElement | null;\n /** Positioning strategy used by Floating UI */\n strategy?: 'absolute' | 'fixed';\n}\n\nexport interface MenuItemProps {\n /** Title of the menu item component */\n title: React.ReactNode;\n /** Leading icon for the menu item component */\n leadingVisual?: React.ReactNode;\n trailingContent?: React.ReactNode;\n /** Supporting text below title */\n description?: React.ReactNode;\n /** Whether the menu item is disabled */\n isDisabled?: boolean;\n /** Callback function that is called when the menu item is clicked and it closes the menu tree */\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** Callback function that is called when the menu item is focused */\n onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;\n /** Unique identifier for the menu item */\n id?: string;\n /** Content displayed inside the menu item component */\n children?: React.ReactNode;\n}\n\nexport type NestedMenuItemProps = Omit<\n MenuItemProps,\n 'children' | 'trailingContent'\n>;\n\nexport interface MenuItemsProps {\n /** Content displayed inside the menu items component */\n children?: React.ReactNode;\n}\n\nexport interface CategoryItemProps {\n /** Content displayed inside the category item component */\n children?: React.ReactNode;\n}\n\nexport type MenuItemComponentProps = {\n title?: React.ReactNode;\n description?: React.ReactNode;\n className?: string;\n leadingContent?: React.ReactNode;\n trailingContent?: React.ReactNode;\n isDisabled?: boolean;\n preLeadingContent?: React.ReactNode;\n};\n\nexport type RadioItemProps = MenuItemProps & {\n /** Whether the radio item is checked. Marks the item as aria-checked. */\n isChecked?: boolean;\n};\n\nexport type MenuGroupProps = {\n /** Content displayed inside the group. */\n children?: React.ReactNode;\n};\n"]}
1
+ {"version":3,"file":"menu-types.js","sourceRoot":"","sources":["../../../src/menu/menu-types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG","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 { type Popover } from '../popover';\n\nexport interface MenuProps {\n /** Whether the menu is open or closed (uncontrolled when omitted) */\n isOpen?: boolean;\n /** Callback function that is called when the menu closes */\n onClose?: (\n event: Event | undefined,\n closeReason: {\n type: 'backdropClick' | 'itemClick' | 'escapeKeyDown' | 'focusOut';\n id?: string;\n },\n ) => void;\n /** Anchor element ref for positioning */\n anchorRef?: React.RefObject<HTMLElement | null>;\n /** Content displayed inside the menu */\n children?: React.ReactNode;\n /** Whether the menu is a root menu instance. This is set internally by the component based on nesting */\n isRoot?: boolean;\n /** The placement of the floating element is determined by two sets of words. The first set of words specifies the point on the anchor element where the floating element will be attached. The second set of coordinates specifies the point on the floating element that will attach to the anchor element.*/\n placement?: React.ComponentProps<typeof Popover>['placement'];\n /** Minimum width in pixels for the menu component */\n minWidth?: number;\n /** Optional title for nested trigger rendering */\n title?: string;\n /** Whether the menu trigger is disabled */\n isDisabled?: boolean;\n /** Optional description for nested trigger rendering */\n description?: React.ReactNode;\n /** Optional icon for nested trigger rendering */\n icon?: React.ReactNode;\n /** Whether the menu should be wrapped in a floating portal */\n isPortaled?: boolean;\n /** Portal target element (defaults to `document.body`) */\n portalTarget?: HTMLElement | null;\n /** Positioning strategy used by Floating UI */\n strategy?: 'absolute' | 'fixed';\n}\n\nexport interface MenuItemProps {\n /** Title of the menu item component */\n title: React.ReactNode;\n /** Leading icon for the menu item component */\n leadingVisual?: React.ReactNode;\n trailingContent?: React.ReactNode;\n /** Supporting text below title */\n description?: React.ReactNode;\n /** Whether the menu item is disabled */\n isDisabled?: boolean;\n /** Callback function that is called when the menu item is clicked and it closes the menu tree */\n onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;\n /** Callback function that is called when the menu item is focused */\n onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;\n /** Unique identifier for the menu item */\n id?: string;\n /** Content displayed inside the menu item component */\n children?: React.ReactNode;\n}\n\nexport type NestedMenuItemProps = Omit<\n MenuItemProps,\n 'children' | 'trailingContent'\n>;\n\nexport interface MenuItemsProps {\n /** Content displayed inside the menu items component */\n children?: React.ReactNode;\n}\n\nexport interface CategoryItemProps {\n /** Content displayed inside the category item component */\n children?: React.ReactNode;\n}\n\nexport type MenuItemComponentProps = {\n title?: React.ReactNode;\n description?: React.ReactNode;\n className?: string;\n leadingContent?: React.ReactNode;\n trailingContent?: React.ReactNode;\n isDisabled?: boolean;\n preLeadingContent?: React.ReactNode;\n};\n\nexport type RadioItemProps = MenuItemProps & {\n /** Whether the radio item is checked. Marks the item as aria-checked. */\n isChecked?: boolean;\n};\n\nexport type MenuGroupProps = {\n /** Content displayed inside the group. */\n children?: React.ReactNode;\n};\n"]}
@@ -36,7 +36,7 @@ exports.Trail = void 0;
36
36
  const jsx_runtime_1 = require("react/jsx-runtime");
37
37
  const Trail = (_a) => {
38
38
  var { variant, htmlAttributes } = _a, restProps = __rest(_a, ["variant", "htmlAttributes"]);
39
- return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-trail" }, restProps, htmlAttributes, { children: [variant === 'straight' && ((0, jsx_runtime_1.jsx)("svg", { className: "ndl-trail-straight", width: "2", height: "24", viewBox: "0 0 2 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M1.00001 16.0005L1 -4.00049L1 28.0004", stroke: "#BBBEC3" }) })), variant === 'curved' && ((0, jsx_runtime_1.jsx)("svg", { className: "ndl-trail-curved", width: "9", height: "13", viewBox: "0 0 9 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M1 -4L1 3.99988C1 8.41816 4.58172 11.9999 9 11.9999V11.9999", stroke: "#BBBEC3" }) })), variant === 'straight-curved' && ((0, jsx_runtime_1.jsxs)("svg", { className: "ndl-trail-straight-curved", width: "16", height: "24", viewBox: "0 0 16 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("g", { clipPath: "url(#clip0_16990_133)", children: (0, jsx_runtime_1.jsx)("path", { d: "M16 12V12C11.5817 12 8.00001 8.41828 8.00001 4L8.00001 -4L8 28", stroke: "#BBBEC3" }) }), (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: "clip0_16990_133", children: (0, jsx_runtime_1.jsx)("rect", { width: "16", height: "24", fill: "white" }) }) })] }))] })));
39
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "ndl-trail" }, restProps, htmlAttributes, { children: [variant === 'straight' && ((0, jsx_runtime_1.jsx)("svg", { className: "ndl-trail-straight", "aria-hidden": true, width: "2", height: "24", viewBox: "0 0 2 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M1.00001 16.0005L1 -4.00049L1 28.0004", stroke: "#BBBEC3" }) })), variant === 'curved' && ((0, jsx_runtime_1.jsx)("svg", { "aria-hidden": true, className: "ndl-trail-curved", width: "9", height: "13", viewBox: "0 0 9 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: (0, jsx_runtime_1.jsx)("path", { d: "M1 -4L1 3.99988C1 8.41816 4.58172 11.9999 9 11.9999V11.9999", stroke: "#BBBEC3" }) })), variant === 'straight-curved' && ((0, jsx_runtime_1.jsxs)("svg", { "aria-hidden": true, className: "ndl-trail-straight-curved", width: "16", height: "24", viewBox: "0 0 16 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [(0, jsx_runtime_1.jsx)("g", { clipPath: "url(#clip0_16990_133)", children: (0, jsx_runtime_1.jsx)("path", { d: "M16 12V12C11.5817 12 8.00001 8.41828 8.00001 4L8.00001 -4L8 28", stroke: "#BBBEC3" }) }), (0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: "clip0_16990_133", children: (0, jsx_runtime_1.jsx)("rect", { width: "16", height: "24", fill: "white" }) }) })] }))] })));
40
40
  };
41
41
  exports.Trail = Trail;
42
42
  //# sourceMappingURL=TreeViewTrail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TreeViewTrail.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTrail.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AA0BO,MAAM,KAAK,GAAG,CAAC,EAIW,EAAE,EAAE;QAJf,EACpB,OAAO,EACP,cAAc,OAEiB,EAD5B,SAAS,cAHQ,6BAIrB,CADa;IAEZ,OAAO,CACL,+CAAK,SAAS,EAAC,WAAW,IAAK,SAAS,EAAM,cAAc,eACzD,OAAO,KAAK,UAAU,IAAI,CACzB,gCACE,SAAS,EAAC,oBAAoB,EAC9B,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,YAElC,iCAAM,CAAC,EAAC,uCAAuC,EAAC,MAAM,EAAC,SAAS,GAAG,GAC/D,CACP,EACA,OAAO,KAAK,QAAQ,IAAI,CACvB,gCACE,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,YAElC,iCACE,CAAC,EAAC,6DAA6D,EAC/D,MAAM,EAAC,SAAS,GAChB,GACE,CACP,EACA,OAAO,KAAK,iBAAiB,IAAI,CAChC,iCACE,SAAS,EAAC,2BAA2B,EACrC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,aAElC,8BAAG,QAAQ,EAAC,uBAAuB,YACjC,iCACE,CAAC,EAAC,gEAAgE,EAClE,MAAM,EAAC,SAAS,GAChB,GACA,EACJ,2CACE,qCAAU,EAAE,EAAC,iBAAiB,YAC5B,iCAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,GAAG,GACnC,GACN,IACH,CACP,KACG,CACP,CAAC;AACJ,CAAC,CAAC;AA1DW,QAAA,KAAK,SA0DhB","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 { type CommonProps } from '../_common/types';\n\nexport type TrailProps = {\n variant: 'straight' | 'curved' | 'straight-curved' | 'none';\n};\nexport const Trail = ({\n variant,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', TrailProps>) => {\n return (\n <div className=\"ndl-trail\" {...restProps} {...htmlAttributes}>\n {variant === 'straight' && (\n <svg\n className=\"ndl-trail-straight\"\n width=\"2\"\n height=\"24\"\n viewBox=\"0 0 2 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M1.00001 16.0005L1 -4.00049L1 28.0004\" stroke=\"#BBBEC3\" />\n </svg>\n )}\n {variant === 'curved' && (\n <svg\n className=\"ndl-trail-curved\"\n width=\"9\"\n height=\"13\"\n viewBox=\"0 0 9 13\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 -4L1 3.99988C1 8.41816 4.58172 11.9999 9 11.9999V11.9999\"\n stroke=\"#BBBEC3\"\n />\n </svg>\n )}\n {variant === 'straight-curved' && (\n <svg\n className=\"ndl-trail-straight-curved\"\n width=\"16\"\n height=\"24\"\n viewBox=\"0 0 16 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clipPath=\"url(#clip0_16990_133)\">\n <path\n d=\"M16 12V12C11.5817 12 8.00001 8.41828 8.00001 4L8.00001 -4L8 28\"\n stroke=\"#BBBEC3\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_16990_133\">\n <rect width=\"16\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"TreeViewTrail.js","sourceRoot":"","sources":["../../../src/tree-view/TreeViewTrail.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AA0BO,MAAM,KAAK,GAAG,CAAC,EAIW,EAAE,EAAE;QAJf,EACpB,OAAO,EACP,cAAc,OAEiB,EAD5B,SAAS,cAHQ,6BAIrB,CADa;IAEZ,OAAO,CACL,+CAAK,SAAS,EAAC,WAAW,IAAK,SAAS,EAAM,cAAc,eACzD,OAAO,KAAK,UAAU,IAAI,CACzB,gCACE,SAAS,EAAC,oBAAoB,iBACjB,IAAI,EACjB,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,YAElC,iCAAM,CAAC,EAAC,uCAAuC,EAAC,MAAM,EAAC,SAAS,GAAG,GAC/D,CACP,EACA,OAAO,KAAK,QAAQ,IAAI,CACvB,+CACe,IAAI,EACjB,SAAS,EAAC,kBAAkB,EAC5B,KAAK,EAAC,GAAG,EACT,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,UAAU,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,YAElC,iCACE,CAAC,EAAC,6DAA6D,EAC/D,MAAM,EAAC,SAAS,GAChB,GACE,CACP,EACA,OAAO,KAAK,iBAAiB,IAAI,CAChC,gDACe,IAAI,EACjB,SAAS,EAAC,2BAA2B,EACrC,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,aAElC,8BAAG,QAAQ,EAAC,uBAAuB,YACjC,iCACE,CAAC,EAAC,gEAAgE,EAClE,MAAM,EAAC,SAAS,GAChB,GACA,EACJ,2CACE,qCAAU,EAAE,EAAC,iBAAiB,YAC5B,iCAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,GAAG,GACnC,GACN,IACH,CACP,KACG,CACP,CAAC;AACJ,CAAC,CAAC;AA7DW,QAAA,KAAK,SA6DhB","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 { type CommonProps } from '../_common/types';\n\nexport type TrailProps = {\n variant: 'straight' | 'curved' | 'straight-curved' | 'none';\n};\nexport const Trail = ({\n variant,\n htmlAttributes,\n ...restProps\n}: CommonProps<'div', TrailProps>) => {\n return (\n <div className=\"ndl-trail\" {...restProps} {...htmlAttributes}>\n {variant === 'straight' && (\n <svg\n className=\"ndl-trail-straight\"\n aria-hidden={true}\n width=\"2\"\n height=\"24\"\n viewBox=\"0 0 2 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M1.00001 16.0005L1 -4.00049L1 28.0004\" stroke=\"#BBBEC3\" />\n </svg>\n )}\n {variant === 'curved' && (\n <svg\n aria-hidden={true}\n className=\"ndl-trail-curved\"\n width=\"9\"\n height=\"13\"\n viewBox=\"0 0 9 13\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M1 -4L1 3.99988C1 8.41816 4.58172 11.9999 9 11.9999V11.9999\"\n stroke=\"#BBBEC3\"\n />\n </svg>\n )}\n {variant === 'straight-curved' && (\n <svg\n aria-hidden={true}\n className=\"ndl-trail-straight-curved\"\n width=\"16\"\n height=\"24\"\n viewBox=\"0 0 16 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g clipPath=\"url(#clip0_16990_133)\">\n <path\n d=\"M16 12V12C11.5817 12 8.00001 8.41828 8.00001 4L8.00001 -4L8 28\"\n stroke=\"#BBBEC3\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_16990_133\">\n <rect width=\"16\" height=\"24\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n )}\n </div>\n );\n};\n"]}
@@ -55,6 +55,7 @@ const DEFAULT_STYLING = {
55
55
  hasHoverEffects: true,
56
56
  hasZebraStriping: false,
57
57
  headerStyle: HeaderStyleEnum.Filled,
58
+ isCompact: false,
58
59
  };
59
60
  const DataGridComponent = function DataGrid(_a) {
60
61
  var { isResizable = true, isLoading = false, isKeyboardNavigable = true, isAutoResizingColumns = true, tableInstance, components, rootProps, styling = {}, tableNavRef, isSkeletonLoading = false, skeletonProps, ref, portalTarget = document.body, htmlAttributes, className, style } = _a, restProps = __rest(_a, ["isResizable", "isLoading", "isKeyboardNavigable", "isAutoResizingColumns", "tableInstance", "components", "rootProps", "styling", "tableNavRef", "isSkeletonLoading", "skeletonProps", "ref", "portalTarget", "htmlAttributes", "className", "style"]);
@@ -129,6 +130,7 @@ const DataGridComponent = function DataGrid(_a) {
129
130
  Styling.borderStyle === BorderStyleEnum.AllSides,
130
131
  'ndl-data-grid-border-vertical': Styling.borderStyle === BorderStyleEnum.Vertical ||
131
132
  Styling.borderStyle === BorderStyleEnum.AllSides,
133
+ 'ndl-data-grid-compact': Styling.isCompact,
132
134
  'ndl-data-grid-focusable-cells': isKeyboardNavigable,
133
135
  'ndl-data-grid-header-filled': Styling.headerStyle === HeaderStyleEnum.Filled,
134
136
  'ndl-data-grid-hover-effects': Styling.hasHoverEffects,