@devtron-labs/devtron-fe-common-lib 0.0.6-beta-23 → 0.0.6-beta-25
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/TagDetails.d.ts +1 -1
- package/dist/Common/CustomTagSelector/TagLabelSelect.d.ts +1 -1
- package/dist/Common/CustomTagSelector/index.d.ts +1 -0
- package/dist/Common/Types.d.ts +6 -2
- package/dist/Common/index.d.ts +1 -0
- package/dist/index.js +11 -11
- package/package.json +1 -1
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +2 -2
- package/src/Common/CustomTagSelector/TagDetails.tsx +9 -1
- package/src/Common/CustomTagSelector/TagLabelSelect.tsx +8 -1
- package/src/Common/CustomTagSelector/TagLabelValueSelector.tsx +11 -8
- package/src/Common/CustomTagSelector/index.ts +2 -1
- package/src/Common/TippyCustomized.tsx +1 -1
- package/src/Common/Types.ts +48 -44
- package/src/Common/index.ts +3 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TagDetailType } from '../Types';
|
|
3
|
-
export default function TagDetails({ index, tagData, setTagData, removeTag, tabIndex }: TagDetailType): JSX.Element;
|
|
3
|
+
export default function TagDetails({ index, tagData, setTagData, removeTag, tabIndex, suggestedTagsOptions, }: TagDetailType): JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TagLabelSelectType } from '../Types';
|
|
3
|
-
export declare const TagLabelSelect: ({ isCreateApp, labelTags, setLabelTags, tabIndex }: TagLabelSelectType) => JSX.Element;
|
|
3
|
+
export declare const TagLabelSelect: ({ isCreateApp, labelTags, setLabelTags, tabIndex, suggestedTagsOptions, }: TagLabelSelectType) => JSX.Element;
|
package/dist/Common/Types.d.ts
CHANGED
|
@@ -20,11 +20,12 @@ export declare enum TippyTheme {
|
|
|
20
20
|
white = "white"
|
|
21
21
|
}
|
|
22
22
|
export interface TagType {
|
|
23
|
+
id?: number;
|
|
23
24
|
key: string;
|
|
24
25
|
value?: string;
|
|
25
26
|
description?: string;
|
|
26
27
|
propagate: boolean;
|
|
27
|
-
mandatoryProjectIdsCsv?: string
|
|
28
|
+
mandatoryProjectIdsCsv?: string;
|
|
28
29
|
isInvalidKey?: boolean;
|
|
29
30
|
isInvalidValue?: boolean;
|
|
30
31
|
}
|
|
@@ -37,13 +38,16 @@ export interface TagLabelSelectType {
|
|
|
37
38
|
labelTags: TagType[];
|
|
38
39
|
setLabelTags: (tagList: TagType[]) => void;
|
|
39
40
|
tabIndex?: number;
|
|
41
|
+
selectedProjectId?: number;
|
|
42
|
+
suggestedTagsOptions?: OptionType[];
|
|
40
43
|
}
|
|
41
44
|
export interface TagDetailType {
|
|
42
45
|
index: number;
|
|
43
46
|
tagData: TagType;
|
|
44
47
|
setTagData: (index: number, tagData: TagType) => void;
|
|
45
|
-
removeTag
|
|
48
|
+
removeTag?: (index: number) => void;
|
|
46
49
|
tabIndex?: number;
|
|
50
|
+
suggestedTagsOptions?: OptionType[];
|
|
47
51
|
}
|
|
48
52
|
export interface TagLabelValueSelectorType {
|
|
49
53
|
selectedTagIndex: number;
|
package/dist/Common/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -8420,7 +8420,7 @@ function TippyCustomized(props) {
|
|
|
8420
8420
|
};
|
|
8421
8421
|
var getTippyContent = function () {
|
|
8422
8422
|
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;
|
|
8423
|
-
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
|
|
8423
|
+
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 top') }, { 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
|
|
8424
8424
|
? 'p-12'
|
|
8425
8425
|
: "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' })) })))] }));
|
|
8426
8426
|
};
|
|
@@ -8602,11 +8602,11 @@ function ResizableTagTextArea(_a) {
|
|
|
8602
8602
|
var handleOnBlur = function (event) {
|
|
8603
8603
|
refVar.current.style.height = 'auto';
|
|
8604
8604
|
dependentRef.current.style.height = 'auto';
|
|
8605
|
-
onBlur(event);
|
|
8605
|
+
onBlur && onBlur(event);
|
|
8606
8606
|
};
|
|
8607
8607
|
var handleOnFocus = function (event) {
|
|
8608
8608
|
reInitHeight();
|
|
8609
|
-
onFocus(event);
|
|
8609
|
+
onFocus && onFocus(event);
|
|
8610
8610
|
};
|
|
8611
8611
|
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 }));
|
|
8612
8612
|
}
|
|
@@ -8625,10 +8625,10 @@ var TagLabelValueSelector = function (_a) {
|
|
|
8625
8625
|
}, 300);
|
|
8626
8626
|
};
|
|
8627
8627
|
var handleOnBlur = function (e) {
|
|
8628
|
-
setActiveElement('');
|
|
8629
8628
|
if (!e.relatedTarget ||
|
|
8630
8629
|
!e.relatedTarget.classList.value ||
|
|
8631
8630
|
!e.relatedTarget.classList.value.includes("tag-".concat(selectedTagIndex, "-class"))) {
|
|
8631
|
+
setActiveElement('');
|
|
8632
8632
|
var _tagData = __assign({}, tagData);
|
|
8633
8633
|
_tagData[tagInputType] = selectedValue;
|
|
8634
8634
|
if (tagInputType === exports.KEY_VALUE.KEY) {
|
|
@@ -8675,9 +8675,7 @@ var TagLabelValueSelector = function (_a) {
|
|
|
8675
8675
|
if (tagOptions === null || tagOptions === void 0 ? void 0 : tagOptions.length) {
|
|
8676
8676
|
var filteredTags = tagOptions.filter(function (tag) { return tag.value.indexOf(selectedValue) >= 0; });
|
|
8677
8677
|
if (filteredTags.length) {
|
|
8678
|
-
return (jsxRuntime.jsx("div", __assign({ className: "p-8" }, { children:
|
|
8679
|
-
.filter(function (tag) { return tag.value.indexOf(selectedValue) >= 0; })
|
|
8680
|
-
.map(function (tag, index) { return (jsxRuntime.jsx("div", __assign({ "data-key": "".concat(tag.value, "-").concat(index), className: "cursor", onClick: onSelectValue }, { children: tag.label }))); }) })));
|
|
8678
|
+
return (jsxRuntime.jsx("div", __assign({ className: "p-8" }, { children: filteredTags.map(function (tag, index) { return (jsxRuntime.jsx("div", __assign({ "data-key": tag.label, className: "cursor", onClick: onSelectValue }, { children: tag.label }), "".concat(tag.value, "-").concat(index))); }) })));
|
|
8681
8679
|
}
|
|
8682
8680
|
}
|
|
8683
8681
|
return renderValidationsSuggestions();
|
|
@@ -8690,7 +8688,7 @@ var TagLabelValueSelector = function (_a) {
|
|
|
8690
8688
|
};
|
|
8691
8689
|
|
|
8692
8690
|
function TagDetails(_a) {
|
|
8693
|
-
var index = _a.index, tagData = _a.tagData, setTagData = _a.setTagData, removeTag = _a.removeTag, _b = _a.tabIndex, tabIndex = _b === void 0 ? 1 : _b;
|
|
8691
|
+
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;
|
|
8694
8692
|
var keyRef = React.useRef(null);
|
|
8695
8693
|
var valueRef = React.useRef(null);
|
|
8696
8694
|
var deleteTag = function (e) {
|
|
@@ -8702,11 +8700,11 @@ function TagDetails(_a) {
|
|
|
8702
8700
|
_tagData.propagate = !_tagData.propagate;
|
|
8703
8701
|
setTagData(index, _tagData);
|
|
8704
8702
|
};
|
|
8705
|
-
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" }) }))] })));
|
|
8703
|
+
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" }) }))] })));
|
|
8706
8704
|
}
|
|
8707
8705
|
|
|
8708
8706
|
var TagLabelSelect = function (_a) {
|
|
8709
|
-
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, suggestedTagsOptions = _a.suggestedTagsOptions;
|
|
8710
8708
|
var setTagData = function (index, tagValue) {
|
|
8711
8709
|
var _tags = __spreadArray([], __read(labelTags), false);
|
|
8712
8710
|
_tags[index] = tagValue;
|
|
@@ -8722,7 +8720,7 @@ var TagLabelSelect = function (_a) {
|
|
|
8722
8720
|
_tags.splice(index, 1);
|
|
8723
8721
|
setLabelTags(_tags);
|
|
8724
8722
|
};
|
|
8725
|
-
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))); }) }))] })] }));
|
|
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), suggestedTagsOptions: suggestedTagsOptions }, "tag-".concat(index))); }) }))] })] }));
|
|
8726
8724
|
};
|
|
8727
8725
|
|
|
8728
8726
|
function ConfirmationDialog(_a) {
|
|
@@ -16378,6 +16376,7 @@ exports.DialogForm = DialogForm;
|
|
|
16378
16376
|
exports.DialogFormSubmit = DialogFormSubmit;
|
|
16379
16377
|
exports.Drawer = Drawer;
|
|
16380
16378
|
exports.ERROR_EMPTY_SCREEN = ERROR_EMPTY_SCREEN;
|
|
16379
|
+
exports.EmptyState = EmptyState;
|
|
16381
16380
|
exports.ErrorScreenManager = ErrorScreenManager;
|
|
16382
16381
|
exports.ErrorScreenNotAuthorized = ErrorScreenNotAuthorized;
|
|
16383
16382
|
exports.ForceDeleteDialog = ForceDeleteDialog;
|
|
@@ -16396,6 +16395,7 @@ exports.ROUTES = ROUTES;
|
|
|
16396
16395
|
exports.RadioGroup = RadioGroup;
|
|
16397
16396
|
exports.RadioGroupItem = RadioGroupItem;
|
|
16398
16397
|
exports.RequestTimeout = RequestTimeout;
|
|
16398
|
+
exports.ResizableTagTextArea = ResizableTagTextArea;
|
|
16399
16399
|
exports.ServerError = ServerError;
|
|
16400
16400
|
exports.ServerErrors = ServerErrors;
|
|
16401
16401
|
exports.SingleSelectOption = SingleSelectOption;
|
package/package.json
CHANGED
|
@@ -49,12 +49,12 @@ export function ResizableTagTextArea({
|
|
|
49
49
|
const handleOnBlur = (event) => {
|
|
50
50
|
refVar.current.style.height = 'auto'
|
|
51
51
|
dependentRef.current.style.height = 'auto'
|
|
52
|
-
onBlur(event)
|
|
52
|
+
onBlur && onBlur(event)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const handleOnFocus = (event) => {
|
|
56
56
|
reInitHeight()
|
|
57
|
-
onFocus(event)
|
|
57
|
+
onFocus && onFocus(event)
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
return (
|
|
@@ -6,7 +6,14 @@ import { TagLabelValueSelector } from './TagLabelValueSelector'
|
|
|
6
6
|
import { KEY_VALUE } from '../Constants'
|
|
7
7
|
import { stopPropagation } from '../Helper'
|
|
8
8
|
|
|
9
|
-
export default function TagDetails({
|
|
9
|
+
export default function TagDetails({
|
|
10
|
+
index,
|
|
11
|
+
tagData,
|
|
12
|
+
setTagData,
|
|
13
|
+
removeTag,
|
|
14
|
+
tabIndex = 1,
|
|
15
|
+
suggestedTagsOptions,
|
|
16
|
+
}: TagDetailType) {
|
|
10
17
|
const keyRef = useRef(null)
|
|
11
18
|
const valueRef = useRef(null)
|
|
12
19
|
|
|
@@ -36,6 +43,7 @@ export default function TagDetails({ index, tagData, setTagData, removeTag, tabI
|
|
|
36
43
|
tabIndex={tabIndex - 1}
|
|
37
44
|
refVar={keyRef}
|
|
38
45
|
dependentRef={valueRef}
|
|
46
|
+
tagOptions={suggestedTagsOptions}
|
|
39
47
|
/>
|
|
40
48
|
<TagLabelValueSelector
|
|
41
49
|
selectedTagIndex={index}
|
|
@@ -5,7 +5,13 @@ import TagDetails from './TagDetails'
|
|
|
5
5
|
import { TagLabelSelectType } from '../Types'
|
|
6
6
|
import { DEFAULT_TAG_DATA } from '../Constants'
|
|
7
7
|
|
|
8
|
-
export const TagLabelSelect = ({
|
|
8
|
+
export const TagLabelSelect = ({
|
|
9
|
+
isCreateApp,
|
|
10
|
+
labelTags,
|
|
11
|
+
setLabelTags,
|
|
12
|
+
tabIndex = 0,
|
|
13
|
+
suggestedTagsOptions,
|
|
14
|
+
}: TagLabelSelectType) => {
|
|
9
15
|
const setTagData = (index, tagValue): void => {
|
|
10
16
|
const _tags = [...labelTags]
|
|
11
17
|
_tags[index] = tagValue
|
|
@@ -43,6 +49,7 @@ export const TagLabelSelect = ({ isCreateApp, labelTags, setLabelTags, tabIndex
|
|
|
43
49
|
setTagData={setTagData}
|
|
44
50
|
removeTag={removeTag}
|
|
45
51
|
tabIndex={tabIndex + (index + 2)}
|
|
52
|
+
suggestedTagsOptions={suggestedTagsOptions}
|
|
46
53
|
/>
|
|
47
54
|
))}
|
|
48
55
|
</div>
|
|
@@ -34,12 +34,12 @@ export const TagLabelValueSelector = ({
|
|
|
34
34
|
}, 300)
|
|
35
35
|
}
|
|
36
36
|
const handleOnBlur = (e) => {
|
|
37
|
-
setActiveElement('')
|
|
38
37
|
if (
|
|
39
38
|
!e.relatedTarget ||
|
|
40
39
|
!e.relatedTarget.classList.value ||
|
|
41
40
|
!e.relatedTarget.classList.value.includes(`tag-${selectedTagIndex}-class`)
|
|
42
41
|
) {
|
|
42
|
+
setActiveElement('')
|
|
43
43
|
const _tagData = { ...tagData }
|
|
44
44
|
_tagData[tagInputType] = selectedValue
|
|
45
45
|
if (tagInputType === KEY_VALUE.KEY) {
|
|
@@ -108,13 +108,16 @@ export const TagLabelValueSelector = ({
|
|
|
108
108
|
if (filteredTags.length) {
|
|
109
109
|
return (
|
|
110
110
|
<div className="p-8">
|
|
111
|
-
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
{filteredTags.map((tag, index) => (
|
|
112
|
+
<div
|
|
113
|
+
key={`${tag.value}-${index}`}
|
|
114
|
+
data-key={tag.label}
|
|
115
|
+
className="cursor"
|
|
116
|
+
onClick={onSelectValue}
|
|
117
|
+
>
|
|
118
|
+
{tag.label}
|
|
119
|
+
</div>
|
|
120
|
+
))}
|
|
118
121
|
</div>
|
|
119
122
|
)
|
|
120
123
|
}
|
|
@@ -79,7 +79,7 @@ export function TippyCustomized(props: TippyCustomizedProps) {
|
|
|
79
79
|
<>
|
|
80
80
|
<div
|
|
81
81
|
className={`dc__word-break dc__hyphens-auto flex left ${
|
|
82
|
-
isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0'
|
|
82
|
+
isWhiteTheme ? 'p-12 dc__border-bottom-n1 cn-9' : 'pt-20 pb-12 pr-20 pl-20 cn-0 top'
|
|
83
83
|
}`}
|
|
84
84
|
>
|
|
85
85
|
{iconPath ? (
|
package/src/Common/Types.ts
CHANGED
|
@@ -24,67 +24,71 @@ export enum TippyTheme {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export interface TagType {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
id?: number
|
|
28
|
+
key: string
|
|
29
|
+
value?: string
|
|
30
|
+
description?: string
|
|
31
|
+
propagate: boolean
|
|
32
|
+
mandatoryProjectIdsCsv?: string
|
|
33
|
+
isInvalidKey?: boolean
|
|
34
|
+
isInvalidValue?: boolean
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export interface TagErrorType {
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
isValid: boolean
|
|
39
|
+
messages: string[]
|
|
39
40
|
}
|
|
40
41
|
export interface TagLabelSelectType {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
isCreateApp?: boolean
|
|
43
|
+
labelTags: TagType[]
|
|
44
|
+
setLabelTags: (tagList: TagType[]) => void
|
|
45
|
+
tabIndex?: number
|
|
46
|
+
selectedProjectId?: number
|
|
47
|
+
suggestedTagsOptions?: OptionType[]
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
export interface TagDetailType {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
index: number
|
|
52
|
+
tagData: TagType
|
|
53
|
+
setTagData: (index: number, tagData: TagType) => void
|
|
54
|
+
removeTag?: (index: number) => void
|
|
55
|
+
tabIndex?: number
|
|
56
|
+
suggestedTagsOptions?: OptionType[]
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
export interface TagLabelValueSelectorType {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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>
|
|
66
70
|
}
|
|
67
71
|
|
|
68
72
|
export interface ResizableTagTextAreaProps {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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>
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
export interface TeamList extends ResponseType {
|
|
83
|
-
|
|
87
|
+
result: Teams[]
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
export interface Teams {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
+
id: number
|
|
92
|
+
name: string
|
|
93
|
+
active: boolean
|
|
94
|
+
}
|
package/src/Common/index.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './TippyCustomized'
|
|
|
21
21
|
export * from './CustomTagSelector'
|
|
22
22
|
export * from './Dialogs'
|
|
23
23
|
export * from './MultiSelectCustomization'
|
|
24
|
-
export {default as InfoColourBar} from './InfoColorBar/InfoColourbar'
|
|
24
|
+
export { default as InfoColourBar } from './InfoColorBar/InfoColourbar'
|
|
25
25
|
export * from './Common.service'
|
|
26
|
-
export * from './Checkbox'
|
|
26
|
+
export * from './Checkbox'
|
|
27
|
+
export { default as EmptyState } from './EmptyState/EmptyState'
|