@devtron-labs/devtron-fe-common-lib 0.0.26-beta-2 → 0.0.26-beta-4
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/Types.d.ts +0 -1
- package/dist/Common/Types.d.ts +1 -0
- package/dist/index.js +6 -12
- package/package.json +1 -1
- package/src/Common/CustomTagSelector/ResizableTagTextArea.tsx +6 -14
- package/src/Common/CustomTagSelector/Types.ts +0 -1
- package/src/Common/Types.ts +1 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ResizableTagTextAreaProps } from './Types';
|
|
3
|
-
export declare function ResizableTagTextArea({ className, minHeight, maxHeight, value, onChange, onBlur, onFocus, placeholder, tabIndex, refVar, dependentRef, dataTestId,
|
|
3
|
+
export declare function ResizableTagTextArea({ className, minHeight, maxHeight, value, onChange, onBlur, onFocus, placeholder, tabIndex, refVar, dependentRef, dataTestId, }: ResizableTagTextAreaProps): JSX.Element;
|
package/dist/Common/Types.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -14667,7 +14667,7 @@ var SvgIcInfoOutlined = function SvgIcInfoOutlined(props) {
|
|
|
14667
14667
|
};
|
|
14668
14668
|
|
|
14669
14669
|
function ResizableTagTextArea(_a) {
|
|
14670
|
-
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, dataTestId = _a.dataTestId
|
|
14670
|
+
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, dataTestId = _a.dataTestId;
|
|
14671
14671
|
var _b = __read(React.useState(''), 2), text = _b[0], setText = _b[1];
|
|
14672
14672
|
React.useEffect(function () {
|
|
14673
14673
|
setText(value);
|
|
@@ -14680,11 +14680,9 @@ function ResizableTagTextArea(_a) {
|
|
|
14680
14680
|
if (document.activeElement !== refVar.current)
|
|
14681
14681
|
return;
|
|
14682
14682
|
refVar.current.style.height = minHeight + 'px';
|
|
14683
|
-
|
|
14684
|
-
dependentRef.current.style.height = minHeight + 'px';
|
|
14685
|
-
}
|
|
14683
|
+
dependentRef.current.style.height = minHeight + 'px';
|
|
14686
14684
|
var nextHeight = refVar.current.scrollHeight;
|
|
14687
|
-
if (
|
|
14685
|
+
if (nextHeight < dependentRef.current.scrollHeight) {
|
|
14688
14686
|
nextHeight = dependentRef.current.scrollHeight;
|
|
14689
14687
|
}
|
|
14690
14688
|
if (minHeight && nextHeight < minHeight) {
|
|
@@ -14694,23 +14692,19 @@ function ResizableTagTextArea(_a) {
|
|
|
14694
14692
|
nextHeight = maxHeight;
|
|
14695
14693
|
}
|
|
14696
14694
|
refVar.current.style.height = nextHeight + 'px';
|
|
14697
|
-
|
|
14698
|
-
dependentRef.current.style.height = nextHeight + 'px';
|
|
14699
|
-
}
|
|
14695
|
+
dependentRef.current.style.height = nextHeight + 'px';
|
|
14700
14696
|
};
|
|
14701
14697
|
useThrottledEffect(reInitHeight, 500, [text]);
|
|
14702
14698
|
var handleOnBlur = function (event) {
|
|
14703
14699
|
refVar.current.style.height = minHeight + 'px';
|
|
14704
|
-
|
|
14705
|
-
dependentRef.current.style.height = minHeight + 'px';
|
|
14706
|
-
}
|
|
14700
|
+
dependentRef.current.style.height = minHeight + 'px';
|
|
14707
14701
|
onBlur && onBlur(event);
|
|
14708
14702
|
};
|
|
14709
14703
|
var handleOnFocus = function (event) {
|
|
14710
14704
|
reInitHeight();
|
|
14711
14705
|
onFocus && onFocus(event);
|
|
14712
14706
|
};
|
|
14713
|
-
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, "data-testid": dataTestId
|
|
14707
|
+
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, "data-testid": dataTestId }));
|
|
14714
14708
|
}
|
|
14715
14709
|
|
|
14716
14710
|
var validateTagValue = function (value) {
|
package/package.json
CHANGED
|
@@ -15,7 +15,6 @@ export function ResizableTagTextArea({
|
|
|
15
15
|
refVar,
|
|
16
16
|
dependentRef,
|
|
17
17
|
dataTestId,
|
|
18
|
-
handleKeyDown,
|
|
19
18
|
}: ResizableTagTextAreaProps) {
|
|
20
19
|
const [text, setText] = useState('')
|
|
21
20
|
|
|
@@ -30,12 +29,10 @@ export function ResizableTagTextArea({
|
|
|
30
29
|
|
|
31
30
|
const reInitHeight = () => {
|
|
32
31
|
if (document.activeElement !== refVar.current) return
|
|
33
|
-
refVar.current.style.height = minHeight
|
|
34
|
-
|
|
35
|
-
dependentRef.current.style.height = minHeight + 'px'
|
|
36
|
-
}
|
|
32
|
+
refVar.current.style.height = minHeight+ 'px'
|
|
33
|
+
dependentRef.current.style.height = minHeight+ 'px'
|
|
37
34
|
let nextHeight = refVar.current.scrollHeight
|
|
38
|
-
if (
|
|
35
|
+
if (nextHeight < dependentRef.current.scrollHeight) {
|
|
39
36
|
nextHeight = dependentRef.current.scrollHeight
|
|
40
37
|
}
|
|
41
38
|
if (minHeight && nextHeight < minHeight) {
|
|
@@ -45,18 +42,14 @@ export function ResizableTagTextArea({
|
|
|
45
42
|
nextHeight = maxHeight
|
|
46
43
|
}
|
|
47
44
|
refVar.current.style.height = nextHeight + 'px'
|
|
48
|
-
|
|
49
|
-
dependentRef.current.style.height = nextHeight + 'px'
|
|
50
|
-
}
|
|
45
|
+
dependentRef.current.style.height = nextHeight + 'px'
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
useThrottledEffect(reInitHeight, 500, [text])
|
|
54
49
|
|
|
55
50
|
const handleOnBlur = (event) => {
|
|
56
|
-
refVar.current.style.height = minHeight
|
|
57
|
-
|
|
58
|
-
dependentRef.current.style.height = minHeight + 'px'
|
|
59
|
-
}
|
|
51
|
+
refVar.current.style.height = minHeight+ 'px'
|
|
52
|
+
dependentRef.current.style.height = minHeight+ 'px'
|
|
60
53
|
onBlur && onBlur(event)
|
|
61
54
|
}
|
|
62
55
|
|
|
@@ -78,7 +71,6 @@ export function ResizableTagTextArea({
|
|
|
78
71
|
onFocus={handleOnFocus}
|
|
79
72
|
tabIndex={tabIndex}
|
|
80
73
|
data-testid={dataTestId}
|
|
81
|
-
onKeyDown={handleKeyDown}
|
|
82
74
|
/>
|
|
83
75
|
)
|
|
84
76
|
}
|
package/src/Common/Types.ts
CHANGED
|
@@ -267,6 +267,7 @@ export interface CommonNodeAttr {
|
|
|
267
267
|
colorCode?: string
|
|
268
268
|
isExternalCI?: boolean
|
|
269
269
|
isLinkedCI?: boolean
|
|
270
|
+
isJobCI?: boolean // used for Job type CI in Devtron Apps
|
|
270
271
|
environmentName?: string //used for CDs
|
|
271
272
|
environmentId?: number
|
|
272
273
|
inputMaterialList?: any[]
|