@irontec/ivoz-ui 1.7.2 → 1.7.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.
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import AddIcon from '@mui/icons-material/Add';
|
|
3
3
|
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
|
4
4
|
import { Box, useMediaQuery, useTheme } from '@mui/material';
|
|
5
|
-
import { memo, useEffect, useState } from 'react';
|
|
5
|
+
import { memo, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
import { LightButton, TonalButton, } from '../../../../components/shared/Button/Button.styles';
|
|
7
7
|
import { isPropertyFk, isPropertyScalar, } from '../../../../services/api/ParsedApiSpecInterface';
|
|
8
8
|
import { StyledDropdown } from '../../../../services/form/Field/Dropdown/Dropdown.styles';
|
|
@@ -18,13 +18,16 @@ export default function ContentFilterRow(props) {
|
|
|
18
18
|
if (!filters[name]) {
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
|
-
const filterChoices = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
const filterChoices = useMemo(() => {
|
|
22
|
+
const choices = {};
|
|
23
|
+
for (const filter of filters[name]) {
|
|
24
|
+
choices[filter] = FilterIconFactory({
|
|
25
|
+
name: filter,
|
|
26
|
+
includeLabel: true,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return choices;
|
|
30
|
+
}, [filters, name]);
|
|
28
31
|
const [type, setType] = useState(row.type);
|
|
29
32
|
const [value, setValue] = useState(row.value);
|
|
30
33
|
useEffect(() => {
|
|
@@ -74,7 +77,7 @@ export default function ContentFilterRow(props) {
|
|
|
74
77
|
setValue('');
|
|
75
78
|
}, onBlur: () => {
|
|
76
79
|
/* noop */
|
|
77
|
-
}, choices: fieldNames, error: false, errorMsg: '', hasChanged: false }), _jsx(
|
|
80
|
+
}, choices: fieldNames, error: false, errorMsg: '', hasChanged: false }), _jsx(StyledDropdown, { name: 'type', label: '', value: type, required: false, disabled: false, onChange: ({ target }) => {
|
|
78
81
|
setType(target.value);
|
|
79
82
|
}, onBlur: () => {
|
|
80
83
|
/* noop */
|
|
@@ -23,9 +23,7 @@ export default function ConfirmDialog(props) {
|
|
|
23
23
|
setInputVal(val || '');
|
|
24
24
|
}, []);
|
|
25
25
|
const handleKeyDown = (event) => {
|
|
26
|
-
|
|
27
|
-
event.stopPropagation();
|
|
28
|
-
}
|
|
26
|
+
event.stopPropagation();
|
|
29
27
|
};
|
|
30
28
|
const sumbitEnabled = !doubleCheck || inputVal == doubleCheckExpectedStr;
|
|
31
29
|
return (_jsxs(Dialog, Object.assign({ open: open, TransitionComponent: Transition, keepMounted: true, onClose: handleClose, "aria-labelledby": 'alert-dialog-slide-title', "aria-describedby": 'alert-dialog-slide-description', onKeyDown: handleKeyDown }, { children: [_jsx(CloseRoundedIcon, { className: 'close-icon', onClick: handleClose }), _jsx("img", { src: 'assets/img/delete-dialog.svg', className: 'modal-icon' }), _jsx(DialogTitle, Object.assign({ id: 'alert-dialog-slide-title' }, { children: _('Remove element') })), _jsxs(DialogContent, { children: [_jsx(DialogContentText, Object.assign({ id: 'alert-dialog-slide-description' }, { children: text })), doubleCheck && (_jsx(StyledDialogContentText, Object.assign({ id: 'alert-dialog-double-check-description' }, { children: _('Please type the item name, as shown in bold font above, to continue') }))), doubleCheck && (_jsx(StyledSearchTextField, { type: 'text', hasChanged: false, defaultValue: inputVal, onChange: onChangeHandler }))] }), _jsxs(DialogActions, { children: [_jsx(OutlinedButton, Object.assign({ onClick: handleClose, sx: { flexGrow: '1' }, color: 'error' }, { children: _('No, keep it') })), _jsx(SolidButton, Object.assign({ disabled: !sumbitEnabled, onClick: handleApply, sx: { flexGrow: '1' }, color: 'error' }, { children: _('Yes, delete it') }))] })] })));
|