diginet-core-ui 1.4.7 → 1.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/avatar/index.js +3 -5
- package/components/card/body.js +17 -2
- package/components/card/extra.js +17 -2
- package/components/card/footer.js +17 -2
- package/components/card/header.js +17 -2
- package/components/card/index.js +17 -2
- package/components/chip/index.js +2 -1
- package/components/form-control/calendar/function.js +3 -2
- package/components/form-control/date-picker/index.js +1 -1
- package/components/form-control/date-range-picker/index.js +1 -1
- package/components/modal/modal.js +8 -6
- package/components/others/option-wrapper/index.js +3 -3
- package/components/paging/page-info.js +3 -1
- package/package.json +1 -1
- package/readme.md +6 -0
- package/styles/general.js +2 -1
- package/utils/render-portal.js +1 -1
|
@@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import { forwardRef, Fragment, isValidElement, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
10
10
|
import { borderNone, borderRadius, boxContent, cursorInherit, cursorPointer, displayBlock, displayFlex, displayInlineFlex, displayNone, flexCol, itemsCenter, overflowHidden, parseMinWidth, parseWidthHeight, pd, positionAbsolute, positionRelative, userSelectNone, z } from "../../styles/general";
|
|
11
11
|
import { useTheme } from "../../theme";
|
|
12
|
-
import { classNames, isMobile } from "../../utils";
|
|
12
|
+
import { classNames, isMobile, refType as ref } from "../../utils";
|
|
13
13
|
const {
|
|
14
14
|
colors: {
|
|
15
15
|
system: {
|
|
@@ -364,7 +364,7 @@ Avatar.propTypes = {
|
|
|
364
364
|
/** the error to show on wrong type */
|
|
365
365
|
wrongTypeError: PropTypes.string,
|
|
366
366
|
/**
|
|
367
|
-
* ref methods
|
|
367
|
+
* ref methods (ref.current.instance.*method*)
|
|
368
368
|
*
|
|
369
369
|
* * option(): Gets all UI component properties
|
|
370
370
|
* * Returns value - object
|
|
@@ -377,9 +377,7 @@ Avatar.propTypes = {
|
|
|
377
377
|
* * option(options): Updates the values of several properties
|
|
378
378
|
* * @param {options} - object
|
|
379
379
|
*/
|
|
380
|
-
|
|
381
|
-
current: PropTypes.instanceOf(Element)
|
|
382
|
-
})])
|
|
380
|
+
ref: ref
|
|
383
381
|
};
|
|
384
382
|
export { Avatar };
|
|
385
383
|
export default OptionWrapper(Avatar);
|
package/components/card/body.js
CHANGED
|
@@ -4,7 +4,7 @@ import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
-
import { classNames } from "../../utils";
|
|
7
|
+
import { classNames, refType as ref } from "../../utils";
|
|
8
8
|
const CardBody = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
9
|
action = {},
|
|
10
10
|
children,
|
|
@@ -45,7 +45,22 @@ CardBody.propTypes = {
|
|
|
45
45
|
/** If `true`, will have divider between body and footer. */
|
|
46
46
|
style: PropTypes.object,
|
|
47
47
|
/** The title of the component's header. */
|
|
48
|
-
title: PropTypes.string
|
|
48
|
+
title: PropTypes.string,
|
|
49
|
+
/**
|
|
50
|
+
* ref methods (ref.current.instance.*method*)
|
|
51
|
+
*
|
|
52
|
+
* * option(): Gets all UI component properties
|
|
53
|
+
* * Returns value - object
|
|
54
|
+
* * option(optionName): Gets the value of a single property
|
|
55
|
+
* * @param {optionName} - string
|
|
56
|
+
* * Returns value - any
|
|
57
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
58
|
+
* * @param {optionName} - string
|
|
59
|
+
* * @param {optionValue} - any
|
|
60
|
+
* * option(options): Updates the values of several properties
|
|
61
|
+
* * @param {options} - object
|
|
62
|
+
*/
|
|
63
|
+
ref: ref
|
|
49
64
|
};
|
|
50
65
|
export { CardBody };
|
|
51
66
|
export default OptionWrapper(CardBody);
|
package/components/card/extra.js
CHANGED
|
@@ -4,7 +4,7 @@ import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
-
import { classNames } from "../../utils";
|
|
7
|
+
import { classNames, refType as ref } from "../../utils";
|
|
8
8
|
const CardExtra = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
9
|
action = {},
|
|
10
10
|
children,
|
|
@@ -45,7 +45,22 @@ CardExtra.propTypes = {
|
|
|
45
45
|
/** If `true`, will have divider between body and footer. */
|
|
46
46
|
style: PropTypes.object,
|
|
47
47
|
/** The title of the component's header. */
|
|
48
|
-
title: PropTypes.string
|
|
48
|
+
title: PropTypes.string,
|
|
49
|
+
/**
|
|
50
|
+
* ref methods (ref.current.instance.*method*)
|
|
51
|
+
*
|
|
52
|
+
* * option(): Gets all UI component properties
|
|
53
|
+
* * Returns value - object
|
|
54
|
+
* * option(optionName): Gets the value of a single property
|
|
55
|
+
* * @param {optionName} - string
|
|
56
|
+
* * Returns value - any
|
|
57
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
58
|
+
* * @param {optionName} - string
|
|
59
|
+
* * @param {optionValue} - any
|
|
60
|
+
* * option(options): Updates the values of several properties
|
|
61
|
+
* * @param {options} - object
|
|
62
|
+
*/
|
|
63
|
+
ref: ref
|
|
49
64
|
};
|
|
50
65
|
export { CardExtra };
|
|
51
66
|
export default OptionWrapper(CardExtra);
|
|
@@ -4,7 +4,7 @@ import { memo, useRef, useMemo, forwardRef, useImperativeHandle } from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import OptionWrapper from "../others/option-wrapper";
|
|
7
|
-
import { classNames } from "../../utils";
|
|
7
|
+
import { classNames, refType as ref } from "../../utils";
|
|
8
8
|
const CardFooter = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
9
9
|
action = {},
|
|
10
10
|
children,
|
|
@@ -45,7 +45,22 @@ CardFooter.propTypes = {
|
|
|
45
45
|
/** If `true`, will have divider between body and footer. */
|
|
46
46
|
style: PropTypes.object,
|
|
47
47
|
/** The title of the component's header. */
|
|
48
|
-
title: PropTypes.string
|
|
48
|
+
title: PropTypes.string,
|
|
49
|
+
/**
|
|
50
|
+
* ref methods (ref.current.instance.*method*)
|
|
51
|
+
*
|
|
52
|
+
* * option(): Gets all UI component properties
|
|
53
|
+
* * Returns value - object
|
|
54
|
+
* * option(optionName): Gets the value of a single property
|
|
55
|
+
* * @param {optionName} - string
|
|
56
|
+
* * Returns value - any
|
|
57
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
58
|
+
* * @param {optionName} - string
|
|
59
|
+
* * @param {optionValue} - any
|
|
60
|
+
* * option(options): Updates the values of several properties
|
|
61
|
+
* * @param {options} - object
|
|
62
|
+
*/
|
|
63
|
+
ref: ref
|
|
49
64
|
};
|
|
50
65
|
export { CardFooter };
|
|
51
66
|
export default OptionWrapper(CardFooter);
|
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { jsx } from '@emotion/core';
|
|
6
6
|
import OptionWrapper from "../others/option-wrapper";
|
|
7
7
|
import Typography from "../typography";
|
|
8
|
-
import { classNames } from "../../utils";
|
|
8
|
+
import { classNames, refType as ref } from "../../utils";
|
|
9
9
|
const CardHeader = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
10
10
|
action = {},
|
|
11
11
|
children,
|
|
@@ -48,7 +48,22 @@ CardHeader.propTypes = {
|
|
|
48
48
|
/** If `true`, will have divider between body and footer. */
|
|
49
49
|
style: PropTypes.object,
|
|
50
50
|
/** The title of the component's header. */
|
|
51
|
-
title: PropTypes.string
|
|
51
|
+
title: PropTypes.string,
|
|
52
|
+
/**
|
|
53
|
+
* ref methods (ref.current.instance.*method*)
|
|
54
|
+
*
|
|
55
|
+
* * option(): Gets all UI component properties
|
|
56
|
+
* * Returns value - object
|
|
57
|
+
* * option(optionName): Gets the value of a single property
|
|
58
|
+
* * @param {optionName} - string
|
|
59
|
+
* * Returns value - any
|
|
60
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
61
|
+
* * @param {optionName} - string
|
|
62
|
+
* * @param {optionValue} - any
|
|
63
|
+
* * option(options): Updates the values of several properties
|
|
64
|
+
* * @param {options} - object
|
|
65
|
+
*/
|
|
66
|
+
ref: ref
|
|
52
67
|
};
|
|
53
68
|
export { CardHeader };
|
|
54
69
|
export default OptionWrapper(CardHeader);
|
package/components/card/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import CardHeader from "./header";
|
|
|
10
10
|
import { CardFooter } from "./footer";
|
|
11
11
|
import { CardBody } from "./body";
|
|
12
12
|
import { getColor } from "../../styles/utils";
|
|
13
|
-
import { classNames } from "../../utils";
|
|
13
|
+
import { classNames, refType as ref } from "../../utils";
|
|
14
14
|
const {
|
|
15
15
|
colors: {
|
|
16
16
|
system: {
|
|
@@ -173,7 +173,22 @@ Card.propTypes = {
|
|
|
173
173
|
/** The title of the component's header. */
|
|
174
174
|
title: PropTypes.string,
|
|
175
175
|
/** Width of the component. */
|
|
176
|
-
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
176
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
177
|
+
/**
|
|
178
|
+
* ref methods (ref.current.instance.*method*)
|
|
179
|
+
*
|
|
180
|
+
* * option(): Gets all UI component properties
|
|
181
|
+
* * Returns value - object
|
|
182
|
+
* * option(optionName): Gets the value of a single property
|
|
183
|
+
* * @param {optionName} - string
|
|
184
|
+
* * Returns value - any
|
|
185
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
186
|
+
* * @param {optionName} - string
|
|
187
|
+
* * @param {optionValue} - any
|
|
188
|
+
* * option(options): Updates the values of several properties
|
|
189
|
+
* * @param {options} - object
|
|
190
|
+
*/
|
|
191
|
+
ref: ref
|
|
177
192
|
};
|
|
178
193
|
export { Card };
|
|
179
194
|
export default OptionWrapper(Card);
|
package/components/chip/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { jsx, css } from '@emotion/core';
|
|
6
6
|
import { ButtonIcon, Typography } from "../";
|
|
7
7
|
import Icon from "../../icons";
|
|
8
|
-
import { itemsCenter, border, boxBorder, flexRow, displayInlineFlex, justifyCenter, positionRelative, userSelectNone, cursorNotAllowed, positionAbsolute, overflowHidden } from "../../styles/general";
|
|
8
|
+
import { itemsCenter, border, boxBorder, flexRow, displayInlineFlex, justifyCenter, positionRelative, userSelectNone, cursorNotAllowed, positionAbsolute, overflowHidden, pointerEventsNone } from "../../styles/general";
|
|
9
9
|
import { hexToRGBA } from "../../styles/color-helper";
|
|
10
10
|
import { useTheme, useColor as colors } from "../../theme";
|
|
11
11
|
const {
|
|
@@ -183,6 +183,7 @@ const ChipRootCSS = (onClick, onDbClick, colorProps, info) => css`
|
|
|
183
183
|
content: '';
|
|
184
184
|
width: 100%;
|
|
185
185
|
height: 100%;
|
|
186
|
+
${pointerEventsNone};
|
|
186
187
|
}
|
|
187
188
|
&:hover::after,
|
|
188
189
|
&:focus::after {
|
|
@@ -5,7 +5,7 @@ import { Button, ButtonIcon, Typography } from "../..";
|
|
|
5
5
|
import { getGlobal } from "../../../global";
|
|
6
6
|
import locale from "../../../locale";
|
|
7
7
|
import { render } from 'react-dom';
|
|
8
|
-
import { bgColor, border, borderRadius, boxBorder, cursorDefault, cursorPointer, displayFlex, flexCol, flexRow,
|
|
8
|
+
import { bgColor, border, borderRadius, boxBorder, cursorDefault, cursorPointer, displayFlex, flexCol, flexRow, insetX, insetY, itemsCenter, justifyBetween, mg, mgt, parseHeight, parseMaxWidth, parseMinWidth, parseWidth, parseWidthHeight, pd, pointerEventsNone, positionAbsolute, positionRelative, textCenter, textColor, userSelectNone } from "../../../styles/general";
|
|
9
9
|
import { useTheme } from "../../../theme";
|
|
10
10
|
import { date as moment } from "../../../utils";
|
|
11
11
|
const {
|
|
@@ -131,7 +131,8 @@ const generateCalendarCSS = (unique, boxShadow = true, onClickActive = true) =>
|
|
|
131
131
|
}
|
|
132
132
|
::before {
|
|
133
133
|
${positionAbsolute};
|
|
134
|
-
${
|
|
134
|
+
${insetY(1)};
|
|
135
|
+
${insetX(-2)};
|
|
135
136
|
content: '';
|
|
136
137
|
}
|
|
137
138
|
}
|
|
@@ -511,7 +511,7 @@ const ControlContainerCSS = css`
|
|
|
511
511
|
${mg([0, 4, 4])};
|
|
512
512
|
`;
|
|
513
513
|
const PickerCSS = {
|
|
514
|
-
backGr: `background-color: transparent;
|
|
514
|
+
backGr: `background-color: transparent; top: 0px; bottom: 0px; left: 0px; right: 0px; pointer-events: auto; position: fixed; z-index: ${zIndexCORE(1)};`,
|
|
515
515
|
picker: (position, positionLeft, width) => css`
|
|
516
516
|
${positionFixed};
|
|
517
517
|
${borderRadius4px};
|
|
@@ -1024,7 +1024,7 @@ const ControlContainerCSS = css`
|
|
|
1024
1024
|
const pickerCSS = {
|
|
1025
1025
|
backGr: `
|
|
1026
1026
|
background-color: transparent;
|
|
1027
|
-
|
|
1027
|
+
top: 0px; bottom: 0px; left: 0px; right: 0px; pointer-events: auto;
|
|
1028
1028
|
position: fixed;
|
|
1029
1029
|
z-index: ${zIndexCORE(1)};`,
|
|
1030
1030
|
container: css`
|
|
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
7
7
|
import { createPortal } from 'react-dom';
|
|
8
8
|
import { animations } from "../../styles/animation";
|
|
9
|
-
import { bgColor, borderRadius, boxBorder, cursorMove, displayFlex, flexCol, flexRow, justifyCenter, left, parseMaxWidthHeight, parseMinWidth, parseWidthHeight, pdt, positionAbsolute, positionRelative, top } from "../../styles/general";
|
|
9
|
+
import { bgColor, borderRadius, boxBorder, cursorMove, displayFlex, flexCol, flexRow, inset, justifyCenter, left, parseMaxWidthHeight, parseMinWidth, parseWidthHeight, pdt, positionAbsolute, positionFixed, positionRelative, top } from "../../styles/general";
|
|
10
10
|
import { makeStyles, useTheme } from "../../theme";
|
|
11
11
|
import { classNames, useDelayUnmount } from "../../utils";
|
|
12
12
|
import ModalContext from "./context";
|
|
@@ -49,6 +49,7 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
49
49
|
const modalBoxRef = useRef(null);
|
|
50
50
|
const [openState, setOpenState] = useState(open);
|
|
51
51
|
const showModal = useDelayUnmount(openState, 200);
|
|
52
|
+
const _ModalCSS = ModalCSS(zIndex);
|
|
52
53
|
const _ModalContainerCSS = ModalContainerCSS(zIndex, alignment, darkTheme);
|
|
53
54
|
const _ModalBoxCSS = ModalBoxCSS(width, moveable, dragAnyWhere);
|
|
54
55
|
const onShowModal = () => {
|
|
@@ -163,11 +164,7 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
163
164
|
if (showModal) {
|
|
164
165
|
const node = jsx("div", {
|
|
165
166
|
className: 'DGN-UI-Portal DGN-UI-Modal',
|
|
166
|
-
|
|
167
|
-
position: 'fixed',
|
|
168
|
-
zIndex,
|
|
169
|
-
inset: 0
|
|
170
|
-
}
|
|
167
|
+
css: _ModalCSS
|
|
171
168
|
}, jsx("div", {
|
|
172
169
|
id: id,
|
|
173
170
|
css: _ModalContainerCSS,
|
|
@@ -191,6 +188,11 @@ const Modal = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
191
188
|
return null;
|
|
192
189
|
}, [alignment, autoFocus, children, className, darkTheme, dragAnyWhere, id, moveable, moveOutScreen, onClose, open, pressESCToClose, style, width, zIndex, openState, showModal]);
|
|
193
190
|
}));
|
|
191
|
+
const ModalCSS = zIndex => css`
|
|
192
|
+
${positionFixed};
|
|
193
|
+
z-index: ${zIndex};
|
|
194
|
+
${inset(0)};
|
|
195
|
+
`;
|
|
194
196
|
const ModalContainerCSS = (zIndex, alignment, darkTheme) => css`
|
|
195
197
|
${displayFlex};
|
|
196
198
|
${flexRow};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import { useState, forwardRef, useEffect } from 'react';
|
|
3
|
+
import { useState, forwardRef, useEffect, memo } from 'react';
|
|
4
4
|
import { jsx } from '@emotion/core';
|
|
5
5
|
import sx from "../../../styles/sx";
|
|
6
6
|
const OptionWrapper = WrappedComponent => {
|
|
7
|
-
return /*#__PURE__*/forwardRef((props, ref) => {
|
|
7
|
+
return /*#__PURE__*/memo( /*#__PURE__*/forwardRef((props, ref) => {
|
|
8
8
|
const [options, setOptions] = useState({});
|
|
9
9
|
const option = (option, optionValue) => {
|
|
10
10
|
if (typeof option === 'undefined') {
|
|
@@ -32,6 +32,6 @@ const OptionWrapper = WrappedComponent => {
|
|
|
32
32
|
ref: ref,
|
|
33
33
|
css: sx(props === null || props === void 0 ? void 0 : props.sx)
|
|
34
34
|
});
|
|
35
|
-
});
|
|
35
|
+
}));
|
|
36
36
|
};
|
|
37
37
|
export default OptionWrapper;
|
|
@@ -273,6 +273,7 @@ const PagingInfo = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
273
273
|
}
|
|
274
274
|
};
|
|
275
275
|
return useMemo(() => {
|
|
276
|
+
var _lastPage$toString;
|
|
276
277
|
const lastPage = getLastPage(totalItemsState, itemsPerPageState);
|
|
277
278
|
let listPerPageData = !listPerPageState.includes(itemsPerPageState) ? [{
|
|
278
279
|
name: itemsPerPageState,
|
|
@@ -348,7 +349,8 @@ const PagingInfo = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
348
349
|
placeholder: '',
|
|
349
350
|
max: lastPage,
|
|
350
351
|
onKeyDown: checkKeyPress,
|
|
351
|
-
onChange: onTypePaging
|
|
352
|
+
onChange: onTypePaging,
|
|
353
|
+
maxDigit: (_lastPage$toString = lastPage.toString()) === null || _lastPage$toString === void 0 ? void 0 : _lastPage$toString.length
|
|
352
354
|
}), "/", jsx(Typography, {
|
|
353
355
|
ref: refs => {
|
|
354
356
|
totalRef.current = refs;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -38,6 +38,12 @@ npm test
|
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
## Changelog
|
|
41
|
+
## 1.4.8
|
|
42
|
+
- \[Changed\]: Storybook – Update storybook of some components
|
|
43
|
+
- \[Fixed\]: General – Fix bug css inset cannot use on Safari below 14
|
|
44
|
+
- \[Fixed\]: PagingInfo – Fix stretch UI NumberInput
|
|
45
|
+
- \[Fixed\]: Chip – Fix clear button cannot with viewType filled
|
|
46
|
+
|
|
41
47
|
## 1.4.7
|
|
42
48
|
- \[Changed\]: Button – Remove attribute disabled in button tag
|
|
43
49
|
|
package/styles/general.js
CHANGED
package/utils/render-portal.js
CHANGED
|
@@ -11,7 +11,7 @@ export const getPortal = () => {
|
|
|
11
11
|
if (portal) return portal;
|
|
12
12
|
const node = document.createElement('div');
|
|
13
13
|
node.id = idPortal;
|
|
14
|
-
node.style.cssText = `position: fixed;
|
|
14
|
+
node.style.cssText = `position: fixed; top: 0px; bottom: 0px; left: 0px; right: 0px; pointer-events: none; z-index: ${zIndex()};`;
|
|
15
15
|
return document.body.appendChild(node);
|
|
16
16
|
};
|
|
17
17
|
export const isLastChildNode = node => {
|