diginet-core-ui 1.3.24 → 1.3.29
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/assets/fonts/SF-Pro-Display-Bold.otf +0 -0
- package/assets/fonts/SF-Pro-Display-Medium.otf +0 -0
- package/assets/fonts/SF-Pro-Display-Regular.otf +0 -0
- package/assets/images/icons/wifi.svg +3 -0
- package/assets/images/menu/dhr/MHRM09N0004.svg +14 -0
- package/assets/images/menu/dhr/MHRP09N0028.svg +6 -0
- package/assets/images/menu/dhr/MHRP09N0029.svg +14 -0
- package/assets/images/menu/dhr/MHRP09N0030.svg +4 -0
- package/assets/images/menu/dhr/MHRP09N0031.svg +5 -0
- package/assets/images/menu/dhr/MHRP29N0012.svg +7 -0
- package/assets/images/menu/dhr/MHRP29N0021.svg +8 -0
- package/assets/images/menu/dhr/MHRP29N0022.svg +9 -0
- package/assets/images/menu/dhr/MHRP29N0023.svg +22 -0
- package/assets/images/menu/dhr/MHRP39N0015.svg +5 -0
- package/assets/images/menu/dhr/TASK.svg +9 -0
- package/assets/images/menu/erp/D05.svg +8 -0
- package/assets/images/menu/erp/D06.svg +4 -0
- package/assets/images/menu/erp/D90R.svg +9 -0
- package/assets/images/menu/erp/DBC.svg +9 -0
- package/assets/images/menu/erp/{W05F0006.svg → W05F0006N0000.svg} +0 -0
- package/assets/images/menu/erp/{W05F0008.svg → W05F0008N0000.svg} +0 -0
- package/assets/images/menu/erp/{W05F4000.svg → W05F4000N0000.svg} +0 -0
- package/assets/images/menu/erp/{W06F0005.svg → W06F0005N0000.svg} +0 -0
- package/assets/images/menu/erp/{W06F0006.svg → W06F0006N0000.svg} +0 -0
- package/assets/images/menu/erp/{W06F0008.svg → W06F0008N0000.svg} +0 -0
- package/assets/images/menu/erp/W94F1000N0000.svg +9 -0
- package/assets/images/menu/erp/W94F1000N0001.svg +9 -0
- package/components/accordion/css.js +42 -33
- package/components/accordion/details.js +29 -17
- package/components/accordion/group.js +23 -23
- package/components/accordion/index.js +36 -27
- package/components/accordion/summary.js +10 -11
- package/components/alert/index.js +97 -91
- package/components/alert/notify.js +10 -8
- package/components/avatar/index.js +19 -17
- package/components/badge/index.js +122 -139
- package/components/button/icon.js +242 -334
- package/components/button/index.js +272 -427
- package/components/button/more.js +4 -5
- package/components/button/ripple-effect.js +4 -6
- package/components/card/body-card.js +4 -6
- package/components/card/card.js +4 -8
- package/components/card/index.js +4 -5
- package/components/chart/Pie/Sector.js +4 -5
- package/components/chart/Pie/Sectors.js +5 -5
- package/components/chart/Pie/index.js +8 -9
- package/components/chart/Pie-v2/Sector.js +4 -5
- package/components/chart/Pie-v2/Sectors.js +7 -8
- package/components/chart/Pie-v2/index.js +11 -16
- package/components/chart/bar/Bar.js +2 -3
- package/components/chart/bar/Labels.js +9 -11
- package/components/chart/bar/index.js +17 -9
- package/components/chart/bar-v2/Bar.js +2 -3
- package/components/chart/bar-v2/Labels.js +9 -11
- package/components/chart/bar-v2/index.js +17 -9
- package/components/chart/line/Labels.js +8 -10
- package/components/chart/line/Point.js +2 -3
- package/components/chart/line/index.js +17 -9
- package/components/chart/line-v2/Labels.js +8 -10
- package/components/chart/line-v2/Point.js +2 -3
- package/components/chart/line-v2/index.js +17 -9
- package/components/chip/attach.js +12 -16
- package/components/chip/index.js +8 -11
- package/components/collapse/index.js +4 -5
- package/components/divider/index.js +27 -14
- package/components/form-control/attachment/index.js +143 -87
- package/components/form-control/calendar/function.js +24 -23
- package/components/form-control/calendar/index.js +2 -4
- package/components/form-control/calendar/range.js +3 -4
- package/components/form-control/checkbox/index.js +85 -71
- package/components/form-control/control/index.js +4 -6
- package/components/form-control/date-picker/index-old.js +0 -2
- package/components/form-control/date-picker/index.js +39 -43
- package/components/form-control/date-range-picker/index.js +26 -28
- package/components/form-control/dropdown/index.js +173 -202
- package/components/form-control/dropdown-box/index.js +72 -49
- package/components/form-control/form-group/index.js +4 -5
- package/components/form-control/helper-text/index.js +4 -5
- package/components/form-control/input-base/index.js +28 -38
- package/components/form-control/label/index.js +23 -13
- package/components/form-control/money-input/index.js +6 -6
- package/components/form-control/number-input/index.js +12 -14
- package/components/form-control/phone-input/index.js +4 -5
- package/components/form-control/radio/index.js +7 -15
- package/components/form-control/text-input/index.js +14 -24
- package/components/form-control/time-picker/index.js +15 -26
- package/components/form-control/time-picker/swiper.js +2 -4
- package/components/form-control/toggle/index.js +22 -18
- package/components/form-view/helper-text.js +4 -5
- package/components/form-view/index.js +4 -5
- package/components/form-view/input.js +5 -7
- package/components/form-view/label.js +2 -6
- package/components/list/list-item-action.js +7 -8
- package/components/list/list-item-icon.js +4 -5
- package/components/list/list-item-text.js +4 -5
- package/components/list/list-item.js +4 -5
- package/components/list/list.js +4 -5
- package/components/list/sub-header.js +4 -5
- package/components/modal/body.js +4 -6
- package/components/modal/footer.js +4 -6
- package/components/modal/header.js +8 -14
- package/components/modal/index.js +4 -5
- package/components/modal/modal.js +6 -13
- package/components/others/extra/index.js +4 -8
- package/components/others/option-wrapper/index.js +57 -0
- package/components/others/scrollbar/index.js +4 -5
- package/components/paging/page-info.js +282 -231
- package/components/paging/page-selector.js +4 -7
- package/components/popover/index.js +6 -7
- package/components/popup/danger_popup.js +8 -18
- package/components/popup/index.js +26 -34
- package/components/popup/proposals_popup.js +9 -16
- package/components/popup/v2/danger-popup.js +4 -6
- package/components/popup/v2/index.js +116 -98
- package/components/popup/v2/info-popup.js +4 -6
- package/components/popup/v2/success-popup.js +4 -6
- package/components/popup/v2/warning-popup.js +4 -6
- package/components/popup/v2/yes-no-popup.js +4 -6
- package/components/progress/circular.js +17 -26
- package/components/progress/linear.js +11 -13
- package/components/rating/index.js +114 -233
- package/components/slider/slider-container.js +15 -10
- package/components/slider/slider-item.js +10 -12
- package/components/status/index.js +63 -57
- package/components/tab/tab-container.js +26 -24
- package/components/tab/tab-header.js +36 -27
- package/components/tab/tab-panel.js +32 -15
- package/components/tab/tab.js +79 -80
- package/components/tooltip/index.js +4 -4
- package/components/transfer/index.js +10 -11
- package/components/tree-view/css.js +2 -0
- package/components/tree-view/index.js +14 -13
- package/components/typography/index.js +6 -112
- package/css/styles.css +1 -1
- package/css/styles.css.map +1 -1
- package/global/index.js +2 -0
- package/icons/basic.js +1648 -959
- package/icons/effect.js +45 -103
- package/package.json +1 -1
- package/readme.md +66 -0
- package/styles/color-helper.js +7 -146
- package/styles/colors.js +6 -2
- package/styles/font.js +9 -0
- package/styles/general.js +100 -7
- package/styles/typography.js +25 -26
- package/theme/settings.js +9 -2
- package/theme/theme-provider.js +15 -7
- package/theme/with-styles.js +2 -4
- package/theme/with-theme.js +2 -4
- package/utils/isMobile.js +21 -0
- package/utils/renderHTML.js +4 -5
- package/utils/renderIcon.js +15 -11
- package/utils/updatePosition.js +2 -2
package/styles/typography.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { css } from '@emotion/core';
|
|
2
2
|
import { parseToPixel } from "./utils";
|
|
3
|
-
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export const fontSize = '16px';
|
|
3
|
+
import { font } from "./font";
|
|
4
|
+
export const {
|
|
5
|
+
fontFamily,
|
|
6
|
+
fontSize
|
|
7
|
+
} = font; //export to use general
|
|
8
|
+
|
|
10
9
|
const fontNormal = css`
|
|
11
10
|
font-style: normal;
|
|
11
|
+
font-family: ${fontFamily};
|
|
12
12
|
`;
|
|
13
13
|
const fontWeightBold = css`
|
|
14
14
|
font-weight: 700;
|
|
@@ -18,7 +18,7 @@ const fontWeightRegular = css`
|
|
|
18
18
|
`;
|
|
19
19
|
const fontWeightNormal = css`
|
|
20
20
|
font-weight: normal;
|
|
21
|
-
`;
|
|
21
|
+
`; // follow rules line-height = fontsize + 4
|
|
22
22
|
|
|
23
23
|
const getFontSize = size => css`
|
|
24
24
|
font-size: ${parseToPixel(size)};
|
|
@@ -28,78 +28,77 @@ const getFontSize = size => css`
|
|
|
28
28
|
const title1 = css`
|
|
29
29
|
${fontNormal};
|
|
30
30
|
${fontWeightBold};
|
|
31
|
-
${getFontSize(
|
|
31
|
+
${getFontSize(parseInt(fontSize) + 16)}; //32
|
|
32
32
|
`;
|
|
33
33
|
const title2 = css`
|
|
34
34
|
${fontNormal};
|
|
35
35
|
${fontWeightBold};
|
|
36
|
-
${getFontSize(
|
|
36
|
+
${getFontSize(parseInt(fontSize) + 10)}; //26
|
|
37
37
|
`;
|
|
38
38
|
const title3 = css`
|
|
39
39
|
${fontNormal};
|
|
40
40
|
${fontWeightBold};
|
|
41
|
-
${getFontSize(
|
|
41
|
+
${getFontSize(parseInt(fontSize) + 8)}; //24
|
|
42
42
|
`;
|
|
43
43
|
const title4 = css`
|
|
44
44
|
${fontNormal};
|
|
45
45
|
${fontWeightBold};
|
|
46
|
-
${getFontSize(
|
|
46
|
+
${getFontSize(parseInt(fontSize) + 6)}; //22
|
|
47
47
|
`;
|
|
48
48
|
const heading1 = css`
|
|
49
49
|
${fontNormal};
|
|
50
50
|
${fontWeightBold};
|
|
51
|
-
${getFontSize(
|
|
51
|
+
${getFontSize(parseInt(fontSize) + 4)}; //20
|
|
52
52
|
`;
|
|
53
53
|
const heading2 = css`
|
|
54
54
|
${fontNormal};
|
|
55
55
|
${fontWeightBold};
|
|
56
|
-
${getFontSize(
|
|
56
|
+
${getFontSize(parseInt(fontSize) + 2)}; //18
|
|
57
57
|
`;
|
|
58
58
|
const heading3 = css`
|
|
59
59
|
${fontNormal};
|
|
60
60
|
${fontWeightBold};
|
|
61
|
-
|
|
62
|
-
line-height: 20px;
|
|
61
|
+
${getFontSize(parseInt(fontSize))}; //16
|
|
63
62
|
`;
|
|
64
63
|
const heading4 = css`
|
|
65
64
|
${fontNormal};
|
|
66
65
|
${fontWeightBold};
|
|
67
|
-
${getFontSize(
|
|
66
|
+
${getFontSize(parseInt(fontSize) - 2)}; //14
|
|
68
67
|
`;
|
|
69
68
|
const heading5 = css`
|
|
70
69
|
${fontNormal};
|
|
71
70
|
${fontWeightBold};
|
|
72
|
-
${getFontSize(
|
|
71
|
+
${getFontSize(parseInt(fontSize) - 4)}; //12
|
|
73
72
|
`;
|
|
74
73
|
const heading6 = css`
|
|
75
74
|
${fontNormal};
|
|
76
75
|
${fontWeightRegular}
|
|
77
|
-
${getFontSize(
|
|
76
|
+
${getFontSize(parseInt(fontSize) - 4)}; //12
|
|
78
77
|
`;
|
|
79
78
|
const paragraph1 = css`
|
|
80
79
|
${fontNormal};
|
|
81
80
|
${fontWeightNormal};
|
|
82
|
-
${getFontSize(
|
|
81
|
+
${getFontSize(parseInt(fontSize))}; //16
|
|
83
82
|
`;
|
|
84
83
|
const paragraph2 = css`
|
|
85
84
|
${fontNormal};
|
|
86
85
|
${fontWeightNormal};
|
|
87
|
-
${getFontSize(
|
|
86
|
+
${getFontSize(parseInt(fontSize) - 2)}; //14
|
|
88
87
|
`;
|
|
89
88
|
const paragraph3 = css`
|
|
90
89
|
${fontNormal};
|
|
91
90
|
${fontWeightNormal};
|
|
92
|
-
${getFontSize(
|
|
91
|
+
${getFontSize(parseInt(fontSize) - 4)}; //12
|
|
93
92
|
`;
|
|
94
93
|
const uppercase = css`
|
|
95
|
-
|
|
94
|
+
text-transform: uppercase
|
|
96
95
|
`;
|
|
97
96
|
const label = css`
|
|
98
|
-
font-size:
|
|
99
|
-
${fontWeightBold}
|
|
97
|
+
font-size: ${parseInt(fontSize) - 4}px; //12
|
|
98
|
+
${fontWeightBold}
|
|
100
99
|
`;
|
|
101
100
|
const helperText = css`
|
|
102
|
-
font-size:
|
|
101
|
+
font-size: ${parseInt(fontSize) - 4}px; //12
|
|
103
102
|
${fontWeightNormal}
|
|
104
103
|
`;
|
|
105
104
|
export const typography = {
|
package/theme/settings.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { fontSize, fontFamily, fontFamilyMedium, fontFamilyBold } from '../styles/typography';
|
|
2
1
|
import * as colors from '../styles/colors';
|
|
2
|
+
import { font } from '../styles/font';
|
|
3
|
+
const {
|
|
4
|
+
fontSize,
|
|
5
|
+
fontFamily,
|
|
6
|
+
fontFamilyBold,
|
|
7
|
+
fontFamilyMedium
|
|
8
|
+
} = font;
|
|
9
|
+
import { color } from '../styles/colors';
|
|
3
10
|
const settings = {
|
|
4
11
|
border: {
|
|
5
12
|
radius: '4px',
|
|
@@ -9,7 +16,7 @@ const settings = {
|
|
|
9
16
|
large: '0 4px 4px 0 rgba(0, 0, 0, 0.25)',
|
|
10
17
|
small: '0 2px 2px 0 rgba(0, 0, 0, 0.25)'
|
|
11
18
|
},
|
|
12
|
-
colors: {
|
|
19
|
+
colors: { ...color,
|
|
13
20
|
bgDisabled: colors.dark12,
|
|
14
21
|
bgProgress: colors.brand12,
|
|
15
22
|
border: colors.dark6,
|
package/theme/theme-provider.js
CHANGED
|
@@ -5,33 +5,41 @@ import { memo, useEffect } from 'react';
|
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
6
|
import { setTheme } from './set-theme';
|
|
7
7
|
import { makeStylesEls } from './make-styles';
|
|
8
|
-
import { fontFamilyLink, fontFamilyMediumLink, fontFamilyBoldLink } from '../styles/typography';
|
|
9
8
|
import { string, object, node } from 'prop-types';
|
|
9
|
+
import { font } from '../styles/font';
|
|
10
|
+
const {
|
|
11
|
+
fontFamily,
|
|
12
|
+
fontFamilyBold,
|
|
13
|
+
fontFamilyMedium,
|
|
14
|
+
fontFamilyLink,
|
|
15
|
+
fontFamilyBoldLink,
|
|
16
|
+
fontFamilyMediumLink
|
|
17
|
+
} = font;
|
|
10
18
|
const ThemeProviderRoot = css`
|
|
11
19
|
@font-face {
|
|
12
|
-
font-family:
|
|
20
|
+
font-family: ${fontFamilyBold};
|
|
13
21
|
src: url('${fontFamilyBoldLink}') format('opentype');
|
|
14
22
|
}
|
|
15
23
|
@font-face {
|
|
16
|
-
font-family:
|
|
24
|
+
font-family: ${fontFamilyMedium};
|
|
17
25
|
src: url('${fontFamilyMediumLink}') format('opentype');
|
|
18
26
|
}
|
|
19
27
|
@font-face {
|
|
20
|
-
font-family:
|
|
28
|
+
font-family: ${fontFamily};
|
|
21
29
|
src: url('${fontFamilyLink}') format('opentype');
|
|
22
30
|
}
|
|
23
31
|
@font-face {
|
|
24
|
-
font-family:
|
|
32
|
+
font-family: ${fontFamily};
|
|
25
33
|
font-weight: 400;
|
|
26
34
|
src: url('${fontFamilyLink}') format('opentype');
|
|
27
35
|
}
|
|
28
36
|
@font-face {
|
|
29
|
-
font-family:
|
|
37
|
+
font-family: ${fontFamily};
|
|
30
38
|
font-weight: 500;
|
|
31
39
|
src: url('${fontFamilyMediumLink}') format('opentype');
|
|
32
40
|
}
|
|
33
41
|
@font-face {
|
|
34
|
-
font-family:
|
|
42
|
+
font-family: ${fontFamily};
|
|
35
43
|
font-weight: 700;
|
|
36
44
|
src: url('${fontFamilyBoldLink}') format('opentype');
|
|
37
45
|
}
|
package/theme/with-styles.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -9,9 +7,9 @@ import makeStyles from './make-styles';
|
|
|
9
7
|
const WithStyles = styles => Component => props => {
|
|
10
8
|
const useStyle = makeStyles(styles);
|
|
11
9
|
const classes = useStyle();
|
|
12
|
-
return jsx(Component,
|
|
10
|
+
return jsx(Component, { ...props,
|
|
13
11
|
classes: classes
|
|
14
|
-
})
|
|
12
|
+
});
|
|
15
13
|
};
|
|
16
14
|
|
|
17
15
|
export default WithStyles;
|
package/theme/with-theme.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
import settings from './settings';
|
|
4
2
|
|
|
5
3
|
const withTheme = Component => props => {
|
|
6
|
-
return /*#__PURE__*/React.createElement(Component,
|
|
4
|
+
return /*#__PURE__*/React.createElement(Component, { ...props,
|
|
7
5
|
theme: settings
|
|
8
|
-
})
|
|
6
|
+
});
|
|
9
7
|
};
|
|
10
8
|
|
|
11
9
|
export default withTheme;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const isMobile = {
|
|
2
|
+
iOS: function () {
|
|
3
|
+
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
|
|
4
|
+
},
|
|
5
|
+
Android: function () {
|
|
6
|
+
return navigator.userAgent.match(/Android/i);
|
|
7
|
+
},
|
|
8
|
+
BlackBerry: function () {
|
|
9
|
+
return navigator.userAgent.match(/BlackBerry/i);
|
|
10
|
+
},
|
|
11
|
+
Opera: function () {
|
|
12
|
+
return navigator.userAgent.match(/Opera Mini/i);
|
|
13
|
+
},
|
|
14
|
+
Windows: function () {
|
|
15
|
+
return navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i);
|
|
16
|
+
},
|
|
17
|
+
any: function () {
|
|
18
|
+
return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default isMobile;
|
package/utils/renderHTML.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
@@ -8,14 +6,15 @@ import parseTextToHTML from './parseHTML';
|
|
|
8
6
|
|
|
9
7
|
const renderHTML = (text = null, TagName = 'div', options = {}) => {
|
|
10
8
|
if (text && (text.$$typeof && String(text.$$typeof) === 'Symbol(react.element)' || Array.isArray(text) && text.some(node => node && String(node.$$typeof) === 'Symbol(react.element)'))) {
|
|
11
|
-
return jsx(TagName, options
|
|
9
|
+
return jsx(TagName, { ...options
|
|
10
|
+
}, text);
|
|
12
11
|
}
|
|
13
12
|
|
|
14
|
-
return jsx(TagName,
|
|
13
|
+
return jsx(TagName, { ...options,
|
|
15
14
|
dangerouslySetInnerHTML: {
|
|
16
15
|
__html: parseTextToHTML(String(text))
|
|
17
16
|
}
|
|
18
|
-
})
|
|
17
|
+
});
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
export default renderHTML;
|
package/utils/renderIcon.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
1
|
/** @jsxRuntime classic */
|
|
4
2
|
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import { jsx } from '@emotion/core';
|
|
7
|
-
import
|
|
5
|
+
import { ButtonIcon } from '../components';
|
|
6
|
+
import * as Icons from '../icons';
|
|
8
7
|
import { parseTextToHTML, capitalize } from './';
|
|
9
8
|
/**
|
|
10
9
|
* render icon form source (dynamic type)
|
|
@@ -20,28 +19,33 @@ const renderIcon = (source, type, options = {}) => {
|
|
|
20
19
|
let IconComp = Icons[capitalize(source)];
|
|
21
20
|
|
|
22
21
|
if (IconComp) {
|
|
23
|
-
return jsx(IconComp, options
|
|
22
|
+
return jsx(IconComp, { ...options
|
|
23
|
+
});
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
return null;
|
|
27
27
|
|
|
28
28
|
case 'effect':
|
|
29
|
-
return jsx(
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
return jsx(ButtonIcon, {
|
|
30
|
+
viewType: 'ghost',
|
|
31
|
+
name: source,
|
|
32
|
+
...options
|
|
33
|
+
});
|
|
32
34
|
|
|
33
35
|
case 'link':
|
|
34
36
|
case 'imgLink':
|
|
35
|
-
return jsx("img",
|
|
36
|
-
src: source
|
|
37
|
-
|
|
37
|
+
return jsx("img", {
|
|
38
|
+
src: source,
|
|
39
|
+
...options
|
|
40
|
+
});
|
|
38
41
|
|
|
39
42
|
default:
|
|
40
43
|
if (source.length < 20) {
|
|
41
44
|
const IconComp = Icons[capitalize(source)];
|
|
42
45
|
|
|
43
46
|
if (IconComp) {
|
|
44
|
-
return jsx(IconComp, options
|
|
47
|
+
return jsx(IconComp, { ...options
|
|
48
|
+
});
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
return null;
|
package/utils/updatePosition.js
CHANGED
|
@@ -14,7 +14,7 @@ const updatePosition = (anchorEl, transformEl, cb) => {
|
|
|
14
14
|
} = transformEl.getBoundingClientRect(); // Vertical
|
|
15
15
|
|
|
16
16
|
if (bottom < 0 || top > innerHeight) {
|
|
17
|
-
cb();
|
|
17
|
+
cb === null || cb === void 0 ? void 0 : cb();
|
|
18
18
|
} else if (bottom + 4 + nodeHeight > innerHeight) {
|
|
19
19
|
if (top - (nodeHeight + 4) > 0) {
|
|
20
20
|
transformEl.style.top = top - (nodeHeight + 4) + 'px';
|
|
@@ -27,7 +27,7 @@ const updatePosition = (anchorEl, transformEl, cb) => {
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
if (left < 0 || right > innerWidth) {
|
|
30
|
-
cb();
|
|
30
|
+
cb === null || cb === void 0 ? void 0 : cb();
|
|
31
31
|
} else {
|
|
32
32
|
transformEl.style.left = left + 'px';
|
|
33
33
|
}
|