@caribeng/ui 22.2.0 → 22.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +311 -231
- package/fesm2022/caribeng-ui-accordion.mjs +2 -2
- package/fesm2022/caribeng-ui-account-picker.mjs +533 -0
- package/fesm2022/caribeng-ui-aging.mjs +488 -0
- package/fesm2022/{caribeng-ui-caribe-alert.mjs → caribeng-ui-alert.mjs} +45 -45
- package/fesm2022/caribeng-ui-amount.mjs +249 -0
- package/fesm2022/caribeng-ui-anchor.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-animation-lottie.mjs → caribeng-ui-animation-lottie.mjs} +41 -41
- package/fesm2022/caribeng-ui-audit-log.mjs +323 -0
- package/fesm2022/caribeng-ui-avatar.mjs +4 -4
- package/fesm2022/caribeng-ui-badge.mjs +8 -2
- package/fesm2022/caribeng-ui-breadcrumb.mjs +26 -9
- package/fesm2022/{caribeng-ui-caribe-button-group.mjs → caribeng-ui-button-group.mjs} +15 -15
- package/fesm2022/caribeng-ui-button.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-card-content.mjs → caribeng-ui-card-content.mjs} +39 -39
- package/fesm2022/{caribeng-ui-caribe-card-move.mjs → caribeng-ui-card-move.mjs} +65 -65
- package/fesm2022/{caribeng-ui-caribe-card-primary.mjs → caribeng-ui-card-primary.mjs} +31 -31
- package/fesm2022/{caribeng-ui-caribe-card-select.mjs → caribeng-ui-card-select.mjs} +67 -67
- package/fesm2022/caribeng-ui-carousel.mjs +2 -2
- package/fesm2022/caribeng-ui-cascadeselect.mjs +45 -9
- package/fesm2022/caribeng-ui-chart.mjs +8 -5
- package/fesm2022/caribeng-ui-chat.mjs +1303 -0
- package/fesm2022/{caribeng-ui-caribe-coachmark.mjs → caribeng-ui-coachmark.mjs} +85 -85
- package/fesm2022/caribeng-ui-code-block.mjs +332 -0
- package/fesm2022/caribeng-ui-colorpicker.mjs +99 -5
- package/fesm2022/caribeng-ui-command-palette.mjs +476 -0
- package/fesm2022/caribeng-ui-comments.mjs +864 -0
- package/fesm2022/caribeng-ui-confirmdialog.mjs +78 -13
- package/fesm2022/caribeng-ui-confirmpopup.mjs +91 -16
- package/fesm2022/caribeng-ui-contextmenu.mjs +8 -4
- package/fesm2022/caribeng-ui-copy-button.mjs +230 -0
- package/fesm2022/caribeng-ui-datagrid.mjs +1635 -0
- package/fesm2022/caribeng-ui-dataview.mjs +6 -3
- package/fesm2022/caribeng-ui-datepicker.mjs +2 -2
- package/fesm2022/caribeng-ui-dock.mjs +52 -12
- package/fesm2022/caribeng-ui-document.mjs +495 -0
- package/fesm2022/{caribeng-ui-caribe-dots-indicator.mjs → caribeng-ui-dots-indicator.mjs} +41 -41
- package/fesm2022/caribeng-ui-drawer.mjs +9 -4
- package/fesm2022/caribeng-ui-dynamic-form.mjs +1581 -0
- package/fesm2022/caribeng-ui-editor.mjs +2324 -1311
- package/fesm2022/{caribeng-ui-caribe-expansion-panel.mjs → caribeng-ui-expansion-panel.mjs} +39 -39
- package/fesm2022/{caribeng-ui-caribe-fab-menu.mjs → caribeng-ui-fab-menu.mjs} +75 -75
- package/fesm2022/caribeng-ui-fieldset.mjs +2 -2
- package/fesm2022/caribeng-ui-file-card.mjs +134 -17
- package/fesm2022/{caribeng-ui-caribe-file-download.mjs → caribeng-ui-file-download.mjs} +63 -63
- package/fesm2022/caribeng-ui-financial-report.mjs +380 -0
- package/fesm2022/{caribeng-ui-caribe-float-menu.mjs → caribeng-ui-float-menu.mjs} +31 -31
- package/fesm2022/caribeng-ui-floatlabel.mjs +2 -2
- package/fesm2022/caribeng-ui-flow.mjs +1508 -0
- package/fesm2022/caribeng-ui-folder-card.mjs +122 -12
- package/fesm2022/{caribeng-ui-caribe-footer.mjs → caribeng-ui-footer.mjs} +19 -19
- package/fesm2022/caribeng-ui-gantt.mjs +1094 -0
- package/fesm2022/{caribeng-ui-caribe-header.mjs → caribeng-ui-header.mjs} +49 -49
- package/fesm2022/{caribeng-ui-caribe-icon-button.mjs → caribeng-ui-icon-button.mjs} +23 -23
- package/fesm2022/caribeng-ui-image-cropper.mjs +671 -0
- package/fesm2022/caribeng-ui-import-wizard.mjs +746 -0
- package/fesm2022/caribeng-ui-infinite-scroll.mjs +226 -0
- package/fesm2022/caribeng-ui-inlinemessage.mjs +2 -2
- package/fesm2022/caribeng-ui-input-number.mjs +22 -6
- package/fesm2022/{caribeng-ui-caribe-input-search.mjs → caribeng-ui-input-search.mjs} +65 -65
- package/fesm2022/{caribeng-ui-caribe-input-token.mjs → caribeng-ui-input-token.mjs} +59 -59
- package/fesm2022/caribeng-ui-inputmask.mjs +8 -2
- package/fesm2022/caribeng-ui-inputotp.mjs +2 -2
- package/fesm2022/caribeng-ui-journal-entry.mjs +340 -0
- package/fesm2022/caribeng-ui-kanban.mjs +4612 -0
- package/fesm2022/caribeng-ui-kbd.mjs +122 -0
- package/fesm2022/caribeng-ui-kpi.mjs +189 -0
- package/fesm2022/{caribeng-ui-caribe-link.mjs → caribeng-ui-link.mjs} +37 -37
- package/fesm2022/caribeng-ui-masonry.mjs +93 -0
- package/fesm2022/caribeng-ui-media-player.mjs +821 -0
- package/fesm2022/caribeng-ui-megamenu.mjs +13 -9
- package/fesm2022/caribeng-ui-mentions.mjs +495 -0
- package/fesm2022/caribeng-ui-menu.mjs +8 -4
- package/fesm2022/caribeng-ui-menubar.mjs +9 -5
- package/fesm2022/caribeng-ui-message.mjs +6 -3
- package/fesm2022/caribeng-ui-notification-center.mjs +636 -0
- package/fesm2022/{caribeng-ui-caribe-off-canvas.mjs → caribeng-ui-off-canvas.mjs} +55 -55
- package/fesm2022/{caribeng-ui-caribe-onboarding.mjs → caribeng-ui-onboarding.mjs} +105 -105
- package/fesm2022/caribeng-ui-orderlist.mjs +2 -2
- package/fesm2022/caribeng-ui-organizationchart.mjs +6 -10
- package/fesm2022/caribeng-ui-panel.mjs +6 -6
- package/fesm2022/caribeng-ui-panelmenu.mjs +9 -6
- package/fesm2022/caribeng-ui-pdfviewer.mjs +1755 -25
- package/fesm2022/caribeng-ui-period-picker.mjs +637 -0
- package/fesm2022/caribeng-ui-phone-input.mjs +688 -0
- package/fesm2022/caribeng-ui-picklist.mjs +2 -2
- package/fesm2022/caribeng-ui-pivot.mjs +419 -0
- package/fesm2022/caribeng-ui-pricing.mjs +263 -69
- package/fesm2022/caribeng-ui-qrcode.mjs +564 -0
- package/fesm2022/caribeng-ui-rating.mjs +14 -17
- package/fesm2022/caribeng-ui-reconciliation.mjs +386 -0
- package/fesm2022/caribeng-ui-ripple.mjs +2 -0
- package/fesm2022/caribeng-ui-scheduler.mjs +1027 -0
- package/fesm2022/caribeng-ui-scrolltop.mjs +3 -1
- package/fesm2022/caribeng-ui-select.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-shortcut.mjs → caribeng-ui-shortcut.mjs} +29 -29
- package/fesm2022/caribeng-ui-sidebar.mjs +573 -0
- package/fesm2022/caribeng-ui-signature-pad.mjs +654 -0
- package/fesm2022/{caribeng-ui-caribe-status.mjs → caribeng-ui-status.mjs} +11 -11
- package/fesm2022/{caribeng-ui-caribe-step-indicator.mjs → caribeng-ui-step-indicator.mjs} +53 -53
- package/fesm2022/caribeng-ui-stepper.mjs +12 -5
- package/fesm2022/caribeng-ui-steps.mjs +2 -2
- package/fesm2022/caribeng-ui-table.mjs +333 -19
- package/fesm2022/caribeng-ui-tabmenu.mjs +10 -6
- package/fesm2022/caribeng-ui-tabs.mjs +2 -2
- package/fesm2022/{caribeng-ui-caribe-tag-button.mjs → caribeng-ui-tag-button.mjs} +25 -25
- package/fesm2022/caribeng-ui-tag.mjs +2 -2
- package/fesm2022/caribeng-ui-tieredmenu.mjs +111 -21
- package/fesm2022/{caribeng-ui-caribe-tracker.mjs → caribeng-ui-tracker.mjs} +29 -29
- package/fesm2022/{caribeng-ui-caribe-transaction-status.mjs → caribeng-ui-transaction-status.mjs} +11 -11
- package/fesm2022/caribeng-ui-treeselect.mjs +44 -9
- package/fesm2022/caribeng-ui-treetable.mjs +236 -17
- package/fesm2022/{caribeng-ui-caribe-voucher.mjs → caribeng-ui-voucher.mjs} +45 -45
- package/fesm2022/caribeng-ui-xlsx.mjs +486 -0
- package/fesm2022/caribeng-ui.mjs +1568 -1
- package/package.json +258 -178
- package/schematics/collection.json +5 -0
- package/schematics/migrate-from-primeng/core-icons.json +1 -0
- package/schematics/migrate-from-primeng/icons.js +269 -0
- package/schematics/migrate-from-primeng/index.js +290 -0
- package/schematics/migrate-from-primeng/mappings/button.js +93 -0
- package/schematics/migrate-from-primeng/mappings/card.js +33 -0
- package/schematics/migrate-from-primeng/mappings/checkbox.js +44 -0
- package/schematics/migrate-from-primeng/mappings/confirm.js +221 -0
- package/schematics/migrate-from-primeng/mappings/datepicker.js +121 -0
- package/schematics/migrate-from-primeng/mappings/dialog.js +84 -0
- package/schematics/migrate-from-primeng/mappings/index.js +88 -0
- package/schematics/migrate-from-primeng/mappings/inputnumber.js +62 -0
- package/schematics/migrate-from-primeng/mappings/inputtext.js +60 -0
- package/schematics/migrate-from-primeng/mappings/menu.js +468 -0
- package/schematics/migrate-from-primeng/mappings/multiselect.js +49 -0
- package/schematics/migrate-from-primeng/mappings/radiobutton.js +22 -0
- package/schematics/migrate-from-primeng/mappings/rules.js +206 -0
- package/schematics/migrate-from-primeng/mappings/select.js +97 -0
- package/schematics/migrate-from-primeng/mappings/service-calls.js +100 -0
- package/schematics/migrate-from-primeng/mappings/table.js +613 -0
- package/schematics/migrate-from-primeng/mappings/tabs.js +225 -0
- package/schematics/migrate-from-primeng/mappings/tag.js +29 -0
- package/schematics/migrate-from-primeng/mappings/textarea.js +44 -0
- package/schematics/migrate-from-primeng/mappings/toast.js +173 -0
- package/schematics/migrate-from-primeng/mappings/toggleswitch.js +37 -0
- package/schematics/migrate-from-primeng/mappings/tooltip.js +44 -0
- package/schematics/migrate-from-primeng/mappings/types.js +10 -0
- package/schematics/migrate-from-primeng/report.js +79 -0
- package/schematics/migrate-from-primeng/schema.js +2 -0
- package/schematics/migrate-from-primeng/schema.json +34 -0
- package/schematics/migrate-from-primeng/template.js +387 -0
- package/schematics/migrate-from-primeng/todo.js +5 -0
- package/schematics/migrate-from-primeng/typescript.js +442 -0
- package/schematics/migrate-from-primeng/workspace.js +117 -0
- package/schematics/ng-add/index.js +16 -1
- package/types/caribeng-ui-account-picker.d.ts +142 -0
- package/types/caribeng-ui-aging.d.ts +123 -0
- package/types/{caribeng-ui-caribe-alert.d.ts → caribeng-ui-alert.d.ts} +2 -2
- package/types/caribeng-ui-amount.d.ts +82 -0
- package/types/{caribeng-ui-caribe-animation-lottie.d.ts → caribeng-ui-animation-lottie.d.ts} +2 -2
- package/types/caribeng-ui-audit-log.d.ts +86 -0
- package/types/caribeng-ui-badge.d.ts +3 -1
- package/types/caribeng-ui-breadcrumb.d.ts +9 -1
- package/types/{caribeng-ui-caribe-button-group.d.ts → caribeng-ui-button-group.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-content.d.ts → caribeng-ui-card-content.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-move.d.ts → caribeng-ui-card-move.d.ts} +1 -1
- package/types/{caribeng-ui-caribe-card-primary.d.ts → caribeng-ui-card-primary.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-card-select.d.ts → caribeng-ui-card-select.d.ts} +2 -2
- package/types/caribeng-ui-cascadeselect.d.ts +6 -0
- package/types/caribeng-ui-chart.d.ts +3 -1
- package/types/caribeng-ui-chat.d.ts +299 -0
- package/types/{caribeng-ui-caribe-coachmark.d.ts → caribeng-ui-coachmark.d.ts} +2 -2
- package/types/caribeng-ui-code-block.d.ts +65 -0
- package/types/caribeng-ui-colorpicker.d.ts +5 -1
- package/types/caribeng-ui-command-palette.d.ts +133 -0
- package/types/caribeng-ui-comments.d.ts +214 -0
- package/types/caribeng-ui-confirmdialog.d.ts +34 -2
- package/types/caribeng-ui-confirmpopup.d.ts +39 -2
- package/types/caribeng-ui-contextmenu.d.ts +7 -0
- package/types/caribeng-ui-copy-button.d.ts +90 -0
- package/types/caribeng-ui-datagrid.d.ts +269 -0
- package/types/caribeng-ui-dataview.d.ts +2 -0
- package/types/caribeng-ui-dock.d.ts +13 -1
- package/types/caribeng-ui-document.d.ts +138 -0
- package/types/{caribeng-ui-caribe-dots-indicator.d.ts → caribeng-ui-dots-indicator.d.ts} +2 -2
- package/types/caribeng-ui-drawer.d.ts +3 -1
- package/types/caribeng-ui-dynamic-form.d.ts +409 -0
- package/types/caribeng-ui-editor.d.ts +110 -12
- package/types/{caribeng-ui-caribe-expansion-panel.d.ts → caribeng-ui-expansion-panel.d.ts} +1 -1
- package/types/{caribeng-ui-caribe-fab-menu.d.ts → caribeng-ui-fab-menu.d.ts} +2 -2
- package/types/caribeng-ui-file-card.d.ts +27 -2
- package/types/{caribeng-ui-caribe-file-download.d.ts → caribeng-ui-file-download.d.ts} +1 -1
- package/types/caribeng-ui-financial-report.d.ts +102 -0
- package/types/{caribeng-ui-caribe-float-menu.d.ts → caribeng-ui-float-menu.d.ts} +2 -2
- package/types/caribeng-ui-flow.d.ts +228 -0
- package/types/caribeng-ui-folder-card.d.ts +27 -5
- package/types/{caribeng-ui-caribe-footer.d.ts → caribeng-ui-footer.d.ts} +2 -2
- package/types/caribeng-ui-gantt.d.ts +244 -0
- package/types/{caribeng-ui-caribe-header.d.ts → caribeng-ui-header.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-icon-button.d.ts → caribeng-ui-icon-button.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-illustration.d.ts → caribeng-ui-illustration.d.ts} +1 -1
- package/types/caribeng-ui-image-cropper.d.ts +169 -0
- package/types/caribeng-ui-import-wizard.d.ts +149 -0
- package/types/caribeng-ui-infinite-scroll.d.ts +75 -0
- package/types/caribeng-ui-input-number.d.ts +1 -1
- package/types/{caribeng-ui-caribe-input-search.d.ts → caribeng-ui-input-search.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-input-token.d.ts → caribeng-ui-input-token.d.ts} +2 -2
- package/types/caribeng-ui-inputmask.d.ts +3 -1
- package/types/caribeng-ui-journal-entry.d.ts +110 -0
- package/types/caribeng-ui-kanban.d.ts +783 -0
- package/types/caribeng-ui-kbd.d.ts +36 -0
- package/types/caribeng-ui-kpi.d.ts +64 -0
- package/types/{caribeng-ui-caribe-link.d.ts → caribeng-ui-link.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-logo.d.ts → caribeng-ui-logo.d.ts} +1 -1
- package/types/caribeng-ui-masonry.d.ts +32 -0
- package/types/caribeng-ui-media-player.d.ts +140 -0
- package/types/caribeng-ui-megamenu.d.ts +11 -0
- package/types/caribeng-ui-mentions.d.ts +127 -0
- package/types/caribeng-ui-menu.d.ts +7 -0
- package/types/caribeng-ui-menubar.d.ts +7 -0
- package/types/caribeng-ui-message.d.ts +2 -0
- package/types/caribeng-ui-notification-center.d.ts +153 -0
- package/types/{caribeng-ui-caribe-off-canvas.d.ts → caribeng-ui-off-canvas.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-onboarding.d.ts → caribeng-ui-onboarding.d.ts} +2 -2
- package/types/caribeng-ui-panelmenu.d.ts +7 -0
- package/types/caribeng-ui-pdfviewer.d.ts +245 -5
- package/types/caribeng-ui-period-picker.d.ts +148 -0
- package/types/caribeng-ui-phone-input.d.ts +168 -0
- package/types/caribeng-ui-pivot.d.ts +116 -0
- package/types/caribeng-ui-pricing.d.ts +41 -4
- package/types/caribeng-ui-qrcode.d.ts +88 -0
- package/types/caribeng-ui-reconciliation.d.ts +109 -0
- package/types/caribeng-ui-scheduler.d.ts +188 -0
- package/types/{caribeng-ui-caribe-shortcut.d.ts → caribeng-ui-shortcut.d.ts} +2 -2
- package/types/caribeng-ui-sidebar.d.ts +167 -0
- package/types/caribeng-ui-signature-pad.d.ts +151 -0
- package/types/{caribeng-ui-caribe-status.d.ts → caribeng-ui-status.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-step-indicator.d.ts → caribeng-ui-step-indicator.d.ts} +2 -2
- package/types/caribeng-ui-stepper.d.ts +2 -0
- package/types/caribeng-ui-table.d.ts +67 -3
- package/types/caribeng-ui-tabmenu.d.ts +7 -0
- package/types/{caribeng-ui-caribe-tag-button.d.ts → caribeng-ui-tag-button.d.ts} +2 -2
- package/types/caribeng-ui-tieredmenu.d.ts +17 -1
- package/types/{caribeng-ui-caribe-tracker.d.ts → caribeng-ui-tracker.d.ts} +2 -2
- package/types/{caribeng-ui-caribe-transaction-status.d.ts → caribeng-ui-transaction-status.d.ts} +2 -2
- package/types/caribeng-ui-treeselect.d.ts +6 -0
- package/types/caribeng-ui-treetable.d.ts +67 -2
- package/types/{caribeng-ui-caribe-voucher.d.ts → caribeng-ui-voucher.d.ts} +2 -2
- package/types/caribeng-ui-xlsx.d.ts +79 -0
- package/types/caribeng-ui.d.ts +985 -2
- package/fesm2022/caribeng-ui-caribe-calendar.mjs +0 -92
- package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +0 -130
- package/fesm2022/caribeng-ui-caribe-data-table.mjs +0 -94
- package/fesm2022/caribeng-ui-caribe-file-select.mjs +0 -88
- package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +0 -100
- package/fesm2022/caribeng-ui-caribe-input-date.mjs +0 -138
- package/fesm2022/caribeng-ui-caribe-input-select.mjs +0 -154
- package/fesm2022/caribeng-ui-caribe-loader.mjs +0 -48
- package/fesm2022/caribeng-ui-caribe-modal.mjs +0 -119
- package/fesm2022/caribeng-ui-caribe-pictogram.mjs +0 -52
- package/fesm2022/caribeng-ui-caribe-pop-over.mjs +0 -104
- package/fesm2022/caribeng-ui-caribe-preloader.mjs +0 -57
- package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +0 -84
- package/fesm2022/caribeng-ui-caribe-stroke.mjs +0 -69
- package/fesm2022/caribeng-ui-caribe-switch.mjs +0 -182
- package/styles/caribeng.css +0 -380
- package/styles/scss/_mixins.scss +0 -46
- package/styles/scss/_overlay.scss +0 -15
- package/styles/scss/_tokens.scss +0 -267
- package/styles/scss/_utilities.scss +0 -73
- package/styles/scss/_variables.scss +0 -33
- package/styles/scss/index.scss +0 -16
- package/types/caribeng-ui-caribe-calendar.d.ts +0 -27
- package/types/caribeng-ui-caribe-circle-loading.d.ts +0 -28
- package/types/caribeng-ui-caribe-data-table.d.ts +0 -26
- package/types/caribeng-ui-caribe-file-select.d.ts +0 -31
- package/types/caribeng-ui-caribe-inline-alert.d.ts +0 -28
- package/types/caribeng-ui-caribe-input-date.d.ts +0 -40
- package/types/caribeng-ui-caribe-input-select.d.ts +0 -47
- package/types/caribeng-ui-caribe-loader.d.ts +0 -22
- package/types/caribeng-ui-caribe-modal.d.ts +0 -21
- package/types/caribeng-ui-caribe-pictogram.d.ts +0 -15
- package/types/caribeng-ui-caribe-pop-over.d.ts +0 -17
- package/types/caribeng-ui-caribe-preloader.d.ts +0 -24
- package/types/caribeng-ui-caribe-progress-bar.d.ts +0 -28
- package/types/caribeng-ui-caribe-stroke.d.ts +0 -17
- package/types/caribeng-ui-caribe-switch.d.ts +0 -55
- /package/fesm2022/{caribeng-ui-caribe-illustration.mjs → caribeng-ui-illustration.mjs} +0 -0
- /package/fesm2022/{caribeng-ui-caribe-logo.mjs → caribeng-ui-logo.mjs} +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
/** Teclas con nombre: `mod` es ⌘ en Mac y Ctrl en el resto. */
|
|
6
|
+
const NAMED_KEYS = {
|
|
7
|
+
mod: { mac: { text: '⌘', spoken: 'Command' }, other: { text: 'Ctrl' } },
|
|
8
|
+
cmd: { mac: { text: '⌘', spoken: 'Command' }, other: { text: 'Win' } },
|
|
9
|
+
ctrl: { mac: { text: '⌃', spoken: 'Control' }, other: { text: 'Ctrl' } },
|
|
10
|
+
alt: { mac: { text: '⌥', spoken: 'Option' }, other: { text: 'Alt' } },
|
|
11
|
+
shift: { mac: { text: '⇧', spoken: 'Shift' }, other: { text: 'Shift' } },
|
|
12
|
+
enter: { mac: { text: '↵', spoken: 'Enter' }, other: { text: 'Enter' } },
|
|
13
|
+
backspace: { mac: { text: '⌫', spoken: 'Delete' }, other: { text: 'Backspace' } },
|
|
14
|
+
tab: { mac: { text: 'Tab' }, other: { text: 'Tab' } },
|
|
15
|
+
esc: { mac: { text: 'Esc' }, other: { text: 'Esc' } },
|
|
16
|
+
space: { mac: { text: 'Space' }, other: { text: 'Space' } },
|
|
17
|
+
up: { mac: { text: '↑', spoken: 'Up' }, other: { text: '↑', spoken: 'Up' } },
|
|
18
|
+
down: { mac: { text: '↓', spoken: 'Down' }, other: { text: '↓', spoken: 'Down' } },
|
|
19
|
+
left: { mac: { text: '←', spoken: 'Left' }, other: { text: '←', spoken: 'Left' } },
|
|
20
|
+
right: { mac: { text: '→', spoken: 'Right' }, other: { text: '→', spoken: 'Right' } },
|
|
21
|
+
};
|
|
22
|
+
/** Detecta macOS/iOS en el navegador (en SSR devuelve `false`). */
|
|
23
|
+
function isApplePlatform(doc) {
|
|
24
|
+
const nav = doc.defaultView?.navigator;
|
|
25
|
+
const platform = nav?.userAgentData?.platform ?? nav?.platform ?? '';
|
|
26
|
+
return /mac|iphone|ipad|ipod/i.test(platform);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Tecla o atajo de teclado de CaribeNG. Con contenido muestra una tecla; con
|
|
30
|
+
* `keys` muestra la combinación (⌘ K en Mac, Ctrl + K en el resto).
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```html
|
|
34
|
+
* <cb-kbd>Esc</cb-kbd>
|
|
35
|
+
* <cb-kbd [keys]="['mod', 'K']" />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
class CbKbd {
|
|
39
|
+
constructor() {
|
|
40
|
+
this.doc = inject(DOCUMENT);
|
|
41
|
+
/** Teclas de la combinación: nombres (`mod`, `shift`, `alt`, `enter`, `up`…) o texto libre (`K`, `F2`). */
|
|
42
|
+
this.keys = input([], /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "keys" }] : /* istanbul ignore next */ []));
|
|
44
|
+
/** Plataforma a mostrar. `auto` la detecta (⌘ en Mac). */
|
|
45
|
+
this.platform = input('auto', /* @ts-ignore */
|
|
46
|
+
...(ngDevMode ? [{ debugName: "platform" }] : /* istanbul ignore next */ []));
|
|
47
|
+
this.size = input('md', /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
49
|
+
this.isMac = computed(() => {
|
|
50
|
+
const platform = this.platform();
|
|
51
|
+
return platform === 'auto' ? isApplePlatform(this.doc) : platform === 'mac';
|
|
52
|
+
}, /* @ts-ignore */
|
|
53
|
+
...(ngDevMode ? [{ debugName: "isMac" }] : /* istanbul ignore next */ []));
|
|
54
|
+
this.labels = computed(() => {
|
|
55
|
+
const mac = this.isMac();
|
|
56
|
+
return this.keys().map((key) => {
|
|
57
|
+
const named = NAMED_KEYS[key.toLowerCase()];
|
|
58
|
+
if (named)
|
|
59
|
+
return mac ? named.mac : named.other;
|
|
60
|
+
return { text: key.length === 1 ? key.toUpperCase() : key };
|
|
61
|
+
});
|
|
62
|
+
}, /* @ts-ignore */
|
|
63
|
+
...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
|
|
64
|
+
}
|
|
65
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbKbd, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
66
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbKbd, isStandalone: true, selector: "cb-kbd", inputs: { keys: { classPropertyName: "keys", publicName: "keys", isSignal: true, isRequired: false, transformFunction: null }, platform: { classPropertyName: "platform", publicName: "platform", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cb-kbd--sm": "size() === 'sm'" }, classAttribute: "cb-kbd" }, ngImport: i0, template: `
|
|
67
|
+
@if (labels().length) {
|
|
68
|
+
<kbd class="cb-kbd__combo">
|
|
69
|
+
@for (key of labels(); track $index) {
|
|
70
|
+
@if (!$first && !isMac()) {
|
|
71
|
+
<span class="cb-kbd__plus" aria-hidden="true">+</span>
|
|
72
|
+
}
|
|
73
|
+
<kbd class="cb-kbd__key">
|
|
74
|
+
@if (key.spoken) {
|
|
75
|
+
<span aria-hidden="true">{{ key.text }}</span><span class="cb-kbd__sr">{{ key.spoken }}</span>
|
|
76
|
+
} @else {
|
|
77
|
+
{{ key.text }}
|
|
78
|
+
}
|
|
79
|
+
</kbd>
|
|
80
|
+
}
|
|
81
|
+
</kbd>
|
|
82
|
+
} @else {
|
|
83
|
+
<kbd class="cb-kbd__key"><ng-content /></kbd>
|
|
84
|
+
}
|
|
85
|
+
`, isInline: true, styles: [":host{display:inline-flex;vertical-align:middle;font-size:var(--cb-text-xs, .75rem)}.cb-kbd__combo{display:inline-flex;align-items:center;gap:.25em;font:inherit}.cb-kbd__key{display:inline-flex;align-items:center;justify-content:center;min-width:1.75em;height:1.75em;padding:0 .4em;border:1px solid var(--cb-color-border-strong);border-bottom-width:2px;border-radius:var(--cb-radius-sm, 4px);background:var(--cb-color-surface-raised);color:var(--cb-color-text);font-family:var(--cb-font-sans);font-size:inherit;font-weight:var(--cb-font-weight-medium, 500);line-height:1;white-space:nowrap}.cb-kbd__plus{color:var(--cb-color-text-muted)}:host(.cb-kbd--sm){font-size:.6875rem}.cb-kbd__sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
86
|
+
}
|
|
87
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbKbd, decorators: [{
|
|
88
|
+
type: Component,
|
|
89
|
+
args: [{ selector: 'cb-kbd', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: {
|
|
90
|
+
class: 'cb-kbd',
|
|
91
|
+
'[class.cb-kbd--sm]': "size() === 'sm'",
|
|
92
|
+
}, template: `
|
|
93
|
+
@if (labels().length) {
|
|
94
|
+
<kbd class="cb-kbd__combo">
|
|
95
|
+
@for (key of labels(); track $index) {
|
|
96
|
+
@if (!$first && !isMac()) {
|
|
97
|
+
<span class="cb-kbd__plus" aria-hidden="true">+</span>
|
|
98
|
+
}
|
|
99
|
+
<kbd class="cb-kbd__key">
|
|
100
|
+
@if (key.spoken) {
|
|
101
|
+
<span aria-hidden="true">{{ key.text }}</span><span class="cb-kbd__sr">{{ key.spoken }}</span>
|
|
102
|
+
} @else {
|
|
103
|
+
{{ key.text }}
|
|
104
|
+
}
|
|
105
|
+
</kbd>
|
|
106
|
+
}
|
|
107
|
+
</kbd>
|
|
108
|
+
} @else {
|
|
109
|
+
<kbd class="cb-kbd__key"><ng-content /></kbd>
|
|
110
|
+
}
|
|
111
|
+
`, styles: [":host{display:inline-flex;vertical-align:middle;font-size:var(--cb-text-xs, .75rem)}.cb-kbd__combo{display:inline-flex;align-items:center;gap:.25em;font:inherit}.cb-kbd__key{display:inline-flex;align-items:center;justify-content:center;min-width:1.75em;height:1.75em;padding:0 .4em;border:1px solid var(--cb-color-border-strong);border-bottom-width:2px;border-radius:var(--cb-radius-sm, 4px);background:var(--cb-color-surface-raised);color:var(--cb-color-text);font-family:var(--cb-font-sans);font-size:inherit;font-weight:var(--cb-font-weight-medium, 500);line-height:1;white-space:nowrap}.cb-kbd__plus{color:var(--cb-color-text-muted)}:host(.cb-kbd--sm){font-size:.6875rem}.cb-kbd__sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}\n"] }]
|
|
112
|
+
}], propDecorators: { keys: [{ type: i0.Input, args: [{ isSignal: true, alias: "keys", required: false }] }], platform: [{ type: i0.Input, args: [{ isSignal: true, alias: "platform", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Public API Surface de @caribeng/ui/kbd
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Generated bundle index. Do not edit.
|
|
120
|
+
*/
|
|
121
|
+
|
|
122
|
+
export { CbKbd };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, input, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation, cbFormat, CB_CONFIG, cbFormatAmount } from '@caribeng/ui';
|
|
4
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
5
|
+
|
|
6
|
+
let nextUid = 0;
|
|
7
|
+
/**
|
|
8
|
+
* Indicador (KPI) de CaribeNG: valor, variación frente al periodo anterior,
|
|
9
|
+
* minigráfica de tendencia y avance hacia una meta.
|
|
10
|
+
*
|
|
11
|
+
* - `better` dice si subir es bueno (`up`, ingresos) o malo (`down`, gastos): el
|
|
12
|
+
* color de la variación lo sigue.
|
|
13
|
+
* - La variación se calcula sola a partir de `previous` y se dice con texto
|
|
14
|
+
* («sube 12,3 %»), no solo con el color o la flecha.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```html
|
|
18
|
+
* <cb-kpi label="Ingresos del mes" [value]="208330000" [previous]="167440000" [series]="ventas" compareLabel="vs. octubre 2025" />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
class CbKpi {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.t = injectCbTranslation();
|
|
24
|
+
this.fmt = cbFormat;
|
|
25
|
+
this.Math = Math;
|
|
26
|
+
this.config = inject(CB_CONFIG);
|
|
27
|
+
this.uid = `cb-kpi-${++nextUid}`;
|
|
28
|
+
this.label = input('', /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
30
|
+
this.value = input(null, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
32
|
+
/** Valor del periodo con el que se compara. */
|
|
33
|
+
this.previous = input(null, /* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [{ debugName: "previous" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/** Texto de la comparación («vs. mes anterior»). */
|
|
36
|
+
this.compareLabel = input('', /* @ts-ignore */
|
|
37
|
+
...(ngDevMode ? [{ debugName: "compareLabel" }] : /* istanbul ignore next */ []));
|
|
38
|
+
/** `up`: subir es bueno (ingresos); `down`: subir es malo (gastos); `none`: sin color. */
|
|
39
|
+
this.better = input('up', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "better" }] : /* istanbul ignore next */ []));
|
|
41
|
+
this.format_ = input('currency', { ...(ngDevMode ? { debugName: "format_" } : /* istanbul ignore next */ {}), alias: 'format' });
|
|
42
|
+
this.currency = input(undefined, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []));
|
|
44
|
+
this.decimals = input(undefined, /* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [{ debugName: "decimals" }] : /* istanbul ignore next */ []));
|
|
46
|
+
/** Serie para la minigráfica (del más antiguo al más reciente). */
|
|
47
|
+
this.series = input([], /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []));
|
|
49
|
+
/** Meta: muestra el avance del valor hacia ella. */
|
|
50
|
+
this.target = input(null, /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
|
|
52
|
+
this.locale = computed(() => this.config.numberLocale ?? this.t().intlLocale, /* @ts-ignore */
|
|
53
|
+
...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
|
|
54
|
+
this.delta = computed(() => {
|
|
55
|
+
const v = this.value();
|
|
56
|
+
const p = this.previous();
|
|
57
|
+
if (v === null || p === null)
|
|
58
|
+
return null;
|
|
59
|
+
const change = p === 0 ? (v === 0 ? 0 : null) : (v - p) / Math.abs(p);
|
|
60
|
+
if (change === null)
|
|
61
|
+
return null;
|
|
62
|
+
const pct = new Intl.NumberFormat(this.locale(), { style: 'percent', maximumFractionDigits: 1 }).format(Math.abs(change));
|
|
63
|
+
const t = this.t();
|
|
64
|
+
const better = this.better();
|
|
65
|
+
const good = change === 0 || better === 'none' ? null : (change > 0) === (better === 'up');
|
|
66
|
+
return {
|
|
67
|
+
change,
|
|
68
|
+
good,
|
|
69
|
+
text: `${change > 0 ? '+' : change < 0 ? '−' : ''}${pct}`,
|
|
70
|
+
spoken: change === 0 ? t.kpiSame : cbFormat(change > 0 ? t.kpiUp : t.kpiDown, pct),
|
|
71
|
+
};
|
|
72
|
+
}, /* @ts-ignore */
|
|
73
|
+
...(ngDevMode ? [{ debugName: "delta" }] : /* istanbul ignore next */ []));
|
|
74
|
+
this.points = computed(() => {
|
|
75
|
+
const s = this.series();
|
|
76
|
+
if (s.length < 2)
|
|
77
|
+
return null;
|
|
78
|
+
const min = Math.min(...s);
|
|
79
|
+
const max = Math.max(...s);
|
|
80
|
+
const span = max - min || 1;
|
|
81
|
+
const xy = s.map((v, i) => [(i / (s.length - 1)) * 100, 30 - ((v - min) / span) * 28]);
|
|
82
|
+
const line = xy.map(([x, y], i) => `${i ? 'L' : 'M'}${x.toFixed(2)},${y.toFixed(2)}`).join(' ');
|
|
83
|
+
return { line, area: `${line} L100,32 L0,32 Z` };
|
|
84
|
+
}, /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "points" }] : /* istanbul ignore next */ []));
|
|
86
|
+
this.sparkLabel = computed(() => {
|
|
87
|
+
const s = this.series();
|
|
88
|
+
return s.length ? cbFormat(this.t().kpiTrend, this.format(s[0]), this.format(s[s.length - 1]), s.length) : '';
|
|
89
|
+
}, /* @ts-ignore */
|
|
90
|
+
...(ngDevMode ? [{ debugName: "sparkLabel" }] : /* istanbul ignore next */ []));
|
|
91
|
+
this.progress = computed(() => {
|
|
92
|
+
const v = this.value();
|
|
93
|
+
const g = this.target();
|
|
94
|
+
if (v === null || !g)
|
|
95
|
+
return null;
|
|
96
|
+
return { pct: Math.round((v / g) * 100) };
|
|
97
|
+
}, /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "progress" }] : /* istanbul ignore next */ []));
|
|
99
|
+
}
|
|
100
|
+
format(v) {
|
|
101
|
+
if (v === null)
|
|
102
|
+
return '—';
|
|
103
|
+
const locale = this.locale();
|
|
104
|
+
switch (this.format_()) {
|
|
105
|
+
case 'percent':
|
|
106
|
+
return new Intl.NumberFormat(locale, { style: 'percent', maximumFractionDigits: this.decimals() ?? 1 }).format(v);
|
|
107
|
+
case 'integer':
|
|
108
|
+
return cbFormatAmount(v, locale, { decimals: 0 });
|
|
109
|
+
case 'number':
|
|
110
|
+
return cbFormatAmount(v, locale, { decimals: this.decimals() });
|
|
111
|
+
default:
|
|
112
|
+
return cbFormatAmount(v, locale, { currency: this.currency() ?? this.config.currency ?? null, decimals: this.decimals() ?? 0 });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbKpi, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
116
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbKpi, isStandalone: true, selector: "cb-kpi", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, previous: { classPropertyName: "previous", publicName: "previous", isSignal: true, isRequired: false, transformFunction: null }, compareLabel: { classPropertyName: "compareLabel", publicName: "compareLabel", isSignal: true, isRequired: false, transformFunction: null }, better: { classPropertyName: "better", publicName: "better", isSignal: true, isRequired: false, transformFunction: null }, format_: { classPropertyName: "format_", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, currency: { classPropertyName: "currency", publicName: "currency", isSignal: true, isRequired: false, transformFunction: null }, decimals: { classPropertyName: "decimals", publicName: "decimals", isSignal: true, isRequired: false, transformFunction: null }, series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.aria-labelledby": "uid + \"-label\"" }, classAttribute: "cb-kpi" }, ngImport: i0, template: `
|
|
117
|
+
<div class="cb-kpi__head">
|
|
118
|
+
<span class="cb-kpi__label" [id]="uid + '-label'">{{ label() }}</span>
|
|
119
|
+
@if (delta(); as d) {
|
|
120
|
+
<span class="cb-kpi__delta" [class.cb-kpi__delta--good]="d.good === true" [class.cb-kpi__delta--bad]="d.good === false">
|
|
121
|
+
<cb-icon [name]="d.change > 0 ? 'trending-up' : d.change < 0 ? 'trending-down' : 'minus'" [size]="14" aria-hidden="true" />
|
|
122
|
+
<span aria-hidden="true">{{ d.text }}</span>
|
|
123
|
+
<span class="cb-kpi__sr">{{ d.spoken }}</span>
|
|
124
|
+
</span>
|
|
125
|
+
}
|
|
126
|
+
</div>
|
|
127
|
+
<div class="cb-kpi__value">{{ format(value()) }}</div>
|
|
128
|
+
@if (previous() !== null) {
|
|
129
|
+
<div class="cb-kpi__compare">{{ compareLabel() || t().kpiPrevious }}: {{ format(previous()) }}</div>
|
|
130
|
+
}
|
|
131
|
+
@if (points(); as p) {
|
|
132
|
+
<svg class="cb-kpi__spark" viewBox="0 0 100 32" preserveAspectRatio="none" role="img" [attr.aria-label]="sparkLabel()">
|
|
133
|
+
<path class="cb-kpi__area" [attr.d]="p.area" />
|
|
134
|
+
<path class="cb-kpi__line" [attr.d]="p.line" vector-effect="non-scaling-stroke" />
|
|
135
|
+
</svg>
|
|
136
|
+
}
|
|
137
|
+
@if (progress(); as g) {
|
|
138
|
+
<div class="cb-kpi__goal">
|
|
139
|
+
<div class="cb-kpi__bar" role="progressbar" [attr.aria-valuenow]="g.pct" aria-valuemin="0" aria-valuemax="100" [attr.aria-label]="t().kpiGoal">
|
|
140
|
+
<span [style.width.%]="Math.min(100, g.pct)"></span>
|
|
141
|
+
</div>
|
|
142
|
+
<span class="cb-kpi__goal-text">{{ fmt(t().kpiOfGoal, g.pct, format(target())) }}</span>
|
|
143
|
+
</div>
|
|
144
|
+
}
|
|
145
|
+
`, isInline: true, styles: [":host{display:grid;gap:.35rem;min-width:0;padding:1rem 1.1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);background:var(--cb-color-surface-raised, var(--cb-color-bg));color:var(--cb-color-text);font-family:var(--cb-font-sans)}.cb-kpi__head{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.cb-kpi__label{color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500)}.cb-kpi__delta{display:inline-flex;align-items:center;gap:.2rem;padding:.1rem .45rem;border-radius:999px;background:var(--cb-color-surface-subtle);color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);font-variant-numeric:tabular-nums;font-weight:var(--cb-font-weight-semibold, 600);white-space:nowrap}.cb-kpi__delta--good{background:color-mix(in srgb,var(--cb-color-success-500, #10b981) 14%,transparent);color:var(--cb-color-success-text, #047857)}.cb-kpi__delta--bad{background:color-mix(in srgb,var(--cb-color-danger-500, #ef4444) 12%,transparent);color:var(--cb-color-danger-text, #b91c1c)}.cb-kpi__value{overflow:hidden;font-size:var(--cb-text-2xl, 1.5rem);font-variant-numeric:tabular-nums;font-weight:var(--cb-font-weight-bold, 700);letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.cb-kpi__compare{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);font-variant-numeric:tabular-nums}.cb-kpi__spark{width:100%;height:2.25rem;margin-top:.25rem;overflow:visible}.cb-kpi__line{fill:none;stroke:var(--cb-color-primary-500);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}.cb-kpi__area{fill:color-mix(in srgb,var(--cb-color-primary-500) 14%,transparent)}.cb-kpi__goal{display:grid;gap:.25rem;margin-top:.25rem}.cb-kpi__bar{height:.4rem;overflow:hidden;border-radius:999px;background:var(--cb-color-surface-subtle)}.cb-kpi__bar span{display:block;height:100%;border-radius:inherit;background:var(--cb-color-primary-500)}.cb-kpi__goal-text{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem)}.cb-kpi__sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}\n"], dependencies: [{ kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
146
|
+
}
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbKpi, decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{ selector: 'cb-kpi', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbIcon], host: { class: 'cb-kpi', role: 'group', '[attr.aria-labelledby]': 'uid + "-label"' }, template: `
|
|
150
|
+
<div class="cb-kpi__head">
|
|
151
|
+
<span class="cb-kpi__label" [id]="uid + '-label'">{{ label() }}</span>
|
|
152
|
+
@if (delta(); as d) {
|
|
153
|
+
<span class="cb-kpi__delta" [class.cb-kpi__delta--good]="d.good === true" [class.cb-kpi__delta--bad]="d.good === false">
|
|
154
|
+
<cb-icon [name]="d.change > 0 ? 'trending-up' : d.change < 0 ? 'trending-down' : 'minus'" [size]="14" aria-hidden="true" />
|
|
155
|
+
<span aria-hidden="true">{{ d.text }}</span>
|
|
156
|
+
<span class="cb-kpi__sr">{{ d.spoken }}</span>
|
|
157
|
+
</span>
|
|
158
|
+
}
|
|
159
|
+
</div>
|
|
160
|
+
<div class="cb-kpi__value">{{ format(value()) }}</div>
|
|
161
|
+
@if (previous() !== null) {
|
|
162
|
+
<div class="cb-kpi__compare">{{ compareLabel() || t().kpiPrevious }}: {{ format(previous()) }}</div>
|
|
163
|
+
}
|
|
164
|
+
@if (points(); as p) {
|
|
165
|
+
<svg class="cb-kpi__spark" viewBox="0 0 100 32" preserveAspectRatio="none" role="img" [attr.aria-label]="sparkLabel()">
|
|
166
|
+
<path class="cb-kpi__area" [attr.d]="p.area" />
|
|
167
|
+
<path class="cb-kpi__line" [attr.d]="p.line" vector-effect="non-scaling-stroke" />
|
|
168
|
+
</svg>
|
|
169
|
+
}
|
|
170
|
+
@if (progress(); as g) {
|
|
171
|
+
<div class="cb-kpi__goal">
|
|
172
|
+
<div class="cb-kpi__bar" role="progressbar" [attr.aria-valuenow]="g.pct" aria-valuemin="0" aria-valuemax="100" [attr.aria-label]="t().kpiGoal">
|
|
173
|
+
<span [style.width.%]="Math.min(100, g.pct)"></span>
|
|
174
|
+
</div>
|
|
175
|
+
<span class="cb-kpi__goal-text">{{ fmt(t().kpiOfGoal, g.pct, format(target())) }}</span>
|
|
176
|
+
</div>
|
|
177
|
+
}
|
|
178
|
+
`, styles: [":host{display:grid;gap:.35rem;min-width:0;padding:1rem 1.1rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);background:var(--cb-color-surface-raised, var(--cb-color-bg));color:var(--cb-color-text);font-family:var(--cb-font-sans)}.cb-kpi__head{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.cb-kpi__label{color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500)}.cb-kpi__delta{display:inline-flex;align-items:center;gap:.2rem;padding:.1rem .45rem;border-radius:999px;background:var(--cb-color-surface-subtle);color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);font-variant-numeric:tabular-nums;font-weight:var(--cb-font-weight-semibold, 600);white-space:nowrap}.cb-kpi__delta--good{background:color-mix(in srgb,var(--cb-color-success-500, #10b981) 14%,transparent);color:var(--cb-color-success-text, #047857)}.cb-kpi__delta--bad{background:color-mix(in srgb,var(--cb-color-danger-500, #ef4444) 12%,transparent);color:var(--cb-color-danger-text, #b91c1c)}.cb-kpi__value{overflow:hidden;font-size:var(--cb-text-2xl, 1.5rem);font-variant-numeric:tabular-nums;font-weight:var(--cb-font-weight-bold, 700);letter-spacing:-.01em;text-overflow:ellipsis;white-space:nowrap}.cb-kpi__compare{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);font-variant-numeric:tabular-nums}.cb-kpi__spark{width:100%;height:2.25rem;margin-top:.25rem;overflow:visible}.cb-kpi__line{fill:none;stroke:var(--cb-color-primary-500);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}.cb-kpi__area{fill:color-mix(in srgb,var(--cb-color-primary-500) 14%,transparent)}.cb-kpi__goal{display:grid;gap:.25rem;margin-top:.25rem}.cb-kpi__bar{height:.4rem;overflow:hidden;border-radius:999px;background:var(--cb-color-surface-subtle)}.cb-kpi__bar span{display:block;height:100%;border-radius:inherit;background:var(--cb-color-primary-500)}.cb-kpi__goal-text{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem)}.cb-kpi__sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}\n"] }]
|
|
179
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], previous: [{ type: i0.Input, args: [{ isSignal: true, alias: "previous", required: false }] }], compareLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "compareLabel", required: false }] }], better: [{ type: i0.Input, args: [{ isSignal: true, alias: "better", required: false }] }], format_: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], decimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "decimals", required: false }] }], series: [{ type: i0.Input, args: [{ isSignal: true, alias: "series", required: false }] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }] } });
|
|
180
|
+
|
|
181
|
+
/*
|
|
182
|
+
* Public API Surface de @caribeng/ui/kpi
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Generated bundle index. Do not edit.
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
export { CbKpi };
|
|
@@ -3,7 +3,7 @@ import { input, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@a
|
|
|
3
3
|
import { injectCbTranslation } from '@caribeng/ui';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Enlace
|
|
6
|
+
* Enlace. Renderiza un ancla accesible con estilos de marca,
|
|
7
7
|
* soporte de enlaces externos y estado deshabilitado.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
@@ -30,45 +30,45 @@ class CbLink {
|
|
|
30
30
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
31
31
|
}
|
|
32
32
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbLink, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
33
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbLink, isStandalone: true, selector: "cb-link", inputs: { href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, external: { classPropertyName: "external", publicName: "external", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cb-link-host" }, ngImport: i0, template: `
|
|
34
|
-
<a
|
|
35
|
-
class="cb-link"
|
|
36
|
-
[class.cb-is-disabled]="disabled()"
|
|
37
|
-
[attr.href]="disabled() ? null : href()"
|
|
38
|
-
[attr.target]="external() ? '_blank' : null"
|
|
39
|
-
[attr.rel]="external() ? 'noopener noreferrer' : null"
|
|
40
|
-
[attr.tabindex]="disabled() ? -1 : 0"
|
|
41
|
-
[attr.aria-disabled]="disabled() || null"
|
|
42
|
-
role="link"
|
|
43
|
-
>
|
|
44
|
-
<span class="cb-link__label">{{ label() }}<ng-content /></span>
|
|
45
|
-
@if (external()) {
|
|
46
|
-
<span class="cb-link__external" aria-hidden="true">↗</span>
|
|
47
|
-
<span class="cb-link__sr">{{ t().opensInNewTab }}</span>
|
|
48
|
-
}
|
|
49
|
-
</a>
|
|
50
|
-
`, isInline: true, styles: [":host{display:inline-flex;align-items:center}.cb-link{display:inline-flex;align-items:center;gap:var(--cb-space-1, .25rem);font-family:var(--cb-font-sans, inherit);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500);line-height:var(--cb-line-height-normal, 1.5);color:var(--cb-color-primary-
|
|
33
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbLink, isStandalone: true, selector: "cb-link", inputs: { href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, external: { classPropertyName: "external", publicName: "external", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cb-link-host" }, ngImport: i0, template: `
|
|
34
|
+
<a
|
|
35
|
+
class="cb-link"
|
|
36
|
+
[class.cb-is-disabled]="disabled()"
|
|
37
|
+
[attr.href]="disabled() ? null : href()"
|
|
38
|
+
[attr.target]="external() ? '_blank' : null"
|
|
39
|
+
[attr.rel]="external() ? 'noopener noreferrer' : null"
|
|
40
|
+
[attr.tabindex]="disabled() ? -1 : 0"
|
|
41
|
+
[attr.aria-disabled]="disabled() || null"
|
|
42
|
+
role="link"
|
|
43
|
+
>
|
|
44
|
+
<span class="cb-link__label">{{ label() }}<ng-content /></span>
|
|
45
|
+
@if (external()) {
|
|
46
|
+
<span class="cb-link__external" aria-hidden="true">↗</span>
|
|
47
|
+
<span class="cb-link__sr">{{ t().opensInNewTab }}</span>
|
|
48
|
+
}
|
|
49
|
+
</a>
|
|
50
|
+
`, isInline: true, styles: [":host{display:inline-flex;align-items:center}.cb-link{display:inline-flex;align-items:center;gap:var(--cb-space-1, .25rem);font-family:var(--cb-font-sans, inherit);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500);line-height:var(--cb-line-height-normal, 1.5);color:var(--cb-color-primary-text);text-decoration:none;cursor:pointer;border-radius:var(--cb-radius-sm, .25rem);transition:color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-link__label{text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}.cb-link:hover{color:var(--cb-color-primary-700, #065f46)}.cb-link:active{color:var(--cb-color-primary-800, #064e3b)}.cb-link:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500, #10b981));outline-offset:2px}.cb-link__external{font-size:.85em;line-height:1}.cb-link.cb-is-disabled{color:var(--cb-color-text-muted, #94a3b8);pointer-events:none;cursor:not-allowed}:host-context([data-theme=\"dark\"]) .cb-link{color:var(--cb-color-primary-400, #34d399)}:host-context([data-theme=\"dark\"]) .cb-link:hover{color:var(--cb-color-primary-300, #6ee7b7)}.cb-link__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
51
51
|
}
|
|
52
52
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbLink, decorators: [{
|
|
53
53
|
type: Component,
|
|
54
|
-
args: [{ selector: 'cb-link', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: { class: 'cb-link-host' }, template: `
|
|
55
|
-
<a
|
|
56
|
-
class="cb-link"
|
|
57
|
-
[class.cb-is-disabled]="disabled()"
|
|
58
|
-
[attr.href]="disabled() ? null : href()"
|
|
59
|
-
[attr.target]="external() ? '_blank' : null"
|
|
60
|
-
[attr.rel]="external() ? 'noopener noreferrer' : null"
|
|
61
|
-
[attr.tabindex]="disabled() ? -1 : 0"
|
|
62
|
-
[attr.aria-disabled]="disabled() || null"
|
|
63
|
-
role="link"
|
|
64
|
-
>
|
|
65
|
-
<span class="cb-link__label">{{ label() }}<ng-content /></span>
|
|
66
|
-
@if (external()) {
|
|
67
|
-
<span class="cb-link__external" aria-hidden="true">↗</span>
|
|
68
|
-
<span class="cb-link__sr">{{ t().opensInNewTab }}</span>
|
|
69
|
-
}
|
|
70
|
-
</a>
|
|
71
|
-
`, styles: [":host{display:inline-flex;align-items:center}.cb-link{display:inline-flex;align-items:center;gap:var(--cb-space-1, .25rem);font-family:var(--cb-font-sans, inherit);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500);line-height:var(--cb-line-height-normal, 1.5);color:var(--cb-color-primary-
|
|
54
|
+
args: [{ selector: 'cb-link', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, host: { class: 'cb-link-host' }, template: `
|
|
55
|
+
<a
|
|
56
|
+
class="cb-link"
|
|
57
|
+
[class.cb-is-disabled]="disabled()"
|
|
58
|
+
[attr.href]="disabled() ? null : href()"
|
|
59
|
+
[attr.target]="external() ? '_blank' : null"
|
|
60
|
+
[attr.rel]="external() ? 'noopener noreferrer' : null"
|
|
61
|
+
[attr.tabindex]="disabled() ? -1 : 0"
|
|
62
|
+
[attr.aria-disabled]="disabled() || null"
|
|
63
|
+
role="link"
|
|
64
|
+
>
|
|
65
|
+
<span class="cb-link__label">{{ label() }}<ng-content /></span>
|
|
66
|
+
@if (external()) {
|
|
67
|
+
<span class="cb-link__external" aria-hidden="true">↗</span>
|
|
68
|
+
<span class="cb-link__sr">{{ t().opensInNewTab }}</span>
|
|
69
|
+
}
|
|
70
|
+
</a>
|
|
71
|
+
`, styles: [":host{display:inline-flex;align-items:center}.cb-link{display:inline-flex;align-items:center;gap:var(--cb-space-1, .25rem);font-family:var(--cb-font-sans, inherit);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500);line-height:var(--cb-line-height-normal, 1.5);color:var(--cb-color-primary-text);text-decoration:none;cursor:pointer;border-radius:var(--cb-radius-sm, .25rem);transition:color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-link__label{text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}.cb-link:hover{color:var(--cb-color-primary-700, #065f46)}.cb-link:active{color:var(--cb-color-primary-800, #064e3b)}.cb-link:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500, #10b981));outline-offset:2px}.cb-link__external{font-size:.85em;line-height:1}.cb-link.cb-is-disabled{color:var(--cb-color-text-muted, #94a3b8);pointer-events:none;cursor:not-allowed}:host-context([data-theme=\"dark\"]) .cb-link{color:var(--cb-color-primary-400, #34d399)}:host-context([data-theme=\"dark\"]) .cb-link:hover{color:var(--cb-color-primary-300, #6ee7b7)}.cb-link__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}\n"] }]
|
|
72
72
|
}], propDecorators: { href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], external: [{ type: i0.Input, args: [{ isSignal: true, alias: "external", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
73
73
|
|
|
74
74
|
/**
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, input, numberAttribute, DestroyRef, afterNextRender, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** Alto de cada fila de la rejilla (px): cuanto menor, más exacto el ajuste de alturas. */
|
|
5
|
+
const ROW = 4;
|
|
6
|
+
/** Filas que ocupa un elemento de `height` px con un hueco de `gap` px debajo. */
|
|
7
|
+
function masonrySpan(height, gap, row = ROW) {
|
|
8
|
+
return Math.max(1, Math.ceil((height + gap) / row));
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Masonry de CaribeNG: reparte los elementos proyectados en columnas de alturas distintas, sin
|
|
12
|
+
* huecos, como un tablero de Pinterest. Usa CSS Grid y mide la altura de cada elemento (también
|
|
13
|
+
* si cambia, p. ej. al cargar una imagen), así que el orden del DOM —el que siguen el teclado y
|
|
14
|
+
* los lectores de pantalla— es el orden visual por filas, a diferencia de las columnas de CSS.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```html
|
|
18
|
+
* <cb-masonry minColumnWidth="14rem" gap="12px" role="list">
|
|
19
|
+
* @for (foto of fotos(); track foto.id) { <figure role="listitem">…</figure> }
|
|
20
|
+
* </cb-masonry>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
class CbMasonry {
|
|
24
|
+
constructor() {
|
|
25
|
+
this.host = inject(ElementRef);
|
|
26
|
+
/** Número fijo de columnas (0 = las que quepan con `minColumnWidth`). */
|
|
27
|
+
this.columns = input(0, { ...(ngDevMode ? { debugName: "columns" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
28
|
+
/** Ancho mínimo de columna cuando `columns` es 0. */
|
|
29
|
+
this.minColumnWidth = input('16rem', /* @ts-ignore */
|
|
30
|
+
...(ngDevMode ? [{ debugName: "minColumnWidth" }] : /* istanbul ignore next */ []));
|
|
31
|
+
/** Separación entre elementos (cualquier longitud CSS). */
|
|
32
|
+
this.gap = input('16px', /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
34
|
+
const destroyRef = inject(DestroyRef);
|
|
35
|
+
afterNextRender(() => {
|
|
36
|
+
const host = this.host.nativeElement;
|
|
37
|
+
const layout = () => {
|
|
38
|
+
const gap = parseFloat(getComputedStyle(host).columnGap) || 0;
|
|
39
|
+
for (const child of Array.from(host.children)) {
|
|
40
|
+
const span = `span ${masonrySpan(child.getBoundingClientRect().height, gap)}`;
|
|
41
|
+
if (child.style.gridRowEnd !== span)
|
|
42
|
+
child.style.gridRowEnd = span;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
let frame = 0;
|
|
46
|
+
const schedule = () => {
|
|
47
|
+
cancelAnimationFrame(frame);
|
|
48
|
+
frame = requestAnimationFrame(layout);
|
|
49
|
+
};
|
|
50
|
+
layout();
|
|
51
|
+
if (typeof ResizeObserver === 'undefined')
|
|
52
|
+
return;
|
|
53
|
+
// Cambia el alto de un elemento (imágenes que cargan, texto que se adapta) o el ancho de las
|
|
54
|
+
// columnas (también al cambiar `gap`, `columns` o `minColumnWidth`).
|
|
55
|
+
const resize = new ResizeObserver(schedule);
|
|
56
|
+
resize.observe(host);
|
|
57
|
+
const watch = (el) => resize.observe(el);
|
|
58
|
+
Array.from(host.children).forEach(watch);
|
|
59
|
+
// Elementos que llegan o se van (p. ej. con scroll infinito).
|
|
60
|
+
const mutations = new MutationObserver((records) => {
|
|
61
|
+
for (const r of records)
|
|
62
|
+
r.addedNodes.forEach((n) => n instanceof Element && watch(n));
|
|
63
|
+
schedule();
|
|
64
|
+
});
|
|
65
|
+
mutations.observe(host, { childList: true });
|
|
66
|
+
destroyRef.onDestroy(() => {
|
|
67
|
+
cancelAnimationFrame(frame);
|
|
68
|
+
resize.disconnect();
|
|
69
|
+
mutations.disconnect();
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbMasonry, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
74
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbMasonry, isStandalone: true, selector: "cb-masonry", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, minColumnWidth: { classPropertyName: "minColumnWidth", publicName: "minColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--cb-masonry-gap": "gap()", "style.--cb-masonry-columns": "columns() > 0 ? \"repeat(\" + columns() + \", minmax(0, 1fr))\" : \"repeat(auto-fill, minmax(min(\" + minColumnWidth() + \", 100%), 1fr))\"" }, classAttribute: "cb-masonry" }, ngImport: i0, template: `<ng-content />`, isInline: true, styles: [".cb-masonry{display:grid;grid-template-columns:var(--cb-masonry-columns);grid-auto-rows:4px;column-gap:var(--cb-masonry-gap);grid-auto-flow:row;align-items:start;margin:0;padding:0;list-style:none}.cb-masonry>*{align-self:start;min-width:0;margin:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
75
|
+
}
|
|
76
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbMasonry, decorators: [{
|
|
77
|
+
type: Component,
|
|
78
|
+
args: [{ selector: 'cb-masonry', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
79
|
+
class: 'cb-masonry',
|
|
80
|
+
'[style.--cb-masonry-gap]': 'gap()',
|
|
81
|
+
'[style.--cb-masonry-columns]': 'columns() > 0 ? "repeat(" + columns() + ", minmax(0, 1fr))" : "repeat(auto-fill, minmax(min(" + minColumnWidth() + ", 100%), 1fr))"',
|
|
82
|
+
}, template: `<ng-content />`, styles: [".cb-masonry{display:grid;grid-template-columns:var(--cb-masonry-columns);grid-auto-rows:4px;column-gap:var(--cb-masonry-gap);grid-auto-flow:row;align-items:start;margin:0;padding:0;list-style:none}.cb-masonry>*{align-self:start;min-width:0;margin:0}\n"] }]
|
|
83
|
+
}], ctorParameters: () => [], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], minColumnWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minColumnWidth", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }] } });
|
|
84
|
+
|
|
85
|
+
/*
|
|
86
|
+
* Public API Surface de @caribeng/ui/masonry
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Generated bundle index. Do not edit.
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
export { CbMasonry, masonrySpan as cbMasonrySpan };
|