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,7 +1,7 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
-
import { memo,
|
|
4
|
+
import { memo, useEffect, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
7
|
import { InputBase, Label, HelperText, Typography } from '../../';
|
|
@@ -27,19 +27,14 @@ const PhoneInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
27
27
|
defaultValue,
|
|
28
28
|
value,
|
|
29
29
|
placeholder,
|
|
30
|
-
autoComplete,
|
|
31
30
|
autoFocus,
|
|
32
31
|
disabled,
|
|
33
32
|
readOnly,
|
|
34
33
|
multiline,
|
|
35
|
-
onConfirm,
|
|
36
34
|
refs,
|
|
37
35
|
inputRef,
|
|
38
36
|
inputProps,
|
|
39
|
-
iconStyle,
|
|
40
37
|
inputStyle,
|
|
41
|
-
labelProps,
|
|
42
|
-
errorProps,
|
|
43
38
|
error,
|
|
44
39
|
onChange,
|
|
45
40
|
onBlur,
|
|
@@ -58,18 +53,18 @@ const PhoneInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
58
53
|
|
|
59
54
|
|
|
60
55
|
const PhoneInputRoot = css`
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
display: block;
|
|
57
|
+
position: relative;
|
|
58
|
+
`;
|
|
64
59
|
const PhoneInputEnsign = css`
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
position: relative;
|
|
62
|
+
max-height: 24px;
|
|
63
|
+
align-items: center;
|
|
64
|
+
svg {
|
|
65
|
+
margin-right: 4px;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
73
68
|
/* End styled */
|
|
74
69
|
|
|
75
70
|
let currentKey,
|
|
@@ -324,7 +319,7 @@ const PhoneInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
324
319
|
onPaste: onPasteHandler,
|
|
325
320
|
startIcon: jsx("span", {
|
|
326
321
|
css: PhoneInputEnsign
|
|
327
|
-
}, !hiddenEnsign && ensigns[ensign].icon,
|
|
322
|
+
}, !hiddenEnsign && ensigns[ensign].icon, ' ', jsx(Typography, null, "(+", ensigns[ensign].countryCode, ")")),
|
|
328
323
|
startIconProps: {
|
|
329
324
|
className: 'non-effect'
|
|
330
325
|
}
|
|
@@ -368,9 +363,6 @@ PhoneInput.propTypes = {
|
|
|
368
363
|
/** error for input */
|
|
369
364
|
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
370
365
|
|
|
371
|
-
/** type auto complete of input (like new-password) */
|
|
372
|
-
autoComplete: PropTypes.string,
|
|
373
|
-
|
|
374
366
|
/** prevent all event if true, hide all icon */
|
|
375
367
|
disabled: PropTypes.bool,
|
|
376
368
|
|
|
@@ -392,12 +384,6 @@ PhoneInput.propTypes = {
|
|
|
392
384
|
/** style inline of input in PhoneInput component */
|
|
393
385
|
inputStyle: PropTypes.object,
|
|
394
386
|
|
|
395
|
-
/** any props of label in PhoneInput component */
|
|
396
|
-
labelProps: PropTypes.object,
|
|
397
|
-
|
|
398
|
-
/** any props of error in PhoneInput component */
|
|
399
|
-
errorProps: PropTypes.object,
|
|
400
|
-
|
|
401
387
|
/** The function to get ref of Dropdown component */
|
|
402
388
|
refs: PropTypes.func,
|
|
403
389
|
|
|
@@ -410,13 +396,13 @@ PhoneInput.propTypes = {
|
|
|
410
396
|
/** on input function */
|
|
411
397
|
onInput: PropTypes.func,
|
|
412
398
|
|
|
413
|
-
/**
|
|
414
|
-
* on change function. Return a object, example:<br/>
|
|
415
|
-
* {<br/>
|
|
416
|
-
* target: {value: "(+84) 123 456 789", ...}<br/>
|
|
417
|
-
* value: 0123456789<br/>
|
|
418
|
-
* countryCode: 84<br/>
|
|
419
|
-
* }
|
|
399
|
+
/**
|
|
400
|
+
* on change function. Return a object, example:<br/>
|
|
401
|
+
* {<br/>
|
|
402
|
+
* target: {value: "(+84) 123 456 789", ...}<br/>
|
|
403
|
+
* value: 0123456789<br/>
|
|
404
|
+
* countryCode: 84<br/>
|
|
405
|
+
* }
|
|
420
406
|
*/
|
|
421
407
|
onChange: PropTypes.func,
|
|
422
408
|
|
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { jsx, css } from '@emotion/core';
|
|
7
7
|
import { ButtonIcon, CircularProgress as Circular, HelperText, InputBase, Label } from '../../';
|
|
8
8
|
import { renderIcon, onValidate } from '../../../utils';
|
|
9
|
-
import { displayBlock, flexRow, positionRelative } from '../../../styles/general';
|
|
9
|
+
import { cursorNotAllowed, displayBlock, flexRow, positionRelative } from '../../../styles/general';
|
|
10
10
|
const icons = {
|
|
11
11
|
default: `<svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
12
12
|
<path fillRule="evenodd" clipRule="evenodd" d="M15.5616 19.0007C15.4036 19.0007 15.2446 18.9637 15.0986 18.8877L9.99962 16.2237L4.90162 18.8877C4.56362 19.0627 4.15562 19.0327 3.84962 18.8087C3.54162 18.5847 3.38862 18.2057 3.45362 17.8307L4.42462 12.2027L0.304623 8.21765C0.030623 7.95265 -0.068377 7.55465 0.048623 7.19065C0.165623 6.82865 0.478623 6.56365 0.856623 6.50965L6.55662 5.68165L9.10462 0.555654C9.44262 -0.124346 10.5576 -0.124346 10.8956 0.555654L13.4436 5.68165L19.1436 6.50965C19.5216 6.56365 19.8346 6.82865 19.9516 7.19065C20.0686 7.55465 19.9696 7.95265 19.6956 8.21765L15.5756 12.2027L16.5466 17.8307C16.6116 18.2057 16.4576 18.5847 16.1506 18.8087C15.9766 18.9367 15.7696 19.0007 15.5616 19.0007Z" fill="#7F828E"/>
|
|
@@ -81,15 +81,18 @@ const TextInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
81
81
|
/* Start styled */
|
|
82
82
|
|
|
83
83
|
const TextInputRoot = css`
|
|
84
|
-
${displayBlock}
|
|
85
|
-
${positionRelative}
|
|
86
|
-
|
|
84
|
+
${displayBlock};
|
|
85
|
+
${positionRelative};
|
|
86
|
+
margin-bottom: 20px;
|
|
87
|
+
&.disabled {
|
|
88
|
+
${cursorNotAllowed};
|
|
89
|
+
}
|
|
87
90
|
`;
|
|
88
91
|
const TextInputIcon = css`
|
|
89
|
-
${flexRow}
|
|
92
|
+
${flexRow};
|
|
90
93
|
color: inherit;
|
|
91
94
|
.edit-icon-pen {
|
|
92
|
-
${flexRow}
|
|
95
|
+
${flexRow};
|
|
93
96
|
}
|
|
94
97
|
.edit-icon-confirm {
|
|
95
98
|
display: none;
|
|
@@ -479,7 +479,8 @@ const TimePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
479
479
|
const escKeyFunc = ev => {
|
|
480
480
|
//call the useOnClickOutside when press esc key
|
|
481
481
|
if (ev.keyCode === 27) {
|
|
482
|
-
onBlur();
|
|
482
|
+
onBlur(); // eslint-disable-next-line no-undef
|
|
483
|
+
|
|
483
484
|
inputContainerRef.current.childNodes[0].blur();
|
|
484
485
|
}
|
|
485
486
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
|
|
3
|
+
/* eslint-disable react/prop-types */
|
|
4
|
+
|
|
1
5
|
/** @jsxRuntime classic */
|
|
2
6
|
|
|
3
7
|
/** @jsx jsx */
|
|
4
|
-
import { useEffect,
|
|
8
|
+
import { useEffect, useRef } from 'react';
|
|
5
9
|
import { jsx, css } from '@emotion/core';
|
|
6
10
|
import PropTypes from 'prop-types';
|
|
7
11
|
import { randomString } from '../../../utils';
|
|
@@ -95,84 +99,84 @@ const Swiper = props => {
|
|
|
95
99
|
|
|
96
100
|
const styles = {
|
|
97
101
|
container: css`
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
102
|
+
* {
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
}
|
|
105
|
+
background-color: #fff;
|
|
106
|
+
border-radius: 0;
|
|
107
|
+
color: #111d5e;
|
|
108
|
+
height: 100%;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
position: relative;
|
|
111
|
+
text-align: center;
|
|
112
|
+
width: 100%;
|
|
113
|
+
::before,
|
|
114
|
+
::after {
|
|
115
|
+
border-radius: 0px;
|
|
116
|
+
content: '';
|
|
117
|
+
display: block;
|
|
118
|
+
height: 50%;
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
position: absolute;
|
|
121
|
+
width: 100%;
|
|
122
|
+
/* z-index: 9003; */
|
|
123
|
+
z-index: 1;
|
|
124
|
+
}
|
|
125
|
+
::before {
|
|
126
|
+
top: 0;
|
|
127
|
+
background-image: linear-gradient(to bottom, ${gradient});
|
|
128
|
+
}
|
|
129
|
+
::after {
|
|
130
|
+
bottom: 0;
|
|
131
|
+
background-image: linear-gradient(to top, ${gradient});
|
|
132
|
+
}
|
|
133
|
+
`,
|
|
130
134
|
mainSelector: css`
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
135
|
+
-webkit-font-smoothing: subpixel-antialiased;
|
|
136
|
+
color: #111d53;
|
|
137
|
+
list-style: none;
|
|
138
|
+
margin: 0 auto;
|
|
139
|
+
position: absolute;
|
|
140
|
+
top: 50%;
|
|
141
|
+
transform-style: preserve-3d;
|
|
142
|
+
transform: translate3d(0, 0, ${-radius}px) rotateX(0deg);
|
|
143
|
+
width: 100%;
|
|
144
|
+
.${IDs.mainOption} {
|
|
145
|
+
-webkit-font-smoothing: subpixel-antialiased;
|
|
146
|
+
backface-visibility: hidden;
|
|
147
|
+
cursor: pointer;
|
|
148
|
+
position: absolute;
|
|
149
|
+
user-select: none;
|
|
150
|
+
}
|
|
151
|
+
`,
|
|
148
152
|
highlightContainer: css`
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
153
|
+
background-color: #fff;
|
|
154
|
+
border-bottom: 1px solid #7f828e;
|
|
155
|
+
border-top: 1px solid #7f828e;
|
|
156
|
+
color: #111d53;
|
|
157
|
+
font-size: 24px;
|
|
158
|
+
font-weight: 500;
|
|
159
|
+
height: ${itemHeight}px;
|
|
160
|
+
left: 50%;
|
|
161
|
+
line-height: ${itemHeight}px;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
position: absolute;
|
|
164
|
+
top: 50%;
|
|
165
|
+
transform: translate(-50%, -50%);
|
|
166
|
+
vertical-align: middle;
|
|
167
|
+
width: 70%;
|
|
168
|
+
`,
|
|
165
169
|
highlightSelector: css`
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
list-style: none;
|
|
171
|
+
margin: 0;
|
|
172
|
+
padding: 0;
|
|
173
|
+
position: absolute;
|
|
174
|
+
width: 100%;
|
|
175
|
+
.${IDs.highlightOption} {
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
user-select: none;
|
|
178
|
+
}
|
|
179
|
+
`
|
|
176
180
|
};
|
|
177
181
|
|
|
178
182
|
const renderSwiper = data => {
|
package/components/grid/Col.js
CHANGED
package/components/index.js
CHANGED
|
@@ -78,7 +78,10 @@ export { default as PagingSelector } from './paging/page-selector2'; // PAPER
|
|
|
78
78
|
|
|
79
79
|
export { default as Paper } from './paper'; // POPOVER
|
|
80
80
|
|
|
81
|
-
export { default as Popover } from './popover';
|
|
81
|
+
export { default as Popover } from './popover';
|
|
82
|
+
export { default as PopoverHeader } from './popover/header';
|
|
83
|
+
export { default as PopoverBody } from './popover/body';
|
|
84
|
+
export { default as PopoverFooter } from './popover/footer'; // POPUP
|
|
82
85
|
|
|
83
86
|
export { default as Popup } from './popup';
|
|
84
87
|
export { default as PopupV2 } from './popup/v2';
|
|
@@ -35,35 +35,35 @@ const scrollbar = ({
|
|
|
35
35
|
...props
|
|
36
36
|
}) => {
|
|
37
37
|
const Scrollbar = css`
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
38
|
+
position: relative;
|
|
39
|
+
display: block;
|
|
40
|
+
padding: 8px 8px;
|
|
41
|
+
margin-right: 8px;
|
|
42
|
+
max-width: ${maxWidth ? isNaN(maxWidth) ? maxWidth : maxWidth + 'px' : '100%'};
|
|
43
|
+
max-height: ${maxHeight ? isNaN(maxHeight) ? maxHeight : maxHeight + 'px' : '100%'};
|
|
44
|
+
&::-webkit-scrollbar {
|
|
45
|
+
width: ${width ? isNaN(width) ? width : width + 'px' : '8px'};
|
|
46
|
+
height: ${height ? isNaN(height) ? height : height + 'px' : '8px'};
|
|
47
|
+
background-color: ${backgroundScroll};
|
|
48
|
+
}
|
|
49
|
+
&::-webkit-scrollbar-thumb {
|
|
50
|
+
border-radius: 10px;
|
|
51
|
+
mix-blend-mode: normal;
|
|
52
|
+
background-color: ${backgroundThumb};
|
|
53
|
+
background-clip: content-box;
|
|
54
|
+
}
|
|
55
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
56
|
+
border-radius: 10px;
|
|
57
|
+
background-color: ${backgroundThumbHover};
|
|
58
|
+
background-clip: content-box;
|
|
59
|
+
}
|
|
60
|
+
${/tract/i.test(custom) ? `&::-webkit-scrollbar-track {
|
|
61
61
|
border-radius: 10px;
|
|
62
62
|
mix-blend-mode: normal;
|
|
63
63
|
background: rgba(21, 26, 48, 0.02);
|
|
64
64
|
}` : ''}
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
${getPosition[position]}
|
|
66
|
+
`;
|
|
67
67
|
return jsx("div", {
|
|
68
68
|
css: Scrollbar,
|
|
69
69
|
custom: custom,
|
|
@@ -82,7 +82,6 @@ scrollbar.defaultProps = {
|
|
|
82
82
|
};
|
|
83
83
|
scrollbar.propTypes = {
|
|
84
84
|
custom: PropTypes.string,
|
|
85
|
-
position: PropTypes.string,
|
|
86
85
|
position: PropTypes.oneOf(['bottom', 'right', 'left']),
|
|
87
86
|
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
88
87
|
maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { memo, useMemo, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { jsx, css } from '@emotion/core';
|
|
7
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
8
|
+
import { flexCol, overflowAuto, positionRelative } from '../../styles/general';
|
|
9
|
+
import theme from '../../theme/settings';
|
|
10
|
+
const {
|
|
11
|
+
colors: {
|
|
12
|
+
fill: {
|
|
13
|
+
'scrollbar-rest': scrollbarRest,
|
|
14
|
+
'scrollbar-active': scrollbarActive
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
spacing
|
|
18
|
+
} = theme;
|
|
19
|
+
const PopoverBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
20
|
+
children,
|
|
21
|
+
className,
|
|
22
|
+
id,
|
|
23
|
+
style
|
|
24
|
+
}, reference) => {
|
|
25
|
+
const ref = useRef(null);
|
|
26
|
+
useImperativeHandle(reference, () => ({
|
|
27
|
+
element: ref.current,
|
|
28
|
+
instance: {}
|
|
29
|
+
}));
|
|
30
|
+
return useMemo(() => jsx("div", {
|
|
31
|
+
css: PopoverBodyCSS,
|
|
32
|
+
ref: ref,
|
|
33
|
+
id: id,
|
|
34
|
+
style: style,
|
|
35
|
+
className: ['DGN-UI-Popover-Body', className].join(' ').trim().replace(/\s+/g, ' ')
|
|
36
|
+
}, children), [children, className, id, style]);
|
|
37
|
+
}));
|
|
38
|
+
const PopoverBodyCSS = css`
|
|
39
|
+
${flexCol};
|
|
40
|
+
${positionRelative};
|
|
41
|
+
${overflowAuto};
|
|
42
|
+
padding: ${spacing([4])};
|
|
43
|
+
max-height: 472px;
|
|
44
|
+
order: 2;
|
|
45
|
+
&::-webkit-scrollbar {
|
|
46
|
+
width: 24px;
|
|
47
|
+
}
|
|
48
|
+
&::-webkit-scrollbar-thumb {
|
|
49
|
+
border-radius: 10px;
|
|
50
|
+
mix-blend-mode: normal;
|
|
51
|
+
background-color: ${scrollbarRest};
|
|
52
|
+
background-clip: content-box;
|
|
53
|
+
border: 8px solid transparent;
|
|
54
|
+
:hover {
|
|
55
|
+
background-color: ${scrollbarActive};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
PopoverBody.defaultProps = {
|
|
60
|
+
className: '',
|
|
61
|
+
style: {}
|
|
62
|
+
};
|
|
63
|
+
PopoverBody.propTypes = {
|
|
64
|
+
/** The content of the component. */
|
|
65
|
+
children: PropTypes.node,
|
|
66
|
+
|
|
67
|
+
/** Class for component. */
|
|
68
|
+
className: PropTypes.string,
|
|
69
|
+
|
|
70
|
+
/** Style inline of component. */
|
|
71
|
+
style: PropTypes.object
|
|
72
|
+
};
|
|
73
|
+
export { PopoverBody };
|
|
74
|
+
export default OptionWrapper(PopoverBody);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { memo, useMemo, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { jsx, css } from '@emotion/core';
|
|
7
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
8
|
+
import { alignCenter, borderBox, flexRow, justifyEnd, parseWidth, positionRelative } from '../../styles/general';
|
|
9
|
+
import theme from '../../theme/settings';
|
|
10
|
+
const {
|
|
11
|
+
colors: {
|
|
12
|
+
system: {
|
|
13
|
+
white
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
spacing
|
|
17
|
+
} = theme;
|
|
18
|
+
const PopoverFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
19
|
+
boxShadow,
|
|
20
|
+
children,
|
|
21
|
+
className,
|
|
22
|
+
id,
|
|
23
|
+
style
|
|
24
|
+
}, reference) => {
|
|
25
|
+
const ref = useRef(null);
|
|
26
|
+
|
|
27
|
+
const _PopoverFooterCSS = PopoverFooterCSS(boxShadow);
|
|
28
|
+
|
|
29
|
+
useImperativeHandle(reference, () => ({
|
|
30
|
+
element: ref.current,
|
|
31
|
+
instance: {}
|
|
32
|
+
}));
|
|
33
|
+
return useMemo(() => jsx("div", {
|
|
34
|
+
css: _PopoverFooterCSS,
|
|
35
|
+
ref: ref,
|
|
36
|
+
id: id,
|
|
37
|
+
style: style,
|
|
38
|
+
className: ['DGN-UI-Popover-Footer', className].join(' ').trim().replace(/\s+/g, ' ')
|
|
39
|
+
}, children), [children, className, id, style]);
|
|
40
|
+
}));
|
|
41
|
+
|
|
42
|
+
const PopoverFooterCSS = boxShadow => css`
|
|
43
|
+
${flexRow};
|
|
44
|
+
${positionRelative};
|
|
45
|
+
${alignCenter};
|
|
46
|
+
${justifyEnd};
|
|
47
|
+
${borderBox};
|
|
48
|
+
${parseWidth('100%')};
|
|
49
|
+
min-height: 56px;
|
|
50
|
+
padding: ${spacing([4])};
|
|
51
|
+
background: ${white};
|
|
52
|
+
border-radius: 0px 0px 4px 4px;
|
|
53
|
+
box-shadow: ${boxShadow ? '0px -2px 2px rgba(0, 0, 0, 0.1)' : 'none'};
|
|
54
|
+
order: 3;
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
PopoverFooter.defaultProps = {
|
|
58
|
+
className: '',
|
|
59
|
+
style: {},
|
|
60
|
+
boxShadow: true
|
|
61
|
+
};
|
|
62
|
+
PopoverFooter.propTypes = {
|
|
63
|
+
/** The box-shadow of component. */
|
|
64
|
+
boxShadow: PropTypes.bool,
|
|
65
|
+
|
|
66
|
+
/** The content of the component. */
|
|
67
|
+
children: PropTypes.node,
|
|
68
|
+
|
|
69
|
+
/** Class for component. */
|
|
70
|
+
className: PropTypes.string,
|
|
71
|
+
|
|
72
|
+
/** Style inline of component. */
|
|
73
|
+
style: PropTypes.object
|
|
74
|
+
};
|
|
75
|
+
export { PopoverFooter };
|
|
76
|
+
export default OptionWrapper(PopoverFooter);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** @jsxRuntime classic */
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { memo, useMemo, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import { jsx, css } from '@emotion/core';
|
|
7
|
+
import OptionWrapper from '../others/option-wrapper';
|
|
8
|
+
import { Typography } from '../';
|
|
9
|
+
import { alignCenter, borderBox, flexRow, parseWidthHeight, positionRelative } from '../../styles/general';
|
|
10
|
+
import theme from '../../theme/settings';
|
|
11
|
+
const {
|
|
12
|
+
colors: {
|
|
13
|
+
fill: {
|
|
14
|
+
headerbar
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
spacing
|
|
18
|
+
} = theme;
|
|
19
|
+
const PopoverHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
20
|
+
children,
|
|
21
|
+
className,
|
|
22
|
+
id,
|
|
23
|
+
style,
|
|
24
|
+
title
|
|
25
|
+
}, reference) => {
|
|
26
|
+
const ref = useRef(null);
|
|
27
|
+
useImperativeHandle(reference, () => ({
|
|
28
|
+
element: ref.current,
|
|
29
|
+
instance: {}
|
|
30
|
+
}));
|
|
31
|
+
return useMemo(() => jsx("div", {
|
|
32
|
+
css: PopoverHeaderCSS,
|
|
33
|
+
ref: ref,
|
|
34
|
+
id: id,
|
|
35
|
+
style: style,
|
|
36
|
+
className: ['DGN-UI-Popover-Header', className].join(' ').trim().replace(/\s+/g, ' ')
|
|
37
|
+
}, jsx(Typography, {
|
|
38
|
+
type: 'h3',
|
|
39
|
+
style: {
|
|
40
|
+
whiteSpace: 'nowrap',
|
|
41
|
+
overflow: 'hidden',
|
|
42
|
+
textOverflow: 'ellipsis',
|
|
43
|
+
width: '100%'
|
|
44
|
+
}
|
|
45
|
+
}, children ? children : title)), [children, className, id, style, title]);
|
|
46
|
+
}));
|
|
47
|
+
const PopoverHeaderCSS = css`
|
|
48
|
+
${flexRow};
|
|
49
|
+
${alignCenter};
|
|
50
|
+
${positionRelative};
|
|
51
|
+
${borderBox};
|
|
52
|
+
${parseWidthHeight('100%', 56)};
|
|
53
|
+
background-color: ${headerbar};
|
|
54
|
+
min-width: 480px;
|
|
55
|
+
padding: ${spacing([4])};
|
|
56
|
+
border-radius: 4px 4px 0px 0px;
|
|
57
|
+
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.25);
|
|
58
|
+
order: 1;
|
|
59
|
+
`;
|
|
60
|
+
PopoverHeader.defaultProps = {
|
|
61
|
+
title: '',
|
|
62
|
+
className: '',
|
|
63
|
+
style: {}
|
|
64
|
+
};
|
|
65
|
+
PopoverHeader.propTypes = {
|
|
66
|
+
/** The content of the component. */
|
|
67
|
+
children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
68
|
+
|
|
69
|
+
/** Class for component. */
|
|
70
|
+
className: PropTypes.string,
|
|
71
|
+
|
|
72
|
+
/** Style inline of component. */
|
|
73
|
+
style: PropTypes.object,
|
|
74
|
+
|
|
75
|
+
/** The content of the component if not have prop `children`. */
|
|
76
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
|
|
77
|
+
};
|
|
78
|
+
export { PopoverHeader };
|
|
79
|
+
export default OptionWrapper(PopoverHeader);
|