diginet-core-ui 1.3.69-beta.9 → 1.3.70
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/avatar/index.js +4 -12
- package/components/badge/index.js +4 -12
- package/components/button/icon.js +4 -12
- package/components/button/index.js +12 -25
- package/components/card/body.js +4 -12
- package/components/card/extra.js +4 -12
- package/components/card/footer.js +4 -12
- package/components/card/header.js +4 -12
- package/components/card/index.js +4 -12
- package/components/chip/index.js +185 -154
- package/components/form-control/checkbox/index.js +16 -5
- package/components/form-control/date-picker/index.js +2 -4
- package/components/form-control/label/index.js +18 -29
- package/components/form-control/money-input/index.js +11 -11
- package/components/form-control/number-input/index2.js +18 -18
- package/components/form-control/phone-input/index.js +7 -7
- package/components/form-control/radio/index.js +15 -4
- package/components/form-control/text-input/index.js +212 -139
- package/components/form-control/toggle/index.js +17 -5
- package/components/others/option-wrapper/index.js +18 -5
- package/components/paging/page-info.js +10 -22
- package/components/paging/page-selector2.js +10 -22
- package/components/popover/body.js +4 -12
- package/components/popover/footer.js +4 -12
- package/components/popover/header.js +4 -12
- package/components/popover/index.js +104 -196
- package/components/status/index.js +4 -12
- package/components/tab/tab-header.js +7 -14
- package/components/tab/tab.js +1 -1
- package/components/tooltip/index.js +4 -10
- package/icons/effect.js +21 -29
- package/package.json +31 -59
- package/readme.md +9 -0
|
@@ -51,7 +51,6 @@ const checkFileType = (type, matchType) => {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
54
|
-
action = {},
|
|
55
54
|
src,
|
|
56
55
|
defaultSrc,
|
|
57
56
|
outlined,
|
|
@@ -242,17 +241,10 @@ const Avatar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
242
241
|
}
|
|
243
242
|
}
|
|
244
243
|
}, [src]);
|
|
245
|
-
useImperativeHandle(reference, () => {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}; // methods
|
|
250
|
-
|
|
251
|
-
_instance.__proto__ = {}; // hidden methods
|
|
252
|
-
|
|
253
|
-
currentRef.instance = _instance;
|
|
254
|
-
return currentRef;
|
|
255
|
-
});
|
|
244
|
+
useImperativeHandle(reference, () => ({
|
|
245
|
+
element: ref.current,
|
|
246
|
+
instance: {}
|
|
247
|
+
}));
|
|
256
248
|
return useMemo(() => {
|
|
257
249
|
return jsx(Fragment, null, jsx("div", {
|
|
258
250
|
css: _AvatarContainerCSS,
|
|
@@ -72,7 +72,6 @@ const calDotPos = (anchorOrigin, contentDirection, dotSize, hasContent, size) =>
|
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
const Badge = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
75
|
-
action = {},
|
|
76
75
|
anchorOrigin,
|
|
77
76
|
contentDirection,
|
|
78
77
|
content,
|
|
@@ -99,17 +98,10 @@ const Badge = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
99
98
|
|
|
100
99
|
const _BadgeRootCSS = BadgeRootCSS(children, name, dotPos, _BadgeNumberCSS);
|
|
101
100
|
|
|
102
|
-
useImperativeHandle(reference, () => {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}; // methods
|
|
107
|
-
|
|
108
|
-
_instance.__proto__ = {}; // hidden methods
|
|
109
|
-
|
|
110
|
-
currentRef.instance = _instance;
|
|
111
|
-
return currentRef;
|
|
112
|
-
});
|
|
101
|
+
useImperativeHandle(reference, () => ({
|
|
102
|
+
element: ref.current,
|
|
103
|
+
instance: {}
|
|
104
|
+
}));
|
|
113
105
|
return useMemo(() => {
|
|
114
106
|
let node = children;
|
|
115
107
|
|
|
@@ -71,7 +71,6 @@ const renderIconLoading = iconSize => {
|
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
74
|
-
action = {},
|
|
75
74
|
viewType,
|
|
76
75
|
color,
|
|
77
76
|
size,
|
|
@@ -105,17 +104,10 @@ const ButtonIcon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
105
104
|
|
|
106
105
|
const _ButtonRootCSS = ButtonRootCSS(circular, size, width, _width, height, _height, buttonSize, iconSize, colorHover, color, _color, name);
|
|
107
106
|
|
|
108
|
-
useImperativeHandle(reference, () => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}; // methods
|
|
113
|
-
|
|
114
|
-
_instance.__proto__ = {}; // hidden methods
|
|
115
|
-
|
|
116
|
-
currentRef.instance = _instance;
|
|
117
|
-
return currentRef;
|
|
118
|
-
});
|
|
107
|
+
useImperativeHandle(reference, () => ({
|
|
108
|
+
element: ref.current,
|
|
109
|
+
instance: {}
|
|
110
|
+
}));
|
|
119
111
|
|
|
120
112
|
const _onClick = event => {
|
|
121
113
|
event.persist();
|
|
@@ -12,7 +12,6 @@ import Ripple from './ripple-effect';
|
|
|
12
12
|
import CircularProgress from '../progress/circular';
|
|
13
13
|
import Icon from '../../icons';
|
|
14
14
|
import { flexRow, alignCenter, justifyCenter, positionRelative, borderRadius4px, borderBox, noPadding, noBorder, cursorPointer, overflowHidden, pointerEventsNone, outlineNone, userSelectNone, backgroundTransparent, inlineFlex, noMargin } from '../../styles/general';
|
|
15
|
-
import { classNames } from '../../utils';
|
|
16
15
|
import theme from '../../theme/settings';
|
|
17
16
|
const {
|
|
18
17
|
colors: {
|
|
@@ -34,8 +33,7 @@ const {
|
|
|
34
33
|
},
|
|
35
34
|
typography: {
|
|
36
35
|
uppercase
|
|
37
|
-
}
|
|
38
|
-
spacing
|
|
36
|
+
}
|
|
39
37
|
} = theme;
|
|
40
38
|
export const getRippleColor = (color, viewType, colors) => {
|
|
41
39
|
if (!isColor(color) && !isColorName(color)) {
|
|
@@ -85,13 +83,12 @@ export const getClassNameFromColor = color => {
|
|
|
85
83
|
return !isColor(color) && !isColorName(color) ? color : 'custom-color';
|
|
86
84
|
};
|
|
87
85
|
const colorMap = new Map([['primary', active], ['success', success], ['warning', warning], ['danger', danger], ['info', info]]);
|
|
88
|
-
const iconSizeMap = new Map([['tiny',
|
|
89
|
-
const paddingSizeMap = new Map([['tiny',
|
|
90
|
-
const outlinedPaddingSizeMap = new Map([['tiny',
|
|
86
|
+
const iconSizeMap = new Map([['tiny', '16px'], ['small', '20px'], ['medium', '24px'], ['large', '32px'], ['giant', '40px']]);
|
|
87
|
+
const paddingSizeMap = new Map([['tiny', '4px 8px'], ['small', '6px 12px'], ['medium', '8px 16px'], ['large', '8px 20px'], ['giant', '8px 24px']]);
|
|
88
|
+
const outlinedPaddingSizeMap = new Map([['tiny', '3px 7px'], ['small', '5px 11px'], ['medium', '7px 15px'], ['large', '7px 19px'], ['giant', '7px 23px']]);
|
|
91
89
|
const iconMarginSizeMap = new Map([['tiny', '4px'], ['small', '4px'], ['medium', '4px'], ['large', '6px'], ['giant', '8px']]);
|
|
92
90
|
const typographySizeMap = new Map([['tiny', 'heading5'], ['small', 'heading5'], ['medium', 'heading4'], ['large', 'heading2'], ['giant', 'heading1']]);
|
|
93
91
|
const minHeightSizeMap = new Map([['tiny', '24px'], ['small', '32px'], ['medium', '40px'], ['large', '48px'], ['giant', '56px']]);
|
|
94
|
-
const minHeightSizeLinkMap = new Map([['tiny', '16px'], ['small', '20px'], ['medium', '24px'], ['large', '32px'], ['giant', '40px']]);
|
|
95
92
|
const alphaArr = {
|
|
96
93
|
hover: 0.1,
|
|
97
94
|
focus: 0.2,
|
|
@@ -99,7 +96,6 @@ const alphaArr = {
|
|
|
99
96
|
};
|
|
100
97
|
const alphaLoading = 0.2;
|
|
101
98
|
const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
102
|
-
action = {},
|
|
103
99
|
children,
|
|
104
100
|
className,
|
|
105
101
|
color,
|
|
@@ -125,23 +121,15 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
125
121
|
const typographySize = typographySizeMap.get(size);
|
|
126
122
|
const iconMarginSize = iconMarginSizeMap.get(size);
|
|
127
123
|
const minHeightSize = minHeightSizeMap.get(size);
|
|
128
|
-
const minHeightSizeLink = minHeightSizeLinkMap.get(size);
|
|
129
124
|
|
|
130
125
|
const _ButtonText = ButtonText(loading, iconMarginSize);
|
|
131
126
|
|
|
132
|
-
const _ButtonRoot = ButtonRoot(viewType, size, paddingSize, minHeightSize,
|
|
133
|
-
|
|
134
|
-
useImperativeHandle(reference, () => {
|
|
135
|
-
const currentRef = ref.current || {};
|
|
136
|
-
currentRef.element = ref.current;
|
|
137
|
-
const _instance = { ...action
|
|
138
|
-
}; // methods
|
|
139
|
-
|
|
140
|
-
_instance.__proto__ = {}; // hidden methods
|
|
127
|
+
const _ButtonRoot = ButtonRoot(viewType, size, paddingSize, minHeightSize, outlinedPaddingSize, endIcon, label, iconMarginSize, startIcon, iconSize, color);
|
|
141
128
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
129
|
+
useImperativeHandle(reference, () => ({
|
|
130
|
+
element: ref.current,
|
|
131
|
+
instance: {}
|
|
132
|
+
}));
|
|
145
133
|
const StartIcon = useMemo(() => {
|
|
146
134
|
let node = startIcon;
|
|
147
135
|
|
|
@@ -231,7 +219,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
231
219
|
onClick: _onClick,
|
|
232
220
|
id: id,
|
|
233
221
|
type: type,
|
|
234
|
-
className:
|
|
222
|
+
className: ['DGN-UI-Button', viewType, getClassNameFromColor(color), size, loading && 'button--loading', disabled && 'button--disabled', className].join(' ').trim().replace(/\s+/g, ' '),
|
|
235
223
|
...props
|
|
236
224
|
}, start, jsx(Typography, {
|
|
237
225
|
css: _ButtonText,
|
|
@@ -240,7 +228,7 @@ const Button = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
240
228
|
}, children || label), end && end, !disabled && !loading && viewType !== 'link' && jsx(Ripple, {
|
|
241
229
|
color: getRippleColor(color, viewType, allColors)
|
|
242
230
|
}));
|
|
243
|
-
}, [
|
|
231
|
+
}, [size, viewType, color, disabled, onClick, loading, startIcon, endIcon, label, type, className, children, id]);
|
|
244
232
|
}));
|
|
245
233
|
const ButtonIcon = css`
|
|
246
234
|
${flexRow};
|
|
@@ -256,7 +244,7 @@ const ButtonText = (loading, iconMarginSize) => css`
|
|
|
256
244
|
margin: 0 ${loading ? iconMarginSize : 0};
|
|
257
245
|
`;
|
|
258
246
|
|
|
259
|
-
const ButtonRoot = (viewType, size, paddingSize, minHeightSize,
|
|
247
|
+
const ButtonRoot = (viewType, size, paddingSize, minHeightSize, outlinedPaddingSize, endIcon, label, iconMarginSize, startIcon, iconSize, color) => css`
|
|
260
248
|
${inlineFlex};
|
|
261
249
|
${alignCenter};
|
|
262
250
|
${justifyCenter};
|
|
@@ -425,7 +413,6 @@ const ButtonRoot = (viewType, size, paddingSize, minHeightSize, minHeightSizeLin
|
|
|
425
413
|
}
|
|
426
414
|
}
|
|
427
415
|
&.link {
|
|
428
|
-
min-height: ${minHeightSizeLink};
|
|
429
416
|
${backgroundTransparent};
|
|
430
417
|
${noBorder};
|
|
431
418
|
${noPadding};
|
package/components/card/body.js
CHANGED
|
@@ -6,7 +6,6 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { jsx } from '@emotion/core';
|
|
7
7
|
import OptionWrapper from '../others/option-wrapper';
|
|
8
8
|
const CardBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
|
-
action = {},
|
|
10
9
|
children,
|
|
11
10
|
className,
|
|
12
11
|
id,
|
|
@@ -14,17 +13,10 @@ const CardBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
14
13
|
title
|
|
15
14
|
}, reference) => {
|
|
16
15
|
const ref = useRef(null);
|
|
17
|
-
useImperativeHandle(reference, () => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}; // methods
|
|
22
|
-
|
|
23
|
-
_instance.__proto__ = {}; // hidden methods
|
|
24
|
-
|
|
25
|
-
currentRef.instance = _instance;
|
|
26
|
-
return currentRef;
|
|
27
|
-
});
|
|
16
|
+
useImperativeHandle(reference, () => ({
|
|
17
|
+
element: ref.current,
|
|
18
|
+
instance: {}
|
|
19
|
+
}));
|
|
28
20
|
return useMemo(() => {
|
|
29
21
|
return jsx("div", {
|
|
30
22
|
id: id,
|
package/components/card/extra.js
CHANGED
|
@@ -6,7 +6,6 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { jsx } from '@emotion/core';
|
|
7
7
|
import OptionWrapper from '../others/option-wrapper';
|
|
8
8
|
const CardExtra = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
|
-
action = {},
|
|
10
9
|
children,
|
|
11
10
|
className,
|
|
12
11
|
id,
|
|
@@ -14,17 +13,10 @@ const CardExtra = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
14
13
|
title
|
|
15
14
|
}, reference) => {
|
|
16
15
|
const ref = useRef(null);
|
|
17
|
-
useImperativeHandle(reference, () => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}; // methods
|
|
22
|
-
|
|
23
|
-
_instance.__proto__ = {}; // hidden methods
|
|
24
|
-
|
|
25
|
-
currentRef.instance = _instance;
|
|
26
|
-
return currentRef;
|
|
27
|
-
});
|
|
16
|
+
useImperativeHandle(reference, () => ({
|
|
17
|
+
element: ref.current,
|
|
18
|
+
instance: {}
|
|
19
|
+
}));
|
|
28
20
|
return useMemo(() => {
|
|
29
21
|
return jsx("div", {
|
|
30
22
|
id: id,
|
|
@@ -6,7 +6,6 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { jsx } from '@emotion/core';
|
|
7
7
|
import OptionWrapper from '../others/option-wrapper';
|
|
8
8
|
const CardFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
|
-
action = {},
|
|
10
9
|
children,
|
|
11
10
|
className,
|
|
12
11
|
id,
|
|
@@ -14,17 +13,10 @@ const CardFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
14
13
|
title
|
|
15
14
|
}, reference) => {
|
|
16
15
|
const ref = useRef(null);
|
|
17
|
-
useImperativeHandle(reference, () => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}; // methods
|
|
22
|
-
|
|
23
|
-
_instance.__proto__ = {}; // hidden methods
|
|
24
|
-
|
|
25
|
-
currentRef.instance = _instance;
|
|
26
|
-
return currentRef;
|
|
27
|
-
});
|
|
16
|
+
useImperativeHandle(reference, () => ({
|
|
17
|
+
element: ref.current,
|
|
18
|
+
instance: {}
|
|
19
|
+
}));
|
|
28
20
|
return useMemo(() => {
|
|
29
21
|
return jsx("div", {
|
|
30
22
|
id: id,
|
|
@@ -7,7 +7,6 @@ import { jsx } from '@emotion/core';
|
|
|
7
7
|
import OptionWrapper from '../others/option-wrapper';
|
|
8
8
|
import Typography from '../typography';
|
|
9
9
|
const CardHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
|
-
action = {},
|
|
11
10
|
children,
|
|
12
11
|
className,
|
|
13
12
|
id,
|
|
@@ -15,17 +14,10 @@ const CardHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
15
14
|
title
|
|
16
15
|
}, reference) => {
|
|
17
16
|
const ref = useRef(null);
|
|
18
|
-
useImperativeHandle(reference, () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}; // methods
|
|
23
|
-
|
|
24
|
-
_instance.__proto__ = {}; // hidden methods
|
|
25
|
-
|
|
26
|
-
currentRef.instance = _instance;
|
|
27
|
-
return currentRef;
|
|
28
|
-
});
|
|
17
|
+
useImperativeHandle(reference, () => ({
|
|
18
|
+
element: ref.current,
|
|
19
|
+
instance: {}
|
|
20
|
+
}));
|
|
29
21
|
return useMemo(() => {
|
|
30
22
|
return jsx("div", {
|
|
31
23
|
id: id,
|
package/components/card/index.js
CHANGED
|
@@ -23,7 +23,6 @@ const {
|
|
|
23
23
|
spacing
|
|
24
24
|
} = theme;
|
|
25
25
|
const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
26
|
-
action = {},
|
|
27
26
|
body: bodyProp,
|
|
28
27
|
bodyStyle,
|
|
29
28
|
children,
|
|
@@ -45,17 +44,10 @@ const Card = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
45
44
|
|
|
46
45
|
const _CardCSS = CardCSS(width, height, headerDivider, footerDivider, dividerColor);
|
|
47
46
|
|
|
48
|
-
useImperativeHandle(reference, () => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}; // methods
|
|
53
|
-
|
|
54
|
-
_instance.__proto__ = {}; // hidden methods
|
|
55
|
-
|
|
56
|
-
currentRef.instance = _instance;
|
|
57
|
-
return currentRef;
|
|
58
|
-
});
|
|
47
|
+
useImperativeHandle(reference, () => ({
|
|
48
|
+
element: ref.current,
|
|
49
|
+
instance: {}
|
|
50
|
+
}));
|
|
59
51
|
const head = header || title ? jsx(CardHeader, {
|
|
60
52
|
className: (className === null || className === void 0 ? void 0 : className.header) || '',
|
|
61
53
|
style: headerStyle,
|