@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
|
@@ -4,7 +4,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
4
4
|
import { injectCbTranslation, cbFormat, cbFieldState } from '@caribeng/ui';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Input-token
|
|
7
|
+
* Input-token: entrada de código OTP con casillas por dígito,
|
|
8
8
|
* enmascarado opcional y CVA.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
@@ -112,35 +112,35 @@ class CbInputToken {
|
|
|
112
112
|
useExisting: forwardRef(() => CbInputToken),
|
|
113
113
|
multi: true,
|
|
114
114
|
},
|
|
115
|
-
], ngImport: i0, template: `
|
|
116
|
-
<div class="cb-input-token">
|
|
117
|
-
<div
|
|
118
|
-
class="cb-input-token__slots"
|
|
119
|
-
role="group"
|
|
120
|
-
[attr.aria-label]="t().verificationCode"
|
|
121
|
-
>
|
|
122
|
-
@for (slot of slots(); track slot) {
|
|
123
|
-
<input
|
|
124
|
-
class="cb-input-token__slot"
|
|
125
|
-
[class.cb-is-invalid]="fieldState.invalid()"
|
|
126
|
-
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
127
|
-
[type]="unmasked() ? 'text' : 'password'"
|
|
128
|
-
maxlength="1"
|
|
129
|
-
inputmode="numeric"
|
|
130
|
-
[value]="charAt(slot)"
|
|
131
|
-
[disabled]="disabled() || cvaDisabled()"
|
|
132
|
-
[attr.aria-label]="fmt(t().digit, slot + 1)"
|
|
133
|
-
(input)="onDigitInput($event, slot)"
|
|
134
|
-
(keydown)="onKeydown($event, slot)"
|
|
135
|
-
(paste)="onPaste($event)"
|
|
136
|
-
(blur)="onTouched()"
|
|
137
|
-
/>
|
|
138
|
-
}
|
|
139
|
-
</div>
|
|
140
|
-
@if (helpText()) {
|
|
141
|
-
<span class="cb-input-token__help">{{ helpText() }}</span>
|
|
142
|
-
}
|
|
143
|
-
</div>
|
|
115
|
+
], ngImport: i0, template: `
|
|
116
|
+
<div class="cb-input-token">
|
|
117
|
+
<div
|
|
118
|
+
class="cb-input-token__slots"
|
|
119
|
+
role="group"
|
|
120
|
+
[attr.aria-label]="t().verificationCode"
|
|
121
|
+
>
|
|
122
|
+
@for (slot of slots(); track slot) {
|
|
123
|
+
<input
|
|
124
|
+
class="cb-input-token__slot"
|
|
125
|
+
[class.cb-is-invalid]="fieldState.invalid()"
|
|
126
|
+
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
127
|
+
[type]="unmasked() ? 'text' : 'password'"
|
|
128
|
+
maxlength="1"
|
|
129
|
+
inputmode="numeric"
|
|
130
|
+
[value]="charAt(slot)"
|
|
131
|
+
[disabled]="disabled() || cvaDisabled()"
|
|
132
|
+
[attr.aria-label]="fmt(t().digit, slot + 1)"
|
|
133
|
+
(input)="onDigitInput($event, slot)"
|
|
134
|
+
(keydown)="onKeydown($event, slot)"
|
|
135
|
+
(paste)="onPaste($event)"
|
|
136
|
+
(blur)="onTouched()"
|
|
137
|
+
/>
|
|
138
|
+
}
|
|
139
|
+
</div>
|
|
140
|
+
@if (helpText()) {
|
|
141
|
+
<span class="cb-input-token__help">{{ helpText() }}</span>
|
|
142
|
+
}
|
|
143
|
+
</div>
|
|
144
144
|
`, isInline: true, styles: [":host{display:inline-block}.cb-input-token{display:inline-flex;flex-direction:column;gap:var(--cb-space-2, .4rem);font-family:var(--cb-font-sans, inherit)}.cb-input-token__slots{display:inline-flex;gap:var(--cb-space-2, .45rem)}.cb-input-token__slot{width:2.5rem;height:3rem;text-align:center;font:inherit;font-size:var(--cb-text-lg, 1.1rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong, #0f172a);background-color:var(--cb-color-surface-0, #ffffff);border:1px solid var(--cb-color-border, #cbd5e1);border-radius:var(--cb-radius-md, .5rem);transition:border-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-input-token__slot:focus-visible{outline:none;border-color:var(--cb-color-primary-500, #10b981);box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-primary-500, #10b981) 20%,transparent)}.cb-input-token__slot:disabled{opacity:.6;background-color:var(--cb-color-surface-100, #f1f5f9)}.cb-input-token__help{font-size:var(--cb-text-xs, .75rem);color:var(--cb-color-text-muted, #64748b)}:host-context([data-theme=\"dark\"]) .cb-input-token__slot{color:var(--cb-color-surface-0, #f8fafc);background-color:var(--cb-color-surface-900, #0f172a);border-color:var(--cb-color-surface-600, #475569)}.cb-input-token__slot.cb-is-invalid{border-color:var(--cb-color-danger)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
145
145
|
}
|
|
146
146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbInputToken, decorators: [{
|
|
@@ -151,35 +151,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
151
151
|
useExisting: forwardRef(() => CbInputToken),
|
|
152
152
|
multi: true,
|
|
153
153
|
},
|
|
154
|
-
], host: { class: 'cb-input-token-host' }, template: `
|
|
155
|
-
<div class="cb-input-token">
|
|
156
|
-
<div
|
|
157
|
-
class="cb-input-token__slots"
|
|
158
|
-
role="group"
|
|
159
|
-
[attr.aria-label]="t().verificationCode"
|
|
160
|
-
>
|
|
161
|
-
@for (slot of slots(); track slot) {
|
|
162
|
-
<input
|
|
163
|
-
class="cb-input-token__slot"
|
|
164
|
-
[class.cb-is-invalid]="fieldState.invalid()"
|
|
165
|
-
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
166
|
-
[type]="unmasked() ? 'text' : 'password'"
|
|
167
|
-
maxlength="1"
|
|
168
|
-
inputmode="numeric"
|
|
169
|
-
[value]="charAt(slot)"
|
|
170
|
-
[disabled]="disabled() || cvaDisabled()"
|
|
171
|
-
[attr.aria-label]="fmt(t().digit, slot + 1)"
|
|
172
|
-
(input)="onDigitInput($event, slot)"
|
|
173
|
-
(keydown)="onKeydown($event, slot)"
|
|
174
|
-
(paste)="onPaste($event)"
|
|
175
|
-
(blur)="onTouched()"
|
|
176
|
-
/>
|
|
177
|
-
}
|
|
178
|
-
</div>
|
|
179
|
-
@if (helpText()) {
|
|
180
|
-
<span class="cb-input-token__help">{{ helpText() }}</span>
|
|
181
|
-
}
|
|
182
|
-
</div>
|
|
154
|
+
], host: { class: 'cb-input-token-host' }, template: `
|
|
155
|
+
<div class="cb-input-token">
|
|
156
|
+
<div
|
|
157
|
+
class="cb-input-token__slots"
|
|
158
|
+
role="group"
|
|
159
|
+
[attr.aria-label]="t().verificationCode"
|
|
160
|
+
>
|
|
161
|
+
@for (slot of slots(); track slot) {
|
|
162
|
+
<input
|
|
163
|
+
class="cb-input-token__slot"
|
|
164
|
+
[class.cb-is-invalid]="fieldState.invalid()"
|
|
165
|
+
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
166
|
+
[type]="unmasked() ? 'text' : 'password'"
|
|
167
|
+
maxlength="1"
|
|
168
|
+
inputmode="numeric"
|
|
169
|
+
[value]="charAt(slot)"
|
|
170
|
+
[disabled]="disabled() || cvaDisabled()"
|
|
171
|
+
[attr.aria-label]="fmt(t().digit, slot + 1)"
|
|
172
|
+
(input)="onDigitInput($event, slot)"
|
|
173
|
+
(keydown)="onKeydown($event, slot)"
|
|
174
|
+
(paste)="onPaste($event)"
|
|
175
|
+
(blur)="onTouched()"
|
|
176
|
+
/>
|
|
177
|
+
}
|
|
178
|
+
</div>
|
|
179
|
+
@if (helpText()) {
|
|
180
|
+
<span class="cb-input-token__help">{{ helpText() }}</span>
|
|
181
|
+
}
|
|
182
|
+
</div>
|
|
183
183
|
`, styles: [":host{display:inline-block}.cb-input-token{display:inline-flex;flex-direction:column;gap:var(--cb-space-2, .4rem);font-family:var(--cb-font-sans, inherit)}.cb-input-token__slots{display:inline-flex;gap:var(--cb-space-2, .45rem)}.cb-input-token__slot{width:2.5rem;height:3rem;text-align:center;font:inherit;font-size:var(--cb-text-lg, 1.1rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong, #0f172a);background-color:var(--cb-color-surface-0, #ffffff);border:1px solid var(--cb-color-border, #cbd5e1);border-radius:var(--cb-radius-md, .5rem);transition:border-color var(--cb-duration-fast, .12s) var(--cb-ease, ease)}.cb-input-token__slot:focus-visible{outline:none;border-color:var(--cb-color-primary-500, #10b981);box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-primary-500, #10b981) 20%,transparent)}.cb-input-token__slot:disabled{opacity:.6;background-color:var(--cb-color-surface-100, #f1f5f9)}.cb-input-token__help{font-size:var(--cb-text-xs, .75rem);color:var(--cb-color-text-muted, #64748b)}:host-context([data-theme=\"dark\"]) .cb-input-token__slot{color:var(--cb-color-surface-0, #f8fafc);background-color:var(--cb-color-surface-900, #0f172a);border-color:var(--cb-color-surface-600, #475569)}.cb-input-token__slot.cb-is-invalid{border-color:var(--cb-color-danger)}\n"] }]
|
|
184
184
|
}], propDecorators: { numInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "numInputs", required: false }] }], unmasked: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmasked", required: false }] }], helpText: [{ type: i0.Input, args: [{ isSignal: true, alias: "helpText", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
185
185
|
|
|
@@ -3,6 +3,7 @@ import { input, booleanAttribute, model, signal, computed, forwardRef, ViewEncap
|
|
|
3
3
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
4
4
|
import { cbFieldState } from '@caribeng/ui';
|
|
5
5
|
|
|
6
|
+
let nextUid = 0;
|
|
6
7
|
/**
|
|
7
8
|
* InputMask de CaribeNG: campo de texto con máscara de formato (`9` = dígito,
|
|
8
9
|
* `a` = letra, `*` = alfanumérico) e integración con Angular Forms (CVA).
|
|
@@ -25,6 +26,9 @@ class CbInputMask {
|
|
|
25
26
|
this.fieldState = cbFieldState({ invalid: () => this.invalid() });
|
|
26
27
|
this.ariaLabel = input('', /* @ts-ignore */
|
|
27
28
|
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
29
|
+
/** `id` del campo, para asociarlo a un `<label for>`. */
|
|
30
|
+
this.inputId = input(`cb-input-mask-${++nextUid}`, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []));
|
|
28
32
|
this.value = model('', /* @ts-ignore */
|
|
29
33
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
30
34
|
this.cvaDisabled = signal(false, /* @ts-ignore */
|
|
@@ -107,7 +111,7 @@ class CbInputMask {
|
|
|
107
111
|
return /^[a-zA-Z0-9]$/.test(ch);
|
|
108
112
|
}
|
|
109
113
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbInputMask, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
110
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbInputMask, isStandalone: true, selector: "cb-input-mask", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, unmask: { classPropertyName: "unmask", publicName: "unmask", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.cb-is-disabled": "isDisabled()" }, classAttribute: "cb-input-mask" }, providers: [
|
|
114
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: CbInputMask, isStandalone: true, selector: "cb-input-mask", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, unmask: { classPropertyName: "unmask", publicName: "unmask", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class.cb-is-disabled": "isDisabled()" }, classAttribute: "cb-input-mask" }, providers: [
|
|
111
115
|
{
|
|
112
116
|
provide: NG_VALUE_ACCESSOR,
|
|
113
117
|
useExisting: forwardRef(() => CbInputMask),
|
|
@@ -117,6 +121,7 @@ class CbInputMask {
|
|
|
117
121
|
<input
|
|
118
122
|
type="text"
|
|
119
123
|
class="cb-input-mask__field"
|
|
124
|
+
[id]="inputId()"
|
|
120
125
|
[class.cb-is-invalid]="fieldState.invalid()"
|
|
121
126
|
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
122
127
|
[attr.aria-required]="fieldState.required() || null"
|
|
@@ -144,6 +149,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
144
149
|
<input
|
|
145
150
|
type="text"
|
|
146
151
|
class="cb-input-mask__field"
|
|
152
|
+
[id]="inputId()"
|
|
147
153
|
[class.cb-is-invalid]="fieldState.invalid()"
|
|
148
154
|
[attr.aria-invalid]="fieldState.invalid() ? 'true' : null"
|
|
149
155
|
[attr.aria-required]="fieldState.required() || null"
|
|
@@ -155,7 +161,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
155
161
|
(blur)="onBlur()"
|
|
156
162
|
/>
|
|
157
163
|
`, styles: [":host{display:inline-block;width:100%;font-family:var(--cb-font-sans)}.cb-input-mask__field{width:100%;box-sizing:border-box;padding:var(--cb-space-2) var(--cb-space-3);border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface);color:var(--cb-color-text);font-family:inherit;font-size:var(--cb-text-sm);line-height:1.5;transition:border-color .12s ease,box-shadow .12s ease}.cb-input-mask__field:focus{outline:none;border-color:var(--cb-color-primary-500);box-shadow:0 0 0 2px color-mix(in srgb,var(--cb-color-primary-500) 20%,transparent)}.cb-input-mask__field:disabled{opacity:.6;cursor:not-allowed}.cb-input-mask__field.cb-is-invalid{border-color:var(--cb-color-danger)}.cb-input-mask__field.cb-is-invalid:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-danger) 25%,transparent)}\n"] }]
|
|
158
|
-
}], propDecorators: { mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], unmask: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmask", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
164
|
+
}], propDecorators: { mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], unmask: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmask", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
159
165
|
|
|
160
166
|
/**
|
|
161
167
|
* Generated bundle index. Do not edit.
|
|
@@ -126,7 +126,7 @@ class CbInputOtp {
|
|
|
126
126
|
(blur)="onBlur()"
|
|
127
127
|
/>
|
|
128
128
|
}
|
|
129
|
-
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;gap:var(--cb-space-2);font-family:var(--cb-font-sans)}.cb-input-otp__slot{width:2.5rem;height:2.75rem;text-align:center;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface);color:var(--cb-color-text);font-family:inherit;font-size:var(--cb-text-base);font-weight:var(--cb-font-semibold);transition:border-color .12s ease,box-shadow .12s ease}.cb-input-otp__slot:focus{outline:none;border-color:var(--cb-color-primary-500);box-shadow:0 0 0 2px color-mix(in srgb,var(--cb-color-primary-500) 20%,transparent)}.cb-input-otp__slot.cb-is-invalid{border-color:var(--cb-color-danger)}.cb-input-otp__slot.cb-is-invalid:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-danger) 25%,transparent)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
129
|
+
`, isInline: true, styles: [":host{display:inline-flex;align-items:center;gap:var(--cb-space-2);max-width:100%;font-family:var(--cb-font-sans)}.cb-input-otp__slot{flex:0 1 2.5rem;box-sizing:border-box;width:2.5rem;min-width:2rem;height:2.75rem;text-align:center;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface);color:var(--cb-color-text);font-family:inherit;font-size:var(--cb-text-base);font-weight:var(--cb-font-semibold);transition:border-color .12s ease,box-shadow .12s ease}.cb-input-otp__slot:focus{outline:none;border-color:var(--cb-color-primary-500);box-shadow:0 0 0 2px color-mix(in srgb,var(--cb-color-primary-500) 20%,transparent)}.cb-input-otp__slot.cb-is-invalid{border-color:var(--cb-color-danger)}.cb-input-otp__slot.cb-is-invalid:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-danger) 25%,transparent)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
130
130
|
}
|
|
131
131
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbInputOtp, decorators: [{
|
|
132
132
|
type: Component,
|
|
@@ -158,7 +158,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
158
158
|
(blur)="onBlur()"
|
|
159
159
|
/>
|
|
160
160
|
}
|
|
161
|
-
`, styles: [":host{display:inline-flex;align-items:center;gap:var(--cb-space-2);font-family:var(--cb-font-sans)}.cb-input-otp__slot{width:2.5rem;height:2.75rem;text-align:center;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface);color:var(--cb-color-text);font-family:inherit;font-size:var(--cb-text-base);font-weight:var(--cb-font-semibold);transition:border-color .12s ease,box-shadow .12s ease}.cb-input-otp__slot:focus{outline:none;border-color:var(--cb-color-primary-500);box-shadow:0 0 0 2px color-mix(in srgb,var(--cb-color-primary-500) 20%,transparent)}.cb-input-otp__slot.cb-is-invalid{border-color:var(--cb-color-danger)}.cb-input-otp__slot.cb-is-invalid:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-danger) 25%,transparent)}\n"] }]
|
|
161
|
+
`, styles: [":host{display:inline-flex;align-items:center;gap:var(--cb-space-2);max-width:100%;font-family:var(--cb-font-sans)}.cb-input-otp__slot{flex:0 1 2.5rem;box-sizing:border-box;width:2.5rem;min-width:2rem;height:2.75rem;text-align:center;border:var(--cb-border-width) solid var(--cb-color-border);border-radius:var(--cb-radius-md);background:var(--cb-color-surface);color:var(--cb-color-text);font-family:inherit;font-size:var(--cb-text-base);font-weight:var(--cb-font-semibold);transition:border-color .12s ease,box-shadow .12s ease}.cb-input-otp__slot:focus{outline:none;border-color:var(--cb-color-primary-500);box-shadow:0 0 0 2px color-mix(in srgb,var(--cb-color-primary-500) 20%,transparent)}.cb-input-otp__slot.cb-is-invalid{border-color:var(--cb-color-danger)}.cb-input-otp__slot.cb-is-invalid:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--cb-color-danger) 25%,transparent)}\n"] }]
|
|
162
162
|
}], propDecorators: { length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], integerOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "integerOnly", required: false }] }], mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
163
163
|
|
|
164
164
|
/**
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { viewChild, model, input, booleanAttribute, output, signal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation, cbFormat, injectCbAmount, cbSummarize } from '@caribeng/ui';
|
|
4
|
+
import { cbAccountOptions } from '@caribeng/ui/account-picker';
|
|
5
|
+
import { CbButton } from '@caribeng/ui/button';
|
|
6
|
+
import { CbDataGrid } from '@caribeng/ui/datagrid';
|
|
7
|
+
import { CbDatepicker } from '@caribeng/ui/datepicker';
|
|
8
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
9
|
+
import { CbInput } from '@caribeng/ui/input';
|
|
10
|
+
import { CbSelect } from '@caribeng/ui/select';
|
|
11
|
+
|
|
12
|
+
let nextUid = 0;
|
|
13
|
+
let nextLine = 0;
|
|
14
|
+
/** Comprobante vacío con dos líneas. */
|
|
15
|
+
function cbEmptyJournalEntry(date = new Date()) {
|
|
16
|
+
const line = () => ({ id: `l${Date.now().toString(36)}${++nextLine}`, account: null, thirdParty: null, costCenter: null, description: null, debit: null, credit: null });
|
|
17
|
+
return { date, type: null, number: null, description: null, lines: [line(), line()] };
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Editor de comprobante contable de CaribeNG: cabecera (fecha, tipo, número y
|
|
21
|
+
* descripción) y líneas con cuenta, tercero, centro de costo, detalle, débito y
|
|
22
|
+
* crédito, editables como una hoja de cálculo.
|
|
23
|
+
*
|
|
24
|
+
* - La cuenta se busca por código o nombre en el plan de cuentas y solo admite
|
|
25
|
+
* cuentas de movimiento; escribir el débito borra el crédito de la línea y al revés.
|
|
26
|
+
* - Totales de débitos y créditos con la diferencia en vivo; «Cuadrar» pone la
|
|
27
|
+
* diferencia en la última línea vacía (o en una nueva).
|
|
28
|
+
* - Guardar (o Ctrl + Enter) valida fecha, líneas, cuentas y que cuadre, y emite `save`.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```html
|
|
32
|
+
* <cb-journal-entry [(entry)]="comprobante" [accounts]="puc" [thirdParties]="terceros" (save)="guardar($event)" />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
class CbJournalEntry {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.t = injectCbTranslation();
|
|
38
|
+
this.fmt = cbFormat;
|
|
39
|
+
this.amount = injectCbAmount();
|
|
40
|
+
this.uid = `cb-journal-entry-${++nextUid}`;
|
|
41
|
+
this.grid = viewChild.required(CbDataGrid);
|
|
42
|
+
/** Comprobante (bidireccional). */
|
|
43
|
+
this.entry = model(cbEmptyJournalEntry(), /* @ts-ignore */
|
|
44
|
+
...(ngDevMode ? [{ debugName: "entry" }] : /* istanbul ignore next */ []));
|
|
45
|
+
/** Plan de cuentas: solo se eligen cuentas de movimiento. */
|
|
46
|
+
this.accounts = input([], /* @ts-ignore */
|
|
47
|
+
...(ngDevMode ? [{ debugName: "accounts" }] : /* istanbul ignore next */ []));
|
|
48
|
+
/** Terceros (sin ellos no se muestra la columna). */
|
|
49
|
+
this.thirdParties = input([], /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "thirdParties" }] : /* istanbul ignore next */ []));
|
|
51
|
+
/** Centros de costo (sin ellos no se muestra la columna). */
|
|
52
|
+
this.costCenters = input([], /* @ts-ignore */
|
|
53
|
+
...(ngDevMode ? [{ debugName: "costCenters" }] : /* istanbul ignore next */ []));
|
|
54
|
+
/** Tipos de comprobante (sin ellos no se muestra el campo). */
|
|
55
|
+
this.types = input([], /* @ts-ignore */
|
|
56
|
+
...(ngDevMode ? [{ debugName: "types" }] : /* istanbul ignore next */ []));
|
|
57
|
+
/** Cuentas que exigen tercero (por prefijo de código, p. ej. `['13', '22']`). */
|
|
58
|
+
this.thirdPartyRequired = input([], /* @ts-ignore */
|
|
59
|
+
...(ngDevMode ? [{ debugName: "thirdPartyRequired" }] : /* istanbul ignore next */ []));
|
|
60
|
+
/** Moneda de los importes (si no, la de `provideCaribeNG({ currency })`). */
|
|
61
|
+
this.currency = input(undefined, /* @ts-ignore */
|
|
62
|
+
...(ngDevMode ? [{ debugName: "currency" }] : /* istanbul ignore next */ []));
|
|
63
|
+
this.readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
64
|
+
/** Muestra el botón de guardar cargando. */
|
|
65
|
+
this.saving = input(false, { ...(ngDevMode ? { debugName: "saving" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
66
|
+
this.saveLabel = input(undefined, /* @ts-ignore */
|
|
67
|
+
...(ngDevMode ? [{ debugName: "saveLabel" }] : /* istanbul ignore next */ []));
|
|
68
|
+
this.scrollHeight = input('22rem', /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "scrollHeight" }] : /* istanbul ignore next */ []));
|
|
70
|
+
this.ariaLabel = input(undefined, /* @ts-ignore */
|
|
71
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
72
|
+
/** Comprobante válido y cuadrado al guardar (líneas sin importe quitadas, detalles heredados). */
|
|
73
|
+
this.save = output();
|
|
74
|
+
/** Se intentó guardar con problemas: cuáles. */
|
|
75
|
+
this.invalid = output();
|
|
76
|
+
/** Se intentó guardar (desde entonces se muestran los problemas). */
|
|
77
|
+
this.tried = signal(false, /* @ts-ignore */
|
|
78
|
+
...(ngDevMode ? [{ debugName: "tried" }] : /* istanbul ignore next */ []));
|
|
79
|
+
this.accountOptions = computed(() => cbAccountOptions(this.accounts()), /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "accountOptions" }] : /* istanbul ignore next */ []));
|
|
81
|
+
this.columns = computed(() => {
|
|
82
|
+
const t = this.t();
|
|
83
|
+
const needsThird = this.thirdPartyRequired();
|
|
84
|
+
const cols = [
|
|
85
|
+
{
|
|
86
|
+
field: 'account',
|
|
87
|
+
header: t.journalAccount,
|
|
88
|
+
type: 'autocomplete',
|
|
89
|
+
options: this.accountOptions(),
|
|
90
|
+
width: '15rem',
|
|
91
|
+
sortable: false,
|
|
92
|
+
// Solo se exige en las líneas que ya tienen algo (las vacías se quitan al guardar).
|
|
93
|
+
validate: (v, row) => (!v && (row.debit || row.credit || row.description) ? t.journalAccountRequired : null),
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
if (this.thirdParties().length) {
|
|
97
|
+
cols.push({
|
|
98
|
+
field: 'thirdParty',
|
|
99
|
+
header: t.journalThirdParty,
|
|
100
|
+
type: 'autocomplete',
|
|
101
|
+
options: this.thirdParties(),
|
|
102
|
+
width: '12rem',
|
|
103
|
+
sortable: false,
|
|
104
|
+
validate: (v, row) => (!v && row.account && needsThird.some((p) => String(row.account).startsWith(p)) ? t.journalThirdPartyRequired : null),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (this.costCenters().length)
|
|
108
|
+
cols.push({ field: 'costCenter', header: t.journalCostCenter, type: 'autocomplete', options: this.costCenters(), width: '10rem', sortable: false });
|
|
109
|
+
cols.push({ field: 'description', header: t.journalLineDescription, width: '12rem', sortable: false }, {
|
|
110
|
+
field: 'debit',
|
|
111
|
+
header: t.journalDebit,
|
|
112
|
+
type: 'number',
|
|
113
|
+
currency: true,
|
|
114
|
+
min: 0,
|
|
115
|
+
width: '9.5rem',
|
|
116
|
+
sortable: false,
|
|
117
|
+
summary: 'sum',
|
|
118
|
+
onEdit: (v) => (v ? { credit: null } : null),
|
|
119
|
+
validate: (v, row) => (!v && !row.credit && row.account ? t.journalAmountRequired : null),
|
|
120
|
+
}, { field: 'credit', header: t.journalCredit, type: 'number', currency: true, min: 0, width: '9.5rem', sortable: false, summary: 'sum', onEdit: (v) => (v ? { debit: null } : null) });
|
|
121
|
+
return cols;
|
|
122
|
+
}, /* @ts-ignore */
|
|
123
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
124
|
+
/** Totales de débitos y créditos y su diferencia. */
|
|
125
|
+
this.totals = computed(() => {
|
|
126
|
+
const lines = this.entry().lines;
|
|
127
|
+
const debit = cbSummarize(lines.map((l) => l.debit), 'sum') ?? 0;
|
|
128
|
+
const credit = cbSummarize(lines.map((l) => l.credit), 'sum') ?? 0;
|
|
129
|
+
return { debit, credit, difference: Math.round((debit - credit) * 100) / 100 };
|
|
130
|
+
}, /* @ts-ignore */
|
|
131
|
+
...(ngDevMode ? [{ debugName: "totals" }] : /* istanbul ignore next */ []));
|
|
132
|
+
/** Débitos y créditos iguales y mayores que cero. */
|
|
133
|
+
this.balanced = computed(() => this.totals().difference === 0 && this.totals().debit > 0, /* @ts-ignore */
|
|
134
|
+
...(ngDevMode ? [{ debugName: "balanced" }] : /* istanbul ignore next */ []));
|
|
135
|
+
/** Problemas que impiden guardar. */
|
|
136
|
+
this.problems = computed(() => {
|
|
137
|
+
const t = this.t();
|
|
138
|
+
const e = this.entry();
|
|
139
|
+
const out = [];
|
|
140
|
+
if (!e.date)
|
|
141
|
+
out.push(t.journalErrDate);
|
|
142
|
+
const withAmount = e.lines.filter((l) => l.debit || l.credit);
|
|
143
|
+
if (withAmount.length < 2)
|
|
144
|
+
out.push(t.journalErrLines);
|
|
145
|
+
if (this.totals().difference !== 0)
|
|
146
|
+
out.push(cbFormat(t.journalErrUnbalanced, this.money(this.totals().difference)));
|
|
147
|
+
const errors = this.grid().errors().filter((err) => {
|
|
148
|
+
const line = e.lines.find((l) => l.id === err.key);
|
|
149
|
+
// Las líneas totalmente vacías se ignoran (se quitan al guardar).
|
|
150
|
+
return line && (line.account || line.debit || line.credit || line.description);
|
|
151
|
+
});
|
|
152
|
+
if (errors.length)
|
|
153
|
+
out.push(cbFormat(t.journalErrCells, errors.length));
|
|
154
|
+
return out;
|
|
155
|
+
}, /* @ts-ignore */
|
|
156
|
+
...(ngDevMode ? [{ debugName: "problems" }] : /* istanbul ignore next */ []));
|
|
157
|
+
this.newLine = () => ({ id: `l${Date.now().toString(36)}${++nextLine}`, account: null, thirdParty: null, costCenter: null, description: null, debit: null, credit: null });
|
|
158
|
+
}
|
|
159
|
+
money(value) {
|
|
160
|
+
return this.amount(value, this.currency() ? { currency: this.currency() } : {});
|
|
161
|
+
}
|
|
162
|
+
patch(change) {
|
|
163
|
+
this.entry.update((e) => ({ ...e, ...change }));
|
|
164
|
+
}
|
|
165
|
+
/** Pone la diferencia en la última línea sin importe (o en una nueva) para que cuadre. */
|
|
166
|
+
balance() {
|
|
167
|
+
const diff = this.totals().difference;
|
|
168
|
+
if (diff === 0 || this.readonly())
|
|
169
|
+
return;
|
|
170
|
+
const amount = { debit: diff < 0 ? -diff : null, credit: diff > 0 ? diff : null };
|
|
171
|
+
const lines = [...this.entry().lines];
|
|
172
|
+
const i = lines.map((l) => !l.debit && !l.credit).lastIndexOf(true);
|
|
173
|
+
if (i >= 0)
|
|
174
|
+
lines[i] = { ...lines[i], ...amount };
|
|
175
|
+
else
|
|
176
|
+
lines.push({ ...this.newLine(), ...amount });
|
|
177
|
+
this.patch({ lines });
|
|
178
|
+
}
|
|
179
|
+
/** Valida y, si está todo bien, emite `save`. */
|
|
180
|
+
submit() {
|
|
181
|
+
if (this.readonly())
|
|
182
|
+
return;
|
|
183
|
+
this.tried.set(true);
|
|
184
|
+
const problems = this.problems();
|
|
185
|
+
if (problems.length) {
|
|
186
|
+
this.invalid.emit(problems);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const e = this.entry();
|
|
190
|
+
const description = e.description?.trim() || null;
|
|
191
|
+
this.save.emit({
|
|
192
|
+
...e,
|
|
193
|
+
lines: e.lines.filter((l) => l.debit || l.credit).map((l) => ({ ...l, description: l.description?.trim() || description })),
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
onKeydown(event) {
|
|
197
|
+
if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
|
|
198
|
+
event.preventDefault();
|
|
199
|
+
this.submit();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbJournalEntry, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
203
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbJournalEntry, isStandalone: true, selector: "cb-journal-entry", inputs: { entry: { classPropertyName: "entry", publicName: "entry", isSignal: true, isRequired: false, transformFunction: null }, accounts: { classPropertyName: "accounts", publicName: "accounts", isSignal: true, isRequired: false, transformFunction: null }, thirdParties: { classPropertyName: "thirdParties", publicName: "thirdParties", isSignal: true, isRequired: false, transformFunction: null }, costCenters: { classPropertyName: "costCenters", publicName: "costCenters", isSignal: true, isRequired: false, transformFunction: null }, types: { classPropertyName: "types", publicName: "types", isSignal: true, isRequired: false, transformFunction: null }, thirdPartyRequired: { classPropertyName: "thirdPartyRequired", publicName: "thirdPartyRequired", isSignal: true, isRequired: false, transformFunction: null }, currency: { classPropertyName: "currency", publicName: "currency", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, saving: { classPropertyName: "saving", publicName: "saving", isSignal: true, isRequired: false, transformFunction: null }, saveLabel: { classPropertyName: "saveLabel", publicName: "saveLabel", isSignal: true, isRequired: false, transformFunction: null }, scrollHeight: { classPropertyName: "scrollHeight", publicName: "scrollHeight", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { entry: "entryChange", save: "save", invalid: "invalid" }, host: { listeners: { "keydown": "onKeydown($event)" }, classAttribute: "cb-journal-entry" }, viewQueries: [{ propertyName: "grid", first: true, predicate: CbDataGrid, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
204
|
+
<div class="cb-je__header" role="group" [attr.aria-label]="ariaLabel() || t().journalHeader">
|
|
205
|
+
<cb-datepicker class="cb-je__date" [label]="t().journalDate" [value]="entry().date" (valueChange)="patch({ date: $event })" [disabled]="readonly()" [invalid]="tried() && !entry().date" />
|
|
206
|
+
@if (types().length) {
|
|
207
|
+
<div class="cb-je__type">
|
|
208
|
+
<span class="cb-je__label" [id]="uid + '-type'">{{ t().journalType }}</span>
|
|
209
|
+
<cb-select [ariaLabelledBy]="uid + '-type'" [options]="types()" optionValue="value" [value]="entry().type" (valueChange)="patch({ type: $event })" [disabled]="readonly()" [placeholder]="t().select" />
|
|
210
|
+
</div>
|
|
211
|
+
}
|
|
212
|
+
<cb-input class="cb-je__number" [label]="t().journalNumber" [value]="entry().number ?? ''" (valueChange)="patch({ number: $event })" [readonly]="readonly()" />
|
|
213
|
+
<cb-input class="cb-je__desc" [label]="t().journalDescription" [value]="entry().description ?? ''" (valueChange)="patch({ description: $event })" [readonly]="readonly()" />
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<cb-data-grid
|
|
217
|
+
#grid
|
|
218
|
+
[rows]="entry().lines"
|
|
219
|
+
(rowsChange)="patch({ lines: $event })"
|
|
220
|
+
[columns]="columns()"
|
|
221
|
+
[newRow]="newLine"
|
|
222
|
+
[editable]="!readonly()"
|
|
223
|
+
[currency]="currency()"
|
|
224
|
+
[scrollHeight]="scrollHeight()"
|
|
225
|
+
[ariaLabel]="t().journalLines"
|
|
226
|
+
/>
|
|
227
|
+
|
|
228
|
+
<div class="cb-je__footer">
|
|
229
|
+
<dl class="cb-je__totals" aria-live="polite">
|
|
230
|
+
<div>
|
|
231
|
+
<dt>{{ t().journalDebit }}</dt>
|
|
232
|
+
<dd>{{ money(totals().debit) }}</dd>
|
|
233
|
+
</div>
|
|
234
|
+
<div>
|
|
235
|
+
<dt>{{ t().journalCredit }}</dt>
|
|
236
|
+
<dd>{{ money(totals().credit) }}</dd>
|
|
237
|
+
</div>
|
|
238
|
+
<div [class.cb-je__diff--off]="totals().difference !== 0">
|
|
239
|
+
<dt>{{ t().journalDifference }}</dt>
|
|
240
|
+
<dd>{{ money(totals().difference) }}</dd>
|
|
241
|
+
</div>
|
|
242
|
+
</dl>
|
|
243
|
+
<span class="cb-je__status" [class.cb-je__status--ok]="balanced()">
|
|
244
|
+
<cb-icon [name]="balanced() ? 'check' : 'circle-alert'" [size]="15" aria-hidden="true" />
|
|
245
|
+
{{ balanced() ? t().journalBalanced : t().journalUnbalanced }}
|
|
246
|
+
</span>
|
|
247
|
+
@if (!readonly()) {
|
|
248
|
+
<span class="cb-je__spacer"></span>
|
|
249
|
+
<cb-button variant="outlined" [disabled]="totals().difference === 0" (click)="balance()">{{ t().journalBalance }}</cb-button>
|
|
250
|
+
<cb-button [loading]="saving()" (click)="submit()">{{ saveLabel() || t().journalSave }}</cb-button>
|
|
251
|
+
}
|
|
252
|
+
</div>
|
|
253
|
+
|
|
254
|
+
@if (tried() && problems().length) {
|
|
255
|
+
<div class="cb-je__errors" role="alert">
|
|
256
|
+
<p>{{ t().journalCannotSave }}</p>
|
|
257
|
+
<ul>
|
|
258
|
+
@for (p of problems(); track $index) {
|
|
259
|
+
<li>{{ p }}</li>
|
|
260
|
+
}
|
|
261
|
+
</ul>
|
|
262
|
+
</div>
|
|
263
|
+
}
|
|
264
|
+
`, isInline: true, styles: [":host{display:grid;gap:var(--cb-space-4, 1rem);width:100%;min-width:0;container-type:inline-size;color:var(--cb-color-text);font-family:var(--cb-font-sans)}.cb-je__header{display:grid;grid-template-columns:11rem minmax(12rem,16rem) 9rem minmax(12rem,1fr);gap:var(--cb-space-3, .75rem) var(--cb-space-4, 1rem);align-items:end}.cb-je__header:not(:has(.cb-je__type)){grid-template-columns:11rem 9rem minmax(12rem,1fr)}.cb-je__header>*{min-width:0}.cb-je__type{display:grid;gap:var(--cb-space-1, .25rem)}.cb-je__type cb-select{display:block;min-width:0}.cb-je__label{color:var(--cb-color-text);font-size:var(--cb-text-sm);font-weight:var(--cb-font-weight-medium)}.cb-je__footer{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cb-space-3, .75rem) var(--cb-space-4, 1rem)}.cb-je__totals{display:flex;flex-wrap:wrap;gap:var(--cb-space-2, .5rem) var(--cb-space-5, 1.25rem);margin:0}.cb-je__totals>div{display:grid;gap:.1rem}.cb-je__totals dt{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);text-transform:uppercase;letter-spacing:.04em}.cb-je__totals dd{margin:0;font-size:var(--cb-text-base, 1rem);font-variant-numeric:tabular-nums;font-weight:var(--cb-font-weight-semibold, 600)}.cb-je__diff--off dd{color:var(--cb-color-danger-text, #dc2626)}.cb-je__status{display:inline-flex;align-items:center;gap:.35rem;padding:.25rem .65rem;border-radius:999px;background:color-mix(in srgb,var(--cb-color-danger-500, #ef4444) 10%,transparent);color:var(--cb-color-danger-text, #dc2626);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500)}.cb-je__status--ok{background:color-mix(in srgb,var(--cb-color-success-500, #10b981) 12%,transparent);color:var(--cb-color-success-text, #047857)}.cb-je__spacer{flex:1}.cb-je__errors{padding:.75rem 1rem;border:1px solid color-mix(in srgb,var(--cb-color-danger-500, #ef4444) 45%,transparent);border-left-width:4px;border-radius:var(--cb-radius-md);background:color-mix(in srgb,var(--cb-color-danger-500, #ef4444) 7%,var(--cb-color-bg));color:var(--cb-color-danger-text, #b91c1c);font-size:var(--cb-text-sm, .875rem)}.cb-je__errors p{margin:0 0 .25rem;font-weight:var(--cb-font-weight-semibold, 600)}.cb-je__errors ul{margin:0;padding-left:1.25rem}@container (max-width: 44rem){.cb-je__header,.cb-je__header:not(:has(.cb-je__type)){grid-template-columns:1fr 1fr}.cb-je__desc{grid-column:1 / -1}}@container (max-width: 28rem){.cb-je__header,.cb-je__header:not(:has(.cb-je__type)){grid-template-columns:1fr}}\n"], dependencies: [{ kind: "component", type: CbDataGrid, selector: "cb-data-grid", inputs: ["rows", "columns", "dataKey", "editable", "rowNumbers", "toolbar", "scrollHeight", "newRow", "emptyMessage", "ariaLabel", "currency", "negativeStyle"], outputs: ["rowsChange", "cellChange", "rowAdd", "rowsDelete"] }, { kind: "component", type: CbDatepicker, selector: "cb-datepicker", inputs: ["value", "range", "label", "hint", "error", "placeholder", "size", "invalid", "required", "requiredIndicator", "disabled", "inputId", "locale", "firstDayOfWeek", "minDate", "maxDate", "selectionMode", "view", "numberOfMonths", "showTime", "hourFormat", "stepMinute", "dateFormat", "editable", "presets"], outputs: ["valueChange", "rangeChange"] }, { kind: "component", type: CbInput, selector: "cb-input", inputs: ["value", "label", "hint", "error", "invalid", "type", "placeholder", "size", "readonly", "required", "requiredIndicator", "inputmode", "disabled", "inputId"], outputs: ["valueChange"] }, { kind: "component", type: CbSelect, selector: "cb-select", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "group", "optionGroupLabel", "optionGroupChildren", "placeholder", "size", "filter", "filterPlaceholder", "emptyMessage", "showClear", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "invalid", "disabled", "inputId", "ariaLabel", "ariaLabelledBy", "value"], outputs: ["valueChange"] }, { kind: "component", type: CbButton, selector: "cb-button", inputs: ["severity", "variant", "size", "disabled", "loading", "fullWidth", "type", "ariaLabel", "ariaHaspopup", "ariaExpanded", "ariaControls"] }, { kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
265
|
+
}
|
|
266
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbJournalEntry, decorators: [{
|
|
267
|
+
type: Component,
|
|
268
|
+
args: [{ selector: 'cb-journal-entry', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbDataGrid, CbDatepicker, CbInput, CbSelect, CbButton, CbIcon], host: { class: 'cb-journal-entry', '(keydown)': 'onKeydown($event)' }, template: `
|
|
269
|
+
<div class="cb-je__header" role="group" [attr.aria-label]="ariaLabel() || t().journalHeader">
|
|
270
|
+
<cb-datepicker class="cb-je__date" [label]="t().journalDate" [value]="entry().date" (valueChange)="patch({ date: $event })" [disabled]="readonly()" [invalid]="tried() && !entry().date" />
|
|
271
|
+
@if (types().length) {
|
|
272
|
+
<div class="cb-je__type">
|
|
273
|
+
<span class="cb-je__label" [id]="uid + '-type'">{{ t().journalType }}</span>
|
|
274
|
+
<cb-select [ariaLabelledBy]="uid + '-type'" [options]="types()" optionValue="value" [value]="entry().type" (valueChange)="patch({ type: $event })" [disabled]="readonly()" [placeholder]="t().select" />
|
|
275
|
+
</div>
|
|
276
|
+
}
|
|
277
|
+
<cb-input class="cb-je__number" [label]="t().journalNumber" [value]="entry().number ?? ''" (valueChange)="patch({ number: $event })" [readonly]="readonly()" />
|
|
278
|
+
<cb-input class="cb-je__desc" [label]="t().journalDescription" [value]="entry().description ?? ''" (valueChange)="patch({ description: $event })" [readonly]="readonly()" />
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<cb-data-grid
|
|
282
|
+
#grid
|
|
283
|
+
[rows]="entry().lines"
|
|
284
|
+
(rowsChange)="patch({ lines: $event })"
|
|
285
|
+
[columns]="columns()"
|
|
286
|
+
[newRow]="newLine"
|
|
287
|
+
[editable]="!readonly()"
|
|
288
|
+
[currency]="currency()"
|
|
289
|
+
[scrollHeight]="scrollHeight()"
|
|
290
|
+
[ariaLabel]="t().journalLines"
|
|
291
|
+
/>
|
|
292
|
+
|
|
293
|
+
<div class="cb-je__footer">
|
|
294
|
+
<dl class="cb-je__totals" aria-live="polite">
|
|
295
|
+
<div>
|
|
296
|
+
<dt>{{ t().journalDebit }}</dt>
|
|
297
|
+
<dd>{{ money(totals().debit) }}</dd>
|
|
298
|
+
</div>
|
|
299
|
+
<div>
|
|
300
|
+
<dt>{{ t().journalCredit }}</dt>
|
|
301
|
+
<dd>{{ money(totals().credit) }}</dd>
|
|
302
|
+
</div>
|
|
303
|
+
<div [class.cb-je__diff--off]="totals().difference !== 0">
|
|
304
|
+
<dt>{{ t().journalDifference }}</dt>
|
|
305
|
+
<dd>{{ money(totals().difference) }}</dd>
|
|
306
|
+
</div>
|
|
307
|
+
</dl>
|
|
308
|
+
<span class="cb-je__status" [class.cb-je__status--ok]="balanced()">
|
|
309
|
+
<cb-icon [name]="balanced() ? 'check' : 'circle-alert'" [size]="15" aria-hidden="true" />
|
|
310
|
+
{{ balanced() ? t().journalBalanced : t().journalUnbalanced }}
|
|
311
|
+
</span>
|
|
312
|
+
@if (!readonly()) {
|
|
313
|
+
<span class="cb-je__spacer"></span>
|
|
314
|
+
<cb-button variant="outlined" [disabled]="totals().difference === 0" (click)="balance()">{{ t().journalBalance }}</cb-button>
|
|
315
|
+
<cb-button [loading]="saving()" (click)="submit()">{{ saveLabel() || t().journalSave }}</cb-button>
|
|
316
|
+
}
|
|
317
|
+
</div>
|
|
318
|
+
|
|
319
|
+
@if (tried() && problems().length) {
|
|
320
|
+
<div class="cb-je__errors" role="alert">
|
|
321
|
+
<p>{{ t().journalCannotSave }}</p>
|
|
322
|
+
<ul>
|
|
323
|
+
@for (p of problems(); track $index) {
|
|
324
|
+
<li>{{ p }}</li>
|
|
325
|
+
}
|
|
326
|
+
</ul>
|
|
327
|
+
</div>
|
|
328
|
+
}
|
|
329
|
+
`, styles: [":host{display:grid;gap:var(--cb-space-4, 1rem);width:100%;min-width:0;container-type:inline-size;color:var(--cb-color-text);font-family:var(--cb-font-sans)}.cb-je__header{display:grid;grid-template-columns:11rem minmax(12rem,16rem) 9rem minmax(12rem,1fr);gap:var(--cb-space-3, .75rem) var(--cb-space-4, 1rem);align-items:end}.cb-je__header:not(:has(.cb-je__type)){grid-template-columns:11rem 9rem minmax(12rem,1fr)}.cb-je__header>*{min-width:0}.cb-je__type{display:grid;gap:var(--cb-space-1, .25rem)}.cb-je__type cb-select{display:block;min-width:0}.cb-je__label{color:var(--cb-color-text);font-size:var(--cb-text-sm);font-weight:var(--cb-font-weight-medium)}.cb-je__footer{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cb-space-3, .75rem) var(--cb-space-4, 1rem)}.cb-je__totals{display:flex;flex-wrap:wrap;gap:var(--cb-space-2, .5rem) var(--cb-space-5, 1.25rem);margin:0}.cb-je__totals>div{display:grid;gap:.1rem}.cb-je__totals dt{color:var(--cb-color-text-muted);font-size:var(--cb-text-xs, .75rem);text-transform:uppercase;letter-spacing:.04em}.cb-je__totals dd{margin:0;font-size:var(--cb-text-base, 1rem);font-variant-numeric:tabular-nums;font-weight:var(--cb-font-weight-semibold, 600)}.cb-je__diff--off dd{color:var(--cb-color-danger-text, #dc2626)}.cb-je__status{display:inline-flex;align-items:center;gap:.35rem;padding:.25rem .65rem;border-radius:999px;background:color-mix(in srgb,var(--cb-color-danger-500, #ef4444) 10%,transparent);color:var(--cb-color-danger-text, #dc2626);font-size:var(--cb-text-sm, .875rem);font-weight:var(--cb-font-weight-medium, 500)}.cb-je__status--ok{background:color-mix(in srgb,var(--cb-color-success-500, #10b981) 12%,transparent);color:var(--cb-color-success-text, #047857)}.cb-je__spacer{flex:1}.cb-je__errors{padding:.75rem 1rem;border:1px solid color-mix(in srgb,var(--cb-color-danger-500, #ef4444) 45%,transparent);border-left-width:4px;border-radius:var(--cb-radius-md);background:color-mix(in srgb,var(--cb-color-danger-500, #ef4444) 7%,var(--cb-color-bg));color:var(--cb-color-danger-text, #b91c1c);font-size:var(--cb-text-sm, .875rem)}.cb-je__errors p{margin:0 0 .25rem;font-weight:var(--cb-font-weight-semibold, 600)}.cb-je__errors ul{margin:0;padding-left:1.25rem}@container (max-width: 44rem){.cb-je__header,.cb-je__header:not(:has(.cb-je__type)){grid-template-columns:1fr 1fr}.cb-je__desc{grid-column:1 / -1}}@container (max-width: 28rem){.cb-je__header,.cb-je__header:not(:has(.cb-je__type)){grid-template-columns:1fr}}\n"] }]
|
|
330
|
+
}], propDecorators: { grid: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CbDataGrid), { isSignal: true }] }], entry: [{ type: i0.Input, args: [{ isSignal: true, alias: "entry", required: false }] }, { type: i0.Output, args: ["entryChange"] }], accounts: [{ type: i0.Input, args: [{ isSignal: true, alias: "accounts", required: false }] }], thirdParties: [{ type: i0.Input, args: [{ isSignal: true, alias: "thirdParties", required: false }] }], costCenters: [{ type: i0.Input, args: [{ isSignal: true, alias: "costCenters", required: false }] }], types: [{ type: i0.Input, args: [{ isSignal: true, alias: "types", required: false }] }], thirdPartyRequired: [{ type: i0.Input, args: [{ isSignal: true, alias: "thirdPartyRequired", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], saving: [{ type: i0.Input, args: [{ isSignal: true, alias: "saving", required: false }] }], saveLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "saveLabel", required: false }] }], scrollHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollHeight", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], save: [{ type: i0.Output, args: ["save"] }], invalid: [{ type: i0.Output, args: ["invalid"] }] } });
|
|
331
|
+
|
|
332
|
+
/*
|
|
333
|
+
* Public API Surface de @caribeng/ui/journal-entry
|
|
334
|
+
*/
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Generated bundle index. Do not edit.
|
|
338
|
+
*/
|
|
339
|
+
|
|
340
|
+
export { CbJournalEntry, cbEmptyJournalEntry };
|