@sneat/contactus-shared 0.2.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/esm2022/index.js +4 -0
- package/esm2022/index.js.map +1 -0
- package/esm2022/lib/components/address-form/address-form.component.js +182 -0
- package/esm2022/lib/components/address-form/address-form.component.js.map +1 -0
- package/esm2022/lib/components/address-form/index.js +2 -0
- package/esm2022/lib/components/address-form/index.js.map +1 -0
- package/esm2022/lib/components/basic-contact-form/basic-contact-form.component.js +71 -0
- package/esm2022/lib/components/basic-contact-form/basic-contact-form.component.js.map +1 -0
- package/esm2022/lib/components/basic-contact-form/index.js +2 -0
- package/esm2022/lib/components/basic-contact-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-comm-channels/comm-channel-form.component.js +90 -0
- package/esm2022/lib/components/contact-comm-channels/comm-channel-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-comm-channels/comm-channel-item.component.js +128 -0
- package/esm2022/lib/components/contact-comm-channels/comm-channel-item.component.js.map +1 -0
- package/esm2022/lib/components/contact-comm-channels/comm-channels-list.component.js +30 -0
- package/esm2022/lib/components/contact-comm-channels/comm-channels-list.component.js.map +1 -0
- package/esm2022/lib/components/contact-comm-channels/contact-comm-channels.component.js +16 -0
- package/esm2022/lib/components/contact-comm-channels/contact-comm-channels.component.js.map +1 -0
- package/esm2022/lib/components/contact-comm-channels/contact-emails.component.js +30 -0
- package/esm2022/lib/components/contact-comm-channels/contact-emails.component.js.map +1 -0
- package/esm2022/lib/components/contact-comm-channels/contact-phones.component.js +30 -0
- package/esm2022/lib/components/contact-comm-channels/contact-phones.component.js.map +1 -0
- package/esm2022/lib/components/contact-comm-channels/index.js +2 -0
- package/esm2022/lib/components/contact-comm-channels/index.js.map +1 -0
- package/esm2022/lib/components/contact-details/contact-details.component.js +235 -0
- package/esm2022/lib/components/contact-details/contact-details.component.js.map +1 -0
- package/esm2022/lib/components/contact-details/index.js +2 -0
- package/esm2022/lib/components/contact-details/index.js.map +1 -0
- package/esm2022/lib/components/contact-details/related-contacts.component.js +116 -0
- package/esm2022/lib/components/contact-details/related-contacts.component.js.map +1 -0
- package/esm2022/lib/components/contact-dob/contact-dob.component.js +57 -0
- package/esm2022/lib/components/contact-dob/contact-dob.component.js.map +1 -0
- package/esm2022/lib/components/contact-dob/index.js +2 -0
- package/esm2022/lib/components/contact-dob/index.js.map +1 -0
- package/esm2022/lib/components/contact-events.js +2 -0
- package/esm2022/lib/components/contact-events.js.map +1 -0
- package/esm2022/lib/components/contact-forms/contact-form-base.component.js +30 -0
- package/esm2022/lib/components/contact-forms/contact-form-base.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/emails-form/emails-form.component.js +76 -0
- package/esm2022/lib/components/contact-forms/emails-form/emails-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/emails-form/index.js +2 -0
- package/esm2022/lib/components/contact-forms/emails-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/index.js +11 -0
- package/esm2022/lib/components/contact-forms/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/location-form/index.js +2 -0
- package/esm2022/lib/components/contact-forms/location-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/location-form/location-form.component.js +194 -0
- package/esm2022/lib/components/contact-forms/location-form/location-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/new-contact/index.js +5 -0
- package/esm2022/lib/components/contact-forms/new-contact/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-company-form.component.js +115 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-company-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-contact-form-base.component.js +34 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-contact-form-base.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-contact-form.component.js +82 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-contact-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-person-form.component.js +282 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-person-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-pet-form.component.js +25 -0
- package/esm2022/lib/components/contact-forms/new-contact/new-pet-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/person-forms/age-group/age-group-form.component.js +64 -0
- package/esm2022/lib/components/contact-forms/person-forms/age-group/age-group-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/person-forms/age-group/index.js +2 -0
- package/esm2022/lib/components/contact-forms/person-forms/age-group/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/person-forms/gender-form/gender-form.component.js +118 -0
- package/esm2022/lib/components/contact-forms/person-forms/gender-form/gender-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/person-forms/gender-form/index.js +2 -0
- package/esm2022/lib/components/contact-forms/person-forms/gender-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/person-forms/names-form/index.js +2 -0
- package/esm2022/lib/components/contact-forms/person-forms/names-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/person-forms/names-form/names-form.component.js +296 -0
- package/esm2022/lib/components/contact-forms/person-forms/names-form/names-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/pesson-wizard/index.js +2 -0
- package/esm2022/lib/components/contact-forms/pesson-wizard/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/pesson-wizard/person-wizard.component.js +369 -0
- package/esm2022/lib/components/contact-forms/pesson-wizard/person-wizard.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/pet-kind-and-breed-form/index.js +2 -0
- package/esm2022/lib/components/contact-forms/pet-kind-and-breed-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/pet-kind-and-breed-form/pet-kind-and-breed-form.component.js +66 -0
- package/esm2022/lib/components/contact-forms/pet-kind-and-breed-form/pet-kind-and-breed-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/phones-form/index.js +2 -0
- package/esm2022/lib/components/contact-forms/phones-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/phones-form/phones-form.component.js +79 -0
- package/esm2022/lib/components/contact-forms/phones-form/phones-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/relationship-form/contact-relationship-form.component.js +125 -0
- package/esm2022/lib/components/contact-forms/relationship-form/contact-relationship-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/relationship-form/index.js +2 -0
- package/esm2022/lib/components/contact-forms/relationship-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/relationship-form/relationship-form.component.js +136 -0
- package/esm2022/lib/components/contact-forms/relationship-form/relationship-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/role-form/contact-role-form.component.js +98 -0
- package/esm2022/lib/components/contact-forms/role-form/contact-role-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/role-form/index.js +2 -0
- package/esm2022/lib/components/contact-forms/role-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/roles-form/index.js +2 -0
- package/esm2022/lib/components/contact-forms/roles-form/index.js.map +1 -0
- package/esm2022/lib/components/contact-forms/roles-form/roles-form.component.js +59 -0
- package/esm2022/lib/components/contact-forms/roles-form/roles-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-forms/space-related-form.component.js +32 -0
- package/esm2022/lib/components/contact-forms/space-related-form.component.js.map +1 -0
- package/esm2022/lib/components/contact-input/contact-input.component.js +151 -0
- package/esm2022/lib/components/contact-input/contact-input.component.js.map +1 -0
- package/esm2022/lib/components/contact-input/index.js +2 -0
- package/esm2022/lib/components/contact-input/index.js.map +1 -0
- package/esm2022/lib/components/contact-locations/contact-locations.component.js +52 -0
- package/esm2022/lib/components/contact-locations/contact-locations.component.js.map +1 -0
- package/esm2022/lib/components/contact-locations/index.js +2 -0
- package/esm2022/lib/components/contact-locations/index.js.map +1 -0
- package/esm2022/lib/components/contact-modules-menu/contact-modules-menu.component.js +29 -0
- package/esm2022/lib/components/contact-modules-menu/contact-modules-menu.component.js.map +1 -0
- package/esm2022/lib/components/contact-modules-menu/index.js +2 -0
- package/esm2022/lib/components/contact-modules-menu/index.js.map +1 -0
- package/esm2022/lib/components/contact-role-badges/contact-role-badges.component.js +44 -0
- package/esm2022/lib/components/contact-role-badges/contact-role-badges.component.js.map +1 -0
- package/esm2022/lib/components/contact-roles-input/contact-roles-input.component.js +37 -0
- package/esm2022/lib/components/contact-roles-input/contact-roles-input.component.js.map +1 -0
- package/esm2022/lib/components/contact-roles-input/index.js +2 -0
- package/esm2022/lib/components/contact-roles-input/index.js.map +1 -0
- package/esm2022/lib/components/contacts-by-type/contacts-by-type.component.js +200 -0
- package/esm2022/lib/components/contacts-by-type/contacts-by-type.component.js.map +1 -0
- package/esm2022/lib/components/contacts-by-type/index.js +2 -0
- package/esm2022/lib/components/contacts-by-type/index.js.map +1 -0
- package/esm2022/lib/components/contacts-checklist/contacts-checklist-item.component.js +32 -0
- package/esm2022/lib/components/contacts-checklist/contacts-checklist-item.component.js.map +1 -0
- package/esm2022/lib/components/contacts-checklist/contacts-checklist.component.js +140 -0
- package/esm2022/lib/components/contacts-checklist/contacts-checklist.component.js.map +1 -0
- package/esm2022/lib/components/contacts-checklist/index.js +2 -0
- package/esm2022/lib/components/contacts-checklist/index.js.map +1 -0
- package/esm2022/lib/components/contacts-component/contacts.component.js +200 -0
- package/esm2022/lib/components/contacts-component/contacts.component.js.map +1 -0
- package/esm2022/lib/components/contacts-component.commands.js +2 -0
- package/esm2022/lib/components/contacts-component.commands.js.map +1 -0
- package/esm2022/lib/components/contacts-list/contacts-list.component.js +32 -0
- package/esm2022/lib/components/contacts-list/contacts-list.component.js.map +1 -0
- package/esm2022/lib/components/contacts-list/index.js +3 -0
- package/esm2022/lib/components/contacts-list/index.js.map +1 -0
- package/esm2022/lib/components/contacts-list-item/contacts-list-item.component.js +138 -0
- package/esm2022/lib/components/contacts-list-item/contacts-list-item.component.js.map +1 -0
- package/esm2022/lib/components/contacts-list-item/related-as.component.js +34 -0
- package/esm2022/lib/components/contacts-list-item/related-as.component.js.map +1 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector-input.component.js +91 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector-input.component.js.map +1 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector.component.js +415 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector.component.js.map +1 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector.interfaces.js +2 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector.interfaces.js.map +1 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector.module.js +28 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector.module.js.map +1 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector.service.js +18 -0
- package/esm2022/lib/components/contacts-selector/contacts-selector.service.js.map +1 -0
- package/esm2022/lib/components/contacts-selector/lib-exports.js +6 -0
- package/esm2022/lib/components/contacts-selector/lib-exports.js.map +1 -0
- package/esm2022/lib/components/contactus-module.base.component.js +4 -0
- package/esm2022/lib/components/contactus-module.base.component.js.map +1 -0
- package/esm2022/lib/components/inlist-options/inlist-age-group.component.js +53 -0
- package/esm2022/lib/components/inlist-options/inlist-age-group.component.js.map +1 -0
- package/esm2022/lib/components/inlist-options/inlist-options.component.js +27 -0
- package/esm2022/lib/components/inlist-options/inlist-options.component.js.map +1 -0
- package/esm2022/lib/components/invite-links/invite-links.component.js +87 -0
- package/esm2022/lib/components/invite-links/invite-links.component.js.map +1 -0
- package/esm2022/lib/components/lib-exports.js +29 -0
- package/esm2022/lib/components/lib-exports.js.map +1 -0
- package/esm2022/lib/components/members-as-badges/contacts-as-badges.component.js +39 -0
- package/esm2022/lib/components/members-as-badges/contacts-as-badges.component.js.map +1 -0
- package/esm2022/lib/components/members-as-badges/index.js +2 -0
- package/esm2022/lib/components/members-as-badges/index.js.map +1 -0
- package/esm2022/lib/components/members-by-role/family-members.component.js +180 -0
- package/esm2022/lib/components/members-by-role/family-members.component.js.map +1 -0
- package/esm2022/lib/components/members-by-role/index.js +4 -0
- package/esm2022/lib/components/members-by-role/index.js.map +1 -0
- package/esm2022/lib/components/members-by-role/member-group.js +2 -0
- package/esm2022/lib/components/members-by-role/member-group.js.map +1 -0
- package/esm2022/lib/components/members-by-role/members-by-role.component.js +34 -0
- package/esm2022/lib/components/members-by-role/members-by-role.component.js.map +1 -0
- package/esm2022/lib/components/members-card-header/members-card-header.component.js +33 -0
- package/esm2022/lib/components/members-card-header/members-card-header.component.js.map +1 -0
- package/esm2022/lib/components/members-list/index.js +2 -0
- package/esm2022/lib/components/members-list/index.js.map +1 -0
- package/esm2022/lib/components/members-list/members-list.component.js +164 -0
- package/esm2022/lib/components/members-list/members-list.component.js.map +1 -0
- package/esm2022/lib/components/members-short-list-card/members-short-list-card.component.js +60 -0
- package/esm2022/lib/components/members-short-list-card/members-short-list-card.component.js.map +1 -0
- package/esm2022/lib/components/shared-with/index.js +2 -0
- package/esm2022/lib/components/shared-with/index.js.map +1 -0
- package/esm2022/lib/components/shared-with/shared-with.component.js +25 -0
- package/esm2022/lib/components/shared-with/shared-with.component.js.map +1 -0
- package/esm2022/lib/components/with-new-contact-input.js +18 -0
- package/esm2022/lib/components/with-new-contact-input.js.map +1 -0
- package/esm2022/lib/constants.js +2 -0
- package/esm2022/lib/constants.js.map +1 -0
- package/esm2022/lib/index.js +3 -0
- package/esm2022/lib/index.js.map +1 -0
- package/esm2022/lib/modals/contact-names-modal/contact-names-modal.component.js +88 -0
- package/esm2022/lib/modals/contact-names-modal/contact-names-modal.component.js.map +1 -0
- package/esm2022/lib/modals/invite-modal/index.js +2 -0
- package/esm2022/lib/modals/invite-modal/index.js.map +1 -0
- package/esm2022/lib/modals/invite-modal/invite-modal.component.js +255 -0
- package/esm2022/lib/modals/invite-modal/invite-modal.component.js.map +1 -0
- package/esm2022/lib/pipes/contact-title.pipe.js +25 -0
- package/esm2022/lib/pipes/contact-title.pipe.js.map +1 -0
- package/esm2022/lib/pipes/index.js +4 -0
- package/esm2022/lib/pipes/index.js.map +1 -0
- package/esm2022/lib/pipes/person-title.pipe.js +21 -0
- package/esm2022/lib/pipes/person-title.pipe.js.map +1 -0
- package/esm2022/lib/pipes/selected-contacts.pipe.js +22 -0
- package/esm2022/lib/pipes/selected-contacts.pipe.js.map +1 -0
- package/esm2022/lib/providers/user-space-brief.provider.js +30 -0
- package/esm2022/lib/providers/user-space-brief.provider.js.map +1 -0
- package/esm2022/lib/ui-types.js +2 -0
- package/esm2022/lib/ui-types.js.map +1 -0
- package/esm2022/sneat-contactus-shared.js +5 -0
- package/esm2022/sneat-contactus-shared.js.map +1 -0
- package/index.d.ts +3 -0
- package/lib/components/address-form/address-form.component.d.ts +51 -0
- package/lib/components/address-form/index.d.ts +1 -0
- package/lib/components/basic-contact-form/basic-contact-form.component.d.ts +20 -0
- package/lib/components/basic-contact-form/index.d.ts +1 -0
- package/lib/components/contact-comm-channels/comm-channel-form.component.d.ts +20 -0
- package/lib/components/contact-comm-channels/comm-channel-item.component.d.ts +24 -0
- package/lib/components/contact-comm-channels/comm-channels-list.component.d.ts +15 -0
- package/lib/components/contact-comm-channels/contact-comm-channels.component.d.ts +7 -0
- package/lib/components/contact-comm-channels/contact-emails.component.d.ts +9 -0
- package/lib/components/contact-comm-channels/contact-phones.component.d.ts +9 -0
- package/lib/components/contact-comm-channels/index.d.ts +1 -0
- package/lib/components/contact-details/contact-details.component.d.ts +32 -0
- package/lib/components/contact-details/index.d.ts +1 -0
- package/lib/components/contact-details/related-contacts.component.d.ts +24 -0
- package/lib/components/contact-dob/contact-dob.component.d.ts +13 -0
- package/lib/components/contact-dob/index.d.ts +1 -0
- package/lib/components/contact-events.d.ts +6 -0
- package/lib/components/contact-forms/contact-form-base.component.d.ts +15 -0
- package/lib/components/contact-forms/emails-form/emails-form.component.d.ts +27 -0
- package/lib/components/contact-forms/emails-form/index.d.ts +1 -0
- package/lib/components/contact-forms/index.d.ts +10 -0
- package/lib/components/contact-forms/location-form/index.d.ts +1 -0
- package/lib/components/contact-forms/location-form/location-form.component.d.ts +39 -0
- package/lib/components/contact-forms/new-contact/index.d.ts +4 -0
- package/lib/components/contact-forms/new-contact/new-company-form.component.d.ts +26 -0
- package/lib/components/contact-forms/new-contact/new-contact-form-base.component.d.ts +15 -0
- package/lib/components/contact-forms/new-contact/new-contact-form.component.d.ts +20 -0
- package/lib/components/contact-forms/new-contact/new-person-form.component.d.ts +51 -0
- package/lib/components/contact-forms/new-contact/new-pet-form.component.d.ts +8 -0
- package/lib/components/contact-forms/person-forms/age-group/age-group-form.component.d.ts +17 -0
- package/lib/components/contact-forms/person-forms/age-group/index.d.ts +1 -0
- package/lib/components/contact-forms/person-forms/gender-form/gender-form.component.d.ts +22 -0
- package/lib/components/contact-forms/person-forms/gender-form/index.d.ts +1 -0
- package/lib/components/contact-forms/person-forms/names-form/index.d.ts +1 -0
- package/lib/components/contact-forms/person-forms/names-form/names-form.component.d.ts +63 -0
- package/lib/components/contact-forms/pesson-wizard/index.d.ts +1 -0
- package/lib/components/contact-forms/pesson-wizard/person-wizard.component.d.ts +63 -0
- package/lib/components/contact-forms/pet-kind-and-breed-form/index.d.ts +1 -0
- package/lib/components/contact-forms/pet-kind-and-breed-form/pet-kind-and-breed-form.component.d.ts +14 -0
- package/lib/components/contact-forms/phones-form/index.d.ts +1 -0
- package/lib/components/contact-forms/phones-form/phones-form.component.d.ts +21 -0
- package/lib/components/contact-forms/relationship-form/contact-relationship-form.component.d.ts +24 -0
- package/lib/components/contact-forms/relationship-form/index.d.ts +1 -0
- package/lib/components/contact-forms/relationship-form/relationship-form.component.d.ts +34 -0
- package/lib/components/contact-forms/role-form/contact-role-form.component.d.ts +33 -0
- package/lib/components/contact-forms/role-form/index.d.ts +1 -0
- package/lib/components/contact-forms/roles-form/index.d.ts +1 -0
- package/lib/components/contact-forms/roles-form/roles-form.component.d.ts +21 -0
- package/lib/components/contact-forms/space-related-form.component.d.ts +11 -0
- package/lib/components/contact-input/contact-input.component.d.ts +36 -0
- package/lib/components/contact-input/index.d.ts +1 -0
- package/lib/components/contact-locations/contact-locations.component.d.ts +14 -0
- package/lib/components/contact-locations/index.d.ts +1 -0
- package/lib/components/contact-modules-menu/contact-modules-menu.component.d.ts +12 -0
- package/lib/components/contact-modules-menu/index.d.ts +1 -0
- package/lib/components/contact-role-badges/contact-role-badges.component.d.ts +12 -0
- package/lib/components/contact-roles-input/contact-roles-input.component.d.ts +18 -0
- package/lib/components/contact-roles-input/index.d.ts +1 -0
- package/lib/components/contacts-by-type/contacts-by-type.component.d.ts +38 -0
- package/lib/components/contacts-by-type/index.d.ts +1 -0
- package/lib/components/contacts-checklist/contacts-checklist-item.component.d.ts +21 -0
- package/lib/components/contacts-checklist/contacts-checklist.component.d.ts +40 -0
- package/lib/components/contacts-checklist/index.d.ts +1 -0
- package/lib/components/contacts-component/contacts.component.d.ts +45 -0
- package/lib/components/contacts-component.commands.d.ts +5 -0
- package/lib/components/contacts-list/contacts-list.component.d.ts +11 -0
- package/lib/components/contacts-list/index.d.ts +2 -0
- package/lib/components/contacts-list-item/contacts-list-item.component.d.ts +29 -0
- package/lib/components/contacts-list-item/related-as.component.d.ts +16 -0
- package/lib/components/contacts-selector/contacts-selector-input.component.d.ts +24 -0
- package/lib/components/contacts-selector/contacts-selector.component.d.ts +80 -0
- package/lib/components/contacts-selector/contacts-selector.interfaces.d.ts +22 -0
- package/lib/components/contacts-selector/contacts-selector.module.d.ts +6 -0
- package/lib/components/contacts-selector/contacts-selector.service.d.ts +10 -0
- package/lib/components/contacts-selector/lib-exports.d.ts +5 -0
- package/lib/components/contactus-module.base.component.d.ts +4 -0
- package/lib/components/inlist-options/inlist-age-group.component.d.ts +12 -0
- package/lib/components/inlist-options/inlist-options.component.d.ts +18 -0
- package/lib/components/invite-links/invite-links.component.d.ts +28 -0
- package/lib/components/lib-exports.d.ts +27 -0
- package/lib/components/members-as-badges/contacts-as-badges.component.d.ts +18 -0
- package/lib/components/members-as-badges/index.d.ts +1 -0
- package/lib/components/members-by-role/family-members.component.d.ts +21 -0
- package/lib/components/members-by-role/index.d.ts +3 -0
- package/lib/components/members-by-role/member-group.d.ts +9 -0
- package/lib/components/members-by-role/members-by-role.component.d.ts +12 -0
- package/lib/components/members-card-header/members-card-header.component.d.ts +13 -0
- package/lib/components/members-list/index.d.ts +1 -0
- package/lib/components/members-list/members-list.component.d.ts +32 -0
- package/lib/components/members-short-list-card/members-short-list-card.component.d.ts +12 -0
- package/lib/components/shared-with/index.d.ts +1 -0
- package/lib/components/shared-with/shared-with.component.d.ts +6 -0
- package/lib/components/with-new-contact-input.d.ts +10 -0
- package/lib/constants.d.ts +13 -0
- package/lib/index.d.ts +2 -0
- package/lib/modals/contact-names-modal/contact-names-modal.component.d.ts +15 -0
- package/lib/modals/invite-modal/index.d.ts +1 -0
- package/lib/modals/invite-modal/invite-modal.component.d.ts +49 -0
- package/lib/pipes/contact-title.pipe.d.ts +10 -0
- package/lib/pipes/index.d.ts +3 -0
- package/lib/pipes/person-title.pipe.d.ts +9 -0
- package/lib/pipes/selected-contacts.pipe.d.ts +8 -0
- package/lib/providers/user-space-brief.provider.d.ts +12 -0
- package/lib/ui-types.d.ts +9 -0
- package/package.json +27 -0
- package/sneat-contactus-shared.d.ts +5 -0
- package/tsconfig.lib.prod.tsbuildinfo +1 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { Component, effect, EventEmitter, input, Input, Output, signal, inject, } from '@angular/core';
|
|
2
|
+
import { IonButton, IonButtons, IonIcon, IonItem, IonItemDivider, IonItemGroup, IonItemSliding, IonLabel, IonSpinner, } from '@ionic/angular/standalone';
|
|
3
|
+
import { eq, listItemAnimations } from '@sneat/core';
|
|
4
|
+
import { isContactPassFilter, } from '@sneat/contactus-core';
|
|
5
|
+
import { ContactNavService } from '@sneat/contactus-services';
|
|
6
|
+
import { ClassName, SneatBaseComponent } from '@sneat/ui';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
import { ContactsListItemComponent } from '../contacts-list';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export class ContactsByTypeComponent extends SneatBaseComponent {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.contactNavService = inject(ContactNavService);
|
|
14
|
+
this.$space = input.required(...(ngDevMode ? [{ debugName: "$space" }] : []));
|
|
15
|
+
this.$contactGroupDefinitions = input.required(...(ngDevMode ? [{ debugName: "$contactGroupDefinitions" }] : []));
|
|
16
|
+
this.$contacts = input.required(...(ngDevMode ? [{ debugName: "$contacts" }] : []));
|
|
17
|
+
this.contactsChange = new EventEmitter();
|
|
18
|
+
this.$otherContacts = signal(undefined, ...(ngDevMode ? [{ debugName: "$otherContacts" }] : []));
|
|
19
|
+
this.$contactGroups = signal([], ...(ngDevMode ? [{ debugName: "$contactGroups" }] : []));
|
|
20
|
+
//
|
|
21
|
+
this.$filter = input.required(...(ngDevMode ? [{ debugName: "$filter" }] : []));
|
|
22
|
+
// @Input() contacts?: readonly IContactWithSpace[];
|
|
23
|
+
this.contactClicked = (event, contact) => {
|
|
24
|
+
this.console.log(`ContactsByTypeComponent.contactClicked(contact{id=${contact.id}})`);
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
event.stopPropagation();
|
|
27
|
+
};
|
|
28
|
+
this.contactSelectionChange = new EventEmitter();
|
|
29
|
+
this.goToNewContactPage = true;
|
|
30
|
+
this.addContactClick = new EventEmitter();
|
|
31
|
+
effect(() => {
|
|
32
|
+
this.setContactGroups();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
ngOnChanges(changes) {
|
|
36
|
+
if (changes['contacts'] || changes['filter']) {
|
|
37
|
+
this.setContactGroups();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// hideRole(role: string): void {
|
|
41
|
+
// if (!this.commune.id) {
|
|
42
|
+
// throw new Error('!this.commune.id');
|
|
43
|
+
// }
|
|
44
|
+
// this.communeService.updateRecord(undefined, this.commune.id, dto => {
|
|
45
|
+
// if (!dto.noContactRoles) {
|
|
46
|
+
// dto = {...dto, noContactRoles: [role]};
|
|
47
|
+
// return {dto, changed: true};
|
|
48
|
+
// } else if (!dto.noContactRoles.includes(role)) {
|
|
49
|
+
// dto.noContactRoles.push(role);
|
|
50
|
+
// return {dto, changed: true};
|
|
51
|
+
// }
|
|
52
|
+
// return {dto, changed: false};
|
|
53
|
+
// }).subscribe(dto => {
|
|
54
|
+
// if (!dto) {
|
|
55
|
+
// throw new Error(`commune not found by id: ${this.commune.id}`);
|
|
56
|
+
// }
|
|
57
|
+
// this.commune = new Commune(dto);
|
|
58
|
+
// this.setContactGroups();
|
|
59
|
+
// });
|
|
60
|
+
// }
|
|
61
|
+
setContactGroups() {
|
|
62
|
+
this.$contactGroups.set([]);
|
|
63
|
+
const filter = this.$filter();
|
|
64
|
+
const contacts = this.$contacts();
|
|
65
|
+
const noContactRoles = this.$space().dbo?.noContactRoles;
|
|
66
|
+
let otherContacts = !filter
|
|
67
|
+
? contacts
|
|
68
|
+
: contacts &&
|
|
69
|
+
contacts.filter((c) => c.brief?.title?.toLowerCase().includes(filter));
|
|
70
|
+
const contactGroupDefinitions = this.$contactGroupDefinitions();
|
|
71
|
+
contactGroupDefinitions.forEach((group) => {
|
|
72
|
+
const rolesWithContacts = [];
|
|
73
|
+
group.dbo?.roles?.forEach((role) => {
|
|
74
|
+
let roleWithContacts = {
|
|
75
|
+
...role,
|
|
76
|
+
// We do not filter by text here as we want to show all contacts if role title contains the text
|
|
77
|
+
contacts: contacts?.filter((c) => c.brief?.roles?.includes(role.id)),
|
|
78
|
+
};
|
|
79
|
+
if (filter && role.brief.title.toLowerCase().includes(filter)) {
|
|
80
|
+
// Show all contacts in role that filtered by title
|
|
81
|
+
rolesWithContacts.push(roleWithContacts);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (roleWithContacts.contacts) {
|
|
85
|
+
roleWithContacts.contacts.forEach((c) => {
|
|
86
|
+
otherContacts = otherContacts?.filter((oc) => !eq(oc.id, c.id));
|
|
87
|
+
});
|
|
88
|
+
if (roleWithContacts.contacts.length && filter) {
|
|
89
|
+
roleWithContacts = {
|
|
90
|
+
...roleWithContacts,
|
|
91
|
+
contacts: roleWithContacts.contacts.filter((c) => isContactPassFilter(c, filter, role.id)),
|
|
92
|
+
};
|
|
93
|
+
if (roleWithContacts.contacts?.length) {
|
|
94
|
+
rolesWithContacts.push(roleWithContacts);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (!filter && (!noContactRoles || !noContactRoles.includes(role.id))) {
|
|
99
|
+
rolesWithContacts.push(roleWithContacts);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const groupWithContacts = {
|
|
103
|
+
...group.dbo,
|
|
104
|
+
id: group.id,
|
|
105
|
+
brief: {
|
|
106
|
+
title: group.dbo?.title || '',
|
|
107
|
+
},
|
|
108
|
+
roles: rolesWithContacts,
|
|
109
|
+
};
|
|
110
|
+
if (groupWithContacts.roles.length) {
|
|
111
|
+
this.$contactGroups.update((v) => [...v, groupWithContacts]);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
if (otherContacts?.length || this.$otherContacts()?.length) {
|
|
115
|
+
this.$otherContacts.set(otherContacts);
|
|
116
|
+
}
|
|
117
|
+
// console.log(
|
|
118
|
+
// 'ContactsByTypeComponent.setContactGroups()',
|
|
119
|
+
// this.$space(),
|
|
120
|
+
// filter,
|
|
121
|
+
// contacts,
|
|
122
|
+
// selectedContactIDsByRole,
|
|
123
|
+
// this.$contactGroups(),
|
|
124
|
+
// this.$otherContacts(),
|
|
125
|
+
// );
|
|
126
|
+
}
|
|
127
|
+
find(event) {
|
|
128
|
+
event.stopPropagation();
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
alert('Not implemented yet');
|
|
131
|
+
}
|
|
132
|
+
addContact(event, group, role) {
|
|
133
|
+
event.stopPropagation();
|
|
134
|
+
if (!this.goToNewContactPage) {
|
|
135
|
+
this.addContactClick.emit({
|
|
136
|
+
event,
|
|
137
|
+
role: role,
|
|
138
|
+
group: group,
|
|
139
|
+
});
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (!this.$space().id) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
this.contactNavService.goNewContactPage(this.$space(), {
|
|
146
|
+
group: group.id,
|
|
147
|
+
role: role?.id,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// private readonly $checkedContactIDs = signal<readonly string[]>([]);
|
|
151
|
+
checkChanged(args, role) {
|
|
152
|
+
this.contactsChange.emit(this.$contacts()?.map((c) => c.id === args.id ? Object.assign(c, { isChecked: args.checked }) : c));
|
|
153
|
+
this.contactSelectionChange.emit({ ...args, role });
|
|
154
|
+
}
|
|
155
|
+
ngOnInit() {
|
|
156
|
+
this.command?.pipe(this.takeUntilDestroyed()).subscribe((command) => {
|
|
157
|
+
// console.log('ContactsByTypeComponent: command$ =>', command);
|
|
158
|
+
switch (command.name) {
|
|
159
|
+
case 'reset_selected': {
|
|
160
|
+
this.contactsChange.emit(this.$contacts()?.map((c) => c.isChecked ? Object.assign(c, { isChecked: false }) : c));
|
|
161
|
+
this.setContactGroups();
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
case 'select_all': {
|
|
165
|
+
throw new Error('Not implemented yet');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ContactsByTypeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
171
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ContactsByTypeComponent, isStandalone: true, selector: "sneat-contacts-by-type", inputs: { $space: { classPropertyName: "$space", publicName: "$space", isSignal: true, isRequired: true, transformFunction: null }, $contactGroupDefinitions: { classPropertyName: "$contactGroupDefinitions", publicName: "$contactGroupDefinitions", isSignal: true, isRequired: true, transformFunction: null }, $contacts: { classPropertyName: "$contacts", publicName: "$contacts", isSignal: true, isRequired: true, transformFunction: null }, $filter: { classPropertyName: "$filter", publicName: "$filter", isSignal: true, isRequired: true, transformFunction: null }, contactClicked: { classPropertyName: "contactClicked", publicName: "contactClicked", isSignal: false, isRequired: false, transformFunction: null }, command: { classPropertyName: "command", publicName: "command", isSignal: false, isRequired: false, transformFunction: null }, goToNewContactPage: { classPropertyName: "goToNewContactPage", publicName: "goToNewContactPage", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { contactsChange: "contactsChange", contactSelectionChange: "contactSelectionChange", addContactClick: "addContactClick" }, providers: [{ provide: ClassName, useValue: 'ContactsByTypeComponent' }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "@for (\n contactGroup of $contactGroups();\n track contactGroup.id;\n let isLastContactGroup = $last\n) {\n <ion-item-group @listItem>\n <ion-item color=\"light\" lines=\"full\" class=\"sneat-tiny-end-padding\">\n <ion-label>{{ contactGroup.brief.title }}</ion-label>\n <ion-buttons slot=\"end\">\n <ion-button color=\"tertiary\" (click)=\"addContact($event, contactGroup)\">\n <ion-icon name=\"add\" slot=\"start\" />\n <ion-label>Add contact</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-item>\n @for (role of contactGroup.roles; track role.id; let lastRole = $last) {\n <ion-item\n class=\"sneat-tiny-end-padding\"\n [lines]=\"lastRole && isLastContactGroup ? 'none' : 'full'\"\n >\n <ion-label color=\"medium\">\n <span class=\"ion-margin-end\">{{ role.brief.emoji }}</span>\n <b class=\"ion-margin-end\">{{\n role.brief.titlePlural || role.brief.title\n }}</b>\n —\n <i class=\"ion-margin-start\">\n @if (!role.contacts) {\n loading...\n } @else {\n @switch (role.contacts.length) {\n @case (0) {\n not added yet\n }\n @default {\n {{ role.contacts.length }}\n }\n }\n }\n </i>\n </ion-label>\n @if (!role.contacts) {\n <ion-spinner name=\"lines-small\" color=\"medium\" slot=\"end\" />\n }\n <ion-buttons slot=\"end\">\n @if (role.brief.finder) {\n <ion-button\n target=\"_blank\"\n color=\"medium\"\n [href]=\"'https:' + role.brief.finder\"\n [title]=\"'Find at https://' + role.brief.finder\"\n (click)=\"find($event)\"\n >\n Find\n </ion-button>\n }\n <ion-button\n color=\"tertiary\"\n (click)=\"addContact($event, contactGroup, role)\"\n >\n <ion-icon name=\"add-outline\" slot=\"start\" />\n <ion-label>Add</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-item>\n @for (\n contact of role.contacts;\n track contact.id;\n let lastContact = $last\n ) {\n <ion-item-sliding @listItem>\n <sneat-contacts-list-item\n [$space]=\"$space()\"\n [$contact]=\"contact\"\n [contactClicked]=\"contactClicked\"\n [showBorder]=\"lastContact ? 'full' : 'inset'\"\n (checkChange)=\"checkChanged($event, role.id)\"\n />\n </ion-item-sliding>\n }\n }\n </ion-item-group>\n}\n\n@if ($otherContacts()?.length) {\n <ion-item-group @listItem>\n <ion-item-divider color=\"light\">\n <ion-label>Other</ion-label>\n </ion-item-divider>\n @for (contact of $contacts() || []; track contact.id) {\n <ion-item-sliding @listItem>\n <sneat-contacts-list-item\n [$space]=\"$space()\"\n [$contact]=\"contact\"\n [contactClicked]=\"contactClicked\"\n />\n </ion-item-sliding>\n }\n </ion-item-group>\n}\n", dependencies: [{ kind: "component", type: ContactsListItemComponent, selector: "sneat-contacts-list-item", inputs: ["$contact", "$space", "hideCheckbox", "excludeRole", "showAddress", "showBorder", "hideRoles", "relatedTo", "showRelatedAs", "showRelatedItems", "contactClicked"], outputs: ["checkChange"] }, { kind: "component", type: IonItemGroup, selector: "ion-item-group" }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonItemSliding, selector: "ion-item-sliding", inputs: ["disabled"] }, { kind: "component", type: IonItemDivider, selector: "ion-item-divider", inputs: ["color", "mode", "sticky"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }], animations: [listItemAnimations] }); }
|
|
172
|
+
}
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ContactsByTypeComponent, decorators: [{
|
|
174
|
+
type: Component,
|
|
175
|
+
args: [{ imports: [
|
|
176
|
+
ContactsListItemComponent,
|
|
177
|
+
IonItemGroup,
|
|
178
|
+
IonItem,
|
|
179
|
+
IonLabel,
|
|
180
|
+
IonButtons,
|
|
181
|
+
IonButton,
|
|
182
|
+
IonIcon,
|
|
183
|
+
IonItemSliding,
|
|
184
|
+
IonItemDivider,
|
|
185
|
+
IonSpinner,
|
|
186
|
+
], providers: [{ provide: ClassName, useValue: 'ContactsByTypeComponent' }], selector: 'sneat-contacts-by-type', animations: [listItemAnimations], template: "@for (\n contactGroup of $contactGroups();\n track contactGroup.id;\n let isLastContactGroup = $last\n) {\n <ion-item-group @listItem>\n <ion-item color=\"light\" lines=\"full\" class=\"sneat-tiny-end-padding\">\n <ion-label>{{ contactGroup.brief.title }}</ion-label>\n <ion-buttons slot=\"end\">\n <ion-button color=\"tertiary\" (click)=\"addContact($event, contactGroup)\">\n <ion-icon name=\"add\" slot=\"start\" />\n <ion-label>Add contact</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-item>\n @for (role of contactGroup.roles; track role.id; let lastRole = $last) {\n <ion-item\n class=\"sneat-tiny-end-padding\"\n [lines]=\"lastRole && isLastContactGroup ? 'none' : 'full'\"\n >\n <ion-label color=\"medium\">\n <span class=\"ion-margin-end\">{{ role.brief.emoji }}</span>\n <b class=\"ion-margin-end\">{{\n role.brief.titlePlural || role.brief.title\n }}</b>\n —\n <i class=\"ion-margin-start\">\n @if (!role.contacts) {\n loading...\n } @else {\n @switch (role.contacts.length) {\n @case (0) {\n not added yet\n }\n @default {\n {{ role.contacts.length }}\n }\n }\n }\n </i>\n </ion-label>\n @if (!role.contacts) {\n <ion-spinner name=\"lines-small\" color=\"medium\" slot=\"end\" />\n }\n <ion-buttons slot=\"end\">\n @if (role.brief.finder) {\n <ion-button\n target=\"_blank\"\n color=\"medium\"\n [href]=\"'https:' + role.brief.finder\"\n [title]=\"'Find at https://' + role.brief.finder\"\n (click)=\"find($event)\"\n >\n Find\n </ion-button>\n }\n <ion-button\n color=\"tertiary\"\n (click)=\"addContact($event, contactGroup, role)\"\n >\n <ion-icon name=\"add-outline\" slot=\"start\" />\n <ion-label>Add</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-item>\n @for (\n contact of role.contacts;\n track contact.id;\n let lastContact = $last\n ) {\n <ion-item-sliding @listItem>\n <sneat-contacts-list-item\n [$space]=\"$space()\"\n [$contact]=\"contact\"\n [contactClicked]=\"contactClicked\"\n [showBorder]=\"lastContact ? 'full' : 'inset'\"\n (checkChange)=\"checkChanged($event, role.id)\"\n />\n </ion-item-sliding>\n }\n }\n </ion-item-group>\n}\n\n@if ($otherContacts()?.length) {\n <ion-item-group @listItem>\n <ion-item-divider color=\"light\">\n <ion-label>Other</ion-label>\n </ion-item-divider>\n @for (contact of $contacts() || []; track contact.id) {\n <ion-item-sliding @listItem>\n <sneat-contacts-list-item\n [$space]=\"$space()\"\n [$contact]=\"contact\"\n [contactClicked]=\"contactClicked\"\n />\n </ion-item-sliding>\n }\n </ion-item-group>\n}\n" }]
|
|
187
|
+
}], ctorParameters: () => [], propDecorators: { $space: [{ type: i0.Input, args: [{ isSignal: true, alias: "$space", required: true }] }], $contactGroupDefinitions: [{ type: i0.Input, args: [{ isSignal: true, alias: "$contactGroupDefinitions", required: true }] }], $contacts: [{ type: i0.Input, args: [{ isSignal: true, alias: "$contacts", required: true }] }], contactsChange: [{
|
|
188
|
+
type: Output
|
|
189
|
+
}], $filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "$filter", required: true }] }], contactClicked: [{
|
|
190
|
+
type: Input
|
|
191
|
+
}], command: [{
|
|
192
|
+
type: Input
|
|
193
|
+
}], contactSelectionChange: [{
|
|
194
|
+
type: Output
|
|
195
|
+
}], goToNewContactPage: [{
|
|
196
|
+
type: Input
|
|
197
|
+
}], addContactClick: [{
|
|
198
|
+
type: Output
|
|
199
|
+
}] } });
|
|
200
|
+
//# sourceMappingURL=contacts-by-type.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts-by-type.component.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/contacts-by-type/contacts-by-type.component.ts","../../../../../../../../libs/contactus/shared/src/lib/components/contacts-by-type/contacts-by-type.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,YAAY,EACZ,KAAK,EACL,KAAK,EAGL,MAAM,EACN,MAAM,EAEN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,cAAc,EACd,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,EAAE,EAAa,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAOL,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIlC,OAAO,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AC,CAAC;IACL,CAAC;8GAnNU,uBAAuB;kGAAvB,uBAAuB,mrCALvB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,yBAAyB,EAAE,CAAC,sEChE1E,osGAoGA,4CD/CI,yBAAyB,4QACzB,YAAY,2DACZ,OAAO,0NACP,QAAQ,6FACR,UAAU,8EACV,SAAS,oPACT,OAAO,2JACP,cAAc,mFACd,cAAc,kGACd,UAAU,2FAKA,CAAC,kBAAkB,CAAC;;2FAErB,uBAAuB;kBAlBnC,SAAS;8BACC;wBACP,yBAAyB;wBACzB,YAAY;wBACZ,OAAO;wBACP,QAAQ;wBACR,UAAU;wBACV,SAAS;wBACT,OAAO;wBACP,cAAc;wBACd,cAAc;wBACd,UAAU;qBACX,aACU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,yBAAyB,EAAE,CAAC,YAC9D,wBAAwB,cAEtB,CAAC,kBAAkB,CAAC;;sBAiB/B,MAAM;;sBAYN,KAAK;;sBASL,KAAK;;sBAEL,MAAM;;sBAIN,KAAK;;sBACL,MAAM","sourcesContent":["import {\n Component,\n effect,\n EventEmitter,\n input,\n Input,\n OnChanges,\n OnInit,\n Output,\n signal,\n SimpleChanges,\n inject,\n} from '@angular/core';\nimport {\n IonButton,\n IonButtons,\n IonIcon,\n IonItem,\n IonItemDivider,\n IonItemGroup,\n IonItemSliding,\n IonLabel,\n IonSpinner,\n} from '@ionic/angular/standalone';\nimport { eq, IIdAndDbo, listItemAnimations } from '@sneat/core';\nimport {\n ContactGroupWithIdAndBrief,\n ContactRole,\n IContactRoleWithIdAndBrief,\n IContactGroupDbo,\n IContactWithBrief,\n IContactWithCheck,\n isContactPassFilter,\n} from '@sneat/contactus-core';\nimport { ContactNavService } from '@sneat/contactus-services';\nimport { ISpaceContext } from '@sneat/space-models';\nimport { ClassName, SneatBaseComponent } from '@sneat/ui';\nimport { Observable } from 'rxjs';\nimport { IContactAddEventArgs } from '../contact-events';\nimport { ICheckChangedArgs } from '../contacts-checklist';\nimport { ContactsComponentCommand } from '../contacts-component.commands';\nimport { ContactsListItemComponent } from '../contacts-list';\nimport {\n IContactGroupWithContacts,\n IContactRoleWithContacts,\n} from '../../ui-types';\n\nexport interface IRoleContactCheckChangedArgs extends ICheckChangedArgs {\n role: ContactRole;\n}\n\n@Component({\n imports: [\n ContactsListItemComponent,\n IonItemGroup,\n IonItem,\n IonLabel,\n IonButtons,\n IonButton,\n IonIcon,\n IonItemSliding,\n IonItemDivider,\n IonSpinner,\n ],\n providers: [{ provide: ClassName, useValue: 'ContactsByTypeComponent' }],\n selector: 'sneat-contacts-by-type',\n templateUrl: './contacts-by-type.component.html',\n animations: [listItemAnimations],\n})\nexport class ContactsByTypeComponent\n extends SneatBaseComponent\n implements OnChanges, OnInit\n{\n private readonly contactNavService = inject(ContactNavService);\n\n public readonly $space = input.required<ISpaceContext>();\n\n public readonly $contactGroupDefinitions =\n input.required<readonly IIdAndDbo<IContactGroupDbo>[]>();\n\n public readonly $contacts = input.required<\n readonly IContactWithCheck[] | undefined\n >();\n\n @Output() readonly contactsChange = new EventEmitter<IContactWithCheck[]>();\n\n protected readonly $otherContacts = signal<\n readonly IContactWithBrief[] | undefined\n >(undefined);\n protected readonly $contactGroups = signal<\n readonly IContactGroupWithContacts[]\n >([]);\n\n //\n public readonly $filter = input.required<string>();\n // @Input() contacts?: readonly IContactWithSpace[];\n @Input() contactClicked: (event: Event, contact: IContactWithBrief) => void =\n (event: Event, contact: IContactWithBrief) => {\n this.console.log(\n `ContactsByTypeComponent.contactClicked(contact{id=${contact.id}})`,\n );\n event.preventDefault();\n event.stopPropagation();\n };\n\n @Input() command?: Observable<ContactsComponentCommand>;\n\n @Output()\n public readonly contactSelectionChange =\n new EventEmitter<IRoleContactCheckChangedArgs>();\n\n @Input() goToNewContactPage = true;\n @Output() readonly addContactClick = new EventEmitter<IContactAddEventArgs>();\n\n constructor() {\n super();\n effect(() => {\n this.setContactGroups();\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['contacts'] || changes['filter']) {\n this.setContactGroups();\n }\n }\n\n // hideRole(role: string): void {\n // \tif (!this.commune.id) {\n // \t\tthrow new Error('!this.commune.id');\n // \t}\n // \tthis.communeService.updateRecord(undefined, this.commune.id, dto => {\n // \t\tif (!dto.noContactRoles) {\n // \t\t\tdto = {...dto, noContactRoles: [role]};\n // \t\t\treturn {dto, changed: true};\n // \t\t} else if (!dto.noContactRoles.includes(role)) {\n // \t\t\tdto.noContactRoles.push(role);\n // \t\t\treturn {dto, changed: true};\n // \t\t}\n // \t\treturn {dto, changed: false};\n // \t}).subscribe(dto => {\n // \t\tif (!dto) {\n // \t\t\tthrow new Error(`commune not found by id: ${this.commune.id}`);\n // \t\t}\n // \t\tthis.commune = new Commune(dto);\n // \t\tthis.setContactGroups();\n // \t});\n // }\n\n private setContactGroups(): void {\n this.$contactGroups.set([]);\n const filter = this.$filter();\n const contacts = this.$contacts();\n const noContactRoles = this.$space().dbo?.noContactRoles;\n let otherContacts = !filter\n ? contacts\n : contacts &&\n contacts.filter((c) => c.brief?.title?.toLowerCase().includes(filter));\n\n const contactGroupDefinitions = this.$contactGroupDefinitions();\n\n contactGroupDefinitions.forEach((group) => {\n const rolesWithContacts: IContactRoleWithContacts[] = [];\n group.dbo?.roles?.forEach((role) => {\n let roleWithContacts: IContactRoleWithContacts = {\n ...role,\n // We do not filter by text here as we want to show all contacts if role title contains the text\n contacts: contacts?.filter((c) => c.brief?.roles?.includes(role.id)),\n };\n if (filter && role.brief.title.toLowerCase().includes(filter)) {\n // Show all contacts in role that filtered by title\n rolesWithContacts.push(roleWithContacts);\n return;\n }\n if (roleWithContacts.contacts) {\n roleWithContacts.contacts.forEach((c) => {\n otherContacts = otherContacts?.filter((oc) => !eq(oc.id, c.id));\n });\n if (roleWithContacts.contacts.length && filter) {\n roleWithContacts = {\n ...roleWithContacts,\n contacts: roleWithContacts.contacts.filter((c) =>\n isContactPassFilter(c, filter, role.id),\n ),\n };\n if (roleWithContacts.contacts?.length) {\n rolesWithContacts.push(roleWithContacts);\n }\n }\n }\n if (!filter && (!noContactRoles || !noContactRoles.includes(role.id))) {\n rolesWithContacts.push(roleWithContacts);\n }\n });\n\n const groupWithContacts: IContactGroupWithContacts = {\n ...group.dbo,\n id: group.id,\n brief: {\n title: group.dbo?.title || '',\n },\n roles: rolesWithContacts,\n };\n\n if (groupWithContacts.roles.length) {\n this.$contactGroups.update((v) => [...v, groupWithContacts]);\n }\n });\n if (otherContacts?.length || this.$otherContacts()?.length) {\n this.$otherContacts.set(otherContacts);\n }\n // console.log(\n // \t'ContactsByTypeComponent.setContactGroups()',\n // \tthis.$space(),\n // \tfilter,\n // \tcontacts,\n // \tselectedContactIDsByRole,\n // \tthis.$contactGroups(),\n // \tthis.$otherContacts(),\n // );\n }\n\n protected find(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n alert('Not implemented yet');\n }\n\n protected addContact(\n event: Event,\n group: ContactGroupWithIdAndBrief,\n role?: IContactRoleWithIdAndBrief,\n ): void {\n event.stopPropagation();\n if (!this.goToNewContactPage) {\n this.addContactClick.emit({\n event,\n role: role,\n group: group,\n });\n return;\n }\n if (!this.$space().id) {\n return;\n }\n this.contactNavService.goNewContactPage(this.$space(), {\n group: group.id,\n role: role?.id,\n });\n }\n\n // private readonly $checkedContactIDs = signal<readonly string[]>([]);\n\n protected checkChanged(args: ICheckChangedArgs, role: ContactRole): void {\n this.contactsChange.emit(\n this.$contacts()?.map((c) =>\n c.id === args.id ? Object.assign(c, { isChecked: args.checked }) : c,\n ),\n );\n this.contactSelectionChange.emit({ ...args, role });\n }\n\n public ngOnInit(): void {\n this.command?.pipe(this.takeUntilDestroyed()).subscribe((command) => {\n // console.log('ContactsByTypeComponent: command$ =>', command);\n switch (command.name) {\n case 'reset_selected': {\n this.contactsChange.emit(\n this.$contacts()?.map((c) =>\n c.isChecked ? Object.assign(c, { isChecked: false }) : c,\n ),\n );\n this.setContactGroups();\n break;\n }\n case 'select_all': {\n throw new Error('Not implemented yet');\n }\n }\n });\n }\n}\n","@for (\n contactGroup of $contactGroups();\n track contactGroup.id;\n let isLastContactGroup = $last\n) {\n <ion-item-group @listItem>\n <ion-item color=\"light\" lines=\"full\" class=\"sneat-tiny-end-padding\">\n <ion-label>{{ contactGroup.brief.title }}</ion-label>\n <ion-buttons slot=\"end\">\n <ion-button color=\"tertiary\" (click)=\"addContact($event, contactGroup)\">\n <ion-icon name=\"add\" slot=\"start\" />\n <ion-label>Add contact</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-item>\n @for (role of contactGroup.roles; track role.id; let lastRole = $last) {\n <ion-item\n class=\"sneat-tiny-end-padding\"\n [lines]=\"lastRole && isLastContactGroup ? 'none' : 'full'\"\n >\n <ion-label color=\"medium\">\n <span class=\"ion-margin-end\">{{ role.brief.emoji }}</span>\n <b class=\"ion-margin-end\">{{\n role.brief.titlePlural || role.brief.title\n }}</b>\n —\n <i class=\"ion-margin-start\">\n @if (!role.contacts) {\n loading...\n } @else {\n @switch (role.contacts.length) {\n @case (0) {\n not added yet\n }\n @default {\n {{ role.contacts.length }}\n }\n }\n }\n </i>\n </ion-label>\n @if (!role.contacts) {\n <ion-spinner name=\"lines-small\" color=\"medium\" slot=\"end\" />\n }\n <ion-buttons slot=\"end\">\n @if (role.brief.finder) {\n <ion-button\n target=\"_blank\"\n color=\"medium\"\n [href]=\"'https:' + role.brief.finder\"\n [title]=\"'Find at https://' + role.brief.finder\"\n (click)=\"find($event)\"\n >\n Find\n </ion-button>\n }\n <ion-button\n color=\"tertiary\"\n (click)=\"addContact($event, contactGroup, role)\"\n >\n <ion-icon name=\"add-outline\" slot=\"start\" />\n <ion-label>Add</ion-label>\n </ion-button>\n </ion-buttons>\n </ion-item>\n @for (\n contact of role.contacts;\n track contact.id;\n let lastContact = $last\n ) {\n <ion-item-sliding @listItem>\n <sneat-contacts-list-item\n [$space]=\"$space()\"\n [$contact]=\"contact\"\n [contactClicked]=\"contactClicked\"\n [showBorder]=\"lastContact ? 'full' : 'inset'\"\n (checkChange)=\"checkChanged($event, role.id)\"\n />\n </ion-item-sliding>\n }\n }\n </ion-item-group>\n}\n\n@if ($otherContacts()?.length) {\n <ion-item-group @listItem>\n <ion-item-divider color=\"light\">\n <ion-label>Other</ion-label>\n </ion-item-divider>\n @for (contact of $contacts() || []; track contact.id) {\n <ion-item-sliding @listItem>\n <sneat-contacts-list-item\n [$space]=\"$space()\"\n [$contact]=\"contact\"\n [contactClicked]=\"contactClicked\"\n />\n </ion-item-sliding>\n }\n </ion-item-group>\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/contacts-by-type/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './contacts-by-type.component';\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, EventEmitter, input, Output, } from '@angular/core';
|
|
2
|
+
import { IonCheckbox, IonItem, IonSpinner } from '@ionic/angular/standalone';
|
|
3
|
+
import { PersonNamesPipe } from '@sneat/auth-ui';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export class ContactsChecklistItemComponent {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.$contact = input.required(...(ngDevMode ? [{ debugName: "$contact" }] : []));
|
|
8
|
+
this.$contactID = computed(() => this.$contact().id, ...(ngDevMode ? [{ debugName: "$contactID" }] : []));
|
|
9
|
+
this.$isLast = input.required(...(ngDevMode ? [{ debugName: "$isLast" }] : []));
|
|
10
|
+
this.$lastItemLine = input(...(ngDevMode ? [undefined, { debugName: "$lastItemLine" }] : []));
|
|
11
|
+
this.$checkedInProgress = input.required(...(ngDevMode ? [{ debugName: "$checkedInProgress" }] : []));
|
|
12
|
+
this.$uncheckedInProgress = input.required(...(ngDevMode ? [{ debugName: "$uncheckedInProgress" }] : []));
|
|
13
|
+
this.checkboxChange = new EventEmitter();
|
|
14
|
+
this.$isDisabled = computed(() => {
|
|
15
|
+
const contactID = this.$contactID();
|
|
16
|
+
return (this.$checkedInProgress().includes(contactID) ||
|
|
17
|
+
this.$uncheckedInProgress().includes(contactID));
|
|
18
|
+
}, ...(ngDevMode ? [{ debugName: "$isDisabled" }] : []));
|
|
19
|
+
}
|
|
20
|
+
onCheckboxChange(event, contact) {
|
|
21
|
+
this.checkboxChange.emit({ event, item: contact });
|
|
22
|
+
}
|
|
23
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ContactsChecklistItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
24
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ContactsChecklistItemComponent, isStandalone: true, selector: "sneat-contacts-checklist-item", inputs: { $contact: { classPropertyName: "$contact", publicName: "$contact", isSignal: true, isRequired: true, transformFunction: null }, $isLast: { classPropertyName: "$isLast", publicName: "$isLast", isSignal: true, isRequired: true, transformFunction: null }, $lastItemLine: { classPropertyName: "$lastItemLine", publicName: "$lastItemLine", isSignal: true, isRequired: false, transformFunction: null }, $checkedInProgress: { classPropertyName: "$checkedInProgress", publicName: "$checkedInProgress", isSignal: true, isRequired: true, transformFunction: null }, $uncheckedInProgress: { classPropertyName: "$uncheckedInProgress", publicName: "$uncheckedInProgress", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { checkboxChange: "checkboxChange" }, ngImport: i0, template: "@let contact = $contact();\n\n<ion-item [lines]=\"$isLast() ? $lastItemLine() : undefined\">\n <ion-checkbox\n labelPlacement=\"end\"\n justify=\"start\"\n [value]=\"$contact().id\"\n [checked]=\"contact.isChecked\"\n [disabled]=\"$isDisabled()\"\n (ionChange)=\"onCheckboxChange($event, contact)\"\n >\n {{ contact.brief.names | personNames }}\n <!--TODO: use pipe-->\n </ion-checkbox>\n @if ($isDisabled()) {\n <ion-spinner name=\"lines-small\" slot=\"end\" color=\"medium\" />\n }\n</ion-item>\n", dependencies: [{ kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonCheckbox, selector: "ion-checkbox", inputs: ["checked", "color", "disabled", "errorText", "helperText", "indeterminate", "justify", "labelPlacement", "mode", "name", "value"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "pipe", type: PersonNamesPipe, name: "personNames" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
25
|
+
}
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ContactsChecklistItemComponent, decorators: [{
|
|
27
|
+
type: Component,
|
|
28
|
+
args: [{ selector: 'sneat-contacts-checklist-item', changeDetection: ChangeDetectionStrategy.OnPush, imports: [IonItem, IonCheckbox, IonSpinner, PersonNamesPipe], template: "@let contact = $contact();\n\n<ion-item [lines]=\"$isLast() ? $lastItemLine() : undefined\">\n <ion-checkbox\n labelPlacement=\"end\"\n justify=\"start\"\n [value]=\"$contact().id\"\n [checked]=\"contact.isChecked\"\n [disabled]=\"$isDisabled()\"\n (ionChange)=\"onCheckboxChange($event, contact)\"\n >\n {{ contact.brief.names | personNames }}\n <!--TODO: use pipe-->\n </ion-checkbox>\n @if ($isDisabled()) {\n <ion-spinner name=\"lines-small\" slot=\"end\" color=\"medium\" />\n }\n</ion-item>\n" }]
|
|
29
|
+
}], propDecorators: { $contact: [{ type: i0.Input, args: [{ isSignal: true, alias: "$contact", required: true }] }], $isLast: [{ type: i0.Input, args: [{ isSignal: true, alias: "$isLast", required: true }] }], $lastItemLine: [{ type: i0.Input, args: [{ isSignal: true, alias: "$lastItemLine", required: false }] }], $checkedInProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "$checkedInProgress", required: true }] }], $uncheckedInProgress: [{ type: i0.Input, args: [{ isSignal: true, alias: "$uncheckedInProgress", required: true }] }], checkboxChange: [{
|
|
30
|
+
type: Output
|
|
31
|
+
}] } });
|
|
32
|
+
//# sourceMappingURL=contacts-checklist-item.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts-checklist-item.component.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/contacts-checklist/contacts-checklist-item.component.ts","../../../../../../../../libs/contactus/shared/src/lib/components/contacts-checklist/contacts-checklist-item.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;;AAcjD,MAAM,OAAO,8BAA8B;IAN3C;QAOkB,aAAQ,GAAG,KAAK,CAAC,QAAQ,mDAAqB,CAAC;QAC9C,eAAU,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,sDAAC,CAAC;QACjD,YAAO,GAAG,KAAK,CAAC,QAAQ,kDAAW,CAAC;QACpC,kBAAa,GAAG,KAAK,mEAElC,CAAC;QAEY,uBAAkB,GAAG,KAAK,CAAC,QAAQ,6DAAqB,CAAC;QACzD,yBAAoB,GAAG,KAAK,CAAC,QAAQ,+DAAqB,CAAC;QAEjD,mBAAc,GAAG,IAAI,YAAY,EAExD,CAAC;QAMe,gBAAW,GAAG,QAAQ,CAAC,GAAG,EAAE;YAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACpC,OAAO,CACL,IAAI,CAAC,kBAAkB,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAC7C,IAAI,CAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAChD,CAAC;QACJ,CAAC,uDAAC,CAAC;KACJ;IAXW,gBAAgB,CAAC,KAAY,EAAE,OAA0B;QACjE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;8GAjBU,8BAA8B;kGAA9B,8BAA8B,m2BCvB3C,ohBAkBA,4CDGY,OAAO,0NAAE,WAAW,qMAAE,UAAU,oGAAE,eAAe;;2FAEhD,8BAA8B;kBAN1C,SAAS;+BACE,+BAA+B,mBAExB,uBAAuB,CAAC,MAAM,WACtC,CAAC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,CAAC;;sBAa3D,MAAM","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n EventEmitter,\n input,\n Output,\n} from '@angular/core';\nimport { IonCheckbox, IonItem, IonSpinner } from '@ionic/angular/standalone';\nimport { PersonNamesPipe } from '@sneat/auth-ui';\nimport { IContactWithBrief, IContactWithCheck } from '@sneat/contactus-core';\n\ninterface IItemWithEvent<T> {\n event: Event;\n item: T;\n}\n\n@Component({\n selector: 'sneat-contacts-checklist-item',\n templateUrl: 'contacts-checklist-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [IonItem, IonCheckbox, IonSpinner, PersonNamesPipe],\n})\nexport class ContactsChecklistItemComponent {\n public readonly $contact = input.required<IContactWithCheck>();\n private readonly $contactID = computed(() => this.$contact().id);\n public readonly $isLast = input.required<boolean>();\n public readonly $lastItemLine = input<\n undefined | 'full' | 'none' | 'inset'\n >();\n\n public readonly $checkedInProgress = input.required<readonly string[]>();\n public readonly $uncheckedInProgress = input.required<readonly string[]>();\n\n @Output() public readonly checkboxChange = new EventEmitter<\n IItemWithEvent<IContactWithBrief>\n >();\n\n protected onCheckboxChange(event: Event, contact: IContactWithBrief): void {\n this.checkboxChange.emit({ event, item: contact });\n }\n\n protected readonly $isDisabled = computed(() => {\n const contactID = this.$contactID();\n return (\n this.$checkedInProgress().includes(contactID) ||\n this.$uncheckedInProgress().includes(contactID)\n );\n });\n}\n","@let contact = $contact();\n\n<ion-item [lines]=\"$isLast() ? $lastItemLine() : undefined\">\n <ion-checkbox\n labelPlacement=\"end\"\n justify=\"start\"\n [value]=\"$contact().id\"\n [checked]=\"contact.isChecked\"\n [disabled]=\"$isDisabled()\"\n (ionChange)=\"onCheckboxChange($event, contact)\"\n >\n {{ contact.brief.names | personNames }}\n <!--TODO: use pipe-->\n </ion-checkbox>\n @if ($isDisabled()) {\n <ion-spinner name=\"lines-small\" slot=\"end\" color=\"medium\" />\n }\n</ion-item>\n"]}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, input, Input, Output, signal, computed, effect, inject, } from '@angular/core';
|
|
2
|
+
import { IonItem, IonLabel } from '@ionic/angular/standalone';
|
|
3
|
+
import { ContactusSpaceService } from '@sneat/contactus-services';
|
|
4
|
+
import { addSpace, } from '@sneat/contactus-core';
|
|
5
|
+
import { computeSpaceIdFromSpaceRef, computeSpaceRefFromSpaceContext, } from '@sneat/space-models';
|
|
6
|
+
import { ClassName, SneatBaseComponent } from '@sneat/ui';
|
|
7
|
+
import { ContactsChecklistItemComponent } from './contacts-checklist-item.component';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export class ContactsChecklistComponent extends SneatBaseComponent {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
13
|
+
this.contactusSpaceService = inject(ContactusSpaceService);
|
|
14
|
+
this.$lastItemLine = input(...(ngDevMode ? [undefined, { debugName: "$lastItemLine" }] : []));
|
|
15
|
+
this.$spaceRoles = input(['member'], ...(ngDevMode ? [{ debugName: "$spaceRoles" }] : []));
|
|
16
|
+
this.$spaceRolesToExclude = input(...(ngDevMode ? [undefined, { debugName: "$spaceRolesToExclude" }] : []));
|
|
17
|
+
this.$onlySelected = input(false, ...(ngDevMode ? [{ debugName: "$onlySelected" }] : []));
|
|
18
|
+
this.$checkedContactIDs = input.required(...(ngDevMode ? [{ debugName: "$checkedContactIDs" }] : []));
|
|
19
|
+
this.$checkedContactIDsOfSpace = computed(() => {
|
|
20
|
+
const suffix = '@' + this.$spaceID();
|
|
21
|
+
const checkedContactIDs = this.$checkedContactIDs();
|
|
22
|
+
return checkedContactIDs
|
|
23
|
+
?.filter((id) => !id.includes('@') || id.endsWith(suffix))
|
|
24
|
+
.map((id) => (id.includes('@') ? id.slice(0, -suffix.length) : id));
|
|
25
|
+
}, ...(ngDevMode ? [{ debugName: "$checkedContactIDsOfSpace" }] : []));
|
|
26
|
+
this.$space = input.required(...(ngDevMode ? [{ debugName: "$space" }] : []));
|
|
27
|
+
this.$spaceRef = computeSpaceRefFromSpaceContext(this.$space);
|
|
28
|
+
this.$spaceID = computeSpaceIdFromSpaceRef(this.$spaceRef);
|
|
29
|
+
this.roles = ['member'];
|
|
30
|
+
this.noContactsMessage = 'No members found';
|
|
31
|
+
this.checkedChange = new EventEmitter();
|
|
32
|
+
this.$spaceContacts = signal(undefined, ...(ngDevMode ? [{ debugName: "$spaceContacts" }] : []));
|
|
33
|
+
this.$contactsToDisplay = computed(() => {
|
|
34
|
+
const contacts = this.$spaceContacts(), roles = this.$spaceRoles(), rolesToExclude = this.$spaceRolesToExclude(), onlySelected = this.$onlySelected(), checkedInProgress = this.$checkedInProgress(), uncheckedInProgress = this.$uncheckedInProgress(), checkedContactIDs = this.$checkedContactIDsOfSpace();
|
|
35
|
+
const isSelected = (contactID) => !uncheckedInProgress.includes(contactID) &&
|
|
36
|
+
(checkedContactIDs?.includes(contactID) ||
|
|
37
|
+
checkedInProgress.includes(contactID));
|
|
38
|
+
const hasIncludedRole = roles.length
|
|
39
|
+
? (c) => roles.some((r) => c.brief?.roles?.includes(r))
|
|
40
|
+
: () => true;
|
|
41
|
+
const hasExcludedRole = rolesToExclude
|
|
42
|
+
? (c) => rolesToExclude.some((r) => c.brief?.roles?.includes(r))
|
|
43
|
+
: () => false;
|
|
44
|
+
if (!contacts) {
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
const spaceRef = this.$spaceRef();
|
|
48
|
+
return contacts
|
|
49
|
+
.filter((c) => hasIncludedRole(c) && !hasExcludedRole(c))
|
|
50
|
+
.map((c) => ({
|
|
51
|
+
id: c.id,
|
|
52
|
+
brief: c.brief,
|
|
53
|
+
isChecked: isSelected(c.id),
|
|
54
|
+
}))
|
|
55
|
+
.filter((c) => !onlySelected || c.isChecked)
|
|
56
|
+
.map(addSpace(spaceRef));
|
|
57
|
+
}, ...(ngDevMode ? [{ debugName: "$contactsToDisplay" }] : []));
|
|
58
|
+
this.contactID = (_, contact) => contact.id;
|
|
59
|
+
this.$checkedInProgress = signal([], ...(ngDevMode ? [{ debugName: "$checkedInProgress" }] : []));
|
|
60
|
+
this.$uncheckedInProgress = signal([], ...(ngDevMode ? [{ debugName: "$uncheckedInProgress" }] : []));
|
|
61
|
+
effect(() => {
|
|
62
|
+
const spaceID = this.$spaceID();
|
|
63
|
+
this.contactusSpaceSubscription?.unsubscribe();
|
|
64
|
+
if (spaceID) {
|
|
65
|
+
this.subscribeForContactBriefs(this.$spaceID());
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
subscribeForContactBriefs(spaceID) {
|
|
70
|
+
this.contactusSpaceSubscription = this.contactusSpaceService
|
|
71
|
+
.watchContactBriefs(spaceID)
|
|
72
|
+
.pipe(this.takeUntilDestroyed())
|
|
73
|
+
.subscribe({
|
|
74
|
+
next: (contacts) => {
|
|
75
|
+
this.$spaceContacts.set(contacts);
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
onCheckboxChange(event, contact) {
|
|
80
|
+
const ce = event;
|
|
81
|
+
const cID = contact.id;
|
|
82
|
+
const checked = !!ce.detail.checked;
|
|
83
|
+
if (checked) {
|
|
84
|
+
if (!this.$checkedInProgress().includes(cID)) {
|
|
85
|
+
this.$checkedInProgress.update((v) => [...v, cID]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else if (!this.$uncheckedInProgress().includes(cID)) {
|
|
89
|
+
this.$uncheckedInProgress.update((v) => [...v, cID]);
|
|
90
|
+
}
|
|
91
|
+
const clearInProgress = () => {
|
|
92
|
+
if (checked) {
|
|
93
|
+
this.$checkedInProgress.update((v) => v.filter((id) => id !== cID));
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
this.$uncheckedInProgress.update((v) => v.filter((id) => id !== cID));
|
|
97
|
+
}
|
|
98
|
+
this.changeDetectorRef.markForCheck();
|
|
99
|
+
};
|
|
100
|
+
new Promise((resolve, reject) => {
|
|
101
|
+
this.checkedChange.emit({
|
|
102
|
+
event: ce,
|
|
103
|
+
id: cID,
|
|
104
|
+
checked,
|
|
105
|
+
resolve,
|
|
106
|
+
reject,
|
|
107
|
+
});
|
|
108
|
+
})
|
|
109
|
+
.then(clearInProgress)
|
|
110
|
+
.catch((err) => {
|
|
111
|
+
this.errorLogger.logError(err);
|
|
112
|
+
// Restore checkbox state with a delay
|
|
113
|
+
// to allow users to see that check change was registered and processed
|
|
114
|
+
setTimeout(clearInProgress, 500);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ContactsChecklistComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
118
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: ContactsChecklistComponent, isStandalone: true, selector: "sneat-contacts-checklist", inputs: { $lastItemLine: { classPropertyName: "$lastItemLine", publicName: "$lastItemLine", isSignal: true, isRequired: false, transformFunction: null }, $spaceRoles: { classPropertyName: "$spaceRoles", publicName: "$spaceRoles", isSignal: true, isRequired: false, transformFunction: null }, $spaceRolesToExclude: { classPropertyName: "$spaceRolesToExclude", publicName: "$spaceRolesToExclude", isSignal: true, isRequired: false, transformFunction: null }, $onlySelected: { classPropertyName: "$onlySelected", publicName: "$onlySelected", isSignal: true, isRequired: false, transformFunction: null }, $checkedContactIDs: { classPropertyName: "$checkedContactIDs", publicName: "$checkedContactIDs", isSignal: true, isRequired: true, transformFunction: null }, $space: { classPropertyName: "$space", publicName: "$space", isSignal: true, isRequired: true, transformFunction: null }, roles: { classPropertyName: "roles", publicName: "roles", isSignal: false, isRequired: false, transformFunction: null }, noContactsMessage: { classPropertyName: "noContactsMessage", publicName: "noContactsMessage", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { checkedChange: "checkedChange" }, providers: [
|
|
119
|
+
{
|
|
120
|
+
provide: ClassName,
|
|
121
|
+
useValue: 'ContactsChecklistComponent',
|
|
122
|
+
},
|
|
123
|
+
], usesInheritance: true, ngImport: i0, template: "<!--$checkedContactIDsOfSpace: {{$checkedContactIDsOfSpace()}}-->\n@for (\n contact of $contactsToDisplay() || [];\n track contact.id;\n let last = $last\n) {\n <sneat-contacts-checklist-item\n [$contact]=\"contact\"\n [$isLast]=\"last\"\n [$lastItemLine]=\"$lastItemLine()\"\n [$checkedInProgress]=\"$checkedInProgress()\"\n [$uncheckedInProgress]=\"$uncheckedInProgress()\"\n (checkboxChange)=\"onCheckboxChange($event.event, $event.item)\"\n />\n} @empty {\n <ion-item>\n @if ($spaceContacts()) {\n <ion-label color=\"medium\">{{\n noContactsMessage || \"No contacts\"\n }}</ion-label>\n } @else {\n <ion-label>Loading...</ion-label>\n }\n </ion-item>\n}\n", dependencies: [{ kind: "component", type: ContactsChecklistItemComponent, selector: "sneat-contacts-checklist-item", inputs: ["$contact", "$isLast", "$lastItemLine", "$checkedInProgress", "$uncheckedInProgress"], outputs: ["checkboxChange"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
124
|
+
}
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ContactsChecklistComponent, decorators: [{
|
|
126
|
+
type: Component,
|
|
127
|
+
args: [{ selector: 'sneat-contacts-checklist', imports: [ContactsChecklistItemComponent, IonItem, IonLabel], providers: [
|
|
128
|
+
{
|
|
129
|
+
provide: ClassName,
|
|
130
|
+
useValue: 'ContactsChecklistComponent',
|
|
131
|
+
},
|
|
132
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!--$checkedContactIDsOfSpace: {{$checkedContactIDsOfSpace()}}-->\n@for (\n contact of $contactsToDisplay() || [];\n track contact.id;\n let last = $last\n) {\n <sneat-contacts-checklist-item\n [$contact]=\"contact\"\n [$isLast]=\"last\"\n [$lastItemLine]=\"$lastItemLine()\"\n [$checkedInProgress]=\"$checkedInProgress()\"\n [$uncheckedInProgress]=\"$uncheckedInProgress()\"\n (checkboxChange)=\"onCheckboxChange($event.event, $event.item)\"\n />\n} @empty {\n <ion-item>\n @if ($spaceContacts()) {\n <ion-label color=\"medium\">{{\n noContactsMessage || \"No contacts\"\n }}</ion-label>\n } @else {\n <ion-label>Loading...</ion-label>\n }\n </ion-item>\n}\n" }]
|
|
133
|
+
}], ctorParameters: () => [], propDecorators: { $lastItemLine: [{ type: i0.Input, args: [{ isSignal: true, alias: "$lastItemLine", required: false }] }], $spaceRoles: [{ type: i0.Input, args: [{ isSignal: true, alias: "$spaceRoles", required: false }] }], $spaceRolesToExclude: [{ type: i0.Input, args: [{ isSignal: true, alias: "$spaceRolesToExclude", required: false }] }], $onlySelected: [{ type: i0.Input, args: [{ isSignal: true, alias: "$onlySelected", required: false }] }], $checkedContactIDs: [{ type: i0.Input, args: [{ isSignal: true, alias: "$checkedContactIDs", required: true }] }], $space: [{ type: i0.Input, args: [{ isSignal: true, alias: "$space", required: true }] }], roles: [{
|
|
134
|
+
type: Input
|
|
135
|
+
}], noContactsMessage: [{
|
|
136
|
+
type: Input
|
|
137
|
+
}], checkedChange: [{
|
|
138
|
+
type: Output
|
|
139
|
+
}] } });
|
|
140
|
+
//# sourceMappingURL=contacts-checklist.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contacts-checklist.component.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/contacts-checklist/contacts-checklist.component.ts","../../../../../../../../libs/contactus/shared/src/lib/components/contacts-checklist/contacts-checklist.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EACL,QAAQ,GAGT,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,GAEhC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;;AAsBrF,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAqFhE;QACE,KAAK,EAAE,CAAC;QArFO,sBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAC9C,0BAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;QAEvD,kBAAa,GAAG,KAAK,mEAElC,CAAC;QAEY,gBAAW,GA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E,EAAE;YACpC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;gBACtB,KAAK,EAAE,EAAE;gBACT,EAAE,EAAE,GAAG;gBACP,OAAO;gBACP,OAAO;gBACP,MAAM;aACP,CAAC,CAAC;QACL,CAAC,CAAC;aACC,IAAI,CAAC,eAAe,CAAC;aACrB,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAE/B,sCAAsC;YACtC,uEAAuE;YACvE,UAAU,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACP,CAAC;8GAlJU,0BAA0B;kGAA1B,0BAA0B,6vCAR1B;YACT;gBACE,OAAO,EAAE,SAAS;gBAClB,QAAQ,EAAE,4BAA4B;aACvC;SACF,iDC9CH,6sBAyBA,4CDeY,8BAA8B,uMAAE,OAAO,0NAAE,QAAQ;;2FAShD,0BAA0B;kBAZtC,SAAS;+BACE,0BAA0B,WAE3B,CAAC,8BAA8B,EAAE,OAAO,EAAE,QAAQ,CAAC,aACjD;wBACT;4BACE,OAAO,EAAE,SAAS;4BAClB,QAAQ,EAAE,4BAA4B;yBACvC;qBACF,mBACgB,uBAAuB,CAAC,MAAM;;sBA8B9C,KAAK;;sBAEL,KAAK;;sBAEL,MAAM","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n input,\n Input,\n Output,\n signal,\n computed,\n effect,\n inject,\n} from '@angular/core';\nimport { IonItem, IonLabel } from '@ionic/angular/standalone';\nimport { ContactusSpaceService } from '@sneat/contactus-services';\nimport {\n addSpace,\n IContactWithBrief,\n IContactWithCheck,\n} from '@sneat/contactus-core';\nimport {\n computeSpaceIdFromSpaceRef,\n computeSpaceRefFromSpaceContext,\n ISpaceContext,\n} from '@sneat/space-models';\nimport { ClassName, SneatBaseComponent } from '@sneat/ui';\nimport { Subscription } from 'rxjs';\nimport { ContactsChecklistItemComponent } from './contacts-checklist-item.component';\n\nexport interface ICheckChangedArgs {\n event: Event;\n id: string;\n checked: boolean;\n resolve: () => void;\n reject: (reason?: unknown) => void;\n}\n\n@Component({\n selector: 'sneat-contacts-checklist',\n templateUrl: './contacts-checklist.component.html',\n imports: [ContactsChecklistItemComponent, IonItem, IonLabel],\n providers: [\n {\n provide: ClassName,\n useValue: 'ContactsChecklistComponent',\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ContactsChecklistComponent extends SneatBaseComponent {\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private readonly contactusSpaceService = inject(ContactusSpaceService);\n\n public readonly $lastItemLine = input<\n undefined | 'full' | 'none' | 'inset'\n >();\n\n public readonly $spaceRoles = input<readonly string[]>(['member']);\n public readonly $spaceRolesToExclude = input<undefined | readonly string[]>();\n public readonly $onlySelected = input<boolean>(false);\n public readonly $checkedContactIDs = input.required<\n readonly string[] | undefined\n >();\n\n protected readonly $checkedContactIDsOfSpace = computed(() => {\n const suffix = '@' + this.$spaceID();\n const checkedContactIDs = this.$checkedContactIDs();\n return checkedContactIDs\n ?.filter((id) => !id.includes('@') || id.endsWith(suffix))\n .map((id) => (id.includes('@') ? id.slice(0, -suffix.length) : id));\n });\n\n public readonly $space = input.required<ISpaceContext>();\n protected readonly $spaceRef = computeSpaceRefFromSpaceContext(this.$space);\n protected readonly $spaceID = computeSpaceIdFromSpaceRef(this.$spaceRef);\n\n space?: ISpaceContext;\n @Input() roles: string[] = ['member'];\n\n @Input() noContactsMessage = 'No members found';\n\n @Output() readonly checkedChange = new EventEmitter<ICheckChangedArgs>();\n\n private contactusSpaceSubscription?: Subscription;\n\n protected readonly $spaceContacts = signal<IContactWithBrief[] | undefined>(\n undefined,\n );\n\n protected readonly $contactsToDisplay = computed<\n undefined | readonly IContactWithCheck[]\n >(() => {\n const contacts = this.$spaceContacts(),\n roles = this.$spaceRoles(),\n rolesToExclude = this.$spaceRolesToExclude(),\n onlySelected = this.$onlySelected(),\n checkedInProgress = this.$checkedInProgress(),\n uncheckedInProgress = this.$uncheckedInProgress(),\n checkedContactIDs = this.$checkedContactIDsOfSpace();\n\n const isSelected = (contactID: string) =>\n !uncheckedInProgress.includes(contactID) &&\n (checkedContactIDs?.includes(contactID) ||\n checkedInProgress.includes(contactID));\n\n const hasIncludedRole = roles.length\n ? (c: IContactWithBrief) => roles.some((r) => c.brief?.roles?.includes(r))\n : () => true;\n\n const hasExcludedRole = rolesToExclude\n ? (c: IContactWithBrief) =>\n rolesToExclude.some((r) => c.brief?.roles?.includes(r))\n : () => false;\n\n if (!contacts) {\n return undefined;\n }\n\n const spaceRef = this.$spaceRef();\n\n return contacts\n .filter((c) => hasIncludedRole(c) && !hasExcludedRole(c))\n .map((c) => ({\n id: c.id,\n brief: c.brief,\n isChecked: isSelected(c.id),\n }))\n .filter((c) => !onlySelected || c.isChecked)\n .map(addSpace(spaceRef));\n });\n\n protected readonly contactID = (_: number, contact: IContactWithBrief) =>\n contact.id;\n\n constructor() {\n super();\n effect(() => {\n const spaceID = this.$spaceID();\n this.contactusSpaceSubscription?.unsubscribe();\n if (spaceID) {\n this.subscribeForContactBriefs(this.$spaceID());\n }\n });\n }\n\n private subscribeForContactBriefs(spaceID: string): void {\n this.contactusSpaceSubscription = this.contactusSpaceService\n .watchContactBriefs(spaceID)\n .pipe(this.takeUntilDestroyed())\n .subscribe({\n next: (contacts) => {\n this.$spaceContacts.set(contacts);\n },\n });\n }\n\n protected readonly $checkedInProgress = signal<readonly string[]>([]);\n protected readonly $uncheckedInProgress = signal<readonly string[]>([]);\n\n protected onCheckboxChange(event: Event, contact: IContactWithBrief): void {\n const ce = event as CustomEvent;\n const cID = contact.id;\n const checked = !!ce.detail.checked;\n if (checked) {\n if (!this.$checkedInProgress().includes(cID)) {\n this.$checkedInProgress.update((v) => [...v, cID]);\n }\n } else if (!this.$uncheckedInProgress().includes(cID)) {\n this.$uncheckedInProgress.update((v) => [...v, cID]);\n }\n const clearInProgress = () => {\n if (checked) {\n this.$checkedInProgress.update((v) => v.filter((id) => id !== cID));\n } else {\n this.$uncheckedInProgress.update((v) => v.filter((id) => id !== cID));\n }\n this.changeDetectorRef.markForCheck();\n };\n new Promise<void>((resolve, reject) => {\n this.checkedChange.emit({\n event: ce,\n id: cID,\n checked,\n resolve,\n reject,\n });\n })\n .then(clearInProgress)\n .catch((err) => {\n this.errorLogger.logError(err);\n\n // Restore checkbox state with a delay\n // to allow users to see that check change was registered and processed\n setTimeout(clearInProgress, 500);\n });\n }\n}\n","<!--$checkedContactIDsOfSpace: {{$checkedContactIDsOfSpace()}}-->\n@for (\n contact of $contactsToDisplay() || [];\n track contact.id;\n let last = $last\n) {\n <sneat-contacts-checklist-item\n [$contact]=\"contact\"\n [$isLast]=\"last\"\n [$lastItemLine]=\"$lastItemLine()\"\n [$checkedInProgress]=\"$checkedInProgress()\"\n [$uncheckedInProgress]=\"$uncheckedInProgress()\"\n (checkboxChange)=\"onCheckboxChange($event.event, $event.item)\"\n />\n} @empty {\n <ion-item>\n @if ($spaceContacts()) {\n <ion-label color=\"medium\">{{\n noContactsMessage || \"No contacts\"\n }}</ion-label>\n } @else {\n <ion-label>Loading...</ion-label>\n }\n </ion-item>\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/contacts-checklist/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './contacts-checklist.component';\n"]}
|