@irontec/ivoz-ui 1.7.12 → 1.7.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.
- package/components/Dashboard/Dashboard.js +5 -5
- package/components/shared/ConfirmDialog.d.ts +2 -2
- package/components/shared/ConfirmDialog.js +20 -19
- package/components/shared/ConfirmDialog.styles.d.ts +2 -2
- package/components/shared/ConfirmEditDialog.js +27 -25
- package/components/shared/Modal/Modal.d.ts +22 -0
- package/components/shared/Modal/Modal.js +22 -0
- package/components/shared/Modal/Modal.styles.d.ts +32 -0
- package/components/shared/Modal/Modal.styles.js +17 -0
- package/entities/DefaultEntityBehavior/AutoSelectOptions.d.ts +6 -0
- package/entities/DefaultEntityBehavior/AutoSelectOptions.js +51 -0
- package/entities/DefaultEntityBehavior/DynamicAutocompleteGetter.d.ts +3 -0
- package/entities/DefaultEntityBehavior/DynamicAutocompleteGetter.js +19 -0
- package/entities/DefaultEntityBehavior.d.ts +4 -3
- package/entities/DefaultEntityBehavior.js +6 -2
- package/entities/EntityInterface.d.ts +11 -0
- package/helpers/fetchFilteredPage.d.ts +9 -0
- package/helpers/fetchFilteredPage.js +31 -0
- package/helpers/index.d.ts +2 -0
- package/helpers/index.js +2 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/services/entity/EntityService.d.ts +2 -1
- package/services/entity/EntityService.js +3 -0
- package/services/form/Field/DynamicAutocomplete/DynamicAutocomplete.d.ts +27 -0
- package/services/form/Field/DynamicAutocomplete/DynamicAutocomplete.js +217 -0
- package/services/form/Field/DynamicAutocomplete/DynamicAutocomplete.styles.d.ts +1 -0
- package/services/form/Field/DynamicAutocomplete/DynamicAutocomplete.styles.js +6 -0
- package/services/form/Field/DynamicAutocomplete/index.d.ts +2 -0
- package/services/form/Field/DynamicAutocomplete/index.js +2 -0
- package/services/form/Field/index.d.ts +1 -0
- package/services/form/Field/index.js +1 -0
- package/services/form/FormFieldFactory/Factory/DynamicAutocompleteFactory.d.ts +22 -0
- package/services/form/FormFieldFactory/Factory/DynamicAutocompleteFactory.js +43 -0
- package/services/form/FormFieldFactory/Factory/index.d.ts +2 -1
- package/services/form/FormFieldFactory/Factory/index.js +2 -1
- package/services/form/FormFieldFactory/FormFieldFactory.d.ts +2 -0
- package/services/form/FormFieldFactory/FormFieldFactory.js +29 -1
- package/translations/ca.json +2 -0
- package/translations/en.json +3 -1
- package/translations/es.json +3 -1
- package/translations/it.json +2 -0
|
@@ -10,12 +10,12 @@ const Dashboard = (props) => {
|
|
|
10
10
|
return { name, platform, dLicences, mLicenses };
|
|
11
11
|
}
|
|
12
12
|
const rows = [
|
|
13
|
-
createData('
|
|
14
|
-
createData('
|
|
15
|
-
createData('
|
|
16
|
-
createData('
|
|
13
|
+
createData('Client 1', 'Platform A', 5, 3),
|
|
14
|
+
createData('Client 2', 'Platform B', 8, 2),
|
|
15
|
+
createData('Client 3', 'Platform C', 4, 6),
|
|
16
|
+
createData('Client 4', 'Platform D', 7, 1),
|
|
17
17
|
];
|
|
18
|
-
return (_jsxs("section", Object.assign({ className: className }, { children: [_jsx("div", Object.assign({ className: 'card welcome' }, { children: _jsxs("div", Object.assign({ className: 'card-container' }, { children: [_jsxs("div", { children: [_jsxs("h3", { children: ["Welcome to ", _jsx("br", {}), "
|
|
18
|
+
return (_jsxs("section", Object.assign({ className: className }, { children: [_jsx("div", Object.assign({ className: 'card welcome' }, { children: _jsxs("div", Object.assign({ className: 'card-container' }, { children: [_jsxs("div", { children: [_jsxs("h3", { children: ["Welcome to ", _jsx("br", {}), " Demo System"] }), _jsx("p", { children: "This is a demo. Add platforms, manage clients, assign licenses and more." }), _jsx(LightButton, { children: "Get started" })] }), _jsx("img", { src: 'assets/img/dashboard-welcome.svg' })] })) })), _jsxs("div", Object.assign({ className: 'card activity' }, { children: [_jsx("div", Object.assign({ className: 'title' }, { children: "Recent activity" })), _jsxs("div", Object.assign({ className: 'content' }, { children: [_jsxs("div", Object.assign({ className: 'row' }, { children: [_jsx("div", Object.assign({ className: 'time' }, { children: "5m" })), _jsx("div", Object.assign({ className: 'value' }, { children: "Login (User1)" }))] })), _jsxs("div", Object.assign({ className: 'row' }, { children: [_jsx("div", Object.assign({ className: 'time' }, { children: "30m" })), _jsx("div", Object.assign({ className: 'value' }, { children: "New admin added (User2)" }))] })), _jsxs("div", Object.assign({ className: 'row' }, { children: [_jsx("div", Object.assign({ className: 'time' }, { children: "6h" })), _jsx("div", Object.assign({ className: 'value' }, { children: "Login (User2)" }))] })), _jsxs("div", Object.assign({ className: 'row' }, { children: [_jsx("div", Object.assign({ className: 'time' }, { children: "1d" })), _jsx("div", Object.assign({ className: 'value' }, { children: "10 licenses assigned (User3)" }))] })), _jsxs("div", Object.assign({ className: 'row' }, { children: [_jsx("div", Object.assign({ className: 'time' }, { children: "1d" })), _jsx("div", Object.assign({ className: 'value' }, { children: "New client added (User3)" }))] }))] }))] })), _jsxs("div", Object.assign({ className: 'card amount' }, { children: [_jsx("div", Object.assign({ className: 'img-container' }, { children: _jsx(IconPlatformsDashboard, {}) })), _jsx("div", Object.assign({ className: 'number' }, { children: "4" })), _jsx("div", Object.assign({ className: 'name' }, { children: "Platforms" })), _jsxs("div", Object.assign({ className: 'progress' }, { children: [_jsx("span", { children: "+ 0" }), _jsx("img", { src: 'assets/img/same.svg' })] })), _jsx("a", Object.assign({ href: '', className: 'link' }, { children: "View platforms" }))] })), _jsxs("div", Object.assign({ className: 'card amount' }, { children: [_jsx("div", Object.assign({ className: 'img-container' }, { children: _jsx(IconClientsDashboard, {}) })), _jsx("div", Object.assign({ className: 'number' }, { children: "20" })), _jsx("div", Object.assign({ className: 'name' }, { children: "Clients" })), _jsxs("div", Object.assign({ className: 'progress' }, { children: [_jsx("span", { children: "+ 1" }), _jsx("img", { src: 'assets/img/up.svg' })] })), _jsx("a", Object.assign({ href: '', className: 'link' }, { children: "View clients" }))] })), _jsxs("div", Object.assign({ className: 'card amount' }, { children: [_jsx("div", Object.assign({ className: 'img-container' }, { children: _jsx(IconUsersDashboard, {}) })), _jsx("div", Object.assign({ className: 'number' }, { children: "100" })), _jsx("div", Object.assign({ className: 'name' }, { children: "Users" })), _jsxs("div", Object.assign({ className: 'progress' }, { children: [_jsx("span", { children: "- 2" }), _jsx("img", { src: 'assets/img/down.svg' })] })), _jsx("a", Object.assign({ href: '', className: 'link' }, { children: "View users" }))] })), _jsxs("div", Object.assign({ className: 'card licenses' }, { children: [_jsx("div", Object.assign({ className: 'title' }, { children: "Licenses" })), _jsxs("div", Object.assign({ className: 'radial' }, { children: [_jsx("div", { className: 'circle' }), _jsxs("div", Object.assign({ className: 'data' }, { children: [_jsx("div", Object.assign({ className: 'total' }, { children: "Total" })), _jsx("div", Object.assign({ className: 'number' }, { children: "120" }))] }))] })), _jsxs("div", Object.assign({ className: 'legend' }, { children: [_jsxs("div", Object.assign({ className: 'label' }, { children: [_jsx("div", { className: 'color orange' }), _jsx("div", Object.assign({ className: 'text' }, { children: "Desktop" }))] })), _jsxs("div", Object.assign({ className: 'label' }, { children: [_jsx("div", { className: 'color red' }), _jsx("div", Object.assign({ className: 'text' }, { children: "Mobile" }))] }))] }))] })), _jsxs("div", Object.assign({ className: 'card last' }, { children: [_jsxs("div", Object.assign({ className: 'header' }, { children: [_jsx("div", Object.assign({ className: 'title' }, { children: "Last added clients" })), _jsx(SolidButton, { children: "+ Add" })] })), _jsx("div", Object.assign({ className: 'table' }, { children: _jsx(TableContainer, Object.assign({ component: Paper, sx: { boxShadow: 'none' } }, { children: _jsxs(Table, Object.assign({ sx: { minWidth: 650 }, "aria-label": 'simple table' }, { children: [_jsx(TableHead, { children: _jsxs(TableRow, Object.assign({ style: { fontSize: '13px' } }, { children: [_jsx(TableCell, Object.assign({ style: { fontSize: '13px', color: 'var(--color-text)' } }, { children: "Name" })), _jsx(TableCell, Object.assign({ style: { fontSize: '13px', color: 'var(--color-text)' } }, { children: "Platform" })), _jsx(TableCell, Object.assign({ style: { fontSize: '13px', color: 'var(--color-text)' } }, { children: "Desktop licenses" })), _jsx(TableCell, Object.assign({ style: { fontSize: '13px', color: 'var(--color-text)' } }, { children: "Mobile licenses" }))] })) }), _jsx(TableBody, { children: rows.map((row) => (_jsxs(TableRow, Object.assign({ sx: { '&:last-child td, &:last-child th': { border: 0 } } }, { children: [_jsx(TableCell, Object.assign({ component: 'th', scope: 'row' }, { children: row.name })), _jsx(TableCell, { children: row.platform }), _jsx(TableCell, { children: row.dLicences }), _jsx(TableCell, { children: row.mLicenses })] }), row.name))) })] })) })) }))] }))] })));
|
|
19
19
|
};
|
|
20
20
|
export default styled(Dashboard)(({ theme }) => {
|
|
21
21
|
return {
|
|
@@ -4,8 +4,8 @@ interface ConfirmDialogProps {
|
|
|
4
4
|
open: boolean;
|
|
5
5
|
doubleCheck?: boolean;
|
|
6
6
|
doubleCheckExpectedStr?: string;
|
|
7
|
-
handleClose: (
|
|
8
|
-
handleApply: (event:
|
|
7
|
+
handleClose: () => void;
|
|
8
|
+
handleApply: (event: React.MouseEvent) => void;
|
|
9
9
|
}
|
|
10
10
|
export default function ConfirmDialog(props: ConfirmDialogProps): JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import Dialog from '@mui/material/Dialog';
|
|
4
|
-
import DialogActions from '@mui/material/DialogActions';
|
|
5
|
-
import DialogContent from '@mui/material/DialogContent';
|
|
6
|
-
import DialogContentText from '@mui/material/DialogContentText';
|
|
7
|
-
import DialogTitle from '@mui/material/DialogTitle';
|
|
8
|
-
import Slide from '@mui/material/Slide';
|
|
9
|
-
import { forwardRef, useCallback, useState, } from 'react';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from 'react';
|
|
10
3
|
import { StyledSearchTextField } from '../../services/form/Field/TextField/TextField.styles';
|
|
11
4
|
import _ from '../../services/translations/translate';
|
|
12
|
-
import { OutlinedButton, SolidButton } from './Button/Button.styles';
|
|
13
5
|
import { StyledDialogContentText } from './ConfirmDialog.styles';
|
|
14
|
-
|
|
15
|
-
return _jsx(Slide, Object.assign({}, props, { direction: 'up', ref: ref }));
|
|
16
|
-
});
|
|
17
|
-
Transition.displayName = 'ConfirmDialogTransition';
|
|
6
|
+
import Modal from './Modal/Modal';
|
|
18
7
|
export default function ConfirmDialog(props) {
|
|
19
8
|
const { text, open, doubleCheck, doubleCheckExpectedStr, handleClose, handleApply, } = props;
|
|
20
9
|
const [inputVal, setInputVal] = useState('');
|
|
@@ -22,9 +11,21 @@ export default function ConfirmDialog(props) {
|
|
|
22
11
|
const val = event.target.value;
|
|
23
12
|
setInputVal(val || '');
|
|
24
13
|
}, []);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
const submitEnabled = !doubleCheck || inputVal == doubleCheckExpectedStr;
|
|
15
|
+
const customButtons = [
|
|
16
|
+
{
|
|
17
|
+
label: _('No, keep it'),
|
|
18
|
+
onClick: () => handleClose(),
|
|
19
|
+
variant: 'outlined',
|
|
20
|
+
autoFocus: false,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: _('Yes, delete it'),
|
|
24
|
+
onClick: (event) => handleApply(event),
|
|
25
|
+
variant: 'solid',
|
|
26
|
+
autoFocus: true,
|
|
27
|
+
disabled: !submitEnabled,
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
return (_jsx(Modal, Object.assign({ title: _('Remove element'), description: text, open: open, onClose: handleClose, buttons: customButtons, icon: 'assets/img/delete-dialog.svg', keepMounted: true }, { children: doubleCheck && (_jsxs(_Fragment, { children: [_jsx(StyledDialogContentText, Object.assign({ id: 'alert-dialog-double-check-description' }, { children: _('Please type the item name, as shown in bold font above, to continue') })), _jsx(StyledSearchTextField, { type: 'text', hasChanged: false, defaultValue: inputVal, onChange: onChangeHandler })] })) })));
|
|
30
31
|
}
|
|
@@ -10,8 +10,8 @@ export declare const StyledDialogContentText: import("@emotion/styled").StyledCo
|
|
|
10
10
|
noWrap?: boolean | undefined;
|
|
11
11
|
paragraph?: boolean | undefined;
|
|
12
12
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
13
|
-
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "
|
|
14
|
-
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "
|
|
13
|
+
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2" | undefined;
|
|
14
|
+
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "overline" | "subtitle1" | "subtitle2" | "body1" | "body2", string>> | undefined;
|
|
15
15
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
|
|
16
16
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
17
17
|
}, "children" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "variant" | "align" | ("color" | "p" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "noWrap" | "gutterBottom" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { useState, useEffect
|
|
3
|
-
import
|
|
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';
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
import { Box } from '@mui/material';
|
|
8
4
|
import LinearProgress from '@mui/material/LinearProgress';
|
|
9
|
-
import { DialogContentText, Slide } from '@mui/material';
|
|
10
|
-
import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
|
|
11
5
|
import _ from '../../services/translations/translate';
|
|
12
|
-
|
|
13
|
-
return _jsx(Slide, Object.assign({}, props, { direction: 'up', ref: ref }));
|
|
14
|
-
});
|
|
15
|
-
Transition.displayName = 'ConfirmDialogTransition';
|
|
6
|
+
import Modal from './Modal/Modal';
|
|
16
7
|
export const ConfirmEditionDialog = (props) => {
|
|
17
8
|
const { open, handleClose, text, handleSave, formEvent } = props;
|
|
18
9
|
const TOTAL_TIME = 100;
|
|
19
10
|
const [progress, setProgress] = useState(TOTAL_TIME);
|
|
20
|
-
const handleKeyDown = (event) => {
|
|
21
|
-
if (event.key === 'Tab') {
|
|
22
|
-
event.stopPropagation();
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
11
|
useEffect(() => {
|
|
26
12
|
let timer = null;
|
|
27
13
|
if (open) {
|
|
@@ -41,11 +27,27 @@ export const ConfirmEditionDialog = (props) => {
|
|
|
41
27
|
}
|
|
42
28
|
};
|
|
43
29
|
}, [open]);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
const customButtons = [
|
|
31
|
+
{
|
|
32
|
+
label: _('Cancel'),
|
|
33
|
+
onClick: () => handleClose(),
|
|
34
|
+
variant: 'outlined',
|
|
35
|
+
autoFocus: false,
|
|
36
|
+
},
|
|
37
|
+
...(progress === 0
|
|
38
|
+
? [
|
|
39
|
+
{
|
|
40
|
+
label: _('Apply'),
|
|
41
|
+
onClick: () => {
|
|
42
|
+
if (formEvent) {
|
|
43
|
+
handleSave(formEvent);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
variant: 'solid',
|
|
47
|
+
autoFocus: true,
|
|
48
|
+
},
|
|
49
|
+
]
|
|
50
|
+
: []),
|
|
51
|
+
];
|
|
52
|
+
return (_jsx(Modal, Object.assign({ title: _('Save element'), description: text, open: open, onClose: handleClose, buttons: customButtons, keepMounted: true }, { children: _jsx(Box, Object.assign({ sx: { width: '100%', mt: 2 } }, { children: _jsx(LinearProgress, { variant: 'determinate', value: progress }) })) })));
|
|
51
53
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
interface Button {
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
onClick: (event: React.MouseEvent) => void;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
variant?: 'outlined' | 'solid';
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface ModalContentProps {
|
|
11
|
+
title: React.ReactNode;
|
|
12
|
+
description?: React.ReactNode;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
sx?: SxProps<Theme>;
|
|
15
|
+
open: boolean;
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
buttons?: Button[];
|
|
18
|
+
icon?: string;
|
|
19
|
+
keepMounted?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export default function Modal(props: ModalContentProps): JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StyledDialogContentBody, StyledDialogContent, StyledDialogActions, } from './Modal.styles';
|
|
3
|
+
import { OutlinedButton, SolidButton } from '../Button/Button.styles';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import Slide from '@mui/material/Slide';
|
|
6
|
+
import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
|
|
7
|
+
import { Box, Dialog, DialogContentText, DialogTitle, IconButton, } from '@mui/material';
|
|
8
|
+
const Transition = forwardRef(function Transition(props, ref) {
|
|
9
|
+
return _jsx(Slide, Object.assign({}, props, { direction: 'up', ref: ref }));
|
|
10
|
+
});
|
|
11
|
+
export default function Modal(props) {
|
|
12
|
+
const { title, description, children, sx, open, onClose, buttons, icon, keepMounted = false, } = props;
|
|
13
|
+
const handleKeyDown = (event) => {
|
|
14
|
+
event.stopPropagation();
|
|
15
|
+
};
|
|
16
|
+
const renderButton = (button, index) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const ButtonTypeComponent = button.variant === 'outlined' ? OutlinedButton : SolidButton;
|
|
19
|
+
return (_jsx(ButtonTypeComponent, Object.assign({ onClick: button.onClick, autoFocus: button.autoFocus, disabled: (_a = button.disabled) !== null && _a !== void 0 ? _a : false, sx: { flex: 1 } }, { children: button.label }), index));
|
|
20
|
+
};
|
|
21
|
+
return (_jsxs(Dialog, Object.assign({ open: open, onClose: onClose, TransitionComponent: Transition, "aria-labelledby": 'alert-dialog-slide-title', "aria-describedby": 'alert-dialog-slide-description', onKeyDown: handleKeyDown, keepMounted: keepMounted }, { children: [_jsx(Box, Object.assign({ sx: { position: 'absolute', right: 8, top: 8 } }, { children: _jsx(IconButton, Object.assign({ onClick: onClose }, { children: _jsx(CloseRoundedIcon, {}) })) })), icon && _jsx("img", { src: icon, className: 'modal-icon', alt: 'dialog icon' }), _jsx(DialogTitle, Object.assign({ id: 'alert-dialog-slide-title' }, { children: title })), _jsxs(StyledDialogContent, { children: [description && (_jsx(DialogContentText, Object.assign({ id: 'alert-dialog-slide-description' }, { children: description }))), _jsx(StyledDialogContentBody, Object.assign({ sx: sx }, { children: children }))] }), buttons && (_jsx(StyledDialogActions, Object.assign({ style: { padding: 0 } }, { children: buttons === null || buttons === void 0 ? void 0 : buttons.map(renderButton) })))] })));
|
|
22
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
declare type StyledDialogContentBodyProps = {
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
5
|
+
};
|
|
6
|
+
export declare const StyledDialogContentBody: import("@mui/styles").StyledComponent<Omit<import("@mui/system").SystemProps<Theme> & {
|
|
7
|
+
children?: import("react").ReactNode;
|
|
8
|
+
component?: import("react").ElementType<any> | undefined;
|
|
9
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
10
|
+
sx?: SxProps<Theme> | undefined;
|
|
11
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement> | "key"> & {
|
|
12
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
13
|
+
}, "children" | "ref" | "sx" | "component" | ("color" | "p" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint")>, "classes" | "className"> & import("@mui/styles").StyledComponentProps<"root"> & Omit<Pick<import("@mui/system").SystemProps<Theme> & {
|
|
14
|
+
children?: import("react").ReactNode;
|
|
15
|
+
component?: import("react").ElementType<any> | undefined;
|
|
16
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
17
|
+
sx?: SxProps<Theme> | undefined;
|
|
18
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement> | "key"> & {
|
|
19
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
20
|
+
}, "children" | "ref" | "sx" | "component" | ("color" | "p" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint")>, "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "component" | ("color" | "p" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxShadow" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "zIndex" | "border" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint")>, "className" | "theme"> & {
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
theme?: StyledDialogContentBodyProps | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const StyledDialogContent: import("@mui/styles").StyledComponent<Omit<import("@mui/material").DialogContentProps, "classes" | "className"> & import("@mui/styles").StyledComponentProps<"root"> & Omit<Pick<import("@mui/material").DialogContentProps, "classes" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "dividers">, "className" | "theme"> & {
|
|
25
|
+
className?: string | undefined;
|
|
26
|
+
theme?: import("@mui/styles").DefaultTheme | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const StyledDialogActions: import("@mui/styles").StyledComponent<Omit<import("@mui/material").DialogActionsProps, "classes" | "className"> & import("@mui/styles").StyledComponentProps<"root"> & Omit<Pick<import("@mui/material").DialogActionsProps, "classes" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "disableSpacing">, "className" | "theme"> & {
|
|
29
|
+
className?: string | undefined;
|
|
30
|
+
theme?: import("@mui/styles").DefaultTheme | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Box, DialogContent, DialogActions, } from '@mui/material';
|
|
2
|
+
import { styled } from '@mui/styles';
|
|
3
|
+
export const StyledDialogContentBody = styled(Box)(({ sx }) => {
|
|
4
|
+
const resolvedStyles = Object.assign({ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: 'var(--spacing-md)' }, sx);
|
|
5
|
+
return resolvedStyles;
|
|
6
|
+
});
|
|
7
|
+
export const StyledDialogContent = styled(DialogContent)(() => {
|
|
8
|
+
return {
|
|
9
|
+
minWidth: '350px',
|
|
10
|
+
};
|
|
11
|
+
});
|
|
12
|
+
export const StyledDialogActions = styled(DialogActions)(() => {
|
|
13
|
+
return {
|
|
14
|
+
padding: 0,
|
|
15
|
+
marginTop: '10px',
|
|
16
|
+
};
|
|
17
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import EntityService from '../../services/entity/EntityService';
|
|
2
2
|
import { CancelToken } from 'axios';
|
|
3
3
|
import { EntityList } from 'router/parseRoutes';
|
|
4
|
+
import { SelectOptionsType } from 'entities/EntityInterface';
|
|
4
5
|
declare type AutoSelectOptionsArgs = {
|
|
5
6
|
cancelToken?: CancelToken;
|
|
6
7
|
entities?: EntityList;
|
|
@@ -9,4 +10,9 @@ declare type AutoSelectOptionsArgs = {
|
|
|
9
10
|
response: Record<string, Array<unknown>> | any;
|
|
10
11
|
};
|
|
11
12
|
export declare const autoSelectOptions: (props: AutoSelectOptionsArgs) => Array<Promise<unknown>>;
|
|
13
|
+
declare type AutoSelectOptionHandlersArgs = {
|
|
14
|
+
entityService: EntityService;
|
|
15
|
+
skip?: string[];
|
|
16
|
+
};
|
|
17
|
+
export declare const autoSelectOptionHandlers: (props: AutoSelectOptionHandlersArgs) => Promise<Record<string, SelectOptionsType>>;
|
|
12
18
|
export default autoSelectOptions;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import { StoreContainer } from '../../store';
|
|
2
11
|
export const autoSelectOptions = (props) => {
|
|
3
12
|
const { cancelToken, response, entityService } = props;
|
|
@@ -51,4 +60,46 @@ export const autoSelectOptions = (props) => {
|
|
|
51
60
|
}
|
|
52
61
|
return promises;
|
|
53
62
|
};
|
|
63
|
+
export const autoSelectOptionHandlers = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
const { entityService } = props;
|
|
65
|
+
const entities = StoreContainer.store.getState().entities.entities;
|
|
66
|
+
const handlers = {};
|
|
67
|
+
if (!entities) {
|
|
68
|
+
return handlers;
|
|
69
|
+
}
|
|
70
|
+
const skip = props.skip || [];
|
|
71
|
+
const fkProperties = entityService === null || entityService === void 0 ? void 0 : entityService.getFkProperties();
|
|
72
|
+
const promises = [];
|
|
73
|
+
for (const idx in fkProperties) {
|
|
74
|
+
if (skip.includes(idx)) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const cleanRef = fkProperties[idx].$ref.replace('#/definitions/', '');
|
|
78
|
+
const entity = entities[cleanRef];
|
|
79
|
+
if (!entity) {
|
|
80
|
+
if (cleanRef && cleanRef.indexOf('_') < 0) {
|
|
81
|
+
console.log('autoSelectOptionsHandlers', `${cleanRef} not found`);
|
|
82
|
+
}
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (!entity.selectOptions) {
|
|
86
|
+
if (cleanRef && cleanRef.indexOf('_') < 0) {
|
|
87
|
+
console.log('autoSelectOptionsHandlers', `${cleanRef} selectOption is not defined`);
|
|
88
|
+
}
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
if (!entity.dynamicSelectOptions) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const selectOptionsLoader = entity.selectOptions;
|
|
95
|
+
if (!selectOptionsLoader) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
promises.push(selectOptionsLoader().then((handler) => {
|
|
99
|
+
handlers[cleanRef] = handler;
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
yield Promise.all(promises);
|
|
103
|
+
return handlers;
|
|
104
|
+
});
|
|
54
105
|
export default autoSelectOptions;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { autoSelectOptionHandlers } from './AutoSelectOptions';
|
|
11
|
+
const dynamicAutocompleteGetters = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
+
const { entityService } = props;
|
|
13
|
+
const getters = yield autoSelectOptionHandlers({
|
|
14
|
+
entityService,
|
|
15
|
+
skip: [],
|
|
16
|
+
});
|
|
17
|
+
return getters;
|
|
18
|
+
});
|
|
19
|
+
export default dynamicAutocompleteGetters;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CancelToken } from 'axios';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { EntityValues } from '../services/entity/EntityService';
|
|
4
|
-
import { ChildDecoratorProps, ChildDecoratorType, EntityAclType, FetchFksCallback, OrderDirection, calculateAclType } from './EntityInterface';
|
|
4
|
+
import { ChildDecoratorProps, ChildDecoratorType, DynamicAutocompleteGetterTypeArgs, EntityAclType, FetchFksCallback, OrderDirection, calculateAclType } from './EntityInterface';
|
|
5
5
|
import autoForeignKeyResolver from './DefaultEntityBehavior/AutoForeignKeyResolver';
|
|
6
|
-
import autoSelectOptions from './DefaultEntityBehavior/AutoSelectOptions';
|
|
6
|
+
import autoSelectOptions, { autoSelectOptionHandlers } from './DefaultEntityBehavior/AutoSelectOptions';
|
|
7
7
|
import filterFieldsetGroups, { FieldsetGroups } from './DefaultEntityBehavior/FilterFieldsetGroups';
|
|
8
8
|
import foreignKeyGetter from './DefaultEntityBehavior/ForeignKeyGetter';
|
|
9
9
|
import foreignKeyResolver from './DefaultEntityBehavior/ForeignKeyResolver';
|
|
@@ -34,6 +34,7 @@ declare const DefaultEntityBehavior: {
|
|
|
34
34
|
unmarshaller: (row: MarshallerValues, properties: import("..").PartialPropertyList) => MarshallerValues;
|
|
35
35
|
foreignKeyResolver: () => Promise<import("./EntityInterface").foreignKeyResolverType>;
|
|
36
36
|
foreignKeyGetter: () => Promise<import("./EntityInterface").ForeignKeyGetterType>;
|
|
37
|
+
dynamicAutocompleteGetters: (props: DynamicAutocompleteGetterTypeArgs) => Promise<Record<string, import("./EntityInterface").SelectOptionsType<any>>>;
|
|
37
38
|
columns: never[];
|
|
38
39
|
properties: {};
|
|
39
40
|
acl: EntityAclType;
|
|
@@ -51,5 +52,5 @@ declare const DefaultEntityBehavior: {
|
|
|
51
52
|
defaultOrderDirection: OrderDirection;
|
|
52
53
|
};
|
|
53
54
|
export default DefaultEntityBehavior;
|
|
54
|
-
export { Form, ListDecorator, View, autoForeignKeyResolver, autoSelectOptions, filterFieldsetGroups, foreignKeyGetter, foreignKeyResolver, marshaller, unmarshaller, validator, };
|
|
55
|
+
export { Form, ListDecorator, View, autoForeignKeyResolver, autoSelectOptions, autoSelectOptionHandlers, filterFieldsetGroups, foreignKeyGetter, foreignKeyResolver, marshaller, unmarshaller, validator, };
|
|
55
56
|
export type { EntityFormProps, EntityFormType, FieldsetGroups, FkChoices, MarshallerValues, NullablePropertyFkChoices, PropertyFkChoices, };
|
|
@@ -12,7 +12,7 @@ import { OrderDirection, } from './EntityInterface';
|
|
|
12
12
|
import { fetchAllPages } from '../helpers/fechAllPages';
|
|
13
13
|
import { isEntityItem } from '../router';
|
|
14
14
|
import autoForeignKeyResolver from './DefaultEntityBehavior/AutoForeignKeyResolver';
|
|
15
|
-
import autoSelectOptions from './DefaultEntityBehavior/AutoSelectOptions';
|
|
15
|
+
import autoSelectOptions, { autoSelectOptionHandlers, } from './DefaultEntityBehavior/AutoSelectOptions';
|
|
16
16
|
import filterFieldsetGroups from './DefaultEntityBehavior/FilterFieldsetGroups';
|
|
17
17
|
import foreignKeyGetter from './DefaultEntityBehavior/ForeignKeyGetter';
|
|
18
18
|
import foreignKeyResolver from './DefaultEntityBehavior/ForeignKeyResolver';
|
|
@@ -74,6 +74,10 @@ const DefaultEntityBehavior = {
|
|
|
74
74
|
const module = yield import('./DefaultEntityBehavior/ForeignKeyGetter');
|
|
75
75
|
return module.default;
|
|
76
76
|
}),
|
|
77
|
+
dynamicAutocompleteGetters: (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
+
const module = yield import('./DefaultEntityBehavior/DynamicAutocompleteGetter');
|
|
79
|
+
return module.default(props);
|
|
80
|
+
}),
|
|
77
81
|
columns,
|
|
78
82
|
properties,
|
|
79
83
|
acl,
|
|
@@ -99,4 +103,4 @@ const DefaultEntityBehavior = {
|
|
|
99
103
|
defaultOrderDirection: OrderDirection.asc,
|
|
100
104
|
};
|
|
101
105
|
export default DefaultEntityBehavior;
|
|
102
|
-
export { Form, ListDecorator, View, autoForeignKeyResolver, autoSelectOptions, filterFieldsetGroups, foreignKeyGetter, foreignKeyResolver, marshaller, unmarshaller, validator, };
|
|
106
|
+
export { Form, ListDecorator, View, autoForeignKeyResolver, autoSelectOptions, autoSelectOptionHandlers, filterFieldsetGroups, foreignKeyGetter, foreignKeyResolver, marshaller, unmarshaller, validator, };
|
|
@@ -47,6 +47,15 @@ export declare type SelectOptionsArgs = {
|
|
|
47
47
|
callback: FetchFksCallback;
|
|
48
48
|
cancelToken?: CancelToken;
|
|
49
49
|
};
|
|
50
|
+
export declare type DynamicAutocompleteGetterTypeArgs = {
|
|
51
|
+
entityService: EntityService;
|
|
52
|
+
skip?: Array<string>;
|
|
53
|
+
};
|
|
54
|
+
export declare type DynamicSelectOptionsArgs = {
|
|
55
|
+
searchTerm?: string;
|
|
56
|
+
id?: string;
|
|
57
|
+
};
|
|
58
|
+
export declare type DynamicAutocompleteGetterType = (props: DynamicAutocompleteGetterTypeArgs) => Promise<Record<string, SelectOptionsType>>;
|
|
50
59
|
export declare type SelectOptionsType<T = any> = (props: SelectOptionsArgs, customProps?: T) => Promise<unknown>;
|
|
51
60
|
export declare type EntityAclType = {
|
|
52
61
|
iden?: string;
|
|
@@ -90,6 +99,8 @@ export default interface EntityInterface {
|
|
|
90
99
|
foreignKeyResolver: () => Promise<foreignKeyResolverType>;
|
|
91
100
|
foreignKeyGetter: () => Promise<ForeignKeyGetterType>;
|
|
92
101
|
selectOptions?: () => Promise<SelectOptionsType>;
|
|
102
|
+
dynamicAutocompleteGetters: DynamicAutocompleteGetterType;
|
|
103
|
+
dynamicSelectOptions?: boolean;
|
|
93
104
|
Form: () => Promise<React.FunctionComponent<EntityFormProps>>;
|
|
94
105
|
View: () => Promise<ViewType>;
|
|
95
106
|
List: React.FunctionComponent<ListContentProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CancelToken } from 'axios';
|
|
2
|
+
import { FetchFksCallback } from '../entities/EntityInterface';
|
|
3
|
+
export declare type fetchFilteredPageProps = {
|
|
4
|
+
endpoint: string;
|
|
5
|
+
params: Record<string, unknown>;
|
|
6
|
+
setter: FetchFksCallback;
|
|
7
|
+
cancelToken?: CancelToken;
|
|
8
|
+
};
|
|
9
|
+
export declare const fetchFilteredPage: (props: fetchFilteredPageProps) => Promise<unknown>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { StoreContainer } from '../store';
|
|
11
|
+
export const fetchFilteredPage = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
|
+
const { endpoint, params, setter, cancelToken } = props;
|
|
13
|
+
const getAction = StoreContainer.store.getActions().api.get;
|
|
14
|
+
const response = [];
|
|
15
|
+
try {
|
|
16
|
+
yield getAction({
|
|
17
|
+
path: endpoint,
|
|
18
|
+
silenceErrors: false,
|
|
19
|
+
params: Object.assign(Object.assign({ _itemsPerPage: 20 }, params), { _pagination: true, _page: 1 }),
|
|
20
|
+
successCallback: (data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
response.push(...data);
|
|
22
|
+
}),
|
|
23
|
+
cancelToken,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error(error);
|
|
28
|
+
}
|
|
29
|
+
setter(response);
|
|
30
|
+
return response;
|
|
31
|
+
});
|
package/helpers/index.js
ADDED
package/index.d.ts
CHANGED
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IvozStoreState } from 'store';
|
|
3
3
|
import { SearchFilterType } from '../../components/List/Filter/icons/FilterIconFactory';
|
|
4
|
-
import EntityInterface, { EntityAclType, ForeignKeyGetterType, OrderDirection } from '../../entities/EntityInterface';
|
|
4
|
+
import EntityInterface, { DynamicAutocompleteGetterTypeArgs, EntityAclType, ForeignKeyGetterType, OrderDirection, SelectOptionsType } from '../../entities/EntityInterface';
|
|
5
5
|
import { ActionModelSpec, ActionsSpec, PropertyList, fkPropertyList, visualToggleList } from '../../services/api/ParsedApiSpecInterface';
|
|
6
6
|
export declare type VisualToggleStates = {
|
|
7
7
|
[key: string]: boolean;
|
|
@@ -42,6 +42,7 @@ export default class EntityService<T extends IvozStoreState = IvozStoreState> {
|
|
|
42
42
|
getOrderDirection(): OrderDirection;
|
|
43
43
|
getAcls(parentRow?: EntityValues): EntityAclType;
|
|
44
44
|
getForeignKeyGetter(): ForeignKeyGetterType;
|
|
45
|
+
getDynamicAutocompleteGetters(props: DynamicAutocompleteGetterTypeArgs): Promise<Record<string, SelectOptionsType>>;
|
|
45
46
|
getListDecorator(): import("../../entities/EntityInterface").ListDecoratorType;
|
|
46
47
|
getPropertyFilters(propertyName: string, path?: string): Array<SearchFilterType>;
|
|
47
48
|
private getIden;
|
|
@@ -347,6 +347,9 @@ export default class EntityService {
|
|
|
347
347
|
getForeignKeyGetter() {
|
|
348
348
|
return this.entityDefinition.foreignKeyGetter;
|
|
349
349
|
}
|
|
350
|
+
getDynamicAutocompleteGetters(props) {
|
|
351
|
+
return this.entityDefinition.dynamicAutocompleteGetters(props);
|
|
352
|
+
}
|
|
350
353
|
getListDecorator() {
|
|
351
354
|
return this.entityDefinition.ListDecorator;
|
|
352
355
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InputProps } from '@mui/material';
|
|
2
|
+
import React, { JSXElementConstructor, ReactElement } from 'react';
|
|
3
|
+
import { DropdownChoices } from '../Dropdown';
|
|
4
|
+
import { SelectOptionsType } from 'entities/EntityInterface';
|
|
5
|
+
import { FormOnChangeEvent } from 'entities/DefaultEntityBehavior/Form/Form';
|
|
6
|
+
export interface DynamicAutocompleteProps {
|
|
7
|
+
choices: DropdownChoices;
|
|
8
|
+
selectOptions?: SelectOptionsType;
|
|
9
|
+
nullOption?: string | React.ReactElement<any>;
|
|
10
|
+
className?: string;
|
|
11
|
+
name: string;
|
|
12
|
+
label: string | ReactElement<any, string | JSXElementConstructor<any>>;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
value: any;
|
|
15
|
+
multiple: boolean;
|
|
16
|
+
required: boolean;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
onBlur: (event: React.FocusEvent) => void;
|
|
19
|
+
error?: boolean;
|
|
20
|
+
errorMsg?: React.ReactNode;
|
|
21
|
+
helperText?: string | React.ReactNode;
|
|
22
|
+
hasChanged: boolean;
|
|
23
|
+
InputProps?: Partial<InputProps>;
|
|
24
|
+
onChange: (event: FormOnChangeEvent) => void;
|
|
25
|
+
}
|
|
26
|
+
declare const DynamicAutocomplete: (props: DynamicAutocompleteProps) => JSX.Element | null;
|
|
27
|
+
export default DynamicAutocomplete;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Paper, Typography } from '@mui/material';
|
|
3
|
+
import MuiAutocomplete from '@mui/material/Autocomplete';
|
|
4
|
+
import { useCallback, useEffect, useState, useRef, } from 'react';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
import { StyledAutocompleteTextField } from '../TextField';
|
|
7
|
+
import SearchIcon from '@mui/icons-material/Search';
|
|
8
|
+
const DynamicAutocomplete = (props) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const { nullOption, name, label, required, multiple, disabled, onBlur, error, errorMsg, helperText, hasChanged, value, choices, selectOptions, onChange, } = props;
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
let className = props.className;
|
|
13
|
+
if (hasChanged) {
|
|
14
|
+
className += ' changed';
|
|
15
|
+
}
|
|
16
|
+
if (multiple) {
|
|
17
|
+
className += ' multiselect';
|
|
18
|
+
}
|
|
19
|
+
const nullOptionObject = {
|
|
20
|
+
id: '__null__',
|
|
21
|
+
label: nullOption !== null && nullOption !== void 0 ? nullOption : '',
|
|
22
|
+
};
|
|
23
|
+
const [arrayChoices, setArrayChoices] = useState([]);
|
|
24
|
+
const [searchTerm, setSearchTerm] = useState('');
|
|
25
|
+
const [loading, setLoading] = useState(false);
|
|
26
|
+
const [currentOption, setCurrentOption] = useState(nullOptionObject);
|
|
27
|
+
const debounceTimeoutRef = useRef();
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (Array.isArray(choices)) {
|
|
30
|
+
setArrayChoices(choices);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const arrayValue = [];
|
|
34
|
+
for (const idx in choices) {
|
|
35
|
+
arrayValue.push({ id: idx, label: choices[idx] });
|
|
36
|
+
}
|
|
37
|
+
setArrayChoices(arrayValue);
|
|
38
|
+
}, [choices]);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const nullValue = !value || value === '__null__';
|
|
41
|
+
if (nullValue) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (!choices) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const choicesIncludesValue = Array.isArray(choices)
|
|
48
|
+
? choices.some((item) => item.id === value)
|
|
49
|
+
: choices && value in choices;
|
|
50
|
+
if (choicesIncludesValue) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
selectOptions === null || selectOptions === void 0 ? void 0 : selectOptions({
|
|
54
|
+
callback: (options) => {
|
|
55
|
+
const option = options[0];
|
|
56
|
+
arrayChoices.push(option);
|
|
57
|
+
setArrayChoices(arrayChoices);
|
|
58
|
+
},
|
|
59
|
+
}, {
|
|
60
|
+
id: value,
|
|
61
|
+
});
|
|
62
|
+
}, []);
|
|
63
|
+
const setOptions = useCallback((options) => {
|
|
64
|
+
const isCurrentOptionIncluded = options.some((option) => option.id == (currentOption === null || currentOption === void 0 ? void 0 : currentOption.id));
|
|
65
|
+
if (!isCurrentOptionIncluded &&
|
|
66
|
+
currentOption &&
|
|
67
|
+
currentOption.id !== '__null__') {
|
|
68
|
+
options.unshift(currentOption);
|
|
69
|
+
}
|
|
70
|
+
if (nullOptionObject) {
|
|
71
|
+
options.unshift(nullOptionObject);
|
|
72
|
+
}
|
|
73
|
+
setArrayChoices(options);
|
|
74
|
+
}, [nullOptionObject, currentOption]);
|
|
75
|
+
const clearSearch = useCallback(() => {
|
|
76
|
+
if (debounceTimeoutRef.current) {
|
|
77
|
+
clearTimeout(debounceTimeoutRef.current);
|
|
78
|
+
}
|
|
79
|
+
setLoading(false);
|
|
80
|
+
}, []);
|
|
81
|
+
const loadOptions = useCallback((searchValue) => {
|
|
82
|
+
if (!selectOptions) {
|
|
83
|
+
console.error('selectOptions is not defined');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
setLoading(true);
|
|
87
|
+
debounceTimeoutRef.current = setTimeout(() => {
|
|
88
|
+
selectOptions({
|
|
89
|
+
callback: (options) => {
|
|
90
|
+
setLoading(false);
|
|
91
|
+
setOptions(options);
|
|
92
|
+
},
|
|
93
|
+
}, {
|
|
94
|
+
searchTerm: searchValue,
|
|
95
|
+
});
|
|
96
|
+
}, 500);
|
|
97
|
+
}, [searchTerm, selectOptions]);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
clearSearch();
|
|
100
|
+
const searchTermMatchNullOption = getOptionLabel(nullOptionObject) === searchTerm;
|
|
101
|
+
if (searchTermMatchNullOption) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const isSearchTermIncluded = searchTerm !== '' &&
|
|
105
|
+
(arrayChoices === null || arrayChoices === void 0 ? void 0 : arrayChoices.some((option) => getOptionLabel(option).includes(searchTerm)));
|
|
106
|
+
if (isSearchTermIncluded) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
loadOptions(searchTerm);
|
|
110
|
+
}, [searchTerm, selectOptions]);
|
|
111
|
+
const handleInputChange = useCallback((e, value, reason) => {
|
|
112
|
+
if (reason === 'clear') {
|
|
113
|
+
setSearchTerm('');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (reason === 'input') {
|
|
117
|
+
setSearchTerm(value);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (reason === 'reset') {
|
|
121
|
+
if (arrayChoices.length === 0) {
|
|
122
|
+
setSearchTerm('');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}, []);
|
|
126
|
+
const onChangeWrapper = useCallback((e, option, reason) => {
|
|
127
|
+
let selectedValue = undefined;
|
|
128
|
+
if (reason !== 'clear' && option !== null) {
|
|
129
|
+
selectedValue = multiple
|
|
130
|
+
? option.map((item) => typeof item === 'object' ? item.id : item)
|
|
131
|
+
: option.id;
|
|
132
|
+
}
|
|
133
|
+
else if (reason === 'clear') {
|
|
134
|
+
selectedValue = '';
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
selectedValue = (arrayChoices === null || arrayChoices === void 0 ? void 0 : arrayChoices.find((item) => item.id === '__null__'))
|
|
138
|
+
? '__null__'
|
|
139
|
+
: null;
|
|
140
|
+
}
|
|
141
|
+
setCurrentOption(option);
|
|
142
|
+
onChange({
|
|
143
|
+
target: {
|
|
144
|
+
name: name,
|
|
145
|
+
value: selectedValue,
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
}, [multiple, onChange, name, arrayChoices]);
|
|
149
|
+
const getOptionLabel = useCallback((value) => {
|
|
150
|
+
var _a, _b, _c, _d, _e, _f;
|
|
151
|
+
if (typeof value !== 'object') {
|
|
152
|
+
value = arrayChoices === null || arrayChoices === void 0 ? void 0 : arrayChoices.find((option) => option.id == value);
|
|
153
|
+
}
|
|
154
|
+
const isTranslation = (value === null || value === void 0 ? void 0 : value.label) &&
|
|
155
|
+
typeof value.label === 'object' &&
|
|
156
|
+
((_b = (_a = value.label) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.defaults) &&
|
|
157
|
+
typeof ((_d = (_c = value.label) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.defaults) === 'string';
|
|
158
|
+
if (isTranslation) {
|
|
159
|
+
const translatableText = (_f = (_e = value.label) === null || _e === void 0 ? void 0 : _e.props) === null || _f === void 0 ? void 0 : _f.defaults;
|
|
160
|
+
return t(translatableText);
|
|
161
|
+
}
|
|
162
|
+
return (value === null || value === void 0 ? void 0 : value.label) || '';
|
|
163
|
+
}, [arrayChoices, t]);
|
|
164
|
+
const isOptionEqualToValue = useCallback((option, value) => {
|
|
165
|
+
if (value === (currentOption === null || currentOption === void 0 ? void 0 : currentOption.id)) {
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
if ((option === null || option === void 0 ? void 0 : option.id) == value) {
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
if ((option === null || option === void 0 ? void 0 : option.id) == value.id) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
return false;
|
|
175
|
+
}, []);
|
|
176
|
+
const arrayChoicesLength = (_a = arrayChoices === null || arrayChoices === void 0 ? void 0 : arrayChoices.length) !== null && _a !== void 0 ? _a : 0;
|
|
177
|
+
const renderInput = useCallback((props) => {
|
|
178
|
+
const inputProps = Object.assign(Object.assign({}, props.InputProps), { notched: true });
|
|
179
|
+
const showPlaceholder = !searchTerm && !loading;
|
|
180
|
+
const inputPlaceholder = showPlaceholder
|
|
181
|
+
? t('Type to search')
|
|
182
|
+
: props.placeholder;
|
|
183
|
+
return (_jsx(StyledAutocompleteTextField, Object.assign({}, props, { name: name, label: label, required: required, disabled: disabled, InputProps: inputProps, InputLabelProps: { shrink: true, required: required }, error: error, errorMsg: errorMsg, helperText: helperText, placeholder: inputPlaceholder })));
|
|
184
|
+
}, [
|
|
185
|
+
name,
|
|
186
|
+
label,
|
|
187
|
+
required,
|
|
188
|
+
disabled,
|
|
189
|
+
error,
|
|
190
|
+
errorMsg,
|
|
191
|
+
helperText,
|
|
192
|
+
arrayChoicesLength,
|
|
193
|
+
searchTerm,
|
|
194
|
+
loading,
|
|
195
|
+
]);
|
|
196
|
+
const dropdownHelperText = 'Type to load more options';
|
|
197
|
+
const CustomOption = useCallback((props) => {
|
|
198
|
+
return (_jsxs(Paper, Object.assign({}, props, { children: [props.children, dropdownHelperText && (_jsxs(Box, Object.assign({ sx: {
|
|
199
|
+
p: 2,
|
|
200
|
+
borderTop: '1px solid',
|
|
201
|
+
borderColor: 'divider',
|
|
202
|
+
backgroundColor: 'var(--color-background)',
|
|
203
|
+
color: 'var(--color-text)',
|
|
204
|
+
display: 'flex',
|
|
205
|
+
alignItems: 'center',
|
|
206
|
+
gap: '4px',
|
|
207
|
+
} }, { children: [_jsx(SearchIcon, { sx: { fontSize: '18px' } }), _jsx(Typography, Object.assign({ variant: 'caption' }, { children: t(dropdownHelperText) }))] })))] })));
|
|
208
|
+
}, [dropdownHelperText]);
|
|
209
|
+
const disableClearable = arrayChoices.find((item) => item.id === '__null__')
|
|
210
|
+
? false
|
|
211
|
+
: true;
|
|
212
|
+
const safeValue = arrayChoices.find((item) => item.id === value)
|
|
213
|
+
? value
|
|
214
|
+
: null;
|
|
215
|
+
return (_jsx(MuiAutocomplete, { className: 'dynamic-autocomplete' + className, value: safeValue, multiple: multiple, disabled: disabled, disableClearable: disableClearable, onChange: onChangeWrapper, onBlur: onBlur, onInputChange: handleInputChange, options: arrayChoices !== null && arrayChoices !== void 0 ? arrayChoices : [], getOptionLabel: getOptionLabel, isOptionEqualToValue: isOptionEqualToValue, loading: loading, placeholder: props.placeholder, renderInput: renderInput, PaperComponent: CustomOption, renderOption: (props, option) => (_jsx(Box, Object.assign({ component: 'li', className: 'autocomplete-option', "data-value": option.id }, props, { children: option.label }))) }));
|
|
216
|
+
};
|
|
217
|
+
export default DynamicAutocomplete;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StyledDynamicAutocomplete: import("@emotion/styled").StyledComponent<import("./DynamicAutocomplete").DynamicAutocompleteProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PropertySpec } from '../../../api';
|
|
3
|
+
import { ScalarEntityValue } from '../../../entity';
|
|
4
|
+
import { FormOnChangeEvent } from 'entities/DefaultEntityBehavior/Form/Form';
|
|
5
|
+
import EntityService from 'services/entity/EntityService';
|
|
6
|
+
import { NullableFormFieldFactoryChoices } from 'services/form';
|
|
7
|
+
declare type DynamicAutocompleteFactoryPropsType = {
|
|
8
|
+
fld: string;
|
|
9
|
+
property: PropertySpec;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
multiSelect: boolean;
|
|
12
|
+
value: ScalarEntityValue | Array<ScalarEntityValue>;
|
|
13
|
+
choices: NullableFormFieldFactoryChoices;
|
|
14
|
+
hasChanged: boolean;
|
|
15
|
+
error: React.ReactNode;
|
|
16
|
+
touched: boolean | undefined;
|
|
17
|
+
changeHandler: (event: FormOnChangeEvent) => void;
|
|
18
|
+
handleBlur: (event: React.FocusEvent) => void;
|
|
19
|
+
entityService: EntityService;
|
|
20
|
+
};
|
|
21
|
+
export declare const DynamicAutocompleteFactory: (props: DynamicAutocompleteFactoryPropsType) => JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isPropertyFk } from '../../../api';
|
|
3
|
+
import { DynamicAutocomplete } from '../../Field/DynamicAutocomplete';
|
|
4
|
+
import { Skeleton } from '@mui/material';
|
|
5
|
+
import { useEffect, useState } from 'react';
|
|
6
|
+
export const DynamicAutocompleteFactory = (props) => {
|
|
7
|
+
const { entityService, fld, disabled, multiSelect, value, hasChanged, error, touched, property, changeHandler, handleBlur, } = props;
|
|
8
|
+
let { choices } = props;
|
|
9
|
+
const [selectOptionsLoader, setSelectOptionsLoader] = useState(undefined);
|
|
10
|
+
const cleanRef = isPropertyFk(property)
|
|
11
|
+
? property.$ref.replace('#/definitions/', '')
|
|
12
|
+
: '';
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!cleanRef) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const selectOptionsGetter = entityService.getDynamicAutocompleteGetters({
|
|
18
|
+
entityService,
|
|
19
|
+
skip: [],
|
|
20
|
+
});
|
|
21
|
+
selectOptionsGetter.then((getters) => {
|
|
22
|
+
const selectOptions = getters[cleanRef];
|
|
23
|
+
if (selectOptions) {
|
|
24
|
+
setSelectOptionsLoader({ selectOptions: selectOptions });
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}, [cleanRef, entityService]);
|
|
28
|
+
if (!selectOptionsLoader || !choices) {
|
|
29
|
+
return (_jsxs(_Fragment, { children: [_jsx(Skeleton, { width: '50%' }), _jsx(Skeleton, { variant: 'rectangular', height: 42 })] }));
|
|
30
|
+
}
|
|
31
|
+
if (property.null) {
|
|
32
|
+
if (Array.isArray(choices)) {
|
|
33
|
+
const nullAlreadyAssigned = choices.find((item) => item.id == '__null__');
|
|
34
|
+
if (!nullAlreadyAssigned) {
|
|
35
|
+
choices = [{ label: property.null, id: '__null__' }, ...choices];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
choices = Object.assign({ __null__: property.null }, choices);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return (_jsx(DynamicAutocomplete, { name: fld, label: property.label, value: value, choices: choices, multiple: multiSelect, nullOption: property.null, required: property.required, disabled: disabled, onBlur: handleBlur, error: touched && Boolean(error), errorMsg: touched && error, helperText: property.helpText, hasChanged: hasChanged, onChange: changeHandler, selectOptions: selectOptionsLoader.selectOptions }));
|
|
43
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DynamicAutocompleteFactory } from './DynamicAutocompleteFactory';
|
|
1
2
|
import { AutocompleteFactory } from './AutocompleteFactory';
|
|
2
3
|
import { DateFactory } from './DateFactory';
|
|
3
4
|
import { DateTimeFactory } from './DateTimeFactory';
|
|
@@ -11,4 +12,4 @@ import { SwitchFactory } from './SwitchFactory';
|
|
|
11
12
|
import { TextareaFactory } from './TextareaFactory';
|
|
12
13
|
import { TimeFactory } from './TimeFactory';
|
|
13
14
|
import { ColorFactory } from './ColorFactory';
|
|
14
|
-
export { AutocompleteFactory, DateFactory, DateTimeFactory, DropdownFactory, FileUploadFactory, InputTextFactory, MultilangFactory, NumberFactory, PasswordFactory, SwitchFactory, TextareaFactory, TimeFactory, ColorFactory, };
|
|
15
|
+
export { DynamicAutocompleteFactory, AutocompleteFactory, DateFactory, DateTimeFactory, DropdownFactory, FileUploadFactory, InputTextFactory, MultilangFactory, NumberFactory, PasswordFactory, SwitchFactory, TextareaFactory, TimeFactory, ColorFactory, };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DynamicAutocompleteFactory } from './DynamicAutocompleteFactory';
|
|
1
2
|
import { AutocompleteFactory } from './AutocompleteFactory';
|
|
2
3
|
import { DateFactory } from './DateFactory';
|
|
3
4
|
import { DateTimeFactory } from './DateTimeFactory';
|
|
@@ -11,4 +12,4 @@ import { SwitchFactory } from './SwitchFactory';
|
|
|
11
12
|
import { TextareaFactory } from './TextareaFactory';
|
|
12
13
|
import { TimeFactory } from './TimeFactory';
|
|
13
14
|
import { ColorFactory } from './ColorFactory';
|
|
14
|
-
export { AutocompleteFactory, DateFactory, DateTimeFactory, DropdownFactory, FileUploadFactory, InputTextFactory, MultilangFactory, NumberFactory, PasswordFactory, SwitchFactory, TextareaFactory, TimeFactory, ColorFactory, };
|
|
15
|
+
export { DynamicAutocompleteFactory, AutocompleteFactory, DateFactory, DateTimeFactory, DropdownFactory, FileUploadFactory, InputTextFactory, MultilangFactory, NumberFactory, PasswordFactory, SwitchFactory, TextareaFactory, TimeFactory, ColorFactory, };
|
|
@@ -12,6 +12,8 @@ export default class FormFieldFactory {
|
|
|
12
12
|
private handleBlur;
|
|
13
13
|
private divRef?;
|
|
14
14
|
constructor(entityService: EntityService, formik: useFormikType, changeHandler: (event: FormOnChangeEvent) => void, handleBlur: (event: React.FocusEvent) => void, divRef?: React.RefObject<HTMLDivElement> | undefined);
|
|
15
|
+
private getDynamicSelectOptions;
|
|
16
|
+
private isDynamicAutocomplete;
|
|
15
17
|
getFormField(fld: string, choices: NullableFormFieldFactoryChoices, readOnly?: boolean): JSX.Element | null;
|
|
16
18
|
createByPropertySpec(fld: string, property: PropertySpec, choices: NullableFormFieldFactoryChoices, readOnly?: boolean): JSX.Element | null;
|
|
17
19
|
getProperty(fld: string): PropertySpec | null;
|
|
@@ -3,7 +3,8 @@ import { InputAdornment, } from '@mui/material';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { isPropertyEmbeddable, isPropertyFk, isPropertyScalar, } from '../../api/ParsedApiSpecInterface';
|
|
5
5
|
import { CustomFunctionComponentContext, } from '../../form/Field/CustomComponentWrapper';
|
|
6
|
-
import { AutocompleteFactory, DateFactory, DateTimeFactory, DropdownFactory, FileUploadFactory, InputTextFactory, MultilangFactory, NumberFactory, PasswordFactory, SwitchFactory, TextareaFactory, TimeFactory, ColorFactory, } from './Factory/index';
|
|
6
|
+
import { DynamicAutocompleteFactory, AutocompleteFactory, DateFactory, DateTimeFactory, DropdownFactory, FileUploadFactory, InputTextFactory, MultilangFactory, NumberFactory, PasswordFactory, SwitchFactory, TextareaFactory, TimeFactory, ColorFactory, } from './Factory/index';
|
|
7
|
+
import { StoreContainer } from '../../../store';
|
|
7
8
|
export default class FormFieldFactory {
|
|
8
9
|
constructor(entityService, formik, changeHandler, handleBlur, divRef) {
|
|
9
10
|
this.entityService = entityService;
|
|
@@ -12,6 +13,30 @@ export default class FormFieldFactory {
|
|
|
12
13
|
this.handleBlur = handleBlur;
|
|
13
14
|
this.divRef = divRef;
|
|
14
15
|
}
|
|
16
|
+
getDynamicSelectOptions(property) {
|
|
17
|
+
var _a;
|
|
18
|
+
if (!isPropertyFk(property)) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const entities = StoreContainer.store.getState().entities.entities;
|
|
22
|
+
const entityName = property.$ref.replace('#/definitions/', '');
|
|
23
|
+
if (!((_a = entities[entityName]) === null || _a === void 0 ? void 0 : _a.dynamicSelectOptions)) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
return entities[entityName].selectOptions;
|
|
27
|
+
}
|
|
28
|
+
isDynamicAutocomplete(property) {
|
|
29
|
+
var _a;
|
|
30
|
+
if (!isPropertyFk(property)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
const entities = StoreContainer.store.getState().entities.entities;
|
|
34
|
+
const cleanRef = property.$ref.replace('#/definitions/', '');
|
|
35
|
+
if (!((_a = entities[cleanRef]) === null || _a === void 0 ? void 0 : _a.dynamicSelectOptions)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
15
40
|
getFormField(fld, choices, readOnly = false) {
|
|
16
41
|
const property = this.getProperty(fld);
|
|
17
42
|
if (!property) {
|
|
@@ -34,6 +59,9 @@ export default class FormFieldFactory {
|
|
|
34
59
|
.component;
|
|
35
60
|
return (_jsx(PropertyComponent, { _context: CustomFunctionComponentContext.write, _columnName: fld, readOnly: readOnly, formik: this.formik, values: this.formik.values, choices: choices, property: property, disabled: disabled, changeHandler: this.changeHandler, onBlur: this.handleBlur, formFieldFactory: this }));
|
|
36
61
|
}
|
|
62
|
+
if (this.isDynamicAutocomplete(property)) {
|
|
63
|
+
return (_jsx(DynamicAutocompleteFactory, { fld: fld, property: property, disabled: disabled, multiSelect: multiSelect, value: value, hasChanged: hasChanged, error: error, touched: touched, choices: choices, changeHandler: this.changeHandler, handleBlur: this.handleBlur, entityService: this.entityService }));
|
|
64
|
+
}
|
|
37
65
|
if (isPropertyFk(property) || multiSelect) {
|
|
38
66
|
return (_jsx(AutocompleteFactory, { fld: fld, property: property, disabled: disabled, multiSelect: multiSelect, value: value, hasChanged: hasChanged, error: error, touched: touched, choices: choices, changeHandler: this.changeHandler, handleBlur: this.handleBlur }));
|
|
39
67
|
}
|
package/translations/ca.json
CHANGED
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"Starts with": "empieza por",
|
|
41
41
|
"This change will affect": "Aquest canvi afectarà",
|
|
42
42
|
"True": "Verdadero",
|
|
43
|
+
"Type to load more options": "Escriu per carregar més opcions",
|
|
44
|
+
"Type to search": "Escriu per cercar",
|
|
43
45
|
"Upload image": "Subir imagen",
|
|
44
46
|
"Username": "Usuari",
|
|
45
47
|
"Validation error": "Error de validación",
|
package/translations/en.json
CHANGED
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"Starts with": "Starts with",
|
|
41
41
|
"This change will affect": "This change will affect",
|
|
42
42
|
"True": "True",
|
|
43
|
+
"Type to load more options": "Type to load more options",
|
|
44
|
+
"Type to search": "Type to search",
|
|
43
45
|
"Upload image": "Upload image",
|
|
44
46
|
"Username": "Username",
|
|
45
47
|
"Validation error": "Validation error",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
"Yes, delete it": "Yes, delete it",
|
|
49
51
|
"You are about to remove": "You are about to remove",
|
|
50
52
|
"You are about to update": "You are about to update",
|
|
51
|
-
"You haven
|
|
53
|
+
"You haven't created any {{entity}} yet.": "You haven't created any {{entity}} yet.",
|
|
52
54
|
"entities": "entities",
|
|
53
55
|
"invalid pattern": "invalid pattern",
|
|
54
56
|
"required value": "required value",
|
package/translations/es.json
CHANGED
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"Starts with": "empieza por",
|
|
41
41
|
"This change will affect": "Este cambio afectará",
|
|
42
42
|
"True": "Verdadero",
|
|
43
|
+
"Type to load more options": "Escribe para cargar más opciones",
|
|
44
|
+
"Type to search": "Escribe para buscar",
|
|
43
45
|
"Upload image": "Subir imagen",
|
|
44
46
|
"Username": "Usuario",
|
|
45
47
|
"Validation error": "Error de validación",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
"Yes, delete it": "Si, eliminar",
|
|
49
51
|
"You are about to remove": "Estás a punto de eliminar",
|
|
50
52
|
"You are about to update": "Estás a punto de actualizar",
|
|
51
|
-
"You haven
|
|
53
|
+
"You haven't created any {{entity}} yet.": "Aún no has creado ningún {{entity}}",
|
|
52
54
|
"entities": "entidades",
|
|
53
55
|
"invalid pattern": "Patrón invalido",
|
|
54
56
|
"required value": "valor requerido",
|
package/translations/it.json
CHANGED
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"Starts with": "Starts with",
|
|
41
41
|
"This change will affect": "Questa modifica influirà",
|
|
42
42
|
"True": "True",
|
|
43
|
+
"Type to load more options": "Digita per caricare più opzioni",
|
|
44
|
+
"Type to search": "Digita per cercare",
|
|
43
45
|
"Upload image": "Upload image",
|
|
44
46
|
"Username": "Username",
|
|
45
47
|
"Validation error": "Validation error",
|