diginet-core-ui 1.3.73-beta.1 → 1.3.73-beta.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/accordion/summary.js +2 -2
- package/components/form-control/attachment/index.js +27 -22
- package/components/form-control/checkbox/index.js +4 -4
- package/components/form-control/dropdown/index.js +4 -2
- package/components/grid/Col.js +8 -7
- package/components/grid/Container.js +16 -15
- package/components/grid/Row.js +16 -15
- package/components/grid/index.js +17 -36
- package/components/modal/footer.js +14 -4
- package/components/popover/body.js +2 -2
- package/components/popover/footer.js +3 -2
- package/components/popover/header.js +5 -3
- package/components/popover/index.js +59 -32
- package/components/tab/tab-container.js +27 -24
- package/components/tab/tab-header.js +31 -27
- package/components/tab/tab-panel.js +31 -27
- package/components/tab/tab.js +41 -35
- package/components/tree-view/index.js +117 -84
- package/icons/basic.js +56 -0
- package/package.json +1 -1
- package/styles/general.js +11 -11
|
@@ -61,10 +61,10 @@ const AccordionSummary = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
61
61
|
|
|
62
62
|
if (expandState) {
|
|
63
63
|
if (expanded === undefined) setExpandState(false);
|
|
64
|
-
!!onCollapse && onCollapse(
|
|
64
|
+
!!onCollapse && onCollapse(ref.current);
|
|
65
65
|
} else if (!expandState) {
|
|
66
66
|
if (expanded === undefined) setExpandState(true);
|
|
67
|
-
!!onExpand && onExpand(
|
|
67
|
+
!!onExpand && onExpand(ref.current);
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -1775,7 +1775,12 @@ Attachment.defaultProps = {
|
|
|
1775
1775
|
multiple: true,
|
|
1776
1776
|
readOnly: false,
|
|
1777
1777
|
style: {},
|
|
1778
|
-
uploadErrorInfo: {
|
|
1778
|
+
uploadErrorInfo: {
|
|
1779
|
+
maxFile: getGlobal(['errorDefault', 'maxFile']),
|
|
1780
|
+
maxSize: getGlobal(['errorDefault', 'maxSize']),
|
|
1781
|
+
fileType: getGlobal(['errorDefault', 'fileType']),
|
|
1782
|
+
existingFile: getGlobal(['errorDefault', 'existingFile'])
|
|
1783
|
+
},
|
|
1779
1784
|
viewType: 'detail'
|
|
1780
1785
|
};
|
|
1781
1786
|
Attachment.propTypes = {
|
|
@@ -1788,17 +1793,17 @@ Attachment.propTypes = {
|
|
|
1788
1793
|
/** Class for component. */
|
|
1789
1794
|
className: PropTypes.string,
|
|
1790
1795
|
|
|
1791
|
-
/** List attachment:<br />
|
|
1792
|
-
* [{<br />
|
|
1793
|
-
* "AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
|
|
1794
|
-
* "URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
|
|
1795
|
-
* "FileName": "8a07bee1eeff17a14eee.jpg",<br />
|
|
1796
|
-
* "FileSize": 248837,<br />
|
|
1797
|
-
* "KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
|
|
1798
|
-
* "CreateUserID": "LEMONADMIN",<br />
|
|
1799
|
-
* "CreateDate": "2020-08-24T11:54:04.307Z",<br />
|
|
1800
|
-
* "UserName": "Quản trị hệ thống"<br />
|
|
1801
|
-
* }, ...]
|
|
1796
|
+
/** List attachment:<br />
|
|
1797
|
+
* [{<br />
|
|
1798
|
+
* "AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
|
|
1799
|
+
* "URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
|
|
1800
|
+
* "FileName": "8a07bee1eeff17a14eee.jpg",<br />
|
|
1801
|
+
* "FileSize": 248837,<br />
|
|
1802
|
+
* "KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
|
|
1803
|
+
* "CreateUserID": "LEMONADMIN",<br />
|
|
1804
|
+
* "CreateDate": "2020-08-24T11:54:04.307Z",<br />
|
|
1805
|
+
* "UserName": "Quản trị hệ thống"<br />
|
|
1806
|
+
* }, ...]
|
|
1802
1807
|
*/
|
|
1803
1808
|
data: PropTypes.array,
|
|
1804
1809
|
|
|
@@ -1841,16 +1846,16 @@ Attachment.propTypes = {
|
|
|
1841
1846
|
/** Download attached event, if not it will use default. */
|
|
1842
1847
|
onDownload: PropTypes.func,
|
|
1843
1848
|
|
|
1844
|
-
/**
|
|
1845
|
-
* event when removed file(s)
|
|
1846
|
-
*
|
|
1847
|
-
* return data: {<br/>
|
|
1848
|
-
* attached: [Files] (insist old and all new files )<br/>
|
|
1849
|
-
* allNewAttached: [Files]<br/>
|
|
1850
|
-
* oldAttached: [Files]<br/>
|
|
1851
|
-
* removedAttached: [Files]<br/>
|
|
1852
|
-
* element: [NodeList (just removed)]<br/>
|
|
1853
|
-
* }
|
|
1849
|
+
/**
|
|
1850
|
+
* event when removed file(s)
|
|
1851
|
+
*
|
|
1852
|
+
* return data: {<br/>
|
|
1853
|
+
* attached: [Files] (insist old and all new files )<br/>
|
|
1854
|
+
* allNewAttached: [Files]<br/>
|
|
1855
|
+
* oldAttached: [Files]<br/>
|
|
1856
|
+
* removedAttached: [Files]<br/>
|
|
1857
|
+
* element: [NodeList (just removed)]<br/>
|
|
1858
|
+
* }
|
|
1854
1859
|
*/
|
|
1855
1860
|
onRemove: PropTypes.func,
|
|
1856
1861
|
|
|
@@ -328,10 +328,10 @@ Checkbox.propTypes = {
|
|
|
328
328
|
/** The name of the Checkbox corresponds to the label displayed on the interface. */
|
|
329
329
|
name: PropTypes.string,
|
|
330
330
|
|
|
331
|
-
/**
|
|
332
|
-
* Callback fired when the state is changed.
|
|
333
|
-
*
|
|
334
|
-
* You can pull out the new checked state by accessing `event.value` or `event.target.checked` (boolean).
|
|
331
|
+
/**
|
|
332
|
+
* Callback fired when the state is changed.
|
|
333
|
+
*
|
|
334
|
+
* You can pull out the new checked state by accessing `event.value` or `event.target.checked` (boolean).
|
|
335
335
|
*/
|
|
336
336
|
onChange: PropTypes.func,
|
|
337
337
|
|
|
@@ -49,7 +49,8 @@ const timing = {},
|
|
|
49
49
|
isSearch = {},
|
|
50
50
|
allValue = {};
|
|
51
51
|
const separatorPattern = /\{\w+\}/g;
|
|
52
|
-
const regexBetween = /[^{\}]+(?=})/g;
|
|
52
|
+
const regexBetween = /[^{\}]+(?=})/g; // eslint-disable-line
|
|
53
|
+
|
|
53
54
|
const regexInclude = /{|}/g;
|
|
54
55
|
|
|
55
56
|
const checkHasValue = value => {
|
|
@@ -914,6 +915,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
914
915
|
const onRemove = (e, value) => {
|
|
915
916
|
var _ref;
|
|
916
917
|
|
|
918
|
+
if (readOnly || disabled) return;
|
|
917
919
|
const index = currentValue[unique].findIndex(v => JSON.stringify(v) === JSON.stringify(value));
|
|
918
920
|
|
|
919
921
|
if (index !== -1) {
|
|
@@ -1385,7 +1387,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1385
1387
|
label: text,
|
|
1386
1388
|
size: 'medium',
|
|
1387
1389
|
disabled: disabled,
|
|
1388
|
-
clearAble:
|
|
1390
|
+
clearAble: !readOnly && !disabled,
|
|
1389
1391
|
onRemove: e => onRemove(e, vl)
|
|
1390
1392
|
});
|
|
1391
1393
|
}
|
package/components/grid/Col.js
CHANGED
|
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import Grid from '.';
|
|
7
7
|
import { makeStyles } from '../../theme';
|
|
8
|
+
import { classNames } from '../../utils';
|
|
8
9
|
const useStyles = makeStyles({
|
|
9
10
|
customCol: {
|
|
10
11
|
'& .DGN-UI-Control': {
|
|
@@ -34,30 +35,27 @@ const Col = props => {
|
|
|
34
35
|
className
|
|
35
36
|
} = props;
|
|
36
37
|
return jsx(Grid, { ...props,
|
|
37
|
-
className:
|
|
38
|
+
className: classNames(`DGN-UI-Col ${classes.customCol}`, className),
|
|
38
39
|
item: true
|
|
39
40
|
});
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
Col.defaultProps = {
|
|
43
|
-
style: {},
|
|
44
44
|
className: '',
|
|
45
45
|
columns: 12,
|
|
46
46
|
lg: false,
|
|
47
47
|
md: false,
|
|
48
48
|
sm: false,
|
|
49
|
+
style: {},
|
|
50
|
+
wrap: 'wrap',
|
|
49
51
|
xl: false,
|
|
50
52
|
xs: true,
|
|
51
|
-
zeroMinWidth: false
|
|
52
|
-
wrap: 'wrap'
|
|
53
|
+
zeroMinWidth: false
|
|
53
54
|
};
|
|
54
55
|
Col.propTypes = {
|
|
55
56
|
/** The content of the component. */
|
|
56
57
|
children: PropTypes.node,
|
|
57
58
|
|
|
58
|
-
/** Style inline of component. */
|
|
59
|
-
style: PropTypes.object,
|
|
60
|
-
|
|
61
59
|
/** Class for component. */
|
|
62
60
|
className: PropTypes.string,
|
|
63
61
|
|
|
@@ -76,6 +74,9 @@ Col.propTypes = {
|
|
|
76
74
|
/** If a number, it sets the number of columns the grid item uses. It can't be greater than the total number of columns of the container (12 by default). If 'auto', the grid item's width matches its content. If false, the prop is ignored. If true, the grid item's width grows to use the space available in the grid container. The value is applied for the `sm` breakpoint and wider screens if not overridden. */
|
|
77
75
|
sm: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]),
|
|
78
76
|
|
|
77
|
+
/** Style inline of component. */
|
|
78
|
+
style: PropTypes.object,
|
|
79
|
+
|
|
79
80
|
/** Defines the flex-wrap style property. It's applied for all screen sizes. */
|
|
80
81
|
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap']),
|
|
81
82
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import Grid from '.';
|
|
7
|
+
import { classNames } from '../../utils';
|
|
7
8
|
|
|
8
9
|
const checkChildren = children => {
|
|
9
10
|
if (!children) return false;
|
|
@@ -21,24 +22,14 @@ const Container = props => {
|
|
|
21
22
|
children
|
|
22
23
|
} = props;
|
|
23
24
|
return checkChildren(children) ? jsx(Grid, { ...props,
|
|
24
|
-
className:
|
|
25
|
+
className: classNames('DGN-UI-Container', className),
|
|
25
26
|
container: true
|
|
26
27
|
}) : null;
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
Container.defaultProps = {
|
|
30
|
-
style: {},
|
|
31
31
|
className: '',
|
|
32
32
|
columns: 12,
|
|
33
|
-
lg: false,
|
|
34
|
-
md: false,
|
|
35
|
-
sm: false,
|
|
36
|
-
xl: false,
|
|
37
|
-
xs: false,
|
|
38
|
-
zeroMinWidth: false,
|
|
39
|
-
spacing: 0,
|
|
40
|
-
direction: 'row',
|
|
41
|
-
wrap: 'wrap',
|
|
42
33
|
columnSpacing: {
|
|
43
34
|
xs: 4,
|
|
44
35
|
sm: 4,
|
|
@@ -46,6 +37,9 @@ Container.defaultProps = {
|
|
|
46
37
|
lg: 4,
|
|
47
38
|
xl: 6
|
|
48
39
|
},
|
|
40
|
+
direction: 'row',
|
|
41
|
+
lg: false,
|
|
42
|
+
md: false,
|
|
49
43
|
rowSpacing: {
|
|
50
44
|
xs: 4,
|
|
51
45
|
sm: 4,
|
|
@@ -53,21 +47,25 @@ Container.defaultProps = {
|
|
|
53
47
|
lg: 4,
|
|
54
48
|
xl: 4
|
|
55
49
|
},
|
|
50
|
+
sm: false,
|
|
51
|
+
spacing: 0,
|
|
52
|
+
style: {},
|
|
56
53
|
topSpacing: {
|
|
57
54
|
xs: 2,
|
|
58
55
|
sm: 2,
|
|
59
56
|
md: 2,
|
|
60
57
|
lg: 2,
|
|
61
58
|
xl: 2
|
|
62
|
-
}
|
|
59
|
+
},
|
|
60
|
+
wrap: 'wrap',
|
|
61
|
+
xl: false,
|
|
62
|
+
xs: false,
|
|
63
|
+
zeroMinWidth: false
|
|
63
64
|
};
|
|
64
65
|
Container.propTypes = {
|
|
65
66
|
/** The content of the component. */
|
|
66
67
|
children: PropTypes.node,
|
|
67
68
|
|
|
68
|
-
/** Style inline of component. */
|
|
69
|
-
style: PropTypes.object,
|
|
70
|
-
|
|
71
69
|
/** Class for component. */
|
|
72
70
|
className: PropTypes.string,
|
|
73
71
|
|
|
@@ -95,6 +93,9 @@ Container.propTypes = {
|
|
|
95
93
|
/** Defines the space between the type `Col` components */
|
|
96
94
|
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
97
95
|
|
|
96
|
+
/** Style inline of component. */
|
|
97
|
+
style: PropTypes.object,
|
|
98
|
+
|
|
98
99
|
/** Defines the flex-wrap style property. It's applied for all screen sizes. */
|
|
99
100
|
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap']),
|
|
100
101
|
|
package/components/grid/Row.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import Grid from '.';
|
|
7
|
+
import { classNames } from '../../utils';
|
|
7
8
|
|
|
8
9
|
const checkChildren = children => {
|
|
9
10
|
if (!children) return false;
|
|
@@ -21,24 +22,14 @@ const Row = props => {
|
|
|
21
22
|
children
|
|
22
23
|
} = props;
|
|
23
24
|
return checkChildren(children) ? jsx(Grid, { ...props,
|
|
24
|
-
className:
|
|
25
|
+
className: classNames('DGN-UI-Row', className),
|
|
25
26
|
container: true
|
|
26
27
|
}) : null;
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
Row.defaultProps = {
|
|
30
|
-
style: {},
|
|
31
31
|
className: '',
|
|
32
32
|
columns: 12,
|
|
33
|
-
lg: false,
|
|
34
|
-
md: false,
|
|
35
|
-
sm: false,
|
|
36
|
-
xl: false,
|
|
37
|
-
xs: false,
|
|
38
|
-
zeroMinWidth: false,
|
|
39
|
-
spacing: 0,
|
|
40
|
-
direction: 'row',
|
|
41
|
-
wrap: 'wrap',
|
|
42
33
|
columnSpacing: {
|
|
43
34
|
xs: 4,
|
|
44
35
|
sm: 4,
|
|
@@ -46,21 +37,28 @@ Row.defaultProps = {
|
|
|
46
37
|
lg: 4,
|
|
47
38
|
xl: 6
|
|
48
39
|
},
|
|
40
|
+
direction: 'row',
|
|
41
|
+
lg: false,
|
|
42
|
+
md: false,
|
|
49
43
|
rowSpacing: {
|
|
50
44
|
xs: 4,
|
|
51
45
|
sm: 4,
|
|
52
46
|
md: 4,
|
|
53
47
|
lg: 4,
|
|
54
48
|
xl: 4
|
|
55
|
-
}
|
|
49
|
+
},
|
|
50
|
+
sm: false,
|
|
51
|
+
spacing: 0,
|
|
52
|
+
style: {},
|
|
53
|
+
wrap: 'wrap',
|
|
54
|
+
xl: false,
|
|
55
|
+
xs: false,
|
|
56
|
+
zeroMinWidth: false
|
|
56
57
|
};
|
|
57
58
|
Row.propTypes = {
|
|
58
59
|
/** The content of the component. */
|
|
59
60
|
children: PropTypes.node,
|
|
60
61
|
|
|
61
|
-
/** Style inline of component. */
|
|
62
|
-
style: PropTypes.object,
|
|
63
|
-
|
|
64
62
|
/** Class for component. */
|
|
65
63
|
className: PropTypes.string,
|
|
66
64
|
|
|
@@ -88,6 +86,9 @@ Row.propTypes = {
|
|
|
88
86
|
/** Defines the space between the type `Col` components */
|
|
89
87
|
spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),
|
|
90
88
|
|
|
89
|
+
/** Style inline of component. */
|
|
90
|
+
style: PropTypes.object,
|
|
91
|
+
|
|
91
92
|
/** Defines the flex-wrap style property. It's applied for all screen sizes. */
|
|
92
93
|
wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap']),
|
|
93
94
|
|
package/components/grid/index.js
CHANGED
|
@@ -8,19 +8,20 @@ import GridContext from './context';
|
|
|
8
8
|
import theme from '../../theme/settings';
|
|
9
9
|
import { breakpointKeys } from '../../theme/createBreakpoints';
|
|
10
10
|
import { borderBox } from '../../styles/general';
|
|
11
|
+
import { classNames, handleBreakpoints } from '../../utils';
|
|
11
12
|
const {
|
|
12
13
|
breakpoints: themeBreakpoints,
|
|
13
14
|
spacing: themeSpacing
|
|
14
15
|
} = theme;
|
|
15
16
|
const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
16
|
-
|
|
17
|
-
style,
|
|
18
|
-
className,
|
|
17
|
+
action = {},
|
|
19
18
|
children,
|
|
19
|
+
className,
|
|
20
20
|
columns: columnsProp,
|
|
21
21
|
columnSpacing: columnSpacingProp,
|
|
22
22
|
container,
|
|
23
23
|
direction,
|
|
24
|
+
id,
|
|
24
25
|
item,
|
|
25
26
|
leftSpacing: leftSpacingProp,
|
|
26
27
|
lg,
|
|
@@ -28,6 +29,7 @@ const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
28
29
|
rowSpacing: rowSpacingProp,
|
|
29
30
|
sm,
|
|
30
31
|
spacing,
|
|
32
|
+
style,
|
|
31
33
|
topSpacing: topSpacingProp,
|
|
32
34
|
wrap,
|
|
33
35
|
xl,
|
|
@@ -50,7 +52,9 @@ const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
50
52
|
|
|
51
53
|
useImperativeHandle(reference, () => {
|
|
52
54
|
const currentRef = ref.current || {};
|
|
53
|
-
|
|
55
|
+
currentRef.element = ref.current;
|
|
56
|
+
const _instance = { ...action
|
|
57
|
+
}; // methods
|
|
54
58
|
|
|
55
59
|
_instance.__proto__ = {}; // hidden methods
|
|
56
60
|
|
|
@@ -63,11 +67,11 @@ const Grid = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
63
67
|
ref: ref,
|
|
64
68
|
css: [_GridCSS, container && (rowSpacing || columnSpacing) && _GridSpacingCSS, _HandleGridCSS],
|
|
65
69
|
style: style,
|
|
66
|
-
className:
|
|
70
|
+
className: classNames(`DGN-UI-Grid${item ? '-item' : ''}`, className)
|
|
67
71
|
}, jsx(GridContext.Provider, {
|
|
68
72
|
value: columns
|
|
69
73
|
}, children));
|
|
70
|
-
}, [
|
|
74
|
+
}, [columns, columnSpacing, leftSpacing, rowSpacing, topSpacing, children, className, container, direction, id, item, lg, md, sm, spacing, style, wrap, xl, xs, zeroMinWidth]);
|
|
71
75
|
}));
|
|
72
76
|
|
|
73
77
|
const getOffset = val => {
|
|
@@ -75,30 +79,7 @@ const getOffset = val => {
|
|
|
75
79
|
return `${parse}${String(val).replace(String(parse), '') || 'px'}`;
|
|
76
80
|
};
|
|
77
81
|
|
|
78
|
-
const
|
|
79
|
-
let output = '';
|
|
80
|
-
|
|
81
|
-
if (Array.isArray(propValue)) {
|
|
82
|
-
propValue.map((item, index) => {
|
|
83
|
-
output = output.concat([themeBreakpoints.up(breakpointKeys[index])]).concat(`{${cssFromPropValue(propValue[index])}} `);
|
|
84
|
-
});
|
|
85
|
-
return output;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (typeof propValue === 'object') {
|
|
89
|
-
Object.keys(propValue).map(item => {
|
|
90
|
-
if (breakpointKeys.includes(item)) {
|
|
91
|
-
output = output.concat([themeBreakpoints.up(item)]).concat(`{${cssFromPropValue(propValue[item])}} `);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
return output;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
output = cssFromPropValue(propValue);
|
|
98
|
-
return output;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const progessSizeArray = sizeArr => {
|
|
82
|
+
const processSizeArray = sizeArr => {
|
|
102
83
|
let lastValue = false;
|
|
103
84
|
sizeArr = sizeArr.map(item => {
|
|
104
85
|
if (item === false) return lastValue;else lastValue = item;
|
|
@@ -208,26 +189,26 @@ const GridSpacingCSS = (rowSpacing, columnSpacing, topSpacing, leftSpacing) => c
|
|
|
208
189
|
`;
|
|
209
190
|
|
|
210
191
|
const HandleGridCSS = (sizeArr, columns) => css`
|
|
211
|
-
${
|
|
192
|
+
${processSizeArray(sizeArr).map((item, idx) => {
|
|
212
193
|
return handleGrid(breakpointKeys[idx], item, columns);
|
|
213
194
|
})}
|
|
214
195
|
`;
|
|
215
196
|
|
|
216
197
|
Grid.defaultProps = {
|
|
217
|
-
style: {},
|
|
218
198
|
className: '',
|
|
219
199
|
columns: 12,
|
|
220
200
|
container: false,
|
|
201
|
+
direction: 'row',
|
|
221
202
|
item: false,
|
|
222
203
|
lg: false,
|
|
223
204
|
md: false,
|
|
224
205
|
sm: false,
|
|
206
|
+
spacing: 0,
|
|
207
|
+
style: {},
|
|
208
|
+
wrap: 'wrap',
|
|
225
209
|
xl: false,
|
|
226
210
|
xs: false,
|
|
227
|
-
zeroMinWidth: false
|
|
228
|
-
spacing: 0,
|
|
229
|
-
direction: 'row',
|
|
230
|
-
wrap: 'wrap'
|
|
211
|
+
zeroMinWidth: false
|
|
231
212
|
};
|
|
232
213
|
Grid.propTypes = {
|
|
233
214
|
/** The content of the component. */
|
|
@@ -12,12 +12,16 @@ const {
|
|
|
12
12
|
} = theme;
|
|
13
13
|
const ModalFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
14
14
|
action = {},
|
|
15
|
+
boxShadow,
|
|
15
16
|
children,
|
|
16
17
|
className,
|
|
17
18
|
id,
|
|
18
19
|
style
|
|
19
20
|
}, reference) => {
|
|
20
21
|
const ref = useRef(null);
|
|
22
|
+
|
|
23
|
+
const _ModalFooterCSS = ModalFooterCSS(boxShadow);
|
|
24
|
+
|
|
21
25
|
useImperativeHandle(reference, () => {
|
|
22
26
|
const currentRef = ref.current || {};
|
|
23
27
|
currentRef.element = ref.current;
|
|
@@ -30,14 +34,15 @@ const ModalFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
30
34
|
return currentRef;
|
|
31
35
|
});
|
|
32
36
|
return useMemo(() => jsx("div", {
|
|
33
|
-
css:
|
|
37
|
+
css: _ModalFooterCSS,
|
|
34
38
|
id: id,
|
|
35
39
|
className: classNames('DGN-UI-Modal-Footer', className),
|
|
36
40
|
style: style,
|
|
37
41
|
ref: ref
|
|
38
|
-
}, children), [children, className, id, style]);
|
|
42
|
+
}, children), [boxShadow, children, className, id, style]);
|
|
39
43
|
}));
|
|
40
|
-
|
|
44
|
+
|
|
45
|
+
const ModalFooterCSS = boxShadow => css`
|
|
41
46
|
${flexRow};
|
|
42
47
|
${positionRelative};
|
|
43
48
|
${alignCenter};
|
|
@@ -46,7 +51,7 @@ const ModalFooterCSS = css`
|
|
|
46
51
|
width: 100%;
|
|
47
52
|
min-height: 56px;
|
|
48
53
|
border-radius: 0px 0px 4px 4px;
|
|
49
|
-
box-shadow:
|
|
54
|
+
box-shadow: ${boxShadow};
|
|
50
55
|
order: 3;
|
|
51
56
|
${handleBreakpoints({
|
|
52
57
|
xs: 4,
|
|
@@ -55,11 +60,16 @@ const ModalFooterCSS = css`
|
|
|
55
60
|
return `padding: ${spacing([4, propValue])}`;
|
|
56
61
|
})}
|
|
57
62
|
`;
|
|
63
|
+
|
|
58
64
|
ModalFooter.defaultProps = {
|
|
65
|
+
boxShadow: '0px -1px 1px rgba(0, 0, 0, 0.25)',
|
|
59
66
|
className: '',
|
|
60
67
|
style: {}
|
|
61
68
|
};
|
|
62
69
|
ModalFooter.propTypes = {
|
|
70
|
+
/** The box-shadow of component. */
|
|
71
|
+
boxShadow: PropTypes.string,
|
|
72
|
+
|
|
63
73
|
/** The content of the component. */
|
|
64
74
|
children: PropTypes.node,
|
|
65
75
|
|
|
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
7
|
import OptionWrapper from '../others/option-wrapper';
|
|
8
8
|
import { flexCol, overflowAuto, positionRelative } from '../../styles/general';
|
|
9
|
+
import { classNames } from '../../utils';
|
|
9
10
|
import theme from '../../theme/settings';
|
|
10
11
|
const {
|
|
11
12
|
colors: {
|
|
@@ -40,7 +41,7 @@ const PopoverBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
40
41
|
ref: ref,
|
|
41
42
|
id: id,
|
|
42
43
|
style: style,
|
|
43
|
-
className:
|
|
44
|
+
className: classNames('DGN-UI-Popover-Body', className)
|
|
44
45
|
}, children), [children, className, id, style]);
|
|
45
46
|
}));
|
|
46
47
|
const PopoverBodyCSS = css`
|
|
@@ -48,7 +49,6 @@ const PopoverBodyCSS = css`
|
|
|
48
49
|
${positionRelative};
|
|
49
50
|
${overflowAuto};
|
|
50
51
|
padding: ${spacing([4])};
|
|
51
|
-
max-height: 472px;
|
|
52
52
|
order: 2;
|
|
53
53
|
&::-webkit-scrollbar {
|
|
54
54
|
width: 24px;
|
|
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
7
|
import OptionWrapper from '../others/option-wrapper';
|
|
8
8
|
import { alignCenter, borderBox, flexRow, justifyEnd, parseWidth, positionRelative } from '../../styles/general';
|
|
9
|
+
import { classNames } from '../../utils';
|
|
9
10
|
import theme from '../../theme/settings';
|
|
10
11
|
const {
|
|
11
12
|
colors: {
|
|
@@ -43,8 +44,8 @@ const PopoverFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
43
44
|
ref: ref,
|
|
44
45
|
id: id,
|
|
45
46
|
style: style,
|
|
46
|
-
className:
|
|
47
|
-
}, children), [children, className, id, style]);
|
|
47
|
+
className: classNames('DGN-UI-Popover-Footer', className)
|
|
48
|
+
}, children), [boxShadow, children, className, id, style]);
|
|
48
49
|
}));
|
|
49
50
|
|
|
50
51
|
const PopoverFooterCSS = boxShadow => css`
|
|
@@ -7,6 +7,7 @@ import { jsx, css } from '@emotion/core';
|
|
|
7
7
|
import OptionWrapper from '../others/option-wrapper';
|
|
8
8
|
import { Typography } from '../';
|
|
9
9
|
import { alignCenter, borderBox, flexRow, parseWidthHeight, positionRelative } from '../../styles/general';
|
|
10
|
+
import { classNames } from '../../utils';
|
|
10
11
|
import theme from '../../theme/settings';
|
|
11
12
|
const {
|
|
12
13
|
colors: {
|
|
@@ -14,7 +15,8 @@ const {
|
|
|
14
15
|
headerbar
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
|
-
spacing
|
|
18
|
+
spacing,
|
|
19
|
+
zIndex: zIndexCORE
|
|
18
20
|
} = theme;
|
|
19
21
|
const PopoverHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
20
22
|
action = {},
|
|
@@ -41,7 +43,7 @@ const PopoverHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
41
43
|
ref: ref,
|
|
42
44
|
id: id,
|
|
43
45
|
style: style,
|
|
44
|
-
className:
|
|
46
|
+
className: classNames('DGN-UI-Popover-Header', className)
|
|
45
47
|
}, jsx(Typography, {
|
|
46
48
|
type: 'h3',
|
|
47
49
|
style: {
|
|
@@ -59,11 +61,11 @@ const PopoverHeaderCSS = css`
|
|
|
59
61
|
${borderBox};
|
|
60
62
|
${parseWidthHeight('100%', 56)};
|
|
61
63
|
background-color: ${headerbar};
|
|
62
|
-
min-width: 480px;
|
|
63
64
|
padding: ${spacing([4])};
|
|
64
65
|
border-radius: 4px 4px 0px 0px;
|
|
65
66
|
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
|
|
66
67
|
order: 1;
|
|
68
|
+
z-index: ${zIndexCORE(1)};
|
|
67
69
|
`;
|
|
68
70
|
PopoverHeader.defaultProps = {
|
|
69
71
|
title: '',
|