@devtron-labs/devtron-fe-common-lib 0.0.6-beta-25 → 0.0.6-beta-26
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/CustomTagSelector/ResizableTagTextArea.d.ts +1 -1
- package/dist/Common/CustomTagSelector/TagDetails.d.ts +2 -2
- package/dist/Common/CustomTagSelector/TagLabelSelect.d.ts +2 -2
- package/dist/Common/CustomTagSelector/TagLabelValueSelector.d.ts +1 -1
- package/dist/Common/CustomTagSelector/Types.d.ts +59 -0
- package/dist/Common/CustomTagSelector/index.d.ts +3 -0
- package/dist/Common/Types.d.ts +0 -57
- package/dist/index.js +26 -24
- package/package.json +1 -1
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +1 -1
- package/src/Common/CustomTagSelector/TagDetails.tsx +3 -3
- package/src/Common/CustomTagSelector/TagLabelSelect.tsx +3 -5
- package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +3 -3
- package/src/Common/CustomTagSelector/Types.ts +63 -0
- package/src/Common/CustomTagSelector/index.ts +4 -1
- package/src/Common/Types.ts +0 -63
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ResizableTagTextAreaProps } from '
|
|
2
|
+
import { ResizableTagTextAreaProps } from './Types';
|
|
3
3
|
export declare function ResizableTagTextArea({ className, minHeight, maxHeight, value, onChange, onBlur, onFocus, placeholder, tabIndex, refVar, dependentRef, }: ResizableTagTextAreaProps): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TagDetailType } from '
|
|
3
|
-
export
|
|
2
|
+
import { TagDetailType } from './Types';
|
|
3
|
+
export declare const TagDetails: ({ index, tagData, setTagData, removeTag, tabIndex, suggestedTagsOptions, }: TagDetailType) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TagLabelSelectType } from '
|
|
3
|
-
export declare const TagLabelSelect: ({ isCreateApp, labelTags, setLabelTags, tabIndex
|
|
2
|
+
import { TagLabelSelectType } from './Types';
|
|
3
|
+
export declare const TagLabelSelect: ({ isCreateApp, labelTags, setLabelTags, tabIndex }: TagLabelSelectType) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TagLabelValueSelectorType } from '
|
|
2
|
+
import { TagLabelValueSelectorType } from './Types';
|
|
3
3
|
export declare const TagLabelValueSelector: ({ selectedTagIndex, tagData, setTagData, tagOptions, isRequired, tagInputType, placeholder, tabIndex, refVar, dependentRef, }: TagLabelValueSelectorType) => JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { KEY_VALUE } from '../Constants';
|
|
3
|
+
import { OptionType } from '../Types';
|
|
4
|
+
export interface TagType {
|
|
5
|
+
id?: number;
|
|
6
|
+
key: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
propagate: boolean;
|
|
10
|
+
mandatoryProjectIdsCsv?: string;
|
|
11
|
+
isInvalidKey?: boolean;
|
|
12
|
+
isInvalidValue?: boolean;
|
|
13
|
+
isSuggested?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface TagErrorType {
|
|
16
|
+
isValid: boolean;
|
|
17
|
+
messages: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface TagLabelSelectType {
|
|
20
|
+
isCreateApp?: boolean;
|
|
21
|
+
labelTags: TagType[];
|
|
22
|
+
setLabelTags: (tagList: TagType[]) => void;
|
|
23
|
+
tabIndex?: number;
|
|
24
|
+
selectedProjectId?: number;
|
|
25
|
+
suggestedTagsOptions?: OptionType[];
|
|
26
|
+
}
|
|
27
|
+
export interface TagDetailType {
|
|
28
|
+
index: number;
|
|
29
|
+
tagData: TagType;
|
|
30
|
+
setTagData: (index: number, tagData: TagType) => void;
|
|
31
|
+
removeTag?: (index: number) => void;
|
|
32
|
+
tabIndex?: number;
|
|
33
|
+
suggestedTagsOptions?: OptionType[];
|
|
34
|
+
}
|
|
35
|
+
export interface TagLabelValueSelectorType {
|
|
36
|
+
selectedTagIndex: number;
|
|
37
|
+
tagData: TagType;
|
|
38
|
+
setTagData: (index: number, tagData: TagType) => void;
|
|
39
|
+
tagOptions?: OptionType[];
|
|
40
|
+
isRequired?: boolean;
|
|
41
|
+
tagInputType?: KEY_VALUE;
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
tabIndex?: number;
|
|
44
|
+
refVar?: React.MutableRefObject<HTMLTextAreaElement>;
|
|
45
|
+
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
|
|
46
|
+
}
|
|
47
|
+
export interface ResizableTagTextAreaProps {
|
|
48
|
+
className?: string;
|
|
49
|
+
minHeight?: number;
|
|
50
|
+
maxHeight?: number;
|
|
51
|
+
value?: string;
|
|
52
|
+
onChange?: (e: any) => void;
|
|
53
|
+
onBlur?: (e: any) => void;
|
|
54
|
+
onFocus?: (e: any) => void;
|
|
55
|
+
placeholder?: string;
|
|
56
|
+
tabIndex?: number;
|
|
57
|
+
refVar?: React.MutableRefObject<HTMLTextAreaElement>;
|
|
58
|
+
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
|
|
59
|
+
}
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { KEY_VALUE } from './Constants';
|
|
3
1
|
export interface ResponseType {
|
|
4
2
|
code: number;
|
|
5
3
|
status: string;
|
|
@@ -19,61 +17,6 @@ export declare enum TippyTheme {
|
|
|
19
17
|
black = "black",
|
|
20
18
|
white = "white"
|
|
21
19
|
}
|
|
22
|
-
export interface TagType {
|
|
23
|
-
id?: number;
|
|
24
|
-
key: string;
|
|
25
|
-
value?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
propagate: boolean;
|
|
28
|
-
mandatoryProjectIdsCsv?: string;
|
|
29
|
-
isInvalidKey?: boolean;
|
|
30
|
-
isInvalidValue?: boolean;
|
|
31
|
-
}
|
|
32
|
-
export interface TagErrorType {
|
|
33
|
-
isValid: boolean;
|
|
34
|
-
messages: string[];
|
|
35
|
-
}
|
|
36
|
-
export interface TagLabelSelectType {
|
|
37
|
-
isCreateApp?: boolean;
|
|
38
|
-
labelTags: TagType[];
|
|
39
|
-
setLabelTags: (tagList: TagType[]) => void;
|
|
40
|
-
tabIndex?: number;
|
|
41
|
-
selectedProjectId?: number;
|
|
42
|
-
suggestedTagsOptions?: OptionType[];
|
|
43
|
-
}
|
|
44
|
-
export interface TagDetailType {
|
|
45
|
-
index: number;
|
|
46
|
-
tagData: TagType;
|
|
47
|
-
setTagData: (index: number, tagData: TagType) => void;
|
|
48
|
-
removeTag?: (index: number) => void;
|
|
49
|
-
tabIndex?: number;
|
|
50
|
-
suggestedTagsOptions?: OptionType[];
|
|
51
|
-
}
|
|
52
|
-
export interface TagLabelValueSelectorType {
|
|
53
|
-
selectedTagIndex: number;
|
|
54
|
-
tagData: TagType;
|
|
55
|
-
setTagData: (index: number, tagData: TagType) => void;
|
|
56
|
-
tagOptions?: OptionType[];
|
|
57
|
-
isRequired?: boolean;
|
|
58
|
-
tagInputType?: KEY_VALUE;
|
|
59
|
-
placeholder?: string;
|
|
60
|
-
tabIndex?: number;
|
|
61
|
-
refVar?: React.MutableRefObject<HTMLTextAreaElement>;
|
|
62
|
-
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
|
|
63
|
-
}
|
|
64
|
-
export interface ResizableTagTextAreaProps {
|
|
65
|
-
className?: string;
|
|
66
|
-
minHeight?: number;
|
|
67
|
-
maxHeight?: number;
|
|
68
|
-
value?: string;
|
|
69
|
-
onChange?: (e: any) => void;
|
|
70
|
-
onBlur?: (e: any) => void;
|
|
71
|
-
onFocus?: (e: any) => void;
|
|
72
|
-
placeholder?: string;
|
|
73
|
-
tabIndex?: number;
|
|
74
|
-
refVar?: React.MutableRefObject<HTMLTextAreaElement>;
|
|
75
|
-
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>;
|
|
76
|
-
}
|
|
77
20
|
export interface TeamList extends ResponseType {
|
|
78
21
|
result: Teams[];
|
|
79
22
|
}
|
package/dist/index.js
CHANGED
|
@@ -8480,21 +8480,6 @@ function PropagateTagInfo(_a) {
|
|
|
8480
8480
|
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" })] })) })));
|
|
8481
8481
|
}
|
|
8482
8482
|
|
|
8483
|
-
var _path$2;
|
|
8484
|
-
function _extends$5() { _extends$5 = 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$5.apply(this, arguments); }
|
|
8485
|
-
var SvgIcAdd = function SvgIcAdd(props) {
|
|
8486
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
|
|
8487
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
8488
|
-
width: "1em",
|
|
8489
|
-
height: "1em",
|
|
8490
|
-
viewBox: "0 0 24 24"
|
|
8491
|
-
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
8492
|
-
className: "ic-add_svg__fill-color",
|
|
8493
|
-
fill: "#999",
|
|
8494
|
-
d: "M18 13h-5v5a1 1 0 0 1-2 0v-5H6a1 1 0 0 1 0-2h5V6a1 1 0 0 1 2 0v5h5a1 1 0 0 1 0 2z"
|
|
8495
|
-
})));
|
|
8496
|
-
};
|
|
8497
|
-
|
|
8498
8483
|
var validateTagValue = function (value) {
|
|
8499
8484
|
var errorList = [];
|
|
8500
8485
|
if (value.length > 63) {
|
|
@@ -8555,15 +8540,15 @@ var ValidationRules = /** @class */ (function () {
|
|
|
8555
8540
|
return ValidationRules;
|
|
8556
8541
|
}());
|
|
8557
8542
|
|
|
8558
|
-
var _path$
|
|
8559
|
-
function _extends$
|
|
8543
|
+
var _path$2;
|
|
8544
|
+
function _extends$5() { _extends$5 = 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$5.apply(this, arguments); }
|
|
8560
8545
|
var SvgIcInfoOutlined = function SvgIcInfoOutlined(props) {
|
|
8561
|
-
return /*#__PURE__*/React__namespace.createElement("svg", _extends$
|
|
8546
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
|
|
8562
8547
|
xmlns: "http://www.w3.org/2000/svg",
|
|
8563
8548
|
width: "1em",
|
|
8564
8549
|
height: "1em",
|
|
8565
8550
|
viewBox: "0 0 20 20"
|
|
8566
|
-
}, props), _path$
|
|
8551
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
8567
8552
|
d: "M10 1.667c4.6 0 8.333 3.733 8.333 8.333S14.6 18.333 10 18.333 1.667 14.6 1.667 10 5.4 1.667 10 1.667zm0 1.666A6.67 6.67 0 0 0 3.333 10 6.67 6.67 0 0 0 10 16.667 6.67 6.67 0 0 0 16.667 10 6.67 6.67 0 0 0 10 3.333zm0 5.834c.46 0 .833.373.833.833v3.333a.834.834 0 1 1-1.666 0V10c0-.46.373-.833.833-.833zm0-3.334A.833.833 0 1 1 10 7.5a.833.833 0 0 1 0-1.667z",
|
|
8568
8553
|
fill: "#06C",
|
|
8569
8554
|
fillRule: "evenodd"
|
|
@@ -8675,7 +8660,7 @@ var TagLabelValueSelector = function (_a) {
|
|
|
8675
8660
|
if (tagOptions === null || tagOptions === void 0 ? void 0 : tagOptions.length) {
|
|
8676
8661
|
var filteredTags = tagOptions.filter(function (tag) { return tag.value.indexOf(selectedValue) >= 0; });
|
|
8677
8662
|
if (filteredTags.length) {
|
|
8678
|
-
return (jsxRuntime.jsx("div",
|
|
8663
|
+
return (jsxRuntime.jsx("div", { children: filteredTags.map(function (tag, index) { return (jsxRuntime.jsx("div", __assign({ "data-key": tag.label, className: "dc__hover-n50 lh-20 fs-13 fw-6 pt-6 pr-8 pb-6 pl-8 cursor", onClick: onSelectValue }, { children: tag.label }), "".concat(tag.value, "-").concat(index))); }) }));
|
|
8679
8664
|
}
|
|
8680
8665
|
}
|
|
8681
8666
|
return renderValidationsSuggestions();
|
|
@@ -8687,7 +8672,7 @@ var TagLabelValueSelector = function (_a) {
|
|
|
8687
8672
|
: ''), 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() }))] })));
|
|
8688
8673
|
};
|
|
8689
8674
|
|
|
8690
|
-
function
|
|
8675
|
+
var TagDetails = function (_a) {
|
|
8691
8676
|
var index = _a.index, tagData = _a.tagData, setTagData = _a.setTagData, removeTag = _a.removeTag, _b = _a.tabIndex, tabIndex = _b === void 0 ? 1 : _b, suggestedTagsOptions = _a.suggestedTagsOptions;
|
|
8692
8677
|
var keyRef = React.useRef(null);
|
|
8693
8678
|
var valueRef = React.useRef(null);
|
|
@@ -8701,10 +8686,25 @@ function TagDetails(_a) {
|
|
|
8701
8686
|
setTagData(index, _tagData);
|
|
8702
8687
|
};
|
|
8703
8688
|
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, tagOptions: suggestedTagsOptions }), 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" }) }))] })));
|
|
8704
|
-
}
|
|
8689
|
+
};
|
|
8690
|
+
|
|
8691
|
+
var _path$1;
|
|
8692
|
+
function _extends$4() { _extends$4 = 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$4.apply(this, arguments); }
|
|
8693
|
+
var SvgIcAdd = function SvgIcAdd(props) {
|
|
8694
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
|
|
8695
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8696
|
+
width: "1em",
|
|
8697
|
+
height: "1em",
|
|
8698
|
+
viewBox: "0 0 24 24"
|
|
8699
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
8700
|
+
className: "ic-add_svg__fill-color",
|
|
8701
|
+
fill: "#999",
|
|
8702
|
+
d: "M18 13h-5v5a1 1 0 0 1-2 0v-5H6a1 1 0 0 1 0-2h5V6a1 1 0 0 1 2 0v5h5a1 1 0 0 1 0 2z"
|
|
8703
|
+
})));
|
|
8704
|
+
};
|
|
8705
8705
|
|
|
8706
8706
|
var TagLabelSelect = function (_a) {
|
|
8707
|
-
var isCreateApp = _a.isCreateApp, labelTags = _a.labelTags, setLabelTags = _a.setLabelTags, _b = _a.tabIndex, tabIndex = _b === void 0 ? 0 : _b
|
|
8707
|
+
var isCreateApp = _a.isCreateApp, labelTags = _a.labelTags, setLabelTags = _a.setLabelTags, _b = _a.tabIndex, tabIndex = _b === void 0 ? 0 : _b;
|
|
8708
8708
|
var setTagData = function (index, tagValue) {
|
|
8709
8709
|
var _tags = __spreadArray([], __read(labelTags), false);
|
|
8710
8710
|
_tags[index] = tagValue;
|
|
@@ -8720,7 +8720,7 @@ var TagLabelSelect = function (_a) {
|
|
|
8720
8720
|
_tags.splice(index, 1);
|
|
8721
8721
|
setLabelTags(_tags);
|
|
8722
8722
|
};
|
|
8723
|
-
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)
|
|
8723
|
+
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))); }) }))] })] }));
|
|
8724
8724
|
};
|
|
8725
8725
|
|
|
8726
8726
|
function ConfirmationDialog(_a) {
|
|
@@ -16391,6 +16391,7 @@ exports.Option = Option;
|
|
|
16391
16391
|
exports.PATTERNS = PATTERNS;
|
|
16392
16392
|
exports.PopupMenu = PopupMenu;
|
|
16393
16393
|
exports.Progressing = Progressing;
|
|
16394
|
+
exports.PropagateTagInfo = PropagateTagInfo;
|
|
16394
16395
|
exports.ROUTES = ROUTES;
|
|
16395
16396
|
exports.RadioGroup = RadioGroup;
|
|
16396
16397
|
exports.RadioGroupItem = RadioGroupItem;
|
|
@@ -16400,6 +16401,7 @@ exports.ServerError = ServerError;
|
|
|
16400
16401
|
exports.ServerErrors = ServerErrors;
|
|
16401
16402
|
exports.SingleSelectOption = SingleSelectOption;
|
|
16402
16403
|
exports.TOAST_ACCESS_DENIED = TOAST_ACCESS_DENIED;
|
|
16404
|
+
exports.TagDetails = TagDetails;
|
|
16403
16405
|
exports.TagLabelSelect = TagLabelSelect;
|
|
16404
16406
|
exports.TagLabelValueSelector = TagLabelValueSelector;
|
|
16405
16407
|
exports.TippyCustomized = TippyCustomized;
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React, { useRef } from 'react'
|
|
2
2
|
import { ReactComponent as DeleteCross } from '../../Assets/Icon/ic-close.svg'
|
|
3
3
|
import { ReactComponent as InjectTag } from '../../Assets/Icon/inject-tag.svg'
|
|
4
|
-
import { TagDetailType } from '../Types'
|
|
5
4
|
import { TagLabelValueSelector } from './TagLabelValueSelector'
|
|
6
5
|
import { KEY_VALUE } from '../Constants'
|
|
7
6
|
import { stopPropagation } from '../Helper'
|
|
7
|
+
import { TagDetailType } from './Types'
|
|
8
8
|
|
|
9
|
-
export
|
|
9
|
+
export const TagDetails = ({
|
|
10
10
|
index,
|
|
11
11
|
tagData,
|
|
12
12
|
setTagData,
|
|
13
13
|
removeTag,
|
|
14
14
|
tabIndex = 1,
|
|
15
15
|
suggestedTagsOptions,
|
|
16
|
-
}: TagDetailType) {
|
|
16
|
+
}: TagDetailType) => {
|
|
17
17
|
const keyRef = useRef(null)
|
|
18
18
|
const valueRef = useRef(null)
|
|
19
19
|
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropagateTagInfo from './PropagateTagInfo'
|
|
3
3
|
import { ReactComponent as Add } from '../../Assets/Icon/ic-add.svg'
|
|
4
|
-
import TagDetails from './TagDetails'
|
|
5
|
-
import { TagLabelSelectType } from '../Types'
|
|
6
4
|
import { DEFAULT_TAG_DATA } from '../Constants'
|
|
5
|
+
import { TagLabelSelectType } from './Types'
|
|
6
|
+
import { TagDetails } from './TagDetails'
|
|
7
7
|
|
|
8
8
|
export const TagLabelSelect = ({
|
|
9
9
|
isCreateApp,
|
|
10
10
|
labelTags,
|
|
11
11
|
setLabelTags,
|
|
12
|
-
tabIndex = 0
|
|
13
|
-
suggestedTagsOptions,
|
|
12
|
+
tabIndex = 0
|
|
14
13
|
}: TagLabelSelectType) => {
|
|
15
14
|
const setTagData = (index, tagValue): void => {
|
|
16
15
|
const _tags = [...labelTags]
|
|
@@ -49,7 +48,6 @@ export const TagLabelSelect = ({
|
|
|
49
48
|
setTagData={setTagData}
|
|
50
49
|
removeTag={removeTag}
|
|
51
50
|
tabIndex={tabIndex + (index + 2)}
|
|
52
|
-
suggestedTagsOptions={suggestedTagsOptions}
|
|
53
51
|
/>
|
|
54
52
|
))}
|
|
55
53
|
</div>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { TagLabelValueSelectorType } from '../Types'
|
|
3
2
|
import PopupMenu from '../PopupMenu'
|
|
4
3
|
import { ValidationRules } from './ValidationRules'
|
|
5
4
|
import { ReactComponent as ErrorCross } from '../../Assets/Icon/ic-cross.svg'
|
|
@@ -7,6 +6,7 @@ import { ReactComponent as Info } from '../../Assets/Icon/ic-info-outlined.svg'
|
|
|
7
6
|
import { KEY_VALUE } from '../Constants'
|
|
8
7
|
import { stopPropagation } from '../Helper'
|
|
9
8
|
import { ResizableTagTextArea } from './ResizableTagTextArea'
|
|
9
|
+
import { TagLabelValueSelectorType } from './Types'
|
|
10
10
|
|
|
11
11
|
export const TagLabelValueSelector = ({
|
|
12
12
|
selectedTagIndex,
|
|
@@ -107,12 +107,12 @@ export const TagLabelValueSelector = ({
|
|
|
107
107
|
const filteredTags = tagOptions.filter((tag) => tag.value.indexOf(selectedValue) >= 0)
|
|
108
108
|
if (filteredTags.length) {
|
|
109
109
|
return (
|
|
110
|
-
<div
|
|
110
|
+
<div>
|
|
111
111
|
{filteredTags.map((tag, index) => (
|
|
112
112
|
<div
|
|
113
113
|
key={`${tag.value}-${index}`}
|
|
114
114
|
data-key={tag.label}
|
|
115
|
-
className="cursor"
|
|
115
|
+
className="dc__hover-n50 lh-20 fs-13 fw-6 pt-6 pr-8 pb-6 pl-8 cursor"
|
|
116
116
|
onClick={onSelectValue}
|
|
117
117
|
>
|
|
118
118
|
{tag.label}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { KEY_VALUE } from '../Constants'
|
|
2
|
+
import { OptionType } from '../Types'
|
|
3
|
+
|
|
4
|
+
export interface TagType {
|
|
5
|
+
id?: number
|
|
6
|
+
key: string
|
|
7
|
+
value?: string
|
|
8
|
+
description?: string
|
|
9
|
+
propagate: boolean
|
|
10
|
+
mandatoryProjectIdsCsv?: string
|
|
11
|
+
isInvalidKey?: boolean
|
|
12
|
+
isInvalidValue?: boolean
|
|
13
|
+
isSuggested?: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface TagErrorType {
|
|
17
|
+
isValid: boolean
|
|
18
|
+
messages: string[]
|
|
19
|
+
}
|
|
20
|
+
export interface TagLabelSelectType {
|
|
21
|
+
isCreateApp?: boolean
|
|
22
|
+
labelTags: TagType[]
|
|
23
|
+
setLabelTags: (tagList: TagType[]) => void
|
|
24
|
+
tabIndex?: number
|
|
25
|
+
selectedProjectId?: number
|
|
26
|
+
suggestedTagsOptions?: OptionType[]
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface TagDetailType {
|
|
30
|
+
index: number
|
|
31
|
+
tagData: TagType
|
|
32
|
+
setTagData: (index: number, tagData: TagType) => void
|
|
33
|
+
removeTag?: (index: number) => void
|
|
34
|
+
tabIndex?: number
|
|
35
|
+
suggestedTagsOptions?: OptionType[]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface TagLabelValueSelectorType {
|
|
39
|
+
selectedTagIndex: number
|
|
40
|
+
tagData: TagType
|
|
41
|
+
setTagData: (index: number, tagData: TagType) => void
|
|
42
|
+
tagOptions?: OptionType[]
|
|
43
|
+
isRequired?: boolean
|
|
44
|
+
tagInputType?: KEY_VALUE
|
|
45
|
+
placeholder?: string
|
|
46
|
+
tabIndex?: number
|
|
47
|
+
refVar?: React.MutableRefObject<HTMLTextAreaElement>
|
|
48
|
+
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface ResizableTagTextAreaProps {
|
|
52
|
+
className?: string
|
|
53
|
+
minHeight?: number
|
|
54
|
+
maxHeight?: number
|
|
55
|
+
value?: string
|
|
56
|
+
onChange?: (e) => void
|
|
57
|
+
onBlur?: (e) => void
|
|
58
|
+
onFocus?: (e) => void
|
|
59
|
+
placeholder?: string
|
|
60
|
+
tabIndex?: number
|
|
61
|
+
refVar?: React.MutableRefObject<HTMLTextAreaElement>
|
|
62
|
+
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>
|
|
63
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export {default as PropagateTagInfo} from './PropagateTagInfo'
|
|
2
|
+
export * from './TagDetails'
|
|
1
3
|
export * from './TagLabelSelect'
|
|
2
4
|
export * from './TagLabelValueSelector'
|
|
3
|
-
export * from './ResizableTagTextArea'
|
|
5
|
+
export * from './ResizableTagTextArea'
|
|
6
|
+
export * from './Types'
|
package/src/Common/Types.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { KEY_VALUE } from './Constants'
|
|
2
|
-
|
|
3
1
|
export interface ResponseType {
|
|
4
2
|
code: number
|
|
5
3
|
status: string
|
|
@@ -22,67 +20,6 @@ export enum TippyTheme {
|
|
|
22
20
|
black = 'black',
|
|
23
21
|
white = 'white',
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
export interface TagType {
|
|
27
|
-
id?: number
|
|
28
|
-
key: string
|
|
29
|
-
value?: string
|
|
30
|
-
description?: string
|
|
31
|
-
propagate: boolean
|
|
32
|
-
mandatoryProjectIdsCsv?: string
|
|
33
|
-
isInvalidKey?: boolean
|
|
34
|
-
isInvalidValue?: boolean
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface TagErrorType {
|
|
38
|
-
isValid: boolean
|
|
39
|
-
messages: string[]
|
|
40
|
-
}
|
|
41
|
-
export interface TagLabelSelectType {
|
|
42
|
-
isCreateApp?: boolean
|
|
43
|
-
labelTags: TagType[]
|
|
44
|
-
setLabelTags: (tagList: TagType[]) => void
|
|
45
|
-
tabIndex?: number
|
|
46
|
-
selectedProjectId?: number
|
|
47
|
-
suggestedTagsOptions?: OptionType[]
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface TagDetailType {
|
|
51
|
-
index: number
|
|
52
|
-
tagData: TagType
|
|
53
|
-
setTagData: (index: number, tagData: TagType) => void
|
|
54
|
-
removeTag?: (index: number) => void
|
|
55
|
-
tabIndex?: number
|
|
56
|
-
suggestedTagsOptions?: OptionType[]
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export interface TagLabelValueSelectorType {
|
|
60
|
-
selectedTagIndex: number
|
|
61
|
-
tagData: TagType
|
|
62
|
-
setTagData: (index: number, tagData: TagType) => void
|
|
63
|
-
tagOptions?: OptionType[]
|
|
64
|
-
isRequired?: boolean
|
|
65
|
-
tagInputType?: KEY_VALUE
|
|
66
|
-
placeholder?: string
|
|
67
|
-
tabIndex?: number
|
|
68
|
-
refVar?: React.MutableRefObject<HTMLTextAreaElement>
|
|
69
|
-
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface ResizableTagTextAreaProps {
|
|
73
|
-
className?: string
|
|
74
|
-
minHeight?: number
|
|
75
|
-
maxHeight?: number
|
|
76
|
-
value?: string
|
|
77
|
-
onChange?: (e) => void
|
|
78
|
-
onBlur?: (e) => void
|
|
79
|
-
onFocus?: (e) => void
|
|
80
|
-
placeholder?: string
|
|
81
|
-
tabIndex?: number
|
|
82
|
-
refVar?: React.MutableRefObject<HTMLTextAreaElement>
|
|
83
|
-
dependentRef?: React.MutableRefObject<HTMLTextAreaElement>
|
|
84
|
-
}
|
|
85
|
-
|
|
86
23
|
export interface TeamList extends ResponseType {
|
|
87
24
|
result: Teams[]
|
|
88
25
|
}
|