@cdc/dashboard 4.26.1 → 4.26.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-8NmHlKRI.es.js +15 -0
- package/dist/cdcdashboard-BPoPzKPz.es.js +6 -0
- package/dist/cdcdashboard-Cf9_fbQf.es.js +6 -0
- package/dist/{cdcdashboard-dgT_1dIT.es.js → cdcdashboard-DQ00cQCm.es.js} +1 -20
- package/dist/cdcdashboard-jiQQPkty.es.js +6 -0
- package/dist/cdcdashboard.js +59394 -65183
- package/examples/default.json +522 -133
- package/examples/nested-dropdown.json +6985 -0
- package/examples/private/abc.json +467 -0
- package/examples/private/dash.json +12696 -0
- package/examples/private/npcr.json +1 -0
- package/examples/private/test.json +125407 -0
- package/examples/private/timeline-data.json +4994 -0
- package/examples/private/timeline.json +1708 -0
- package/examples/test-api-filter-reset.json +8 -4
- package/examples/tp5-gauges.json +196 -0
- package/examples/tp5-test.json +266 -0
- package/index.html +1 -29
- package/package.json +38 -40
- package/src/CdcDashboardComponent.tsx +0 -3
- package/src/_stories/Dashboard.DataSetup.stories.tsx +2 -1
- package/src/_stories/Dashboard.stories.tsx +27 -5
- package/src/_stories/_mock/dashboard-line-chart-angles.json +1030 -0
- package/src/_stories/_mock/tp5-test.json +267 -0
- package/src/components/DashboardFilters/DashboardFiltersEditor/DashboardFiltersEditor.tsx +3 -0
- package/src/components/DashboardFilters/DashboardFiltersEditor/components/FilterEditor.tsx +5 -1
- package/src/components/DashboardFilters/DashboardFiltersEditor/components/NestedDropDownDashboard.tsx +5 -1
- package/src/components/VisualizationRow.tsx +30 -25
- package/src/components/VisualizationsPanel/VisualizationsPanel.tsx +0 -17
- package/src/helpers/addValuesToDashboardFilters.ts +17 -11
- package/src/helpers/apiFilterHelpers.ts +28 -32
- package/src/helpers/tests/addValuesToDashboardFilters.test.ts +141 -44
- package/src/helpers/tests/apiFilterHelpers.test.ts +523 -420
- package/src/scss/main.scss +8 -5
- package/vite.config.js +7 -1
- package/dist/cdcdashboard-BnB1QM5d.es.js +0 -361528
- package/dist/cdcdashboard-Ct2SB0vL.es.js +0 -231049
- package/dist/cdcdashboard-D6CG2-Hb.es.js +0 -39377
- package/dist/cdcdashboard-MXgURbdZ.es.js +0 -39194
|
@@ -35,6 +35,8 @@ import CascadingDataFilters from './_mock/filter-cascade.json'
|
|
|
35
35
|
import ParentChildFilters from './_mock/parent-child-filters.json'
|
|
36
36
|
import NestedParentChildFilters from './_mock/nested-parent-child-filters.json'
|
|
37
37
|
import GalleryDataBiteDashboard from './_mock/gallery-data-bite-dashboard.json'
|
|
38
|
+
import TP5TestConfig from './_mock/tp5-test.json'
|
|
39
|
+
import LineChartAnglesConfig from './_mock/dashboard-line-chart-angles.json'
|
|
38
40
|
|
|
39
41
|
// Dashboard Filter Updates for Ascending, Descending, and Custom Order
|
|
40
42
|
import DashboardFilterAsc from './_mock/dashboard-filter-asc.json'
|
|
@@ -103,6 +105,20 @@ export const Example_3: Story = {
|
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
|
|
108
|
+
export const TP5_Test_Dashboard: Story = {
|
|
109
|
+
args: {
|
|
110
|
+
config: TP5TestConfig,
|
|
111
|
+
isEditor: false
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const Line_Chart_Angles: Story = {
|
|
116
|
+
args: {
|
|
117
|
+
config: LineChartAnglesConfig,
|
|
118
|
+
isEditor: false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
106
122
|
export const Bump_Chart_Dashboard: Story = {
|
|
107
123
|
args: {
|
|
108
124
|
config: BumpChartConfig,
|
|
@@ -792,20 +808,26 @@ export const Nested_Dropdown_With_Parent_Child: Story = {
|
|
|
792
808
|
|
|
793
809
|
// Get filter dropdowns
|
|
794
810
|
const regionFilter = (await canvas.findByLabelText('Region', { selector: 'select' })) as HTMLSelectElement
|
|
795
|
-
const
|
|
796
|
-
selector: 'select'
|
|
797
|
-
})) as HTMLSelectElement
|
|
811
|
+
const yearQuarterInput = canvasElement.querySelector('.nested-dropdown input') as HTMLInputElement
|
|
798
812
|
|
|
799
813
|
const getFilterOptions = (select: HTMLSelectElement) =>
|
|
800
814
|
Array.from(select.options)
|
|
801
815
|
.map(o => o.text)
|
|
802
816
|
.filter(Boolean)
|
|
803
817
|
|
|
818
|
+
const getNestedDropdownOptions = () => {
|
|
819
|
+
const container = yearQuarterInput.closest('.nested-dropdown')
|
|
820
|
+
if (!container) return []
|
|
821
|
+
return Array.from(container.querySelectorAll('li[role="treeitem"]'))
|
|
822
|
+
.map(li => li.getAttribute('aria-label') || li.textContent?.trim() || '')
|
|
823
|
+
.filter(Boolean)
|
|
824
|
+
}
|
|
825
|
+
|
|
804
826
|
const getState = () => ({
|
|
805
827
|
regionOptions: getFilterOptions(regionFilter),
|
|
806
828
|
regionSelected: regionFilter.value,
|
|
807
|
-
yearQuarterOptions:
|
|
808
|
-
yearQuarterSelected:
|
|
829
|
+
yearQuarterOptions: getNestedDropdownOptions(),
|
|
830
|
+
yearQuarterSelected: yearQuarterInput.value,
|
|
809
831
|
chartRendered: !!canvasElement.querySelector('svg')
|
|
810
832
|
})
|
|
811
833
|
|