@aglyn/plugins-crm 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +7 -0
- package/package.json +57 -0
- package/src/index.d.ts +21 -0
- package/src/index.js +29 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/activity-list.d.ts +98 -0
- package/src/lib/components/activity-list.js +321 -0
- package/src/lib/components/activity-list.js.map +1 -0
- package/src/lib/components/activity-queries.d.ts +117 -0
- package/src/lib/components/activity-queries.js +198 -0
- package/src/lib/components/activity-queries.js.map +1 -0
- package/src/lib/components/add-to-list-button.d.ts +25 -0
- package/src/lib/components/add-to-list-button.js +64 -0
- package/src/lib/components/add-to-list-button.js.map +1 -0
- package/src/lib/components/add-to-list-dialog.d.ts +24 -0
- package/src/lib/components/add-to-list-dialog.js +327 -0
- package/src/lib/components/add-to-list-dialog.js.map +1 -0
- package/src/lib/components/assignment-rule-drawer.d.ts +43 -0
- package/src/lib/components/assignment-rule-drawer.js +293 -0
- package/src/lib/components/assignment-rule-drawer.js.map +1 -0
- package/src/lib/components/companies-bulk-bar.d.ts +29 -0
- package/src/lib/components/companies-bulk-bar.js +274 -0
- package/src/lib/components/companies-bulk-bar.js.map +1 -0
- package/src/lib/components/companies-section.d.ts +54 -0
- package/src/lib/components/companies-section.js +522 -0
- package/src/lib/components/companies-section.js.map +1 -0
- package/src/lib/components/company-contacts-card.d.ts +49 -0
- package/src/lib/components/company-contacts-card.js +435 -0
- package/src/lib/components/company-contacts-card.js.map +1 -0
- package/src/lib/components/company-deals-card.d.ts +20 -0
- package/src/lib/components/company-deals-card.js +38 -0
- package/src/lib/components/company-deals-card.js.map +1 -0
- package/src/lib/components/company-detail-page.d.ts +20 -0
- package/src/lib/components/company-detail-page.js +165 -0
- package/src/lib/components/company-detail-page.js.map +1 -0
- package/src/lib/components/company-edit-drawer.d.ts +65 -0
- package/src/lib/components/company-edit-drawer.js +433 -0
- package/src/lib/components/company-edit-drawer.js.map +1 -0
- package/src/lib/components/company-import-drawer.d.ts +42 -0
- package/src/lib/components/company-import-drawer.js +99 -0
- package/src/lib/components/company-import-drawer.js.map +1 -0
- package/src/lib/components/company-picker.d.ts +127 -0
- package/src/lib/components/company-picker.js +323 -0
- package/src/lib/components/company-picker.js.map +1 -0
- package/src/lib/components/company-properties-card.d.ts +47 -0
- package/src/lib/components/company-properties-card.js +289 -0
- package/src/lib/components/company-properties-card.js.map +1 -0
- package/src/lib/components/contact-address-fields.d.ts +29 -0
- package/src/lib/components/contact-address-fields.js +149 -0
- package/src/lib/components/contact-address-fields.js.map +1 -0
- package/src/lib/components/contact-associations-card.d.ts +72 -0
- package/src/lib/components/contact-associations-card.js +296 -0
- package/src/lib/components/contact-associations-card.js.map +1 -0
- package/src/lib/components/contact-custom-columns.d.ts +38 -0
- package/src/lib/components/contact-custom-columns.js +102 -0
- package/src/lib/components/contact-custom-columns.js.map +1 -0
- package/src/lib/components/contact-custom-fields-card.d.ts +39 -0
- package/src/lib/components/contact-custom-fields-card.js +204 -0
- package/src/lib/components/contact-custom-fields-card.js.map +1 -0
- package/src/lib/components/contact-deals-card.d.ts +20 -0
- package/src/lib/components/contact-deals-card.js +38 -0
- package/src/lib/components/contact-deals-card.js.map +1 -0
- package/src/lib/components/contact-detail-page.d.ts +46 -0
- package/src/lib/components/contact-detail-page.js +535 -0
- package/src/lib/components/contact-detail-page.js.map +1 -0
- package/src/lib/components/contact-duplicates-card.d.ts +42 -0
- package/src/lib/components/contact-duplicates-card.js +167 -0
- package/src/lib/components/contact-duplicates-card.js.map +1 -0
- package/src/lib/components/contact-field-drawer.d.ts +64 -0
- package/src/lib/components/contact-field-drawer.js +251 -0
- package/src/lib/components/contact-field-drawer.js.map +1 -0
- package/src/lib/components/contact-import-drawer.d.ts +46 -0
- package/src/lib/components/contact-import-drawer.js +149 -0
- package/src/lib/components/contact-import-drawer.js.map +1 -0
- package/src/lib/components/contact-known-by-card.d.ts +39 -0
- package/src/lib/components/contact-known-by-card.js +142 -0
- package/src/lib/components/contact-known-by-card.js.map +1 -0
- package/src/lib/components/contact-list-columns.d.ts +53 -0
- package/src/lib/components/contact-list-columns.js +288 -0
- package/src/lib/components/contact-list-columns.js.map +1 -0
- package/src/lib/components/contact-merge-dialog.d.ts +79 -0
- package/src/lib/components/contact-merge-dialog.js +405 -0
- package/src/lib/components/contact-merge-dialog.js.map +1 -0
- package/src/lib/components/contact-properties-card.d.ts +89 -0
- package/src/lib/components/contact-properties-card.js +492 -0
- package/src/lib/components/contact-properties-card.js.map +1 -0
- package/src/lib/components/contact-timeline-card.d.ts +68 -0
- package/src/lib/components/contact-timeline-card.js +435 -0
- package/src/lib/components/contact-timeline-card.js.map +1 -0
- package/src/lib/components/contacts-bulk-bar.d.ts +91 -0
- package/src/lib/components/contacts-bulk-bar.js +493 -0
- package/src/lib/components/contacts-bulk-bar.js.map +1 -0
- package/src/lib/components/contacts-section.d.ts +26 -0
- package/src/lib/components/contacts-section.js +1025 -0
- package/src/lib/components/contacts-section.js.map +1 -0
- package/src/lib/components/copy-capture-address-button.d.ts +33 -0
- package/src/lib/components/copy-capture-address-button.js +60 -0
- package/src/lib/components/copy-capture-address-button.js.map +1 -0
- package/src/lib/components/crm-attribution-zone.d.ts +38 -0
- package/src/lib/components/crm-attribution-zone.js +36 -0
- package/src/lib/components/crm-attribution-zone.js.map +1 -0
- package/src/lib/components/crm-booking-zone.d.ts +61 -0
- package/src/lib/components/crm-booking-zone.js +50 -0
- package/src/lib/components/crm-booking-zone.js.map +1 -0
- package/src/lib/components/crm-bulk-bar-frame.d.ts +47 -0
- package/src/lib/components/crm-bulk-bar-frame.js +137 -0
- package/src/lib/components/crm-bulk-bar-frame.js.map +1 -0
- package/src/lib/components/crm-call-actions.d.ts +65 -0
- package/src/lib/components/crm-call-actions.js +110 -0
- package/src/lib/components/crm-call-actions.js.map +1 -0
- package/src/lib/components/crm-column-menu.d.ts +21 -0
- package/src/lib/components/crm-column-menu.js +103 -0
- package/src/lib/components/crm-column-menu.js.map +1 -0
- package/src/lib/components/crm-console-page.d.ts +19 -0
- package/src/lib/components/crm-console-page.js +151 -0
- package/src/lib/components/crm-console-page.js.map +1 -0
- package/src/lib/components/crm-console-sections.d.ts +52 -0
- package/src/lib/components/crm-console-sections.js +83 -0
- package/src/lib/components/crm-console-sections.js.map +1 -0
- package/src/lib/components/crm-custom-field-control.d.ts +26 -0
- package/src/lib/components/crm-custom-field-control.js +131 -0
- package/src/lib/components/crm-custom-field-control.js.map +1 -0
- package/src/lib/components/crm-email-template-tools.d.ts +69 -0
- package/src/lib/components/crm-email-template-tools.js +240 -0
- package/src/lib/components/crm-email-template-tools.js.map +1 -0
- package/src/lib/components/crm-export-all-button.d.ts +39 -0
- package/src/lib/components/crm-export-all-button.js +98 -0
- package/src/lib/components/crm-export-all-button.js.map +1 -0
- package/src/lib/components/crm-filter-bar.d.ts +53 -0
- package/src/lib/components/crm-filter-bar.js +294 -0
- package/src/lib/components/crm-filter-bar.js.map +1 -0
- package/src/lib/components/crm-glance-card.d.ts +54 -0
- package/src/lib/components/crm-glance-card.js +219 -0
- package/src/lib/components/crm-glance-card.js.map +1 -0
- package/src/lib/components/crm-next-activity-column.d.ts +35 -0
- package/src/lib/components/crm-next-activity-column.js +100 -0
- package/src/lib/components/crm-next-activity-column.js.map +1 -0
- package/src/lib/components/crm-record-header.d.ts +97 -0
- package/src/lib/components/crm-record-header.js +160 -0
- package/src/lib/components/crm-record-header.js.map +1 -0
- package/src/lib/components/crm-record-insights-zone.d.ts +50 -0
- package/src/lib/components/crm-record-insights-zone.js +169 -0
- package/src/lib/components/crm-record-insights-zone.js.map +1 -0
- package/src/lib/components/crm-record-picker.d.ts +42 -0
- package/src/lib/components/crm-record-picker.js +104 -0
- package/src/lib/components/crm-record-picker.js.map +1 -0
- package/src/lib/components/crm-send-email-button.d.ts +39 -0
- package/src/lib/components/crm-send-email-button.js +81 -0
- package/src/lib/components/crm-send-email-button.js.map +1 -0
- package/src/lib/components/crm-send-email-dialog.d.ts +61 -0
- package/src/lib/components/crm-send-email-dialog.js +851 -0
- package/src/lib/components/crm-send-email-dialog.js.map +1 -0
- package/src/lib/components/crm-site-picker.d.ts +61 -0
- package/src/lib/components/crm-site-picker.js +99 -0
- package/src/lib/components/crm-site-picker.js.map +1 -0
- package/src/lib/components/crm-suite-lock.d.ts +29 -0
- package/src/lib/components/crm-suite-lock.js +114 -0
- package/src/lib/components/crm-suite-lock.js.map +1 -0
- package/src/lib/components/crm-tasks-due-card.d.ts +42 -0
- package/src/lib/components/crm-tasks-due-card.js +225 -0
- package/src/lib/components/crm-tasks-due-card.js.map +1 -0
- package/src/lib/components/crm-views-control.d.ts +65 -0
- package/src/lib/components/crm-views-control.js +518 -0
- package/src/lib/components/crm-views-control.js.map +1 -0
- package/src/lib/components/csv-import-drawer.d.ts +132 -0
- package/src/lib/components/csv-import-drawer.js +746 -0
- package/src/lib/components/csv-import-drawer.js.map +1 -0
- package/src/lib/components/deal-board.d.ts +70 -0
- package/src/lib/components/deal-board.js +478 -0
- package/src/lib/components/deal-board.js.map +1 -0
- package/src/lib/components/deal-detail-page.d.ts +18 -0
- package/src/lib/components/deal-detail-page.js +323 -0
- package/src/lib/components/deal-detail-page.js.map +1 -0
- package/src/lib/components/deal-edit-drawer.d.ts +59 -0
- package/src/lib/components/deal-edit-drawer.js +640 -0
- package/src/lib/components/deal-edit-drawer.js.map +1 -0
- package/src/lib/components/deal-import-drawer.d.ts +24 -0
- package/src/lib/components/deal-import-drawer.js +83 -0
- package/src/lib/components/deal-import-drawer.js.map +1 -0
- package/src/lib/components/deal-products-card.d.ts +48 -0
- package/src/lib/components/deal-products-card.js +614 -0
- package/src/lib/components/deal-products-card.js.map +1 -0
- package/src/lib/components/deal-properties-card.d.ts +29 -0
- package/src/lib/components/deal-properties-card.js +144 -0
- package/src/lib/components/deal-properties-card.js.map +1 -0
- package/src/lib/components/deal-stage-card.d.ts +24 -0
- package/src/lib/components/deal-stage-card.js +199 -0
- package/src/lib/components/deal-stage-card.js.map +1 -0
- package/src/lib/components/deals-bulk-bar.d.ts +31 -0
- package/src/lib/components/deals-bulk-bar.js +340 -0
- package/src/lib/components/deals-bulk-bar.js.map +1 -0
- package/src/lib/components/deals-section.d.ts +49 -0
- package/src/lib/components/deals-section.js +767 -0
- package/src/lib/components/deals-section.js.map +1 -0
- package/src/lib/components/email-capture-card.d.ts +42 -0
- package/src/lib/components/email-capture-card.js +134 -0
- package/src/lib/components/email-capture-card.js.map +1 -0
- package/src/lib/components/email-template-drawer.d.ts +33 -0
- package/src/lib/components/email-template-drawer.js +209 -0
- package/src/lib/components/email-template-drawer.js.map +1 -0
- package/src/lib/components/email-templates-card.d.ts +33 -0
- package/src/lib/components/email-templates-card.js +370 -0
- package/src/lib/components/email-templates-card.js.map +1 -0
- package/src/lib/components/erase-person-action.d.ts +92 -0
- package/src/lib/components/erase-person-action.js +261 -0
- package/src/lib/components/erase-person-action.js.map +1 -0
- package/src/lib/components/fields-section.d.ts +37 -0
- package/src/lib/components/fields-section.js +641 -0
- package/src/lib/components/fields-section.js.map +1 -0
- package/src/lib/components/form-contact-fields-card.d.ts +46 -0
- package/src/lib/components/form-contact-fields-card.js +253 -0
- package/src/lib/components/form-contact-fields-card.js.map +1 -0
- package/src/lib/components/insert-link-at-caret.d.ts +28 -0
- package/src/lib/components/insert-link-at-caret.js +37 -0
- package/src/lib/components/insert-link-at-caret.js.map +1 -0
- package/src/lib/components/lead-convert-dialog.d.ts +32 -0
- package/src/lib/components/lead-convert-dialog.js +493 -0
- package/src/lib/components/lead-convert-dialog.js.map +1 -0
- package/src/lib/components/lead-detail-page.d.ts +16 -0
- package/src/lib/components/lead-detail-page.js +163 -0
- package/src/lib/components/lead-detail-page.js.map +1 -0
- package/src/lib/components/lead-history-card.d.ts +32 -0
- package/src/lib/components/lead-history-card.js +165 -0
- package/src/lib/components/lead-history-card.js.map +1 -0
- package/src/lib/components/lead-import-drawer.d.ts +24 -0
- package/src/lib/components/lead-import-drawer.js +95 -0
- package/src/lib/components/lead-import-drawer.js.map +1 -0
- package/src/lib/components/lead-owner-select.d.ts +35 -0
- package/src/lib/components/lead-owner-select.js +91 -0
- package/src/lib/components/lead-owner-select.js.map +1 -0
- package/src/lib/components/lead-properties-card.d.ts +61 -0
- package/src/lib/components/lead-properties-card.js +395 -0
- package/src/lib/components/lead-properties-card.js.map +1 -0
- package/src/lib/components/lead-status-chip.d.ts +12 -0
- package/src/lib/components/lead-status-chip.js +43 -0
- package/src/lib/components/lead-status-chip.js.map +1 -0
- package/src/lib/components/lead-surfaces-note.d.ts +126 -0
- package/src/lib/components/lead-surfaces-note.js +262 -0
- package/src/lib/components/lead-surfaces-note.js.map +1 -0
- package/src/lib/components/lead-unqualify-dialog.d.ts +24 -0
- package/src/lib/components/lead-unqualify-dialog.js +125 -0
- package/src/lib/components/lead-unqualify-dialog.js.map +1 -0
- package/src/lib/components/leads-bulk-bar.d.ts +58 -0
- package/src/lib/components/leads-bulk-bar.js +307 -0
- package/src/lib/components/leads-bulk-bar.js.map +1 -0
- package/src/lib/components/leads-section.d.ts +23 -0
- package/src/lib/components/leads-section.js +664 -0
- package/src/lib/components/leads-section.js.map +1 -0
- package/src/lib/components/linked-deals-card.d.ts +32 -0
- package/src/lib/components/linked-deals-card.js +163 -0
- package/src/lib/components/linked-deals-card.js.map +1 -0
- package/src/lib/components/log-activity-dialog.d.ts +60 -0
- package/src/lib/components/log-activity-dialog.js +368 -0
- package/src/lib/components/log-activity-dialog.js.map +1 -0
- package/src/lib/components/lost-reason-dialog.d.ts +26 -0
- package/src/lib/components/lost-reason-dialog.js +95 -0
- package/src/lib/components/lost-reason-dialog.js.map +1 -0
- package/src/lib/components/new-contact-drawer.d.ts +78 -0
- package/src/lib/components/new-contact-drawer.js +343 -0
- package/src/lib/components/new-contact-drawer.js.map +1 -0
- package/src/lib/components/org-lead-surfaces-note.d.ts +57 -0
- package/src/lib/components/org-lead-surfaces-note.js +172 -0
- package/src/lib/components/org-lead-surfaces-note.js.map +1 -0
- package/src/lib/components/owner-avatar.d.ts +18 -0
- package/src/lib/components/owner-avatar.js +61 -0
- package/src/lib/components/owner-avatar.js.map +1 -0
- package/src/lib/components/pipeline-stages-dialog.d.ts +43 -0
- package/src/lib/components/pipeline-stages-dialog.js +339 -0
- package/src/lib/components/pipeline-stages-dialog.js.map +1 -0
- package/src/lib/components/pipelines-dialog.d.ts +55 -0
- package/src/lib/components/pipelines-dialog.js +517 -0
- package/src/lib/components/pipelines-dialog.js.map +1 -0
- package/src/lib/components/recent-activity-feed.d.ts +39 -0
- package/src/lib/components/recent-activity-feed.js +103 -0
- package/src/lib/components/recent-activity-feed.js.map +1 -0
- package/src/lib/components/recipes-card.d.ts +39 -0
- package/src/lib/components/recipes-card.js +485 -0
- package/src/lib/components/recipes-card.js.map +1 -0
- package/src/lib/components/record-activity-card.d.ts +26 -0
- package/src/lib/components/record-activity-card.js +121 -0
- package/src/lib/components/record-activity-card.js.map +1 -0
- package/src/lib/components/record-files-card.d.ts +67 -0
- package/src/lib/components/record-files-card.js +290 -0
- package/src/lib/components/record-files-card.js.map +1 -0
- package/src/lib/components/record-tasks-card.d.ts +32 -0
- package/src/lib/components/record-tasks-card.js +306 -0
- package/src/lib/components/record-tasks-card.js.map +1 -0
- package/src/lib/components/reports/activity-card.d.ts +57 -0
- package/src/lib/components/reports/activity-card.js +281 -0
- package/src/lib/components/reports/activity-card.js.map +1 -0
- package/src/lib/components/reports/closed-deals-card.d.ts +20 -0
- package/src/lib/components/reports/closed-deals-card.js +194 -0
- package/src/lib/components/reports/closed-deals-card.js.map +1 -0
- package/src/lib/components/reports/contacts-mix-card.d.ts +27 -0
- package/src/lib/components/reports/contacts-mix-card.js +161 -0
- package/src/lib/components/reports/contacts-mix-card.js.map +1 -0
- package/src/lib/components/reports/contacts-trend-card.d.ts +31 -0
- package/src/lib/components/reports/contacts-trend-card.js +144 -0
- package/src/lib/components/reports/contacts-trend-card.js.map +1 -0
- package/src/lib/components/reports/forecast-card.d.ts +22 -0
- package/src/lib/components/reports/forecast-card.js +251 -0
- package/src/lib/components/reports/forecast-card.js.map +1 -0
- package/src/lib/components/reports/lead-counts.d.ts +32 -0
- package/src/lib/components/reports/lead-counts.js +44 -0
- package/src/lib/components/reports/lead-counts.js.map +1 -0
- package/src/lib/components/reports/lead-funnel-card.d.ts +38 -0
- package/src/lib/components/reports/lead-funnel-card.js +375 -0
- package/src/lib/components/reports/lead-funnel-card.js.map +1 -0
- package/src/lib/components/reports/pipeline-card.d.ts +19 -0
- package/src/lib/components/reports/pipeline-card.js +338 -0
- package/src/lib/components/reports/pipeline-card.js.map +1 -0
- package/src/lib/components/reports/report-bar-chart.d.ts +39 -0
- package/src/lib/components/reports/report-bar-chart.js +133 -0
- package/src/lib/components/reports/report-bar-chart.js.map +1 -0
- package/src/lib/components/reports/report-breakdown.d.ts +32 -0
- package/src/lib/components/reports/report-breakdown.js +105 -0
- package/src/lib/components/reports/report-breakdown.js.map +1 -0
- package/src/lib/components/reports/report-export.d.ts +37 -0
- package/src/lib/components/reports/report-export.js +66 -0
- package/src/lib/components/reports/report-export.js.map +1 -0
- package/src/lib/components/reports/report-format.d.ts +36 -0
- package/src/lib/components/reports/report-format.js +43 -0
- package/src/lib/components/reports/report-format.js.map +1 -0
- package/src/lib/components/reports/report-scope.d.ts +81 -0
- package/src/lib/components/reports/report-scope.js +58 -0
- package/src/lib/components/reports/report-scope.js.map +1 -0
- package/src/lib/components/reports/report-stat-tile.d.ts +47 -0
- package/src/lib/components/reports/report-stat-tile.js +96 -0
- package/src/lib/components/reports/report-stat-tile.js.map +1 -0
- package/src/lib/components/reports/source-conversion-card.d.ts +28 -0
- package/src/lib/components/reports/source-conversion-card.js +205 -0
- package/src/lib/components/reports/source-conversion-card.js.map +1 -0
- package/src/lib/components/reports/tasks-card.d.ts +26 -0
- package/src/lib/components/reports/tasks-card.js +279 -0
- package/src/lib/components/reports/tasks-card.js.map +1 -0
- package/src/lib/components/reports/use-aggregate-read.d.ts +99 -0
- package/src/lib/components/reports/use-aggregate-read.js +195 -0
- package/src/lib/components/reports/use-aggregate-read.js.map +1 -0
- package/src/lib/components/reports/won-lost-by-owner-card.d.ts +30 -0
- package/src/lib/components/reports/won-lost-by-owner-card.js +168 -0
- package/src/lib/components/reports/won-lost-by-owner-card.js.map +1 -0
- package/src/lib/components/reports-section.d.ts +42 -0
- package/src/lib/components/reports-section.js +308 -0
- package/src/lib/components/reports-section.js.map +1 -0
- package/src/lib/components/sending-addresses-card.d.ts +49 -0
- package/src/lib/components/sending-addresses-card.js +262 -0
- package/src/lib/components/sending-addresses-card.js.map +1 -0
- package/src/lib/components/settings-section.d.ts +151 -0
- package/src/lib/components/settings-section.js +783 -0
- package/src/lib/components/settings-section.js.map +1 -0
- package/src/lib/components/task-cells.d.ts +51 -0
- package/src/lib/components/task-cells.js +139 -0
- package/src/lib/components/task-cells.js.map +1 -0
- package/src/lib/components/task-edit-drawer.d.ts +53 -0
- package/src/lib/components/task-edit-drawer.js +483 -0
- package/src/lib/components/task-edit-drawer.js.map +1 -0
- package/src/lib/components/task-import-drawer.d.ts +24 -0
- package/src/lib/components/task-import-drawer.js +82 -0
- package/src/lib/components/task-import-drawer.js.map +1 -0
- package/src/lib/components/task-snooze-menu.d.ts +65 -0
- package/src/lib/components/task-snooze-menu.js +207 -0
- package/src/lib/components/task-snooze-menu.js.map +1 -0
- package/src/lib/components/tasks-bulk-bar.d.ts +25 -0
- package/src/lib/components/tasks-bulk-bar.js +348 -0
- package/src/lib/components/tasks-bulk-bar.js.map +1 -0
- package/src/lib/components/tasks-calendar.d.ts +38 -0
- package/src/lib/components/tasks-calendar.js +228 -0
- package/src/lib/components/tasks-calendar.js.map +1 -0
- package/src/lib/components/tasks-section.d.ts +27 -0
- package/src/lib/components/tasks-section.js +579 -0
- package/src/lib/components/tasks-section.js.map +1 -0
- package/src/lib/components/use-contact-campaign-emails.d.ts +32 -0
- package/src/lib/components/use-contact-campaign-emails.js +83 -0
- package/src/lib/components/use-contact-campaign-emails.js.map +1 -0
- package/src/lib/components/use-crm-api.d.ts +44 -0
- package/src/lib/components/use-crm-api.js +84 -0
- package/src/lib/components/use-crm-api.js.map +1 -0
- package/src/lib/components/use-crm-inbound-address.d.ts +60 -0
- package/src/lib/components/use-crm-inbound-address.js +124 -0
- package/src/lib/components/use-crm-inbound-address.js.map +1 -0
- package/src/lib/components/use-emails-hub-path.d.ts +24 -0
- package/src/lib/components/use-emails-hub-path.js +59 -0
- package/src/lib/components/use-emails-hub-path.js.map +1 -0
- package/src/lib/components/use-member-email-aliases.d.ts +54 -0
- package/src/lib/components/use-member-email-aliases.js +186 -0
- package/src/lib/components/use-member-email-aliases.js.map +1 -0
- package/src/lib/components/use-org-members.d.ts +40 -0
- package/src/lib/components/use-org-members.js +100 -0
- package/src/lib/components/use-org-members.js.map +1 -0
- package/src/lib/constants/api-routes.d.ts +109 -0
- package/src/lib/constants/api-routes.js +74 -0
- package/src/lib/constants/api-routes.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +14 -0
- package/src/lib/constants/bundle-common.js +14 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/constants/company-filters.d.ts +18 -0
- package/src/lib/constants/company-filters.js +51 -0
- package/src/lib/constants/company-filters.js.map +1 -0
- package/src/lib/constants/contact-filters.d.ts +38 -0
- package/src/lib/constants/contact-filters.js +294 -0
- package/src/lib/constants/contact-filters.js.map +1 -0
- package/src/lib/hooks/use-contact-field-definitions.d.ts +48 -0
- package/src/lib/hooks/use-contact-field-definitions.js +72 -0
- package/src/lib/hooks/use-contact-field-definitions.js.map +1 -0
- package/src/lib/hooks/use-contact-update.d.ts +25 -0
- package/src/lib/hooks/use-contact-update.js +80 -0
- package/src/lib/hooks/use-contact-update.js.map +1 -0
- package/src/lib/hooks/use-crm-activity-logger.d.ts +73 -0
- package/src/lib/hooks/use-crm-activity-logger.js +101 -0
- package/src/lib/hooks/use-crm-activity-logger.js.map +1 -0
- package/src/lib/hooks/use-crm-bulk-apply.d.ts +52 -0
- package/src/lib/hooks/use-crm-bulk-apply.js +112 -0
- package/src/lib/hooks/use-crm-bulk-apply.js.map +1 -0
- package/src/lib/hooks/use-crm-default-view.d.ts +24 -0
- package/src/lib/hooks/use-crm-default-view.js +64 -0
- package/src/lib/hooks/use-crm-default-view.js.map +1 -0
- package/src/lib/hooks/use-crm-email-templates.d.ts +59 -0
- package/src/lib/hooks/use-crm-email-templates.js +103 -0
- package/src/lib/hooks/use-crm-email-templates.js.map +1 -0
- package/src/lib/hooks/use-crm-hub-path.d.ts +29 -0
- package/src/lib/hooks/use-crm-hub-path.js +41 -0
- package/src/lib/hooks/use-crm-hub-path.js.map +1 -0
- package/src/lib/hooks/use-crm-org-mount.d.ts +97 -0
- package/src/lib/hooks/use-crm-org-mount.js +215 -0
- package/src/lib/hooks/use-crm-org-mount.js.map +1 -0
- package/src/lib/hooks/use-crm-record-names.d.ts +52 -0
- package/src/lib/hooks/use-crm-record-names.js +126 -0
- package/src/lib/hooks/use-crm-record-names.js.map +1 -0
- package/src/lib/hooks/use-crm-records-quota.d.ts +68 -0
- package/src/lib/hooks/use-crm-records-quota.js +118 -0
- package/src/lib/hooks/use-crm-records-quota.js.map +1 -0
- package/src/lib/hooks/use-crm-saved-view.d.ts +96 -0
- package/src/lib/hooks/use-crm-saved-view.js +329 -0
- package/src/lib/hooks/use-crm-saved-view.js.map +1 -0
- package/src/lib/hooks/use-crm-scope.d.ts +117 -0
- package/src/lib/hooks/use-crm-scope.js +147 -0
- package/src/lib/hooks/use-crm-scope.js.map +1 -0
- package/src/lib/hooks/use-crm-tasks.d.ts +85 -0
- package/src/lib/hooks/use-crm-tasks.js +153 -0
- package/src/lib/hooks/use-crm-tasks.js.map +1 -0
- package/src/lib/hooks/use-crm-view-grid.d.ts +55 -0
- package/src/lib/hooks/use-crm-view-grid.js +170 -0
- package/src/lib/hooks/use-crm-view-grid.js.map +1 -0
- package/src/lib/hooks/use-crm-views.d.ts +42 -0
- package/src/lib/hooks/use-crm-views.js +84 -0
- package/src/lib/hooks/use-crm-views.js.map +1 -0
- package/src/lib/hooks/use-deal-stage-api.d.ts +69 -0
- package/src/lib/hooks/use-deal-stage-api.js +78 -0
- package/src/lib/hooks/use-deal-stage-api.js.map +1 -0
- package/src/lib/hooks/use-deals.d.ts +47 -0
- package/src/lib/hooks/use-deals.js +105 -0
- package/src/lib/hooks/use-deals.js.map +1 -0
- package/src/lib/hooks/use-org-leads.d.ts +53 -0
- package/src/lib/hooks/use-org-leads.js +114 -0
- package/src/lib/hooks/use-org-leads.js.map +1 -0
- package/src/lib/hooks/use-org-member-directory.d.ts +36 -0
- package/src/lib/hooks/use-org-member-directory.js +116 -0
- package/src/lib/hooks/use-org-member-directory.js.map +1 -0
- package/src/lib/hooks/use-org-member-options.d.ts +38 -0
- package/src/lib/hooks/use-org-member-options.js +131 -0
- package/src/lib/hooks/use-org-member-options.js.map +1 -0
- package/src/lib/hooks/use-pipeline.d.ts +71 -0
- package/src/lib/hooks/use-pipeline.js +159 -0
- package/src/lib/hooks/use-pipeline.js.map +1 -0
- package/src/lib/model/companies-bulk-writes.d.ts +40 -0
- package/src/lib/model/companies-bulk-writes.js +103 -0
- package/src/lib/model/companies-bulk-writes.js.map +1 -0
- package/src/lib/model/companies-csv.d.ts +36 -0
- package/src/lib/model/companies-csv.js +38 -0
- package/src/lib/model/companies-csv.js.map +1 -0
- package/src/lib/model/companies.d.ts +99 -0
- package/src/lib/model/companies.js +168 -0
- package/src/lib/model/companies.js.map +1 -0
- package/src/lib/model/company-delete-route.d.ts +43 -0
- package/src/lib/model/company-delete-route.js +31 -0
- package/src/lib/model/company-delete-route.js.map +1 -0
- package/src/lib/model/company-delete.d.ts +42 -0
- package/src/lib/model/company-delete.js +52 -0
- package/src/lib/model/company-delete.js.map +1 -0
- package/src/lib/model/contact-duplicates.d.ts +58 -0
- package/src/lib/model/contact-duplicates.js +67 -0
- package/src/lib/model/contact-duplicates.js.map +1 -0
- package/src/lib/model/contact-record.d.ts +113 -0
- package/src/lib/model/contact-record.js +70 -0
- package/src/lib/model/contact-record.js.map +1 -0
- package/src/lib/model/contact-update.d.ts +93 -0
- package/src/lib/model/contact-update.js +50 -0
- package/src/lib/model/contact-update.js.map +1 -0
- package/src/lib/model/contacts-bulk-writes.d.ts +173 -0
- package/src/lib/model/contacts-bulk-writes.js +196 -0
- package/src/lib/model/contacts-bulk-writes.js.map +1 -0
- package/src/lib/model/contacts-csv.d.ts +54 -0
- package/src/lib/model/contacts-csv.js +67 -0
- package/src/lib/model/contacts-csv.js.map +1 -0
- package/src/lib/model/contacts-list-seed.d.ts +51 -0
- package/src/lib/model/contacts-list-seed.js +63 -0
- package/src/lib/model/contacts-list-seed.js.map +1 -0
- package/src/lib/model/crm-activity-report.d.ts +27 -0
- package/src/lib/model/crm-activity-report.js +56 -0
- package/src/lib/model/crm-activity-report.js.map +1 -0
- package/src/lib/model/crm-api.d.ts +49 -0
- package/src/lib/model/crm-api.js +47 -0
- package/src/lib/model/crm-api.js.map +1 -0
- package/src/lib/model/crm-bulk-writes.d.ts +147 -0
- package/src/lib/model/crm-bulk-writes.js +207 -0
- package/src/lib/model/crm-bulk-writes.js.map +1 -0
- package/src/lib/model/crm-company-import.d.ts +154 -0
- package/src/lib/model/crm-company-import.js +331 -0
- package/src/lib/model/crm-company-import.js.map +1 -0
- package/src/lib/model/crm-custom-draft.d.ts +62 -0
- package/src/lib/model/crm-custom-draft.js +67 -0
- package/src/lib/model/crm-custom-draft.js.map +1 -0
- package/src/lib/model/crm-deal-import.d.ts +112 -0
- package/src/lib/model/crm-deal-import.js +263 -0
- package/src/lib/model/crm-deal-import.js.map +1 -0
- package/src/lib/model/crm-import.d.ts +244 -0
- package/src/lib/model/crm-import.js +466 -0
- package/src/lib/model/crm-import.js.map +1 -0
- package/src/lib/model/crm-lead-import.d.ts +105 -0
- package/src/lib/model/crm-lead-import.js +255 -0
- package/src/lib/model/crm-lead-import.js.map +1 -0
- package/src/lib/model/crm-record-routes.d.ts +21 -0
- package/src/lib/model/crm-record-routes.js +70 -0
- package/src/lib/model/crm-record-routes.js.map +1 -0
- package/src/lib/model/crm-routes.d.ts +101 -0
- package/src/lib/model/crm-routes.js +92 -0
- package/src/lib/model/crm-routes.js.map +1 -0
- package/src/lib/model/crm-task-import.d.ts +94 -0
- package/src/lib/model/crm-task-import.js +275 -0
- package/src/lib/model/crm-task-import.js.map +1 -0
- package/src/lib/model/crm-view-param.d.ts +43 -0
- package/src/lib/model/crm-view-param.js +49 -0
- package/src/lib/model/crm-view-param.js.map +1 -0
- package/src/lib/model/deal-board-model.d.ts +241 -0
- package/src/lib/model/deal-board-model.js +439 -0
- package/src/lib/model/deal-board-model.js.map +1 -0
- package/src/lib/model/deal-form-model.d.ts +114 -0
- package/src/lib/model/deal-form-model.js +218 -0
- package/src/lib/model/deal-form-model.js.map +1 -0
- package/src/lib/model/deals-csv.d.ts +32 -0
- package/src/lib/model/deals-csv.js +37 -0
- package/src/lib/model/deals-csv.js.map +1 -0
- package/src/lib/model/import-column-shapes.d.ts +36 -0
- package/src/lib/model/import-column-shapes.js +76 -0
- package/src/lib/model/import-column-shapes.js.map +1 -0
- package/src/lib/model/lead-company-suggestion.d.ts +61 -0
- package/src/lib/model/lead-company-suggestion.js +65 -0
- package/src/lib/model/lead-company-suggestion.js.map +1 -0
- package/src/lib/model/lead-filters.d.ts +29 -0
- package/src/lib/model/lead-filters.js +39 -0
- package/src/lib/model/lead-filters.js.map +1 -0
- package/src/lib/model/lead-surfaces.d.ts +58 -0
- package/src/lib/model/lead-surfaces.js +67 -0
- package/src/lib/model/lead-surfaces.js.map +1 -0
- package/src/lib/model/leads-csv.d.ts +40 -0
- package/src/lib/model/leads-csv.js +40 -0
- package/src/lib/model/leads-csv.js.map +1 -0
- package/src/lib/model/next-activity-api.d.ts +31 -0
- package/src/lib/model/next-activity-api.js +57 -0
- package/src/lib/model/next-activity-api.js.map +1 -0
- package/src/lib/model/next-activity.d.ts +64 -0
- package/src/lib/model/next-activity.js +47 -0
- package/src/lib/model/next-activity.js.map +1 -0
- package/src/lib/model/person-key-web.d.ts +43 -0
- package/src/lib/model/person-key-web.js +52 -0
- package/src/lib/model/person-key-web.js.map +1 -0
- package/src/lib/model/record-facts.d.ts +282 -0
- package/src/lib/model/record-facts.js +434 -0
- package/src/lib/model/record-facts.js.map +1 -0
- package/src/lib/model/task-api.d.ts +28 -0
- package/src/lib/model/task-api.js +57 -0
- package/src/lib/model/task-api.js.map +1 -0
- package/src/lib/model/task-calendar.d.ts +108 -0
- package/src/lib/model/task-calendar.js +139 -0
- package/src/lib/model/task-calendar.js.map +1 -0
- package/src/lib/model/task-routes.d.ts +177 -0
- package/src/lib/model/task-routes.js +197 -0
- package/src/lib/model/task-routes.js.map +1 -0
- package/src/lib/model/task-scope.d.ts +45 -0
- package/src/lib/model/task-scope.js +51 -0
- package/src/lib/model/task-scope.js.map +1 -0
- package/src/lib/model/task-views.d.ts +149 -0
- package/src/lib/model/task-views.js +286 -0
- package/src/lib/model/task-views.js.map +1 -0
- package/src/lib/model/tasks-csv.d.ts +28 -0
- package/src/lib/model/tasks-csv.js +28 -0
- package/src/lib/model/tasks-csv.js.map +1 -0
- package/src/lib/plugin.d.ts +32 -0
- package/src/lib/plugin.js +208 -0
- package/src/lib/plugin.js.map +1 -0
- package/src/lib/server/companies-import.d.ts +57 -0
- package/src/lib/server/companies-import.js +242 -0
- package/src/lib/server/companies-import.js.map +1 -0
- package/src/lib/server/company-delete.d.ts +59 -0
- package/src/lib/server/company-delete.js +146 -0
- package/src/lib/server/company-delete.js.map +1 -0
- package/src/lib/server/contact-email-history.d.ts +82 -0
- package/src/lib/server/contact-email-history.js +264 -0
- package/src/lib/server/contact-email-history.js.map +1 -0
- package/src/lib/server/contact-profile.d.ts +41 -0
- package/src/lib/server/contact-profile.js +45 -0
- package/src/lib/server/contact-profile.js.map +1 -0
- package/src/lib/server/contact-update.d.ts +92 -0
- package/src/lib/server/contact-update.js +512 -0
- package/src/lib/server/contact-update.js.map +1 -0
- package/src/lib/server/contacts-import.d.ts +73 -0
- package/src/lib/server/contacts-import.js +263 -0
- package/src/lib/server/contacts-import.js.map +1 -0
- package/src/lib/server/contacts-merge.d.ts +86 -0
- package/src/lib/server/contacts-merge.js +206 -0
- package/src/lib/server/contacts-merge.js.map +1 -0
- package/src/lib/server/deals-import.d.ts +76 -0
- package/src/lib/server/deals-import.js +246 -0
- package/src/lib/server/deals-import.js.map +1 -0
- package/src/lib/server/email-send.d.ts +119 -0
- package/src/lib/server/email-send.js +667 -0
- package/src/lib/server/email-send.js.map +1 -0
- package/src/lib/server/email-template-duplicate.d.ts +19 -0
- package/src/lib/server/email-template-duplicate.js +206 -0
- package/src/lib/server/email-template-duplicate.js.map +1 -0
- package/src/lib/server/erase-person.d.ts +108 -0
- package/src/lib/server/erase-person.js +309 -0
- package/src/lib/server/erase-person.js.map +1 -0
- package/src/lib/server/import-context.d.ts +85 -0
- package/src/lib/server/import-context.js +181 -0
- package/src/lib/server/import-context.js.map +1 -0
- package/src/lib/server/inbound-address.d.ts +61 -0
- package/src/lib/server/inbound-address.js +188 -0
- package/src/lib/server/inbound-address.js.map +1 -0
- package/src/lib/server/lead-convert.d.ts +78 -0
- package/src/lib/server/lead-convert.js +250 -0
- package/src/lib/server/lead-convert.js.map +1 -0
- package/src/lib/server/leads-import.d.ts +84 -0
- package/src/lib/server/leads-import.js +261 -0
- package/src/lib/server/leads-import.js.map +1 -0
- package/src/lib/server/next-activity-routes.d.ts +33 -0
- package/src/lib/server/next-activity-routes.js +110 -0
- package/src/lib/server/next-activity-routes.js.map +1 -0
- package/src/lib/server/org-activity.d.ts +61 -0
- package/src/lib/server/org-activity.js +120 -0
- package/src/lib/server/org-activity.js.map +1 -0
- package/src/lib/server/org-caller.d.ts +110 -0
- package/src/lib/server/org-caller.js +154 -0
- package/src/lib/server/org-caller.js.map +1 -0
- package/src/lib/server/recipe-routes.d.ts +75 -0
- package/src/lib/server/recipe-routes.js +442 -0
- package/src/lib/server/recipe-routes.js.map +1 -0
- package/src/lib/server/record-facts.d.ts +65 -0
- package/src/lib/server/record-facts.js +337 -0
- package/src/lib/server/record-facts.js.map +1 -0
- package/src/lib/server/record-timeline.d.ts +51 -0
- package/src/lib/server/record-timeline.js +215 -0
- package/src/lib/server/record-timeline.js.map +1 -0
- package/src/lib/server/suite-gate.d.ts +42 -0
- package/src/lib/server/suite-gate.js +87 -0
- package/src/lib/server/suite-gate.js.map +1 -0
- package/src/lib/server/task-routes.d.ts +132 -0
- package/src/lib/server/task-routes.js +699 -0
- package/src/lib/server/task-routes.js.map +1 -0
- package/src/lib/server/tasks-import.d.ts +54 -0
- package/src/lib/server/tasks-import.js +157 -0
- package/src/lib/server/tasks-import.js.map +1 -0
- package/src/lib/server-deal-stage.d.ts +88 -0
- package/src/lib/server-deal-stage.js +316 -0
- package/src/lib/server-deal-stage.js.map +1 -0
- package/src/lib/server.d.ts +149 -0
- package/src/lib/server.js +615 -0
- package/src/lib/server.js.map +1 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { findOrgMember } from "@aglyn/aglyn";
|
|
19
|
+
import { FormControl, InputLabel, MenuItem, Select } from "@mui/material";
|
|
20
|
+
import { useId } from "react";
|
|
21
|
+
/** The `value` an owner select carries for "nobody". */ export const UNASSIGNED_OWNER = '';
|
|
22
|
+
/**
|
|
23
|
+
* How a member reads in a picker: the name they set, else their address,
|
|
24
|
+
* else the id — never blank, because a blank option cannot be chosen on
|
|
25
|
+
* purpose.
|
|
26
|
+
*/ export function orgMemberLabel(member) {
|
|
27
|
+
var _member_displayName, _member_email;
|
|
28
|
+
return String((_member_displayName = member.displayName) != null ? _member_displayName : '').trim() || String((_member_email = member.email) != null ? _member_email : '').trim() || String(member.$id);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The owner picker: Unassigned, then the roster by name.
|
|
32
|
+
*
|
|
33
|
+
* The stored value is resolved to a member first — by uid, or by an address
|
|
34
|
+
* the roster has — so the picker highlights the person and a save writes
|
|
35
|
+
* their uid. A value the roster does not hold is kept as its own option
|
|
36
|
+
* rather than dropped, because a controlled `Select` whose value is absent
|
|
37
|
+
* from its options renders empty — which would show a lead owned by
|
|
38
|
+
* somebody who left as owned by nobody, and a save from that state would
|
|
39
|
+
* make it true.
|
|
40
|
+
*/ export function LeadOwnerSelect(props) {
|
|
41
|
+
var _ref, _ref1;
|
|
42
|
+
const { value, onChange, roster, label = 'Owner', size = 'small', disabled, fullWidth = true } = props;
|
|
43
|
+
const resolved = findOrgMember(roster.options, value);
|
|
44
|
+
const current = (_ref = (_ref1 = resolved == null ? void 0 : resolved.uid) != null ? _ref1 : value) != null ? _ref : UNASSIGNED_OWNER;
|
|
45
|
+
const known = Boolean(resolved);
|
|
46
|
+
/*
|
|
47
|
+
* A bare `Select` names its combobox after the VALUE it shows, not after
|
|
48
|
+
* the label beside it — MUI builds `aria-labelledby` from `labelId` and the
|
|
49
|
+
* display element, and with no `labelId` only the display is left. A
|
|
50
|
+
* reader hears "Unassigned" and has to guess it is the owner; a test can
|
|
51
|
+
* only find the control by what it happens to say. The label's id is what
|
|
52
|
+
* makes "Owner" the control's name.
|
|
53
|
+
*/ const labelId = useId();
|
|
54
|
+
return /*#__PURE__*/ _jsxs(FormControl, {
|
|
55
|
+
size: size,
|
|
56
|
+
fullWidth: fullWidth,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ _jsx(InputLabel, {
|
|
60
|
+
id: labelId,
|
|
61
|
+
children: label
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ _jsxs(Select, {
|
|
64
|
+
labelId: labelId,
|
|
65
|
+
label: label,
|
|
66
|
+
value: current,
|
|
67
|
+
onChange: (event)=>onChange(String(event.target.value)),
|
|
68
|
+
children: [
|
|
69
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
70
|
+
value: UNASSIGNED_OWNER,
|
|
71
|
+
children: /*#__PURE__*/ _jsx("em", {
|
|
72
|
+
children: 'Unassigned'
|
|
73
|
+
})
|
|
74
|
+
}),
|
|
75
|
+
current && !known ? /*#__PURE__*/ _jsx(MenuItem, {
|
|
76
|
+
value: current,
|
|
77
|
+
children: roster.labelFor(current)
|
|
78
|
+
}) : null,
|
|
79
|
+
roster.options.map((option)=>/*#__PURE__*/ _jsx(MenuItem, {
|
|
80
|
+
value: option.uid,
|
|
81
|
+
children: option.label
|
|
82
|
+
}, option.uid))
|
|
83
|
+
]
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
LeadOwnerSelect.displayName = 'LeadOwnerSelect';
|
|
89
|
+
export default LeadOwnerSelect;
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=lead-owner-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/lead-owner-select.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { type AglynOrgMember, findOrgMember } from '@aglyn/aglyn'\nimport { FormControl, InputLabel, MenuItem, Select } from '@mui/material'\nimport { useId } from 'react'\nimport type { OrgMemberOptions } from '../hooks/use-org-member-options'\n\n/** The `value` an owner select carries for \"nobody\". */\nexport const UNASSIGNED_OWNER = ''\n\n/**\n * How a member reads in a picker: the name they set, else their address,\n * else the id — never blank, because a blank option cannot be chosen on\n * purpose.\n */\nexport function orgMemberLabel(\n member: Pick<AglynOrgMember, '$id' | 'displayName' | 'email'>,\n): string {\n return (\n String(member.displayName ?? '').trim() ||\n String(member.email ?? '').trim() ||\n String(member.$id)\n )\n}\n\nexport interface LeadOwnerSelectProps {\n value: string | null | undefined\n onChange: (uid: string) => void\n roster: OrgMemberOptions\n label?: string\n size?: 'small' | 'medium'\n disabled?: boolean\n fullWidth?: boolean\n}\n\n/**\n * The owner picker: Unassigned, then the roster by name.\n *\n * The stored value is resolved to a member first — by uid, or by an address\n * the roster has — so the picker highlights the person and a save writes\n * their uid. A value the roster does not hold is kept as its own option\n * rather than dropped, because a controlled `Select` whose value is absent\n * from its options renders empty — which would show a lead owned by\n * somebody who left as owned by nobody, and a save from that state would\n * make it true.\n */\nexport function LeadOwnerSelect(props: LeadOwnerSelectProps) {\n const {\n value,\n onChange,\n roster,\n label = 'Owner',\n size = 'small',\n disabled,\n fullWidth = true,\n } = props\n const resolved = findOrgMember(roster.options, value)\n const current = resolved?.uid ?? value ?? UNASSIGNED_OWNER\n const known = Boolean(resolved)\n /*\n * A bare `Select` names its combobox after the VALUE it shows, not after\n * the label beside it — MUI builds `aria-labelledby` from `labelId` and the\n * display element, and with no `labelId` only the display is left. A\n * reader hears \"Unassigned\" and has to guess it is the owner; a test can\n * only find the control by what it happens to say. The label's id is what\n * makes \"Owner\" the control's name.\n */\n const labelId = useId()\n return (\n <FormControl size={size} fullWidth={fullWidth} disabled={disabled}>\n <InputLabel id={labelId}>{label}</InputLabel>\n <Select\n labelId={labelId}\n label={label}\n value={current}\n onChange={(event) => onChange(String(event.target.value))}\n >\n <MenuItem value={UNASSIGNED_OWNER}>\n <em>{'Unassigned'}</em>\n </MenuItem>\n {current && !known ? (\n <MenuItem value={current}>{roster.labelFor(current)}</MenuItem>\n ) : null}\n {roster.options.map((option) => (\n <MenuItem key={option.uid} value={option.uid}>\n {option.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n )\n}\nLeadOwnerSelect.displayName = 'LeadOwnerSelect'\n\nexport default LeadOwnerSelect\n"],"names":["findOrgMember","FormControl","InputLabel","MenuItem","Select","useId","UNASSIGNED_OWNER","orgMemberLabel","member","String","displayName","trim","email","$id","LeadOwnerSelect","props","resolved","value","onChange","roster","label","size","disabled","fullWidth","options","current","uid","known","Boolean","labelId","id","event","target","em","labelFor","map","option"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SAA8BA,aAAa,QAAQ,eAAc;AACjE,SAASC,WAAW,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,gBAAe;AACzE,SAASC,KAAK,QAAQ,QAAO;AAG7B,sDAAsD,GACtD,OAAO,MAAMC,mBAAmB,GAAE;AAElC;;;;CAIC,GACD,OAAO,SAASC,eACdC,MAA6D;QAGpDA,qBACAA;IAFT,OACEC,QAAOD,sBAAAA,OAAOE,WAAW,YAAlBF,sBAAsB,IAAIG,IAAI,MACrCF,QAAOD,gBAAAA,OAAOI,KAAK,YAAZJ,gBAAgB,IAAIG,IAAI,MAC/BF,OAAOD,OAAOK,GAAG;AAErB;AAYA;;;;;;;;;;CAUC,GACD,OAAO,SAASC,gBAAgBC,KAA2B;QAWzCC;IAVhB,MAAM,EACJC,KAAK,EACLC,QAAQ,EACRC,MAAM,EACNC,QAAQ,OAAO,EACfC,OAAO,OAAO,EACdC,QAAQ,EACRC,YAAY,IAAI,EACjB,GAAGR;IACJ,MAAMC,WAAWhB,cAAcmB,OAAOK,OAAO,EAAEP;IAC/C,MAAMQ,WAAUT,gBAAAA,4BAAAA,SAAUU,GAAG,oBAAIT,iBAAjBD,OAA0BV;IAC1C,MAAMqB,QAAQC,QAAQZ;IACtB;;;;;;;GAOC,GACD,MAAMa,UAAUxB;IAChB,qBACE,MAACJ;QAAYoB,MAAMA;QAAME,WAAWA;QAAWD,UAAUA;;0BACvD,KAACpB;gBAAW4B,IAAID;0BAAUT;;0BAC1B,MAAChB;gBACCyB,SAASA;gBACTT,OAAOA;gBACPH,OAAOQ;gBACPP,UAAU,CAACa,QAAUb,SAAST,OAAOsB,MAAMC,MAAM,CAACf,KAAK;;kCAEvD,KAACd;wBAASc,OAAOX;kCACf,cAAA,KAAC2B;sCAAI;;;oBAENR,WAAW,CAACE,sBACX,KAACxB;wBAASc,OAAOQ;kCAAUN,OAAOe,QAAQ,CAACT;yBACzC;oBACHN,OAAOK,OAAO,CAACW,GAAG,CAAC,CAACC,uBACnB,KAACjC;4BAA0Bc,OAAOmB,OAAOV,GAAG;sCACzCU,OAAOhB,KAAK;2BADAgB,OAAOV,GAAG;;;;;AAOnC;AACAZ,gBAAgBJ,WAAW,GAAG;AAE9B,eAAeI,gBAAe"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { AglynOrgBilling, CrmLeadFields } from '@aglyn/aglyn';
|
|
2
|
+
import type { RowActionsMenuItem } from '@aglyn/shared-ui-jsx/components/row-actions-menu.component';
|
|
3
|
+
import { type FirestoreDocStatus } from '@aglyn/tenant-feature-instance';
|
|
4
|
+
import type { OrgMemberOptions } from '../hooks/use-org-member-options';
|
|
5
|
+
/**
|
|
6
|
+
* Why Convert is refused while an erasure waits on the person — the same
|
|
7
|
+
* sentence shape the overflow's items carry, so the two read as one state.
|
|
8
|
+
*/
|
|
9
|
+
export declare const CONVERT_PENDING_ERASURE_REASON = "An erasure is pending for this person";
|
|
10
|
+
export interface LeadPropertiesCardProps {
|
|
11
|
+
hostId: string;
|
|
12
|
+
leadId: string;
|
|
13
|
+
lead: Record<string, unknown> & CrmLeadFields;
|
|
14
|
+
leadStatus: FirestoreDocStatus;
|
|
15
|
+
/** The listener has not confirmed this document with the server yet. */
|
|
16
|
+
fromCache: boolean;
|
|
17
|
+
basePath: string;
|
|
18
|
+
roster: OrgMemberOptions;
|
|
19
|
+
onConvert: () => void;
|
|
20
|
+
onUnqualify: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Items the page adds to the overflow beside Unqualify — the privacy
|
|
23
|
+
* erasure (AGL-2623) lives on the page, because it needs the workspace
|
|
24
|
+
* role and the API, and this card owns the header it must appear in.
|
|
25
|
+
*/
|
|
26
|
+
extraMenuItems?: RowActionsMenuItem[];
|
|
27
|
+
/** What the page shows above the facts — the erasure-pending state. */
|
|
28
|
+
banner?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* An erasure request is waiting on this person (AGL-2623). Convert stays
|
|
31
|
+
* on the page but is refused with the reason, the way the overflow's items
|
|
32
|
+
* are: a conversion filed now would reach the capture door only to be
|
|
33
|
+
* refused there, and the lead itself goes when the request runs.
|
|
34
|
+
*/
|
|
35
|
+
erasurePending?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The org the shell passed: the booking door reads whether the lead's site
|
|
38
|
+
* runs Bookings and whether the plan is entitled to it (AGL-2660), and a
|
|
39
|
+
* logged call reads the activity scope it belongs in (AGL-2661).
|
|
40
|
+
*/
|
|
41
|
+
org?: Partial<AglynOrgBilling> | null;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* What the team knows and decides about a lead: status, owner, notes, and
|
|
45
|
+
* the identity and consent the capture recorded (AGL-2608).
|
|
46
|
+
*
|
|
47
|
+
* Status and owner are single-field client writes — the rules let a site
|
|
48
|
+
* admin, editor or author update `hosts/{hostId}/leads`, and a one-field
|
|
49
|
+
* `update` cannot roll anything else back. Notes are a text field seeded
|
|
50
|
+
* from the document, so that save goes through `writeGuardedBySeed`: a draft
|
|
51
|
+
* edited over a cached read would otherwise overwrite a newer note with an
|
|
52
|
+
* older one plus a sentence.
|
|
53
|
+
*
|
|
54
|
+
* Converted leads are read-only here. Their status is the conversion, and
|
|
55
|
+
* the actions become links to what the conversion made.
|
|
56
|
+
*/
|
|
57
|
+
export declare function LeadPropertiesCard(props: LeadPropertiesCardProps): import("react").JSX.Element;
|
|
58
|
+
export declare namespace LeadPropertiesCard {
|
|
59
|
+
var displayName: string;
|
|
60
|
+
}
|
|
61
|
+
export default LeadPropertiesCard;
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { _ as _extends } from "@swc/helpers/_/_extends";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
import * as Aglyn from "@aglyn/aglyn";
|
|
20
|
+
import { mdiAccountCancelOutline } from "@aglyn/shared-data-mdi";
|
|
21
|
+
import { AppLink, MdiIcon } from "@aglyn/shared-ui-jsx";
|
|
22
|
+
import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
23
|
+
import { useFirestore, writeGuardedBySeed } from "@aglyn/tenant-feature-instance";
|
|
24
|
+
import { Alert, Button, FormControl, InputLabel, MenuItem, Select, Stack, TextField, Tooltip, Typography } from "@mui/material";
|
|
25
|
+
import { deleteField, doc, serverTimestamp, updateDoc } from "firebase/firestore";
|
|
26
|
+
import { useEffect, useId, useState } from "react";
|
|
27
|
+
import { crmRoutes } from "../model/crm-routes.js";
|
|
28
|
+
import { CrmCallButton, CrmPhoneLink } from "./crm-call-actions.js";
|
|
29
|
+
import { CrmRecordChip, CrmRecordHeader } from "./crm-record-header.js";
|
|
30
|
+
import { CrmSendEmailButton } from "./crm-send-email-button.js";
|
|
31
|
+
import { LeadOwnerSelect } from "./lead-owner-select.js";
|
|
32
|
+
import { LeadStatusChip } from "./lead-status-chip.js";
|
|
33
|
+
const NOTES_MAX = 4000;
|
|
34
|
+
/**
|
|
35
|
+
* Why Convert is refused while an erasure waits on the person — the same
|
|
36
|
+
* sentence shape the overflow's items carry, so the two read as one state.
|
|
37
|
+
*/ export const CONVERT_PENDING_ERASURE_REASON = 'An erasure is pending for this person';
|
|
38
|
+
/** A label over a value — the record page's one row shape. */ function Fact(props) {
|
|
39
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
40
|
+
spacing: 0.25,
|
|
41
|
+
children: [
|
|
42
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
43
|
+
variant: "caption",
|
|
44
|
+
color: "text.secondary",
|
|
45
|
+
children: props.label
|
|
46
|
+
}),
|
|
47
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
48
|
+
variant: "body2",
|
|
49
|
+
component: "div",
|
|
50
|
+
children: props.children
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* What the team knows and decides about a lead: status, owner, notes, and
|
|
57
|
+
* the identity and consent the capture recorded (AGL-2608).
|
|
58
|
+
*
|
|
59
|
+
* Status and owner are single-field client writes — the rules let a site
|
|
60
|
+
* admin, editor or author update `hosts/{hostId}/leads`, and a one-field
|
|
61
|
+
* `update` cannot roll anything else back. Notes are a text field seeded
|
|
62
|
+
* from the document, so that save goes through `writeGuardedBySeed`: a draft
|
|
63
|
+
* edited over a cached read would otherwise overwrite a newer note with an
|
|
64
|
+
* older one plus a sentence.
|
|
65
|
+
*
|
|
66
|
+
* Converted leads are read-only here. Their status is the conversion, and
|
|
67
|
+
* the actions become links to what the conversion made.
|
|
68
|
+
*/ export function LeadPropertiesCard(props) {
|
|
69
|
+
var _lead_phone, _lead_notes, _lead_email, _lead_email1, _lead_name;
|
|
70
|
+
const { hostId, leadId, lead, leadStatus, fromCache, basePath, roster, onConvert, onUnqualify, extraMenuItems = [], banner, erasurePending = false, org } = props;
|
|
71
|
+
const firestore = useFirestore();
|
|
72
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
73
|
+
const routes = crmRoutes(basePath);
|
|
74
|
+
const ref = doc(firestore, 'hosts', hostId, 'leads', leadId);
|
|
75
|
+
const status = Aglyn.crmLeadStatus(lead);
|
|
76
|
+
const converted = Boolean(lead.convertedContactId);
|
|
77
|
+
const open = Aglyn.isCrmLeadOpen(lead) && !converted;
|
|
78
|
+
/** What a capture that took a number left on the document (AGL-2661). */ const leadPhone = String((_lead_phone = lead['phone']) != null ? _lead_phone : '').trim();
|
|
79
|
+
const [notes, setNotes] = useState(String((_lead_notes = lead.notes) != null ? _lead_notes : ''));
|
|
80
|
+
// The label's id, so the status combobox is named "Status" rather than
|
|
81
|
+
// after the status it shows — see `LeadOwnerSelect`.
|
|
82
|
+
const statusLabelId = useId();
|
|
83
|
+
const [notesDirty, setNotesDirty] = useState(false);
|
|
84
|
+
const [savingNotes, setSavingNotes] = useState(false);
|
|
85
|
+
// A newer note from the server replaces an UNEDITED draft; an edited one is
|
|
86
|
+
// the reader's, and the guard on save decides whether it may land.
|
|
87
|
+
useEffect(()=>{
|
|
88
|
+
var _lead_notes;
|
|
89
|
+
if (!notesDirty) setNotes(String((_lead_notes = lead.notes) != null ? _lead_notes : ''));
|
|
90
|
+
}, [
|
|
91
|
+
lead.notes,
|
|
92
|
+
notesDirty
|
|
93
|
+
]);
|
|
94
|
+
const write = async (fields, done)=>{
|
|
95
|
+
try {
|
|
96
|
+
await updateDoc(ref, _extends({}, fields, {
|
|
97
|
+
updatedAt: serverTimestamp()
|
|
98
|
+
}));
|
|
99
|
+
enqueueSnackbar(done, {
|
|
100
|
+
variant: 'success',
|
|
101
|
+
persist: false
|
|
102
|
+
});
|
|
103
|
+
} catch (error) {
|
|
104
|
+
enqueueSnackbar(error instanceof Error ? error.message : 'The lead could not be updated.', {
|
|
105
|
+
variant: 'error'
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
const saveNotes = async ()=>{
|
|
110
|
+
setSavingNotes(true);
|
|
111
|
+
const verdict = await writeGuardedBySeed({
|
|
112
|
+
subject: 'lead',
|
|
113
|
+
fromCache,
|
|
114
|
+
unreadable: leadStatus === 'error'
|
|
115
|
+
}, ()=>write({
|
|
116
|
+
notes: notes.trim().slice(0, NOTES_MAX)
|
|
117
|
+
}, 'Notes saved'));
|
|
118
|
+
setSavingNotes(false);
|
|
119
|
+
if (!verdict.ok) {
|
|
120
|
+
var _verdict_message;
|
|
121
|
+
enqueueSnackbar((_verdict_message = verdict.message) != null ? _verdict_message : 'The notes could not be saved.', {
|
|
122
|
+
variant: 'warning'
|
|
123
|
+
});
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
setNotesDirty(false);
|
|
127
|
+
};
|
|
128
|
+
const consent = Aglyn.readMarketingBasis(lead, Aglyn.soloConsentGroup(hostId));
|
|
129
|
+
const consentLine = consent.basis === 'granted' ? `Opted in to marketing${consent.basisAtMs ? ` on ${new Date(consent.basisAtMs).toLocaleDateString()}` : ''}` : consent.basis === 'declined' ? 'Declined marketing' : 'No marketing consent recorded — this lead cannot be emailed marketing';
|
|
130
|
+
return /*#__PURE__*/ _jsx(CrmRecordHeader, {
|
|
131
|
+
kind: "Lead",
|
|
132
|
+
title: String(lead['name'] || lead['email'] || leadId),
|
|
133
|
+
// The name is the heading; the address is the one line under it,
|
|
134
|
+
// unless the address IS the name, in which case there is no second fact.
|
|
135
|
+
subtitle: lead['name'] ? String((_lead_email = lead['email']) != null ? _lead_email : '') : undefined,
|
|
136
|
+
help: Aglyn.pluginDocsHelp('crmLeads', {
|
|
137
|
+
anchor: '#working-a-lead-from-the-row'
|
|
138
|
+
}),
|
|
139
|
+
backHref: routes.section('leads'),
|
|
140
|
+
backLabel: "Back to leads",
|
|
141
|
+
// The booking door (AGL-2660), while the lead is still the record
|
|
142
|
+
// being worked: once converted, the contact is where a meeting is
|
|
143
|
+
// booked from, and the links below lead there.
|
|
144
|
+
booking: converted ? undefined : {
|
|
145
|
+
hostId,
|
|
146
|
+
org,
|
|
147
|
+
kind: 'lead',
|
|
148
|
+
recordId: leadId
|
|
149
|
+
},
|
|
150
|
+
actions: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
151
|
+
children: [
|
|
152
|
+
converted ? null : erasurePending ? /*#__PURE__*/ _jsx(Tooltip, {
|
|
153
|
+
title: CONVERT_PENDING_ERASURE_REASON,
|
|
154
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
155
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
156
|
+
size: "small",
|
|
157
|
+
variant: "contained",
|
|
158
|
+
disabled: true,
|
|
159
|
+
children: 'Convert'
|
|
160
|
+
})
|
|
161
|
+
})
|
|
162
|
+
}) : /*#__PURE__*/ _jsx(Button, {
|
|
163
|
+
size: "small",
|
|
164
|
+
variant: "contained",
|
|
165
|
+
onClick: onConvert,
|
|
166
|
+
children: 'Convert'
|
|
167
|
+
}),
|
|
168
|
+
/*#__PURE__*/ _jsx(CrmCallButton, {
|
|
169
|
+
hostId: hostId,
|
|
170
|
+
org: org,
|
|
171
|
+
link: {
|
|
172
|
+
leadId
|
|
173
|
+
},
|
|
174
|
+
phone: leadPhone
|
|
175
|
+
}),
|
|
176
|
+
/*#__PURE__*/ _jsx(CrmSendEmailButton, {
|
|
177
|
+
hostId: hostId,
|
|
178
|
+
leadId: leadId,
|
|
179
|
+
email: String((_lead_email1 = lead['email']) != null ? _lead_email1 : ''),
|
|
180
|
+
name: String((_lead_name = lead['name']) != null ? _lead_name : '')
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
}),
|
|
184
|
+
menuItems: [
|
|
185
|
+
...open ? [
|
|
186
|
+
{
|
|
187
|
+
key: 'unqualify',
|
|
188
|
+
label: 'Unqualify',
|
|
189
|
+
icon: /*#__PURE__*/ _jsx(MdiIcon, {
|
|
190
|
+
path: mdiAccountCancelOutline.path,
|
|
191
|
+
size: 0.8
|
|
192
|
+
}),
|
|
193
|
+
destructive: true,
|
|
194
|
+
onClick: onUnqualify
|
|
195
|
+
}
|
|
196
|
+
] : [],
|
|
197
|
+
...extraMenuItems
|
|
198
|
+
],
|
|
199
|
+
chips: /*#__PURE__*/ _jsxs(_Fragment, {
|
|
200
|
+
children: [
|
|
201
|
+
/*#__PURE__*/ _jsx(LeadStatusChip, {
|
|
202
|
+
lead: lead
|
|
203
|
+
}),
|
|
204
|
+
/*#__PURE__*/ _jsx(CrmRecordChip, {
|
|
205
|
+
label: "Owner",
|
|
206
|
+
value: lead.ownerUid ? roster.labelFor(lead.ownerUid) : undefined
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
}),
|
|
210
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
211
|
+
spacing: 3,
|
|
212
|
+
children: [
|
|
213
|
+
banner,
|
|
214
|
+
leadPhone ? /*#__PURE__*/ _jsx(Fact, {
|
|
215
|
+
label: "Phone",
|
|
216
|
+
children: /*#__PURE__*/ _jsx(CrmPhoneLink, {
|
|
217
|
+
phone: leadPhone
|
|
218
|
+
})
|
|
219
|
+
}) : null,
|
|
220
|
+
/*#__PURE__*/ _jsx(Fact, {
|
|
221
|
+
label: "Marketing consent",
|
|
222
|
+
children: consentLine
|
|
223
|
+
}),
|
|
224
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
225
|
+
direction: {
|
|
226
|
+
xs: 'column',
|
|
227
|
+
md: 'row'
|
|
228
|
+
},
|
|
229
|
+
spacing: 2,
|
|
230
|
+
children: [
|
|
231
|
+
converted ? /*#__PURE__*/ _jsx(Fact, {
|
|
232
|
+
label: "Status",
|
|
233
|
+
children: /*#__PURE__*/ _jsxs(Stack, {
|
|
234
|
+
direction: "row",
|
|
235
|
+
spacing: 1,
|
|
236
|
+
sx: {
|
|
237
|
+
alignItems: 'center'
|
|
238
|
+
},
|
|
239
|
+
children: [
|
|
240
|
+
/*#__PURE__*/ _jsx(LeadStatusChip, {
|
|
241
|
+
lead: lead
|
|
242
|
+
}),
|
|
243
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
244
|
+
variant: "body2",
|
|
245
|
+
color: "text.secondary",
|
|
246
|
+
children: lead.convertedAtMs ? `Converted ${new Date(lead.convertedAtMs).toLocaleString()}` : 'Converted'
|
|
247
|
+
})
|
|
248
|
+
]
|
|
249
|
+
})
|
|
250
|
+
}) : /*#__PURE__*/ _jsxs(FormControl, {
|
|
251
|
+
size: "small",
|
|
252
|
+
sx: {
|
|
253
|
+
minWidth: 200
|
|
254
|
+
},
|
|
255
|
+
children: [
|
|
256
|
+
/*#__PURE__*/ _jsx(InputLabel, {
|
|
257
|
+
id: statusLabelId,
|
|
258
|
+
children: 'Status'
|
|
259
|
+
}),
|
|
260
|
+
/*#__PURE__*/ _jsxs(Select, {
|
|
261
|
+
labelId: statusLabelId,
|
|
262
|
+
label: "Status",
|
|
263
|
+
value: status === 'unqualified' ? 'unqualified' : status,
|
|
264
|
+
onChange: (event)=>{
|
|
265
|
+
const next = String(event.target.value);
|
|
266
|
+
if (next === 'unqualified') {
|
|
267
|
+
onUnqualify();
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
// Reopening drops the reason with the closed state: a lead
|
|
271
|
+
// being worked again is not "unqualified because …".
|
|
272
|
+
void write(_extends({
|
|
273
|
+
status: next
|
|
274
|
+
}, status === 'unqualified' ? {
|
|
275
|
+
unqualifiedReason: deleteField()
|
|
276
|
+
} : {}), 'Status updated');
|
|
277
|
+
},
|
|
278
|
+
children: [
|
|
279
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
280
|
+
value: "new",
|
|
281
|
+
children: Aglyn.CRM_LEAD_STATUS_LABELS.new
|
|
282
|
+
}),
|
|
283
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
284
|
+
value: "working",
|
|
285
|
+
children: Aglyn.CRM_LEAD_STATUS_LABELS.working
|
|
286
|
+
}),
|
|
287
|
+
/*#__PURE__*/ _jsx(MenuItem, {
|
|
288
|
+
value: "unqualified",
|
|
289
|
+
children: `${Aglyn.CRM_LEAD_STATUS_LABELS.unqualified}…`
|
|
290
|
+
})
|
|
291
|
+
]
|
|
292
|
+
})
|
|
293
|
+
]
|
|
294
|
+
}),
|
|
295
|
+
/*#__PURE__*/ _jsx(LeadOwnerSelect, {
|
|
296
|
+
value: lead.ownerUid,
|
|
297
|
+
roster: roster,
|
|
298
|
+
fullWidth: false,
|
|
299
|
+
onChange: (uid)=>void write({
|
|
300
|
+
ownerUid: uid || deleteField()
|
|
301
|
+
}, uid ? 'Owner assigned' : 'Owner cleared')
|
|
302
|
+
})
|
|
303
|
+
]
|
|
304
|
+
}),
|
|
305
|
+
status === 'unqualified' && lead.unqualifiedReason ? /*#__PURE__*/ _jsx(Alert, {
|
|
306
|
+
severity: "info",
|
|
307
|
+
children: `Unqualified: ${lead.unqualifiedReason}`
|
|
308
|
+
}) : null,
|
|
309
|
+
converted ? /*#__PURE__*/ _jsxs(Stack, {
|
|
310
|
+
direction: "row",
|
|
311
|
+
spacing: 1,
|
|
312
|
+
sx: {
|
|
313
|
+
flexWrap: 'wrap',
|
|
314
|
+
rowGap: 1
|
|
315
|
+
},
|
|
316
|
+
children: [
|
|
317
|
+
/*#__PURE__*/ _jsx(Button, _extends({
|
|
318
|
+
component: AppLink
|
|
319
|
+
}, {
|
|
320
|
+
componentVariant: 'naked',
|
|
321
|
+
nativeButton: false
|
|
322
|
+
}, {
|
|
323
|
+
href: routes.contact(String(lead.convertedContactId)),
|
|
324
|
+
size: "small",
|
|
325
|
+
variant: "outlined",
|
|
326
|
+
children: 'Open contact'
|
|
327
|
+
})),
|
|
328
|
+
lead.companyId ? /*#__PURE__*/ _jsx(Button, _extends({
|
|
329
|
+
component: AppLink
|
|
330
|
+
}, {
|
|
331
|
+
componentVariant: 'naked',
|
|
332
|
+
nativeButton: false
|
|
333
|
+
}, {
|
|
334
|
+
href: routes.company(lead.companyId),
|
|
335
|
+
size: "small",
|
|
336
|
+
variant: "outlined",
|
|
337
|
+
children: 'Open company'
|
|
338
|
+
})) : null,
|
|
339
|
+
lead.dealId ? /*#__PURE__*/ _jsx(Button, _extends({
|
|
340
|
+
component: AppLink
|
|
341
|
+
}, {
|
|
342
|
+
componentVariant: 'naked',
|
|
343
|
+
nativeButton: false
|
|
344
|
+
}, {
|
|
345
|
+
href: routes.deal(lead.dealId),
|
|
346
|
+
size: "small",
|
|
347
|
+
variant: "outlined",
|
|
348
|
+
children: 'Open deal'
|
|
349
|
+
})) : null
|
|
350
|
+
]
|
|
351
|
+
}) : null,
|
|
352
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
353
|
+
spacing: 1,
|
|
354
|
+
children: [
|
|
355
|
+
/*#__PURE__*/ _jsx(TextField, {
|
|
356
|
+
size: "small",
|
|
357
|
+
label: "Notes",
|
|
358
|
+
value: notes,
|
|
359
|
+
onChange: (event)=>{
|
|
360
|
+
setNotes(event.target.value);
|
|
361
|
+
setNotesDirty(true);
|
|
362
|
+
},
|
|
363
|
+
multiline: true,
|
|
364
|
+
minRows: 3,
|
|
365
|
+
fullWidth: true,
|
|
366
|
+
slotProps: {
|
|
367
|
+
htmlInput: {
|
|
368
|
+
maxLength: NOTES_MAX
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}),
|
|
372
|
+
/*#__PURE__*/ _jsx(Stack, {
|
|
373
|
+
direction: "row",
|
|
374
|
+
spacing: 1,
|
|
375
|
+
sx: {
|
|
376
|
+
justifyContent: 'flex-end'
|
|
377
|
+
},
|
|
378
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
379
|
+
size: "small",
|
|
380
|
+
variant: "contained",
|
|
381
|
+
onClick: ()=>void saveNotes(),
|
|
382
|
+
disabled: !notesDirty || savingNotes,
|
|
383
|
+
children: 'Save notes'
|
|
384
|
+
})
|
|
385
|
+
})
|
|
386
|
+
]
|
|
387
|
+
})
|
|
388
|
+
]
|
|
389
|
+
})
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
LeadPropertiesCard.displayName = 'LeadPropertiesCard';
|
|
393
|
+
export default LeadPropertiesCard;
|
|
394
|
+
|
|
395
|
+
//# sourceMappingURL=lead-properties-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/crm/src/lib/components/lead-properties-card.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport * as Aglyn from '@aglyn/aglyn'\nimport type { AglynOrgBilling, CrmLeadFields, CrmLeadStatus } from '@aglyn/aglyn'\nimport { mdiAccountCancelOutline } from '@aglyn/shared-data-mdi'\nimport { AppLink, MdiIcon } from '@aglyn/shared-ui-jsx'\nimport type { RowActionsMenuItem } from '@aglyn/shared-ui-jsx/components/row-actions-menu.component'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n type FirestoreDocStatus,\n useFirestore,\n writeGuardedBySeed,\n} from '@aglyn/tenant-feature-instance'\nimport {\n Alert,\n Button,\n FormControl,\n InputLabel,\n MenuItem,\n Select,\n Stack,\n TextField,\n Tooltip,\n Typography,\n} from '@mui/material'\nimport { deleteField, doc, serverTimestamp, updateDoc } from 'firebase/firestore'\nimport { useEffect, useId, useState } from 'react'\nimport { crmRoutes } from '../model/crm-routes'\nimport { CrmCallButton, CrmPhoneLink } from './crm-call-actions'\nimport { CrmRecordChip, CrmRecordHeader } from './crm-record-header'\nimport { CrmSendEmailButton } from './crm-send-email-button'\nimport type { OrgMemberOptions } from '../hooks/use-org-member-options'\nimport { LeadOwnerSelect } from './lead-owner-select'\nimport { LeadStatusChip } from './lead-status-chip'\n\nconst NOTES_MAX = 4000\n\n/**\n * Why Convert is refused while an erasure waits on the person — the same\n * sentence shape the overflow's items carry, so the two read as one state.\n */\nexport const CONVERT_PENDING_ERASURE_REASON = 'An erasure is pending for this person'\n\n/** A label over a value — the record page's one row shape. */\nfunction Fact(props: { label: string; children: React.ReactNode }) {\n return (\n <Stack spacing={0.25}>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {props.label}\n </Typography>\n <Typography variant=\"body2\" component=\"div\">\n {props.children}\n </Typography>\n </Stack>\n )\n}\n\nexport interface LeadPropertiesCardProps {\n hostId: string\n leadId: string\n lead: Record<string, unknown> & CrmLeadFields\n leadStatus: FirestoreDocStatus\n /** The listener has not confirmed this document with the server yet. */\n fromCache: boolean\n basePath: string\n roster: OrgMemberOptions\n onConvert: () => void\n onUnqualify: () => void\n /**\n * Items the page adds to the overflow beside Unqualify — the privacy\n * erasure (AGL-2623) lives on the page, because it needs the workspace\n * role and the API, and this card owns the header it must appear in.\n */\n extraMenuItems?: RowActionsMenuItem[]\n /** What the page shows above the facts — the erasure-pending state. */\n banner?: React.ReactNode\n /**\n * An erasure request is waiting on this person (AGL-2623). Convert stays\n * on the page but is refused with the reason, the way the overflow's items\n * are: a conversion filed now would reach the capture door only to be\n * refused there, and the lead itself goes when the request runs.\n */\n erasurePending?: boolean\n /**\n * The org the shell passed: the booking door reads whether the lead's site\n * runs Bookings and whether the plan is entitled to it (AGL-2660), and a\n * logged call reads the activity scope it belongs in (AGL-2661).\n */\n org?: Partial<AglynOrgBilling> | null\n}\n\n/**\n * What the team knows and decides about a lead: status, owner, notes, and\n * the identity and consent the capture recorded (AGL-2608).\n *\n * Status and owner are single-field client writes — the rules let a site\n * admin, editor or author update `hosts/{hostId}/leads`, and a one-field\n * `update` cannot roll anything else back. Notes are a text field seeded\n * from the document, so that save goes through `writeGuardedBySeed`: a draft\n * edited over a cached read would otherwise overwrite a newer note with an\n * older one plus a sentence.\n *\n * Converted leads are read-only here. Their status is the conversion, and\n * the actions become links to what the conversion made.\n */\nexport function LeadPropertiesCard(props: LeadPropertiesCardProps) {\n const {\n hostId,\n leadId,\n lead,\n leadStatus,\n fromCache,\n basePath,\n roster,\n onConvert,\n onUnqualify,\n extraMenuItems = [],\n banner,\n erasurePending = false,\n org,\n } = props\n const firestore = useFirestore()\n const { enqueueSnackbar } = useSnackbar()\n const routes = crmRoutes(basePath)\n const ref = doc(firestore, 'hosts', hostId, 'leads', leadId)\n const status = Aglyn.crmLeadStatus(lead)\n const converted = Boolean(lead.convertedContactId)\n const open = Aglyn.isCrmLeadOpen(lead) && !converted\n /** What a capture that took a number left on the document (AGL-2661). */\n const leadPhone = String(lead['phone'] ?? '').trim()\n\n const [notes, setNotes] = useState(String(lead.notes ?? ''))\n // The label's id, so the status combobox is named \"Status\" rather than\n // after the status it shows — see `LeadOwnerSelect`.\n const statusLabelId = useId()\n const [notesDirty, setNotesDirty] = useState(false)\n const [savingNotes, setSavingNotes] = useState(false)\n // A newer note from the server replaces an UNEDITED draft; an edited one is\n // the reader's, and the guard on save decides whether it may land.\n useEffect(() => {\n if (!notesDirty) setNotes(String(lead.notes ?? ''))\n }, [lead.notes, notesDirty])\n\n const write = async (fields: Record<string, unknown>, done: string) => {\n try {\n await updateDoc(ref, { ...fields, updatedAt: serverTimestamp() })\n enqueueSnackbar(done, { variant: 'success', persist: false })\n } catch (error) {\n enqueueSnackbar(\n error instanceof Error ? error.message : 'The lead could not be updated.',\n { variant: 'error' },\n )\n }\n }\n\n const saveNotes = async () => {\n setSavingNotes(true)\n const verdict = await writeGuardedBySeed(\n { subject: 'lead', fromCache, unreadable: leadStatus === 'error' },\n () => write({ notes: notes.trim().slice(0, NOTES_MAX) }, 'Notes saved'),\n )\n setSavingNotes(false)\n if (!verdict.ok) {\n enqueueSnackbar(verdict.message ?? 'The notes could not be saved.', {\n variant: 'warning',\n })\n return\n }\n setNotesDirty(false)\n }\n\n const consent = Aglyn.readMarketingBasis(lead, Aglyn.soloConsentGroup(hostId))\n const consentLine =\n consent.basis === 'granted'\n ? `Opted in to marketing${\n consent.basisAtMs ? ` on ${new Date(consent.basisAtMs).toLocaleDateString()}` : ''\n }`\n : consent.basis === 'declined'\n ? 'Declined marketing'\n : 'No marketing consent recorded — this lead cannot be emailed marketing'\n\n return (\n <CrmRecordHeader\n kind=\"Lead\"\n title={String(lead['name'] || lead['email'] || leadId)}\n // The name is the heading; the address is the one line under it,\n // unless the address IS the name, in which case there is no second fact.\n subtitle={lead['name'] ? String(lead['email'] ?? '') : undefined}\n help={Aglyn.pluginDocsHelp('crmLeads', { anchor: '#working-a-lead-from-the-row' })}\n backHref={routes.section('leads')}\n backLabel=\"Back to leads\"\n // The booking door (AGL-2660), while the lead is still the record\n // being worked: once converted, the contact is where a meeting is\n // booked from, and the links below lead there.\n booking={converted ? undefined : { hostId, org, kind: 'lead', recordId: leadId }}\n actions={\n <>\n {converted ? null : erasurePending ? (\n <Tooltip title={CONVERT_PENDING_ERASURE_REASON}>\n {/* A disabled button receives no pointer events, so the\n tooltip anchors on the span around it. */}\n <span>\n <Button size=\"small\" variant=\"contained\" disabled>\n {'Convert'}\n </Button>\n </span>\n </Tooltip>\n ) : (\n <Button size=\"small\" variant=\"contained\" onClick={onConvert}>\n {'Convert'}\n </Button>\n )}\n {/* Dial the number the capture carried, and log the call (AGL-2661). */}\n <CrmCallButton\n hostId={hostId}\n org={org}\n link={{ leadId }}\n phone={leadPhone}\n />\n <CrmSendEmailButton\n hostId={hostId}\n leadId={leadId}\n email={String(lead['email'] ?? '')}\n name={String(lead['name'] ?? '')}\n />\n </>\n }\n menuItems={[\n ...(open\n ? [\n {\n key: 'unqualify',\n label: 'Unqualify',\n icon: <MdiIcon path={mdiAccountCancelOutline.path} size={0.8} />,\n destructive: true,\n onClick: onUnqualify,\n } satisfies RowActionsMenuItem,\n ]\n : []),\n ...extraMenuItems,\n ]}\n chips={\n <>\n <LeadStatusChip lead={lead} />\n <CrmRecordChip\n label=\"Owner\"\n value={lead.ownerUid ? roster.labelFor(lead.ownerUid) : undefined}\n />\n </>\n }\n >\n <Stack spacing={3}>\n {banner}\n {/*\n Only when the capture carried one (AGL-2661): the sign-up and\n booking doors write no phone, so a row for every lead would be a\n permanent blank. A form that captures one fills this.\n */}\n {leadPhone ? (\n <Fact label=\"Phone\">\n <CrmPhoneLink phone={leadPhone} />\n </Fact>\n ) : null}\n <Fact label=\"Marketing consent\">{consentLine}</Fact>\n <Stack direction={{ xs: 'column', md: 'row' }} spacing={2}>\n {converted ? (\n <Fact label=\"Status\">\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <LeadStatusChip lead={lead} />\n <Typography variant=\"body2\" color=\"text.secondary\">\n {lead.convertedAtMs\n ? `Converted ${new Date(lead.convertedAtMs).toLocaleString()}`\n : 'Converted'}\n </Typography>\n </Stack>\n </Fact>\n ) : (\n <FormControl size=\"small\" sx={{ minWidth: 200 }}>\n <InputLabel id={statusLabelId}>{'Status'}</InputLabel>\n <Select\n labelId={statusLabelId}\n label=\"Status\"\n value={status === 'unqualified' ? 'unqualified' : status}\n onChange={(event) => {\n const next = String(event.target.value) as CrmLeadStatus\n if (next === 'unqualified') {\n onUnqualify()\n return\n }\n // Reopening drops the reason with the closed state: a lead\n // being worked again is not \"unqualified because …\".\n void write(\n {\n status: next,\n ...(status === 'unqualified' ? { unqualifiedReason: deleteField() } : {}),\n },\n 'Status updated',\n )\n }}\n >\n <MenuItem value=\"new\">{Aglyn.CRM_LEAD_STATUS_LABELS.new}</MenuItem>\n <MenuItem value=\"working\">{Aglyn.CRM_LEAD_STATUS_LABELS.working}</MenuItem>\n <MenuItem value=\"unqualified\">\n {`${Aglyn.CRM_LEAD_STATUS_LABELS.unqualified}…`}\n </MenuItem>\n </Select>\n </FormControl>\n )}\n <LeadOwnerSelect\n value={lead.ownerUid}\n roster={roster}\n fullWidth={false}\n onChange={(uid) =>\n void write({ ownerUid: uid || deleteField() }, uid ? 'Owner assigned' : 'Owner cleared')\n }\n />\n </Stack>\n {status === 'unqualified' && lead.unqualifiedReason ? (\n <Alert severity=\"info\">{`Unqualified: ${lead.unqualifiedReason}`}</Alert>\n ) : null}\n {converted ? (\n <Stack direction=\"row\" spacing={1} sx={{ flexWrap: 'wrap', rowGap: 1 }}>\n <Button\n component={AppLink as any}\n {...({ componentVariant: 'naked', nativeButton: false } as any)}\n href={routes.contact(String(lead.convertedContactId))}\n size=\"small\"\n variant=\"outlined\"\n >\n {'Open contact'}\n </Button>\n {lead.companyId ? (\n <Button\n component={AppLink as any}\n {...({ componentVariant: 'naked', nativeButton: false } as any)}\n href={routes.company(lead.companyId)}\n size=\"small\"\n variant=\"outlined\"\n >\n {'Open company'}\n </Button>\n ) : null}\n {lead.dealId ? (\n <Button\n component={AppLink as any}\n {...({ componentVariant: 'naked', nativeButton: false } as any)}\n href={routes.deal(lead.dealId)}\n size=\"small\"\n variant=\"outlined\"\n >\n {'Open deal'}\n </Button>\n ) : null}\n </Stack>\n ) : null}\n <Stack spacing={1}>\n <TextField\n size=\"small\"\n label=\"Notes\"\n value={notes}\n onChange={(event) => {\n setNotes(event.target.value)\n setNotesDirty(true)\n }}\n multiline\n minRows={3}\n fullWidth\n slotProps={{ htmlInput: { maxLength: NOTES_MAX } }}\n />\n <Stack direction=\"row\" spacing={1} sx={{ justifyContent: 'flex-end' }}>\n <Button\n size=\"small\"\n variant=\"contained\"\n onClick={() => void saveNotes()}\n disabled={!notesDirty || savingNotes}\n >\n {'Save notes'}\n </Button>\n </Stack>\n </Stack>\n </Stack>\n </CrmRecordHeader>\n )\n}\nLeadPropertiesCard.displayName = 'LeadPropertiesCard'\n\nexport default LeadPropertiesCard\n"],"names":["Aglyn","mdiAccountCancelOutline","AppLink","MdiIcon","useSnackbar","useFirestore","writeGuardedBySeed","Alert","Button","FormControl","InputLabel","MenuItem","Select","Stack","TextField","Tooltip","Typography","deleteField","doc","serverTimestamp","updateDoc","useEffect","useId","useState","crmRoutes","CrmCallButton","CrmPhoneLink","CrmRecordChip","CrmRecordHeader","CrmSendEmailButton","LeadOwnerSelect","LeadStatusChip","NOTES_MAX","CONVERT_PENDING_ERASURE_REASON","Fact","props","spacing","variant","color","label","component","children","LeadPropertiesCard","lead","hostId","leadId","leadStatus","fromCache","basePath","roster","onConvert","onUnqualify","extraMenuItems","banner","erasurePending","org","firestore","enqueueSnackbar","routes","ref","status","crmLeadStatus","converted","Boolean","convertedContactId","open","isCrmLeadOpen","leadPhone","String","trim","notes","setNotes","statusLabelId","notesDirty","setNotesDirty","savingNotes","setSavingNotes","write","fields","done","updatedAt","persist","error","Error","message","saveNotes","verdict","subject","unreadable","slice","ok","consent","readMarketingBasis","soloConsentGroup","consentLine","basis","basisAtMs","Date","toLocaleDateString","kind","title","subtitle","undefined","help","pluginDocsHelp","anchor","backHref","section","backLabel","booking","recordId","actions","span","size","disabled","onClick","link","phone","email","name","menuItems","key","icon","path","destructive","chips","value","ownerUid","labelFor","direction","xs","md","sx","alignItems","convertedAtMs","toLocaleString","minWidth","id","labelId","onChange","event","next","target","unqualifiedReason","CRM_LEAD_STATUS_LABELS","new","working","unqualified","fullWidth","uid","severity","flexWrap","rowGap","componentVariant","nativeButton","href","contact","companyId","company","dealId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1
|
+
import { type CrmLeadFields } from '@aglyn/aglyn';
|
|
2
|
+
import { type ChipProps } from '@mui/material';
|
|
3
|
+
export interface LeadStatusChipProps {
|
|
4
|
+
lead: Pick<CrmLeadFields, 'status'> | null | undefined;
|
|
5
|
+
size?: ChipProps['size'];
|
|
6
|
+
}
|
|
7
|
+
/** A lead's status as a chip (AGL-2608). An absent status reads as New. */
|
|
8
|
+
export declare function LeadStatusChip(props: LeadStatusChipProps): import("react").JSX.Element;
|
|
9
|
+
export declare namespace LeadStatusChip {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export default LeadStatusChip;
|