cozy-ui-plus 1.1.0
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/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/babel.config.js +24 -0
- package/dist/AppIcon/index.js +265 -0
- package/dist/AppLinker/index.js +159 -0
- package/dist/AppLinker/native.config.js +8 -0
- package/dist/AppLinker/native.js +81 -0
- package/dist/AppSections/Sections.js +461 -0
- package/dist/AppSections/_mockApps.js +210 -0
- package/dist/AppSections/_testApps.js +162 -0
- package/dist/AppSections/categories.js +183 -0
- package/dist/AppSections/components/AppsSection.js +112 -0
- package/dist/AppSections/components/DropdownFilter.js +101 -0
- package/dist/AppSections/constants.js +16 -0
- package/dist/AppSections/generateI18nConfig.js +37 -0
- package/dist/AppSections/helpers.js +28 -0
- package/dist/AppSections/index.js +24 -0
- package/dist/AppSections/search.js +161 -0
- package/dist/AppTile/helpers.js +41 -0
- package/dist/AppTile/index.js +171 -0
- package/dist/CipherIcon/index.js +102 -0
- package/dist/CollectionField/index.js +166 -0
- package/dist/ContactPicker/index.js +129 -0
- package/dist/Contacts/AddModal/ContactAddressDialog/helpers.js +31 -0
- package/dist/Contacts/AddModal/ContactAddressDialog/index.js +106 -0
- package/dist/Contacts/AddModal/ContactAddressDialog/locales/index.js +113 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInput.js +164 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputAccordion.js +91 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputArray.js +105 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputLayout.js +98 -0
- package/dist/Contacts/AddModal/ContactForm/FieldInputWrapper.js +51 -0
- package/dist/Contacts/AddModal/ContactForm/HasValueCondition.js +44 -0
- package/dist/Contacts/AddModal/ContactForm/RelatedContactList.js +55 -0
- package/dist/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.js +104 -0
- package/dist/Contacts/AddModal/ContactForm/TextFieldSelect.js +59 -0
- package/dist/Contacts/AddModal/ContactForm/contactToFormValues.js +119 -0
- package/dist/Contacts/AddModal/ContactForm/fieldsConfig.js +314 -0
- package/dist/Contacts/AddModal/ContactForm/formValuesToContact.js +110 -0
- package/dist/Contacts/AddModal/ContactForm/helpers.js +466 -0
- package/dist/Contacts/AddModal/ContactForm/index.js +184 -0
- package/dist/Contacts/AddModal/ContactForm/locales/index.js +313 -0
- package/dist/Contacts/AddModal/CustomLabelDialog/index.js +138 -0
- package/dist/Contacts/AddModal/CustomLabelDialog/locales/index.js +73 -0
- package/dist/Contacts/AddModal/index.js +134 -0
- package/dist/Contacts/AddModal/locales/index.js +65 -0
- package/dist/Contacts/AddModal/mocks.js +265 -0
- package/dist/Contacts/AddModal/types.js +110 -0
- package/dist/Contacts/GroupsSelect/GroupCreation.js +157 -0
- package/dist/Contacts/GroupsSelect/GroupsSelect.js +207 -0
- package/dist/Contacts/GroupsSelect/GroupsSelectProvider.js +60 -0
- package/dist/Contacts/GroupsSelect/SelectBox/Control.js +54 -0
- package/dist/Contacts/GroupsSelect/SelectBox/EditGroupName.js +89 -0
- package/dist/Contacts/GroupsSelect/SelectBox/Menu.js +49 -0
- package/dist/Contacts/GroupsSelect/SelectBox/Option.js +80 -0
- package/dist/Contacts/GroupsSelect/SelectBox/SelectContainer.js +25 -0
- package/dist/Contacts/GroupsSelect/helpers.js +45 -0
- package/dist/Contacts/GroupsSelect/locales/index.js +97 -0
- package/dist/Contacts/GroupsSelect/useGroupSelect.js +196 -0
- package/dist/Contacts/Header/GroupsSelection.js +101 -0
- package/dist/Contacts/Header/ImportDropdown.js +115 -0
- package/dist/Contacts/Header/SearchInput.js +40 -0
- package/dist/Contacts/Header/index.js +93 -0
- package/dist/Contacts/Header/locales/index.js +73 -0
- package/dist/ContactsList/ContactCell.js +45 -0
- package/dist/ContactsList/ContactRow.js +84 -0
- package/dist/ContactsList/Contacts/ContactCozy.js +44 -0
- package/dist/ContactsList/Contacts/ContactEmail.js +44 -0
- package/dist/ContactsList/Contacts/ContactIdentity.js +86 -0
- package/dist/ContactsList/Contacts/ContactName.js +48 -0
- package/dist/ContactsList/Contacts/ContactPhone.js +44 -0
- package/dist/ContactsList/ContactsList.js +74 -0
- package/dist/ContactsList/helpers.js +156 -0
- package/dist/ContactsList/index.js +13 -0
- package/dist/ContactsList/locales/withContactsListLocales.js +42 -0
- package/dist/ContactsListModal/AddContact/AddContactActions.js +32 -0
- package/dist/ContactsListModal/AddContact/AddContactContent.js +85 -0
- package/dist/ContactsListModal/AddContact/AddContactDialog.js +63 -0
- package/dist/ContactsListModal/AddContact/AddContactTitle.js +21 -0
- package/dist/ContactsListModal/AddContact/helpers.js +61 -0
- package/dist/ContactsListModal/ContactsListContent.js +88 -0
- package/dist/ContactsListModal/ContactsListModal.js +178 -0
- package/dist/ContactsListModal/ContactsListModalWithQuery.js +44 -0
- package/dist/ContactsListModal/EmptyMessage.js +33 -0
- package/dist/ContactsListModal/MobileHeader.js +67 -0
- package/dist/ContactsListModal/index.js +58 -0
- package/dist/ContactsListModal/mockClient.js +2009 -0
- package/dist/ContactsListModal/queries.js +26 -0
- package/dist/ContactsListModal/withContactsListLocales.js +40 -0
- package/dist/Dialogs/AuthenticationDialogs/index.js +139 -0
- package/dist/Field/index.js +297 -0
- package/dist/FileImageLoader/checkImageSource.js +61 -0
- package/dist/FileImageLoader/index.js +394 -0
- package/dist/FilePicker/FilePickerBody.js +108 -0
- package/dist/FilePicker/FilePickerBodyItem.js +132 -0
- package/dist/FilePicker/FilePickerBreadcrumb.js +74 -0
- package/dist/FilePicker/FilePickerFooter.js +91 -0
- package/dist/FilePicker/FilePickerHeader.js +110 -0
- package/dist/FilePicker/docs/DemoProvider.js +280 -0
- package/dist/FilePicker/helpers.js +57 -0
- package/dist/FilePicker/index.js +125 -0
- package/dist/FilePicker/queries.js +61 -0
- package/dist/Intent/IntentDialogOpener/index.js +142 -0
- package/dist/Intent/IntentIframe/index.js +182 -0
- package/dist/ListItem/ExpandedAttributes/ExpandedAttribute.js +64 -0
- package/dist/ListItem/ExpandedAttributes/helpers.js +263 -0
- package/dist/ListItem/ExpandedAttributes/index.js +90 -0
- package/dist/ListItem/ListItemBase/Renaming/RenameDialog.js +52 -0
- package/dist/ListItem/ListItemBase/Renaming/RenameInput.js +319 -0
- package/dist/ListItem/ListItemBase/Renaming/helpers.js +73 -0
- package/dist/ListItem/ListItemBase/index.js +153 -0
- package/dist/ListItem/ListItemByDoc/index.js +109 -0
- package/dist/ListItem/ListItemContact/helpers.js +39 -0
- package/dist/ListItem/ListItemContact/index.js +87 -0
- package/dist/ListItem/ListItemContact/useActions.js +28 -0
- package/dist/ListItem/ListItemFile/ExpirationAnnotation.js +54 -0
- package/dist/ListItem/ListItemFile/ItemIcon.js +61 -0
- package/dist/ListItem/ListItemFile/PrimaryText.js +47 -0
- package/dist/ListItem/ListItemFile/SecondaryText.js +41 -0
- package/dist/ListItem/ListItemFile/index.js +96 -0
- package/dist/ListItem/hoc/withListItemLocales.js +322 -0
- package/dist/Paywall/MaxAccountsByKonnectorPaywall.js +48 -0
- package/dist/Paywall/MaxAccountsPaywall.js +43 -0
- package/dist/Paywall/MaxDaysToCapturePaywall.js +43 -0
- package/dist/Paywall/MaxPapersPaywall.js +44 -0
- package/dist/Paywall/OnlyOfficePaywall.js +41 -0
- package/dist/Paywall/PasswordSharingPaywall.js +34 -0
- package/dist/Paywall/Paywall.js +205 -0
- package/dist/Paywall/QuotaPaywall.js +32 -0
- package/dist/Paywall/helpers.js +31 -0
- package/dist/Paywall/index.js +63 -0
- package/dist/Paywall/locales/withPaywallLocales.js +401 -0
- package/dist/Qualification/QualificationGrid/helpers.js +16 -0
- package/dist/Qualification/QualificationGrid/index.js +136 -0
- package/dist/Qualification/QualificationGrid/locales/withLocales.js +82 -0
- package/dist/Qualification/QualificationIcon/index.js +156 -0
- package/dist/Qualification/QualificationItem/index.js +87 -0
- package/dist/Qualification/QualificationModal/helpers.js +95 -0
- package/dist/Qualification/QualificationModal/index.js +121 -0
- package/dist/Qualification/QualificationModal/locales/index.js +37 -0
- package/dist/ShortcutTile/index.js +68 -0
- package/dist/SquareAppIcon/index.js +262 -0
- package/dist/Storage/StorageButton.js +54 -0
- package/dist/Storage/StorageProgress.js +68 -0
- package/dist/Storage/index.js +49 -0
- package/dist/Storage/locales/index.js +41 -0
- package/dist/UploadQueue/FileUploadProgress.js +86 -0
- package/dist/UploadQueue/Item.js +132 -0
- package/dist/UploadQueue/Pending.js +23 -0
- package/dist/UploadQueue/RemainingTime.js +59 -0
- package/dist/UploadQueue/helpers.js +13 -0
- package/dist/UploadQueue/index.js +277 -0
- package/dist/UploadQueue/useStatusIcon.js +60 -0
- package/dist/hooks/useClientErrors.js +185 -0
- package/dist/proptypes.js +33 -0
- package/dist/providers/CozyTheme/CozyThemeWithQuery.js +41 -0
- package/dist/providers/CozyTheme/index.js +58 -0
- package/dist/providers/CozyTheme/queries.js +25 -0
- package/dist/providers/DemoProvider.js +49 -0
- package/dist/providers/Intent/index.js +130 -0
- package/dist/src/AppIcon/index.d.ts +50 -0
- package/dist/src/AppIcon/index.spec.d.ts +1 -0
- package/dist/src/AppLinker/index.d.ts +35 -0
- package/dist/src/AppLinker/index.spec.d.ts +1 -0
- package/dist/src/AppLinker/native.config.d.ts +1 -0
- package/dist/src/AppLinker/native.d.ts +6 -0
- package/dist/src/AppLinker/native.spec.d.ts +1 -0
- package/dist/src/AppSections/Sections.d.ts +49 -0
- package/dist/src/AppSections/_mockApps.d.ts +242 -0
- package/dist/src/AppSections/_testApps.d.ts +203 -0
- package/dist/src/AppSections/categories.d.ts +7 -0
- package/dist/src/AppSections/categories.spec.d.ts +1 -0
- package/dist/src/AppSections/components/AppsSection.d.ts +20 -0
- package/dist/src/AppSections/components/AppsSection.spec.d.ts +1 -0
- package/dist/src/AppSections/components/DropdownFilter.d.ts +17 -0
- package/dist/src/AppSections/constants.d.ts +8 -0
- package/dist/src/AppSections/generateI18nConfig.d.ts +4 -0
- package/dist/src/AppSections/helpers.d.ts +2 -0
- package/dist/src/AppSections/helpers.spec.d.ts +1 -0
- package/dist/src/AppSections/index.d.ts +3 -0
- package/dist/src/AppSections/index.spec.d.ts +1 -0
- package/dist/src/AppSections/search.d.ts +3 -0
- package/dist/src/AppSections/search.spec.d.ts +1 -0
- package/dist/src/AppTile/AppTile.spec.d.ts +1 -0
- package/dist/src/AppTile/helpers.d.ts +9 -0
- package/dist/src/AppTile/index.d.ts +33 -0
- package/dist/src/CipherIcon/index.d.ts +2 -0
- package/dist/src/CipherIcon/index.spec.d.ts +1 -0
- package/dist/src/CollectionField/index.d.ts +23 -0
- package/dist/src/ContactPicker/index.d.ts +21 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/helpers.d.ts +4 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/helpers.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/index.d.ts +39 -0
- package/dist/src/Contacts/AddModal/ContactAddressDialog/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInput.d.ts +39 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputAccordion.d.ts +12 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputArray.d.ts +14 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputLayout.d.ts +22 -0
- package/dist/src/Contacts/AddModal/ContactForm/FieldInputWrapper.d.ts +19 -0
- package/dist/src/Contacts/AddModal/ContactForm/HasValueCondition.d.ts +18 -0
- package/dist/src/Contacts/AddModal/ContactForm/HasValueCondition.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/RelatedContactList.d.ts +15 -0
- package/dist/src/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.d.ts +9 -0
- package/dist/src/Contacts/AddModal/ContactForm/TextFieldSelect.d.ts +5 -0
- package/dist/src/Contacts/AddModal/ContactForm/contactToFormValues.d.ts +6 -0
- package/dist/src/Contacts/AddModal/ContactForm/contactToFormValues.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/fieldsConfig.d.ts +4 -0
- package/dist/src/Contacts/AddModal/ContactForm/formValuesToContact.d.ts +7 -0
- package/dist/src/Contacts/AddModal/ContactForm/formValuesToContact.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/helpers.d.ts +35 -0
- package/dist/src/Contacts/AddModal/ContactForm/helpers.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/index.d.ts +17 -0
- package/dist/src/Contacts/AddModal/ContactForm/index.spec.d.ts +1 -0
- package/dist/src/Contacts/AddModal/ContactForm/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/CustomLabelDialog/index.d.ts +22 -0
- package/dist/src/Contacts/AddModal/CustomLabelDialog/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/index.d.ts +8 -0
- package/dist/src/Contacts/AddModal/locales/index.d.ts +10 -0
- package/dist/src/Contacts/AddModal/mocks.d.ts +276 -0
- package/dist/src/Contacts/AddModal/types.d.ts +188 -0
- package/dist/src/Contacts/GroupsSelect/GroupCreation.d.ts +3 -0
- package/dist/src/Contacts/GroupsSelect/GroupsSelect.d.ts +56 -0
- package/dist/src/Contacts/GroupsSelect/GroupsSelect.spec.d.ts +22 -0
- package/dist/src/Contacts/GroupsSelect/GroupsSelectProvider.d.ts +5 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/Control.d.ts +14 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/EditGroupName.d.ts +7 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/Menu.d.ts +7 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/Option.d.ts +18 -0
- package/dist/src/Contacts/GroupsSelect/SelectBox/SelectContainer.d.ts +2 -0
- package/dist/src/Contacts/GroupsSelect/helpers.d.ts +9 -0
- package/dist/src/Contacts/GroupsSelect/locales/index.d.ts +10 -0
- package/dist/src/Contacts/GroupsSelect/useGroupSelect.d.ts +11 -0
- package/dist/src/Contacts/Header/GroupsSelection.d.ts +7 -0
- package/dist/src/Contacts/Header/ImportDropdown.d.ts +4 -0
- package/dist/src/Contacts/Header/SearchInput.d.ts +4 -0
- package/dist/src/Contacts/Header/index.d.ts +26 -0
- package/dist/src/Contacts/Header/locales/index.d.ts +10 -0
- package/dist/src/ContactsList/ContactCell.d.ts +8 -0
- package/dist/src/ContactsList/ContactRow.d.ts +16 -0
- package/dist/src/ContactsList/ContactRow.spec.d.ts +1 -0
- package/dist/src/ContactsList/Contacts/ContactCozy.d.ts +14 -0
- package/dist/src/ContactsList/Contacts/ContactEmail.d.ts +14 -0
- package/dist/src/ContactsList/Contacts/ContactIdentity.d.ts +10 -0
- package/dist/src/ContactsList/Contacts/ContactName.d.ts +10 -0
- package/dist/src/ContactsList/Contacts/ContactPhone.d.ts +14 -0
- package/dist/src/ContactsList/ContactsList.d.ts +2 -0
- package/dist/src/ContactsList/helpers.d.ts +9 -0
- package/dist/src/ContactsList/helpers.spec.d.ts +1 -0
- package/dist/src/ContactsList/index.d.ts +2 -0
- package/dist/src/ContactsList/locales/withContactsListLocales.d.ts +12 -0
- package/dist/src/ContactsListModal/AddContact/AddContactActions.d.ts +2 -0
- package/dist/src/ContactsListModal/AddContact/AddContactContent.d.ts +2 -0
- package/dist/src/ContactsListModal/AddContact/AddContactDialog.d.ts +6 -0
- package/dist/src/ContactsListModal/AddContact/AddContactTitle.d.ts +2 -0
- package/dist/src/ContactsListModal/AddContact/helpers.d.ts +6 -0
- package/dist/src/ContactsListModal/AddContact/helpers.spec.d.ts +1 -0
- package/dist/src/ContactsListModal/ContactsListContent.d.ts +2 -0
- package/dist/src/ContactsListModal/ContactsListModal.d.ts +20 -0
- package/dist/src/ContactsListModal/ContactsListModalWithQuery.d.ts +12 -0
- package/dist/src/ContactsListModal/EmptyMessage.d.ts +2 -0
- package/dist/src/ContactsListModal/MobileHeader.d.ts +16 -0
- package/dist/src/ContactsListModal/index.d.ts +2 -0
- package/dist/src/ContactsListModal/mockClient.d.ts +3 -0
- package/dist/src/ContactsListModal/queries.d.ts +7 -0
- package/dist/src/ContactsListModal/withContactsListLocales.d.ts +7 -0
- package/dist/src/Dialogs/AuthenticationDialogs/index.d.ts +2 -0
- package/dist/src/Field/index.d.ts +53 -0
- package/dist/src/Field/index.spec.d.ts +1 -0
- package/dist/src/FileImageLoader/checkImageSource.d.ts +1 -0
- package/dist/src/FileImageLoader/index.d.ts +45 -0
- package/dist/src/FileImageLoader/index.spec.d.ts +1 -0
- package/dist/src/FilePicker/FilePickerBody.d.ts +19 -0
- package/dist/src/FilePicker/FilePickerBodyItem.d.ts +22 -0
- package/dist/src/FilePicker/FilePickerBodyItem.spec.d.ts +1 -0
- package/dist/src/FilePicker/FilePickerBreadcrumb.d.ts +13 -0
- package/dist/src/FilePicker/FilePickerFooter.d.ts +15 -0
- package/dist/src/FilePicker/FilePickerFooter.spec.d.ts +1 -0
- package/dist/src/FilePicker/FilePickerHeader.d.ts +14 -0
- package/dist/src/FilePicker/docs/DemoProvider.d.ts +23 -0
- package/dist/src/FilePicker/helpers.d.ts +3 -0
- package/dist/src/FilePicker/helpers.spec.d.ts +1 -0
- package/dist/src/FilePicker/index.d.ts +22 -0
- package/dist/src/FilePicker/queries.d.ts +14 -0
- package/dist/src/Intent/IntentDialogOpener/index.d.ts +32 -0
- package/dist/src/Intent/IntentIframe/index.d.ts +8 -0
- package/dist/src/ListItem/ExpandedAttributes/ExpandedAttribute.d.ts +14 -0
- package/dist/src/ListItem/ExpandedAttributes/helpers.d.ts +43 -0
- package/dist/src/ListItem/ExpandedAttributes/helpers.spec.d.ts +1 -0
- package/dist/src/ListItem/ExpandedAttributes/index.d.ts +2 -0
- package/dist/src/ListItem/ListItemBase/Renaming/RenameDialog.d.ts +2 -0
- package/dist/src/ListItem/ListItemBase/Renaming/RenameInput.d.ts +12 -0
- package/dist/src/ListItem/ListItemBase/Renaming/helpers.d.ts +1 -0
- package/dist/src/ListItem/ListItemBase/index.d.ts +2 -0
- package/dist/src/ListItem/ListItemByDoc/index.d.ts +46 -0
- package/dist/src/ListItem/ListItemContact/helpers.d.ts +1 -0
- package/dist/src/ListItem/ListItemContact/helpers.spec.d.ts +1 -0
- package/dist/src/ListItem/ListItemContact/index.d.ts +35 -0
- package/dist/src/ListItem/ListItemContact/useActions.d.ts +2 -0
- package/dist/src/ListItem/ListItemFile/ExpirationAnnotation.d.ts +2 -0
- package/dist/src/ListItem/ListItemFile/ItemIcon.d.ts +12 -0
- package/dist/src/ListItem/ListItemFile/PrimaryText.d.ts +12 -0
- package/dist/src/ListItem/ListItemFile/SecondaryText.d.ts +12 -0
- package/dist/src/ListItem/ListItemFile/index.d.ts +37 -0
- package/dist/src/ListItem/hoc/withListItemLocales.d.ts +12 -0
- package/dist/src/Paywall/MaxAccountsByKonnectorPaywall.d.ts +2 -0
- package/dist/src/Paywall/MaxAccountsPaywall.d.ts +2 -0
- package/dist/src/Paywall/MaxDaysToCapturePaywall.d.ts +2 -0
- package/dist/src/Paywall/MaxPapersPaywall.d.ts +2 -0
- package/dist/src/Paywall/OnlyOfficePaywall.d.ts +16 -0
- package/dist/src/Paywall/PasswordSharingPaywall.d.ts +10 -0
- package/dist/src/Paywall/Paywall.d.ts +2 -0
- package/dist/src/Paywall/Paywall.spec.d.ts +1 -0
- package/dist/src/Paywall/QuotaPaywall.d.ts +13 -0
- package/dist/src/Paywall/helpers.d.ts +1 -0
- package/dist/src/Paywall/index.d.ts +7 -0
- package/dist/src/Paywall/locales/withPaywallLocales.d.ts +2 -0
- package/dist/src/Qualification/QualificationGrid/helpers.d.ts +1 -0
- package/dist/src/Qualification/QualificationGrid/index.d.ts +2 -0
- package/dist/src/Qualification/QualificationGrid/locales/withLocales.d.ts +12 -0
- package/dist/src/Qualification/QualificationIcon/index.d.ts +13 -0
- package/dist/src/Qualification/QualificationItem/index.d.ts +17 -0
- package/dist/src/Qualification/QualificationModal/helpers.d.ts +14 -0
- package/dist/src/Qualification/QualificationModal/helpers.spec.d.ts +1 -0
- package/dist/src/Qualification/QualificationModal/index.d.ts +16 -0
- package/dist/src/Qualification/QualificationModal/locales/index.d.ts +10 -0
- package/dist/src/ShortcutTile/index.d.ts +13 -0
- package/dist/src/SquareAppIcon/SquareAppIcon.spec.d.ts +1 -0
- package/dist/src/SquareAppIcon/index.d.ts +26 -0
- package/dist/src/Storage/StorageButton.d.ts +4 -0
- package/dist/src/Storage/StorageProgress.d.ts +5 -0
- package/dist/src/Storage/index.d.ts +14 -0
- package/dist/src/Storage/locales/index.d.ts +10 -0
- package/dist/src/UploadQueue/FileUploadProgress.d.ts +4 -0
- package/dist/src/UploadQueue/Item.d.ts +3 -0
- package/dist/src/UploadQueue/Pending.d.ts +3 -0
- package/dist/src/UploadQueue/RemainingTime.d.ts +4 -0
- package/dist/src/UploadQueue/helpers.d.ts +1 -0
- package/dist/src/UploadQueue/index.d.ts +42 -0
- package/dist/src/UploadQueue/index.spec.d.ts +1 -0
- package/dist/src/UploadQueue/useStatusIcon.d.ts +1 -0
- package/dist/src/hooks/useClientErrors.d.ts +29 -0
- package/dist/src/hooks/useClientErrors.spec.d.ts +1 -0
- package/dist/src/proptypes.d.ts +18 -0
- package/dist/src/providers/CozyTheme/CozyThemeWithQuery.d.ts +2 -0
- package/dist/src/providers/CozyTheme/index.d.ts +24 -0
- package/dist/src/providers/CozyTheme/queries.d.ts +8 -0
- package/dist/src/providers/DemoProvider.d.ts +6 -0
- package/dist/src/providers/Intent/index.d.ts +9 -0
- package/dist/stylesheet.css +898 -0
- package/dist/test/I18n.d.ts +6 -0
- package/dist/types.d.js +1 -0
- package/jest.config.js +20 -0
- package/package.json +76 -0
- package/preprocess.js +16 -0
- package/src/AppIcon/Readme.md +96 -0
- package/src/AppIcon/index.jsx +168 -0
- package/src/AppIcon/index.spec.js +145 -0
- package/src/AppIcon/styles.styl +37 -0
- package/src/AppLinker/Readme.md +32 -0
- package/src/AppLinker/__snapshots__/index.spec.jsx.snap +13 -0
- package/src/AppLinker/index.jsx +107 -0
- package/src/AppLinker/index.spec.jsx +60 -0
- package/src/AppLinker/native.config.js +1 -0
- package/src/AppLinker/native.js +57 -0
- package/src/AppLinker/native.spec.js +120 -0
- package/src/AppSections/Readme.md +35 -0
- package/src/AppSections/Sections.jsx +285 -0
- package/src/AppSections/Sections.styl +4 -0
- package/src/AppSections/__snapshots__/search.spec.js.snap +972 -0
- package/src/AppSections/_mockApps.js +197 -0
- package/src/AppSections/_testApps.js +151 -0
- package/src/AppSections/categories.js +138 -0
- package/src/AppSections/categories.spec.js +289 -0
- package/src/AppSections/components/AppsSection.jsx +82 -0
- package/src/AppSections/components/AppsSection.spec.jsx +50 -0
- package/src/AppSections/components/AppsSection.styl +7 -0
- package/src/AppSections/components/DropdownFilter.jsx +50 -0
- package/src/AppSections/components/DropdownFilter.styl +14 -0
- package/src/AppSections/constants.js +9 -0
- package/src/AppSections/generateI18nConfig.ts +23 -0
- package/src/AppSections/helpers.js +16 -0
- package/src/AppSections/helpers.spec.js +40 -0
- package/src/AppSections/index.jsx +3 -0
- package/src/AppSections/index.spec.jsx +137 -0
- package/src/AppSections/locales/en.json +37 -0
- package/src/AppSections/locales/fr.json +37 -0
- package/src/AppSections/locales/ru.json +37 -0
- package/src/AppSections/locales/vi.json +37 -0
- package/src/AppSections/search.js +104 -0
- package/src/AppSections/search.spec.js +158 -0
- package/src/AppTile/AppTile.spec.jsx +117 -0
- package/src/AppTile/Readme.md +24 -0
- package/src/AppTile/helpers.js +25 -0
- package/src/AppTile/index.jsx +139 -0
- package/src/AppTile/locales/en.json +9 -0
- package/src/AppTile/locales/fr.json +9 -0
- package/src/AppTile/locales/ru.json +9 -0
- package/src/AppTile/locales/vi.json +9 -0
- package/src/AppTile/styles.styl +27 -0
- package/src/CipherIcon/Readme.md +14 -0
- package/src/CipherIcon/index.jsx +46 -0
- package/src/CipherIcon/index.spec.jsx +53 -0
- package/src/CollectionField/Readme.md +41 -0
- package/src/CollectionField/index.jsx +141 -0
- package/src/CollectionField/styles.styl +15 -0
- package/src/ContactPicker/Readme.md +26 -0
- package/src/ContactPicker/index.jsx +86 -0
- package/src/ContactPicker/styles.styl +5 -0
- package/src/Contacts/AddModal/ContactAddressDialog/helpers.js +22 -0
- package/src/Contacts/AddModal/ContactAddressDialog/helpers.spec.js +64 -0
- package/src/Contacts/AddModal/ContactAddressDialog/index.jsx +85 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/en.json +25 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/fr.json +25 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/ru.json +25 -0
- package/src/Contacts/AddModal/ContactAddressDialog/locales/vi.json +25 -0
- package/src/Contacts/AddModal/ContactForm/FieldInput.jsx +124 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputAccordion.jsx +58 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputArray.jsx +81 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputLayout.jsx +77 -0
- package/src/Contacts/AddModal/ContactForm/FieldInputWrapper.jsx +44 -0
- package/src/Contacts/AddModal/ContactForm/HasValueCondition.jsx +31 -0
- package/src/Contacts/AddModal/ContactForm/HasValueCondition.spec.jsx +79 -0
- package/src/Contacts/AddModal/ContactForm/RelatedContactList.jsx +37 -0
- package/src/Contacts/AddModal/ContactForm/TextFieldCustomLabelSelect.jsx +79 -0
- package/src/Contacts/AddModal/ContactForm/TextFieldSelect.jsx +40 -0
- package/src/Contacts/AddModal/ContactForm/__snapshots__/HasValueCondition.spec.jsx.snap +33 -0
- package/src/Contacts/AddModal/ContactForm/contactToFormValues.js +109 -0
- package/src/Contacts/AddModal/ContactForm/contactToFormValues.spec.js +133 -0
- package/src/Contacts/AddModal/ContactForm/fieldsConfig.jsx +357 -0
- package/src/Contacts/AddModal/ContactForm/formValuesToContact.js +111 -0
- package/src/Contacts/AddModal/ContactForm/formValuesToContact.spec.js +557 -0
- package/src/Contacts/AddModal/ContactForm/helpers.js +393 -0
- package/src/Contacts/AddModal/ContactForm/helpers.spec.js +391 -0
- package/src/Contacts/AddModal/ContactForm/index.jsx +138 -0
- package/src/Contacts/AddModal/ContactForm/index.spec.jsx +301 -0
- package/src/Contacts/AddModal/ContactForm/locales/en.json +75 -0
- package/src/Contacts/AddModal/ContactForm/locales/fr.json +75 -0
- package/src/Contacts/AddModal/ContactForm/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/ContactForm/locales/ru.json +75 -0
- package/src/Contacts/AddModal/ContactForm/locales/vi.json +75 -0
- package/src/Contacts/AddModal/ContactForm/styles.styl +2 -0
- package/src/Contacts/AddModal/CustomLabelDialog/index.jsx +109 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/en.json +15 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/fr.json +15 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/ru.json +15 -0
- package/src/Contacts/AddModal/CustomLabelDialog/locales/vi.json +15 -0
- package/src/Contacts/AddModal/Readme.md +55 -0
- package/src/Contacts/AddModal/index.jsx +86 -0
- package/src/Contacts/AddModal/locales/en.json +13 -0
- package/src/Contacts/AddModal/locales/fr.json +13 -0
- package/src/Contacts/AddModal/locales/index.jsx +11 -0
- package/src/Contacts/AddModal/locales/ru.json +13 -0
- package/src/Contacts/AddModal/locales/vi.json +13 -0
- package/src/Contacts/AddModal/mocks.js +299 -0
- package/src/Contacts/AddModal/types.js +102 -0
- package/src/Contacts/GroupsSelect/GroupCreation.jsx +96 -0
- package/src/Contacts/GroupsSelect/GroupsSelect.jsx +159 -0
- package/src/Contacts/GroupsSelect/GroupsSelect.spec.jsx +249 -0
- package/src/Contacts/GroupsSelect/GroupsSelectProvider.jsx +40 -0
- package/src/Contacts/GroupsSelect/Readme.md +1 -0
- package/src/Contacts/GroupsSelect/SelectBox/Control.jsx +37 -0
- package/src/Contacts/GroupsSelect/SelectBox/EditGroupName.jsx +52 -0
- package/src/Contacts/GroupsSelect/SelectBox/Menu.jsx +27 -0
- package/src/Contacts/GroupsSelect/SelectBox/Option.jsx +71 -0
- package/src/Contacts/GroupsSelect/SelectBox/SelectContainer.jsx +15 -0
- package/src/Contacts/GroupsSelect/SelectBox/styles.styl +2 -0
- package/src/Contacts/GroupsSelect/helpers.js +25 -0
- package/src/Contacts/GroupsSelect/locales/en.json +21 -0
- package/src/Contacts/GroupsSelect/locales/fr.json +21 -0
- package/src/Contacts/GroupsSelect/locales/index.jsx +11 -0
- package/src/Contacts/GroupsSelect/locales/ru.json +21 -0
- package/src/Contacts/GroupsSelect/locales/vi.json +21 -0
- package/src/Contacts/GroupsSelect/styles.styl +48 -0
- package/src/Contacts/GroupsSelect/useGroupSelect.jsx +89 -0
- package/src/Contacts/Header/GroupsSelection.jsx +75 -0
- package/src/Contacts/Header/ImportDropdown.jsx +80 -0
- package/src/Contacts/Header/Readme.md +38 -0
- package/src/Contacts/Header/SearchInput.jsx +19 -0
- package/src/Contacts/Header/index.jsx +80 -0
- package/src/Contacts/Header/locales/en.json +15 -0
- package/src/Contacts/Header/locales/fr.json +15 -0
- package/src/Contacts/Header/locales/index.jsx +11 -0
- package/src/Contacts/Header/locales/ru.json +15 -0
- package/src/Contacts/Header/locales/vi.json +15 -0
- package/src/Contacts/Readme.md +1 -0
- package/src/ContactsList/ContactCell.jsx +23 -0
- package/src/ContactsList/ContactRow.jsx +46 -0
- package/src/ContactsList/ContactRow.spec.js +75 -0
- package/src/ContactsList/Contacts/ContactCozy.jsx +23 -0
- package/src/ContactsList/Contacts/ContactEmail.jsx +23 -0
- package/src/ContactsList/Contacts/ContactIdentity.jsx +57 -0
- package/src/ContactsList/Contacts/ContactName.jsx +43 -0
- package/src/ContactsList/Contacts/ContactPhone.jsx +24 -0
- package/src/ContactsList/ContactsList.jsx +52 -0
- package/src/ContactsList/Readme.md +47 -0
- package/src/ContactsList/_mockContacts.json +2494 -0
- package/src/ContactsList/helpers.js +132 -0
- package/src/ContactsList/helpers.spec.js +150 -0
- package/src/ContactsList/index.js +3 -0
- package/src/ContactsList/locales/en.json +5 -0
- package/src/ContactsList/locales/fr.json +5 -0
- package/src/ContactsList/locales/ru.json +5 -0
- package/src/ContactsList/locales/vi.json +5 -0
- package/src/ContactsList/locales/withContactsListLocales.jsx +15 -0
- package/src/ContactsList/styles.styl +35 -0
- package/src/ContactsListModal/AddContact/AddContactActions.jsx +16 -0
- package/src/ContactsListModal/AddContact/AddContactContent.jsx +60 -0
- package/src/ContactsListModal/AddContact/AddContactDialog.jsx +38 -0
- package/src/ContactsListModal/AddContact/AddContactTitle.jsx +9 -0
- package/src/ContactsListModal/AddContact/helpers.js +18 -0
- package/src/ContactsListModal/AddContact/helpers.spec.js +74 -0
- package/src/ContactsListModal/AddContact/styles.styl +2 -0
- package/src/ContactsListModal/ContactsListContent.jsx +74 -0
- package/src/ContactsListModal/ContactsListModal.jsx +143 -0
- package/src/ContactsListModal/ContactsListModalWithQuery.jsx +27 -0
- package/src/ContactsListModal/EmptyMessage.jsx +18 -0
- package/src/ContactsListModal/MobileHeader.jsx +50 -0
- package/src/ContactsListModal/Readme.md +45 -0
- package/src/ContactsListModal/index.jsx +28 -0
- package/src/ContactsListModal/locales/en.json +11 -0
- package/src/ContactsListModal/locales/fr.json +11 -0
- package/src/ContactsListModal/locales/ru.json +11 -0
- package/src/ContactsListModal/locales/vi.json +11 -0
- package/src/ContactsListModal/mockClient.jsx +47 -0
- package/src/ContactsListModal/queries.js +12 -0
- package/src/ContactsListModal/styles.styl +12 -0
- package/src/ContactsListModal/withContactsListLocales.jsx +11 -0
- package/src/Dialogs/AuthenticationDialogs/index.jsx +115 -0
- package/src/Field/Readme.md +357 -0
- package/src/Field/index.jsx +317 -0
- package/src/Field/index.spec.js +59 -0
- package/src/Field/styles.styl +41 -0
- package/src/FileImageLoader/Readme.md +112 -0
- package/src/FileImageLoader/checkImageSource.js +29 -0
- package/src/FileImageLoader/index.jsx +186 -0
- package/src/FileImageLoader/index.spec.jsx +176 -0
- package/src/FilePicker/FilePickerBody.jsx +111 -0
- package/src/FilePicker/FilePickerBodyItem.jsx +126 -0
- package/src/FilePicker/FilePickerBodyItem.spec.jsx +164 -0
- package/src/FilePicker/FilePickerBreadcrumb.jsx +55 -0
- package/src/FilePicker/FilePickerFooter.jsx +42 -0
- package/src/FilePicker/FilePickerFooter.spec.jsx +41 -0
- package/src/FilePicker/FilePickerHeader.jsx +89 -0
- package/src/FilePicker/Readme.md +50 -0
- package/src/FilePicker/docs/DemoProvider.jsx +273 -0
- package/src/FilePicker/helpers.js +46 -0
- package/src/FilePicker/helpers.spec.js +84 -0
- package/src/FilePicker/index.jsx +94 -0
- package/src/FilePicker/locales/en.json +8 -0
- package/src/FilePicker/locales/fr.json +8 -0
- package/src/FilePicker/locales/ru.json +8 -0
- package/src/FilePicker/locales/vi.json +8 -0
- package/src/FilePicker/queries.js +37 -0
- package/src/FilePicker/styles.styl +18 -0
- package/src/Intent/IntentDialogOpener/Readme.md +25 -0
- package/src/Intent/IntentDialogOpener/index.jsx +110 -0
- package/src/Intent/IntentIframe/Readme.md +80 -0
- package/src/Intent/IntentIframe/index.jsx +112 -0
- package/src/Intent/IntentIframe/styles.styl +21 -0
- package/src/ListItem/ExpandedAttributes/ExpandedAttribute.jsx +40 -0
- package/src/ListItem/ExpandedAttributes/helpers.js +214 -0
- package/src/ListItem/ExpandedAttributes/helpers.spec.js +175 -0
- package/src/ListItem/ExpandedAttributes/index.jsx +62 -0
- package/src/ListItem/ListItemBase/Renaming/RenameDialog.jsx +38 -0
- package/src/ListItem/ListItemBase/Renaming/RenameInput.jsx +134 -0
- package/src/ListItem/ListItemBase/Renaming/helpers.js +35 -0
- package/src/ListItem/ListItemBase/index.jsx +116 -0
- package/src/ListItem/ListItemByDoc/index.jsx +103 -0
- package/src/ListItem/ListItemContact/helpers.js +28 -0
- package/src/ListItem/ListItemContact/helpers.spec.js +41 -0
- package/src/ListItem/ListItemContact/index.jsx +68 -0
- package/src/ListItem/ListItemContact/useActions.jsx +22 -0
- package/src/ListItem/ListItemFile/ExpirationAnnotation.jsx +39 -0
- package/src/ListItem/ListItemFile/ItemIcon.jsx +49 -0
- package/src/ListItem/ListItemFile/PrimaryText.jsx +38 -0
- package/src/ListItem/ListItemFile/SecondaryText.jsx +36 -0
- package/src/ListItem/ListItemFile/index.jsx +75 -0
- package/src/ListItem/Readme.md +211 -0
- package/src/ListItem/hoc/withListItemLocales.jsx +15 -0
- package/src/ListItem/locales/en.json +75 -0
- package/src/ListItem/locales/fr.json +75 -0
- package/src/ListItem/locales/ru.json +75 -0
- package/src/ListItem/locales/vi.json +75 -0
- package/src/Paywall/MaxAccountsByKonnectorPaywall.jsx +32 -0
- package/src/Paywall/MaxAccountsPaywall.jsx +27 -0
- package/src/Paywall/MaxDaysToCapturePaywall.jsx +27 -0
- package/src/Paywall/MaxPapersPaywall.jsx +29 -0
- package/src/Paywall/OnlyOfficePaywall.jsx +24 -0
- package/src/Paywall/PasswordSharingPaywall.jsx +20 -0
- package/src/Paywall/Paywall.jsx +130 -0
- package/src/Paywall/Paywall.spec.jsx +228 -0
- package/src/Paywall/QuotaPaywall.jsx +18 -0
- package/src/Paywall/Readme.md +139 -0
- package/src/Paywall/helpers.js +22 -0
- package/src/Paywall/howto.md +28 -0
- package/src/Paywall/index.jsx +7 -0
- package/src/Paywall/locales/en.json +95 -0
- package/src/Paywall/locales/fr.json +95 -0
- package/src/Paywall/locales/ru.json +95 -0
- package/src/Paywall/locales/vi.json +95 -0
- package/src/Paywall/locales/withPaywallLocales.jsx +15 -0
- package/src/Qualification/QualificationGrid/Readme.md +26 -0
- package/src/Qualification/QualificationGrid/helpers.js +4 -0
- package/src/Qualification/QualificationGrid/index.jsx +91 -0
- package/src/Qualification/QualificationGrid/locales/en.json +15 -0
- package/src/Qualification/QualificationGrid/locales/fr.json +15 -0
- package/src/Qualification/QualificationGrid/locales/ru.json +15 -0
- package/src/Qualification/QualificationGrid/locales/vi.json +15 -0
- package/src/Qualification/QualificationGrid/locales/withLocales.jsx +15 -0
- package/src/Qualification/QualificationIcon/Readme.md +14 -0
- package/src/Qualification/QualificationIcon/index.jsx +104 -0
- package/src/Qualification/QualificationItem/Readme.md +8 -0
- package/src/Qualification/QualificationItem/index.jsx +64 -0
- package/src/Qualification/QualificationModal/Readme.md +28 -0
- package/src/Qualification/QualificationModal/helpers.js +63 -0
- package/src/Qualification/QualificationModal/helpers.spec.js +61 -0
- package/src/Qualification/QualificationModal/index.jsx +71 -0
- package/src/Qualification/QualificationModal/locales/en.json +6 -0
- package/src/Qualification/QualificationModal/locales/fr.json +6 -0
- package/src/Qualification/QualificationModal/locales/index.jsx +11 -0
- package/src/Qualification/QualificationModal/locales/ru.json +6 -0
- package/src/Qualification/QualificationModal/locales/vi.json +6 -0
- package/src/ShortcutTile/index.tsx +60 -0
- package/src/SquareAppIcon/Readme.md +185 -0
- package/src/SquareAppIcon/SquareAppIcon.spec.js +86 -0
- package/src/SquareAppIcon/__snapshots__/SquareAppIcon.spec.js.snap +474 -0
- package/src/SquareAppIcon/constants.json +6 -0
- package/src/SquareAppIcon/index.jsx +289 -0
- package/src/SquareAppIcon/styles.styl +141 -0
- package/src/Storage/Readme.md +45 -0
- package/src/Storage/StorageButton.jsx +34 -0
- package/src/Storage/StorageProgress.jsx +52 -0
- package/src/Storage/index.jsx +41 -0
- package/src/Storage/locales/en.json +7 -0
- package/src/Storage/locales/fr.json +7 -0
- package/src/Storage/locales/index.jsx +11 -0
- package/src/Storage/locales/ru.json +7 -0
- package/src/Storage/locales/vi.json +7 -0
- package/src/UploadQueue/FileUploadProgress.jsx +50 -0
- package/src/UploadQueue/Item.jsx +99 -0
- package/src/UploadQueue/Pending.jsx +12 -0
- package/src/UploadQueue/Readme.md +95 -0
- package/src/UploadQueue/RemainingTime.jsx +27 -0
- package/src/UploadQueue/helpers.js +3 -0
- package/src/UploadQueue/index.jsx +161 -0
- package/src/UploadQueue/index.spec.jsx +163 -0
- package/src/UploadQueue/locales/en.json +10 -0
- package/src/UploadQueue/locales/es.json +10 -0
- package/src/UploadQueue/locales/fr.json +10 -0
- package/src/UploadQueue/locales/ru.json +10 -0
- package/src/UploadQueue/locales/vi.json +10 -0
- package/src/UploadQueue/styles.styl +155 -0
- package/src/UploadQueue/useStatusIcon.js +32 -0
- package/src/hooks/useClientErrors.jsx +140 -0
- package/src/hooks/useClientErrors.spec.jsx +94 -0
- package/src/proptypes.js +20 -0
- package/src/providers/CozyTheme/CozyThemeWithQuery.jsx +25 -0
- package/src/providers/CozyTheme/Readme.md +88 -0
- package/src/providers/CozyTheme/index.jsx +35 -0
- package/src/providers/CozyTheme/queries.js +14 -0
- package/src/providers/DemoProvider.jsx +30 -0
- package/src/providers/Intent/index.jsx +83 -0
- package/src/types.d.ts +4 -0
- package/test/I18n.js +13 -0
- package/test/fileMock.js +3 -0
- package/test/jestsetup.js +1 -0
- package/tsconfig-build.json +16 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
divider,
|
|
3
|
+
emailTo,
|
|
4
|
+
smsTo,
|
|
5
|
+
call
|
|
6
|
+
} from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
7
|
+
|
|
8
|
+
import { makeOptionalActions } from './helpers'
|
|
9
|
+
|
|
10
|
+
describe('makeOptionalActions', () => {
|
|
11
|
+
it('should return divider, call, smsTo, emailTo', () => {
|
|
12
|
+
const res = makeOptionalActions({
|
|
13
|
+
email: [{ address: 'mail@cozy.com' }],
|
|
14
|
+
phone: [{ number: '123456' }]
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
expect(res).toStrictEqual([divider, call, smsTo, emailTo])
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('should return divider, emailTo', () => {
|
|
21
|
+
const res = makeOptionalActions({
|
|
22
|
+
email: [{ address: 'mail@cozy.com' }]
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
expect(res).toStrictEqual([divider, emailTo])
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('should return divider, call, smsTo', () => {
|
|
29
|
+
const res = makeOptionalActions({
|
|
30
|
+
phone: [{ number: '123456' }]
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
expect(res).toStrictEqual([divider, call, smsTo])
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('should empty array', () => {
|
|
37
|
+
const res = makeOptionalActions({})
|
|
38
|
+
|
|
39
|
+
expect(res).toStrictEqual([])
|
|
40
|
+
})
|
|
41
|
+
})
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { getDisplayName } from 'cozy-client/dist/models/contact'
|
|
5
|
+
import Filename from 'cozy-ui/transpiled/react/Filename'
|
|
6
|
+
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
7
|
+
import ContactsIcon from 'cozy-ui/transpiled/react/Icons/Contacts'
|
|
8
|
+
|
|
9
|
+
import useActions from './useActions'
|
|
10
|
+
import ListItemBase from '../ListItemBase'
|
|
11
|
+
|
|
12
|
+
const ListItemContact = ({
|
|
13
|
+
contact,
|
|
14
|
+
primary,
|
|
15
|
+
secondary,
|
|
16
|
+
icon,
|
|
17
|
+
actions,
|
|
18
|
+
selectProps,
|
|
19
|
+
expandedAttributesProps,
|
|
20
|
+
onClick
|
|
21
|
+
}) => {
|
|
22
|
+
const defaultActions = useActions(contact)
|
|
23
|
+
const primaryText = primary || getDisplayName(contact)
|
|
24
|
+
const secondaryText = secondary || contact.email?.[0]?.address
|
|
25
|
+
const itemIcon = icon || <Icon icon={ContactsIcon} width="32" height="32" />
|
|
26
|
+
|
|
27
|
+
const itemActions = defaultActions.concat(actions)
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<ListItemBase
|
|
31
|
+
doc={contact}
|
|
32
|
+
primary={primaryText}
|
|
33
|
+
secondary={secondaryText}
|
|
34
|
+
icon={itemIcon}
|
|
35
|
+
actions={itemActions}
|
|
36
|
+
actionMenuComp={{
|
|
37
|
+
Header: <Filename icon={ContactsIcon} filename={primaryText} />
|
|
38
|
+
}}
|
|
39
|
+
selectProps={selectProps}
|
|
40
|
+
expandedAttributesProps={expandedAttributesProps}
|
|
41
|
+
onClick={onClick}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
ListItemContact.defaultProps = {
|
|
47
|
+
actions: []
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ListItemContact.propTypes = {
|
|
51
|
+
contact: PropTypes.object,
|
|
52
|
+
primary: PropTypes.node,
|
|
53
|
+
secondary: PropTypes.node,
|
|
54
|
+
icon: PropTypes.node,
|
|
55
|
+
actions: PropTypes.array,
|
|
56
|
+
selectProps: PropTypes.shape({
|
|
57
|
+
isSelectActive: PropTypes.bool,
|
|
58
|
+
isSelected: PropTypes.bool,
|
|
59
|
+
isChecked: PropTypes.bool
|
|
60
|
+
}),
|
|
61
|
+
expandedAttributesProps: PropTypes.shape({
|
|
62
|
+
isExpandedAttributesActive: PropTypes.bool,
|
|
63
|
+
expandedAttributes: PropTypes.array
|
|
64
|
+
}),
|
|
65
|
+
onClick: PropTypes.func
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default ListItemContact
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
makeActions,
|
|
5
|
+
modify,
|
|
6
|
+
viewInContacts
|
|
7
|
+
} from 'cozy-ui/transpiled/react/ActionsMenu/Actions'
|
|
8
|
+
|
|
9
|
+
import { makeOptionalActions } from './helpers'
|
|
10
|
+
|
|
11
|
+
const useActions = contact => {
|
|
12
|
+
const optionalActions = useMemo(() => makeOptionalActions(contact), [contact])
|
|
13
|
+
const finalActions = useMemo(
|
|
14
|
+
() => [modify, viewInContacts].concat(optionalActions),
|
|
15
|
+
[optionalActions]
|
|
16
|
+
)
|
|
17
|
+
const actions = useMemo(() => makeActions(finalActions), [finalActions])
|
|
18
|
+
|
|
19
|
+
return actions
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default useActions
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
computeExpirationDate,
|
|
6
|
+
isExpired,
|
|
7
|
+
makeExpiredMessage,
|
|
8
|
+
makeExpiresInMessage
|
|
9
|
+
} from 'cozy-client/dist/models/paper'
|
|
10
|
+
import Typography from 'cozy-ui/transpiled/react/Typography'
|
|
11
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
12
|
+
|
|
13
|
+
import withListItemLocales from '../hoc/withListItemLocales'
|
|
14
|
+
|
|
15
|
+
const ExpirationAnnotation = ({ file }) => {
|
|
16
|
+
const { lang } = useI18n()
|
|
17
|
+
|
|
18
|
+
if (isExpired(file)) {
|
|
19
|
+
return (
|
|
20
|
+
<Typography component="span" variant="inherit" color="error">
|
|
21
|
+
{makeExpiredMessage({ lang })}
|
|
22
|
+
</Typography>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const expirationDate = computeExpirationDate(file)
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Typography component="span" variant="inherit" className="u-warning">
|
|
30
|
+
{makeExpiresInMessage(expirationDate, { lang })}
|
|
31
|
+
</Typography>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
ExpirationAnnotation.propTypes = {
|
|
36
|
+
file: PropTypes.object.isRequired
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default withListItemLocales(ExpirationAnnotation)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useClient } from 'cozy-client'
|
|
5
|
+
import { isNote } from 'cozy-client/dist/models/file'
|
|
6
|
+
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
7
|
+
import FiletypeNoteIcon from 'cozy-ui/transpiled/react/Icons/FileTypeNote'
|
|
8
|
+
import FiletypeTextIcon from 'cozy-ui/transpiled/react/Icons/FileTypeText'
|
|
9
|
+
import Skeleton from 'cozy-ui/transpiled/react/Skeleton'
|
|
10
|
+
import Thumbnail from 'cozy-ui/transpiled/react/Thumbnail'
|
|
11
|
+
|
|
12
|
+
import FileImageLoader from '../../FileImageLoader'
|
|
13
|
+
|
|
14
|
+
const ItemIcon = ({ icon, file }) => {
|
|
15
|
+
const client = useClient()
|
|
16
|
+
|
|
17
|
+
if (icon) return icon
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<FileImageLoader
|
|
21
|
+
client={client}
|
|
22
|
+
file={file}
|
|
23
|
+
linkType="tiny"
|
|
24
|
+
render={src => {
|
|
25
|
+
return (
|
|
26
|
+
<Thumbnail>
|
|
27
|
+
{src ? (
|
|
28
|
+
<img src={src} alt="" />
|
|
29
|
+
) : (
|
|
30
|
+
<Skeleton variant="rect" animation="wave" />
|
|
31
|
+
)}
|
|
32
|
+
</Thumbnail>
|
|
33
|
+
)
|
|
34
|
+
}}
|
|
35
|
+
renderFallback={() => (
|
|
36
|
+
<Thumbnail>
|
|
37
|
+
<Icon icon={isNote(file) ? FiletypeNoteIcon : FiletypeTextIcon} />
|
|
38
|
+
</Thumbnail>
|
|
39
|
+
)}
|
|
40
|
+
/>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
ItemIcon.propTypes = {
|
|
45
|
+
icon: PropTypes.node,
|
|
46
|
+
file: PropTypes.object
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default ItemIcon
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { splitFilename } from 'cozy-client/dist/models/file'
|
|
5
|
+
import Filename from 'cozy-ui/transpiled/react/Filename'
|
|
6
|
+
import useBreakpoints from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
7
|
+
|
|
8
|
+
const PrimaryText = ({ primary, file }) => {
|
|
9
|
+
const { isMobile } = useBreakpoints()
|
|
10
|
+
|
|
11
|
+
if (primary) return primary
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Filename
|
|
15
|
+
variant="body1"
|
|
16
|
+
midEllipsis={isMobile}
|
|
17
|
+
filename={
|
|
18
|
+
splitFilename({
|
|
19
|
+
name: file.name,
|
|
20
|
+
type: 'file'
|
|
21
|
+
}).filename
|
|
22
|
+
}
|
|
23
|
+
extension={
|
|
24
|
+
splitFilename({
|
|
25
|
+
name: file.name,
|
|
26
|
+
type: 'file'
|
|
27
|
+
}).extension
|
|
28
|
+
}
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
PrimaryText.propTypes = {
|
|
34
|
+
primary: PropTypes.node,
|
|
35
|
+
file: PropTypes.object
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default PrimaryText
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { isExpired, isExpiringSoon } from 'cozy-client/dist/models/paper'
|
|
5
|
+
import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n'
|
|
6
|
+
|
|
7
|
+
import ExpirationAnnotation from './ExpirationAnnotation'
|
|
8
|
+
|
|
9
|
+
const SecondaryText = ({ secondary, file }) => {
|
|
10
|
+
const { f } = useI18n()
|
|
11
|
+
|
|
12
|
+
if (secondary) return secondary
|
|
13
|
+
|
|
14
|
+
const date = file?.metadata?.datetime
|
|
15
|
+
? f(file?.metadata?.datetime, 'dd/LL/yyyy')
|
|
16
|
+
: null
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
{date ? date : ''}
|
|
21
|
+
{(isExpired(file) || isExpiringSoon(file)) && (
|
|
22
|
+
<>
|
|
23
|
+
{date ? ' · ' : ''}
|
|
24
|
+
<ExpirationAnnotation file={file} />
|
|
25
|
+
</>
|
|
26
|
+
)}
|
|
27
|
+
</>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
SecondaryText.propTypes = {
|
|
32
|
+
secondary: PropTypes.node,
|
|
33
|
+
file: PropTypes.object
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default SecondaryText
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import PropTypes from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { splitFilename } from 'cozy-client/dist/models/file'
|
|
5
|
+
import Filename from 'cozy-ui/transpiled/react/Filename'
|
|
6
|
+
import FiletypePdfIcon from 'cozy-ui/transpiled/react/Icons/FileTypePdf'
|
|
7
|
+
|
|
8
|
+
import ItemIcon from './ItemIcon'
|
|
9
|
+
import PrimaryText from './PrimaryText'
|
|
10
|
+
import SecondaryText from './SecondaryText'
|
|
11
|
+
import ListItemBase from '../ListItemBase'
|
|
12
|
+
|
|
13
|
+
const ListItemFile = ({
|
|
14
|
+
file,
|
|
15
|
+
primary,
|
|
16
|
+
secondary,
|
|
17
|
+
icon,
|
|
18
|
+
actions,
|
|
19
|
+
selectProps,
|
|
20
|
+
expandedAttributesProps,
|
|
21
|
+
onClick
|
|
22
|
+
}) => {
|
|
23
|
+
const { filename, extension } = splitFilename({
|
|
24
|
+
name: file.name,
|
|
25
|
+
type: 'file'
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<ListItemBase
|
|
30
|
+
doc={file}
|
|
31
|
+
primary={<PrimaryText primary={primary} file={file} />}
|
|
32
|
+
secondary={<SecondaryText secondary={secondary} file={file} />}
|
|
33
|
+
icon={<ItemIcon icon={icon} file={file} />}
|
|
34
|
+
actions={actions}
|
|
35
|
+
actionMenuComp={{
|
|
36
|
+
Header: (
|
|
37
|
+
<Filename
|
|
38
|
+
icon={FiletypePdfIcon}
|
|
39
|
+
filename={filename}
|
|
40
|
+
extension={extension}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
}}
|
|
44
|
+
selectProps={selectProps}
|
|
45
|
+
expandedAttributesProps={expandedAttributesProps}
|
|
46
|
+
onClick={onClick}
|
|
47
|
+
/>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
ListItemFile.defaultProps = {
|
|
52
|
+
expandedAttributesProps: {
|
|
53
|
+
isExpandedAttributesActive: false
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
ListItemFile.propTypes = {
|
|
58
|
+
file: PropTypes.object,
|
|
59
|
+
primary: PropTypes.node,
|
|
60
|
+
secondary: PropTypes.node,
|
|
61
|
+
icon: PropTypes.node,
|
|
62
|
+
actions: PropTypes.array,
|
|
63
|
+
selectProps: PropTypes.shape({
|
|
64
|
+
isSelectActive: PropTypes.bool,
|
|
65
|
+
isSelected: PropTypes.bool,
|
|
66
|
+
isChecked: PropTypes.bool
|
|
67
|
+
}),
|
|
68
|
+
expandedAttributesProps: PropTypes.shape({
|
|
69
|
+
isExpandedAttributesActive: PropTypes.bool,
|
|
70
|
+
expandedAttributes: PropTypes.array
|
|
71
|
+
}),
|
|
72
|
+
onClick: PropTypes.func
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default ListItemFile
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
```jsx
|
|
2
|
+
import Variants from 'cozy-ui/docs/components/Variants'
|
|
3
|
+
import List from 'cozy-ui/transpiled/react/List'
|
|
4
|
+
import ListSubheader from 'cozy-ui/transpiled/react/ListSubheader'
|
|
5
|
+
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
6
|
+
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
7
|
+
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
8
|
+
import ListItemSecondaryAction from 'cozy-ui/transpiled/react/ListItemSecondaryAction'
|
|
9
|
+
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
10
|
+
import IconButton from 'cozy-ui/transpiled/react/IconButton'
|
|
11
|
+
import CommentIcon from 'cozy-ui/transpiled/react/Icons/Comment'
|
|
12
|
+
import PeopleIcon from 'cozy-ui/transpiled/react/Icons/People'
|
|
13
|
+
import RightIcon from 'cozy-ui/transpiled/react/Icons/Right'
|
|
14
|
+
import DotsIcon from "cozy-ui/transpiled/react/Icons/Dots"
|
|
15
|
+
import PenIcon from "cozy-ui/transpiled/react/Icons/Pen"
|
|
16
|
+
import TrashIcon from "cozy-ui/transpiled/react/Icons/Trash"
|
|
17
|
+
import Radio from 'cozy-ui/transpiled/react/Radios'
|
|
18
|
+
import Checkbox from 'cozy-ui/transpiled/react/Checkbox'
|
|
19
|
+
|
|
20
|
+
const initialVariants = [{
|
|
21
|
+
dense: false,
|
|
22
|
+
longText: false,
|
|
23
|
+
disabledGutters: false,
|
|
24
|
+
doubleGutters: false,
|
|
25
|
+
small: false,
|
|
26
|
+
large: false,
|
|
27
|
+
bigIcons: false,
|
|
28
|
+
smallIcons: false,
|
|
29
|
+
multipleLeftIcons: false,
|
|
30
|
+
multipleRightIcons: false,
|
|
31
|
+
withActions: false,
|
|
32
|
+
ellipsis: true
|
|
33
|
+
}]
|
|
34
|
+
|
|
35
|
+
;
|
|
36
|
+
|
|
37
|
+
<Variants initialVariants={initialVariants} screenshotAllVariants>
|
|
38
|
+
{variant => {
|
|
39
|
+
const gutters = variant.disabledGutters ? 'disabled' : variant.doubleGutters ? 'double' : 'default'
|
|
40
|
+
const size = variant.small ? 'small' : variant.large ? 'large' : 'medium'
|
|
41
|
+
const listItemProps = { gutters, size, ellipsis: variant.ellipsis }
|
|
42
|
+
|
|
43
|
+
const iconSize = variant.smallIcons ? 8 : variant.bigIcons ? 32 : 16
|
|
44
|
+
const text = variant.longText ? content.ada.short : "I'm a primary text"
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<List dense={variant.dense} subheader={<ListSubheader>Section 1</ListSubheader>}>
|
|
49
|
+
<ListItem {...listItemProps} button>
|
|
50
|
+
<ListItemIcon>
|
|
51
|
+
<Icon icon={CommentIcon} size={iconSize} />
|
|
52
|
+
</ListItemIcon>
|
|
53
|
+
{variant.multipleLeftIcons && (
|
|
54
|
+
<>
|
|
55
|
+
<ListItemIcon>
|
|
56
|
+
<Icon icon={PeopleIcon} size={iconSize} />
|
|
57
|
+
</ListItemIcon>
|
|
58
|
+
<ListItemIcon>
|
|
59
|
+
<Radio />
|
|
60
|
+
</ListItemIcon>
|
|
61
|
+
<ListItemIcon>
|
|
62
|
+
<Checkbox />
|
|
63
|
+
</ListItemIcon>
|
|
64
|
+
</>
|
|
65
|
+
)}
|
|
66
|
+
<ListItemText primary={text} />
|
|
67
|
+
{variant.multipleRightIcons && (
|
|
68
|
+
<>
|
|
69
|
+
<ListItemIcon>
|
|
70
|
+
<Icon icon={RightIcon} size={iconSize} />
|
|
71
|
+
</ListItemIcon>
|
|
72
|
+
<ListItemIcon>
|
|
73
|
+
<Radio />
|
|
74
|
+
</ListItemIcon>
|
|
75
|
+
<ListItemIcon>
|
|
76
|
+
<Checkbox />
|
|
77
|
+
</ListItemIcon>
|
|
78
|
+
</>
|
|
79
|
+
)}
|
|
80
|
+
{variant.withActions && (
|
|
81
|
+
<ListItemSecondaryAction>
|
|
82
|
+
<IconButton>
|
|
83
|
+
<Icon icon={PenIcon} />
|
|
84
|
+
</IconButton>
|
|
85
|
+
<IconButton>
|
|
86
|
+
<Icon icon={TrashIcon} />
|
|
87
|
+
</IconButton>
|
|
88
|
+
<IconButton>
|
|
89
|
+
<Icon icon={DotsIcon} />
|
|
90
|
+
</IconButton>
|
|
91
|
+
</ListItemSecondaryAction>
|
|
92
|
+
)}
|
|
93
|
+
</ListItem>
|
|
94
|
+
</List>
|
|
95
|
+
</>
|
|
96
|
+
)
|
|
97
|
+
}}
|
|
98
|
+
</Variants>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Contextualized items
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
import { BreakpointsProvider } from 'cozy-ui/transpiled/react/providers/Breakpoints'
|
|
105
|
+
import List from 'cozy-ui/transpiled/react/List'
|
|
106
|
+
import ListItemByDoc from 'cozy-ui/transpiled/react/ListItem/ListItemByDoc'
|
|
107
|
+
import ListItem from 'cozy-ui/transpiled/react/ListItem'
|
|
108
|
+
import ListItemIcon from 'cozy-ui/transpiled/react/ListItemIcon'
|
|
109
|
+
import ListItemText from 'cozy-ui/transpiled/react/ListItemText'
|
|
110
|
+
import Icon from 'cozy-ui/transpiled/react/Icon'
|
|
111
|
+
import Divider from 'cozy-ui/transpiled/react/Divider'
|
|
112
|
+
import FiletypeTextIcon from 'cozy-ui/transpiled/react/Icons/FileTypeText'
|
|
113
|
+
import DemoProvider from 'cozy-ui/docs/components/DemoProvider'
|
|
114
|
+
|
|
115
|
+
const mockClient = {
|
|
116
|
+
plugins: {
|
|
117
|
+
realtime: {
|
|
118
|
+
subscribe: () => {},
|
|
119
|
+
unsubscribe: () => {},
|
|
120
|
+
unsubscribeAll: () => {}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
getStackClient: () => ({
|
|
124
|
+
uri: 'https://cozy.io/'
|
|
125
|
+
}),
|
|
126
|
+
getInstanceOptions: () => ({
|
|
127
|
+
subdomain: ''
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const contacts = [
|
|
132
|
+
{
|
|
133
|
+
_id: 'id01',
|
|
134
|
+
_type: 'io.cozy.contacts',
|
|
135
|
+
displayName: 'John Doe',
|
|
136
|
+
birthday: '25/10/2022',
|
|
137
|
+
email: [{ address: 'johndoe@cozy.cc', primary: true }],
|
|
138
|
+
phone: [{ number: '0102030405', primary: true }]
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
_id: 'id02',
|
|
142
|
+
_type: 'io.cozy.contacts',
|
|
143
|
+
displayName: 'Jason Bourne',
|
|
144
|
+
birthday: '01/01/2020',
|
|
145
|
+
email: [{ address: 'jbourne@cozy.cc', primary: true }]
|
|
146
|
+
}
|
|
147
|
+
]
|
|
148
|
+
|
|
149
|
+
const files = [
|
|
150
|
+
{
|
|
151
|
+
_type: 'io.cozy.files',
|
|
152
|
+
name: 'File01.pdf',
|
|
153
|
+
metadata: {
|
|
154
|
+
number: 12345,
|
|
155
|
+
refTaxIncome: '153',
|
|
156
|
+
datetime: '2024-01-11T12:00:00.000Z',
|
|
157
|
+
datetimeLabel: 'expirationDate',
|
|
158
|
+
referencedDate: '2024-01-01T12:00:00.000Z',
|
|
159
|
+
expirationDate: '2024-01-11T12:00:00.000Z',
|
|
160
|
+
issueDate: '2024-01-11T12:00:00.000Z',
|
|
161
|
+
noticePeriod: '30',
|
|
162
|
+
qualification: {
|
|
163
|
+
label: 'driver_license'
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
_type: 'io.cozy.files',
|
|
169
|
+
type: 'file',
|
|
170
|
+
name: 'Note01.cozy-note',
|
|
171
|
+
metadata: {
|
|
172
|
+
title: 'note title',
|
|
173
|
+
version: 0
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
|
|
178
|
+
;
|
|
179
|
+
|
|
180
|
+
<DemoProvider client={mockClient}>
|
|
181
|
+
<List>
|
|
182
|
+
<ListItemByDoc
|
|
183
|
+
doc={contacts[0]}
|
|
184
|
+
expandedAttributesProps={{
|
|
185
|
+
isExpandedAttributesActive: true,
|
|
186
|
+
expandedAttributes: ['email', 'birthday']
|
|
187
|
+
}}
|
|
188
|
+
onClick={() => {}}
|
|
189
|
+
/>
|
|
190
|
+
<Divider variant="inset" />
|
|
191
|
+
<ListItemByDoc
|
|
192
|
+
doc={files[0]}
|
|
193
|
+
expandedAttributesProps={{
|
|
194
|
+
isExpandedAttributesActive: true,
|
|
195
|
+
expandedAttributes: ['metadata.number']
|
|
196
|
+
}}
|
|
197
|
+
onClick={() => {}}
|
|
198
|
+
/>
|
|
199
|
+
<ListItemByDoc
|
|
200
|
+
doc={files[0]}
|
|
201
|
+
expandedAttributesProps={{ isExpandedAttributesActive: true }}
|
|
202
|
+
onClick={() => {}}
|
|
203
|
+
/>
|
|
204
|
+
<Divider variant="inset" />
|
|
205
|
+
<ListItemByDoc
|
|
206
|
+
doc={files[1]}
|
|
207
|
+
onClick={() => {}}
|
|
208
|
+
/>
|
|
209
|
+
</List>
|
|
210
|
+
</DemoProvider>
|
|
211
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import withLocales from 'cozy-ui/transpiled/react/providers/I18n/withLocales'
|
|
2
|
+
|
|
3
|
+
import en from '../locales/en.json'
|
|
4
|
+
import fr from '../locales/fr.json'
|
|
5
|
+
import ru from '../locales/ru.json'
|
|
6
|
+
import vi from '../locales/vi.json'
|
|
7
|
+
|
|
8
|
+
export const locales = {
|
|
9
|
+
en,
|
|
10
|
+
fr,
|
|
11
|
+
ru,
|
|
12
|
+
vi
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default withLocales(locales)
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"common": {
|
|
3
|
+
"day": "%{smart_count} day |||| %{smart_count} days"
|
|
4
|
+
},
|
|
5
|
+
"ListItem": {
|
|
6
|
+
"attributes": {
|
|
7
|
+
"birthday": "Birthday",
|
|
8
|
+
"birthcity": "Birth city",
|
|
9
|
+
"address": "Address",
|
|
10
|
+
"email": "Email address",
|
|
11
|
+
"phone": "Phone number",
|
|
12
|
+
"company": "Company",
|
|
13
|
+
"jobTitle": "Job title",
|
|
14
|
+
"metadata": {
|
|
15
|
+
"datetime": "Added on",
|
|
16
|
+
"issueDate": "Delivered on",
|
|
17
|
+
"expirationDate": "Expiration date",
|
|
18
|
+
"referencedDate": "Referenced date",
|
|
19
|
+
"shootingDate": "Shooting date",
|
|
20
|
+
"obtentionDate": "Date obtained",
|
|
21
|
+
"date": "Document date",
|
|
22
|
+
"country": "Country of delivery",
|
|
23
|
+
"refTaxIncome": "Reference tax income",
|
|
24
|
+
"contractType": "Contract type",
|
|
25
|
+
"noticePeriod": "Expiration alert",
|
|
26
|
+
"cafFileNumber": "CAF file number",
|
|
27
|
+
"vinNumber": "Vehicle registration number (VIN)",
|
|
28
|
+
"cardNumber": "National ID card number",
|
|
29
|
+
"ibanNumber": "IBAN number",
|
|
30
|
+
"bicNumber": "BIC number",
|
|
31
|
+
"passportNumber": "Passport number",
|
|
32
|
+
"netSocialAmount": "Net social amount",
|
|
33
|
+
"vehicle": {
|
|
34
|
+
"licenseNumber": "Vehicle registration number",
|
|
35
|
+
"confidentialNumber": "Confidential vehicle registration code"
|
|
36
|
+
},
|
|
37
|
+
"number": {
|
|
38
|
+
"pay_sheet": "Gross remuneration",
|
|
39
|
+
"tax_return": "Reference tax number",
|
|
40
|
+
"tax_notice": "Reference tax number",
|
|
41
|
+
"real_estate_tax": "Reference tax number",
|
|
42
|
+
"tax_timetable": "Reference tax number",
|
|
43
|
+
"fine": "Amount of the fine",
|
|
44
|
+
"fidelity_card": "Card number",
|
|
45
|
+
"driver_license": "License number",
|
|
46
|
+
"caf": "CAF file number",
|
|
47
|
+
"payment_proof_family_allowance": "CAF file number",
|
|
48
|
+
"vehicle_registration": "Vehicle registration number (VIN)",
|
|
49
|
+
"national_id_card": "National ID card number",
|
|
50
|
+
"bank_details": "IBAN number",
|
|
51
|
+
"passport": "Passport number",
|
|
52
|
+
"residence_permit": "License number"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"file": {
|
|
57
|
+
"page": {
|
|
58
|
+
"back": "Back side",
|
|
59
|
+
"front": "Front side"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"snackbar": {
|
|
63
|
+
"copyToClipboard": {
|
|
64
|
+
"success": "Copied to clipboard",
|
|
65
|
+
"error": "Cannot copy to clipboard"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"renameModal": {
|
|
69
|
+
"title": "Rename",
|
|
70
|
+
"content": "You are about to change the file extension. Do you want to continue?",
|
|
71
|
+
"cancel": "Cancel",
|
|
72
|
+
"submit": "Continue"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|