@neo4j-ndl/react 4.14.0 → 4.14.2

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 (77) hide show
  1. package/lib/cjs/ai/response/Response.js +2 -2
  2. package/lib/cjs/ai/response/Response.js.map +1 -1
  3. package/lib/cjs/data-grid/Components.js +3 -1
  4. package/lib/cjs/data-grid/Components.js.map +1 -1
  5. package/lib/cjs/data-grid/DataGrid.js +2 -1
  6. package/lib/cjs/data-grid/DataGrid.js.map +1 -1
  7. package/lib/cjs/data-grid/data-grid-context.js.map +1 -1
  8. package/lib/cjs/data-grid/index.js +14 -1
  9. package/lib/cjs/data-grid/index.js.map +1 -1
  10. package/lib/cjs/data-grid/stories/datagrid-custom-cell-with-style-rules.story.js +142 -0
  11. package/lib/cjs/data-grid/stories/datagrid-custom-cell-with-style-rules.story.js.map +1 -0
  12. package/lib/cjs/data-grid/stories/datagrid-rule-based-styling.story.js +133 -0
  13. package/lib/cjs/data-grid/stories/datagrid-rule-based-styling.story.js.map +1 -0
  14. package/lib/cjs/data-grid/stories/index.js +9 -1
  15. package/lib/cjs/data-grid/stories/index.js.map +1 -1
  16. package/lib/cjs/data-grid/style-rules/evaluate.js +283 -0
  17. package/lib/cjs/data-grid/style-rules/evaluate.js.map +1 -0
  18. package/lib/cjs/data-grid/style-rules/hooks.js +45 -0
  19. package/lib/cjs/data-grid/style-rules/hooks.js.map +1 -0
  20. package/lib/cjs/data-grid/style-rules/index.js +37 -0
  21. package/lib/cjs/data-grid/style-rules/index.js.map +1 -0
  22. package/lib/cjs/data-grid/style-rules/types.js +158 -0
  23. package/lib/cjs/data-grid/style-rules/types.js.map +1 -0
  24. package/lib/cjs/index.js +3 -8
  25. package/lib/cjs/index.js.map +1 -1
  26. package/lib/esm/ai/response/Response.js +2 -2
  27. package/lib/esm/ai/response/Response.js.map +1 -1
  28. package/lib/esm/data-grid/Components.js +3 -1
  29. package/lib/esm/data-grid/Components.js.map +1 -1
  30. package/lib/esm/data-grid/DataGrid.js +2 -1
  31. package/lib/esm/data-grid/DataGrid.js.map +1 -1
  32. package/lib/esm/data-grid/data-grid-context.js.map +1 -1
  33. package/lib/esm/data-grid/index.js +3 -0
  34. package/lib/esm/data-grid/index.js.map +1 -1
  35. package/lib/esm/data-grid/stories/datagrid-custom-cell-with-style-rules.story.js +140 -0
  36. package/lib/esm/data-grid/stories/datagrid-custom-cell-with-style-rules.story.js.map +1 -0
  37. package/lib/esm/data-grid/stories/datagrid-rule-based-styling.story.js +131 -0
  38. package/lib/esm/data-grid/stories/datagrid-rule-based-styling.story.js.map +1 -0
  39. package/lib/esm/data-grid/stories/index.js +6 -0
  40. package/lib/esm/data-grid/stories/index.js.map +1 -1
  41. package/lib/esm/data-grid/style-rules/evaluate.js +279 -0
  42. package/lib/esm/data-grid/style-rules/evaluate.js.map +1 -0
  43. package/lib/esm/data-grid/style-rules/hooks.js +42 -0
  44. package/lib/esm/data-grid/style-rules/hooks.js.map +1 -0
  45. package/lib/esm/data-grid/style-rules/index.js +24 -0
  46. package/lib/esm/data-grid/style-rules/index.js.map +1 -0
  47. package/lib/esm/data-grid/style-rules/types.js +155 -0
  48. package/lib/esm/data-grid/style-rules/types.js.map +1 -0
  49. package/lib/esm/index.js +1 -1
  50. package/lib/esm/index.js.map +1 -1
  51. package/lib/types/ai/response/Response.d.ts.map +1 -1
  52. package/lib/types/data-grid/Components.d.ts.map +1 -1
  53. package/lib/types/data-grid/DataGrid.d.ts +4 -1
  54. package/lib/types/data-grid/DataGrid.d.ts.map +1 -1
  55. package/lib/types/data-grid/data-grid-context.d.ts +2 -0
  56. package/lib/types/data-grid/data-grid-context.d.ts.map +1 -1
  57. package/lib/types/data-grid/index.d.ts +4 -0
  58. package/lib/types/data-grid/index.d.ts.map +1 -1
  59. package/lib/types/data-grid/stories/datagrid-custom-cell-with-style-rules.story.d.ts +24 -0
  60. package/lib/types/data-grid/stories/datagrid-custom-cell-with-style-rules.story.d.ts.map +1 -0
  61. package/lib/types/data-grid/stories/datagrid-pinned-columns.stories.d.ts +2 -2
  62. package/lib/types/data-grid/stories/datagrid-rule-based-styling.story.d.ts +24 -0
  63. package/lib/types/data-grid/stories/datagrid-rule-based-styling.story.d.ts.map +1 -0
  64. package/lib/types/data-grid/stories/datagrid-search-and-filters.stories.d.ts +2 -2
  65. package/lib/types/data-grid/stories/index.d.ts +4 -0
  66. package/lib/types/data-grid/stories/index.d.ts.map +1 -1
  67. package/lib/types/data-grid/style-rules/evaluate.d.ts +41 -0
  68. package/lib/types/data-grid/style-rules/evaluate.d.ts.map +1 -0
  69. package/lib/types/data-grid/style-rules/hooks.d.ts +27 -0
  70. package/lib/types/data-grid/style-rules/hooks.d.ts.map +1 -0
  71. package/lib/types/data-grid/style-rules/index.d.ts +25 -0
  72. package/lib/types/data-grid/style-rules/index.d.ts.map +1 -0
  73. package/lib/types/data-grid/style-rules/types.d.ts +161 -0
  74. package/lib/types/data-grid/style-rules/types.d.ts.map +1 -0
  75. package/lib/types/index.d.ts +1 -1
  76. package/lib/types/index.d.ts.map +1 -1
  77. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["../../../src/data-grid/DataGrid.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAwBA,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,cAAc,EACd,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,UAAU,EACV,qBAAqB,EACrB,uBAAuB,EACvB,wBAAw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H;wBAC5H,QAAQ,EAAE,YAAY,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;qBAC/D,YAGD,eACE,SAAS,EAAC,eAAe,EACzB,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,eACjC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EACvC,GAAG,EAAE,QAAQ,aAGZ,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,KAAI,KAAC,UAAU,CAAC,MAAM,KAAG,EAC3C,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,KAAI,KAAC,UAAU,CAAC,IAAI,KAAG,IACpC,GACc,EAErB,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,KAAI,KAAC,UAAU,CAAC,UAAU,KAAG,KAChD,GACmB,CAC5B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,YAAY;IACZ,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,cAAc;IACd,YAAY;IACZ,MAAM;IACN,UAAU;IACV,WAAW;IACX,cAAc;IACd,kBAAkB;IAClB,UAAU;IACV,UAAU;IACV,iBAAiB;IACjB,+BAA+B;IAC/B,UAAU;IACV,qBAAqB;IACrB,uBAAuB;IACvB,wBAAwB;IACxB,WAAW;IACX,WAAW;IACX,UAAU;IACV,YAAY;CACb,CAAC;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport classNames from 'classnames';\nimport {\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useResizeObserver } from '../hooks';\nimport { type Skeleton } from '../skeleton';\nimport {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n} from './Components';\nimport {\n type DataGridComponentsInterface,\n DataGridContext,\n type DataGridContextType,\n} from './data-grid-context';\nimport { useTableNav } from './data-grid-nav';\nimport { updateColumnWidths } from './helpers';\n\nenum BorderStyleEnum {\n AllSides = 'all-sides',\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n None = 'none',\n}\n\nexport type BorderStyle = `${BorderStyleEnum}`;\n\nenum HeaderStyleEnum {\n Filled = 'filled',\n Clean = 'clean',\n}\n\nexport type HeaderStyle = `${HeaderStyleEnum}`;\n\nexport type DataGridProps<T extends RowData> = {\n styling?: Partial<{\n /** Alternate the background color of rows */\n hasZebraStriping: boolean;\n /** Type of border that will be used */\n borderStyle: BorderStyle;\n /** If header should have styles or not (Aura example) */\n headerStyle: HeaderStyle;\n /** If background hover effects should be enabled on rows and header cells */\n hasHoverEffects: boolean;\n /** 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-resizable': isResizable,\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,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,EACL,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,cAAc,EACd,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,UAAU,EACV,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,eAAe,GAEhB,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,CAAC,CAAC,SAAS;qBAC/D,YAGD,eACE,SAAS,EAAC,eAAe,EACzB,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,eACjC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EACvC,GAAG,EAAE,QAAQ,aAGZ,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,KAAI,KAAC,UAAU,CAAC,MAAM,KAAG,EAC3C,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,IAAI,KAAI,KAAC,UAAU,CAAC,IAAI,KAAG,IACpC,GACc,EAErB,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,KAAI,KAAC,UAAU,CAAC,UAAU,KAAG,KAChD,GACmB,CAC5B,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,YAAY;IACZ,UAAU;IACV,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,cAAc;IACd,YAAY;IACZ,MAAM;IACN,UAAU;IACV,WAAW;IACX,cAAc;IACd,kBAAkB;IAClB,UAAU;IACV,UAAU;IACV,iBAAiB;IACjB,+BAA+B;IAC/B,UAAU;IACV,qBAAqB;IACrB,uBAAuB;IACvB,wBAAwB;IACxB,WAAW;IACX,WAAW;IACX,UAAU;IACV,YAAY;CACb,CAAC;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport classNames from 'classnames';\nimport {\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type CommonProps, type HtmlAttributes } from '../_common/types';\nimport { useResizeObserver } from '../hooks';\nimport { type Skeleton } from '../skeleton';\nimport {\n ActionButton,\n ActionCell,\n Body,\n BodyCell,\n BodyRow,\n ColumnControls,\n DropDownCell,\n Header,\n HeaderCell,\n HeaderTitle,\n InlineEditCell,\n LoadingPlaceholder,\n Navigation,\n NoDataIcon,\n NoDataPlaceholder,\n NoDataPlaceholderContentWrapper,\n Pagination,\n PaginationArrowButton,\n PaginationNumericButton,\n PaginationNumericButtons,\n ResizingBar,\n RowsPerPage,\n Scrollable,\n TableResults,\n} from './Components';\nimport {\n type DataGridComponentsInterface,\n DataGridContext,\n type DataGridContextType,\n} from './data-grid-context';\nimport { useTableNav } from './data-grid-nav';\nimport { updateColumnWidths } from './helpers';\nimport { type DataGridStyleRule } from './style-rules/types';\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 /** Rule-based conditional styling for cells and rows. */\n styleRules?: DataGridStyleRule[];\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 styleRules,\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 styleRules,\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-resizable': isResizable,\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 +1 @@
1
- {"version":3,"file":"data-grid-context.js","sourceRoot":"","sources":["../../../src/data-grid/data-grid-context.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA4ElD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAA2B,IAAK,CAAC,CAAC;AAE9E,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,UAAU,CAAyB,eAAe,CAAC,CAAC;IACpE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport { createContext, useContext } from 'react';\n\nimport { type Skeleton } from '../skeleton';\nimport {\n type ActionButton,\n type ActionCell,\n type Body,\n type BodyCell,\n type BodyRow,\n type ColumnControls,\n type Header,\n type HeaderCell,\n type HeaderTitle,\n type LoadingPlaceholder,\n type Navigation,\n type NoDataPlaceholder,\n type Pagination,\n type PaginationArrowButton,\n type PaginationNumericButton,\n type PaginationNumericButtons,\n type ResizingBar,\n type RowsPerPage,\n type Scrollable,\n type TableResults,\n} from './Components';\nimport { type DataGridNav } from './data-grid-nav/data-grid-nav';\n\ntype Nullable<T> = T | null;\n\nexport interface DataGridComponentsInterface<T extends RowData> {\n ResizingBar?: Nullable<typeof ResizingBar<T>>;\n /**\n * Header Section\n */\n Header?: Nullable<typeof Header>;\n HeaderCell?: Nullable<typeof HeaderCell<T>>;\n HeaderTitle?: Nullable<typeof HeaderTitle<T>>;\n ActionButton?: Nullable<typeof ActionButton>;\n ColumnControls?: Nullable<typeof ColumnControls>;\n /**\n * Body Section\n */\n Scrollable?: Nullable<typeof Scrollable>;\n Body?: Nullable<typeof Body>;\n BodyCell?: Nullable<typeof BodyCell<T>>;\n BodyRow?: Nullable<typeof BodyRow<T>>;\n ActionCell?: Nullable<typeof ActionCell<T>>;\n LoadingPlaceholder?: Nullable<typeof LoadingPlaceholder>;\n NoDataPlaceholder?: Nullable<typeof NoDataPlaceholder>;\n /**\n * Navigation Section\n */\n Navigation?: Nullable<typeof Navigation>;\n Pagination?: Nullable<typeof Pagination>;\n PaginationArrowButton?: Nullable<typeof PaginationArrowButton>;\n TableResults?: Nullable<typeof TableResults>;\n RowsPerPage?: Nullable<typeof RowsPerPage>;\n PaginationNumericButtons?: Nullable<typeof PaginationNumericButtons>;\n PaginationNumericButton?: Nullable<typeof PaginationNumericButton>;\n}\n\nexport interface DataGridContextType<T extends RowData> {\n isResizable: boolean;\n tableProps: DataGridType<T>;\n components: DataGridComponentsInterface<T>;\n isLoading: boolean;\n hasResizeColumns: boolean;\n isKeyboardNavigationEnabled: boolean;\n isSkeletonLoading: boolean;\n skeletonProps: React.ComponentProps<typeof Skeleton>;\n dataGridNav: DataGridNav;\n portalTarget: HTMLElement | null;\n isMediumNavigation: boolean;\n isSmallNavigation: boolean;\n}\n\n// oxlint-disable-next-line @typescript-eslint/no-explicit-any\nexport const DataGridContext = createContext<DataGridContextType<any>>(null!);\n\nexport function useDataGridContext<T extends RowData>() {\n const context = useContext<DataGridContextType<T>>(DataGridContext);\n if (!context) {\n throw new Error(\n 'useDataGridContext should be used under Table component provider',\n );\n }\n return context;\n}\n"]}
1
+ {"version":3,"file":"data-grid-context.js","sourceRoot":"","sources":["../../../src/data-grid/data-grid-context.tsx"],"names":[],"mappings":"AAwBA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA8ElD,8DAA8D;AAC9D,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAA2B,IAAK,CAAC,CAAC;AAE9E,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,UAAU,CAAyB,eAAe,CAAC,CAAC;IACpE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n type RowData,\n type Table as DataGridType,\n} from '@tanstack/react-table';\nimport { createContext, useContext } from 'react';\n\nimport { type Skeleton } from '../skeleton';\nimport {\n type ActionButton,\n type ActionCell,\n type Body,\n type BodyCell,\n type BodyRow,\n type ColumnControls,\n type Header,\n type HeaderCell,\n type HeaderTitle,\n type LoadingPlaceholder,\n type Navigation,\n type NoDataPlaceholder,\n type Pagination,\n type PaginationArrowButton,\n type PaginationNumericButton,\n type PaginationNumericButtons,\n type ResizingBar,\n type RowsPerPage,\n type Scrollable,\n type TableResults,\n} from './Components';\nimport { type DataGridNav } from './data-grid-nav/data-grid-nav';\nimport { type DataGridStyleRule } from './style-rules/types';\n\ntype Nullable<T> = T | null;\n\nexport interface DataGridComponentsInterface<T extends RowData> {\n ResizingBar?: Nullable<typeof ResizingBar<T>>;\n /**\n * Header Section\n */\n Header?: Nullable<typeof Header>;\n HeaderCell?: Nullable<typeof HeaderCell<T>>;\n HeaderTitle?: Nullable<typeof HeaderTitle<T>>;\n ActionButton?: Nullable<typeof ActionButton>;\n ColumnControls?: Nullable<typeof ColumnControls>;\n /**\n * Body Section\n */\n Scrollable?: Nullable<typeof Scrollable>;\n Body?: Nullable<typeof Body>;\n BodyCell?: Nullable<typeof BodyCell<T>>;\n BodyRow?: Nullable<typeof BodyRow<T>>;\n ActionCell?: Nullable<typeof ActionCell<T>>;\n LoadingPlaceholder?: Nullable<typeof LoadingPlaceholder>;\n NoDataPlaceholder?: Nullable<typeof NoDataPlaceholder>;\n /**\n * Navigation Section\n */\n Navigation?: Nullable<typeof Navigation>;\n Pagination?: Nullable<typeof Pagination>;\n PaginationArrowButton?: Nullable<typeof PaginationArrowButton>;\n TableResults?: Nullable<typeof TableResults>;\n RowsPerPage?: Nullable<typeof RowsPerPage>;\n PaginationNumericButtons?: Nullable<typeof PaginationNumericButtons>;\n PaginationNumericButton?: Nullable<typeof PaginationNumericButton>;\n}\n\nexport interface DataGridContextType<T extends RowData> {\n isResizable: boolean;\n tableProps: DataGridType<T>;\n components: DataGridComponentsInterface<T>;\n isLoading: boolean;\n hasResizeColumns: boolean;\n isKeyboardNavigationEnabled: boolean;\n isSkeletonLoading: boolean;\n skeletonProps: React.ComponentProps<typeof Skeleton>;\n dataGridNav: DataGridNav;\n portalTarget: HTMLElement | null;\n isMediumNavigation: boolean;\n isSmallNavigation: boolean;\n styleRules?: DataGridStyleRule[];\n}\n\n// oxlint-disable-next-line @typescript-eslint/no-explicit-any\nexport const DataGridContext = createContext<DataGridContextType<any>>(null!);\n\nexport function useDataGridContext<T extends RowData>() {\n const context = useContext<DataGridContextType<T>>(DataGridContext);\n if (!context) {\n throw new Error(\n 'useDataGridContext should be used under Table component provider',\n );\n }\n return context;\n}\n"]}
@@ -24,4 +24,7 @@ export { DataGrid } from './DataGrid';
24
24
  export { dataGridUtils, useDataGridContext };
