@redsift/dashboard 12.3.0 → 12.3.1-muiv6-alpha.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.
package/CONTRIBUTING.md CHANGED
@@ -48,7 +48,7 @@ The Design System is following a monorepo architecture, providing multiple packa
48
48
 
49
49
  - `@redsift/table`
50
50
 
51
- This package provides datagrid components and features based on [MUI DataGrid](https://mui.com/x/react-data-grid/). Due to the use of advanced features, a [premium license](https://mui.com/x/introduction/licensing/#premium-plan) from MUI is required.
51
+ This package provides datagrid components and features based on [MUI DataGrid](https://mui.com/x/react-data-grid/). The muiv6 and muiv7 branches use MUI DataGrid Pro; muiv8 (main) uses MUI DataGrid Premium. A [Pro or Premium license](https://mui.com/x/introduction/licensing/) from MUI is required.
52
52
 
53
53
  - `@redsift/charts`
54
54
 
@@ -1,7 +1,7 @@
1
1
  import { _ as _objectSpread2, a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef, useRef, useState, useReducer, useMemo } from 'react';
3
3
  import classNames from 'classnames';
4
- import { useGridApiRef } from '@mui/x-data-grid-premium';
4
+ import { useGridApiRef } from '@mui/x-data-grid-pro';
5
5
  import { D as DashboardContext } from './context.js';
6
6
  import { D as DashboardReducerActionType } from './types.js';
7
7
  import { C as CrossfilterRegistry } from './CrossfilterRegistry2.js';
@@ -1 +1 @@
1
- {"version":3,"file":"Dashboard2.js","sources":["../../src/components/Dashboard/reducer.ts","../../src/components/Dashboard/Dashboard.tsx"],"sourcesContent":["import { GridFilterItem } from '@redsift/table';\nimport { DashboardReducerState, DashboardReducerAction, DashboardReducerActionType } from './types';\n\nconst areEquals = (tableFilter: GridFilterItem, actionFilter: GridFilterItem) => {\n return tableFilter.field === actionFilter.field && tableFilter.operator === actionFilter.operator;\n};\n\nconst addOrUpdateFilter = (oldFilters: GridFilterItem[], newFilter: GridFilterItem) => {\n if (oldFilters.find((f) => areEquals(f, newFilter))) {\n return oldFilters.map((f) => {\n if (areEquals(f, newFilter)) {\n return newFilter;\n }\n return f;\n });\n } else {\n return [...oldFilters, newFilter];\n }\n};\n\nconst addOrUpdateFilters = (oldFilters: GridFilterItem[], newFilters: GridFilterItem[]) => {\n let updatedFilters = oldFilters;\n for (let i = 0; i < newFilters.length; i++) {\n updatedFilters = addOrUpdateFilter(updatedFilters, newFilters[i]);\n }\n return updatedFilters;\n};\n\nconst replaceFilters = (newFilters: GridFilterItem | GridFilterItem[]) => {\n return Array.isArray(newFilters) ? newFilters : [newFilters];\n};\n\nconst removeFilter = (oldFilters: GridFilterItem[], newFilter: GridFilterItem) => {\n return oldFilters.filter((f) => !areEquals(f, newFilter));\n};\n\nconst removeAllFilters = () => {\n return [] as GridFilterItem[];\n};\n\nexport const DashboardReducer = (\n state: DashboardReducerState,\n action: DashboardReducerAction\n): DashboardReducerState => {\n switch (action.type) {\n case DashboardReducerActionType.ResetFilter:\n return {\n ...state,\n tableFilters: removeFilter(state.tableFilters, action.filter as GridFilterItem),\n };\n case DashboardReducerActionType.ResetFilters:\n return { ...state, tableFilters: removeAllFilters() };\n case DashboardReducerActionType.FilterTable:\n return {\n ...state,\n tableFilters: addOrUpdateFilter(state.tableFilters, action.filter as GridFilterItem),\n };\n\n case DashboardReducerActionType.FilterTableBatch:\n return {\n ...state,\n tableFilters: replaceFilters(action.filter!),\n };\n\n case DashboardReducerActionType.AppendFilterTableBatch:\n return {\n ...state,\n tableFilters: addOrUpdateFilters(state.tableFilters, action.filter as GridFilterItem[]),\n };\n }\n};\n","import React, { forwardRef, RefObject, useMemo, useReducer, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { useGridApiRef } from '@mui/x-data-grid-premium';\n\nimport { Comp } from '@redsift/design-system';\nimport { DashboardContext } from './context';\nimport { DashboardContextProps, DashboardProps } from './types';\nimport { DashboardReducer } from './reducer';\nimport { CrossfilterRegistry } from '../CrossfilterRegistry';\n\nconst COMPONENT_NAME = 'Dashboard';\nconst CLASSNAME = 'redsift-dashboard-container';\n\n/**\n * Dashboard provides a context for connected, filterable visualizations.\n * Uses Crossfilter.js for high-performance multi-dimensional filtering.\n *\n * Wrap charts and DataGrids with `WithFilters` to enable cross-filtering.\n * When one chart is filtered, all connected charts update automatically.\n *\n * @example\n * // Basic dashboard with connected charts\n * <Dashboard data={rawData}>\n * <WithFilters dimension=\"category\">\n * <PieChart data={categoryData} />\n * </WithFilters>\n * <WithFilters dimension=\"date\">\n * <TimeSeriesBarChart data={timeData} />\n * </WithFilters>\n * <WithFilters>\n * <DataGrid columns={columns} rows={filteredRows} />\n * </WithFilters>\n * </Dashboard>\n *\n * @example\n * // Data format for crossfilter\n * const data = [\n * { id: 1, category: 'A', date: '2024-01-15', value: 100 },\n * { id: 2, category: 'B', date: '2024-01-16', value: 200 },\n * // Crossfilter will index all fields for fast filtering\n * ];\n * <Dashboard data={data}>...</Dashboard>\n *\n * @example\n * // With DataGrid API ref for programmatic control\n * const apiRef = useGridApiRef();\n * <Dashboard data={data} dataGridApiRef={apiRef}>\n * {...}\n * </Dashboard>\n * // Later: apiRef.current.setFilterModel(...)\n */\n\nexport const Dashboard: Comp<DashboardProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, data, dataGridApiRef: propsDataGridApiRef, ...forwardedProps } = props;\n\n const providerRef = ref || useRef<HTMLDivElement>();\n const dataGridApiRef = propsDataGridApiRef || useGridApiRef();\n const [updateContext, setUpdateContext] = useState(false);\n\n const [state, dispatch] = useReducer(DashboardReducer, {\n tableFilters: [],\n });\n\n const value = useMemo<DashboardContextProps>(\n () => ({\n dashboardRef: providerRef as RefObject<HTMLDivElement>,\n data,\n dataGridApiRef,\n dispatch,\n ndx: CrossfilterRegistry.get(data),\n state,\n toggleUpdateContext: () => setUpdateContext(!updateContext),\n }),\n [data, state, updateContext]\n );\n\n return (\n <div\n {...forwardedProps}\n className={classNames(Dashboard.className, className)}\n ref={providerRef as RefObject<HTMLDivElement>}\n >\n <DashboardContext.Provider value={value as DashboardContextProps}>{children}</DashboardContext.Provider>\n </div>\n );\n});\nDashboard.className = CLASSNAME;\nDashboard.displayName = COMPONENT_NAME;\n"],"names":["areEquals","tableFilter","actionFilter","field","operator","addOrUpdateFilter","oldFilters","newFilter","find","f","map","addOrUpdateFilters","newFilters","updatedFilters","i","length","replaceFilters","Array","isArray","removeFilter","filter","removeAllFilters","DashboardReducer","state","action","type","DashboardReducerActionType","ResetFilter","_objectSpread","tableFilters","ResetFilters","FilterTable","FilterTableBatch","AppendFilterTableBatch","COMPONENT_NAME","CLASSNAME","Dashboard","forwardRef","props","ref","children","className","data","dataGridApiRef","propsDataGridApiRef","forwardedProps","_objectWithoutProperties","_excluded","providerRef","useRef","useGridApiRef","updateContext","setUpdateContext","useState","dispatch","useReducer","value","useMemo","dashboardRef","ndx","CrossfilterRegistry","get","toggleUpdateContext","React","createElement","_extends","classNames","DashboardContext","Provider","displayName"],"mappings":";;;;;;;;AAGA,MAAMA,SAAS,GAAGA,CAACC,WAA2B,EAAEC,YAA4B,KAAK;AAC/E,EAAA,OAAOD,WAAW,CAACE,KAAK,KAAKD,YAAY,CAACC,KAAK,IAAIF,WAAW,CAACG,QAAQ,KAAKF,YAAY,CAACE,QAAQ,CAAA;AACnG,CAAC,CAAA;AAED,MAAMC,iBAAiB,GAAGA,CAACC,UAA4B,EAAEC,SAAyB,KAAK;AACrF,EAAA,IAAID,UAAU,CAACE,IAAI,CAAEC,CAAC,IAAKT,SAAS,CAACS,CAAC,EAAEF,SAAS,CAAC,CAAC,EAAE;AACnD,IAAA,OAAOD,UAAU,CAACI,GAAG,CAAED,CAAC,IAAK;AAC3B,MAAA,IAAIT,SAAS,CAACS,CAAC,EAAEF,SAAS,CAAC,EAAE;AAC3B,QAAA,OAAOA,SAAS,CAAA;AAClB,OAAA;AACA,MAAA,OAAOE,CAAC,CAAA;AACV,KAAC,CAAC,CAAA;AACJ,GAAC,MAAM;AACL,IAAA,OAAO,CAAC,GAAGH,UAAU,EAAEC,SAAS,CAA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GAAGnC,cAAc;;;;"}
1
+ {"version":3,"file":"Dashboard2.js","sources":["../../src/components/Dashboard/reducer.ts","../../src/components/Dashboard/Dashboard.tsx"],"sourcesContent":["import { GridFilterItem } from '@redsift/table';\nimport { DashboardReducerState, DashboardReducerAction, DashboardReducerActionType } from './types';\n\nconst areEquals = (tableFilter: GridFilterItem, actionFilter: GridFilterItem) => {\n return tableFilter.field === actionFilter.field && tableFilter.operator === actionFilter.operator;\n};\n\nconst addOrUpdateFilter = (oldFilters: GridFilterItem[], newFilter: GridFilterItem) => {\n if (oldFilters.find((f) => areEquals(f, newFilter))) {\n return oldFilters.map((f) => {\n if (areEquals(f, newFilter)) {\n return newFilter;\n }\n return f;\n });\n } else {\n return [...oldFilters, newFilter];\n }\n};\n\nconst addOrUpdateFilters = (oldFilters: GridFilterItem[], newFilters: GridFilterItem[]) => {\n let updatedFilters = oldFilters;\n for (let i = 0; i < newFilters.length; i++) {\n updatedFilters = addOrUpdateFilter(updatedFilters, newFilters[i]);\n }\n return updatedFilters;\n};\n\nconst replaceFilters = (newFilters: GridFilterItem | GridFilterItem[]) => {\n return Array.isArray(newFilters) ? newFilters : [newFilters];\n};\n\nconst removeFilter = (oldFilters: GridFilterItem[], newFilter: GridFilterItem) => {\n return oldFilters.filter((f) => !areEquals(f, newFilter));\n};\n\nconst removeAllFilters = () => {\n return [] as GridFilterItem[];\n};\n\nexport const DashboardReducer = (\n state: DashboardReducerState,\n action: DashboardReducerAction\n): DashboardReducerState => {\n switch (action.type) {\n case DashboardReducerActionType.ResetFilter:\n return {\n ...state,\n tableFilters: removeFilter(state.tableFilters, action.filter as GridFilterItem),\n };\n case DashboardReducerActionType.ResetFilters:\n return { ...state, tableFilters: removeAllFilters() };\n case DashboardReducerActionType.FilterTable:\n return {\n ...state,\n tableFilters: addOrUpdateFilter(state.tableFilters, action.filter as GridFilterItem),\n };\n\n case DashboardReducerActionType.FilterTableBatch:\n return {\n ...state,\n tableFilters: replaceFilters(action.filter!),\n };\n\n case DashboardReducerActionType.AppendFilterTableBatch:\n return {\n ...state,\n tableFilters: addOrUpdateFilters(state.tableFilters, action.filter as GridFilterItem[]),\n };\n }\n};\n","import React, { forwardRef, RefObject, useMemo, useReducer, useRef, useState } from 'react';\nimport classNames from 'classnames';\nimport { useGridApiRef } from '@mui/x-data-grid-pro';\n\nimport { Comp } from '@redsift/design-system';\nimport { DashboardContext } from './context';\nimport { DashboardContextProps, DashboardProps } from './types';\nimport { DashboardReducer } from './reducer';\nimport { CrossfilterRegistry } from '../CrossfilterRegistry';\n\nconst COMPONENT_NAME = 'Dashboard';\nconst CLASSNAME = 'redsift-dashboard-container';\n\n/**\n * Dashboard provides a context for connected, filterable visualizations.\n * Uses Crossfilter.js for high-performance multi-dimensional filtering.\n *\n * Wrap charts and DataGrids with `WithFilters` to enable cross-filtering.\n * When one chart is filtered, all connected charts update automatically.\n *\n * @example\n * // Basic dashboard with connected charts\n * <Dashboard data={rawData}>\n * <WithFilters dimension=\"category\">\n * <PieChart data={categoryData} />\n * </WithFilters>\n * <WithFilters dimension=\"date\">\n * <TimeSeriesBarChart data={timeData} />\n * </WithFilters>\n * <WithFilters>\n * <DataGrid columns={columns} rows={filteredRows} />\n * </WithFilters>\n * </Dashboard>\n *\n * @example\n * // Data format for crossfilter\n * const data = [\n * { id: 1, category: 'A', date: '2024-01-15', value: 100 },\n * { id: 2, category: 'B', date: '2024-01-16', value: 200 },\n * // Crossfilter will index all fields for fast filtering\n * ];\n * <Dashboard data={data}>...</Dashboard>\n *\n * @example\n * // With DataGrid API ref for programmatic control\n * const apiRef = useGridApiRef();\n * <Dashboard data={data} dataGridApiRef={apiRef}>\n * {...}\n * </Dashboard>\n * // Later: apiRef.current.setFilterModel(...)\n */\n\nexport const Dashboard: Comp<DashboardProps, HTMLDivElement> = forwardRef((props, ref) => {\n const { children, className, data, dataGridApiRef: propsDataGridApiRef, ...forwardedProps } = props;\n\n const providerRef = ref || useRef<HTMLDivElement>();\n const dataGridApiRef = propsDataGridApiRef || useGridApiRef();\n const [updateContext, setUpdateContext] = useState(false);\n\n const [state, dispatch] = useReducer(DashboardReducer, {\n tableFilters: [],\n });\n\n const value = useMemo<DashboardContextProps>(\n () => ({\n dashboardRef: providerRef as RefObject<HTMLDivElement>,\n data,\n dataGridApiRef,\n dispatch,\n ndx: CrossfilterRegistry.get(data),\n state,\n toggleUpdateContext: () => setUpdateContext(!updateContext),\n }),\n [data, state, updateContext]\n );\n\n return (\n <div\n {...forwardedProps}\n className={classNames(Dashboard.className, className)}\n ref={providerRef as RefObject<HTMLDivElement>}\n >\n <DashboardContext.Provider value={value as DashboardContextProps}>{children}</DashboardContext.Provider>\n </div>\n );\n});\nDashboard.className = CLASSNAME;\nDashboard.displayName = COMPONENT_NAME;\n"],"names":["areEquals","tableFilter","actionFilter","field","operator","addOrUpdateFilter","oldFilters","newFilter","find","f","map","addOrUpdateFilters","newFilters","updatedFilters","i","length","replaceFilters","Array","isArray","removeFilter","filter","removeAllFilters","DashboardReducer","state","action","type","DashboardReducerActionType","ResetFilter","_objectSpread","tableFilters","ResetFilters","FilterTable","FilterTableBatch","AppendFilterTableBatch","COMPONENT_NAME","CLASSNAME","Dashboard","forwardRef","props","ref","children","className","data","dataGridApiRef","propsDataGridApiRef","forwardedProps","_objectWithoutProperties","_excluded","providerRef","useRef","useGridApiRef","updateContext","setUpdateContext","useState","dispatch","useReducer","value","useMemo","dashboardRef","ndx","CrossfilterRegistry","get","toggleUpdateContext","React","createElement","_extends","classNames","DashboardContext","Provider","displayName"],"mappings":";;;;;;;;AAGA,MAAMA,SAAS,GAAGA,CAACC,WAA2B,EAAEC,YAA4B,KAAK;AAC/E,EAAA,OAAOD,WAAW,CAACE,KAAK,KAAKD,YAAY,CAACC,KAAK,IAAIF,WAAW,CAACG,QAAQ,KAAKF,YAAY,CAACE,QAAQ,CAAA;AACnG,CAAC,CAAA;AAED,MAAMC,iBAAiB,GAAGA,CAACC,UAA4B,EAAEC,SAAyB,KAAK;AACrF,EAAA,I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AAA,KACMpB,cAAc,EAAA;IAClBJ,SAAS,EAAEyB,UAAU,CAAC9B,SAAS,CAACK,SAAS,EAAEA,SAAS,CAAE;AACtDF,IAAAA,GAAG,EAAES,WAAAA;AAAyC,GAAA,CAAA,eAE9Ce,KAAA,CAAAC,aAAA,CAACG,gBAAgB,CAACC,QAAQ,EAAA;AAACZ,IAAAA,KAAK,EAAEA,KAAAA;GAAiChB,EAAAA,QAAoC,CACpG,CAAC,CAAA;AAEV,CAAC,EAAC;AACFJ,SAAS,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC/BC,SAAS,CAACiC,WAAW,GAAGnC,cAAc;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { a as _objectWithoutProperties, b as _extends } from './_rollupPluginBabelHelpers.js';
2
2
  import React, { forwardRef, useState, useContext, useEffect } from 'react';
3
- import { gridFilteredSortedRowEntriesSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector } from '@mui/x-data-grid-premium';
3
+ import { gridFilteredSortedRowEntriesSelector, gridVisibleColumnDefinitionsSelector, gridColumnsTotalWidthSelector } from '@mui/x-data-grid-pro';
4
4
  import classNames from 'classnames';
5
5
  import { saveAs } from 'file-saver';
6
6
  import { Font, StyleSheet, Document, Page, View, Image, Text, pdf } from '@react-pdf/renderer';
@@ -371,16 +371,16 @@ const PdfExportButton = /*#__PURE__*/forwardRef((props, ref) => {
371
371
  try {
372
372
  const dashboardImage = await getDashboardImage(componentRef || dashboardRef);
373
373
  let dataTable;
374
- if (dataGridApiRef !== null && dataGridApiRef !== void 0 && dataGridApiRef.current) {
374
+ if (dataGridApiRef && dataGridApiRef.current && Object.keys(dataGridApiRef.current).length) {
375
375
  dataTable = {
376
- data: gridFilteredSortedRowEntriesSelector(dataGridApiRef).slice(0, 1000).map(_ref => {
376
+ data: gridFilteredSortedRowEntriesSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId).slice(0, 1000).map(_ref => {
377
377
  let {
378
378
  model
379
379
  } = _ref;
380
380
  return model;
381
381
  }),
382
- columns: gridVisibleColumnDefinitionsSelector(dataGridApiRef),
383
- totalWidth: gridColumnsTotalWidthSelector(dataGridApiRef)
382
+ columns: gridVisibleColumnDefinitionsSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId),
383
+ totalWidth: gridColumnsTotalWidthSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId)
384
384
  };
385
385
  }
386
386
  const doc = /*#__PURE__*/React.createElement(PdfDocument, {
@@ -1 +1 @@
1
- {"version":3,"file":"PdfExportButton2.js","sources":["../../src/components/PdfExportButton/styles.ts","../../src/components/PdfExportButton/PdfDocument.tsx","../../src/components/PdfExportButton/PdfExportButton.tsx"],"sourcesContent":["// istanbul ignore file\n\nimport { Font, StyleSheet } from '@react-pdf/renderer';\nconst BACKGROUND_COLOR = '#F8F8F8';\nconst GREY_1 = '#E2E6EA';\nconst GREY_2 = '#bff0fd';\n\nexport const getPdfStyles = (primaryColor: string) => {\n Font.register({\n family: 'Source Code Pro',\n fonts: [\n {\n src: 'https://fonts.gstatic.com/s/sourcecodepro/v7/HI_SiYsKILxRpg3hIP6sJ7fM7PqlM-vT.ttf',\n },\n ],\n });\n\n Font.register({\n family: 'Roboto',\n fonts: [\n {\n fontWeight: 700,\n src: 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/fonts/roboto/Roboto-Regular.ttf',\n },\n {\n fontWeight: 400,\n src: 'https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-light-webfont.ttf',\n },\n ],\n });\n\n return StyleSheet.create({\n page: {\n borderTopStyle: 'solid',\n borderTopWidth: 32,\n borderTopColor: primaryColor,\n borderBottomStyle: 'solid',\n borderBottomWidth: 6,\n borderBottomColor: primaryColor,\n backgroundColor: BACKGROUND_COLOR,\n paddingTop: 20,\n paddingBottom: 40,\n },\n logoContainer: {\n margin: 0,\n paddingBottom: 10,\n alignItems: 'center',\n width: '100%',\n },\n logo: {\n width: 'auto',\n height: 30,\n },\n introductionContainer: {\n lineHeight: 1.4,\n textAlign: 'center',\n marginHorizontal: 40,\n marginVertical: 10,\n },\n introductionText: {\n fontSize: 8,\n fontFamily: 'Roboto',\n fontWeight: 400,\n color: 'black',\n },\n pageNumber: {\n fontFamily: 'Source Code Pro',\n position: 'absolute',\n fontSize: 6,\n bottom: 5,\n right: 20,\n left: 0,\n textAlign: 'right',\n color: 'black',\n },\n pageContinue: {\n fontSize: 8,\n fontFamily: 'Roboto',\n fontWeight: 400,\n top: -10,\n left: 20,\n },\n tableContainer: {\n backgroundColor: 'white',\n marginHorizontal: 20,\n marginVertical: 10,\n paddingTop: 10,\n paddingLeft: 10,\n borderRightWidth: 1,\n borderBottomWidth: 1,\n borderRightColor: BACKGROUND_COLOR,\n borderBottomColor: GREY_1,\n width: 'auto',\n },\n tableRowContainer: {\n flexDirection: 'row',\n borderBottomColor: GREY_2,\n alignItems: 'flex-start',\n fontSize: 8,\n marginLeft: 16,\n marginRight: 24,\n height: 'auto',\n },\n tableHeaderContainer: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n fontSize: 7,\n fontFamily: 'Roboto',\n fontWeight: 700,\n marginLeft: 16,\n marginRight: 24,\n marginBottom: 12,\n paddingTop: 12,\n paddingBottom: 12,\n borderBottomWidth: 2,\n borderBottomColor: primaryColor,\n },\n tableCellHeaderText: {\n fontSize: 7,\n fontFamily: 'Roboto',\n fontWeight: 700,\n color: 'black',\n overflow: 'hidden',\n },\n tableCellText: {\n fontSize: 6,\n lineHeight: 1.5,\n fontFamily: 'Roboto',\n fontWeight: 400,\n color: 'black',\n overflow: 'hidden',\n },\n dashboardImageContainer: {\n marginHorizontal: 20,\n marginTop: 0,\n marginBottom: 10,\n },\n constraintsContainer: {\n width: 'auto',\n height: 'auto',\n paddingVertical: 30,\n textAlign: 'center',\n },\n constraints: {\n fontSize: 6,\n fontFamily: 'Roboto',\n fontWeight: 700,\n color: 'black',\n },\n });\n};\n","// istanbul ignore file\n\nimport React from 'react';\nimport { Document, Image, Page, Text, View } from '@react-pdf/renderer';\nimport { GridValidRowModel } from '@mui/x-data-grid-premium';\nimport { PdfTableColumn, PdfTableRowProps, PdfTableProps, PdfDocumentProps, PdfStyles } from './types';\nimport { getPdfStyles } from './styles';\n\nconst DEFAULT_COLUMN_WIDTH = 100;\n\nconst getWidthColumn = (width: number, totalW: number, nrColumns: number) => {\n // calculation width column where the 7px margin between the columns is included\n return `${Math.round((width * 100) / (totalW - 7 * (nrColumns - 1)))}%`;\n};\n\nconst PdfTableRow = ({ rowIndex, rowData, columns, styles, totalWidth }: PdfTableRowProps) => {\n return (\n <View style={styles.tableRowContainer} key={`row-${rowIndex}`}>\n {columns.map((column: PdfTableColumn, index: number) => {\n const { field, width } = column;\n let totalW = totalWidth;\n let nrColumns = columns.length;\n\n // The checkbox in the table will not be printed\n if (field === '__check__') {\n totalW = totalW - (width || 50);\n nrColumns = nrColumns - 1;\n return;\n }\n const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);\n\n // Empty value will print '-'\n if (!rowData[field]) {\n return (\n <View\n style={{\n width: widthColumn,\n paddingVertical: 2,\n marginRight: 7,\n }}\n key={`cell-${rowIndex}-${index}`}\n >\n <Text style={styles.tableCellText}>{'-'}</Text>\n </View>\n );\n }\n return (\n <View\n style={{\n width: widthColumn,\n paddingVertical: 2,\n marginRight: 7,\n }}\n key={`cell-${rowIndex}-${index}`}\n >\n <Text style={styles.tableCellText}>\n {Array.isArray(rowData[field]) ? rowData[field].join(', ') : rowData[field]}\n </Text>\n </View>\n );\n })}\n </View>\n );\n};\n\nconst PdfTable = ({ dataTable, styles, localeText }: PdfTableProps) => {\n const { data, columns, totalWidth } = dataTable;\n\n return (\n <>\n <View style={styles.tableHeaderContainer}>\n {columns.map((column: PdfTableColumn) => {\n let totalW = totalWidth;\n let nrColumns = columns.length;\n const { field, headerName, width } = column;\n\n // The checkbox in the table will not be printed\n if (field === '__check__') {\n totalW = totalW - (width || 50);\n nrColumns = nrColumns - 1;\n return;\n }\n const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);\n\n return (\n <View\n style={{\n width: widthColumn,\n paddingVertical: 2,\n marginRight: 7,\n }}\n key={`heading-${field}`}\n >\n <Text style={styles.tableCellHeaderText}>{headerName}</Text>\n </View>\n );\n })}\n </View>\n <View>\n {data.map((row: GridValidRowModel, index: number) => {\n if (index < 1000) {\n return (\n <PdfTableRow\n key={index}\n rowIndex={index}\n rowData={data[index]}\n columns={columns}\n styles={styles}\n totalWidth={totalWidth}\n />\n );\n }\n })}\n </View>\n {data.length >= 1000 ? (\n <View style={styles.constraintsContainer}>\n <Text style={styles.constraints}>\n {localeText?.maxSizeDisclaimer ||\n 'Due to processing constraints this pdf is limited to the first 1000 rows of data.'}\n </Text>\n </View>\n ) : null}\n </>\n );\n};\n\nconst Pagination = ({ styles }: { styles: PdfStyles }) => {\n return (\n <Text style={styles.pageNumber} render={({ pageNumber, totalPages }) => `${pageNumber}/${totalPages}`} fixed />\n );\n};\n\nexport const PdfDocument = ({\n dashboardImage,\n introduction,\n localeText,\n logo,\n dataTable,\n primaryColor,\n}: PdfDocumentProps) => {\n const styles = getPdfStyles(primaryColor);\n\n return (\n <Document>\n <Page size=\"A4\" style={styles.page}>\n <>\n {logo ? (\n <View style={styles.logoContainer}>\n <Image src={logo} style={styles.logo} />\n </View>\n ) : null}\n {introduction ? (\n <View style={styles.introductionContainer}>\n <Text style={styles.introductionText}>{introduction}</Text>\n </View>\n ) : null}\n {dashboardImage ? (\n <View style={styles.dashboardImageContainer}>\n <Image src={dashboardImage as unknown as string} />\n </View>\n ) : null}\n {dataTable ? (\n <View style={styles.tableContainer}>\n <PdfTable dataTable={dataTable} styles={styles} localeText={localeText} />\n </View>\n ) : null}\n\n <Pagination styles={styles} />\n </>\n </Page>\n </Document>\n );\n};\n","// istanbul ignore file\n\nimport React, {\n forwardRef,\n JSXElementConstructor,\n ReactElement,\n RefObject,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport {\n gridFilteredSortedRowEntriesSelector,\n gridVisibleColumnDefinitionsSelector,\n gridColumnsTotalWidthSelector,\n} from '@mui/x-data-grid-premium';\nimport classNames from 'classnames';\nimport { saveAs } from 'file-saver';\nimport { pdf } from '@react-pdf/renderer';\nimport domToImage from 'dom-to-image';\n\nimport { Comp, Button, Spinner, RedsiftColorBlueD1 } from '@redsift/design-system';\n\nimport { PdfExportButtonProps } from './types';\nimport { PdfDocument } from './PdfDocument';\nimport { DashboardContext } from '../Dashboard';\n\nconst COMPONENT_NAME = 'PdfExportButton';\nconst CLASSNAME = 'redsift-pdf-export-button';\n\nconst getDashboardImage = async (componentRef: RefObject<HTMLElement>): Promise<string> => {\n const filter = (el: Node) => {\n const classList = (el as HTMLElement).classList;\n return !(classList?.contains('redsift-datagrid') || classList?.contains('redsift-button'));\n };\n\n const dashboardHeight = (componentRef.current as HTMLElement).getBoundingClientRect().height;\n const datagridHeight =\n (componentRef.current as HTMLElement)?.getElementsByClassName('redsift-datagrid')?.[0]?.getBoundingClientRect()\n ?.height || 0;\n\n return new Promise((resolve) => {\n domToImage\n .toPng(componentRef.current as HTMLElement, {\n filter,\n height: dashboardHeight - datagridHeight,\n })\n .then(function (dataUrl: string) {\n resolve(dataUrl);\n })\n .catch(() => {\n resolve('');\n });\n });\n};\n\nexport const PdfExportButton: Comp<PdfExportButtonProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const {\n children,\n className,\n componentRef: propComponentRef,\n fileName,\n introduction,\n localeText,\n logo,\n onClick,\n primaryColor,\n ...forwardedProps\n } = props;\n const [componentRef, setComponentRef] = useState(propComponentRef);\n const [isLoading, setIsLoading] = useState(false);\n\n const { dashboardRef, dataGridApiRef } = useContext(DashboardContext);\n\n useEffect(() => {\n if (!componentRef || !componentRef.current) {\n setComponentRef(dashboardRef);\n }\n }, [dashboardRef]);\n\n const exportPdf = async () => {\n if (onClick) {\n onClick();\n }\n setIsLoading(true);\n try {\n const dashboardImage = await getDashboardImage(componentRef || dashboardRef!);\n\n let dataTable;\n if (dataGridApiRef?.current) {\n dataTable = {\n data: gridFilteredSortedRowEntriesSelector(dataGridApiRef)\n .slice(0, 1000)\n .map(({ model }) => model),\n columns: gridVisibleColumnDefinitionsSelector(dataGridApiRef),\n totalWidth: gridColumnsTotalWidthSelector(dataGridApiRef),\n };\n }\n\n const doc = (\n <PdfDocument\n localeText={localeText}\n dashboardImage={dashboardImage}\n introduction={introduction}\n logo={logo}\n primaryColor={primaryColor || RedsiftColorBlueD1}\n dataTable={dataTable}\n />\n );\n const asPdf = pdf([] as unknown as ReactElement<any, string | JSXElementConstructor<any>>);\n asPdf.updateContainer(doc);\n const blob = await asPdf.toBlob();\n saveAs(blob, fileName || 'redsift-dashboard.pdf');\n } catch (e) {\n console.log('error:', e);\n }\n setIsLoading(false);\n };\n\n return (\n <Button\n className={classNames(PdfExportButton.className, className)}\n onClick={exportPdf}\n isDisabled={isLoading}\n {...forwardedProps}\n ref={ref as RefObject<HTMLButtonElement>}\n >\n {isLoading ? <Spinner size=\"xsmall\" isColored={false} /> : null} {children}\n </Button>\n );\n});\nPdfExportButton.className = CLASSNAME;\nPdfExportButton.displayName = COMPONENT_NAME;\n"],"names":["BACKGROUND_COLOR","GREY_1","GREY_2","getPdfStyles","primaryColor","Font","register","family","fonts","src","fontWeight","StyleSheet","create","page","borderTopStyle","borderTopWidth","borderTopColor","borderBottomStyle","borderBottomWidth","borderBottomColor","backgroundColor","paddingTop","paddingBottom","logoContainer","margin","alignItems","width","logo","height","introductionContainer","lineHeight","textAlign","marginHorizontal","marginVertical","introductionText","fontSize","fontFamily","color","pageNumber","position","bottom","right","left","pageContinue","top","tableContainer","paddingLeft","borderRightWidth","borderRightColor","tableRowContainer","flexDirection","marginLeft","marginRight","tableHeaderContainer","marginBottom","tableCellHeaderText","overflow","tableCellText","dashboardImageContainer","marginTop","constraintsContainer","paddingVertical","constraints","DEFAULT_COLUMN_WIDTH","getWidthColumn","totalW","nrColumns","Math","round","PdfTableRow","_ref","rowIndex","rowData","columns","styles","totalWidth","React","createElement","View","style","key","map","column","index","field","length","widthColumn","Text","Array","isArray","join","PdfTable","_ref2","dataTable","localeText","data","Fragment","headerName","row","maxSizeDisclaimer","Pagination","_ref3","render","_ref4","totalPages","fixed","PdfDocument","_ref5","dashboardImage","introduction","Document","Page","size","Image","COMPONENT_NAME","CLASSNAME","getDashboardImage","componentRef","_componentRef$current","_componentRef$current2","_componentRef$current3","_componentRef$current4","filter","el","classList","contains","dashboardHeight","current","getBoundingClientRect","datagridHeight","getElementsByClassName","Promise","resolve","domToImage","toPng","then","dataUrl","catch","PdfExportButton","forwardRef","props","ref","children","className","propComponentRef","fileName","onClick","forwardedProps","_objectWithoutProperties","_excluded","setComponentRef","useState","isLoading","setIsLoading","dashboardRef","dataGridApiRef","useContext","DashboardContext","useEffect","exportPdf","gridFilteredSortedRowEntriesSelector","slice","model","gridVisibleColumnDefinitionsSelector","gridColumnsTotalWidthSelector","doc","RedsiftColorBlueD1","asPdf","pdf","updateContainer","blob","toBlob","saveAs","e","console","log","Button","_extends","classNames","isDisabled","Spinner","isColored","displayName"],"mappings":";;;;;;;;;;AAAA;AAGA,MAAMA,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAMC,MAAM,GAAG,SAAS,CAAA;AACxB,MAAMC,MAAM,GAAG,SAAS,CAAA;AAEjB,MAAMC,YAAY,GAAIC,YAAoB,IAAK;EACpDC,IAAI,CAACC,QAAQ,CAAC;AACZC,IAAAA,MAAM,EAAE,iBAAiB;AACzBC,IAAAA,KAAK,EAAE,CACL;AACEC,MAAAA,GAAG,EAAE,mFAAA;KACN,CAAA;AAEL,GAAC,CAAC,CAAA;EAEFJ,IAAI,CAACC,QAAQ,CAAC;AACZC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,KAAK,EAAE,CACL;AACEE,MAAAA,UAAU,EAAE,GAAG;AACfD,MAAAA,GAAG,EAAE,2FAAA;AACP,KAAC,EACD;A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GC,GAAG,CAAC,EAAuE,CAAC,CAAA;AAC1FD,MAAAA,KAAK,CAACE,eAAe,CAACJ,GAAG,CAAC,CAAA;AAC1B,MAAA,MAAMK,IAAI,GAAG,MAAMH,KAAK,CAACI,MAAM,EAAE,CAAA;AACjCC,MAAAA,MAAM,CAACF,IAAI,EAAEzB,QAAQ,IAAI,uBAAuB,CAAC,CAAA;KAClD,CAAC,OAAO4B,CAAC,EAAE;AACVC,MAAAA,OAAO,CAACC,GAAG,CAAC,QAAQ,EAAEF,CAAC,CAAC,CAAA;AAC1B,KAAA;IACApB,YAAY,CAAC,KAAK,CAAC,CAAA;GACpB,CAAA;AAED,EAAA,oBACE7E,KAAA,CAAAC,aAAA,CAACmG,MAAM,EAAAC,QAAA,CAAA;IACLlC,SAAS,EAAEmC,UAAU,CAACxC,eAAe,CAACK,SAAS,EAAEA,SAAS,CAAE;AAC5DG,IAAAA,OAAO,EAAEa,SAAU;AACnBoB,IAAAA,UAAU,EAAE3B,SAAAA;AAAU,GAAA,EAClBL,cAAc,EAAA;AAClBN,IAAAA,GAAG,EAAEA,GAAAA;AAAoC,GAAA,CAAA,EAExCW,SAAS,gBAAG5E,KAAA,CAAAC,aAAA,CAACuG,OAAO,EAAA;AAACpE,IAAAA,IAAI,EAAC,QAAQ;AAACqE,IAAAA,SAAS,EAAE,KAAA;AAAM,GAAE,CAAC,GAAG,IAAI,EAAC,GAAC,EAACvC,QAC5D,CAAC,CAAA;AAEb,CAAC,EAAC;AACFJ,eAAe,CAACK,SAAS,GAAG5B,SAAS,CAAA;AACrCuB,eAAe,CAAC4C,WAAW,GAAGpE,cAAc;;;;"}
1
+ {"version":3,"file":"PdfExportButton2.js","sources":["../../src/components/PdfExportButton/styles.ts","../../src/components/PdfExportButton/PdfDocument.tsx","../../src/components/PdfExportButton/PdfExportButton.tsx"],"sourcesContent":["// istanbul ignore file\n\nimport { Font, StyleSheet } from '@react-pdf/renderer';\nconst BACKGROUND_COLOR = '#F8F8F8';\nconst GREY_1 = '#E2E6EA';\nconst GREY_2 = '#bff0fd';\n\nexport const getPdfStyles = (primaryColor: string) => {\n Font.register({\n family: 'Source Code Pro',\n fonts: [\n {\n src: 'https://fonts.gstatic.com/s/sourcecodepro/v7/HI_SiYsKILxRpg3hIP6sJ7fM7PqlM-vT.ttf',\n },\n ],\n });\n\n Font.register({\n family: 'Roboto',\n fonts: [\n {\n fontWeight: 700,\n src: 'https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/fonts/roboto/Roboto-Regular.ttf',\n },\n {\n fontWeight: 400,\n src: 'https://cdnjs.cloudflare.com/ajax/libs/ink/3.1.10/fonts/Roboto/roboto-light-webfont.ttf',\n },\n ],\n });\n\n return StyleSheet.create({\n page: {\n borderTopStyle: 'solid',\n borderTopWidth: 32,\n borderTopColor: primaryColor,\n borderBottomStyle: 'solid',\n borderBottomWidth: 6,\n borderBottomColor: primaryColor,\n backgroundColor: BACKGROUND_COLOR,\n paddingTop: 20,\n paddingBottom: 40,\n },\n logoContainer: {\n margin: 0,\n paddingBottom: 10,\n alignItems: 'center',\n width: '100%',\n },\n logo: {\n width: 'auto',\n height: 30,\n },\n introductionContainer: {\n lineHeight: 1.4,\n textAlign: 'center',\n marginHorizontal: 40,\n marginVertical: 10,\n },\n introductionText: {\n fontSize: 8,\n fontFamily: 'Roboto',\n fontWeight: 400,\n color: 'black',\n },\n pageNumber: {\n fontFamily: 'Source Code Pro',\n position: 'absolute',\n fontSize: 6,\n bottom: 5,\n right: 20,\n left: 0,\n textAlign: 'right',\n color: 'black',\n },\n pageContinue: {\n fontSize: 8,\n fontFamily: 'Roboto',\n fontWeight: 400,\n top: -10,\n left: 20,\n },\n tableContainer: {\n backgroundColor: 'white',\n marginHorizontal: 20,\n marginVertical: 10,\n paddingTop: 10,\n paddingLeft: 10,\n borderRightWidth: 1,\n borderBottomWidth: 1,\n borderRightColor: BACKGROUND_COLOR,\n borderBottomColor: GREY_1,\n width: 'auto',\n },\n tableRowContainer: {\n flexDirection: 'row',\n borderBottomColor: GREY_2,\n alignItems: 'flex-start',\n fontSize: 8,\n marginLeft: 16,\n marginRight: 24,\n height: 'auto',\n },\n tableHeaderContainer: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n fontSize: 7,\n fontFamily: 'Roboto',\n fontWeight: 700,\n marginLeft: 16,\n marginRight: 24,\n marginBottom: 12,\n paddingTop: 12,\n paddingBottom: 12,\n borderBottomWidth: 2,\n borderBottomColor: primaryColor,\n },\n tableCellHeaderText: {\n fontSize: 7,\n fontFamily: 'Roboto',\n fontWeight: 700,\n color: 'black',\n overflow: 'hidden',\n },\n tableCellText: {\n fontSize: 6,\n lineHeight: 1.5,\n fontFamily: 'Roboto',\n fontWeight: 400,\n color: 'black',\n overflow: 'hidden',\n },\n dashboardImageContainer: {\n marginHorizontal: 20,\n marginTop: 0,\n marginBottom: 10,\n },\n constraintsContainer: {\n width: 'auto',\n height: 'auto',\n paddingVertical: 30,\n textAlign: 'center',\n },\n constraints: {\n fontSize: 6,\n fontFamily: 'Roboto',\n fontWeight: 700,\n color: 'black',\n },\n });\n};\n","// istanbul ignore file\n\nimport React from 'react';\nimport { Document, Image, Page, Text, View } from '@react-pdf/renderer';\nimport { GridValidRowModel } from '@mui/x-data-grid-pro';\nimport { PdfTableColumn, PdfTableRowProps, PdfTableProps, PdfDocumentProps, PdfStyles } from './types';\nimport { getPdfStyles } from './styles';\n\nconst DEFAULT_COLUMN_WIDTH = 100;\n\nconst getWidthColumn = (width: number, totalW: number, nrColumns: number) => {\n // calculation width column where the 7px margin between the columns is included\n return `${Math.round((width * 100) / (totalW - 7 * (nrColumns - 1)))}%`;\n};\n\nconst PdfTableRow = ({ rowIndex, rowData, columns, styles, totalWidth }: PdfTableRowProps) => {\n return (\n <View style={styles.tableRowContainer} key={`row-${rowIndex}`}>\n {columns.map((column: PdfTableColumn, index: number) => {\n const { field, width } = column;\n let totalW = totalWidth;\n let nrColumns = columns.length;\n\n // The checkbox in the table will not be printed\n if (field === '__check__') {\n totalW = totalW - (width || 50);\n nrColumns = nrColumns - 1;\n return;\n }\n const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);\n\n // Empty value will print '-'\n if (!rowData[field]) {\n return (\n <View\n style={{\n width: widthColumn,\n paddingVertical: 2,\n marginRight: 7,\n }}\n key={`cell-${rowIndex}-${index}`}\n >\n <Text style={styles.tableCellText}>{'-'}</Text>\n </View>\n );\n }\n return (\n <View\n style={{\n width: widthColumn,\n paddingVertical: 2,\n marginRight: 7,\n }}\n key={`cell-${rowIndex}-${index}`}\n >\n <Text style={styles.tableCellText}>\n {Array.isArray(rowData[field]) ? rowData[field].join(', ') : rowData[field]}\n </Text>\n </View>\n );\n })}\n </View>\n );\n};\n\nconst PdfTable = ({ dataTable, styles, localeText }: PdfTableProps) => {\n const { data, columns, totalWidth } = dataTable;\n\n return (\n <>\n <View style={styles.tableHeaderContainer}>\n {columns.map((column: PdfTableColumn) => {\n let totalW = totalWidth;\n let nrColumns = columns.length;\n const { field, headerName, width } = column;\n\n // The checkbox in the table will not be printed\n if (field === '__check__') {\n totalW = totalW - (width || 50);\n nrColumns = nrColumns - 1;\n return;\n }\n const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);\n\n return (\n <View\n style={{\n width: widthColumn,\n paddingVertical: 2,\n marginRight: 7,\n }}\n key={`heading-${field}`}\n >\n <Text style={styles.tableCellHeaderText}>{headerName}</Text>\n </View>\n );\n })}\n </View>\n <View>\n {data.map((row: GridValidRowModel, index: number) => {\n if (index < 1000) {\n return (\n <PdfTableRow\n key={index}\n rowIndex={index}\n rowData={data[index]}\n columns={columns}\n styles={styles}\n totalWidth={totalWidth}\n />\n );\n }\n })}\n </View>\n {data.length >= 1000 ? (\n <View style={styles.constraintsContainer}>\n <Text style={styles.constraints}>\n {localeText?.maxSizeDisclaimer ||\n 'Due to processing constraints this pdf is limited to the first 1000 rows of data.'}\n </Text>\n </View>\n ) : null}\n </>\n );\n};\n\nconst Pagination = ({ styles }: { styles: PdfStyles }) => {\n return (\n <Text style={styles.pageNumber} render={({ pageNumber, totalPages }) => `${pageNumber}/${totalPages}`} fixed />\n );\n};\n\nexport const PdfDocument = ({\n dashboardImage,\n introduction,\n localeText,\n logo,\n dataTable,\n primaryColor,\n}: PdfDocumentProps) => {\n const styles = getPdfStyles(primaryColor);\n\n return (\n <Document>\n <Page size=\"A4\" style={styles.page}>\n <>\n {logo ? (\n <View style={styles.logoContainer}>\n <Image src={logo} style={styles.logo} />\n </View>\n ) : null}\n {introduction ? (\n <View style={styles.introductionContainer}>\n <Text style={styles.introductionText}>{introduction}</Text>\n </View>\n ) : null}\n {dashboardImage ? (\n <View style={styles.dashboardImageContainer}>\n <Image src={dashboardImage as unknown as string} />\n </View>\n ) : null}\n {dataTable ? (\n <View style={styles.tableContainer}>\n <PdfTable dataTable={dataTable} styles={styles} localeText={localeText} />\n </View>\n ) : null}\n\n <Pagination styles={styles} />\n </>\n </Page>\n </Document>\n );\n};\n","// istanbul ignore file\n\nimport React, {\n forwardRef,\n JSXElementConstructor,\n ReactElement,\n RefObject,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport {\n gridFilteredSortedRowEntriesSelector,\n gridVisibleColumnDefinitionsSelector,\n gridColumnsTotalWidthSelector,\n} from '@mui/x-data-grid-pro';\nimport classNames from 'classnames';\nimport { saveAs } from 'file-saver';\nimport { pdf } from '@react-pdf/renderer';\nimport domToImage from 'dom-to-image';\n\nimport { Comp, Button, Spinner, RedsiftColorBlueD1 } from '@redsift/design-system';\n\nimport { PdfExportButtonProps } from './types';\nimport { PdfDocument } from './PdfDocument';\nimport { DashboardContext } from '../Dashboard';\n\nconst COMPONENT_NAME = 'PdfExportButton';\nconst CLASSNAME = 'redsift-pdf-export-button';\n\nconst getDashboardImage = async (componentRef: RefObject<HTMLElement>): Promise<string> => {\n const filter = (el: Node) => {\n const classList = (el as HTMLElement).classList;\n return !(classList?.contains('redsift-datagrid') || classList?.contains('redsift-button'));\n };\n\n const dashboardHeight = (componentRef.current as HTMLElement).getBoundingClientRect().height;\n const datagridHeight =\n (componentRef.current as HTMLElement)?.getElementsByClassName('redsift-datagrid')?.[0]?.getBoundingClientRect()\n ?.height || 0;\n\n return new Promise((resolve) => {\n domToImage\n .toPng(componentRef.current as HTMLElement, {\n filter,\n height: dashboardHeight - datagridHeight,\n })\n .then(function (dataUrl: string) {\n resolve(dataUrl);\n })\n .catch(() => {\n resolve('');\n });\n });\n};\n\nexport const PdfExportButton: Comp<PdfExportButtonProps, HTMLButtonElement> = forwardRef((props, ref) => {\n const {\n children,\n className,\n componentRef: propComponentRef,\n fileName,\n introduction,\n localeText,\n logo,\n onClick,\n primaryColor,\n ...forwardedProps\n } = props;\n const [componentRef, setComponentRef] = useState(propComponentRef);\n const [isLoading, setIsLoading] = useState(false);\n\n const { dashboardRef, dataGridApiRef } = useContext(DashboardContext);\n\n useEffect(() => {\n if (!componentRef || !componentRef.current) {\n setComponentRef(dashboardRef);\n }\n }, [dashboardRef]);\n\n const exportPdf = async () => {\n if (onClick) {\n onClick();\n }\n setIsLoading(true);\n try {\n const dashboardImage = await getDashboardImage(componentRef || dashboardRef!);\n\n let dataTable;\n if (dataGridApiRef && dataGridApiRef.current && Object.keys(dataGridApiRef.current).length) {\n dataTable = {\n data: gridFilteredSortedRowEntriesSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId)\n .slice(0, 1000)\n .map(({ model }) => model),\n columns: gridVisibleColumnDefinitionsSelector(\n dataGridApiRef.current.state,\n dataGridApiRef.current.instanceId\n ),\n totalWidth: gridColumnsTotalWidthSelector(dataGridApiRef.current.state, dataGridApiRef.current.instanceId),\n };\n }\n\n const doc = (\n <PdfDocument\n localeText={localeText}\n dashboardImage={dashboardImage}\n introduction={introduction}\n logo={logo}\n primaryColor={primaryColor || RedsiftColorBlueD1}\n dataTable={dataTable}\n />\n );\n const asPdf = pdf([] as unknown as ReactElement<any, string | JSXElementConstructor<any>>);\n asPdf.updateContainer(doc);\n const blob = await asPdf.toBlob();\n saveAs(blob, fileName || 'redsift-dashboard.pdf');\n } catch (e) {\n console.log('error:', e);\n }\n setIsLoading(false);\n };\n\n return (\n <Button\n className={classNames(PdfExportButton.className, className)}\n onClick={exportPdf}\n isDisabled={isLoading}\n {...forwardedProps}\n ref={ref as RefObject<HTMLButtonElement>}\n >\n {isLoading ? <Spinner size=\"xsmall\" isColored={false} /> : null} {children}\n </Button>\n );\n});\nPdfExportButton.className = CLASSNAME;\nPdfExportButton.displayName = COMPONENT_NAME;\n"],"names":["BACKGROUND_COLOR","GREY_1","GREY_2","getPdfStyles","primaryColor","Font","register","family","fonts","src","fontWeight","StyleSheet","create","page","borderTopStyle","borderTopWidth","borderTopColor","borderBottomStyle","borderBottomWidth","borderBottomColor","backgroundColor","paddingTop","paddingBottom","logoContainer","margin","alignItems","width","logo","height","introductionContainer","lineHeight","textAlign","marginHorizontal","marginVertical","introductionText","fontSize","fontFamily","color","pageNumber","position","bottom","right","left","pageContinue","top","tableContainer","paddingLeft","borderRightWidth","borderRightColor","tableRowContainer","flexDirection","marginLeft","marginRight","tableHeaderContainer","marginBottom","tableCellHeaderText","overflow","tableCellText","dashboardImageContainer","marginTop","constraintsContainer","paddingVertical","constraints","DEFAULT_COLUMN_WIDTH","getWidthColumn","totalW","nrColumns","Math","round","PdfTableRow","_ref","rowIndex","rowData","columns","styles","totalWidth","React","createElement","View","style","key","map","column","index","field","length","widthColumn","Text","Array","isArray","join","PdfTable","_ref2","dataTable","localeText","data","Fragment","headerName","row","maxSizeDisclaimer","Pagination","_ref3","render","_ref4","totalPages","fixed","PdfDocument","_ref5","dashboardImage","introduction","Document","Page","size","Image","COMPONENT_NAME","CLASSNAME","getDashboardImage","componentRef","_componentRef$current","_componentRef$current2","_componentRef$current3","_componentRef$current4","filter","el","classList","contains","dashboardHeight","current","getBoundingClientRect","datagridHeight","getElementsByClassName","Promise","resolve","domToImage","toPng","then","dataUrl","catch","PdfExportButton","forwardRef","props","ref","children","className","propComponentRef","fileName","onClick","forwardedProps","_objectWithoutProperties","_excluded","setComponentRef","useState","isLoading","setIsLoading","dashboardRef","dataGridApiRef","useContext","DashboardContext","useEffect","exportPdf","Object","keys","gridFilteredSortedRowEntriesSelector","state","instanceId","slice","model","gridVisibleColumnDefinitionsSelector","gridColumnsTotalWidthSelector","doc","RedsiftColorBlueD1","asPdf","pdf","updateContainer","blob","toBlob","saveAs","e","console","log","Button","_extends","classNames","isDisabled","Spinner","isColored","displayName"],"mappings":";;;;;;;;;;AAAA;AAGA,MAAMA,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAMC,MAAM,GAAG,SAAS,CAAA;AACxB,MAAMC,MAAM,GAAG,SAAS,CAAA;AAEjB,MAAMC,YAAY,GAAIC,YAAoB,IAAK;EACpDC,IAAI,CAACC,QAAQ,CAAC;AACZC,IAAAA,MAAM,EAAE,iBAAiB;AACzBC,IAAAA,KAAK,EAAE,CACL;AACEC,MAAAA,GAAG,EAAE,mFAAA;KACN,CAAA;AAEL,GAAC,CAAC,CAAA;EAEFJ,IAAI,CAACC,QAAQ,CAAC;AACZC,IAAAA,MAAM,EAAE,QAAQ;AAChBC,IAAAA,KAAK,EAAE,CACL;AACEE,MAAAA,UAAU,EAAE,GAAG;AACfD,MAAAA,GAAG,EAAE,2FAAA;AACP,KAAC,EACD;AACEC,MAAAA,UAAU,EAAE,GAAG;AACfD,MAAAA,GAAG,EAAE,yFAAA;KACN,CAAA;AAEL,GAAC,CAAC,CAAA;EAEF,OAAOE,UAAU,CAACC,MAAM,CAAC;AACvBC,IAAAA,IAAI,EAAE;AACJC,MAAAA,cAAc,EAAE,OAAO;AACvBC,MAAAA,cAAc,EAAE,EAAE;AAClBC,MAAAA,cAAc,EAAEZ,YAAY;AAC5Ba,MAAAA,iBAAiB,EAAE,OAAO;AAC1BC,MAAAA,iBAAiB,EAAE,CAAC;AACpBC,MAAAA,iBAAiB,EAAEf,YAAY;AAC/BgB,MAAAA,eAAe,EAAEpB,g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M,EAAE,CAAA;AACjCC,MAAAA,MAAM,CAACF,IAAI,EAAE7B,QAAQ,IAAI,uBAAuB,CAAC,CAAA;KAClD,CAAC,OAAOgC,CAAC,EAAE;AACVC,MAAAA,OAAO,CAACC,GAAG,CAAC,QAAQ,EAAEF,CAAC,CAAC,CAAA;AAC1B,KAAA;IACAxB,YAAY,CAAC,KAAK,CAAC,CAAA;GACpB,CAAA;AAED,EAAA,oBACE7E,KAAA,CAAAC,aAAA,CAACuG,MAAM,EAAAC,QAAA,CAAA;IACLtC,SAAS,EAAEuC,UAAU,CAAC5C,eAAe,CAACK,SAAS,EAAEA,SAAS,CAAE;AAC5DG,IAAAA,OAAO,EAAEa,SAAU;AACnBwB,IAAAA,UAAU,EAAE/B,SAAAA;AAAU,GAAA,EAClBL,cAAc,EAAA;AAClBN,IAAAA,GAAG,EAAEA,GAAAA;AAAoC,GAAA,CAAA,EAExCW,SAAS,gBAAG5E,KAAA,CAAAC,aAAA,CAAC2G,OAAO,EAAA;AAACxE,IAAAA,IAAI,EAAC,QAAQ;AAACyE,IAAAA,SAAS,EAAE,KAAA;AAAM,GAAE,CAAC,GAAG,IAAI,EAAC,GAAC,EAAC3C,QAC5D,CAAC,CAAA;AAEb,CAAC,EAAC;AACFJ,eAAe,CAACK,SAAS,GAAG5B,SAAS,CAAA;AACrCuB,eAAe,CAACgD,WAAW,GAAGxE,cAAc;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../src/components/Dashboard/types.ts"],"sourcesContent":["import { ComponentProps, Dispatch, MutableRefObject, RefObject } from 'react';\nimport { GridFilterItem } from '@redsift/table';\nimport { GridApi } from '@mui/x-data-grid-premium';\n\nimport { JSONArray } from '../../types';\n\n/**\n * Context props.\n */\nexport type DashboardContextProps = {\n dashboardRef?: RefObject<HTMLDivElement>;\n data: JSONArray;\n // MUI v8: GridApi can be null initially\n dataGridApiRef?: MutableRefObject<GridApi | null>;\n dispatch: Dispatch<DashboardReducerAction>;\n state: DashboardReducerState;\n toggleUpdateContext?: () => void;\n};\n\n/**\n * Reducer props.\n */\nexport type DashboardReducerState = {\n tableFilters: GridFilterItem[];\n};\n\nexport enum DashboardReducerActionType {\n ResetFilter = 'reset-filter',\n ResetFilters = 'reset-filters',\n FilterTable = 'filter-table',\n FilterTableBatch = 'filter-table-batch',\n AppendFilterTableBatch = 'append-filter-table-batch',\n}\n\nexport type DashboardReducerAction = {\n type: DashboardReducerActionType;\n filter?: GridFilterItem | GridFilterItem[];\n};\n\n/**\n * Component props.\n */\nexport interface DashboardProps extends ComponentProps<'div'> {\n /** Dataset that will be share across every components within the dashboard. */\n data: JSONArray;\n /** Datagrid API Ref. MUI v8: can be null initially. */\n dataGridApiRef?: MutableRefObject<GridApi | null>;\n}\n"],"names":["DashboardReducerActionType"],"mappings":"AAMA;AACA;AACA;;AAWA;AACA;AACA;;AAKYA,IAAAA,0BAA0B,0BAA1BA,0BAA0B,EAAA;EAA1BA,0BAA0B,CAAA,aAAA,CAAA,GAAA,cAAA,CAAA;EAA1BA,0BAA0B,CAAA,cAAA,CAAA,GAAA,eAAA,CAAA;EAA1BA,0BAA0B,CAAA,aAAA,CAAA,GAAA,cAAA,CAAA;EAA1BA,0BAA0B,CAAA,kBAAA,CAAA,GAAA,oBAAA,CAAA;EAA1BA,0BAA0B,CAAA,wBAAA,CAAA,GAAA,2BAAA,CAAA;AAAA,EAAA,OAA1BA,0BAA0B,CAAA;AAAA,CAAA,CAAA,EAAA,EAAA;;AAatC;AACA;AACA;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../src/components/Dashboard/types.ts"],"sourcesContent":["import { ComponentProps, Dispatch, MutableRefObject, RefObject } from 'react';\nimport { GridFilterItem } from '@redsift/table';\nimport { GridApi } from '@mui/x-data-grid-pro';\n\nimport { JSONArray } from '../../types';\n\n/**\n * Context props.\n */\nexport type DashboardContextProps = {\n dashboardRef?: RefObject<HTMLDivElement>;\n data: JSONArray;\n dataGridApiRef?: MutableRefObject<GridApi>;\n dispatch: Dispatch<DashboardReducerAction>;\n state: DashboardReducerState;\n toggleUpdateContext?: () => void;\n};\n\n/**\n * Reducer props.\n */\nexport type DashboardReducerState = {\n tableFilters: GridFilterItem[];\n};\n\nexport enum DashboardReducerActionType {\n ResetFilter = 'reset-filter',\n ResetFilters = 'reset-filters',\n FilterTable = 'filter-table',\n FilterTableBatch = 'filter-table-batch',\n AppendFilterTableBatch = 'append-filter-table-batch',\n}\n\nexport type DashboardReducerAction = {\n type: DashboardReducerActionType;\n filter?: GridFilterItem | GridFilterItem[];\n};\n\n/**\n * Component props.\n */\nexport interface DashboardProps extends ComponentProps<'div'> {\n /** Dataset that will be share across every components within the dashboard. */\n data: JSONArray;\n /** Datagrid API Ref. */\n dataGridApiRef?: MutableRefObject<GridApi>;\n}\n"],"names":["DashboardReducerActionType"],"mappings":"AAMA;AACA;AACA;;AAUA;AACA;AACA;;AAKYA,IAAAA,0BAA0B,0BAA1BA,0BAA0B,EAAA;EAA1BA,0BAA0B,CAAA,aAAA,CAAA,GAAA,cAAA,CAAA;EAA1BA,0BAA0B,CAAA,cAAA,CAAA,GAAA,eAAA,CAAA;EAA1BA,0BAA0B,CAAA,aAAA,CAAA,GAAA,cAAA,CAAA;EAA1BA,0BAA0B,CAAA,kBAAA,CAAA,GAAA,oBAAA,CAAA;EAA1BA,0BAA0B,CAAA,wBAAA,CAAA,GAAA,2BAAA,CAAA;AAAA,EAAA,OAA1BA,0BAA0B,CAAA;AAAA,CAAA,CAAA,EAAA,EAAA;;AAatC;AACA;AACA;;;;"}
package/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import * as _redsift_design_system from '@redsift/design-system';
5
5
  import { Comp, ValueOf, StylingProps, StylingTransientProps, ListboxProps, ContainerProps, ContainerTransientProps, IconProps, ButtonProps, Theme } from '@redsift/design-system';
6
6
  import React$1, { ComponentProps, RefObject, MutableRefObject, Dispatch, ElementType } from 'react';
7
7
  import { GridFilterItem } from '@redsift/table';
8
- import { GridApi } from '@mui/x-data-grid-premium';
8
+ import { GridApi } from '@mui/x-data-grid-pro';
9
9
  import * as styled_components_dist_types from 'styled-components/dist/types';
10
10
 
11
11
  type JSONValue = string | number | boolean | {
@@ -48,7 +48,7 @@ declare const ChartEmptyState: Comp<ChartEmptyStateProps, HTMLDivElement>;
48
48
  type DashboardContextProps = {
49
49
  dashboardRef?: RefObject<HTMLDivElement>;
50
50
  data: JSONArray;
51
- dataGridApiRef?: MutableRefObject<GridApi | null>;
51
+ dataGridApiRef?: MutableRefObject<GridApi>;
52
52
  dispatch: Dispatch<DashboardReducerAction>;
53
53
  state: DashboardReducerState;
54
54
  toggleUpdateContext?: () => void;
@@ -76,8 +76,8 @@ type DashboardReducerAction = {
76
76
  interface DashboardProps extends ComponentProps<'div'> {
77
77
  /** Dataset that will be share across every components within the dashboard. */
78
78
  data: JSONArray;
79
- /** Datagrid API Ref. MUI v8: can be null initially. */
80
- dataGridApiRef?: MutableRefObject<GridApi | null>;
79
+ /** Datagrid API Ref. */
80
+ dataGridApiRef?: MutableRefObject<GridApi>;
81
81
  }
82
82
 
83
83
  /**
package/package.json CHANGED
@@ -30,7 +30,7 @@
30
30
  "test": "yarn test:unit && yarn test:storybook"
31
31
  },
32
32
  "types": "index.d.ts",
33
- "version": "12.3.0",
33
+ "version": "12.3.1-muiv6-alpha.2",
34
34
  "dependencies": {
35
35
  "@emotion/react": "^11.10.4",
36
36
  "@emotion/styled": "^11.10.4",
@@ -56,7 +56,7 @@
56
56
  "@babel/preset-env": "^7.17.10",
57
57
  "@babel/preset-react": "^7.17.12",
58
58
  "@babel/preset-typescript": "^7.16.7",
59
- "@mui/x-data-grid-premium": "^8.24.0",
59
+ "@mui/x-data-grid-pro": "^6.18.0",
60
60
  "@rollup/plugin-babel": "^6.0.2",
61
61
  "@rollup/plugin-commonjs": "^24.0.0",
62
62
  "@rollup/plugin-json": "^6.0.0",
@@ -98,17 +98,17 @@
98
98
  "ts-jest": "^29.2.0"
99
99
  },
100
100
  "peerDependencies": {
101
- "@mui/x-data-grid-premium": ">=8",
102
- "@redsift/charts": "^12.3.0-0",
103
- "@redsift/design-system": "^12.3.0-0",
104
- "@redsift/icons": "^12.3.0-0",
105
- "@redsift/popovers": "^12.3.0-0",
106
- "@redsift/table": "^12.3.0-0",
101
+ "@mui/x-data-grid-pro": ">=6",
102
+ "@redsift/charts": "^12.3.1-0",
103
+ "@redsift/design-system": "^12.3.1-0",
104
+ "@redsift/icons": "^12.3.1-0",
105
+ "@redsift/popovers": "^12.3.1-0",
106
+ "@redsift/table": "^12.3.1-0",
107
107
  "crossfilter2": "^1.5.4",
108
108
  "dc": "^4.2.7",
109
109
  "react": ">=17",
110
110
  "react-dom": ">=17",
111
111
  "styled-components": "6.1.19"
112
112
  },
113
- "gitHead": "3a3750fc5930d3267a6f9131122e17c4873278a0"
113
+ "gitHead": "2c2f13c866eb3a49a10b4f0943ff599324f851b2"
114
114
  }