@cdc/core 4.25.10 → 4.26.1
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/_stories/Gallery.Charts.stories.tsx +307 -0
- package/_stories/Gallery.DataBite.stories.tsx +72 -0
- package/_stories/Gallery.Maps.stories.tsx +230 -0
- package/_stories/Gallery.WaffleChart.stories.tsx +187 -0
- package/_stories/PageART.stories.tsx +192 -0
- package/_stories/PageBRFSS.stories.tsx +289 -0
- package/_stories/PageCancerRegistries.stories.tsx +199 -0
- package/_stories/PageEasternEquineEncephalitis.stories.tsx +202 -0
- package/_stories/PageExcessiveAlcoholUse.stories.tsx +196 -0
- package/_stories/PageMaternalMortality.stories.tsx +192 -0
- package/_stories/PageOralHealth.stories.tsx +196 -0
- package/_stories/PageRespiratory.stories.tsx +332 -0
- package/_stories/PageSmokingTobacco.stories.tsx +195 -0
- package/_stories/PageStateDiabetesProfiles.stories.tsx +196 -0
- package/_stories/PageWastewater.stories.tsx +463 -0
- package/_stories/StoryRenderingTests.stories.tsx +164 -0
- package/assets/icon-magnifying-glass.svg +5 -0
- package/assets/icon-warming-stripes.svg +13 -0
- package/components/AdvancedEditor/AdvancedEditor.tsx +7 -1
- package/components/AdvancedEditor/EmbedEditor.tsx +281 -0
- package/components/ComboBox/ComboBox.tsx +345 -0
- package/components/ComboBox/combobox.styles.css +185 -0
- package/components/ComboBox/index.ts +1 -0
- package/components/CustomColorsEditor/CustomColorsEditor.css +299 -0
- package/components/CustomColorsEditor/CustomColorsEditor.tsx +209 -0
- package/components/CustomColorsEditor/index.ts +1 -0
- package/components/DataTable/DataTable.tsx +132 -58
- package/components/DataTable/DataTableStandAlone.tsx +8 -3
- package/components/DataTable/components/DataTableEditorPanel.tsx +12 -2
- package/components/DataTable/data-table.css +217 -210
- package/components/DataTable/helpers/mapCellMatrix.tsx +28 -9
- package/components/DataTable/helpers/standardizeState.js +2 -2
- package/components/DataTable/helpers/tests/standardizeState.test.js +54 -0
- package/components/EditorPanel/ColumnsEditor.tsx +37 -19
- package/components/EditorPanel/DataTableEditor.tsx +54 -28
- package/components/EditorPanel/EditorPanel.styles.css +439 -0
- package/components/EditorPanel/EditorPanel.tsx +144 -0
- package/components/EditorPanel/EditorPanelDispatch.tsx +75 -0
- package/components/EditorPanel/FieldSetWrapper.tsx +66 -23
- package/components/EditorPanel/FootnotesEditor.tsx +44 -37
- package/components/EditorPanel/Inputs.tsx +44 -8
- package/components/EditorPanel/VizFilterEditor/NestedDropdownEditor.tsx +35 -62
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +246 -175
- package/components/EditorPanel/components/MarkupVariablesEditor.tsx +61 -22
- package/components/EditorPanel/sections/VisualSection.tsx +169 -0
- package/components/Filters/Filters.tsx +57 -10
- package/components/Filters/components/Dropdown.tsx +6 -1
- package/components/Filters/helpers/getNestedOptions.ts +2 -1
- package/components/Filters/helpers/handleSorting.ts +1 -1
- package/components/Footnotes/Footnotes.tsx +35 -25
- package/components/Footnotes/FootnotesStandAlone.tsx +42 -6
- package/components/HeaderThemeSelector/HeaderThemeSelector.css +43 -0
- package/components/HeaderThemeSelector/HeaderThemeSelector.stories.tsx +74 -0
- package/components/HeaderThemeSelector/HeaderThemeSelector.tsx +61 -0
- package/components/HeaderThemeSelector/index.ts +2 -0
- package/components/Layout/components/Sidebar/components/sidebar.styles.scss +82 -0
- package/components/Layout/components/Visualization/index.tsx +16 -1
- package/components/Layout/components/Visualization/visualizations.scss +7 -0
- package/components/Layout/styles/editor.scss +2 -1
- package/components/Legend/Legend.Gradient.tsx +1 -1
- package/components/Loader/Loader.tsx +1 -1
- package/components/MediaControls.tsx +63 -34
- package/components/PaletteConversionModal.tsx +7 -4
- package/components/PaletteSelector/PaletteSelector.css +49 -6
- package/components/Table/components/Cell.tsx +23 -2
- package/components/Table/components/Row.tsx +5 -3
- package/components/_stories/Filters.stories.tsx +20 -1
- package/components/_stories/Footnotes.CSV.stories.tsx +247 -0
- package/components/_stories/Footnotes.stories.tsx +768 -3
- package/components/_stories/Inputs.stories.tsx +2 -2
- package/components/_stories/styles.scss +0 -1
- package/components/ui/Accordion.jsx +1 -1
- package/components/ui/Icon.tsx +3 -1
- package/components/ui/Title/index.tsx +30 -2
- package/components/ui/Title/title.styles.css +42 -0
- package/components/ui/accordion.styles.css +57 -0
- package/data/chartColorPalettes.ts +1 -1
- package/dist/cove-main.css +75 -6
- package/dist/cove-main.css.map +1 -1
- package/generateViteConfig.js +8 -1
- package/helpers/addValuesToFilters.ts +11 -1
- package/helpers/constants.ts +37 -0
- package/helpers/cove/number.ts +33 -12
- package/helpers/coveUpdateWorker.ts +20 -11
- package/helpers/embedCodeGenerator.ts +109 -0
- package/helpers/fetchRemoteData.ts +3 -15
- package/helpers/getUniqueValues.ts +19 -0
- package/helpers/hashObj.ts +25 -0
- package/helpers/isRightAlignedTableValue.js +5 -0
- package/helpers/markupProcessor.ts +27 -12
- package/helpers/mergeCustomOrderValues.ts +37 -0
- package/helpers/metrics/helpers.ts +1 -0
- package/helpers/parseCsvWithQuotes.ts +65 -0
- package/helpers/pivotData.ts +2 -2
- package/helpers/prepareScreenshot.ts +268 -0
- package/helpers/queryStringUtils.ts +29 -0
- package/helpers/testing.ts +17 -4
- package/helpers/tests/prepareScreenshot.test.ts +414 -0
- package/helpers/tests/queryStringUtils.test.ts +381 -0
- package/helpers/tests/testStandaloneBuild.ts +23 -5
- package/helpers/useDataVizClasses.ts +0 -1
- package/helpers/ver/4.25.11.ts +13 -0
- package/helpers/ver/4.26.1.ts +80 -0
- package/helpers/viewports.ts +2 -0
- package/hooks/useDataColumns.ts +63 -0
- package/hooks/useFilterManagement.ts +94 -0
- package/hooks/useLegendSeparators.ts +26 -0
- package/hooks/useListManagement.ts +192 -0
- package/package.json +6 -4
- package/styles/_button-section.scss +0 -3
- package/styles/_common-components.css +73 -0
- package/styles/_global.scss +25 -5
- package/styles/base.scss +0 -50
- package/styles/cove-main.scss +3 -1
- package/styles/filters.scss +10 -3
- package/styles/v2/base/index.scss +0 -1
- package/styles/v2/components/editor.scss +14 -6
- package/styles/v2/utils/_breakpoints.scss +1 -1
- package/styles/v2/utils/index.scss +0 -1
- package/styles/waiting.scss +1 -1
- package/types/Axis.ts +1 -0
- package/types/ForecastingSeriesKey.ts +1 -0
- package/types/MarkupInclude.ts +5 -3
- package/types/MarkupVariable.ts +1 -1
- package/types/Series.ts +3 -0
- package/types/Table.ts +1 -0
- package/types/Visualization.ts +1 -0
- package/types/VizFilter.ts +2 -0
- package/LICENSE +0 -201
- package/styles/_mixins.scss +0 -13
- package/styles/_typography.scss +0 -0
- package/styles/v2/base/_typography.scss +0 -0
- package/styles/v2/components/guidance-block.scss +0 -74
- package/styles/v2/utils/_functions.scss +0 -0
|
@@ -5,6 +5,7 @@ import { filterOrderOptions } from '../../../helpers/filterOrderOptions'
|
|
|
5
5
|
import FilterOrder from './components/FilterOrder'
|
|
6
6
|
import { Visualization } from '../../../types/Visualization'
|
|
7
7
|
import { useMemo } from 'react'
|
|
8
|
+
import { Select } from '../Inputs'
|
|
8
9
|
|
|
9
10
|
type NestedDropdownEditorProps = {
|
|
10
11
|
config: Visualization
|
|
@@ -155,43 +156,26 @@ const NestedDropdownEditor: React.FC<NestedDropdownEditorProps> = ({
|
|
|
155
156
|
/>
|
|
156
157
|
</label>
|
|
157
158
|
|
|
158
|
-
<
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
value={subGrouping?.columnName ?? ''}
|
|
179
|
-
onChange={e => {
|
|
180
|
-
handleSubGroupColumnNameChange(e.target.value)
|
|
181
|
-
}}
|
|
182
|
-
>
|
|
183
|
-
<option value=''>- Select Option -</option>
|
|
184
|
-
{columnNameOptions.map((option, index) => {
|
|
185
|
-
if (option !== filter.columnName) {
|
|
186
|
-
return (
|
|
187
|
-
<option value={option} key={index}>
|
|
188
|
-
{option}
|
|
189
|
-
</option>
|
|
190
|
-
)
|
|
191
|
-
}
|
|
192
|
-
})}
|
|
193
|
-
</select>
|
|
194
|
-
</label>
|
|
159
|
+
<Select
|
|
160
|
+
label='Filter Grouping'
|
|
161
|
+
value={filter.columnName}
|
|
162
|
+
options={[{ value: '', label: '- Select Option -' }, ...columnNameOptions.map(opt => ({ value: opt, label: opt }))]}
|
|
163
|
+
onChange={e => handleGroupColumnNameChange(e.target.value)}
|
|
164
|
+
/>
|
|
165
|
+
|
|
166
|
+
<Select
|
|
167
|
+
label='Filter SubGrouping'
|
|
168
|
+
value={subGrouping?.columnName ?? ''}
|
|
169
|
+
options={[
|
|
170
|
+
{ value: '', label: '- Select Option -' },
|
|
171
|
+
...columnNameOptions
|
|
172
|
+
.filter(option => option !== filter.columnName)
|
|
173
|
+
.map(opt => ({ value: opt, label: opt }))
|
|
174
|
+
]}
|
|
175
|
+
onChange={e => {
|
|
176
|
+
handleSubGroupColumnNameChange(e.target.value)
|
|
177
|
+
}}
|
|
178
|
+
/>
|
|
195
179
|
|
|
196
180
|
<label>
|
|
197
181
|
<input
|
|
@@ -229,39 +213,28 @@ const NestedDropdownEditor: React.FC<NestedDropdownEditorProps> = ({
|
|
|
229
213
|
)}
|
|
230
214
|
</label>
|
|
231
215
|
|
|
232
|
-
<
|
|
216
|
+
<div className='mt-2'>
|
|
233
217
|
<div className='edit-label column-heading float-right'>{filter.columnName} </div>
|
|
234
|
-
<
|
|
235
|
-
|
|
236
|
-
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
</option>
|
|
241
|
-
)
|
|
242
|
-
})}
|
|
243
|
-
</select>
|
|
218
|
+
<Select
|
|
219
|
+
label='Group Order'
|
|
220
|
+
value={filter.order}
|
|
221
|
+
options={filterOrderOptions}
|
|
222
|
+
onChange={e => handleGroupingOrderBy(e.target.value as OrderBy)}
|
|
223
|
+
/>
|
|
244
224
|
{filter.order === 'cust' && (
|
|
245
225
|
<FilterOrder orderedValues={filter.orderedValues} handleFilterOrder={handleGroupingCustomOrder} />
|
|
246
226
|
)}
|
|
247
|
-
</
|
|
227
|
+
</div>
|
|
248
228
|
|
|
249
229
|
{subGrouping?.columnName && (
|
|
250
|
-
<
|
|
251
|
-
<span className={'edit-filterOrder column-heading'}>SubGrouping Order</span>
|
|
230
|
+
<div className='mt-2'>
|
|
252
231
|
<div className='edit-label column-heading float-right'>{subGrouping.columnName} </div>
|
|
253
|
-
<
|
|
232
|
+
<Select
|
|
233
|
+
label='SubGrouping Order'
|
|
254
234
|
value={subGrouping.order ? subGrouping.order : 'asc'}
|
|
235
|
+
options={filterOrderOptions}
|
|
255
236
|
onChange={e => handleSubGroupingOrderBy(e.target.value as OrderBy)}
|
|
256
|
-
|
|
257
|
-
{filterOrderOptions.map((option, index) => {
|
|
258
|
-
return (
|
|
259
|
-
<option value={option.value} key={`filter-${index}`}>
|
|
260
|
-
{option.label}
|
|
261
|
-
</option>
|
|
262
|
-
)
|
|
263
|
-
})}
|
|
264
|
-
</select>
|
|
237
|
+
/>
|
|
265
238
|
{subGrouping?.order === 'cust' &&
|
|
266
239
|
filter.values.map((groupName, i) => {
|
|
267
240
|
const orderedSubGroupValues = subGrouping.valuesLookup[groupName].orderedValues
|
|
@@ -278,7 +251,7 @@ const NestedDropdownEditor: React.FC<NestedDropdownEditorProps> = ({
|
|
|
278
251
|
</div>
|
|
279
252
|
)
|
|
280
253
|
})}
|
|
281
|
-
</
|
|
254
|
+
</div>
|
|
282
255
|
)}
|
|
283
256
|
</div>
|
|
284
257
|
)
|
|
@@ -14,6 +14,7 @@ import FilterOrder from './components/FilterOrder'
|
|
|
14
14
|
import { useMemo, useState } from 'react'
|
|
15
15
|
import MultiSelect from '../../MultiSelect'
|
|
16
16
|
import NestedDropdownEditor from './NestedDropdownEditor'
|
|
17
|
+
import { DragDropContext, Droppable, Draggable } from '@hello-pangea/dnd'
|
|
17
18
|
|
|
18
19
|
type VizFilterProps = {
|
|
19
20
|
config: Visualization
|
|
@@ -28,6 +29,16 @@ const VizFilterEditor: React.FC<VizFilterProps> = ({ config, updateField, rawDat
|
|
|
28
29
|
return _.uniq(_.flatten(rawData?.map(row => Object.keys(row))))
|
|
29
30
|
}, [rawData])
|
|
30
31
|
|
|
32
|
+
// Helper function to get filter values from various sources
|
|
33
|
+
const getFilterValues = (filter: VizFilter) => {
|
|
34
|
+
if (filter.values && filter.values.length > 0) return filter.values
|
|
35
|
+
if (filter.orderedValues && filter.orderedValues.length > 0) return filter.orderedValues
|
|
36
|
+
if (filter.columnName && rawData && rawData.length > 0) {
|
|
37
|
+
return _.uniq(rawData.map(row => row[filter.columnName]))
|
|
38
|
+
}
|
|
39
|
+
return []
|
|
40
|
+
}
|
|
41
|
+
|
|
31
42
|
const removeFilter = index => {
|
|
32
43
|
let filters = _.cloneDeep(config.filters)
|
|
33
44
|
|
|
@@ -118,6 +129,26 @@ const VizFilterEditor: React.FC<VizFilterProps> = ({ config, updateField, rawDat
|
|
|
118
129
|
.map(({ label, columnName, id }) => ({ label: label || columnName, value: id }))
|
|
119
130
|
}
|
|
120
131
|
|
|
132
|
+
const handleFilterReorder = (idx1: number, idx2: number) => {
|
|
133
|
+
if (idx1 === undefined || idx2 === undefined || idx1 === idx2) return
|
|
134
|
+
const filters = _.cloneDeep(config.filters)
|
|
135
|
+
const [movedFilter] = filters.splice(idx1, 1)
|
|
136
|
+
filters.splice(idx2, 0, movedFilter)
|
|
137
|
+
updateField(null, null, 'filters', filters)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const getItemStyle = (isDragging: boolean, draggableStyle: any) => ({
|
|
141
|
+
...draggableStyle
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
const sortableItemStyles = {
|
|
145
|
+
animate: false,
|
|
146
|
+
animateReplay: true,
|
|
147
|
+
display: 'block',
|
|
148
|
+
boxSizing: 'border-box' as const,
|
|
149
|
+
border: '1px solid #D1D1D1'
|
|
150
|
+
}
|
|
151
|
+
|
|
121
152
|
return (
|
|
122
153
|
<>
|
|
123
154
|
{config.filters && (
|
|
@@ -150,188 +181,228 @@ const VizFilterEditor: React.FC<VizFilterProps> = ({ config, updateField, rawDat
|
|
|
150
181
|
fieldName='filterIntro'
|
|
151
182
|
/>
|
|
152
183
|
<br />
|
|
153
|
-
<
|
|
154
|
-
{
|
|
184
|
+
<DragDropContext
|
|
185
|
+
onDragEnd={({ source, destination }) => handleFilterReorder(source.index, destination?.index)}
|
|
186
|
+
>
|
|
187
|
+
<Droppable droppableId='filters_list'>
|
|
188
|
+
{provided => (
|
|
189
|
+
<ul {...provided.droppableProps} ref={provided.innerRef} className='draggable-field-list'>
|
|
190
|
+
{/* Whether filters should apply onChange or Apply Button */}
|
|
155
191
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
192
|
+
{config.filters.map((filter, filterIndex) => {
|
|
193
|
+
if (filter.type === 'url') return <></>
|
|
194
|
+
return (
|
|
195
|
+
<Draggable
|
|
196
|
+
key={filter.id || `filter-${filterIndex}`}
|
|
197
|
+
draggableId={`filter-${filter.id || filterIndex}`}
|
|
198
|
+
index={filterIndex}
|
|
199
|
+
>
|
|
200
|
+
{(provided, snapshot) => (
|
|
201
|
+
<div
|
|
202
|
+
ref={provided.innerRef}
|
|
203
|
+
{...provided.draggableProps}
|
|
204
|
+
{...provided.dragHandleProps}
|
|
205
|
+
className={snapshot.isDragging ? 'currently-dragging' : ''}
|
|
206
|
+
style={getItemStyle(snapshot.isDragging, provided.draggableProps.style)}
|
|
207
|
+
>
|
|
208
|
+
<FieldSetWrapper
|
|
209
|
+
key={filter.columnName}
|
|
210
|
+
fieldName={filter.columnName}
|
|
211
|
+
fieldKey={filterIndex}
|
|
212
|
+
fieldType='Filter'
|
|
213
|
+
controls={openControls}
|
|
214
|
+
deleteField={() => removeFilter(filterIndex)}
|
|
215
|
+
draggable={true}
|
|
216
|
+
>
|
|
217
|
+
<Select
|
|
218
|
+
value={filter.filterStyle}
|
|
219
|
+
fieldName='filterStyle'
|
|
220
|
+
label='Filter Style'
|
|
221
|
+
updateField={(_section, _subsection, _field, value) =>
|
|
222
|
+
updateFilterStyle(filterIndex, value)
|
|
223
|
+
}
|
|
224
|
+
options={filterStyleOptions}
|
|
225
|
+
/>
|
|
174
226
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
227
|
+
{filter.filterStyle !== 'nested-dropdown' ? (
|
|
228
|
+
<>
|
|
229
|
+
<Select
|
|
230
|
+
value={filter.columnName}
|
|
231
|
+
fieldName='columnName'
|
|
232
|
+
label='Filter'
|
|
233
|
+
updateField={(_section, _subsection, _field, value) =>
|
|
234
|
+
handleNameChange(filterIndex, value)
|
|
235
|
+
}
|
|
236
|
+
options={dataColumns}
|
|
237
|
+
initial='- Select Option -'
|
|
238
|
+
/>
|
|
185
239
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
240
|
+
{filter.columnName && (
|
|
241
|
+
<Select
|
|
242
|
+
value={filter.defaultValue}
|
|
243
|
+
options={
|
|
244
|
+
filter.resetLabel
|
|
245
|
+
? [filter.resetLabel, ...getFilterValues(filter)]
|
|
246
|
+
: getFilterValues(filter)
|
|
247
|
+
}
|
|
248
|
+
updateField={(_section, _subSection, _key, value) => {
|
|
249
|
+
updateFilterDefaultValue(filterIndex, value)
|
|
250
|
+
}}
|
|
251
|
+
label={`Filter Default Value${
|
|
252
|
+
filter.columnName ? ` (${filter.columnName})` : ''
|
|
253
|
+
}`}
|
|
254
|
+
initial='Select'
|
|
255
|
+
/>
|
|
256
|
+
)}
|
|
201
257
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
258
|
+
<label>
|
|
259
|
+
<span className='edit-label column-heading'>Label</span>
|
|
260
|
+
<input
|
|
261
|
+
type='text'
|
|
262
|
+
value={filter.label}
|
|
263
|
+
onChange={e => {
|
|
264
|
+
updateFilterProp('label', filterIndex, e.target.value)
|
|
265
|
+
}}
|
|
266
|
+
/>
|
|
267
|
+
</label>
|
|
212
268
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
269
|
+
{filter.filterStyle === 'multi-select' && (
|
|
270
|
+
<TextField
|
|
271
|
+
label='Select Limit'
|
|
272
|
+
value={(filter as MultiSelectFilter).selectLimit}
|
|
273
|
+
updateField={updateField}
|
|
274
|
+
section='filters'
|
|
275
|
+
subsection={filterIndex}
|
|
276
|
+
fieldName='selectLimit'
|
|
277
|
+
type='number'
|
|
278
|
+
tooltip={
|
|
279
|
+
<Tooltip style={{ textTransform: 'none' }}>
|
|
280
|
+
<Tooltip.Target>
|
|
281
|
+
<Icon display='question' style={{ marginLeft: '0.5rem' }} />
|
|
282
|
+
</Tooltip.Target>
|
|
283
|
+
<Tooltip.Content>
|
|
284
|
+
<p>The maximum number of items that can be selected.</p>
|
|
285
|
+
</Tooltip.Content>
|
|
286
|
+
</Tooltip>
|
|
287
|
+
}
|
|
288
|
+
/>
|
|
289
|
+
)}
|
|
234
290
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
291
|
+
<Select
|
|
292
|
+
value={filter.order || 'asc'}
|
|
293
|
+
fieldName='order'
|
|
294
|
+
label='Filter Order'
|
|
295
|
+
updateField={(_section, _subSection, _field, value) => {
|
|
296
|
+
updateFilterProp('order', filterIndex, value)
|
|
297
|
+
if (filter.orderColumn && value !== 'column')
|
|
298
|
+
updateFilterProp('orderColumn', filterIndex, '')
|
|
299
|
+
}}
|
|
300
|
+
options={filterOrderOptions}
|
|
301
|
+
/>
|
|
302
|
+
{filter.order === 'cust' && (
|
|
303
|
+
<FilterOrder
|
|
304
|
+
orderedValues={filter.orderedValues || filter.values}
|
|
305
|
+
handleFilterOrder={(index1, index2) =>
|
|
306
|
+
handleFilterOrder(index1, index2, filterIndex)
|
|
307
|
+
}
|
|
308
|
+
/>
|
|
309
|
+
)}
|
|
310
|
+
{filter.order === 'column' && (
|
|
311
|
+
<Select
|
|
312
|
+
value={filter.orderColumn}
|
|
313
|
+
fieldName='orderColumn'
|
|
314
|
+
label='Order Column'
|
|
315
|
+
updateField={(_section, _subSection, _field, value) =>
|
|
316
|
+
updateFilterProp('orderColumn', filterIndex, value)
|
|
317
|
+
}
|
|
318
|
+
options={dataColumns}
|
|
319
|
+
/>
|
|
320
|
+
)}
|
|
321
|
+
<label>
|
|
322
|
+
<span className='edit-label column-heading'>
|
|
323
|
+
Default Value Set By Query String Parameter
|
|
324
|
+
</span>
|
|
325
|
+
<input
|
|
326
|
+
type='text'
|
|
327
|
+
value={filter.setByQueryParameter}
|
|
328
|
+
onChange={e => {
|
|
329
|
+
updateFilterProp('setByQueryParameter', filterIndex, e.target.value)
|
|
330
|
+
}}
|
|
331
|
+
/>
|
|
332
|
+
</label>
|
|
272
333
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
334
|
+
<label>
|
|
335
|
+
<input
|
|
336
|
+
type='checkbox'
|
|
337
|
+
checked={filter.showDropdown === undefined ? true : filter.showDropdown}
|
|
338
|
+
onChange={e => {
|
|
339
|
+
updateFilterProp('showDropdown', filterIndex, e.target.checked)
|
|
340
|
+
}}
|
|
341
|
+
/>
|
|
342
|
+
<span className='edit-showDropdown column-heading'>Show Filter</span>
|
|
343
|
+
</label>
|
|
344
|
+
</>
|
|
345
|
+
) : (
|
|
346
|
+
<NestedDropdownEditor
|
|
347
|
+
config={config}
|
|
348
|
+
dataColumns={dataColumns}
|
|
349
|
+
filterIndex={filterIndex}
|
|
350
|
+
rawData={rawData}
|
|
351
|
+
handleGroupingCustomOrder={(index1, index2) =>
|
|
352
|
+
handleFilterOrder(index1, index2, filterIndex)
|
|
353
|
+
}
|
|
354
|
+
handleNameChange={value => handleNameChange(filterIndex, value)}
|
|
355
|
+
updateField={updateField}
|
|
356
|
+
updateFilterStyle={updateFilterStyle}
|
|
357
|
+
/>
|
|
358
|
+
)}
|
|
359
|
+
{hasFootnotes && (
|
|
360
|
+
<label>
|
|
361
|
+
<input
|
|
362
|
+
type='checkbox'
|
|
363
|
+
checked={!!filter.filterFootnotes}
|
|
364
|
+
onChange={e => {
|
|
365
|
+
updateFilterProp('filterFootnotes', filterIndex, e.target.checked)
|
|
366
|
+
}}
|
|
367
|
+
/>
|
|
368
|
+
<span className='edit-showDropdown column-heading'>Filter Footnotes</span>
|
|
369
|
+
</label>
|
|
370
|
+
)}
|
|
371
|
+
<label>
|
|
372
|
+
<span className='edit-label column-heading'>
|
|
373
|
+
Filter Parents{' '}
|
|
374
|
+
<Tooltip style={{ textTransform: 'none' }}>
|
|
375
|
+
<Tooltip.Target>
|
|
376
|
+
<Icon display='question' style={{ marginLeft: '0.5rem' }} />
|
|
377
|
+
</Tooltip.Target>
|
|
378
|
+
<Tooltip.Content>
|
|
379
|
+
<p>
|
|
380
|
+
A selected parent's value will be used to filter the available options of this
|
|
381
|
+
child filter.
|
|
382
|
+
</p>
|
|
383
|
+
</Tooltip.Content>
|
|
384
|
+
</Tooltip>
|
|
385
|
+
</span>
|
|
386
|
+
<MultiSelect
|
|
387
|
+
fieldName='parents'
|
|
388
|
+
updateField={(_section, _subsection, _fieldname, value) => {
|
|
389
|
+
updateFilterProp('parents', filterIndex, value)
|
|
390
|
+
}}
|
|
391
|
+
options={getParentFilterOptions(filterIndex)}
|
|
392
|
+
selected={config.filters[filterIndex].parents}
|
|
393
|
+
/>
|
|
394
|
+
</label>
|
|
395
|
+
</FieldSetWrapper>
|
|
396
|
+
</div>
|
|
397
|
+
)}
|
|
398
|
+
</Draggable>
|
|
399
|
+
)
|
|
400
|
+
})}
|
|
401
|
+
{provided.placeholder}
|
|
402
|
+
</ul>
|
|
403
|
+
)}
|
|
404
|
+
</Droppable>
|
|
405
|
+
</DragDropContext>
|
|
335
406
|
</>
|
|
336
407
|
)}
|
|
337
408
|
{!config.filters && <p style={{ textAlign: 'center' }}>There are currently no filters.</p>}
|