@cdc/editor 4.22.10 → 4.22.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.
Files changed (38) hide show
  1. package/README.md +8 -7
  2. package/dist/cdceditor.js +42 -42
  3. package/example/data-horizontal-filters.json +5 -6
  4. package/example/data-horizontal-multiseries-filters.json +13 -15
  5. package/example/data-horizontal-multiseries.json +4 -5
  6. package/example/data-horizontal.json +2 -3
  7. package/example/data-vertical-filters.json +7 -8
  8. package/example/data-vertical-multiseries-filters.json +13 -15
  9. package/example/data-vertical-multiseries-multirow-filters.json +49 -52
  10. package/example/data-vertical-multiseries-multirow.json +11 -11
  11. package/example/data-vertical-multiseries.json +4 -5
  12. package/example/data-vertical.json +4 -5
  13. package/example/private/city-state.json +434 -0
  14. package/example/private/example-city-state.json +86 -0
  15. package/example/private/map-issue.csv +11 -0
  16. package/example/private/test.html +26 -1
  17. package/example/region-map.json +32 -32
  18. package/example/valid-county-data.json +3047 -3047
  19. package/package.json +8 -8
  20. package/src/CdcEditor.js +72 -72
  21. package/src/components/ChooseTab.js +67 -88
  22. package/src/components/ConfigureTab.js +51 -51
  23. package/src/components/DataImport.js +248 -246
  24. package/src/components/PreviewDataTable.js +130 -149
  25. package/src/components/TabPane.js +3 -3
  26. package/src/components/Tabs.js +20 -27
  27. package/src/components/modal/Confirmation.js +16 -13
  28. package/src/components/modal/Modal.js +23 -35
  29. package/src/components/modal/UseModal.js +8 -8
  30. package/src/context.js +4 -4
  31. package/src/index.html +1 -4
  32. package/src/index.js +6 -7
  33. package/src/scss/_data-table.scss +1 -1
  34. package/src/scss/_variables.scss +1 -1
  35. package/src/scss/choose-vis-tab.scss +63 -63
  36. package/src/scss/configure-tab.scss +17 -17
  37. package/src/scss/data-import.scss +177 -177
  38. package/src/scss/main.scss +31 -32
@@ -12,4 +12,4 @@
12
12
  font-size: 1em;
13
13
  width: 30%;
14
14
  }
15
- }
15
+ }
@@ -1,4 +1,4 @@
1
- @import "~@cdc/core/styles/variables";
1
+ @import '~@cdc/core/styles/variables';
2
2
 
3
3
  $xxs: 350px;
4
4
  $xs: 576px;
@@ -1,70 +1,70 @@
1
1
  @import 'variables';
2
2
 
