@cdc/core 4.24.10 → 4.24.11
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/components/AdvancedEditor/AdvancedEditor.tsx +17 -13
- package/components/Alert/components/Alert.tsx +34 -8
- package/components/DataTable/DataTable.tsx +12 -2
- package/components/DataTable/data-table.css +4 -22
- package/components/DataTable/helpers/boxplotCellMatrix.tsx +14 -13
- package/components/DataTable/helpers/getChartCellValue.ts +23 -5
- package/components/EditorPanel/ColumnsEditor.tsx +81 -36
- package/components/EditorPanel/DataTableEditor.tsx +33 -33
- package/components/EditorPanel/FieldSetWrapper.tsx +2 -2
- package/components/EditorPanel/Inputs.tsx +26 -16
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +30 -55
- package/components/Filters/Filters.tsx +12 -4
- package/components/Layout/components/Sidebar/components/sidebar.styles.scss +0 -4
- package/components/Layout/components/Visualization/visualizations.scss +1 -1
- package/components/Legend/Legend.Gradient.tsx +49 -34
- package/components/MultiSelect/MultiSelect.tsx +85 -62
- package/components/MultiSelect/multiselect.styles.css +10 -7
- package/components/NestedDropdown/NestedDropdown.tsx +40 -20
- package/components/NestedDropdown/nesteddropdown.styles.css +15 -13
- package/components/Table/Table.tsx +102 -34
- package/components/_stories/DataTable.stories.tsx +14 -0
- package/components/_stories/Filters.stories.tsx +57 -0
- package/components/_stories/_mocks/DataTable/no-data.json +108 -0
- package/components/ui/Icon.tsx +19 -6
- package/dist/cove-main.css +20 -54
- package/dist/cove-main.css.map +1 -1
- package/helpers/DataTransform.ts +2 -1
- package/helpers/cove/{number.js → number.ts} +25 -11
- package/helpers/fetchRemoteData.js +32 -37
- package/helpers/formatConfigBeforeSave.ts +1 -0
- package/helpers/queryStringUtils.ts +6 -0
- package/helpers/useDataVizClasses.ts +42 -20
- package/package.json +2 -2
- package/styles/_button-section.scss +1 -1
- package/styles/_global-variables.scss +3 -3
- package/styles/_global.scss +21 -22
- package/styles/_reset.scss +0 -11
- package/styles/filters.scss +0 -22
- package/styles/v2/base/_reset.scss +0 -7
- package/styles/v2/components/editor.scss +0 -4
- package/styles/v2/components/icon.scss +1 -1
- package/types/Axis.ts +2 -0
- package/types/BoxPlot.ts +5 -3
- package/types/Color.ts +1 -1
- package/types/Legend.ts +1 -2
- package/types/MarkupInclude.ts +1 -0
- package/types/Runtime.ts +3 -1
- package/types/Series.ts +8 -1
- package/types/Table.ts +1 -1
- package/types/Visualization.ts +7 -8
- package/components/ui/Select.jsx +0 -30
- package/helpers/getGradientLegendWidth.ts +0 -15
package/styles/_global.scss
CHANGED
|
@@ -53,15 +53,6 @@ strong {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.btn {
|
|
56
|
-
background: #005eaa;
|
|
57
|
-
color: #fff;
|
|
58
|
-
border: 0;
|
|
59
|
-
padding: 0.4em 0.8em;
|
|
60
|
-
font-size: 1em;
|
|
61
|
-
display: block;
|
|
62
|
-
border-radius: 0.3em;
|
|
63
|
-
transition: 0.1s background-color;
|
|
64
|
-
cursor: pointer;
|
|
65
56
|
&.full-width {
|
|
66
57
|
width: 100%;
|
|
67
58
|
}
|
|
@@ -89,17 +80,11 @@ strong {
|
|
|
89
80
|
}
|
|
90
81
|
}
|
|
91
82
|
|
|
92
|
-
&:hover {
|
|
93
|
-
transition: 0.1s all;
|
|
94
|
-
background: lighten(#005eaa, 5%);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
83
|
svg {
|
|
98
84
|
width: 16px;
|
|
99
85
|
height: 16px;
|
|
100
86
|
position: relative;
|
|
101
87
|
top: 2px;
|
|
102
|
-
margin-left: 5px;
|
|
103
88
|
}
|
|
104
89
|
}
|
|
105
90
|
|
|
@@ -122,13 +107,6 @@ textarea {
|
|
|
122
107
|
textarea {
|
|
123
108
|
min-height: 140px;
|
|
124
109
|
}
|
|
125
|
-
select {
|
|
126
|
-
width: 100%;
|
|
127
|
-
font-size: 1em;
|
|
128
|
-
font-weight: normal;
|
|
129
|
-
text-transform: none;
|
|
130
|
-
border: rgba(0, 0, 0, 0.3) 1px solid !important;
|
|
131
|
-
}
|
|
132
110
|
|
|
133
111
|
.input-group-text {
|
|
134
112
|
border-top-left-radius: 0;
|
|
@@ -194,3 +172,24 @@ section.footnotes {
|
|
|
194
172
|
.margin-left-href {
|
|
195
173
|
margin-left: 15px;
|
|
196
174
|
}
|
|
175
|
+
|
|
176
|
+
.btn.btn-primary:not([disabled]) {
|
|
177
|
+
background-color: $blue;
|
|
178
|
+
border-color: $blue;
|
|
179
|
+
&:hover:not([disabled]) {
|
|
180
|
+
background-color: darken($blue, 5%);
|
|
181
|
+
border-color: darken($blue, 5%);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
// after migration to TP5 this declaration should be removed and all references
|
|
187
|
+
// to it should be replaced with .form-select
|
|
188
|
+
.cove-form-select {
|
|
189
|
+
display: block;
|
|
190
|
+
width: 100%;
|
|
191
|
+
padding: 0.375rem 0.75rem;
|
|
192
|
+
border-radius: 0.25rem;
|
|
193
|
+
border: 1px solid var(--lightGray);
|
|
194
|
+
color: var(--darkGray);
|
|
195
|
+
}
|
package/styles/_reset.scss
CHANGED
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
.cdc-open-viz-module {
|
|
22
|
-
div,
|
|
23
22
|
span,
|
|
24
23
|
applet,
|
|
25
24
|
object,
|
|
@@ -67,8 +66,6 @@
|
|
|
67
66
|
ul,
|
|
68
67
|
li,
|
|
69
68
|
fieldset,
|
|
70
|
-
form,
|
|
71
|
-
label,
|
|
72
69
|
legend,
|
|
73
70
|
caption,
|
|
74
71
|
article,
|
|
@@ -99,14 +96,6 @@
|
|
|
99
96
|
vertical-align: baseline;
|
|
100
97
|
}
|
|
101
98
|
|
|
102
|
-
button {
|
|
103
|
-
border: 0;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
&:focus {
|
|
106
|
-
outline: 0;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
99
|
* {
|
|
111
100
|
box-sizing: border-box;
|
|
112
101
|
}
|
package/styles/filters.scss
CHANGED
|
@@ -26,24 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
// note the diff of section and no section above.
|
|
30
|
-
// Can't use nested selectors with top level section overwrites
|
|
31
|
-
section.filters-section {
|
|
32
|
-
// border: 1px solid #c7c7c7;
|
|
33
|
-
// padding: 10px;
|
|
34
|
-
border-radius: 10px;
|
|
35
|
-
margin-bottom: 10px;
|
|
36
|
-
display: block !important;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
29
|
div.single-filters {
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-wrap: wrap;
|
|
42
|
-
margin: 15px 0;
|
|
43
|
-
|
|
44
|
-
select {
|
|
45
|
-
width: auto !important;
|
|
46
|
-
}
|
|
47
30
|
|
|
48
31
|
label {
|
|
49
32
|
width: 100%;
|
|
@@ -57,11 +40,6 @@ div.single-filters {
|
|
|
57
40
|
}
|
|
58
41
|
}
|
|
59
42
|
|
|
60
|
-
.single-filters--dropdown {
|
|
61
|
-
width: auto;
|
|
62
|
-
display: flex;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
43
|
.single-filters--tab {
|
|
66
44
|
width: 100%;
|
|
67
45
|
display: flex;
|
package/types/Axis.ts
CHANGED
|
@@ -27,6 +27,7 @@ export type Axis = {
|
|
|
27
27
|
maxTickRotation?: number
|
|
28
28
|
min?: string
|
|
29
29
|
numTicks?: number
|
|
30
|
+
padding?: number
|
|
30
31
|
paddingPercent?: number
|
|
31
32
|
rightAxisSize?: number
|
|
32
33
|
rightHideAxis?: boolean
|
|
@@ -48,4 +49,5 @@ export type Axis = {
|
|
|
48
49
|
type: string
|
|
49
50
|
axisBBox: number
|
|
50
51
|
maxValue: string
|
|
52
|
+
sortByRecentDate: boolean
|
|
51
53
|
}
|
package/types/BoxPlot.ts
CHANGED
|
@@ -10,12 +10,14 @@ export type BoxPlot = {
|
|
|
10
10
|
q3: string
|
|
11
11
|
outliers: string
|
|
12
12
|
values: string
|
|
13
|
-
|
|
13
|
+
count: string
|
|
14
14
|
lowerBounds: string
|
|
15
15
|
upperBounds: string
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
plotNonOutlierValues: boolean
|
|
18
|
+
plots: [{ columnOutliers: []; columnLowerBounds: number; columnUpperBounds: number }]
|
|
18
19
|
categories: string[]
|
|
19
|
-
firstQuartilePercentage: number
|
|
20
20
|
geoType: string
|
|
21
|
+
hideOutliers: boolean
|
|
22
|
+
borders: string
|
|
21
23
|
}
|
package/types/Color.ts
CHANGED
package/types/Legend.ts
CHANGED
|
@@ -10,8 +10,7 @@ export type Legend = {
|
|
|
10
10
|
hideSuppressedLabels: boolean
|
|
11
11
|
highlightOnHover: boolean
|
|
12
12
|
label: string
|
|
13
|
-
|
|
14
|
-
position: string
|
|
13
|
+
position: 'left' | 'bottom' | 'top' | 'right' | 'side'
|
|
15
14
|
reverseLabelOrder: boolean
|
|
16
15
|
singleRow: boolean
|
|
17
16
|
type: string
|
package/types/MarkupInclude.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Visualization } from './Visualization'
|
|
|
5
5
|
export type MarkupIncludeConfig = Visualization & {
|
|
6
6
|
contentEditor: {
|
|
7
7
|
// Changing the base config object creates an infinite loop, nesting it is a workaround
|
|
8
|
+
allowHideSection?: boolean
|
|
8
9
|
inlineHTML: string
|
|
9
10
|
markupVariables: Variable[]
|
|
10
11
|
showHeader: boolean
|
package/types/Runtime.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Axis } from './Axis'
|
|
2
|
+
import { Series } from './Series'
|
|
2
3
|
|
|
3
4
|
export type ForecastingSeriesKey = {
|
|
4
5
|
stages: {
|
|
@@ -17,7 +18,8 @@ export type Runtime = {
|
|
|
17
18
|
}
|
|
18
19
|
xAxis: Axis
|
|
19
20
|
yAxis: Axis
|
|
20
|
-
|
|
21
|
+
series: Series
|
|
22
|
+
seriesKeys: string[]
|
|
21
23
|
seriesLabels: Record<string, any>
|
|
22
24
|
seriesLabelsAll: string[]
|
|
23
25
|
editorErrorMessage: string
|
package/types/Series.ts
CHANGED
package/types/Table.ts
CHANGED
package/types/Visualization.ts
CHANGED
|
@@ -19,20 +19,19 @@ import { DashboardFilters } from '@cdc/dashboard/src/types/DashboardFilters'
|
|
|
19
19
|
type DeprecatedVisualizationType = {
|
|
20
20
|
columns: Record<string, Partial<Column>>
|
|
21
21
|
confidenceKeys: ConfidenceInterval
|
|
22
|
-
dataFileName
|
|
23
|
-
dataFileSourceType
|
|
22
|
+
dataFileName?: string
|
|
23
|
+
dataFileSourceType?: string
|
|
24
24
|
dataFormat: any
|
|
25
|
-
datasets
|
|
25
|
+
datasets?: Record<string, any>
|
|
26
26
|
filters: VizFilter[]
|
|
27
27
|
general: General
|
|
28
28
|
legend: Legend
|
|
29
29
|
multiDashboards?: any[]
|
|
30
30
|
newViz: boolean
|
|
31
31
|
isResponsiveTicks: boolean
|
|
32
|
-
|
|
33
|
-
openModal: boolean
|
|
32
|
+
openModal?: boolean
|
|
34
33
|
orientation: 'vertical' | 'horizontal'
|
|
35
|
-
originalFormattedData
|
|
34
|
+
originalFormattedData?: any
|
|
36
35
|
runtime?: Runtime
|
|
37
36
|
series: Series
|
|
38
37
|
table: Table
|
|
@@ -49,7 +48,7 @@ type DeprecatedVisualizationType = {
|
|
|
49
48
|
| 'filtered-text'
|
|
50
49
|
| 'table'
|
|
51
50
|
| 'navigation'
|
|
52
|
-
usesSharedFilter
|
|
51
|
+
usesSharedFilter?: any
|
|
53
52
|
visualizationSubType: string
|
|
54
53
|
visualizationType: string
|
|
55
54
|
xAxis: Axis
|
|
@@ -63,7 +62,7 @@ type StatefulProperties = {
|
|
|
63
62
|
|
|
64
63
|
export type CommonVisualizationProperties = Partial<StatefulProperties> & {
|
|
65
64
|
showEditorPanel?: boolean
|
|
66
|
-
uid?: string // this is the actual key of the visualization object
|
|
65
|
+
uid?: string | number // this is the actual key of the visualization object
|
|
67
66
|
visualizationType?: string
|
|
68
67
|
filterBehavior: FilterBehavior
|
|
69
68
|
} & Partial<ConfigureData>
|
package/components/ui/Select.jsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
const Select = ({ label, value, options, fieldName, section = null, subsection = null, required = false, tooltip, onchange, initial: initialValue, ...attributes }) => {
|
|
4
|
-
let optionsJsx = options.map((optionName, index) => (
|
|
5
|
-
<option value={optionName} key={index}>
|
|
6
|
-
{optionName}
|
|
7
|
-
</option>
|
|
8
|
-
))
|
|
9
|
-
|
|
10
|
-
if (initialValue) {
|
|
11
|
-
optionsJsx.unshift(
|
|
12
|
-
<option value='' key='initial'>
|
|
13
|
-
{initialValue}
|
|
14
|
-
</option>
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<label>
|
|
20
|
-
<span className='edit-label'>
|
|
21
|
-
{label}
|
|
22
|
-
{tooltip}
|
|
23
|
-
</span>
|
|
24
|
-
<select className={required && !value ? 'warning' : ''} name={fieldName} value={value} onChange={onchange} {...attributes}>
|
|
25
|
-
{optionsJsx}
|
|
26
|
-
</select>
|
|
27
|
-
</label>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
export default Select
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export const getGradientLegendWidth = (containerWidth: number, currentViewport: string): number => {
|
|
2
|
-
const newWidth = Number(containerWidth)
|
|
3
|
-
switch (currentViewport) {
|
|
4
|
-
case 'lg':
|
|
5
|
-
return newWidth / 3
|
|
6
|
-
case 'md':
|
|
7
|
-
return newWidth / 2
|
|
8
|
-
case 'sm':
|
|
9
|
-
case 'xs':
|
|
10
|
-
case 'xxs':
|
|
11
|
-
return newWidth / 1.4
|
|
12
|
-
default:
|
|
13
|
-
return newWidth
|
|
14
|
-
}
|
|
15
|
-
}
|