@trismegisto/angular 3.3.2 → 3.3.4
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/fesm2022/trismegisto-angular-access-control.mjs +823 -0
- package/fesm2022/trismegisto-angular-access-control.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-account-avatar.mjs +54 -3
- package/fesm2022/trismegisto-angular-account-avatar.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-account-closure.mjs +221 -0
- package/fesm2022/trismegisto-angular-account-closure.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-account-forms.mjs +924 -0
- package/fesm2022/trismegisto-angular-account-forms.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-account-switcher.mjs +202 -0
- package/fesm2022/trismegisto-angular-account-switcher.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-address.mjs +631 -0
- package/fesm2022/trismegisto-angular-address.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-alert-history.mjs +294 -0
- package/fesm2022/trismegisto-angular-alert-history.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-alert-rule-editor.mjs +450 -0
- package/fesm2022/trismegisto-angular-alert-rule-editor.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-anchor-nav.mjs +157 -0
- package/fesm2022/trismegisto-angular-anchor-nav.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-announcer.mjs +79 -0
- package/fesm2022/trismegisto-angular-announcer.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-api-exchange.mjs +202 -0
- package/fesm2022/trismegisto-angular-api-exchange.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-appointment-details.mjs +254 -0
- package/fesm2022/trismegisto-angular-appointment-details.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-approval.mjs +242 -0
- package/fesm2022/trismegisto-angular-approval.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-assignee.mjs +271 -0
- package/fesm2022/trismegisto-angular-assignee.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-attachment.mjs +1 -1
- package/fesm2022/trismegisto-angular-attachment.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-availability-editor.mjs +187 -0
- package/fesm2022/trismegisto-angular-availability-editor.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-avatar-group.mjs +1 -1
- package/fesm2022/trismegisto-angular-avatar-group.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-backlog.mjs +244 -0
- package/fesm2022/trismegisto-angular-backlog.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-billing.mjs +1007 -0
- package/fesm2022/trismegisto-angular-billing.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-bottom-navigation.mjs +203 -0
- package/fesm2022/trismegisto-angular-bottom-navigation.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-bottom-sheet.mjs +428 -0
- package/fesm2022/trismegisto-angular-bottom-sheet.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-card-container.mjs +1 -1
- package/fesm2022/trismegisto-angular-card-container.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-cart.mjs +677 -0
- package/fesm2022/trismegisto-angular-cart.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-cascader.mjs +419 -0
- package/fesm2022/trismegisto-angular-cascader.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-change-history.mjs +148 -0
- package/fesm2022/trismegisto-angular-change-history.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-code-diff.mjs +2 -2
- package/fesm2022/trismegisto-angular-code-diff.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-color-picker.mjs +145 -0
- package/fesm2022/trismegisto-angular-color-picker.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-combobox-multi.mjs +6 -4
- package/fesm2022/trismegisto-angular-combobox-multi.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-commerce-format.mjs +103 -0
- package/fesm2022/trismegisto-angular-commerce-format.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-connection-wizard.mjs +159 -0
- package/fesm2022/trismegisto-angular-connection-wizard.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-consent.mjs +382 -0
- package/fesm2022/trismegisto-angular-consent.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-credentials-form.mjs +461 -0
- package/fesm2022/trismegisto-angular-credentials-form.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-data-grid.mjs +690 -18
- package/fesm2022/trismegisto-angular-data-grid.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-data-source-picker.mjs +115 -0
- package/fesm2022/trismegisto-angular-data-source-picker.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-date-picker.mjs +99 -10
- package/fesm2022/trismegisto-angular-date-picker.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-datetime-picker.mjs +183 -0
- package/fesm2022/trismegisto-angular-datetime-picker.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-deadline.mjs +326 -0
- package/fesm2022/trismegisto-angular-deadline.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-deploy-pipeline.mjs +259 -0
- package/fesm2022/trismegisto-angular-deploy-pipeline.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-drawer.mjs +11 -5
- package/fesm2022/trismegisto-angular-drawer.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-endpoint-card.mjs +143 -0
- package/fesm2022/trismegisto-angular-endpoint-card.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-entity-picker.mjs +246 -0
- package/fesm2022/trismegisto-angular-entity-picker.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-environment-picker.mjs +217 -0
- package/fesm2022/trismegisto-angular-environment-picker.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-event-calendar.mjs +234 -11
- package/fesm2022/trismegisto-angular-event-calendar.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-execution-status.mjs +211 -0
- package/fesm2022/trismegisto-angular-execution-status.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-feature-flags.mjs +153 -0
- package/fesm2022/trismegisto-angular-feature-flags.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-field-mapping.mjs +178 -0
- package/fesm2022/trismegisto-angular-field-mapping.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-file-list.mjs +222 -0
- package/fesm2022/trismegisto-angular-file-list.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-file-permissions.mjs +273 -0
- package/fesm2022/trismegisto-angular-file-permissions.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-file-upload.mjs +1 -1
- package/fesm2022/trismegisto-angular-file-upload.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-file-versions.mjs +139 -0
- package/fesm2022/trismegisto-angular-file-versions.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-filter-bar.mjs +1 -1
- package/fesm2022/trismegisto-angular-filter-bar.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-finance.mjs +912 -0
- package/fesm2022/trismegisto-angular-finance.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-form-error-summary.mjs +195 -0
- package/fesm2022/trismegisto-angular-form-error-summary.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-forms.mjs +21 -3
- package/fesm2022/trismegisto-angular-forms.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-gantt.mjs +453 -0
- package/fesm2022/trismegisto-angular-gantt.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-header.mjs +22 -5
- package/fesm2022/trismegisto-angular-header.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-health-status.mjs +204 -0
- package/fesm2022/trismegisto-angular-health-status.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-icon.mjs +96 -1
- package/fesm2022/trismegisto-angular-icon.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-identity-document.mjs +274 -0
- package/fesm2022/trismegisto-angular-identity-document.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-image-gallery.mjs +320 -0
- package/fesm2022/trismegisto-angular-image-gallery.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-incident.mjs +735 -0
- package/fesm2022/trismegisto-angular-incident.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-input.mjs +2 -1
- package/fesm2022/trismegisto-angular-input.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-integration-text.mjs +82 -0
- package/fesm2022/trismegisto-angular-integration-text.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-integration.mjs +423 -0
- package/fesm2022/trismegisto-angular-integration.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-invoice.mjs +381 -0
- package/fesm2022/trismegisto-angular-invoice.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-json-viewer.mjs +388 -0
- package/fesm2022/trismegisto-angular-json-viewer.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-kanban.mjs +49 -9
- package/fesm2022/trismegisto-angular-kanban.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-level-badge.mjs +192 -0
- package/fesm2022/trismegisto-angular-level-badge.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-location-select.mjs +213 -0
- package/fesm2022/trismegisto-angular-location-select.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-log-viewer.mjs +260 -0
- package/fesm2022/trismegisto-angular-log-viewer.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-maintenance-window.mjs +286 -0
- package/fesm2022/trismegisto-angular-maintenance-window.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-member-list.mjs +303 -0
- package/fesm2022/trismegisto-angular-member-list.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-mention-text.mjs +44 -0
- package/fesm2022/trismegisto-angular-mention-text.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-menu.mjs +10 -4
- package/fesm2022/trismegisto-angular-menu.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-message.mjs +132 -7
- package/fesm2022/trismegisto-angular-message.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-metric-explorer.mjs +367 -0
- package/fesm2022/trismegisto-angular-metric-explorer.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-modal.mjs +14 -5
- package/fesm2022/trismegisto-angular-modal.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-monitoring-text.mjs +121 -0
- package/fesm2022/trismegisto-angular-monitoring-text.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-month-picker.mjs +232 -0
- package/fesm2022/trismegisto-angular-month-picker.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-navigation-menu.mjs +68 -9
- package/fesm2022/trismegisto-angular-navigation-menu.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-number-field.mjs +275 -0
- package/fesm2022/trismegisto-angular-number-field.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-observability-text.mjs +244 -0
- package/fesm2022/trismegisto-angular-observability-text.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-order.mjs +443 -0
- package/fesm2022/trismegisto-angular-order.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-org-chart.mjs +678 -0
- package/fesm2022/trismegisto-angular-org-chart.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-password-strength.mjs +204 -0
- package/fesm2022/trismegisto-angular-password-strength.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-payment-fields.mjs +818 -0
- package/fesm2022/trismegisto-angular-payment-fields.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-payment-form.mjs +405 -0
- package/fesm2022/trismegisto-angular-payment-form.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-payment-method.mjs +331 -0
- package/fesm2022/trismegisto-angular-payment-method.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-pdf-viewer.mjs +113 -0
- package/fesm2022/trismegisto-angular-pdf-viewer.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-permission-matrix.mjs +266 -0
- package/fesm2022/trismegisto-angular-permission-matrix.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-pipes.mjs +171 -2
- package/fesm2022/trismegisto-angular-pipes.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-popconfirm.mjs +239 -0
- package/fesm2022/trismegisto-angular-popconfirm.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-popover.mjs +6 -2
- package/fesm2022/trismegisto-angular-popover.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-price.mjs +276 -0
- package/fesm2022/trismegisto-angular-price.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-product.mjs +800 -0
- package/fesm2022/trismegisto-angular-product.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-progress.mjs +119 -4
- package/fesm2022/trismegisto-angular-progress.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-rating.mjs +166 -0
- package/fesm2022/trismegisto-angular-rating.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-reason-dialog.mjs +137 -0
- package/fesm2022/trismegisto-angular-reason-dialog.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-recurrence-editor.mjs +429 -0
- package/fesm2022/trismegisto-angular-recurrence-editor.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-release-timeline.mjs +175 -0
- package/fesm2022/trismegisto-angular-release-timeline.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-report-history.mjs +251 -0
- package/fesm2022/trismegisto-angular-report-history.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-report-schedule.mjs +240 -0
- package/fesm2022/trismegisto-angular-report-schedule.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-resource-calendar.mjs +172 -0
- package/fesm2022/trismegisto-angular-resource-calendar.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-resource-usage.mjs +208 -0
- package/fesm2022/trismegisto-angular-resource-usage.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-return-request.mjs +316 -0
- package/fesm2022/trismegisto-angular-return-request.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-rich-text.mjs +1 -1
- package/fesm2022/trismegisto-angular-rich-text.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-risk-register.mjs +342 -0
- package/fesm2022/trismegisto-angular-risk-register.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-save-status.mjs +166 -0
- package/fesm2022/trismegisto-angular-save-status.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-service-map.mjs +471 -0
- package/fesm2022/trismegisto-angular-service-map.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-service-status.mjs +278 -0
- package/fesm2022/trismegisto-angular-service-status.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-shipping.mjs +410 -0
- package/fesm2022/trismegisto-angular-shipping.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-sidebar.mjs +3 -0
- package/fesm2022/trismegisto-angular-sidebar.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-skip-link.mjs +74 -0
- package/fesm2022/trismegisto-angular-skip-link.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-sla-summary.mjs +349 -0
- package/fesm2022/trismegisto-angular-sla-summary.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-slot-picker.mjs +229 -0
- package/fesm2022/trismegisto-angular-slot-picker.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-split-button.mjs +190 -0
- package/fesm2022/trismegisto-angular-split-button.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-status-badge.mjs +80 -0
- package/fesm2022/trismegisto-angular-status-badge.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-status-select.mjs +156 -0
- package/fesm2022/trismegisto-angular-status-select.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-storage-usage.mjs +136 -0
- package/fesm2022/trismegisto-angular-storage-usage.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-swimlane-board.mjs +237 -0
- package/fesm2022/trismegisto-angular-swimlane-board.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-sync-status.mjs +269 -0
- package/fesm2022/trismegisto-angular-sync-status.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-tag-input.mjs +345 -0
- package/fesm2022/trismegisto-angular-tag-input.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-task-card.mjs +315 -0
- package/fesm2022/trismegisto-angular-task-card.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-task-detail.mjs +737 -0
- package/fesm2022/trismegisto-angular-task-detail.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-textarea.mjs +129 -8
- package/fesm2022/trismegisto-angular-textarea.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-time-range.mjs +201 -0
- package/fesm2022/trismegisto-angular-time-range.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-toast.mjs +135 -34
- package/fesm2022/trismegisto-angular-toast.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-tour.mjs +385 -0
- package/fesm2022/trismegisto-angular-tour.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-trace-waterfall.mjs +511 -0
- package/fesm2022/trismegisto-angular-trace-waterfall.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-transaction.mjs +616 -0
- package/fesm2022/trismegisto-angular-transaction.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-tree-select.mjs +444 -0
- package/fesm2022/trismegisto-angular-tree-select.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-tree.mjs +1 -1
- package/fesm2022/trismegisto-angular-tree.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-unsaved-changes.mjs +147 -0
- package/fesm2022/trismegisto-angular-unsaved-changes.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-uptime-bar.mjs +271 -0
- package/fesm2022/trismegisto-angular-uptime-bar.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-user-card.mjs +298 -0
- package/fesm2022/trismegisto-angular-user-card.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-vehicle-plate.mjs +245 -0
- package/fesm2022/trismegisto-angular-vehicle-plate.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-webhook.mjs +358 -0
- package/fesm2022/trismegisto-angular-webhook.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-wizard.mjs +2 -2
- package/fesm2022/trismegisto-angular-wizard.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-workflow-diagram.mjs +441 -0
- package/fesm2022/trismegisto-angular-workflow-diagram.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-workflow-i18n.mjs +890 -0
- package/fesm2022/trismegisto-angular-workflow-i18n.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-workload.mjs +172 -0
- package/fesm2022/trismegisto-angular-workload.mjs.map +1 -0
- package/fesm2022/trismegisto-angular-workspace-persistence.mjs +3 -2
- package/fesm2022/trismegisto-angular-workspace-persistence.mjs.map +1 -1
- package/fesm2022/trismegisto-angular-workspace.mjs +229 -44
- package/fesm2022/trismegisto-angular-workspace.mjs.map +1 -1
- package/fesm2022/trismegisto-angular.mjs +117 -7
- package/fesm2022/trismegisto-angular.mjs.map +1 -1
- package/package.json +449 -5
- package/types/trismegisto-angular-access-control.d.ts +330 -0
- package/types/trismegisto-angular-access-control.d.ts.map +1 -0
- package/types/trismegisto-angular-account-avatar.d.ts +18 -1
- package/types/trismegisto-angular-account-avatar.d.ts.map +1 -1
- package/types/trismegisto-angular-account-closure.d.ts +85 -0
- package/types/trismegisto-angular-account-closure.d.ts.map +1 -0
- package/types/trismegisto-angular-account-forms.d.ts +381 -0
- package/types/trismegisto-angular-account-forms.d.ts.map +1 -0
- package/types/trismegisto-angular-account-switcher.d.ts +60 -0
- package/types/trismegisto-angular-account-switcher.d.ts.map +1 -0
- package/types/trismegisto-angular-address.d.ts +267 -0
- package/types/trismegisto-angular-address.d.ts.map +1 -0
- package/types/trismegisto-angular-alert-history.d.ts +77 -0
- package/types/trismegisto-angular-alert-history.d.ts.map +1 -0
- package/types/trismegisto-angular-alert-rule-editor.d.ts +123 -0
- package/types/trismegisto-angular-alert-rule-editor.d.ts.map +1 -0
- package/types/trismegisto-angular-anchor-nav.d.ts +78 -0
- package/types/trismegisto-angular-anchor-nav.d.ts.map +1 -0
- package/types/trismegisto-angular-announcer.d.ts +49 -0
- package/types/trismegisto-angular-announcer.d.ts.map +1 -0
- package/types/trismegisto-angular-api-exchange.d.ts +155 -0
- package/types/trismegisto-angular-api-exchange.d.ts.map +1 -0
- package/types/trismegisto-angular-appointment-details.d.ts +123 -0
- package/types/trismegisto-angular-appointment-details.d.ts.map +1 -0
- package/types/trismegisto-angular-approval.d.ts +109 -0
- package/types/trismegisto-angular-approval.d.ts.map +1 -0
- package/types/trismegisto-angular-assignee.d.ts +120 -0
- package/types/trismegisto-angular-assignee.d.ts.map +1 -0
- package/types/trismegisto-angular-availability-editor.d.ts +100 -0
- package/types/trismegisto-angular-availability-editor.d.ts.map +1 -0
- package/types/trismegisto-angular-backlog.d.ts +98 -0
- package/types/trismegisto-angular-backlog.d.ts.map +1 -0
- package/types/trismegisto-angular-billing.d.ts +851 -0
- package/types/trismegisto-angular-billing.d.ts.map +1 -0
- package/types/trismegisto-angular-bottom-navigation.d.ts +83 -0
- package/types/trismegisto-angular-bottom-navigation.d.ts.map +1 -0
- package/types/trismegisto-angular-bottom-sheet.d.ts +121 -0
- package/types/trismegisto-angular-bottom-sheet.d.ts.map +1 -0
- package/types/trismegisto-angular-cart.d.ts +267 -0
- package/types/trismegisto-angular-cart.d.ts.map +1 -0
- package/types/trismegisto-angular-cascader.d.ts +133 -0
- package/types/trismegisto-angular-cascader.d.ts.map +1 -0
- package/types/trismegisto-angular-change-history.d.ts +58 -0
- package/types/trismegisto-angular-change-history.d.ts.map +1 -0
- package/types/trismegisto-angular-color-picker.d.ts +73 -0
- package/types/trismegisto-angular-color-picker.d.ts.map +1 -0
- package/types/trismegisto-angular-combobox-multi.d.ts +3 -1
- package/types/trismegisto-angular-combobox-multi.d.ts.map +1 -1
- package/types/trismegisto-angular-commerce-format.d.ts +43 -0
- package/types/trismegisto-angular-commerce-format.d.ts.map +1 -0
- package/types/trismegisto-angular-connection-wizard.d.ts +110 -0
- package/types/trismegisto-angular-connection-wizard.d.ts.map +1 -0
- package/types/trismegisto-angular-consent.d.ts +142 -0
- package/types/trismegisto-angular-consent.d.ts.map +1 -0
- package/types/trismegisto-angular-credentials-form.d.ts +242 -0
- package/types/trismegisto-angular-credentials-form.d.ts.map +1 -0
- package/types/trismegisto-angular-data-grid.d.ts +382 -48
- package/types/trismegisto-angular-data-grid.d.ts.map +1 -1
- package/types/trismegisto-angular-data-source-picker.d.ts +73 -0
- package/types/trismegisto-angular-data-source-picker.d.ts.map +1 -0
- package/types/trismegisto-angular-date-picker.d.ts +75 -4
- package/types/trismegisto-angular-date-picker.d.ts.map +1 -1
- package/types/trismegisto-angular-datetime-picker.d.ts +89 -0
- package/types/trismegisto-angular-datetime-picker.d.ts.map +1 -0
- package/types/trismegisto-angular-deadline.d.ts +143 -0
- package/types/trismegisto-angular-deadline.d.ts.map +1 -0
- package/types/trismegisto-angular-deploy-pipeline.d.ts +100 -0
- package/types/trismegisto-angular-deploy-pipeline.d.ts.map +1 -0
- package/types/trismegisto-angular-drawer.d.ts +6 -3
- package/types/trismegisto-angular-drawer.d.ts.map +1 -1
- package/types/trismegisto-angular-endpoint-card.d.ts +113 -0
- package/types/trismegisto-angular-endpoint-card.d.ts.map +1 -0
- package/types/trismegisto-angular-entity-picker.d.ts +88 -0
- package/types/trismegisto-angular-entity-picker.d.ts.map +1 -0
- package/types/trismegisto-angular-environment-picker.d.ts +72 -0
- package/types/trismegisto-angular-environment-picker.d.ts.map +1 -0
- package/types/trismegisto-angular-event-calendar.d.ts +52 -6
- package/types/trismegisto-angular-event-calendar.d.ts.map +1 -1
- package/types/trismegisto-angular-execution-status.d.ts +76 -0
- package/types/trismegisto-angular-execution-status.d.ts.map +1 -0
- package/types/trismegisto-angular-feature-flags.d.ts +97 -0
- package/types/trismegisto-angular-feature-flags.d.ts.map +1 -0
- package/types/trismegisto-angular-field-mapping.d.ts +118 -0
- package/types/trismegisto-angular-field-mapping.d.ts.map +1 -0
- package/types/trismegisto-angular-file-list.d.ts +136 -0
- package/types/trismegisto-angular-file-list.d.ts.map +1 -0
- package/types/trismegisto-angular-file-permissions.d.ts +171 -0
- package/types/trismegisto-angular-file-permissions.d.ts.map +1 -0
- package/types/trismegisto-angular-file-versions.d.ts +93 -0
- package/types/trismegisto-angular-file-versions.d.ts.map +1 -0
- package/types/trismegisto-angular-finance.d.ts +623 -0
- package/types/trismegisto-angular-finance.d.ts.map +1 -0
- package/types/trismegisto-angular-form-error-summary.d.ts +98 -0
- package/types/trismegisto-angular-form-error-summary.d.ts.map +1 -0
- package/types/trismegisto-angular-forms.d.ts +14 -1
- package/types/trismegisto-angular-forms.d.ts.map +1 -1
- package/types/trismegisto-angular-gantt.d.ts +128 -0
- package/types/trismegisto-angular-gantt.d.ts.map +1 -0
- package/types/trismegisto-angular-header.d.ts +5 -1
- package/types/trismegisto-angular-header.d.ts.map +1 -1
- package/types/trismegisto-angular-health-status.d.ts +71 -0
- package/types/trismegisto-angular-health-status.d.ts.map +1 -0
- package/types/trismegisto-angular-icon.d.ts +96 -1
- package/types/trismegisto-angular-icon.d.ts.map +1 -1
- package/types/trismegisto-angular-identity-document.d.ts +112 -0
- package/types/trismegisto-angular-identity-document.d.ts.map +1 -0
- package/types/trismegisto-angular-image-gallery.d.ts +129 -0
- package/types/trismegisto-angular-image-gallery.d.ts.map +1 -0
- package/types/trismegisto-angular-incident.d.ts +212 -0
- package/types/trismegisto-angular-incident.d.ts.map +1 -0
- package/types/trismegisto-angular-input.d.ts.map +1 -1
- package/types/trismegisto-angular-integration-text.d.ts +42 -0
- package/types/trismegisto-angular-integration-text.d.ts.map +1 -0
- package/types/trismegisto-angular-integration.d.ts +283 -0
- package/types/trismegisto-angular-integration.d.ts.map +1 -0
- package/types/trismegisto-angular-invoice.d.ts +221 -0
- package/types/trismegisto-angular-invoice.d.ts.map +1 -0
- package/types/trismegisto-angular-json-viewer.d.ts +117 -0
- package/types/trismegisto-angular-json-viewer.d.ts.map +1 -0
- package/types/trismegisto-angular-kanban.d.ts +38 -3
- package/types/trismegisto-angular-kanban.d.ts.map +1 -1
- package/types/trismegisto-angular-level-badge.d.ts +87 -0
- package/types/trismegisto-angular-level-badge.d.ts.map +1 -0
- package/types/trismegisto-angular-location-select.d.ts +80 -0
- package/types/trismegisto-angular-location-select.d.ts.map +1 -0
- package/types/trismegisto-angular-log-viewer.d.ts +125 -0
- package/types/trismegisto-angular-log-viewer.d.ts.map +1 -0
- package/types/trismegisto-angular-maintenance-window.d.ts +89 -0
- package/types/trismegisto-angular-maintenance-window.d.ts.map +1 -0
- package/types/trismegisto-angular-member-list.d.ts +80 -0
- package/types/trismegisto-angular-member-list.d.ts.map +1 -0
- package/types/trismegisto-angular-mention-text.d.ts +28 -0
- package/types/trismegisto-angular-mention-text.d.ts.map +1 -0
- package/types/trismegisto-angular-menu.d.ts +4 -1
- package/types/trismegisto-angular-menu.d.ts.map +1 -1
- package/types/trismegisto-angular-message.d.ts +31 -2
- package/types/trismegisto-angular-message.d.ts.map +1 -1
- package/types/trismegisto-angular-metric-explorer.d.ts +117 -0
- package/types/trismegisto-angular-metric-explorer.d.ts.map +1 -0
- package/types/trismegisto-angular-modal.d.ts +1 -0
- package/types/trismegisto-angular-modal.d.ts.map +1 -1
- package/types/trismegisto-angular-monitoring-text.d.ts +57 -0
- package/types/trismegisto-angular-monitoring-text.d.ts.map +1 -0
- package/types/trismegisto-angular-month-picker.d.ts +104 -0
- package/types/trismegisto-angular-month-picker.d.ts.map +1 -0
- package/types/trismegisto-angular-navigation-menu.d.ts +35 -2
- package/types/trismegisto-angular-navigation-menu.d.ts.map +1 -1
- package/types/trismegisto-angular-number-field.d.ts +148 -0
- package/types/trismegisto-angular-number-field.d.ts.map +1 -0
- package/types/trismegisto-angular-observability-text.d.ts +85 -0
- package/types/trismegisto-angular-observability-text.d.ts.map +1 -0
- package/types/trismegisto-angular-order.d.ts +268 -0
- package/types/trismegisto-angular-order.d.ts.map +1 -0
- package/types/trismegisto-angular-org-chart.d.ts +145 -0
- package/types/trismegisto-angular-org-chart.d.ts.map +1 -0
- package/types/trismegisto-angular-password-strength.d.ts +74 -0
- package/types/trismegisto-angular-password-strength.d.ts.map +1 -0
- package/types/trismegisto-angular-payment-fields.d.ts +450 -0
- package/types/trismegisto-angular-payment-fields.d.ts.map +1 -0
- package/types/trismegisto-angular-payment-form.d.ts +189 -0
- package/types/trismegisto-angular-payment-form.d.ts.map +1 -0
- package/types/trismegisto-angular-payment-method.d.ts +238 -0
- package/types/trismegisto-angular-payment-method.d.ts.map +1 -0
- package/types/trismegisto-angular-pdf-viewer.d.ts +70 -0
- package/types/trismegisto-angular-pdf-viewer.d.ts.map +1 -0
- package/types/trismegisto-angular-permission-matrix.d.ts +70 -0
- package/types/trismegisto-angular-permission-matrix.d.ts.map +1 -0
- package/types/trismegisto-angular-pipes.d.ts +108 -2
- package/types/trismegisto-angular-pipes.d.ts.map +1 -1
- package/types/trismegisto-angular-popconfirm.d.ts +115 -0
- package/types/trismegisto-angular-popconfirm.d.ts.map +1 -0
- package/types/trismegisto-angular-popover.d.ts +3 -1
- package/types/trismegisto-angular-popover.d.ts.map +1 -1
- package/types/trismegisto-angular-price.d.ts +185 -0
- package/types/trismegisto-angular-price.d.ts.map +1 -0
- package/types/trismegisto-angular-product.d.ts +391 -0
- package/types/trismegisto-angular-product.d.ts.map +1 -0
- package/types/trismegisto-angular-progress.d.ts +20 -3
- package/types/trismegisto-angular-progress.d.ts.map +1 -1
- package/types/trismegisto-angular-rating.d.ts +83 -0
- package/types/trismegisto-angular-rating.d.ts.map +1 -0
- package/types/trismegisto-angular-reason-dialog.d.ts +65 -0
- package/types/trismegisto-angular-reason-dialog.d.ts.map +1 -0
- package/types/trismegisto-angular-recurrence-editor.d.ts +151 -0
- package/types/trismegisto-angular-recurrence-editor.d.ts.map +1 -0
- package/types/trismegisto-angular-release-timeline.d.ts +79 -0
- package/types/trismegisto-angular-release-timeline.d.ts.map +1 -0
- package/types/trismegisto-angular-report-history.d.ts +144 -0
- package/types/trismegisto-angular-report-history.d.ts.map +1 -0
- package/types/trismegisto-angular-report-schedule.d.ts +138 -0
- package/types/trismegisto-angular-report-schedule.d.ts.map +1 -0
- package/types/trismegisto-angular-resource-calendar.d.ts +107 -0
- package/types/trismegisto-angular-resource-calendar.d.ts.map +1 -0
- package/types/trismegisto-angular-resource-usage.d.ts +91 -0
- package/types/trismegisto-angular-resource-usage.d.ts.map +1 -0
- package/types/trismegisto-angular-return-request.d.ts +158 -0
- package/types/trismegisto-angular-return-request.d.ts.map +1 -0
- package/types/trismegisto-angular-risk-register.d.ts +130 -0
- package/types/trismegisto-angular-risk-register.d.ts.map +1 -0
- package/types/trismegisto-angular-save-status.d.ts +67 -0
- package/types/trismegisto-angular-save-status.d.ts.map +1 -0
- package/types/trismegisto-angular-service-map.d.ts +111 -0
- package/types/trismegisto-angular-service-map.d.ts.map +1 -0
- package/types/trismegisto-angular-service-status.d.ts +82 -0
- package/types/trismegisto-angular-service-status.d.ts.map +1 -0
- package/types/trismegisto-angular-shipping.d.ts +221 -0
- package/types/trismegisto-angular-shipping.d.ts.map +1 -0
- package/types/trismegisto-angular-sidebar.d.ts +1 -0
- package/types/trismegisto-angular-sidebar.d.ts.map +1 -1
- package/types/trismegisto-angular-skip-link.d.ts +53 -0
- package/types/trismegisto-angular-skip-link.d.ts.map +1 -0
- package/types/trismegisto-angular-sla-summary.d.ts +104 -0
- package/types/trismegisto-angular-sla-summary.d.ts.map +1 -0
- package/types/trismegisto-angular-slot-picker.d.ts +128 -0
- package/types/trismegisto-angular-slot-picker.d.ts.map +1 -0
- package/types/trismegisto-angular-split-button.d.ts +81 -0
- package/types/trismegisto-angular-split-button.d.ts.map +1 -0
- package/types/trismegisto-angular-status-badge.d.ts +40 -0
- package/types/trismegisto-angular-status-badge.d.ts.map +1 -0
- package/types/trismegisto-angular-status-select.d.ts +76 -0
- package/types/trismegisto-angular-status-select.d.ts.map +1 -0
- package/types/trismegisto-angular-storage-usage.d.ts +82 -0
- package/types/trismegisto-angular-storage-usage.d.ts.map +1 -0
- package/types/trismegisto-angular-swimlane-board.d.ts +114 -0
- package/types/trismegisto-angular-swimlane-board.d.ts.map +1 -0
- package/types/trismegisto-angular-sync-status.d.ts +191 -0
- package/types/trismegisto-angular-sync-status.d.ts.map +1 -0
- package/types/trismegisto-angular-tag-input.d.ts +121 -0
- package/types/trismegisto-angular-tag-input.d.ts.map +1 -0
- package/types/trismegisto-angular-task-card.d.ts +106 -0
- package/types/trismegisto-angular-task-card.d.ts.map +1 -0
- package/types/trismegisto-angular-task-detail.d.ts +248 -0
- package/types/trismegisto-angular-task-detail.d.ts.map +1 -0
- package/types/trismegisto-angular-textarea.d.ts +31 -1
- package/types/trismegisto-angular-textarea.d.ts.map +1 -1
- package/types/trismegisto-angular-time-range.d.ts +92 -0
- package/types/trismegisto-angular-time-range.d.ts.map +1 -0
- package/types/trismegisto-angular-toast.d.ts +50 -11
- package/types/trismegisto-angular-toast.d.ts.map +1 -1
- package/types/trismegisto-angular-tour.d.ts +116 -0
- package/types/trismegisto-angular-tour.d.ts.map +1 -0
- package/types/trismegisto-angular-trace-waterfall.d.ts +111 -0
- package/types/trismegisto-angular-trace-waterfall.d.ts.map +1 -0
- package/types/trismegisto-angular-transaction.d.ts +542 -0
- package/types/trismegisto-angular-transaction.d.ts.map +1 -0
- package/types/trismegisto-angular-tree-select.d.ts +197 -0
- package/types/trismegisto-angular-tree-select.d.ts.map +1 -0
- package/types/trismegisto-angular-unsaved-changes.d.ts +101 -0
- package/types/trismegisto-angular-unsaved-changes.d.ts.map +1 -0
- package/types/trismegisto-angular-uptime-bar.d.ts +90 -0
- package/types/trismegisto-angular-uptime-bar.d.ts.map +1 -0
- package/types/trismegisto-angular-user-card.d.ts +126 -0
- package/types/trismegisto-angular-user-card.d.ts.map +1 -0
- package/types/trismegisto-angular-vehicle-plate.d.ts +107 -0
- package/types/trismegisto-angular-vehicle-plate.d.ts.map +1 -0
- package/types/trismegisto-angular-webhook.d.ts +244 -0
- package/types/trismegisto-angular-webhook.d.ts.map +1 -0
- package/types/trismegisto-angular-workflow-diagram.d.ts +136 -0
- package/types/trismegisto-angular-workflow-diagram.d.ts.map +1 -0
- package/types/trismegisto-angular-workflow-i18n.d.ts +358 -0
- package/types/trismegisto-angular-workflow-i18n.d.ts.map +1 -0
- package/types/trismegisto-angular-workload.d.ts +64 -0
- package/types/trismegisto-angular-workload.d.ts.map +1 -0
- package/types/trismegisto-angular-workspace-persistence.d.ts +5 -4
- package/types/trismegisto-angular-workspace-persistence.d.ts.map +1 -1
- package/types/trismegisto-angular-workspace.d.ts +79 -7
- package/types/trismegisto-angular-workspace.d.ts.map +1 -1
- package/types/trismegisto-angular.d.ts +120 -10
- package/types/trismegisto-angular.d.ts.map +1 -1
|
@@ -0,0 +1,800 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, output, computed, ChangeDetectionStrategy, Component, model, signal, effect, untracked } from '@angular/core';
|
|
3
|
+
import { isPurchasable, resolveStockLevel, findVariant, optionValueState, formatMessage, selectOptionValue, clampQuantity, pluralMessage } from '@trismegisto/primitives';
|
|
4
|
+
import { localCatalog, formatLocale } from '@trismegisto/angular/commerce-format';
|
|
5
|
+
import { ButtonComponent } from '@trismegisto/angular/button';
|
|
6
|
+
import { ICON_GRID, ICON_IMAGE, ICON_SHOPPING_CART, useHermesIcons, IconComponent } from '@trismegisto/angular/icon';
|
|
7
|
+
import { PriceComponent, StockStatusComponent } from '@trismegisto/angular/price';
|
|
8
|
+
import { InputComponent } from '@trismegisto/angular/input';
|
|
9
|
+
|
|
10
|
+
const PRODUCT_ICONS = [ICON_GRID, ICON_IMAGE, ICON_SHOPPING_CART];
|
|
11
|
+
|
|
12
|
+
// Textos das peças de `@trismegisto/angular/product` em pt-BR, en e es — fora do HERMES_MESSAGES de propósito
|
|
13
|
+
// (o pt-BR do catálogo geral vai embutido em todo app). O componente escolhe pelo idioma ativo
|
|
14
|
+
// (`HermesI18nService.pick`) e o app sobrescreve qualquer texto pelo input `texts`.
|
|
15
|
+
const PRODUCT_MESSAGES_PT_BR = {
|
|
16
|
+
product: {
|
|
17
|
+
addToCart: 'Adicionar ao carrinho',
|
|
18
|
+
addNamed: 'Adicionar {name} ao carrinho',
|
|
19
|
+
unavailable: 'Indisponível',
|
|
20
|
+
listLabel: 'Produtos',
|
|
21
|
+
empty: 'Nenhum produto encontrado.',
|
|
22
|
+
count: { one: '{count} produto', other: '{count} produtos' },
|
|
23
|
+
loading: 'Carregando produtos',
|
|
24
|
+
gallery: 'Imagens de {name}',
|
|
25
|
+
showImage: 'Mostrar imagem {index} de {total}',
|
|
26
|
+
sku: 'Código: {sku}',
|
|
27
|
+
quantity: 'Quantidade',
|
|
28
|
+
chooseOptions: 'Escolha {options} para continuar.',
|
|
29
|
+
optionsJoin: ' e ',
|
|
30
|
+
},
|
|
31
|
+
variant: {
|
|
32
|
+
unavailable: '{value}, esgotado',
|
|
33
|
+
missing: '{value}, indisponível nesta combinação',
|
|
34
|
+
selected: '{option}: {value}',
|
|
35
|
+
none: 'nenhum',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const PRODUCT_MESSAGES_EN = {
|
|
39
|
+
product: {
|
|
40
|
+
addToCart: 'Add to cart',
|
|
41
|
+
addNamed: 'Add {name} to cart',
|
|
42
|
+
unavailable: 'Unavailable',
|
|
43
|
+
listLabel: 'Products',
|
|
44
|
+
empty: 'No products found.',
|
|
45
|
+
count: { one: '{count} product', other: '{count} products' },
|
|
46
|
+
loading: 'Loading products',
|
|
47
|
+
gallery: 'Images of {name}',
|
|
48
|
+
showImage: 'Show image {index} of {total}',
|
|
49
|
+
sku: 'SKU: {sku}',
|
|
50
|
+
quantity: 'Quantity',
|
|
51
|
+
chooseOptions: 'Choose {options} to continue.',
|
|
52
|
+
optionsJoin: ' and ',
|
|
53
|
+
},
|
|
54
|
+
variant: {
|
|
55
|
+
unavailable: '{value}, sold out',
|
|
56
|
+
missing: '{value}, not available in this combination',
|
|
57
|
+
selected: '{option}: {value}',
|
|
58
|
+
none: 'none',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
const PRODUCT_MESSAGES_ES = {
|
|
62
|
+
product: {
|
|
63
|
+
addToCart: 'Añadir al carrito',
|
|
64
|
+
addNamed: 'Añadir {name} al carrito',
|
|
65
|
+
unavailable: 'No disponible',
|
|
66
|
+
listLabel: 'Productos',
|
|
67
|
+
empty: 'No se encontraron productos.',
|
|
68
|
+
count: { one: '{count} producto', other: '{count} productos' },
|
|
69
|
+
loading: 'Cargando productos',
|
|
70
|
+
gallery: 'Imágenes de {name}',
|
|
71
|
+
showImage: 'Mostrar imagen {index} de {total}',
|
|
72
|
+
sku: 'Código: {sku}',
|
|
73
|
+
quantity: 'Cantidad',
|
|
74
|
+
chooseOptions: 'Elige {options} para continuar.',
|
|
75
|
+
optionsJoin: ' y ',
|
|
76
|
+
},
|
|
77
|
+
variant: {
|
|
78
|
+
unavailable: '{value}, agotado',
|
|
79
|
+
missing: '{value}, no disponible en esta combinación',
|
|
80
|
+
selected: '{option}: {value}',
|
|
81
|
+
none: 'ninguno',
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
const PRODUCT_MESSAGES = { 'pt-BR': PRODUCT_MESSAGES_PT_BR, en: PRODUCT_MESSAGES_EN, es: PRODUCT_MESSAGES_ES };
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Cartão de produto (`hm-product-card`): imagem, selo, marca, nome, preço (com desconto e parcelas),
|
|
88
|
+
* estoque e o botão de adicionar ao carrinho.
|
|
89
|
+
*
|
|
90
|
+
* ```html
|
|
91
|
+
* <hm-product-card [product]="item" currency="BRL" (addToCart)="carrinho.add($event)" />
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* - Com `product.href`, o nome é um link que cobre o cartão inteiro (o botão continua clicável por cima);
|
|
95
|
+
* sem `href`, o nome é um botão que emite `view`. Nunca há um controle dentro de outro.
|
|
96
|
+
* - O botão diz o produto para quem usa leitor de tela ("Adicionar ao carrinho: Camiseta"), porque numa
|
|
97
|
+
* grade todos os botões teriam o mesmo nome. Esgotado, ele fica desabilitado e diz "Indisponível".
|
|
98
|
+
* - `[extra]` recebe conteúdo livre sob o preço (amostras de cor, avaliação).
|
|
99
|
+
*/
|
|
100
|
+
class ProductCardComponent {
|
|
101
|
+
#icons = useHermesIcons(PRODUCT_ICONS);
|
|
102
|
+
product = input.required(...(ngDevMode ? [{ debugName: "product" }] : /* istanbul ignore next */ []));
|
|
103
|
+
/** Código ISO 4217 do preço. */
|
|
104
|
+
currency = input('BRL', ...(ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []));
|
|
105
|
+
layout = input('vertical', ...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
106
|
+
/** Nível do título (o nome do produto) na estrutura da página. */
|
|
107
|
+
headingLevel = input(3, ...(ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []));
|
|
108
|
+
/** Mostra o botão de adicionar ao carrinho. */
|
|
109
|
+
showAction = input(true, { ...(ngDevMode ? { debugName: "showAction" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
110
|
+
/** Texto do botão no lugar de "Adicionar ao carrinho". */
|
|
111
|
+
actionLabel = input('', ...(ngDevMode ? [{ debugName: "actionLabel" }] : /* istanbul ignore next */ []));
|
|
112
|
+
/** O pedido de adicionar está em andamento (botão em espera). */
|
|
113
|
+
adding = input(false, { ...(ngDevMode ? { debugName: "adding" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
114
|
+
/** Pediu para adicionar ao carrinho. */
|
|
115
|
+
addToCart = output();
|
|
116
|
+
/** Clicou no nome (só quando o produto não tem `href`). */
|
|
117
|
+
view = output();
|
|
118
|
+
/** Sobrescreve textos do catálogo da peça (`PRODUCT_MESSAGES_PT_BR`). */
|
|
119
|
+
texts = input(null, ...(ngDevMode ? [{ debugName: "texts" }] : /* istanbul ignore next */ []));
|
|
120
|
+
#text = localCatalog(PRODUCT_MESSAGES, PRODUCT_MESSAGES_PT_BR, () => this.texts());
|
|
121
|
+
text = computed(() => this.#text().product, ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
122
|
+
purchasable = computed(() => {
|
|
123
|
+
const stock = this.product().stock;
|
|
124
|
+
return !stock || isPurchasable(resolveStockLevel(stock));
|
|
125
|
+
}, ...(ngDevMode ? [{ debugName: "purchasable" }] : /* istanbul ignore next */ []));
|
|
126
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: ProductCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
127
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: ProductCardComponent, isStandalone: true, selector: "hm-product-card", inputs: { product: { classPropertyName: "product", publicName: "product", isSignal: true, isRequired: true, transformFunction: null }, currency: { classPropertyName: "currency", publicName: "currency", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null }, showAction: { classPropertyName: "showAction", publicName: "showAction", isSignal: true, isRequired: false, transformFunction: null }, actionLabel: { classPropertyName: "actionLabel", publicName: "actionLabel", isSignal: true, isRequired: false, transformFunction: null }, adding: { classPropertyName: "adding", publicName: "adding", isSignal: true, isRequired: false, transformFunction: null }, texts: { classPropertyName: "texts", publicName: "texts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { addToCart: "addToCart", view: "view" }, host: { properties: { "class.hm-product-card--horizontal": "layout() === 'horizontal'", "class.hm-product-card--unavailable": "!purchasable()" }, classAttribute: "hm-product-card" }, ngImport: i0, template: `
|
|
128
|
+
<div class="hm-product-card__media">
|
|
129
|
+
@if (product().image) {
|
|
130
|
+
<img class="hm-product-card__image" [src]="product().image" [alt]="product().imageAlt ?? ''" loading="lazy" />
|
|
131
|
+
} @else {
|
|
132
|
+
<span class="hm-product-card__placeholder" aria-hidden="true"><hm-icon shape="image" /></span>
|
|
133
|
+
}
|
|
134
|
+
@if (product().badge) {
|
|
135
|
+
<span class="hm-product-card__badge">{{ product().badge }}</span>
|
|
136
|
+
}
|
|
137
|
+
</div>
|
|
138
|
+
<div class="hm-product-card__body">
|
|
139
|
+
@if (product().brand) {
|
|
140
|
+
<span class="hm-product-card__brand">{{ product().brand }}</span>
|
|
141
|
+
}
|
|
142
|
+
<div class="hm-product-card__name" role="heading" [attr.aria-level]="headingLevel()">
|
|
143
|
+
@if (product().href) {
|
|
144
|
+
<a class="hm-product-card__link" [href]="product().href">{{ product().name }}</a>
|
|
145
|
+
} @else {
|
|
146
|
+
<button type="button" class="hm-product-card__link" (click)="view.emit(product())">{{ product().name }}</button>
|
|
147
|
+
}
|
|
148
|
+
</div>
|
|
149
|
+
<hm-price
|
|
150
|
+
class="hm-product-card__price"
|
|
151
|
+
[amount]="product().price"
|
|
152
|
+
[compareAt]="product().compareAt ?? null"
|
|
153
|
+
[currency]="currency()"
|
|
154
|
+
[installments]="product().installments ?? 0"
|
|
155
|
+
[interestFree]="!!product().interestFree"
|
|
156
|
+
/>
|
|
157
|
+
@if (product().stock; as stock) {
|
|
158
|
+
<hm-stock-status
|
|
159
|
+
class="hm-product-card__stock"
|
|
160
|
+
[quantity]="stock.quantity"
|
|
161
|
+
[lowThreshold]="stock.lowThreshold ?? 5"
|
|
162
|
+
[backorder]="!!stock.backorder"
|
|
163
|
+
[preorder]="!!stock.preorder"
|
|
164
|
+
/>
|
|
165
|
+
}
|
|
166
|
+
<div class="hm-product-card__extra"><ng-content select="[extra]" /></div>
|
|
167
|
+
@if (showAction()) {
|
|
168
|
+
<hm-button
|
|
169
|
+
class="hm-product-card__action"
|
|
170
|
+
[emphasis]="layout() === 'horizontal' ? 'medium' : 'high'"
|
|
171
|
+
size="small"
|
|
172
|
+
icon="shopping-cart"
|
|
173
|
+
[block]="layout() === 'vertical'"
|
|
174
|
+
[disabled]="!purchasable()"
|
|
175
|
+
[loading]="adding()"
|
|
176
|
+
(clicked)="addToCart.emit(product())"
|
|
177
|
+
>
|
|
178
|
+
{{ purchasable() ? actionLabel() || text().addToCart : text().unavailable }}<span class="hm-visually-hidden">: {{ product().name }}</span>
|
|
179
|
+
</hm-button>
|
|
180
|
+
}
|
|
181
|
+
</div>
|
|
182
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "loadingState", "block", "link", "newTab", "caret", "inMenu", "toggle", "pressed"], outputs: ["loadingStateChange", "pressedChange", "clicked"] }, { kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: PriceComponent, selector: "hm-price", inputs: ["amount", "compareAt", "currency", "size", "period", "unit", "showDiscount", "showSavings", "installments", "interestFree", "freeLabel", "texts"] }, { kind: "component", type: StockStatusComponent, selector: "hm-stock-status", inputs: ["quantity", "lowThreshold", "backorder", "preorder", "showCount", "texts"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
183
|
+
}
|
|
184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: ProductCardComponent, decorators: [{
|
|
185
|
+
type: Component,
|
|
186
|
+
args: [{
|
|
187
|
+
selector: 'hm-product-card',
|
|
188
|
+
imports: [ButtonComponent, IconComponent, PriceComponent, StockStatusComponent],
|
|
189
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
190
|
+
host: {
|
|
191
|
+
class: 'hm-product-card',
|
|
192
|
+
'[class.hm-product-card--horizontal]': "layout() === 'horizontal'",
|
|
193
|
+
'[class.hm-product-card--unavailable]': '!purchasable()',
|
|
194
|
+
},
|
|
195
|
+
template: `
|
|
196
|
+
<div class="hm-product-card__media">
|
|
197
|
+
@if (product().image) {
|
|
198
|
+
<img class="hm-product-card__image" [src]="product().image" [alt]="product().imageAlt ?? ''" loading="lazy" />
|
|
199
|
+
} @else {
|
|
200
|
+
<span class="hm-product-card__placeholder" aria-hidden="true"><hm-icon shape="image" /></span>
|
|
201
|
+
}
|
|
202
|
+
@if (product().badge) {
|
|
203
|
+
<span class="hm-product-card__badge">{{ product().badge }}</span>
|
|
204
|
+
}
|
|
205
|
+
</div>
|
|
206
|
+
<div class="hm-product-card__body">
|
|
207
|
+
@if (product().brand) {
|
|
208
|
+
<span class="hm-product-card__brand">{{ product().brand }}</span>
|
|
209
|
+
}
|
|
210
|
+
<div class="hm-product-card__name" role="heading" [attr.aria-level]="headingLevel()">
|
|
211
|
+
@if (product().href) {
|
|
212
|
+
<a class="hm-product-card__link" [href]="product().href">{{ product().name }}</a>
|
|
213
|
+
} @else {
|
|
214
|
+
<button type="button" class="hm-product-card__link" (click)="view.emit(product())">{{ product().name }}</button>
|
|
215
|
+
}
|
|
216
|
+
</div>
|
|
217
|
+
<hm-price
|
|
218
|
+
class="hm-product-card__price"
|
|
219
|
+
[amount]="product().price"
|
|
220
|
+
[compareAt]="product().compareAt ?? null"
|
|
221
|
+
[currency]="currency()"
|
|
222
|
+
[installments]="product().installments ?? 0"
|
|
223
|
+
[interestFree]="!!product().interestFree"
|
|
224
|
+
/>
|
|
225
|
+
@if (product().stock; as stock) {
|
|
226
|
+
<hm-stock-status
|
|
227
|
+
class="hm-product-card__stock"
|
|
228
|
+
[quantity]="stock.quantity"
|
|
229
|
+
[lowThreshold]="stock.lowThreshold ?? 5"
|
|
230
|
+
[backorder]="!!stock.backorder"
|
|
231
|
+
[preorder]="!!stock.preorder"
|
|
232
|
+
/>
|
|
233
|
+
}
|
|
234
|
+
<div class="hm-product-card__extra"><ng-content select="[extra]" /></div>
|
|
235
|
+
@if (showAction()) {
|
|
236
|
+
<hm-button
|
|
237
|
+
class="hm-product-card__action"
|
|
238
|
+
[emphasis]="layout() === 'horizontal' ? 'medium' : 'high'"
|
|
239
|
+
size="small"
|
|
240
|
+
icon="shopping-cart"
|
|
241
|
+
[block]="layout() === 'vertical'"
|
|
242
|
+
[disabled]="!purchasable()"
|
|
243
|
+
[loading]="adding()"
|
|
244
|
+
(clicked)="addToCart.emit(product())"
|
|
245
|
+
>
|
|
246
|
+
{{ purchasable() ? actionLabel() || text().addToCart : text().unavailable }}<span class="hm-visually-hidden">: {{ product().name }}</span>
|
|
247
|
+
</hm-button>
|
|
248
|
+
}
|
|
249
|
+
</div>
|
|
250
|
+
`,
|
|
251
|
+
}]
|
|
252
|
+
}], propDecorators: { product: [{ type: i0.Input, args: [{ isSignal: true, alias: "product", required: true }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }], showAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAction", required: false }] }], actionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "actionLabel", required: false }] }], adding: [{ type: i0.Input, args: [{ isSignal: true, alias: "adding", required: false }] }], addToCart: [{ type: i0.Output, args: ["addToCart"] }], view: [{ type: i0.Output, args: ["view"] }], texts: [{ type: i0.Input, args: [{ isSignal: true, alias: "texts", required: false }] }] } });
|
|
253
|
+
|
|
254
|
+
let sequence = 0;
|
|
255
|
+
/**
|
|
256
|
+
* Escolha de variantes de um produto (`hm-variant-picker`): um grupo de opções por eixo (cor, tamanho…),
|
|
257
|
+
* com amostra de cor ou botão de texto, marcando o que está esgotado e o que não existe na combinação.
|
|
258
|
+
*
|
|
259
|
+
* ```html
|
|
260
|
+
* <hm-variant-picker [options]="opcoes" [variants]="variantes" [(selection)]="escolha" (variantChange)="variante.set($event)" />
|
|
261
|
+
* ```
|
|
262
|
+
*
|
|
263
|
+
* - Cada eixo é um `fieldset` com rádios nativos (setas trocam o valor, Tab passa ao próximo eixo); a
|
|
264
|
+
* legenda diz o valor escolhido ("Cor: Azul").
|
|
265
|
+
* - Esgotado continua escolhível (a pessoa vê a variante e o aviso), riscado e com ", esgotado" no nome;
|
|
266
|
+
* uma combinação que não existe fica desabilitada.
|
|
267
|
+
* - `variantChange` emite a variante quando a seleção fica completa, e `null` enquanto falta algum eixo.
|
|
268
|
+
*/
|
|
269
|
+
class VariantPickerComponent {
|
|
270
|
+
#icons = useHermesIcons(PRODUCT_ICONS);
|
|
271
|
+
/** Eixos de escolha, na ordem exibida. */
|
|
272
|
+
options = input.required(...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
273
|
+
/** Todas as variantes que existem (com `available: false` nas esgotadas). */
|
|
274
|
+
variants = input([], ...(ngDevMode ? [{ debugName: "variants" }] : /* istanbul ignore next */ []));
|
|
275
|
+
/** Valor escolhido em cada eixo (`{ cor: 'azul' }`). */
|
|
276
|
+
selection = model({}, ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
277
|
+
/** A variante da seleção completa, ou `null` enquanto falta algum eixo. */
|
|
278
|
+
variantChange = output();
|
|
279
|
+
/** Sobrescreve textos do catálogo da peça (`PRODUCT_MESSAGES_PT_BR`). */
|
|
280
|
+
texts = input(null, ...(ngDevMode ? [{ debugName: "texts" }] : /* istanbul ignore next */ []));
|
|
281
|
+
#text = localCatalog(PRODUCT_MESSAGES, PRODUCT_MESSAGES_PT_BR, () => this.texts());
|
|
282
|
+
#id = `hm-variant-picker-${++sequence}`;
|
|
283
|
+
/** Variante correspondente à seleção atual (null se incompleta). */
|
|
284
|
+
variant = computed(() => findVariant(this.options(), this.variants(), this.selection()), ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
285
|
+
groups = computed(() => {
|
|
286
|
+
const text = this.#text().variant;
|
|
287
|
+
const selection = this.selection();
|
|
288
|
+
const variants = this.variants();
|
|
289
|
+
return this.options().map((option) => {
|
|
290
|
+
const chosen = option.values.find((value) => value.id === selection[option.id]);
|
|
291
|
+
return {
|
|
292
|
+
option,
|
|
293
|
+
name: `${this.#id}-${option.id}`,
|
|
294
|
+
legend: formatMessage(text.selected, { option: option.label, value: chosen?.label ?? text.none }),
|
|
295
|
+
values: option.values.map((value) => {
|
|
296
|
+
const state = variants.length ? optionValueState(variants, selection, option.id, value.id) : 'available';
|
|
297
|
+
const spoken = state === 'unavailable'
|
|
298
|
+
? formatMessage(text.unavailable, { value: value.label })
|
|
299
|
+
: state === 'missing'
|
|
300
|
+
? formatMessage(text.missing, { value: value.label })
|
|
301
|
+
: value.label;
|
|
302
|
+
return { value, state, checked: selection[option.id] === value.id, spoken };
|
|
303
|
+
}),
|
|
304
|
+
};
|
|
305
|
+
});
|
|
306
|
+
}, ...(ngDevMode ? [{ debugName: "groups" }] : /* istanbul ignore next */ []));
|
|
307
|
+
pick(optionId, valueId) {
|
|
308
|
+
this.selection.set(selectOptionValue(this.selection(), optionId, valueId));
|
|
309
|
+
this.variantChange.emit(this.variant());
|
|
310
|
+
}
|
|
311
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: VariantPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
312
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: VariantPickerComponent, isStandalone: true, selector: "hm-variant-picker", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, variants: { classPropertyName: "variants", publicName: "variants", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, texts: { classPropertyName: "texts", publicName: "texts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", variantChange: "variantChange" }, host: { classAttribute: "hm-variant-picker" }, ngImport: i0, template: `
|
|
313
|
+
@for (group of groups(); track group.option.id) {
|
|
314
|
+
<fieldset class="hm-variant-picker__group">
|
|
315
|
+
<legend class="hm-variant-picker__legend">{{ group.legend }}</legend>
|
|
316
|
+
<div class="hm-variant-picker__values">
|
|
317
|
+
@for (item of group.values; track item.value.id) {
|
|
318
|
+
<label
|
|
319
|
+
class="hm-variant-picker__value"
|
|
320
|
+
[class.hm-variant-picker__value--swatch]="!!item.value.swatch"
|
|
321
|
+
[class.hm-variant-picker__value--checked]="item.checked"
|
|
322
|
+
[class.hm-variant-picker__value--unavailable]="item.state === 'unavailable'"
|
|
323
|
+
[class.hm-variant-picker__value--missing]="item.state === 'missing'"
|
|
324
|
+
>
|
|
325
|
+
<input
|
|
326
|
+
type="radio"
|
|
327
|
+
class="hm-variant-picker__control"
|
|
328
|
+
[name]="group.name"
|
|
329
|
+
[value]="item.value.id"
|
|
330
|
+
[checked]="item.checked"
|
|
331
|
+
[disabled]="item.state === 'missing'"
|
|
332
|
+
[attr.aria-label]="item.spoken"
|
|
333
|
+
(change)="pick(group.option.id, item.value.id)"
|
|
334
|
+
/>
|
|
335
|
+
@if (item.value.swatch) {
|
|
336
|
+
<span class="hm-variant-picker__swatch" [style.background]="item.value.swatch" aria-hidden="true"></span>
|
|
337
|
+
} @else {
|
|
338
|
+
<span class="hm-variant-picker__text" aria-hidden="true">{{ item.value.label }}</span>
|
|
339
|
+
}
|
|
340
|
+
</label>
|
|
341
|
+
}
|
|
342
|
+
</div>
|
|
343
|
+
</fieldset>
|
|
344
|
+
}
|
|
345
|
+
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
346
|
+
}
|
|
347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: VariantPickerComponent, decorators: [{
|
|
348
|
+
type: Component,
|
|
349
|
+
args: [{
|
|
350
|
+
selector: 'hm-variant-picker',
|
|
351
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
352
|
+
host: { class: 'hm-variant-picker' },
|
|
353
|
+
template: `
|
|
354
|
+
@for (group of groups(); track group.option.id) {
|
|
355
|
+
<fieldset class="hm-variant-picker__group">
|
|
356
|
+
<legend class="hm-variant-picker__legend">{{ group.legend }}</legend>
|
|
357
|
+
<div class="hm-variant-picker__values">
|
|
358
|
+
@for (item of group.values; track item.value.id) {
|
|
359
|
+
<label
|
|
360
|
+
class="hm-variant-picker__value"
|
|
361
|
+
[class.hm-variant-picker__value--swatch]="!!item.value.swatch"
|
|
362
|
+
[class.hm-variant-picker__value--checked]="item.checked"
|
|
363
|
+
[class.hm-variant-picker__value--unavailable]="item.state === 'unavailable'"
|
|
364
|
+
[class.hm-variant-picker__value--missing]="item.state === 'missing'"
|
|
365
|
+
>
|
|
366
|
+
<input
|
|
367
|
+
type="radio"
|
|
368
|
+
class="hm-variant-picker__control"
|
|
369
|
+
[name]="group.name"
|
|
370
|
+
[value]="item.value.id"
|
|
371
|
+
[checked]="item.checked"
|
|
372
|
+
[disabled]="item.state === 'missing'"
|
|
373
|
+
[attr.aria-label]="item.spoken"
|
|
374
|
+
(change)="pick(group.option.id, item.value.id)"
|
|
375
|
+
/>
|
|
376
|
+
@if (item.value.swatch) {
|
|
377
|
+
<span class="hm-variant-picker__swatch" [style.background]="item.value.swatch" aria-hidden="true"></span>
|
|
378
|
+
} @else {
|
|
379
|
+
<span class="hm-variant-picker__text" aria-hidden="true">{{ item.value.label }}</span>
|
|
380
|
+
}
|
|
381
|
+
</label>
|
|
382
|
+
}
|
|
383
|
+
</div>
|
|
384
|
+
</fieldset>
|
|
385
|
+
}
|
|
386
|
+
`,
|
|
387
|
+
}]
|
|
388
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], variants: [{ type: i0.Input, args: [{ isSignal: true, alias: "variants", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], variantChange: [{ type: i0.Output, args: ["variantChange"] }], texts: [{ type: i0.Input, args: [{ isSignal: true, alias: "texts", required: false }] }] } });
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Detalhe de produto (`hm-product-detail`): galeria com miniaturas, nome, preço, estoque, variantes,
|
|
392
|
+
* quantidade e o botão de adicionar ao carrinho — o miolo de uma página de produto.
|
|
393
|
+
*
|
|
394
|
+
* ```html
|
|
395
|
+
* <hm-product-detail
|
|
396
|
+
* [name]="p.nome" [images]="p.fotos" [price]="p.preco" [options]="p.opcoes" [variants]="p.variantes"
|
|
397
|
+
* [(selection)]="escolha" [(quantity)]="quantidade" (addToCart)="carrinho.add($event)">
|
|
398
|
+
* <div description [innerHTML]="p.descricaoHtml"></div>
|
|
399
|
+
* </hm-product-detail>
|
|
400
|
+
* ```
|
|
401
|
+
*
|
|
402
|
+
* - A variante escolhida pode trazer preço, estoque, código e imagem próprios (`ProductVariant`), que
|
|
403
|
+
* vencem os do produto; trocar de variante leva a galeria para a imagem dela.
|
|
404
|
+
* - Com variantes, o botão só habilita com a seleção completa, e a frase ao lado diz o que falta
|
|
405
|
+
* ("Escolha Tamanho para continuar."). Esgotado, o botão fica desabilitado.
|
|
406
|
+
* - O slot `[description]` recebe a descrição; o padrão (`<ng-content>`) vai depois do botão
|
|
407
|
+
* (frete, garantia, compartilhar).
|
|
408
|
+
*/
|
|
409
|
+
class ProductDetailComponent {
|
|
410
|
+
#icons = useHermesIcons(PRODUCT_ICONS);
|
|
411
|
+
name = input.required(...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
412
|
+
brand = input('', ...(ngDevMode ? [{ debugName: "brand" }] : /* istanbul ignore next */ []));
|
|
413
|
+
images = input([], ...(ngDevMode ? [{ debugName: "images" }] : /* istanbul ignore next */ []));
|
|
414
|
+
price = input.required(...(ngDevMode ? [{ debugName: "price" }] : /* istanbul ignore next */ []));
|
|
415
|
+
compareAt = input(null, ...(ngDevMode ? [{ debugName: "compareAt" }] : /* istanbul ignore next */ []));
|
|
416
|
+
currency = input('BRL', ...(ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []));
|
|
417
|
+
installments = input(0, ...(ngDevMode ? [{ debugName: "installments" }] : /* istanbul ignore next */ []));
|
|
418
|
+
interestFree = input(false, { ...(ngDevMode ? { debugName: "interestFree" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
419
|
+
/** Código do produto (a variante pode trazer o próprio). */
|
|
420
|
+
sku = input('', ...(ngDevMode ? [{ debugName: "sku" }] : /* istanbul ignore next */ []));
|
|
421
|
+
stock = input(null, ...(ngDevMode ? [{ debugName: "stock" }] : /* istanbul ignore next */ []));
|
|
422
|
+
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
423
|
+
variants = input([], ...(ngDevMode ? [{ debugName: "variants" }] : /* istanbul ignore next */ []));
|
|
424
|
+
selection = model({}, ...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
425
|
+
quantity = model(1, ...(ngDevMode ? [{ debugName: "quantity" }] : /* istanbul ignore next */ []));
|
|
426
|
+
/** Teto de unidades por pedido (o estoque da variante também limita). */
|
|
427
|
+
maxQuantity = input(null, ...(ngDevMode ? [{ debugName: "maxQuantity" }] : /* istanbul ignore next */ []));
|
|
428
|
+
headingLevel = input(1, ...(ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []));
|
|
429
|
+
/** O pedido de adicionar está em andamento. */
|
|
430
|
+
adding = input(false, { ...(ngDevMode ? { debugName: "adding" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
431
|
+
addToCart = output();
|
|
432
|
+
/** Sobrescreve textos do catálogo da peça (`PRODUCT_MESSAGES_PT_BR`). */
|
|
433
|
+
texts = input(null, ...(ngDevMode ? [{ debugName: "texts" }] : /* istanbul ignore next */ []));
|
|
434
|
+
#text = localCatalog(PRODUCT_MESSAGES, PRODUCT_MESSAGES_PT_BR, () => this.texts());
|
|
435
|
+
text = computed(() => this.#text().product, ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
436
|
+
imageIndex = signal(0, ...(ngDevMode ? [{ debugName: "imageIndex" }] : /* istanbul ignore next */ []));
|
|
437
|
+
variant = computed(() => (this.options().length ? findVariant(this.options(), this.variants(), this.selection()) : null), ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
438
|
+
effectivePrice = computed(() => this.variant()?.price ?? this.price(), ...(ngDevMode ? [{ debugName: "effectivePrice" }] : /* istanbul ignore next */ []));
|
|
439
|
+
effectiveCompareAt = computed(() => {
|
|
440
|
+
const variant = this.variant();
|
|
441
|
+
return variant && variant.compareAt !== undefined ? variant.compareAt : this.compareAt();
|
|
442
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveCompareAt" }] : /* istanbul ignore next */ []));
|
|
443
|
+
effectiveStock = computed(() => {
|
|
444
|
+
const variant = this.variant();
|
|
445
|
+
if (variant?.stock)
|
|
446
|
+
return variant.stock;
|
|
447
|
+
if (variant && variant.available === false)
|
|
448
|
+
return { quantity: 0 };
|
|
449
|
+
return this.stock();
|
|
450
|
+
}, ...(ngDevMode ? [{ debugName: "effectiveStock" }] : /* istanbul ignore next */ []));
|
|
451
|
+
purchasable = computed(() => {
|
|
452
|
+
const stock = this.effectiveStock();
|
|
453
|
+
return !stock || isPurchasable(resolveStockLevel(stock));
|
|
454
|
+
}, ...(ngDevMode ? [{ debugName: "purchasable" }] : /* istanbul ignore next */ []));
|
|
455
|
+
missing = computed(() => {
|
|
456
|
+
const selection = this.selection();
|
|
457
|
+
return this.options().filter((option) => !selection[option.id]);
|
|
458
|
+
}, ...(ngDevMode ? [{ debugName: "missing" }] : /* istanbul ignore next */ []));
|
|
459
|
+
canBuy = computed(() => this.purchasable() && !this.missing().length && (!this.options().length || !!this.variant()), ...(ngDevMode ? [{ debugName: "canBuy" }] : /* istanbul ignore next */ []));
|
|
460
|
+
missingText = computed(() => {
|
|
461
|
+
const missing = this.missing();
|
|
462
|
+
if (!missing.length)
|
|
463
|
+
return '';
|
|
464
|
+
const text = this.text();
|
|
465
|
+
return formatMessage(text.chooseOptions, { options: missing.map((option) => option.label).join(text.optionsJoin) });
|
|
466
|
+
}, ...(ngDevMode ? [{ debugName: "missingText" }] : /* istanbul ignore next */ []));
|
|
467
|
+
skuText = computed(() => formatMessage(this.text().sku, { sku: this.variant()?.sku || this.sku() }), ...(ngDevMode ? [{ debugName: "skuText" }] : /* istanbul ignore next */ []));
|
|
468
|
+
galleryLabel = computed(() => formatMessage(this.text().gallery, { name: this.name() }), ...(ngDevMode ? [{ debugName: "galleryLabel" }] : /* istanbul ignore next */ []));
|
|
469
|
+
activeImage = computed(() => this.images()[this.imageIndex()] ?? this.images()[0] ?? null, ...(ngDevMode ? [{ debugName: "activeImage" }] : /* istanbul ignore next */ []));
|
|
470
|
+
#quantityCap = computed(() => {
|
|
471
|
+
const caps = [this.maxQuantity(), this.effectiveStock()?.quantity ?? null].filter((cap) => cap !== null && cap > 0);
|
|
472
|
+
return caps.length ? Math.min(...caps) : null;
|
|
473
|
+
}, ...(ngDevMode ? [{ debugName: "#quantityCap" }] : /* istanbul ignore next */ []));
|
|
474
|
+
constructor() {
|
|
475
|
+
// A variante escolhida leva a galeria para a imagem dela.
|
|
476
|
+
effect(() => {
|
|
477
|
+
const index = this.variant()?.imageIndex;
|
|
478
|
+
if (index !== undefined && index >= 0)
|
|
479
|
+
untracked(() => this.imageIndex.set(Math.min(index, Math.max(0, this.images().length - 1))));
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
thumbLabel(index) {
|
|
483
|
+
return formatMessage(this.text().showImage, { index: index + 1, total: this.images().length });
|
|
484
|
+
}
|
|
485
|
+
setQuantity(value) {
|
|
486
|
+
const number = typeof value === 'number' ? value : Number(value);
|
|
487
|
+
if (!Number.isFinite(number))
|
|
488
|
+
return;
|
|
489
|
+
this.quantity.set(clampQuantity(number, 1, this.#quantityCap()));
|
|
490
|
+
}
|
|
491
|
+
requestAdd() {
|
|
492
|
+
if (!this.canBuy())
|
|
493
|
+
return;
|
|
494
|
+
this.addToCart.emit({ variant: this.variant(), selection: this.selection(), quantity: clampQuantity(this.quantity(), 1, this.#quantityCap()) });
|
|
495
|
+
}
|
|
496
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: ProductDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
497
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: ProductDetailComponent, isStandalone: true, selector: "hm-product-detail", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: true, transformFunction: null }, brand: { classPropertyName: "brand", publicName: "brand", isSignal: true, isRequired: false, transformFunction: null }, images: { classPropertyName: "images", publicName: "images", isSignal: true, isRequired: false, transformFunction: null }, price: { classPropertyName: "price", publicName: "price", isSignal: true, isRequired: true, transformFunction: null }, compareAt: { classPropertyName: "compareAt", publicName: "compareAt", isSignal: true, isRequired: false, transformFunction: null }, currency: { classPropertyName: "currency", publicName: "currency", isSignal: true, isRequired: false, transformFunction: null }, installments: { classPropertyName: "installments", publicName: "installments", isSignal: true, isRequired: false, transformFunction: null }, interestFree: { classPropertyName: "interestFree", publicName: "interestFree", isSignal: true, isRequired: false, transformFunction: null }, sku: { classPropertyName: "sku", publicName: "sku", isSignal: true, isRequired: false, transformFunction: null }, stock: { classPropertyName: "stock", publicName: "stock", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, variants: { classPropertyName: "variants", publicName: "variants", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, quantity: { classPropertyName: "quantity", publicName: "quantity", isSignal: true, isRequired: false, transformFunction: null }, maxQuantity: { classPropertyName: "maxQuantity", publicName: "maxQuantity", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null }, adding: { classPropertyName: "adding", publicName: "adding", isSignal: true, isRequired: false, transformFunction: null }, texts: { classPropertyName: "texts", publicName: "texts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selection: "selectionChange", quantity: "quantityChange", addToCart: "addToCart" }, host: { classAttribute: "hm-product-detail" }, ngImport: i0, template: `
|
|
498
|
+
<div class="hm-product-detail__gallery" role="group" [attr.aria-label]="galleryLabel()">
|
|
499
|
+
<div class="hm-product-detail__stage">
|
|
500
|
+
@if (activeImage(); as image) {
|
|
501
|
+
<img class="hm-product-detail__image" [src]="image.src" [alt]="image.alt" />
|
|
502
|
+
} @else {
|
|
503
|
+
<span class="hm-product-detail__placeholder" aria-hidden="true"><hm-icon shape="image" /></span>
|
|
504
|
+
}
|
|
505
|
+
</div>
|
|
506
|
+
@if (images().length > 1) {
|
|
507
|
+
<div class="hm-product-detail__thumbs">
|
|
508
|
+
@for (image of images(); track $index) {
|
|
509
|
+
<button
|
|
510
|
+
type="button"
|
|
511
|
+
class="hm-product-detail__thumb"
|
|
512
|
+
[class.hm-product-detail__thumb--active]="$index === imageIndex()"
|
|
513
|
+
[attr.aria-label]="thumbLabel($index)"
|
|
514
|
+
[attr.aria-pressed]="$index === imageIndex() ? 'true' : 'false'"
|
|
515
|
+
(click)="imageIndex.set($index)"
|
|
516
|
+
>
|
|
517
|
+
<img [src]="image.src" alt="" />
|
|
518
|
+
</button>
|
|
519
|
+
}
|
|
520
|
+
</div>
|
|
521
|
+
}
|
|
522
|
+
</div>
|
|
523
|
+
|
|
524
|
+
<div class="hm-product-detail__info">
|
|
525
|
+
@if (brand()) {
|
|
526
|
+
<span class="hm-product-detail__brand">{{ brand() }}</span>
|
|
527
|
+
}
|
|
528
|
+
<div class="hm-product-detail__name" role="heading" [attr.aria-level]="headingLevel()">{{ name() }}</div>
|
|
529
|
+
@if (sku()) {
|
|
530
|
+
<span class="hm-product-detail__sku">{{ skuText() }}</span>
|
|
531
|
+
}
|
|
532
|
+
<hm-price
|
|
533
|
+
size="large"
|
|
534
|
+
[amount]="effectivePrice()"
|
|
535
|
+
[compareAt]="effectiveCompareAt()"
|
|
536
|
+
[currency]="currency()"
|
|
537
|
+
[installments]="installments()"
|
|
538
|
+
[interestFree]="interestFree()"
|
|
539
|
+
showSavings
|
|
540
|
+
/>
|
|
541
|
+
@if (effectiveStock(); as stock) {
|
|
542
|
+
<hm-stock-status
|
|
543
|
+
[quantity]="stock.quantity"
|
|
544
|
+
[lowThreshold]="stock.lowThreshold ?? 5"
|
|
545
|
+
[backorder]="!!stock.backorder"
|
|
546
|
+
[preorder]="!!stock.preorder"
|
|
547
|
+
/>
|
|
548
|
+
}
|
|
549
|
+
<div class="hm-product-detail__description"><ng-content select="[description]" /></div>
|
|
550
|
+
@if (options().length) {
|
|
551
|
+
<hm-variant-picker [options]="options()" [variants]="variants()" [(selection)]="selection" />
|
|
552
|
+
}
|
|
553
|
+
<div class="hm-product-detail__buy">
|
|
554
|
+
<hm-input
|
|
555
|
+
class="hm-product-detail__quantity"
|
|
556
|
+
type="number"
|
|
557
|
+
[label]="text().quantity"
|
|
558
|
+
[value]="quantity()"
|
|
559
|
+
[min]="1"
|
|
560
|
+
[max]="maxQuantity()"
|
|
561
|
+
[step]="1"
|
|
562
|
+
(valueChange)="setQuantity($event)"
|
|
563
|
+
/>
|
|
564
|
+
<hm-button
|
|
565
|
+
class="hm-product-detail__add"
|
|
566
|
+
icon="shopping-cart"
|
|
567
|
+
[disabled]="!canBuy()"
|
|
568
|
+
[loading]="adding()"
|
|
569
|
+
(clicked)="requestAdd()"
|
|
570
|
+
>{{ purchasable() ? text().addToCart : text().unavailable }}</hm-button>
|
|
571
|
+
</div>
|
|
572
|
+
@if (missingText()) {
|
|
573
|
+
<p class="hm-product-detail__hint">{{ missingText() }}</p>
|
|
574
|
+
}
|
|
575
|
+
<ng-content />
|
|
576
|
+
</div>
|
|
577
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "hm-button", inputs: ["emphasis", "intent", "size", "type", "icon", "iconDirection", "iconEnd", "disabled", "loading", "loadingState", "block", "link", "newTab", "caret", "inMenu", "toggle", "pressed"], outputs: ["loadingStateChange", "pressedChange", "clicked"] }, { kind: "component", type: IconComponent, selector: "hm-icon", inputs: ["shape", "direction", "size", "solid", "badge", "status", "flip", "inverse", "label"] }, { kind: "component", type: InputComponent, selector: "hm-input", inputs: ["value", "label", "type", "placeholder", "icon", "labelHidden", "hint", "prefix", "suffix", "prefixIcon", "mask", "maskValue", "min", "max", "step", "stepButtons", "maxLength", "autocomplete", "inputMode"], outputs: ["valueChange"] }, { kind: "component", type: PriceComponent, selector: "hm-price", inputs: ["amount", "compareAt", "currency", "size", "period", "unit", "showDiscount", "showSavings", "installments", "interestFree", "freeLabel", "texts"] }, { kind: "component", type: StockStatusComponent, selector: "hm-stock-status", inputs: ["quantity", "lowThreshold", "backorder", "preorder", "showCount", "texts"] }, { kind: "component", type: VariantPickerComponent, selector: "hm-variant-picker", inputs: ["options", "variants", "selection", "texts"], outputs: ["selectionChange", "variantChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
578
|
+
}
|
|
579
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: ProductDetailComponent, decorators: [{
|
|
580
|
+
type: Component,
|
|
581
|
+
args: [{
|
|
582
|
+
selector: 'hm-product-detail',
|
|
583
|
+
imports: [ButtonComponent, IconComponent, InputComponent, PriceComponent, StockStatusComponent, VariantPickerComponent],
|
|
584
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
585
|
+
host: { class: 'hm-product-detail' },
|
|
586
|
+
template: `
|
|
587
|
+
<div class="hm-product-detail__gallery" role="group" [attr.aria-label]="galleryLabel()">
|
|
588
|
+
<div class="hm-product-detail__stage">
|
|
589
|
+
@if (activeImage(); as image) {
|
|
590
|
+
<img class="hm-product-detail__image" [src]="image.src" [alt]="image.alt" />
|
|
591
|
+
} @else {
|
|
592
|
+
<span class="hm-product-detail__placeholder" aria-hidden="true"><hm-icon shape="image" /></span>
|
|
593
|
+
}
|
|
594
|
+
</div>
|
|
595
|
+
@if (images().length > 1) {
|
|
596
|
+
<div class="hm-product-detail__thumbs">
|
|
597
|
+
@for (image of images(); track $index) {
|
|
598
|
+
<button
|
|
599
|
+
type="button"
|
|
600
|
+
class="hm-product-detail__thumb"
|
|
601
|
+
[class.hm-product-detail__thumb--active]="$index === imageIndex()"
|
|
602
|
+
[attr.aria-label]="thumbLabel($index)"
|
|
603
|
+
[attr.aria-pressed]="$index === imageIndex() ? 'true' : 'false'"
|
|
604
|
+
(click)="imageIndex.set($index)"
|
|
605
|
+
>
|
|
606
|
+
<img [src]="image.src" alt="" />
|
|
607
|
+
</button>
|
|
608
|
+
}
|
|
609
|
+
</div>
|
|
610
|
+
}
|
|
611
|
+
</div>
|
|
612
|
+
|
|
613
|
+
<div class="hm-product-detail__info">
|
|
614
|
+
@if (brand()) {
|
|
615
|
+
<span class="hm-product-detail__brand">{{ brand() }}</span>
|
|
616
|
+
}
|
|
617
|
+
<div class="hm-product-detail__name" role="heading" [attr.aria-level]="headingLevel()">{{ name() }}</div>
|
|
618
|
+
@if (sku()) {
|
|
619
|
+
<span class="hm-product-detail__sku">{{ skuText() }}</span>
|
|
620
|
+
}
|
|
621
|
+
<hm-price
|
|
622
|
+
size="large"
|
|
623
|
+
[amount]="effectivePrice()"
|
|
624
|
+
[compareAt]="effectiveCompareAt()"
|
|
625
|
+
[currency]="currency()"
|
|
626
|
+
[installments]="installments()"
|
|
627
|
+
[interestFree]="interestFree()"
|
|
628
|
+
showSavings
|
|
629
|
+
/>
|
|
630
|
+
@if (effectiveStock(); as stock) {
|
|
631
|
+
<hm-stock-status
|
|
632
|
+
[quantity]="stock.quantity"
|
|
633
|
+
[lowThreshold]="stock.lowThreshold ?? 5"
|
|
634
|
+
[backorder]="!!stock.backorder"
|
|
635
|
+
[preorder]="!!stock.preorder"
|
|
636
|
+
/>
|
|
637
|
+
}
|
|
638
|
+
<div class="hm-product-detail__description"><ng-content select="[description]" /></div>
|
|
639
|
+
@if (options().length) {
|
|
640
|
+
<hm-variant-picker [options]="options()" [variants]="variants()" [(selection)]="selection" />
|
|
641
|
+
}
|
|
642
|
+
<div class="hm-product-detail__buy">
|
|
643
|
+
<hm-input
|
|
644
|
+
class="hm-product-detail__quantity"
|
|
645
|
+
type="number"
|
|
646
|
+
[label]="text().quantity"
|
|
647
|
+
[value]="quantity()"
|
|
648
|
+
[min]="1"
|
|
649
|
+
[max]="maxQuantity()"
|
|
650
|
+
[step]="1"
|
|
651
|
+
(valueChange)="setQuantity($event)"
|
|
652
|
+
/>
|
|
653
|
+
<hm-button
|
|
654
|
+
class="hm-product-detail__add"
|
|
655
|
+
icon="shopping-cart"
|
|
656
|
+
[disabled]="!canBuy()"
|
|
657
|
+
[loading]="adding()"
|
|
658
|
+
(clicked)="requestAdd()"
|
|
659
|
+
>{{ purchasable() ? text().addToCart : text().unavailable }}</hm-button>
|
|
660
|
+
</div>
|
|
661
|
+
@if (missingText()) {
|
|
662
|
+
<p class="hm-product-detail__hint">{{ missingText() }}</p>
|
|
663
|
+
}
|
|
664
|
+
<ng-content />
|
|
665
|
+
</div>
|
|
666
|
+
`,
|
|
667
|
+
}]
|
|
668
|
+
}], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }], brand: [{ type: i0.Input, args: [{ isSignal: true, alias: "brand", required: false }] }], images: [{ type: i0.Input, args: [{ isSignal: true, alias: "images", required: false }] }], price: [{ type: i0.Input, args: [{ isSignal: true, alias: "price", required: true }] }], compareAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareAt", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], installments: [{ type: i0.Input, args: [{ isSignal: true, alias: "installments", required: false }] }], interestFree: [{ type: i0.Input, args: [{ isSignal: true, alias: "interestFree", required: false }] }], sku: [{ type: i0.Input, args: [{ isSignal: true, alias: "sku", required: false }] }], stock: [{ type: i0.Input, args: [{ isSignal: true, alias: "stock", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], variants: [{ type: i0.Input, args: [{ isSignal: true, alias: "variants", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], quantity: [{ type: i0.Input, args: [{ isSignal: true, alias: "quantity", required: false }] }, { type: i0.Output, args: ["quantityChange"] }], maxQuantity: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxQuantity", required: false }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }], adding: [{ type: i0.Input, args: [{ isSignal: true, alias: "adding", required: false }] }], addToCart: [{ type: i0.Output, args: ["addToCart"] }], texts: [{ type: i0.Input, args: [{ isSignal: true, alias: "texts", required: false }] }] } });
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Lista de produtos (`hm-product-list`): uma grade de `hm-product-card` que se ajusta à largura (ou uma
|
|
672
|
+
* lista de cartões horizontais), com contagem, estado vazio e esqueletos durante o carregamento.
|
|
673
|
+
*
|
|
674
|
+
* ```html
|
|
675
|
+
* <hm-product-list [products]="resultado" [loading]="buscando()" (addToCart)="carrinho.add($event)" />
|
|
676
|
+
* ```
|
|
677
|
+
*
|
|
678
|
+
* - É uma lista de verdade (`<ul>`), nomeada por `label`; a contagem ("24 produtos") fica visível e é
|
|
679
|
+
* anunciada quando muda (região viva educada), como um resultado de busca.
|
|
680
|
+
* - Filtrar, ordenar e paginar é do app: a lista mostra o que recebe.
|
|
681
|
+
*/
|
|
682
|
+
class ProductListComponent {
|
|
683
|
+
#icons = useHermesIcons(PRODUCT_ICONS);
|
|
684
|
+
products = input([], ...(ngDevMode ? [{ debugName: "products" }] : /* istanbul ignore next */ []));
|
|
685
|
+
currency = input('BRL', ...(ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []));
|
|
686
|
+
/** Grade de cartões verticais ou lista de cartões horizontais. */
|
|
687
|
+
layout = input('grid', ...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
688
|
+
/** Nome da lista para leitor de tela. Vazio = "Produtos". */
|
|
689
|
+
label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
690
|
+
headingLevel = input(3, ...(ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []));
|
|
691
|
+
showAction = input(true, { ...(ngDevMode ? { debugName: "showAction" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
692
|
+
/** Mostra a contagem de produtos acima da lista. */
|
|
693
|
+
showCount = input(true, { ...(ngDevMode ? { debugName: "showCount" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
694
|
+
/** Texto do estado vazio. */
|
|
695
|
+
emptyText = input('', ...(ngDevMode ? [{ debugName: "emptyText" }] : /* istanbul ignore next */ []));
|
|
696
|
+
loading = input(false, { ...(ngDevMode ? { debugName: "loading" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
697
|
+
/** Quantos esqueletos durante o carregamento. */
|
|
698
|
+
skeletonCount = input(4, ...(ngDevMode ? [{ debugName: "skeletonCount" }] : /* istanbul ignore next */ []));
|
|
699
|
+
/** Produto cujo "adicionar" está em andamento. */
|
|
700
|
+
addingId = input(null, ...(ngDevMode ? [{ debugName: "addingId" }] : /* istanbul ignore next */ []));
|
|
701
|
+
addToCart = output();
|
|
702
|
+
view = output();
|
|
703
|
+
/** Sobrescreve textos do catálogo da peça (`PRODUCT_MESSAGES_PT_BR`). */
|
|
704
|
+
texts = input(null, ...(ngDevMode ? [{ debugName: "texts" }] : /* istanbul ignore next */ []));
|
|
705
|
+
#text = localCatalog(PRODUCT_MESSAGES, PRODUCT_MESSAGES_PT_BR, () => this.texts());
|
|
706
|
+
#locale = formatLocale();
|
|
707
|
+
text = computed(() => this.#text().product, ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
708
|
+
cardLayout = computed(() => (this.layout() === 'list' ? 'horizontal' : 'vertical'), ...(ngDevMode ? [{ debugName: "cardLayout" }] : /* istanbul ignore next */ []));
|
|
709
|
+
countText = computed(() => pluralMessage(this.text().count, this.products().length, this.#locale()), ...(ngDevMode ? [{ debugName: "countText" }] : /* istanbul ignore next */ []));
|
|
710
|
+
skeletons = computed(() => Array.from({ length: Math.max(1, this.skeletonCount()) }, (_, index) => index), ...(ngDevMode ? [{ debugName: "skeletons" }] : /* istanbul ignore next */ []));
|
|
711
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: ProductListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
712
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.24", type: ProductListComponent, isStandalone: true, selector: "hm-product-list", inputs: { products: { classPropertyName: "products", publicName: "products", isSignal: true, isRequired: false, transformFunction: null }, currency: { classPropertyName: "currency", publicName: "currency", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null }, showAction: { classPropertyName: "showAction", publicName: "showAction", isSignal: true, isRequired: false, transformFunction: null }, showCount: { classPropertyName: "showCount", publicName: "showCount", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, skeletonCount: { classPropertyName: "skeletonCount", publicName: "skeletonCount", isSignal: true, isRequired: false, transformFunction: null }, addingId: { classPropertyName: "addingId", publicName: "addingId", isSignal: true, isRequired: false, transformFunction: null }, texts: { classPropertyName: "texts", publicName: "texts", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { addToCart: "addToCart", view: "view" }, host: { properties: { "class.hm-product-list--list": "layout() === 'list'", "attr.aria-busy": "loading() ? \"true\" : null" }, classAttribute: "hm-product-list" }, ngImport: i0, template: `
|
|
713
|
+
@if (showCount()) {
|
|
714
|
+
<p class="hm-product-list__count" aria-live="polite">{{ loading() ? text().loading : countText() }}</p>
|
|
715
|
+
}
|
|
716
|
+
@if (loading()) {
|
|
717
|
+
<ul class="hm-product-list__items" [attr.aria-label]="label() || text().listLabel">
|
|
718
|
+
@for (slot of skeletons(); track slot) {
|
|
719
|
+
<li class="hm-product-list__item hm-product-list__item--skeleton" aria-hidden="true">
|
|
720
|
+
<span class="hm-product-list__bone hm-product-list__bone--media"></span>
|
|
721
|
+
<span class="hm-product-list__bone"></span>
|
|
722
|
+
<span class="hm-product-list__bone hm-product-list__bone--short"></span>
|
|
723
|
+
</li>
|
|
724
|
+
}
|
|
725
|
+
</ul>
|
|
726
|
+
} @else if (products().length) {
|
|
727
|
+
<ul class="hm-product-list__items" [attr.aria-label]="label() || text().listLabel">
|
|
728
|
+
@for (product of products(); track product.id) {
|
|
729
|
+
<li class="hm-product-list__item">
|
|
730
|
+
<hm-product-card
|
|
731
|
+
[product]="product"
|
|
732
|
+
[currency]="currency()"
|
|
733
|
+
[layout]="cardLayout()"
|
|
734
|
+
[headingLevel]="headingLevel()"
|
|
735
|
+
[showAction]="showAction()"
|
|
736
|
+
[adding]="addingId() === product.id"
|
|
737
|
+
(addToCart)="addToCart.emit($event)"
|
|
738
|
+
(view)="view.emit($event)"
|
|
739
|
+
/>
|
|
740
|
+
</li>
|
|
741
|
+
}
|
|
742
|
+
</ul>
|
|
743
|
+
} @else {
|
|
744
|
+
<p class="hm-product-list__empty">{{ emptyText() || text().empty }}</p>
|
|
745
|
+
}
|
|
746
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ProductCardComponent, selector: "hm-product-card", inputs: ["product", "currency", "layout", "headingLevel", "showAction", "actionLabel", "adding", "texts"], outputs: ["addToCart", "view"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
747
|
+
}
|
|
748
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.24", ngImport: i0, type: ProductListComponent, decorators: [{
|
|
749
|
+
type: Component,
|
|
750
|
+
args: [{
|
|
751
|
+
selector: 'hm-product-list',
|
|
752
|
+
imports: [ProductCardComponent],
|
|
753
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
754
|
+
host: { class: 'hm-product-list', '[class.hm-product-list--list]': "layout() === 'list'", '[attr.aria-busy]': 'loading() ? "true" : null' },
|
|
755
|
+
template: `
|
|
756
|
+
@if (showCount()) {
|
|
757
|
+
<p class="hm-product-list__count" aria-live="polite">{{ loading() ? text().loading : countText() }}</p>
|
|
758
|
+
}
|
|
759
|
+
@if (loading()) {
|
|
760
|
+
<ul class="hm-product-list__items" [attr.aria-label]="label() || text().listLabel">
|
|
761
|
+
@for (slot of skeletons(); track slot) {
|
|
762
|
+
<li class="hm-product-list__item hm-product-list__item--skeleton" aria-hidden="true">
|
|
763
|
+
<span class="hm-product-list__bone hm-product-list__bone--media"></span>
|
|
764
|
+
<span class="hm-product-list__bone"></span>
|
|
765
|
+
<span class="hm-product-list__bone hm-product-list__bone--short"></span>
|
|
766
|
+
</li>
|
|
767
|
+
}
|
|
768
|
+
</ul>
|
|
769
|
+
} @else if (products().length) {
|
|
770
|
+
<ul class="hm-product-list__items" [attr.aria-label]="label() || text().listLabel">
|
|
771
|
+
@for (product of products(); track product.id) {
|
|
772
|
+
<li class="hm-product-list__item">
|
|
773
|
+
<hm-product-card
|
|
774
|
+
[product]="product"
|
|
775
|
+
[currency]="currency()"
|
|
776
|
+
[layout]="cardLayout()"
|
|
777
|
+
[headingLevel]="headingLevel()"
|
|
778
|
+
[showAction]="showAction()"
|
|
779
|
+
[adding]="addingId() === product.id"
|
|
780
|
+
(addToCart)="addToCart.emit($event)"
|
|
781
|
+
(view)="view.emit($event)"
|
|
782
|
+
/>
|
|
783
|
+
</li>
|
|
784
|
+
}
|
|
785
|
+
</ul>
|
|
786
|
+
} @else {
|
|
787
|
+
<p class="hm-product-list__empty">{{ emptyText() || text().empty }}</p>
|
|
788
|
+
}
|
|
789
|
+
`,
|
|
790
|
+
}]
|
|
791
|
+
}], propDecorators: { products: [{ type: i0.Input, args: [{ isSignal: true, alias: "products", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }], showAction: [{ type: i0.Input, args: [{ isSignal: true, alias: "showAction", required: false }] }], showCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCount", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], skeletonCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "skeletonCount", required: false }] }], addingId: [{ type: i0.Input, args: [{ isSignal: true, alias: "addingId", required: false }] }], addToCart: [{ type: i0.Output, args: ["addToCart"] }], view: [{ type: i0.Output, args: ["view"] }], texts: [{ type: i0.Input, args: [{ isSignal: true, alias: "texts", required: false }] }] } });
|
|
792
|
+
|
|
793
|
+
// Ponto de import `@trismegisto/angular/product` (secundário do ng-packagr).
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Generated bundle index. Do not edit.
|
|
797
|
+
*/
|
|
798
|
+
|
|
799
|
+
export { PRODUCT_MESSAGES, PRODUCT_MESSAGES_EN, PRODUCT_MESSAGES_ES, PRODUCT_MESSAGES_PT_BR, ProductCardComponent, ProductDetailComponent, ProductListComponent, VariantPickerComponent };
|
|
800
|
+
//# sourceMappingURL=trismegisto-angular-product.mjs.map
|