diginet-core-ui 1.3.66 → 1.3.68
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/storybook/avatar01.svg +9 -0
- package/assets/storybook/cover01.svg +9 -0
- package/components/accordion/css.js +6 -6
- package/components/accordion/details.js +13 -18
- package/components/accordion/group.js +16 -17
- package/components/accordion/index.js +17 -22
- package/components/accordion/summary.js +55 -32
- package/components/avatar/index.js +4 -9
- package/components/badge/index.js +4 -9
- package/components/button/icon.js +4 -9
- package/components/button/index.js +287 -292
- package/components/card/body.js +47 -0
- package/components/card/extra.js +47 -0
- package/components/card/footer.js +47 -0
- package/components/card/header.js +50 -0
- package/components/card/index.js +175 -37
- package/components/chart/Pie-v2/Sector.js +2 -2
- package/components/chip/attach.js +5 -5
- package/components/form-control/attachment/index.js +5 -3
- package/components/form-control/calendar/function.js +20 -10
- package/components/form-control/calendar/index.js +16 -16
- package/components/form-control/dropdown/index.js +71 -10
- package/components/form-control/helper-text/index.js +8 -3
- package/components/form-control/input-base/index.js +47 -10
- package/components/form-control/money-input/index.js +6 -2
- package/components/form-control/number-input/index.js +11 -11
- package/components/form-control/number-input/index2.js +13 -4
- package/components/form-control/phone-input/index.js +13 -9
- package/components/form-control/text-input/index.js +13 -3
- package/components/grid/Container.js +110 -0
- package/components/grid/Row.js +1 -1
- package/components/grid/index.js +35 -5
- package/components/index.js +7 -2
- package/components/others/option-wrapper/index.js +21 -27
- package/components/paging/page-info.js +263 -88
- package/components/paging/page-selector2.js +95 -56
- package/components/popover/index.js +8 -6
- package/components/progress/circular.js +12 -12
- package/components/transfer/index.js +3 -3
- package/components/tree-view/index.js +10 -6
- package/icons/basic.js +120 -0
- package/icons/effect.js +19 -24
- package/package.json +1 -1
- package/readme.md +20 -0
- package/styles/color-helper.js +103 -103
- package/styles/utils.js +14 -2
- package/utils/classNames.js +30 -0
- package/utils/error/error.js +2 -2
- package/utils/index.js +1 -0
- package/utils/renderIcon.js +5 -5
- package/utils/useInput.js +1 -8
- package/components/card/body-card.js +0 -65
- package/components/card/card.js +0 -125
- package/components/card/context.js +0 -6
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { jsx } from '@emotion/core';
|
|
7
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
8
|
+
const CardBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
id,
|
|
12
|
+
style,
|
|
13
|
+
title
|
|
14
|
+
}, reference) => {
|
|
15
|
+
const ref = useRef(null);
|
|
16
|
+
useImperativeHandle(reference, () => ({
|
|
17
|
+
element: ref.current,
|
|
18
|
+
instance: {}
|
|
19
|
+
}));
|
|
20
|
+
return useMemo(() => {
|
|
21
|
+
return jsx("div", {
|
|
22
|
+
id: id,
|
|
23
|
+
ref: ref,
|
|
24
|
+
style: style,
|
|
25
|
+
className: [`DGN-UI-Card-Body`, className].join(' ').trim().replace(/\s+/g, ' ')
|
|
26
|
+
}, children);
|
|
27
|
+
}, [children, className, id, style, title]);
|
|
28
|
+
}));
|
|
29
|
+
CardBody.defaultProps = {
|
|
30
|
+
className: '',
|
|
31
|
+
style: {}
|
|
32
|
+
};
|
|
33
|
+
CardBody.propTypes = {
|
|
34
|
+
/** The content of the component. */
|
|
35
|
+
children: PropTypes.node,
|
|
36
|
+
|
|
37
|
+
/** Class for component. ({container: '', header: '', body: '', footer: ''}) */
|
|
38
|
+
className: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
39
|
+
|
|
40
|
+
/** If `true`, will have divider between body and footer. */
|
|
41
|
+
style: PropTypes.object,
|
|
42
|
+
|
|
43
|
+
/** The title of the component's header. */
|
|
44
|
+
title: PropTypes.string
|
|
45
|
+
};
|
|
46
|
+
export { CardBody };
|
|
47
|
+
export default OptionWrapper(CardBody);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { jsx } from '@emotion/core';
|
|
7
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
8
|
+
const CardExtra = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
id,
|
|
12
|
+
style,
|
|
13
|
+
title
|
|
14
|
+
}, reference) => {
|
|
15
|
+
const ref = useRef(null);
|
|
16
|
+
useImperativeHandle(reference, () => ({
|
|
17
|
+
element: ref.current,
|
|
18
|
+
instance: {}
|
|
19
|
+
}));
|
|
20
|
+
return useMemo(() => {
|
|
21
|
+
return jsx("div", {
|
|
22
|
+
id: id,
|
|
23
|
+
ref: ref,
|
|
24
|
+
style: style,
|
|
25
|
+
className: [`DGN-UI-Card-Extra`, className].join(' ').trim().replace(/\s+/g, ' ')
|
|
26
|
+
}, children);
|
|
27
|
+
}, [children, className, id, style, title]);
|
|
28
|
+
}));
|
|
29
|
+
CardExtra.defaultProps = {
|
|
30
|
+
className: '',
|
|
31
|
+
style: {}
|
|
32
|
+
};
|
|
33
|
+
CardExtra.propTypes = {
|
|
34
|
+
/** The content of the component. */
|
|
35
|
+
children: PropTypes.node,
|
|
36
|
+
|
|
37
|
+
/** Class for component. ({container: '', header: '', body: '', footer: ''}) */
|
|
38
|
+
className: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
39
|
+
|
|
40
|
+
/** If `true`, will have divider between body and footer. */
|
|
41
|
+
style: PropTypes.object,
|
|
42
|
+
|
|
43
|
+
/** The title of the component's header. */
|
|
44
|
+
title: PropTypes.string
|
|
45
|
+
};
|
|
46
|
+
export { CardExtra };
|
|
47
|
+
export default OptionWrapper(CardExtra);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { jsx } from '@emotion/core';
|
|
7
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
8
|
+
const CardFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
|
+
children,
|
|
10
|
+
className,
|
|
11
|
+
id,
|
|
12
|
+
style,
|
|
13
|
+
title
|
|
14
|
+
}, reference) => {
|
|
15
|
+
const ref = useRef(null);
|
|
16
|
+
useImperativeHandle(reference, () => ({
|
|
17
|
+
element: ref.current,
|
|
18
|
+
instance: {}
|
|
19
|
+
}));
|
|
20
|
+
return useMemo(() => {
|
|
21
|
+
return jsx("div", {
|
|
22
|
+
id: id,
|
|
23
|
+
ref: ref,
|
|
24
|
+
style: style,
|
|
25
|
+
className: [`DGN-UI-Card-Footer`, className].join(' ').trim().replace(/\s+/g, ' ')
|
|
26
|
+
}, children);
|
|
27
|
+
}, [children, className, id, style, title]);
|
|
28
|
+
}));
|
|
29
|
+
CardFooter.defaultProps = {
|
|
30
|
+
className: '',
|
|
31
|
+
style: {}
|
|
32
|
+
};
|
|
33
|
+
CardFooter.propTypes = {
|
|
34
|
+
/** The content of the component. */
|
|
35
|
+
children: PropTypes.node,
|
|
36
|
+
|
|
37
|
+
/** Class for component. ({container: '', header: '', body: '', footer: ''}) */
|
|
38
|
+
className: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
39
|
+
|
|
40
|
+
/** If `true`, will have divider between body and footer. */
|
|
41
|
+
style: PropTypes.object,
|
|
42
|
+
|
|
43
|
+
/** The title of the component's header. */
|
|
44
|
+
title: PropTypes.string
|
|
45
|
+
};
|
|
46
|
+
export { CardFooter };
|
|
47
|
+
export default OptionWrapper(CardFooter);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { jsx } from '@emotion/core';
|
|
7
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
8
|
+
import Typography from '../typography';
|
|
9
|
+
const CardHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
|
+
children,
|
|
11
|
+
className,
|
|
12
|
+
id,
|
|
13
|
+
style,
|
|
14
|
+
title
|
|
15
|
+
}, reference) => {
|
|
16
|
+
const ref = useRef(null);
|
|
17
|
+
useImperativeHandle(reference, () => ({
|
|
18
|
+
element: ref.current,
|
|
19
|
+
instance: {}
|
|
20
|
+
}));
|
|
21
|
+
return useMemo(() => {
|
|
22
|
+
return jsx("div", {
|
|
23
|
+
id: id,
|
|
24
|
+
ref: ref,
|
|
25
|
+
style: style,
|
|
26
|
+
className: [`DGN-UI-Card-Header`, className].join(' ').trim().replace(/\s+/g, ' ')
|
|
27
|
+
}, children || jsx(Typography, {
|
|
28
|
+
type: 'h3'
|
|
29
|
+
}, title));
|
|
30
|
+
}, [children, className, id, style, title]);
|
|
31
|
+
}));
|
|
32
|
+
CardHeader.defaultProps = {
|
|
33
|
+
className: '',
|
|
34
|
+
style: {}
|
|
35
|
+
};
|
|
36
|
+
CardHeader.propTypes = {
|
|
37
|
+
/** The content of the component. */
|
|
38
|
+
children: PropTypes.node,
|
|
39
|
+
|
|
40
|
+
/** Class for component. ({container: '', header: '', body: '', footer: ''}) */
|
|
41
|
+
className: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
42
|
+
|
|
43
|
+
/** If `true`, will have divider between body and footer. */
|
|
44
|
+
style: PropTypes.object,
|
|
45
|
+
|
|
46
|
+
/** The title of the component's header. */
|
|
47
|
+
title: PropTypes.string
|
|
48
|
+
};
|
|
49
|
+
export { CardHeader };
|
|
50
|
+
export default OptionWrapper(CardHeader);
|
package/components/card/index.js
CHANGED
|
@@ -1,50 +1,188 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
3
5
|
import PropTypes from 'prop-types';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { jsx, css } from '@emotion/core';
|
|
7
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
8
|
+
import theme from '../../theme/settings';
|
|
9
|
+
import { borderBox, borderRadius4px, flexCol, flexRow, justifyEnd, overflowHidden, parseWidth, parseWidthHeight, positionAbsolute, positionRelative } from '../../styles/general';
|
|
10
|
+
import CardHeader from './header';
|
|
11
|
+
import { CardFooter } from './footer';
|
|
12
|
+
import { CardBody } from './body';
|
|
13
|
+
import { getColor } from '../../styles/utils';
|
|
14
|
+
const {
|
|
15
|
+
colors: {
|
|
16
|
+
system: {
|
|
17
|
+
white
|
|
18
|
+
},
|
|
19
|
+
line: {
|
|
20
|
+
category
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
spacing
|
|
24
|
+
} = theme;
|
|
25
|
+
const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
26
|
+
body: bodyProp,
|
|
8
27
|
bodyStyle,
|
|
9
|
-
refs,
|
|
10
28
|
children,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
className,
|
|
30
|
+
dividerColor,
|
|
31
|
+
footer,
|
|
32
|
+
footerDivider,
|
|
33
|
+
footerStyle,
|
|
34
|
+
header,
|
|
35
|
+
headerDivider,
|
|
36
|
+
headerStyle,
|
|
37
|
+
height,
|
|
38
|
+
id,
|
|
39
|
+
style,
|
|
40
|
+
title,
|
|
41
|
+
width
|
|
42
|
+
}, reference) => {
|
|
43
|
+
const ref = useRef(null);
|
|
44
|
+
|
|
45
|
+
const _CardCSS = CardCSS(width, height, headerDivider, footerDivider, dividerColor);
|
|
46
|
+
|
|
47
|
+
useImperativeHandle(reference, () => ({
|
|
48
|
+
element: ref.current,
|
|
49
|
+
instance: {}
|
|
50
|
+
}));
|
|
51
|
+
const head = header || title ? jsx(CardHeader, {
|
|
52
|
+
className: (className === null || className === void 0 ? void 0 : className.header) || '',
|
|
53
|
+
style: headerStyle,
|
|
54
|
+
title: title
|
|
55
|
+
}, header) : null;
|
|
56
|
+
const foot = footer ? jsx(CardFooter, {
|
|
57
|
+
className: (className === null || className === void 0 ? void 0 : className.footer) || '',
|
|
58
|
+
style: footerStyle
|
|
59
|
+
}, footer) : null;
|
|
60
|
+
const body = bodyProp || children && (head || foot) ? jsx(CardBody, {
|
|
61
|
+
className: (className === null || className === void 0 ? void 0 : className.body) || '',
|
|
25
62
|
style: bodyStyle
|
|
26
|
-
}, children)
|
|
63
|
+
}, bodyProp || children) : null;
|
|
64
|
+
return useMemo(() => {
|
|
65
|
+
return jsx("div", {
|
|
66
|
+
id: id,
|
|
67
|
+
ref: ref,
|
|
68
|
+
css: _CardCSS,
|
|
69
|
+
style: style,
|
|
70
|
+
className: [`DGN-UI-Card`, (className === null || className === void 0 ? void 0 : className.container) || className].join(' ').trim().replace(/\s+/g, ' ')
|
|
71
|
+
}, head, body || children, foot);
|
|
72
|
+
}, [bodyProp, bodyStyle, children, className, dividerColor, footer, footerDivider, footerStyle, header, headerDivider, headerStyle, height, id, style, title, width]);
|
|
27
73
|
}));
|
|
28
|
-
|
|
29
|
-
|
|
74
|
+
|
|
75
|
+
const CardCSS = (width, height, headerDivider, footerDivider, dividerColor) => css`
|
|
76
|
+
${flexCol};
|
|
77
|
+
${positionRelative};
|
|
78
|
+
${borderBox};
|
|
79
|
+
${borderRadius4px};
|
|
80
|
+
${overflowHidden}
|
|
81
|
+
${parseWidthHeight(width || spacing([64.5]), height || 'max-content')};
|
|
82
|
+
${parseWidth(width)};
|
|
83
|
+
background: ${white};
|
|
84
|
+
.DGN-UI-Card-Header {
|
|
85
|
+
${flexRow};
|
|
86
|
+
${positionRelative};
|
|
87
|
+
${borderBox};
|
|
88
|
+
order: 1;
|
|
89
|
+
padding: ${spacing([4])};
|
|
90
|
+
&:after {
|
|
91
|
+
${positionAbsolute};
|
|
92
|
+
content: '';
|
|
93
|
+
left: 0;
|
|
94
|
+
right: 0;
|
|
95
|
+
bottom: 0;
|
|
96
|
+
margin: ${spacing([0, 4])};
|
|
97
|
+
border-bottom: ${headerDivider ? `1px solid ${getColor(dividerColor)}` : 'none'};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.DGN-UI-Card-Body {
|
|
101
|
+
${flexCol};
|
|
102
|
+
${positionRelative};
|
|
103
|
+
${borderBox};
|
|
104
|
+
order: 2;
|
|
105
|
+
padding: ${headerDivider ? spacing([4]) : spacing([0, 4, 4])};
|
|
106
|
+
}
|
|
107
|
+
.DGN-UI-Card-Footer {
|
|
108
|
+
${flexRow};
|
|
109
|
+
${justifyEnd};
|
|
110
|
+
${positionRelative};
|
|
111
|
+
${borderBox};
|
|
112
|
+
order: 3;
|
|
113
|
+
padding: ${footerDivider ? spacing([4]) : spacing([0, 4, 4])};
|
|
114
|
+
&:before {
|
|
115
|
+
${positionAbsolute};
|
|
116
|
+
content: '';
|
|
117
|
+
left: 0;
|
|
118
|
+
right: 0;
|
|
119
|
+
top: 0;
|
|
120
|
+
margin: ${spacing([0, 4])};
|
|
121
|
+
border-top: ${footerDivider ? `1px solid ${getColor(dividerColor)}` : 'none'};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
.DGN-UI-Card-Extra {
|
|
125
|
+
${flexCol};
|
|
126
|
+
${positionRelative};
|
|
127
|
+
${borderBox};
|
|
128
|
+
}
|
|
129
|
+
`;
|
|
130
|
+
|
|
131
|
+
Card.defaultProps = {
|
|
132
|
+
bodyStyle: {},
|
|
133
|
+
className: '',
|
|
134
|
+
dividerColor: category,
|
|
135
|
+
footerDivider: false,
|
|
136
|
+
footerStyle: {},
|
|
137
|
+
headerDivider: true,
|
|
138
|
+
headerStyle: {},
|
|
139
|
+
style: {}
|
|
30
140
|
};
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
|
|
141
|
+
Card.propTypes = {
|
|
142
|
+
/** The content of the component's body. */
|
|
143
|
+
body: PropTypes.node,
|
|
34
144
|
|
|
35
|
-
/**
|
|
145
|
+
/** The content of the component's body. */
|
|
36
146
|
bodyStyle: PropTypes.object,
|
|
37
147
|
|
|
38
|
-
/**
|
|
39
|
-
|
|
148
|
+
/** The content of the component. */
|
|
149
|
+
children: PropTypes.node,
|
|
40
150
|
|
|
41
|
-
/**
|
|
42
|
-
|
|
151
|
+
/** Class for component. ({container: '', header: '', body: '', footer: ''}) */
|
|
152
|
+
className: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
|
|
43
153
|
|
|
44
|
-
/**
|
|
45
|
-
|
|
154
|
+
/** Color of divider. */
|
|
155
|
+
dividerColor: PropTypes.string,
|
|
156
|
+
|
|
157
|
+
/** The content of the component's footer. */
|
|
158
|
+
footer: PropTypes.node,
|
|
159
|
+
|
|
160
|
+
/** If `true`, will have divider between body and footer. */
|
|
161
|
+
footerDivider: PropTypes.bool,
|
|
162
|
+
|
|
163
|
+
/** Style inline of component's footer. */
|
|
164
|
+
footerStyle: PropTypes.object,
|
|
165
|
+
|
|
166
|
+
/** The content of the component's header. */
|
|
167
|
+
header: PropTypes.node,
|
|
168
|
+
|
|
169
|
+
/** If `true`, will have divider between header and body. */
|
|
170
|
+
headerDivider: PropTypes.bool,
|
|
171
|
+
|
|
172
|
+
/** Style inline of component's header. */
|
|
173
|
+
headerStyle: PropTypes.object,
|
|
174
|
+
|
|
175
|
+
/** Height of the component. */
|
|
176
|
+
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
177
|
+
|
|
178
|
+
/** Style inline of component. */
|
|
179
|
+
style: PropTypes.object,
|
|
180
|
+
|
|
181
|
+
/** The title of the component's header. */
|
|
182
|
+
title: PropTypes.string,
|
|
46
183
|
|
|
47
|
-
/**
|
|
48
|
-
|
|
184
|
+
/** Width of the component. */
|
|
185
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
49
186
|
};
|
|
50
|
-
export
|
|
187
|
+
export { Card };
|
|
188
|
+
export default OptionWrapper(Card);
|
|
@@ -94,8 +94,8 @@ Sector.propTypes = {
|
|
|
94
94
|
onTouchEnd: PropTypes.func,
|
|
95
95
|
onTouchStart: PropTypes.func,
|
|
96
96
|
|
|
97
|
-
/** function displays selected items by custom, example:<br/>
|
|
98
|
-
* renderItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
97
|
+
/** function displays selected items by custom, example:<br/>
|
|
98
|
+
* renderItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
99
99
|
*/
|
|
100
100
|
renderSelectedItem: PropTypes.func,
|
|
101
101
|
path: PropTypes.string.isRequired,
|
|
@@ -156,11 +156,11 @@ const AttachChip = /*#__PURE__*/memo(({
|
|
|
156
156
|
}))), attachView);
|
|
157
157
|
});
|
|
158
158
|
AttachChip.propTypes = {
|
|
159
|
-
/** the file info, such as:<br/>
|
|
160
|
-
* {<br/>
|
|
161
|
-
* URL: https://url.com/pathname,<br/>
|
|
162
|
-
* FileName: file.name,<br/>
|
|
163
|
-
* }
|
|
159
|
+
/** the file info, such as:<br/>
|
|
160
|
+
* {<br/>
|
|
161
|
+
* URL: https://url.com/pathname,<br/>
|
|
162
|
+
* FileName: file.name,<br/>
|
|
163
|
+
* }
|
|
164
164
|
*/
|
|
165
165
|
file: PropTypes.shape({
|
|
166
166
|
URL: PropTypes.string.isRequired,
|
|
@@ -234,6 +234,8 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
234
234
|
};
|
|
235
235
|
|
|
236
236
|
const afterChangeFile = (length = 0) => {
|
|
237
|
+
var _sortIconRef$current;
|
|
238
|
+
|
|
237
239
|
if (!length) {
|
|
238
240
|
if (!attachmentImageRef.current.classList.contains('hint-center')) {
|
|
239
241
|
attachmentImageRef.current.classList.add('hint-center');
|
|
@@ -242,11 +244,11 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
242
244
|
attachmentImageRef.current.classList.remove('hint-center');
|
|
243
245
|
}
|
|
244
246
|
|
|
245
|
-
if (sortIconRef.current) {
|
|
247
|
+
if ((_sortIconRef$current = sortIconRef.current) !== null && _sortIconRef$current !== void 0 && _sortIconRef$current.element) {
|
|
246
248
|
if (length > 1) {
|
|
247
|
-
sortIconRef.current.style.display = null;
|
|
249
|
+
sortIconRef.current.element.style.display = null;
|
|
248
250
|
} else {
|
|
249
|
-
sortIconRef.current.style.display = 'none';
|
|
251
|
+
sortIconRef.current.element.style.display = 'none';
|
|
250
252
|
}
|
|
251
253
|
}
|
|
252
254
|
};
|
|
@@ -637,6 +637,8 @@ const renderNavigatorContent = time => {
|
|
|
637
637
|
|
|
638
638
|
|
|
639
639
|
const onUpdateNavigator = (time, refs, min, max) => {
|
|
640
|
+
var _refs$doubleLeft$curr, _refs$doubleLeft$curr2, _refs$doubleRight$cur, _refs$doubleRight$cur2, _refs$left$current, _refs$left$current$in, _refs$right$current, _refs$right$current$i;
|
|
641
|
+
|
|
640
642
|
const el = refs.content.current;
|
|
641
643
|
const vl = renderNavigatorContent(time);
|
|
642
644
|
const year = locale.get() === 'vi' ? ` ${getGlobal(['year'])} ` : '';
|
|
@@ -647,30 +649,38 @@ const onUpdateNavigator = (time, refs, min, max) => {
|
|
|
647
649
|
|
|
648
650
|
const firstDayOfMin = new Date(new Date(new Date(min).setDate(1)).setHours(0, 0, 0, 0));
|
|
649
651
|
const firstDayOfMax = new Date(new Date(new Date(max).setDate(1)).setHours(0, 0, 0, 0));
|
|
650
|
-
refs.doubleLeft.current.disabled
|
|
651
|
-
refs.doubleRight.current.disabled
|
|
652
|
-
refs.left.current.disabled
|
|
653
|
-
refs.right.current.disabled
|
|
652
|
+
(_refs$doubleLeft$curr = refs.doubleLeft.current) === null || _refs$doubleLeft$curr === void 0 ? void 0 : (_refs$doubleLeft$curr2 = _refs$doubleLeft$curr.instance) === null || _refs$doubleLeft$curr2 === void 0 ? void 0 : _refs$doubleLeft$curr2.option('disabled', false);
|
|
653
|
+
(_refs$doubleRight$cur = refs.doubleRight.current) === null || _refs$doubleRight$cur === void 0 ? void 0 : (_refs$doubleRight$cur2 = _refs$doubleRight$cur.instance) === null || _refs$doubleRight$cur2 === void 0 ? void 0 : _refs$doubleRight$cur2.option('disabled', false);
|
|
654
|
+
(_refs$left$current = refs.left.current) === null || _refs$left$current === void 0 ? void 0 : (_refs$left$current$in = _refs$left$current.instance) === null || _refs$left$current$in === void 0 ? void 0 : _refs$left$current$in.option('disabled', false);
|
|
655
|
+
(_refs$right$current = refs.right.current) === null || _refs$right$current === void 0 ? void 0 : (_refs$right$current$i = _refs$right$current.instance) === null || _refs$right$current$i === void 0 ? void 0 : _refs$right$current$i.option('disabled', false);
|
|
654
656
|
|
|
655
657
|
if (min && isValidDate(min)) {
|
|
656
658
|
if (moment(time).diff(firstDayOfMin) < 365) {
|
|
657
|
-
|
|
659
|
+
var _refs$doubleLeft$curr3, _refs$doubleLeft$curr4;
|
|
660
|
+
|
|
661
|
+
(_refs$doubleLeft$curr3 = refs.doubleLeft.current) === null || _refs$doubleLeft$curr3 === void 0 ? void 0 : (_refs$doubleLeft$curr4 = _refs$doubleLeft$curr3.instance) === null || _refs$doubleLeft$curr4 === void 0 ? void 0 : _refs$doubleLeft$curr4.option('disabled', true);
|
|
658
662
|
}
|
|
659
663
|
|
|
660
664
|
if (moment(time).diff(firstDayOfMin) <= 28) {
|
|
661
|
-
|
|
662
|
-
|
|
665
|
+
var _refs$doubleLeft$curr5, _refs$doubleLeft$curr6, _refs$left$current2, _refs$left$current2$i;
|
|
666
|
+
|
|
667
|
+
(_refs$doubleLeft$curr5 = refs.doubleLeft.current) === null || _refs$doubleLeft$curr5 === void 0 ? void 0 : (_refs$doubleLeft$curr6 = _refs$doubleLeft$curr5.instance) === null || _refs$doubleLeft$curr6 === void 0 ? void 0 : _refs$doubleLeft$curr6.option('disabled', true);
|
|
668
|
+
(_refs$left$current2 = refs.left.current) === null || _refs$left$current2 === void 0 ? void 0 : (_refs$left$current2$i = _refs$left$current2.instance) === null || _refs$left$current2$i === void 0 ? void 0 : _refs$left$current2$i.option('disabled', true);
|
|
663
669
|
}
|
|
664
670
|
}
|
|
665
671
|
|
|
666
672
|
if (max && isValidDate(max)) {
|
|
667
673
|
if (moment(time).diff(firstDayOfMax) > -334) {
|
|
668
|
-
|
|
674
|
+
var _refs$doubleRight$cur3, _refs$doubleRight$cur4;
|
|
675
|
+
|
|
676
|
+
(_refs$doubleRight$cur3 = refs.doubleRight.current) === null || _refs$doubleRight$cur3 === void 0 ? void 0 : (_refs$doubleRight$cur4 = _refs$doubleRight$cur3.instance) === null || _refs$doubleRight$cur4 === void 0 ? void 0 : _refs$doubleRight$cur4.option('disabled', true);
|
|
669
677
|
}
|
|
670
678
|
|
|
671
679
|
if (moment(time).diff(firstDayOfMax) > -1) {
|
|
672
|
-
|
|
673
|
-
|
|
680
|
+
var _refs$doubleRight$cur5, _refs$doubleRight$cur6, _refs$right$current2, _refs$right$current2$;
|
|
681
|
+
|
|
682
|
+
(_refs$doubleRight$cur5 = refs.doubleRight.current) === null || _refs$doubleRight$cur5 === void 0 ? void 0 : (_refs$doubleRight$cur6 = _refs$doubleRight$cur5.instance) === null || _refs$doubleRight$cur6 === void 0 ? void 0 : _refs$doubleRight$cur6.option('disabled', true);
|
|
683
|
+
(_refs$right$current2 = refs.right.current) === null || _refs$right$current2 === void 0 ? void 0 : (_refs$right$current2$ = _refs$right$current2.instance) === null || _refs$right$current2$ === void 0 ? void 0 : _refs$right$current2$.option('disabled', true);
|
|
674
684
|
}
|
|
675
685
|
}
|
|
676
686
|
};
|
|
@@ -41,8 +41,8 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
41
41
|
limit: 'DGN-UI-Calendar-Day-limit'
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
/**
|
|
45
|
-
* START REFERENCE
|
|
44
|
+
/**
|
|
45
|
+
* START REFERENCE
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
48
|
const ref = useRef(null);
|
|
@@ -61,12 +61,12 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
61
61
|
};
|
|
62
62
|
const firstDayOfMax = new Date(new Date(max).setDate(1)).setHours(0, 0, 0, 0);
|
|
63
63
|
const firstDayOfMin = new Date(new Date(min).setDate(1)).setHours(0, 0, 0, 0);
|
|
64
|
-
/**
|
|
65
|
-
* END REFERENCE
|
|
64
|
+
/**
|
|
65
|
+
* END REFERENCE
|
|
66
66
|
*/
|
|
67
67
|
|
|
68
|
-
/**
|
|
69
|
-
* START FUNCTION
|
|
68
|
+
/**
|
|
69
|
+
* START FUNCTION
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
72
|
const onUpdateNavigatorValue = useCallback(value => {
|
|
@@ -152,12 +152,12 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
152
152
|
onUpdateCalendar(time, navigatorRefs, min, max, tableRef.current, activeValue.current, unique, displayAnotherMonth, onDayClick, onUpdateNavigatorValue);
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
|
-
/**
|
|
156
|
-
* END FUNCTION
|
|
155
|
+
/**
|
|
156
|
+
* END FUNCTION
|
|
157
157
|
*/
|
|
158
158
|
|
|
159
|
-
/**
|
|
160
|
-
* START EFFECT
|
|
159
|
+
/**
|
|
160
|
+
* START EFFECT
|
|
161
161
|
*/
|
|
162
162
|
|
|
163
163
|
|
|
@@ -198,12 +198,12 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
198
198
|
onUpdate(activeValue.current);
|
|
199
199
|
}
|
|
200
200
|
}, [onClick, min, max]);
|
|
201
|
-
/**
|
|
202
|
-
* END FUNCTION
|
|
201
|
+
/**
|
|
202
|
+
* END FUNCTION
|
|
203
203
|
*/
|
|
204
204
|
|
|
205
|
-
/**
|
|
206
|
-
* START COMPONENT
|
|
205
|
+
/**
|
|
206
|
+
* START COMPONENT
|
|
207
207
|
*/
|
|
208
208
|
|
|
209
209
|
const tableMemo = jsx("div", {
|
|
@@ -212,8 +212,8 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
212
212
|
className: unique.table.table,
|
|
213
213
|
ref: tableRef
|
|
214
214
|
}, renderHeader(unique), jsx("tbody", null)));
|
|
215
|
-
/**
|
|
216
|
-
* END COMPONENT
|
|
215
|
+
/**
|
|
216
|
+
* END COMPONENT
|
|
217
217
|
*/
|
|
218
218
|
|
|
219
219
|
return jsx("div", { ...props,
|