@cdc/dashboard 1.1.4 → 4.22.10

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.
Files changed (36) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cdcdashboard.js +40 -28
  3. package/examples/default-filter-control.json +175 -0
  4. package/examples/default-multi-dataset.json +498 -0
  5. package/examples/private/chart-issue.json +3467 -0
  6. package/examples/private/no-issue.json +3467 -0
  7. package/examples/private/totals-two.json +104 -0
  8. package/examples/private/totals.json +103 -0
  9. package/examples/temp-example-data.json +130 -0
  10. package/package.json +9 -8
  11. package/src/CdcDashboard.js +18 -6
  12. package/src/CdcDashboard.jsx +697 -0
  13. package/src/{context.tsx → ConfigContext.js} +0 -0
  14. package/src/components/{Column.js → Column.jsx} +9 -7
  15. package/src/components/DataTable.tsx +8 -10
  16. package/src/components/EditorPanel.js +200 -44
  17. package/src/components/{Grid.js → Grid.jsx} +5 -4
  18. package/src/components/Header.jsx +246 -0
  19. package/src/components/Row.js +1 -0
  20. package/src/components/Row.jsx +181 -0
  21. package/src/components/Row.jsx~HEAD +212 -0
  22. package/src/components/Widget.js +6 -2
  23. package/src/components/Widget.jsx +206 -0
  24. package/src/index.html +29 -25
  25. package/src/scss/editor-panel.scss +0 -1
  26. package/src/scss/grid.scss +60 -14
  27. package/src/scss/main.scss +71 -6
  28. package/src/components/Header.js +0 -15
  29. package/src/images/icon-close.svg +0 -1
  30. package/src/images/icon-code.svg +0 -3
  31. package/src/images/icon-down.svg +0 -1
  32. package/src/images/icon-edit.svg +0 -3
  33. package/src/images/icon-grid.svg +0 -4
  34. package/src/images/icon-move.svg +0 -8
  35. package/src/images/icon-up.svg +0 -1
  36. package/src/images/warning.svg +0 -1
@@ -183,7 +183,6 @@
183
183
  display: block;
184
184
  text-align: left;
185
185
  cursor: pointer;
186
- color: rgba(0,0,0,.5);
187
186
  text-decoration: underline;
