siam-ui-utils 3.1.2 → 3.1.4
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/_virtual/index.js +2 -2
- package/dist/custom-input/CustomInputCheckbox.js +1 -2
- package/dist/custom-input/CustomInputCheckbox.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Button.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Button.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/CloseButton.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/CloseButton.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Col.js +3 -3
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Col.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/FormGroup.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/FormGroup.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Input.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Input.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Label.js +3 -3
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Label.js.map +1 -1
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Row.js +2 -2
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Row.js.map +1 -1
- package/dist/react-notifications/index.js +3 -8
- package/dist/react-notifications/index.js.map +1 -1
- package/dist/select/custom-select/index.js +3 -85
- package/dist/select/custom-select/index.js.map +1 -1
- package/package.json +5 -1
- package/dist/_virtual/events.js +0 -6
- package/dist/_virtual/events.js.map +0 -1
- package/dist/_virtual/events2.js +0 -5
- package/dist/_virtual/events2.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +0 -8
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +0 -13
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +0 -8
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +0 -13
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +0 -1
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +0 -9
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +0 -1
- package/dist/node_modules/dom-helpers/esm/addClass.js +0 -10
- package/dist/node_modules/dom-helpers/esm/addClass.js.map +0 -1
- package/dist/node_modules/dom-helpers/esm/hasClass.js +0 -8
- package/dist/node_modules/dom-helpers/esm/hasClass.js.map +0 -1
- package/dist/node_modules/dom-helpers/esm/removeClass.js +0 -16
- package/dist/node_modules/dom-helpers/esm/removeClass.js.map +0 -1
- package/dist/node_modules/events/events.js +0 -372
- package/dist/node_modules/events/events.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/CSSTransition.js +0 -275
- package/dist/node_modules/react-transition-group/esm/CSSTransition.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/Transition.js +0 -441
- package/dist/node_modules/react-transition-group/esm/Transition.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/TransitionGroup.js +0 -146
- package/dist/node_modules/react-transition-group/esm/TransitionGroup.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js +0 -6
- package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/config.js +0 -7
- package/dist/node_modules/react-transition-group/esm/config.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js +0 -100
- package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js +0 -24
- package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js.map +0 -1
- package/dist/node_modules/react-transition-group/esm/utils/reflow.js +0 -7
- package/dist/node_modules/react-transition-group/esm/utils/reflow.js.map +0 -1
- package/dist/react-notifications/Notification.js +0 -73
- package/dist/react-notifications/Notification.js.map +0 -1
- package/dist/react-notifications/NotificationContainer.js +0 -59
- package/dist/react-notifications/NotificationContainer.js.map +0 -1
- package/dist/react-notifications/NotificationManager.js +0 -174
- package/dist/react-notifications/NotificationManager.js.map +0 -1
- package/dist/react-notifications/Notifications.js +0 -72
- package/dist/react-notifications/Notifications.js.map +0 -1
- package/dist/react-notifications/constants.js +0 -26
- package/dist/react-notifications/constants.js.map +0 -1
- package/dist/react-notifications/notifications.css +0 -213
- package/dist/select/custom-select/constants.js +0 -8
- package/dist/select/custom-select/constants.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionGroupContext.js","sources":["../../../../node_modules/react-transition-group/esm/TransitionGroupContext.js"],"sourcesContent":["import React from 'react';\nexport default React.createContext(null);"],"names":[],"mappings":";AACA,MAAA,yBAAe,MAAM,cAAc,IAAI;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../../node_modules/react-transition-group/esm/config.js"],"sourcesContent":["export default {\n disabled: false\n};"],"names":[],"mappings":"AAAA,MAAA,SAAe;AAAA,EACb,UAAU;AACZ;","x_google_ignoreList":[0]}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { isValidElement, cloneElement, Children } from "react";
|
|
2
|
-
function getChildMapping(children, mapFn) {
|
|
3
|
-
var mapper = function mapper2(child) {
|
|
4
|
-
return mapFn && isValidElement(child) ? mapFn(child) : child;
|
|
5
|
-
};
|
|
6
|
-
var result = /* @__PURE__ */ Object.create(null);
|
|
7
|
-
if (children) Children.map(children, function(c) {
|
|
8
|
-
return c;
|
|
9
|
-
}).forEach(function(child) {
|
|
10
|
-
result[child.key] = mapper(child);
|
|
11
|
-
});
|
|
12
|
-
return result;
|
|
13
|
-
}
|
|
14
|
-
function mergeChildMappings(prev, next) {
|
|
15
|
-
prev = prev || {};
|
|
16
|
-
next = next || {};
|
|
17
|
-
function getValueForKey(key) {
|
|
18
|
-
return key in next ? next[key] : prev[key];
|
|
19
|
-
}
|
|
20
|
-
var nextKeysPending = /* @__PURE__ */ Object.create(null);
|
|
21
|
-
var pendingKeys = [];
|
|
22
|
-
for (var prevKey in prev) {
|
|
23
|
-
if (prevKey in next) {
|
|
24
|
-
if (pendingKeys.length) {
|
|
25
|
-
nextKeysPending[prevKey] = pendingKeys;
|
|
26
|
-
pendingKeys = [];
|
|
27
|
-
}
|
|
28
|
-
} else {
|
|
29
|
-
pendingKeys.push(prevKey);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
var i;
|
|
33
|
-
var childMapping = {};
|
|
34
|
-
for (var nextKey in next) {
|
|
35
|
-
if (nextKeysPending[nextKey]) {
|
|
36
|
-
for (i = 0; i < nextKeysPending[nextKey].length; i++) {
|
|
37
|
-
var pendingNextKey = nextKeysPending[nextKey][i];
|
|
38
|
-
childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
childMapping[nextKey] = getValueForKey(nextKey);
|
|
42
|
-
}
|
|
43
|
-
for (i = 0; i < pendingKeys.length; i++) {
|
|
44
|
-
childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
|
|
45
|
-
}
|
|
46
|
-
return childMapping;
|
|
47
|
-
}
|
|
48
|
-
function getProp(child, prop, props) {
|
|
49
|
-
return props[prop] != null ? props[prop] : child.props[prop];
|
|
50
|
-
}
|
|
51
|
-
function getInitialChildMapping(props, onExited) {
|
|
52
|
-
return getChildMapping(props.children, function(child) {
|
|
53
|
-
return cloneElement(child, {
|
|
54
|
-
onExited: onExited.bind(null, child),
|
|
55
|
-
in: true,
|
|
56
|
-
appear: getProp(child, "appear", props),
|
|
57
|
-
enter: getProp(child, "enter", props),
|
|
58
|
-
exit: getProp(child, "exit", props)
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function getNextChildMapping(nextProps, prevChildMapping, onExited) {
|
|
63
|
-
var nextChildMapping = getChildMapping(nextProps.children);
|
|
64
|
-
var children = mergeChildMappings(prevChildMapping, nextChildMapping);
|
|
65
|
-
Object.keys(children).forEach(function(key) {
|
|
66
|
-
var child = children[key];
|
|
67
|
-
if (!isValidElement(child)) return;
|
|
68
|
-
var hasPrev = key in prevChildMapping;
|
|
69
|
-
var hasNext = key in nextChildMapping;
|
|
70
|
-
var prevChild = prevChildMapping[key];
|
|
71
|
-
var isLeaving = isValidElement(prevChild) && !prevChild.props.in;
|
|
72
|
-
if (hasNext && (!hasPrev || isLeaving)) {
|
|
73
|
-
children[key] = cloneElement(child, {
|
|
74
|
-
onExited: onExited.bind(null, child),
|
|
75
|
-
in: true,
|
|
76
|
-
exit: getProp(child, "exit", nextProps),
|
|
77
|
-
enter: getProp(child, "enter", nextProps)
|
|
78
|
-
});
|
|
79
|
-
} else if (!hasNext && hasPrev && !isLeaving) {
|
|
80
|
-
children[key] = cloneElement(child, {
|
|
81
|
-
in: false
|
|
82
|
-
});
|
|
83
|
-
} else if (hasNext && hasPrev && isValidElement(prevChild)) {
|
|
84
|
-
children[key] = cloneElement(child, {
|
|
85
|
-
onExited: onExited.bind(null, child),
|
|
86
|
-
in: prevChild.props.in,
|
|
87
|
-
exit: getProp(child, "exit", nextProps),
|
|
88
|
-
enter: getProp(child, "enter", nextProps)
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
return children;
|
|
93
|
-
}
|
|
94
|
-
export {
|
|
95
|
-
getChildMapping,
|
|
96
|
-
getInitialChildMapping,
|
|
97
|
-
getNextChildMapping,
|
|
98
|
-
mergeChildMappings
|
|
99
|
-
};
|
|
100
|
-
//# sourceMappingURL=ChildMapping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChildMapping.js","sources":["../../../../../node_modules/react-transition-group/esm/utils/ChildMapping.js"],"sourcesContent":["import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\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,OAAO;AAAA,QAClC,IAAI;AAAA,MACZ,CAAO;AAAA,IACH,WAAW,WAAW,WAAW,eAAe,SAAS,GAAG;AAI1D,eAAS,GAAG,IAAI,aAAa,OAAO;AAAA,QAClC,UAAU,SAAS,KAAK,MAAM,KAAK;AAAA,QACnC,IAAI,UAAU,MAAM;AAAA,QACpB,MAAM,QAAQ,OAAO,QAAQ,SAAS;AAAA,QACtC,OAAO,QAAQ,OAAO,SAAS,SAAS;AAAA,MAChD,CAAO;AAAA,IACH;AAAA,EACF,CAAC;AACD,SAAO;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import PropTypes from "prop-types";
|
|
2
|
-
var define_process_env_default = {};
|
|
3
|
-
var timeoutsShape = define_process_env_default.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
4
|
-
enter: PropTypes.number,
|
|
5
|
-
exit: PropTypes.number,
|
|
6
|
-
appear: PropTypes.number
|
|
7
|
-
}).isRequired]) : null;
|
|
8
|
-
var classNamesShape = define_process_env_default.NODE_ENV !== "production" ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
9
|
-
enter: PropTypes.string,
|
|
10
|
-
exit: PropTypes.string,
|
|
11
|
-
active: PropTypes.string
|
|
12
|
-
}), PropTypes.shape({
|
|
13
|
-
enter: PropTypes.string,
|
|
14
|
-
enterDone: PropTypes.string,
|
|
15
|
-
enterActive: PropTypes.string,
|
|
16
|
-
exit: PropTypes.string,
|
|
17
|
-
exitDone: PropTypes.string,
|
|
18
|
-
exitActive: PropTypes.string
|
|
19
|
-
})]) : null;
|
|
20
|
-
export {
|
|
21
|
-
classNamesShape,
|
|
22
|
-
timeoutsShape
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=PropTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PropTypes.js","sources":["../../../../../node_modules/react-transition-group/esm/utils/PropTypes.js"],"sourcesContent":["import PropTypes from 'prop-types';\nexport var timeoutsShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n enter: PropTypes.number,\n exit: PropTypes.number,\n appear: PropTypes.number\n}).isRequired]) : null;\nexport var classNamesShape = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.string, PropTypes.shape({\n enter: PropTypes.string,\n exit: PropTypes.string,\n active: PropTypes.string\n}), PropTypes.shape({\n enter: PropTypes.string,\n enterDone: PropTypes.string,\n enterActive: PropTypes.string,\n exit: PropTypes.string,\n exitDone: PropTypes.string,\n exitActive: PropTypes.string\n})]) : null;"],"names":[],"mappings":";;AACO,IAAI,gBAAgB,2BAAY,aAAa,eAAe,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM;AAAA,EACxH,OAAO,UAAU;AAAA,EACjB,MAAM,UAAU;AAAA,EAChB,QAAQ,UAAU;AACpB,CAAC,EAAE,UAAU,CAAC,IAAI;AACX,IAAI,kBAAkB,2BAAY,aAAa,eAAe,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM;AAAA,EAC1H,OAAO,UAAU;AAAA,EACjB,MAAM,UAAU;AAAA,EAChB,QAAQ,UAAU;AACpB,CAAC,GAAG,UAAU,MAAM;AAAA,EAClB,OAAO,UAAU;AAAA,EACjB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU;AAAA,EACvB,MAAM,UAAU;AAAA,EAChB,UAAU,UAAU;AAAA,EACpB,YAAY,UAAU;AACxB,CAAC,CAAC,CAAC,IAAI;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reflow.js","sources":["../../../../../node_modules/react-transition-group/esm/utils/reflow.js"],"sourcesContent":["export var forceReflow = function forceReflow(node) {\n return node.scrollTop;\n};"],"names":["forceReflow"],"mappings":"AAAU,IAAC,cAAc,SAASA,aAAY,MAAM;AAClD,SAAO,KAAK;AACd;","x_google_ignoreList":[0]}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useEffect } from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import classnames from "../_virtual/index.js";
|
|
5
|
-
const Notification = ({
|
|
6
|
-
title = null,
|
|
7
|
-
type = "info",
|
|
8
|
-
message = null,
|
|
9
|
-
customClassName = "",
|
|
10
|
-
timeOut = 5e3,
|
|
11
|
-
onClick = () => {
|
|
12
|
-
},
|
|
13
|
-
onRequestHide = () => {
|
|
14
|
-
}
|
|
15
|
-
}) => {
|
|
16
|
-
const mounted = useRef(true);
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
mounted.current = true;
|
|
19
|
-
let timer = null;
|
|
20
|
-
if (timeOut !== 0) {
|
|
21
|
-
timer = setTimeout(() => {
|
|
22
|
-
if (mounted.current) requestHide();
|
|
23
|
-
}, timeOut);
|
|
24
|
-
}
|
|
25
|
-
return () => {
|
|
26
|
-
mounted.current = false;
|
|
27
|
-
if (timer) {
|
|
28
|
-
clearTimeout(timer);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}, []);
|
|
32
|
-
const requestHide = () => {
|
|
33
|
-
if (mounted.current && onRequestHide) {
|
|
34
|
-
onRequestHide();
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const handleClick = () => {
|
|
38
|
-
if (onClick) {
|
|
39
|
-
onClick();
|
|
40
|
-
}
|
|
41
|
-
requestHide();
|
|
42
|
-
};
|
|
43
|
-
const className = classnames([
|
|
44
|
-
"notification",
|
|
45
|
-
`notification-${type}`,
|
|
46
|
-
customClassName
|
|
47
|
-
]);
|
|
48
|
-
const titleHtml = title ? /* @__PURE__ */ jsx("h4", { className: "title", children: title }) : null;
|
|
49
|
-
return /* @__PURE__ */ jsx("div", { className, onClick: handleClick, children: /* @__PURE__ */ jsxs("div", { className: "notification-message", role: "alert", children: [
|
|
50
|
-
titleHtml,
|
|
51
|
-
/* @__PURE__ */ jsx("div", { className: "message", children: message })
|
|
52
|
-
] }) });
|
|
53
|
-
};
|
|
54
|
-
Notification.propTypes = {
|
|
55
|
-
type: PropTypes.oneOf([
|
|
56
|
-
"info",
|
|
57
|
-
"success",
|
|
58
|
-
"warning",
|
|
59
|
-
"error",
|
|
60
|
-
"primary",
|
|
61
|
-
"secondary"
|
|
62
|
-
]),
|
|
63
|
-
title: PropTypes.node,
|
|
64
|
-
message: PropTypes.node,
|
|
65
|
-
timeOut: PropTypes.number,
|
|
66
|
-
onClick: PropTypes.func,
|
|
67
|
-
onRequestHide: PropTypes.func,
|
|
68
|
-
customClassName: PropTypes.string
|
|
69
|
-
};
|
|
70
|
-
export {
|
|
71
|
-
Notification as default
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=Notification.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","sources":["../../src/react-notifications/Notification.jsx"],"sourcesContent":["/* eslint-disable jsx-a11y/no-static-element-interactions */\r\n/* eslint-disable jsx-a11y/click-events-have-key-events */\r\nimport { useEffect, useRef } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport classnames from 'classnames';\r\n\r\nconst Notification = ({\r\n title = null,\r\n type = 'info',\r\n message = null,\r\n customClassName = '',\r\n timeOut = 5000,\r\n onClick = () => {},\r\n onRequestHide = () => {},\r\n}) => {\r\n const mounted = useRef(true);\r\n\r\n useEffect(() => {\r\n mounted.current = true;\r\n let timer = null;\r\n if (timeOut !== 0) {\r\n timer = setTimeout(() => {\r\n if (mounted.current) requestHide();\r\n }, timeOut);\r\n }\r\n return () => {\r\n mounted.current = false;\r\n if (timer) {\r\n clearTimeout(timer);\r\n }\r\n };\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, []);\r\n\r\n const requestHide = () => {\r\n if (mounted.current && onRequestHide) {\r\n onRequestHide();\r\n }\r\n };\r\n\r\n const handleClick = () => {\r\n if (onClick) {\r\n onClick();\r\n }\r\n requestHide();\r\n };\r\n\r\n const className = classnames([\r\n 'notification',\r\n `notification-${type}`,\r\n customClassName,\r\n ]);\r\n const titleHtml = title ? <h4 className=\"title\">{title}</h4> : null;\r\n return (\r\n <div className={className} onClick={handleClick}>\r\n <div className=\"notification-message\" role=\"alert\">\r\n {titleHtml}\r\n <div className=\"message\">{message}</div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nNotification.propTypes = {\r\n type: PropTypes.oneOf([\r\n 'info',\r\n 'success',\r\n 'warning',\r\n 'error',\r\n 'primary',\r\n 'secondary',\r\n ]),\r\n title: PropTypes.node,\r\n message: PropTypes.node,\r\n timeOut: PropTypes.number,\r\n onClick: PropTypes.func,\r\n onRequestHide: PropTypes.func,\r\n customClassName: PropTypes.string,\r\n};\r\n\r\nexport default Notification;\r\n"],"names":[],"mappings":";;;;AAMA,MAAM,eAAe,CAAC;AAAA,EACpB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,UAAU;AAAA,EACV,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,UAAU,MAAM;AAAA,EAAC;AAAA,EACjB,gBAAgB,MAAM;AAAA,EAAC;AACzB,MAAM;AACJ,QAAM,UAAU,OAAO,IAAI;AAE3B,YAAU,MAAM;AACd,YAAQ,UAAU;AAClB,QAAI,QAAQ;AACZ,QAAI,YAAY,GAAG;AACjB,cAAQ,WAAW,MAAM;AACvB,YAAI,QAAQ,QAAS,aAAA;AAAA,MACvB,GAAG,OAAO;AAAA,IACZ;AACA,WAAO,MAAM;AACX,cAAQ,UAAU;AAClB,UAAI,OAAO;AACT,qBAAa,KAAK;AAAA,MACpB;AAAA,IACF;AAAA,EAEF,GAAG,CAAA,CAAE;AAEL,QAAM,cAAc,MAAM;AACxB,QAAI,QAAQ,WAAW,eAAe;AACpC,oBAAA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,cAAc,MAAM;AACxB,QAAI,SAAS;AACX,cAAA;AAAA,IACF;AACA,gBAAA;AAAA,EACF;AAEA,QAAM,YAAY,WAAW;AAAA,IAC3B;AAAA,IACA,gBAAgB,IAAI;AAAA,IACpB;AAAA,EAAA,CACD;AACD,QAAM,YAAY,QAAQ,oBAAC,QAAG,WAAU,SAAS,iBAAM,IAAQ;AAC/D,SACE,oBAAC,OAAA,EAAI,WAAsB,SAAS,aAClC,+BAAC,OAAA,EAAI,WAAU,wBAAuB,MAAK,SACxC,UAAA;AAAA,IAAA;AAAA,IACD,oBAAC,OAAA,EAAI,WAAU,WAAW,UAAA,QAAA,CAAQ;AAAA,EAAA,EAAA,CACpC,EAAA,CACF;AAEJ;AAEA,aAAa,YAAY;AAAA,EACvB,MAAM,UAAU,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AAAA,EACD,OAAO,UAAU;AAAA,EACjB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,SAAS,UAAU;AAAA,EACnB,eAAe,UAAU;AAAA,EACzB,iBAAiB,UAAU;AAC7B;"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Component } from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import NotificationManager from "./NotificationManager.js";
|
|
5
|
-
import Notifications from "./Notifications.js";
|
|
6
|
-
class NotificationContainer extends Component {
|
|
7
|
-
constructor(props) {
|
|
8
|
-
super(props);
|
|
9
|
-
this._isMounted = false;
|
|
10
|
-
const { enterTimeout = 400, leaveTimeout = 400 } = props;
|
|
11
|
-
this.state = {
|
|
12
|
-
notifications: []
|
|
13
|
-
};
|
|
14
|
-
this.enterTimeout = enterTimeout;
|
|
15
|
-
this.leaveTimeout = leaveTimeout;
|
|
16
|
-
NotificationManager.addChangeListener(this.handleStoreChange);
|
|
17
|
-
}
|
|
18
|
-
componentDidMount = () => {
|
|
19
|
-
this._isMounted = true;
|
|
20
|
-
};
|
|
21
|
-
componentWillUnmount = () => {
|
|
22
|
-
this._isMounted = false;
|
|
23
|
-
NotificationManager.removeChangeListener(this.handleStoreChange);
|
|
24
|
-
};
|
|
25
|
-
handleStoreChange = (notifications) => {
|
|
26
|
-
if (this._isMounted) {
|
|
27
|
-
this.setState({
|
|
28
|
-
notifications
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
handleRequestHide = (notification) => {
|
|
33
|
-
NotificationManager.remove(notification);
|
|
34
|
-
};
|
|
35
|
-
render() {
|
|
36
|
-
const { notifications } = this.state;
|
|
37
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
-
Notifications,
|
|
39
|
-
{
|
|
40
|
-
enterTimeout: this.enterTimeout,
|
|
41
|
-
leaveTimeout: this.leaveTimeout,
|
|
42
|
-
notifications,
|
|
43
|
-
onRequestHide: this.handleRequestHide
|
|
44
|
-
}
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
NotificationContainer.propTypes = {
|
|
49
|
-
enterTimeout: PropTypes.number,
|
|
50
|
-
leaveTimeout: PropTypes.number
|
|
51
|
-
};
|
|
52
|
-
NotificationContainer.defaultProps = {
|
|
53
|
-
enterTimeout: 400,
|
|
54
|
-
leaveTimeout: 400
|
|
55
|
-
};
|
|
56
|
-
export {
|
|
57
|
-
NotificationContainer as default
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=NotificationContainer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationContainer.js","sources":["../../src/react-notifications/NotificationContainer.jsx"],"sourcesContent":["import { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport NotificationManager from './NotificationManager';\r\nimport Notifications from './Notifications';\r\n\r\nclass NotificationContainer extends Component {\r\n constructor(props) {\r\n super(props);\r\n this._isMounted = false;\r\n const { enterTimeout = 400, leaveTimeout = 400 } = props;\r\n this.state = {\r\n notifications: [],\r\n };\r\n this.enterTimeout = enterTimeout;\r\n this.leaveTimeout = leaveTimeout;\r\n NotificationManager.addChangeListener(this.handleStoreChange);\r\n }\r\n\r\n componentDidMount = () => {\r\n this._isMounted = true;\r\n };\r\n\r\n componentWillUnmount = () => {\r\n this._isMounted = false;\r\n NotificationManager.removeChangeListener(this.handleStoreChange);\r\n };\r\n\r\n handleStoreChange = (notifications) => {\r\n if (this._isMounted) {\r\n this.setState({\r\n notifications,\r\n });\r\n }\r\n };\r\n\r\n handleRequestHide = (notification) => {\r\n NotificationManager.remove(notification);\r\n };\r\n\r\n render() {\r\n const { notifications } = this.state;\r\n return (\r\n <Notifications\r\n enterTimeout={this.enterTimeout}\r\n leaveTimeout={this.leaveTimeout}\r\n notifications={notifications}\r\n onRequestHide={this.handleRequestHide}\r\n />\r\n );\r\n }\r\n}\r\n\r\nNotificationContainer.propTypes = {\r\n enterTimeout: PropTypes.number,\r\n leaveTimeout: PropTypes.number,\r\n};\r\n\r\nNotificationContainer.defaultProps = {\r\n enterTimeout: 400,\r\n leaveTimeout: 400,\r\n};\r\n\r\nexport default NotificationContainer;\r\n"],"names":[],"mappings":";;;;;AAKA,MAAM,8BAA8B,UAAU;AAAA,EAC5C,YAAY,OAAO;AACjB,UAAM,KAAK;AACX,SAAK,aAAa;AAClB,UAAM,EAAE,eAAe,KAAK,eAAe,QAAQ;AACnD,SAAK,QAAQ;AAAA,MACX,eAAe,CAAA;AAAA,IAAC;AAElB,SAAK,eAAe;AACpB,SAAK,eAAe;AACpB,wBAAoB,kBAAkB,KAAK,iBAAiB;AAAA,EAC9D;AAAA,EAEA,oBAAoB,MAAM;AACxB,SAAK,aAAa;AAAA,EACpB;AAAA,EAEA,uBAAuB,MAAM;AAC3B,SAAK,aAAa;AAClB,wBAAoB,qBAAqB,KAAK,iBAAiB;AAAA,EACjE;AAAA,EAEA,oBAAoB,CAAC,kBAAkB;AACrC,QAAI,KAAK,YAAY;AACnB,WAAK,SAAS;AAAA,QACZ;AAAA,MAAA,CACD;AAAA,IACH;AAAA,EACF;AAAA,EAEA,oBAAoB,CAAC,iBAAiB;AACpC,wBAAoB,OAAO,YAAY;AAAA,EACzC;AAAA,EAEA,SAAS;AACP,UAAM,EAAE,kBAAkB,KAAK;AAC/B,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,cAAc,KAAK;AAAA,QACnB,cAAc,KAAK;AAAA,QACnB;AAAA,QACA,eAAe,KAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAG1B;AACF;AAEA,sBAAsB,YAAY;AAAA,EAChC,cAAc,UAAU;AAAA,EACxB,cAAc,UAAU;AAC1B;AAEA,sBAAsB,eAAe;AAAA,EACnC,cAAc;AAAA,EACd,cAAc;AAChB;"}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { e as eventsExports } from "../_virtual/events.js";
|
|
2
|
-
import { TYPES, TITLES, DEFAULT_VALUES } from "./constants.js";
|
|
3
|
-
const { CHANGE, PRIMARY, SECONDARY, WARNING, INFO, SUCCESS, ERROR } = TYPES;
|
|
4
|
-
const {
|
|
5
|
-
ERROR: ERROR_TITLE,
|
|
6
|
-
INFORMACION,
|
|
7
|
-
AVISO,
|
|
8
|
-
EXITO,
|
|
9
|
-
PRIMARIO,
|
|
10
|
-
SECUNDARIO
|
|
11
|
-
} = TITLES;
|
|
12
|
-
const { TIMEOUT } = DEFAULT_VALUES;
|
|
13
|
-
const createUUID = () => {
|
|
14
|
-
const pattern = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
|
|
15
|
-
return pattern.replace(/[xy]/g, (c) => {
|
|
16
|
-
const r = Math.random() * 16 | 0;
|
|
17
|
-
const v = c === "x" ? r : r & 3 | 8;
|
|
18
|
-
return v.toString(16);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
class NotificationManager extends eventsExports.EventEmitter {
|
|
22
|
-
constructor() {
|
|
23
|
-
super();
|
|
24
|
-
this.listNotify = [];
|
|
25
|
-
}
|
|
26
|
-
create(notify) {
|
|
27
|
-
const defaultNotify = {
|
|
28
|
-
customClassName: "",
|
|
29
|
-
id: createUUID(),
|
|
30
|
-
message: null,
|
|
31
|
-
timeOut: TIMEOUT,
|
|
32
|
-
title: INFORMACION,
|
|
33
|
-
type: INFO
|
|
34
|
-
};
|
|
35
|
-
if (notify.priority) {
|
|
36
|
-
this.listNotify.unshift(Object.assign(defaultNotify, notify));
|
|
37
|
-
} else {
|
|
38
|
-
this.listNotify.push(Object.assign(defaultNotify, notify));
|
|
39
|
-
}
|
|
40
|
-
this.emitChange();
|
|
41
|
-
}
|
|
42
|
-
primary({
|
|
43
|
-
customClassName = "",
|
|
44
|
-
message = "",
|
|
45
|
-
onClick = null,
|
|
46
|
-
priority = "",
|
|
47
|
-
timeOut = TIMEOUT,
|
|
48
|
-
title = PRIMARIO,
|
|
49
|
-
type = PRIMARY
|
|
50
|
-
}) {
|
|
51
|
-
this.create({
|
|
52
|
-
customClassName,
|
|
53
|
-
message,
|
|
54
|
-
onClick,
|
|
55
|
-
priority,
|
|
56
|
-
timeOut,
|
|
57
|
-
title,
|
|
58
|
-
type
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
secondary({
|
|
62
|
-
customClassName = "",
|
|
63
|
-
message = "",
|
|
64
|
-
onClick = null,
|
|
65
|
-
priority = "",
|
|
66
|
-
timeOut = TIMEOUT,
|
|
67
|
-
title = SECUNDARIO,
|
|
68
|
-
type = SECONDARY
|
|
69
|
-
}) {
|
|
70
|
-
this.create({
|
|
71
|
-
customClassName,
|
|
72
|
-
message,
|
|
73
|
-
onClick,
|
|
74
|
-
priority,
|
|
75
|
-
timeOut,
|
|
76
|
-
title,
|
|
77
|
-
type
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
info({
|
|
81
|
-
customClassName = "",
|
|
82
|
-
message = "",
|
|
83
|
-
onClick = null,
|
|
84
|
-
priority = "",
|
|
85
|
-
timeOut = TIMEOUT,
|
|
86
|
-
title = INFORMACION,
|
|
87
|
-
type = INFO
|
|
88
|
-
}) {
|
|
89
|
-
this.create({
|
|
90
|
-
customClassName,
|
|
91
|
-
message,
|
|
92
|
-
onClick,
|
|
93
|
-
priority,
|
|
94
|
-
timeOut,
|
|
95
|
-
title,
|
|
96
|
-
type
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
success({
|
|
100
|
-
customClassName = "",
|
|
101
|
-
message = "",
|
|
102
|
-
onClick = null,
|
|
103
|
-
priority = "",
|
|
104
|
-
timeOut = TIMEOUT,
|
|
105
|
-
title = EXITO,
|
|
106
|
-
type = SUCCESS
|
|
107
|
-
}) {
|
|
108
|
-
this.create({
|
|
109
|
-
customClassName,
|
|
110
|
-
message,
|
|
111
|
-
onClick,
|
|
112
|
-
priority,
|
|
113
|
-
timeOut,
|
|
114
|
-
title,
|
|
115
|
-
type
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
warning({
|
|
119
|
-
customClassName = "",
|
|
120
|
-
message = "",
|
|
121
|
-
onClick = null,
|
|
122
|
-
priority = "",
|
|
123
|
-
timeOut = TIMEOUT,
|
|
124
|
-
title = AVISO,
|
|
125
|
-
type = WARNING
|
|
126
|
-
}) {
|
|
127
|
-
this.create({
|
|
128
|
-
customClassName,
|
|
129
|
-
message,
|
|
130
|
-
onClick,
|
|
131
|
-
priority,
|
|
132
|
-
timeOut,
|
|
133
|
-
title,
|
|
134
|
-
type
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
error({
|
|
138
|
-
customClassName = "",
|
|
139
|
-
message = "",
|
|
140
|
-
onClick = null,
|
|
141
|
-
priority = "",
|
|
142
|
-
timeOut = TIMEOUT,
|
|
143
|
-
title = ERROR_TITLE,
|
|
144
|
-
type = ERROR
|
|
145
|
-
}) {
|
|
146
|
-
this.create({
|
|
147
|
-
customClassName,
|
|
148
|
-
message,
|
|
149
|
-
onClick,
|
|
150
|
-
priority,
|
|
151
|
-
timeOut,
|
|
152
|
-
title,
|
|
153
|
-
type
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
remove(notification) {
|
|
157
|
-
this.listNotify = this.listNotify.filter((n) => notification.id !== n.id);
|
|
158
|
-
this.emitChange();
|
|
159
|
-
}
|
|
160
|
-
emitChange() {
|
|
161
|
-
this.emit(CHANGE, this.listNotify);
|
|
162
|
-
}
|
|
163
|
-
addChangeListener(callback) {
|
|
164
|
-
this.addListener(CHANGE, callback);
|
|
165
|
-
}
|
|
166
|
-
removeChangeListener(callback) {
|
|
167
|
-
this.removeListener(CHANGE, callback);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
const NotificationManager$1 = new NotificationManager();
|
|
171
|
-
export {
|
|
172
|
-
NotificationManager$1 as default
|
|
173
|
-
};
|
|
174
|
-
//# sourceMappingURL=NotificationManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationManager.js","sources":["../../src/react-notifications/NotificationManager.js"],"sourcesContent":["import { EventEmitter } from 'events';\r\nimport { TYPES, TITLES, DEFAULT_VALUES } from './constants';\r\nconst { CHANGE, PRIMARY, SECONDARY, WARNING, INFO, SUCCESS, ERROR } = TYPES;\r\nconst {\r\n ERROR: ERROR_TITLE,\r\n INFORMACION,\r\n AVISO,\r\n EXITO,\r\n PRIMARIO,\r\n SECUNDARIO,\r\n} = TITLES;\r\nconst { TIMEOUT } = DEFAULT_VALUES;\r\n\r\nconst createUUID = () => {\r\n const pattern = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\r\n return pattern.replace(/[xy]/g, (c) => {\r\n const r = (Math.random() * 16) | 0;\r\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\r\n return v.toString(16);\r\n });\r\n};\r\n\r\nclass NotificationManager extends EventEmitter {\r\n constructor() {\r\n super();\r\n this.listNotify = [];\r\n }\r\n\r\n create(notify) {\r\n const defaultNotify = {\r\n customClassName: '',\r\n id: createUUID(),\r\n message: null,\r\n timeOut: TIMEOUT,\r\n title: INFORMACION,\r\n type: INFO,\r\n };\r\n if (notify.priority) {\r\n this.listNotify.unshift(Object.assign(defaultNotify, notify));\r\n } else {\r\n this.listNotify.push(Object.assign(defaultNotify, notify));\r\n }\r\n this.emitChange();\r\n }\r\n\r\n primary({\r\n customClassName = '',\r\n message = '',\r\n onClick = null,\r\n priority = '',\r\n timeOut = TIMEOUT,\r\n title = PRIMARIO,\r\n type = PRIMARY,\r\n }) {\r\n this.create({\r\n customClassName,\r\n message,\r\n onClick,\r\n priority,\r\n timeOut,\r\n title,\r\n type,\r\n });\r\n }\r\n\r\n secondary({\r\n customClassName = '',\r\n message = '',\r\n onClick = null,\r\n priority = '',\r\n timeOut = TIMEOUT,\r\n title = SECUNDARIO,\r\n type = SECONDARY,\r\n }) {\r\n this.create({\r\n customClassName,\r\n message,\r\n onClick,\r\n priority,\r\n timeOut,\r\n title,\r\n type,\r\n });\r\n }\r\n\r\n info({\r\n customClassName = '',\r\n message = '',\r\n onClick = null,\r\n priority = '',\r\n timeOut = TIMEOUT,\r\n title = INFORMACION,\r\n type = INFO,\r\n }) {\r\n this.create({\r\n customClassName,\r\n message,\r\n onClick,\r\n priority,\r\n timeOut,\r\n title,\r\n type,\r\n });\r\n }\r\n\r\n success({\r\n customClassName = '',\r\n message = '',\r\n onClick = null,\r\n priority = '',\r\n timeOut = TIMEOUT,\r\n title = EXITO,\r\n type = SUCCESS,\r\n }) {\r\n this.create({\r\n customClassName,\r\n message,\r\n onClick,\r\n priority,\r\n timeOut,\r\n title,\r\n type,\r\n });\r\n }\r\n\r\n warning({\r\n customClassName = '',\r\n message = '',\r\n onClick = null,\r\n priority = '',\r\n timeOut = TIMEOUT,\r\n title = AVISO,\r\n type = WARNING,\r\n }) {\r\n this.create({\r\n customClassName,\r\n message,\r\n onClick,\r\n priority,\r\n timeOut,\r\n title,\r\n type,\r\n });\r\n }\r\n\r\n error({\r\n customClassName = '',\r\n message = '',\r\n onClick = null,\r\n priority = '',\r\n timeOut = TIMEOUT,\r\n title = ERROR_TITLE,\r\n type = ERROR,\r\n }) {\r\n this.create({\r\n customClassName,\r\n message,\r\n onClick,\r\n priority,\r\n timeOut,\r\n title,\r\n type,\r\n });\r\n }\r\n\r\n remove(notification) {\r\n this.listNotify = this.listNotify.filter((n) => notification.id !== n.id);\r\n this.emitChange();\r\n }\r\n\r\n emitChange() {\r\n this.emit(CHANGE, this.listNotify);\r\n }\r\n\r\n addChangeListener(callback) {\r\n this.addListener(CHANGE, callback);\r\n }\r\n\r\n removeChangeListener(callback) {\r\n this.removeListener(CHANGE, callback);\r\n }\r\n}\r\n\r\nexport default new NotificationManager();\r\n"],"names":["EventEmitter"],"mappings":";;AAEA,MAAM,EAAE,QAAQ,SAAS,WAAW,SAAS,MAAM,SAAS,MAAK,IAAK;AACtE,MAAM;AAAA,EACJ,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAI;AACJ,MAAM,EAAE,QAAO,IAAK;AAEpB,MAAM,aAAa,MAAM;AACvB,QAAM,UAAU;AAChB,SAAO,QAAQ,QAAQ,SAAS,CAAC,MAAM;AACrC,UAAM,IAAK,KAAK,OAAM,IAAK,KAAM;AACjC,UAAM,IAAI,MAAM,MAAM,IAAK,IAAI,IAAO;AACtC,WAAO,EAAE,SAAS,EAAE;AAAA,EACtB,CAAC;AACH;AAEA,MAAM,4BAA4BA,cAAAA,aAAa;AAAA,EAC7C,cAAc;AACZ;AACA,SAAK,aAAa;EACpB;AAAA,EAEA,OAAO,QAAQ;AACb,UAAM,gBAAgB;AAAA,MACpB,iBAAiB;AAAA,MACjB,IAAI,WAAU;AAAA,MACd,SAAS;AAAA,MACT,SAAS;AAAA,MACT,OAAO;AAAA,MACP,MAAM;AAAA,IACZ;AACI,QAAI,OAAO,UAAU;AACnB,WAAK,WAAW,QAAQ,OAAO,OAAO,eAAe,MAAM,CAAC;AAAA,IAC9D,OAAO;AACL,WAAK,WAAW,KAAK,OAAO,OAAO,eAAe,MAAM,CAAC;AAAA,IAC3D;AACA,SAAK,WAAU;AAAA,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,IACV,QAAQ;AAAA,IACR,OAAO;AAAA,EACX,GAAK;AACD,SAAK,OAAO;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACN,CAAK;AAAA,EACH;AAAA,EAEA,MAAM;AAAA,IACJ,kBAAkB;AAAA,IAClB,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;AAAA,IACX,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,OAAO;AAAA,EACX,GAAK;AACD,SAAK,OAAO;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACN,CAAK;AAAA,EACH;AAAA,EAEA,OAAO,cAAc;AACnB,SAAK,aAAa,KAAK,WAAW,OAAO,CAAC,MAAM,aAAa,OAAO,EAAE,EAAE;AACxE,SAAK,WAAU;AAAA,EACjB;AAAA,EAEA,aAAa;AACX,SAAK,KAAK,QAAQ,KAAK,UAAU;AAAA,EACnC;AAAA,EAEA,kBAAkB,UAAU;AAC1B,SAAK,YAAY,QAAQ,QAAQ;AAAA,EACnC;AAAA,EAEA,qBAAqB,UAAU;AAC7B,SAAK,eAAe,QAAQ,QAAQ;AAAA,EACtC;AACF;AAEA,MAAA,wBAAe,IAAI,oBAAmB;"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Component, createRef } from "react";
|
|
3
|
-
import PropTypes from "prop-types";
|
|
4
|
-
import classnames from "../_virtual/index.js";
|
|
5
|
-
import Notification from "./Notification.js";
|
|
6
|
-
import TransitionGroup from "../node_modules/react-transition-group/esm/TransitionGroup.js";
|
|
7
|
-
import CSSTransition from "../node_modules/react-transition-group/esm/CSSTransition.js";
|
|
8
|
-
class Notifications extends Component {
|
|
9
|
-
constructor(props) {
|
|
10
|
-
super(props);
|
|
11
|
-
this.nodeRefs = {};
|
|
12
|
-
}
|
|
13
|
-
handleRequestHide = (notification) => () => {
|
|
14
|
-
const { onRequestHide } = this.props;
|
|
15
|
-
if (onRequestHide) {
|
|
16
|
-
onRequestHide(notification);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
getNodeRef = (key) => {
|
|
20
|
-
if (!this.nodeRefs[key]) {
|
|
21
|
-
this.nodeRefs[key] = createRef();
|
|
22
|
-
}
|
|
23
|
-
return this.nodeRefs[key];
|
|
24
|
-
};
|
|
25
|
-
render() {
|
|
26
|
-
const {
|
|
27
|
-
notifications = [],
|
|
28
|
-
enterTimeout = 400,
|
|
29
|
-
leaveTimeout = 400
|
|
30
|
-
} = this.props;
|
|
31
|
-
const className = classnames("notification-container", {
|
|
32
|
-
"notification-container-empty": notifications.length === 0
|
|
33
|
-
});
|
|
34
|
-
return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(TransitionGroup, { children: notifications.map((notification) => {
|
|
35
|
-
const key = notification.id || (/* @__PURE__ */ new Date()).getTime();
|
|
36
|
-
const nodeRef = this.getNodeRef(key);
|
|
37
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
-
CSSTransition,
|
|
39
|
-
{
|
|
40
|
-
classNames: "notification",
|
|
41
|
-
timeout: { exit: leaveTimeout, enter: enterTimeout },
|
|
42
|
-
nodeRef,
|
|
43
|
-
children: /* @__PURE__ */ jsx(
|
|
44
|
-
Notification,
|
|
45
|
-
{
|
|
46
|
-
ref: nodeRef,
|
|
47
|
-
type: notification.type,
|
|
48
|
-
title: notification.title,
|
|
49
|
-
message: notification.message,
|
|
50
|
-
timeOut: notification.timeOut,
|
|
51
|
-
onClick: notification.onClick,
|
|
52
|
-
onRequestHide: this.handleRequestHide(notification),
|
|
53
|
-
customClassName: notification.customClassName
|
|
54
|
-
},
|
|
55
|
-
key
|
|
56
|
-
)
|
|
57
|
-
},
|
|
58
|
-
key
|
|
59
|
-
);
|
|
60
|
-
}) }) });
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
Notifications.propTypes = {
|
|
64
|
-
notifications: PropTypes.array,
|
|
65
|
-
onRequestHide: PropTypes.func,
|
|
66
|
-
enterTimeout: PropTypes.number,
|
|
67
|
-
leaveTimeout: PropTypes.number
|
|
68
|
-
};
|
|
69
|
-
export {
|
|
70
|
-
Notifications as default
|
|
71
|
-
};
|
|
72
|
-
//# sourceMappingURL=Notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Notifications.js","sources":["../../src/react-notifications/Notifications.jsx"],"sourcesContent":["import { Component, createRef } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { TransitionGroup, CSSTransition } from 'react-transition-group';\r\nimport classnames from 'classnames';\r\nimport Notification from './Notification';\r\n\r\nclass Notifications extends Component {\r\n constructor(props) {\r\n super(props);\r\n this.nodeRefs = {};\r\n }\r\n\r\n handleRequestHide = (notification) => () => {\r\n const { onRequestHide } = this.props;\r\n if (onRequestHide) {\r\n onRequestHide(notification);\r\n }\r\n };\r\n\r\n getNodeRef = (key) => {\r\n if (!this.nodeRefs[key]) {\r\n this.nodeRefs[key] = createRef();\r\n }\r\n return this.nodeRefs[key];\r\n };\r\n\r\n render() {\r\n const {\r\n notifications = [],\r\n enterTimeout = 400,\r\n leaveTimeout = 400,\r\n } = this.props;\r\n const className = classnames('notification-container', {\r\n 'notification-container-empty': notifications.length === 0,\r\n });\r\n return (\r\n <div className={className}>\r\n <TransitionGroup>\r\n {notifications.map((notification) => {\r\n const key = notification.id || new Date().getTime();\r\n const nodeRef = this.getNodeRef(key);\r\n return (\r\n <CSSTransition\r\n classNames=\"notification\"\r\n key={key}\r\n timeout={{ exit: leaveTimeout, enter: enterTimeout }}\r\n nodeRef={nodeRef}\r\n >\r\n <Notification\r\n ref={nodeRef}\r\n key={key}\r\n type={notification.type}\r\n title={notification.title}\r\n message={notification.message}\r\n timeOut={notification.timeOut}\r\n onClick={notification.onClick}\r\n onRequestHide={this.handleRequestHide(notification)}\r\n customClassName={notification.customClassName}\r\n />\r\n </CSSTransition>\r\n );\r\n })}\r\n </TransitionGroup>\r\n </div>\r\n );\r\n }\r\n}\r\nNotifications.propTypes = {\r\n notifications: PropTypes.array,\r\n onRequestHide: PropTypes.func,\r\n enterTimeout: PropTypes.number,\r\n leaveTimeout: PropTypes.number,\r\n};\r\n\r\nexport default Notifications;\r\n"],"names":[],"mappings":";;;;;;;AAMA,MAAM,sBAAsB,UAAU;AAAA,EACpC,YAAY,OAAO;AACjB,UAAM,KAAK;AACX,SAAK,WAAW,CAAA;AAAA,EAClB;AAAA,EAEA,oBAAoB,CAAC,iBAAiB,MAAM;AAC1C,UAAM,EAAE,kBAAkB,KAAK;AAC/B,QAAI,eAAe;AACjB,oBAAc,YAAY;AAAA,IAC5B;AAAA,EACF;AAAA,EAEA,aAAa,CAAC,QAAQ;AACpB,QAAI,CAAC,KAAK,SAAS,GAAG,GAAG;AACvB,WAAK,SAAS,GAAG,IAAI,UAAA;AAAA,IACvB;AACA,WAAO,KAAK,SAAS,GAAG;AAAA,EAC1B;AAAA,EAEA,SAAS;AACP,UAAM;AAAA,MACJ,gBAAgB,CAAA;AAAA,MAChB,eAAe;AAAA,MACf,eAAe;AAAA,IAAA,IACb,KAAK;AACT,UAAM,YAAY,WAAW,0BAA0B;AAAA,MACrD,gCAAgC,cAAc,WAAW;AAAA,IAAA,CAC1D;AACD,WACE,oBAAC,SAAI,WACH,UAAA,oBAAC,mBACE,UAAA,cAAc,IAAI,CAAC,iBAAiB;AACnC,YAAM,MAAM,aAAa,OAAM,oBAAI,KAAA,GAAO,QAAA;AAC1C,YAAM,UAAU,KAAK,WAAW,GAAG;AACnC,aACE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,YAAW;AAAA,UAEX,SAAS,EAAE,MAAM,cAAc,OAAO,aAAA;AAAA,UACtC;AAAA,UAEA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAK;AAAA,cAEL,MAAM,aAAa;AAAA,cACnB,OAAO,aAAa;AAAA,cACpB,SAAS,aAAa;AAAA,cACtB,SAAS,aAAa;AAAA,cACtB,SAAS,aAAa;AAAA,cACtB,eAAe,KAAK,kBAAkB,YAAY;AAAA,cAClD,iBAAiB,aAAa;AAAA,YAAA;AAAA,YAPzB;AAAA,UAAA;AAAA,QAQP;AAAA,QAdK;AAAA,MAAA;AAAA,IAiBX,CAAC,GACH,GACF;AAAA,EAEJ;AACF;AACA,cAAc,YAAY;AAAA,EACxB,eAAe,UAAU;AAAA,EACzB,eAAe,UAAU;AAAA,EACzB,cAAc,UAAU;AAAA,EACxB,cAAc,UAAU;AAC1B;"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const TYPES = {
|
|
2
|
-
CHANGE: "change",
|
|
3
|
-
ERROR: "error",
|
|
4
|
-
INFO: "info",
|
|
5
|
-
PRIMARY: "primary",
|
|
6
|
-
SECONDARY: "secondary",
|
|
7
|
-
SUCCESS: "success",
|
|
8
|
-
WARNING: "warning"
|
|
9
|
-
};
|
|
10
|
-
const TITLES = {
|
|
11
|
-
AVISO: "AVISO",
|
|
12
|
-
ERROR: "ERROR",
|
|
13
|
-
EXITO: "EXITO",
|
|
14
|
-
INFORMACION: "INFORMACION",
|
|
15
|
-
PRIMARIO: "PRIMARIO",
|
|
16
|
-
SECUNDARIO: "SECUNDARIO"
|
|
17
|
-
};
|
|
18
|
-
const DEFAULT_VALUES = {
|
|
19
|
-
TIMEOUT: 5e3
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
DEFAULT_VALUES,
|
|
23
|
-
TITLES,
|
|
24
|
-
TYPES
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../src/react-notifications/constants.js"],"sourcesContent":["export const TYPES = {\r\n CHANGE: 'change',\r\n ERROR: 'error',\r\n INFO: 'info',\r\n PRIMARY: 'primary',\r\n SECONDARY: 'secondary',\r\n SUCCESS: 'success',\r\n WARNING: 'warning',\r\n};\r\n\r\nexport const TITLES = {\r\n AVISO: 'AVISO',\r\n ERROR: 'ERROR',\r\n EXITO: 'EXITO',\r\n INFORMACION: 'INFORMACION',\r\n PRIMARIO: 'PRIMARIO',\r\n SECUNDARIO: 'SECUNDARIO',\r\n};\r\n\r\nexport const DEFAULT_VALUES = {\r\n TIMEOUT: 5000,\r\n};\r\n"],"names":[],"mappings":"AAAY,MAAC,QAAQ;AAAA,EACnB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AACX;AAEY,MAAC,SAAS;AAAA,EACpB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,aAAa;AAAA,EACb,UAAU;AAAA,EACV,YAAY;AACd;AAEY,MAAC,iBAAiB;AAAA,EAC5B,SAAS;AACX;"}
|