@cdc/core 4.25.3-6 → 4.25.3
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 +11 -9
- package/components/DataTable/DataTable.tsx +34 -20
- package/components/DataTable/components/ChartHeader.tsx +1 -1
- package/components/DataTable/helpers/getChartCellValue.ts +11 -5
- package/components/DataTable/helpers/getDataSeriesColumns.ts +7 -3
- package/components/DataTable/helpers/mapCellMatrix.tsx +64 -33
- package/components/DataTable/helpers/tests/mapCellMatrix.test.ts +80 -0
- package/components/EditorPanel/DataTableEditor.tsx +28 -18
- package/components/EditorPanel/Inputs.tsx +2 -1
- package/components/EditorPanel/VizFilterEditor/VizFilterEditor.tsx +23 -0
- package/components/Filters/Filters.tsx +20 -8
- package/components/Layout/components/Visualization/visualizations.scss +1 -1
- package/components/MediaControls.jsx +14 -7
- package/components/elements/Button.jsx +4 -2
- package/dist/cove-main.css +98 -151
- package/dist/cove-main.css.map +1 -1
- package/helpers/DataTransform.ts +2 -2
- package/helpers/addValuesToFilters.ts +1 -1
- package/helpers/coveUpdateWorker.ts +12 -7
- package/helpers/formatConfigBeforeSave.ts +30 -8
- package/helpers/isRightAlignedTableValue.js +5 -1
- package/helpers/isSolr.ts +13 -0
- package/helpers/labelHash.ts +21 -0
- package/helpers/pivotData.ts +14 -7
- package/helpers/tests/formatConfigBeforeSave.test.ts +68 -0
- package/helpers/tests/pivotData.test.ts +23 -19
- package/helpers/ver/4.25.3.ts +20 -0
- package/helpers/ver/tests/versionNeedsUpdate.test.ts +28 -0
- package/package.json +2 -2
- package/styles/_global-variables.scss +2 -1
- package/styles/_global.scss +18 -9
- package/styles/base.scss +42 -0
- package/styles/filters.scss +5 -11
- package/styles/v2/components/button.scss +48 -12
- package/styles/v2/themes/_color-definitions.scss +1 -4
- package/types/General.ts +0 -1
- package/types/Table.ts +2 -0
- package/helpers/isSolr.js +0 -13
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
// import html2pdf from 'html2pdf.js'
|
|
3
|
-
import html2canvas from 'html2canvas'
|
|
4
3
|
|
|
5
4
|
const buttonText = {
|
|
6
5
|
pdf: 'Download PDF',
|
|
@@ -76,12 +75,20 @@ const generateMedia = (state, type, elementToCapture) => {
|
|
|
76
75
|
|
|
77
76
|
switch (type) {
|
|
78
77
|
case 'image':
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
const downloadImage = async () => {
|
|
79
|
+
import(/* webpackChunkName: "html2canvas" */ 'html2canvas').then(mod => {
|
|
80
|
+
mod
|
|
81
|
+
.default(baseSvg, {
|
|
82
|
+
ignoreElements: el =>
|
|
83
|
+
el.className?.indexOf &&
|
|
84
|
+
el.className.search(/download-buttons|download-links|data-table-container/) !== -1
|
|
85
|
+
})
|
|
86
|
+
.then(canvas => {
|
|
87
|
+
saveImageAs(canvas.toDataURL(), filename + '.png')
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
downloadImage()
|
|
85
92
|
return
|
|
86
93
|
case 'pdf':
|
|
87
94
|
// let opt = {
|
|
@@ -16,6 +16,7 @@ const Button = ({
|
|
|
16
16
|
active = false,
|
|
17
17
|
onClick,
|
|
18
18
|
children,
|
|
19
|
+
secondary,
|
|
19
20
|
...attributes
|
|
20
21
|
}) => {
|
|
21
22
|
const buttonRef = useRef(null)
|
|
@@ -33,7 +34,8 @@ const Button = ({
|
|
|
33
34
|
(flexCenter || 'loader' === role ? ' cove-button--flex-center' : '') +
|
|
34
35
|
(fluid ? ' fluid' : '') +
|
|
35
36
|
(loading ? ' loading' : '') +
|
|
36
|
-
(attributes.className ? ' ' + attributes.className : '')
|
|
37
|
+
(attributes.className ? ' ' + attributes.className : '') +
|
|
38
|
+
(secondary ? ' secondary' : ''),
|
|
37
39
|
onMouseOver: () => setButtonState('in'),
|
|
38
40
|
onMouseOut: () => setButtonState('out'),
|
|
39
41
|
onFocus: () => setButtonState('in'),
|
|
@@ -89,7 +91,7 @@ const Button = ({
|
|
|
89
91
|
{...attributesObj}
|
|
90
92
|
onClick={e => {
|
|
91
93
|
e.preventDefault()
|
|
92
|
-
return loading || onClick()
|
|
94
|
+
return loading || onClick(e)
|
|
93
95
|
}}
|
|
94
96
|
disabled={loading || attributesObj.disabled}
|
|
95
97
|
ref={buttonRef}
|