25
25
  export { useTableNav } from './data-grid-nav';
26
26
  export * from './data-grid-nav/data-grid-nav';
27
+ export { evaluateDataGridStyleRules } from './style-rules/evaluate';
28
+ export { useDataGridCellStyle } from './style-rules/hooks';
29
+ export { DataGridCellStyleSchema, DataGridColorRangeSchema, DataGridColumnRefSchema, DataGridDisableableColorSchema, DataGridStyleRuleLiteralSchema, DataGridStyleRuleOperandSchema, DataGridStyleRuleSchema, DataGridStyleRuleWhereSchema, } from './style-rules/types';
27
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data-grid/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,aAAa,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAsC,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,cAAc,+BAA+B,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { useDataGridContext } from './data-grid-context';\nimport * as dataGridUtils from './helpers';\n\nexport { DataGrid, type HeaderStyle, type BorderStyle } from './DataGrid';\nexport { dataGridUtils, useDataGridContext };\nexport type * from './datagrid-types';\nexport { useTableNav } from './data-grid-nav';\nexport * from './data-grid-nav/data-grid-nav';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data-grid/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,aAAa,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAsC,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,8BAA8B,EAC9B,8BAA8B,EAC9B,8BAA8B,EAC9B,uBAAuB,EACvB,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { useDataGridContext } from './data-grid-context';\nimport * as dataGridUtils from './helpers';\n\nexport { DataGrid, type HeaderStyle, type BorderStyle } from './DataGrid';\nexport { dataGridUtils, useDataGridContext };\nexport type * from './datagrid-types';\nexport { useTableNav } from './data-grid-nav';\nexport * from './data-grid-nav/data-grid-nav';\nexport { evaluateDataGridStyleRules } from './style-rules/evaluate';\nexport { useDataGridCellStyle } from './style-rules/hooks';\nexport {\n DataGridCellStyleSchema,\n DataGridColorRangeSchema,\n DataGridColumnRefSchema,\n DataGridDisableableColorSchema,\n DataGridStyleRuleLiteralSchema,\n DataGridStyleRuleOperandSchema,\n DataGridStyleRuleSchema,\n DataGridStyleRuleWhereSchema,\n} from './style-rules/types';\nexport type {\n DataGridCellStyle,\n DataGridColorRange,\n DataGridColumnRef,\n DataGridDisableableColor,\n DataGridStyleRuleLiteral,\n DataGridStyleRuleOperand,\n DataGridStyleRule,\n DataGridStyleRuleWhere,\n} from './style-rules/types';\n"]}
@@ -0,0 +1,140 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { DataGrid, useDataGridCellStyle, } from '@neo4j-ndl/react';
24
+ import { createColumnHelper, flexRender, getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
25
+ import { TABLE_DEMO_DATA } from './staticData';
26
+ const styleRules = [
27
+ // Row coloring: all cells styled when name contains "Alicia"
28
+ {
29
+ apply: {
30
+ color: { value: '#000000' },
31
+ textColor: { value: '#ffffff' },
32
+ },
33
+ column: null,
34
+ priority: 3,
35
+ where: { contains: [{ column: 'name' }, 'Alicia'] },
36
+ },
37
+ // Cell coloring: cells in the "age" column with value 51 get green
38
+ {
39
+ apply: { color: { value: '#00bb00' } },
40
+ column: 'age',
41
+ priority: 3,
42
+ where: { equal: [{ column: 'age' }, 51] },
43
+ },
44
+ // Dual color ranges on the "age" column: independent gradients for background
45
+ // (driven by age, full 0-100 range) and text color (driven by age too, but
46
+ // with a narrower 20-80 band so the text contrast is calibrated separately).
47
+ {
48
+ apply: {
49
+ colorRange: {
50
+ maxColor: '#f00000',
51
+ maxValue: 100,
52
+ midColor: '#a00000',
53
+ midValue: 50,
54
+ minColor: '#800000',
55
+ minValue: 0,
56
+ onColumn: 'age',
57
+ },
58
+ textColorRange: {
59
+ maxColor: '#aaaaaa',
60
+ maxValue: 80,
61
+ minColor: '#ffffff',
62
+ minValue: 20,
63
+ onColumn: 'age',
64
+ },
65
+ },
66
+ column: 'age',
67
+ priority: 2, // Lower priority so explicit green rule overrides
68
+ },
69
+ // Multi-column rule: all cells styled when age > 50 AND name contains "o"
70
+ {
71
+ apply: {
72
+ color: { value: '#fef3c7' },
73
+ textColor: { value: '#000000' },
74
+ },
75
+ column: null,
76
+ priority: 0, // Lower priority so other rules take precedence
77
+ where: {
78
+ and: [
79
+ { greaterThan: [{ column: 'age' }, 50] },
80
+ { contains: [{ column: 'name' }, 'o'] },
81
+ ],
82
+ },
83
+ },
84
+ ];
85
+ /**
86
+ * A custom BodyCell that uses the `useDataGridCellStyle` hook to manually apply style rules to the cell.
87
+ */
88
+ const CustomBodyCell = ({ cell, }) => {
89
+ const ruleStyle = useDataGridCellStyle(cell);
90
+ return (_jsx("div", { className: "ndl-data-grid-td", role: "cell", style: Object.assign(Object.assign({}, ruleStyle), { width: cell.column.getSize() }), children: flexRender(cell.column.columnDef.cell, cell.getContext()) }));
91
+ };
92
+ const Component = () => {
93
+ const columnHelper = createColumnHelper();
94
+ const columns = [
95
+ columnHelper.accessor('name', {
96
+ cell: (info) => info.getValue(),
97
+ header: () => 'Name',
98
+ minSize: 180,
99
+ size: 220,
100
+ }),
101
+ columnHelper.accessor('age', {
102
+ cell: (info) => info.renderValue(),
103
+ header: () => 'Age',
104
+ minSize: 80,
105
+ }),
106
+ columnHelper.accessor('cypherCommand', {
107
+ cell: (info) => info.getValue(),
108
+ header: () => 'Cypher Command',
109
+ minSize: 400,
110
+ size: 400,
111
+ }),
112
+ ];
113
+ const table = useReactTable({
114
+ columnResizeMode: 'onChange',
115
+ columns,
116
+ data: TABLE_DEMO_DATA,
117
+ defaultColumn: {
118
+ maxSize: 800,
119
+ minSize: 80,
120
+ },
121
+ enableSorting: true,
122
+ getCoreRowModel: getCoreRowModel(),
123
+ getPaginationRowModel: getPaginationRowModel(),
124
+ getSortedRowModel: getSortedRowModel(),
125
+ initialState: {
126
+ pagination: {
127
+ pageSize: 10,
128
+ },
129
+ },
130
+ });
131
+ return (_jsx("div", { className: "n-w-full n-bg-light-neutral-text-weakest", children: _jsx(DataGrid, { isResizable: false, tableInstance: table, isKeyboardNavigable: false, styleRules: styleRules, components: {
132
+ BodyCell: CustomBodyCell,
133
+ }, styling: {
134
+ borderStyle: 'all-sides',
135
+ hasHoverEffects: true,
136
+ hasZebraStriping: false,
137
+ } }) }));
138
+ };
139
+ export default Component;
140
+ //# sourceMappingURL=datagrid-custom-cell-with-style-rules.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datagrid-custom-cell-with-style-rules.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-custom-cell-with-style-rules.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EACL,QAAQ,EAER,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EAEjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,eAAe,EAAuB,MAAM,cAAc,CAAC;AAEpE,MAAM,UAAU,GAAwB;IACtC,6DAA6D;IAC7D;QACE,KAAK,EAAE;YACL,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAC3B,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;SAChC;QACD,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC,EAAE;KACpD;IACD,mEAAmE;IACnE;QACE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,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Ae,EAAE;QAClC,qBAAqB,EAAE,qBAAqB,EAAE;QAC9C,iBAAiB,EAAE,iBAAiB,EAAE;QACtC,YAAY,EAAE;YACZ,UAAU,EAAE;gBACV,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC,CAAC;IAEH,OAAO,CACL,cAAK,SAAS,EAAC,0CAA0C,YACvD,KAAC,QAAQ,IACP,WAAW,EAAE,KAAK,EAClB,aAAa,EAAE,KAAK,EACpB,mBAAmB,EAAE,KAAK,EAC1B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE;gBACV,QAAQ,EAAE,cAAc;aACzB,EACD,OAAO,EAAE;gBACP,WAAW,EAAE,WAAW;gBACxB,eAAe,EAAE,IAAI;gBACrB,gBAAgB,EAAE,KAAK;aACxB,GACD,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n DataGrid,\n type DataGridStyleRule,\n useDataGridCellStyle,\n} from '@neo4j-ndl/react';\nimport {\n type Cell,\n createColumnHelper,\n flexRender,\n getCoreRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n type RowData,\n useReactTable,\n} from '@tanstack/react-table';\n\nimport { TABLE_DEMO_DATA, type TestDataFormat } from './staticData';\n\nconst styleRules: DataGridStyleRule[] = [\n // Row coloring: all cells styled when name contains \"Alicia\"\n {\n apply: {\n color: { value: '#000000' },\n textColor: { value: '#ffffff' },\n },\n column: null,\n priority: 3,\n where: { contains: [{ column: 'name' }, 'Alicia'] },\n },\n // Cell coloring: cells in the \"age\" column with value 51 get green\n {\n apply: { color: { value: '#00bb00' } },\n column: 'age',\n priority: 3,\n where: { equal: [{ column: 'age' }, 51] },\n },\n // Dual color ranges on the \"age\" column: independent gradients for background\n // (driven by age, full 0-100 range) and text color (driven by age too, but\n // with a narrower 20-80 band so the text contrast is calibrated separately).\n {\n apply: {\n colorRange: {\n maxColor: '#f00000',\n maxValue: 100,\n midColor: '#a00000',\n midValue: 50,\n minColor: '#800000',\n minValue: 0,\n onColumn: 'age',\n },\n textColorRange: {\n maxColor: '#aaaaaa',\n maxValue: 80,\n minColor: '#ffffff',\n minValue: 20,\n onColumn: 'age',\n },\n },\n column: 'age',\n priority: 2, // Lower priority so explicit green rule overrides\n },\n // Multi-column rule: all cells styled when age > 50 AND name contains \"o\"\n {\n apply: {\n color: { value: '#fef3c7' },\n textColor: { value: '#000000' },\n },\n column: null,\n priority: 0, // Lower priority so other rules take precedence\n where: {\n and: [\n { greaterThan: [{ column: 'age' }, 50] },\n { contains: [{ column: 'name' }, 'o'] },\n ],\n },\n },\n];\n\n/**\n * A custom BodyCell that uses the `useDataGridCellStyle` hook to manually apply style rules to the cell.\n */\nconst CustomBodyCell = <T extends RowData>({\n cell,\n}: {\n cell: Cell<T, unknown>;\n}) => {\n const ruleStyle = useDataGridCellStyle(cell);\n\n return (\n <div\n className=\"ndl-data-grid-td\"\n role=\"cell\"\n style={{\n ...ruleStyle,\n width: cell.column.getSize(),\n }}\n >\n {flexRender(cell.column.columnDef.cell, cell.getContext())}\n </div>\n );\n};\n\nconst Component = () => {\n const columnHelper = createColumnHelper<TestDataFormat>();\n\n const columns = [\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n header: () => 'Name',\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.renderValue(),\n header: () => 'Age',\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\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 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: 10,\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 styleRules={styleRules}\n components={{\n BodyCell: CustomBodyCell,\n }}\n styling={{\n borderStyle: 'all-sides',\n hasHoverEffects: true,\n hasZebraStriping: false,\n }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -0,0 +1,131 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ *
4
+ * Copyright (c) "Neo4j"
5
+ * Neo4j Sweden AB [http://neo4j.com]
6
+ *
7
+ * This file is part of Neo4j.
8
+ *
9
+ * Neo4j is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU General Public License as published by
11
+ * the Free Software Foundation, either version 3 of the License, or
12
+ * (at your option) any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU General Public License
20
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21
+ */
22
+ import '@neo4j-ndl/base/lib/neo4j-ds-styles.css';
23
+ import { DataGrid } from '@neo4j-ndl/react';
24
+ import { createColumnHelper, getCoreRowModel, getPaginationRowModel, getSortedRowModel, useReactTable, } from '@tanstack/react-table';
25
+ import { TABLE_DEMO_DATA } from './staticData';
26
+ const styleRules = [
27
+ // Row coloring: all cells styled when name contains "Alicia"
28
+ {
29
+ apply: {
30
+ color: { value: '#000000' },
31
+ textColor: { value: '#ffffff' },
32
+ },
33
+ column: null,
34
+ priority: 3,
35
+ where: { contains: [{ column: 'name' }, 'Alicia'] },
36
+ },
37
+ // Cell coloring: cells in the "age" column with value 51 get green
38
+ {
39
+ apply: { color: { value: '#00bb00' } },
40
+ column: 'age',
41
+ priority: 3,
42
+ where: { equal: [{ column: 'age' }, 51] },
43
+ },
44
+ // Dual color ranges on the "age" column: independent gradients for background
45
+ // (driven by age, full 0-100 range) and text color (driven by age too, but
46
+ // with a narrower 20-80 band so the text contrast is calibrated separately).
47
+ {
48
+ apply: {
49
+ colorRange: {
50
+ maxColor: '#f00000',
51
+ maxValue: 100,
52
+ midColor: '#a00000',
53
+ midValue: 50,
54
+ minColor: '#800000',
55
+ minValue: 0,
56
+ onColumn: 'age',
57
+ },
58
+ textColorRange: {
59
+ maxColor: '#aaaaaa',
60
+ maxValue: 80,
61
+ minColor: '#ffffff',
62
+ minValue: 20,
63
+ onColumn: 'age',
64
+ },
65
+ },
66
+ column: 'age',
67
+ priority: 2, // Lower priority so explicit green rule overrides
68
+ },
69
+ // Multi-column rule: all cells styled when age > 50 AND name contains "o"
70
+ {
71
+ apply: {
72
+ color: { value: '#fef3c7' },
73
+ textColor: { value: '#000000' },
74
+ },
75
+ column: null,
76
+ priority: 0, // Lower priority so other rules take precedence
77
+ where: {
78
+ and: [
79
+ { greaterThan: [{ column: 'age' }, 50] },
80
+ { contains: [{ column: 'name' }, 'o'] },
81
+ ],
82
+ },
83
+ },
84
+ ];
85
+ const Component = () => {
86
+ const columnHelper = createColumnHelper();
87
+ const columns = [
88
+ columnHelper.accessor('name', {
89
+ cell: (info) => info.getValue(),
90
+ header: () => 'Name',
91
+ minSize: 180,
92
+ size: 220,
93
+ }),
94
+ columnHelper.accessor('age', {
95
+ cell: (info) => info.renderValue(),
96
+ header: () => 'Age',
97
+ minSize: 80,
98
+ }),
99
+ columnHelper.accessor('cypherCommand', {
100
+ cell: (info) => info.getValue(),
101
+ header: () => 'Cypher Command',
102
+ minSize: 400,
103
+ size: 400,
104
+ }),
105
+ ];
106
+ const table = useReactTable({
107
+ columnResizeMode: 'onChange',
108
+ columns,
109
+ data: TABLE_DEMO_DATA,
110
+ defaultColumn: {
111
+ maxSize: 800,
112
+ minSize: 80,
113
+ },
114
+ enableSorting: true,
115
+ getCoreRowModel: getCoreRowModel(),
116
+ getPaginationRowModel: getPaginationRowModel(),
117
+ getSortedRowModel: getSortedRowModel(),
118
+ initialState: {
119
+ pagination: {
120
+ pageSize: 10,
121
+ },
122
+ },
123
+ });
124
+ return (_jsx("div", { className: "n-w-full n-bg-light-neutral-text-weakest", children: _jsx(DataGrid, { isResizable: false, tableInstance: table, isKeyboardNavigable: false, styleRules: styleRules, styling: {
125
+ borderStyle: 'all-sides',
126
+ hasHoverEffects: true,
127
+ hasZebraStriping: false,
128
+ } }) }));
129
+ };
130
+ export default Component;
131
+ //# sourceMappingURL=datagrid-rule-based-styling.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datagrid-rule-based-styling.story.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/datagrid-rule-based-styling.story.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAuB,MAAM,cAAc,CAAC;AAEpE,MAAM,UAAU,GAAwB;IACtC,6DAA6D;IAC7D;QACE,KAAK,EAAE;YACL,KAAK,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE;YAC3B,SAAS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,EAAE,EAAE;aACb;SACF;KACF,CAAC,CAAC;IAEH,OAAO,CACL,cAAK,SAAS,EAAC,0CAA0C,YACvD,KAAC,QAAQ,IACP,WAAW,EAAE,KAAK,EAClB,aAAa,EAAE,KAAK,EACpB,mBAAmB,EAAE,KAAK,EAC1B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE;gBACP,WAAW,EAAE,WAAW;gBACxB,eAAe,EAAE,IAAI;gBACrB,gBAAgB,EAAE,KAAK;aACxB,GACD,GACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { DataGrid } from '@neo4j-ndl/react';\nimport {\n createColumnHelper,\n getCoreRowModel,\n getPaginationRowModel,\n getSortedRowModel,\n useReactTable,\n} from '@tanstack/react-table';\n\nimport { type DataGridStyleRule } from '../style-rules/types';\nimport { TABLE_DEMO_DATA, type TestDataFormat } from './staticData';\n\nconst styleRules: DataGridStyleRule[] = [\n // Row coloring: all cells styled when name contains \"Alicia\"\n {\n apply: {\n color: { value: '#000000' },\n textColor: { value: '#ffffff' },\n },\n column: null,\n priority: 3,\n where: { contains: [{ column: 'name' }, 'Alicia'] },\n },\n // Cell coloring: cells in the \"age\" column with value 51 get green\n {\n apply: { color: { value: '#00bb00' } },\n column: 'age',\n priority: 3,\n where: { equal: [{ column: 'age' }, 51] },\n },\n // Dual color ranges on the \"age\" column: independent gradients for background\n // (driven by age, full 0-100 range) and text color (driven by age too, but\n // with a narrower 20-80 band so the text contrast is calibrated separately).\n {\n apply: {\n colorRange: {\n maxColor: '#f00000',\n maxValue: 100,\n midColor: '#a00000',\n midValue: 50,\n minColor: '#800000',\n minValue: 0,\n onColumn: 'age',\n },\n textColorRange: {\n maxColor: '#aaaaaa',\n maxValue: 80,\n minColor: '#ffffff',\n minValue: 20,\n onColumn: 'age',\n },\n },\n column: 'age',\n priority: 2, // Lower priority so explicit green rule overrides\n },\n // Multi-column rule: all cells styled when age > 50 AND name contains \"o\"\n {\n apply: {\n color: { value: '#fef3c7' },\n textColor: { value: '#000000' },\n },\n column: null,\n priority: 0, // Lower priority so other rules take precedence\n where: {\n and: [\n { greaterThan: [{ column: 'age' }, 50] },\n { contains: [{ column: 'name' }, 'o'] },\n ],\n },\n },\n];\n\nconst Component = () => {\n const columnHelper = createColumnHelper<TestDataFormat>();\n\n const columns = [\n columnHelper.accessor('name', {\n cell: (info) => info.getValue(),\n header: () => 'Name',\n minSize: 180,\n size: 220,\n }),\n columnHelper.accessor('age', {\n cell: (info) => info.renderValue(),\n header: () => 'Age',\n minSize: 80,\n }),\n columnHelper.accessor('cypherCommand', {\n cell: (info) => info.getValue(),\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 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: 10,\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 styleRules={styleRules}\n styling={{\n borderStyle: 'all-sides',\n hasHoverEffects: true,\n hasZebraStriping: false,\n }}\n />\n </div>\n );\n};\n\nexport default Component;\n"]}
@@ -36,10 +36,13 @@ export { PinnedBothSides as DataGridPinnedBothSides, PinnedLeftSide as DataGridP
36
36
  export { default as DataGridNoPaginationTable } from './datagrid-no-pagination-table.story';
37
37
  export { default as DataGridSingleSelectable } from './datagrid-single-selectable.story';
38
38
  export { default as DataGridUsingEditableCells } from './datagrid-using-editable-cells.story';
39
+ export { default as DataGridRuleBasedStyling } from './datagrid-rule-based-styling.story';
40
+ export { default as DataGridCustomCellWithStyleRules } from './datagrid-custom-cell-with-style-rules.story';
39
41
  import { removeLicenseHeader } from '../../_common/export-stories-utils';
40
42
  import DataGridColumnFilteringSourceRaw from './datagrid-column-filtering.story?raw';
41
43
  import DataGridCompactModeSourceRaw from './datagrid-compact-mode.story?raw';
42
44
  import DataGridComponentOverridingSourceRaw from './datagrid-component-overriding.story?raw';
45
+ import DataGridCustomCellWithStyleRulesSourceRaw from './datagrid-custom-cell-with-style-rules.story?raw';
43
46
  import DataGridInDialogSourceRaw from './datagrid-in-dialog.story?raw';
44
47
  import DataGridKeyboardNavigationSourceRaw from './datagrid-keyboard-navigation.story?raw';
45
48
  import DataGridKitchenSinkSourceRaw from './datagrid-kitchen-sink.story?raw';
@@ -48,6 +51,7 @@ import DataGridPercentageWidthColumnsSourceRaw from './datagrid-percentage-width
48
51
  import DataGridPinnedColumnsSourceRaw from './datagrid-pinned-columns.stories?raw';
49
52
  import DataGridPlaceholderStatesSourceRaw from './datagrid-placeholder-states.story?raw';
50
53
  import DataGridResizableColumnSourceRaw from './datagrid-resizable-column.story?raw';
54
+ import DataGridRuleBasedStylingSourceRaw from './datagrid-rule-based-styling.story?raw';
51
55
  import DataGridSearchableSourceRaw from './datagrid-search-and-filters.stories?raw';
52
56
  import DataGridSelectableSourceRaw from './datagrid-selectable.story?raw';
53
57
  import DataGridSimpleSourceRaw from './datagrid-simple.story?raw';
@@ -56,6 +60,8 @@ import DataGridSkeletonLoadingSourceRaw from './datagrid-skeleton-loading.story?
56
60
  import DataGridSortableSourceRaw from './datagrid-sortable.story?raw';
57
61
  import DataGridUsingEditableCellsSourceRaw from './datagrid-using-editable-cells.story?raw';
58
62
  import DataGridVirtualizationSourceRaw from './datagrid-virtualization.story?raw';
63
+ export const DataGridCustomCellWithStyleRulesSource = removeLicenseHeader(DataGridCustomCellWithStyleRulesSourceRaw);
64
+ export const DataGridRuleBasedStylingSource = removeLicenseHeader(DataGridRuleBasedStylingSourceRaw);
59
65
  export const DataGridSimpleSource = removeLicenseHeader(DataGridSimpleSourceRaw);
60
66
  export const DataGridCompactModeSource = removeLicenseHeader(DataGridCompactModeSourceRaw);
61
67
  export const DataGridSortableSource = removeLicenseHeader(DataGridSortableSourceRaw);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-grid/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EACL,UAAU,IAAI,kBAAkB,EAChC,eAAe,IAAI,uBAAuB,GAC3C,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAA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mB,CACjE,mCAAmC,CACpC,CAAC;AACF,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CACrE,uCAAuC,CACxC,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAC5D,8BAA8B,CAC/B,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAG,mBAAmB,CAChE,4BAA4B,CAC7B,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAAmB,CAC/D,iCAAiC,CAClC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CACjE,mCAAmC,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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xC,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG,mBAAmB,CAC5D,8BAA8B,CAC/B,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAG,mBAAmB,CAChE,4BAA4B,CAC7B,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAG,mBAAmB,CAC/D,iCAAiC,CAClC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CACjE,mCAAmC,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';\nexport { default as DataGridRuleBasedStyling } from './datagrid-rule-based-styling.story';\nexport { default as DataGridCustomCellWithStyleRules } from './datagrid-custom-cell-with-style-rules.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 DataGridCustomCellWithStyleRulesSourceRaw from './datagrid-custom-cell-with-style-rules.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 DataGridRuleBasedStylingSourceRaw from './datagrid-rule-based-styling.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 DataGridCustomCellWithStyleRulesSource = removeLicenseHeader(\n DataGridCustomCellWithStyleRulesSourceRaw,\n);\nexport const DataGridRuleBasedStylingSource = removeLicenseHeader(\n DataGridRuleBasedStylingSourceRaw,\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"]}