@redsift/dashboard 11.6.0-muiv5-alpha.11 → 11.6.0-muiv5-alpha.12
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/_internal/ChartEmptyState.js +2 -0
- package/{components/ChartEmptyState/_internal → _internal}/ChartEmptyState2.js +33 -2
- package/_internal/ChartEmptyState2.js.map +1 -0
- package/_internal/CrossfilterRegistry.js +2 -0
- package/{components/CrossfilterRegistry/_internal → _internal}/CrossfilterRegistry2.js +1 -1
- package/_internal/CrossfilterRegistry2.js.map +1 -0
- package/_internal/Dashboard.js +4 -0
- package/{components/Dashboard/_internal → _internal}/Dashboard.js.map +1 -1
- package/{components/Dashboard/_internal/reducer.js → _internal/Dashboard2.js} +44 -4
- package/_internal/Dashboard2.js.map +1 -0
- package/_internal/PdfExportButton.js +2 -0
- package/_internal/PdfExportButton2.js +417 -0
- package/_internal/PdfExportButton2.js.map +1 -0
- package/_internal/TimeSeriesBarChart.js +2 -0
- package/{components/TimeSeriesBarChart/_internal → _internal}/TimeSeriesBarChart.js.map +1 -1
- package/{components/TimeSeriesBarChart/_internal → _internal}/TimeSeriesBarChart2.js +119 -10
- package/_internal/TimeSeriesBarChart2.js.map +1 -0
- package/_internal/WithFilters.js +2 -0
- package/_internal/WithFilters2.js +701 -0
- package/_internal/WithFilters2.js.map +1 -0
- package/{_virtual/_internal/_rollupPluginBabelHelpers.js → _internal/context.js} +11 -2
- package/_internal/context.js.map +1 -0
- package/{components/Dashboard/_internal → _internal}/types.js +1 -1
- package/_internal/types.js.map +1 -0
- package/index.js +15 -11
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/_virtual/_internal/_rollupPluginBabelHelpers.js.map +0 -1
- package/components/ChartEmptyState/_internal/ChartEmptyState.js +0 -2
- package/components/ChartEmptyState/_internal/ChartEmptyState2.js.map +0 -1
- package/components/ChartEmptyState/_internal/styles.js +0 -35
- package/components/ChartEmptyState/_internal/styles.js.map +0 -1
- package/components/CrossfilterRegistry/_internal/CrossfilterRegistry.js +0 -2
- package/components/CrossfilterRegistry/_internal/CrossfilterRegistry2.js.map +0 -1
- package/components/Dashboard/_internal/Dashboard.js +0 -5
- package/components/Dashboard/_internal/Dashboard2.js +0 -46
- package/components/Dashboard/_internal/Dashboard2.js.map +0 -1
- package/components/Dashboard/_internal/context.js +0 -11
- package/components/Dashboard/_internal/context.js.map +0 -1
- package/components/Dashboard/_internal/reducer.js.map +0 -1
- package/components/Dashboard/_internal/types.js.map +0 -1
- package/components/PdfExportButton/_internal/PdfDocument.js +0 -173
- package/components/PdfExportButton/_internal/PdfDocument.js.map +0 -1
- package/components/PdfExportButton/_internal/PdfExportButton.js +0 -2
- package/components/PdfExportButton/_internal/PdfExportButton2.js +0 -110
- package/components/PdfExportButton/_internal/PdfExportButton2.js.map +0 -1
- package/components/PdfExportButton/_internal/styles.js +0 -146
- package/components/PdfExportButton/_internal/styles.js.map +0 -1
- package/components/TimeSeriesBarChart/_internal/TimeSeriesBarChart.js +0 -3
- package/components/TimeSeriesBarChart/_internal/TimeSeriesBarChart2.js.map +0 -1
- package/components/TimeSeriesBarChart/_internal/styles.js +0 -98
- package/components/TimeSeriesBarChart/_internal/styles.js.map +0 -1
- package/components/TimeSeriesBarChart/_internal/types.js +0 -22
- package/components/TimeSeriesBarChart/_internal/types.js.map +0 -1
- package/components/WithFilters/_internal/FilterableBarChart.js +0 -152
- package/components/WithFilters/_internal/FilterableBarChart.js.map +0 -1
- package/components/WithFilters/_internal/FilterableDataGrid.js +0 -51
- package/components/WithFilters/_internal/FilterableDataGrid.js.map +0 -1
- package/components/WithFilters/_internal/FilterablePieChart.js +0 -160
- package/components/WithFilters/_internal/FilterablePieChart.js.map +0 -1
- package/components/WithFilters/_internal/FilterableScatterPlot.js +0 -252
- package/components/WithFilters/_internal/FilterableScatterPlot.js.map +0 -1
- package/components/WithFilters/_internal/WithFilters.js +0 -2
- package/components/WithFilters/_internal/WithFilters2.js +0 -36
- package/components/WithFilters/_internal/WithFilters2.js.map +0 -1
- package/hooks/_internal/useCategoricalChartAsListbox.js +0 -94
- package/hooks/_internal/useCategoricalChartAsListbox.js.map +0 -1
- package/utils/groupReducers/_internal/groupReduceCount.js +0 -5
- package/utils/groupReducers/_internal/groupReduceCount.js.map +0 -1
- package/utils/groupReducers/_internal/groupReduceSum.js +0 -5
- package/utils/groupReducers/_internal/groupReduceSum.js.map +0 -1
- /package/{components/ChartEmptyState/_internal → _internal}/ChartEmptyState.js.map +0 -0
- /package/{components/CrossfilterRegistry/_internal → _internal}/CrossfilterRegistry.js.map +0 -0
- /package/{components/PdfExportButton/_internal → _internal}/PdfExportButton.js.map +0 -0
- /package/{components/WithFilters/_internal → _internal}/WithFilters.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WithFilters2.js","sources":["../../src/hooks/useCategoricalChartAsListbox.ts","../../src/components/WithFilters/FilterableBarChart.tsx","../../src/components/WithFilters/FilterableDataGrid.tsx","../../src/components/WithFilters/FilterablePieChart.tsx","../../src/components/WithFilters/FilterableScatterPlot.tsx","../../src/components/WithFilters/WithFilters.tsx"],"sourcesContent":["import { BaseMixin } from 'dc';\nimport { useRef, KeyboardEvent, useMemo, MutableRefObject } from 'react';\nimport { Group } from '../types';\n\ntype UseCategoricalChartAsListboxProps = <T extends BaseMixin<T>>(props: {\n id: string;\n ref: MutableRefObject<HTMLDivElement>;\n type: 'bar' | 'slice';\n ndxGroup?: Group;\n orientation?: 'horizontal' | 'vertical';\n}) => void;\n\n/**\n * Hook to give to a chart the roles, events and attributes of a listbox.\n */\nexport const useCategoricalChartAsListbox: UseCategoricalChartAsListboxProps =\n ({ id, ref, type, ndxGroup, orientation = 'horizontal' }) => {\n const currentIndexRef = useRef(0);\n\n const props = useMemo(() => {\n const numberOfGroups = ndxGroup\n ?.all()\n .filter((datum) => datum.value).length;\n if (ref && numberOfGroups) {\n const getCurrentOption = () =>\n ref.current.querySelector(\n `._${currentIndexRef.current}`\n ) as HTMLElement;\n\n const next = () => {\n getCurrentOption().classList.remove('focused');\n const index =\n currentIndexRef.current === numberOfGroups - 1\n ? 0\n : currentIndexRef.current + 1;\n currentIndexRef.current = index;\n ref.current.setAttribute(\n 'aria-activedescendant',\n `id${id}__${type}-${currentIndexRef.current}`\n );\n getCurrentOption().classList.add('focused');\n };\n\n const previous = () => {\n getCurrentOption().classList.remove('focused');\n const index =\n currentIndexRef.current === 0\n ? numberOfGroups - 1\n : currentIndexRef.current - 1;\n currentIndexRef.current = index;\n ref.current.setAttribute(\n 'aria-activedescendant',\n `id${id}__${type}-${currentIndexRef.current}`\n );\n getCurrentOption().classList.add('focused');\n };\n\n const focus = () => {\n ref.current.setAttribute(\n 'aria-activedescendant',\n `id${id}__${type}-0`\n );\n getCurrentOption().classList.add('focused');\n };\n\n const blur = () => {\n getCurrentOption().classList.remove('focused');\n currentIndexRef.current = 0;\n ref.current.setAttribute('aria-activedescendant', '');\n };\n\n const keydown = (e: Event) => {\n e.stopPropagation();\n\n switch ((e as unknown as KeyboardEvent).code) {\n case 'ArrowRight':\n if (orientation === 'horizontal') {\n e.preventDefault();\n next();\n }\n break;\n case 'ArrowLeft':\n if (orientation === 'horizontal') {\n e.preventDefault();\n previous();\n }\n break;\n case 'ArrowDown':\n if (orientation === 'vertical') {\n e.preventDefault();\n next();\n }\n break;\n case 'ArrowUp':\n if (orientation === 'vertical') {\n e.preventDefault();\n previous();\n }\n break;\n case 'Enter':\n case 'Space':\n e.preventDefault();\n getCurrentOption().dispatchEvent(new Event('click'));\n break;\n default:\n break;\n }\n };\n\n return {\n 'aria-activedescendant': '',\n 'aria-multiselectable': 'true',\n 'aria-orientation': orientation,\n role: 'listbox',\n tabIndex: 0,\n onFocus: focus,\n onBlur: blur,\n onMouseDown: (event: MouseEvent) => event.preventDefault(),\n onMouseLeave: blur,\n onKeyDown: keydown,\n };\n }\n }, [\n ref,\n ref.current,\n ndxGroup,\n JSON.parse(JSON.stringify(ndxGroup?.all() || '')),\n ]);\n\n return props;\n };\n","import { GridFilterItem } from '@redsift/table';\nimport { BarDatum } from '@redsift/charts';\nimport { Dimension, Group } from '../../types';\nimport React, { useEffect, useContext, useState, isValidElement, useRef, MutableRefObject } from 'react';\nimport { CrossfilterRegistry } from '../CrossfilterRegistry';\nimport { DashboardContext, DashboardReducerActionType } from '../Dashboard';\nimport { ChartEmptyState } from '../ChartEmptyState';\nimport { ChartsWithFiltersProps } from './types';\nimport { useCategoricalChartAsListbox } from '@redsift/dashboard/hooks/useCategoricalChartAsListbox';\nimport { useId } from '@redsift/design-system';\n\nexport const FilterableBarChart: React.FC<ChartsWithFiltersProps> = (props) => {\n const {\n children,\n datagridCategoryDimFilter,\n dimension,\n group,\n id: propsId,\n isDimensionArray,\n isResetable,\n localeText,\n onFilter,\n } = props;\n const [_id] = useId();\n const id = propsId ?? _id;\n const ref = useRef<HTMLDivElement>();\n\n const { emptyChartTitle, emptyChartSubtitle, emptyChartResetLabel } = {\n ...localeText,\n };\n\n const {\n data,\n dispatch,\n toggleUpdateContext,\n state: { tableFilters },\n } = useContext(DashboardContext);\n\n const [ndxDimension, setNdxDimension] = useState<Dimension>();\n const [ndxGroup, setNdxGroup] = useState<Group>();\n\n useEffect(() => {\n const computedNdxDimension = CrossfilterRegistry.get(data).dimension(dimension, isDimensionArray);\n const computedNdxGroup = group ? group(computedNdxDimension) : computedNdxDimension.group();\n setNdxDimension(computedNdxDimension);\n setNdxGroup(computedNdxGroup);\n return function cleanup() {\n computedNdxDimension.filterAll();\n };\n }, [dimension, data, group]);\n\n const [filters, setFilters] = useState<string[]>([]);\n\n const handleFilter = (category: string) => {\n let newFilters: string[];\n if (filters.includes(category)) {\n newFilters = filters.filter((f) => f !== category);\n } else {\n newFilters = [...filters, category];\n }\n\n setFilters(newFilters);\n if (newFilters.length) {\n ndxDimension!.filter((d) => newFilters.includes(d as string));\n } else {\n ndxDimension!.filterAll();\n }\n toggleUpdateContext?.();\n\n if (datagridCategoryDimFilter) {\n dispatch?.({\n type: DashboardReducerActionType.FilterTable,\n filter: {\n id: id,\n columnField: datagridCategoryDimFilter.field,\n operatorValue: datagridCategoryDimFilter.operator,\n value: newFilters,\n },\n });\n }\n\n if (onFilter) {\n onFilter(newFilters);\n }\n };\n\n const resetFilters = () => {\n setFilters([]);\n ndxDimension!.filterAll();\n toggleUpdateContext?.();\n\n if (datagridCategoryDimFilter) {\n dispatch?.({\n type: DashboardReducerActionType.ResetFilter,\n filter: {\n id: id,\n columnField: datagridCategoryDimFilter.field,\n operatorValue: datagridCategoryDimFilter.operator,\n } as GridFilterItem,\n });\n }\n\n if (onFilter) {\n onFilter();\n }\n };\n\n useEffect(() => {\n if (!datagridCategoryDimFilter) {\n return;\n }\n\n const updatedFilters = tableFilters.find(\n (filter) =>\n filter.columnField === datagridCategoryDimFilter.field &&\n filter.operatorValue === datagridCategoryDimFilter.operator\n )?.value;\n if (updatedFilters && updatedFilters !== filters && ndxDimension) {\n setFilters(updatedFilters);\n if (updatedFilters.length) {\n ndxDimension!.filter((d) => updatedFilters.includes(d));\n } else {\n ndxDimension!.filterAll();\n }\n toggleUpdateContext?.();\n }\n }, [tableFilters]);\n\n const emptyComponent = (\n <ChartEmptyState\n title={emptyChartTitle!}\n subtitle={emptyChartSubtitle}\n resetLabel={emptyChartResetLabel}\n onReset={resetFilters}\n />\n );\n\n const chartProps = useCategoricalChartAsListbox({\n id,\n ref: ref as MutableRefObject<HTMLDivElement>,\n type: 'bar',\n ndxGroup,\n orientation: 'vertical',\n });\n\n const filterProps = {\n barProps: {\n tabIndex: -1,\n },\n barRole: 'option',\n role: 'listbox',\n chartProps: chartProps,\n chartRef: ref,\n data: ndxGroup ? JSON.parse(JSON.stringify(ndxGroup.all())) : undefined,\n emptyComponent,\n id,\n isBarSelected: (datum: BarDatum) => {\n return (\n filters.length === 0 ||\n filters.includes(Array.isArray(datum.data.key) ? (datum.data.key[1] as string) : (datum.data.key as string))\n );\n },\n onBarClick: (datum: BarDatum) => {\n handleFilter(Array.isArray(datum.data.key) ? (datum.data.key[1] as string) : (datum.data.key as string));\n },\n onReset: isResetable ? resetFilters : undefined,\n };\n\n if (isValidElement(children)) {\n return React.cloneElement(children, { ...filterProps });\n }\n\n return null;\n};\n","import { GridFilterModel } from '@redsift/table';\nimport React, { useContext, isValidElement, useState, useEffect } from 'react';\nimport { DashboardContext, DashboardReducerActionType } from '../Dashboard';\nimport { WithFiltersProps } from './types';\n\nexport const FilterableDataGrid: React.FC<WithFiltersProps> = (props) => {\n const { children, onFilter } = props;\n\n const { state, data, dispatch, dataGridApiRef } =\n useContext(DashboardContext);\n const { tableFilters } = state;\n\n const [filterModel, setFilterModel] = useState<GridFilterModel>();\n useEffect(() => {\n setFilterModel({\n ...filterModel,\n items: tableFilters,\n });\n }, [tableFilters]);\n\n const updateChartFilters = (filterModel: GridFilterModel) => {\n dispatch?.({\n type: DashboardReducerActionType.FilterTableBatch,\n filter: filterModel.items,\n });\n };\n\n if (isValidElement(children)) {\n const filterProps = {\n apiRef: children.props.apiRef ?? dataGridApiRef,\n rows: data || [],\n filterModel,\n onFilterModelChange: (filterModel: GridFilterModel) => {\n if (onFilter) {\n onFilter(filterModel);\n }\n updateChartFilters(filterModel);\n },\n };\n\n return React.cloneElement(children, { ...filterProps });\n }\n\n return null;\n};\n","import { GridFilterItem } from '@redsift/table';\nimport { ArcDatum, LegendItemDatum } from '@redsift/charts';\nimport { Dimension, Group } from '../../types';\nimport React, { useEffect, useContext, useState, isValidElement, useRef, MutableRefObject } from 'react';\nimport { CrossfilterRegistry } from '../CrossfilterRegistry';\nimport { DashboardContext, DashboardReducerActionType } from '../Dashboard';\nimport { ChartEmptyState } from '../ChartEmptyState';\nimport { ChartsWithFiltersProps } from './types';\nimport { useCategoricalChartAsListbox } from '@redsift/dashboard/hooks/useCategoricalChartAsListbox';\nimport { useId } from '@redsift/design-system';\n\nexport const FilterablePieChart: React.FC<ChartsWithFiltersProps> = (props) => {\n const {\n children,\n datagridCategoryDimFilter,\n dimension,\n group,\n id: propsId,\n isDimensionArray,\n isResetable,\n localeText,\n onFilter,\n } = props;\n const [_id] = useId();\n const id = propsId ?? _id;\n const ref = useRef<HTMLDivElement>();\n\n const { emptyChartTitle, emptyChartSubtitle, emptyChartResetLabel } = {\n ...localeText,\n };\n\n const {\n data,\n dispatch,\n toggleUpdateContext,\n state: { tableFilters },\n } = useContext(DashboardContext);\n\n const [ndxDimension, setNdxDimension] = useState<Dimension>();\n const [ndxGroup, setNdxGroup] = useState<Group>();\n\n useEffect(() => {\n const computedNdxDimension = CrossfilterRegistry.get(data).dimension(dimension, isDimensionArray);\n const computedNdxGroup = group ? group(computedNdxDimension) : computedNdxDimension.group();\n setNdxDimension(computedNdxDimension);\n setNdxGroup(computedNdxGroup);\n return function cleanup() {\n computedNdxDimension.filterAll();\n };\n }, [dimension, data, group]);\n\n const [filters, setFilters] = useState<string[]>([]);\n\n const handleFilter = (category: string) => {\n let newFilters: string[];\n if (filters.includes(category)) {\n newFilters = filters.filter((f) => f !== category);\n } else {\n newFilters = [...filters, category];\n }\n\n setFilters(newFilters);\n if (newFilters.length) {\n ndxDimension!.filter((d) => newFilters.includes(d as string));\n } else {\n ndxDimension!.filterAll();\n }\n toggleUpdateContext?.();\n\n if (datagridCategoryDimFilter) {\n dispatch?.({\n type: DashboardReducerActionType.FilterTable,\n filter: {\n id: id,\n columnField: datagridCategoryDimFilter.field,\n operatorValue: datagridCategoryDimFilter.operator,\n value: newFilters,\n },\n });\n }\n\n if (onFilter) {\n onFilter(newFilters);\n }\n };\n\n const resetFilters = () => {\n setFilters([]);\n ndxDimension!.filterAll();\n toggleUpdateContext?.();\n\n if (datagridCategoryDimFilter) {\n dispatch?.({\n type: DashboardReducerActionType.ResetFilter,\n filter: {\n id: id,\n columnField: datagridCategoryDimFilter.field,\n operatorValue: datagridCategoryDimFilter.operator,\n } as GridFilterItem,\n });\n }\n\n if (onFilter) {\n onFilter();\n }\n };\n\n const updatedFilters = datagridCategoryDimFilter\n ? tableFilters.find(\n (filter) =>\n filter.columnField === datagridCategoryDimFilter.field &&\n filter.operatorValue === datagridCategoryDimFilter.operator\n )?.value\n : null;\n useEffect(() => {\n if (updatedFilters && updatedFilters !== filters && ndxDimension) {\n setFilters(updatedFilters);\n if (updatedFilters.length) {\n ndxDimension!.filter((d) => updatedFilters.includes(d));\n } else {\n ndxDimension!.filterAll();\n }\n toggleUpdateContext?.();\n }\n }, [updatedFilters]);\n\n const emptyComponent = (\n <ChartEmptyState\n title={emptyChartTitle!}\n subtitle={emptyChartSubtitle}\n resetLabel={emptyChartResetLabel}\n onReset={resetFilters}\n />\n );\n\n const chartProps = useCategoricalChartAsListbox({\n id,\n ref: ref as MutableRefObject<HTMLDivElement>,\n type: 'bar',\n ndxGroup,\n orientation: 'horizontal',\n });\n\n const legendProps = {\n onLegendItemClick: (datum: LegendItemDatum) => {\n handleFilter(datum.data.key);\n },\n isLegendItemSelected: (datum: LegendItemDatum) => {\n return filters.length === 0 || filters.includes(datum.data.key);\n },\n legendItemRole: 'option',\n role: 'group',\n };\n\n const filterProps = {\n sliceProps: {\n tabIndex: -1,\n },\n sliceRole: 'option',\n role: 'listbox',\n chartProps,\n legendProps,\n chartRef: ref,\n data: ndxGroup ? JSON.parse(JSON.stringify(ndxGroup.all())) : undefined,\n emptyComponent,\n id,\n isSliceSelected: (datum: ArcDatum) => {\n return filters.length === 0 || filters.includes(datum.data.key);\n },\n onSliceClick: (datum: ArcDatum) => {\n handleFilter(datum.data.key);\n },\n onReset: isResetable ? resetFilters : undefined,\n };\n\n if (isValidElement(children)) {\n return React.cloneElement(children, { ...filterProps });\n }\n\n return null;\n};\n","import { DotDatum, LegendItemDatum } from '@redsift/charts';\nimport { Dimension, Group } from '../../types';\nimport React, { useEffect, useContext, useState, isValidElement } from 'react';\nimport { CrossfilterRegistry } from '../CrossfilterRegistry';\nimport { DashboardContext, DashboardReducerActionType } from '../Dashboard';\nimport { ChartEmptyState } from '../ChartEmptyState';\nimport { ScaleLinear as d3ScaleLinear } from 'd3';\nimport { ChartsWithFiltersProps } from './types';\nimport { useId } from '@redsift/design-system';\n\ntype BrushFilter = {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n};\n\nconst filter = (legendFilters?: string[], brushFilters?: BrushFilter) => (d: [number, number, string]) => {\n if (legendFilters && legendFilters.length && brushFilters) {\n return (\n d[0] >= brushFilters.minX &&\n d[0] <= brushFilters.maxX &&\n d[1] >= brushFilters.minY &&\n d[1] <= brushFilters.maxY &&\n legendFilters.includes(d[2])\n );\n } else if (legendFilters && legendFilters.length) {\n return legendFilters.includes(d[2]);\n } else if (brushFilters) {\n return (\n d[0] >= brushFilters.minX && d[0] <= brushFilters.maxX && d[1] >= brushFilters.minY && d[1] <= brushFilters.maxY\n );\n } else {\n return true;\n }\n};\n\nconst isFiltered = (legendFilters?: string[], brushFilters?: BrushFilter) => (datum: DotDatum) => {\n if (legendFilters && legendFilters.length && brushFilters) {\n return (\n (datum.data.key[0] as number) >= brushFilters.minX &&\n (datum.data.key[0] as number) <= brushFilters.maxX &&\n (datum.data.key[1] as number) >= brushFilters.minY &&\n (datum.data.key[1] as number) <= brushFilters.maxY &&\n legendFilters.includes(datum.data.key[2] as string)\n );\n } else if (legendFilters && legendFilters.length) {\n return legendFilters.includes(datum.data.key[2] as string);\n } else if (brushFilters) {\n return (\n (datum.data.key[0] as number) >= brushFilters.minX &&\n (datum.data.key[0] as number) <= brushFilters.maxX &&\n (datum.data.key[1] as number) >= brushFilters.minY &&\n (datum.data.key[1] as number) <= brushFilters.maxY\n );\n } else {\n return true;\n }\n};\n\nexport const FilterableScatterPlot: React.FC<ChartsWithFiltersProps> = (props) => {\n const {\n children,\n datagridCoordinatesCategoryDimFilter,\n dimension,\n group,\n id: propsId,\n isDimensionArray,\n isResetable,\n localeText,\n onFilter,\n } = props;\n const [_id] = useId();\n const id = propsId ?? _id;\n\n const { emptyChartTitle, emptyChartSubtitle, emptyChartResetLabel } = {\n ...localeText,\n };\n\n const {\n data,\n dispatch,\n toggleUpdateContext,\n // state: { tableFilters },\n } = useContext(DashboardContext);\n\n const [ndxDimension, setNdxDimension] = useState<Dimension>();\n const [ndxGroup, setNdxGroup] = useState<Group>();\n\n useEffect(() => {\n const computedNdxDimension = CrossfilterRegistry.get(data).dimension(dimension, isDimensionArray);\n const computedNdxGroup = group ? group(computedNdxDimension) : computedNdxDimension.group();\n setNdxDimension(computedNdxDimension);\n setNdxGroup(computedNdxGroup);\n return function cleanup() {\n computedNdxDimension.filterAll();\n };\n }, [dimension, data, group]);\n\n const [brushFilters, setBrushFilters] = useState<BrushFilter>();\n const [legendFilters, setLegendFilters] = useState<string[]>([]);\n\n const handleBrushFilter = (newFilters: BrushFilter) => {\n setBrushFilters(newFilters);\n ndxDimension!.filter((d) => filter(legendFilters, newFilters)(d as unknown as [number, number, string]));\n toggleUpdateContext?.();\n\n if (datagridCoordinatesCategoryDimFilter) {\n dispatch?.({\n type: DashboardReducerActionType.FilterTable,\n filter: {\n id: `${id}-x`,\n columnField: datagridCoordinatesCategoryDimFilter[0].field,\n operatorValue: datagridCoordinatesCategoryDimFilter[0].operator,\n value: [newFilters.minX, newFilters.maxX],\n },\n });\n dispatch?.({\n type: DashboardReducerActionType.FilterTable,\n filter: {\n id: `${id}-y`,\n columnField: datagridCoordinatesCategoryDimFilter[1].field,\n operatorValue: datagridCoordinatesCategoryDimFilter[1].operator,\n value: [newFilters.minY, newFilters.maxY],\n },\n });\n }\n\n if (onFilter) {\n onFilter(newFilters);\n }\n };\n\n const handleLegendFilter = (category: string) => {\n let newFilters: string[];\n if (legendFilters.includes(category)) {\n newFilters = legendFilters.filter((f) => f !== category);\n } else {\n newFilters = [...legendFilters, category];\n }\n\n setLegendFilters(newFilters);\n ndxDimension!.filter((d) => filter(newFilters, brushFilters)(d as unknown as [number, number, string]));\n toggleUpdateContext?.();\n\n if (datagridCoordinatesCategoryDimFilter?.length === 3) {\n dispatch?.({\n type: DashboardReducerActionType.FilterTable,\n filter: {\n id: `${id}-category`,\n columnField: datagridCoordinatesCategoryDimFilter[2].field,\n operatorValue: datagridCoordinatesCategoryDimFilter[2].operator,\n value: newFilters,\n },\n });\n }\n\n if (onFilter) {\n onFilter(newFilters);\n }\n };\n\n const resetFilters = (brush = true, legend = true) => {\n if (brush) {\n setBrushFilters(undefined);\n }\n if (legend) {\n setLegendFilters([]);\n }\n ndxDimension!.filter((d) =>\n filter(legend ? [] : legendFilters, brush ? undefined : brushFilters)(d as unknown as [number, number, string])\n );\n toggleUpdateContext?.();\n\n if (datagridCoordinatesCategoryDimFilter) {\n if (brush) {\n dispatch?.({\n type: DashboardReducerActionType.ResetFilter,\n filter: {\n id: `${id}-x`,\n columnField: datagridCoordinatesCategoryDimFilter[0].field,\n operatorValue: datagridCoordinatesCategoryDimFilter[0].operator,\n },\n });\n dispatch?.({\n type: DashboardReducerActionType.ResetFilter,\n filter: {\n id: `${id}-y`,\n columnField: datagridCoordinatesCategoryDimFilter[1].field,\n operatorValue: datagridCoordinatesCategoryDimFilter[1].operator,\n },\n });\n }\n if (legend && datagridCoordinatesCategoryDimFilter.length === 3) {\n dispatch?.({\n type: DashboardReducerActionType.ResetFilter,\n filter: {\n id: `${id}-category`,\n columnField: datagridCoordinatesCategoryDimFilter[2].field,\n operatorValue: datagridCoordinatesCategoryDimFilter[2].operator,\n },\n });\n }\n }\n\n if (onFilter) {\n onFilter();\n }\n };\n\n // useEffect(() => {\n // if (!datagridCoordinatesCategoryDimFilter) {\n // return;\n // }\n\n // const updatedXFilters = tableFilters.find(\n // (filter) =>\n // filter.columnField === datagridCoordinatesCategoryDimFilter[0].field &&\n // filter.operatorValue ===\n // datagridCoordinatesCategoryDimFilter[0].operator\n // )?.value;\n // const updatedYFilters = tableFilters.find(\n // (filter) =>\n // filter.columnField === datagridCoordinatesCategoryDimFilter[1].field &&\n // filter.operatorValue ===\n // datagridCoordinatesCategoryDimFilter[1].operator\n // )?.value;\n // console.log(updatedXFilters, updatedYFilters, brushFilters);\n // const updatedFilters = {\n // minX: Number(updatedXFilters[0]),\n // maxX: Number(updatedXFilters[0]),\n // minY: Number(updatedYFilters[1]),\n // maxY: Number(updatedYFilters[1]),\n // }\n // if (updatedFilters && JSON.stringify(updatedFilters) !== JSON.stringify(brushFilters)) {\n // }\n // }, [tableFilters]);\n\n const emptyComponent = (\n <ChartEmptyState\n title={emptyChartTitle!}\n subtitle={emptyChartSubtitle}\n resetLabel={emptyChartResetLabel}\n onReset={resetFilters}\n />\n );\n\n const legendProps = {\n onLegendItemClick: (datum: LegendItemDatum) => {\n handleLegendFilter(datum.data.key);\n },\n isLegendItemSelected: (datum: LegendItemDatum) => {\n return legendFilters.length === 0 || legendFilters.includes(datum.data.key);\n },\n legendItemRole: 'option',\n role: 'group',\n };\n\n const filterProps = {\n isBrushable: true,\n data: ndxGroup ? JSON.parse(JSON.stringify(ndxGroup.all())) : undefined,\n dotRole: 'option',\n role: 'listbox',\n emptyComponent,\n id,\n legendProps,\n onBrush: (\n selection: [[number, number], [number, number]],\n scaleX: d3ScaleLinear<number, number>,\n scaleY: d3ScaleLinear<number, number>\n ) => {\n if (selection) {\n setBrushFilters({\n minX: scaleX.invert(selection[0][0]),\n minY: scaleY.invert(selection[1][1]),\n maxX: scaleX.invert(selection[1][0]),\n maxY: scaleY.invert(selection[0][1]),\n });\n }\n },\n onBrushEnd: (\n selection: [[number, number], [number, number]],\n scaleX?: d3ScaleLinear<number, number>,\n scaleY?: d3ScaleLinear<number, number>\n ) => {\n if (selection && scaleX && scaleY) {\n handleBrushFilter({\n minX: scaleX.invert(selection[0][0]),\n minY: scaleY.invert(selection[1][1]),\n maxX: scaleX.invert(selection[1][0]),\n maxY: scaleY.invert(selection[0][1]),\n });\n } else {\n resetFilters(true, false);\n }\n },\n onReset: isResetable ? resetFilters : undefined,\n isDotSelected: (datum: DotDatum) => isFiltered(legendFilters, brushFilters)(datum),\n };\n\n if (isValidElement(children)) {\n return React.cloneElement(children, { ...filterProps });\n }\n\n return null;\n};\n","import React from 'react';\nimport { isComponent } from '@redsift/design-system';\nimport { FilterableBarChart } from './FilterableBarChart';\nimport { FilterableDataGrid } from './FilterableDataGrid';\nimport { FilterablePieChart } from './FilterablePieChart';\nimport { FilterableScatterPlot } from './FilterableScatterPlot';\nimport { WithFiltersProps } from './types';\n\nexport const WithFilters: React.FC<WithFiltersProps> = (props) => {\n if (isComponent('DataGrid')(props.children)) {\n return <FilterableDataGrid {...props} />;\n }\n\n const { dimension } = props;\n\n if (!dimension) {\n return null;\n }\n\n if (isComponent('BarChart')(props.children)) {\n return <FilterableBarChart {...props} dimension={dimension} />;\n } else if (isComponent('PieChart')(props.children)) {\n return <FilterablePieChart {...props} dimension={dimension} />;\n } else if (isComponent('ScatterPlot')(props.children)) {\n return <FilterableScatterPlot {...props} dimension={dimension} />;\n }\n\n return React.isValidElement(props.children) ? props.children : null;\n};\n"],"names":["useCategoricalChartAsListbox","_ref","id","ref","type","ndxGroup","orientation","currentIndexRef","useRef","props","useMemo","numberOfGroups","all","filter","datum","value","length","getCurrentOption","current","querySelector","next","classList","remove","index","setAttribute","add","previous","focus","blur","keydown","e","stopPropagation","code","preventDefault","dispatchEvent","Event","role","tabIndex","onFocus","onBlur","onMouseDown","event","onMouseLeave","onKeyDown","JSON","parse","stringify","FilterableBarChart","children","datagridCategoryDimFilter","dimension","group","propsId","isDimensionArray","isResetable","localeText","onFilter","_id","useId","emptyChartTitle","emptyChartSubtitle","emptyChartResetLabel","_objectSpread","data","dispatch","toggleUpdateContext","state","tableFilters","useContext","DashboardContext","ndxDimension","setNdxDimension","useState","setNdxGroup","useEffect","computedNdxDimension","CrossfilterRegistry","get","computedNdxGroup","cleanup","filterAll","filters","setFilters","handleFilter","category","newFilters","includes","f","d","DashboardReducerActionType","FilterTable","columnField","field","operatorValue","operator","resetFilters","ResetFilter","_tableFilters$find","updatedFilters","find","emptyComponent","React","createElement","ChartEmptyState","title","subtitle","resetLabel","onReset","chartProps","filterProps","barProps","barRole","chartRef","undefined","isBarSelected","Array","isArray","key","onBarClick","isValidElement","cloneElement","FilterableDataGrid","dataGridApiRef","filterModel","setFilterModel","items","updateChartFilters","FilterTableBatch","_children$props$apiRe","apiRef","rows","onFilterModelChange","FilterablePieChart","legendProps","onLegendItemClick","isLegendItemSelected","legendItemRole","sliceProps","sliceRole","isSliceSelected","onSliceClick","legendFilters","brushFilters","minX","maxX","minY","maxY","isFiltered","FilterableScatterPlot","datagridCoordinatesCategoryDimFilter","setBrushFilters","setLegendFilters","handleBrushFilter","handleLegendFilter","brush","arguments","legend","isBrushable","dotRole","onBrush","selection","scaleX","scaleY","invert","onBrushEnd","isDotSelected","WithFilters","isComponent","_extends"],"mappings":";;;;;;;AAYA;AACA;AACA;AACO,MAAMA,4BAA+D,GAC1EC,IAAA,IAA6D;EAAA,IAA5D;IAAEC,EAAE;IAAEC,GAAG;IAAEC,IAAI;IAAEC,QAAQ;AAAEC,IAAAA,WAAW,GAAG,YAAA;AAAa,GAAC,GAAAL,IAAA,CAAA;AACtD,EAAA,MAAMM,eAAe,GAAGC,MAAM,CAAC,CAAC,CAAC,CAAA;AAEjC,EAAA,MAAMC,KAAK,GAAGC,OAAO,CAAC,MAAM;IAC1B,MAAMC,cAAc,GAAGN,QAAQ,KAAA,IAAA,IAARA,QAAQ,KAARA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,QAAQ,CAC3BO,GAAG,EAAE,CACNC,MAAM,CAAEC,KAAK,IAAKA,KAAK,CAACC,KAAK,CAAC,CAACC,MAAM,CAAA;IACxC,IAAIb,GAAG,IAAIQ,cAAc,EAAE;AACzB,MAAA,MAAMM,gBAAgB,GAAGA,MACvBd,GAAG,CAACe,OAAO,CAACC,aAAa,CACtB,CAAIZ,EAAAA,EAAAA,eAAe,CAACW,OAAQ,EAC/B,CAAgB,CAAA;MAElB,MAAME,IAAI,GAAGA,MAAM;QACjBH,gBAAgB,EAAE,CAACI,SAAS,CAACC,MAAM,CAAC,SAAS,CAAC,CAAA;AAC9C,QAAA,MAAMC,KAAK,GACTh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;AAAEyC,MAAAA,SAAS,EAAEA,SAAAA;AAAU,KAAA,CAAE,CAAC,CAAA;AACnE,GAAA;AAEA,EAAA,oBAAOmD,KAAK,CAACkB,cAAc,CAAC9G,KAAK,CAACuC,QAAQ,CAAC,GAAGvC,KAAK,CAACuC,QAAQ,GAAG,IAAI,CAAA;AACrE;;;;"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
1
3
|
function ownKeys(object, enumerableOnly) {
|
|
2
4
|
var keys = Object.keys(object);
|
|
3
5
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -89,5 +91,12 @@ function _toPropertyKey(arg) {
|
|
|
89
91
|
return typeof key === "symbol" ? key : String(key);
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
const initialState = {
|
|
95
|
+
tableFilters: []
|
|
96
|
+
};
|
|
97
|
+
const DashboardContext = /*#__PURE__*/React.createContext({
|
|
98
|
+
state: initialState
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export { DashboardContext as D, _objectSpread2 as _, _objectWithoutProperties as a, _extends as b, initialState as i };
|
|
102
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../src/components/Dashboard/context.ts"],"sourcesContent":["import React from 'react';\nimport { DashboardContextProps, DashboardReducerState } from './types';\n\nexport const initialState: DashboardReducerState = {\n tableFilters: [],\n};\n\nexport const DashboardContext = React.createContext<DashboardContextProps>({\n state: initialState,\n} as DashboardContextProps);\n"],"names":["initialState","tableFilters","DashboardContext","React","createContext","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,MAAMA,YAAmC,GAAG;AACjDC,EAAAA,YAAY,EAAE,EAAA;AAChB,EAAC;MAEYC,gBAAgB,gBAAGC,KAAK,CAACC,aAAa,CAAwB;AACzEC,EAAAA,KAAK,EAAEL,YAAAA;AACT,CAA0B;;;;"}
|
|
@@ -0,0 +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-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.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export { ChartSize, ColorTheme } from '@redsift/charts';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
export { C as ChartEmptyState } from './_internal/ChartEmptyState2.js';
|
|
3
|
+
export { D as Dashboard, a as DashboardReducer } from './_internal/Dashboard2.js';
|
|
4
|
+
export { D as DashboardContext, i as initialState } from './_internal/context.js';
|
|
5
|
+
export { D as DashboardReducerActionType } from './_internal/types.js';
|
|
6
|
+
export { P as PdfExportButton } from './_internal/PdfExportButton2.js';
|
|
7
|
+
export { T as TimeSeriesBarChart, a as TimeSeriesBarChartSize, b as TimeSeriesBarChartTheme } from './_internal/TimeSeriesBarChart2.js';
|
|
8
|
+
export { W as WithFilters } from './_internal/WithFilters2.js';
|
|
9
|
+
|
|
10
|
+
const groupReduceCount = d => d.group().reduceCount();
|
|
11
|
+
const COUNT = groupReduceCount;
|
|
12
|
+
|
|
13
|
+
const groupReduceSum = field => d => d.group().reduceSum(d => d[field]);
|
|
14
|
+
const SUM = groupReduceSum;
|
|
15
|
+
|
|
16
|
+
export { COUNT, SUM, groupReduceSum };
|
|
13
17
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/utils/groupReducers/groupReduceCount.ts","../src/utils/groupReducers/groupReduceSum.ts"],"sourcesContent":["import { Dimension } from '../../types';\n\nconst groupReduceCount = (d: Dimension) => d.group().reduceCount();\n\nexport const COUNT = groupReduceCount;\n","import { Dimension } from '../../types';\n\nexport const groupReduceSum = (field: string) => (d: Dimension) =>\n d.group().reduceSum((d) => d[field]);\n\nexport const SUM = groupReduceSum;\n"],"names":["groupReduceCount","d","group","reduceCount","COUNT","groupReduceSum","field","reduceSum","SUM"],"mappings":";;;;;;;;;AAEA,MAAMA,gBAAgB,GAAIC,CAAY,IAAKA,CAAC,CAACC,KAAK,EAAE,CAACC,WAAW,EAAE,CAAA;AAE3D,MAAMC,KAAK,GAAGJ;;ACFd,MAAMK,cAAc,GAAIC,KAAa,IAAML,CAAY,IAC5DA,CAAC,CAACC,KAAK,EAAE,CAACK,SAAS,CAAEN,CAAC,IAAKA,CAAC,CAACK,KAAK,CAAC,EAAC;AAE/B,MAAME,GAAG,GAAGH;;;;"}
|
package/package.json
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"test": "yarn test:unit && yarn test:storybook"
|
|
31
31
|
},
|
|
32
32
|
"types": "types.d.ts",
|
|
33
|
-
"version": "11.6.0-muiv5-alpha.
|
|
33
|
+
"version": "11.6.0-muiv5-alpha.12",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@emotion/react": "^11.10.4",
|
|
36
36
|
"@emotion/styled": "^11.10.4",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"react-dom": ">=17",
|
|
111
111
|
"styled-components": "^5.3.5"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "830bd377ff33506ced96e969a219726667ee667c"
|
|
114
114
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChartEmptyState2.js","sources":["../../../../src/components/ChartEmptyState/ChartEmptyState.tsx"],"sourcesContent":["import React, { forwardRef, RefObject } from 'react';\nimport { mdiRefresh } from '@redsift/icons';\nimport { Comp } from '@redsift/design-system';\n\nimport { ChartEmptyStateProps } from './types';\nimport { StyledChartEmptyState, StyledResetButton } from './styles';\n\nconst COMPONENT_NAME = 'ChartEmptyState';\nconst CLASSNAME = 'redsift-chart-empty-state';\n\nexport const ChartEmptyState: Comp<ChartEmptyStateProps, HTMLDivElement> = forwardRef((props, ref) => {\n const {\n onReset,\n title = 'No Data Available',\n subtitle = 'Please check the applied filters',\n resetLabel = 'Reset all filters',\n } = props;\n\n return (\n <StyledChartEmptyState ref={ref as RefObject<HTMLDivElement>} className=\"redsift-chart-empty-state\">\n <div className={`${ChartEmptyState.className}__img`}>\n <svg width=\"86\" height=\"86\" viewBox=\"0 0 86 86\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n opacity=\"0.2\"\n d=\"M43 86C66.7482 86 86 66.7482 86 43C86 19.2518 66.7482 0 43 0C19.2518 0 0 19.2518 0 43C0 66.7482 19.2518 86 43 86Z\"\n fill=\"#4285F4\"\n />\n <path\n opacity=\"0.4\"\n d=\"M13.4479 45.9299C13.4479 44.8254 14.3434 43.9299 15.4479 43.9299H29.3785C30.4831 43.9299 31.3785 44.8254 31.3785 45.9299V60.0675H13.4479V45.9299Z\"\n fill=\"#4285F4\"\n />\n <path\n opacity=\"0.4\"\n d=\"M34.0681 27.9993C34.0681 26.8948 34.9636 25.9993 36.0681 25.9993H49.9987C51.1033 25.9993 51.9987 26.8948 51.9987 27.9993V60.0675H34.0681V27.9993Z\"\n fill=\"#4285F4\"\n />\n <path\n opacity=\"0.4\"\n d=\"M54.6883 53.1022C54.6883 51.9976 55.5837 51.1022 56.6883 51.1022H70.6189C71.7235 51.1022 72.6189 51.9976 72.6189 53.1022V60.0675H54.6883V53.1022Z\"\n fill=\"#4285F4\"\n />\n <line x1=\"10.3618\" y1=\"60.464\" x2=\"75.705\" y2=\"60.464\" stroke=\"#305AA2\" strokeLinecap=\"round\" />\n <path d=\"M48.7345 25.9993H46.9414L51.9987 28.9192V27.8839L48.7345 25.9993Z\" fill=\"#4285F4\" />\n <path d=\"M41.5622 25.9993L51.9987 32.0249V30.9896L43.3553 25.9993H41.5622Z\" fill=\"#4285F4\" />\n <path d=\"M36.183 25.9993L51.9987 35.1305V34.0953L37.9761 25.9993H36.183Z\" fill=\"#4285F4\" />\n <path\n d=\"M34.0771 27.622C34.0681 27.6758 34.0681 27.7296 34.0681 27.7924V27.8839L51.9987 38.2362V37.201L34.281 26.9716C34.1776 27.171 34.097 27.3834 34.0771 27.622Z\"\n fill=\"#4285F4\"\n />\n <path d=\"M34.0681 30.9896L51.9987 41.3418V40.3066L34.0681 29.9544V30.9896Z\" fill=\"#4285F4\" />\n <path d=\"M34.0681 34.0953L51.9987 44.4475V43.4123L34.0681 33.06V34.0953Z\" fill=\"#4285F4\" />\n <path d=\"M34.0681 37.2009L51.9987 47.5531V46.518L34.0681 36.1657V37.2009Z\" fill=\"#4285F4\" />\n <path d=\"M34.0681 40.3066L51.9987 50.6588V49.6236L34.0681 39.2714V40.3066Z\" fill=\"#4285F4\" />\n <path d=\"M34.0681 43.4123L51.9987 53.7645V52.7293L34.0681 42.377V43.4123Z\" fill=\"#4285F4\" />\n <path d=\"M34.0681 46.518L51.9987 56.8702V55.835L34.0681 45.4827V46.518Z\" fill=\"#4285F4\" />\n <path d=\"M34.0681 49.6236L51.9987 59.9759V58.9407L34.0681 48.5884V49.6236Z\" fill=\"#4285F4\" />\n <path d=\"M34.0681 52.7293L46.7782 60.0675H48.5712L34.0681 51.6941V52.7293Z\" fill=\"#4285F4\" />\n <path d=\"M34.0681 55.835L41.399 60.0675H43.192L34.0681 54.7997V55.835Z\" fill=\"#4285F4\" />\n <path d=\"M34.0681 58.9406L36.0198 60.0675H37.8129L34.0681 57.9054V58.9406Z\" fill=\"#4285F4\" />\n <circle\n opacity=\"0.6\"\n cx=\"50.5506\"\n cy=\"29.9304\"\n r=\"10.1549\"\n transform=\"rotate(-45 50.5506 29.9304)\"\n fill=\"white\"\n stroke=\"#305AA2\"\n strokeWidth=\"3\"\n />\n <circle\n cx=\"50.5506\"\n cy=\"29.9304\"\n r=\"10.1549\"\n transform=\"rotate(-45 50.5506 29.9304)\"\n stroke=\"#305AA2\"\n strokeWidth=\"3\"\n />\n <path\n d=\"M59.2186 36.4771L58.1579 35.4164L56.0366 37.5377L57.0973 38.5984L59.2186 36.4771ZM65.9725 47.4736C66.5582 48.0594 67.508 48.0594 68.0938 47.4736C68.6796 46.8878 68.6796 45.938 68.0938 45.3522L65.9725 47.4736ZM57.0973 38.5984L65.9725 47.4736L68.0938 45.3522L59.2186 36.4771L57.0973 38.5984Z\"\n fill=\"#305AA2\"\n />\n </svg>\n </div>\n <div className={`${ChartEmptyState.className}__title`}>{title}</div>\n <div className={`${ChartEmptyState.className}__subtitle`}>{subtitle}</div>\n {onReset ? (\n <StyledResetButton variant=\"unstyled\" leftIcon={mdiRefresh} onClick={onReset}>\n {resetLabel}\n </StyledResetButton>\n ) : null}\n </StyledChartEmptyState>\n );\n});\n\nChartEmptyState.className = CLASSNAME;\nChartEmptyState.displayName = COMPONENT_NAME;\n"],"names":["COMPONENT_NAME","CLASSNAME","ChartEmptyState","forwardRef","props","ref","onReset","title","subtitle","resetLabel","React","createElement","StyledChartEmptyState","className","width","height","viewBox","fill","xmlns","opacity","d","x1","y1","x2","y2","stroke","strokeLinecap","cx","cy","r","transform","strokeWidth","StyledResetButton","variant","leftIcon","mdiRefresh","onClick","displayName"],"mappings":";;;;AAOA,MAAMA,cAAc,GAAG,iBAAiB,CAAA;AACxC,MAAMC,SAAS,GAAG,2BAA2B,CAAA;AAEtC,MAAMC,eAA2D,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACpG,MAAM;IACJC,OAAO;AACPC,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EAAC,SAAS;AACZC,IAAAA,EAAE,EAAC,SAAS;AACZC,IAAAA,CAAC,EAAC,SAAS;AACXC,IAAAA,SAAS,EAAC,6BAA6B;AACvCL,IAAAA,MAAM,EAAC,SAAS;AAChBM,IAAAA,WAAW,EAAC,GAAA;AAAG,GAChB,CAAC,eACFrB,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AACES,IAAAA,CAAC,EAAC,mSAAmS;AACrSH,IAAAA,IAAI,EAAC,SAAA;AAAS,GACf,CACE,CACF,CAAC,eACNP,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKE,IAAAA,SAAS,EAAG,CAAA,EAAEX,eAAe,CAACW,SAAU,CAAA,OAAA,CAAA;AAAS,GAAA,EAAEN,KAAW,CAAC,eACpEG,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKE,IAAAA,SAAS,EAAG,CAAA,EAAEX,eAAe,CAACW,SAAU,CAAA,UAAA,CAAA;GAAcL,EAAAA,QAAc,CAAC,EACzEF,OAAO,gBACNI,KAAA,CAAAC,aAAA,CAACqB,iBAAiB,EAAA;AAACC,IAAAA,OAAO,EAAC,UAAU;AAACC,IAAAA,QAAQ,EAAEC,UAAW;AAACC,IAAAA,OAAO,EAAE9B,OAAAA;AAAQ,GAAA,EAC1EG,UACgB,CAAC,GAClB,IACiB,CAAC,CAAA;AAE5B,CAAC,EAAC;AAEFP,eAAe,CAACW,SAAS,GAAGZ,SAAS,CAAA;AACrCC,eAAe,CAACmC,WAAW,GAAGrC,cAAc;;;;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { Button } from '@redsift/design-system';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Component style.
|
|
6
|
-
*/
|
|
7
|
-
const StyledChartEmptyState = styled.div`
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
justify-content: center;
|
|
11
|
-
align-items: center;
|
|
12
|
-
margin-top: 16px;
|
|
13
|
-
|
|
14
|
-
.redsift-chart-empty-state__title {
|
|
15
|
-
font-family: var(--redsift-typography-h4-font-family);
|
|
16
|
-
font-size: var(--redsift-typography-h4-font-size);
|
|
17
|
-
font-weight: var(--redsift-typography-h4-font-weight);
|
|
18
|
-
line-height: var(--redsift-typography-h4-line-height);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.redsift-chart-empty-state__subtitle {
|
|
22
|
-
font-family: var(--redsift-typography-body-font-family);
|
|
23
|
-
font-size: var(--redsift-typography-body-font-size);
|
|
24
|
-
font-weight: var(--redsift-typography-body-font-weight);
|
|
25
|
-
line-height: var(--redsift-typography-body-line-height);
|
|
26
|
-
margin-top: 8px;
|
|
27
|
-
text-align: center;
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
const StyledResetButton = styled(Button)`
|
|
31
|
-
margin-top: 8px;
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
export { StyledChartEmptyState, StyledResetButton };
|
|
35
|
-
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../src/components/ChartEmptyState/styles.ts"],"sourcesContent":["import styled from 'styled-components';\nimport { Button } from '@redsift/design-system';\n\n/**\n * Component style.\n */\nexport const StyledChartEmptyState = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n margin-top: 16px;\n\n .redsift-chart-empty-state__title {\n font-family: var(--redsift-typography-h4-font-family);\n font-size: var(--redsift-typography-h4-font-size);\n font-weight: var(--redsift-typography-h4-font-weight);\n line-height: var(--redsift-typography-h4-line-height);\n }\n\n .redsift-chart-empty-state__subtitle {\n font-family: var(--redsift-typography-body-font-family);\n font-size: var(--redsift-typography-body-font-size);\n font-weight: var(--redsift-typography-body-font-weight);\n line-height: var(--redsift-typography-body-line-height);\n margin-top: 8px;\n text-align: center;\n }\n`;\n\nexport const StyledResetButton = styled(Button)`\n margin-top: 8px;\n`;\n"],"names":["StyledChartEmptyState","styled","div","StyledResetButton","Button"],"mappings":";;;AAGA;AACA;AACA;AACaA,MAAAA,qBAAqB,GAAGC,MAAM,CAACC,GAAI,CAAA;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;MAEYC,iBAAiB,GAAGF,MAAM,CAACG,MAAM,CAAE,CAAA;AAChD;AACA;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CrossfilterRegistry2.js","sources":["../../../../src/components/CrossfilterRegistry/CrossfilterRegistry.ts"],"sourcesContent":["import { JSONArray, TNdx } from '../../types';\nimport crossfilter from 'crossfilter2';\n\nexport const CrossfilterRegistry = (() => {\n const instances = new WeakMap<JSONArray, TNdx>();\n\n const get = (data: JSONArray): TNdx => {\n let instance = instances.get(data);\n\n if (!instance) {\n instance = crossfilter(data);\n instances.set(data, instance);\n }\n\n return instance;\n };\n\n const remove = (data: JSONArray): void => {\n instances.delete(data);\n };\n\n return {\n get,\n remove,\n };\n})();\n"],"names":["CrossfilterRegistry","instances","WeakMap","get","data","instance","crossfilter","set","remove","delete"],"mappings":";;AAGaA,MAAAA,mBAAmB,GAAG,CAAC,MAAM;AACxC,EAAA,MAAMC,SAAS,GAAG,IAAIC,OAAO,EAAmB,CAAA;EAEhD,MAAMC,GAAG,GAAIC,IAAe,IAAW;AACrC,IAAA,IAAIC,QAAQ,GAAGJ,SAAS,CAACE,GAAG,CAACC,IAAI,CAAC,CAAA;IAElC,IAAI,CAACC,QAAQ,EAAE;AACbA,MAAAA,QAAQ,GAAGC,WAAW,CAACF,IAAI,CAAC,CAAA;AAC5BH,MAAAA,SAAS,CAACM,GAAG,CAACH,IAAI,EAAEC,QAAQ,CAAC,CAAA;AAC/B,KAAA;AAEA,IAAA,OAAOA,QAAQ,CAAA;GAChB,CAAA;EAED,MAAMG,MAAM,GAAIJ,IAAe,IAAW;AACxCH,IAAAA,SAAS,CAACQ,MAAM,CAACL,IAAI,CAAC,CAAA;GACvB,CAAA;EAED,OAAO;IACLD,GAAG;AACHK,IAAAA,MAAAA;GACD,CAAA;AACH,CAAC;;;;"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../../_virtual/_internal/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import React, { forwardRef, useRef, useState, useReducer, useMemo } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import { useGridApiRef } from '@mui/x-data-grid-pro';
|
|
5
|
-
import { DashboardContext } from './context.js';
|
|
6
|
-
import { DashboardReducer } from './reducer.js';
|
|
7
|
-
import { CrossfilterRegistry } from '../../CrossfilterRegistry/_internal/CrossfilterRegistry2.js';
|
|
8
|
-
|
|
9
|
-
const _excluded = ["children", "className", "data", "dataGridApiRef"];
|
|
10
|
-
const COMPONENT_NAME = 'Dashboard';
|
|
11
|
-
const CLASSNAME = 'redsift-dashboard-container';
|
|
12
|
-
const Dashboard = /*#__PURE__*/forwardRef((props, ref) => {
|
|
13
|
-
const {
|
|
14
|
-
children,
|
|
15
|
-
className,
|
|
16
|
-
data,
|
|
17
|
-
dataGridApiRef: propsDataGridApiRef
|
|
18
|
-
} = props,
|
|
19
|
-
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
20
|
-
const providerRef = ref || useRef();
|
|
21
|
-
const dataGridApiRef = propsDataGridApiRef || useGridApiRef();
|
|
22
|
-
const [updateContext, setUpdateContext] = useState(false);
|
|
23
|
-
const [state, dispatch] = useReducer(DashboardReducer, {
|
|
24
|
-
tableFilters: []
|
|
25
|
-
});
|
|
26
|
-
const value = useMemo(() => ({
|
|
27
|
-
dashboardRef: providerRef,
|
|
28
|
-
data,
|
|
29
|
-
dataGridApiRef,
|
|
30
|
-
dispatch,
|
|
31
|
-
ndx: CrossfilterRegistry.get(data),
|
|
32
|
-
state,
|
|
33
|
-
toggleUpdateContext: () => setUpdateContext(!updateContext)
|
|
34
|
-
}), [data, state, updateContext]);
|
|
35
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, forwardedProps, {
|
|
36
|
-
className: classNames(Dashboard.className, className),
|
|
37
|
-
ref: providerRef
|
|
38
|
-
}), /*#__PURE__*/React.createElement(DashboardContext.Provider, {
|
|
39
|
-
value: value
|
|
40
|
-
}, children));
|
|
41
|
-
});
|
|
42
|
-
Dashboard.className = CLASSNAME;
|
|
43
|
-
Dashboard.displayName = COMPONENT_NAME;
|
|
44
|
-
|
|
45
|
-
export { Dashboard };
|
|
46
|
-
//# sourceMappingURL=Dashboard2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard2.js","sources":["../../../../src/components/Dashboard/Dashboard.tsx"],"sourcesContent":["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\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":["COMPONENT_NAME","CLASSNAME","Dashboard","forwardRef","props","ref","children","className","data","dataGridApiRef","propsDataGridApiRef","forwardedProps","_objectWithoutProperties","_excluded","providerRef","useRef","useGridApiRef","updateContext","setUpdateContext","useState","state","dispatch","useReducer","DashboardReducer","tableFilters","value","useMemo","dashboardRef","ndx","CrossfilterRegistry","get","toggleUpdateContext","React","createElement","_extends","classNames","DashboardContext","Provider","displayName"],"mappings":";;;;;;;;;AAUA,MAAMA,cAAc,GAAG,WAAW,CAAA;AAClC,MAAMC,SAAS,GAAG,6BAA6B,CAAA;AAExC,MAAMC,SAA+C,gBAAGC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EACxF,MAAM;MAAEC,QAAQ;MAAEC,SAAS;MAAEC,IAAI;AAAEC,MAAAA,cAAc,EAAEC,mBAAAA;AAAuC,KAAC,GAAGN,KAAK;AAAxBO,IAAAA,cAAc,GAAAC,wBAAA,CAAKR,KAAK,EAAAS,SAAA,CAAA,CAAA;AAEnG,EAAA,MAAMC,WAAW,GAAGT,GAAG,IAAIU,MAAM,EAAkB,CAAA;AACnD,EAAA,MAAMN,cAAc,GAAGC,mBAAmB,IAAIM,aAAa,EAAE,CAAA;EAC7D,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAGC,QAAQ,CAAC,KAAK,CAAC,CAAA;EAEzD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,UAAU,CAACC,gBAAgB,EAAE;AACrDC,IAAAA,YAAY,EAAE,EAAA;AAChB,GAAC,CAAC,CAAA;AAEF,EAAA,MAAMC,KAAK,GAAGC,OAAO,CACnB,OAAO;AACLC,IAAAA,YAAY,EAAEb,WAAwC;IACtDN,IAAI;IACJC,cAAc;IACdY,QAAQ;AACRO,IAAAA,GAAG,EAAEC,mBAAmB,CAACC,GAAG,CAACtB,IAAI,CAAC;IAClCY,KAAK;AACLW,IAAAA,mBAAmB,EAAEA,MAAMb,gBAAgB,CAAC,CAACD,aAAa,CAAA;GAC3D,CAAC,EACF,CAACT,IAAI,EAAEY,KAAK,EAAEH,aAAa,CAC7B,CAAC,CAAA;AAED,EAAA,oBACEe,KAAA,CAAAC,aAAA,CAAAC,KAAAA,EAAAA,QAAA,KACMvB,cAAc,EAAA;IAClBJ,SAAS,EAAE4B,UAAU,CAACjC,SAAS,CAACK,SAAS,EAAEA,SAAS,CAAE;AACtDF,IAAAA,GAAG,EAAES,WAAAA;AAAyC,GAAA,CAAA,eAE9CkB,KAAA,CAAAC,aAAA,CAACG,gBAAgB,CAACC,QAAQ,EAAA;AAACZ,IAAAA,KAAK,EAAEA,KAAAA;GAAiCnB,EAAAA,QAAoC,CACpG,CAAC,CAAA;AAEV,CAAC,EAAC;AACFJ,SAAS,CAACK,SAAS,GAAGN,SAAS,CAAA;AAC/BC,SAAS,CAACoC,WAAW,GAAGtC,cAAc;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../../src/components/Dashboard/context.ts"],"sourcesContent":["import React from 'react';\nimport { DashboardContextProps, DashboardReducerState } from './types';\n\nexport const initialState: DashboardReducerState = {\n tableFilters: [],\n};\n\nexport const DashboardContext = React.createContext<DashboardContextProps>({\n state: initialState,\n} as DashboardContextProps);\n"],"names":["initialState","tableFilters","DashboardContext","React","createContext","state"],"mappings":";;AAGO,MAAMA,YAAmC,GAAG;AACjDC,EAAAA,YAAY,EAAE,EAAA;AAChB,EAAC;MAEYC,gBAAgB,gBAAGC,KAAK,CAACC,aAAa,CAAwB;AACzEC,EAAAA,KAAK,EAAEL,YAAAA;AACT,CAA0B;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.js","sources":["../../../../src/components/Dashboard/reducer.ts"],"sourcesContent":["import { GridFilterItem } from '@redsift/table';\nimport {\n DashboardReducerState,\n DashboardReducerAction,\n DashboardReducerActionType,\n} from './types';\n\nconst areEquals = (\n tableFilter: GridFilterItem,\n actionFilter: GridFilterItem\n) => {\n return (\n tableFilter.columnField === actionFilter.columnField &&\n tableFilter.operatorValue === actionFilter.operatorValue\n );\n};\n\nconst addOrUpdateFilter = (\n oldFilters: GridFilterItem[],\n newFilter: GridFilterItem\n) => {\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 = (\n oldFilters: GridFilterItem[],\n newFilters: GridFilterItem[]\n) => {\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 = (\n oldFilters: GridFilterItem[],\n newFilter: GridFilterItem\n) => {\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(\n state.tableFilters,\n action.filter as GridFilterItem\n ),\n };\n case DashboardReducerActionType.ResetFilters:\n return { ...state, tableFilters: removeAllFilters() };\n case DashboardReducerActionType.FilterTable:\n return {\n ...state,\n tableFilters: addOrUpdateFilter(\n state.tableFilters,\n action.filter as GridFilterItem\n ),\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(\n state.tableFilters,\n action.filter as GridFilterItem[]\n ),\n };\n }\n};\n"],"names":["areEquals","tableFilter","actionFilter","columnField","operatorValue","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"],"mappings":";;;AAOA,MAAMA,SAAS,GAAGA,CAChBC,WAA2B,EAC3BC,YAA4B,KACzB;AACH,EAAA,OACED,WAAW,CAACE,WAAW,KAAKD,YAAY,CAACC,WAAW,IACpDF,WAAW,CAACG,aAAa,KAAKF,YAAY,CAACE,aAAa,CAAA;AAE5D,CAAC,CAAA;AAED,MAAMC,iBAAiB,GAAGA,CACxBC,UAA4B,EAC5BC,SAAyB,KACtB;AACH,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,CAAC,CAAA;AACnC,GAAA;AACF,CAAC,CAAA;AAED,MAAMI,kBAAkB,GAAGA,CACzBL,UAA4B,EAC5BM,UAA4B,KACzB;EACH,IAAIC,cAAc,GAAGP,UAAU,CAAA;AAC/B,EAAA,KAAK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CAAA,EAAA,EACKL,KAAK,CAAA,EAAA,EAAA,EAAA;QACRM,YAAY,EAAExB,iBAAiB,CAC7BkB,KAAK,CAACM,YAAY,EAClBL,MAAM,CAACJ,MACT,CAAA;AAAC,OAAA,CAAA,CAAA;IAGL,KAAKM,0BAA0B,CAACM,gBAAgB;AAC9C,MAAA,OAAAJ,cAAA,CAAAA,cAAA,CAAA,EAAA,EACKL,KAAK,CAAA,EAAA,EAAA,EAAA;AACRM,QAAAA,YAAY,EAAEb,cAAc,CAACQ,MAAM,CAACJ,MAAO,CAAA;AAAC,OAAA,CAAA,CAAA;IAGhD,KAAKM,0BAA0B,CAACO,sBAAsB;AACpD,MAAA,OAAAL,cAAA,CAAAA,cAAA,CAAA,EAAA,EACKL,KAAK,CAAA,EAAA,EAAA,EAAA;QACRM,YAAY,EAAElB,kBAAkB,CAC9BY,KAAK,CAACM,YAAY,EAClBL,MAAM,CAACJ,MACT,CAAA;AAAC,OAAA,CAAA,CAAA;AAEP,GAAA;AACF;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
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;;;;"}
|
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Document, Page, View, Image, Text } from '@react-pdf/renderer';
|
|
3
|
-
import { getPdfStyles } from './styles.js';
|
|
4
|
-
|
|
5
|
-
// istanbul ignore file
|
|
6
|
-
const DEFAULT_COLUMN_WIDTH = 100;
|
|
7
|
-
const getWidthColumn = (width, totalW, nrColumns) => {
|
|
8
|
-
// calculation width column where the 7px margin between the columns is included
|
|
9
|
-
return `${Math.round(width * 100 / (totalW - 7 * (nrColumns - 1)))}%`;
|
|
10
|
-
};
|
|
11
|
-
const PdfTableRow = _ref => {
|
|
12
|
-
let {
|
|
13
|
-
rowIndex,
|
|
14
|
-
rowData,
|
|
15
|
-
columns,
|
|
16
|
-
styles,
|
|
17
|
-
totalWidth
|
|
18
|
-
} = _ref;
|
|
19
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
20
|
-
style: styles.tableRowContainer,
|
|
21
|
-
key: `row-${rowIndex}`
|
|
22
|
-
}, columns.map((column, index) => {
|
|
23
|
-
const {
|
|
24
|
-
field,
|
|
25
|
-
width
|
|
26
|
-
} = column;
|
|
27
|
-
let totalW = totalWidth;
|
|
28
|
-
let nrColumns = columns.length;
|
|
29
|
-
|
|
30
|
-
// The checkbox in the table will not be printed
|
|
31
|
-
if (field === '__check__') {
|
|
32
|
-
totalW = totalW - (width || 50);
|
|
33
|
-
nrColumns = nrColumns - 1;
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);
|
|
37
|
-
|
|
38
|
-
// Empty value will print '-'
|
|
39
|
-
if (!rowData[field]) {
|
|
40
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
41
|
-
style: {
|
|
42
|
-
width: widthColumn,
|
|
43
|
-
paddingVertical: 2,
|
|
44
|
-
marginRight: 7
|
|
45
|
-
},
|
|
46
|
-
key: `cell-${rowIndex}-${index}`
|
|
47
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
48
|
-
style: styles.tableCellText
|
|
49
|
-
}, '-'));
|
|
50
|
-
}
|
|
51
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
52
|
-
style: {
|
|
53
|
-
width: widthColumn,
|
|
54
|
-
paddingVertical: 2,
|
|
55
|
-
marginRight: 7
|
|
56
|
-
},
|
|
57
|
-
key: `cell-${rowIndex}-${index}`
|
|
58
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
59
|
-
style: styles.tableCellText
|
|
60
|
-
}, Array.isArray(rowData[field]) ? rowData[field].join(', ') : rowData[field]));
|
|
61
|
-
}));
|
|
62
|
-
};
|
|
63
|
-
const PdfTable = _ref2 => {
|
|
64
|
-
let {
|
|
65
|
-
dataTable,
|
|
66
|
-
styles,
|
|
67
|
-
localeText
|
|
68
|
-
} = _ref2;
|
|
69
|
-
const {
|
|
70
|
-
data,
|
|
71
|
-
columns,
|
|
72
|
-
totalWidth
|
|
73
|
-
} = dataTable;
|
|
74
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
75
|
-
style: styles.tableHeaderContainer
|
|
76
|
-
}, columns.map(column => {
|
|
77
|
-
let totalW = totalWidth;
|
|
78
|
-
let nrColumns = columns.length;
|
|
79
|
-
const {
|
|
80
|
-
field,
|
|
81
|
-
headerName,
|
|
82
|
-
width
|
|
83
|
-
} = column;
|
|
84
|
-
|
|
85
|
-
// The checkbox in the table will not be printed
|
|
86
|
-
if (field === '__check__') {
|
|
87
|
-
totalW = totalW - (width || 50);
|
|
88
|
-
nrColumns = nrColumns - 1;
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const widthColumn = getWidthColumn(width || DEFAULT_COLUMN_WIDTH, totalW, nrColumns);
|
|
92
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
93
|
-
style: {
|
|
94
|
-
width: widthColumn,
|
|
95
|
-
paddingVertical: 2,
|
|
96
|
-
marginRight: 7
|
|
97
|
-
},
|
|
98
|
-
key: `heading-${field}`
|
|
99
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
100
|
-
style: styles.tableCellHeaderText
|
|
101
|
-
}, headerName));
|
|
102
|
-
})), /*#__PURE__*/React.createElement(View, null, data.map((row, index) => {
|
|
103
|
-
if (index < 1000) {
|
|
104
|
-
return /*#__PURE__*/React.createElement(PdfTableRow, {
|
|
105
|
-
key: index,
|
|
106
|
-
rowIndex: index,
|
|
107
|
-
rowData: data[index],
|
|
108
|
-
columns: columns,
|
|
109
|
-
styles: styles,
|
|
110
|
-
totalWidth: totalWidth
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
})), data.length >= 1000 ? /*#__PURE__*/React.createElement(View, {
|
|
114
|
-
style: styles.constraintsContainer
|
|
115
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
116
|
-
style: styles.constraints
|
|
117
|
-
}, (localeText === null || localeText === void 0 ? void 0 : localeText.maxSizeDisclaimer) || 'Due to processing constraints this pdf is limited to the first 1000 rows of data.')) : null);
|
|
118
|
-
};
|
|
119
|
-
const Pagination = _ref3 => {
|
|
120
|
-
let {
|
|
121
|
-
styles
|
|
122
|
-
} = _ref3;
|
|
123
|
-
return /*#__PURE__*/React.createElement(Text, {
|
|
124
|
-
style: styles.pageNumber,
|
|
125
|
-
render: _ref4 => {
|
|
126
|
-
let {
|
|
127
|
-
pageNumber,
|
|
128
|
-
totalPages
|
|
129
|
-
} = _ref4;
|
|
130
|
-
return `${pageNumber}/${totalPages}`;
|
|
131
|
-
},
|
|
132
|
-
fixed: true
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
const PdfDocument = _ref5 => {
|
|
136
|
-
let {
|
|
137
|
-
dashboardImage,
|
|
138
|
-
introduction,
|
|
139
|
-
localeText,
|
|
140
|
-
logo,
|
|
141
|
-
dataTable,
|
|
142
|
-
primaryColor
|
|
143
|
-
} = _ref5;
|
|
144
|
-
const styles = getPdfStyles(primaryColor);
|
|
145
|
-
return /*#__PURE__*/React.createElement(Document, null, /*#__PURE__*/React.createElement(Page, {
|
|
146
|
-
size: "A4",
|
|
147
|
-
style: styles.page
|
|
148
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, logo ? /*#__PURE__*/React.createElement(View, {
|
|
149
|
-
style: styles.logoContainer
|
|
150
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
151
|
-
src: logo,
|
|
152
|
-
style: styles.logo
|
|
153
|
-
})) : null, introduction ? /*#__PURE__*/React.createElement(View, {
|
|
154
|
-
style: styles.introductionContainer
|
|
155
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
156
|
-
style: styles.introductionText
|
|
157
|
-
}, introduction)) : null, dashboardImage ? /*#__PURE__*/React.createElement(View, {
|
|
158
|
-
style: styles.dashboardImageContainer
|
|
159
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
160
|
-
src: dashboardImage
|
|
161
|
-
})) : null, dataTable ? /*#__PURE__*/React.createElement(View, {
|
|
162
|
-
style: styles.tableContainer
|
|
163
|
-
}, /*#__PURE__*/React.createElement(PdfTable, {
|
|
164
|
-
dataTable: dataTable,
|
|
165
|
-
styles: styles,
|
|
166
|
-
localeText: localeText
|
|
167
|
-
})) : null, /*#__PURE__*/React.createElement(Pagination, {
|
|
168
|
-
styles: styles
|
|
169
|
-
}))));
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export { PdfDocument };
|
|
173
|
-
//# sourceMappingURL=PdfDocument.js.map
|