@wavv/ui 2.4.13 → 2.4.14
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.
|
@@ -84,7 +84,7 @@ const DraftEditor = ({ value, onChange, onEnterKey, onFocus, onBlur, mergeFields
|
|
|
84
84
|
height: height,
|
|
85
85
|
editorMaxHeight: editorMaxHeight,
|
|
86
86
|
noPadding: noPadding || textOnly,
|
|
87
|
-
readOnly: readOnly,
|
|
87
|
+
readOnly: readOnly || disabled,
|
|
88
88
|
color: color,
|
|
89
89
|
overflow: overflow,
|
|
90
90
|
clampLines: clampLines,
|
|
@@ -106,7 +106,7 @@ const DraftEditor = ({ value, onChange, onEnterKey, onFocus, onBlur, mergeFields
|
|
|
106
106
|
className: className,
|
|
107
107
|
children: [
|
|
108
108
|
/*#__PURE__*/ jsxs(InputWrapper, {
|
|
109
|
-
readOnly: readOnly,
|
|
109
|
+
readOnly: readOnly || disabled,
|
|
110
110
|
children: [
|
|
111
111
|
label && /*#__PURE__*/ jsx(Label, {
|
|
112
112
|
filled: isInputFilled(value),
|
|
@@ -119,7 +119,7 @@ const DraftEditor = ({ value, onChange, onEnterKey, onFocus, onBlur, mergeFields
|
|
|
119
119
|
editorState: editorState,
|
|
120
120
|
onChange: handleChange,
|
|
121
121
|
placeholder: placeholder,
|
|
122
|
-
readOnly: readOnly,
|
|
122
|
+
readOnly: readOnly || disabled,
|
|
123
123
|
handleReturn: handleEditorReturn,
|
|
124
124
|
handlePastedText: handlePaste,
|
|
125
125
|
onFocus: handleFocus,
|
|
@@ -143,10 +143,10 @@ const EditorContainer = styled(InputContainer)(({ theme, height, noPadding, disa
|
|
|
143
143
|
color: disabled ? theme.input.color.disabled : color || theme.input.color.default,
|
|
144
144
|
cursor: readOnly ? 'inherit' : 'text',
|
|
145
145
|
'&:hover': {
|
|
146
|
-
backgroundColor: readOnly ? theme.input.background.default : void 0,
|
|
147
|
-
borderBottom: readOnly ? `1px solid ${theme.input.borderColor.default}` : void 0,
|
|
146
|
+
backgroundColor: readOnly && !disabled ? theme.input.background.default : void 0,
|
|
147
|
+
borderBottom: readOnly && !disabled ? `1px solid ${theme.input.borderColor.default}` : void 0,
|
|
148
148
|
Label: {
|
|
149
|
-
color: readOnly ? theme.input.labelColor.filled : void 0
|
|
149
|
+
color: readOnly && !disabled ? theme.input.labelColor.filled : void 0
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
}), ({ theme, height, hasLabel, editorMaxHeight, overflow, clampLines, hideEditor, fontSize, noPadding, filled })=>({
|
|
@@ -27,11 +27,11 @@ const Select_Select = ({ backgroundColor, menuBackground, children, fontSize, fo
|
|
|
27
27
|
const [internalValue, setInternalValue] = useState(()=>{
|
|
28
28
|
if (isMultiple) {
|
|
29
29
|
const defaultValueArray = defaultValue;
|
|
30
|
-
return Array.isArray(defaultValueArray) ? defaultValueArray
|
|
31
|
-
|
|
30
|
+
return Array.isArray(defaultValueArray) ? defaultValueArray : defaultValueArray ? [
|
|
31
|
+
defaultValueArray
|
|
32
32
|
] : [];
|
|
33
33
|
}
|
|
34
|
-
return defaultValue
|
|
34
|
+
return defaultValue ?? '';
|
|
35
35
|
});
|
|
36
36
|
const isControlled = void 0 !== value;
|
|
37
37
|
const currentValue = isControlled ? value : internalValue;
|
|
@@ -68,9 +68,9 @@ type SingleSelectInputProps = BaseSelectInputProps & {
|
|
|
68
68
|
/** The selection mode for the select */
|
|
69
69
|
selectionMode?: 'single';
|
|
70
70
|
/** The controlled value of the input */
|
|
71
|
-
value?:
|
|
71
|
+
value?: string;
|
|
72
72
|
/** The uncontrolled initial value of the input */
|
|
73
|
-
defaultValue?:
|
|
73
|
+
defaultValue?: string;
|
|
74
74
|
/** The function to be called when an option is selected */
|
|
75
75
|
onChange?: (key: string) => void;
|
|
76
76
|
};
|
|
@@ -78,9 +78,9 @@ type MultipleSelectInputProps = BaseSelectInputProps & {
|
|
|
78
78
|
/** The selection mode for the select */
|
|
79
79
|
selectionMode: 'multiple';
|
|
80
80
|
/** The controlled value of the input */
|
|
81
|
-
value?:
|
|
81
|
+
value?: string | string[];
|
|
82
82
|
/** The uncontrolled initial value of the input */
|
|
83
|
-
defaultValue?:
|
|
83
|
+
defaultValue?: string | string[];
|
|
84
84
|
onChange?: (keys: string | string[]) => void;
|
|
85
85
|
};
|
|
86
86
|
export type SelectInputProps = SingleSelectInputProps | MultipleSelectInputProps;
|