@dilicorp/ui 1.3.4 → 1.3.6
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/dist/molecules/alert.js +12 -2
- package/dist/molecules/paginate.js +3 -2
- package/package.json +2 -2
- package/package-lock.json +0 -25363
package/dist/molecules/alert.js
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import React, { forwardRef, useCallback, useImperativeHandle, useState } from 'react';
|
|
1
|
+
import React, { forwardRef, useCallback, useImperativeHandle, useRef, useState } from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Button } from '../atoms/button';
|
|
5
5
|
export const Alert = forwardRef((props, ref) => {
|
|
6
|
+
const closingInternallyRef = useRef(false);
|
|
6
7
|
const { children, className, showButton, buttonText = 'Ok', color, onClose } = props;
|
|
7
8
|
const [display, setDisplay] = useState(false);
|
|
8
9
|
const open = useCallback(() => {
|
|
9
10
|
setDisplay(true);
|
|
10
11
|
}, []);
|
|
11
12
|
const close = useCallback(() => {
|
|
13
|
+
if (closingInternallyRef.current) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
closingInternallyRef.current = true;
|
|
12
17
|
setDisplay(false);
|
|
13
|
-
|
|
18
|
+
try {
|
|
19
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
20
|
+
}
|
|
21
|
+
finally {
|
|
22
|
+
closingInternallyRef.current = false;
|
|
23
|
+
}
|
|
14
24
|
}, [onClose]);
|
|
15
25
|
useImperativeHandle(ref, () => ({
|
|
16
26
|
open,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import ReactPagination from '@mpca/react-js-pagination';
|
|
3
4
|
import uriHelper from '../utils/uri-helper';
|
|
4
5
|
import { useLocation, useNavigate } from 'react-router-dom';
|
|
5
6
|
const config = {
|
|
@@ -17,7 +18,7 @@ const config = {
|
|
|
17
18
|
linkClassLast: 'arrow last'
|
|
18
19
|
};
|
|
19
20
|
export const Paginate = (props) => {
|
|
20
|
-
const { activePage, perPage, totalItems,
|
|
21
|
+
const { activePage, perPage, totalItems, from, to, translate = '%1 out of %2 records', onChange } = props;
|
|
21
22
|
const history = useLocation();
|
|
22
23
|
const navigate = useNavigate();
|
|
23
24
|
const search = uriHelper.parse(history.search);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dilicorp/ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"description": "A simple UI design for Dilicorp",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"@fortawesome/free-brands-svg-icons": "^5.15.4",
|
|
64
64
|
"@fortawesome/free-solid-svg-icons": "^5.15.4",
|
|
65
65
|
"@fortawesome/react-fontawesome": "^0.1.16",
|
|
66
|
+
"@mpca/react-js-pagination": "^0.0.1",
|
|
66
67
|
"flatted": "^3.2.7",
|
|
67
68
|
"formik": "^2.2.9",
|
|
68
69
|
"immutability-helper": "^3.1.1",
|
|
@@ -72,7 +73,6 @@
|
|
|
72
73
|
"react-dnd-html5-backend": "^16.0.1",
|
|
73
74
|
"react-dropzone": "^11.4.2",
|
|
74
75
|
"react-input-mask": "^2.0.4",
|
|
75
|
-
"react-js-pagination": "^3.0.3",
|
|
76
76
|
"react-loading-skeleton": "^3.3.1",
|
|
77
77
|
"react-select": "^5.2.1",
|
|
78
78
|
"react-text-mask": "^5.5.0",
|