@irontec/ivoz-ui 1.6.2 → 1.7.2
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/components/List/Content/CTA/DeleteRowButton.js +9 -2
- package/components/form.helper.d.ts +4 -1
- package/components/form.helper.js +37 -1
- package/components/shared/ConfirmDialog.js +6 -1
- package/components/shared/ConfirmEditDialog.d.ts +10 -0
- package/components/shared/ConfirmEditDialog.js +51 -0
- package/entities/DefaultEntityBehavior/Form/Form.js +54 -26
- package/entities/EntityInterface.d.ts +1 -0
- package/package.json +1 -1
- package/services/form/InverseRealtions/InverseRelationHelper.d.ts +3 -0
- package/services/form/InverseRealtions/InverseRelationHelper.js +37 -0
- package/services/form/InverseRealtions/index.d.ts +2 -0
- package/services/form/InverseRealtions/index.js +2 -0
- package/services/form/index.d.ts +1 -0
- package/services/form/index.js +1 -0
- package/translations/ca.json +4 -0
- package/translations/en.json +4 -0
- package/translations/es.json +4 -0
- package/translations/it.json +4 -0
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { jsx as _jsx,
|
|
10
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Tooltip } from '@mui/material';
|
|
12
12
|
import { useState } from 'react';
|
|
13
13
|
import ConfirmDialog from '../../../../components/shared/ConfirmDialog';
|
|
@@ -49,6 +49,13 @@ const DeleteRowButton = (props) => {
|
|
|
49
49
|
});
|
|
50
50
|
const entity = entityService.getEntity();
|
|
51
51
|
const iden = entity.toStr(row);
|
|
52
|
-
|
|
52
|
+
const isIdenInt = Number.isInteger(parseInt(iden, 10));
|
|
53
|
+
const printStrongIden = () => {
|
|
54
|
+
if (!isIdenInt) {
|
|
55
|
+
return _jsx("strong", { children: iden });
|
|
56
|
+
}
|
|
57
|
+
return _jsx(_Fragment, {});
|
|
58
|
+
};
|
|
59
|
+
return (_jsxs(_Fragment, { children: [variant === 'icon' && (_jsx(Tooltip, Object.assign({ title: _('Delete'), placement: 'bottom', enterTouchDelay: 0, arrow: true }, { children: _jsx("span", { children: _jsx(LightButton, Object.assign({ disabled: disabled, onClick: () => !disabled && setShowDelete(true) }, { children: _jsx(StyledDeleteIcon, {}) })) }) }))), variant === 'text' && (_jsx(MoreMenuItem, Object.assign({ className: disabled ? 'disabled' : '', onClick: () => !disabled && setShowDelete(true) }, { children: _('Delete') }))), _jsx(ConfirmDialog, { text: _jsxs("span", { children: [_('You are about to remove'), " ", printStrongIden()] }), open: showDelete, doubleCheck: entity.deleteDoubleCheck || false, doubleCheckExpectedStr: iden, handleClose: handleHideDelete, handleApply: handleDelete })] }));
|
|
53
60
|
};
|
|
54
61
|
export default DeleteRowButton;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { EntityItem } from '../router/routeMapParser';
|
|
2
|
+
import { PropertySpec } from 'services/api';
|
|
2
3
|
declare type GetMarshallerWhiteListPropsType = Pick<EntityItem, 'filterBy' | 'filterValues' | 'fixedValues'>;
|
|
3
4
|
declare const getMarshallerWhiteList: (props: GetMarshallerWhiteListPropsType) => string[];
|
|
4
|
-
|
|
5
|
+
declare const collectReferences: (obj: any, references?: PropertySpec[]) => PropertySpec[];
|
|
6
|
+
declare const findMatchingColumns: (columnNames: string[], inverseRelations: PropertySpec[]) => string[];
|
|
7
|
+
export { getMarshallerWhiteList, collectReferences, findMatchingColumns };
|
|
@@ -16,4 +16,40 @@ const getMarshallerWhiteList = (props) => {
|
|
|
16
16
|
}
|
|
17
17
|
return whitelist;
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
const collectReferences = (obj, references = []) => {
|
|
20
|
+
if (isReferenceObject(obj)) {
|
|
21
|
+
references.push(obj);
|
|
22
|
+
}
|
|
23
|
+
Object.keys(obj).forEach((key) => {
|
|
24
|
+
const value = obj[key];
|
|
25
|
+
if (isObject(value)) {
|
|
26
|
+
collectReferences(value, references);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return references;
|
|
30
|
+
};
|
|
31
|
+
const isObject = (value) => {
|
|
32
|
+
return value && typeof value === 'object';
|
|
33
|
+
};
|
|
34
|
+
const isReferenceObject = (obj) => {
|
|
35
|
+
return isObject(obj) && obj.hasOwnProperty('$ref');
|
|
36
|
+
};
|
|
37
|
+
const findMatchingColumns = (columnNames, inverseRelations) => {
|
|
38
|
+
return columnNames.filter((column) => {
|
|
39
|
+
const singularColumn = getSingularForm(column);
|
|
40
|
+
return inverseRelations.some((relation) => {
|
|
41
|
+
return objectHasMatchingValue(relation, singularColumn);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
const getSingularForm = (word) => {
|
|
46
|
+
return word.endsWith('s')
|
|
47
|
+
? word.slice(0, -1).toLowerCase()
|
|
48
|
+
: word.toLowerCase();
|
|
49
|
+
};
|
|
50
|
+
const objectHasMatchingValue = (obj, target) => {
|
|
51
|
+
return Object.values(obj).some((value) => {
|
|
52
|
+
return typeof value === 'string' && value.toLowerCase().includes(target);
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
export { getMarshallerWhiteList, collectReferences, findMatchingColumns };
|
|
@@ -22,6 +22,11 @@ export default function ConfirmDialog(props) {
|
|
|
22
22
|
const val = event.target.value;
|
|
23
23
|
setInputVal(val || '');
|
|
24
24
|
}, []);
|
|
25
|
+
const handleKeyDown = (event) => {
|
|
26
|
+
if (event.key === 'Tab') {
|
|
27
|
+
event.stopPropagation();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
25
30
|
const sumbitEnabled = !doubleCheck || inputVal == doubleCheckExpectedStr;
|
|
26
|
-
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' }, { 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') }))] })] })));
|
|
31
|
+
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') }))] })] })));
|
|
27
32
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { FormEvent } from 'react';
|
|
2
|
+
interface ConfirmEditDialogProps {
|
|
3
|
+
text: React.ReactNode;
|
|
4
|
+
open: boolean;
|
|
5
|
+
formEvent?: FormEvent<HTMLFormElement>;
|
|
6
|
+
handleClose: () => void;
|
|
7
|
+
handleSave: (e: FormEvent<HTMLFormElement>) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const ConfirmEditionDialog: (props: ConfirmEditDialogProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect, forwardRef, } from 'react';
|
|
3
|
+
import Dialog from '@mui/material/Dialog';
|
|
4
|
+
import DialogTitle from '@mui/material/DialogTitle';
|
|
5
|
+
import DialogContent from '@mui/material/DialogContent';
|
|
6
|
+
import DialogActions from '@mui/material/DialogActions';
|
|
7
|
+
import Button from '@mui/material/Button';
|
|
8
|
+
import LinearProgress from '@mui/material/LinearProgress';
|
|
9
|
+
import { DialogContentText, Slide } from '@mui/material';
|
|
10
|
+
import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
|
|
11
|
+
import _ from '../../services/translations/translate';
|
|
12
|
+
const Transition = forwardRef(function (props, ref) {
|
|
13
|
+
return _jsx(Slide, Object.assign({}, props, { direction: 'up', ref: ref }));
|
|
14
|
+
});
|
|
15
|
+
Transition.displayName = 'ConfirmDialogTransition';
|
|
16
|
+
export const ConfirmEditionDialog = (props) => {
|
|
17
|
+
const { open, handleClose, text, handleSave, formEvent } = props;
|
|
18
|
+
const TOTAL_TIME = 100;
|
|
19
|
+
const [progress, setProgress] = useState(TOTAL_TIME);
|
|
20
|
+
const handleKeyDown = (event) => {
|
|
21
|
+
if (event.key === 'Tab') {
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
let timer = null;
|
|
27
|
+
if (open) {
|
|
28
|
+
timer = setInterval(() => {
|
|
29
|
+
setProgress((oldProgress) => {
|
|
30
|
+
if (oldProgress === 0) {
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
return oldProgress - 5;
|
|
34
|
+
});
|
|
35
|
+
}, 250);
|
|
36
|
+
}
|
|
37
|
+
setProgress(TOTAL_TIME);
|
|
38
|
+
return () => {
|
|
39
|
+
if (timer) {
|
|
40
|
+
clearInterval(timer);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}, [open]);
|
|
44
|
+
return (_jsxs(Dialog, Object.assign({ open: open, TransitionComponent: Transition, keepMounted: true, onClose: handleClose, onKeyDown: handleKeyDown, "aria-labelledby": 'alert-dialog-slide-title', "aria-describedby": 'alert-dialog-slide-description' }, { children: [_jsx(CloseRoundedIcon, { className: 'close-icon', onClick: handleClose }), _jsx("img", { src: 'assets/img/warning-dialog.svg', className: 'modal-icon' }), _jsx(DialogTitle, Object.assign({ id: 'alert-dialog-slide-title' }, { children: _('Save element') })), _jsxs(DialogContent, { children: [_jsx(DialogContentText, Object.assign({ id: 'alert-dialog-slide-description' }, { children: text })), _jsx(LinearProgress, { variant: 'determinate', value: progress })] }), _jsxs(DialogActions, { children: [_jsx(Button, Object.assign({ onClick: () => {
|
|
45
|
+
handleClose();
|
|
46
|
+
} }, { children: "Cancel" })), _jsx(Button, Object.assign({ hidden: progress !== 0, onClick: () => {
|
|
47
|
+
if (formEvent) {
|
|
48
|
+
handleSave(formEvent);
|
|
49
|
+
}
|
|
50
|
+
}, disabled: progress !== 0 }, { children: "Apply" }))] })] })));
|
|
51
|
+
};
|
|
@@ -6,6 +6,7 @@ import ErrorBoundary from '../../../components/ErrorBoundary';
|
|
|
6
6
|
import { getMarshallerWhiteList } from '../../../components/form.helper';
|
|
7
7
|
import SaveButton from '../../../components/shared/Button/SaveButton';
|
|
8
8
|
import ErrorMessage from '../../../components/shared/ErrorMessage';
|
|
9
|
+
import { collectReferences, findMatchingColumns, } from '../../../services';
|
|
9
10
|
import FormFieldFactory from '../../../services/form/FormFieldFactory';
|
|
10
11
|
import _ from '../../../services/translations/translate';
|
|
11
12
|
import { StyledGroupGrid, StyledGroupLegend, } from '../../DefaultEntityBehavior.styles';
|
|
@@ -14,10 +15,16 @@ import filterFieldsetGroups, { isDetailedFormFieldSpec, } from '../FilterFieldse
|
|
|
14
15
|
import FormFieldMemo from './FormField';
|
|
15
16
|
import { useFormHandler } from './useFormHandler';
|
|
16
17
|
import { validationErrosToJsxErrorList } from './validationErrosToJsxErrorList';
|
|
18
|
+
import { ConfirmEditionDialog } from '../../../components/shared/ConfirmEditDialog';
|
|
17
19
|
const Form = (props) => {
|
|
18
20
|
var _a;
|
|
19
|
-
const { entityService, readOnlyProperties, filterBy, fixedValues, filterValues, foreignKeyGetter: foreignKeyGetterLoader, row, match, } = props;
|
|
21
|
+
const { entityService, readOnlyProperties, filterBy, fixedValues, filterValues, foreignKeyGetter: foreignKeyGetterLoader, row, match, edit, } = props;
|
|
20
22
|
const { fkChoices } = props;
|
|
23
|
+
const [showConfirm, setShowConfirm] = useState(false);
|
|
24
|
+
const editDoubleCheck = !edit
|
|
25
|
+
? false
|
|
26
|
+
: props.entityService.getEntity().editDoubleCheck;
|
|
27
|
+
const [formEvent, setFormEvent] = useState(undefined);
|
|
21
28
|
const [foreignKeyGetter, setForeignKeyGetter] = useState();
|
|
22
29
|
useEffect(() => {
|
|
23
30
|
if (fkChoices) {
|
|
@@ -42,6 +49,14 @@ const Form = (props) => {
|
|
|
42
49
|
const allProperties = entityService.getAllProperties();
|
|
43
50
|
const columns = entityService.getProperties();
|
|
44
51
|
const columnNames = Object.keys(columns);
|
|
52
|
+
const inverseRelations = collectReferences(columns);
|
|
53
|
+
const inverseRelationsMatch = findMatchingColumns(columnNames, inverseRelations);
|
|
54
|
+
let totalEntitiesUsed = 0;
|
|
55
|
+
inverseRelationsMatch.forEach((value) => {
|
|
56
|
+
if (Array.isArray(row === null || row === void 0 ? void 0 : row[value])) {
|
|
57
|
+
totalEntitiesUsed = (row === null || row === void 0 ? void 0 : row[value]).length + totalEntitiesUsed;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
45
60
|
let groups = [];
|
|
46
61
|
if (props.groups) {
|
|
47
62
|
groups = filterFieldsetGroups(props.groups);
|
|
@@ -95,38 +110,51 @@ const Form = (props) => {
|
|
|
95
110
|
formik.visibleFields = visibleFields;
|
|
96
111
|
const errorList = validationErrosToJsxErrorList(formik, allProperties);
|
|
97
112
|
const divRef = useRef(null);
|
|
113
|
+
const entity = entityService.getEntity();
|
|
114
|
+
const iden = row ? entity.toStr(row) : '';
|
|
98
115
|
const focusOnDiv = () => {
|
|
99
116
|
const node = divRef.current;
|
|
100
117
|
node === null || node === void 0 ? void 0 : node.focus();
|
|
101
118
|
};
|
|
102
119
|
const formFieldFactory = new FormFieldFactory(entityService, formik, formik.handleChange, formik.handleBlur, divRef);
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
const confirmEditionText = () => {
|
|
121
|
+
if (totalEntitiesUsed) {
|
|
122
|
+
return (_jsxs("span", { children: [_(`You are about to update`), " ", _jsx("strong", { children: iden }), _jsx("br", {}), _(`This change will affect`), " ", _jsx("strong", { children: totalEntitiesUsed }), ' ', _(`entities`)] }));
|
|
123
|
+
}
|
|
124
|
+
return (_jsxs("span", { children: [_(`You are about to update`), " ", _jsx("strong", { children: iden })] }));
|
|
125
|
+
};
|
|
126
|
+
return (_jsxs("div", { children: [_jsxs("form", Object.assign({ onSubmit: (e) => {
|
|
105
127
|
e.preventDefault();
|
|
106
128
|
e.stopPropagation();
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return acc || visualToggles[fldName];
|
|
115
|
-
}, false);
|
|
116
|
-
if (!visible) {
|
|
117
|
-
return null;
|
|
129
|
+
if (formik.isSubmitting) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (editDoubleCheck) {
|
|
133
|
+
setFormEvent(e);
|
|
134
|
+
setShowConfirm(true);
|
|
135
|
+
return;
|
|
118
136
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
137
|
+
formik.handleSubmit(e);
|
|
138
|
+
}, style: { display: 'flex', flexDirection: 'column', gap: '40px' } }, { children: [groups.map((group, idx) => {
|
|
139
|
+
const fields = group.fields;
|
|
140
|
+
const visible = fields.reduce((acc, fld) => {
|
|
141
|
+
const fldName = typeof fld === 'string' ? fld : fld.name;
|
|
142
|
+
return acc || visualToggles[fldName];
|
|
143
|
+
}, false);
|
|
144
|
+
if (!visible) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
const visibilityStyles = visible
|
|
148
|
+
? { display: 'block' }
|
|
149
|
+
: { display: 'none' };
|
|
150
|
+
focusOnDiv();
|
|
151
|
+
return (_jsxs("div", Object.assign({ ref: divRef, style: Object.assign(Object.assign({}, visibilityStyles), { position: 'relative' }) }, { children: [_jsx(StyledGroupLegend, { children: group.legend }), _jsx(StyledGroupGrid, { children: fields.map((column, idx) => {
|
|
152
|
+
const fldName = typeof column === 'string' ? column : column.name;
|
|
153
|
+
if (fldName === filterBy) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
return (_jsx(ErrorBoundary, Object.assign({ minimalist: true }, { children: _jsx(FormFieldMemo, { column: column, fkChoices: fkChoices || autoloadedFkChoices, visualToggles: visualToggles, readOnlyProperties: readOnlyProperties, formFieldFactory: formFieldFactory }) }), idx));
|
|
157
|
+
}) })] }), idx));
|
|
158
|
+
}), Object.keys(errorList).length > 0 && (_jsxs(_Fragment, { children: [_jsx("br", {}), _jsxs(Alert, Object.assign({ severity: 'error' }, { children: [_jsx(AlertTitle, { children: _('Validation error') }), _jsx("ul", { children: Object.values(errorList).map((error) => error) })] })), _jsx("br", {})] })), _jsx(SaveButton, {}), reqError && _jsx(ErrorMessage, { message: reqError })] })), _jsx(ConfirmEditionDialog, { text: confirmEditionText(), open: showConfirm, handleClose: () => setShowConfirm(false), formEvent: formEvent, handleSave: (e) => formik.handleSubmit(e) })] }));
|
|
131
159
|
};
|
|
132
160
|
export { Form };
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const collectReferences = (obj, references = []) => {
|
|
2
|
+
if (isReferenceObject(obj)) {
|
|
3
|
+
references.push(obj);
|
|
4
|
+
}
|
|
5
|
+
Object.keys(obj).forEach((key) => {
|
|
6
|
+
const value = obj[key];
|
|
7
|
+
if (isObject(value)) {
|
|
8
|
+
collectReferences(value, references);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return references;
|
|
12
|
+
};
|
|
13
|
+
function isObject(value) {
|
|
14
|
+
return value && typeof value === 'object';
|
|
15
|
+
}
|
|
16
|
+
function isReferenceObject(obj) {
|
|
17
|
+
return isObject(obj) && obj.hasOwnProperty('$ref');
|
|
18
|
+
}
|
|
19
|
+
export const findMatchingColumns = (columnNames, inverseRelations) => {
|
|
20
|
+
return columnNames.filter((column) => {
|
|
21
|
+
const singularColumn = getSingularForm(column);
|
|
22
|
+
return inverseRelations.some((relation) => {
|
|
23
|
+
return objectHasMatchingValue(relation, singularColumn);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
function getSingularForm(word) {
|
|
28
|
+
return word.endsWith('s')
|
|
29
|
+
? word.slice(0, -1).toLowerCase()
|
|
30
|
+
: word.toLowerCase();
|
|
31
|
+
}
|
|
32
|
+
// Helper function to check if an object contains a value that includes a target string (case-insensitive)
|
|
33
|
+
function objectHasMatchingValue(obj, target) {
|
|
34
|
+
return Object.values(obj).some((value) => {
|
|
35
|
+
return typeof value === 'string' && value.toLowerCase().includes(target);
|
|
36
|
+
});
|
|
37
|
+
}
|
package/services/form/index.d.ts
CHANGED
package/services/form/index.js
CHANGED
package/translations/ca.json
CHANGED
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"Please type the item name, as shown in bold font above, to continue": "Escriba el nombre del elemento, tal y como se muestra arriba en negrita, para continuar",
|
|
31
31
|
"Remove element": "Eliminar elemento",
|
|
32
32
|
"Save": "Guardar",
|
|
33
|
+
"Save element": "Desa element",
|
|
33
34
|
"Select Fields": "Seleccionar campos",
|
|
34
35
|
"Select all": "Seleccionar todo",
|
|
35
36
|
"Sign In": "Entrar",
|
|
36
37
|
"Starts with": "empieza por",
|
|
38
|
+
"This change will affect": "Aquest canvi afectarà",
|
|
37
39
|
"True": "Verdadero",
|
|
38
40
|
"Upload image": "Subir imagen",
|
|
39
41
|
"Username": "Usuari",
|
|
@@ -42,7 +44,9 @@
|
|
|
42
44
|
"Welcome back!": "Bienvenido de nuevo!",
|
|
43
45
|
"Yes, delete it": "Si, eliminar",
|
|
44
46
|
"You are about to remove": "Esteu a punt d'eliminar-lo",
|
|
47
|
+
"You are about to update": "Estàs a punt d'actualitzar",
|
|
45
48
|
"You haven’t created any {{entity}} yet.": "Aún no has creado ningún {{entity}}",
|
|
49
|
+
"entities": "entitats",
|
|
46
50
|
"invalid pattern": "Patrón invalido",
|
|
47
51
|
"required value": "valor requerido",
|
|
48
52
|
"settings": "Configuracions",
|
package/translations/en.json
CHANGED
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"Please type the item name, as shown in bold font above, to continue": "Please type the item name, as shown in bold font above, to continue",
|
|
31
31
|
"Remove element": "Remove element",
|
|
32
32
|
"Save": "Save",
|
|
33
|
+
"Save element": "Save element",
|
|
33
34
|
"Select Fields": "Select Fields",
|
|
34
35
|
"Select all": "Select all",
|
|
35
36
|
"Sign In": "Sign In",
|
|
36
37
|
"Starts with": "Starts with",
|
|
38
|
+
"This change will affect": "This change will affect",
|
|
37
39
|
"True": "True",
|
|
38
40
|
"Upload image": "Upload image",
|
|
39
41
|
"Username": "Username",
|
|
@@ -42,7 +44,9 @@
|
|
|
42
44
|
"Welcome back!": "Welcome back!",
|
|
43
45
|
"Yes, delete it": "Yes, delete it",
|
|
44
46
|
"You are about to remove": "You are about to remove",
|
|
47
|
+
"You are about to update": "You are about to update",
|
|
45
48
|
"You haven’t created any {{entity}} yet.": "You haven’t created any {{entity}} yet.",
|
|
49
|
+
"entities": "entities",
|
|
46
50
|
"invalid pattern": "invalid pattern",
|
|
47
51
|
"required value": "required value",
|
|
48
52
|
"settings": "Settings",
|
package/translations/es.json
CHANGED
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"Please type the item name, as shown in bold font above, to continue": "Escriba el nombre del elemento, tal y como se muestra arriba en negrita, para continuar",
|
|
31
31
|
"Remove element": "Eliminar elemento",
|
|
32
32
|
"Save": "Guardar",
|
|
33
|
+
"Save element": "Guardar elemento",
|
|
33
34
|
"Select Fields": "Seleccionar campos",
|
|
34
35
|
"Select all": "Seleccionar todo",
|
|
35
36
|
"Sign In": "Entrar",
|
|
36
37
|
"Starts with": "empieza por",
|
|
38
|
+
"This change will affect": "Este cambio afectará",
|
|
37
39
|
"True": "Verdadero",
|
|
38
40
|
"Upload image": "Subir imagen",
|
|
39
41
|
"Username": "Usuario",
|
|
@@ -42,7 +44,9 @@
|
|
|
42
44
|
"Welcome back!": "Bienvenido de nuevo!",
|
|
43
45
|
"Yes, delete it": "Si, eliminar",
|
|
44
46
|
"You are about to remove": "Estás a punto de eliminar",
|
|
47
|
+
"You are about to update": "Estás a punto de actualizar",
|
|
45
48
|
"You haven’t created any {{entity}} yet.": "Aún no has creado ningún {{entity}}",
|
|
49
|
+
"entities": "entidades",
|
|
46
50
|
"invalid pattern": "Patrón invalido",
|
|
47
51
|
"required value": "valor requerido",
|
|
48
52
|
"settings": "Configuración",
|
package/translations/it.json
CHANGED
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"Please type the item name, as shown in bold font above, to continue": "Please type the item name, as shown in bold font above, to continue",
|
|
31
31
|
"Remove element": "Remove element",
|
|
32
32
|
"Save": "Save",
|
|
33
|
+
"Save element": "Salva elemento",
|
|
33
34
|
"Select Fields": "Select Fields",
|
|
34
35
|
"Select all": "Select all",
|
|
35
36
|
"Sign In": "Sign In",
|
|
36
37
|
"Starts with": "Starts with",
|
|
38
|
+
"This change will affect": "Questa modifica influirà",
|
|
37
39
|
"True": "True",
|
|
38
40
|
"Upload image": "Upload image",
|
|
39
41
|
"Username": "Username",
|
|
@@ -42,7 +44,9 @@
|
|
|
42
44
|
"Welcome back!": "Welcome back!",
|
|
43
45
|
"Yes, delete it": "Yes, delete it",
|
|
44
46
|
"You are about to remove": "Stai per rimuovere",
|
|
47
|
+
"You are about to update": "Stai per aggiornare ",
|
|
45
48
|
"You haven’t created any {{entity}} yet.": "You haven’t created any {{entity}} yet.",
|
|
49
|
+
"entities": "entità",
|
|
46
50
|
"invalid pattern": "invalid pattern",
|
|
47
51
|
"required value": "required value",
|
|
48
52
|
"settings": "Impostazioni",
|