siam-ui-utils 3.0.31 → 3.0.32

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.
Files changed (170) hide show
  1. package/dist/CustomBootstrap.js +9 -0
  2. package/dist/CustomBootstrap.js.map +1 -0
  3. package/dist/_virtual/_commonjsHelpers.js +7 -0
  4. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  5. package/dist/_virtual/events.js +6 -0
  6. package/dist/_virtual/events.js.map +1 -0
  7. package/dist/_virtual/events2.js +5 -0
  8. package/dist/_virtual/events2.js.map +1 -0
  9. package/dist/_virtual/index.js +8 -0
  10. package/dist/_virtual/index.js.map +1 -0
  11. package/dist/_virtual/index2.js +5 -0
  12. package/dist/_virtual/index2.js.map +1 -0
  13. package/dist/_virtual/react-dropzone.js +8 -0
  14. package/dist/_virtual/react-dropzone.js.map +1 -0
  15. package/dist/_virtual/react-dropzone2.js +5 -0
  16. package/dist/_virtual/react-dropzone2.js.map +1 -0
  17. package/dist/assets/img/copiar.png.js +5 -0
  18. package/dist/assets/img/copiar.png.js.map +1 -0
  19. package/dist/assets/img/take-photo.jpg.js +5 -0
  20. package/dist/assets/img/take-photo.jpg.js.map +1 -0
  21. package/dist/constants.js +9 -0
  22. package/dist/constants.js.map +1 -0
  23. package/dist/copy-link/index.js +60 -0
  24. package/dist/copy-link/index.js.map +1 -0
  25. package/dist/copy-link/styles.css +38 -0
  26. package/dist/custom-input/CustomInputCheckbox.js +35 -0
  27. package/dist/custom-input/CustomInputCheckbox.js.map +1 -0
  28. package/dist/custom-input/CustomInputCurrency.js +84 -0
  29. package/dist/custom-input/CustomInputCurrency.js.map +1 -0
  30. package/dist/custom-input/CustomInputFile.js +45 -0
  31. package/dist/custom-input/CustomInputFile.js.map +1 -0
  32. package/dist/custom-input/CustomInputRadio.js +66 -0
  33. package/dist/custom-input/CustomInputRadio.js.map +1 -0
  34. package/dist/custom-input/constant.js +5 -0
  35. package/dist/custom-input/constant.js.map +1 -0
  36. package/dist/custom-input/index.css +167 -0
  37. package/dist/custom-input/index.js +12 -0
  38. package/dist/custom-input/index.js.map +1 -0
  39. package/dist/drag-and-dropzone/config.js +59 -0
  40. package/dist/drag-and-dropzone/config.js.map +1 -0
  41. package/dist/drag-and-dropzone/index.css +276 -0
  42. package/dist/drag-and-dropzone/index.js +39 -0
  43. package/dist/drag-and-dropzone/index.js.map +1 -0
  44. package/dist/dropzone/Input.js +77 -0
  45. package/dist/dropzone/Input.js.map +1 -0
  46. package/dist/dropzone/Layout.js +50 -0
  47. package/dist/dropzone/Layout.js.map +1 -0
  48. package/dist/dropzone/Preview.js +117 -0
  49. package/dist/dropzone/Preview.js.map +1 -0
  50. package/dist/dropzone/SubmitButton.js +34 -0
  51. package/dist/dropzone/SubmitButton.js.map +1 -0
  52. package/dist/dropzone/assets/cancel.svg.js +5 -0
  53. package/dist/dropzone/assets/cancel.svg.js.map +1 -0
  54. package/dist/dropzone/assets/remove.svg.js +5 -0
  55. package/dist/dropzone/assets/remove.svg.js.map +1 -0
  56. package/dist/dropzone/assets/restart.svg.js +5 -0
  57. package/dist/dropzone/assets/restart.svg.js.map +1 -0
  58. package/dist/dropzone/index.js +514 -0
  59. package/dist/dropzone/index.js.map +1 -0
  60. package/dist/dropzone/utils.js +93 -0
  61. package/dist/dropzone/utils.js.map +1 -0
  62. package/dist/dropzone-uploader/base/index.css +207 -0
  63. package/dist/dropzone-uploader/base/index.js +135 -0
  64. package/dist/dropzone-uploader/base/index.js.map +1 -0
  65. package/dist/dropzone-uploader/index.js +7 -0
  66. package/dist/dropzone-uploader/index.js.map +1 -0
  67. package/dist/dropzone-uploader/styled/index.css +348 -0
  68. package/dist/dropzone-uploader/styled/index.js +148 -0
  69. package/dist/dropzone-uploader/styled/index.js.map +1 -0
  70. package/dist/iconos/constants-svg.js +666 -0
  71. package/dist/iconos/constants-svg.js.map +1 -0
  72. package/dist/iconos/icon-button-svg.js +50 -0
  73. package/dist/iconos/icon-button-svg.js.map +1 -0
  74. package/dist/iconos/index.js +24 -0
  75. package/dist/iconos/index.js.map +1 -0
  76. package/dist/iconos/styled-icon.js +26 -0
  77. package/dist/iconos/styled-icon.js.map +1 -0
  78. package/dist/index.js +4 -0
  79. package/dist/index.js.map +1 -0
  80. package/dist/intl-messages/index.js +11 -0
  81. package/dist/intl-messages/index.js.map +1 -0
  82. package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -0
  83. package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js.map +1 -0
  84. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -0
  85. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -0
  86. package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -0
  87. package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js.map +1 -0
  88. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +13 -0
  89. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -0
  90. package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -0
  91. package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js.map +1 -0
  92. package/dist/node_modules/classnames/index.js +62 -0
  93. package/dist/node_modules/classnames/index.js.map +1 -0
  94. package/dist/node_modules/dom-helpers/esm/addClass.js +10 -0
  95. package/dist/node_modules/dom-helpers/esm/addClass.js.map +1 -0
  96. package/dist/node_modules/dom-helpers/esm/hasClass.js +8 -0
  97. package/dist/node_modules/dom-helpers/esm/hasClass.js.map +1 -0
  98. package/dist/node_modules/dom-helpers/esm/removeClass.js +16 -0
  99. package/dist/node_modules/dom-helpers/esm/removeClass.js.map +1 -0
  100. package/dist/node_modules/events/events.js +372 -0
  101. package/dist/node_modules/events/events.js.map +1 -0
  102. package/dist/node_modules/react-dropzone-component/dist/react-dropzone.js +1023 -0
  103. package/dist/node_modules/react-dropzone-component/dist/react-dropzone.js.map +1 -0
  104. package/dist/node_modules/react-multi-select-component/dist/esm/index.js +178 -0
  105. package/dist/node_modules/react-multi-select-component/dist/esm/index.js.map +1 -0
  106. package/dist/node_modules/react-transition-group/esm/CSSTransition.js +275 -0
  107. package/dist/node_modules/react-transition-group/esm/CSSTransition.js.map +1 -0
  108. package/dist/node_modules/react-transition-group/esm/Transition.js +441 -0
  109. package/dist/node_modules/react-transition-group/esm/Transition.js.map +1 -0
  110. package/dist/node_modules/react-transition-group/esm/TransitionGroup.js +146 -0
  111. package/dist/node_modules/react-transition-group/esm/TransitionGroup.js.map +1 -0
  112. package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js +6 -0
  113. package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js.map +1 -0
  114. package/dist/node_modules/react-transition-group/esm/config.js +7 -0
  115. package/dist/node_modules/react-transition-group/esm/config.js.map +1 -0
  116. package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js +100 -0
  117. package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js.map +1 -0
  118. package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js +24 -0
  119. package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js.map +1 -0
  120. package/dist/node_modules/react-transition-group/esm/utils/reflow.js +7 -0
  121. package/dist/node_modules/react-transition-group/esm/utils/reflow.js.map +1 -0
  122. package/dist/react-notifications/Notification.js +73 -0
  123. package/dist/react-notifications/Notification.js.map +1 -0
  124. package/dist/react-notifications/NotificationContainer.js +59 -0
  125. package/dist/react-notifications/NotificationContainer.js.map +1 -0
  126. package/dist/react-notifications/NotificationManager.js +174 -0
  127. package/dist/react-notifications/NotificationManager.js.map +1 -0
  128. package/dist/react-notifications/Notifications.js +72 -0
  129. package/dist/react-notifications/Notifications.js.map +1 -0
  130. package/dist/react-notifications/constants.js +26 -0
  131. package/dist/react-notifications/constants.js.map +1 -0
  132. package/dist/react-notifications/index.js +11 -0
  133. package/dist/react-notifications/index.js.map +1 -0
  134. package/dist/react-notifications/notifications.css +213 -0
  135. package/dist/select/custom-select/constants.js +8 -0
  136. package/dist/select/custom-select/constants.js.map +1 -0
  137. package/dist/select/custom-select/index.js +90 -0
  138. package/dist/select/custom-select/index.js.map +1 -0
  139. package/dist/select/custom-select-input/index.js +12 -0
  140. package/dist/select/custom-select-input/index.js.map +1 -0
  141. package/dist/select/index.js +9 -0
  142. package/dist/select/index.js.map +1 -0
  143. package/dist/select/multi-select/badge-label-multi-select.js +29 -0
  144. package/dist/select/multi-select/badge-label-multi-select.js.map +1 -0
  145. package/dist/select/multi-select/index.css +24 -0
  146. package/dist/select/multi-select/index.js +62 -0
  147. package/dist/select/multi-select/index.js.map +1 -0
  148. package/dist/select/multi-select/styled-component.js +24 -0
  149. package/dist/select/multi-select/styled-component.js.map +1 -0
  150. package/dist/timer/index.js +60 -0
  151. package/dist/timer/index.js.map +1 -0
  152. package/dist/timer/styles.css +59 -0
  153. package/dist/tomar-foto/index.js +62 -0
  154. package/dist/tomar-foto/index.js.map +1 -0
  155. package/dist/view-layout/button-editor.js +14 -0
  156. package/dist/view-layout/button-editor.js.map +1 -0
  157. package/dist/view-layout/constants.js +11 -0
  158. package/dist/view-layout/constants.js.map +1 -0
  159. package/dist/view-layout/editor-layer.js +28 -0
  160. package/dist/view-layout/editor-layer.js.map +1 -0
  161. package/dist/view-layout/index.js +53 -0
  162. package/dist/view-layout/index.js.map +1 -0
  163. package/dist/view-layout/slot-wrapper.js +39 -0
  164. package/dist/view-layout/slot-wrapper.js.map +1 -0
  165. package/dist/view-layout/styles.css +127 -0
  166. package/dist/where-by-room/index.js +20 -0
  167. package/dist/where-by-room/index.js.map +1 -0
  168. package/dist/where-by-room/room.js +78 -0
  169. package/dist/where-by-room/room.js.map +1 -0
  170. package/package.json +1 -1
