pge-front-common 14.1.13 → 14.1.14
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/lib/components/InformativeBox/index.type.d.ts +6 -6
- package/lib/index.d.ts +5 -5
- package/lib/index.esm.js +20 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +20 -3
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { HtmlHTMLAttributes } from "react";
|
|
2
|
-
export interface InformativeBoxProps extends HtmlHTMLAttributes<HTMLDivElement> {
|
|
3
|
-
infoType:
|
|
4
|
-
widthType?:
|
|
5
|
-
title: string;
|
|
6
|
-
message: string;
|
|
1
|
+
import { HtmlHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
export interface InformativeBoxProps extends Omit<HtmlHTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
|
+
infoType: "success" | "alert" | "warning" | "informative";
|
|
4
|
+
widthType?: "fitContent" | "fullWidth";
|
|
5
|
+
title: string | ReactNode;
|
|
6
|
+
message: string | ReactNode;
|
|
7
7
|
hasDismissButton?: boolean;
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -28,11 +28,11 @@ interface InputBaseProps$1 extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
28
28
|
}
|
|
29
29
|
declare const InputBase: ({ customClass, restrictionMessage, label, leftIcon, rightIcon, onRightIconClick, style, required, error, helperText, disabled, readOnly, className, showCounter, value, ...props }: InputBaseProps$1) => React__default.JSX.Element;
|
|
30
30
|
|
|
31
|
-
interface InformativeBoxProps extends HtmlHTMLAttributes<HTMLDivElement> {
|
|
32
|
-
infoType:
|
|
33
|
-
widthType?:
|
|
34
|
-
title: string;
|
|
35
|
-
message: string;
|
|
31
|
+
interface InformativeBoxProps extends Omit<HtmlHTMLAttributes<HTMLDivElement>, "title"> {
|
|
32
|
+
infoType: "success" | "alert" | "warning" | "informative";
|
|
33
|
+
widthType?: "fitContent" | "fullWidth";
|
|
34
|
+
title: string | ReactNode;
|
|
35
|
+
message: string | ReactNode;
|
|
36
36
|
hasDismissButton?: boolean;
|
|
37
37
|
onClose?: () => void;
|
|
38
38
|
}
|
package/lib/index.esm.js
CHANGED
|
@@ -8468,10 +8468,27 @@ var Blanket = function (props) { return (React__default.createElement("div", __a
|
|
|
8468
8468
|
} }, props))); };
|
|
8469
8469
|
var Dropdown = function (_a) {
|
|
8470
8470
|
var children = _a.children, isOpen = _a.isOpen, target = _a.target, onClose = _a.onClose;
|
|
8471
|
-
|
|
8471
|
+
var dropdownRef = useRef(null);
|
|
8472
|
+
useEffect(function () {
|
|
8473
|
+
var handleClickOutside = function (event) {
|
|
8474
|
+
if (dropdownRef.current &&
|
|
8475
|
+
!dropdownRef.current.contains(event.target)) {
|
|
8476
|
+
onClose();
|
|
8477
|
+
}
|
|
8478
|
+
};
|
|
8479
|
+
if (isOpen) {
|
|
8480
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
8481
|
+
}
|
|
8482
|
+
else {
|
|
8483
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
8484
|
+
}
|
|
8485
|
+
return function () {
|
|
8486
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
8487
|
+
};
|
|
8488
|
+
}, [isOpen, onClose]);
|
|
8489
|
+
return (React__default.createElement("div", { ref: dropdownRef, style: { position: "relative", width: "100%" } },
|
|
8472
8490
|
target,
|
|
8473
|
-
isOpen ? React__default.createElement(Menu, null, children) : null
|
|
8474
|
-
isOpen ? React__default.createElement(Blanket, { onClick: onClose }) : null));
|
|
8491
|
+
isOpen ? React__default.createElement(Menu, null, children) : null));
|
|
8475
8492
|
};
|
|
8476
8493
|
function isArrayContained(subset, superset) {
|
|
8477
8494
|
return subset.every(function (subItem) {
|