@cdc/dashboard 4.23.11 → 4.24.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/dist/cdcdashboard.js +109007 -98738
- package/examples/DEV-6574.json +2224 -0
- package/examples/filters/Alabama.json +72 -0
- package/examples/filters/Alaska.json +1737 -0
- package/examples/filters/Arkansas.json +4713 -0
- package/examples/filters/California.json +212 -0
- package/examples/filters/Colorado.json +1500 -0
- package/examples/filters/Connecticut.json +559 -0
- package/examples/filters/Delaware.json +63 -0
- package/examples/filters/DistrictofColumbia.json +63 -0
- package/examples/filters/Florida.json +4217 -0
- package/examples/filters/States.json +146 -0
- package/examples/test.json +752 -0
- package/examples/zika.json +2274 -0
- package/index.html +5 -3
- package/package.json +9 -9
- package/src/CdcDashboard.tsx +124 -963
- package/src/CdcDashboardComponent.tsx +903 -0
- package/src/_stories/Dashboard.stories.tsx +2 -2
- package/src/components/Column.tsx +15 -12
- package/src/components/Header/Header.tsx +694 -0
- package/src/components/Header/index.tsx +1 -676
- package/src/components/MultiConfigTabs/MultiConfigTabs.tsx +106 -0
- package/src/components/MultiConfigTabs/MultiTabs.tsx +30 -0
- package/src/components/MultiConfigTabs/index.tsx +8 -0
- package/src/components/MultiConfigTabs/multiconfigtabs.styles.css +32 -0
- package/src/components/Widget.tsx +25 -9
- package/src/helpers/filterData.ts +73 -73
- package/src/helpers/generateValuesForFilter.ts +25 -29
- package/src/helpers/getUpdateConfig.ts +6 -2
- package/src/helpers/processData.ts +13 -0
- package/src/helpers/processDataLegacy.ts +14 -0
- package/src/{index.jsx → index.tsx} +2 -2
- package/src/scss/editor-panel.scss +14 -11
- package/src/scss/grid.scss +4 -6
- package/src/scss/main.scss +2 -8
- package/src/store/dashboard.actions.ts +10 -4
- package/src/store/dashboard.reducer.ts +74 -3
- package/src/types/ConfigRow.ts +6 -0
- package/src/types/Dashboard.ts +11 -0
- package/src/types/DashboardConfig.ts +23 -0
- package/src/types/InitialState.ts +10 -0
- package/src/types/MultiDashboard.ts +11 -0
- package/src/types/SharedFilter.ts +31 -20
- package/src/types/Config.ts +0 -27
|
@@ -5,8 +5,8 @@ import ExampleConfig_1 from './_mock/dashboard-gallery.json'
|
|
|
5
5
|
import ExampleConfig_2 from './_mock/dashboard-2.json'
|
|
6
6
|
import ExampleConfig_3 from './_mock/dashboard_no_filter.json'
|
|
7
7
|
import Dashboard_Filter from './_mock/dashboard-filter.json'
|
|
8
|
-
import Dashboard from '../
|
|
9
|
-
import { Config } from '../types/
|
|
8
|
+
import Dashboard from '../CdcDashboardComponent'
|
|
9
|
+
import { type DashboardConfig as Config } from '../types/DashboardConfig'
|
|
10
10
|
import { userEvent, within } from '@storybook/testing-library'
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof Dashboard> = {
|
|
@@ -7,19 +7,22 @@ import Widget from './Widget'
|
|
|
7
7
|
const Column = ({ data, rowIdx, colIdx }) => {
|
|
8
8
|
const { config } = useContext(DashboardContext)
|
|
9
9
|
|
|
10
|
-
const [{ isOver, canDrop }, drop] = useDrop(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const [{ isOver, canDrop }, drop] = useDrop(
|
|
11
|
+
() => ({
|
|
12
|
+
accept: 'vis-widget',
|
|
13
|
+
drop: () => ({
|
|
14
|
+
rowIdx,
|
|
15
|
+
colIdx,
|
|
16
|
+
canDrop
|
|
17
|
+
}),
|
|
18
|
+
canDrop: () => !data.widget,
|
|
19
|
+
collect: monitor => ({
|
|
20
|
+
isOver: monitor.isOver(),
|
|
21
|
+
canDrop: !!monitor.canDrop()
|
|
22
|
+
})
|
|
16
23
|
}),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
isOver: monitor.isOver(),
|
|
20
|
-
canDrop: !!monitor.canDrop()
|
|
21
|
-
})
|
|
22
|
-
}))
|
|
24
|
+
[config.activeDashboard]
|
|
25
|
+
)
|
|
23
26
|
|
|
24
27
|
const widget = data.widget ? config?.visualizations[data.widget] : null
|
|
25
28
|
if (widget && !widget.uid) widget.uid = data.widget
|