sag_components 1.0.421 → 1.0.423
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/.history/.env_20231001120549 +0 -0
- package/.history/.env_20231001120613 +1 -0
- package/.history/.env_20231003143620 +1 -0
- package/.history/.eslintrc_20230928112617.js +26 -0
- package/.history/.eslintrc_20230928130534.js +27 -0
- package/.history/.eslintrc_20230928133400.js +28 -0
- package/.history/.eslintrc_20230928133404.js +28 -0
- package/.history/.eslintrc_20230928133416.js +28 -0
- package/.history/.eslintrc_20230928133419.js +28 -0
- package/.history/.eslintrc_20230928133432.js +28 -0
- package/.history/.eslintrc_20230928133439.js +28 -0
- package/.history/.eslintrc_20230928133458.js +29 -0
- package/.history/.eslintrc_20230928133500.js +28 -0
- package/.history/.eslintrc_20230928134009.js +28 -0
- package/.history/.eslintrc_20230928135318.js +34 -0
- package/.history/.eslintrc_20230928135321.js +34 -0
- package/.history/.eslintrc_20230928135323.js +34 -0
- package/.history/.eslintrc_20230928135332.js +34 -0
- package/.history/.eslintrc_20230928135333.js +34 -0
- package/.history/.eslintrc_20230928135352.js +29 -0
- package/.history/.eslintrc_20230928135353.js +29 -0
- package/.history/.eslintrc_20230928135355.js +29 -0
- package/.history/.eslintrc_20230928135408.js +29 -0
- package/.history/.eslintrc_20230928135538.js +30 -0
- package/.history/.eslintrc_20230928135539.js +30 -0
- package/.history/.eslintrc_20230928135543.js +30 -0
- package/.history/.gitignore_20230921093332 +119 -0
- package/.history/.gitignore_20230921111638 +120 -0
- package/.history/.gitignore_20230921111650 +120 -0
- package/.history/.gitignore_20230921111810 +121 -0
- package/.history/package-lock_20231114111138.json +47810 -0
- package/.history/package-lock_20231114111158.json +47802 -0
- package/.history/package_20231029152422.json +82 -0
- package/.history/package_20231029153420.json +82 -0
- package/.history/package_20231029154416.json +82 -0
- package/.history/package_20231030094127.json +82 -0
- package/.history/package_20231030114707.json +82 -0
- package/.history/package_20231030130704.json +82 -0
- package/.history/package_20231030132422.json +82 -0
- package/.history/package_20231030134051.json +82 -0
- package/.history/package_20231030142913.json +82 -0
- package/.history/package_20231030143556.json +82 -0
- package/.history/package_20231030144210.json +82 -0
- package/.history/package_20231101113942.json +82 -0
- package/.history/package_20231101114544.json +82 -0
- package/.history/package_20231101151518.json +82 -0
- package/.history/package_20231101154501.json +82 -0
- package/.history/package_20231101155811.json +82 -0
- package/.history/package_20231101160235.json +82 -0
- package/.history/package_20231101160406.json +82 -0
- package/.history/package_20231101161325.json +82 -0
- package/.history/package_20231101161333.json +82 -0
- package/.history/package_20231102123623.json +82 -0
- package/.history/package_20231102125741.json +82 -0
- package/.history/package_20231102130857.json +82 -0
- package/.history/package_20231102132227.json +82 -0
- package/.history/package_20231102142340.json +82 -0
- package/.history/package_20231102143256.json +82 -0
- package/.history/package_20231105153539.json +82 -0
- package/.history/package_20231105154332.json +82 -0
- package/.history/package_20231105171201.json +82 -0
- package/.history/package_20231106123849.json +82 -0
- package/.history/package_20231107170638.json +82 -0
- package/.history/package_20231109103647.json +82 -0
- package/.history/package_20231109103911.json +82 -0
- package/.history/package_20231109105426.json +82 -0
- package/.history/package_20231109132014.json +82 -0
- package/.history/package_20231109132115.json +82 -0
- package/.history/package_20231114100517.json +82 -0
- package/.history/package_20231114100859.json +82 -0
- package/.history/package_20231114101553.json +82 -0
- package/.history/package_20231114102545.json +82 -0
- package/.history/package_20231114111208.json +83 -0
- package/.history/package_20231114111515.json +83 -0
- package/.history/package_20231114112931.json +83 -0
- package/.history/package_20231114113014.json +83 -0
- package/.history/package_20231114113155.json +83 -0
- package/.history/package_20231114124318.json +83 -0
- package/.history/package_20231114125107.json +83 -0
- package/.history/package_20231114125510.json +83 -0
- package/.history/package_20231114132634.json +83 -0
- package/.history/package_20231116165815.json +83 -0
- package/.history/package_20231116165916.json +83 -0
- package/.history/package_20231119113637.json +83 -0
- package/.history/package_20231120100907.json +83 -0
- package/.history/package_20231121151523.json +77 -0
- package/.history/package_20231121155513.json +77 -0
- package/.history/package_20231121162434.json +77 -0
- package/.history/package_20231122100718.json +77 -0
- package/.history/package_20231128125149.json +82 -0
- package/.history/package_20231128125208.json +82 -0
- package/dist/stories/components/CommonFunctions.js +18 -28
- package/dist/stories/components/IconButton.js +16 -35
- package/dist/stories/components/IconButton.style.js +2 -2
- package/dist/stories/components/TotalBenchmarkAreachart.js +56 -94
- package/dist/stories/components/TotalBenchmarkAreachart.style.js +6 -9
- package/package.json +9 -9
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sag_components",
|
|
3
|
+
"version": "1.0.338",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "react-scripts start",
|
|
8
|
+
"lint": "eslint .",
|
|
9
|
+
"build": "cross-env BABEL_ENV=production babel src -d dist ",
|
|
10
|
+
"storybook": "storybook dev -p 6006",
|
|
11
|
+
"build-storybook": "storybook build"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "SAG",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
18
|
+
"@babel/cli": "^7.23.0",
|
|
19
|
+
"@babel/preset-env": "^7.23.2",
|
|
20
|
+
"@babel/preset-react": "^7.22.15",
|
|
21
|
+
"@babel/preset-typescript": "^7.23.2",
|
|
22
|
+
"babel-plugin-react-css-modules": "^5.2.6",
|
|
23
|
+
"babel-preset-react-app": "^10.0.1",
|
|
24
|
+
"@storybook/addon-designs": "^7.0.5",
|
|
25
|
+
"@storybook/addon-essentials": "^7.4.6",
|
|
26
|
+
"@storybook/addon-interactions": "^7.4.6",
|
|
27
|
+
"@storybook/addon-links": "^7.4.6",
|
|
28
|
+
"@storybook/addon-storysource": "^7.4.6",
|
|
29
|
+
"@storybook/addons": "^7.5.3",
|
|
30
|
+
"@storybook/blocks": "^7.4.6",
|
|
31
|
+
"@storybook/preset-scss": "^1.0.3",
|
|
32
|
+
"@storybook/react": "^7.4.6",
|
|
33
|
+
"@storybook/react-webpack5": "^7.4.6",
|
|
34
|
+
"@storybook/testing-library": "^0.2.2",
|
|
35
|
+
"@storybook/theming": "^7.5.3",
|
|
36
|
+
"cross-env": "^7.0.3",
|
|
37
|
+
"css-loader": "^6.8.1",
|
|
38
|
+
"eslint": "^8.53.0",
|
|
39
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
40
|
+
"eslint-plugin-import": "^2.29.0",
|
|
41
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
42
|
+
"eslint-plugin-react": "^7.33.2",
|
|
43
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
44
|
+
"react-dom": "^18.2.0",
|
|
45
|
+
"sass": "^1.69.5",
|
|
46
|
+
"sass-loader": "^13.3.2",
|
|
47
|
+
"style-loader": "^3.3.3"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@emotion/react": "^11.11.1",
|
|
51
|
+
"@emotion/styled": "^11.11.0",
|
|
52
|
+
"@mui/icons-material": "^5.14.16",
|
|
53
|
+
"@mui/material": "^5.14.16",
|
|
54
|
+
"@mui/x-date-pickers": "^6.18.0",
|
|
55
|
+
"classnames": "^2.3.2",
|
|
56
|
+
"dayjs": "^1.11.10",
|
|
57
|
+
"prop-types": "^15.8.1",
|
|
58
|
+
"react": "^18.2.0",
|
|
59
|
+
"react-css-modules": "^4.7.11",
|
|
60
|
+
"react-loading-skeleton": "^3.3.1",
|
|
61
|
+
"recharts": "^2.9.2",
|
|
62
|
+
"storybook": "^7.4.6",
|
|
63
|
+
"styled-components": "^5.3.1"
|
|
64
|
+
},
|
|
65
|
+
"browserslist": {
|
|
66
|
+
"production": [
|
|
67
|
+
">0.2%",
|
|
68
|
+
"not dead",
|
|
69
|
+
"not op_mini all"
|
|
70
|
+
],
|
|
71
|
+
"development": [
|
|
72
|
+
"last 1 chrome version",
|
|
73
|
+
"last 1 firefox version",
|
|
74
|
+
"last 1 safari version"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sag_components",
|
|
3
|
+
"version": "1.0.346",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "react-scripts start",
|
|
8
|
+
"lint": "eslint .",
|
|
9
|
+
"build": "cross-env BABEL_ENV=production babel src -d dist ",
|
|
10
|
+
"storybook": "storybook dev -p 6006",
|
|
11
|
+
"build-storybook": "storybook build"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "SAG",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
18
|
+
"@babel/cli": "^7.23.0",
|
|
19
|
+
"@babel/preset-env": "^7.23.2",
|
|
20
|
+
"@babel/preset-react": "^7.22.15",
|
|
21
|
+
"@babel/preset-typescript": "^7.23.2",
|
|
22
|
+
"babel-plugin-react-css-modules": "^5.2.6",
|
|
23
|
+
"babel-preset-react-app": "^10.0.1",
|
|
24
|
+
"@storybook/addon-designs": "^7.0.5",
|
|
25
|
+
"@storybook/addon-essentials": "^7.4.6",
|
|
26
|
+
"@storybook/addon-interactions": "^7.4.6",
|
|
27
|
+
"@storybook/addon-links": "^7.4.6",
|
|
28
|
+
"@storybook/addon-storysource": "^7.4.6",
|
|
29
|
+
"@storybook/addons": "^7.5.3",
|
|
30
|
+
"@storybook/blocks": "^7.4.6",
|
|
31
|
+
"@storybook/preset-scss": "^1.0.3",
|
|
32
|
+
"@storybook/react": "^7.4.6",
|
|
33
|
+
"@storybook/react-webpack5": "^7.4.6",
|
|
34
|
+
"@storybook/testing-library": "^0.2.2",
|
|
35
|
+
"@storybook/theming": "^7.5.3",
|
|
36
|
+
"cross-env": "^7.0.3",
|
|
37
|
+
"css-loader": "^6.8.1",
|
|
38
|
+
"eslint": "^8.53.0",
|
|
39
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
40
|
+
"eslint-plugin-import": "^2.29.0",
|
|
41
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
42
|
+
"eslint-plugin-react": "^7.33.2",
|
|
43
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
44
|
+
"react-dom": "^18.2.0",
|
|
45
|
+
"sass": "^1.69.5",
|
|
46
|
+
"sass-loader": "^13.3.2",
|
|
47
|
+
"style-loader": "^3.3.3"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@emotion/react": "^11.11.1",
|
|
51
|
+
"@emotion/styled": "^11.11.0",
|
|
52
|
+
"@mui/icons-material": "^5.14.16",
|
|
53
|
+
"@mui/material": "^5.14.16",
|
|
54
|
+
"@mui/x-date-pickers": "^6.18.0",
|
|
55
|
+
"classnames": "^2.3.2",
|
|
56
|
+
"dayjs": "^1.11.10",
|
|
57
|
+
"prop-types": "^15.8.1",
|
|
58
|
+
"react": "^18.2.0",
|
|
59
|
+
"react-css-modules": "^4.7.11",
|
|
60
|
+
"react-loading-skeleton": "^3.3.1",
|
|
61
|
+
"recharts": "^2.9.2",
|
|
62
|
+
"storybook": "^7.4.6",
|
|
63
|
+
"styled-components": "^5.3.1"
|
|
64
|
+
},
|
|
65
|
+
"bundler": {
|
|
66
|
+
"exportEntries": ["src/index.ts"],
|
|
67
|
+
"managerEntries": ["src/manager.ts"],
|
|
68
|
+
"previewEntries": ["src/preview.ts"]
|
|
69
|
+
},
|
|
70
|
+
"browserslist": {
|
|
71
|
+
"production": [
|
|
72
|
+
">0.2%",
|
|
73
|
+
"not dead",
|
|
74
|
+
"not op_mini all"
|
|
75
|
+
],
|
|
76
|
+
"development": [
|
|
77
|
+
"last 1 chrome version",
|
|
78
|
+
"last 1 firefox version",
|
|
79
|
+
"last 1 safari version"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sag_components",
|
|
3
|
+
"version": "1.0.346",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "react-scripts start",
|
|
8
|
+
"lint": "eslint .",
|
|
9
|
+
"build": "cross-env BABEL_ENV=production babel src -d dist ",
|
|
10
|
+
"storybook": "storybook dev -p 6006",
|
|
11
|
+
"build-storybook": "storybook build"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [],
|
|
14
|
+
"author": "SAG",
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
|
|
18
|
+
"@babel/cli": "^7.23.0",
|
|
19
|
+
"@babel/preset-env": "^7.23.2",
|
|
20
|
+
"@babel/preset-react": "^7.22.15",
|
|
21
|
+
"@babel/preset-typescript": "^7.23.2",
|
|
22
|
+
"babel-plugin-react-css-modules": "^5.2.6",
|
|
23
|
+
"babel-preset-react-app": "^10.0.1",
|
|
24
|
+
"@storybook/addon-designs": "^7.0.5",
|
|
25
|
+
"@storybook/addon-essentials": "^7.4.6",
|
|
26
|
+
"@storybook/addon-interactions": "^7.4.6",
|
|
27
|
+
"@storybook/addon-links": "^7.4.6",
|
|
28
|
+
"@storybook/addon-storysource": "^7.4.6",
|
|
29
|
+
"@storybook/addons": "^7.5.3",
|
|
30
|
+
"@storybook/blocks": "^7.4.6",
|
|
31
|
+
"@storybook/preset-scss": "^1.0.3",
|
|
32
|
+
"@storybook/react": "^7.4.6",
|
|
33
|
+
"@storybook/react-webpack5": "^7.4.6",
|
|
34
|
+
"@storybook/testing-library": "^0.2.2",
|
|
35
|
+
"@storybook/theming": "^7.5.3",
|
|
36
|
+
"cross-env": "^7.0.3",
|
|
37
|
+
"css-loader": "^6.8.1",
|
|
38
|
+
"eslint": "^8.53.0",
|
|
39
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
40
|
+
"eslint-plugin-import": "^2.29.0",
|
|
41
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
42
|
+
"eslint-plugin-react": "^7.33.2",
|
|
43
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
44
|
+
"react-dom": "^18.2.0",
|
|
45
|
+
"sass": "^1.69.5",
|
|
46
|
+
"sass-loader": "^13.3.2",
|
|
47
|
+
"style-loader": "^3.3.3"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@emotion/react": "^11.11.1",
|
|
51
|
+
"@emotion/styled": "^11.11.0",
|
|
52
|
+
"@mui/icons-material": "^5.14.16",
|
|
53
|
+
"@mui/material": "^5.14.16",
|
|
54
|
+
"@mui/x-date-pickers": "^6.18.0",
|
|
55
|
+
"classnames": "^2.3.2",
|
|
56
|
+
"dayjs": "^1.11.10",
|
|
57
|
+
"prop-types": "^15.8.1",
|
|
58
|
+
"react": "^18.2.0",
|
|
59
|
+
"react-css-modules": "^4.7.11",
|
|
60
|
+
"react-loading-skeleton": "^3.3.1",
|
|
61
|
+
"recharts": "^2.9.2",
|
|
62
|
+
"storybook": "^7.4.6",
|
|
63
|
+
"styled-components": "^5.3.1"
|
|
64
|
+
},
|
|
65
|
+
"bundler": {
|
|
66
|
+
"exportEntries": ["src/index.js"],
|
|
67
|
+
"managerEntries": ["src/manager.js"],
|
|
68
|
+
"previewEntries": ["src/preview.js"]
|
|
69
|
+
},
|
|
70
|
+
"browserslist": {
|
|
71
|
+
"production": [
|
|
72
|
+
">0.2%",
|
|
73
|
+
"not dead",
|
|
74
|
+
"not op_mini all"
|
|
75
|
+
],
|
|
76
|
+
"development": [
|
|
77
|
+
"last 1 chrome version",
|
|
78
|
+
"last 1 firefox version",
|
|
79
|
+
"last 1 safari version"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getNumberWithCommas = exports.getFormattedValue = exports.getFormattedUnits = exports.getCurrencySign = void 0;
|
|
7
7
|
const getCurrencySign = (currencyTypeToConvert, value) => {
|
|
8
8
|
if (value === undefined || value === null) {
|
|
9
|
-
return
|
|
9
|
+
return '';
|
|
10
10
|
}
|
|
11
11
|
if (isNaN(parseFloat(value))) {
|
|
12
|
-
return
|
|
12
|
+
return '';
|
|
13
13
|
}
|
|
14
|
-
if (!currencyTypeToConvert) return
|
|
15
|
-
let currencySign =
|
|
16
|
-
const currencyFormatter = new Intl.NumberFormat(
|
|
17
|
-
style:
|
|
14
|
+
if (!currencyTypeToConvert) return '';
|
|
15
|
+
let currencySign = '';
|
|
16
|
+
const currencyFormatter = new Intl.NumberFormat('en-US', {
|
|
17
|
+
style: 'currency',
|
|
18
18
|
currency: currencyTypeToConvert
|
|
19
19
|
});
|
|
20
20
|
currencySign = currencyFormatter.format(Math.abs(value)).substring(0, 1);
|
|
@@ -23,21 +23,21 @@ const getCurrencySign = (currencyTypeToConvert, value) => {
|
|
|
23
23
|
exports.getCurrencySign = getCurrencySign;
|
|
24
24
|
const getFormattedUnits = num => {
|
|
25
25
|
if (num === undefined || num === null) {
|
|
26
|
-
return
|
|
26
|
+
return '';
|
|
27
27
|
}
|
|
28
28
|
if (isNaN(parseFloat(num))) {
|
|
29
|
-
return
|
|
29
|
+
return '';
|
|
30
30
|
}
|
|
31
31
|
if (Math.abs(num) >= 1000000000) {
|
|
32
|
-
return
|
|
32
|
+
return 'B';
|
|
33
33
|
}
|
|
34
34
|
if (Math.abs(num) >= 1000000) {
|
|
35
|
-
return
|
|
35
|
+
return 'M';
|
|
36
36
|
}
|
|
37
37
|
if (Math.abs(num) >= 1000) {
|
|
38
|
-
return
|
|
38
|
+
return 'K';
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return '';
|
|
41
41
|
};
|
|
42
42
|
exports.getFormattedUnits = getFormattedUnits;
|
|
43
43
|
const getFormattedValue = num => {
|
|
@@ -50,13 +50,13 @@ const getFormattedValue = num => {
|
|
|
50
50
|
|
|
51
51
|
// if (typeof num === 'number') {
|
|
52
52
|
if (Math.abs(num) >= 1000000000) {
|
|
53
|
-
return (num / 1000000000).toFixed(1).replace(/\.0$/,
|
|
53
|
+
return (num / 1000000000).toFixed(1).replace(/\.0$/, '');
|
|
54
54
|
}
|
|
55
55
|
if (Math.abs(num) >= 1000000) {
|
|
56
|
-
return (num / 1000000).toFixed(1).replace(/\.0$/,
|
|
56
|
+
return (num / 1000000).toFixed(1).replace(/\.0$/, '');
|
|
57
57
|
}
|
|
58
58
|
if (Math.abs(num) >= 1000) {
|
|
59
|
-
return (num / 1000).toFixed(1).replace(/\.0$/,
|
|
59
|
+
return (num / 1000).toFixed(1).replace(/\.0$/, '');
|
|
60
60
|
}
|
|
61
61
|
return num;
|
|
62
62
|
// }
|
|
@@ -65,17 +65,7 @@ exports.getFormattedValue = getFormattedValue;
|
|
|
65
65
|
const getNumberWithCommas = x => {
|
|
66
66
|
let param = x.toString();
|
|
67
67
|
const pattern = /(-?\d+)(\d{3})/;
|
|
68
|
-
while (pattern.test(param)) param = param.replace(pattern,
|
|
68
|
+
while (pattern.test(param)) param = param.replace(pattern, '$1,$2');
|
|
69
69
|
return param;
|
|
70
70
|
};
|
|
71
|
-
exports.getNumberWithCommas = getNumberWithCommas;
|
|
72
|
-
const isNumericValue = num => {
|
|
73
|
-
if (num === undefined || num === null) {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
if (isNaN(parseFloat(num))) {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
return true;
|
|
80
|
-
};
|
|
81
|
-
exports.isNumericValue = isNumericValue;
|
|
71
|
+
exports.getNumberWithCommas = getNumberWithCommas;
|
|
@@ -17,7 +17,10 @@ var _IconButton = require("./IconButton.style");
|
|
|
17
17
|
/* IconButton */
|
|
18
18
|
const IconButton = props => {
|
|
19
19
|
const {
|
|
20
|
-
downloadStatus,
|
|
20
|
+
// downloadStatus,
|
|
21
|
+
fileName,
|
|
22
|
+
fileLink,
|
|
23
|
+
showProcess,
|
|
21
24
|
contentColor,
|
|
22
25
|
buttonText,
|
|
23
26
|
backgroundColor,
|
|
@@ -27,30 +30,28 @@ const IconButton = props => {
|
|
|
27
30
|
iconWidth,
|
|
28
31
|
iconHeight,
|
|
29
32
|
disabled,
|
|
30
|
-
inProgress,
|
|
31
33
|
onClick,
|
|
32
34
|
onCancelClick
|
|
33
35
|
} = props;
|
|
34
|
-
const [mouseDownPressed, setMouseDownPressed] = (0, _react.useState)(false);
|
|
35
36
|
const [progress, setProgress] = (0, _react.useState)(0);
|
|
36
37
|
const incrementProgress = () => {
|
|
37
|
-
if (
|
|
38
|
+
if (showProcess && progress <= 90) {
|
|
38
39
|
const interval = setInterval(() => {
|
|
39
40
|
setProgress(prevProgress => {
|
|
40
|
-
const newProgress = prevProgress +
|
|
41
|
+
const newProgress = prevProgress + 3;
|
|
41
42
|
if (newProgress >= 90) {
|
|
42
43
|
clearInterval(interval);
|
|
43
44
|
}
|
|
44
45
|
return newProgress;
|
|
45
46
|
});
|
|
46
47
|
}, 500);
|
|
47
|
-
} else
|
|
48
|
+
} else {
|
|
48
49
|
setProgress(0);
|
|
49
50
|
}
|
|
50
51
|
};
|
|
51
52
|
(0, _react.useEffect)(() => {
|
|
52
53
|
incrementProgress();
|
|
53
|
-
}, [
|
|
54
|
+
}, [showProcess]);
|
|
54
55
|
const getIcon = icon => {
|
|
55
56
|
switch (icon) {
|
|
56
57
|
case 'download':
|
|
@@ -99,54 +100,35 @@ const IconButton = props => {
|
|
|
99
100
|
return '';
|
|
100
101
|
}
|
|
101
102
|
};
|
|
102
|
-
const onMouseDownHandler = () => {
|
|
103
|
-
if (disabled) return;
|
|
104
|
-
setMouseDownPressed(true);
|
|
105
|
-
};
|
|
106
|
-
const onMouseUpHandler = () => {
|
|
107
|
-
if (disabled) return;
|
|
108
|
-
setMouseDownPressed(false);
|
|
109
|
-
};
|
|
110
|
-
const onPointerOutHandler = () => {
|
|
111
|
-
if (disabled) return;
|
|
112
|
-
if (!mouseDownPressed) return;
|
|
113
|
-
setMouseDownPressed(false);
|
|
114
|
-
};
|
|
115
|
-
const getClassNameExtention = () => {
|
|
116
|
-
if (disabled) return 'disabled';
|
|
117
|
-
if (mouseDownPressed) return 'mouseDownPressed';
|
|
118
|
-
return '';
|
|
119
|
-
};
|
|
120
103
|
const onClickHandler = event => {
|
|
121
|
-
if (disabled) return;
|
|
122
104
|
onClick(event);
|
|
123
105
|
};
|
|
124
106
|
const onCancelClickHandler = event => {
|
|
125
107
|
onCancelClick(event);
|
|
126
108
|
};
|
|
127
109
|
return /*#__PURE__*/_react.default.createElement(_IconButton.ButtonWrapper, null, /*#__PURE__*/_react.default.createElement(_IconButton.IconButtonContainer, {
|
|
128
|
-
|
|
110
|
+
download: fileName,
|
|
111
|
+
href: fileLink,
|
|
129
112
|
backgroundColor: backgroundColor,
|
|
130
113
|
borderColor: borderColor,
|
|
131
114
|
borderRadius: borderRadius,
|
|
132
115
|
color: contentColor,
|
|
133
|
-
|
|
134
|
-
onMouseUp: onMouseUpHandler,
|
|
135
|
-
onPointerOut: onPointerOutHandler,
|
|
136
|
-
inProgress: inProgress,
|
|
116
|
+
inProgress: showProcess,
|
|
137
117
|
progress: progress,
|
|
138
118
|
onClick: event => {
|
|
139
119
|
onClickHandler(event);
|
|
140
120
|
}
|
|
141
|
-
}, getIcon(iconName), buttonText !== '' && buttonText !== undefined && /*#__PURE__*/_react.default.createElement(_IconButton.SpanText, null, buttonText)),
|
|
121
|
+
}, getIcon(iconName), buttonText !== '' && buttonText !== undefined && /*#__PURE__*/_react.default.createElement(_IconButton.SpanText, null, buttonText)), showProcess && /*#__PURE__*/_react.default.createElement(_IconButton.CancelClick, {
|
|
142
122
|
onClick: event => onCancelClickHandler(event)
|
|
143
123
|
}, "Click here to cancel"));
|
|
144
124
|
};
|
|
145
125
|
exports.IconButton = IconButton;
|
|
146
126
|
var _default = exports.default = IconButton;
|
|
147
127
|
IconButton.defaultProps = {
|
|
148
|
-
// downloadStatus: '
|
|
149
|
-
|
|
128
|
+
// downloadStatus: '',
|
|
129
|
+
fileName: '',
|
|
130
|
+
fileLink: '',
|
|
131
|
+
showProcess: false,
|
|
150
132
|
buttonText: '',
|
|
151
133
|
iconName: 'eye',
|
|
152
134
|
contentColor: '#212121',
|
|
@@ -156,7 +138,6 @@ IconButton.defaultProps = {
|
|
|
156
138
|
iconHeight: 18,
|
|
157
139
|
iconWidth: 18,
|
|
158
140
|
disabled: false,
|
|
159
|
-
inProgress: false,
|
|
160
141
|
onClick: () => {},
|
|
161
142
|
onCancelClick: () => {}
|
|
162
143
|
};
|
|
@@ -10,6 +10,6 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
10
10
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
11
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
12
12
|
const ButtonWrapper = exports.ButtonWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: fit-content;\n text-align: center;\n"])));
|
|
13
|
-
const IconButtonContainer = exports.IconButtonContainer = _styledComponents.default.
|
|
13
|
+
const IconButtonContainer = exports.IconButtonContainer = _styledComponents.default.a(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n font-size: 14px;\n font-weight: 400;\n display: flex;\n gap: 10px;\n align-items: center;\n justify-content: center;\n padding: 12px 20px;\n text-decoration: none;\n color: ", ";\n border-radius: ", ";\n border: 1px solid ", ";\n background: ", ";\n position: relative;\n transition: all .3s;\n ", "\n &:hover, &:focus {\n cursor: pointer;\n box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.1);\n }\n"])), props => props.color, props => props.borderRadius, props => props.borderColor.toString(), props => props.backgroundColor.toString(), props => props.inProgress && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n pointer-events: none;\n &:after {\n content: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n text-wrap: nowrap;\n position: absolute;\n background: linear-gradient(\n to right,\n #5FCC70 ", "%,\n #B1B1B1 ", "%,\n #B1B1B1 100%\n );\n width: 100%;\n height: 100%;\n border-radius: ", ";\n border-width: 0;\n z-index: 9;\n }\n "])), props => props.buttonText, props.progress, props.progress + 1, props => props.borderRadius));
|
|
14
14
|
const SpanText = exports.SpanText = _styledComponents.default.span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n"])));
|
|
15
|
-
const CancelClick = exports.CancelClick = _styledComponents.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: inherit;\n font-family: \"Lato\", sans-serif;;\n font-size: 14px;\n color: #568202;\n"])));
|
|
15
|
+
const CancelClick = exports.CancelClick = _styledComponents.default.span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n display: inherit;\n font-family: \"Lato\", sans-serif;;\n font-size: 14px;\n color: #568202;\n cursor: pointer;\n margin-top: 5px;\n"])));
|