188
187
  span {
189
188
  text-decoration: none;
@@ -11,7 +11,7 @@ $red: #f74242;
11
11
  width: 350px;
12
12
  border-right: #C7C7C7 1px solid;
13
13
  position: fixed;
14
- top: 3em;
14
+ top: 6em;
15
15
  bottom: 0;
16
16
  z-index: 1;
17
17
  overflow-y: auto;
@@ -43,6 +43,7 @@ $red: #f74242;
43
43
  transition: border 300ms cubic-bezier(0.16, 1, 0.3, 1);
44
44
  background-color: #F2F2F2;
45
45
  user-select: none;
46
+
46
47
  &.can-drop {
47
48
  border-color: $blue-light;
48
49
  }
@@ -56,12 +57,15 @@ $red: #f74242;
56
57
  position: relative;
57
58
  z-index: 1;
58
59
  bottom: -1px;
60
+
59
61
  > li:not(.spacer) + li:not(.spacer) {
60
62
  margin-left: .3em;
61
63
  }
64
+
62
65
  .spacer {
63
66
  flex-grow: 1;
64
67
  }
68
+
65
69
  svg {
66
70
  width: 25px;
67
71
  height: auto;
@@ -76,9 +80,11 @@ $red: #f74242;
76
80
  .row-menu__btn:hover .row-menu__flyout {
77
81
  transition: width .2s cubic-bezier(0.16, 1, 0.3, 1);
78
82
  width: 144px;
83
+
79
84
  li {
80
85
  display: flex;
81
86
  }
87
+
82
88
  li + li {
83
89
  margin-left: .3em;
84
90
  }
@@ -92,9 +98,11 @@ $red: #f74242;
92
98
  transition: width .2s cubic-bezier(0.16, 1, 0.3, 1);
93
99
  z-index: 1;
94
100
  width: 25px;
101
+
95
102
  li:not(.current) {
96
103
  display: none;
97
104
  }
105
+
98
106
  li svg {
99
107
  opacity: .7;
100
108
  }
@@ -113,10 +121,11 @@ $red: #f74242;
113
121
  border-radius: .2em .2em 0 0;
114
122
  outline: none;
115
123
  transition: background-color 300ms cubic-bezier(0.16, 1, 0.3, 1);
116
- cursor: pointer;
124
+ cursor: pointer;
117
125
  padding: .2em .3em;
118
126
  display: flex;
119
127
  fill: #fff;
128
+
120
129
  + .row-menu__btn {
121
130
  margin-left: .2em;
122
131
  }
@@ -137,15 +146,17 @@ $red: #f74242;
137
146
  justify-content: center;
138
147
  align-items: center;
139
148
  position: relative;
140
- height: 150px;
149
+ height: 180px;
141
150
  margin-left: 0.5rem;
142
151
  margin-right: 0.5rem;
143
152
  background-color: transparent;
144
153
  border: 2px dashed #C2C2C2;
145
154
  flex: 1 1 auto;
155
+
146
156
  &:hover {
147
157
  border-color: darken(#c2c2c2, 20%);
148
158
  }
159
+
149
160
  &.column--populated {
150
161
  background: none;
151
162
  border: none;
@@ -158,10 +169,21 @@ $red: #f74242;
158
169
  background-image: none;
159
170
  }
160
171
 
161
- .column-size--12 {width: 100%;}
162
- .column-size--8 {width: 66.666%;}
163
- .column-size--6 {width: 50%;}
164
- .column-size--4 {width: 33.333%;}
172
+ .column-size--12 {
173
+ width: 100%;
174
+ }
175
+
176
+ .column-size--8 {
177
+ width: 66.666%;
178
+ }
179
+
180
+ .column-size--6 {
181
+ width: 50%;
182
+ }
183
+
184
+ .column-size--4 {
185
+ width: 33.333%;
186
+ }
165
187
 
166
188
  .builder-column__text {
167
189
  padding: 0.5rem;
@@ -186,20 +208,36 @@ $red: #f74242;
186
208
  padding: 0;
187
209
  position: relative;
188
210
  cursor: move;
211
+
189
212
  &:hover {
190
213
  border-color: darken($lightGray, 20%);
214
+
191
215
  .widget-menu-item svg {
192
216
  fill: darken($mediumGray, 20%);
193
217
  }
194
- svg.drag-icon {
218
+
219
+ .drag-icon,
220
+ .drag-icon svg {
195
221
  fill: darken($lightGray, 20%);
196
222
  }
197
223
  }
198
- svg.drag-icon {
224
+
225
+ .btn-configure {
226
+ background: none;
227
+ width: 3em;
228
+ margin-left: 0.5em;
229
+ }
230
+
231
+ .drag-icon,
232
+ .drag-icon svg {
199
233
  fill: $lightGray;
234
+ }
235
+
236
+ .drag-icon {
200
237
  position: absolute;
201
- left: .3em;
202
238
  top: .3em;
239
+ left: .3em;
240
+ width: 10px;
203
241
  }
204
242
  }
205
243
 
@@ -233,6 +271,7 @@ $red: #f74242;
233
271
  flex-direction: column;
234
272
  align-items: center;
235
273
  justify-content: center;
274
+
236
275
  svg {
237
276
  margin-bottom: .5em;
238
277
  }
@@ -270,6 +309,9 @@ $red: #f74242;
270
309
  height: 20px;
271
310
  cursor: pointer;
272
311
  user-select: none;
312
+ margin-left: 0.7em;
313
+ margin-top: 5px;
314
+
273
315
  svg {
274
316
  fill: $mediumGray;
275
317
  }
@@ -288,8 +330,10 @@ $red: #f74242;
288
330
 
289
331
  .builder-row {
290
332
  position: relative;
333
+
291
334
  .widget__content {
292
335
  padding: 0 2em;
336
+
293
337
  > svg {
294
338
  width: 100%;
295
339
  height: auto;
@@ -298,24 +342,26 @@ $red: #f74242;
298
342
  flex-grow: 1;
299
343
  }
300
344
  }
345
+
301
346
  &:hover {
302
347
  .row-menu .row-menu__btn {
303
348
  background-color: $blue;
304
-
349
+
305
350
  &:hover {
306
351
  background-color: lighten($blue, 8%);
307
352
  }
308
-
353
+
309
354
  &.row-menu__btn--edit {
310
355
  background-color: transparent;
311
356
  }
312
-
357
+
313
358
  &.row-menu__btn--remove:hover {
314
359
  background-color: $red;
315
360
  }
316
361
  }
362
+
317
363
  .column-container {
318
364
  border-color: $blue;
319
365
  }
320
366
  }
321
- }
367
+ }
@@ -9,20 +9,25 @@
9
9
  .loading > div.la-ball-beat {
10
10
  margin-top: 20%;
11
11
  }
12
+
12
13
  .editor-heading {
13
- background-color: #fff;
14
+ background-color: #ddd;
14
15
  border-bottom: #C7C7C7 1px solid;
15
16
  padding: 0 1em;
16
17
  display: flex;
17
- height: 3em;
18
- justify-content: space-between;
19
- align-items: center;
18
+ height: 6em;
20
19
  position: fixed;
21
20
  width: 100%;
22
- z-index: 99;
21
+ z-index: 19;
23
22
  top: 0;
23
+ &.sub-dashboard-viz {
24
+ height: 3em;
25
+ }
24
26
  .heading-1 {
25
27
  font-size: 1.2em;
28
+ padding-right: 1em;
29
+ margin: 0.5em 1em 0.5em 0;
30
+ border-right: 1px solid black;
26
31
  &.back-to {
27
32
  display: flex;
28
33
  span {
@@ -32,6 +37,19 @@
32
37
  }
33
38
  }
34
39
 
40
+ .heading-body {
41
+ padding: .5em;
42
+
43
+ input[type="checkbox"] {
44
+ margin-right: 2em;
45
+ margin-left: .5em;
46
+ }
47
+
48
+ .table-height-input {
49
+ width: 6em;
50
+ }
51
+ }
52
+
35
53
  .toggle-bar {
36
54
  overflow: hidden;
37
55
  display: flex;
@@ -40,10 +58,13 @@
40
58
  position: relative;
41
59
  bottom: -1px;
42
60
  li {
43
- padding: .6em 1.5em;
61
+ padding: .3em 1.5em;
44
62
  color: $mediumGray;
45
63
  border-bottom: #C7C7C7 1px solid;
46
64
  cursor: pointer;
65
+ white-space: nowrap;
66
+ text-overflow: ellipsis;
67
+ overflow: hidden;
47
68
  &.active {
48
69
  border-bottom-width: 5px;
49
70
  border-bottom-color: $mediumGray;
@@ -55,6 +76,19 @@
55
76
  }
56
77
  }
57
78
  }
79
+
80
+ .description-input {
81
+ width: 100%;
82
+ }
83
+
84
+ .shared-filter-button {
85
+ display: inline-block;
86
+ border-radius: 1em;
87
+ border: 1px solid gray;
88
+ background-color: white;
89
+ padding: .5em;
90
+ margin-right: 1em;
91
+ }
58
92
  }
59
93
 
60
94
  .visually-hidden {
@@ -147,6 +181,17 @@
147
181
  .dashboard-col-12 {
148
182
  width: 100%;
149
183
  }
184
+
185
+ .preview-table-container {
186
+ padding-left: 350px;
187
+ padding-top: 100px;
188
+ }
189
+
190
+ .multi-table-container {
191
+ display: inline-block;
192
+ width: 100%;
193
+ }
194
+
150
195
  @include breakpointClass(md) {
151
196
  .dashboard-row {
152
197
  flex-direction: row;
@@ -179,6 +224,13 @@
179
224
  }
180
225
  }
181
226
 
227
+ @include breakpoint(md) {
228
+ .cove-dashboard-filters {
229
+ display: flex;
230
+ gap: 30px;
231
+ }
232
+ }
233
+
182
234
  .dashboard-filters-section {
183
235
  margin: 0 0 1em;
184
236
  }
@@ -189,6 +241,10 @@
189
241
 
190
242
  .cdc-dashboard-inner-container {
191
243
  margin: 1em;
244
+
245
+ &.is-editor {
246
+ margin-top: 7em;
247
+ }
192
248
  }
193
249
 
194
250
  .sub-editor {
@@ -212,3 +268,12 @@
212
268
  }
213
269
  }
214
270
  }
271
+
272
+ .shared-filter-modal {
273
+ border: none;
274
+
275
+ label {
276
+ display: block;
277
+ margin: 1em 0;
278
+ }
279
+ }
@@ -1,15 +0,0 @@
1
- import React, { useContext, memo } from 'react'
2
-
3
- const Header = ({preview, setPreview, back, subEditor = null}) => {
4
- return (
5
- <div aria-level="2" role="heading" className="editor-heading">
6
- {subEditor ? <div className="heading-1 back-to" onClick={back} style={{cursor: 'pointer'}}><span>&#8592;</span> Back to Dashboard</div> : <div className="heading-1">Dashboard Editor</div>}
7
- {!subEditor && <ul className="toggle-bar">
8
- <li className={preview ? 'inactive' : 'active'} onClick={() => {setPreview(false)}}>Build Layout</li>
9
- <li className={preview ? 'active' : 'inactive'} onClick={() => {setPreview(true)}}>Preview &amp; Configure</li>
10
- </ul>}
11
- </div>
12
- )
13
- }
14
-
15
- export default Header
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">
2
- <path fill="currentColor" d="M414.8 40.79L286.8 488.8C281.9 505.8 264.2 515.6 247.2 510.8C230.2 505.9 220.4 488.2 225.2 471.2L353.2 23.21C358.1 6.216 375.8-3.624 392.8 1.232C409.8 6.087 419.6 23.8 414.8 40.79H414.8zM518.6 121.4L630.6 233.4C643.1 245.9 643.1 266.1 630.6 278.6L518.6 390.6C506.1 403.1 485.9 403.1 473.4 390.6C460.9 378.1 460.9 357.9 473.4 345.4L562.7 256L473.4 166.6C460.9 154.1 460.9 133.9 473.4 121.4C485.9 108.9 506.1 108.9 518.6 121.4V121.4zM166.6 166.6L77.25 256L166.6 345.4C179.1 357.9 179.1 378.1 166.6 390.6C154.1 403.1 133.9 403.1 121.4 390.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4L121.4 121.4C133.9 108.9 154.1 108.9 166.6 121.4C179.1 133.9 179.1 154.1 166.6 166.6V166.6z"/>
3
- </svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000"><path d="M24 24H0V0h24v24z" fill="none" opacity=".87"/><path d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6-1.41-1.41z"/></svg>
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
- <path d="M14.06 9.02l.92.92L5.92 19H5v-.92l9.06-9.06M17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29zm-3.6 3.19L3 17.25V21h3.75L17.81 9.94l-3.75-3.75z"/>
3
- </svg>
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
2
- <path fill="currentColor" d="M149.333 56v80c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V56c0-13.255 10.745-24 24-24h101.333c13.255 0 24 10.745 24 24zm181.334 240v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24h101.333c13.256 0 24.001-10.745 24.001-24zm32-240v80c0 13.255 10.745 24 24 24H488c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24H386.667c-13.255 0-24 10.745-24 24zm-32 80V56c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24h101.333c13.256 0 24.001-10.745 24.001-24zm-205.334 56H24c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24zM0 376v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zm386.667-56H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H386.667c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24zm0 160H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H386.667c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24zM181.333 376v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24z">
3
- </path>
4
- </svg>
@@ -1,8 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="10" height="16" viewBox="0 0 10 16">
2
- <circle cx="2" cy="2" r="2"/>
3
- <circle cx="8" cy="2" r="2"/>
4
- <circle cx="2" cy="8" r="2"/>
5
- <circle cx="8" cy="8" r="2"/>
6
- <circle cx="2" cy="14" r="2"/>
7
- <circle cx="8" cy="14" r="2"/>
8
- </svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14l-6-6z"/></svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/></svg>