@trii/components 2.0.51 → 2.0.53
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 +26 -5
- 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 +27 -7
- 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
package/dist/cjs/index.js
CHANGED
|
@@ -15467,7 +15467,8 @@ const resources = {
|
|
|
15467
15467
|
en: { translation: en },
|
|
15468
15468
|
es: { translation: es },
|
|
15469
15469
|
};
|
|
15470
|
-
i18n.
|
|
15470
|
+
const i18nInstance = i18n.createInstance();
|
|
15471
|
+
i18nInstance.use(reactI18next.initReactI18next).init({
|
|
15471
15472
|
resources,
|
|
15472
15473
|
lng: 'en',
|
|
15473
15474
|
fallbackLng: 'en',
|
|
@@ -15506,7 +15507,7 @@ const PopupContainer = material.styled(material.Box)(({ theme }) => ({
|
|
|
15506
15507
|
background: '#616161',
|
|
15507
15508
|
},
|
|
15508
15509
|
}));
|
|
15509
|
-
const
|
|
15510
|
+
const ContactInfoPopupContent = ({ open, anchorEl, onClose, contactData, avatarImgUrl, navigate, language = 'en', }) => {
|
|
15510
15511
|
const { t: i18nT, i18n } = reactI18next.useTranslation();
|
|
15511
15512
|
React$1.useEffect(() => {
|
|
15512
15513
|
if (language) {
|
|
@@ -15566,6 +15567,9 @@ const ContactInfoPopup = ({ open, anchorEl, onClose, contactData, avatarImgUrl,
|
|
|
15566
15567
|
}, [open, onClose]);
|
|
15567
15568
|
return (jsxRuntimeExports.jsx(material.Popper, { sx: { zIndex: 1300 }, open: open, anchorEl: anchorEl, placement: "bottom-start", "data-popper-child": "true", children: jsxRuntimeExports.jsx(material.ClickAwayListener, { onClickAway: onClose, children: jsxRuntimeExports.jsx(PopupContainer, { children: jsxRuntimeExports.jsxs(material.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') })] }) }) }) }));
|
|
15568
15569
|
};
|
|
15570
|
+
const ContactInfoPopup = (props) => {
|
|
15571
|
+
return (jsxRuntimeExports.jsx(reactI18next.I18nextProvider, { i18n: i18nInstance, children: jsxRuntimeExports.jsx(ContactInfoPopupContent, { ...props }) }));
|
|
15572
|
+
};
|
|
15569
15573
|
|
|
15570
15574
|
var Close = {};
|
|
15571
15575
|
|
|
@@ -25399,7 +25403,7 @@ const SearchLocationEditor = ({ baseUrl, spaceId, entityType, entityId, onBack,
|
|
|
25399
25403
|
}
|
|
25400
25404
|
};
|
|
25401
25405
|
const isDisabled = !canSubmit || isSavingMain || isSavingSecondary;
|
|
25402
|
-
return (jsxRuntimeExports.jsxs(material.Box, { sx: { width: '100%' }, children: [jsxRuntimeExports.jsxs(material.Stack, { direction: "row", alignItems: "center", spacing: 1, sx: { mb:
|
|
25406
|
+
return (jsxRuntimeExports.jsxs(material.Box, { sx: { width: '100%' }, children: [jsxRuntimeExports.jsxs(material.Stack, { direction: "row", alignItems: "center", spacing: 1, sx: { mb: 3 }, children: [jsxRuntimeExports.jsx(material.IconButton, { size: "small", onClick: onBack, "aria-label": t('global.back'), children: jsxRuntimeExports.jsx(default_1$c, { fontSize: "small" }) }), jsxRuntimeExports.jsx(material.Typography, { variant: "h6", children: t('searchLocationModal.searchAddress') })] }), jsxRuntimeExports.jsxs(material.Stack, { spacing: 3, children: [jsxRuntimeExports.jsxs(material.Box, { sx: { position: 'relative', zIndex: 1400 }, children: [jsxRuntimeExports.jsx(SearchLocationInput, { onPlaceSelected: handlePlaceSelected, onError: handleError, placeholder: t('searchLocationModal.enterLocation') }), error ? (jsxRuntimeExports.jsx(material.Typography, { variant: "caption", color: "error", sx: { mt: 0.5, display: 'block' }, children: error })) : null] }), jsxRuntimeExports.jsx(material.TextField, { label: t('conversations.contactDetails.street'), value: draft.street, onChange: handleChange('street'), fullWidth: true, size: "medium" }), jsxRuntimeExports.jsxs(material.Stack, { direction: { xs: 'column', sm: 'row' }, spacing: 2, children: [jsxRuntimeExports.jsx(material.TextField, { label: t('searchLocationModal.city'), value: draft.city, onChange: handleChange('city'), fullWidth: true, size: "medium" }), jsxRuntimeExports.jsx(material.TextField, { label: t('searchLocationModal.state'), value: draft.state, onChange: handleChange('state'), fullWidth: true, size: "medium" })] }), jsxRuntimeExports.jsxs(material.Stack, { direction: { xs: 'column', sm: 'row' }, spacing: 2, children: [jsxRuntimeExports.jsx(material.TextField, { label: t('searchLocationModal.postalCode'), value: draft.zipcode, onChange: handleChange('zipcode'), fullWidth: true, size: "medium" }), jsxRuntimeExports.jsx(material.TextField, { label: t('searchLocationModal.country'), value: draft.country, onChange: handleChange('country'), fullWidth: true, size: "medium" })] }), query ? (jsxRuntimeExports.jsx(material.Typography, { variant: "caption", sx: { opacity: 0.7 }, children: query })) : null, jsxRuntimeExports.jsxs(material.Stack, { direction: "row", spacing: 2, justifyContent: "flex-end", sx: { pt: 2 }, children: [jsxRuntimeExports.jsx(LoadingButton$1, { variant: "contained", size: "large", startIcon: jsxRuntimeExports.jsx(default_1$b, {}), onClick: handleSaveMainAddress, loading: isSavingMain, disabled: isDisabled, children: t('searchLocationModal.saveMainAddress') }), jsxRuntimeExports.jsx(LoadingButton$1, { variant: "outlined", size: "large", startIcon: jsxRuntimeExports.jsx(default_1$b, {}), onClick: handleSaveSecondaryAddress, loading: isSavingSecondary, disabled: isDisabled, children: t('searchLocationModal.saveSecondaryAddress') })] })] })] }));
|
|
25403
25407
|
};
|
|
25404
25408
|
|
|
25405
25409
|
/**
|
|
@@ -27046,6 +27050,9 @@ const Section = ({ title, children, enableDirectionSearch = false, onDirectionSe
|
|
|
27046
27050
|
borderRadius: 2,
|
|
27047
27051
|
p: 2,
|
|
27048
27052
|
mb: 2,
|
|
27053
|
+
display: 'flex',
|
|
27054
|
+
alignItems: 'center',
|
|
27055
|
+
justifyContent: 'space-between',
|
|
27049
27056
|
}, children: [jsxRuntimeExports.jsx(material.Typography, { variant: "subtitle1", children: title }), enableDirectionSearch && (jsxRuntimeExports.jsx(material.Button, { startIcon: jsxRuntimeExports.jsx(default_1$9, { sx: { color: 'primary.main', height: 18, width: 18 } }), size: "small", variant: "outlined", color: "primary", onClick: () => onDirectionSearchClick && onDirectionSearchClick(), children: t('global.searchLocation') })), jsxRuntimeExports.jsx(material.Divider, { sx: { my: 1.5 } }), children] }));
|
|
27050
27057
|
};
|
|
27051
27058
|
|
|
@@ -58314,9 +58321,20 @@ const BusinessSelectEditor = ({ baseUrl, spaceId, contactId, initialBusiness, on
|
|
|
58314
58321
|
} })] })] }));
|
|
58315
58322
|
};
|
|
58316
58323
|
|
|
58317
|
-
const
|
|
58324
|
+
const EditContactModalContent = ({ open, onClose, baseUrl, spaceId, contactId, sx, language = 'en', navigate, }) => {
|
|
58318
58325
|
const { t: i18nT, i18n } = reactI18next.useTranslation();
|
|
58319
58326
|
const modalContentRef = React$1.useRef(null);
|
|
58327
|
+
React$1.useEffect(() => {
|
|
58328
|
+
// Load the google script and append it to the document body
|
|
58329
|
+
const script = document.createElement('script');
|
|
58330
|
+
script.src = 'https://accounts.google.com/gsi/client';
|
|
58331
|
+
script.async = true;
|
|
58332
|
+
script.defer = true;
|
|
58333
|
+
document.body.appendChild(script);
|
|
58334
|
+
return () => {
|
|
58335
|
+
document.body.removeChild(script);
|
|
58336
|
+
};
|
|
58337
|
+
}, []);
|
|
58320
58338
|
React$1.useEffect(() => {
|
|
58321
58339
|
if (language) {
|
|
58322
58340
|
i18n.changeLanguage(language);
|
|
@@ -58408,8 +58426,11 @@ const EditContactModal = ({ open, onClose, baseUrl, spaceId, contactId, sx, lang
|
|
|
58408
58426
|
}
|
|
58409
58427
|
: null, onBack: () => setView('main'), onEntityUpdated: handleEntityUpdated, currentUser: selectors.userTrii }) }) })] }) }) })) : null] }) }) }) }) }) }));
|
|
58410
58428
|
};
|
|
58429
|
+
const EditContactModal = (props) => {
|
|
58430
|
+
return (jsxRuntimeExports.jsx(reactI18next.I18nextProvider, { i18n: i18nInstance, children: jsxRuntimeExports.jsx(EditContactModalContent, { ...props }) }));
|
|
58431
|
+
};
|
|
58411
58432
|
|
|
58412
|
-
exports.i18n = i18n;
|
|
58413
58433
|
exports.ContactInfoPopup = ContactInfoPopup;
|
|
58414
58434
|
exports.EditContactModal = EditContactModal;
|
|
58435
|
+
exports.i18n = i18nInstance;
|
|
58415
58436
|
//# sourceMappingURL=index.js.map
|