@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.
- package/Avatar/package.json +1 -1
- package/Backdrop/package.json +1 -1
- package/Badge/package.json +1 -1
- package/Body/package.json +1 -1
- package/BodyContext/package.json +1 -1
- package/BodyProvider/cjs/index.development.js +18 -18
- package/BodyProvider/cjs/index.development.v2.js +18 -18
- package/BodyProvider/cjs/index.production.js +1 -1
- package/BodyProvider/cjs/index.production.v2.js +1 -1
- package/BodyProvider/package.json +1 -1
- package/BodyScrollLock/package.json +1 -1
- package/Box/cjs/index.development.js +1 -1
- package/Box/cjs/index.development.v2.js +1 -1
- package/Box/cjs/index.production.js +1 -1
- package/Box/cjs/index.production.v2.js +1 -1
- package/Box/cjs/style.development.css +1 -1
- package/Box/cjs/style.development.v2.css +1 -1
- package/Box/cjs/style.production.css +1 -1
- package/Box/cjs/style.production.v2.css +1 -1
- package/Box/index.d.ts +2 -2
- package/Box/package.json +1 -1
- package/Button/package.json +1 -1
- package/ButtonPageUp/package.json +1 -1
- package/Checkbox/cjs/index.development.js +9 -4
- package/Checkbox/cjs/index.development.v2.js +9 -4
- package/Checkbox/cjs/index.production.js +1 -1
- package/Checkbox/cjs/index.production.v2.js +1 -1
- package/Checkbox/cjs/style.development.css +1 -1
- package/Checkbox/cjs/style.development.v2.css +1 -1
- package/Checkbox/cjs/style.production.css +1 -1
- package/Checkbox/cjs/style.production.v2.css +1 -1
- package/Checkbox/index.d.ts +1 -0
- package/Checkbox/package.json +1 -1
- package/ContextMenu/cjs/index.development.js +262 -0
- package/ContextMenu/cjs/index.development.v2.js +262 -0
- package/ContextMenu/cjs/index.production.js +1 -0
- package/ContextMenu/cjs/index.production.v2.js +1 -0
- package/ContextMenu/cjs/style.development.css +1 -0
- package/ContextMenu/cjs/style.development.v2.css +1 -0
- package/ContextMenu/cjs/style.production.css +1 -0
- package/ContextMenu/cjs/style.production.v2.css +1 -0
- package/ContextMenu/index.d.ts +25 -0
- package/ContextMenu/index.js +7 -0
- package/ContextMenu/index.v2.js +7 -0
- package/ContextMenu/package.json +12 -0
- package/ErrorCatch/ErrorCatch.d.ts +30 -0
- package/ErrorCatch/cjs/index.development.js +367 -0
- package/ErrorCatch/cjs/index.development.v2.js +367 -0
- package/ErrorCatch/cjs/index.production.js +1 -0
- package/ErrorCatch/cjs/index.production.v2.js +1 -0
- package/ErrorCatch/cjs/style.development.css +1 -0
- package/ErrorCatch/cjs/style.development.v2.css +1 -0
- package/ErrorCatch/cjs/style.production.css +1 -0
- package/ErrorCatch/cjs/style.production.v2.css +1 -0
- package/ErrorCatch/components/ErrorView.d.ts +7 -0
- package/ErrorCatch/index.d.ts +4 -0
- package/ErrorCatch/index.js +7 -0
- package/ErrorCatch/index.v2.js +7 -0
- package/ErrorCatch/package.json +9 -0
- package/ErrorCatch/utils.d.ts +4 -0
- package/ErrorCatch/withErrorCatch.d.ts +3 -0
- package/Flex/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Icon/package.json +1 -1
- package/Image/package.json +1 -1
- package/ImageEmoji/package.json +1 -1
- package/Input/cjs/style.development.css +1 -1
- package/Input/cjs/style.development.v2.css +1 -1
- package/Input/cjs/style.production.css +1 -1
- package/Input/cjs/style.production.v2.css +1 -1
- package/Input/package.json +1 -1
- package/InputField/package.json +1 -1
- package/KeyPress/package.json +1 -1
- package/Label/package.json +1 -1
- package/Line/package.json +1 -1
- package/Link/package.json +1 -1
- package/List/package.json +1 -1
- package/Media/package.json +1 -1
- package/Modal/cjs/index.development.js +2 -2
- package/Modal/cjs/index.development.v2.js +2 -2
- package/Modal/cjs/index.production.js +1 -1
- package/Modal/cjs/index.production.v2.js +1 -1
- package/Modal/package.json +1 -1
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +6 -6
- package/Overlay/cjs/index.development.v2.js +6 -6
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -1
- package/Overlay/package.json +1 -2
- package/PhotoGallery/cjs/index.development.js +4 -1
- package/PhotoGallery/cjs/index.development.v2.js +4 -1
- package/PhotoGallery/cjs/index.production.js +1 -1
- package/PhotoGallery/cjs/index.production.v2.js +1 -1
- package/PhotoGallery/cjs/style.development.css +1 -1
- package/PhotoGallery/cjs/style.development.v2.css +1 -1
- package/PhotoGallery/cjs/style.production.css +1 -1
- package/PhotoGallery/cjs/style.production.v2.css +1 -1
- package/PhotoGallery/index.d.ts +1 -1
- package/PhotoGallery/package.json +1 -1
- package/Picture/cjs/index.development.js +1 -1
- package/Picture/cjs/index.development.v2.js +1 -1
- package/Picture/cjs/index.production.js +1 -1
- package/Picture/cjs/index.production.v2.js +1 -1
- package/Picture/cjs/style.development.css +1 -1
- package/Picture/cjs/style.development.v2.css +1 -1
- package/Picture/cjs/style.production.css +1 -1
- package/Picture/cjs/style.production.v2.css +1 -1
- package/Picture/index.d.ts +1 -1
- package/Picture/package.json +1 -1
- package/Portal/package.json +1 -1
- package/Progress/cjs/index.development.js +3 -9
- package/Progress/cjs/index.development.v2.js +3 -9
- package/Progress/cjs/index.production.js +1 -1
- package/Progress/cjs/index.production.v2.js +1 -1
- package/Progress/package.json +1 -1
- package/QRCode/package.json +1 -1
- package/Rating/package.json +1 -1
- package/RatingSelect/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +3 -157
- package/SafeQuery/cjs/index.development.v2.js +3 -157
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -1
- package/SafeQuery/package.json +2 -5
- package/Scroll/package.json +1 -1
- package/ScrollControls/ScrollControlsButton.d.ts +2 -2
- package/ScrollControls/cjs/index.development.js +4 -4
- package/ScrollControls/cjs/index.development.v2.js +4 -4
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -1
- package/ScrollControls/index.d.ts +5 -4
- package/ScrollControls/package.json +1 -1
- package/SimpleSlider/cjs/style.development.css +1 -1
- package/SimpleSlider/cjs/style.development.v2.css +1 -1
- package/SimpleSlider/cjs/style.production.css +1 -1
- package/SimpleSlider/cjs/style.production.v2.css +1 -1
- package/SimpleSlider/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/SnackBar/package.json +1 -1
- package/SnackBarManager/package.json +1 -1
- package/Spinner/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +1 -1
- package/Tooltip/cjs/index.development.v2.js +1 -1
- package/Tooltip/cjs/index.production.js +1 -1
- package/Tooltip/cjs/index.production.v2.js +1 -1
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/style.development.css +1 -1
- package/Tumbler/cjs/style.development.v2.css +1 -1
- package/Tumbler/cjs/style.production.css +1 -1
- package/Tumbler/cjs/style.production.v2.css +1 -1
- package/Tumbler/package.json +1 -1
- package/Viewport/cjs/index.development.js +113 -0
- package/Viewport/cjs/index.development.v2.js +113 -0
- package/Viewport/cjs/index.production.js +1 -0
- package/Viewport/cjs/index.production.v2.js +1 -0
- package/Viewport/index.d.ts +15 -0
- package/Viewport/index.js +7 -0
- package/Viewport/index.v2.js +7 -0
- package/Viewport/package.json +9 -0
- package/package.json +3 -3
- package/useBodyTTag/package.json +1 -1
- package/useBrowserLayoutEffect/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useForwardRef/package.json +1 -1
- package/useId/package.json +1 -1
- package/useInView/cjs/index.development.js +15 -0
- package/useInView/cjs/index.development.v2.js +15 -0
- package/useInView/cjs/index.production.js +1 -0
- package/useInView/cjs/index.production.v2.js +1 -0
- package/useInView/index.d.ts +9 -0
- package/useInView/index.js +7 -0
- package/useInView/index.v2.js +7 -0
- package/useInView/package.json +13 -0
- package/useIsMounted/package.json +1 -1
- package/useKeyPress/package.json +1 -1
- package/useMedia/package.json +1 -1
- package/useOutsideClick/package.json +1 -1
- package/usePortal/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSnackBar/package.json +1 -1
- package/SafeQuery/cjs/style.development.css +0 -1
- package/SafeQuery/cjs/style.development.v2.css +0 -1
- package/SafeQuery/cjs/style.production.css +0 -1
- package/SafeQuery/cjs/style.production.v2.css +0 -1
- 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,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 {};
|