ish-ui 1.0.23 → 1.0.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/formFields/EditInPlaceDateTimeField.js +9 -11
- package/dist/formFields/EditInPlaceField.js +2 -2
- package/dist/formFields/EditInPlaceFieldBase.js +4 -18
- package/dist/formFields/EditInPlacePasswordField.d.ts +4 -0
- package/dist/formFields/EditInPlacePasswordField.js +17 -0
- package/dist/formFields/EditInPlaceSearchSelect.js +5 -8
- package/dist/formFields/SelectCustomComponents.d.ts +1 -1
- package/dist/formFields/SelectCustomComponents.js +2 -19
- package/dist/formFields/UneditableBase.js +1 -1
- package/dist/tagsInput/TagInputList.js +7 -13
- package/dist/themes/ishTheme.js +15 -1
- package/package.json +1 -1
|
@@ -22,22 +22,16 @@ import { endFieldProcessingAction, startFieldProcessingAction } from '../actions
|
|
|
22
22
|
const useStyles = makeAppStyles(theme => ({
|
|
23
23
|
inlinePickerButton: {
|
|
24
24
|
padding: '2px',
|
|
25
|
-
marginBottom: '-4px',
|
|
26
25
|
fontSize: '1.3em',
|
|
27
26
|
'&:hover': {
|
|
28
27
|
color: theme.palette.primary.main,
|
|
29
28
|
}
|
|
30
29
|
},
|
|
31
|
-
pickerButton: {
|
|
32
|
-
width: theme.spacing(4),
|
|
33
|
-
height: theme.spacing(4),
|
|
34
|
-
bottom: theme.spacing(-0.5)
|
|
35
|
-
},
|
|
36
30
|
inlineContainer: {
|
|
37
31
|
display: 'inline-block',
|
|
38
32
|
}
|
|
39
33
|
}));
|
|
40
|
-
function EditInPlaceDateTimeField({ type, formatDate, formatTime, formatDateTime, timezone, input, fieldClasses = {}, inline, meta: { error, invalid, active, dispatch }, labelAdornment, label, disabled, formatValue, className, onKeyPress, placeholder
|
|
34
|
+
function EditInPlaceDateTimeField({ type, formatDate, formatTime, formatDateTime, timezone, input, fieldClasses = {}, inline, meta: { error, invalid, active, dispatch }, labelAdornment, label, disabled, formatValue, className, onKeyPress, placeholder, persistValue, warning, defaultValue, rightAligned, processActionId, variant, }) {
|
|
41
35
|
const [textValue, setTextValue] = useState(defaultValue || '');
|
|
42
36
|
const [pickerOpened, setPickerOpened] = useState(false);
|
|
43
37
|
const inputNode = useRef(null);
|
|
@@ -70,7 +64,7 @@ function EditInPlaceDateTimeField({ type, formatDate, formatTime, formatDateTime
|
|
|
70
64
|
setTextValue(formatDateInner(dateValue));
|
|
71
65
|
}, [dateValue]);
|
|
72
66
|
useEffect(() => {
|
|
73
|
-
if (!active && processActionId) {
|
|
67
|
+
if (!active && processActionId && dispatch) {
|
|
74
68
|
dispatch(endFieldProcessingAction(input.name));
|
|
75
69
|
}
|
|
76
70
|
}, [input.value, input.name, active, processActionId]);
|
|
@@ -117,7 +111,9 @@ function EditInPlaceDateTimeField({ type, formatDate, formatTime, formatDateTime
|
|
|
117
111
|
input.onBlur(null);
|
|
118
112
|
};
|
|
119
113
|
const onBlur = () => {
|
|
120
|
-
dispatch
|
|
114
|
+
if (dispatch) {
|
|
115
|
+
dispatch(startFieldProcessingAction(input.name));
|
|
116
|
+
}
|
|
121
117
|
if (persistValue && !textValue) {
|
|
122
118
|
input.onChange(input.value);
|
|
123
119
|
input.onBlur(input.value);
|
|
@@ -169,8 +165,10 @@ function EditInPlaceDateTimeField({ type, formatDate, formatTime, formatDateTime
|
|
|
169
165
|
'pointer-events-none': disabled
|
|
170
166
|
}) },
|
|
171
167
|
React.createElement("div", { id: input.name, className: "w-100" },
|
|
172
|
-
React.createElement(DateTimeField, { type: type, toolbarTitle: label, open: pickerOpened, value: dateValue, onChange: onChange, onClose: onClose, renderInput: () => (React.createElement(EditInPlaceFieldBase, { name: input.name, value: textValue, variant: variant, error: error, invalid: invalid, inline: inline, label: label, warning: warning, fieldClasses: fieldClasses, rightAligned: rightAligned, shrink: Boolean(label || input.value), disabled: disabled, labelAdornment: labelAdornment, placeholder: placeholder, editIcon: React.createElement(IconButton, { tabIndex: -1, onClick: openPicker,
|
|
173
|
-
|
|
168
|
+
React.createElement(DateTimeField, { type: type, toolbarTitle: label, open: pickerOpened, value: dateValue, onChange: onChange, onClose: onClose, renderInput: () => (React.createElement(EditInPlaceFieldBase, { name: input.name, value: textValue, variant: variant, error: error, invalid: invalid, inline: inline, label: label, warning: warning, fieldClasses: fieldClasses, rightAligned: rightAligned, shrink: Boolean(label || input.value), disabled: disabled, labelAdornment: labelAdornment, placeholder: placeholder, editIcon: React.createElement(IconButton, { tabIndex: -1, onClick: openPicker, sx: variant === 'outlined' ? {
|
|
169
|
+
marginRight: -1
|
|
170
|
+
} : null, classes: {
|
|
171
|
+
root: clsx(fieldClasses.text, inline && classes.inlinePickerButton)
|
|
174
172
|
} }, type === 'time'
|
|
175
173
|
? React.createElement(QueryBuilder, { fontSize: "inherit", color: "inherit" })
|
|
176
174
|
: React.createElement(DateRange, { color: "inherit", fontSize: "inherit" })), InputProps: {
|
|
@@ -31,7 +31,7 @@ const useStyles = makeAppStyles(theme => ({
|
|
|
31
31
|
opacity: 0.5
|
|
32
32
|
}
|
|
33
33
|
}));
|
|
34
|
-
function EditInPlaceField({ inputRef, input, label, maxLength, disabled, min, max, step, className, onKeyPress, labelAdornment, truncateLines, rightAligned, defaultValue, onKeyDown, multiline, inline, warning, preformatDisplayValue, type = 'text', meta: { error, invalid }, placeholder
|
|
34
|
+
function EditInPlaceField({ inputRef, input, label, maxLength, disabled, min, max, step, className, onKeyPress, labelAdornment, truncateLines, rightAligned, defaultValue, onKeyDown, multiline, inline, warning, preformatDisplayValue, type = 'text', meta: { error, invalid }, placeholder, fieldClasses = {}, InputProps = {}, editIcon, variant }) {
|
|
35
35
|
const classes = useStyles();
|
|
36
36
|
const onBlur = () => {
|
|
37
37
|
(input === null || input === void 0 ? void 0 : input.onBlur) && input.onBlur(input.value);
|
|
@@ -43,7 +43,7 @@ function EditInPlaceField({ inputRef, input, label, maxLength, disabled, min, ma
|
|
|
43
43
|
[classes.rightAligned]: rightAligned,
|
|
44
44
|
[classes.inlineContainer]: inline
|
|
45
45
|
}) },
|
|
46
|
-
React.createElement(EditInPlaceFieldBase, { name: input.name, value: inputValue, variant: variant, error: error, invalid: invalid, inline: inline, label: label, warning: warning, fieldClasses: fieldClasses, endAdornmentClass: classes.endAdornment, rightAligned: rightAligned, shrink: Boolean(label || input.value), disabled: disabled, labelAdornment: labelAdornment, placeholder: placeholder, hideArrows: ['percentage', 'number'].includes(type), editIcon: editIcon === undefined ? React.createElement(Edit, { fontSize:
|
|
46
|
+
React.createElement(EditInPlaceFieldBase, { name: input.name, value: inputValue, variant: variant, error: error, invalid: invalid, inline: inline, label: label, warning: warning, fieldClasses: fieldClasses, endAdornmentClass: classes.endAdornment, rightAligned: rightAligned, shrink: Boolean(label || input.value), disabled: disabled, labelAdornment: labelAdornment, placeholder: placeholder, hideArrows: ['percentage', 'number'].includes(type), editIcon: editIcon === undefined ? React.createElement(Edit, { fontSize: inline ? 'inherit' : undefined }) : editIcon, InputProps: Object.assign({ multiline,
|
|
47
47
|
onKeyPress,
|
|
48
48
|
onBlur, onFocus: input.onFocus, maxRows: truncateLines, inputProps: {
|
|
49
49
|
ref: inputRef,
|
|
@@ -33,9 +33,6 @@ const useStyles = makeAppStyles(theme => ({
|
|
|
33
33
|
},
|
|
34
34
|
'&:hover .invisible': {
|
|
35
35
|
visibility: 'visible',
|
|
36
|
-
},
|
|
37
|
-
'& .Mui-focused $inputEndAdornment': {
|
|
38
|
-
opacity: 1,
|
|
39
36
|
}
|
|
40
37
|
},
|
|
41
38
|
hideArrows: {
|
|
@@ -56,14 +53,6 @@ const useStyles = makeAppStyles(theme => ({
|
|
|
56
53
|
readonly: {
|
|
57
54
|
fontWeight: 300,
|
|
58
55
|
pointerEvents: 'none'
|
|
59
|
-
},
|
|
60
|
-
inputEndAdornment: {
|
|
61
|
-
display: 'flex',
|
|
62
|
-
fontSize: '24px',
|
|
63
|
-
color: theme.palette.primary.main,
|
|
64
|
-
alignItems: 'flex-end',
|
|
65
|
-
alignSelf: 'flex-end',
|
|
66
|
-
marginBottom: '5px'
|
|
67
56
|
}
|
|
68
57
|
}));
|
|
69
58
|
const EditInPlaceFieldBase = ({ value, invalid, className, inline, label, fieldClasses = {}, rightAligned, shrink, name, disabled, labelAdornment, editIcon, error, placeholder, hideArrows, warning, endAdornmentClass, CustomInput, InputProps, variant = 'standard' }) => {
|
|
@@ -71,7 +60,8 @@ const EditInPlaceFieldBase = ({ value, invalid, className, inline, label, fieldC
|
|
|
71
60
|
const classes = useStyles();
|
|
72
61
|
const inputNode = useRef();
|
|
73
62
|
const onAdornmentClick = () => {
|
|
74
|
-
|
|
63
|
+
var _a;
|
|
64
|
+
(_a = inputNode.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
75
65
|
};
|
|
76
66
|
useEffect(() => {
|
|
77
67
|
if (inline && inputNode.current) {
|
|
@@ -89,10 +79,6 @@ const EditInPlaceFieldBase = ({ value, invalid, className, inline, label, fieldC
|
|
|
89
79
|
return OutlinedInput;
|
|
90
80
|
}
|
|
91
81
|
}, [variant]);
|
|
92
|
-
console.log('!!!!!!', {
|
|
93
|
-
label,
|
|
94
|
-
InputProps
|
|
95
|
-
});
|
|
96
82
|
return (React.createElement(FormControl, { fullWidth: true, error: invalid, variant: variant, margin: "none", className: clsx(className, classes.inputWrapper) },
|
|
97
83
|
label && (React.createElement(InputLabel, { classes: {
|
|
98
84
|
root: clsx(fieldClasses.label, 'd-flex', 'overflow-visible', rightAligned && classes.rightLabel),
|
|
@@ -112,10 +98,10 @@ const EditInPlaceFieldBase = ({ value, invalid, className, inline, label, fieldC
|
|
|
112
98
|
root: clsx(fieldClasses.text, inline && classes.inlineInput),
|
|
113
99
|
underline: fieldClasses.underline
|
|
114
100
|
}, disabled: disabled, endAdornment: !disabled &&
|
|
115
|
-
React.createElement(InputAdornment, { position: "end", onClick: onAdornmentClick, className: clsx(
|
|
101
|
+
React.createElement(InputAdornment, { position: "end", onClick: onAdornmentClick, className: clsx(endAdornmentClass, {
|
|
116
102
|
['fsInherit']: inline,
|
|
117
103
|
['d-none']: (rightAligned || inline),
|
|
118
|
-
['invisible']: !(rightAligned || inline)
|
|
104
|
+
['invisible']: variant !== 'outlined' && !(rightAligned || inline)
|
|
119
105
|
}) }, editIcon), id: `input-${name}`, name: name })),
|
|
120
106
|
React.createElement(FormHelperText, { classes: {
|
|
121
107
|
root: clsx(rightAligned && 'text-end'),
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EditInPlaceFieldProps, FieldInputProps, FieldMetaProps } from '../model';
|
|
3
|
+
declare function EditInPlacePasswordField<FP extends FieldInputProps, MP extends FieldMetaProps>(props: EditInPlaceFieldProps<FP, MP>): React.JSX.Element;
|
|
4
|
+
export default EditInPlacePasswordField;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright ish group pty ltd 2023.
|
|
3
|
+
*
|
|
4
|
+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License version 3 as published by the Free Software Foundation.
|
|
5
|
+
*
|
|
6
|
+
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
|
|
7
|
+
*/
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
10
|
+
import VisibilityOffIcon from '@mui/icons-material/VisibilityOff';
|
|
11
|
+
import EditInPlaceField from './EditInPlaceField';
|
|
12
|
+
import IconButton from '@mui/material/IconButton';
|
|
13
|
+
function EditInPlacePasswordField(props) {
|
|
14
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
15
|
+
return (React.createElement(EditInPlaceField, Object.assign({}, props, { type: showPassword ? 'text' : 'password', editIcon: React.createElement(IconButton, { sx: props.variant === 'outlined' ? { marginRight: -1 } : null, onClick: () => setShowPassword(!showPassword) }, showPassword ? React.createElement(VisibilityOffIcon, null) : React.createElement(VisibilityIcon, null)) })));
|
|
16
|
+
}
|
|
17
|
+
export default EditInPlacePasswordField;
|
|
@@ -28,10 +28,7 @@ import EditInPlaceFieldBase from './EditInPlaceFieldBase';
|
|
|
28
28
|
import { makeAppStyles } from '../styles';
|
|
29
29
|
import { getHighlightedPartLabel, stubComponent } from '../utils';
|
|
30
30
|
import { usePrevious } from '../utils/hooks';
|
|
31
|
-
const useStyles = makeAppStyles(theme => (Object.assign({
|
|
32
|
-
marginBottom: '6px',
|
|
33
|
-
color: theme.palette.primary.main
|
|
34
|
-
}, popper: {
|
|
31
|
+
const useStyles = makeAppStyles(theme => (Object.assign({ popper: {
|
|
35
32
|
zIndex: 1400
|
|
36
33
|
} }, selectStyles(theme))));
|
|
37
34
|
const SelectContext = React.createContext({});
|
|
@@ -262,7 +259,7 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
|
|
|
262
259
|
}, [selectedOption, searchValue, displayedValue, selectValueMark, returnType, valueRenderer, input.value]);
|
|
263
260
|
const renderIcons = useMemo(() => !disabled && (loading
|
|
264
261
|
? React.createElement(CircularProgress, { size: 24, thickness: 4, className: fieldClasses.loading })
|
|
265
|
-
: (React.createElement("div",
|
|
262
|
+
: (React.createElement("div", null,
|
|
266
263
|
allowEmpty && input.value && (React.createElement(IconButton, { size: "small", onClick: onClear, color: "inherit" },
|
|
267
264
|
React.createElement(CloseIcon, { fontSize: "inherit" }))),
|
|
268
265
|
editIcon === undefined ? React.createElement(IconButton, { size: "small", color: "inherit", className: clsx(classes.expandIcon, 'pl-0 pr-0'), disableRipple: true },
|
|
@@ -274,7 +271,7 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
|
|
|
274
271
|
return input.value || null;
|
|
275
272
|
}, [input.value, multiple, selectValueMark, sortedItems]);
|
|
276
273
|
const renderedPlaceholder = useMemo(() => {
|
|
277
|
-
const rendered = placeholder
|
|
274
|
+
const rendered = placeholder;
|
|
278
275
|
return multiple && inputValue.length ? null : rendered;
|
|
279
276
|
}, [multiple, placeholder, isEditing, inputValue]);
|
|
280
277
|
return (React.createElement("div", { className: clsx(className, 'outline-none', inline && classes.inline), id: input === null || input === void 0 ? void 0 : input.name },
|
|
@@ -301,7 +298,7 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
|
|
|
301
298
|
groupUl: 'm-0'
|
|
302
299
|
}, groupBy: categoryKey && (option => option[categoryKey]), renderOption: renderOption, getOptionLabel: getOptionLabel, filterOptions: filterItems, ListboxComponent: inline || categoryKey ? null : ListBoxAdapter, PopperComponent: categoryKey ? null : PopperAdapter, renderInput: (_a) => {
|
|
303
300
|
var { InputLabelProps, InputProps, inputProps } = _a, params = __rest(_a, ["InputLabelProps", "InputProps", "inputProps"]);
|
|
304
|
-
return (React.createElement(EditInPlaceFieldBase, Object.assign({}, params, { variant: variant, name: input.name, value: displayedValue, error: error, invalid: hasError || invalid, inline: inline, label: label, warning: warning, fieldClasses: fieldClasses,
|
|
301
|
+
return (React.createElement(EditInPlaceFieldBase, Object.assign({}, params, { variant: variant, name: input.name, value: displayedValue, error: error, invalid: hasError || invalid, inline: inline, label: label, warning: warning, fieldClasses: fieldClasses, rightAligned: rightAligned, shrink: Boolean(label || input.value), labelAdornment: labelAdornment, placeholder: renderedPlaceholder, editIcon: !hideEditIcon && renderIcons, InputProps: Object.assign(Object.assign({}, InputProps), { onChange: handleInputChange, onFocus: edit, onClick: onEditButtonFocus, onBlur,
|
|
305
302
|
disableUnderline, classes: {
|
|
306
303
|
underline: fieldClasses.underline,
|
|
307
304
|
input: clsx(disabled && classes.readonly, fieldClasses.text),
|
|
@@ -314,7 +311,7 @@ function EditInPlaceSearchSelect({ label, disabled, className, labelAdornment, i
|
|
|
314
311
|
?
|
|
315
312
|
React.createElement(Select, Object.assign({}, InputProps, { inputRef: ref => {
|
|
316
313
|
inputProps.ref.current = ref === null || ref === void 0 ? void 0 : ref.node;
|
|
317
|
-
}, classes: { select: 'cursor-text' }, onFocus: edit, value: (returnType === 'object' ? input.value[selectValueMark] : input.value) || '', endAdornment: React.createElement(InputAdornment, { position: "end", className:
|
|
314
|
+
}, classes: { select: 'cursor-text' }, onFocus: edit, value: (returnType === 'object' ? input.value[selectValueMark] : input.value) || '', endAdornment: React.createElement(InputAdornment, { position: "end", className: 'd-none' }, renderIcons), IconComponent: stubComponent }), renderValue)
|
|
318
315
|
: null })));
|
|
319
316
|
}, disableListWrap: true, openOnFocus: true, fullWidth: true }))));
|
|
320
317
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const selectStyles: (theme: any) => import("@mui/styles").StyleRules<{}, "label" | "inline" | "multiple" | "error" | "root" | "expandIcon" | "menuItem" | "inputWrapper" | "readonly" | "
|
|
2
|
+
export declare const selectStyles: (theme: any) => import("@mui/styles").StyleRules<{}, "label" | "inline" | "multiple" | "error" | "root" | "expandIcon" | "menuItem" | "inputWrapper" | "readonly" | "editIcon" | "bottomMargin" | "bottomPadding" | "topMargin" | "editable" | "valid" | "autoWidthSelect" | "emptySelect" | "validUnderline" | "menuItemActive" | "menuList" | "hasPopup" | "hasClear">;
|
|
3
3
|
export declare const ListRow: React.MemoExoticComponent<any>;
|
|
4
4
|
export declare const ListboxComponent: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
|
|
5
5
|
export declare const NoWrapOption: (content: any, data: any, search: any, parentProps: any) => React.JSX.Element;
|
|
@@ -25,7 +25,7 @@ import { areEqual, FixedSizeList as List } from 'react-window';
|
|
|
25
25
|
import { createStyles } from '@mui/styles';
|
|
26
26
|
import { green } from '@mui/material/colors';
|
|
27
27
|
import clsx from 'clsx';
|
|
28
|
-
import {
|
|
28
|
+
import { ListItemButton } from '@mui/material';
|
|
29
29
|
import Tooltip from '@mui/material/Tooltip';
|
|
30
30
|
export const selectStyles = theme => createStyles({
|
|
31
31
|
bottomMargin: {
|
|
@@ -96,31 +96,14 @@ export const selectStyles = theme => createStyles({
|
|
|
96
96
|
display: 'inline-block',
|
|
97
97
|
'& .MuiInput-root .MuiInput-input': {
|
|
98
98
|
padding: 0
|
|
99
|
-
},
|
|
100
|
-
'& $inputEndAdornment': {
|
|
101
|
-
marginBottom: '-8px'
|
|
102
99
|
}
|
|
103
100
|
},
|
|
104
101
|
root: {
|
|
105
102
|
'& $multiple': {
|
|
106
103
|
flexWrap: 'wrap'
|
|
107
|
-
},
|
|
108
|
-
'& $multiple $inputEndAdornment': {
|
|
109
|
-
position: 'absolute',
|
|
110
|
-
right: 0,
|
|
111
|
-
bottom: 6,
|
|
112
|
-
height: 'auto'
|
|
113
104
|
}
|
|
114
105
|
},
|
|
115
|
-
inputEndAdornment: {
|
|
116
|
-
marginBottom: '-6px',
|
|
117
|
-
alignItems: 'center',
|
|
118
|
-
display: 'flex',
|
|
119
|
-
},
|
|
120
106
|
inputWrapper: {
|
|
121
|
-
'&:hover $inputEndAdornment': {
|
|
122
|
-
visibility: 'visible'
|
|
123
|
-
},
|
|
124
107
|
'&.Mui-focused $expandIcon': {
|
|
125
108
|
opacity: 1
|
|
126
109
|
}
|
|
@@ -142,7 +125,7 @@ export const selectStyles = theme => createStyles({
|
|
|
142
125
|
});
|
|
143
126
|
export const ListRow = React.memo(({ data: { children, selectAdornment }, index, style }) => {
|
|
144
127
|
const inlineStyle = Object.assign(Object.assign({}, style), { top: style.top + 8, paddingLeft: 0, paddingRight: 0, whiteSpace: 'nowrap' });
|
|
145
|
-
return (React.createElement(
|
|
128
|
+
return (React.createElement(ListItemButton, { style: inlineStyle }, (((selectAdornment === null || selectAdornment === void 0 ? void 0 : selectAdornment.position) === 'start' && index === 0)
|
|
146
129
|
|| ((selectAdornment === null || selectAdornment === void 0 ? void 0 : selectAdornment.position) === 'end' && index === children.length))
|
|
147
130
|
? selectAdornment.content
|
|
148
131
|
: children[index]));
|
|
@@ -20,7 +20,7 @@ const useStyles = makeAppStyles({
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const UneditableBase = React.memo(props => {
|
|
23
|
-
const { label, labelAdornment, placeholder
|
|
23
|
+
const { label, labelAdornment, placeholder, rightAligned, value, url, money, currencySymbol, className, format, multiline, error } = props;
|
|
24
24
|
const classes = useStyles();
|
|
25
25
|
const inputId = `input-${label.toLowerCase().replace(' ', '-')}`;
|
|
26
26
|
const openLink = useCallback(() => {
|
|
@@ -28,15 +28,7 @@ import EditInPlaceFieldBase from '../formFields/EditInPlaceFieldBase';
|
|
|
28
28
|
import { getAllMenuTags, getHighlightedPartLabel, getMenuTags, stubComponent } from '../utils';
|
|
29
29
|
import getCaretCoordinates from '../utils/DOM/getCaretCoordinates';
|
|
30
30
|
import { makeAppStyles } from '../styles';
|
|
31
|
-
const useStyles = makeAppStyles((theme) => (Object.assign(Object.assign({}, selectStyles(theme)), {
|
|
32
|
-
visibility: 'hidden',
|
|
33
|
-
display: 'flex',
|
|
34
|
-
color: theme.palette.primary.main,
|
|
35
|
-
alignItems: 'flex-end',
|
|
36
|
-
alignSelf: 'flex-end',
|
|
37
|
-
marginBottom: '4px',
|
|
38
|
-
opacity: 0.5
|
|
39
|
-
}, tagColorDotSmall: {
|
|
31
|
+
const useStyles = makeAppStyles((theme) => (Object.assign(Object.assign({}, selectStyles(theme)), { tagColorDotSmall: {
|
|
40
32
|
width: theme.spacing(2),
|
|
41
33
|
minWidth: theme.spacing(2),
|
|
42
34
|
height: theme.spacing(2),
|
|
@@ -45,6 +37,8 @@ const useStyles = makeAppStyles((theme) => (Object.assign(Object.assign({}, sele
|
|
|
45
37
|
borderRadius: '100%'
|
|
46
38
|
}, listbox: {
|
|
47
39
|
whiteSpace: 'break-spaces'
|
|
40
|
+
}, editIcon: {
|
|
41
|
+
opacity: 0.5
|
|
48
42
|
}, invalid: {} })));
|
|
49
43
|
const endTagRegex = /#\s*[^\w\d]*$/;
|
|
50
44
|
const getCurrentInputString = (input, formTagIds = [], allMenuTags = []) => {
|
|
@@ -256,16 +250,16 @@ function TagInputList({ input, tags, placeholder, labelAdornment, meta, label =
|
|
|
256
250
|
noOptions: 'd-none'
|
|
257
251
|
}, renderInput: (_a) => {
|
|
258
252
|
var { InputProps, inputProps } = _a, params = __rest(_a, ["InputProps", "inputProps"]);
|
|
259
|
-
return (React.createElement(EditInPlaceFieldBase, Object.assign({}, params, { variant: variant, name: input.name, value: input.value, error: meta.error, invalid: meta === null || meta === void 0 ? void 0 : meta.invalid, label: label, warning: warning, disabled: disabled, fieldClasses: fieldClasses, shrink: Boolean(label || input.value), labelAdornment: labelAdornment, placeholder: placeholder
|
|
253
|
+
return (React.createElement(EditInPlaceFieldBase, Object.assign({}, params, { variant: variant, name: input.name, value: input.value, error: meta.error, invalid: meta === null || meta === void 0 ? void 0 : meta.invalid, label: label, warning: warning, disabled: disabled, fieldClasses: fieldClasses, shrink: Boolean(label || input.value), labelAdornment: labelAdornment, placeholder: placeholder, editIcon: editIcon === undefined ? React.createElement(Edit, null) : editIcon, InputProps: Object.assign(Object.assign({}, InputProps), { onChange: handleInputChange, onFocus,
|
|
260
254
|
onBlur, inputProps: Object.assign(Object.assign({}, inputProps), { ref: ref => {
|
|
261
255
|
inputProps.ref.current = ref;
|
|
262
256
|
inputNode.current = ref;
|
|
263
257
|
}, value: inputValue }) }), CustomInput: !isEditing
|
|
264
258
|
? React.createElement(Select, { inputRef: ref => {
|
|
265
259
|
inputProps.ref.current = ref === null || ref === void 0 ? void 0 : ref.node;
|
|
266
|
-
}, onFocus: edit, value: "stub", className: classes.inputWrapper, classes: { select: 'd-flex flex-wrap cursor-text' }, endAdornment: React.createElement(InputAdornment, { position: "end", className: classes.
|
|
267
|
-
React.createElement(Edit,
|
|
268
|
-
React.createElement(MenuItem, { value: "stub" }, InputValueForRender || React.createElement("span", { className: "placeholderContent" }, placeholder
|
|
260
|
+
}, onFocus: edit, value: "stub", className: classes.inputWrapper, classes: { select: 'd-flex flex-wrap cursor-text' }, endAdornment: React.createElement(InputAdornment, { position: "end", className: clsx(classes.editIcon, 'invisible') },
|
|
261
|
+
React.createElement(Edit, { className: "test" })), IconComponent: stubComponent },
|
|
262
|
+
React.createElement(MenuItem, { value: "stub" }, InputValueForRender || React.createElement("span", { className: "placeholderContent" }, placeholder)))
|
|
269
263
|
: null })));
|
|
270
264
|
}, popupIcon: stubComponent(), disableListWrap: true, openOnFocus: true }))));
|
|
271
265
|
}
|
package/dist/themes/ishTheme.js
CHANGED
|
@@ -90,6 +90,12 @@ const createOverrides = (palette) => ({
|
|
|
90
90
|
MuiInputBase: {
|
|
91
91
|
styleOverrides: {
|
|
92
92
|
root: {
|
|
93
|
+
'& .MuiInputAdornment-positionEnd.MuiInputAdornment-standard': {
|
|
94
|
+
color: palette.primary.main
|
|
95
|
+
},
|
|
96
|
+
'&.Mui-focused .MuiInputAdornment-positionEnd.MuiInputAdornment-standard': {
|
|
97
|
+
opacity: 1
|
|
98
|
+
},
|
|
93
99
|
maxWidth: '100%',
|
|
94
100
|
width: '100%',
|
|
95
101
|
MuiInput: {
|
|
@@ -170,7 +176,15 @@ const createOverrides = (palette) => ({
|
|
|
170
176
|
},
|
|
171
177
|
MuiAutocomplete: {
|
|
172
178
|
styleOverrides: {
|
|
179
|
+
root: {
|
|
180
|
+
'& .MuiOutlinedInput-root': {
|
|
181
|
+
padding: 'inherit'
|
|
182
|
+
}
|
|
183
|
+
},
|
|
173
184
|
inputRoot: {
|
|
185
|
+
'& .MuiInputAdornment-outlined': {
|
|
186
|
+
paddingRight: 12
|
|
187
|
+
},
|
|
174
188
|
flexWrap: 'inherit',
|
|
175
189
|
}
|
|
176
190
|
}
|
|
@@ -181,7 +195,7 @@ const createOverrides = (palette) => ({
|
|
|
181
195
|
marginLeft: 0
|
|
182
196
|
}
|
|
183
197
|
}
|
|
184
|
-
}
|
|
198
|
+
}
|
|
185
199
|
}
|
|
186
200
|
});
|
|
187
201
|
const commonTypography = {
|