diginet-core-ui 1.3.96-beta.1 → 1.3.96-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/image/default.jpg +0 -0
- package/components/breadcrumb/index.js +19 -21
- package/components/form-control/dropdown/index.js +1 -1
- package/components/image/index.js +7 -4
- package/components/modal/modal.js +26 -22
- package/components/popover/index.js +21 -9
- package/components/typography/index.js +29 -41
- package/package.json +1 -1
- package/utils/renderHTML.js +1 -1
|
Binary file
|
|
@@ -87,27 +87,24 @@ const Breadcrumb = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
87
87
|
// <ButtonIcon key="ellipsis" name={'MoreHoriz'} width={24} height={16} onClick={handleClickExpand} />,
|
|
88
88
|
...allItems.slice(allItems.length - itemsAfterCollapse, allItems.length)];
|
|
89
89
|
};
|
|
90
|
-
const allItems = data !== null && data !== void 0 && data.length ? data.map((item, idx) => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
onClick: item === null || item === void 0 ? void 0 : (_item$onClick2 = item.onClick) === null || _item$onClick2 === void 0 ? void 0 : _item$onClick2.call(item)
|
|
109
|
-
}, (item === null || item === void 0 ? void 0 : item.label) || (item === null || item === void 0 ? void 0 : item.name)), (data === null || data === void 0 ? void 0 : data.length) !== idx + 1 ? renderSeparator : null);
|
|
110
|
-
}) : React.Children.toArray(children).filter(child => {
|
|
90
|
+
const allItems = data !== null && data !== void 0 && data.length ? data.map((item, idx) => jsx("li", {
|
|
91
|
+
css: _BreadcrumbLiCSS,
|
|
92
|
+
className: 'DGN-UI-Breadcrumb-li',
|
|
93
|
+
key: `child-${idx}`
|
|
94
|
+
}, item !== null && item !== void 0 && item.icon ? jsx(Icon, {
|
|
95
|
+
className: 'DGN-UI-Breadcrumb-li-icon',
|
|
96
|
+
name: item === null || item === void 0 ? void 0 : item.icon,
|
|
97
|
+
color: color,
|
|
98
|
+
width: sizeIcon,
|
|
99
|
+
height: sizeIcon
|
|
100
|
+
}) : null, jsx(Typography, {
|
|
101
|
+
className: 'DGN-UI-Breadcrumb-li-label',
|
|
102
|
+
type: (data === null || data === void 0 ? void 0 : data.length) === idx + 1 ? sizeTypographyH : sizeTypographyP,
|
|
103
|
+
mapping: 'a',
|
|
104
|
+
color: 'currentColor',
|
|
105
|
+
href: item === null || item === void 0 ? void 0 : item.href,
|
|
106
|
+
onClick: item === null || item === void 0 ? void 0 : item.onClick
|
|
107
|
+
}, (item === null || item === void 0 ? void 0 : item.label) || (item === null || item === void 0 ? void 0 : item.name)), (data === null || data === void 0 ? void 0 : data.length) !== idx + 1 ? renderSeparator : null)) : React.Children.toArray(children).filter(child => {
|
|
111
108
|
return /*#__PURE__*/React.isValidElement(child);
|
|
112
109
|
}).map((child, idx) => {
|
|
113
110
|
var _React$Children$toArr;
|
|
@@ -184,6 +181,7 @@ Breadcrumb.propTypes = {
|
|
|
184
181
|
/** Class for component. */
|
|
185
182
|
data: PropTypes.arrayOf(PropTypes.shape({
|
|
186
183
|
label: PropTypes.string,
|
|
184
|
+
icon: PropTypes.string,
|
|
187
185
|
href: PropTypes.string,
|
|
188
186
|
onClick: PropTypes.func
|
|
189
187
|
})),
|
|
@@ -360,7 +360,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
360
360
|
const length = currentObjectDefault[unique].length;
|
|
361
361
|
let existItemQuantity = 0;
|
|
362
362
|
for (let index = length - 1; index >= 0; index--) {
|
|
363
|
-
if (!dataSourceUsable.some(data => data[valueExpr] === currentObjectDefault[unique][index][valueExpr])) {
|
|
363
|
+
if ((currentObjectDefault[unique][index][valueExpr] || currentObjectDefault[unique][index][valueExpr] === 0) && !dataSourceUsable.some(data => data[valueExpr] === currentObjectDefault[unique][index][valueExpr])) {
|
|
364
364
|
dataSourceUsable.unshift(currentObjectDefault[unique][index]);
|
|
365
365
|
} else {
|
|
366
366
|
// Nếu số lượng phần tử của valueObjectDefault tồn tại trong dataSource nhiều hơn hoặc bằng limit thì không remove nữa
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { css, jsx, keyframes } from '@emotion/core';
|
|
4
|
-
import
|
|
4
|
+
import ImageDefault from "../../assets/image/default.jpg";
|
|
5
5
|
import OptionWrapper from "../others/option-wrapper";
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { forwardRef, Fragment, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
8
|
-
import { borderRadius, displayInlineFlex, itemsCenter, objectCover, overflowHidden, parseWidthHeight, positionRelative } from "../../styles/general";
|
|
8
|
+
import { animation, borderRadius, displayInlineFlex, itemsCenter, objectCover, overflowHidden, parseWidthHeight, positionRelative } from "../../styles/general";
|
|
9
9
|
import { classNames, useIntersection } from "../../utils";
|
|
10
10
|
const blurKeyframe = keyframes`
|
|
11
11
|
0% { -webkit-filter: blur(4px);}
|
|
@@ -29,7 +29,7 @@ const Image = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
29
29
|
width
|
|
30
30
|
}, reference) => {
|
|
31
31
|
if (!reference) reference = useRef(null);
|
|
32
|
-
if (!defaultSrc) defaultSrc =
|
|
32
|
+
if (!defaultSrc) defaultSrc = ImageDefault;
|
|
33
33
|
const ref = useRef(null);
|
|
34
34
|
const [srcState, setSrcState] = useState(src);
|
|
35
35
|
const [isInView, setIsInView] = useState(false);
|
|
@@ -106,7 +106,10 @@ const ImageCSS = (width, height, circular) => css`
|
|
|
106
106
|
${circular && borderRadius('50%')};
|
|
107
107
|
`;
|
|
108
108
|
const blurAnimationCSS = css`
|
|
109
|
-
|
|
109
|
+
${animation({
|
|
110
|
+
keyframes: blurKeyframe,
|
|
111
|
+
duration: '1s'
|
|
112
|
+
})}
|
|
110
113
|
`;
|
|
111
114
|
Image.defaultProps = {
|
|
112
115
|
circular: false,
|
|
@@ -7,7 +7,7 @@ import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useS
|
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { animations } from "../../styles/animation";
|
|
9
9
|
import { bgColor, borderRadius, boxBorder, cursorMove, displayFlex, flexCol, flexRow, justifyCenter, left, parseMaxWidthHeight, parseMinWidth, parseWidthHeight, pdt, positionAbsolute, positionRelative, top } from "../../styles/general";
|
|
10
|
-
import { useTheme } from "../../theme";
|
|
10
|
+
import { makeStyles, useTheme } from "../../theme";
|
|
11
11
|
import { classNames, useDelayUnmount } from "../../utils";
|
|
12
12
|
import ModalContext from "./context";
|
|
13
13
|
const {
|
|
@@ -16,6 +16,12 @@ const {
|
|
|
16
16
|
},
|
|
17
17
|
zIndex: zIndexCORE
|
|
18
18
|
} = useTheme();
|
|
19
|
+
const useStyles = makeStyles({
|
|
20
|
+
noScroll: {
|
|
21
|
+
key: props => `DGN-Modal-${props}`,
|
|
22
|
+
overflow: 'hidden'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
19
25
|
const fadeInDown = animations.fadeInDown;
|
|
20
26
|
const fadeOutUp = animations.fadeOutUp;
|
|
21
27
|
const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
@@ -38,7 +44,8 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
38
44
|
}, reference) => {
|
|
39
45
|
if (!reference) reference = useRef(null);
|
|
40
46
|
const ref = useRef(null);
|
|
41
|
-
|
|
47
|
+
|
|
48
|
+
// const overflow = useRef(null);
|
|
42
49
|
const modalBoxRef = useRef(null);
|
|
43
50
|
const [openState, setOpenState] = useState(open);
|
|
44
51
|
const showModal = useDelayUnmount(openState, 200);
|
|
@@ -48,7 +55,6 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
48
55
|
setOpenState(true);
|
|
49
56
|
};
|
|
50
57
|
const onCloseModal = () => {
|
|
51
|
-
document.body.style.overflow = overflow.current; // reset overflow of <body /> before open modal
|
|
52
58
|
onClose && onClose();
|
|
53
59
|
setOpenState(false);
|
|
54
60
|
};
|
|
@@ -109,36 +115,34 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
109
115
|
modalBoxRef.current.style.left = newLeft + 'px';
|
|
110
116
|
};
|
|
111
117
|
};
|
|
112
|
-
useEffect(() => {
|
|
113
|
-
return () => {
|
|
114
|
-
document.body.style.overflow = overflow.current; // reset overflow of <body /> before open modal
|
|
115
|
-
};
|
|
116
|
-
}, []);
|
|
117
118
|
useEffect(() => {
|
|
118
119
|
setOpenState(open);
|
|
119
120
|
}, [open]);
|
|
120
121
|
useEffect(() => {
|
|
121
|
-
if (openState) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
ref.current.focus();
|
|
131
|
-
}
|
|
122
|
+
if (openState && ref.current) {
|
|
123
|
+
const modals = document.querySelectorAll('.DGN-UI-Modal');
|
|
124
|
+
if (!darkTheme && modals && modals.length > 1) {
|
|
125
|
+
ref.current.style.backgroundColor = 'transparent';
|
|
126
|
+
}
|
|
127
|
+
if (autoFocus) {
|
|
128
|
+
if (!ref.current.contains(document.activeElement)) {
|
|
129
|
+
ref.current.tabIndex = -1;
|
|
130
|
+
ref.current.focus();
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
const timestamp = Date.now();
|
|
134
|
+
const classes = useStyles(timestamp);
|
|
135
|
+
const noScrollClass = classes.noScroll.split(' ');
|
|
136
|
+
document.body.classList.add(...noScrollClass);
|
|
137
|
+
// overflow.current = document.body.style.overflow; // overflow of <body /> before open modal
|
|
138
|
+
// document.body.style.overflow = 'hidden';
|
|
136
139
|
// Allow press ESC to close popup
|
|
137
140
|
if (pressESCToClose) {
|
|
138
141
|
document.addEventListener('keydown', pressESCHandler);
|
|
139
142
|
}
|
|
140
143
|
return () => {
|
|
141
|
-
document.body.
|
|
144
|
+
document.body.classList.remove(...noScrollClass);
|
|
145
|
+
// document.body.style.overflow = overflow.current; // reset overflow of <body /> before open modal
|
|
142
146
|
if (pressESCToClose) {
|
|
143
147
|
document.removeEventListener('keydown', pressESCHandler);
|
|
144
148
|
}
|
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import React, { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { bgColor, borderBottom, borderRadius4px, displayFlex, displayNone, flexCol, inset, justifyBetween, overflowAuto, parseMaxWidthHeight, parseMinWidthHeight, parseWidthHeight, pointerEventsInitial, pointerEventsNone, positionAbsolute, positionFixed, positionRelative } from "../../styles/general";
|
|
9
|
-
import { useTheme } from "../../theme";
|
|
9
|
+
import { makeStyles, useTheme } from "../../theme";
|
|
10
10
|
import { classNames, isMobile, refType as ref } from "../../utils";
|
|
11
11
|
const {
|
|
12
12
|
typography: {
|
|
@@ -15,6 +15,12 @@ const {
|
|
|
15
15
|
spacing,
|
|
16
16
|
zIndex: zIndexCORE
|
|
17
17
|
} = useTheme();
|
|
18
|
+
const useStyles = makeStyles({
|
|
19
|
+
noScroll: {
|
|
20
|
+
key: props => `DGN-Popover-${props}`,
|
|
21
|
+
overflow: 'hidden'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
const eventMap = new Map([['click', ['click']], ['hover', ['mouseenter', 'mouseleave']], ['focus', ['focus', 'blur']]]);
|
|
19
25
|
const getArrowPosition = (anchorOrigin, transformOrigin, translate) => {
|
|
20
26
|
if (anchorOrigin.horizontal === 'right' && transformOrigin.horizontal === 'left') {
|
|
@@ -139,7 +145,7 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
139
145
|
if (isMobile.any() && trigger === 'hover') trigger = 'click';
|
|
140
146
|
const ref = useRef(null);
|
|
141
147
|
const arrowRef = useRef(null);
|
|
142
|
-
const overflow = useRef(null);
|
|
148
|
+
// const overflow = useRef(null);
|
|
143
149
|
const anchorRef = useRef(anchor);
|
|
144
150
|
const [openState, setOpenState] = useState(open);
|
|
145
151
|
const [element, setElement] = useState(null);
|
|
@@ -406,10 +412,14 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
406
412
|
}, [open]);
|
|
407
413
|
useEffect(() => {
|
|
408
414
|
if (openState && ref.current) {
|
|
409
|
-
if (document.body.style.overflow !== 'hidden') {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
}
|
|
415
|
+
// if (document.body.style.overflow !== 'hidden') {
|
|
416
|
+
// overflow.current = document.body.style.overflow; // store overflow of <body /> before open
|
|
417
|
+
// document.body.style.overflow = 'hidden';
|
|
418
|
+
// }
|
|
419
|
+
const timestamp = Date.now();
|
|
420
|
+
const classes = useStyles(timestamp);
|
|
421
|
+
const noScrollClass = classes.noScroll.split(' ');
|
|
422
|
+
document.body.classList.add(...noScrollClass);
|
|
413
423
|
// Position's anchor
|
|
414
424
|
updatePositionPopover();
|
|
415
425
|
|
|
@@ -424,7 +434,8 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
424
434
|
window.addEventListener('resize', updatePositionPopover);
|
|
425
435
|
if (trigger === 'hover') ref.current.addEventListener('mouseleave', handleEventTrigger, false);
|
|
426
436
|
return () => {
|
|
427
|
-
document.body.
|
|
437
|
+
document.body.classList.remove(...noScrollClass);
|
|
438
|
+
// document.body.style.overflow = overflow.current; // reset overflow of <body /> before open
|
|
428
439
|
if (pressESCToClose) {
|
|
429
440
|
document.removeEventListener('keydown', pressESCHandler);
|
|
430
441
|
}
|
|
@@ -432,9 +443,10 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
432
443
|
window.removeEventListener('resize', updatePositionPopover);
|
|
433
444
|
if (trigger === 'hover' && ref.current) ref.current.removeEventListener('mouseleave', handleEventTrigger, false);
|
|
434
445
|
};
|
|
435
|
-
} else if (!openState) {
|
|
436
|
-
document.documentElement.style.overflow = overflow.current;
|
|
437
446
|
}
|
|
447
|
+
// else if (!openState) {
|
|
448
|
+
// document.documentElement.style.overflow = overflow.current;
|
|
449
|
+
// }
|
|
438
450
|
}, [openState]);
|
|
439
451
|
useEffect(() => {
|
|
440
452
|
clickOutsideToClose ? document.addEventListener('click', onClickOutside) : document.removeEventListener('click', onClickOutside);
|
|
@@ -5,24 +5,15 @@ import { Popover } from "./..";
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef, Fragment, memo, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { breakAll, breakWord, cursorPointer, displayBlock, displayInlineBlock, italic, overflowHidden, parseHeight, parseMaxWidth, parseMinWidth, pd, positionRelative, textCapitalize, textCenter, textColor, textLineThrough, textLowercase, textSentence, textUnderline, textUppercase, whiteSpaceBreakSpaces } from "../../styles/general";
|
|
8
|
-
import {
|
|
8
|
+
import { useTypography as typography } from "../../theme";
|
|
9
9
|
import { classNames, renderHTML } from "../../utils";
|
|
10
|
-
const
|
|
11
|
-
colors: {
|
|
12
|
-
text: {
|
|
13
|
-
main: textMain
|
|
14
|
-
},
|
|
15
|
-
fill: {
|
|
16
|
-
tooltip: fillTooltip
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
} = useTheme();
|
|
20
|
-
const colorMap = new Map([['default', textMain]]);
|
|
10
|
+
const colorMap = new Map([['default', 'text/main']]);
|
|
21
11
|
const formatMap = new Map([['capitalize', textCapitalize], ['uppercase', textUppercase], ['lowercase', textLowercase], ['italic', italic], ['line-through', textLineThrough], ['underline', textUnderline], ['sentence', textSentence]]);
|
|
22
12
|
const isTextClamped = elm => (elm === null || elm === void 0 ? void 0 : elm.scrollHeight) > (elm === null || elm === void 0 ? void 0 : elm.clientHeight);
|
|
23
13
|
const Typography = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
24
14
|
action = {},
|
|
25
15
|
capitalize,
|
|
16
|
+
// deprecated
|
|
26
17
|
center,
|
|
27
18
|
children,
|
|
28
19
|
className,
|
|
@@ -37,17 +28,20 @@ const Typography = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
37
28
|
tooltipDirection,
|
|
38
29
|
type,
|
|
39
30
|
uppercase,
|
|
31
|
+
// deprecated
|
|
40
32
|
...props
|
|
41
33
|
}, reference) => {
|
|
42
34
|
var _ref$current;
|
|
43
35
|
if (!reference) reference = useRef(null);
|
|
44
36
|
const ref = useRef(null);
|
|
45
37
|
const formatCSS = [];
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
if (Array.isArray(format)) {
|
|
39
|
+
format.forEach(item => {
|
|
40
|
+
formatCSS.push(formatMap.get(item));
|
|
41
|
+
});
|
|
42
|
+
}
|
|
49
43
|
const [openTooltip, setOpenTooltip] = useState(false);
|
|
50
|
-
const _TextRootCSS = [TextRootCSS(color, type, lineClamp, onClick, hoverTooltip), ...formatCSS];
|
|
44
|
+
const _TextRootCSS = [TextRootCSS(color, type, lineClamp, onClick, hoverTooltip, center, fullWidth, uppercase, capitalize), ...formatCSS];
|
|
51
45
|
const showTooltip = () => {
|
|
52
46
|
if (!hoverTooltip) return;
|
|
53
47
|
if (isTextClamped(ref.current)) {
|
|
@@ -70,26 +64,26 @@ const Typography = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
70
64
|
currentRef.instance = _instance;
|
|
71
65
|
return currentRef;
|
|
72
66
|
});
|
|
73
|
-
const classes =
|
|
67
|
+
const classes = classNames('DGN-UI-Typography', `DGN-UI-Typography-${type}`, className);
|
|
74
68
|
const content = Array.isArray(children) && !children.some(node => node && String(node.$$typeof) === 'Symbol(react.element)') ? children.join('') : children;
|
|
75
69
|
const renderTooltip = hoverTooltip ? jsx(Popover, {
|
|
76
|
-
css:
|
|
70
|
+
css: parseMinWidth(300),
|
|
77
71
|
open: openTooltip,
|
|
78
72
|
pressESCToClose: false,
|
|
79
73
|
fullScreen: false,
|
|
80
|
-
bgColor:
|
|
74
|
+
bgColor: 'fill/tooltip',
|
|
81
75
|
anchor: ref,
|
|
82
76
|
width: ((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.clientWidth) || 'max-content',
|
|
83
77
|
direction: tooltipDirection
|
|
84
78
|
}, renderHTML(content, mapping, {
|
|
85
79
|
css: [_TextRootCSS, PopoverContentCSS],
|
|
86
|
-
className: classes
|
|
80
|
+
className: classes
|
|
87
81
|
})) : null;
|
|
88
82
|
return useMemo(() => {
|
|
89
83
|
return jsx(Fragment, null, renderHTML(content, mapping, {
|
|
90
84
|
ref: ref,
|
|
91
|
-
css: _TextRootCSS,
|
|
92
|
-
className: classes
|
|
85
|
+
css: [_TextRootCSS, lineClamp && ClampCSS(lineClamp)],
|
|
86
|
+
className: classes,
|
|
93
87
|
onMouseEnter: showTooltip,
|
|
94
88
|
onMouseLeave: hideTooltip,
|
|
95
89
|
onClick: onClick,
|
|
@@ -97,7 +91,7 @@ const Typography = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
97
91
|
}), renderTooltip);
|
|
98
92
|
}, [capitalize, center, children, className, color, format, fullWidth, hoverTooltip, italic, lineClamp, mapping, onClick, props, tooltipDirection, type, uppercase, openTooltip]);
|
|
99
93
|
}));
|
|
100
|
-
const TextRootCSS = (color, type, lineClamp, onClick, hoverTooltip) => css`
|
|
94
|
+
const TextRootCSS = (color, type, lineClamp, onClick, hoverTooltip, center, fullWidth, uppercase, capitalize) => css`
|
|
101
95
|
${displayInlineBlock};
|
|
102
96
|
${positionRelative};
|
|
103
97
|
${onClick && cursorPointer};
|
|
@@ -106,28 +100,22 @@ const TextRootCSS = (color, type, lineClamp, onClick, hoverTooltip) => css`
|
|
|
106
100
|
${textColor(colorMap.get(color) || color)};
|
|
107
101
|
${parseMaxWidth('max-content')};
|
|
108
102
|
${type !== 'inherit' && typography[type]};
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
103
|
+
${center && textCenter};
|
|
104
|
+
${uppercase && textUppercase};
|
|
105
|
+
${capitalize && textCapitalize};
|
|
106
|
+
${fullWidth && css`
|
|
113
107
|
${displayBlock};
|
|
114
108
|
${parseMaxWidth('initial')};
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
&.DGN-Typography-Clamp {
|
|
123
|
-
${overflowHidden};
|
|
124
|
-
display: -webkit-box;
|
|
125
|
-
-webkit-line-clamp: ${lineClamp};
|
|
126
|
-
-webkit-box-orient: vertical;
|
|
127
|
-
}
|
|
109
|
+
`}
|
|
110
|
+
`;
|
|
111
|
+
const ClampCSS = lineClamp => css`
|
|
112
|
+
${overflowHidden};
|
|
113
|
+
display: -webkit-box;
|
|
114
|
+
-webkit-line-clamp: ${lineClamp};
|
|
115
|
+
-webkit-box-orient: vertical;
|
|
128
116
|
`;
|
|
129
117
|
const PopoverContentCSS = css`
|
|
130
|
-
${textColor('text
|
|
118
|
+
${textColor('text/tooltip')};
|
|
131
119
|
${pd([1, 1.5])};
|
|
132
120
|
${parseHeight('fit-content')};
|
|
133
121
|
`;
|
package/package.json
CHANGED
package/utils/renderHTML.js
CHANGED
|
@@ -11,7 +11,7 @@ const renderHTML = (text = null, TagName = 'div', options = {}) => {
|
|
|
11
11
|
return jsx(TagName, {
|
|
12
12
|
...options,
|
|
13
13
|
dangerouslySetInnerHTML: {
|
|
14
|
-
__html: parseTextToHTML(String(text))
|
|
14
|
+
__html: parseTextToHTML(String(text !== null && text !== void 0 ? text : ''))
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
};
|