@@ -0,0 +1 @@
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]}
@@ -0,0 +1,7 @@
1
+ const config = {
2
+ disabled: false
3
+ };
4
+ export {
5
+ config as default
6
+ };
7
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
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]}
@@ -0,0 +1,100 @@
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
@@ -0,0 +1 @@
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)\n });\n }\n });\n return children;\n}"],"names":["mapper"],"mappings":";AAQO,SAAS,gBAAgB,UAAU,OAAO;AAC/C,MAAI,SAAS,SAASA,QAAO,OAAO;AAClC,WAAO,SAAS,eAAe,KAAK,IAAI,MAAM,KAAK,IAAI;AAAA,EACzD;AAEA,MAAI,SAAS,uBAAO,OAAO,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ACpB,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]}
@@ -0,0 +1,24 @@
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
@@ -0,0 +1 @@
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]}
@@ -0,0 +1,7 @@
1
+ var forceReflow = function forceReflow2(node) {
2
+ return node.scrollTop;
3
+ };
4
+ export {
5
+ forceReflow
6
+ };
7
+ //# sourceMappingURL=reflow.js.map
@@ -0,0 +1 @@
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]}
@@ -0,0 +1,73 @@
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
@@ -0,0 +1 @@
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;"}
@@ -0,0 +1,59 @@
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
@@ -0,0 +1 @@
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;"}
@@ -0,0 +1,174 @@
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
@@ -0,0 +1 @@
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,EACjB;AAAA,EAEA,QAAQ;AAAA,IACN,kBAAkB;AAAA,IAClB,UAAU;AAAA,IACV,UAAU;AAAA,IACV,WAAW;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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;"}
@@ -0,0 +1,72 @@
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
@@ -0,0 +1 @@
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;"}
@@ -0,0 +1,26 @@
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
@@ -0,0 +1 @@
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;"}
@@ -0,0 +1,11 @@
1
+ import "./notifications.css";
2
+ import Notifications from "./Notifications.js";
3
+ import { default as default2 } from "./NotificationContainer.js";
4
+ import { default as default3 } from "./NotificationManager.js";
5
+ export {
6
+ default2 as NotificationContainer,
7
+ default3 as NotificationManager,
8
+ Notifications,
9
+ Notifications as default
10
+ };
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}