@cdc/core 4.25.3 → 4.25.6
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/assets/icon-close.svg +1 -1
- package/components/Alert/components/Alert.tsx +1 -1
- package/components/DataTable/DataTable.tsx +18 -16
- package/components/DataTable/DataTableStandAlone.tsx +15 -9
- package/components/DataTable/components/CellAnchor.tsx +1 -1
- package/components/DataTable/components/ChartHeader.tsx +8 -5
- package/components/DataTable/components/DataTableEditorPanel.tsx +25 -3
- package/components/DataTable/components/MapHeader.tsx +1 -0
- package/components/DataTable/helpers/chartCellMatrix.tsx +14 -10
- package/components/DataTable/helpers/getChartCellValue.ts +42 -26
- package/components/DataTable/helpers/mapCellMatrix.tsx +25 -7
- package/components/DownloadButton.tsx +17 -2
- package/components/EditorPanel/DataTableEditor.tsx +1 -1
- package/components/EditorPanel/FootnotesEditor.tsx +76 -22
- package/components/EditorPanel/Inputs.tsx +12 -4
- package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +3 -2
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +51 -35
- package/components/Filters/Filters.tsx +158 -461
- package/components/Filters/components/Dropdown.tsx +39 -0
- package/components/Filters/components/Tabs.tsx +82 -0
- package/components/Filters/helpers/getChangedFilters.ts +31 -0
- package/components/Filters/helpers/getNestedOptions.ts +2 -2
- package/components/Filters/helpers/handleSorting.ts +2 -2
- package/components/Filters/helpers/tests/getChangedFilters.test.ts +92 -0
- package/components/Filters/helpers/tests/getNestedOptions.test.ts +31 -0
- package/components/Filters/index.ts +1 -1
- package/components/Footnotes/Footnotes.tsx +1 -1
- package/components/Footnotes/FootnotesStandAlone.tsx +8 -33
- package/components/Layout/components/Visualization/index.tsx +4 -3
- package/components/Legend/Legend.Gradient.tsx +68 -24
- package/components/MultiSelect/MultiSelect.tsx +3 -6
- package/components/MultiSelect/multiselect.styles.css +2 -0
- package/components/NestedDropdown/NestedDropdown.tsx +21 -21
- package/components/RichTooltip/RichTooltip.tsx +37 -0
- package/components/RichTooltip/richTooltip.css +16 -0
- package/components/Table/Table.tsx +142 -142
- package/components/Table/components/Row.tsx +1 -1
- package/components/Table/table.styles.css +10 -0
- package/components/_stories/DataTable.stories.tsx +9 -2
- package/components/_stories/Table.stories.tsx +1 -1
- package/components/_stories/styles.scss +0 -4
- package/components/ui/Accordion.jsx +8 -1
- package/components/ui/Title/index.tsx +4 -1
- package/components/ui/Title/{Title.scss → title.styles.css} +0 -2
- package/components/ui/_stories/Colors.stories.mdx +220 -0
- package/components/ui/_stories/IconGallery.stories.mdx +14 -0
- package/components/ui/_stories/Title.stories.tsx +29 -4
- package/components/ui/accordion.styles.css +3 -0
- package/data/colorPalettes.js +0 -1
- package/dist/cove-main.css +3 -8
- package/dist/cove-main.css.map +1 -1
- package/helpers/constants.ts +6 -0
- package/helpers/cove/accessibility.ts +7 -8
- package/helpers/cove/number.ts +5 -3
- package/helpers/coveUpdateWorker.ts +7 -1
- package/helpers/filterOrderOptions.ts +17 -0
- package/helpers/formatConfigBeforeSave.ts +19 -32
- package/helpers/isNumber.ts +20 -0
- package/helpers/isRightAlignedTableValue.js +1 -1
- package/helpers/pivotData.ts +16 -11
- package/helpers/tests/pivotData.test.ts +74 -0
- package/helpers/updateFieldFactory.ts +1 -0
- package/helpers/ver/4.25.3.ts +25 -2
- package/helpers/ver/4.25.4.ts +110 -0
- package/helpers/ver/4.25.6.ts +36 -0
- package/helpers/ver/tests/4.25.4.test.ts +89 -0
- package/helpers/ver/tests/4.25.6.test.ts +84 -0
- package/helpers/viewports.ts +4 -0
- package/package.json +7 -6
- package/styles/_global-variables.scss +3 -0
- package/styles/_reset.scss +0 -6
- package/styles/v2/main.scss +0 -5
- package/types/Axis.ts +2 -0
- package/types/DataSet.ts +14 -0
- package/types/Footnotes.ts +5 -2
- package/types/General.ts +1 -0
- package/types/Legend.ts +1 -0
- package/types/Table.ts +1 -0
- package/types/Visualization.ts +3 -12
- package/types/VizFilter.ts +3 -0
- package/components/ui/_stories/Colors.stories.tsx +0 -92
- package/components/ui/_stories/Icon.stories.tsx +0 -29
- package/helpers/cove/fontSettings.ts +0 -2
- package/helpers/isNumber.js +0 -24
- package/helpers/isNumberLog.js +0 -18
- /package/helpers/{fetchRemoteData.js → fetchRemoteData.ts} +0 -0
package/types/Table.ts
CHANGED
package/types/Visualization.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { FilterBehavior } from './FilterBehavior'
|
|
|
10
10
|
import { General } from './General'
|
|
11
11
|
import { Runtime } from './Runtime'
|
|
12
12
|
import { DashboardFilters } from '@cdc/dashboard/src/types/DashboardFilters'
|
|
13
|
+
import Footnotes from './Footnotes'
|
|
13
14
|
|
|
14
15
|
// This was originally created as a catchall for the different types of visualizations.
|
|
15
16
|
// Currently it includes properties that ares specific to one Visualization type.
|
|
@@ -26,7 +27,6 @@ type DeprecatedVisualizationType = {
|
|
|
26
27
|
filters: VizFilter[]
|
|
27
28
|
general: General
|
|
28
29
|
legend: Legend
|
|
29
|
-
multiDashboards?: any[]
|
|
30
30
|
newViz: boolean
|
|
31
31
|
isResponsiveTicks: boolean
|
|
32
32
|
openModal?: boolean
|
|
@@ -37,17 +37,7 @@ type DeprecatedVisualizationType = {
|
|
|
37
37
|
table: Table
|
|
38
38
|
theme: string
|
|
39
39
|
title: string
|
|
40
|
-
type:
|
|
41
|
-
| 'dashboard'
|
|
42
|
-
| 'chart'
|
|
43
|
-
| 'footnotes'
|
|
44
|
-
| 'map'
|
|
45
|
-
| 'data-bite'
|
|
46
|
-
| 'waffle-chart'
|
|
47
|
-
| 'markup-include'
|
|
48
|
-
| 'filtered-text'
|
|
49
|
-
| 'table'
|
|
50
|
-
| 'navigation'
|
|
40
|
+
type: 'chart' | 'map' | 'data-bite' | 'waffle-chart' | 'markup-include' | 'filtered-text' | 'table' | 'navigation'
|
|
51
41
|
usesSharedFilter?: any
|
|
52
42
|
visualizationSubType: string
|
|
53
43
|
visualizationType: string
|
|
@@ -65,6 +55,7 @@ export type CommonVisualizationProperties = Partial<StatefulProperties> & {
|
|
|
65
55
|
uid?: string | number // this is the actual key of the visualization object
|
|
66
56
|
visualizationType?: string
|
|
67
57
|
filterBehavior: FilterBehavior
|
|
58
|
+
footnotes?: Footnotes
|
|
68
59
|
} & Partial<ConfigureData>
|
|
69
60
|
|
|
70
61
|
export type Visualization = DeprecatedVisualizationType & CommonVisualizationProperties
|
package/types/VizFilter.ts
CHANGED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
2
|
-
|
|
3
|
-
const COLORS = [
|
|
4
|
-
['baseColor', '#333'],
|
|
5
|
-
['blue', '#005eaa'],
|
|
6
|
-
['lightestGray', '#f2f2f2'],
|
|
7
|
-
['lightGray', '#c7c7c7'],
|
|
8
|
-
['mediumGray', '#565656'],
|
|
9
|
-
['darkGray', '#333'],
|
|
10
|
-
['red', '#d8000c'],
|
|
11
|
-
['white', '#fff'],
|
|
12
|
-
|
|
13
|
-
['primary', '#005eaa'],
|
|
14
|
-
['secondary', '#88c3ea'],
|
|
15
|
-
['tertiary', '#c0e9ff'],
|
|
16
|
-
['quaternary', '#edf9ff'],
|
|
17
|
-
|
|
18
|
-
['purple-primary', '#712177'],
|
|
19
|
-
['purple-secondary', '#b890bb'],
|
|
20
|
-
['purple-tertiary', '#e3d3e4'],
|
|
21
|
-
['purple-quaternary', '#f7f2f7'],
|
|
22
|
-
|
|
23
|
-
['brown-primary', '#705043'],
|
|
24
|
-
['brown-secondary', '#ad907b'],
|
|
25
|
-
['brown-tertiary', '#d7ccc8'],
|
|
26
|
-
['brown-quaternary', '#f2ebe8'],
|
|
27
|
-
|
|
28
|
-
['teal-primary', '#00695c'],
|
|
29
|
-
['teal-secondary', '#4ebaaa'],
|
|
30
|
-
['teal-tertiary', '#ceece7'],
|
|
31
|
-
['teal-quaternary', '#ebf7f5'],
|
|
32
|
-
|
|
33
|
-
['pink-primary', '#af4448'],
|
|
34
|
-
['pink-secondary', '#e57373'],
|
|
35
|
-
['pink-tertiary', '#ffc2c2'],
|
|
36
|
-
['pink-quaternary', '#ffe7e7'],
|
|
37
|
-
|
|
38
|
-
['orange-primary', '#bb4d00'],
|
|
39
|
-
['orange-secondary', '#ffad42'],
|
|
40
|
-
['orange-tertiary', '#ffe97d'],
|
|
41
|
-
['orange-quaternary', '#fff4cf'],
|
|
42
|
-
|
|
43
|
-
['slate-primary', '#29434e'],
|
|
44
|
-
['slate-secondary', '#7e9ba5'],
|
|
45
|
-
['slate-tertiary', '#b6c6d2'],
|
|
46
|
-
['slate-quaternary', '#e2e8ed'],
|
|
47
|
-
|
|
48
|
-
['indigo-primary', '#26418f'],
|
|
49
|
-
['indigo-secondary', '#92a6dd'],
|
|
50
|
-
['indigo-tertiary', '#dee8ff'],
|
|
51
|
-
['indigo-quaternary', '#f2f6ff'],
|
|
52
|
-
|
|
53
|
-
['cyan-primary', '#006778'],
|
|
54
|
-
['cyan-secondary', '#65b0bd'],
|
|
55
|
-
['cyan-tertiary', '#cce5e9'],
|
|
56
|
-
['cyan-quaternary', '#ebf5f6'],
|
|
57
|
-
|
|
58
|
-
['green-primary', '#4b830d'],
|
|
59
|
-
['green-secondary', '#84bc49'],
|
|
60
|
-
['green-tertiary', '#dcedc8'],
|
|
61
|
-
['green-quaternary', '#f1f8e9'],
|
|
62
|
-
|
|
63
|
-
['amber-primary', '#fbab18'],
|
|
64
|
-
['amber-secondary', '#ffd54f'],
|
|
65
|
-
['amber-tertiary', '#ffecb3'],
|
|
66
|
-
['amber-quaternary', '#fff7e1']
|
|
67
|
-
]
|
|
68
|
-
|
|
69
|
-
const ColorArray = () => {
|
|
70
|
-
return (
|
|
71
|
-
<table className='table'>
|
|
72
|
-
{COLORS.map(([name, hex]) => (
|
|
73
|
-
<tr>
|
|
74
|
-
<td style={{ background: hex, width: '60px' }}></td>
|
|
75
|
-
<td>{name}</td>
|
|
76
|
-
<td>{hex}</td>
|
|
77
|
-
</tr>
|
|
78
|
-
))}
|
|
79
|
-
</table>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const meta: Meta<typeof ColorArray> = {
|
|
84
|
-
title: 'Components/Atoms/Colors',
|
|
85
|
-
component: ColorArray
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
type Story = StoryObj<typeof ColorArray>
|
|
89
|
-
|
|
90
|
-
export const Primary: Story = {}
|
|
91
|
-
|
|
92
|
-
export default meta
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
-
|
|
4
|
-
import Icon, { ICON_TYPES } from '../Icon'
|
|
5
|
-
|
|
6
|
-
const IconArray = () => {
|
|
7
|
-
return (
|
|
8
|
-
<>
|
|
9
|
-
{ICON_TYPES.map(name => (
|
|
10
|
-
<div>
|
|
11
|
-
<span>
|
|
12
|
-
<Icon display={name} /> {name}{' '}
|
|
13
|
-
</span>
|
|
14
|
-
</div>
|
|
15
|
-
))}
|
|
16
|
-
</>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const meta: Meta<typeof IconArray> = {
|
|
21
|
-
title: 'Components/Atoms/Icon',
|
|
22
|
-
component: IconArray
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
type Story = StoryObj<typeof Icon>
|
|
26
|
-
|
|
27
|
-
export const Primary: Story = {}
|
|
28
|
-
|
|
29
|
-
export default meta
|
package/helpers/isNumber.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* isNumber
|
|
3
|
-
*
|
|
4
|
-
* There are many ways this could be written but this one is working
|
|
5
|
-
* to check if something is a number or not
|
|
6
|
-
* Input: value
|
|
7
|
-
*
|
|
8
|
-
* Output: boolean: true or false
|
|
9
|
-
*/
|
|
10
|
-
export default function isNumber(value = '') {
|
|
11
|
-
// if you need to check data to see if there is junk in there that can't be handled
|
|
12
|
-
// you can run the points through this and see values on the console
|
|
13
|
-
// in debugging I saw cases where inbound was a 'number'
|
|
14
|
-
// and other times a 'string' so might as well take care of both here
|
|
15
|
-
if (typeof value === 'number') {
|
|
16
|
-
return !Number.isNaN(value)
|
|
17
|
-
}
|
|
18
|
-
if (typeof value === 'string') {
|
|
19
|
-
return value !== null && value !== '' && /\d+\.?\d*/.test(value)
|
|
20
|
-
// regex explanation: if 1 or more digits, and a decimal followed by 0 or more digits,
|
|
21
|
-
// then its a number
|
|
22
|
-
}
|
|
23
|
-
return false // if we get here something is wrong so return false
|
|
24
|
-
}
|
package/helpers/isNumberLog.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export default function isNumberLog(value = '', state = null) {
|
|
2
|
-
// if you need to check data to see if there is junk in there that can't be handled
|
|
3
|
-
// you can run the points through this and see values on the console
|
|
4
|
-
console.log("entering isNumberLog value, valuetype:",value,typeof value);
|
|
5
|
-
var test;
|
|
6
|
-
if (typeof value === 'number') {
|
|
7
|
-
test = !Number.isNaN(value)
|
|
8
|
-
}
|
|
9
|
-
if (typeof value === 'string') {
|
|
10
|
-
test = value !== null && value !== '' && /\d+\.?\d*/.test(value)
|
|
11
|
-
}
|
|
12
|
-
if (test === false) {
|
|
13
|
-
console.log('# isNumberLog FALSE on value, result', value, test)
|
|
14
|
-
} else {
|
|
15
|
-
console.log('# isNumberLog TRUE on value, result', value, test)
|
|
16
|
-
}
|
|
17
|
-
return test
|
|
18
|
-
}
|
|
File without changes
|