@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
package/esm2022/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/contactus/shared/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,8BAA8B,CAAC;AAC7C,cAAc,aAAa,CAAC","sourcesContent":["export * from './lib';\nexport * from './lib/components/lib-exports';\nexport * from './lib/pipes';\n"]}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output, signal, ViewChild, inject, } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators, } from '@angular/forms';
|
|
3
|
+
import { IonButton, IonButtons, IonCard, IonIcon, IonInput, IonItem, IonItemDivider, IonLabel, IonSpinner, IonTextarea, } from '@ionic/angular/standalone';
|
|
4
|
+
import { CountrySelectorComponent } from '@sneat/components';
|
|
5
|
+
import { excludeUndefined } from '@sneat/core';
|
|
6
|
+
import { ErrorLogger } from '@sneat/core';
|
|
7
|
+
import { createSetFocusToInput } from '@sneat/ui';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
import * as i1 from "@angular/forms";
|
|
10
|
+
export class AddressFormComponent {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.errorLogger = inject(ErrorLogger);
|
|
13
|
+
this.title = 'Address';
|
|
14
|
+
this.save = new EventEmitter();
|
|
15
|
+
this.addressChange = new EventEmitter();
|
|
16
|
+
this.formCreated = new EventEmitter(); // TODO: there is should be a better way of doing this
|
|
17
|
+
this.setFocusToInput = createSetFocusToInput(this.errorLogger);
|
|
18
|
+
this.$saving = signal(false, ...(ngDevMode ? [{ debugName: "$saving" }] : []));
|
|
19
|
+
this.countryID = new FormControl('', [Validators.required]);
|
|
20
|
+
this.zip = new FormControl('', [
|
|
21
|
+
Validators.pattern('[0-9 A-Z]{2,10}'),
|
|
22
|
+
]);
|
|
23
|
+
this.state = new FormControl('', {
|
|
24
|
+
validators: [Validators.minLength(2), Validators.maxLength(20)],
|
|
25
|
+
});
|
|
26
|
+
this.city = new FormControl('', {
|
|
27
|
+
validators: [Validators.minLength(2), Validators.maxLength(20)],
|
|
28
|
+
});
|
|
29
|
+
this.lines = new FormControl('', [Validators.maxLength(200)]);
|
|
30
|
+
this.form = new FormGroup({
|
|
31
|
+
countryID: this.countryID,
|
|
32
|
+
zip: this.zip,
|
|
33
|
+
state: this.state,
|
|
34
|
+
city: this.city,
|
|
35
|
+
lines: this.lines,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
ngOnInit() {
|
|
39
|
+
this.formCreated.emit(this.form);
|
|
40
|
+
}
|
|
41
|
+
onCountryChanged(countryID) {
|
|
42
|
+
this.countryID.setValue(countryID);
|
|
43
|
+
this.countryID.markAsDirty();
|
|
44
|
+
if (!countryID ||
|
|
45
|
+
countryID === '--' ||
|
|
46
|
+
(this.address?.countryID && this.address.countryID != countryID)) {
|
|
47
|
+
this.zip.setValue('');
|
|
48
|
+
this.lines.setValue('');
|
|
49
|
+
}
|
|
50
|
+
this.address = {
|
|
51
|
+
countryID: countryID,
|
|
52
|
+
zipCode: this.zip.value || undefined,
|
|
53
|
+
state: this.state.value || undefined,
|
|
54
|
+
};
|
|
55
|
+
this.addressChange.emit(this.address);
|
|
56
|
+
setTimeout(() => this.setFocusToInput(this.zipInput), 100);
|
|
57
|
+
}
|
|
58
|
+
get mustAddress() {
|
|
59
|
+
return this.address || { countryID: '' };
|
|
60
|
+
}
|
|
61
|
+
onZipChanged() {
|
|
62
|
+
this.address = { ...this.mustAddress, zipCode: this.zip.value || '' };
|
|
63
|
+
// 'AddressFormComponent.onZipChanged()',
|
|
64
|
+
// this.zip.value,
|
|
65
|
+
// address,
|
|
66
|
+
// this.address,
|
|
67
|
+
this.addressChange.emit(this.address);
|
|
68
|
+
}
|
|
69
|
+
onStateChanged() {
|
|
70
|
+
const address = this.mustAddress;
|
|
71
|
+
this.address = { ...address, state: this.state.value || '' };
|
|
72
|
+
// 'AddressFormComponent.onStateChanged()',
|
|
73
|
+
// this.state.value,
|
|
74
|
+
// address,
|
|
75
|
+
// this.address,
|
|
76
|
+
this.addressChange.emit(this.address);
|
|
77
|
+
}
|
|
78
|
+
onCityChanged() {
|
|
79
|
+
this.address = { ...this.mustAddress, city: this.city.value || '' };
|
|
80
|
+
this.addressChange.emit(this.address);
|
|
81
|
+
}
|
|
82
|
+
onLinesChanged() {
|
|
83
|
+
this.address = { ...this.mustAddress, lines: this.lines.value || '' };
|
|
84
|
+
this.addressChange.emit(this.address);
|
|
85
|
+
}
|
|
86
|
+
ngOnChanges(changes) {
|
|
87
|
+
if (changes['requiredFields'] && this.requiredFields) {
|
|
88
|
+
if (this.requiredFields?.zip) {
|
|
89
|
+
this.zip.setValidators([Validators.required]);
|
|
90
|
+
}
|
|
91
|
+
if (this.requiredFields?.lines) {
|
|
92
|
+
this.lines.setValidators([Validators.required]);
|
|
93
|
+
}
|
|
94
|
+
if (this.requiredFields?.state) {
|
|
95
|
+
this.state.setValidators([Validators.required]);
|
|
96
|
+
}
|
|
97
|
+
if (this.requiredFields?.city) {
|
|
98
|
+
this.city.setValidators([Validators.required]);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (changes['address']) {
|
|
102
|
+
if (!this.countryID.dirty) {
|
|
103
|
+
this.countryID.setValue(this.address?.countryID || '');
|
|
104
|
+
this.countryID.markAsPristine();
|
|
105
|
+
}
|
|
106
|
+
if (!this.zip.dirty) {
|
|
107
|
+
this.zip.setValue(this.address?.zipCode || '');
|
|
108
|
+
this.zip.markAsPristine();
|
|
109
|
+
}
|
|
110
|
+
if (!this.lines.dirty) {
|
|
111
|
+
this.lines.setValue(this.address?.lines || '');
|
|
112
|
+
this.lines.markAsPristine();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
cancelChanges() {
|
|
117
|
+
this.countryID.setValue(this.address?.countryID || '');
|
|
118
|
+
this.countryID.markAsPristine();
|
|
119
|
+
this.zip.setValue(this.address?.zipCode || '');
|
|
120
|
+
this.zip.markAsPristine();
|
|
121
|
+
this.lines.setValue(this.address?.lines || '');
|
|
122
|
+
this.lines.markAsPristine();
|
|
123
|
+
}
|
|
124
|
+
saveChanges() {
|
|
125
|
+
const success = () => {
|
|
126
|
+
this.$saving.set(false);
|
|
127
|
+
this.form.markAsPristine();
|
|
128
|
+
};
|
|
129
|
+
const error = (e) => {
|
|
130
|
+
this.$saving.set(false);
|
|
131
|
+
this.errorLogger.logError(e, 'Failed to save address');
|
|
132
|
+
};
|
|
133
|
+
this.$saving.set(true);
|
|
134
|
+
const countryID = this.countryID.value;
|
|
135
|
+
if (this.form.dirty && countryID) {
|
|
136
|
+
const object = excludeUndefined({
|
|
137
|
+
countryID,
|
|
138
|
+
zipCode: this.zip.value || undefined,
|
|
139
|
+
lines: this.lines.value || undefined,
|
|
140
|
+
});
|
|
141
|
+
this.save.emit({ object, success, error });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AddressFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
145
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: AddressFormComponent, isStandalone: true, selector: "sneat-address-form", inputs: { mode: "mode", title: "title", address: "address", requiredFields: "requiredFields" }, outputs: { save: "save", addressChange: "addressChange", formCreated: "formCreated" }, viewQueries: [{ propertyName: "zipInput", first: true, predicate: ["zipInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ion-card>\n <ion-item-divider color=\"light\">\n <ion-label color=\"medium\">\n {{ title }}\n @if (!countryID.value) {\n <span>— please select country</span>\n }\n </ion-label>\n @if (mode === \"edit\" && form.dirty) {\n <ion-buttons slot=\"end\">\n @if (countryID.value) {\n <ion-button\n color=\"primary\"\n fill=\"solid\"\n [disabled]=\"$saving()\"\n (click)=\"saveChanges()\"\n >\n @if ($saving()) {\n <ion-spinner slot=\"start\" color=\"light\" name=\"lines-small\" />\n } @else {\n <ion-icon slot=\"start\" name=\"save-outline\" />\n }\n\n <ion-label>\n @if ($saving()) {\n Saving...\n } @else {\n Save changes\n }\n </ion-label>\n </ion-button>\n }\n\n @if (!$saving()) {\n <ion-button (click)=\"cancelChanges()\">\n <ion-label>Cancel</ion-label>\n </ion-button>\n }\n </ion-buttons>\n }\n </ion-item-divider>\n\n <sneat-country-selector\n [countryID]=\"countryID.value || undefined\"\n [disabled]=\"$saving()\"\n (countryIDChange)=\"onCountryChanged($event)\"\n />\n\n @if (countryID.value) {\n <ion-item>\n <ion-label color=\"medium\">Zip code</ion-label>\n <ion-input\n type=\"text\"\n #zipInput\n maxlength=\"10\"\n [formControl]=\"zip\"\n [disabled]=\"$saving()\"\n (ionChange)=\"onZipChanged()\"\n />\n </ion-item>\n\n <ion-item>\n <ion-label color=\"medium\">State</ion-label>\n <ion-input\n type=\"text\"\n maxlength=\"20\"\n [formControl]=\"state\"\n (ionChange)=\"onStateChanged()\"\n />\n </ion-item>\n\n <ion-item>\n <ion-label color=\"medium\">City</ion-label>\n <ion-input\n type=\"text\"\n maxlength=\"85\"\n [formControl]=\"city\"\n (ionChange)=\"onCityChanged()\"\n />\n </ion-item>\n\n <ion-item>\n <ion-label color=\"medium\">Address</ion-label>\n <ion-textarea\n [formControl]=\"lines\"\n auto-grow=\"true\"\n [disabled]=\"$saving()\"\n (ionChange)=\"onLinesChanged()\"\n />\n </ion-item>\n }\n</ion-card>\n", dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: CountrySelectorComponent, selector: "sneat-country-selector", inputs: ["countryID", "defaultCountryID", "readonly", "disabled", "label", "canBeUnknown"], outputs: ["countryIDChange"] }, { kind: "component", type: IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonItemDivider, selector: "ion-item-divider", inputs: ["color", "mode", "sticky"] }, { 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: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { 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: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: IonTextarea, selector: "ion-textarea", inputs: ["autoGrow", "autocapitalize", "autofocus", "clearOnEdit", "color", "cols", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "maxlength", "minlength", "mode", "name", "placeholder", "readonly", "required", "rows", "shape", "spellcheck", "value", "wrap"] }] }); }
|
|
146
|
+
}
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: AddressFormComponent, decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{ selector: 'sneat-address-form', imports: [
|
|
150
|
+
ReactiveFormsModule,
|
|
151
|
+
FormsModule,
|
|
152
|
+
CountrySelectorComponent,
|
|
153
|
+
IonCard,
|
|
154
|
+
IonItemDivider,
|
|
155
|
+
IonLabel,
|
|
156
|
+
IonButtons,
|
|
157
|
+
IonButton,
|
|
158
|
+
IonSpinner,
|
|
159
|
+
IonIcon,
|
|
160
|
+
IonItem,
|
|
161
|
+
IonInput,
|
|
162
|
+
IonTextarea,
|
|
163
|
+
], template: "<ion-card>\n <ion-item-divider color=\"light\">\n <ion-label color=\"medium\">\n {{ title }}\n @if (!countryID.value) {\n <span>— please select country</span>\n }\n </ion-label>\n @if (mode === \"edit\" && form.dirty) {\n <ion-buttons slot=\"end\">\n @if (countryID.value) {\n <ion-button\n color=\"primary\"\n fill=\"solid\"\n [disabled]=\"$saving()\"\n (click)=\"saveChanges()\"\n >\n @if ($saving()) {\n <ion-spinner slot=\"start\" color=\"light\" name=\"lines-small\" />\n } @else {\n <ion-icon slot=\"start\" name=\"save-outline\" />\n }\n\n <ion-label>\n @if ($saving()) {\n Saving...\n } @else {\n Save changes\n }\n </ion-label>\n </ion-button>\n }\n\n @if (!$saving()) {\n <ion-button (click)=\"cancelChanges()\">\n <ion-label>Cancel</ion-label>\n </ion-button>\n }\n </ion-buttons>\n }\n </ion-item-divider>\n\n <sneat-country-selector\n [countryID]=\"countryID.value || undefined\"\n [disabled]=\"$saving()\"\n (countryIDChange)=\"onCountryChanged($event)\"\n />\n\n @if (countryID.value) {\n <ion-item>\n <ion-label color=\"medium\">Zip code</ion-label>\n <ion-input\n type=\"text\"\n #zipInput\n maxlength=\"10\"\n [formControl]=\"zip\"\n [disabled]=\"$saving()\"\n (ionChange)=\"onZipChanged()\"\n />\n </ion-item>\n\n <ion-item>\n <ion-label color=\"medium\">State</ion-label>\n <ion-input\n type=\"text\"\n maxlength=\"20\"\n [formControl]=\"state\"\n (ionChange)=\"onStateChanged()\"\n />\n </ion-item>\n\n <ion-item>\n <ion-label color=\"medium\">City</ion-label>\n <ion-input\n type=\"text\"\n maxlength=\"85\"\n [formControl]=\"city\"\n (ionChange)=\"onCityChanged()\"\n />\n </ion-item>\n\n <ion-item>\n <ion-label color=\"medium\">Address</ion-label>\n <ion-textarea\n [formControl]=\"lines\"\n auto-grow=\"true\"\n [disabled]=\"$saving()\"\n (ionChange)=\"onLinesChanged()\"\n />\n </ion-item>\n }\n</ion-card>\n" }]
|
|
164
|
+
}], propDecorators: { mode: [{
|
|
165
|
+
type: Input
|
|
166
|
+
}], title: [{
|
|
167
|
+
type: Input
|
|
168
|
+
}], address: [{
|
|
169
|
+
type: Input
|
|
170
|
+
}], requiredFields: [{
|
|
171
|
+
type: Input
|
|
172
|
+
}], save: [{
|
|
173
|
+
type: Output
|
|
174
|
+
}], addressChange: [{
|
|
175
|
+
type: Output
|
|
176
|
+
}], formCreated: [{
|
|
177
|
+
type: Output
|
|
178
|
+
}], zipInput: [{
|
|
179
|
+
type: ViewChild,
|
|
180
|
+
args: ['zipInput', { static: false }]
|
|
181
|
+
}] } });
|
|
182
|
+
//# sourceMappingURL=address-form.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-form.component.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/address-form/address-form.component.ts","../../../../../../../../libs/contactus/shared/src/lib/components/address-form/address-form.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,EACZ,KAAK,EAGL,MAAM,EACN,MAAM,EAEN,SAAS,EACT,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,mBAAmB,EACnB,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,cAAc,EACd,QAAQ,EACR,UAAU,EACV,WAAW,GACZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAc,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAgB,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;;;AAsClD,MAAM,OAAO,oBAAoB;IAnBjC;QAoBmB,gB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AAW,+BACX,wBAAwB,6LACxB,OAAO,yLACP,cAAc,kGACd,QAAQ,6FACR,UAAU,8EACV,SAAS,oPACT,UAAU,yGACV,OAAO,2JACP,OAAO,0NACP,QAAQ,8eACR,WAAW;;2FAGF,oBAAoB;kBAnBhC,SAAS;+BACE,oBAAoB,WAErB;wBACP,mBAAmB;wBACnB,WAAW;wBACX,wBAAwB;wBACxB,OAAO;wBACP,cAAc;wBACd,QAAQ;wBACR,UAAU;wBACV,SAAS;wBACT,UAAU;wBACV,OAAO;wBACP,OAAO;wBACP,QAAQ;wBACR,WAAW;qBACZ;;sBAKA,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,MAAM;;sBACN,MAAM;;sBACN,MAAM;;sBAEN,SAAS;uBAAC,UAAU,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE","sourcesContent":["import {\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n Output,\n signal,\n SimpleChanges,\n ViewChild,\n inject,\n} from '@angular/core';\nimport {\n FormControl,\n FormGroup,\n FormsModule,\n ReactiveFormsModule,\n Validators,\n} from '@angular/forms';\nimport {\n IonButton,\n IonButtons,\n IonCard,\n IonIcon,\n IonInput,\n IonItem,\n IonItemDivider,\n IonLabel,\n IonSpinner,\n IonTextarea,\n} from '@ionic/angular/standalone';\nimport { CountrySelectorComponent, ISaveEvent } from '@sneat/components';\nimport { excludeUndefined } from '@sneat/core';\nimport { IAddress } from '@sneat/contactus-core';\nimport { ErrorLogger, IErrorLogger } from '@sneat/core';\nimport { createSetFocusToInput } from '@sneat/ui';\n\nexport interface IAddressFormControls {\n countryID: FormControl<string | null>;\n zip: FormControl<string | null>;\n state: FormControl<string | null>;\n city: FormControl<string | null>;\n lines: FormControl<string | null>;\n}\n\nexport type AddressForm = FormGroup<IAddressFormControls>;\n\nexport interface AddressRequiredFields {\n zip?: boolean;\n state?: boolean;\n city?: boolean;\n lines?: boolean;\n}\n\n@Component({\n selector: 'sneat-address-form',\n templateUrl: './address-form.component.html',\n imports: [\n ReactiveFormsModule,\n FormsModule,\n CountrySelectorComponent,\n IonCard,\n IonItemDivider,\n IonLabel,\n IonButtons,\n IonButton,\n IonSpinner,\n IonIcon,\n IonItem,\n IonInput,\n IonTextarea,\n ],\n})\nexport class AddressFormComponent implements OnChanges, OnInit {\n private readonly errorLogger = inject<IErrorLogger>(ErrorLogger);\n\n @Input() mode?: 'new' | 'edit';\n @Input() title = 'Address';\n @Input() address?: IAddress;\n @Input() requiredFields?: AddressRequiredFields;\n @Output() readonly save = new EventEmitter<ISaveEvent<IAddress>>();\n @Output() readonly addressChange = new EventEmitter<IAddress>();\n @Output() readonly formCreated = new EventEmitter<AddressForm>(); // TODO: there is should be a better way of doing this\n\n @ViewChild('zipInput', { static: false }) zipInput?: IonInput;\n\n public readonly setFocusToInput = createSetFocusToInput(this.errorLogger);\n\n protected readonly $saving = signal(false);\n\n protected readonly countryID = new FormControl('', [Validators.required]);\n protected readonly zip = new FormControl('', [\n Validators.pattern('[0-9 A-Z]{2,10}'),\n ]);\n readonly state = new FormControl<string>('', {\n validators: [Validators.minLength(2), Validators.maxLength(20)],\n });\n readonly city = new FormControl<string>('', {\n validators: [Validators.minLength(2), Validators.maxLength(20)],\n });\n protected readonly lines = new FormControl('', [Validators.maxLength(200)]);\n\n public readonly form: AddressForm = new FormGroup({\n countryID: this.countryID,\n zip: this.zip,\n state: this.state,\n city: this.city,\n lines: this.lines,\n });\n\n ngOnInit(): void {\n this.formCreated.emit(this.form);\n }\n\n onCountryChanged(countryID: string): void {\n this.countryID.setValue(countryID);\n this.countryID.markAsDirty();\n if (\n !countryID ||\n countryID === '--' ||\n (this.address?.countryID && this.address.countryID != countryID)\n ) {\n this.zip.setValue('');\n this.lines.setValue('');\n }\n this.address = {\n countryID: countryID,\n zipCode: this.zip.value || undefined,\n state: this.state.value || undefined,\n };\n this.addressChange.emit(this.address);\n setTimeout(() => this.setFocusToInput(this.zipInput), 100);\n }\n\n get mustAddress(): IAddress {\n return this.address || { countryID: '' };\n }\n\n onZipChanged(): void {\n this.address = { ...this.mustAddress, zipCode: this.zip.value || '' };\n // 'AddressFormComponent.onZipChanged()',\n // this.zip.value,\n // address,\n // this.address,\n this.addressChange.emit(this.address);\n }\n\n onStateChanged(): void {\n const address = this.mustAddress;\n this.address = { ...address, state: this.state.value || '' };\n // 'AddressFormComponent.onStateChanged()',\n // this.state.value,\n // address,\n // this.address,\n this.addressChange.emit(this.address);\n }\n\n onCityChanged(): void {\n this.address = { ...this.mustAddress, city: this.city.value || '' };\n this.addressChange.emit(this.address);\n }\n\n onLinesChanged(): void {\n this.address = { ...this.mustAddress, lines: this.lines.value || '' };\n this.addressChange.emit(this.address);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['requiredFields'] && this.requiredFields) {\n if (this.requiredFields?.zip) {\n this.zip.setValidators([Validators.required]);\n }\n if (this.requiredFields?.lines) {\n this.lines.setValidators([Validators.required]);\n }\n if (this.requiredFields?.state) {\n this.state.setValidators([Validators.required]);\n }\n if (this.requiredFields?.city) {\n this.city.setValidators([Validators.required]);\n }\n }\n if (changes['address']) {\n if (!this.countryID.dirty) {\n this.countryID.setValue(this.address?.countryID || '');\n this.countryID.markAsPristine();\n }\n if (!this.zip.dirty) {\n this.zip.setValue(this.address?.zipCode || '');\n this.zip.markAsPristine();\n }\n if (!this.lines.dirty) {\n this.lines.setValue(this.address?.lines || '');\n this.lines.markAsPristine();\n }\n }\n }\n\n protected cancelChanges(): void {\n this.countryID.setValue(this.address?.countryID || '');\n this.countryID.markAsPristine();\n this.zip.setValue(this.address?.zipCode || '');\n this.zip.markAsPristine();\n this.lines.setValue(this.address?.lines || '');\n this.lines.markAsPristine();\n }\n\n protected saveChanges(): void {\n const success = (): void => {\n this.$saving.set(false);\n this.form.markAsPristine();\n };\n const error = (e: unknown): void => {\n this.$saving.set(false);\n this.errorLogger.logError(e, 'Failed to save address');\n };\n this.$saving.set(true);\n const countryID = this.countryID.value;\n if (this.form.dirty && countryID) {\n const object: IAddress = excludeUndefined({\n countryID,\n zipCode: this.zip.value || undefined,\n lines: this.lines.value || undefined,\n });\n this.save.emit({ object, success, error });\n }\n }\n}\n","<ion-card>\n <ion-item-divider color=\"light\">\n <ion-label color=\"medium\">\n {{ title }}\n @if (!countryID.value) {\n <span>— please select country</span>\n }\n </ion-label>\n @if (mode === \"edit\" && form.dirty) {\n <ion-buttons slot=\"end\">\n @if (countryID.value) {\n <ion-button\n color=\"primary\"\n fill=\"solid\"\n [disabled]=\"$saving()\"\n (click)=\"saveChanges()\"\n >\n @if ($saving()) {\n <ion-spinner slot=\"start\" color=\"light\" name=\"lines-small\" />\n } @else {\n <ion-icon slot=\"start\" name=\"save-outline\" />\n }\n\n <ion-label>\n @if ($saving()) {\n Saving...\n } @else {\n Save changes\n }\n </ion-label>\n </ion-button>\n }\n\n @if (!$saving()) {\n <ion-button (click)=\"cancelChanges()\">\n <ion-label>Cancel</ion-label>\n </ion-button>\n }\n </ion-buttons>\n }\n </ion-item-divider>\n\n <sneat-country-selector\n [countryID]=\"countryID.value || undefined\"\n [disabled]=\"$saving()\"\n (countryIDChange)=\"onCountryChanged($event)\"\n />\n\n @if (countryID.value) {\n <ion-item>\n <ion-label color=\"medium\">Zip code</ion-label>\n <ion-input\n type=\"text\"\n #zipInput\n maxlength=\"10\"\n [formControl]=\"zip\"\n [disabled]=\"$saving()\"\n (ionChange)=\"onZipChanged()\"\n />\n </ion-item>\n\n <ion-item>\n <ion-label color=\"medium\">State</ion-label>\n <ion-input\n type=\"text\"\n maxlength=\"20\"\n [formControl]=\"state\"\n (ionChange)=\"onStateChanged()\"\n />\n </ion-item>\n\n <ion-item>\n <ion-label color=\"medium\">City</ion-label>\n <ion-input\n type=\"text\"\n maxlength=\"85\"\n [formControl]=\"city\"\n (ionChange)=\"onCityChanged()\"\n />\n </ion-item>\n\n <ion-item>\n <ion-label color=\"medium\">Address</ion-label>\n <ion-textarea\n [formControl]=\"lines\"\n auto-grow=\"true\"\n [disabled]=\"$saving()\"\n (ionChange)=\"onLinesChanged()\"\n />\n </ion-item>\n }\n</ion-card>\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/address-form/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './address-form.component';\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output, inject } from '@angular/core';
|
|
2
|
+
import { FormsModule } from '@angular/forms';
|
|
3
|
+
import { IonButton, IonInput, IonItem, IonLabel, IonSpinner, } from '@ionic/angular/standalone';
|
|
4
|
+
import { ErrorLogger } from '@sneat/core';
|
|
5
|
+
import { ContactService } from '@sneat/contactus-services';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/forms";
|
|
8
|
+
export class BasicContactFormComponent {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.errorLogger = inject(ErrorLogger);
|
|
11
|
+
this.contactService = inject(ContactService);
|
|
12
|
+
this.contactChange = new EventEmitter();
|
|
13
|
+
this.contactCreated = new EventEmitter();
|
|
14
|
+
this.isSubmitting = false;
|
|
15
|
+
this.isCreated = false;
|
|
16
|
+
this.title = '';
|
|
17
|
+
}
|
|
18
|
+
createContact(event) {
|
|
19
|
+
event.stopPropagation();
|
|
20
|
+
if (!this.space) {
|
|
21
|
+
console.error('space is required');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (!this.contactType) {
|
|
25
|
+
console.error('contactType is required');
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const request = {
|
|
29
|
+
spaceID: this.space.id,
|
|
30
|
+
type: this.contactType,
|
|
31
|
+
// type: this.contactType,
|
|
32
|
+
roles: this.contactRoles,
|
|
33
|
+
parentContactID: this.parentContact?.id,
|
|
34
|
+
status: 'active',
|
|
35
|
+
basic: {
|
|
36
|
+
title: this.title,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
this.isSubmitting = true;
|
|
40
|
+
this.contactService.createContact(this.space, request).subscribe({
|
|
41
|
+
next: (contact) => {
|
|
42
|
+
this.isCreated = true;
|
|
43
|
+
this.contactCreated.emit(contact);
|
|
44
|
+
},
|
|
45
|
+
error: (err) => {
|
|
46
|
+
this.isSubmitting = false;
|
|
47
|
+
this.errorLogger.logError(err, `Failed to create new [${this.contactType}]`);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BasicContactFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
52
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: BasicContactFormComponent, isStandalone: true, selector: "sneat-basic-contact-form", inputs: { parentContact: "parentContact", space: "space", contactType: "contactType", contactRoles: "contactRoles" }, outputs: { contactChange: "contactChange", contactCreated: "contactCreated" }, ngImport: i0, template: "<ion-item>\n <ion-input\n label=\"Name\"\n [(ngModel)]=\"title\"\n required=\"true\"\n [disabled]=\"isSubmitting\"\n />\n</ion-item>\n<div class=\"ion-padding\">\n @if (!isCreated) {\n <ion-button (click)=\"createContact($event)\" [disabled]=\"isSubmitting\">\n @if (!isSubmitting) {\n <ion-label>Create</ion-label>\n }\n @if (isSubmitting) {\n <ion-label>Creating...</ion-label>\n }\n @if (isSubmitting && !isCreated) {\n <ion-spinner name=\"lines-small\" slot=\"end\" />\n }\n </ion-button>\n }\n @if (isCreated) {\n <p>Created...</p>\n }\n</div>\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: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { 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: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: IonSpinner, selector: "ion-spinner", inputs: ["color", "duration", "name", "paused"] }] }); }
|
|
53
|
+
}
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: BasicContactFormComponent, decorators: [{
|
|
55
|
+
type: Component,
|
|
56
|
+
args: [{ selector: 'sneat-basic-contact-form', imports: [IonItem, IonInput, FormsModule, IonButton, IonLabel, IonSpinner], template: "<ion-item>\n <ion-input\n label=\"Name\"\n [(ngModel)]=\"title\"\n required=\"true\"\n [disabled]=\"isSubmitting\"\n />\n</ion-item>\n<div class=\"ion-padding\">\n @if (!isCreated) {\n <ion-button (click)=\"createContact($event)\" [disabled]=\"isSubmitting\">\n @if (!isSubmitting) {\n <ion-label>Create</ion-label>\n }\n @if (isSubmitting) {\n <ion-label>Creating...</ion-label>\n }\n @if (isSubmitting && !isCreated) {\n <ion-spinner name=\"lines-small\" slot=\"end\" />\n }\n </ion-button>\n }\n @if (isCreated) {\n <p>Created...</p>\n }\n</div>\n" }]
|
|
57
|
+
}], propDecorators: { parentContact: [{
|
|
58
|
+
type: Input
|
|
59
|
+
}], space: [{
|
|
60
|
+
type: Input,
|
|
61
|
+
args: [{ required: true }]
|
|
62
|
+
}], contactType: [{
|
|
63
|
+
type: Input
|
|
64
|
+
}], contactRoles: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}], contactChange: [{
|
|
67
|
+
type: Output
|
|
68
|
+
}], contactCreated: [{
|
|
69
|
+
type: Output
|
|
70
|
+
}] } });
|
|
71
|
+
//# sourceMappingURL=basic-contact-form.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-contact-form.component.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/basic-contact-form/basic-contact-form.component.ts","../../../../../../../../libs/contactus/shared/src/lib/components/basic-contact-form/basic-contact-form.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,UAAU,GACX,MAAM,2BAA2B,CAAC;AAOnC,OAAO,EAAE,WAAW,EAAgB,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;;;AAQ3D,MAAM,OAAO,yBAAyB;IALtC;QAMmB,gBAAW,GAAG,MAAM,CAAe,WAAW,CAAC,CAAC;QAChD,mBAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;QAStC,kBAAa,GAAG,IAAI,YAAY,EAAqB,CAAC;QACtD,mBAAc,GAAG,IAAI,YAAY,EAAqB,CAAC;QAE1E,iBAAY,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yB;kGAAzB,yBAAyB,yRCxBtC,snBA0BA,4CDJY,OAAO,0NAAE,QAAQ,6eAAE,WAAW,4jBAAE,SAAS,oPAAE,QAAQ,6FAAE,UAAU;;2FAE9D,yBAAyB;kBALrC,SAAS;+BACE,0BAA0B,WAE3B,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC;;sBAMzE,KAAK;;sBACL,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB,KAAK;;sBAGL,KAAK;;sBAEL,MAAM;;sBACN,MAAM","sourcesContent":["import { Component, EventEmitter, Input, Output, inject } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport {\n IonButton,\n IonInput,\n IonItem,\n IonLabel,\n IonSpinner,\n} from '@ionic/angular/standalone';\nimport {\n ContactRole,\n ContactType,\n IContactWithBrief,\n ICreateContactBasicRequest,\n} from '@sneat/contactus-core';\nimport { ErrorLogger, IErrorLogger } from '@sneat/core';\nimport { ContactService } from '@sneat/contactus-services';\nimport { ISpaceContext } from '@sneat/space-models';\n\n@Component({\n selector: 'sneat-basic-contact-form',\n templateUrl: './basic-contact-form.component.html',\n imports: [IonItem, IonInput, FormsModule, IonButton, IonLabel, IonSpinner],\n})\nexport class BasicContactFormComponent {\n private readonly errorLogger = inject<IErrorLogger>(ErrorLogger);\n private readonly contactService = inject(ContactService);\n\n @Input() parentContact?: IContactWithBrief;\n @Input({ required: true }) space?: ISpaceContext;\n @Input() contactType?: ContactType;\n\n // @Input() contactRole?: ContactRole; // use contactRoles to support multiple roles\n @Input() contactRoles?: ContactRole[];\n\n @Output() readonly contactChange = new EventEmitter<IContactWithBrief>();\n @Output() readonly contactCreated = new EventEmitter<IContactWithBrief>();\n\n isSubmitting = false;\n isCreated = false;\n\n title = '';\n\n createContact(event: Event): void {\n event.stopPropagation();\n if (!this.space) {\n console.error('space is required');\n return;\n }\n if (!this.contactType) {\n console.error('contactType is required');\n return;\n }\n const request: ICreateContactBasicRequest = {\n spaceID: this.space.id,\n type: this.contactType,\n // type: this.contactType,\n roles: this.contactRoles,\n parentContactID: this.parentContact?.id,\n status: 'active',\n basic: {\n title: this.title,\n },\n };\n this.isSubmitting = true;\n\n this.contactService.createContact(this.space, request).subscribe({\n next: (contact) => {\n this.isCreated = true;\n this.contactCreated.emit(contact);\n },\n error: (err: unknown) => {\n this.isSubmitting = false;\n this.errorLogger.logError(\n err,\n `Failed to create new [${this.contactType}]`,\n );\n },\n });\n }\n}\n","<ion-item>\n <ion-input\n label=\"Name\"\n [(ngModel)]=\"title\"\n required=\"true\"\n [disabled]=\"isSubmitting\"\n />\n</ion-item>\n<div class=\"ion-padding\">\n @if (!isCreated) {\n <ion-button (click)=\"createContact($event)\" [disabled]=\"isSubmitting\">\n @if (!isSubmitting) {\n <ion-label>Create</ion-label>\n }\n @if (isSubmitting) {\n <ion-label>Creating...</ion-label>\n }\n @if (isSubmitting && !isCreated) {\n <ion-spinner name=\"lines-small\" slot=\"end\" />\n }\n </ion-button>\n }\n @if (isCreated) {\n <p>Created...</p>\n }\n</div>\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/basic-contact-form/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC","sourcesContent":["export * from './basic-contact-form.component';\n"]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, inject, input, Output, signal, } from '@angular/core';
|
|
2
|
+
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
3
|
+
import { IonButton, IonButtons, IonIcon, IonInput, IonItem, IonLabel, IonSelect, IonSelectOption, IonTextarea, } from '@ionic/angular/standalone';
|
|
4
|
+
import { ContactService, } from '@sneat/contactus-services';
|
|
5
|
+
import { ClassName, SelectFromListComponent, SneatBaseComponent, } from '@sneat/ui';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/forms";
|
|
8
|
+
export class CommChannelFormComponent extends SneatBaseComponent {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.$contact = input.required(...(ngDevMode ? [{ debugName: "$contact" }] : []));
|
|
12
|
+
this.$channelType = input.required(...(ngDevMode ? [{ debugName: "$channelType" }] : []));
|
|
13
|
+
this.$placeholder = input.required(...(ngDevMode ? [{ debugName: "$placeholder" }] : []));
|
|
14
|
+
this.closeForm = new EventEmitter();
|
|
15
|
+
this.$type = signal(undefined, ...(ngDevMode ? [{ debugName: "$type" }] : []));
|
|
16
|
+
this.channelID = new FormControl('', Validators.required);
|
|
17
|
+
this.types = [
|
|
18
|
+
{ id: 'personal', title: 'Personal' },
|
|
19
|
+
{ id: 'work', title: 'Work' },
|
|
20
|
+
];
|
|
21
|
+
this.contactService = inject(ContactService);
|
|
22
|
+
this.$saving = signal(false, ...(ngDevMode ? [{ debugName: "$saving" }] : []));
|
|
23
|
+
}
|
|
24
|
+
onTypeChanged(value) {
|
|
25
|
+
this.$type.set(value);
|
|
26
|
+
}
|
|
27
|
+
addNewChannel(event) {
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
// console.log('addNewChannel');
|
|
31
|
+
const contact = this.$contact();
|
|
32
|
+
if (!contact.id) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const channelID = (this.channelID.value || '').trim();
|
|
36
|
+
if (!channelID) {
|
|
37
|
+
this.channelID.markAsTouched();
|
|
38
|
+
this.channelID.setErrors({ required: true });
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const request = {
|
|
42
|
+
contactID: contact.id,
|
|
43
|
+
spaceID: contact.space.id,
|
|
44
|
+
channelType: this.$channelType(),
|
|
45
|
+
type: 'private',
|
|
46
|
+
channelID,
|
|
47
|
+
};
|
|
48
|
+
this.$saving.set(true);
|
|
49
|
+
this.contactService.addContactCommChannel(request).subscribe({
|
|
50
|
+
next: () => {
|
|
51
|
+
this.closeForm.emit();
|
|
52
|
+
},
|
|
53
|
+
error: (err) => {
|
|
54
|
+
this.$saving.set(false);
|
|
55
|
+
this.errorLogger.logError(err, `Failed to add ${this.$channelType()}`);
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CommChannelFormComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
60
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: CommChannelFormComponent, isStandalone: true, selector: "sneat-comm-channel-form", inputs: { $contact: { classPropertyName: "$contact", publicName: "$contact", isSignal: true, isRequired: true, transformFunction: null }, $channelType: { classPropertyName: "$channelType", publicName: "$channelType", isSignal: true, isRequired: true, transformFunction: null }, $placeholder: { classPropertyName: "$placeholder", publicName: "$placeholder", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { closeForm: "closeForm" }, providers: [
|
|
61
|
+
{
|
|
62
|
+
provide: ClassName,
|
|
63
|
+
useValue: 'CommChannelFormComponent',
|
|
64
|
+
},
|
|
65
|
+
], usesInheritance: true, ngImport: i0, template: "<ion-item class=\"sneat-tiny-end-padding\">\n @if ($type()) {\n <ion-select\n [value]=\"$type()\"\n placeholder=\"Choose type\"\n interface=\"popover\"\n slot=\"start\"\n style=\"min-width: 120px\"\n (ionChange)=\"onTypeChanged($event.detail.value)\"\n >\n <ion-select-option value=\"work\">Work</ion-select-option>\n <ion-select-option value=\"personal\">Personal</ion-select-option>\n </ion-select>\n }\n <ion-input\n [formControl]=\"channelID\"\n [placeholder]=\"$placeholder()\"\n (keyup.enter)=\"addNewChannel($event)\"\n />\n\n <ion-buttons>\n <ion-button fill=\"solid\" color=\"primary\" (click)=\"addNewChannel($event)\">\n <ion-label>Add</ion-label>\n </ion-button>\n <ion-button (click)=\"closeForm.emit()\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n </ion-buttons>\n</ion-item>\n\n@if (!$type()) {\n <sneat-select-from-list\n [items]=\"types\"\n (valueChange)=\"onTypeChanged($event)\"\n />\n}\n\n<ion-item lines=\"none\">\n <ion-textarea label=\"Note\" labelPlacement=\"stacked\" />\n</ion-item>\n", dependencies: [{ 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: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { 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: IonSelect, selector: "ion-select", inputs: ["cancelText", "color", "compareWith", "disabled", "errorText", "expandedIcon", "fill", "helperText", "interface", "interfaceOptions", "justify", "label", "labelPlacement", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "shape", "toggleIcon", "value"] }, { kind: "component", type: IonTextarea, selector: "ion-textarea", inputs: ["autoGrow", "autocapitalize", "autofocus", "clearOnEdit", "color", "cols", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "maxlength", "minlength", "mode", "name", "placeholder", "readonly", "required", "rows", "shape", "spellcheck", "value", "wrap"] }, { kind: "component", type: SelectFromListComponent, selector: "sneat-select-from-list", inputs: ["value", "filterLabel", "label", "listLabel", "listLabelColor", "isFilterable", "isLoading", "items", "items$", "lastItemLines", "labelPlacement", "justify", "other", "canAdd", "filterItem", "selectMode", "isReadonly", "$isProcessing", "sortBy"], outputs: ["valueChange", "filterChanged"] }, { kind: "component", type: IonSelectOption, selector: "ion-select-option", inputs: ["disabled", "value"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
66
|
+
}
|
|
67
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CommChannelFormComponent, decorators: [{
|
|
68
|
+
type: Component,
|
|
69
|
+
args: [{ imports: [
|
|
70
|
+
IonButton,
|
|
71
|
+
IonButtons,
|
|
72
|
+
IonIcon,
|
|
73
|
+
IonInput,
|
|
74
|
+
IonItem,
|
|
75
|
+
IonLabel,
|
|
76
|
+
IonSelect,
|
|
77
|
+
IonTextarea,
|
|
78
|
+
SelectFromListComponent,
|
|
79
|
+
IonSelectOption,
|
|
80
|
+
ReactiveFormsModule,
|
|
81
|
+
], providers: [
|
|
82
|
+
{
|
|
83
|
+
provide: ClassName,
|
|
84
|
+
useValue: 'CommChannelFormComponent',
|
|
85
|
+
},
|
|
86
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, selector: 'sneat-comm-channel-form', template: "<ion-item class=\"sneat-tiny-end-padding\">\n @if ($type()) {\n <ion-select\n [value]=\"$type()\"\n placeholder=\"Choose type\"\n interface=\"popover\"\n slot=\"start\"\n style=\"min-width: 120px\"\n (ionChange)=\"onTypeChanged($event.detail.value)\"\n >\n <ion-select-option value=\"work\">Work</ion-select-option>\n <ion-select-option value=\"personal\">Personal</ion-select-option>\n </ion-select>\n }\n <ion-input\n [formControl]=\"channelID\"\n [placeholder]=\"$placeholder()\"\n (keyup.enter)=\"addNewChannel($event)\"\n />\n\n <ion-buttons>\n <ion-button fill=\"solid\" color=\"primary\" (click)=\"addNewChannel($event)\">\n <ion-label>Add</ion-label>\n </ion-button>\n <ion-button (click)=\"closeForm.emit()\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n </ion-buttons>\n</ion-item>\n\n@if (!$type()) {\n <sneat-select-from-list\n [items]=\"types\"\n (valueChange)=\"onTypeChanged($event)\"\n />\n}\n\n<ion-item lines=\"none\">\n <ion-textarea label=\"Note\" labelPlacement=\"stacked\" />\n</ion-item>\n" }]
|
|
87
|
+
}], propDecorators: { $contact: [{ type: i0.Input, args: [{ isSignal: true, alias: "$contact", required: true }] }], $channelType: [{ type: i0.Input, args: [{ isSignal: true, alias: "$channelType", required: true }] }], $placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "$placeholder", required: true }] }], closeForm: [{
|
|
88
|
+
type: Output
|
|
89
|
+
}] } });
|
|
90
|
+
//# sourceMappingURL=comm-channel-form.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comm-channel-form.component.js","sourceRoot":"","sources":["../../../../../../../../libs/contactus/shared/src/lib/components/contact-comm-channels/comm-channel-form.component.ts","../../../../../../../../libs/contactus/shared/src/lib/components/contact-comm-channels/comm-channel-form.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,YAAY,EACZ,MAAM,EACN,KAAK,EACL,MAAM,EACN,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,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e,4FACf,mBAAmB;;2FAYV,wBAAwB;kBAxBpC,SAAS;8BACC;wBACP,SAAS;wBACT,UAAU;wBACV,OAAO;wBACP,QAAQ;wBACR,OAAO;wBACP,QAAQ;wBACR,SAAS;wBACT,WAAW;wBACX,uBAAuB;wBACvB,eAAe;wBACf,mBAAmB;qBACpB,aACU;wBACT;4BACE,OAAO,EAAE,SAAS;4BAClB,QAAQ,EAAE,0BAA0B;yBACrC;qBACF,mBACgB,uBAAuB,CAAC,MAAM,YACrC,yBAAyB;;sBAQlC,MAAM","sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n inject,\n input,\n Output,\n signal,\n} from '@angular/core';\nimport { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';\nimport {\n IonButton,\n IonButtons,\n IonIcon,\n IonInput,\n IonItem,\n IonLabel,\n IonSelect,\n IonSelectOption,\n IonTextarea,\n} from '@ionic/angular/standalone';\nimport { ContactCommChannelType, IContactContext } from '@sneat/contactus-core';\nimport {\n ContactService,\n IAddContactCommChannelRequest,\n} from '@sneat/contactus-services';\nimport {\n ClassName,\n ISelectItem,\n SelectFromListComponent,\n SneatBaseComponent,\n} from '@sneat/ui';\n\n@Component({\n imports: [\n IonButton,\n IonButtons,\n IonIcon,\n IonInput,\n IonItem,\n IonLabel,\n IonSelect,\n IonTextarea,\n SelectFromListComponent,\n IonSelectOption,\n ReactiveFormsModule,\n ],\n providers: [\n {\n provide: ClassName,\n useValue: 'CommChannelFormComponent',\n },\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'sneat-comm-channel-form',\n templateUrl: 'comm-channel-form.component.html',\n})\nexport class CommChannelFormComponent extends SneatBaseComponent {\n public readonly $contact = input.required<IContactContext>();\n public readonly $channelType = input.required<ContactCommChannelType>();\n public readonly $placeholder = input.required<string>();\n\n @Output() public readonly closeForm = new EventEmitter<void>();\n\n protected readonly $type = signal<'personal' | 'work' | undefined>(undefined);\n\n protected readonly channelID = new FormControl('', Validators.required);\n\n protected readonly types: readonly ISelectItem[] = [\n { id: 'personal', title: 'Personal' },\n { id: 'work', title: 'Work' },\n ];\n\n protected onTypeChanged(value: string): void {\n this.$type.set(value as 'personal' | 'work');\n }\n\n private readonly contactService = inject(ContactService);\n\n protected readonly $saving = signal(false);\n\n protected addNewChannel(event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n // console.log('addNewChannel');\n const contact = this.$contact();\n if (!contact.id) {\n return;\n }\n const channelID = (this.channelID.value || '').trim();\n if (!channelID) {\n this.channelID.markAsTouched();\n this.channelID.setErrors({ required: true });\n return;\n }\n const request: IAddContactCommChannelRequest = {\n contactID: contact.id,\n spaceID: contact.space.id,\n channelType: this.$channelType(),\n type: 'private',\n channelID,\n };\n this.$saving.set(true);\n this.contactService.addContactCommChannel(request).subscribe({\n next: () => {\n this.closeForm.emit();\n },\n error: (err) => {\n this.$saving.set(false);\n this.errorLogger.logError(err, `Failed to add ${this.$channelType()}`);\n },\n });\n }\n}\n","<ion-item class=\"sneat-tiny-end-padding\">\n @if ($type()) {\n <ion-select\n [value]=\"$type()\"\n placeholder=\"Choose type\"\n interface=\"popover\"\n slot=\"start\"\n style=\"min-width: 120px\"\n (ionChange)=\"onTypeChanged($event.detail.value)\"\n >\n <ion-select-option value=\"work\">Work</ion-select-option>\n <ion-select-option value=\"personal\">Personal</ion-select-option>\n </ion-select>\n }\n <ion-input\n [formControl]=\"channelID\"\n [placeholder]=\"$placeholder()\"\n (keyup.enter)=\"addNewChannel($event)\"\n />\n\n <ion-buttons>\n <ion-button fill=\"solid\" color=\"primary\" (click)=\"addNewChannel($event)\">\n <ion-label>Add</ion-label>\n </ion-button>\n <ion-button (click)=\"closeForm.emit()\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n </ion-buttons>\n</ion-item>\n\n@if (!$type()) {\n <sneat-select-from-list\n [items]=\"types\"\n (valueChange)=\"onTypeChanged($event)\"\n />\n}\n\n<ion-item lines=\"none\">\n <ion-textarea label=\"Note\" labelPlacement=\"stacked\" />\n</ion-item>\n"]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, effect, signal, input, inject, } from '@angular/core';
|
|
2
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
import { IonButton, IonButtons, IonIcon, IonInput, IonItem, IonLabel, IonSelect, IonSelectOption, } from '@ionic/angular/standalone';
|
|
4
|
+
import { ContactService, } from '@sneat/contactus-services';
|
|
5
|
+
import { ClassName, SneatBaseComponent } from '@sneat/ui';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/forms";
|
|
8
|
+
export class CommChannelItemComponent extends SneatBaseComponent {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.$channelType = input.required(...(ngDevMode ? [{ debugName: "$channelType" }] : []));
|
|
12
|
+
this.$channel = input.required(...(ngDevMode ? [{ debugName: "$channel" }] : []));
|
|
13
|
+
this.$contactID = input.required(...(ngDevMode ? [{ debugName: "$contactID" }] : []));
|
|
14
|
+
this.$spaceID = input.required(...(ngDevMode ? [{ debugName: "$spaceID" }] : []));
|
|
15
|
+
this.channelID = new FormControl();
|
|
16
|
+
this.$lines = input.required(...(ngDevMode ? [{ debugName: "$lines" }] : []));
|
|
17
|
+
this.$saving = signal(false, ...(ngDevMode ? [{ debugName: "$saving" }] : []));
|
|
18
|
+
this.contactService = inject(ContactService);
|
|
19
|
+
effect(() => {
|
|
20
|
+
const channel = this.$channel();
|
|
21
|
+
if (!this.channelID.dirty) {
|
|
22
|
+
this.channelID.setValue(channel.id);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
deleteChannel(_event) {
|
|
27
|
+
// console.log('deleteChannel', event);
|
|
28
|
+
const channelID = this.$channel().id;
|
|
29
|
+
if (!channelID) {
|
|
30
|
+
throw new Error('Unable to delete channel without ID');
|
|
31
|
+
}
|
|
32
|
+
if (!confirm(`Are you sure you want to delete ${channelID}?`)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.$saving.set(true);
|
|
36
|
+
const request = {
|
|
37
|
+
spaceID: this.$spaceID(),
|
|
38
|
+
contactID: this.$contactID(),
|
|
39
|
+
channelType: this.$channelType(),
|
|
40
|
+
channelID,
|
|
41
|
+
};
|
|
42
|
+
this.contactService
|
|
43
|
+
.deleteContactCommChannel(request)
|
|
44
|
+
.pipe(this.takeUntilDestroyed())
|
|
45
|
+
.subscribe({
|
|
46
|
+
next: () => this.$saving.set(false),
|
|
47
|
+
error: (err) => {
|
|
48
|
+
this.$saving.set(false);
|
|
49
|
+
this.errorLogger.logError(err, 'Failed to delete contact ' + this.$channelType());
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
saveChanges(_event) {
|
|
54
|
+
// console.log('saveChanges', event);
|
|
55
|
+
const channelID = (this.channelID.value || '').trim();
|
|
56
|
+
if (!channelID) {
|
|
57
|
+
this.channelID.markAsTouched();
|
|
58
|
+
this.channelID.setErrors({ required: true });
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
this.$saving.set(true);
|
|
62
|
+
const request = {
|
|
63
|
+
spaceID: this.$spaceID(),
|
|
64
|
+
contactID: this.$contactID(),
|
|
65
|
+
channelID: this.$channel().id,
|
|
66
|
+
channelType: this.$channelType(),
|
|
67
|
+
newChannelID: channelID,
|
|
68
|
+
};
|
|
69
|
+
this.contactService
|
|
70
|
+
.updateContactCommChannel(request)
|
|
71
|
+
.pipe(this.takeUntilDestroyed())
|
|
72
|
+
.subscribe({
|
|
73
|
+
next: () => this.$saving.set(false),
|
|
74
|
+
error: (err) => {
|
|
75
|
+
this.errorLogger.logError(err, 'Failed to update contact' + this.$channelType());
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
onTypeChanged(event) {
|
|
80
|
+
// console.log('onTypeChanged', event);
|
|
81
|
+
const type = event.detail.value;
|
|
82
|
+
this.$saving.set(true);
|
|
83
|
+
const request = {
|
|
84
|
+
spaceID: this.$spaceID(),
|
|
85
|
+
contactID: this.$contactID(),
|
|
86
|
+
channelID: this.$channel().id,
|
|
87
|
+
channelType: this.$channelType(),
|
|
88
|
+
type,
|
|
89
|
+
};
|
|
90
|
+
this.contactService
|
|
91
|
+
.updateContactCommChannel(request)
|
|
92
|
+
.pipe(this.takeUntilDestroyed())
|
|
93
|
+
.subscribe({
|
|
94
|
+
next: () => this.$saving.set(false),
|
|
95
|
+
error: (err) => {
|
|
96
|
+
this.$saving.set(false);
|
|
97
|
+
this.errorLogger.logError(err, 'Failed to update type of contact ' + this.$channelType());
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CommChannelItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
102
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.0", type: CommChannelItemComponent, isStandalone: true, selector: "sneat-comm-channel-item", inputs: { $channelType: { classPropertyName: "$channelType", publicName: "$channelType", isSignal: true, isRequired: true, transformFunction: null }, $channel: { classPropertyName: "$channel", publicName: "$channel", isSignal: true, isRequired: true, transformFunction: null }, $contactID: { classPropertyName: "$contactID", publicName: "$contactID", isSignal: true, isRequired: true, transformFunction: null }, $spaceID: { classPropertyName: "$spaceID", publicName: "$spaceID", isSignal: true, isRequired: true, transformFunction: null }, $lines: { classPropertyName: "$lines", publicName: "$lines", isSignal: true, isRequired: true, transformFunction: null } }, providers: [
|
|
103
|
+
{
|
|
104
|
+
provide: ClassName,
|
|
105
|
+
useValue: 'CommChannelItemComponent',
|
|
106
|
+
},
|
|
107
|
+
], usesInheritance: true, ngImport: i0, template: "<ion-item class=\"sneat-tiny-end-padding\" [lines]=\"$lines()\">\n <ion-select\n placeholder=\"Choose type\"\n interface=\"popover\"\n slot=\"start\"\n [value]=\"$channel().type\"\n style=\"min-width: 120px\"\n (ionChange)=\"onTypeChanged($event)\"\n >\n <ion-select-option value=\"work\">Work</ion-select-option>\n <ion-select-option value=\"personal\">Personal</ion-select-option>\n </ion-select>\n\n <ion-input [formControl]=\"channelID\" (keyup.enter)=\"saveChanges($event)\" />\n\n <ion-buttons slot=\"end\">\n @if (channelID.dirty) {\n <ion-button fill=\"solid\" color=\"danger\" (click)=\"saveChanges($event)\">\n <ion-icon name=\"save-outline\" />\n <ion-label>Save</ion-label>\n </ion-button>\n <ion-button\n title=\"Cancel changes\"\n (click)=\"channelID.reset($channel().id)\"\n >\n <ion-icon name=\"close-outline\" />\n </ion-button>\n } @else {\n <ion-button title=\"Copy\">\n <ion-icon name=\"copy-outline\" />\n </ion-button>\n <ion-button title=\"Remove\" (click)=\"deleteChannel($event)\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n }\n </ion-buttons>\n</ion-item>\n", dependencies: [{ 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: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { 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: IonSelect, selector: "ion-select", inputs: ["cancelText", "color", "compareWith", "disabled", "errorText", "expandedIcon", "fill", "helperText", "interface", "interfaceOptions", "justify", "label", "labelPlacement", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "shape", "toggleIcon", "value"] }, { kind: "component", type: IonSelectOption, selector: "ion-select-option", inputs: ["disabled", "value"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
108
|
+
}
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: CommChannelItemComponent, decorators: [{
|
|
110
|
+
type: Component,
|
|
111
|
+
args: [{ imports: [
|
|
112
|
+
IonButton,
|
|
113
|
+
IonButtons,
|
|
114
|
+
IonIcon,
|
|
115
|
+
IonInput,
|
|
116
|
+
IonItem,
|
|
117
|
+
IonSelect,
|
|
118
|
+
IonSelectOption,
|
|
119
|
+
ReactiveFormsModule,
|
|
120
|
+
IonLabel,
|
|
121
|
+
], providers: [
|
|
122
|
+
{
|
|
123
|
+
provide: ClassName,
|
|
124
|
+
useValue: 'CommChannelItemComponent',
|
|
125
|
+
},
|
|
126
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, selector: 'sneat-comm-channel-item', template: "<ion-item class=\"sneat-tiny-end-padding\" [lines]=\"$lines()\">\n <ion-select\n placeholder=\"Choose type\"\n interface=\"popover\"\n slot=\"start\"\n [value]=\"$channel().type\"\n style=\"min-width: 120px\"\n (ionChange)=\"onTypeChanged($event)\"\n >\n <ion-select-option value=\"work\">Work</ion-select-option>\n <ion-select-option value=\"personal\">Personal</ion-select-option>\n </ion-select>\n\n <ion-input [formControl]=\"channelID\" (keyup.enter)=\"saveChanges($event)\" />\n\n <ion-buttons slot=\"end\">\n @if (channelID.dirty) {\n <ion-button fill=\"solid\" color=\"danger\" (click)=\"saveChanges($event)\">\n <ion-icon name=\"save-outline\" />\n <ion-label>Save</ion-label>\n </ion-button>\n <ion-button\n title=\"Cancel changes\"\n (click)=\"channelID.reset($channel().id)\"\n >\n <ion-icon name=\"close-outline\" />\n </ion-button>\n } @else {\n <ion-button title=\"Copy\">\n <ion-icon name=\"copy-outline\" />\n </ion-button>\n <ion-button title=\"Remove\" (click)=\"deleteChannel($event)\">\n <ion-icon name=\"close-outline\" />\n </ion-button>\n }\n </ion-buttons>\n</ion-item>\n" }]
|
|
127
|
+
}], ctorParameters: () => [], propDecorators: { $channelType: [{ type: i0.Input, args: [{ isSignal: true, alias: "$channelType", required: true }] }], $channel: [{ type: i0.Input, args: [{ isSignal: true, alias: "$channel", required: true }] }], $contactID: [{ type: i0.Input, args: [{ isSignal: true, alias: "$contactID", required: true }] }], $spaceID: [{ type: i0.Input, args: [{ isSignal: true, alias: "$spaceID", required: true }] }], $lines: [{ type: i0.Input, args: [{ isSignal: true, alias: "$lines", required: true }] }] } });
|
|
128
|
+
//# sourceMappingURL=comm-channel-item.component.js.map
|