@prom-ui/core 1.18.0 → 1.19.1

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 (186) hide show
  1. package/Avatar/package.json +1 -1
  2. package/Backdrop/package.json +1 -1
  3. package/Badge/package.json +1 -1
  4. package/Body/package.json +1 -1
  5. package/BodyContext/package.json +1 -1
  6. package/BodyProvider/cjs/index.development.js +18 -18
  7. package/BodyProvider/cjs/index.development.v2.js +18 -18
  8. package/BodyProvider/cjs/index.production.js +1 -1
  9. package/BodyProvider/cjs/index.production.v2.js +1 -1
  10. package/BodyProvider/package.json +1 -1
  11. package/BodyScrollLock/package.json +1 -1
  12. package/Box/cjs/index.development.js +1 -1
  13. package/Box/cjs/index.development.v2.js +1 -1
  14. package/Box/cjs/index.production.js +1 -1
  15. package/Box/cjs/index.production.v2.js +1 -1
  16. package/Box/cjs/style.development.css +1 -1
  17. package/Box/cjs/style.development.v2.css +1 -1
  18. package/Box/cjs/style.production.css +1 -1
  19. package/Box/cjs/style.production.v2.css +1 -1
  20. package/Box/index.d.ts +2 -2
  21. package/Box/package.json +1 -1
  22. package/Button/package.json +1 -1
  23. package/ButtonPageUp/package.json +1 -1
  24. package/Checkbox/cjs/index.development.js +9 -4
  25. package/Checkbox/cjs/index.development.v2.js +9 -4
  26. package/Checkbox/cjs/index.production.js +1 -1
  27. package/Checkbox/cjs/index.production.v2.js +1 -1
  28. package/Checkbox/cjs/style.development.css +1 -1
  29. package/Checkbox/cjs/style.development.v2.css +1 -1
  30. package/Checkbox/cjs/style.production.css +1 -1
  31. package/Checkbox/cjs/style.production.v2.css +1 -1
  32. package/Checkbox/index.d.ts +1 -0
  33. package/Checkbox/package.json +1 -1
  34. package/ContextMenu/cjs/index.development.js +262 -0
  35. package/ContextMenu/cjs/index.development.v2.js +262 -0
  36. package/ContextMenu/cjs/index.production.js +1 -0
  37. package/ContextMenu/cjs/index.production.v2.js +1 -0
  38. package/ContextMenu/cjs/style.development.css +1 -0
  39. package/ContextMenu/cjs/style.development.v2.css +1 -0
  40. package/ContextMenu/cjs/style.production.css +1 -0
  41. package/ContextMenu/cjs/style.production.v2.css +1 -0
  42. package/ContextMenu/index.d.ts +25 -0
  43. package/ContextMenu/index.js +7 -0
  44. package/ContextMenu/index.v2.js +7 -0
  45. package/ContextMenu/package.json +12 -0
  46. package/ErrorCatch/ErrorCatch.d.ts +30 -0
  47. package/ErrorCatch/cjs/index.development.js +367 -0
  48. package/ErrorCatch/cjs/index.development.v2.js +367 -0
  49. package/ErrorCatch/cjs/index.production.js +1 -0
  50. package/ErrorCatch/cjs/index.production.v2.js +1 -0
  51. package/ErrorCatch/cjs/style.development.css +1 -0
  52. package/ErrorCatch/cjs/style.development.v2.css +1 -0
  53. package/ErrorCatch/cjs/style.production.css +1 -0
  54. package/ErrorCatch/cjs/style.production.v2.css +1 -0
  55. package/ErrorCatch/components/ErrorView.d.ts +7 -0
  56. package/ErrorCatch/index.d.ts +4 -0
  57. package/ErrorCatch/index.js +7 -0
  58. package/ErrorCatch/index.v2.js +7 -0
  59. package/ErrorCatch/package.json +9 -0
  60. package/ErrorCatch/utils.d.ts +4 -0
  61. package/ErrorCatch/withErrorCatch.d.ts +3 -0
  62. package/Flex/package.json +1 -1
  63. package/Grid/package.json +1 -1
  64. package/Icon/package.json +1 -1
  65. package/Image/package.json +1 -1
  66. package/ImageEmoji/package.json +1 -1
  67. package/Input/cjs/style.development.css +1 -1
  68. package/Input/cjs/style.development.v2.css +1 -1
  69. package/Input/cjs/style.production.css +1 -1
  70. package/Input/cjs/style.production.v2.css +1 -1
  71. package/Input/package.json +1 -1
  72. package/InputField/package.json +1 -1
  73. package/KeyPress/package.json +1 -1
  74. package/Label/package.json +1 -1
  75. package/Line/package.json +1 -1
  76. package/Link/package.json +1 -1
  77. package/List/package.json +1 -1
  78. package/Media/package.json +1 -1
  79. package/Modal/cjs/index.development.js +2 -2
  80. package/Modal/cjs/index.development.v2.js +2 -2
  81. package/Modal/cjs/index.production.js +1 -1
  82. package/Modal/cjs/index.production.v2.js +1 -1
  83. package/Modal/package.json +1 -1
  84. package/OutsideClick/package.json +1 -1
  85. package/Overlay/cjs/index.development.js +6 -6
  86. package/Overlay/cjs/index.development.v2.js +6 -6
  87. package/Overlay/cjs/index.production.js +1 -1
  88. package/Overlay/cjs/index.production.v2.js +1 -1
  89. package/Overlay/package.json +1 -2
  90. package/PhotoGallery/cjs/index.development.js +4 -1
  91. package/PhotoGallery/cjs/index.development.v2.js +4 -1
  92. package/PhotoGallery/cjs/index.production.js +1 -1
  93. package/PhotoGallery/cjs/index.production.v2.js +1 -1
  94. package/PhotoGallery/cjs/style.development.css +1 -1
  95. package/PhotoGallery/cjs/style.development.v2.css +1 -1
  96. package/PhotoGallery/cjs/style.production.css +1 -1
  97. package/PhotoGallery/cjs/style.production.v2.css +1 -1
  98. package/PhotoGallery/index.d.ts +1 -1
  99. package/PhotoGallery/package.json +1 -1
  100. package/Picture/cjs/index.development.js +1 -1
  101. package/Picture/cjs/index.development.v2.js +1 -1
  102. package/Picture/cjs/index.production.js +1 -1
  103. package/Picture/cjs/index.production.v2.js +1 -1
  104. package/Picture/cjs/style.development.css +1 -1
  105. package/Picture/cjs/style.development.v2.css +1 -1
  106. package/Picture/cjs/style.production.css +1 -1
  107. package/Picture/cjs/style.production.v2.css +1 -1
  108. package/Picture/index.d.ts +1 -1
  109. package/Picture/package.json +1 -1
  110. package/Portal/package.json +1 -1
  111. package/Progress/cjs/index.development.js +3 -9
  112. package/Progress/cjs/index.development.v2.js +3 -9
  113. package/Progress/cjs/index.production.js +1 -1
  114. package/Progress/cjs/index.production.v2.js +1 -1
  115. package/Progress/package.json +1 -1
  116. package/QRCode/package.json +1 -1
  117. package/Rating/package.json +1 -1
  118. package/RatingSelect/package.json +1 -1
  119. package/SafeQuery/cjs/index.development.js +3 -157
  120. package/SafeQuery/cjs/index.development.v2.js +3 -157
  121. package/SafeQuery/cjs/index.production.js +1 -1
  122. package/SafeQuery/cjs/index.production.v2.js +1 -1
  123. package/SafeQuery/package.json +2 -5
  124. package/Scroll/package.json +1 -1
  125. package/ScrollControls/ScrollControlsButton.d.ts +2 -2
  126. package/ScrollControls/cjs/index.development.js +4 -4
  127. package/ScrollControls/cjs/index.development.v2.js +4 -4
  128. package/ScrollControls/cjs/index.production.js +1 -1
  129. package/ScrollControls/cjs/index.production.v2.js +1 -1
  130. package/ScrollControls/index.d.ts +5 -4
  131. package/ScrollControls/package.json +1 -1
  132. package/SimpleSlider/cjs/style.development.css +1 -1
  133. package/SimpleSlider/cjs/style.development.v2.css +1 -1
  134. package/SimpleSlider/cjs/style.production.css +1 -1
  135. package/SimpleSlider/cjs/style.production.v2.css +1 -1
  136. package/SimpleSlider/package.json +1 -1
  137. package/Skeleton/package.json +1 -1
  138. package/SnackBar/package.json +1 -1
  139. package/SnackBarManager/package.json +1 -1
  140. package/Spinner/package.json +1 -1
  141. package/Text/package.json +1 -1
  142. package/TextEmoji/package.json +1 -1
  143. package/Tooltip/cjs/index.development.js +1 -1
  144. package/Tooltip/cjs/index.development.v2.js +1 -1
  145. package/Tooltip/cjs/index.production.js +1 -1
  146. package/Tooltip/cjs/index.production.v2.js +1 -1
  147. package/Tooltip/package.json +1 -1
  148. package/Tumbler/cjs/style.development.css +1 -1
  149. package/Tumbler/cjs/style.development.v2.css +1 -1
  150. package/Tumbler/cjs/style.production.css +1 -1
  151. package/Tumbler/cjs/style.production.v2.css +1 -1
  152. package/Tumbler/package.json +1 -1
  153. package/Viewport/cjs/index.development.js +113 -0
  154. package/Viewport/cjs/index.development.v2.js +113 -0
  155. package/Viewport/cjs/index.production.js +1 -0
  156. package/Viewport/cjs/index.production.v2.js +1 -0
  157. package/Viewport/index.d.ts +15 -0
  158. package/Viewport/index.js +7 -0
  159. package/Viewport/index.v2.js +7 -0
  160. package/Viewport/package.json +9 -0
  161. package/package.json +3 -3
  162. package/useBodyTTag/package.json +1 -1
  163. package/useBrowserLayoutEffect/package.json +1 -1
  164. package/useDebounce/package.json +1 -1
  165. package/useForwardRef/package.json +1 -1
  166. package/useId/package.json +1 -1
  167. package/useInView/cjs/index.development.js +15 -0
  168. package/useInView/cjs/index.development.v2.js +15 -0
  169. package/useInView/cjs/index.production.js +1 -0
  170. package/useInView/cjs/index.production.v2.js +1 -0
  171. package/useInView/index.d.ts +9 -0
  172. package/useInView/index.js +7 -0
  173. package/useInView/index.v2.js +7 -0
  174. package/useInView/package.json +13 -0
  175. package/useIsMounted/package.json +1 -1
  176. package/useKeyPress/package.json +1 -1
  177. package/useMedia/package.json +1 -1
  178. package/useOutsideClick/package.json +1 -1
  179. package/usePortal/package.json +1 -1
  180. package/useScrollPosition/package.json +1 -1
  181. package/useSnackBar/package.json +1 -1
  182. package/SafeQuery/cjs/style.development.css +0 -1
  183. package/SafeQuery/cjs/style.development.v2.css +0 -1
  184. package/SafeQuery/cjs/style.production.css +0 -1
  185. package/SafeQuery/cjs/style.production.v2.css +0 -1
  186. package/SafeQuery/components/Error.d.ts +0 -7
