diginet-core-ui 1.3.85 → 1.3.86
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/accordion/css.js +10 -10
- package/components/accordion/details.js +2 -2
- package/components/alert/index.js +3 -3
- package/components/alert/notify.js +2 -2
- package/components/avatar/index.js +3 -3
- package/components/badge/index.js +6 -6
- package/components/button/icon.js +9 -9
- package/components/button/index.js +9 -9
- package/components/button/more.js +2 -2
- package/components/card/index.js +6 -6
- package/components/chip/index.js +7 -7
- package/components/form-control/attachment/index.js +335 -479
- package/components/form-control/calendar/function.js +5 -5
- package/components/form-control/checkbox/index.js +6 -6
- package/components/form-control/date-picker/index.js +2 -2
- package/components/form-control/date-range-picker/index.js +2 -2
- package/components/form-control/dropdown/index.js +335 -451
- package/components/form-control/dropdown-box/index.js +2 -2
- package/components/form-control/input-base/index.js +52 -58
- package/components/form-control/radio/index.js +4 -4
- package/components/form-control/toggle/index.js +2 -2
- package/components/grid/index.js +2 -2
- package/components/image/index.js +3 -3
- package/components/modal/body.js +2 -2
- package/components/modal/footer.js +3 -3
- package/components/modal/header.js +3 -3
- package/components/modal/modal.js +2 -2
- package/components/paging/page-info.js +6 -6
- package/components/paging/page-selector2.js +3 -3
- package/components/popover/footer.js +3 -3
- package/components/popover/header.js +3 -3
- package/components/popup/v2/index.js +5 -5
- package/components/rating/index.js +4 -4
- package/components/slider/slider-container.js +5 -5
- package/components/status/index.js +4 -4
- package/components/tab/tab-header.js +2 -2
- package/components/tab/tab-panel.js +2 -2
- package/components/tab/tab.js +7 -7
- package/components/tooltip/index.js +2 -2
- package/components/tree-view/css.js +4 -4
- package/components/tree-view/index.js +4 -4
- package/global/index.js +12 -0
- package/icons/effect.js +57 -59
- package/package.json +1 -1
- package/readme.md +6 -0
- package/styles/general.js +280 -114
- package/styles/utils.js +10 -0
- package/utils/array/array.js +18 -25
- package/utils/sb-template.js +2 -2
- package/utils/string/string.js +1 -9
- package/utils/validate.js +2 -2
|
@@ -8,7 +8,7 @@ import { ButtonIcon, InputBase, Label } from "../../";
|
|
|
8
8
|
import { randomString } from "../../../utils";
|
|
9
9
|
import { color as colors } from "../../../styles/colors";
|
|
10
10
|
import { typography } from "../../../styles/typography";
|
|
11
|
-
import {
|
|
11
|
+
import { boxBorder, borderRadius4px, displayBlock, positionFixed, positionRelative } from "../../../styles/general";
|
|
12
12
|
import { useTheme } from "../../../theme";
|
|
13
13
|
const {
|
|
14
14
|
paragraph1
|
|
@@ -196,7 +196,7 @@ const DropdownBoxCSS = zIndex => css`
|
|
|
196
196
|
${displayBlock};
|
|
197
197
|
${paragraph1};
|
|
198
198
|
${positionFixed};
|
|
199
|
-
${
|
|
199
|
+
${boxBorder};
|
|
200
200
|
${borderRadius4px};
|
|
201
201
|
background-color: ${white};
|
|
202
202
|
z-index: ${zIndex};
|
|
@@ -5,7 +5,7 @@ import { Icon, Typography } from "../..";
|
|
|
5
5
|
import { getGlobal } from "../../../global";
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { bgColor, bgTransparent, border, borderNone, borderRadius, borderRadius4px, boxBorder, displayBlock, displayNone, flexRow, inset, insetX, itemsCenter, mgl, mgr, outlineNone, parseHeight, parseMaxHeight, parseMinHeight, parseMinWidthHeight, parseWidth, parseWidthHeight, pd, pdl, pdx, pdy, pointerEventsNone, positionAbsolute, positionRelative, selfEnd, userSelectNone } from "../../../styles/general";
|
|
9
9
|
import { useColor as colors, useTheme } from "../../../theme";
|
|
10
10
|
import { classNames, refType as ref, useInput } from "../../../utils";
|
|
11
11
|
const {
|
|
@@ -35,8 +35,7 @@ const {
|
|
|
35
35
|
},
|
|
36
36
|
typography: {
|
|
37
37
|
paragraph1
|
|
38
|
-
}
|
|
39
|
-
spacing
|
|
38
|
+
}
|
|
40
39
|
} = useTheme();
|
|
41
40
|
const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
42
41
|
action = {},
|
|
@@ -187,33 +186,35 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
187
186
|
if (typeof node === 'string') {
|
|
188
187
|
node = jsx(Icon, {
|
|
189
188
|
name: startIcon,
|
|
190
|
-
style: iconStyle
|
|
189
|
+
style: iconStyle,
|
|
190
|
+
...startIconProps
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
193
|
return jsx("div", {
|
|
194
194
|
css: _InputBaseIconCSS,
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
className: classNames('DGN-UI-InputBase-Start-Icon', startIconProps.className),
|
|
196
|
+
...startIconProps
|
|
197
197
|
}, node);
|
|
198
|
-
}, [startIcon]);
|
|
198
|
+
}, [startIcon, startIconProps]);
|
|
199
199
|
const EndIcon = useMemo(() => {
|
|
200
200
|
let node = endIcon;
|
|
201
201
|
if (typeof node === 'string') {
|
|
202
202
|
node = jsx(Icon, {
|
|
203
203
|
name: endIcon,
|
|
204
|
-
style: iconStyle
|
|
204
|
+
style: iconStyle,
|
|
205
|
+
...endIconProps
|
|
205
206
|
});
|
|
206
207
|
}
|
|
207
208
|
return jsx("div", {
|
|
208
209
|
css: _InputBaseIconCSS,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
}, [endIcon]);
|
|
210
|
+
className: classNames('DGN-UI-InputBase-End-Icon', endIconProps.className),
|
|
211
|
+
...endIconProps
|
|
212
|
+
}, node);
|
|
213
|
+
}, [endIcon, endIconProps]);
|
|
213
214
|
const MultipleInputComp = jsx("div", {
|
|
215
|
+
ref: ref,
|
|
214
216
|
css: [_InputBaseCSS, _MultilineCSS],
|
|
215
217
|
className: classNames('DGN-UI-InputBase', newClass, className, disabled && 'disabled'),
|
|
216
|
-
ref: ref,
|
|
217
218
|
...props
|
|
218
219
|
}, startIcon && StartIcon, jsx("textarea", {
|
|
219
220
|
placeholder: isEnabled ? placeholder : '',
|
|
@@ -233,10 +234,10 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
233
234
|
...bind
|
|
234
235
|
}), endIcon && EndIcon);
|
|
235
236
|
const InputComp = jsx("div", {
|
|
236
|
-
css: [[_InputBaseCSS, _SingleLineCSS]],
|
|
237
237
|
ref: ref,
|
|
238
|
-
|
|
239
|
-
className: classNames('DGN-UI-InputBase', newClass, className, disabled && 'disabled')
|
|
238
|
+
css: [[_InputBaseCSS, _SingleLineCSS]],
|
|
239
|
+
className: classNames('DGN-UI-InputBase', newClass, className, disabled && 'disabled'),
|
|
240
|
+
...props
|
|
240
241
|
}, startIcon && StartIcon, jsx("input", {
|
|
241
242
|
type: type,
|
|
242
243
|
autoComplete: autoComplete,
|
|
@@ -277,7 +278,7 @@ const InputBase = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
277
278
|
const InputBaseCSS = (readOnly, status) => css`
|
|
278
279
|
${flexRow};
|
|
279
280
|
${positionRelative};
|
|
280
|
-
${
|
|
281
|
+
${boxBorder};
|
|
281
282
|
&:hover,
|
|
282
283
|
&:focus-within {
|
|
283
284
|
.DGN-UI-InputBase-Start-Icon:not(.non-effect) {
|
|
@@ -293,7 +294,7 @@ const InputBaseCSS = (readOnly, status) => css`
|
|
|
293
294
|
border-bottom-color: ${lineDisabled} !important;
|
|
294
295
|
}
|
|
295
296
|
&.outlined {
|
|
296
|
-
|
|
297
|
+
${bgColor(fillDisabled)};
|
|
297
298
|
}
|
|
298
299
|
.DGN-UI-InputBase-Start-Icon,
|
|
299
300
|
.DGN-UI-InputBase-End-Icon {
|
|
@@ -308,7 +309,7 @@ const InputBaseCSS = (readOnly, status) => css`
|
|
|
308
309
|
&.outlined {
|
|
309
310
|
${border(1, lineNormal)};
|
|
310
311
|
${borderRadius4px};
|
|
311
|
-
|
|
312
|
+
${pd([1.75, 4])};
|
|
312
313
|
&:not(:focus-within):hover {
|
|
313
314
|
${!readOnly && `
|
|
314
315
|
background-color: ${fillHover};
|
|
@@ -335,15 +336,11 @@ const InputBaseCSS = (readOnly, status) => css`
|
|
|
335
336
|
${borderRadius4px};
|
|
336
337
|
${pointerEventsNone};
|
|
337
338
|
${border(2, 'transparent')};
|
|
338
|
-
|
|
339
|
-
right: -2px;
|
|
340
|
-
top: -2px;
|
|
341
|
-
bottom: -2px;
|
|
339
|
+
${inset(-2)};
|
|
342
340
|
}
|
|
343
341
|
}
|
|
344
342
|
&.underlined {
|
|
345
|
-
|
|
346
|
-
padding-top: ${spacing([1])};
|
|
343
|
+
${pdy([1])};
|
|
347
344
|
&:not(:focus-within):hover {
|
|
348
345
|
${!readOnly && `
|
|
349
346
|
&::before {
|
|
@@ -368,16 +365,14 @@ const InputBaseCSS = (readOnly, status) => css`
|
|
|
368
365
|
&::before {
|
|
369
366
|
content: '';
|
|
370
367
|
${positionAbsolute};
|
|
371
|
-
|
|
372
|
-
right: 0;
|
|
368
|
+
${insetX(0)};
|
|
373
369
|
bottom: 0;
|
|
374
370
|
border-bottom: 1px solid ${lineNormal};
|
|
375
371
|
}
|
|
376
372
|
&::after {
|
|
377
373
|
content: '';
|
|
378
374
|
${positionAbsolute};
|
|
379
|
-
|
|
380
|
-
right: 0px;
|
|
375
|
+
${insetX(0)};
|
|
381
376
|
bottom: -1px;
|
|
382
377
|
border-bottom: 2px solid transparent;
|
|
383
378
|
transform: scaleX(0);
|
|
@@ -386,8 +381,7 @@ const InputBaseCSS = (readOnly, status) => css`
|
|
|
386
381
|
}
|
|
387
382
|
}
|
|
388
383
|
&.non-style {
|
|
389
|
-
|
|
390
|
-
padding-top: ${spacing([1])};
|
|
384
|
+
${pdy([1])};
|
|
391
385
|
border-color: transparent !important;
|
|
392
386
|
box-shadow: none !important;
|
|
393
387
|
background-color: transparent !important;
|
|
@@ -400,8 +394,10 @@ const InputBaseCSS = (readOnly, status) => css`
|
|
|
400
394
|
border-color: transparent !important;
|
|
401
395
|
}
|
|
402
396
|
}
|
|
403
|
-
${status !== 'default' && `
|
|
397
|
+
${status !== 'default' && `
|
|
404
398
|
border-color: ${colors[status]} !important;
|
|
399
|
+
&::before {
|
|
400
|
+
border-color: ${colors[status]} !important;
|
|
405
401
|
}`}
|
|
406
402
|
& + .DGN-UI-HelperText {
|
|
407
403
|
${positionAbsolute};
|
|
@@ -411,7 +407,7 @@ const InputBaseCSS = (readOnly, status) => css`
|
|
|
411
407
|
`;
|
|
412
408
|
const SingleLineCSS = (autoWidth, readOnly) => css`
|
|
413
409
|
${parseWidthHeight(autoWidth ? 'max-content' : 'auto', 'max-content')}
|
|
414
|
-
${
|
|
410
|
+
${itemsCenter};
|
|
415
411
|
flex: 1 1 auto;
|
|
416
412
|
&:focus-within {
|
|
417
413
|
${!readOnly && `
|
|
@@ -424,7 +420,7 @@ const SingleLineCSS = (autoWidth, readOnly) => css`
|
|
|
424
420
|
}
|
|
425
421
|
&.outlined {
|
|
426
422
|
${parseHeight(40)};
|
|
427
|
-
|
|
423
|
+
${bgColor(systemWhite)};
|
|
428
424
|
}
|
|
429
425
|
`;
|
|
430
426
|
const InputCSS = (autoWidth, isEnabled, hoverTooltip) => css`
|
|
@@ -433,9 +429,8 @@ const InputCSS = (autoWidth, isEnabled, hoverTooltip) => css`
|
|
|
433
429
|
${outlineNone};
|
|
434
430
|
transition: all 0.1s;
|
|
435
431
|
color: ${textMain};
|
|
436
|
-
${
|
|
437
|
-
|
|
438
|
-
padding-bottom: 0;
|
|
432
|
+
${bgTransparent};
|
|
433
|
+
${pdy(0)};
|
|
439
434
|
${paragraph1};
|
|
440
435
|
text-overflow: ellipsis;
|
|
441
436
|
&::placeholder {
|
|
@@ -443,46 +438,45 @@ const InputCSS = (autoWidth, isEnabled, hoverTooltip) => css`
|
|
|
443
438
|
${paragraph1};
|
|
444
439
|
}
|
|
445
440
|
&:focus {
|
|
446
|
-
|
|
441
|
+
${bgTransparent};
|
|
447
442
|
color: ${systemActive};
|
|
448
443
|
}
|
|
449
444
|
&:hover {
|
|
450
445
|
color: ${systemActive};
|
|
451
446
|
}
|
|
452
447
|
&.underlined {
|
|
453
|
-
|
|
454
|
-
padding-right: 0;
|
|
448
|
+
${pdx(0)};
|
|
455
449
|
}
|
|
456
450
|
&:disabled {
|
|
457
|
-
|
|
451
|
+
${bgTransparent};
|
|
458
452
|
}
|
|
459
|
-
${!isEnabled && hoverTooltip &&
|
|
453
|
+
${!isEnabled && hoverTooltip && displayNone};
|
|
460
454
|
`;
|
|
461
455
|
const TypoCSS = disabled => css`
|
|
462
456
|
${parseHeight(24)};
|
|
463
457
|
&:focus {
|
|
464
|
-
|
|
458
|
+
${bgTransparent};
|
|
465
459
|
color: ${systemActive};
|
|
466
460
|
}
|
|
467
461
|
&:hover {
|
|
468
462
|
color: ${systemActive};
|
|
469
463
|
}
|
|
470
|
-
${disabled &&
|
|
464
|
+
${disabled && userSelectNone};
|
|
471
465
|
`;
|
|
472
466
|
const MultilineCSS = (TextAreaCSSName, rows, maxRows) => css`
|
|
473
467
|
${parseWidthHeight('100%', 'max-content')};
|
|
474
468
|
&.outlined {
|
|
475
469
|
.css-${TextAreaCSSName} {
|
|
476
470
|
${parseHeight(24)};
|
|
477
|
-
${rows && /\d+/.test(rows) &&
|
|
478
|
-
${maxRows && /\d+/.test(maxRows) &&
|
|
471
|
+
${rows && /\d+/.test(rows) && parseHeight(20 * rows + 4)};
|
|
472
|
+
${maxRows && /\d+/.test(maxRows) && parseMaxHeight(20 * maxRows + 4)};
|
|
479
473
|
}
|
|
480
474
|
}
|
|
481
475
|
&.underlined {
|
|
482
476
|
.css-${TextAreaCSSName} {
|
|
483
477
|
${parseHeight(24)};
|
|
484
|
-
${rows && /\d+/.test(rows) &&
|
|
485
|
-
${maxRows && /\d+/.test(maxRows) &&
|
|
478
|
+
${rows && /\d+/.test(rows) && parseHeight(20 * rows + 4)};
|
|
479
|
+
${maxRows && /\d+/.test(maxRows) && parseMaxHeight(20 * maxRows + 4)};
|
|
486
480
|
}
|
|
487
481
|
}
|
|
488
482
|
`;
|
|
@@ -492,12 +486,12 @@ const TextAreaCSS = (resize, readOnly) => css`
|
|
|
492
486
|
${borderNone};
|
|
493
487
|
${outlineNone};
|
|
494
488
|
${positionRelative};
|
|
495
|
-
${
|
|
489
|
+
${boxBorder};
|
|
496
490
|
${parseWidth('100%')};
|
|
497
491
|
${parseMinWidthHeight('max-content')};
|
|
492
|
+
${pd([0.5, 0])};
|
|
493
|
+
${bgTransparent};
|
|
498
494
|
color: ${textMain};
|
|
499
|
-
background-color: transparent;
|
|
500
|
-
padding: ${spacing(0.5, 0)};
|
|
501
495
|
overflow-y: auto;
|
|
502
496
|
resize: ${resize};
|
|
503
497
|
&:hover:not(:focus-within) {
|
|
@@ -515,27 +509,27 @@ const TextAreaCSS = (resize, readOnly) => css`
|
|
|
515
509
|
&::-webkit-scrollbar {
|
|
516
510
|
${borderRadius4px};
|
|
517
511
|
${parseWidth(4)};
|
|
518
|
-
|
|
512
|
+
${bgColor(systemWhite)};
|
|
519
513
|
}
|
|
520
514
|
&::-webkit-scrollbar-thumb {
|
|
521
|
-
|
|
515
|
+
${borderRadius(10)};
|
|
516
|
+
${bgColor(fillDisabled)};
|
|
522
517
|
mix-blend-mode: normal;
|
|
523
|
-
background-color: ${fillDisabled};
|
|
524
518
|
background-clip: content-box;
|
|
525
519
|
}
|
|
526
520
|
`;
|
|
527
521
|
const InputBaseIconCSS = multiple => css`
|
|
528
522
|
${flexRow};
|
|
529
|
-
${multiple &&
|
|
523
|
+
${multiple && selfEnd};
|
|
530
524
|
color: inherit;
|
|
531
525
|
&.DGN-UI-InputBase-Start-Icon {
|
|
532
|
-
|
|
526
|
+
${mgr([1])};
|
|
533
527
|
& + input {
|
|
534
|
-
|
|
528
|
+
${pdl(0)};
|
|
535
529
|
}
|
|
536
530
|
}
|
|
537
531
|
&.DGN-UI-InputBase-End-Icon {
|
|
538
|
-
|
|
532
|
+
${mgl([1])};
|
|
539
533
|
}
|
|
540
534
|
`;
|
|
541
535
|
InputBase.defaultProps = {
|
|
@@ -6,7 +6,7 @@ import { forwardRef, memo, useState, useRef, useEffect, useMemo, Fragment } from
|
|
|
6
6
|
import theme from "../../../theme/settings";
|
|
7
7
|
import { randomString } from "../../../utils";
|
|
8
8
|
import Typography from "./../../typography";
|
|
9
|
-
import { cursorPointer,
|
|
9
|
+
import { cursorPointer, boxBorder, positionAbsolute, positionRelative, displayNone, displayBlock, cursorNoDrop } from "../../../styles/general";
|
|
10
10
|
const {
|
|
11
11
|
spacing,
|
|
12
12
|
colors: {
|
|
@@ -107,10 +107,10 @@ const formCheckCSS = css`
|
|
|
107
107
|
`;
|
|
108
108
|
const formCheckInputCSS = width => css`
|
|
109
109
|
${positionAbsolute};
|
|
110
|
-
${
|
|
110
|
+
${boxBorder};
|
|
111
111
|
${displayNone};
|
|
112
112
|
&:checked ~ label:after {
|
|
113
|
-
${
|
|
113
|
+
${boxBorder};
|
|
114
114
|
${positionAbsolute};
|
|
115
115
|
width: ${width / 2}px;
|
|
116
116
|
height: ${width / 2}px;
|
|
@@ -152,7 +152,7 @@ const formCheckLabelCSS = width => css`
|
|
|
152
152
|
}
|
|
153
153
|
&:before {
|
|
154
154
|
${positionAbsolute};
|
|
155
|
-
${
|
|
155
|
+
${boxBorder};
|
|
156
156
|
width: ${width}px;
|
|
157
157
|
height: ${width}px;
|
|
158
158
|
border-radius: 50%;
|
|
@@ -6,7 +6,7 @@ import { forwardRef, memo, useEffect, useMemo, useRef, useState, Fragment } from
|
|
|
6
6
|
import theme from "../../../theme/settings";
|
|
7
7
|
import generateRandom from "../../../utils/randomString";
|
|
8
8
|
import Typography from "../../typography";
|
|
9
|
-
import {
|
|
9
|
+
import { itemsCenter, cursorNoDrop, cursorPointer, displayBlock, flexRow, positionAbsolute, positionRelative } from "../../../styles/general";
|
|
10
10
|
const {
|
|
11
11
|
colors: {
|
|
12
12
|
system: {
|
|
@@ -59,7 +59,7 @@ const Toggle = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
59
59
|
`;
|
|
60
60
|
const toggle = css`
|
|
61
61
|
${flexRow};
|
|
62
|
-
${
|
|
62
|
+
${itemsCenter};
|
|
63
63
|
${positionRelative};
|
|
64
64
|
${cursorPointer};
|
|
65
65
|
margin: 0;
|
package/components/grid/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { css, jsx } from '@emotion/core';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { forwardRef, memo, useContext, useImperativeHandle, useMemo, useRef } from 'react';
|
|
6
|
-
import {
|
|
6
|
+
import { boxBorder } from "../../styles/general";
|
|
7
7
|
import { useTheme } from "../../theme";
|
|
8
8
|
import { breakpointKeys } from "../../theme/createBreakpoints";
|
|
9
9
|
import { classNames, handleBreakpoints } from "../../utils";
|
|
@@ -110,7 +110,7 @@ const handleGrid = (size, value, columns) => {
|
|
|
110
110
|
}`;
|
|
111
111
|
};
|
|
112
112
|
const GridCSS = (direction, zeroMinWidth, container, item, wrap, verticalAlign) => css`
|
|
113
|
-
${
|
|
113
|
+
${boxBorder};
|
|
114
114
|
${container && `
|
|
115
115
|
display: flex;
|
|
116
116
|
flex-wrap: ${wrap};
|
|
@@ -7,7 +7,7 @@ import OptionWrapper from "../others/option-wrapper";
|
|
|
7
7
|
import { useIntersection } from "../../utils/intersectionObserver";
|
|
8
8
|
import { classNames } from "../../utils";
|
|
9
9
|
import AvatarDefault from "../../assets/avatar/default.svg";
|
|
10
|
-
import {
|
|
10
|
+
import { itemsCenter, displayInlineFlex, overflowHidden, parseWidthHeight, positionRelative } from "../../styles/general";
|
|
11
11
|
const blurKeyframe = keyframes`
|
|
12
12
|
0% { -webkit-filter: blur(4px);}
|
|
13
13
|
25% { -webkit-filter: blur(3px);}
|
|
@@ -100,9 +100,9 @@ const Image = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
100
100
|
}, [alt, circular, className, defaultSrc, height, id, lazyLoading, src, style, width, isInView, onLoaded, srcState]);
|
|
101
101
|
}));
|
|
102
102
|
const ImageCSS = (width, height, circular) => css`
|
|
103
|
-
${
|
|
103
|
+
${displayInlineFlex};
|
|
104
104
|
${positionRelative};
|
|
105
|
-
${
|
|
105
|
+
${itemsCenter};
|
|
106
106
|
${overflowHidden};
|
|
107
107
|
${parseWidthHeight(width, height)};
|
|
108
108
|
${circular && `border-radius: 50%`};
|
package/components/modal/body.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { memo, useMemo, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import { border,
|
|
6
|
+
import { border, boxBorder, displayBlock, overflowAuto, parseWidthHeight, positionRelative } from "../../styles/general";
|
|
7
7
|
import { classNames } from "../../utils";
|
|
8
8
|
import theme from "../../theme/settings";
|
|
9
9
|
import { responsivePaddingCSS } from "./header";
|
|
@@ -44,7 +44,7 @@ const ModalBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
44
44
|
const ModalBodyCSS = css`
|
|
45
45
|
${displayBlock};
|
|
46
46
|
${positionRelative};
|
|
47
|
-
${
|
|
47
|
+
${boxBorder};
|
|
48
48
|
${overflowAuto};
|
|
49
49
|
${parseWidthHeight('100%', 'auto')};
|
|
50
50
|
order: 2;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { memo, useMemo, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import {
|
|
6
|
+
import { itemsCenter, boxBorder, flexRow, justifyEnd, positionRelative } from "../../styles/general";
|
|
7
7
|
import { classNames } from "../../utils";
|
|
8
8
|
import { responsivePaddingCSS } from "./header";
|
|
9
9
|
const ModalFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -37,9 +37,9 @@ const ModalFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
37
37
|
const ModalFooterCSS = boxShadow => css`
|
|
38
38
|
${flexRow};
|
|
39
39
|
${positionRelative};
|
|
40
|
-
${
|
|
40
|
+
${itemsCenter};
|
|
41
41
|
${justifyEnd};
|
|
42
|
-
${
|
|
42
|
+
${boxBorder};
|
|
43
43
|
width: 100%;
|
|
44
44
|
min-height: 56px;
|
|
45
45
|
border-radius: 0px 0px 4px 4px;
|
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
6
|
import ModalContext from "./context";
|
|
7
7
|
import { ButtonIcon, Typography } from "../";
|
|
8
|
-
import {
|
|
8
|
+
import { itemsCenter, boxBorder, flexRow, justifyBetween, parseWidthHeight, positionRelative } from "../../styles/general";
|
|
9
9
|
import { classNames, handleBreakpoints } from "../../utils";
|
|
10
10
|
import theme from "../../theme/settings";
|
|
11
11
|
const {
|
|
@@ -75,8 +75,8 @@ const ModalHeaderCSS = modal => css`
|
|
|
75
75
|
${flexRow};
|
|
76
76
|
${positionRelative};
|
|
77
77
|
${justifyBetween};
|
|
78
|
-
${
|
|
79
|
-
${
|
|
78
|
+
${itemsCenter};
|
|
79
|
+
${boxBorder};
|
|
80
80
|
${parseWidthHeight('100%', 56)};
|
|
81
81
|
background-color: ${headerbar};
|
|
82
82
|
border-radius: 4px 4px 0px 0px;
|
|
@@ -7,7 +7,7 @@ import { jsx, css } from '@emotion/core';
|
|
|
7
7
|
import useDelayUnmount from "../../utils/useDelayUnmount";
|
|
8
8
|
import ModalContext from "./context";
|
|
9
9
|
import { animations } from "../../styles/animation";
|
|
10
|
-
import {
|
|
10
|
+
import { boxBorder, borderRadius4px, flexCol, flexRow, justifyCenter, parseWidth, parseWidthHeight, positionFixed, positionRelative } from "../../styles/general";
|
|
11
11
|
import theme from "../../theme/settings";
|
|
12
12
|
import { classNames } from "../../utils";
|
|
13
13
|
const {
|
|
@@ -209,7 +209,7 @@ const ModalBoxCSS = (width, moveable, dragAnyWhere) => css`
|
|
|
209
209
|
${flexCol};
|
|
210
210
|
${positionRelative};
|
|
211
211
|
${borderRadius4px}
|
|
212
|
-
${
|
|
212
|
+
${boxBorder};
|
|
213
213
|
${parseWidth(width)}
|
|
214
214
|
cursor: ${moveable && dragAnyWhere ? 'move' : 'initial'};
|
|
215
215
|
max-height: calc(100% - 12px);
|
|
@@ -6,7 +6,7 @@ import OptionWrapper from "../others/option-wrapper";
|
|
|
6
6
|
import { getGlobal } from "../../global";
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
-
import {
|
|
9
|
+
import { itemsCenter, boxBorder, cursorPointer, flexRow, justifyCenter, noPadding, parseHeight, parseMinHeight, parseMinWidth, parseMinWidthHeight, parseWidthHeight, textCenter, whiteSpaceNoWrap } from "../../styles/general";
|
|
10
10
|
import { useTheme } from "../../theme";
|
|
11
11
|
import { classNames, refType as ref } from "../../utils";
|
|
12
12
|
const {
|
|
@@ -441,16 +441,16 @@ const PagingInfo = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
441
441
|
}));
|
|
442
442
|
const ViewNumberInput = css`
|
|
443
443
|
${flexRow};
|
|
444
|
-
${
|
|
444
|
+
${itemsCenter};
|
|
445
445
|
${justifyCenter};
|
|
446
446
|
transition: all 0.1s;
|
|
447
447
|
margin: ${spacing([0, 1])};
|
|
448
448
|
`;
|
|
449
449
|
const pagingInfoCSS = (bgColor, typeShort) => css`
|
|
450
450
|
${flexRow};
|
|
451
|
-
${
|
|
451
|
+
${itemsCenter};
|
|
452
452
|
${paragraph2};
|
|
453
|
-
${
|
|
453
|
+
${boxBorder};
|
|
454
454
|
${parseHeight(40)};
|
|
455
455
|
border-top: solid 1px ${lineSystem};
|
|
456
456
|
padding: ${spacing([1, 0])};
|
|
@@ -471,7 +471,7 @@ const pagingInfoCSS = (bgColor, typeShort) => css`
|
|
|
471
471
|
}
|
|
472
472
|
.txt-line-number {
|
|
473
473
|
${whiteSpaceNoWrap};
|
|
474
|
-
${
|
|
474
|
+
${itemsCenter};
|
|
475
475
|
opacity: 0;
|
|
476
476
|
display: flex !important;
|
|
477
477
|
transition: opacity 0.3s ease;
|
|
@@ -506,7 +506,7 @@ const pagingInfoCSS = (bgColor, typeShort) => css`
|
|
|
506
506
|
.total-items {
|
|
507
507
|
${whiteSpaceNoWrap};
|
|
508
508
|
${flexRow};
|
|
509
|
-
${
|
|
509
|
+
${itemsCenter};
|
|
510
510
|
margin-left: ${`${spacing(typeShort ? [0] : [4])}`};
|
|
511
511
|
opacity: 0;
|
|
512
512
|
transition: opacity 0.3s ease;
|
|
@@ -6,7 +6,7 @@ import { jsx, css } from '@emotion/core';
|
|
|
6
6
|
import OptionWrapper from "../others/option-wrapper";
|
|
7
7
|
import { getGlobal } from "../../global";
|
|
8
8
|
import theme from "../../theme/settings";
|
|
9
|
-
import {
|
|
9
|
+
import { itemsCenter, boxBorder, flexRow, parseHeight } from "../../styles/general";
|
|
10
10
|
import { ButtonIcon } from '..';
|
|
11
11
|
import { useElementSize } from "../../utils/useElementSize";
|
|
12
12
|
const {
|
|
@@ -311,8 +311,8 @@ const PagingSelector = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
311
311
|
}));
|
|
312
312
|
const PageSelectorCSS = css`
|
|
313
313
|
${flexRow};
|
|
314
|
-
${
|
|
315
|
-
${
|
|
314
|
+
${itemsCenter};
|
|
315
|
+
${boxBorder};
|
|
316
316
|
${parseHeight(40)};
|
|
317
317
|
padding: ${spacing([1])};
|
|
318
318
|
background: ${white};
|
|
@@ -4,7 +4,7 @@ import { css, jsx } from '@emotion/core';
|
|
|
4
4
|
import OptionWrapper from "../others/option-wrapper";
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
7
|
-
import {
|
|
7
|
+
import { itemsCenter, boxBorder, flexRow, justifyEnd, parseWidth, positionRelative } from "../../styles/general";
|
|
8
8
|
import { useTheme } from "../../theme";
|
|
9
9
|
import { classNames } from "../../utils";
|
|
10
10
|
const {
|
|
@@ -46,9 +46,9 @@ const PopoverFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
46
46
|
const PopoverFooterCSS = boxShadow => css`
|
|
47
47
|
${flexRow};
|
|
48
48
|
${positionRelative};
|
|
49
|
-
${
|
|
49
|
+
${itemsCenter};
|
|
50
50
|
${justifyEnd};
|
|
51
|
-
${
|
|
51
|
+
${boxBorder};
|
|
52
52
|
${parseWidth('100%')};
|
|
53
53
|
min-height: 56px;
|
|
54
54
|
padding: ${spacing([4])};
|
|
@@ -5,7 +5,7 @@ import { Typography } from "./..";
|
|
|
5
5
|
import OptionWrapper from "../others/option-wrapper";
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { forwardRef, memo, useImperativeHandle, useMemo, useRef } from 'react';
|
|
8
|
-
import {
|
|
8
|
+
import { itemsCenter, boxBorder, flexRow, parseWidthHeight, positionRelative } from "../../styles/general";
|
|
9
9
|
import { useTheme } from "../../theme";
|
|
10
10
|
import { classNames } from "../../utils";
|
|
11
11
|
const {
|
|
@@ -54,9 +54,9 @@ const PopoverHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
54
54
|
}));
|
|
55
55
|
const PopoverHeaderCSS = css`
|
|
56
56
|
${flexRow};
|
|
57
|
-
${
|
|
57
|
+
${itemsCenter};
|
|
58
58
|
${positionRelative};
|
|
59
|
-
${
|
|
59
|
+
${boxBorder};
|
|
60
60
|
${parseWidthHeight('100%', 56)};
|
|
61
61
|
background-color: ${fillHeaderbar};
|
|
62
62
|
padding: ${spacing([4])};
|
|
@@ -8,7 +8,7 @@ import { forwardRef, Fragment, memo, useCallback, useEffect, useImperativeHandle
|
|
|
8
8
|
import { createPortal } from 'react-dom';
|
|
9
9
|
import { animations } from "../../../styles/animation";
|
|
10
10
|
import { hexToRGBA } from "../../../styles/color-helper";
|
|
11
|
-
import {
|
|
11
|
+
import { itemsCenter, border, boxBorder, borderRadius4px, borderRadius50, breakWord, cursorPointer, displayBlock, truncate, flexCol, flexRow, justifyCenter, justifyEnd, overflowAuto, overflowHidden, parseHeight, parseMaxWidthHeight, parseMinHeight, parseMinWidth, parseWidth, parseWidthHeight, positionFixed, positionRelative } from "../../../styles/general";
|
|
12
12
|
import { useTheme } from "../../../theme";
|
|
13
13
|
import { classNames, refType as ref, useDelayUnmount } from "../../../utils";
|
|
14
14
|
const {
|
|
@@ -244,7 +244,7 @@ const PopupRootCSS = (width, top, type, description, subtitle, showMoreDescripti
|
|
|
244
244
|
.DGN-UI-Popup {
|
|
245
245
|
${flexCol};
|
|
246
246
|
${borderRadius4px};
|
|
247
|
-
${
|
|
247
|
+
${boxBorder};
|
|
248
248
|
${parseWidthHeight(width, 'fit-content')};
|
|
249
249
|
${parseMaxWidthHeight('80%')};
|
|
250
250
|
margin: ${isNaN(top) ? top : top + 'px'} auto auto;
|
|
@@ -259,13 +259,13 @@ const PopupRootCSS = (width, top, type, description, subtitle, showMoreDescripti
|
|
|
259
259
|
}
|
|
260
260
|
.DGN-UI-Popup-Header {
|
|
261
261
|
${flexRow};
|
|
262
|
-
${
|
|
262
|
+
${itemsCenter};
|
|
263
263
|
${parseMinHeight(40)};
|
|
264
264
|
padding: ${spacing([0, 2, 0, 4])};
|
|
265
265
|
border-radius: 4px 4px 0px 0px;
|
|
266
266
|
.DGN-UI-Popup-Header-Title {
|
|
267
267
|
${flexRow};
|
|
268
|
-
${
|
|
268
|
+
${truncate};
|
|
269
269
|
${parseWidth('calc(100% - 24px)')};
|
|
270
270
|
}
|
|
271
271
|
color: ${colorMap.get(type)};
|
|
@@ -305,7 +305,7 @@ const PopupRootCSS = (width, top, type, description, subtitle, showMoreDescripti
|
|
|
305
305
|
.DGN-UI-Popup-Body-Description {
|
|
306
306
|
${flexRow};
|
|
307
307
|
${positionRelative};
|
|
308
|
-
${
|
|
308
|
+
${itemsCenter};
|
|
309
309
|
${parseMinHeight(40)};
|
|
310
310
|
${parseHeight('max-content')};
|
|
311
311
|
.DGN-UI-Popup-Body-Subtitle {
|