@irontec/ivoz-ui 1.7.9 → 1.7.11
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/DownloadFile.js +6 -3
- package/components/List/DownloadFile.styles.d.ts +2 -18
- package/components/List/DownloadFile.styles.js +13 -13
- package/components/layout/Header/Header.js +6 -6
- package/components/shared/ConfirmDialog.styles.d.ts +2 -2
- package/css/main.css +3 -3
- package/entities/DefaultEntityBehavior/Form/useMultilangSync.d.ts +12 -0
- package/entities/DefaultEntityBehavior/Form/useMultilangSync.js +32 -0
- package/package.json +1 -2
- package/services/form/Field/Multilang.js +7 -1
- 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,10 +7,12 @@ 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 } from "react/jsx-runtime";
|
|
11
11
|
import { useStoreActions } from 'store';
|
|
12
|
-
import { StyledPdfIcon, StyledFileName } from './DownloadFile.styles';
|
|
13
12
|
import { saveAs } from 'file-saver';
|
|
13
|
+
import { Tooltip } from '@mui/material';
|
|
14
|
+
import DownloadIcon from '@mui/icons-material/Download';
|
|
15
|
+
import { StyledPdfButton } from './DownloadFile.styles';
|
|
14
16
|
export default function DownloadFile(props) {
|
|
15
17
|
const { row, path, fileType } = props;
|
|
16
18
|
const apiDownload = useStoreActions((actions) => {
|
|
@@ -27,5 +29,6 @@ export default function DownloadFile(props) {
|
|
|
27
29
|
}),
|
|
28
30
|
});
|
|
29
31
|
};
|
|
30
|
-
|
|
32
|
+
const noFile = !row[fileType].baseName;
|
|
33
|
+
return (_jsx(Tooltip, Object.assign({ title: row[fileType].baseName, placement: 'bottom', arrow: true }, { children: _jsx(StyledPdfButton, Object.assign({ disabled: noFile, onClick: download }, { children: _jsx(DownloadIcon, {}) })) })));
|
|
31
34
|
}
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
3
|
-
children?: import("react").ReactNode;
|
|
4
|
-
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "disabled" | "error" | "action" | "success" | "warning" | "info" | "primary" | "secondary" | undefined;
|
|
6
|
-
fontSize?: "small" | "inherit" | "large" | "medium" | undefined;
|
|
7
|
-
htmlColor?: string | undefined;
|
|
8
|
-
inheritViewBox?: boolean | undefined;
|
|
9
|
-
shapeRendering?: string | undefined;
|
|
10
|
-
sx?: import("@mui/system").SxProps<import("@mui/material").Theme> | undefined;
|
|
11
|
-
titleAccess?: string | undefined;
|
|
12
|
-
viewBox?: string | undefined;
|
|
13
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").SVGProps<SVGSVGElement>, "string" | "className" | "id" | "lang" | "style" | "tabIndex" | "role" | "color" | "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" | "clipPath" | "filter" | "mask" | "path" | "cursor" | "direction" | "display" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "height" | "imageRendering" | "letterSpacing" | "opacity" | "order" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "visibility" | "width" | "wordSpacing" | "writingMode" | "offset" | "overflow" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "name" | "key" | "max" | "media" | "method" | "min" | "target" | "type" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "alphabetic" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "end" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "hanging" | "horizAdvX" | "horizOriginX" | "href" | "ideographic" | "in2" | "in" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "local" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mathematical" | "mode" | "numOctaves" | "operator" | "orient" | "orientation" | "origin" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "values" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "y" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
14
|
-
ref?: ((instance: SVGSVGElement | null) => void) | import("react").RefObject<SVGSVGElement> | null | undefined;
|
|
15
|
-
}, "color" | "children" | "fontSize" | "shapeRendering" | keyof import("@mui/material/OverridableComponent").CommonProps | "sx" | "viewBox" | "htmlColor" | "inheritViewBox" | "titleAccess"> & {
|
|
16
|
-
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
-
}, {}, {}>;
|
|
18
|
-
export declare const StyledFileName: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
export declare const StyledPdfButton: import("@emotion/styled").StyledComponent<{
|
|
19
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
20
4
|
as?: import("react").ElementType<any> | undefined;
|
|
21
|
-
}, import("react").DetailedHTMLProps<import("react").
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
-
|
|
3
|
-
export const StyledPdfIcon = styled(DownloadIcon)(() => {
|
|
2
|
+
export const StyledPdfButton = styled.button(() => {
|
|
4
3
|
return {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
backgroundColor: 'transparent',
|
|
5
|
+
border: '0',
|
|
6
|
+
color: 'var(--color-text)',
|
|
7
7
|
fontSize: '1.3em',
|
|
8
8
|
cursor: 'pointer',
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
display: 'flex',
|
|
10
|
+
alignItems: 'flex-end',
|
|
11
|
+
'&:hover': {
|
|
12
|
+
color: 'var(--color-primary)',
|
|
13
|
+
},
|
|
14
|
+
'&:disabled': {
|
|
15
|
+
color: '#d1d1d3',
|
|
16
|
+
cursor: 'initial',
|
|
17
|
+
},
|
|
18
18
|
};
|
|
19
19
|
});
|
|
@@ -29,10 +29,10 @@ export default function Header(props) {
|
|
|
29
29
|
};
|
|
30
30
|
return (_jsxs(Box, Object.assign({ className: className }, { children: [_jsx(Box, Object.assign({ className: 'start' }, { children: _jsx(Breadcrumbs, { desktop: desktop, routeMap: routeMap }) })), _jsxs(Box, Object.assign({ className: 'end' }, { children: [desktop && (_jsxs(_Fragment, { children: [_jsx(Settings, {}), _jsxs(Avatar, { children: [_jsx(MenuItem, Object.assign({ onClick: handleModal }, { children: _jsx(Typography, Object.assign({ textAlign: 'center' }, { children: _('About') })) }), 'about'), _jsx(MenuItem, Object.assign({ onClick: handleLogout }, { children: _jsx(Typography, Object.assign({ textAlign: 'center' }, { children: _('Logout') })) }), 'logout')] })] })), !desktop && (_jsx(LightButton, Object.assign({ onClick: () => {
|
|
31
31
|
toggleVisibility();
|
|
32
|
-
} }, { children: _jsx(MenuIcon, {}) }))), open && (_jsxs(Dialog, Object.assign({ open: open, onClose: handleModal, keepMounted: true, "aria-labelledby": 'dialog-about', "aria-describedby": 'dialog-about' }, { children: [_jsx(CloseRoundedIcon, { className: 'close-icon', onClick: handleModal }), _jsxs(DialogContent, Object.assign({ className: 'dialog-about' }, { children: [_jsx("
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
} }, { children: _jsx(MenuIcon, {}) }))), open && (_jsxs(Dialog, Object.assign({ open: open, onClose: handleModal, keepMounted: true, "aria-labelledby": 'dialog-about', "aria-describedby": 'dialog-about' }, { children: [_jsx(CloseRoundedIcon, { className: 'close-icon', onClick: handleModal }), _jsxs(DialogContent, Object.assign({ className: 'dialog-about' }, { children: [_jsx("img", { src: logo || './logo.svg', className: 'logo' }), _jsxs("p", { children: [_('Version'), ": ", version, " (", commit, ") ", _jsx("br", {}), _('Last update'), ": ", lastUpdated] }), _jsxs(Box, Object.assign({ sx: {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
gap: 1,
|
|
37
|
+
}, className: 'logo' }, { children: ["Powered by ", _jsx(Logo, {})] })), _jsx("p", { children: "\u00A92025 Irontec | All rights reserved" })] })), _jsx(DialogActions, { children: _jsx(SolidButton, Object.assign({ onClick: handleModal, sx: { width: '100%' } }, { children: _('ACCEPT') })) })] })))] }))] })));
|
|
38
38
|
}
|
|
@@ -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" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | undefined;
|
|
14
|
+
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline", 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>, {}, {}>;
|
package/css/main.css
CHANGED
|
@@ -323,12 +323,12 @@ code {
|
|
|
323
323
|
.MuiDialog-paper .MuiDialogActions-root button {
|
|
324
324
|
flex-grow: 1;
|
|
325
325
|
}
|
|
326
|
-
.MuiDialog-paper .logo img {
|
|
327
|
-
height: 50px;
|
|
328
|
-
}
|
|
329
326
|
.MuiDialog-paper .logo svg {
|
|
330
327
|
height: 12px;
|
|
331
328
|
}
|
|
329
|
+
.MuiDialog-paper img.logo {
|
|
330
|
+
height: 50px;
|
|
331
|
+
}
|
|
332
332
|
|
|
333
333
|
:root {
|
|
334
334
|
/** COLORS **/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Language } from 'store/i18n';
|
|
2
|
+
import { useFormikType } from 'services';
|
|
3
|
+
import { FormOnChangeEvent } from 'entities';
|
|
4
|
+
declare type Params = {
|
|
5
|
+
formik?: useFormikType;
|
|
6
|
+
languages: Array<Language>;
|
|
7
|
+
changeHandler: (e: FormOnChangeEvent) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const useMultilangSync: ({ formik, languages, changeHandler, }: Params) => {
|
|
10
|
+
handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
export const useMultilangSync = ({ formik, languages, changeHandler, }) => {
|
|
3
|
+
const propagateTimeoutRef = useRef(null);
|
|
4
|
+
const latestTypingRef = useRef(null);
|
|
5
|
+
const handleChange = (e) => {
|
|
6
|
+
changeHandler(e);
|
|
7
|
+
const [fieldKey, currentLang] = e.target.name.split('.');
|
|
8
|
+
const currentValue = e.target.value;
|
|
9
|
+
latestTypingRef.current = { lang: currentLang, value: currentValue };
|
|
10
|
+
if (propagateTimeoutRef.current) {
|
|
11
|
+
clearTimeout(propagateTimeoutRef.current);
|
|
12
|
+
}
|
|
13
|
+
propagateTimeoutRef.current = setTimeout(() => {
|
|
14
|
+
if (!latestTypingRef.current) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { lang: typingLang, value: typingValue } = latestTypingRef.current;
|
|
18
|
+
const updatedValues = {};
|
|
19
|
+
languages.forEach((lng) => {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
const locale = (_b = (_a = lng.locale) === null || _a === void 0 ? void 0 : _a.split('-')[0]) !== null && _b !== void 0 ? _b : 'en';
|
|
22
|
+
const existingVal = (_c = formik === null || formik === void 0 ? void 0 : formik.values[fieldKey]) === null || _c === void 0 ? void 0 : _c[locale];
|
|
23
|
+
updatedValues[locale] =
|
|
24
|
+
locale === typingLang || !(existingVal === null || existingVal === void 0 ? void 0 : existingVal.trim())
|
|
25
|
+
? typingValue
|
|
26
|
+
: existingVal;
|
|
27
|
+
});
|
|
28
|
+
formik === null || formik === void 0 ? void 0 : formik.setFieldValue(fieldKey, updatedValues);
|
|
29
|
+
}, 1800);
|
|
30
|
+
};
|
|
31
|
+
return { handleChange };
|
|
32
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@irontec/ivoz-ui",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.11",
|
|
4
4
|
"description": "UI library used in ivozprovider",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "index.js",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@date-io/date-fns": "^2.10.8",
|
|
49
|
-
"@irontec/ivoz-ui": "^1.7.8",
|
|
50
49
|
"@types/react-color": "^3.0.12",
|
|
51
50
|
"axios": "^0.21.1",
|
|
52
51
|
"date-fns": "^2.21.1",
|
|
@@ -3,12 +3,18 @@ import { Box } from '@mui/material';
|
|
|
3
3
|
import { useStoreState } from 'store';
|
|
4
4
|
import { StyledFieldset, StyledFieldsetRoot, } from './CustomComponentWrapper.styles';
|
|
5
5
|
import { StyledMultilangTextField } from './TextField/TextField.styles';
|
|
6
|
+
import { useMultilangSync } from '../../../entities/DefaultEntityBehavior/Form/useMultilangSync';
|
|
6
7
|
const Multilang = (props) => {
|
|
7
8
|
const { _columnName, disabled, properties, formik, inputProps, onBlur, changeHandler, } = props;
|
|
8
9
|
let { InputProps } = props;
|
|
9
10
|
const languages = useStoreState((state) => state.i18n.languages);
|
|
10
11
|
const mlValue = (formik === null || formik === void 0 ? void 0 : formik.values[_columnName]) || {};
|
|
11
12
|
const rootProperty = properties[_columnName];
|
|
13
|
+
const { handleChange } = useMultilangSync({
|
|
14
|
+
formik,
|
|
15
|
+
languages,
|
|
16
|
+
changeHandler,
|
|
17
|
+
});
|
|
12
18
|
return (_jsx(StyledFieldsetRoot, Object.assign({ label: rootProperty.label, hasChanged: false, required: rootProperty.required, disabled: disabled, className: 'multilang' }, { children: _jsx(StyledFieldset, { children: _jsx(Box, { children: languages === null || languages === void 0 ? void 0 : languages.map((lng) => {
|
|
13
19
|
var _a, _b, _c;
|
|
14
20
|
const locale = (_a = lng.locale.split('-').shift()) !== null && _a !== void 0 ? _a : 'en';
|
|
@@ -22,7 +28,7 @@ const Multilang = (props) => {
|
|
|
22
28
|
const error = formik === null || formik === void 0 ? void 0 : formik.errors[name];
|
|
23
29
|
InputProps = InputProps !== null && InputProps !== void 0 ? InputProps : {};
|
|
24
30
|
InputProps.startAdornment = (_jsx("span", Object.assign({ className: 'preffix' }, { children: lng.name.substring(0, 3).toUpperCase() })));
|
|
25
|
-
return (_jsx(StyledMultilangTextField, { name: name, type: 'text', multiline: multiline, value: value, disabled: disabled, label: undefined, required: required, onChange:
|
|
31
|
+
return (_jsx(StyledMultilangTextField, { name: name, type: 'text', multiline: multiline, value: value, disabled: disabled, label: undefined, required: required, onChange: handleChange, onBlur: onBlur, error: touched && Boolean(error), errorMsg: touched && error, helperText: property.helpText, InputProps: Object.assign({}, InputProps), inputProps: inputProps, hasChanged: false, margin: 'dense', size: 'small' }, name));
|
|
26
32
|
}) }) }) })));
|
|
27
33
|
};
|
|
28
34
|
export default Multilang;
|
package/translations/ca.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"About": "Sobre",
|
|
3
|
+
"ACCEPT": "ACCEPTAR",
|
|
2
4
|
"Add": "Añadir",
|
|
3
5
|
"Advanced search": "Búsqueda avanzada",
|
|
4
6
|
"Apply": "Aplicar",
|
|
@@ -21,6 +23,7 @@
|
|
|
21
23
|
"Is lower than": "es menor que",
|
|
22
24
|
"Is lower than equal": "es menor o igual que",
|
|
23
25
|
"Language": "Idioma",
|
|
26
|
+
"Last update": "Última actualització",
|
|
24
27
|
"Logout": "Salir",
|
|
25
28
|
"New": "Nuevo",
|
|
26
29
|
"New {{entity}}": "Nuevo {{entity}}",
|
|
@@ -50,5 +53,6 @@
|
|
|
50
53
|
"invalid pattern": "Patrón invalido",
|
|
51
54
|
"required value": "valor requerido",
|
|
52
55
|
"settings": "Configuracions",
|
|
56
|
+
"Version": "Versió",
|
|
53
57
|
"{{username}} account settings": "Configuración de cuenta de {{username}}"
|
|
54
58
|
}
|
package/translations/en.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"About": "About",
|
|
3
|
+
"ACCEPT": "ACCEPT",
|
|
2
4
|
"Add": "Add",
|
|
3
5
|
"Advanced search": "Advanced search",
|
|
4
6
|
"Apply": "Apply",
|
|
@@ -21,6 +23,7 @@
|
|
|
21
23
|
"Is lower than": "Is lower than",
|
|
22
24
|
"Is lower than equal": "Is lower than equal",
|
|
23
25
|
"Language": "Language",
|
|
26
|
+
"Last update": "Last update",
|
|
24
27
|
"Logout": "Logout",
|
|
25
28
|
"New": "New",
|
|
26
29
|
"New {{entity}}": "New {{entity}}",
|
|
@@ -50,5 +53,6 @@
|
|
|
50
53
|
"invalid pattern": "invalid pattern",
|
|
51
54
|
"required value": "required value",
|
|
52
55
|
"settings": "Settings",
|
|
56
|
+
"Version": "Version",
|
|
53
57
|
"{{username}} account settings": "{{username}} account settings"
|
|
54
58
|
}
|
package/translations/es.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"About": "Acerca de",
|
|
3
|
+
"ACCEPT": "ACEPTAR",
|
|
2
4
|
"Add": "Añadir",
|
|
3
5
|
"Advanced search": "Búsqueda avanzada",
|
|
4
6
|
"Apply": "Aplicar",
|
|
@@ -21,6 +23,7 @@
|
|
|
21
23
|
"Is lower than": "es menor que",
|
|
22
24
|
"Is lower than equal": "es menor o igual que",
|
|
23
25
|
"Language": "Idioma",
|
|
26
|
+
"Last update": "Última actualización",
|
|
24
27
|
"Logout": "Salir",
|
|
25
28
|
"New": "Nuevo",
|
|
26
29
|
"New {{entity}}": "Nuevo {{entity}}",
|
|
@@ -50,5 +53,6 @@
|
|
|
50
53
|
"invalid pattern": "Patrón invalido",
|
|
51
54
|
"required value": "valor requerido",
|
|
52
55
|
"settings": "Configuración",
|
|
56
|
+
"Version": "Versión",
|
|
53
57
|
"{{username}} account settings": "Configuración de cuenta de {{username}}"
|
|
54
58
|
}
|
package/translations/it.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"About": "Circa",
|
|
3
|
+
"ACCEPT": "ACCETTARE",
|
|
2
4
|
"Add": "Add",
|
|
3
5
|
"Advanced search": "Advanced search",
|
|
4
6
|
"Apply": "Apply",
|
|
@@ -21,6 +23,7 @@
|
|
|
21
23
|
"Is lower than": "Is lower than",
|
|
22
24
|
"Is lower than equal": "Is lower than equal",
|
|
23
25
|
"Language": "Language",
|
|
26
|
+
"Last update": "Ultimo aggiornamento",
|
|
24
27
|
"Logout": "Logout",
|
|
25
28
|
"New": "New",
|
|
26
29
|
"New {{entity}}": "New {{entity}}",
|
|
@@ -50,5 +53,6 @@
|
|
|
50
53
|
"invalid pattern": "invalid pattern",
|
|
51
54
|
"required value": "required value",
|
|
52
55
|
"settings": "Impostazioni",
|
|
56
|
+
"Version": "Versione",
|
|
53
57
|
"{{username}} account settings": "{{username}} account settings"
|
|
54
58
|
}
|