@cdc/filtered-text 4.24.9 → 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/LICENSE +201 -0
- package/dist/cdcfilteredtext.js +2170 -2005
- package/package.json +3 -3
- package/src/components/EditorPanel.jsx +88 -12
- package/src/coreStyles_filteredtext.scss +1 -0
- package/src/index.jsx +2 -1
- package/src/scss/main.scss +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdc/filtered-text",
|
|
3
|
-
"version": "4.24.
|
|
3
|
+
"version": "4.24.11",
|
|
4
4
|
"description": "React component for adding filtered text on dashboards.",
|
|
5
5
|
"moduleName": "CdcFilteredText",
|
|
6
6
|
"main": "dist/cdcfilteredtext",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"homepage": "https://github.com/CDCgov/cdc-open-viz#readme",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@cdc/core": "^4.24.
|
|
29
|
+
"@cdc/core": "^4.24.11",
|
|
30
30
|
"html-react-parser": "^3.0.8",
|
|
31
31
|
"papaparse": "^5.3.2"
|
|
32
32
|
},
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"react": "^18.2.0",
|
|
35
35
|
"react-dom": "^18.2.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "9ab5ee9b2b0ef7321a66a2104be6ce8899ec3808"
|
|
38
38
|
}
|
|
@@ -15,7 +15,19 @@ import { updateFieldFactory } from '@cdc/core/helpers/updateFieldFactory'
|
|
|
15
15
|
|
|
16
16
|
import '@cdc/core/styles/v2/components/editor.scss'
|
|
17
17
|
|
|
18
|
-
const headerColors = [
|
|
18
|
+
const headerColors = [
|
|
19
|
+
'theme-blue',
|
|
20
|
+
'theme-purple',
|
|
21
|
+
'theme-brown',
|
|
22
|
+
'theme-teal',
|
|
23
|
+
'theme-pink',
|
|
24
|
+
'theme-orange',
|
|
25
|
+
'theme-slate',
|
|
26
|
+
'theme-indigo',
|
|
27
|
+
'theme-cyan',
|
|
28
|
+
'theme-green',
|
|
29
|
+
'theme-amber'
|
|
30
|
+
]
|
|
19
31
|
|
|
20
32
|
const EditorPanel = memo(props => {
|
|
21
33
|
const { config, updateConfig, loading, stateData: data, setParentConfig, isDashboard } = useContext(ConfigContext)
|
|
@@ -127,7 +139,7 @@ const EditorPanel = memo(props => {
|
|
|
127
139
|
<section className='waiting-container'>
|
|
128
140
|
<h3>Finish Configuring</h3>
|
|
129
141
|
<p>Set all required options to the left and confirm below to display a preview of the markup.</p>
|
|
130
|
-
<button className='btn' style={{ margin: '1em auto' }} onClick={confirmDone}>
|
|
142
|
+
<button className='btn btn-primary' style={{ margin: '1em auto' }} onClick={confirmDone}>
|
|
131
143
|
I'm Done
|
|
132
144
|
</button>
|
|
133
145
|
</section>
|
|
@@ -144,12 +156,25 @@ const EditorPanel = memo(props => {
|
|
|
144
156
|
const editorContent = (
|
|
145
157
|
<Accordion>
|
|
146
158
|
<Accordion.Section title='General'>
|
|
147
|
-
<InputText
|
|
159
|
+
<InputText
|
|
160
|
+
value={config.title}
|
|
161
|
+
fieldName='title'
|
|
162
|
+
label='Title'
|
|
163
|
+
placeholder='Filterable Text Title'
|
|
164
|
+
updateField={updateField}
|
|
165
|
+
/>
|
|
148
166
|
</Accordion.Section>
|
|
149
167
|
<Accordion.Section title='Data'>
|
|
150
168
|
<div className='cove-accordion__panel-section'>
|
|
151
169
|
<div className='cove-input-group'>
|
|
152
|
-
<InputSelect
|
|
170
|
+
<InputSelect
|
|
171
|
+
value={config.textColumn || ''}
|
|
172
|
+
fieldName='textColumn'
|
|
173
|
+
label='Text Column'
|
|
174
|
+
updateField={updateField}
|
|
175
|
+
initial='Select'
|
|
176
|
+
options={getColumns()}
|
|
177
|
+
/>
|
|
153
178
|
</div>
|
|
154
179
|
</div>
|
|
155
180
|
<hr className='cove-accordion__divider' />
|
|
@@ -161,7 +186,10 @@ const EditorPanel = memo(props => {
|
|
|
161
186
|
<Icon display='question' style={{ marginLeft: '0.5rem' }} />
|
|
162
187
|
</Tooltip.Target>
|
|
163
188
|
<Tooltip.Content>
|
|
164
|
-
<p>
|
|
189
|
+
<p>
|
|
190
|
+
To refine the highlighted data point, specify one or more filters (e.g., "Male" and "Female" for a
|
|
191
|
+
column called "Sex").
|
|
192
|
+
</p>
|
|
165
193
|
</Tooltip.Content>
|
|
166
194
|
</Tooltip>
|
|
167
195
|
</label>
|
|
@@ -219,7 +247,13 @@ const EditorPanel = memo(props => {
|
|
|
219
247
|
</Button>
|
|
220
248
|
</Accordion.Section>
|
|
221
249
|
<Accordion.Section title='Visual'>
|
|
222
|
-
<InputSelect
|
|
250
|
+
<InputSelect
|
|
251
|
+
value={config.fontSize}
|
|
252
|
+
fieldName='fontSize'
|
|
253
|
+
label='Font Size'
|
|
254
|
+
updateField={updateField}
|
|
255
|
+
options={['small', 'medium', 'large']}
|
|
256
|
+
/>
|
|
223
257
|
<br />
|
|
224
258
|
<label>
|
|
225
259
|
<span className='edit-label'>Theme</span>
|
|
@@ -238,11 +272,48 @@ const EditorPanel = memo(props => {
|
|
|
238
272
|
</label>
|
|
239
273
|
|
|
240
274
|
<div className='cove-accordion__panel-section checkbox-group'>
|
|
241
|
-
<InputCheckbox
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
275
|
+
<InputCheckbox
|
|
276
|
+
inline
|
|
277
|
+
size='small'
|
|
278
|
+
value={config.visual.border}
|
|
279
|
+
section='visual'
|
|
280
|
+
fieldName='border'
|
|
281
|
+
label='Display Border'
|
|
282
|
+
updateField={updateField}
|
|
283
|
+
/>
|
|
284
|
+
<InputCheckbox
|
|
285
|
+
inline
|
|
286
|
+
size='small'
|
|
287
|
+
value={config.visual.borderColorTheme}
|
|
288
|
+
section='visual'
|
|
289
|
+
fieldName='borderColorTheme'
|
|
290
|
+
label='Use theme border color'
|
|
291
|
+
updateField={updateField}
|
|
292
|
+
/>
|
|
293
|
+
<InputCheckbox
|
|
294
|
+
size='small'
|
|
295
|
+
value={config.visual.accent}
|
|
296
|
+
section='visual'
|
|
297
|
+
fieldName='accent'
|
|
298
|
+
label='Use Accent Style'
|
|
299
|
+
updateField={updateField}
|
|
300
|
+
/>
|
|
301
|
+
<InputCheckbox
|
|
302
|
+
size='small'
|
|
303
|
+
value={config.visual.background}
|
|
304
|
+
section='visual'
|
|
305
|
+
fieldName='background'
|
|
306
|
+
label='Use Theme Background Color'
|
|
307
|
+
updateField={updateField}
|
|
308
|
+
/>
|
|
309
|
+
<InputCheckbox
|
|
310
|
+
size='small'
|
|
311
|
+
value={config.visual.hideBackgroundColor}
|
|
312
|
+
section='visual'
|
|
313
|
+
fieldName='hideBackgroundColor'
|
|
314
|
+
label='Hide Background Color'
|
|
315
|
+
updateField={updateField}
|
|
316
|
+
/>
|
|
246
317
|
</div>
|
|
247
318
|
</Accordion.Section>
|
|
248
319
|
</Accordion>
|
|
@@ -252,7 +323,12 @@ const EditorPanel = memo(props => {
|
|
|
252
323
|
|
|
253
324
|
return (
|
|
254
325
|
<ErrorBoundary component='EditorPanel'>
|
|
255
|
-
<Layout.Sidebar
|
|
326
|
+
<Layout.Sidebar
|
|
327
|
+
displayPanel={displayPanel}
|
|
328
|
+
isDashboard={isDashboard}
|
|
329
|
+
title={'Configure Filtered Text'}
|
|
330
|
+
onBackClick={onBackClick}
|
|
331
|
+
>
|
|
256
332
|
{!config.newViz && config.runtime && config.runtime.editorErrorMessage && <Error />}
|
|
257
333
|
{config.newViz && showConfigConfirm && <Confirm />}
|
|
258
334
|
{editorContent}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import '@cdc/core/styles/base';
|
package/src/index.jsx
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import ReactDOM from 'react-dom/client'
|
|
3
3
|
|
|
4
4
|
import CdcFilteredText from './CdcFilteredText'
|
|
5
|
+
import './coreStyles_filteredtext.scss'
|
|
5
6
|
|
|
6
7
|
//@ts-ignore
|
|
7
8
|
let isEditor = window.location.href.includes('editor=true')
|
|
@@ -11,5 +12,5 @@ let domContainer = document.getElementsByClassName('react-container')[0]
|
|
|
11
12
|
ReactDOM.createRoot(domContainer).render(
|
|
12
13
|
<React.StrictMode>
|
|
13
14
|
<CdcFilteredText configUrl={domContainer.attributes['data-config'].value} isEditor={isEditor} />
|
|
14
|
-
</React.StrictMode
|
|
15
|
+
</React.StrictMode>
|
|
15
16
|
)
|