diginet-core-ui 1.3.73 → 1.3.74
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/images/menu/dhr/MHRP29N0026.svg +13 -0
- package/assets/images/menu/dhr/MHRP29N0027.svg +14 -0
- package/assets/images/menu/dhr/MHRP29N0028.svg +15 -0
- package/components/accordion/details.js +19 -10
- package/components/accordion/group.js +15 -6
- package/components/accordion/index.js +20 -11
- package/components/accordion/summary.js +18 -9
- package/components/avatar/index.js +1 -1
- package/components/badge/index.js +17 -9
- package/components/button/icon.js +33 -25
- package/components/button/index.js +25 -17
- package/components/card/body.js +12 -4
- package/components/card/extra.js +12 -4
- package/components/card/footer.js +12 -4
- package/components/card/header.js +12 -4
- package/components/card/index.js +12 -4
- package/components/chip/index.js +6 -6
- package/components/form-control/attachment/index.js +197 -192
- package/components/form-control/date-picker/index.js +4 -2
- package/components/form-control/date-range-picker/index.js +15 -8
- package/components/form-control/dropdown/index.js +34 -13
- package/components/form-control/input-base/index.js +505 -483
- package/components/form-control/label/index.js +27 -21
- package/components/form-control/text-input/index.js +4 -1
- 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/image/index.js +164 -0
- package/components/index.js +3 -1
- package/components/modal/body.js +12 -9
- package/components/modal/footer.js +22 -11
- package/components/modal/header.js +25 -13
- package/components/modal/index.js +32 -30
- package/components/modal/modal.js +29 -25
- package/components/others/option-wrapper/index.js +5 -18
- package/components/paging/page-info.js +45 -33
- package/components/paging/page-selector2.js +45 -33
- package/components/popover/body.js +14 -6
- package/components/popover/footer.js +15 -6
- package/components/popover/header.js +17 -7
- package/components/popover/index.js +242 -109
- package/components/status/index.js +12 -4
- package/components/tab/tab-container.js +29 -27
- package/components/tab/tab-header.js +33 -28
- package/components/tab/tab-panel.js +31 -27
- package/components/tab/tab.js +45 -35
- package/components/tree-view/index.js +108 -73
- package/components/typography/index.js +36 -25
- package/icons/basic.js +248 -0
- package/icons/effect.js +44 -36
- package/package.json +1 -1
- package/readme.md +40 -0
- package/styles/general.js +23 -0
- package/theme/index.js +1 -1
- package/theme/set-theme.js +2 -1
- package/utils/index.js +13 -10
- package/utils/useMediaQuery.js +4 -2
|
@@ -38,6 +38,7 @@ const getLastPage = (totalItems, itemsPerPage) => {
|
|
|
38
38
|
|
|
39
39
|
const delayOnInput = getGlobal('delayOnInput');
|
|
40
40
|
const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
41
|
+
action = {},
|
|
41
42
|
className,
|
|
42
43
|
currentPage,
|
|
43
44
|
hideEllipsis,
|
|
@@ -172,23 +173,34 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
172
173
|
changeBy: 'itemsPerPage'
|
|
173
174
|
});
|
|
174
175
|
}, [itemsPerPageState]);
|
|
175
|
-
useImperativeHandle(reference, () =>
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
useImperativeHandle(reference, () => {
|
|
177
|
+
const currentRef = ref.current || {};
|
|
178
|
+
currentRef.element = ref.current;
|
|
179
|
+
const _instance = {
|
|
178
180
|
onChangePage: page => _onChangePage({
|
|
179
181
|
page: page,
|
|
180
182
|
changeBy: 'ref'
|
|
181
183
|
}),
|
|
182
184
|
onChangePerPage: per => _onChangePerPage(per),
|
|
183
|
-
setTotalItems: items => setTotalItemsState(items)
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
setTotalItems: items => setTotalItemsState(items),
|
|
186
|
+
...action
|
|
187
|
+
}; // methods
|
|
188
|
+
|
|
189
|
+
_instance.__proto__ = {}; // hidden methods
|
|
190
|
+
|
|
191
|
+
currentRef.instance = _instance;
|
|
192
|
+
|
|
193
|
+
currentRef.onChangePage = page => _onChangePage({
|
|
186
194
|
page: page,
|
|
187
195
|
changeBy: 'ref'
|
|
188
|
-
})
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
currentRef.onChangePerPage = per => _onChangePerPage(per);
|
|
199
|
+
|
|
200
|
+
currentRef.setTotalItems = items => setTotalItemsState(items);
|
|
201
|
+
|
|
202
|
+
return currentRef;
|
|
203
|
+
});
|
|
192
204
|
|
|
193
205
|
const renderButton = (key, page, isSelected, customDisplay) => {
|
|
194
206
|
if (page >= lastPage || page < 0) return;
|
|
@@ -368,23 +380,23 @@ PagingSelector.propTypes = {
|
|
|
368
380
|
/** Callback fired when quantity on per page changed. */
|
|
369
381
|
onChangePerPage: PropTypes.func,
|
|
370
382
|
|
|
371
|
-
/**
|
|
372
|
-
* Callback fired when page number is changing.
|
|
373
|
-
*
|
|
374
|
-
* * prevPage: Page before changed
|
|
375
|
-
* * newPage: Page after changed
|
|
376
|
-
* * cancel(value): Function cancel change page
|
|
377
|
-
* * @param {value} - bool
|
|
383
|
+
/**
|
|
384
|
+
* Callback fired when page number is changing.
|
|
385
|
+
*
|
|
386
|
+
* * prevPage: Page before changed
|
|
387
|
+
* * newPage: Page after changed
|
|
388
|
+
* * cancel(value): Function cancel change page
|
|
389
|
+
* * @param {value} - bool
|
|
378
390
|
*/
|
|
379
391
|
onChangingPage: PropTypes.func,
|
|
380
392
|
|
|
381
|
-
/**
|
|
382
|
-
* Callback fired when quantity on item per page is changing.
|
|
383
|
-
*
|
|
384
|
-
* * prevPerPage: Items per page before changed
|
|
385
|
-
* * newPerPage: Items per page after changed
|
|
386
|
-
* * cancel(value): Function cancel change items per page
|
|
387
|
-
* * @param {value} - bool
|
|
393
|
+
/**
|
|
394
|
+
* Callback fired when quantity on item per page is changing.
|
|
395
|
+
*
|
|
396
|
+
* * prevPerPage: Items per page before changed
|
|
397
|
+
* * newPerPage: Items per page after changed
|
|
398
|
+
* * cancel(value): Function cancel change items per page
|
|
399
|
+
* * @param {value} - bool
|
|
388
400
|
*/
|
|
389
401
|
onChangingPerPage: PropTypes.func,
|
|
390
402
|
|
|
@@ -394,15 +406,15 @@ PagingSelector.propTypes = {
|
|
|
394
406
|
/** Total items. */
|
|
395
407
|
totalItems: PropTypes.number,
|
|
396
408
|
|
|
397
|
-
/**
|
|
398
|
-
* ref methods (ref.current.instance.*method*)
|
|
399
|
-
*
|
|
400
|
-
* * onChangePage(page): Change page number
|
|
401
|
-
* * @param {page} - number
|
|
402
|
-
* * onChangePerPage(per): Change quantity on per page
|
|
403
|
-
* * @param {per} - number
|
|
404
|
-
* * setTotalItems(items): Set total items
|
|
405
|
-
* * @param {items} - number
|
|
409
|
+
/**
|
|
410
|
+
* ref methods (ref.current.instance.*method*)
|
|
411
|
+
*
|
|
412
|
+
* * onChangePage(page): Change page number
|
|
413
|
+
* * @param {page} - number
|
|
414
|
+
* * onChangePerPage(per): Change quantity on per page
|
|
415
|
+
* * @param {per} - number
|
|
416
|
+
* * setTotalItems(items): Set total items
|
|
417
|
+
* * @param {items} - number
|
|
406
418
|
*/
|
|
407
419
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
408
420
|
current: PropTypes.instanceOf(Element)
|
|
@@ -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: {
|
|
@@ -17,22 +18,30 @@ const {
|
|
|
17
18
|
spacing
|
|
18
19
|
} = theme;
|
|
19
20
|
const PopoverBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
21
|
+
action = {},
|
|
20
22
|
children,
|
|
21
23
|
className,
|
|
22
24
|
id,
|
|
23
25
|
style
|
|
24
26
|
}, reference) => {
|
|
25
27
|
const ref = useRef(null);
|
|
26
|
-
useImperativeHandle(reference, () =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
useImperativeHandle(reference, () => {
|
|
29
|
+
const currentRef = ref.current || {};
|
|
30
|
+
currentRef.element = ref.current;
|
|
31
|
+
const _instance = { ...action
|
|
32
|
+
}; // methods
|
|
33
|
+
|
|
34
|
+
_instance.__proto__ = {}; // hidden methods
|
|
35
|
+
|
|
36
|
+
currentRef.instance = _instance;
|
|
37
|
+
return currentRef;
|
|
38
|
+
});
|
|
30
39
|
return useMemo(() => jsx("div", {
|
|
31
40
|
css: PopoverBodyCSS,
|
|
32
41
|
ref: ref,
|
|
33
42
|
id: id,
|
|
34
43
|
style: style,
|
|
35
|
-
className:
|
|
44
|
+
className: classNames('DGN-UI-Popover-Body', className)
|
|
36
45
|
}, children), [children, className, id, style]);
|
|
37
46
|
}));
|
|
38
47
|
const PopoverBodyCSS = css`
|
|
@@ -40,7 +49,6 @@ const PopoverBodyCSS = css`
|
|
|
40
49
|
${positionRelative};
|
|
41
50
|
${overflowAuto};
|
|
42
51
|
padding: ${spacing([4])};
|
|
43
|
-
max-height: 472px;
|
|
44
52
|
order: 2;
|
|
45
53
|
&::-webkit-scrollbar {
|
|
46
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: {
|
|
@@ -16,6 +17,7 @@ const {
|
|
|
16
17
|
spacing
|
|
17
18
|
} = theme;
|
|
18
19
|
const PopoverFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
20
|
+
action = {},
|
|
19
21
|
boxShadow,
|
|
20
22
|
children,
|
|
21
23
|
className,
|
|
@@ -26,17 +28,24 @@ const PopoverFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
26
28
|
|
|
27
29
|
const _PopoverFooterCSS = PopoverFooterCSS(boxShadow);
|
|
28
30
|
|
|
29
|
-
useImperativeHandle(reference, () =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
useImperativeHandle(reference, () => {
|
|
32
|
+
const currentRef = ref.current || {};
|
|
33
|
+
currentRef.element = ref.current;
|
|
34
|
+
const _instance = { ...action
|
|
35
|
+
}; // methods
|
|
36
|
+
|
|
37
|
+
_instance.__proto__ = {}; // hidden methods
|
|
38
|
+
|
|
39
|
+
currentRef.instance = _instance;
|
|
40
|
+
return currentRef;
|
|
41
|
+
});
|
|
33
42
|
return useMemo(() => jsx("div", {
|
|
34
43
|
css: _PopoverFooterCSS,
|
|
35
44
|
ref: ref,
|
|
36
45
|
id: id,
|
|
37
46
|
style: style,
|
|
38
|
-
className:
|
|
39
|
-
}, children), [children, className, id, style]);
|
|
47
|
+
className: classNames('DGN-UI-Popover-Footer', className)
|
|
48
|
+
}, children), [boxShadow, children, className, id, style]);
|
|
40
49
|
}));
|
|
41
50
|
|
|
42
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,9 +15,11 @@ 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(({
|
|
22
|
+
action = {},
|
|
20
23
|
children,
|
|
21
24
|
className,
|
|
22
25
|
id,
|
|
@@ -24,16 +27,23 @@ const PopoverHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
24
27
|
title
|
|
25
28
|
}, reference) => {
|
|
26
29
|
const ref = useRef(null);
|
|
27
|
-
useImperativeHandle(reference, () =>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
useImperativeHandle(reference, () => {
|
|
31
|
+
const currentRef = ref.current || {};
|
|
32
|
+
currentRef.element = ref.current;
|
|
33
|
+
const _instance = { ...action
|
|
34
|
+
}; // methods
|
|
35
|
+
|
|
36
|
+
_instance.__proto__ = {}; // hidden methods
|
|
37
|
+
|
|
38
|
+
currentRef.instance = _instance;
|
|
39
|
+
return currentRef;
|
|
40
|
+
});
|
|
31
41
|
return useMemo(() => jsx("div", {
|
|
32
42
|
css: PopoverHeaderCSS,
|
|
33
43
|
ref: ref,
|
|
34
44
|
id: id,
|
|
35
45
|
style: style,
|
|
36
|
-
className:
|
|
46
|
+
className: classNames('DGN-UI-Popover-Header', className)
|
|
37
47
|
}, jsx(Typography, {
|
|
38
48
|
type: 'h3',
|
|
39
49
|
style: {
|
|
@@ -51,11 +61,11 @@ const PopoverHeaderCSS = css`
|
|
|
51
61
|
${borderBox};
|
|
52
62
|
${parseWidthHeight('100%', 56)};
|
|
53
63
|
background-color: ${headerbar};
|
|
54
|
-
min-width: 480px;
|
|
55
64
|
padding: ${spacing([4])};
|
|
56
65
|
border-radius: 4px 4px 0px 0px;
|
|
57
66
|
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
|
|
58
67
|
order: 1;
|
|
68
|
+
z-index: ${zIndexCORE(1)};
|
|
59
69
|
`;
|
|
60
70
|
PopoverHeader.defaultProps = {
|
|
61
71
|
title: '',
|