@@ -0,0 +1,262 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var classNames = require('clsx');
7
+ var Button = require('@prom-ui/core/Button');
8
+ var Icon = require('@prom-ui/core/Icon');
9
+ var Overlay = require('@prom-ui/core/Overlay');
10
+ var Tooltip = require('@prom-ui/core/Tooltip');
11
+ var useMedia = require('@prom-ui/core/useMedia');
12
+
13
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
14
+
15
+ function _interopNamespaceCompat(e) {
16
+ if (e && typeof e === 'object' && 'default' in e) return e;
17
+ var n = Object.create(null);
18
+ if (e) {
19
+ Object.keys(e).forEach(function (k) {
20
+ if (k !== 'default') {
21
+ var d = Object.getOwnPropertyDescriptor(e, k);
22
+ Object.defineProperty(n, k, d.get ? d : {
23
+ enumerable: true,
24
+ get: function () { return e[k]; }
25
+ });
26
+ }
27
+ });
28
+ }
29
+ n.default = e;
30
+ return Object.freeze(n);
31
+ }
32
+
33
+ var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
34
+ var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
35
+
36
+ function _iterableToArrayLimit(arr, i) {
37
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
38
+ if (null != _i) {
39
+ var _s,
40
+ _e,
41
+ _x,
42
+ _r,
43
+ _arr = [],
44
+ _n = !0,
45
+ _d = !1;
46
+ try {
47
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
48
+ if (Object(_i) !== _i) return;
49
+ _n = !1;
50
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
51
+ } catch (err) {
52
+ _d = !0, _e = err;
53
+ } finally {
54
+ try {
55
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
56
+ } finally {
57
+ if (_d) throw _e;
58
+ }
59
+ }
60
+ return _arr;
61
+ }
62
+ }
63
+ function _defineProperty(obj, key, value) {
64
+ key = _toPropertyKey(key);
65
+ if (key in obj) {
66
+ Object.defineProperty(obj, key, {
67
+ value: value,
68
+ enumerable: true,
69
+ configurable: true,
70
+ writable: true
71
+ });
72
+ } else {
73
+ obj[key] = value;
74
+ }
75
+ return obj;
76
+ }
77
+ function _objectWithoutPropertiesLoose(source, excluded) {
78
+ if (source == null) return {};
79
+ var target = {};
80
+ var sourceKeys = Object.keys(source);
81
+ var key, i;
82
+ for (i = 0; i < sourceKeys.length; i++) {
83
+ key = sourceKeys[i];
84
+ if (excluded.indexOf(key) >= 0) continue;
85
+ target[key] = source[key];
86
+ }
87
+ return target;
88
+ }
89
+ function _objectWithoutProperties(source, excluded) {
90
+ if (source == null) return {};
91
+ var target = _objectWithoutPropertiesLoose(source, excluded);
92
+ var key, i;
93
+ if (Object.getOwnPropertySymbols) {
94
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
95
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
96
+ key = sourceSymbolKeys[i];
97
+ if (excluded.indexOf(key) >= 0) continue;
98
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
99
+ target[key] = source[key];
100
+ }
101
+ }
102
+ return target;
103
+ }
104
+ function _slicedToArray(arr, i) {
105
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
106
+ }
107
+ function _arrayWithHoles(arr) {
108
+ if (Array.isArray(arr)) return arr;
109
+ }
110
+ function _unsupportedIterableToArray(o, minLen) {
111
+ if (!o) return;
112
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
113
+ var n = Object.prototype.toString.call(o).slice(8, -1);
114
+ if (n === "Object" && o.constructor) n = o.constructor.name;
115
+ if (n === "Map" || n === "Set") return Array.from(o);
116
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
117
+ }
118
+ function _arrayLikeToArray(arr, len) {
119
+ if (len == null || len > arr.length) len = arr.length;
120
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
121
+ return arr2;
122
+ }
123
+ function _nonIterableRest() {
124
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
125
+ }
126
+ function _toPrimitive(input, hint) {
127
+ if (typeof input !== "object" || input === null) return input;
128
+ var prim = input[Symbol.toPrimitive];
129
+ if (prim !== undefined) {
130
+ var res = prim.call(input, hint || "default");
131
+ if (typeof res !== "object") return res;
132
+ throw new TypeError("@@toPrimitive must return a primitive value.");
133
+ }
134
+ return (hint === "string" ? String : Number)(input);
135
+ }
136
+ function _toPropertyKey(arg) {
137
+ var key = _toPrimitive(arg, "string");
138
+ return typeof key === "symbol" ? key : String(key);
139
+ }
140
+
141
+ var css = {"buttonContent":"ContextMenu__buttonContent___5zen8","buttonIcon":"ContextMenu__buttonIcon___X6HfE","buttonText":"ContextMenu__buttonText___-FPMX","list":"ContextMenu__list___0Zx8o","listItem":"ContextMenu__listItem___bLGxL","buttonContentColor_red-900":"ContextMenu__buttonContentColor_red-900___gQpHo"};
142
+
143
+ var _excluded = ["children", "items", "onOpen", "onClose", "isRenderPortal", "placement"];
144
+ var ContextMenu = function ContextMenu(_ref) {
145
+ var children = _ref.children,
146
+ items = _ref.items,
147
+ onOpen = _ref.onOpen,
148
+ onClose = _ref.onClose,
149
+ _ref$isRenderPortal = _ref.isRenderPortal,
150
+ isRenderPortal = _ref$isRenderPortal === void 0 ? true : _ref$isRenderPortal,
151
+ _ref$placement = _ref.placement,
152
+ placement = _ref$placement === void 0 ? 'bottom-end' : _ref$placement,
153
+ props = _objectWithoutProperties(_ref, _excluded);
154
+ var _React$useState = React__namespace.useState(false),
155
+ _React$useState2 = _slicedToArray(_React$useState, 2),
156
+ isOpen = _React$useState2[0],
157
+ setOpen = _React$useState2[1];
158
+ var isMinWidthMedium = useMedia.useMedia({
159
+ minWidth: 'medium'
160
+ });
161
+ var handleOnOpen = function handleOnOpen() {
162
+ if (onOpen) {
163
+ onOpen();
164
+ }
165
+ setOpen(true);
166
+ };
167
+ var handleOnClose = function handleOnClose() {
168
+ if (onClose) {
169
+ onClose();
170
+ }
171
+ setOpen(false);
172
+ };
173
+ var handleOnTooltipVisibleChange = function handleOnTooltipVisibleChange(visible) {
174
+ if (isOpen) {
175
+ if (!visible) {
176
+ handleOnClose();
177
+ }
178
+ } else {
179
+ if (visible) {
180
+ handleOnOpen();
181
+ }
182
+ }
183
+ };
184
+ var content = /*#__PURE__*/React__namespace.createElement("ul", {
185
+ className: css.list,
186
+ "data-qaid": props['data-qaid'] || 'context_menu',
187
+ "data-testid": props['data-testid'] || 'context_menu'
188
+ }, items.map(function (_ref2, index) {
189
+ var icon = _ref2.icon,
190
+ _onClick = _ref2.onClick,
191
+ _ref2$isCloseOnClick = _ref2.isCloseOnClick,
192
+ isCloseOnClick = _ref2$isCloseOnClick === void 0 ? true : _ref2$isCloseOnClick,
193
+ color = _ref2.color,
194
+ children = _ref2.children;
195
+ return /*#__PURE__*/React__namespace.createElement("li", {
196
+ key: index,
197
+ className: css.listItem,
198
+ "data-qaid": "context_menu_item",
199
+ "data-testid": "context_menu_item"
200
+ }, /*#__PURE__*/React__namespace.createElement(Button.Button, {
201
+ type: "button",
202
+ "button-theme": "white",
203
+ "button-width": "1-1",
204
+ "button-round": "none",
205
+ "button-padding": "xs m",
206
+ "button-blackhole": ['border-none', 'awesome-content'],
207
+ "button-weight": "normal",
208
+ "data-qaid": "context_menu_button",
209
+ "data-testid": "context_menu_button",
210
+ onClick: function onClick(e) {
211
+ if (isCloseOnClick) {
212
+ handleOnClose();
213
+ }
214
+ if (_onClick) {
215
+ _onClick(e);
216
+ }
217
+ }
218
+ }, /*#__PURE__*/React__namespace.createElement("div", {
219
+ className: classNames__default.default(css.buttonContent, _defineProperty({}, css["buttonContentColor_".concat(color)], Boolean(color)))
220
+ }, !!icon && /*#__PURE__*/React__namespace.createElement(Icon.Icon, {
221
+ className: css.buttonIcon,
222
+ "icon-as": icon,
223
+ style: {
224
+ width: 24,
225
+ height: 24
226
+ },
227
+ "data-qaid": "context_menu_button_icon",
228
+ "data-testid": "context_menu_button_icon"
229
+ }), /*#__PURE__*/React__namespace.createElement("div", {
230
+ className: css.buttonText,
231
+ "data-qaid": "context_menu_button_text",
232
+ "data-testid": "context_menu_button_text"
233
+ }, children))));
234
+ }));
235
+ if (isMinWidthMedium) {
236
+ return /*#__PURE__*/React__namespace.createElement(Tooltip.Tooltip, {
237
+ isRenderPortal: isRenderPortal,
238
+ trigger: "click",
239
+ placement: placement,
240
+ isShowArrow: false,
241
+ content: content,
242
+ isVisible: isOpen,
243
+ padding: "0",
244
+ onVisibleChange: handleOnTooltipVisibleChange
245
+ }, children);
246
+ } else {
247
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.cloneElement(children, {
248
+ onClick: handleOnOpen
249
+ }), /*#__PURE__*/React__namespace.createElement(Overlay.Overlay, {
250
+ isRenderPortal: isRenderPortal,
251
+ isOpen: isOpen,
252
+ onClose: handleOnClose,
253
+ header: null,
254
+ padding: "0"
255
+ }, content));
256
+ }
257
+ };
258
+ ContextMenu.displayName = 'ContextMenu';
259
+
260
+ exports.ContextMenu = ContextMenu;
261
+
262
+ require('./style.development.v2.css');
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("clsx"),n=require("@prom-ui/core/Button"),r=require("@prom-ui/core/Icon"),o=require("@prom-ui/core/Overlay"),i=require("@prom-ui/core/Tooltip"),u=require("@prom-ui/core/useMedia");function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function l(t){if(t&&"object"==typeof t&&"default"in t)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var c=l(t),d=a(e);function s(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,u,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var p={buttonContent:"k6I7C",buttonIcon:"AMl7D",buttonText:"_1HzQ4",list:"O4D4q",listItem:"LNQ-G","buttonContentColor_red-900":"A2TgC"},y=["children","items","onOpen","onClose","isRenderPortal","placement"],v=function(t){var e=t.children,a=t.items,l=t.onOpen,b=t.onClose,v=t.isRenderPortal,g=void 0===v||v,h=t.placement,O=void 0===h?"bottom-end":h,_=m(t,y),x=f(c.useState(!1),2),j=x[0],C=x[1],w=u.useMedia({minWidth:"medium"}),q=function(){l&&l(),C(!0)},E=function(){b&&b(),C(!1)},P=c.createElement("ul",{className:p.list,"data-qaid":_["data-qaid"]||"context_menu","data-testid":_["data-testid"]||"context_menu"},a.map((function(t,e){var o=t.icon,i=t.onClick,u=t.isCloseOnClick,a=void 0===u||u,l=t.color,m=t.children;return c.createElement("li",{key:e,className:p.listItem,"data-qaid":"context_menu_item","data-testid":"context_menu_item"},c.createElement(n.Button,{type:"button","button-theme":"white","button-width":"1-1","button-round":"none","button-padding":"xs m","button-blackhole":["border-none","awesome-content"],"button-weight":"normal","data-qaid":"context_menu_button","data-testid":"context_menu_button",onClick:function(t){a&&E(),i&&i(t)}},c.createElement("div",{className:d.default(p.buttonContent,s({},p["buttonContentColor_".concat(l)],Boolean(l)))},!!o&&c.createElement(r.Icon,{className:p.buttonIcon,"icon-as":o,style:{width:24,height:24},"data-qaid":"context_menu_button_icon","data-testid":"context_menu_button_icon"}),c.createElement("div",{className:p.buttonText,"data-qaid":"context_menu_button_text","data-testid":"context_menu_button_text"},m))))})));return w?c.createElement(i.Tooltip,{isRenderPortal:g,trigger:"click",placement:O,isShowArrow:!1,content:P,isVisible:j,padding:"0",onVisibleChange:function(t){j?t||E():t&&q()}},e):c.createElement(c.Fragment,null,c.cloneElement(e,{onClick:q}),c.createElement(o.Overlay,{isRenderPortal:g,isOpen:j,onClose:E,header:null,padding:"0"},P))};v.displayName="ContextMenu",exports.ContextMenu=v,require("./style.production.css");
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("clsx"),n=require("@prom-ui/core/Button"),r=require("@prom-ui/core/Icon"),o=require("@prom-ui/core/Overlay"),i=require("@prom-ui/core/Tooltip"),u=require("@prom-ui/core/useMedia");function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function l(t){if(t&&"object"==typeof t&&"default"in t)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var c=l(t),d=a(e);function s(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,u,a=[],l=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,o=d}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(c)throw o}}return a}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var p={buttonContent:"_5zen8",buttonIcon:"X6HfE",buttonText:"-FPMX",list:"_0Zx8o",listItem:"bLGxL","buttonContentColor_red-900":"gQpHo"},y=["children","items","onOpen","onClose","isRenderPortal","placement"],v=function(t){var e=t.children,a=t.items,l=t.onOpen,b=t.onClose,v=t.isRenderPortal,g=void 0===v||v,h=t.placement,_=void 0===h?"bottom-end":h,O=m(t,y),x=f(c.useState(!1),2),j=x[0],C=x[1],w=u.useMedia({minWidth:"medium"}),E=function(){l&&l(),C(!0)},q=function(){b&&b(),C(!1)},P=c.createElement("ul",{className:p.list,"data-qaid":O["data-qaid"]||"context_menu","data-testid":O["data-testid"]||"context_menu"},a.map((function(t,e){var o=t.icon,i=t.onClick,u=t.isCloseOnClick,a=void 0===u||u,l=t.color,m=t.children;return c.createElement("li",{key:e,className:p.listItem,"data-qaid":"context_menu_item","data-testid":"context_menu_item"},c.createElement(n.Button,{type:"button","button-theme":"white","button-width":"1-1","button-round":"none","button-padding":"xs m","button-blackhole":["border-none","awesome-content"],"button-weight":"normal","data-qaid":"context_menu_button","data-testid":"context_menu_button",onClick:function(t){a&&q(),i&&i(t)}},c.createElement("div",{className:d.default(p.buttonContent,s({},p["buttonContentColor_".concat(l)],Boolean(l)))},!!o&&c.createElement(r.Icon,{className:p.buttonIcon,"icon-as":o,style:{width:24,height:24},"data-qaid":"context_menu_button_icon","data-testid":"context_menu_button_icon"}),c.createElement("div",{className:p.buttonText,"data-qaid":"context_menu_button_text","data-testid":"context_menu_button_text"},m))))})));return w?c.createElement(i.Tooltip,{isRenderPortal:g,trigger:"click",placement:_,isShowArrow:!1,content:P,isVisible:j,padding:"0",onVisibleChange:function(t){j?t||q():t&&E()}},e):c.createElement(c.Fragment,null,c.cloneElement(e,{onClick:E}),c.createElement(o.Overlay,{isRenderPortal:g,isOpen:j,onClose:q,header:null,padding:"0"},P))};v.displayName="ContextMenu",exports.ContextMenu=v,require("./style.production.v2.css");
@@ -0,0 +1 @@
1
+ .ContextMenu__buttonContent___k6I7C{display:flex;align-items:center;flex-shrink:0;flex-wrap:nowrap;min-width:0}.ContextMenu__buttonIcon___AMl7D{margin-right:var(--pds-spacing-s)}.ContextMenu__buttonText___1HzQ4{display:block;flex:1}.ContextMenu__list___O4D4q{display:block;list-style:none;padding:0;margin:0;padding:var(--pds-spacing-xs)0}.ContextMenu__listItem___LNQ-G{display:block}.ContextMenu__buttonContentColor_red-900___A2TgC{color:var(--red-900)}
@@ -0,0 +1 @@
1
+ .ContextMenu__buttonContent___5zen8{display:flex;align-items:center;flex-shrink:0;flex-wrap:nowrap;min-width:0}.ContextMenu__buttonIcon___X6HfE{margin-right:var(--pds-spacing-s)}.ContextMenu__buttonText___-FPMX{display:block;flex:1}.ContextMenu__list___0Zx8o{display:block;list-style:none;padding:0;margin:0;padding:var(--pds-spacing-xs)0}.ContextMenu__listItem___bLGxL{display:block}.ContextMenu__buttonContentColor_red-900___gQpHo{color:var(--red-900)}
@@ -0,0 +1 @@
1
+ .k6I7C{display:flex;align-items:center;flex-shrink:0;flex-wrap:nowrap;min-width:0}.AMl7D{margin-right:var(--pds-spacing-s)}._1HzQ4{display:block;flex:1}.O4D4q{display:block;list-style:none;padding:0;margin:0;padding:var(--pds-spacing-xs)0}.LNQ-G{display:block}.A2TgC{color:var(--red-900)}
@@ -0,0 +1 @@
1
+ ._5zen8{display:flex;align-items:center;flex-shrink:0;flex-wrap:nowrap;min-width:0}.X6HfE{margin-right:var(--pds-spacing-s)}.-FPMX{display:block;flex:1}._0Zx8o{display:block;list-style:none;padding:0;margin:0;padding:var(--pds-spacing-xs)0}.bLGxL{display:block}.gQpHo{color:var(--red-900)}
@@ -0,0 +1,25 @@
1
+ import * as React from 'react';
2
+ export type ContextMenuProps = {
3
+ placement?: 'bottom-start' | 'bottom-end';
4
+ /** Элемент триггера DOM */
5
+ children: React.ReactElement<any, any>;
6
+ /** Срабатывает когда меню открыто */
7
+ onOpen?: () => void;
8
+ /** Срабатывает когда меню закрыто */
9
+ onClose?: () => void;
10
+ /** Рендер в конец `<body>` */
11
+ isRenderPortal?: boolean;
12
+ /** items */
13
+ items: {
14
+ icon?: React.ElementType;
15
+ onClick?: React.ComponentPropsWithoutRef<'button'>['onClick'];
16
+ color?: 'red-900';
17
+ children: React.ReactNode;
18
+ isCloseOnClick?: boolean;
19
+ }[];
20
+ /** @ignore */
21
+ ['data-qaid']?: string;
22
+ /** @ignore */
23
+ ['data-testid']?: string;
24
+ };
25
+ export declare const ContextMenu: React.FC<ContextMenuProps>;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./cjs/index.production.js');
5
+ } else {
6
+ module.exports = require('./cjs/index.development.js');
7
+ }
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./cjs/index.production.v2.js');
5
+ } else {
6
+ module.exports = require('./cjs/index.development.v2.js');
7
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@prom-ui/core/ContextMenu",
3
+ "version": "1.19.1",
4
+ "main": "index.js",
5
+ "types": "index.d.ts",
6
+ "sideEffects": [
7
+ "*.css"
8
+ ],
9
+ "dependencies": {
10
+ "clsx": "^2.0.0"
11
+ }
12
+ }
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { type ErrorViewProps } from './components/ErrorView';
3
+ export type ErrorCatchProps = {
4
+ /** Component display name */
5
+ name: string;
6
+ children: React.ReactNode;
7
+ /** Custom error view */
8
+ errorView?: React.ReactElement<ErrorViewProps>;
9
+ };
10
+ type ErrorCatchState = {
11
+ isError: boolean;
12
+ isHidden: boolean;
13
+ };
14
+ /**
15
+ * React-компонент, що перехоплює помилки JavaScript у будь-якому місці свого дочірнього дерева компонентів, реєструє ці помилки та відображає резервний користувацький інтерфейс.
16
+ */
17
+ export declare class ErrorCatch extends React.Component<ErrorCatchProps, ErrorCatchState> {
18
+ constructor(props: ErrorCatchProps);
19
+ static defaultProps: {
20
+ errorView: React.JSX.Element;
21
+ };
22
+ static getDerivedStateFromError(): {
23
+ isError: boolean;
24
+ };
25
+ componentDidCatch(error: Error, info: React.ErrorInfo): void;
26
+ onClose: () => void;
27
+ onReload: () => void;
28
+ render(): React.ReactNode;
29
+ }
30
+ export {};