@monolith-forensics/monolith-ui 1.3.96 → 1.3.97
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/SelectBox/SelectBox.js +24 -1
- package/dist/SelectBox/types.d.ts +4 -0
- package/dist/SelectableTextArea/SelectableTextArea.d.ts +6 -3
- package/dist/SelectableTextArea/SelectableTextArea.js +15 -4
- package/dist/TextAreaInput/TextAreaInput.d.ts +11 -9
- package/dist/TextAreaInput/TextAreaInput.js +99 -108
- package/package.json +1 -1
|
@@ -10,7 +10,9 @@ import { StyledInputContainer, StyledInnerItemContainer, EmptyComponent, GroupTi
|
|
|
10
10
|
// Re-export for backward compatibility
|
|
11
11
|
export { StyledInputContainer };
|
|
12
12
|
export const SelectBox = ({ className, data = [], placeholder = "Select...", arrow = true, onChange, onSearch, searchFn, onScroll, loading, defaultValue, value, size = "sm", variant = "outlined", width = "100%", allowCustomValue = false, searchable = false, clearable = false, label, description, required = false, error, openOnFocus = true, renderOption, actionComponent, focused, grouped, OptionTooltip, // Custom tooltip component for search menu items
|
|
13
|
-
DropDownProps = {}, debounceTime = 175, sort = false, disabled = false,
|
|
13
|
+
DropDownProps = {}, debounceTime = 175, sort = false, disabled = false,
|
|
14
|
+
// Enhanced focus control props
|
|
15
|
+
triggerFocus = false, triggerOpen = false, onFocused, onOpened, }) => {
|
|
14
16
|
var _a, _b, _c, _d, _e, _f;
|
|
15
17
|
// Component setup and data processing
|
|
16
18
|
const theme = useTheme();
|
|
@@ -351,6 +353,26 @@ DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
|
|
|
351
353
|
};
|
|
352
354
|
}, [topHeight, bottomHeight, isOpen]);
|
|
353
355
|
// ============================================================================
|
|
356
|
+
// Enhanced Focus Control Effects
|
|
357
|
+
// ============================================================================
|
|
358
|
+
// Handle triggerFocus prop
|
|
359
|
+
useEffect(() => {
|
|
360
|
+
if (triggerFocus && inputRef.current) {
|
|
361
|
+
inputRef.current.focus();
|
|
362
|
+
onFocused === null || onFocused === void 0 ? void 0 : onFocused();
|
|
363
|
+
}
|
|
364
|
+
}, [triggerFocus, onFocused]);
|
|
365
|
+
// Handle triggerOpen prop
|
|
366
|
+
useEffect(() => {
|
|
367
|
+
if (triggerOpen) {
|
|
368
|
+
setIsOpen(true);
|
|
369
|
+
if (inputRef.current) {
|
|
370
|
+
inputRef.current.focus();
|
|
371
|
+
}
|
|
372
|
+
onOpened === null || onOpened === void 0 ? void 0 : onOpened();
|
|
373
|
+
}
|
|
374
|
+
}, [triggerOpen, onOpened]);
|
|
375
|
+
// ============================================================================
|
|
354
376
|
// Render
|
|
355
377
|
// ============================================================================
|
|
356
378
|
return (_jsxs(StyledContainer, { className: className, children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { ref: refs.setReference, onMouseDown: () => setIsOpen(true), width: width, onKeyDown: handleKeyDown, "data-open": isOpen, "data-disabled": disabled, children: [_jsx(Input, { ref: inputRef, value: inputValue, onChange: handleInputChange, onFocus: handleFocus, autoFocus: focused, placeholder: placeholder, size: size, readOnly: !searchable && !allowCustomValue, "data-button-right": arrow || clearable, style: isOpen ? { borderColor: theme.palette.primary.main } : {} }), renderActionButton()] }), isOpen && (_jsx(FloatingPortal, { preserveTabOrder: true, children: _jsx(StyledFloatContainer, { ref: (ref) => {
|
|
@@ -369,3 +391,4 @@ DropDownProps = {}, debounceTime = 175, sort = false, disabled = false, }) => {
|
|
|
369
391
|
? groups.map((group, index) => (_jsxs("div", { children: [_jsx(GroupTitle, { size: size, children: group.label }), group.items.map((item, index) => renderOptionItem(item, index))] }, group.label)))
|
|
370
392
|
: filteredItems.map((item, index) => renderOptionItem(item, index)) }))] })) }) }))] }));
|
|
371
393
|
};
|
|
394
|
+
SelectBox.displayName = "SelectBox";
|
|
@@ -42,4 +42,8 @@ export type SelectBoxProps = {
|
|
|
42
42
|
onSearch?: (value: string) => void;
|
|
43
43
|
searchFn?: (value: string) => void;
|
|
44
44
|
onItemAdded?: (item: Option | string) => void;
|
|
45
|
+
triggerFocus?: boolean;
|
|
46
|
+
triggerOpen?: boolean;
|
|
47
|
+
onFocused?: () => void;
|
|
48
|
+
onOpened?: () => void;
|
|
45
49
|
};
|
|
@@ -5,23 +5,26 @@ export interface SelectableTextAreaProps {
|
|
|
5
5
|
label: string;
|
|
6
6
|
value: string;
|
|
7
7
|
}>;
|
|
8
|
+
searchable?: boolean;
|
|
9
|
+
allowCustomValue?: boolean;
|
|
8
10
|
required?: boolean;
|
|
9
11
|
error?: string;
|
|
10
12
|
description?: string;
|
|
11
13
|
value?: string;
|
|
12
14
|
onChange?: (value: string) => void;
|
|
13
15
|
selectProps?: Record<string, any>;
|
|
14
|
-
|
|
16
|
+
textAreaPlaceholder?: string;
|
|
17
|
+
textAreaMinRows?: number;
|
|
18
|
+
textAreaMaxRows?: number;
|
|
15
19
|
textAreaProps?: Record<string, any>;
|
|
16
20
|
initialValue?: string;
|
|
17
|
-
showActionMenu?: boolean;
|
|
18
21
|
actionMenuData?: Array<{
|
|
19
22
|
label: string;
|
|
20
23
|
value: string;
|
|
21
24
|
}>;
|
|
22
25
|
onActionMenuSelect?: (item: DropDownItem) => void;
|
|
23
26
|
}
|
|
24
|
-
declare function SelectableTextArea({ label, data, required, error, description, selectProps, value, onChange,
|
|
27
|
+
declare function SelectableTextArea({ label, data, searchable, allowCustomValue, required, error, description, selectProps, value, onChange, textAreaPlaceholder, textAreaMinRows, textAreaMaxRows, textAreaProps, initialValue, actionMenuData, onActionMenuSelect, }: SelectableTextAreaProps): import("react/jsx-runtime").JSX.Element;
|
|
25
28
|
declare namespace SelectableTextArea {
|
|
26
29
|
var displayName: string;
|
|
27
30
|
}
|
|
@@ -57,10 +57,19 @@ const StyledSelectBox = styled(SelectBox) `
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
`;
|
|
60
|
+
const StyledFieldLabel = styled(FieldLabel) `
|
|
61
|
+
.action-section {
|
|
62
|
+
margin-left: 2px !important; /* Reduce spacing from default 8px */
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.label-content {
|
|
66
|
+
gap: 2px !important; /* Reduce gap from default 5px */
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
60
69
|
// Styled TextArea that is now the primary input
|
|
61
70
|
const StyledTextArea = styled.textarea `
|
|
62
71
|
border: 1px solid
|
|
63
|
-
${({ theme, hasError }) => hasError ? theme.palette.error.main : theme.palette.input.border};
|
|
72
|
+
${({ theme, $hasError }) => $hasError ? theme.palette.error.main : theme.palette.input.border};
|
|
64
73
|
border-radius: 4px;
|
|
65
74
|
padding: 10px;
|
|
66
75
|
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
@@ -71,6 +80,8 @@ const StyledTextArea = styled.textarea `
|
|
|
71
80
|
outline: none;
|
|
72
81
|
transition: border-color 0.2s ease;
|
|
73
82
|
width: 100%;
|
|
83
|
+
min-height: ${({ $minRows = 3 }) => $minRows * 1.5 + 1.5}em;
|
|
84
|
+
${({ $maxRows }) => $maxRows && `max-height: ${$maxRows * 1.5 + 1.5}em;`}
|
|
74
85
|
pointer-events: auto;
|
|
75
86
|
user-select: text;
|
|
76
87
|
z-index: 2;
|
|
@@ -86,7 +97,7 @@ const StyledTextArea = styled.textarea `
|
|
|
86
97
|
opacity: 0.5;
|
|
87
98
|
}
|
|
88
99
|
`;
|
|
89
|
-
function SelectableTextArea({ label, data, required, error, description, selectProps = {}, value, onChange,
|
|
100
|
+
function SelectableTextArea({ label, data, searchable, allowCustomValue, required, error, description, selectProps = {}, value, onChange, textAreaPlaceholder, textAreaMinRows = 3, textAreaMaxRows, textAreaProps = {}, initialValue = "", actionMenuData, onActionMenuSelect, }) {
|
|
90
101
|
// Use controlled value if provided, otherwise use internal state
|
|
91
102
|
const [internalValue, setInternalValue] = useState(initialValue);
|
|
92
103
|
const [selectValue, setSelectValue] = useState(null);
|
|
@@ -164,7 +175,7 @@ function SelectableTextArea({ label, data, required, error, description, selectP
|
|
|
164
175
|
}
|
|
165
176
|
}
|
|
166
177
|
};
|
|
167
|
-
return (_jsxs(CombinedInputWrapper, { children: [label && (_jsx(
|
|
178
|
+
return (_jsxs(CombinedInputWrapper, { children: [label && (_jsx(StyledFieldLabel, { asterisk: required, error: error, description: description, actionComponent: _jsx(DropDownMenu, { data: menuData, variant: "text", size: "xs", arrow: false, onItemSelect: handleActionMenuSelect, buttonProps: {
|
|
168
179
|
style: {
|
|
169
180
|
minWidth: "auto",
|
|
170
181
|
border: "none",
|
|
@@ -174,7 +185,7 @@ function SelectableTextArea({ label, data, required, error, description, selectP
|
|
|
174
185
|
height: "16px",
|
|
175
186
|
width: "16px",
|
|
176
187
|
},
|
|
177
|
-
}, children: _jsx(MoreHorizontal, { size: 16 }) })
|
|
188
|
+
}, children: _jsx(MoreHorizontal, { size: 16 }) }), children: label })), _jsxs(TextAreaRow, { children: [_jsx(StyledTextArea, Object.assign({ placeholder: textAreaPlaceholder || "Enter details about the move", "$minRows": textAreaMinRows, "$maxRows": textAreaMaxRows, "$hasError": hasError, value: textAreaValue, onChange: handleTextAreaChange }, textAreaProps)), _jsx(SelectBoxWrapper, { ref: selectBoxRef, children: _jsx(StyledSelectBox, Object.assign({ data: data, searchable: searchable, allowCustomValue: allowCustomValue, arrow: false, value: selectValue || undefined, onChange: handleSelectChange, hasError: hasError }, selectProps), selectKey) })] })] }));
|
|
178
189
|
}
|
|
179
190
|
SelectableTextArea.displayName = "SelectableTextArea";
|
|
180
191
|
export default SelectableTextArea;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { Size } from "../core";
|
|
2
3
|
import { DropDownItem } from "..";
|
|
3
|
-
|
|
4
|
+
export type InsertableItem = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
export interface TextAreaInputProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
9
|
variant?: "contained" | "filled" | "outlined" | "text";
|
|
5
10
|
label?: string;
|
|
6
11
|
error?: string;
|
|
@@ -10,21 +15,18 @@ interface TextAreaInputProps extends Omit<React.TextareaHTMLAttributes<HTMLTextA
|
|
|
10
15
|
description?: string;
|
|
11
16
|
maxRows?: number;
|
|
12
17
|
minRows?: number;
|
|
18
|
+
cacheMeasurements?: boolean;
|
|
13
19
|
onHeightChange?: (height: number, meta: {
|
|
14
20
|
rowHeight: number;
|
|
15
21
|
}) => void;
|
|
16
|
-
cacheMeasurements?: boolean;
|
|
17
22
|
showActionMenu?: boolean;
|
|
18
23
|
actionMenuOptions?: Array<{
|
|
19
|
-
label: string;
|
|
20
24
|
value: string;
|
|
21
|
-
}>;
|
|
22
|
-
onActionMenuSelect?: (item: DropDownItem) => void;
|
|
23
|
-
onChange?: (value: string) => void;
|
|
24
|
-
data?: Array<{
|
|
25
25
|
label: string;
|
|
26
|
-
value: string;
|
|
27
26
|
}>;
|
|
27
|
+
onActionMenuSelect?: (item: DropDownItem) => void;
|
|
28
|
+
insertableItems?: InsertableItem[];
|
|
29
|
+
onInsertItem?: (item: InsertableItem) => void;
|
|
28
30
|
}
|
|
29
|
-
declare const TextAreaInput:
|
|
31
|
+
declare const TextAreaInput: React.ForwardRefExoticComponent<TextAreaInputProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
30
32
|
export default TextAreaInput;
|
|
@@ -11,137 +11,128 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import styled from "styled-components";
|
|
14
|
+
import { forwardRef, useState, useRef, useEffect } from "react";
|
|
14
15
|
import { TextArea, FieldLabel, DropDownMenu, SelectBox, } from "..";
|
|
15
|
-
import { forwardRef, useRef, useState } from "react";
|
|
16
16
|
import { MoreHorizontal } from "lucide-react";
|
|
17
|
-
const
|
|
17
|
+
const DEFAULT_ACTIONS = [
|
|
18
|
+
{ value: "clear", label: "Clear Text" },
|
|
19
|
+
{ value: "insert", label: "Insert Item" },
|
|
20
|
+
];
|
|
21
|
+
const TextAreaWrapper = styled.div `
|
|
18
22
|
position: relative;
|
|
19
|
-
display: flex;
|
|
20
|
-
align-items: flex-start;
|
|
21
|
-
width: 100%;
|
|
22
|
-
z-index: 1; /* Lower than SelectBoxWrapper */
|
|
23
23
|
`;
|
|
24
|
-
const
|
|
24
|
+
const InsertMenuOverlay = styled.div `
|
|
25
25
|
position: absolute;
|
|
26
|
-
|
|
27
|
-
top: 0; /* Position at the top of the textarea */
|
|
26
|
+
top: 0;
|
|
28
27
|
left: 0;
|
|
29
|
-
|
|
28
|
+
right: 0;
|
|
29
|
+
z-index: 10;
|
|
30
|
+
opacity: ${({ $visible }) => ($visible ? 1 : 0)};
|
|
31
|
+
pointer-events: ${({ $visible }) => ($visible ? "auto" : "none")};
|
|
32
|
+
transform: ${({ $visible }) => $visible ? "translateY(0)" : "translateY(-4px)"};
|
|
33
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
30
34
|
`;
|
|
31
|
-
const
|
|
32
|
-
/* Completely hide the SelectBox and disable all interactions */
|
|
33
|
-
position: relative;
|
|
35
|
+
const StyledInsertSelectBox = styled(SelectBox) `
|
|
34
36
|
width: 100%;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
height: 0;
|
|
38
|
-
overflow: hidden;
|
|
39
|
-
|
|
40
|
-
/* Hide all child elements */
|
|
41
|
-
* {
|
|
42
|
-
opacity: 0;
|
|
43
|
-
pointer-events: none;
|
|
44
|
-
height: 0;
|
|
45
|
-
overflow: hidden;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* Only allow dropdown portal to be visible and interactive when opened programmatically */
|
|
49
|
-
[data-floating-ui-portal] {
|
|
50
|
-
opacity: 1 !important;
|
|
51
|
-
pointer-events: auto !important;
|
|
52
|
-
z-index: 1000 !important;
|
|
53
|
-
|
|
54
|
-
* {
|
|
55
|
-
opacity: 1 !important;
|
|
56
|
-
pointer-events: auto !important;
|
|
57
|
-
height: auto !important;
|
|
58
|
-
overflow: visible !important;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
37
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
38
|
+
border: 1px solid ${({ theme }) => theme.palette.primary.main};
|
|
61
39
|
`;
|
|
62
|
-
const TextAreaInput = forwardRef((
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
40
|
+
const TextAreaInput = forwardRef((props, ref) => {
|
|
41
|
+
const {
|
|
42
|
+
// UI
|
|
43
|
+
label, error, required, colSpan = 1, size = "sm", description, maxRows = 6, minRows = 3, onHeightChange, cacheMeasurements,
|
|
44
|
+
// Action menu
|
|
45
|
+
showActionMenu = false, actionMenuOptions = DEFAULT_ACTIONS, onActionMenuSelect,
|
|
46
|
+
// Insertable items
|
|
47
|
+
insertableItems, onInsertItem } = props,
|
|
48
|
+
// Rest of props for TextArea
|
|
49
|
+
rest = __rest(props, ["label", "error", "required", "colSpan", "size", "description", "maxRows", "minRows", "onHeightChange", "cacheMeasurements", "showActionMenu", "actionMenuOptions", "onActionMenuSelect", "insertableItems", "onInsertItem"]);
|
|
50
|
+
// State for insert menu visibility
|
|
51
|
+
const [showInsertMenu, setShowInsertMenu] = useState(false);
|
|
52
|
+
const [triggerSelectBoxOpen, setTriggerSelectBoxOpen] = useState(false);
|
|
53
|
+
const textareaRef = useRef(null);
|
|
54
|
+
const insertMenuRef = useRef(null);
|
|
55
|
+
// Merge refs
|
|
56
|
+
const mergedRef = (node) => {
|
|
57
|
+
textareaRef.current = node;
|
|
58
|
+
if (typeof ref === "function") {
|
|
59
|
+
ref(node);
|
|
77
60
|
}
|
|
78
|
-
else {
|
|
79
|
-
|
|
80
|
-
if (item.value === "recent") {
|
|
81
|
-
handleMenuClick();
|
|
82
|
-
}
|
|
61
|
+
else if (ref) {
|
|
62
|
+
ref.current = node;
|
|
83
63
|
}
|
|
84
64
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
selectInput.focus();
|
|
94
|
-
selectInput.click();
|
|
95
|
-
// Hide again immediately after triggering
|
|
96
|
-
setTimeout(() => {
|
|
97
|
-
selectInput.style.pointerEvents = "none";
|
|
98
|
-
selectInput.style.opacity = "0";
|
|
99
|
-
selectInput.style.height = "0";
|
|
100
|
-
}, 50);
|
|
65
|
+
// Handle click outside to close insert menu
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (!showInsertMenu)
|
|
68
|
+
return;
|
|
69
|
+
const handleClickOutside = (event) => {
|
|
70
|
+
if (insertMenuRef.current &&
|
|
71
|
+
!insertMenuRef.current.contains(event.target)) {
|
|
72
|
+
setShowInsertMenu(false);
|
|
101
73
|
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
setTimeout(() => {
|
|
114
|
-
setSelectValue(null);
|
|
115
|
-
setSelectKey((prev) => prev + 1);
|
|
116
|
-
}, 100);
|
|
74
|
+
};
|
|
75
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
76
|
+
return () => {
|
|
77
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
78
|
+
};
|
|
79
|
+
}, [showInsertMenu]);
|
|
80
|
+
const handleActionSelect = (item) => {
|
|
81
|
+
if (item.value === "insert" && (insertableItems === null || insertableItems === void 0 ? void 0 : insertableItems.length)) {
|
|
82
|
+
setShowInsertMenu(true);
|
|
83
|
+
// Trigger SelectBox to open using the new enhanced props
|
|
84
|
+
setTriggerSelectBoxOpen(true);
|
|
117
85
|
}
|
|
118
86
|
else {
|
|
119
|
-
|
|
87
|
+
onActionMenuSelect === null || onActionMenuSelect === void 0 ? void 0 : onActionMenuSelect(item);
|
|
120
88
|
}
|
|
121
89
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
90
|
+
const handleSelectBoxOpened = () => {
|
|
91
|
+
// Reset the trigger after SelectBox has opened
|
|
92
|
+
setTriggerSelectBoxOpen(false);
|
|
93
|
+
};
|
|
94
|
+
const handleInsertSelect = (value, option) => {
|
|
95
|
+
console.log("Selected value:", value, "Selected option:", option); // Debug log
|
|
96
|
+
// SelectBox passes (value, option) - we want the full option object
|
|
97
|
+
const item = option;
|
|
98
|
+
if (!item || !item.value) {
|
|
99
|
+
console.warn("Invalid item selected:", item);
|
|
100
|
+
setShowInsertMenu(false);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (onInsertItem) {
|
|
104
|
+
onInsertItem(item);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
// Default behavior: insert at current cursor position
|
|
108
|
+
const textarea = textareaRef.current;
|
|
109
|
+
if (textarea) {
|
|
110
|
+
const start = textarea.selectionStart;
|
|
111
|
+
const end = textarea.selectionEnd;
|
|
112
|
+
const currentValue = textarea.value;
|
|
113
|
+
const newValue = currentValue.slice(0, start) + item.value + currentValue.slice(end);
|
|
114
|
+
textarea.value = newValue;
|
|
115
|
+
textarea.focus();
|
|
116
|
+
textarea.setSelectionRange(start + item.value.length, start + item.value.length);
|
|
117
|
+
// Trigger change event
|
|
118
|
+
const event = new Event("input", { bubbles: true });
|
|
119
|
+
textarea.dispatchEvent(event);
|
|
120
|
+
}
|
|
130
121
|
}
|
|
122
|
+
setShowInsertMenu(false);
|
|
131
123
|
};
|
|
132
|
-
return (_jsxs("div", { style: {
|
|
133
|
-
|
|
134
|
-
height: "fit-content",
|
|
135
|
-
}, children: [label && (_jsx(FieldLabel, { asterisk: required, error: error, description: description, size: size, actionComponent: showActionMenu ? (_jsx(DropDownMenu, { data: actionMenuOptions, variant: "text", size: "xs", arrow: false, onItemSelect: handleActionMenuSelect, buttonProps: {
|
|
124
|
+
return (_jsxs("div", { style: { gridColumn: `span ${colSpan}`, height: "fit-content" }, children: [label && (_jsx(FieldLabel, { asterisk: required, error: error, description: description, size: size, actionComponent: showActionMenu ? (_jsx(DropDownMenu, { data: actionMenuOptions, variant: "text", size: "xs", arrow: false, onItemSelect: handleActionSelect, buttonProps: {
|
|
125
|
+
"aria-label": "Open actions",
|
|
136
126
|
style: {
|
|
137
127
|
minWidth: "auto",
|
|
138
128
|
border: "none",
|
|
139
129
|
background: "transparent",
|
|
140
|
-
padding:
|
|
141
|
-
margin:
|
|
142
|
-
height:
|
|
143
|
-
width:
|
|
130
|
+
padding: 0,
|
|
131
|
+
margin: 0,
|
|
132
|
+
height: 16,
|
|
133
|
+
width: 16,
|
|
144
134
|
},
|
|
145
|
-
}, children: _jsx(MoreHorizontal, { size: 16 }) })) : null, children: label })), _jsxs(
|
|
135
|
+
}, children: _jsx(MoreHorizontal, { size: 16 }) })) : null, children: label })), _jsxs(TextAreaWrapper, { children: [_jsx(TextArea, Object.assign({ ref: mergedRef, size: size, maxRows: maxRows, minRows: minRows, onHeightChange: onHeightChange, cacheMeasurements: cacheMeasurements }, rest)), (insertableItems === null || insertableItems === void 0 ? void 0 : insertableItems.length) && (_jsx(InsertMenuOverlay, { ref: insertMenuRef, "$visible": showInsertMenu, children: _jsx(StyledInsertSelectBox, { data: insertableItems, placeholder: "Select item to insert...", searchable: true, clearable: false, arrow: false, focused: showInsertMenu, openOnFocus: true, triggerOpen: triggerSelectBoxOpen, onOpened: handleSelectBoxOpened, onChange: handleInsertSelect, size: size }) }))] })] }));
|
|
146
136
|
});
|
|
137
|
+
TextAreaInput.displayName = "TextAreaInput";
|
|
147
138
|
export default TextAreaInput;
|