diginet-core-ui 1.3.65 → 1.3.66
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/button/index.js +13 -14
- package/components/button/more.js +16 -16
- package/components/button/ripple-effect.js +2 -0
- package/components/card/card.js +30 -28
- package/components/card/index.js +1 -0
- package/components/chart/Pie/Circle.js +2 -1
- package/components/chart/Pie-v2/Circle.js +4 -5
- package/components/chart/Pie-v2/Sector.js +21 -27
- package/components/chart/Pie-v2/Sectors.js +16 -15
- package/components/chart/Pie-v2/index.js +141 -16
- package/components/chart/bar/Bar.js +20 -18
- package/components/chart/bar/Labels.js +20 -18
- package/components/chart/bar/index.js +3 -2
- package/components/chart/bar-v2/Bar.js +23 -21
- package/components/chart/bar-v2/Labels.js +21 -19
- package/components/chart/bar-v2/index.js +3 -2
- package/components/chart/line/Labels.js +21 -18
- package/components/chart/line/Path.js +7 -6
- package/components/chart/line/Point.js +2 -0
- package/components/chart/line/Title.js +1 -2
- package/components/chart/line/index.js +22 -1
- package/components/chart/line-v2/Labels.js +21 -18
- package/components/chart/line-v2/Path.js +15 -14
- package/components/chart/line-v2/Point.js +4 -2
- package/components/chart/line-v2/Title.js +1 -2
- package/components/chart/line-v2/index.js +8 -7
- package/components/check-text/index.js +22 -21
- package/components/chip/attach.js +8 -8
- package/components/form-control/calendar/index.js +17 -17
- package/components/form-control/calendar/range.js +33 -33
- package/components/form-control/dropdown/index.js +2 -1
- package/components/form-control/form/index.js +1 -0
- package/components/form-control/input-base/index.js +39 -30
- package/components/form-control/label/index.js +67 -43
- package/components/form-control/number-input/index.js +16 -29
- package/components/form-control/phone-input/index.js +20 -34
- package/components/form-control/text-input/index.js +9 -6
- package/components/form-control/time-picker/index.js +2 -1
- package/components/form-control/time-picker/swiper.js +80 -76
- package/components/form-view/helper-text.js +1 -0
- package/components/grid/Col.js +1 -1
- package/components/index.js +4 -1
- package/components/modal/index.js +1 -0
- package/components/others/extra/index.js +2 -0
- package/components/others/scrollbar/index.js +25 -26
- package/components/popover/body.js +74 -0
- package/components/popover/footer.js +76 -0
- package/components/popover/header.js +79 -0
- package/components/popover/index.js +119 -86
- package/components/popup/danger_popup.js +3 -1
- package/components/popup/index.js +2 -2
- package/components/popup/proposals_popup.js +1 -0
- package/components/progress/circular.js +14 -12
- package/components/status/index.js +92 -89
- package/components/tooltip/index.js +8 -3
- package/components/transfer/index.js +86 -94
- package/icons/effect.js +32 -34
- package/icons/general/clock/clock.js +1 -0
- package/icons/general/color-handler/background.js +1 -0
- package/icons/general/color-handler/text.js +1 -0
- package/icons/general/emoji/emoji.js +1 -0
- package/icons/general/font-properties/bold.js +1 -0
- package/icons/general/font-properties/font-family.js +1 -0
- package/icons/general/font-properties/font-size.js +1 -0
- package/icons/general/font-properties/italic.js +1 -0
- package/icons/general/font-properties/underline.js +1 -0
- package/icons/general/hyperlink/hyperlink.js +1 -0
- package/icons/general/indent/decrease.js +1 -0
- package/icons/general/indent/increase.js +1 -0
- package/icons/general/list/bullets.js +1 -0
- package/icons/general/list/numbering.js +1 -0
- package/icons/general/picture/picture.js +1 -0
- package/icons/general/steps/redo.js +1 -0
- package/icons/general/steps/undo.js +1 -0
- package/icons/general/text-align/center.js +1 -0
- package/icons/general/text-align/justify.js +1 -0
- package/icons/general/text-align/left.js +1 -0
- package/icons/general/text-align/right.js +1 -0
- package/icons/menu/dhr.js +2 -1
- package/icons/menu/erp.js +1 -0
- package/package.json +1 -1
- package/readme.md +15 -0
- package/styles/animation.js +2 -1
- package/styles/color-helper.js +108 -106
- package/styles/font.js +5 -4
- package/theme/index.js +1 -3
- package/theme/make-styles.js +25 -105
- package/theme/theme-provider.js +0 -9
- package/utils/console.js +0 -1
- package/utils/error/error.js +2 -3
- package/utils/index.js +0 -1
- package/utils/promisify.js +2 -1
- package/utils/renderIcon.js +13 -11
- package/styles/media-queries.js +0 -10
- package/theme/with-styles.js +0 -15
- package/theme/with-theme.js +0 -9
- package/utils/number.js +0 -63
|
@@ -1,103 +1,105 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import {
|
|
4
|
+
import { css, jsx } from '@emotion/core';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import {
|
|
6
|
+
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
7
7
|
import { Typography } from '../';
|
|
8
8
|
import Icon from '../../icons';
|
|
9
|
-
import { alignCenter, backgroundTransparent, borderBox,
|
|
10
|
-
import
|
|
9
|
+
import { alignCenter, backgroundTransparent, borderBox, flexRow } from '../../styles/general';
|
|
10
|
+
import theme from '../../theme/settings';
|
|
11
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
11
12
|
const {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
colors: {
|
|
14
|
+
system: {
|
|
15
|
+
active,
|
|
16
|
+
rest
|
|
17
|
+
},
|
|
18
|
+
semantic: {
|
|
19
|
+
success,
|
|
20
|
+
warning,
|
|
21
|
+
danger,
|
|
22
|
+
info
|
|
23
|
+
},
|
|
24
|
+
fill: {
|
|
25
|
+
sidebar
|
|
26
|
+
}
|
|
24
27
|
}
|
|
25
|
-
} =
|
|
28
|
+
} = theme;
|
|
26
29
|
const colorMap = new Map([['default', rest], ['primary', active], ['success', success], ['warning', warning], ['danger', danger], ['info', info]]);
|
|
27
30
|
const iconSizeMap = new Map([['small', '16px'], ['medium', '20px'], ['large', '24px']]);
|
|
28
31
|
const typographySizeMap = new Map([['small', 'p3'], ['medium', 'p2'], ['large', 'p1']]);
|
|
29
|
-
const filledPaddingSizeMap = new Map([['small', '
|
|
32
|
+
const filledPaddingSizeMap = new Map([['small', '2px 8px'], ['medium', '2px 12px'], ['large', '2px 12px']]);
|
|
30
33
|
const Status = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
size,
|
|
34
|
+
className,
|
|
35
|
+
color,
|
|
34
36
|
icon,
|
|
37
|
+
size,
|
|
35
38
|
text,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
ref = useRef(null);
|
|
42
|
-
}
|
|
43
|
-
|
|
39
|
+
viewType,
|
|
40
|
+
id,
|
|
41
|
+
style
|
|
42
|
+
}, reference) => {
|
|
43
|
+
const ref = useRef(null);
|
|
44
44
|
const outlinedPaddingSize = filledPaddingSizeMap.get(size);
|
|
45
45
|
|
|
46
|
-
const _color = colorMap.get(color);
|
|
46
|
+
const _color = colorMap.get(color) || color || rest;
|
|
47
47
|
|
|
48
48
|
const iconSize = iconSizeMap.get(size);
|
|
49
49
|
const typographySize = typographySizeMap.get(size);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
`;
|
|
68
|
-
const TextCSS = css`
|
|
69
|
-
white-space: nowrap;
|
|
70
|
-
`;
|
|
71
|
-
const StatusText = useMemo(() => jsx(Typography, {
|
|
50
|
+
|
|
51
|
+
const _StatusRoot = StatusRoot(iconSize, _color, size, outlinedPaddingSize);
|
|
52
|
+
|
|
53
|
+
useImperativeHandle(reference, () => ({
|
|
54
|
+
element: ref.current,
|
|
55
|
+
instance: {}
|
|
56
|
+
}));
|
|
57
|
+
const StatusIcon = typeof icon === 'string' ? jsx(Icon, {
|
|
58
|
+
name: icon,
|
|
59
|
+
width: iconSize,
|
|
60
|
+
height: iconSize,
|
|
61
|
+
color: 'currentColor',
|
|
62
|
+
viewBox: true
|
|
63
|
+
}) : icon;
|
|
64
|
+
const StatusText = jsx(Typography, {
|
|
72
65
|
css: TextCSS,
|
|
73
66
|
type: typographySize,
|
|
74
67
|
color: 'inherit'
|
|
75
|
-
}, text)
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
}, text);
|
|
69
|
+
return useMemo(() => {
|
|
70
|
+
return jsx("div", {
|
|
71
|
+
css: _StatusRoot,
|
|
72
|
+
ref: ref,
|
|
73
|
+
id: id,
|
|
74
|
+
style: style,
|
|
75
|
+
className: ['DGN-UI-Status', viewType, size, className].join(' ').trim().replace(/\s+/g, ' ')
|
|
76
|
+
}, StatusIcon, StatusText);
|
|
77
|
+
}, [className, color, icon, size, text, viewType, id, style]);
|
|
78
|
+
}));
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
const StatusRoot = (iconSize, color, size, outlinedPaddingSize) => css`
|
|
81
|
+
${flexRow};
|
|
82
|
+
${alignCenter};
|
|
83
|
+
${backgroundTransparent};
|
|
84
|
+
${borderBox};
|
|
85
|
+
gap: ${size === 'small' ? '2px' : '4px'};
|
|
86
|
+
min-height: ${iconSize};
|
|
87
|
+
color: ${color};
|
|
88
|
+
&.filled {
|
|
89
|
+
color: ${sidebar};
|
|
90
|
+
background-color: ${color};
|
|
91
|
+
border-radius: 12px;
|
|
92
|
+
&.${size} {
|
|
93
|
+
padding: ${outlinedPaddingSize};
|
|
94
|
+
}
|
|
87
95
|
}
|
|
96
|
+
`;
|
|
88
97
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
css: StatusRoot,
|
|
93
|
-
style: style,
|
|
94
|
-
className: ['DGN-UI-Status', viewType, size, className].join(' ').trim().replace(/\s+/g, ' '),
|
|
95
|
-
ref: ref,
|
|
96
|
-
...props
|
|
97
|
-
}, StatusIcon, StatusText);
|
|
98
|
-
}));
|
|
98
|
+
const TextCSS = css`
|
|
99
|
+
white-space: nowrap;
|
|
100
|
+
`;
|
|
99
101
|
Status.defaultProps = {
|
|
100
|
-
viewType: '
|
|
102
|
+
viewType: 'ghost',
|
|
101
103
|
text: '',
|
|
102
104
|
icon: '',
|
|
103
105
|
size: 'medium',
|
|
@@ -105,25 +107,26 @@ Status.defaultProps = {
|
|
|
105
107
|
style: {}
|
|
106
108
|
};
|
|
107
109
|
Status.propTypes = {
|
|
108
|
-
/**
|
|
109
|
-
|
|
110
|
+
/** Class for component. */
|
|
111
|
+
className: PropTypes.string,
|
|
110
112
|
|
|
111
|
-
/**
|
|
112
|
-
|
|
113
|
+
/** The color of the component. */
|
|
114
|
+
color: PropTypes.string,
|
|
113
115
|
|
|
114
|
-
/**
|
|
115
|
-
|
|
116
|
+
/** [Icon](https://core.diginet.com.vn/ui/?path=/story/icon-basic--basic) or element placed before the content. */
|
|
117
|
+
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
116
118
|
|
|
117
|
-
/**
|
|
118
|
-
|
|
119
|
+
/** The size of the component. */
|
|
120
|
+
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
119
121
|
|
|
120
|
-
/**
|
|
121
|
-
|
|
122
|
+
/** The content of the component. */
|
|
123
|
+
text: PropTypes.string,
|
|
122
124
|
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
+
/** The variant to use. */
|
|
126
|
+
viewType: PropTypes.oneOf(['filled', 'default', 'ghost']),
|
|
125
127
|
|
|
126
|
-
/**
|
|
127
|
-
|
|
128
|
+
/** Style inline of component. */
|
|
129
|
+
style: PropTypes.object
|
|
128
130
|
};
|
|
129
|
-
export
|
|
131
|
+
export { Status };
|
|
132
|
+
export default OptionWrapper(Status);
|
|
@@ -64,7 +64,6 @@ const Tooltip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
64
64
|
size,
|
|
65
65
|
forceDirection,
|
|
66
66
|
hoverDelay,
|
|
67
|
-
onToggle,
|
|
68
67
|
padding,
|
|
69
68
|
style,
|
|
70
69
|
tagCreatedName: TagCreatedName,
|
|
@@ -73,9 +72,10 @@ const Tooltip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
73
72
|
tooltipMaxWidth,
|
|
74
73
|
viewportPadding,
|
|
75
74
|
className,
|
|
75
|
+
disabled,
|
|
76
76
|
...props
|
|
77
77
|
}, reference) => {
|
|
78
|
-
const Id = randomString(
|
|
78
|
+
const Id = randomString(6, {
|
|
79
79
|
allowSymbol: false
|
|
80
80
|
});
|
|
81
81
|
const IDs = {
|
|
@@ -442,6 +442,7 @@ const Tooltip = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
442
442
|
};
|
|
443
443
|
|
|
444
444
|
const setOpenTrue = () => {
|
|
445
|
+
if (disabled) return;
|
|
445
446
|
setOpen(true);
|
|
446
447
|
};
|
|
447
448
|
|
|
@@ -545,7 +546,8 @@ Tooltip.defaultProps = {
|
|
|
545
546
|
tagCreatedName: 'div',
|
|
546
547
|
textAlign: 'center',
|
|
547
548
|
viewportPadding: defaultViewPadding,
|
|
548
|
-
className: ''
|
|
549
|
+
className: '',
|
|
550
|
+
disabled: false
|
|
549
551
|
};
|
|
550
552
|
Tooltip.propTypes = {
|
|
551
553
|
/** alignMode use to set align-items of the tooltip*/
|
|
@@ -569,6 +571,9 @@ Tooltip.propTypes = {
|
|
|
569
571
|
/** initialize direction of the tooltip */
|
|
570
572
|
direction: PropTypes.oneOf(['down', 'left', 'right', 'up']),
|
|
571
573
|
|
|
574
|
+
/** If `true`, the component is disabled. */
|
|
575
|
+
disabled: PropTypes.bool,
|
|
576
|
+
|
|
572
577
|
/** distance between the tooltip and the children */
|
|
573
578
|
distance: PropTypes.number,
|
|
574
579
|
|
|
@@ -15,12 +15,10 @@ const Transfer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
15
15
|
selectAll,
|
|
16
16
|
iconExpr,
|
|
17
17
|
displayExpr,
|
|
18
|
-
valueExpr,
|
|
19
18
|
width,
|
|
20
19
|
height,
|
|
21
20
|
paperProps,
|
|
22
21
|
renderItem,
|
|
23
|
-
onChange,
|
|
24
22
|
...props
|
|
25
23
|
}, ref) => {
|
|
26
24
|
if (!ref) {
|
|
@@ -42,97 +40,97 @@ const Transfer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
42
40
|
[determinateLeft, setDeterminateLeft] = useState(true),
|
|
43
41
|
[determinateRight, setDeterminateRight] = useState(true);
|
|
44
42
|
const TransferRoot = css`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
display: flex;
|
|
44
|
+
position: relative;
|
|
45
|
+
`;
|
|
48
46
|
const TransferBox = css`
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
47
|
+
display: block;
|
|
48
|
+
position: relative;
|
|
49
|
+
margin: 8px 0;
|
|
50
|
+
&.select-all {
|
|
51
|
+
max-height: calc(100% - 72px);
|
|
52
|
+
overflow-y: auto;
|
|
53
|
+
&::-webkit-scrollbar {
|
|
54
|
+
width: 8px;
|
|
55
|
+
background-color: #fff !important;
|
|
56
|
+
border-radius: 4px;
|
|
57
|
+
}
|
|
58
|
+
&::-webkit-scrollbar-thumb {
|
|
59
|
+
border-radius: 4px;
|
|
60
|
+
mix-blend-mode: normal;
|
|
61
|
+
background-color: ${theme.colors.dark12} !important;
|
|
62
|
+
background-clip: content-box;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
68
66
|
const TransferItem = css`
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
display: flex;
|
|
68
|
+
position: relative;
|
|
69
|
+
min-height: 40px;
|
|
70
|
+
&:hover {
|
|
71
|
+
background-color: ${theme.colors.hover};
|
|
72
|
+
}
|
|
73
|
+
`;
|
|
76
74
|
const TransferItemContent = css`
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
display: flex;
|
|
76
|
+
position: relative;
|
|
77
|
+
margin: 0 16px;
|
|
78
|
+
width: 100%;
|
|
79
|
+
align-items: center;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
`;
|
|
84
82
|
const TransferItemHeader = css`
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
83
|
+
display: flex;
|
|
84
|
+
position: sticky;
|
|
85
|
+
top: 0;
|
|
86
|
+
background-color: inherit;
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 56px;
|
|
89
|
+
padding: 8px 16px;
|
|
90
|
+
align-items: center;
|
|
91
|
+
box-sizing: border-box;
|
|
92
|
+
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
|
|
93
|
+
z-index: 2;
|
|
94
|
+
`;
|
|
97
95
|
const HeaderCheckbox = css`
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
display: inline-flex;
|
|
97
|
+
position: relative;
|
|
98
|
+
width: 40px;
|
|
99
|
+
height: 40px;
|
|
100
|
+
align-items: center;
|
|
101
|
+
`;
|
|
104
102
|
const HeaderTitle = css`
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
display: block;
|
|
104
|
+
position: relative;
|
|
105
|
+
`;
|
|
108
106
|
const ItemCheckbox = css`
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
display: block;
|
|
108
|
+
position: relative;
|
|
109
|
+
margin-right: 19px;
|
|
110
|
+
`;
|
|
113
111
|
const ItemContent = css`
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
display: flex;
|
|
113
|
+
position: relative;
|
|
114
|
+
align-items: center;
|
|
115
|
+
`;
|
|
118
116
|
const ItemImage = css`
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
width: 24px;
|
|
118
|
+
height: 24px;
|
|
119
|
+
margin-right: 8px;
|
|
120
|
+
object-fit: cover;
|
|
121
|
+
`;
|
|
124
122
|
const DashboardRoot = css`
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
123
|
+
display: flex;
|
|
124
|
+
position: relative;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
justify-content: center;
|
|
127
|
+
margin-left: 5px;
|
|
128
|
+
margin-right: 5px;
|
|
129
|
+
button {
|
|
130
|
+
margin-top: 5px;
|
|
131
|
+
margin-bottom: 5px;
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
136
134
|
|
|
137
135
|
const updateSelectedItemQuantity = (side, newTotal) => {
|
|
138
136
|
const sideRef = side === 'right' ? chosenTextRightRef : chosenTextLeftRef;
|
|
@@ -241,7 +239,7 @@ const Transfer = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
241
239
|
const keyArr = displayExpr && displayExpr.match(/\{\w+\}/g);
|
|
242
240
|
|
|
243
241
|
if (keyArr) {
|
|
244
|
-
const pattern = keyArr.join('|').replace(/([
|
|
242
|
+
const pattern = keyArr.join('|').replace(/([\\{\\}])/g, '\\$1');
|
|
245
243
|
const separatorArr = displayExpr.split(new RegExp(pattern));
|
|
246
244
|
let str = '';
|
|
247
245
|
let i = 0;
|
|
@@ -458,15 +456,12 @@ Transfer.propTypes = {
|
|
|
458
456
|
/** field name used for icon display */
|
|
459
457
|
iconExpr: string,
|
|
460
458
|
|
|
461
|
-
/** field name used for text display<br/>
|
|
462
|
-
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
463
|
-
* Note: don't use 'id - name', return undefined
|
|
459
|
+
/** field name used for text display<br/>
|
|
460
|
+
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
461
|
+
* Note: don't use 'id - name', return undefined
|
|
464
462
|
*/
|
|
465
463
|
displayExpr: oneOfType([string, array]),
|
|
466
464
|
|
|
467
|
-
/** the field name used for the returned result */
|
|
468
|
-
valueExpr: string,
|
|
469
|
-
|
|
470
465
|
/** display header to select all choices if true */
|
|
471
466
|
selectAll: bool,
|
|
472
467
|
|
|
@@ -480,9 +475,6 @@ Transfer.propTypes = {
|
|
|
480
475
|
paperProps: object,
|
|
481
476
|
|
|
482
477
|
/** the function to render content in transfer item */
|
|
483
|
-
renderItem: func
|
|
484
|
-
|
|
485
|
-
/** the function for transfer item between two list */
|
|
486
|
-
onChange: func
|
|
478
|
+
renderItem: func
|
|
487
479
|
};
|
|
488
480
|
export default Transfer;
|
package/icons/effect.js
CHANGED
|
@@ -15,7 +15,6 @@ const {
|
|
|
15
15
|
}
|
|
16
16
|
} = colors;
|
|
17
17
|
const Icon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
18
|
-
type,
|
|
19
18
|
name,
|
|
20
19
|
className,
|
|
21
20
|
style,
|
|
@@ -23,30 +22,29 @@ const Icon = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
23
22
|
width,
|
|
24
23
|
height,
|
|
25
24
|
viewBox,
|
|
26
|
-
disabled,
|
|
27
25
|
onClick,
|
|
28
26
|
...props
|
|
29
27
|
}, reference) => {
|
|
30
28
|
const ref = useRef(null);
|
|
31
29
|
const IconCss = css`
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
${flexRow};
|
|
31
|
+
${justifyCenter};
|
|
32
|
+
${alignCenter};
|
|
33
|
+
${borderBox};
|
|
34
|
+
${outlineNone};
|
|
35
|
+
${userSelectNone};
|
|
36
|
+
width: max-content;
|
|
37
|
+
height: max-content;
|
|
38
|
+
min-width: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
|
|
39
|
+
min-height: ${width ? isNaN(height) ? height : height + 'px' : '24px'};
|
|
40
|
+
`;
|
|
43
41
|
const NotFoundIcon = css`
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
${flexRow};
|
|
43
|
+
${borderBox};
|
|
44
|
+
width: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
|
|
45
|
+
height: ${width ? isNaN(width) ? width : width + 'px' : '24px'};
|
|
46
|
+
border: 1px dashed ${rest};
|
|
47
|
+
`;
|
|
50
48
|
useImperativeHandle(reference, () => {
|
|
51
49
|
const currentRef = ref.current || {};
|
|
52
50
|
const _instance = {}; // methods
|
|
@@ -96,8 +94,8 @@ Icon.propTypes = {
|
|
|
96
94
|
/** name of icon in icons store */
|
|
97
95
|
name: PropTypes.string.isRequired,
|
|
98
96
|
|
|
99
|
-
/** color of icon<br />
|
|
100
|
-
* default: #7F828E
|
|
97
|
+
/** color of icon<br />
|
|
98
|
+
* default: #7F828E
|
|
101
99
|
*/
|
|
102
100
|
color: PropTypes.string,
|
|
103
101
|
|
|
@@ -119,19 +117,19 @@ Icon.propTypes = {
|
|
|
119
117
|
/** have view box if true */
|
|
120
118
|
onClick: PropTypes.func,
|
|
121
119
|
|
|
122
|
-
/**
|
|
123
|
-
* ref methods
|
|
124
|
-
*
|
|
125
|
-
* * option(): Gets all UI component properties
|
|
126
|
-
* * Returns value - object
|
|
127
|
-
* * option(optionName): Gets the value of a single property
|
|
128
|
-
* * @param {optionName} - string
|
|
129
|
-
* * Returns value - any
|
|
130
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
131
|
-
* * @param {optionName} - string
|
|
132
|
-
* * @param {optionValue} - any
|
|
133
|
-
* * option(options): Updates the values of several properties
|
|
134
|
-
* * @param {options} - object
|
|
120
|
+
/**
|
|
121
|
+
* ref methods
|
|
122
|
+
*
|
|
123
|
+
* * option(): Gets all UI component properties
|
|
124
|
+
* * Returns value - object
|
|
125
|
+
* * option(optionName): Gets the value of a single property
|
|
126
|
+
* * @param {optionName} - string
|
|
127
|
+
* * Returns value - any
|
|
128
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
129
|
+
* * @param {optionName} - string
|
|
130
|
+
* * @param {optionValue} - any
|
|
131
|
+
* * option(options): Updates the values of several properties
|
|
132
|
+
* * @param {options} - object
|
|
135
133
|
*/
|
|
136
134
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
137
135
|
current: PropTypes.instanceOf(Element)
|