@caribeng/ui 22.1.1 → 22.4.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 +134 -12
- package/fesm2022/caribeng-ui-accordion.mjs +4 -4
- package/fesm2022/caribeng-ui-anchor.mjs +169 -0
- package/fesm2022/caribeng-ui-autocomplete.mjs +10 -8
- package/fesm2022/caribeng-ui-avatar.mjs +2 -2
- package/fesm2022/caribeng-ui-avatargroup.mjs +9 -3
- package/fesm2022/caribeng-ui-badge.mjs +8 -2
- package/fesm2022/caribeng-ui-blockui.mjs +12 -4
- package/fesm2022/caribeng-ui-breadcrumb.mjs +17 -7
- package/fesm2022/caribeng-ui-button.mjs +22 -2
- package/fesm2022/caribeng-ui-caribe-alert.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-animation-lottie.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-button-group.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-calendar.mjs +11 -6
- package/fesm2022/caribeng-ui-caribe-card-content.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-card-move.mjs +29 -7
- package/fesm2022/caribeng-ui-caribe-card-select.mjs +56 -14
- package/fesm2022/caribeng-ui-caribe-circle-loading.mjs +10 -7
- package/fesm2022/caribeng-ui-caribe-coachmark.mjs +42 -19
- package/fesm2022/caribeng-ui-caribe-data-table.mjs +15 -9
- package/fesm2022/caribeng-ui-caribe-dots-indicator.mjs +38 -5
- package/fesm2022/caribeng-ui-caribe-expansion-panel.mjs +16 -5
- package/fesm2022/caribeng-ui-caribe-fab-menu.mjs +56 -7
- package/fesm2022/caribeng-ui-caribe-file-download.mjs +68 -27
- package/fesm2022/caribeng-ui-caribe-file-select.mjs +22 -17
- package/fesm2022/caribeng-ui-caribe-float-menu.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-footer.mjs +8 -4
- package/fesm2022/caribeng-ui-caribe-header.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-icon-button.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-illustration.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-inline-alert.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-input-search.mjs +14 -10
- package/fesm2022/caribeng-ui-caribe-input-select.mjs +12 -10
- package/fesm2022/caribeng-ui-caribe-input-token.mjs +61 -11
- package/fesm2022/caribeng-ui-caribe-link.mjs +7 -2
- package/fesm2022/caribeng-ui-caribe-loader.mjs +8 -5
- package/fesm2022/caribeng-ui-caribe-modal.mjs +32 -16
- package/fesm2022/caribeng-ui-caribe-off-canvas.mjs +26 -12
- package/fesm2022/caribeng-ui-caribe-onboarding.mjs +44 -19
- package/fesm2022/caribeng-ui-caribe-pictogram.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-pop-over.mjs +34 -10
- package/fesm2022/caribeng-ui-caribe-preloader.mjs +9 -6
- package/fesm2022/caribeng-ui-caribe-progress-bar.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-shortcut.mjs +8 -3
- package/fesm2022/caribeng-ui-caribe-step-indicator.mjs +12 -5
- package/fesm2022/caribeng-ui-caribe-stroke.mjs +6 -3
- package/fesm2022/caribeng-ui-caribe-switch.mjs +5 -3
- package/fesm2022/caribeng-ui-caribe-tag-button.mjs +1 -1
- package/fesm2022/caribeng-ui-caribe-tracker.mjs +5 -2
- package/fesm2022/caribeng-ui-caribe-transaction-status.mjs +1 -1
- package/fesm2022/caribeng-ui-caribe-voucher.mjs +11 -8
- package/fesm2022/caribeng-ui-carousel.mjs +49 -14
- package/fesm2022/caribeng-ui-cascadeselect.mjs +22 -8
- package/fesm2022/caribeng-ui-chart.mjs +2601 -303
- package/fesm2022/caribeng-ui-chat.mjs +1303 -0
- package/fesm2022/caribeng-ui-chip.mjs +9 -4
- package/fesm2022/caribeng-ui-chips.mjs +9 -5
- package/fesm2022/caribeng-ui-code-block.mjs +332 -0
- package/fesm2022/caribeng-ui-colorpicker.mjs +107 -11
- package/fesm2022/caribeng-ui-command-palette.mjs +476 -0
- package/fesm2022/caribeng-ui-confirmdialog.mjs +140 -10
- package/fesm2022/caribeng-ui-confirmpopup.mjs +209 -9
- package/fesm2022/caribeng-ui-contextmenu.mjs +13 -6
- package/fesm2022/caribeng-ui-copy-button.mjs +230 -0
- package/fesm2022/caribeng-ui-dataview.mjs +214 -6
- package/fesm2022/caribeng-ui-datepicker.mjs +1630 -393
- package/fesm2022/caribeng-ui-descriptions.mjs +124 -0
- package/fesm2022/caribeng-ui-dialog.mjs +10 -7
- package/fesm2022/caribeng-ui-dock.mjs +58 -15
- package/fesm2022/caribeng-ui-drawer.mjs +17 -9
- package/fesm2022/caribeng-ui-dynamicdialog.mjs +210 -6
- package/fesm2022/caribeng-ui-editor.mjs +4413 -243
- package/fesm2022/caribeng-ui-empty.mjs +80 -0
- package/fesm2022/caribeng-ui-fieldset.mjs +2 -2
- package/fesm2022/caribeng-ui-file-card.mjs +136 -19
- package/fesm2022/caribeng-ui-fileupload.mjs +96 -19
- package/fesm2022/caribeng-ui-floatlabel.mjs +4 -2
- package/fesm2022/caribeng-ui-folder-card.mjs +132 -15
- package/fesm2022/caribeng-ui-galleria.mjs +76 -45
- package/fesm2022/caribeng-ui-image.mjs +52 -29
- package/fesm2022/caribeng-ui-inlinemessage.mjs +2 -2
- package/fesm2022/caribeng-ui-inplace.mjs +22 -6
- package/fesm2022/caribeng-ui-input-number.mjs +9 -7
- package/fesm2022/caribeng-ui-inputgroup.mjs +2 -2
- package/fesm2022/caribeng-ui-inputmask.mjs +22 -13
- package/fesm2022/caribeng-ui-inputotp.mjs +12 -6
- package/fesm2022/caribeng-ui-kanban.mjs +4612 -0
- package/fesm2022/caribeng-ui-kbd.mjs +122 -0
- package/fesm2022/caribeng-ui-keyfilter.mjs +72 -0
- package/fesm2022/caribeng-ui-listbox.mjs +13 -11
- package/fesm2022/caribeng-ui-megamenu.mjs +228 -32
- package/fesm2022/caribeng-ui-mentions.mjs +495 -0
- package/fesm2022/caribeng-ui-menu.mjs +18 -8
- package/fesm2022/caribeng-ui-menubar.mjs +17 -8
- package/fesm2022/caribeng-ui-message.mjs +13 -7
- package/fesm2022/caribeng-ui-metergroup.mjs +29 -11
- package/fesm2022/caribeng-ui-multiselect.mjs +399 -97
- package/fesm2022/caribeng-ui-orderlist.mjs +230 -11
- package/fesm2022/caribeng-ui-organizationchart.mjs +16 -15
- package/fesm2022/caribeng-ui-paginator.mjs +18 -15
- package/fesm2022/caribeng-ui-panel.mjs +11 -8
- package/fesm2022/caribeng-ui-panelmenu.mjs +14 -8
- package/fesm2022/caribeng-ui-password.mjs +8 -6
- package/fesm2022/caribeng-ui-pdfviewer.mjs +1553 -0
- package/fesm2022/caribeng-ui-phone-input.mjs +688 -0
- package/fesm2022/caribeng-ui-picklist.mjs +251 -14
- package/fesm2022/caribeng-ui-pricing.mjs +272 -75
- package/fesm2022/caribeng-ui-qrcode.mjs +564 -0
- package/fesm2022/caribeng-ui-rating.mjs +7 -3
- package/fesm2022/caribeng-ui-repeater.mjs +223 -0
- package/fesm2022/caribeng-ui-result.mjs +91 -0
- package/fesm2022/caribeng-ui-ripple.mjs +2 -0
- package/fesm2022/caribeng-ui-scrollpanel.mjs +6 -3
- package/fesm2022/caribeng-ui-scrolltop.mjs +9 -4
- package/fesm2022/caribeng-ui-select.mjs +379 -87
- package/fesm2022/caribeng-ui-selectbutton.mjs +2 -2
- package/fesm2022/caribeng-ui-sidebar.mjs +573 -0
- package/fesm2022/caribeng-ui-slider.mjs +171 -75
- package/fesm2022/caribeng-ui-speeddial.mjs +7 -4
- package/fesm2022/caribeng-ui-spinner.mjs +5 -2
- package/fesm2022/caribeng-ui-splitbutton.mjs +163 -0
- package/fesm2022/caribeng-ui-splitter.mjs +5 -2
- package/fesm2022/caribeng-ui-statistic.mjs +183 -0
- package/fesm2022/caribeng-ui-stepper.mjs +17 -7
- package/fesm2022/caribeng-ui-steps.mjs +6 -3
- package/fesm2022/caribeng-ui-table.mjs +716 -84
- package/fesm2022/caribeng-ui-tabmenu.mjs +13 -6
- package/fesm2022/caribeng-ui-tag.mjs +2 -2
- package/fesm2022/caribeng-ui-terminal.mjs +45 -9
- package/fesm2022/caribeng-ui-themetoggle.mjs +82 -0
- package/fesm2022/caribeng-ui-tieredmenu.mjs +113 -20
- package/fesm2022/caribeng-ui-timeline.mjs +175 -6
- package/fesm2022/caribeng-ui-toast.mjs +7 -4
- package/fesm2022/caribeng-ui-togglebutton.mjs +8 -6
- package/fesm2022/caribeng-ui-toolbar.mjs +6 -3
- package/fesm2022/caribeng-ui-tree.mjs +302 -6
- package/fesm2022/caribeng-ui-treeselect.mjs +26 -10
- package/fesm2022/caribeng-ui-treetable.mjs +269 -6
- package/fesm2022/caribeng-ui-virtualscroller.mjs +123 -10
- package/fesm2022/caribeng-ui.mjs +1216 -6
- package/package.json +93 -3
- package/schematics/collection.json +15 -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 +140 -0
- package/schematics/ng-add/schema.js +2 -0
- package/schematics/ng-add/schema.json +66 -0
- package/types/caribeng-ui-anchor.d.ts +50 -0
- package/types/caribeng-ui-autocomplete.d.ts +4 -2
- package/types/caribeng-ui-avatargroup.d.ts +3 -1
- package/types/caribeng-ui-badge.d.ts +3 -1
- package/types/caribeng-ui-blockui.d.ts +9 -4
- package/types/caribeng-ui-breadcrumb.d.ts +11 -0
- package/types/caribeng-ui-button.d.ts +9 -1
- package/types/caribeng-ui-caribe-alert.d.ts +3 -0
- package/types/caribeng-ui-caribe-animation-lottie.d.ts +4 -1
- package/types/caribeng-ui-caribe-button-group.d.ts +4 -1
- package/types/caribeng-ui-caribe-calendar.d.ts +5 -1
- package/types/caribeng-ui-caribe-card-content.d.ts +4 -1
- package/types/caribeng-ui-caribe-card-move.d.ts +13 -13
- package/types/caribeng-ui-caribe-card-select.d.ts +10 -1
- package/types/caribeng-ui-caribe-circle-loading.d.ts +4 -1
- package/types/caribeng-ui-caribe-coachmark.d.ts +6 -0
- package/types/caribeng-ui-caribe-data-table.d.ts +7 -2
- package/types/caribeng-ui-caribe-dots-indicator.d.ts +9 -0
- package/types/caribeng-ui-caribe-expansion-panel.d.ts +7 -10
- package/types/caribeng-ui-caribe-fab-menu.d.ts +10 -1
- package/types/caribeng-ui-caribe-file-download.d.ts +8 -10
- package/types/caribeng-ui-caribe-file-select.d.ts +7 -1
- package/types/caribeng-ui-caribe-float-menu.d.ts +4 -1
- package/types/caribeng-ui-caribe-header.d.ts +3 -0
- package/types/caribeng-ui-caribe-icon-button.d.ts +4 -1
- package/types/caribeng-ui-caribe-illustration.d.ts +4 -1
- package/types/caribeng-ui-caribe-inline-alert.d.ts +3 -0
- package/types/caribeng-ui-caribe-input-search.d.ts +4 -2
- package/types/caribeng-ui-caribe-input-select.d.ts +4 -2
- package/types/caribeng-ui-caribe-input-token.d.ts +16 -1
- package/types/caribeng-ui-caribe-link.d.ts +3 -0
- package/types/caribeng-ui-caribe-loader.d.ts +4 -1
- package/types/caribeng-ui-caribe-modal.d.ts +7 -10
- package/types/caribeng-ui-caribe-off-canvas.d.ts +6 -1
- package/types/caribeng-ui-caribe-onboarding.d.ts +6 -0
- package/types/caribeng-ui-caribe-pictogram.d.ts +4 -1
- package/types/caribeng-ui-caribe-pop-over.d.ts +7 -10
- package/types/caribeng-ui-caribe-preloader.d.ts +4 -1
- package/types/caribeng-ui-caribe-progress-bar.d.ts +3 -0
- package/types/caribeng-ui-caribe-shortcut.d.ts +3 -1
- package/types/caribeng-ui-caribe-step-indicator.d.ts +6 -0
- package/types/caribeng-ui-caribe-stroke.d.ts +4 -1
- package/types/caribeng-ui-caribe-switch.d.ts +3 -1
- package/types/caribeng-ui-caribe-tracker.d.ts +3 -0
- package/types/caribeng-ui-caribe-voucher.d.ts +5 -2
- package/types/caribeng-ui-carousel.d.ts +10 -1
- package/types/caribeng-ui-cascadeselect.d.ts +7 -2
- package/types/caribeng-ui-chart.d.ts +471 -44
- package/types/caribeng-ui-chat.d.ts +299 -0
- package/types/caribeng-ui-chip.d.ts +6 -0
- package/types/caribeng-ui-chips.d.ts +6 -2
- package/types/caribeng-ui-code-block.d.ts +65 -0
- package/types/caribeng-ui-colorpicker.d.ts +8 -2
- package/types/caribeng-ui-command-palette.d.ts +133 -0
- package/types/caribeng-ui-confirmdialog.d.ts +57 -6
- package/types/caribeng-ui-confirmpopup.d.ts +74 -5
- package/types/caribeng-ui-contextmenu.d.ts +11 -1
- package/types/caribeng-ui-copy-button.d.ts +90 -0
- package/types/caribeng-ui-dataview.d.ts +65 -5
- package/types/caribeng-ui-datepicker.d.ts +186 -21
- package/types/caribeng-ui-descriptions.d.ts +63 -0
- package/types/caribeng-ui-dialog.d.ts +4 -1
- package/types/caribeng-ui-dock.d.ts +17 -2
- package/types/caribeng-ui-drawer.d.ts +7 -2
- package/types/caribeng-ui-dynamicdialog.d.ts +93 -3
- package/types/caribeng-ui-editor.d.ts +486 -13
- package/types/caribeng-ui-empty.d.ts +34 -0
- package/types/caribeng-ui-file-card.d.ts +28 -3
- package/types/caribeng-ui-fileupload.d.ts +27 -4
- package/types/caribeng-ui-folder-card.d.ts +31 -6
- package/types/caribeng-ui-galleria.d.ts +9 -0
- package/types/caribeng-ui-image.d.ts +10 -0
- package/types/caribeng-ui-inplace.d.ts +8 -0
- package/types/caribeng-ui-input-number.d.ts +3 -1
- package/types/caribeng-ui-inputmask.d.ts +8 -1
- package/types/caribeng-ui-inputotp.d.ts +7 -2
- package/types/caribeng-ui-kanban.d.ts +783 -0
- package/types/caribeng-ui-kbd.d.ts +36 -0
- package/types/caribeng-ui-keyfilter.d.ts +30 -0
- package/types/caribeng-ui-listbox.d.ts +5 -3
- package/types/caribeng-ui-megamenu.d.ts +37 -2
- package/types/caribeng-ui-mentions.d.ts +127 -0
- package/types/caribeng-ui-menu.d.ts +14 -2
- package/types/caribeng-ui-menubar.d.ts +12 -1
- package/types/caribeng-ui-message.d.ts +5 -0
- package/types/caribeng-ui-metergroup.d.ts +9 -1
- package/types/caribeng-ui-multiselect.d.ts +71 -10
- package/types/caribeng-ui-orderlist.d.ts +58 -6
- package/types/caribeng-ui-organizationchart.d.ts +7 -1
- package/types/caribeng-ui-paginator.d.ts +3 -0
- package/types/caribeng-ui-panel.d.ts +3 -0
- package/types/caribeng-ui-panelmenu.d.ts +11 -1
- package/types/caribeng-ui-password.d.ts +4 -2
- package/types/caribeng-ui-pdfviewer.d.ts +258 -0
- package/types/caribeng-ui-phone-input.d.ts +168 -0
- package/types/caribeng-ui-picklist.d.ts +67 -7
- package/types/caribeng-ui-pricing.d.ts +49 -9
- package/types/caribeng-ui-qrcode.d.ts +88 -0
- package/types/caribeng-ui-rating.d.ts +6 -2
- package/types/caribeng-ui-repeater.d.ts +79 -0
- package/types/caribeng-ui-result.d.ts +35 -0
- package/types/caribeng-ui-scrollpanel.d.ts +4 -1
- package/types/caribeng-ui-scrolltop.d.ts +4 -1
- package/types/caribeng-ui-select.d.ts +73 -9
- package/types/caribeng-ui-sidebar.d.ts +167 -0
- package/types/caribeng-ui-slider.d.ts +63 -10
- package/types/caribeng-ui-speeddial.d.ts +5 -2
- package/types/caribeng-ui-spinner.d.ts +3 -0
- package/types/caribeng-ui-splitbutton.d.ts +49 -0
- package/types/caribeng-ui-splitter.d.ts +3 -0
- package/types/caribeng-ui-statistic.d.ts +65 -0
- package/types/caribeng-ui-stepper.d.ts +5 -0
- package/types/caribeng-ui-steps.d.ts +4 -1
- package/types/caribeng-ui-table.d.ts +185 -17
- package/types/caribeng-ui-tabmenu.d.ts +11 -1
- package/types/caribeng-ui-terminal.d.ts +10 -0
- package/types/caribeng-ui-themetoggle.d.ts +32 -0
- package/types/caribeng-ui-tieredmenu.d.ts +22 -3
- package/types/caribeng-ui-timeline.d.ts +63 -4
- package/types/caribeng-ui-toast.d.ts +3 -0
- package/types/caribeng-ui-togglebutton.d.ts +5 -3
- package/types/caribeng-ui-toolbar.d.ts +7 -4
- package/types/caribeng-ui-tree.d.ts +76 -4
- package/types/caribeng-ui-treeselect.d.ts +10 -2
- package/types/caribeng-ui-treetable.d.ts +68 -4
- package/types/caribeng-ui-virtualscroller.d.ts +45 -5
- package/types/caribeng-ui.d.ts +775 -12
|
@@ -1,27 +1,231 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { model, input, output, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
|
+
import { model, input, output, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, inject, Injector, Injectable } from '@angular/core';
|
|
3
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
4
|
+
import { CbDialog } from '@caribeng/ui/dialog';
|
|
5
|
+
import { NgComponentOutlet, DOCUMENT } from '@angular/common';
|
|
6
|
+
import * as i1 from '@angular/cdk/a11y';
|
|
7
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
8
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
9
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
10
|
+
import { Subject } from 'rxjs';
|
|
11
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
3
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Variante declarativa del diálogo dinámico: un `cb-dialog` con título y
|
|
15
|
+
* texto, para casos simples. Para abrir **componentes** con datos y recibir un
|
|
16
|
+
* resultado, usa `CbDialogService.open()`.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```html
|
|
20
|
+
* <cb-dynamic-dialog [(visible)]="visible" header="Detalle" content="Tu solicitud fue enviada." />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
4
23
|
class CbDynamicDialog {
|
|
5
24
|
constructor() {
|
|
25
|
+
this.t = injectCbTranslation();
|
|
26
|
+
/** Visibilidad (two-way). */
|
|
6
27
|
this.visible = model(false, /* @ts-ignore */
|
|
7
28
|
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
8
|
-
|
|
29
|
+
/** Título. Por defecto, "Diálogo" del idioma activo. */
|
|
30
|
+
this.header = input(undefined, /* @ts-ignore */
|
|
9
31
|
...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
32
|
+
/** Texto del cuerpo (también se puede proyectar contenido). */
|
|
10
33
|
this.content = input('', /* @ts-ignore */
|
|
11
34
|
...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/** Se emite al cerrarse. */
|
|
12
36
|
this.closed = output();
|
|
13
37
|
}
|
|
14
|
-
close() { this.visible.set(false); this.closed.emit(); }
|
|
15
38
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDynamicDialog, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDynamicDialog, isStandalone: true, selector: "cb-dynamic-dialog", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", closed: "closed" },
|
|
39
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDynamicDialog, isStandalone: true, selector: "cb-dynamic-dialog", inputs: { visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", closed: "closed" }, host: { styleAttribute: "display: contents" }, ngImport: i0, template: `
|
|
40
|
+
<cb-dialog [(visible)]="visible" [header]="header() ?? t().dialog" (onHide)="closed.emit()">
|
|
41
|
+
@if (content()) {
|
|
42
|
+
<p class="cb-dynamic-dialog__text">{{ content() }}</p>
|
|
43
|
+
}
|
|
44
|
+
<ng-content />
|
|
45
|
+
</cb-dialog>
|
|
46
|
+
`, isInline: true, styles: [".cb-dynamic-dialog__text{margin:0}\n"], dependencies: [{ kind: "component", type: CbDialog, selector: "cb-dialog", inputs: ["visible", "header", "closable", "dismissableMask", "closeOnEscape", "width", "ariaLabel"], outputs: ["visibleChange", "onHide", "onShow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
17
47
|
}
|
|
18
48
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDynamicDialog, decorators: [{
|
|
19
49
|
type: Component,
|
|
20
|
-
args: [{ selector: 'cb-dynamic-dialog',
|
|
50
|
+
args: [{ selector: 'cb-dynamic-dialog', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [CbDialog], host: { style: 'display: contents' }, template: `
|
|
51
|
+
<cb-dialog [(visible)]="visible" [header]="header() ?? t().dialog" (onHide)="closed.emit()">
|
|
52
|
+
@if (content()) {
|
|
53
|
+
<p class="cb-dynamic-dialog__text">{{ content() }}</p>
|
|
54
|
+
}
|
|
55
|
+
<ng-content />
|
|
56
|
+
</cb-dialog>
|
|
57
|
+
`, styles: [".cb-dynamic-dialog__text{margin:0}\n"] }]
|
|
21
58
|
}], propDecorators: { visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
|
|
22
59
|
|
|
60
|
+
/** Datos pasados en `config.data`, para inyectar en el componente abierto. */
|
|
61
|
+
const CB_DYNAMIC_DIALOG_DATA = new InjectionToken('CB_DYNAMIC_DIALOG_DATA');
|
|
62
|
+
/**
|
|
63
|
+
* Referencia a un diálogo abierto con `CbDialogService`. El componente abierto
|
|
64
|
+
* puede inyectarla para cerrarse devolviendo un resultado.
|
|
65
|
+
*/
|
|
66
|
+
class CbDynamicDialogRef {
|
|
67
|
+
/** @internal */
|
|
68
|
+
constructor(dispose) {
|
|
69
|
+
this.dispose = dispose;
|
|
70
|
+
this.closed$ = new Subject();
|
|
71
|
+
this.isClosed = false;
|
|
72
|
+
/** Emite el resultado (o `undefined` si se cerró sin él) y completa. */
|
|
73
|
+
this.onClose = this.closed$.asObservable();
|
|
74
|
+
}
|
|
75
|
+
/** Cierra el diálogo devolviendo un resultado opcional. */
|
|
76
|
+
close(result) {
|
|
77
|
+
if (this.isClosed)
|
|
78
|
+
return;
|
|
79
|
+
this.isClosed = true;
|
|
80
|
+
this.dispose();
|
|
81
|
+
this.closed$.next(result);
|
|
82
|
+
this.closed$.complete();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
let nextUid = 0;
|
|
86
|
+
/** @internal */
|
|
87
|
+
const CbDynamicDialogConfigToken = new InjectionToken('CbDynamicDialogConfig');
|
|
88
|
+
/** @internal */
|
|
89
|
+
const CbDynamicDialogComponentToken = new InjectionToken('CbDynamicDialogComponent');
|
|
90
|
+
/** Contenedor visual del diálogo dinámico (uso interno de CbDialogService). */
|
|
91
|
+
class CbDynamicDialogContainer {
|
|
92
|
+
constructor() {
|
|
93
|
+
this.t = injectCbTranslation();
|
|
94
|
+
this.config = inject(CbDynamicDialogConfigToken);
|
|
95
|
+
this.ref = inject(CbDynamicDialogRef);
|
|
96
|
+
this.component = inject(CbDynamicDialogComponentToken);
|
|
97
|
+
this.injector = inject(Injector);
|
|
98
|
+
this.titleId = `cb-dynamic-dialog-${++nextUid}-title`;
|
|
99
|
+
}
|
|
100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDynamicDialogContainer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
101
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDynamicDialogContainer, isStandalone: true, selector: "cb-dynamic-dialog-container", ngImport: i0, template: `
|
|
102
|
+
<div
|
|
103
|
+
class="cb-dynamic-dialog"
|
|
104
|
+
role="dialog"
|
|
105
|
+
aria-modal="true"
|
|
106
|
+
[attr.aria-labelledby]="config.header ? titleId : null"
|
|
107
|
+
[attr.aria-label]="config.header ? null : config.ariaLabel || t().dialog"
|
|
108
|
+
[style.width]="config.width || '32rem'"
|
|
109
|
+
cdkTrapFocus
|
|
110
|
+
cdkTrapFocusAutoCapture
|
|
111
|
+
>
|
|
112
|
+
@if (config.header || config.closable !== false) {
|
|
113
|
+
<header class="cb-dynamic-dialog__header">
|
|
114
|
+
@if (config.header) {
|
|
115
|
+
<h2 class="cb-dynamic-dialog__title" [id]="titleId">{{ config.header }}</h2>
|
|
116
|
+
}
|
|
117
|
+
@if (config.closable !== false) {
|
|
118
|
+
<button type="button" class="cb-dynamic-dialog__close" [attr.aria-label]="t().close" (click)="ref.close()">
|
|
119
|
+
<cb-icon name="x" [size]="16" aria-hidden="true" />
|
|
120
|
+
</button>
|
|
121
|
+
}
|
|
122
|
+
</header>
|
|
123
|
+
}
|
|
124
|
+
<div class="cb-dynamic-dialog__body">
|
|
125
|
+
<ng-container *ngComponentOutlet="component; injector: injector" />
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
`, isInline: true, styles: [".cb-dynamic-dialog{display:flex;flex-direction:column;box-sizing:border-box;max-width:calc(100vw - 2 * var(--cb-space-4, 1rem));max-height:calc(100vh - 2 * var(--cb-space-6, 1.5rem));background:var(--cb-color-surface-raised);color:var(--cb-color-text);border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);box-shadow:var(--cb-shadow-lg);font-family:var(--cb-font-sans);overflow:hidden}.cb-dynamic-dialog__header{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-4, 1rem);padding:var(--cb-space-5, 1.25rem) var(--cb-space-6, 1.5rem);border-bottom:1px solid var(--cb-color-border)}.cb-dynamic-dialog__title{margin:0;font-size:var(--cb-text-lg, 1.125rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong)}.cb-dynamic-dialog__close{flex:none;display:grid;place-items:center;width:2rem;height:2rem;margin-inline-start:auto;border:none;border-radius:var(--cb-radius-md, .5rem);background:transparent;color:var(--cb-color-text-muted);cursor:pointer}.cb-dynamic-dialog__close:hover{background:color-mix(in srgb,var(--cb-color-text) 8%,transparent);color:var(--cb-color-text)}.cb-dynamic-dialog__close:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500));outline-offset:2px}.cb-dynamic-dialog__body{padding:var(--cb-space-5, 1.25rem) var(--cb-space-6, 1.5rem);overflow-y:auto}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
129
|
+
}
|
|
130
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDynamicDialogContainer, decorators: [{
|
|
131
|
+
type: Component,
|
|
132
|
+
args: [{ selector: 'cb-dynamic-dialog-container', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [A11yModule, NgComponentOutlet, CbIcon], template: `
|
|
133
|
+
<div
|
|
134
|
+
class="cb-dynamic-dialog"
|
|
135
|
+
role="dialog"
|
|
136
|
+
aria-modal="true"
|
|
137
|
+
[attr.aria-labelledby]="config.header ? titleId : null"
|
|
138
|
+
[attr.aria-label]="config.header ? null : config.ariaLabel || t().dialog"
|
|
139
|
+
[style.width]="config.width || '32rem'"
|
|
140
|
+
cdkTrapFocus
|
|
141
|
+
cdkTrapFocusAutoCapture
|
|
142
|
+
>
|
|
143
|
+
@if (config.header || config.closable !== false) {
|
|
144
|
+
<header class="cb-dynamic-dialog__header">
|
|
145
|
+
@if (config.header) {
|
|
146
|
+
<h2 class="cb-dynamic-dialog__title" [id]="titleId">{{ config.header }}</h2>
|
|
147
|
+
}
|
|
148
|
+
@if (config.closable !== false) {
|
|
149
|
+
<button type="button" class="cb-dynamic-dialog__close" [attr.aria-label]="t().close" (click)="ref.close()">
|
|
150
|
+
<cb-icon name="x" [size]="16" aria-hidden="true" />
|
|
151
|
+
</button>
|
|
152
|
+
}
|
|
153
|
+
</header>
|
|
154
|
+
}
|
|
155
|
+
<div class="cb-dynamic-dialog__body">
|
|
156
|
+
<ng-container *ngComponentOutlet="component; injector: injector" />
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
`, styles: [".cb-dynamic-dialog{display:flex;flex-direction:column;box-sizing:border-box;max-width:calc(100vw - 2 * var(--cb-space-4, 1rem));max-height:calc(100vh - 2 * var(--cb-space-6, 1.5rem));background:var(--cb-color-surface-raised);color:var(--cb-color-text);border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);box-shadow:var(--cb-shadow-lg);font-family:var(--cb-font-sans);overflow:hidden}.cb-dynamic-dialog__header{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-4, 1rem);padding:var(--cb-space-5, 1.25rem) var(--cb-space-6, 1.5rem);border-bottom:1px solid var(--cb-color-border)}.cb-dynamic-dialog__title{margin:0;font-size:var(--cb-text-lg, 1.125rem);font-weight:var(--cb-font-weight-semibold, 600);color:var(--cb-color-text-strong)}.cb-dynamic-dialog__close{flex:none;display:grid;place-items:center;width:2rem;height:2rem;margin-inline-start:auto;border:none;border-radius:var(--cb-radius-md, .5rem);background:transparent;color:var(--cb-color-text-muted);cursor:pointer}.cb-dynamic-dialog__close:hover{background:color-mix(in srgb,var(--cb-color-text) 8%,transparent);color:var(--cb-color-text)}.cb-dynamic-dialog__close:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500));outline-offset:2px}.cb-dynamic-dialog__body{padding:var(--cb-space-5, 1.25rem) var(--cb-space-6, 1.5rem);overflow-y:auto}\n"] }]
|
|
160
|
+
}] });
|
|
161
|
+
/**
|
|
162
|
+
* Abre componentes dentro de un diálogo modal (como `DialogService` de PrimeNG):
|
|
163
|
+
* trampa de foco, cierre con Escape y fondo, y devolución del foco al cerrar.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* const ref = inject(CbDialogService).open(EditarCliente, {
|
|
168
|
+
* header: 'Editar cliente',
|
|
169
|
+
* data: { id: 42 },
|
|
170
|
+
* });
|
|
171
|
+
* ref.onClose.subscribe((guardado) => { … });
|
|
172
|
+
*
|
|
173
|
+
* // Dentro de EditarCliente:
|
|
174
|
+
* readonly data = inject<{ id: number }>(CB_DYNAMIC_DIALOG_DATA);
|
|
175
|
+
* readonly ref = inject(CbDynamicDialogRef);
|
|
176
|
+
* guardar() { this.ref.close(true); }
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
class CbDialogService {
|
|
180
|
+
constructor() {
|
|
181
|
+
this.overlay = inject(Overlay);
|
|
182
|
+
this.injector = inject(Injector);
|
|
183
|
+
this.document = inject(DOCUMENT);
|
|
184
|
+
}
|
|
185
|
+
open(component, config = {}) {
|
|
186
|
+
const previouslyFocused = this.document.activeElement;
|
|
187
|
+
const overlayRef = this.overlay.create({
|
|
188
|
+
hasBackdrop: true,
|
|
189
|
+
backdropClass: 'cb-dialog-backdrop',
|
|
190
|
+
scrollStrategy: this.overlay.scrollStrategies.block(),
|
|
191
|
+
positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),
|
|
192
|
+
});
|
|
193
|
+
const ref = new CbDynamicDialogRef(() => {
|
|
194
|
+
overlayRef.dispose();
|
|
195
|
+
previouslyFocused?.focus?.();
|
|
196
|
+
});
|
|
197
|
+
const injector = Injector.create({
|
|
198
|
+
parent: this.injector,
|
|
199
|
+
providers: [
|
|
200
|
+
{ provide: CbDynamicDialogRef, useValue: ref },
|
|
201
|
+
{ provide: CB_DYNAMIC_DIALOG_DATA, useValue: config.data },
|
|
202
|
+
{ provide: CbDynamicDialogConfigToken, useValue: config },
|
|
203
|
+
{ provide: CbDynamicDialogComponentToken, useValue: component },
|
|
204
|
+
],
|
|
205
|
+
});
|
|
206
|
+
overlayRef.attach(new ComponentPortal(CbDynamicDialogContainer, null, injector));
|
|
207
|
+
overlayRef.backdropClick().subscribe(() => {
|
|
208
|
+
if (config.dismissableMask !== false)
|
|
209
|
+
ref.close();
|
|
210
|
+
});
|
|
211
|
+
overlayRef.keydownEvents().subscribe((event) => {
|
|
212
|
+
if (event.key === 'Escape' && config.closeOnEscape !== false) {
|
|
213
|
+
event.preventDefault();
|
|
214
|
+
ref.close();
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
return ref;
|
|
218
|
+
}
|
|
219
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
220
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDialogService, providedIn: 'root' }); }
|
|
221
|
+
}
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDialogService, decorators: [{
|
|
223
|
+
type: Injectable,
|
|
224
|
+
args: [{ providedIn: 'root' }]
|
|
225
|
+
}] });
|
|
226
|
+
|
|
23
227
|
/**
|
|
24
228
|
* Generated bundle index. Do not edit.
|
|
25
229
|
*/
|
|
26
230
|
|
|
27
|
-
export { CbDynamicDialog };
|
|
231
|
+
export { CB_DYNAMIC_DIALOG_DATA, CbDialogService, CbDynamicDialog, CbDynamicDialogContainer, CbDynamicDialogRef };
|