@devtron-labs/devtron-fe-common-lib 0.0.6-beta-20 → 0.0.6-beta-22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Common/Checkbox.d.ts +18 -0
- package/dist/Common/Constants.d.ts +16 -0
- package/dist/Common/CustomTagSelector/PropagateTagInfo.d.ts +3 -1
- package/dist/Common/CustomTagSelector/ResizableTagTextArea.d.ts +3 -0
- package/dist/Common/CustomTagSelector/TagDetails.d.ts +1 -1
- package/dist/Common/CustomTagSelector/TagLabelSelect.d.ts +1 -1
- package/dist/Common/CustomTagSelector/TagLabelValueSelector.d.ts +1 -1
- package/dist/Common/Error.d.ts +5 -3
- package/dist/Common/Helper.d.ts +2 -0
- package/dist/Common/Modals/Modal.d.ts +2 -1
- package/dist/Common/PopupMenu.d.ts +5 -3
- package/dist/Common/Types.d.ts +33 -8
- package/dist/Common/index.d.ts +1 -0
- package/dist/index.js +224 -70
- package/package.json +1 -1
- package/src/Assets/Icon/ic-cross.svg +3 -0
- package/src/Common/Checkbox.tsx +49 -0
- package/src/Common/Constants.ts +14 -1
- package/src/Common/CustomTagSelector/PropagateTagInfo.tsx +16 -7
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +74 -0
- package/src/Common/CustomTagSelector/TagDetails.tsx +19 -7
- package/src/Common/CustomTagSelector/TagLabelSelect.tsx +5 -3
- package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +49 -30
- package/src/Common/Error.tsx +12 -4
- package/src/Common/Helper.tsx +23 -0
- package/src/Common/Modals/Modal.tsx +39 -30
- package/src/Common/PopupMenu.tsx +114 -63
- package/src/Common/TippyCustomized.tsx +2 -2
- package/src/Common/Types.ts +42 -18
- package/src/Common/index.ts +2 -1
package/dist/index.js
CHANGED
|
@@ -26,6 +26,11 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
26
26
|
|
|
27
27
|
var RequestTimeout = 60000;
|
|
28
28
|
var Host = process.env.REACT_APP_ORCHESTRATOR_ROOT;
|
|
29
|
+
var DOCUMENTATION_HOME_PAGE = 'https://docs.devtron.ai';
|
|
30
|
+
var DOCUMENTATION = {
|
|
31
|
+
APP_TAGS: "".concat(DOCUMENTATION_HOME_PAGE, "/v/v0.6/usage/applications/create-application#tags"),
|
|
32
|
+
APP_OVERVIEW_TAGS: "".concat(DOCUMENTATION_HOME_PAGE, "/v/v0.6/usage/applications/overview#manage-tags"),
|
|
33
|
+
};
|
|
29
34
|
var PATTERNS = {
|
|
30
35
|
KUBERNETES_KEY_PREFIX: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/,
|
|
31
36
|
KUBERNETES_KEY_NAME: /^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$/,
|
|
@@ -34,7 +39,13 @@ var PATTERNS = {
|
|
|
34
39
|
};
|
|
35
40
|
var ROUTES = {
|
|
36
41
|
PROJECT_LIST_MIN: 'team/autocomplete',
|
|
37
|
-
};
|
|
42
|
+
};
|
|
43
|
+
exports.KEY_VALUE = void 0;
|
|
44
|
+
(function (KEY_VALUE) {
|
|
45
|
+
KEY_VALUE["KEY"] = "key";
|
|
46
|
+
KEY_VALUE["VALUE"] = "value";
|
|
47
|
+
})(exports.KEY_VALUE || (exports.KEY_VALUE = {}));
|
|
48
|
+
var DEFAULT_TAG_DATA = { key: '', value: '', propagate: false, isInvalidKey: false, isInvalidValue: false };
|
|
38
49
|
|
|
39
50
|
/******************************************************************************
|
|
40
51
|
Copyright (c) Microsoft Corporation.
|
|
@@ -437,9 +448,9 @@ var css_248z$3 = ".empty-state {\n height: 100%;\n}\n.empty-state img {\n heig
|
|
|
437
448
|
styleInject(css_248z$3);
|
|
438
449
|
|
|
439
450
|
var _g$2;
|
|
440
|
-
function _extends$
|
|
451
|
+
function _extends$b() { _extends$b = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
|
|
441
452
|
var SvgIcProgressing = function SvgIcProgressing(props) {
|
|
442
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
453
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
|
|
443
454
|
xmlns: "http://www.w3.org/2000/svg",
|
|
444
455
|
viewBox: "0 0 24 24",
|
|
445
456
|
width: "1em",
|
|
@@ -491,8 +502,8 @@ EmptyState.Loading = Loading;
|
|
|
491
502
|
|
|
492
503
|
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
493
504
|
|
|
494
|
-
function _extends$
|
|
495
|
-
_extends$
|
|
505
|
+
function _extends$a() {
|
|
506
|
+
_extends$a = Object.assign || function (target) {
|
|
496
507
|
for (var i = 1; i < arguments.length; i++) {
|
|
497
508
|
var source = arguments[i];
|
|
498
509
|
|
|
@@ -506,7 +517,7 @@ function _extends$9() {
|
|
|
506
517
|
return target;
|
|
507
518
|
};
|
|
508
519
|
|
|
509
|
-
return _extends$
|
|
520
|
+
return _extends$a.apply(this, arguments);
|
|
510
521
|
}
|
|
511
522
|
|
|
512
523
|
function _objectWithoutPropertiesLoose$2(source, excluded) {
|
|
@@ -1232,7 +1243,7 @@ function ProgressBar(_ref) {
|
|
|
1232
1243
|
isIn = _ref.isIn,
|
|
1233
1244
|
theme = _ref.theme;
|
|
1234
1245
|
|
|
1235
|
-
var style = _extends$
|
|
1246
|
+
var style = _extends$a({}, userStyle, {
|
|
1236
1247
|
animationDuration: delay + "ms",
|
|
1237
1248
|
animationPlayState: isRunning ? 'running' : 'paused',
|
|
1238
1249
|
opacity: hide ? 0 : 1
|
|
@@ -1509,9 +1520,9 @@ var ToastContainer = function ToastContainer(props) {
|
|
|
1509
1520
|
,
|
|
1510
1521
|
id: containerId
|
|
1511
1522
|
}, getToastToRender(function (position, toastList) {
|
|
1512
|
-
var containerStyle = !toastList.length ? _extends$
|
|
1523
|
+
var containerStyle = !toastList.length ? _extends$a({}, style, {
|
|
1513
1524
|
pointerEvents: 'none'
|
|
1514
|
-
}) : _extends$
|
|
1525
|
+
}) : _extends$a({}, style);
|
|
1515
1526
|
return React.createElement("div", {
|
|
1516
1527
|
className: getClassName(position),
|
|
1517
1528
|
style: containerStyle,
|
|
@@ -1618,7 +1629,7 @@ function dispatchToast(content, options) {
|
|
|
1618
1629
|
|
|
1619
1630
|
|
|
1620
1631
|
function mergeOptions(type, options) {
|
|
1621
|
-
return _extends$
|
|
1632
|
+
return _extends$a({}, options, {
|
|
1622
1633
|
type: options && options.type || type,
|
|
1623
1634
|
toastId: getToastId(options)
|
|
1624
1635
|
});
|
|
@@ -1635,7 +1646,7 @@ function toast(content, options) {
|
|
|
1635
1646
|
}
|
|
1636
1647
|
|
|
1637
1648
|
toast.loading = function (content, options) {
|
|
1638
|
-
return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$
|
|
1649
|
+
return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$a({
|
|
1639
1650
|
isLoading: true,
|
|
1640
1651
|
autoClose: false,
|
|
1641
1652
|
closeOnClick: false,
|
|
@@ -1651,7 +1662,7 @@ function handlePromise(promise, _ref2, options) {
|
|
|
1651
1662
|
var id;
|
|
1652
1663
|
|
|
1653
1664
|
if (pending) {
|
|
1654
|
-
id = isStr(pending) ? toast.loading(pending, options) : toast.loading(pending.render, _extends$
|
|
1665
|
+
id = isStr(pending) ? toast.loading(pending, options) : toast.loading(pending.render, _extends$a({}, options, pending));
|
|
1655
1666
|
}
|
|
1656
1667
|
|
|
1657
1668
|
var resetParams = {
|
|
@@ -1670,7 +1681,7 @@ function handlePromise(promise, _ref2, options) {
|
|
|
1670
1681
|
return;
|
|
1671
1682
|
}
|
|
1672
1683
|
|
|
1673
|
-
var baseParams = _extends$
|
|
1684
|
+
var baseParams = _extends$a({
|
|
1674
1685
|
type: type
|
|
1675
1686
|
}, resetParams, options, {
|
|
1676
1687
|
data: result
|
|
@@ -1681,10 +1692,10 @@ function handlePromise(promise, _ref2, options) {
|
|
|
1681
1692
|
} : input; // if the id is set we know that it's an update
|
|
1682
1693
|
|
|
1683
1694
|
if (id) {
|
|
1684
|
-
toast.update(id, _extends$
|
|
1695
|
+
toast.update(id, _extends$a({}, baseParams, params));
|
|
1685
1696
|
} else {
|
|
1686
1697
|
// using toast.promise without loading
|
|
1687
|
-
toast(params.render, _extends$
|
|
1698
|
+
toast(params.render, _extends$a({}, baseParams, params));
|
|
1688
1699
|
}
|
|
1689
1700
|
|
|
1690
1701
|
return result;
|
|
@@ -1708,7 +1719,7 @@ toast.warning = /*#__PURE__*/createToastByType(TYPE.WARNING);
|
|
|
1708
1719
|
toast.warn = toast.warning;
|
|
1709
1720
|
|
|
1710
1721
|
toast.dark = function (content, options) {
|
|
1711
|
-
return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$
|
|
1722
|
+
return dispatchToast(content, mergeOptions(TYPE.DEFAULT, _extends$a({
|
|
1712
1723
|
theme: 'dark'
|
|
1713
1724
|
}, options)));
|
|
1714
1725
|
};
|
|
@@ -1765,7 +1776,7 @@ toast.update = function (toastId, options) {
|
|
|
1765
1776
|
var oldOptions = toast.props,
|
|
1766
1777
|
oldContent = toast.content;
|
|
1767
1778
|
|
|
1768
|
-
var nextOptions = _extends$
|
|
1779
|
+
var nextOptions = _extends$a({}, oldOptions, options, {
|
|
1769
1780
|
toastId: options.toastId || toastId,
|
|
1770
1781
|
updateId: generateToastId()
|
|
1771
1782
|
});
|
|
@@ -1924,7 +1935,7 @@ var ErrorScreenManager = /** @class */ (function (_super) {
|
|
|
1924
1935
|
case 401:
|
|
1925
1936
|
return 'Unauthorized';
|
|
1926
1937
|
case 403:
|
|
1927
|
-
return jsxRuntime.jsx(ErrorScreenNotAuthorized, { subtitle: this.props.subtitle });
|
|
1938
|
+
return (jsxRuntime.jsx(ErrorScreenNotAuthorized, { subtitle: this.props.subtitle, subtitleClass: this.props.subtitleClass }));
|
|
1928
1939
|
case 404:
|
|
1929
1940
|
return 'Not Found';
|
|
1930
1941
|
case 500:
|
|
@@ -1949,9 +1960,9 @@ var ErrorScreenNotAuthorized = /** @class */ (function (_super) {
|
|
|
1949
1960
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
1950
1961
|
}
|
|
1951
1962
|
ErrorScreenNotAuthorized.prototype.render = function () {
|
|
1952
|
-
return (jsxRuntime.jsxs(EmptyState, { children: [jsxRuntime.jsx(EmptyState.Image, { children: jsxRuntime.jsx("img", { src: notAuthorized, alt: "Not Authorized" }) }), jsxRuntime.jsx(EmptyState.Title, { children: jsxRuntime.jsx("h3", __assign({ className: "title" }, { children: "Not authorized" })) }), jsxRuntime.jsx(EmptyState.Subtitle, { children: this.props.subtitle
|
|
1963
|
+
return (jsxRuntime.jsxs(EmptyState, { children: [jsxRuntime.jsx(EmptyState.Image, { children: jsxRuntime.jsx("img", { src: notAuthorized, alt: "Not Authorized" }) }), jsxRuntime.jsx(EmptyState.Title, { children: jsxRuntime.jsx("h3", __assign({ className: "title" }, { children: "Not authorized" })) }), jsxRuntime.jsx(EmptyState.Subtitle, __assign({ className: this.props.subtitleClass }, { children: this.props.subtitle
|
|
1953
1964
|
? this.props.subtitle
|
|
1954
|
-
: "Looks like you don't have access to information on this page. Please contact your manager to request access." })] }));
|
|
1965
|
+
: "Looks like you don't have access to information on this page. Please contact your manager to request access." }))] }));
|
|
1955
1966
|
};
|
|
1956
1967
|
return ErrorScreenNotAuthorized;
|
|
1957
1968
|
}(React.Component));
|
|
@@ -3889,6 +3900,25 @@ function sortCallback(key, a, b, isCaseSensitive) {
|
|
|
3889
3900
|
return 1;
|
|
3890
3901
|
}
|
|
3891
3902
|
return 0;
|
|
3903
|
+
}
|
|
3904
|
+
var stopPropagation = function (event) {
|
|
3905
|
+
event.stopPropagation();
|
|
3906
|
+
};
|
|
3907
|
+
function useThrottledEffect(callback, delay, deps) {
|
|
3908
|
+
if (deps === void 0) { deps = []; }
|
|
3909
|
+
//function will be executed only once in a given time interval.
|
|
3910
|
+
var lastRan = React.useRef(Date.now());
|
|
3911
|
+
React.useEffect(function () {
|
|
3912
|
+
var handler = setTimeout(function () {
|
|
3913
|
+
if (Date.now() - lastRan.current >= delay) {
|
|
3914
|
+
callback();
|
|
3915
|
+
lastRan.current = Date.now();
|
|
3916
|
+
}
|
|
3917
|
+
}, delay - (Date.now() - lastRan.current));
|
|
3918
|
+
return function () {
|
|
3919
|
+
clearTimeout(handler);
|
|
3920
|
+
};
|
|
3921
|
+
}, __spreadArray([delay], __read(deps), false));
|
|
3892
3922
|
}
|
|
3893
3923
|
|
|
3894
3924
|
function Progressing(_a) {
|
|
@@ -3964,12 +3994,13 @@ var Drawer = function (_a) {
|
|
|
3964
3994
|
};
|
|
3965
3995
|
|
|
3966
3996
|
var Modal = function (_a) {
|
|
3967
|
-
var _b = _a.style, style = _b === void 0 ? {} : _b, children = _a.children, _c = _a.modal, modal = _c === void 0 ? false : _c, _d = _a.rootClassName, rootClassName = _d === void 0 ?
|
|
3997
|
+
var _b = _a.style, style = _b === void 0 ? {} : _b, children = _a.children, _c = _a.modal, modal = _c === void 0 ? false : _c, _d = _a.rootClassName, rootClassName = _d === void 0 ? '' : _d, _e = _a.onClick, onClick = _e === void 0 ? null : _e, _f = _a.callbackRef, callbackRef = _f === void 0 ? null : _f, _g = _a.preventWheelDisable, preventWheelDisable = _g === void 0 ? false : _g;
|
|
3968
3998
|
var innerRef = React.useRef(null);
|
|
3969
3999
|
function handleClick(e) {
|
|
4000
|
+
var _a;
|
|
3970
4001
|
if (typeof onClick !== 'function')
|
|
3971
4002
|
return;
|
|
3972
|
-
if (innerRef && innerRef.current.contains(e.target)) {
|
|
4003
|
+
if (innerRef && ((_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
|
|
3973
4004
|
onClick(e, 'in');
|
|
3974
4005
|
}
|
|
3975
4006
|
else {
|
|
@@ -3977,26 +4008,30 @@ var Modal = function (_a) {
|
|
|
3977
4008
|
}
|
|
3978
4009
|
}
|
|
3979
4010
|
function disableWheel(e) {
|
|
3980
|
-
if (
|
|
3981
|
-
if (innerRef
|
|
4011
|
+
if (!preventWheelDisable) {
|
|
4012
|
+
if (innerRef === null || innerRef === void 0 ? void 0 : innerRef.current.contains(e.target)) {
|
|
4013
|
+
if (innerRef.current.clientHeight === innerRef.current.scrollHeight) {
|
|
4014
|
+
e.preventDefault();
|
|
4015
|
+
}
|
|
4016
|
+
}
|
|
4017
|
+
else {
|
|
3982
4018
|
e.preventDefault();
|
|
3983
4019
|
}
|
|
3984
4020
|
}
|
|
3985
|
-
else {
|
|
3986
|
-
e.preventDefault();
|
|
3987
|
-
}
|
|
3988
4021
|
}
|
|
3989
4022
|
React.useEffect(function () {
|
|
3990
4023
|
document.addEventListener('click', handleClick);
|
|
3991
|
-
var modal = document.getElementById(
|
|
4024
|
+
var modal = document.getElementById('visible-modal');
|
|
3992
4025
|
if (modal)
|
|
3993
|
-
modal.classList.add(
|
|
3994
|
-
|
|
4026
|
+
modal.classList.add('show');
|
|
4027
|
+
if (!preventWheelDisable)
|
|
4028
|
+
document.body.addEventListener('wheel', disableWheel, { passive: false });
|
|
3995
4029
|
return function () {
|
|
3996
|
-
|
|
4030
|
+
if (!preventWheelDisable)
|
|
4031
|
+
document.body.removeEventListener('wheel', disableWheel);
|
|
3997
4032
|
document.removeEventListener('click', handleClick);
|
|
3998
4033
|
if (modal)
|
|
3999
|
-
modal.classList.remove(
|
|
4034
|
+
modal.classList.remove('show');
|
|
4000
4035
|
};
|
|
4001
4036
|
}, []);
|
|
4002
4037
|
return ReactDOM.createPortal(jsxRuntime.jsx("div", __assign({ tabIndex: 0, onClick: onClick, ref: function (el) {
|
|
@@ -4008,9 +4043,9 @@ var Modal = function (_a) {
|
|
|
4008
4043
|
};
|
|
4009
4044
|
|
|
4010
4045
|
var _defs, _use;
|
|
4011
|
-
function _extends$
|
|
4046
|
+
function _extends$9() { _extends$9 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
|
|
4012
4047
|
var SvgIcClose = function SvgIcClose(props) {
|
|
4013
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
4048
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
|
|
4014
4049
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4015
4050
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
4016
4051
|
width: "1em",
|
|
@@ -4201,9 +4236,10 @@ function usePopupContext() {
|
|
|
4201
4236
|
return context;
|
|
4202
4237
|
}
|
|
4203
4238
|
function PopupMenu(_a) {
|
|
4204
|
-
var _b
|
|
4205
|
-
var
|
|
4206
|
-
var
|
|
4239
|
+
var _b;
|
|
4240
|
+
var _c = _a.children, children = _c === void 0 ? null : _c, _d = _a.onToggleCallback, onToggleCallback = _d === void 0 ? null : _d, _e = _a.autoClose, autoClose = _e === void 0 ? false : _e, _f = _a.autoPosition, autoPosition = _f === void 0 ? false : _f;
|
|
4241
|
+
var _g = __read(React.useState(null), 2), popupPosition = _g[0], setPopupPosition = _g[1];
|
|
4242
|
+
var _h = __read(React.useState(0), 2), opacity = _h[0], setOpacity = _h[1];
|
|
4207
4243
|
var observer = React.useRef(null);
|
|
4208
4244
|
var buttonRef = React.useRef(null);
|
|
4209
4245
|
var buttonWidth = React.useRef(null);
|
|
@@ -4224,10 +4260,16 @@ function PopupMenu(_a) {
|
|
|
4224
4260
|
}
|
|
4225
4261
|
}
|
|
4226
4262
|
}, [popupPosition]);
|
|
4263
|
+
React.useEffect(function () {
|
|
4264
|
+
if ((buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) && autoPosition && popupPosition) {
|
|
4265
|
+
var _a = buttonRef.current.getBoundingClientRect(), height = _a.height, x = _a.x, y = _a.y;
|
|
4266
|
+
setPopupPosition({ left: x, top: y + height });
|
|
4267
|
+
}
|
|
4268
|
+
}, [(_b = buttonRef === null || buttonRef === void 0 ? void 0 : buttonRef.current) === null || _b === void 0 ? void 0 : _b.clientHeight]);
|
|
4227
4269
|
var options = {
|
|
4228
4270
|
root: null,
|
|
4229
4271
|
rootMargin: '0px',
|
|
4230
|
-
threshold: 1.0
|
|
4272
|
+
threshold: 1.0,
|
|
4231
4273
|
};
|
|
4232
4274
|
if (!children)
|
|
4233
4275
|
return children;
|
|
@@ -4255,7 +4297,7 @@ function PopupMenu(_a) {
|
|
|
4255
4297
|
var handleOpen = function (e) {
|
|
4256
4298
|
e.stopPropagation();
|
|
4257
4299
|
setOpacity(0);
|
|
4258
|
-
var _a = e.currentTarget.getBoundingClientRect()
|
|
4300
|
+
var _a = e.currentTarget.getBoundingClientRect(), height = _a.height, x = _a.x, y = _a.y;
|
|
4259
4301
|
setPopupPosition({ left: x, top: y + height });
|
|
4260
4302
|
};
|
|
4261
4303
|
var handleClose = function (e, inOrOut) {
|
|
@@ -4284,17 +4326,27 @@ function PopupMenu(_a) {
|
|
|
4284
4326
|
var _a = buttonEl.getBoundingClientRect(); _a.bottom; _a.height; _a.left; _a.right; _a.top; var width = _a.width; _a.x; _a.y;
|
|
4285
4327
|
buttonWidth.current = width;
|
|
4286
4328
|
}
|
|
4287
|
-
return jsxRuntime.jsx(PopupContext.Provider, __assign({ value: {
|
|
4329
|
+
return (jsxRuntime.jsx(PopupContext.Provider, __assign({ value: {
|
|
4330
|
+
handleOpen: handleOpen,
|
|
4331
|
+
popupPosition: popupPosition,
|
|
4332
|
+
handleClose: handleClose,
|
|
4333
|
+
opacity: opacity,
|
|
4334
|
+
setPopupPosition: setPopupPosition,
|
|
4335
|
+
callbackRef: callbackRef,
|
|
4336
|
+
buttonRef: buttonRef,
|
|
4337
|
+
initialiseButtonWidth: initialiseButtonWidth,
|
|
4338
|
+
buttonWidth: buttonWidth,
|
|
4339
|
+
} }, { children: children })));
|
|
4288
4340
|
}
|
|
4289
4341
|
function Button(_a) {
|
|
4290
|
-
var _b = _a.children, children = _b === void 0 ? null : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.rootClassName, rootClassName = _d === void 0 ?
|
|
4342
|
+
var _b = _a.children, children = _b === void 0 ? null : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.rootClassName, rootClassName = _d === void 0 ? '' : _d, _e = _a.tabIndex, tabIndex = _e === void 0 ? 0 : _e, _f = _a.onHover, onHover = _f === void 0 ? false : _f, _g = _a.isKebab, isKebab = _g === void 0 ? false : _g;
|
|
4291
4343
|
var _h = usePopupContext(), handleOpen = _h.handleOpen, popupPosition = _h.popupPosition; _h.buttonRef; var initialiseButtonWidth = _h.initialiseButtonWidth;
|
|
4292
|
-
return jsxRuntime.jsx("button", __assign({ ref: initialiseButtonWidth, type: "button", tabIndex: tabIndex, disabled: disabled, className: "".concat(rootClassName, " ").concat(popupPosition ? 'focused' : '', " ").concat(isKebab ? 'popup-button-kebab' :
|
|
4344
|
+
return (jsxRuntime.jsx("button", __assign({ ref: initialiseButtonWidth, type: "button", tabIndex: tabIndex, disabled: disabled, className: "".concat(rootClassName, " ").concat(popupPosition ? 'focused' : '', " ").concat(isKebab ? 'popup-button-kebab' : 'popup-button'), onMouseEnter: onHover ? (disabled ? null : handleOpen) : function () { }, onClick: disabled ? null : handleOpen }, { children: children })));
|
|
4293
4345
|
}
|
|
4294
4346
|
function Body$1(_a) {
|
|
4295
|
-
var _b = _a.children, children = _b === void 0 ? null : _b, _c = _a.rootClassName, rootClassName = _c === void 0 ?
|
|
4296
|
-
var
|
|
4297
|
-
return popupPosition ? jsxRuntime.jsx(Modal, __assign({ callbackRef: callbackRef, onClick: handleClose, rootClassName: "".concat(rootClassName, " popup-body ").concat(!children ? 'popup-body--empty' : '', " ").concat(Object.keys(popupPosition).join(
|
|
4347
|
+
var _b = _a.children, children = _b === void 0 ? null : _b, _c = _a.rootClassName, rootClassName = _c === void 0 ? '' : _c, _d = _a.style, style = _d === void 0 ? {} : _d, _e = _a.autoWidth, autoWidth = _e === void 0 ? false : _e, _f = _a.preventWheelDisable, preventWheelDisable = _f === void 0 ? false : _f;
|
|
4348
|
+
var _g = usePopupContext(), handleClose = _g.handleClose, popupPosition = _g.popupPosition, opacity = _g.opacity, callbackRef = _g.callbackRef, buttonWidth = _g.buttonWidth;
|
|
4349
|
+
return popupPosition ? (jsxRuntime.jsx(Modal, __assign({ callbackRef: callbackRef, onClick: handleClose, rootClassName: "".concat(rootClassName, " popup-body ").concat(!children ? 'popup-body--empty' : '', " ").concat(Object.keys(popupPosition).join(' ')), style: __assign(__assign(__assign(__assign({}, popupPosition), style), (autoWidth ? { width: buttonWidth.current } : {})), { opacity: opacity }), preventWheelDisable: preventWheelDisable }, { children: children }))) : null;
|
|
4298
4350
|
}
|
|
4299
4351
|
PopupMenu.Button = Button;
|
|
4300
4352
|
PopupMenu.Body = Body$1;
|
|
@@ -8303,6 +8355,21 @@ var index$1 = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));
|
|
|
8303
8355
|
|
|
8304
8356
|
var Tippy = index$1;
|
|
8305
8357
|
|
|
8358
|
+
var _path$5;
|
|
8359
|
+
function _extends$8() { _extends$8 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
|
|
8360
|
+
var SvgIcCross = function SvgIcCross(props) {
|
|
8361
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
|
|
8362
|
+
width: "1em",
|
|
8363
|
+
height: "1em",
|
|
8364
|
+
viewBox: "0 0 24 24",
|
|
8365
|
+
fill: "none",
|
|
8366
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8367
|
+
}, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
8368
|
+
d: "M19.28 5.78a.75.75 0 0 0-1.06-1.06l1.06 1.06ZM4.72 18.22a.75.75 0 1 0 1.06 1.06l-1.06-1.06Zm13.5 1.06a.75.75 0 1 0 1.06-1.06l-1.06 1.06ZM5.78 4.72a.75.75 0 0 0-1.06 1.06l1.06-1.06Zm12.44 0-6.75 6.75 1.06 1.06 6.75-6.75-1.06-1.06Zm-6.75 6.75-6.75 6.75 1.06 1.06 6.75-6.75-1.06-1.06Zm7.81 6.75-6.75-6.75-1.06 1.06 6.75 6.75 1.06-1.06Zm-6.75-6.75L5.78 4.72 4.72 5.78l6.75 6.75 1.06-1.06Z",
|
|
8369
|
+
fill: "#596168"
|
|
8370
|
+
})));
|
|
8371
|
+
};
|
|
8372
|
+
|
|
8306
8373
|
var css_248z$1 = ".tippy-box[data-animation=shift-toward-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=top][data-state=hidden]{transform:translateY(-5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=bottom][data-state=hidden]{transform:translateY(5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=left][data-state=hidden]{transform:translateX(-5px)}.tippy-box[data-animation=shift-toward-subtle][data-state=hidden][data-placement^=right][data-state=hidden]{transform:translateX(5px)}";
|
|
8307
8374
|
styleInject(css_248z$1);
|
|
8308
8375
|
|
|
@@ -8332,9 +8399,9 @@ function TippyCustomized(props) {
|
|
|
8332
8399
|
};
|
|
8333
8400
|
var getTippyContent = function () {
|
|
8334
8401
|
var Icon = props.Icon, iconPath = props.iconPath, iconClass = props.iconClass, iconSize = props.iconSize, onImageLoadError = props.onImageLoadError, heading = props.heading, infoTextHeading = props.infoTextHeading, infoText = props.infoText, showCloseButton = props.showCloseButton, additionalContent = props.additionalContent, documentationLink = props.documentationLink, documentationLinkText = props.documentationLinkText;
|
|
8335
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "dc__word-break dc__hyphens-auto flex left ".concat(isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0') }, { children: [iconPath ? (jsxRuntime.jsx("img", { className: "icon-dim-".concat(iconSize || 20, " mr-6 ").concat(iconClass || ''), src: iconPath, alt: heading, onError: onImageLoadError })) : (Icon && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-".concat(iconSize || 20, " mr-6") }, { children: jsxRuntime.jsx(Icon, { className: "icon-dim-".concat(iconSize || 20, " ").concat(iconClass || '') }) })))), heading && jsxRuntime.jsx("span", __assign({ className: "fs-14 fw-6 lh-20 ".concat(showCloseButton ? 'mr-6' : '') }, { children: heading })), showCloseButton && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-16 ml-auto" }, { children: jsxRuntime.jsx(
|
|
8402
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "dc__word-break dc__hyphens-auto flex left ".concat(isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0') }, { children: [iconPath ? (jsxRuntime.jsx("img", { className: "icon-dim-".concat(iconSize || 20, " mr-6 ").concat(iconClass || ''), src: iconPath, alt: heading, onError: onImageLoadError })) : (Icon && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-".concat(iconSize || 20, " mr-6") }, { children: jsxRuntime.jsx(Icon, { className: "icon-dim-".concat(iconSize || 20, " ").concat(iconClass || '') }) })))), heading && jsxRuntime.jsx("span", __assign({ className: "fs-14 fw-6 lh-20 ".concat(showCloseButton ? 'mr-6' : '') }, { children: heading })), showCloseButton && (jsxRuntime.jsx("div", __assign({ className: "icon-dim-16 ml-auto" }, { children: jsxRuntime.jsx(SvgIcCross, { className: "icon-dim-16 cursor ".concat(isWhiteTheme ? 'fcn-9' : 'fcn-0'), onClick: closeTippy }) })))] })), infoTextHeading && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-14 fw-6 lh-20 ".concat(isWhiteTheme ? 'pl-12 pr-12' : 'pl-20 pr-20') }, { children: infoTextHeading }))), infoText && (jsxRuntime.jsx("div", __assign({ className: "dc__word-break dc__hyphens-auto fs-13 fw-4 lh-20 ".concat(isWhiteTheme
|
|
8336
8403
|
? 'p-12'
|
|
8337
|
-
: "pl-20 pr-20 pt-4 ".concat(additionalContent && documentationLink ? 'pb-12' : 'pb-20')) }, { children: infoText }))), additionalContent, documentationLink && (jsxRuntime.jsx("div", __assign({ className: "pl-12 pb-12" }, { children: jsxRuntime.jsx("a", __assign({ href: documentationLink, target: "_blank", rel: "noreferrer noopener", className: "cb-5", onClick: closeTippy }, { children: documentationLinkText || 'Learn more' })) })))] }));
|
|
8404
|
+
: "pl-20 pr-20 pt-4 ".concat(additionalContent && documentationLink ? 'pb-12' : 'pb-20')) }, { children: infoText }))), additionalContent, documentationLink && (jsxRuntime.jsx("div", __assign({ className: "pl-12 pb-12" }, { children: jsxRuntime.jsx("a", __assign({ href: documentationLink, target: "_blank", rel: "noreferrer noopener", className: "fs-13 cb-5", onClick: closeTippy }, { children: documentationLinkText || 'Learn more' })) })))] }));
|
|
8338
8405
|
};
|
|
8339
8406
|
var className = props.className, placement = props.placement, arrow = props.arrow, interactive = props.interactive, showOnCreate = props.showOnCreate, trigger = props.trigger, animation = props.animation, duration = props.duration, children = props.children;
|
|
8340
8407
|
return (jsxRuntime.jsx(Tippy, __assign({ className: "".concat(isWhiteTheme ? 'tippy-white-container default-white' : 'tippy-black-container default-black', " no-content-padding tippy-shadow ").concat(className), arrow: arrow || false, interactive: interactive || false, placement: placement || 'top', content: getTippyContent(), trigger: trigger || 'mouseenter', onMount: onTippyMount, onClickOutside: closeTippy, showOnCreate: showOnCreate || false, animation: animation || 'fade', duration: duration || 300, visible: props.visible }, { children: children })));
|
|
@@ -8384,11 +8451,12 @@ var SvgIcHelpOutline = function SvgIcHelpOutline(props) {
|
|
|
8384
8451
|
})));
|
|
8385
8452
|
};
|
|
8386
8453
|
|
|
8387
|
-
function PropagateTagInfo() {
|
|
8454
|
+
function PropagateTagInfo(_a) {
|
|
8455
|
+
var isCreateApp = _a.isCreateApp;
|
|
8388
8456
|
var additionalInfo = function () {
|
|
8389
|
-
return (jsxRuntime.
|
|
8457
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "p-12 fs-13" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "mb-20" }, { children: [jsxRuntime.jsxs("span", __assign({ className: "flex left" }, { children: ["Add a tag and click on the", jsxRuntime.jsx(SvgInjectTag, { className: "icon-dim-16 ml-4 mr-4" }), "icon to"] })), "propagate tags as labels to Kubernetes resources"] })), jsxRuntime.jsx("div", { children: "Use these tags to filter/identify resources via CLI or in other Kubernetes tools." })] })));
|
|
8390
8458
|
};
|
|
8391
|
-
return (jsxRuntime.jsx(TippyCustomized, __assign({ theme: exports.TippyTheme.white, className: "w-300", placement: "top", Icon: SvgInjectTag, heading: 'Propagate tags to K8s resources', infoText: "
|
|
8459
|
+
return (jsxRuntime.jsx(TippyCustomized, __assign({ theme: exports.TippyTheme.white, className: "w-300", placement: "top", Icon: SvgInjectTag, heading: 'Propagate tags to K8s resources', infoText: "", additionalContent: additionalInfo(), showCloseButton: true, trigger: "click", interactive: true, documentationLink: isCreateApp ? DOCUMENTATION.APP_TAGS : DOCUMENTATION.APP_OVERVIEW_TAGS, documentationLinkText: "View Documentation" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flexbox cursor" }, { children: [jsxRuntime.jsx(SvgInjectTag, { className: "icon-dim-16 mt-2 mr-4" }), jsxRuntime.jsx("span", { children: "Propagate tags" }), jsxRuntime.jsx(SvgIcHelpOutline, { className: "icon-dim-16 mt-2 ml-4" })] })) })));
|
|
8392
8460
|
}
|
|
8393
8461
|
|
|
8394
8462
|
var _path$2;
|
|
@@ -8481,21 +8549,68 @@ var SvgIcInfoOutlined = function SvgIcInfoOutlined(props) {
|
|
|
8481
8549
|
})));
|
|
8482
8550
|
};
|
|
8483
8551
|
|
|
8552
|
+
function ResizableTagTextArea(_a) {
|
|
8553
|
+
var className = _a.className, minHeight = _a.minHeight, maxHeight = _a.maxHeight, value = _a.value, onChange = _a.onChange, onBlur = _a.onBlur, onFocus = _a.onFocus, placeholder = _a.placeholder, tabIndex = _a.tabIndex, refVar = _a.refVar, dependentRef = _a.dependentRef;
|
|
8554
|
+
var _b = __read(React.useState(''), 2), text = _b[0], setText = _b[1];
|
|
8555
|
+
React.useEffect(function () {
|
|
8556
|
+
setText(value);
|
|
8557
|
+
}, [value]);
|
|
8558
|
+
var handleChange = function (event) {
|
|
8559
|
+
setText(event.target.value);
|
|
8560
|
+
onChange(event);
|
|
8561
|
+
};
|
|
8562
|
+
var reInitHeight = function () {
|
|
8563
|
+
if (document.activeElement !== refVar.current)
|
|
8564
|
+
return;
|
|
8565
|
+
refVar.current.style.height = 'auto';
|
|
8566
|
+
dependentRef.current.style.height = 'auto';
|
|
8567
|
+
var nextHeight = refVar.current.scrollHeight;
|
|
8568
|
+
if (nextHeight < dependentRef.current.scrollHeight) {
|
|
8569
|
+
nextHeight = dependentRef.current.scrollHeight;
|
|
8570
|
+
}
|
|
8571
|
+
if (minHeight && nextHeight < minHeight) {
|
|
8572
|
+
nextHeight = minHeight;
|
|
8573
|
+
}
|
|
8574
|
+
if (maxHeight && nextHeight > maxHeight) {
|
|
8575
|
+
nextHeight = maxHeight;
|
|
8576
|
+
}
|
|
8577
|
+
refVar.current.style.height = nextHeight + 'px';
|
|
8578
|
+
dependentRef.current.style.height = nextHeight + 'px';
|
|
8579
|
+
};
|
|
8580
|
+
useThrottledEffect(reInitHeight, 500, [text]);
|
|
8581
|
+
var handleOnBlur = function (event) {
|
|
8582
|
+
refVar.current.style.height = 'auto';
|
|
8583
|
+
dependentRef.current.style.height = 'auto';
|
|
8584
|
+
onBlur(event);
|
|
8585
|
+
};
|
|
8586
|
+
var handleOnFocus = function (event) {
|
|
8587
|
+
reInitHeight();
|
|
8588
|
+
onFocus(event);
|
|
8589
|
+
};
|
|
8590
|
+
return (jsxRuntime.jsx("textarea", { rows: 1, ref: refVar, value: text, placeholder: placeholder, className: "".concat(className || '', " lh-20"), style: { resize: 'none' }, onChange: handleChange, onBlur: handleOnBlur, onFocus: handleOnFocus, tabIndex: tabIndex }));
|
|
8591
|
+
}
|
|
8592
|
+
|
|
8484
8593
|
var TagLabelValueSelector = function (_a) {
|
|
8485
|
-
var selectedTagIndex = _a.selectedTagIndex, tagData = _a.tagData, setTagData = _a.setTagData, tagOptions = _a.tagOptions, isRequired = _a.isRequired,
|
|
8486
|
-
var
|
|
8487
|
-
var
|
|
8594
|
+
var selectedTagIndex = _a.selectedTagIndex, tagData = _a.tagData, setTagData = _a.setTagData, tagOptions = _a.tagOptions, isRequired = _a.isRequired, tagInputType = _a.tagInputType, placeholder = _a.placeholder, _b = _a.tabIndex, tabIndex = _b === void 0 ? null : _b, refVar = _a.refVar, dependentRef = _a.dependentRef;
|
|
8595
|
+
var _c = __read(React.useState(''), 2), selectedValue = _c[0], setSelectedValue = _c[1];
|
|
8596
|
+
var _d = __read(React.useState(''), 2), activeElement = _d[0], setActiveElement = _d[1];
|
|
8488
8597
|
var validationRules = new ValidationRules();
|
|
8489
8598
|
React.useEffect(function () {
|
|
8490
|
-
setSelectedValue((tagData === null || tagData === void 0 ? void 0 : tagData[
|
|
8491
|
-
}, [selectedTagIndex, tagData,
|
|
8599
|
+
setSelectedValue((tagData === null || tagData === void 0 ? void 0 : tagData[tagInputType]) || '');
|
|
8600
|
+
}, [selectedTagIndex, tagData, tagInputType]);
|
|
8601
|
+
var handleOnFocus = function (e) {
|
|
8602
|
+
setTimeout(function () {
|
|
8603
|
+
setActiveElement("tag-".concat(tagInputType, "-").concat(selectedTagIndex));
|
|
8604
|
+
}, 300);
|
|
8605
|
+
};
|
|
8492
8606
|
var handleOnBlur = function (e) {
|
|
8607
|
+
setActiveElement('');
|
|
8493
8608
|
if (!e.relatedTarget ||
|
|
8494
8609
|
!e.relatedTarget.classList.value ||
|
|
8495
8610
|
!e.relatedTarget.classList.value.includes("tag-".concat(selectedTagIndex, "-class"))) {
|
|
8496
8611
|
var _tagData = __assign({}, tagData);
|
|
8497
|
-
_tagData[
|
|
8498
|
-
if (
|
|
8612
|
+
_tagData[tagInputType] = selectedValue;
|
|
8613
|
+
if (tagInputType === exports.KEY_VALUE.KEY) {
|
|
8499
8614
|
_tagData.isInvalidKey = selectedValue
|
|
8500
8615
|
? !validationRules.propagateTagKey(selectedValue).isValid
|
|
8501
8616
|
: _tagData.value !== '';
|
|
@@ -8515,14 +8630,15 @@ var TagLabelValueSelector = function (_a) {
|
|
|
8515
8630
|
setSelectedValue(e.target.value);
|
|
8516
8631
|
};
|
|
8517
8632
|
var onSelectValue = function (e) {
|
|
8633
|
+
stopPropagation(e);
|
|
8518
8634
|
var _tagData = __assign({}, tagData);
|
|
8519
|
-
_tagData[
|
|
8635
|
+
_tagData[tagInputType] = e.currentTarget.dataset.key;
|
|
8520
8636
|
setTagData(selectedTagIndex, _tagData);
|
|
8521
8637
|
};
|
|
8522
8638
|
var renderValidationsSuggestions = function () {
|
|
8523
8639
|
var field = { isValid: true, messages: [] };
|
|
8524
|
-
if (
|
|
8525
|
-
if (selectedValue || tagData.value
|
|
8640
|
+
if (tagInputType === exports.KEY_VALUE.KEY) {
|
|
8641
|
+
if (selectedValue || tagData.value) {
|
|
8526
8642
|
field = validationRules.propagateTagKey(selectedValue);
|
|
8527
8643
|
}
|
|
8528
8644
|
}
|
|
@@ -8530,7 +8646,7 @@ var TagLabelValueSelector = function (_a) {
|
|
|
8530
8646
|
field = validationRules.propagateTagValue(selectedValue);
|
|
8531
8647
|
}
|
|
8532
8648
|
if (!field.isValid) {
|
|
8533
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "p-4" }, { children: [field.messages.map(function (error) { return (jsxRuntime.jsxs("div", __assign({ className: "flexbox
|
|
8649
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "p-4", onClick: stopPropagation }, { children: [field.messages.map(function (error) { return (jsxRuntime.jsxs("div", __assign({ className: "flexbox pr-4 pl-4" }, { children: [jsxRuntime.jsx("span", { children: jsxRuntime.jsx(SvgIcCross, { className: "icon-dim-14 scr-5 mt-3 mr-4" }) }), jsxRuntime.jsx("span", { children: error })] }), error)); }), tagInputType === exports.KEY_VALUE.KEY && (jsxRuntime.jsxs("div", __assign({ className: "flexbox pr-4 pl-4" }, { children: [jsxRuntime.jsx("span", { children: jsxRuntime.jsx(SvgIcInfoOutlined, { className: "icon-dim-14 mt-3 mr-4" }) }), jsxRuntime.jsx("span", __assign({ className: "dc__italic-font-style" }, { children: "Key format: prefix/name or name" }))] })))] })));
|
|
8534
8650
|
}
|
|
8535
8651
|
return null;
|
|
8536
8652
|
};
|
|
@@ -8545,14 +8661,19 @@ var TagLabelValueSelector = function (_a) {
|
|
|
8545
8661
|
}
|
|
8546
8662
|
return renderValidationsSuggestions();
|
|
8547
8663
|
};
|
|
8548
|
-
return (jsxRuntime.jsxs(PopupMenu, __assign({
|
|
8549
|
-
|
|
8550
|
-
|
|
8664
|
+
return (jsxRuntime.jsxs(PopupMenu, __assign({ autoClose: true, autoPosition: true }, { children: [jsxRuntime.jsx(PopupMenu.Button, __assign({ rootClassName: "dc__bg-n50 flex top dc__no-border" }, { children: jsxRuntime.jsx(ResizableTagTextArea, { minHeight: 30, maxHeight: 80, className: "form__input pt-4-imp pb-4-imp fs-13 ".concat(tagInputType === exports.KEY_VALUE.KEY
|
|
8665
|
+
? "dc__no-right-radius"
|
|
8666
|
+
: "dc__no-border-radius dc__no-right-border dc__no-left-border", " ").concat(tagData[tagInputType === exports.KEY_VALUE.KEY ? 'isInvalidKey' : 'isInvalidValue']
|
|
8667
|
+
? 'form__input--error'
|
|
8668
|
+
: ''), value: selectedValue, onChange: handleInputChange, onBlur: handleOnBlur, onFocus: handleOnFocus, placeholder: placeholder, tabIndex: tabIndex, refVar: refVar, dependentRef: dependentRef }) })), jsxRuntime.jsx(PopupMenu.Body, __assign({ rootClassName: "tag-".concat(selectedTagIndex, "-class"), autoWidth: true, preventWheelDisable: true }, { children: activeElement === "tag-".concat(tagInputType, "-").concat(selectedTagIndex) && renderSuggestions() }))] })));
|
|
8551
8669
|
};
|
|
8552
8670
|
|
|
8553
8671
|
function TagDetails(_a) {
|
|
8554
|
-
var index = _a.index, tagData = _a.tagData, setTagData = _a.setTagData, removeTag = _a.removeTag;
|
|
8555
|
-
var
|
|
8672
|
+
var index = _a.index, tagData = _a.tagData, setTagData = _a.setTagData, removeTag = _a.removeTag, _b = _a.tabIndex, tabIndex = _b === void 0 ? 1 : _b;
|
|
8673
|
+
var keyRef = React.useRef(null);
|
|
8674
|
+
var valueRef = React.useRef(null);
|
|
8675
|
+
var deleteTag = function (e) {
|
|
8676
|
+
stopPropagation(e);
|
|
8556
8677
|
removeTag(index);
|
|
8557
8678
|
};
|
|
8558
8679
|
var propagateTagToResource = function () {
|
|
@@ -8560,11 +8681,11 @@ function TagDetails(_a) {
|
|
|
8560
8681
|
_tagData.propagate = !_tagData.propagate;
|
|
8561
8682
|
setTagData(index, _tagData);
|
|
8562
8683
|
};
|
|
8563
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "flexbox mb-8" }, { children: [jsxRuntime.jsx("div", __assign({ className: "dc__border pl-4 pr-4 br-4 mr-8 pointer ".concat(tagData.propagate ? 'bcn-7' : ''), onClick: propagateTagToResource }, { children: jsxRuntime.jsx(SvgInjectTag, { className: "icon-dim-20 mt-4 ".concat(tagData.propagate ? 'scn-0' : '') }) })), jsxRuntime.jsx(TagLabelValueSelector, { selectedTagIndex: index, tagData: tagData, setTagData: setTagData,
|
|
8684
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "flexbox mb-8" }, { children: [jsxRuntime.jsx("div", __assign({ className: "dc__border h-30 pl-4 pr-4 br-4 mr-8 pointer ".concat(tagData.propagate ? 'bcn-7' : ''), onClick: propagateTagToResource }, { children: jsxRuntime.jsx(SvgInjectTag, { className: "icon-dim-20 mt-4 ".concat(tagData.propagate ? 'scn-0' : '') }) })), jsxRuntime.jsx(TagLabelValueSelector, { selectedTagIndex: index, tagData: tagData, setTagData: setTagData, tagInputType: exports.KEY_VALUE.KEY, placeholder: "Enter key", tabIndex: tabIndex - 1, refVar: keyRef, dependentRef: valueRef }), jsxRuntime.jsx(TagLabelValueSelector, { selectedTagIndex: index, tagData: tagData, setTagData: setTagData, tagInputType: exports.KEY_VALUE.VALUE, placeholder: "Enter value", tabIndex: tabIndex, refVar: valueRef, dependentRef: keyRef }), jsxRuntime.jsx("div", __assign({ className: "dc__border pl-4 pr-4 dc__right-radius-4 pointer flex top", onClick: deleteTag }, { children: jsxRuntime.jsx(SvgIcClose, { className: "icon-dim-20 mt-4" }) }))] })));
|
|
8564
8685
|
}
|
|
8565
8686
|
|
|
8566
8687
|
var TagLabelSelect = function (_a) {
|
|
8567
|
-
var labelTags = _a.labelTags, setLabelTags = _a.setLabelTags;
|
|
8688
|
+
var isCreateApp = _a.isCreateApp, labelTags = _a.labelTags, setLabelTags = _a.setLabelTags, _b = _a.tabIndex, tabIndex = _b === void 0 ? 0 : _b;
|
|
8568
8689
|
var setTagData = function (index, tagValue) {
|
|
8569
8690
|
var _tags = __spreadArray([], __read(labelTags), false);
|
|
8570
8691
|
_tags[index] = tagValue;
|
|
@@ -8572,7 +8693,7 @@ var TagLabelSelect = function (_a) {
|
|
|
8572
8693
|
};
|
|
8573
8694
|
var addNewTag = function () {
|
|
8574
8695
|
var _tags = __spreadArray([], __read(labelTags), false);
|
|
8575
|
-
_tags.splice(0, 0,
|
|
8696
|
+
_tags.splice(0, 0, DEFAULT_TAG_DATA);
|
|
8576
8697
|
setLabelTags(_tags);
|
|
8577
8698
|
};
|
|
8578
8699
|
var removeTag = function (index) {
|
|
@@ -8580,7 +8701,7 @@ var TagLabelSelect = function (_a) {
|
|
|
8580
8701
|
_tags.splice(index, 1);
|
|
8581
8702
|
setLabelTags(_tags);
|
|
8582
8703
|
};
|
|
8583
|
-
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", __assign({ className: "flexbox dc__content-space mb-8" }, { children: [jsxRuntime.jsx("span", { children: "Tags" }), jsxRuntime.jsx(PropagateTagInfo, {})] })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", __assign({ className: "dc_width-max-content cb-5 fw-6 fs-13 flexbox mr-20 mb-8 cursor", onClick: addNewTag }, { children: [jsxRuntime.jsx(SvgIcAdd, { className: "icon-dim-20 fcb-5" }), " Add tag"] })), jsxRuntime.jsx("div", __assign({ className: "mb-8" }, { children: labelTags === null || labelTags === void 0 ? void 0 : labelTags.map(function (tagData, index) { return (jsxRuntime.jsx(TagDetails, { index: index, tagData: tagData, setTagData: setTagData, removeTag: removeTag }, "tag-".concat(index))); }) }))] })] }));
|
|
8704
|
+
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", __assign({ className: "flexbox dc__content-space mb-8" }, { children: [jsxRuntime.jsx("span", { children: "Tags" }), jsxRuntime.jsx(PropagateTagInfo, { isCreateApp: isCreateApp })] })), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", __assign({ className: "dc_width-max-content cb-5 fw-6 fs-13 flexbox mr-20 mb-8 cursor", onClick: addNewTag }, { children: [jsxRuntime.jsx(SvgIcAdd, { className: "icon-dim-20 fcb-5" }), " Add tag"] })), jsxRuntime.jsx("div", __assign({ className: "mb-8" }, { children: labelTags === null || labelTags === void 0 ? void 0 : labelTags.map(function (tagData, index) { return (jsxRuntime.jsx(TagDetails, { index: index, tagData: tagData, setTagData: setTagData, removeTag: removeTag, tabIndex: tabIndex + (index + 2) }, "tag-".concat(index))); }) }))] })] }));
|
|
8584
8705
|
};
|
|
8585
8706
|
|
|
8586
8707
|
function ConfirmationDialog(_a) {
|
|
@@ -16193,12 +16314,43 @@ var getTeamListMin = function () {
|
|
|
16193
16314
|
});
|
|
16194
16315
|
};
|
|
16195
16316
|
|
|
16317
|
+
exports.CHECKBOX_VALUE = void 0;
|
|
16318
|
+
(function (CHECKBOX_VALUE) {
|
|
16319
|
+
CHECKBOX_VALUE["CHECKED"] = "CHECKED";
|
|
16320
|
+
CHECKBOX_VALUE["INTERMEDIATE"] = "INTERMEDIATE";
|
|
16321
|
+
})(exports.CHECKBOX_VALUE || (exports.CHECKBOX_VALUE = {}));
|
|
16322
|
+
/*
|
|
16323
|
+
Valid States of Checkbox:
|
|
16324
|
+
1. disabled: true, checked: false, value: XXX
|
|
16325
|
+
2. disabled: true, checked: true, value: INTERMIDIATE
|
|
16326
|
+
3. disabled: true, checked: true, value: CHECKED
|
|
16327
|
+
4. disabled: true, checked: false, value: XXX
|
|
16328
|
+
5. disabled: false, checked: true, value: INTERMIDIATE
|
|
16329
|
+
6. disabled: false, checked: true, value: CHECKED
|
|
16330
|
+
*/
|
|
16331
|
+
var Checkbox = /** @class */ (function (_super) {
|
|
16332
|
+
__extends(Checkbox, _super);
|
|
16333
|
+
function Checkbox() {
|
|
16334
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
16335
|
+
}
|
|
16336
|
+
Checkbox.prototype.render = function () {
|
|
16337
|
+
var _a;
|
|
16338
|
+
var rootClassName = "".concat(this.props.rootClassName ? this.props.rootClassName : '');
|
|
16339
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("label", __assign({ className: "dc__position-rel flex left cursor ".concat(rootClassName), onClick: (_a = this.props) === null || _a === void 0 ? void 0 : _a.onClick }, { children: [jsxRuntime.jsx("input", { type: "checkbox", className: 'form__checkbox', disabled: this.props.disabled, value: this.props.value, onChange: this.props.onChange, tabIndex: this.props.tabIndex, checked: this.props.isChecked, id: this.props.id }), jsxRuntime.jsx("span", { className: "form__checkbox-container" }), jsxRuntime.jsx("span", __assign({ className: "form__checkbox-label" }, { children: this.props.children }))] })) }));
|
|
16340
|
+
};
|
|
16341
|
+
return Checkbox;
|
|
16342
|
+
}(React.Component));
|
|
16343
|
+
|
|
16196
16344
|
exports.BreadCrumb = BreadCrumb;
|
|
16197
16345
|
exports.BreadcrumbStore = Store;
|
|
16346
|
+
exports.Checkbox = Checkbox;
|
|
16198
16347
|
exports.ClearIndicator = ClearIndicator;
|
|
16199
16348
|
exports.ConditionalWrap = ConditionalWrap;
|
|
16200
16349
|
exports.ConfirmationDialog = ConfirmationDialog;
|
|
16201
16350
|
exports.CustomSelect = CustomSelect;
|
|
16351
|
+
exports.DEFAULT_TAG_DATA = DEFAULT_TAG_DATA;
|
|
16352
|
+
exports.DOCUMENTATION = DOCUMENTATION;
|
|
16353
|
+
exports.DOCUMENTATION_HOME_PAGE = DOCUMENTATION_HOME_PAGE;
|
|
16202
16354
|
exports.DeleteDialog = DeleteDialog;
|
|
16203
16355
|
exports.DetailsProgressing = DetailsProgressing;
|
|
16204
16356
|
exports.DialogForm = DialogForm;
|
|
@@ -16240,6 +16392,8 @@ exports.post = post;
|
|
|
16240
16392
|
exports.put = put;
|
|
16241
16393
|
exports.showError = showError;
|
|
16242
16394
|
exports.sortCallback = sortCallback;
|
|
16395
|
+
exports.stopPropagation = stopPropagation;
|
|
16243
16396
|
exports.toastAccessDenied = toastAccessDenied;
|
|
16244
16397
|
exports.trash = trash;
|
|
16245
16398
|
exports.useBreadcrumb = useBreadcrumb;
|
|
16399
|
+
exports.useThrottledEffect = useThrottledEffect;
|
package/package.json
CHANGED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M19.2803 5.78033C19.5732 5.48744 19.5732 5.01256 19.2803 4.71967C18.9874 4.42678 18.5126 4.42678 18.2197 4.71967L19.2803 5.78033ZM4.71967 18.2197C4.42678 18.5126 4.42678 18.9874 4.71967 19.2803C5.01256 19.5732 5.48744 19.5732 5.78033 19.2803L4.71967 18.2197ZM18.2197 19.2803C18.5126 19.5732 18.9874 19.5732 19.2803 19.2803C19.5732 18.9874 19.5732 18.5126 19.2803 18.2197L18.2197 19.2803ZM5.78033 4.71967C5.48744 4.42678 5.01256 4.42678 4.71967 4.71967C4.42678 5.01256 4.42678 5.48744 4.71967 5.78033L5.78033 4.71967ZM18.2197 4.71967L11.4697 11.4697L12.5303 12.5303L19.2803 5.78033L18.2197 4.71967ZM11.4697 11.4697L4.71967 18.2197L5.78033 19.2803L12.5303 12.5303L11.4697 11.4697ZM19.2803 18.2197L12.5303 11.4697L11.4697 12.5303L18.2197 19.2803L19.2803 18.2197ZM12.5303 11.4697L5.78033 4.71967L4.71967 5.78033L11.4697 12.5303L12.5303 11.4697Z" fill="#596168"/>
|
|
3
|
+
</svg>
|