3
3
  .cdc-editor .choose-vis {
4
- padding: $gbl-padding;
5
- .capitalize {
6
- text-transform: capitalize;
4
+ padding: $gbl-padding;
5
+ .capitalize {
6
+ text-transform: capitalize;
7
+ }
8
+ ul + .heading-2 {
9
+ margin-top: 1em;
10
+ }
11
+ .grid {
12
+ margin-top: 1em;
13
+ list-style: none;
14
+ display: flex;
15
+ li {
16
+ margin-right: 1rem;
17
+ margin-bottom: 1rem;
18
+ width: 165px;
7
19
  }
8
- ul + .heading-2 {
9
- margin-top: 1em;
10
- }
11
- .grid {
12
- margin-top: 1em;
13
- list-style: none;
14
- display: flex;
15
- li {
16
- margin-right: 1rem;
17
- margin-bottom: 1rem;
18
- width: 165px;
20
+ button {
21
+ background-color: #fff;
22
+ color: $baseColor;
23
+ border: solid 1px;
24
+ border-color: rgb(199, 199, 199);
25
+ padding: 1.3em $gbl-padding;
26
+ height: 100%;
27
+ align-items: center;
28
+ display: flex;
29
+ border: $lightGray 1px solid;
30
+ margin-right: 1em;
31
+ cursor: pointer;
32
+ transition: 0.1s all;
33
+ flex-direction: column;
34
+ span {
35
+ text-transform: none;
36
+ font-size: 1em;
37
+ }
38
+ &:hover {
39
+ background: #f2f2f2;
40
+ border-color: #949494;
41
+ transition: 0.1s all;
42
+ }
43
+ &.active {
44
+ background: #fff;
45
+ border-color: #005eaa;
46
+ color: #005eaa;
47
+ position: relative;
48
+ path {
49
+ fill: #005eaa;
19
50
  }
20
- button {
21
- background-color: #fff;
22
- color: $baseColor;
23
- border: solid 1px;
24
- border-color: rgb(199,199,199);
25
- padding: 1.3em $gbl-padding;
26
- height: 100%;
27
- align-items: center;
28
- display: flex;
29
- border: $lightGray 1px solid;
30
- margin-right: 1em;
31
- cursor: pointer;
32
- transition: .1s all;
33
- flex-direction: column;
34
- span {
35
- text-transform: none;
36
- font-size: 1em;
37
- }
38
- &:hover {
39
- background: #F2F2F2;
40
- border-color: #949494;
41
- transition: .1s all;
42
- }
43
- &.active {
44
- background: #fff;
45
- border-color: #005eaa;
46
- color: #005eaa;
47
- position: relative;
48
- path {
49
- fill: #005eaa;
50
- }
51
- &:before {
52
- content: " ";
53
- width: 5px;
54
- background: #005eaa;
55
- left: 0;
56
- top: 0;
57
- bottom: 0;
58
- position: absolute;
59
- }
60
- }
61
- svg {
62
- display: block;
63
- margin: 0 auto .5em;
64
- box-sizing: border-box;
65
- width: 100px;
66
- height: 75px;
67
- }
51
+ &:before {
52
+ content: ' ';
53
+ width: 5px;
54
+ background: #005eaa;
55
+ left: 0;
56
+ top: 0;
57
+ bottom: 0;
58
+ position: absolute;
68
59
  }
60
+ }
61
+ svg {
62
+ display: block;
63
+ margin: 0 auto 0.5em;
64
+ box-sizing: border-box;
65
+ width: 100px;
66
+ height: 75px;
67
+ }
69
68
  }
70
- }
69
+ }
70
+ }
@@ -1,22 +1,22 @@
1
1
  .cdc-editor .configure {
2
+ .editor-panel {
3
+ top: 3em;
4
+ }
5
+ .editor-toggle {
6
+ top: 3.5em;
7
+ }
8
+ .type-dashboard {
9
+ .editor-heading {
10
+ top: 3em;
11
+ }
2
12
  .editor-panel {
3
- top: 3em;
13
+ top: 6em !important;
4
14
  }
5
- .editor-toggle {
6
- top: 3.5em;
15
+ .visualizations-panel {
16
+ top: 9em !important;
7
17
  }
8
- .type-dashboard {
9
- .editor-heading {
10
- top: 3em;
11
- }
12
- .editor-panel{
13
- top: 6em !important;
14
- }
15
- .visualizations-panel {
16
- top: 9em !important;
17
- }
18
- .editor-toggle {
19
- top: 6.5em !important;
20
- }
18
+ .editor-toggle {
19
+ top: 6.5em !important;
21
20
  }
22
- }
21
+ }
22
+ }
@@ -1,189 +1,189 @@
1
- @import "variables";
1
+ @import 'variables';
2
2
 
3
3
  .cdc-editor .data-designer {
4
- display: flex;
5
- justify-content: flex-end;
6
- .left-col {
7
- background: #fff;
8
- padding: $gbl-padding;
9
- width: 50%;
10
- border-right: $lightGray 1px solid;
11
- position: fixed;
12
- bottom: 0;
13
- left: 0;
14
- top: 0;
15
- margin-top: 3rem;
16
- z-index: 1;
17
- overflow-y: auto;
18
- .dataset-name-input {
19
- width: 100%;
20
- }
21
- .heading-3 {
22
- font-weight: 600;
23
- margin-bottom: .5em;
24
- margin-top: 1em;
25
- border-top: 1px solid gray;
26
- padding-top: .5em;
27
- }
28
- .tabs {
29
- margin-bottom: 2em;
30
- > ul.nav {
31
- display: flex;
32
- }
33
- .nav-item {
34
- display: flex;
35
- justify-content: center;
36
- list-style: none;
37
- padding: .6rem 0;
38
- flex-grow: 1;
39
- border-bottom: $lightGray 1px solid;
40
- color: $mediumGray;
41
- align-items: center;
42
- svg {
43
- margin-right: .3em;
44
- }
45
- &:hover {
46
- border-bottom-color: $mediumGray;
47
- }
48
- &.active {
49
- border-bottom-width: 5px;
50
- border-bottom-color: $mediumGray;
51
- color: $darkGray;
52
- }
53
- }
54
-
55
- .tab-content {
56
- padding-top: $gbl-padding;
57
- border-top: 1px solid $baseColor;
58
- }
59
- }
60
- table {
61
- width: 100%;
62
- border: 1px solid gray;
63
- thead {
64
- background-color: rgb(220, 220, 200);
65
- border-bottom: 1px solid gray;
66
- }
67
- td {
68
- text-align: center;
69
- white-space: nowrap;
70
- text-overflow: ellipsis;
71
- overflow: hidden;
72
- max-width: 40px;
73
-
74
- button {
75
- font-size: 11pt;
76
- }
77
- }
78
- td:last-child {
79
- max-width: 10px;
80
- }
81
- }
82
- .cdcdataviz-file-selector {
83
- padding: 1rem 3rem;
84
- text-align: center;
85
- border: $lightGray 2px dashed;
86
- border-radius: .2rem;
87
- cursor: pointer;
88
- font-size: 1em;
89
- color: $mediumGray;
90
- transition: .1s all;
91
- svg {
92
- max-width: 35px;
93
- margin: 0 auto .5em;
94
- color: $baseColor;
95
- transition: .1s all;
96
- path {
97
- fill: currentColor
98
- }
99
- }
100
- &.drag-active {
101
- background-color: $lightest-gray;
102
- svg {
103
- transform: scale(.8);
104
- transition: .1s all;
105
- }
106
- }
107
- span {
108
- white-space: pre;
109
- color: $blue;
110
- text-decoration: underline;
111
- }
112
- }
113
- .footnote {
114
- font-size: .8rem;
115
- font-style: italic;
116
- margin: 1em 0 2em 0;
117
- color: $mediumGray;
118
- }
119
- .btn {
120
- display: inline-block;
121
- margin: 1em 0;
122
- }
123
- .btn.active {
124
- background: darken($primary, 15%);
4
+ display: flex;
5
+ justify-content: flex-end;
6
+ .left-col {
7
+ background: #fff;
8
+ padding: $gbl-padding;
9
+ width: 50%;
10
+ border-right: $lightGray 1px solid;
11
+ position: fixed;
12
+ bottom: 0;
13
+ left: 0;
14
+ top: 0;
15
+ margin-top: 3rem;
16
+ z-index: 1;
17
+ overflow-y: auto;
18
+ .dataset-name-input {
19
+ width: 100%;
20
+ }
21
+ .heading-3 {
22
+ font-weight: 600;
23
+ margin-bottom: 0.5em;
24
+ margin-top: 1em;
25
+ border-top: 1px solid gray;
26
+ padding-top: 0.5em;
27
+ }
28
+ .tabs {
29
+ margin-bottom: 2em;
30
+ > ul.nav {
31
+ display: flex;
32
+ }
33
+ .nav-item {
34
+ display: flex;
35
+ justify-content: center;
36
+ list-style: none;
37
+ padding: 0.6rem 0;
38
+ flex-grow: 1;
39
+ border-bottom: $lightGray 1px solid;
40
+ color: $mediumGray;
41
+ align-items: center;
42
+ svg {
43
+ margin-right: 0.3em;
125
44
  }
126
- .input-group {
127
- display: flex;
128
- align-items: stretch;
129
- input[type="text"] {
130
- flex-grow: 1;
131
- border-right: 0;
132
- }
45
+ &:hover {
46
+ border-bottom-color: $mediumGray;
133
47
  }
134
-
135
- .keep-url {
136
- font-size:.8rem;
137
- color: $mediumGray
48
+ &.active {
49
+ border-bottom-width: 5px;
50
+ border-bottom-color: $mediumGray;
51
+ color: $darkGray;
138
52
  }
139
-
140
- .sample-data-list {
141
- font-size: .8rem;
142
- list-style: none;
143
- li {
144
- margin-top: .3rem;
145
- color: $blue;
146
- text-decoration: underline;
147
- cursor: pointer
148
- }
53
+ }
54
+
55
+ .tab-content {
56
+ padding-top: $gbl-padding;
57
+ border-top: 1px solid $baseColor;
58
+ }
59
+ }
60
+ table {
61
+ width: 100%;
62
+ border: 1px solid gray;
63
+ thead {
64
+ background-color: rgb(220, 220, 200);
65
+ border-bottom: 1px solid gray;
66
+ }
67
+ td {
68
+ text-align: center;
69
+ white-space: nowrap;
70
+ text-overflow: ellipsis;
71
+ overflow: hidden;
72
+ max-width: 40px;
73
+
74
+ button {
75
+ font-size: 11pt;
149
76
  }
150
-
151
- .file-loaded-area {
152
- margin-bottom: 20px;
77
+ }
78
+ td:last-child {
79
+ max-width: 10px;
80
+ }
81
+ }
82
+ .cdcdataviz-file-selector {
83
+ padding: 1rem 3rem;
84
+ text-align: center;
85
+ border: $lightGray 2px dashed;
86
+ border-radius: 0.2rem;
87
+ cursor: pointer;
88
+ font-size: 1em;
89
+ color: $mediumGray;
90
+ transition: 0.1s all;
91
+ svg {
92
+ max-width: 35px;
93
+ margin: 0 auto 0.5em;
94
+ color: $baseColor;
95
+ transition: 0.1s all;
96
+ path {
97
+ fill: currentColor;
153
98
  }
154
-
155
- .url-source-options,
156
- .data-source-options {
157
- display: grid;
158
- grid-template-columns: 1fr 100px;
159
- gap: 10px;
160
- margin-bottom: 20px;
161
-
162
- .btn {
163
- margin: 0;
164
- }
165
-
166
- .cdcdataviz-file-selector.loaded-file {
167
- font-size: .9em;
168
- padding: .4rem 3rem;
169
- svg {
170
- position: relative;
171
- top: 4px;
172
- width: 1em;
173
- height: 1em;
174
- margin: 0;
175
- }
176
- }
99
+ }
100
+ &.drag-active {
101
+ background-color: $lightest-gray;
102
+ svg {
103
+ transform: scale(0.8);
104
+ transition: 0.1s all;
177
105
  }
178
- .data-source-options {
179
- align-items: center;
106
+ }
107
+ span {
108
+ white-space: pre;
109
+ color: $blue;
110
+ text-decoration: underline;
111
+ }
112
+ }
113
+ .footnote {
114
+ font-size: 0.8rem;
115
+ font-style: italic;
116
+ margin: 1em 0 2em 0;
117
+ color: $mediumGray;
118
+ }
119
+ .btn {
120
+ display: inline-block;
121
+ margin: 1em 0;
122
+ }
123
+ .btn.active {
124
+ background: darken($primary, 15%);
125
+ }
126
+ .input-group {
127
+ display: flex;
128
+ align-items: stretch;
129
+ input[type='text'] {
130
+ flex-grow: 1;
131
+ border-right: 0;
132
+ }
133
+ }
134
+
135
+ .keep-url {
136
+ font-size: 0.8rem;
137
+ color: $mediumGray;
138
+ }
139
+
140
+ .sample-data-list {
141
+ font-size: 0.8rem;
142
+ list-style: none;
143
+ li {
144
+ margin-top: 0.3rem;
145
+ color: $blue;
146
+ text-decoration: underline;
147
+ cursor: pointer;
148
+ }
149
+ }
150
+
151
+ .file-loaded-area {
152
+ margin-bottom: 20px;
153
+ }
154
+
155
+ .url-source-options,
156
+ .data-source-options {
157
+ display: grid;
158
+ grid-template-columns: 1fr 100px;
159
+ gap: 10px;
160
+ margin-bottom: 20px;
161
+
162
+ .btn {
163
+ margin: 0;
164
+ }
165
+
166
+ .cdcdataviz-file-selector.loaded-file {
167
+ font-size: 0.9em;
168
+ padding: 0.4rem 3rem;
169
+ svg {
170
+ position: relative;
171
+ top: 4px;
172
+ width: 1em;
173
+ height: 1em;
174
+ margin: 0;
180
175
  }
176
+ }
181
177
  }
182
- .right-col {
183
- position: relative;
184
- background-color: $lightest-gray;
185
- padding: $gbl-padding;
186
- width: 50% !important;
187
- @import "data-table";
178
+ .data-source-options {
179
+ align-items: center;
188
180
  }
181
+ }
182
+ .right-col {
183
+ position: relative;
184
+ background-color: $lightest-gray;
185
+ padding: $gbl-padding;
186
+ width: 50% !important;
187
+ @import 'data-table';
188
+ }
189
189
  }
@@ -1,4 +1,4 @@
1
- @import "@cdc/core/styles/base";
1
+ @import '@cdc/core/styles/base';
2
2
  @import 'variables';
3
3
 
4
4
  .cdc-open-viz-module.cdc-editor {
@@ -29,7 +29,7 @@
29
29
  display: flex;
30
30
  list-style: none;
31
31
  li {
32
- background: #F2F2F2;
32
+ background: #f2f2f2;
33
33
  line-height: 3rem;
34
34
  border-bottom: 1px solid $lightGray;
35
35
  color: #333;
@@ -42,8 +42,8 @@
42
42
  border-right: none;
43
43
  }
44
44
  &.active {
45
- background-color: #565656;
46
- color: #fff;
45
+ background-color: #565656;
46
+ color: #fff;
47
47
  }
48
48
  }
49
49
  }
@@ -56,23 +56,23 @@
56
56
  .dropdown {
57
57
  display: block;
58
58
  width: 100%;
59
-
59
+
60
60
  nav {
61
61
  display: none;
62
62
 
63
63
  button {
64
- display:block;
64
+ display: block;
65
65
  }
66
66
  }
67
67
 
68
68
  &:focus-within nav {
69
- display: block
69
+ display: block;
70
70
  }
71
71
  }
72
72
  .info-box {
73
73
  border: $lightGray 1px solid;
74
74
  padding: 1rem;
75
- font-size: .9rem;
75
+ font-size: 0.9rem;
76
76
  h4 {
77
77
  font-weight: 600;
78
78
  font-size: 1.2em;
@@ -84,36 +84,35 @@
84
84
 
85
85
  .alert--info {
86
86
  color: #004085;
87
- background-color: #cce5ff;;
87
+ background-color: #cce5ff;
88
88
  padding: 0.75em 1em;
89
89
  margin: 1em 0;
90
- font-size: .8em;
90
+ font-size: 0.8em;
91
91
  border: #b8daff 1px solid;
92
92
  border-radius: 0.4em;
93
93
  }
94
94
  }
95
95
 
96
-
97
96
  // Modal
98
97
  .modal-backdrop {
99
98
  position: fixed;
100
- width: 100%;
101
- height: 100%;
102
- top: 0;
103
- left: 0;
104
- background: rgba(255, 255, 255, 0.75);
105
- z-index: 500;
99
+ width: 100%;
100
+ height: 100%;
101
+ top: 0;
102
+ left: 0;
103
+ background: rgba(255, 255, 255, 0.75);
104
+ z-index: 500;
106
105
  backdrop-filter: blur(2px);
107
106
  }
108
107
 
109
108
  .modal-wrapper {
110
109
  position: fixed;
111
- top: 50%;
112
- left: 50%;
113
- transform: translate(-50%, -50%);
114
- z-index: 700;
115
- width: inherit;
116
- outline: 0;
110
+ top: 50%;
111
+ left: 50%;
112
+ transform: translate(-50%, -50%);
113
+ z-index: 700;
114
+ width: inherit;
115
+ outline: 0;
117
116
  font-family: sans-serif;
118
117
 
119
118
  .modal {
@@ -122,7 +121,7 @@
122
121
  position: relative;
123
122
  margin: auto;
124
123
  border-radius: 8px;
125
- border: rgba(0,0,0,.3) 1px solid;
124
+ border: rgba(0, 0, 0, 0.3) 1px solid;
126
125
  box-shadow: rgb(0 0 0 / 20%) 3px 3px 7px;
127
126
  line-height: 1.4em;
128
127
  padding: 16px 20px;
@@ -170,12 +169,12 @@
170
169
  @import '@cdc/core/styles/v2/layout/_tooltip.scss';
171
170
  }
172
171
 
173
- section.introText {
174
- padding: 15px;
175
- }
172
+ section.introText {
173
+ padding: 15px;
174
+ }
176
175
 
177
- section.footnotes {
178
- border-top: 1px solid #DDD;
179
- margin-top: 70px;
180
- padding: 15px;
181
- }
176
+ section.footnotes {
177
+ border-top: 1px solid #ddd;
178
+ margin-top: 70px;
179
+ padding: 15px;
180
+ }