@trii/components 2.0.51 → 2.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +11 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +1 -2
- package/dist/cjs/types/components/EditContactModal/EditContactModal.d.ts +1 -2
- package/dist/cjs/types/i18n/config.d.ts +2 -2
- package/dist/esm/index.js +12 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ContactInfoPopup/ContactInfoPopup.d.ts +1 -2
- package/dist/esm/types/components/EditContactModal/EditContactModal.d.ts +1 -2
- package/dist/esm/types/i18n/config.d.ts +2 -2
- package/dist/index.d.ts +6 -4
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IBusiness, IContact } from '@trii/types/dist/Contacts';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material';
|
|
3
|
-
import '../../i18n/config';
|
|
4
3
|
export interface ContactInfoPopupProps {
|
|
5
4
|
open: boolean;
|
|
6
5
|
anchorEl: HTMLElement | null;
|
|
@@ -11,5 +10,5 @@ export interface ContactInfoPopupProps {
|
|
|
11
10
|
sx?: SxProps<Theme>;
|
|
12
11
|
navigate: (path: string) => void;
|
|
13
12
|
}
|
|
14
|
-
declare const ContactInfoPopup: (
|
|
13
|
+
declare const ContactInfoPopup: (props: ContactInfoPopupProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
14
|
export default ContactInfoPopup;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SxProps, Theme } from '@mui/material';
|
|
2
|
-
import '../../i18n/config';
|
|
3
2
|
export interface Props {
|
|
4
3
|
open: boolean;
|
|
5
4
|
onClose: () => void;
|
|
@@ -10,5 +9,5 @@ export interface Props {
|
|
|
10
9
|
sx?: SxProps<Theme>;
|
|
11
10
|
navigate: (path: string) => void;
|
|
12
11
|
}
|
|
13
|
-
declare const EditContactModal: (
|
|
12
|
+
declare const EditContactModal: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export default EditContactModal;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export default
|
|
1
|
+
declare const i18nInstance: import("i18next").i18n;
|
|
2
|
+
export default i18nInstance;
|
package/dist/esm/index.js
CHANGED
|
@@ -2,9 +2,8 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { useCallback, useEffect, createContext, useContext, useState, useMemo, Children, isValidElement, cloneElement, useDeferredValue, createElement, useRef } from 'react';
|
|
3
3
|
import { styled as styled$5, Box as Box$2, IconButton as IconButton$2, Avatar, Typography as Typography$2, CircularProgress as CircularProgress$2, Tooltip, Chip as Chip$2, Popper as Popper$2, ClickAwayListener, CardContent, Stack as Stack$2, Popover as Popover$2, TextField as TextField$1, Autocomplete, Button as Button$2, Divider, Select as Select$2, MenuItem as MenuItem$2, FormControl as FormControl$2, Menu as Menu$2, ListItemIcon, ListItemText, Modal as Modal$2, Grid, LinearProgress, Backdrop as Backdrop$2, Fade as Fade$2 } from '@mui/material';
|
|
4
4
|
import { withEmotionCache, ThemeContext, CacheProvider, Global, css, keyframes } from '@emotion/react';
|
|
5
|
-
import { initReactI18next, useTranslation } from 'react-i18next';
|
|
5
|
+
import { initReactI18next, I18nextProvider, useTranslation } from 'react-i18next';
|
|
6
6
|
import i18n from 'i18next';
|
|
7
|
-
export { default as i18n } from 'i18next';
|
|
8
7
|
import * as ReactDOM from 'react-dom';
|
|
9
8
|
import ReactDOM__default from 'react-dom';
|
|
10
9
|
|
|
@@ -15448,7 +15447,8 @@ const resources = {
|
|
|
15448
15447
|
en: { translation: en },
|
|
15449
15448
|
es: { translation: es },
|
|
15450
15449
|
};
|
|
15451
|
-
i18n.
|
|
15450
|
+
const i18nInstance = i18n.createInstance();
|
|
15451
|
+
i18nInstance.use(initReactI18next).init({
|
|
15452
15452
|
resources,
|
|
15453
15453
|
lng: 'en',
|
|
15454
15454
|
fallbackLng: 'en',
|
|
@@ -15487,7 +15487,7 @@ const PopupContainer = styled$5(Box$2)(({ theme }) => ({
|
|
|
15487
15487
|
background: '#616161',
|
|
15488
15488
|
},
|
|
15489
15489
|
}));
|
|
15490
|
-
const
|
|
15490
|
+
const ContactInfoPopupContent = ({ open, anchorEl, onClose, contactData, avatarImgUrl, navigate, language = 'en', }) => {
|
|
15491
15491
|
const { t: i18nT, i18n } = useTranslation();
|
|
15492
15492
|
useEffect(() => {
|
|
15493
15493
|
if (language) {
|
|
@@ -15547,6 +15547,9 @@ const ContactInfoPopup = ({ open, anchorEl, onClose, contactData, avatarImgUrl,
|
|
|
15547
15547
|
}, [open, onClose]);
|
|
15548
15548
|
return (jsxRuntimeExports.jsx(Popper$2, { sx: { zIndex: 1300 }, open: open, anchorEl: anchorEl, placement: "bottom-start", "data-popper-child": "true", children: jsxRuntimeExports.jsx(ClickAwayListener, { onClickAway: onClose, children: jsxRuntimeExports.jsx(PopupContainer, { children: jsxRuntimeExports.jsxs(CardContent, { children: [jsxRuntimeExports.jsx(Header$1, { navigate: navigate, contactId: contactData?.id, imgUrl: avatarImgUrl, name: contactData?.name, onClose: onClose, isBusiness: dataIsBusiness }), jsxRuntimeExports.jsx(LabelsSection, { contactData: contactData, title: t('labels') }), dataIsContact && jsxRuntimeExports.jsx(BusinessSection, { contactData: contactData, title: t('business') }), dataIsBusiness && (jsxRuntimeExports.jsx(MembersSection, { contactData: contactData, title: t('businessMembers'), navigate: navigate })), contactMethods.map((method, index) => (jsxRuntimeExports.jsx(ContactMethod$1, { icon: method.icon, title: method.title, contactList: method.contactList, showTitle: method.showTitle }, index))), jsxRuntimeExports.jsx(Properties, { properties: contactData?.properties, title: t('properties') })] }) }) }) }));
|
|
15549
15549
|
};
|
|
15550
|
+
const ContactInfoPopup = (props) => {
|
|
15551
|
+
return (jsxRuntimeExports.jsx(I18nextProvider, { i18n: i18nInstance, children: jsxRuntimeExports.jsx(ContactInfoPopupContent, { ...props }) }));
|
|
15552
|
+
};
|
|
15550
15553
|
|
|
15551
15554
|
var Close = {};
|
|
15552
15555
|
|
|
@@ -58295,7 +58298,7 @@ const BusinessSelectEditor = ({ baseUrl, spaceId, contactId, initialBusiness, on
|
|
|
58295
58298
|
} })] })] }));
|
|
58296
58299
|
};
|
|
58297
58300
|
|
|
58298
|
-
const
|
|
58301
|
+
const EditContactModalContent = ({ open, onClose, baseUrl, spaceId, contactId, sx, language = 'en', navigate, }) => {
|
|
58299
58302
|
const { t: i18nT, i18n } = useTranslation();
|
|
58300
58303
|
const modalContentRef = useRef(null);
|
|
58301
58304
|
useEffect(() => {
|
|
@@ -58389,6 +58392,9 @@ const EditContactModal = ({ open, onClose, baseUrl, spaceId, contactId, sx, lang
|
|
|
58389
58392
|
}
|
|
58390
58393
|
: null, onBack: () => setView('main'), onEntityUpdated: handleEntityUpdated, currentUser: selectors.userTrii }) }) })] }) }) })) : null] }) }) }) }) }) }));
|
|
58391
58394
|
};
|
|
58395
|
+
const EditContactModal = (props) => {
|
|
58396
|
+
return (jsxRuntimeExports.jsx(I18nextProvider, { i18n: i18nInstance, children: jsxRuntimeExports.jsx(EditContactModalContent, { ...props }) }));
|
|
58397
|
+
};
|
|
58392
58398
|
|
|
58393
|
-
export { ContactInfoPopup, EditContactModal };
|
|
58399
|
+
export { ContactInfoPopup, EditContactModal, i18nInstance as i18n };
|
|
58394
58400
|
//# sourceMappingURL=index.js.map
|