@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,34 +1,271 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { model, signal, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { inject, TemplateRef, Directive, ElementRef, model, input, output, contentChild, signal, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
5
|
+
import { CbIcon } from '@caribeng/ui/icon';
|
|
3
6
|
|
|
7
|
+
/** Plantilla de cada elemento de un `<cb-picklist>`. */
|
|
8
|
+
class CbPickListItemTemplate {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.template = inject(TemplateRef);
|
|
11
|
+
}
|
|
12
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPickListItemTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
16
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: CbPickListItemTemplate, isStandalone: true, selector: "ng-template[cbPickListItem]", ngImport: i0 }); }
|
|
17
|
+
}
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPickListItemTemplate, decorators: [{
|
|
19
|
+
type: Directive,
|
|
20
|
+
args: [{ selector: 'ng-template[cbPickListItem]' }]
|
|
21
|
+
}] });
|
|
22
|
+
let nextUid = 0;
|
|
23
|
+
/**
|
|
24
|
+
* PickList de CaribeNG: transfiere elementos entre una lista de disponibles y
|
|
25
|
+
* otra de seleccionados, con botones, doble clic o teclado (Espacio marca,
|
|
26
|
+
* Enter transfiere).
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```html
|
|
30
|
+
* <cb-picklist [(source)]="disponibles" [(target)]="asignados" sourceHeader="Permisos" targetHeader="Asignados">
|
|
31
|
+
* <ng-template cbPickListItem let-permiso>{{ permiso.nombre }}</ng-template>
|
|
32
|
+
* </cb-picklist>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
4
35
|
class CbPickList {
|
|
5
36
|
constructor() {
|
|
37
|
+
this.t = injectCbTranslation();
|
|
38
|
+
this.host = inject(ElementRef);
|
|
39
|
+
this.uid = `cb-picklist-${++nextUid}`;
|
|
40
|
+
/** Elementos disponibles (two-way). */
|
|
6
41
|
this.source = model([], /* @ts-ignore */
|
|
7
42
|
...(ngDevMode ? [{ debugName: "source" }] : /* istanbul ignore next */ []));
|
|
43
|
+
/** Elementos seleccionados (two-way). */
|
|
8
44
|
this.target = model([], /* @ts-ignore */
|
|
9
45
|
...(ngDevMode ? [{ debugName: "target" }] : /* istanbul ignore next */ []));
|
|
10
|
-
|
|
46
|
+
/** Título de la lista de origen. Por defecto, "Disponibles" del idioma activo. */
|
|
47
|
+
this.sourceHeader = input(undefined, /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "sourceHeader" }] : /* istanbul ignore next */ []));
|
|
49
|
+
/** Título de la lista de destino. Por defecto, "Seleccionados" del idioma activo. */
|
|
50
|
+
this.targetHeader = input(undefined, /* @ts-ignore */
|
|
51
|
+
...(ngDevMode ? [{ debugName: "targetHeader" }] : /* istanbul ignore next */ []));
|
|
52
|
+
/** Se emite tras transferir elementos. */
|
|
53
|
+
this.moved = output();
|
|
54
|
+
this.itemTemplate = contentChild(CbPickListItemTemplate, /* @ts-ignore */
|
|
55
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
56
|
+
/** Posiciones marcadas en cada lista. */
|
|
57
|
+
this.selected = signal({ source: new Set(), target: new Set() }, /* @ts-ignore */
|
|
11
58
|
...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
59
|
+
this.focused = signal({ source: 0, target: 0 }, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []));
|
|
61
|
+
}
|
|
62
|
+
headerId(side) {
|
|
63
|
+
return `${this.uid}-${side}`;
|
|
64
|
+
}
|
|
65
|
+
isSelected(side, index) {
|
|
66
|
+
return this.selected()[side].has(index);
|
|
67
|
+
}
|
|
68
|
+
tabbable(side) {
|
|
69
|
+
const max = this.list(side).length - 1;
|
|
70
|
+
return Math.max(0, Math.min(this.focused()[side], max));
|
|
71
|
+
}
|
|
72
|
+
setFocused(side, index) {
|
|
73
|
+
this.focused.update((f) => ({ ...f, [side]: index }));
|
|
74
|
+
}
|
|
75
|
+
toggle(side, index) {
|
|
76
|
+
const next = new Set(this.selected()[side]);
|
|
77
|
+
if (next.has(index))
|
|
78
|
+
next.delete(index);
|
|
79
|
+
else
|
|
80
|
+
next.add(index);
|
|
81
|
+
this.selected.update((s) => ({ ...s, [side]: next }));
|
|
82
|
+
this.setFocused(side, index);
|
|
12
83
|
}
|
|
13
|
-
|
|
14
|
-
move(
|
|
15
|
-
|
|
16
|
-
this.
|
|
84
|
+
/** Transfiere los elementos marcados al lado indicado. */
|
|
85
|
+
move(to) {
|
|
86
|
+
const from = to === 'target' ? 'source' : 'target';
|
|
87
|
+
this.transfer(from, [...this.selected()[from]].sort((a, b) => a - b));
|
|
88
|
+
}
|
|
89
|
+
/** Transfiere todos los elementos al lado indicado. */
|
|
90
|
+
moveAll(to) {
|
|
91
|
+
const from = to === 'target' ? 'source' : 'target';
|
|
92
|
+
this.transfer(from, this.list(from).map((_, i) => i));
|
|
93
|
+
}
|
|
94
|
+
/** Transfiere un único elemento al otro lado (doble clic). */
|
|
95
|
+
moveOne(from, index) {
|
|
96
|
+
this.transfer(from, [index]);
|
|
97
|
+
}
|
|
98
|
+
onKeydown(event, side) {
|
|
99
|
+
const count = this.list(side).length;
|
|
100
|
+
if (!count)
|
|
101
|
+
return;
|
|
102
|
+
const current = this.tabbable(side);
|
|
103
|
+
let target = -1;
|
|
104
|
+
switch (event.key) {
|
|
105
|
+
case 'ArrowDown':
|
|
106
|
+
target = Math.min(count - 1, current + 1);
|
|
107
|
+
break;
|
|
108
|
+
case 'ArrowUp':
|
|
109
|
+
target = Math.max(0, current - 1);
|
|
110
|
+
break;
|
|
111
|
+
case 'Home':
|
|
112
|
+
target = 0;
|
|
113
|
+
break;
|
|
114
|
+
case 'End':
|
|
115
|
+
target = count - 1;
|
|
116
|
+
break;
|
|
117
|
+
case ' ':
|
|
118
|
+
this.toggle(side, current);
|
|
119
|
+
break;
|
|
120
|
+
case 'Enter':
|
|
121
|
+
// Transfiere los marcados; si no hay ninguno, el enfocado.
|
|
122
|
+
if (this.selected()[side].size)
|
|
123
|
+
this.move(side === 'source' ? 'target' : 'source');
|
|
124
|
+
else
|
|
125
|
+
this.moveOne(side, current);
|
|
126
|
+
break;
|
|
127
|
+
default:
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
if (target >= 0) {
|
|
132
|
+
this.setFocused(side, target);
|
|
133
|
+
this.host.nativeElement
|
|
134
|
+
.querySelectorAll(`[data-side="${side}"] [role="option"]`)[target]?.focus();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
list(side) {
|
|
138
|
+
return side === 'source' ? this.source() : this.target();
|
|
139
|
+
}
|
|
140
|
+
transfer(from, indices) {
|
|
141
|
+
if (!indices.length)
|
|
142
|
+
return;
|
|
143
|
+
const to = from === 'source' ? 'target' : 'source';
|
|
144
|
+
const picked = new Set(indices);
|
|
145
|
+
const items = this.list(from).filter((_, i) => picked.has(i));
|
|
146
|
+
const remaining = this.list(from).filter((_, i) => !picked.has(i));
|
|
147
|
+
const destination = [...this.list(to), ...items];
|
|
148
|
+
(from === 'source' ? this.source : this.target).set(remaining);
|
|
149
|
+
(to === 'source' ? this.source : this.target).set(destination);
|
|
150
|
+
this.selected.set({ source: new Set(), target: new Set() });
|
|
151
|
+
this.moved.emit({ to, items });
|
|
17
152
|
}
|
|
18
|
-
else {
|
|
19
|
-
this.target.set(this.target().filter(x => !this.selected().has(x)));
|
|
20
|
-
this.source.set([...this.source(), ...moving]);
|
|
21
|
-
} this.selected.set(new Set()); }
|
|
22
153
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPickList, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
23
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbPickList, isStandalone: true, selector: "cb-picklist", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }
|
|
154
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbPickList, isStandalone: true, selector: "cb-picklist", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: false, transformFunction: null }, target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, sourceHeader: { classPropertyName: "sourceHeader", publicName: "sourceHeader", isSignal: true, isRequired: false, transformFunction: null }, targetHeader: { classPropertyName: "targetHeader", publicName: "targetHeader", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { source: "sourceChange", target: "targetChange", moved: "moved" }, host: { classAttribute: "cb-picklist-host" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: CbPickListItemTemplate, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
155
|
+
<div class="cb-picklist">
|
|
156
|
+
<ng-container *ngTemplateOutlet="listTpl; context: { side: 'source', items: source(), header: sourceHeader() ?? t().available }" />
|
|
157
|
+
|
|
158
|
+
<div class="cb-picklist__controls">
|
|
159
|
+
<button type="button" class="cb-picklist__btn" [attr.aria-label]="t().moveToTarget" [disabled]="!selected().source.size" (click)="move('target')">
|
|
160
|
+
<cb-icon name="chevron-right" [size]="16" aria-hidden="true" />
|
|
161
|
+
</button>
|
|
162
|
+
<button type="button" class="cb-picklist__btn" [attr.aria-label]="t().moveAllToTarget" [disabled]="!source().length" (click)="moveAll('target')">
|
|
163
|
+
<cb-icon name="chevrons-right" [size]="16" aria-hidden="true" />
|
|
164
|
+
</button>
|
|
165
|
+
<button type="button" class="cb-picklist__btn" [attr.aria-label]="t().moveToSource" [disabled]="!selected().target.size" (click)="move('source')">
|
|
166
|
+
<cb-icon name="chevron-left" [size]="16" aria-hidden="true" />
|
|
167
|
+
</button>
|
|
168
|
+
<button type="button" class="cb-picklist__btn" [attr.aria-label]="t().moveAllToSource" [disabled]="!target().length" (click)="moveAll('source')">
|
|
169
|
+
<cb-icon name="chevrons-left" [size]="16" aria-hidden="true" />
|
|
170
|
+
</button>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<ng-container *ngTemplateOutlet="listTpl; context: { side: 'target', items: target(), header: targetHeader() ?? t().selected }" />
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<ng-template #listTpl let-side="side" let-items="items" let-header="header">
|
|
177
|
+
<section class="cb-picklist__panel">
|
|
178
|
+
<div class="cb-picklist__header" [id]="headerId(side)">{{ header }}</div>
|
|
179
|
+
<ul
|
|
180
|
+
class="cb-picklist__list"
|
|
181
|
+
role="listbox"
|
|
182
|
+
aria-multiselectable="true"
|
|
183
|
+
[attr.aria-labelledby]="headerId(side)"
|
|
184
|
+
[attr.data-side]="side"
|
|
185
|
+
(keydown)="onKeydown($event, side)"
|
|
186
|
+
>
|
|
187
|
+
@for (item of items; track $index; let i = $index) {
|
|
188
|
+
<li
|
|
189
|
+
class="cb-picklist__item"
|
|
190
|
+
role="option"
|
|
191
|
+
[attr.aria-selected]="isSelected(side, i)"
|
|
192
|
+
[attr.tabindex]="i === tabbable(side) ? 0 : -1"
|
|
193
|
+
(focus)="setFocused(side, i)"
|
|
194
|
+
(click)="toggle(side, i)"
|
|
195
|
+
(dblclick)="moveOne(side, i)"
|
|
196
|
+
>
|
|
197
|
+
@if (itemTemplate(); as tpl) {
|
|
198
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: item, index: i, list: side }" />
|
|
199
|
+
} @else {
|
|
200
|
+
{{ item }}
|
|
201
|
+
}
|
|
202
|
+
</li>
|
|
203
|
+
}
|
|
204
|
+
</ul>
|
|
205
|
+
</section>
|
|
206
|
+
</ng-template>
|
|
207
|
+
`, isInline: true, styles: [":host{display:block;color:var(--cb-color-text)}.cb-picklist{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:var(--cb-space-3, .75rem);align-items:stretch}.cb-picklist__controls{display:flex;flex-direction:column;justify-content:center;gap:var(--cb-space-2, .5rem)}.cb-picklist__btn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem);background:var(--cb-color-surface-raised);color:var(--cb-color-text);cursor:pointer}.cb-picklist__btn:hover:not(:disabled){border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-600)}.cb-picklist__btn:disabled{opacity:.45;cursor:not-allowed}.cb-picklist__btn:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500));outline-offset:2px}.cb-picklist__panel{display:flex;flex-direction:column;min-width:0;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);background:var(--cb-color-surface-raised);overflow:hidden}.cb-picklist__header{padding:.65rem .85rem;font-weight:var(--cb-font-weight-semibold, 600);border-bottom:1px solid var(--cb-color-border)}.cb-picklist__list{flex:1;height:14rem;margin:0;padding:var(--cb-space-1, .25rem);list-style:none;overflow-y:auto}.cb-picklist__item{padding:.6rem .75rem;border-radius:var(--cb-radius-md, .5rem);cursor:pointer;outline:none;font-size:var(--cb-text-sm, .875rem);-webkit-user-select:none;user-select:none}.cb-picklist__item:hover{background:color-mix(in srgb,var(--cb-color-text) 6%,transparent)}.cb-picklist__item[aria-selected=true]{color:var(--cb-color-primary-700);background:color-mix(in srgb,var(--cb-color-primary-500) 14%,transparent);font-weight:var(--cb-font-weight-medium, 500)}.cb-picklist__item:focus-visible{box-shadow:inset 0 0 0 2px var(--cb-color-focus-ring, var(--cb-color-primary-500))}@media(max-width:640px){.cb-picklist{grid-template-columns:minmax(0,1fr)}.cb-picklist__controls{flex-direction:row;justify-content:center}.cb-picklist__controls cb-icon{transform:rotate(90deg)}}:host-context([data-theme=\"dark\"]) .cb-picklist__item[aria-selected=true]{color:var(--cb-color-primary-300)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CbIcon, selector: "cb-icon", inputs: ["name", "size", "spin", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
24
208
|
}
|
|
25
209
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbPickList, decorators: [{
|
|
26
210
|
type: Component,
|
|
27
|
-
args: [{ selector: 'cb-picklist',
|
|
28
|
-
|
|
211
|
+
args: [{ selector: 'cb-picklist', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [NgTemplateOutlet, CbIcon], host: { class: 'cb-picklist-host' }, template: `
|
|
212
|
+
<div class="cb-picklist">
|
|
213
|
+
<ng-container *ngTemplateOutlet="listTpl; context: { side: 'source', items: source(), header: sourceHeader() ?? t().available }" />
|
|
214
|
+
|
|
215
|
+
<div class="cb-picklist__controls">
|
|
216
|
+
<button type="button" class="cb-picklist__btn" [attr.aria-label]="t().moveToTarget" [disabled]="!selected().source.size" (click)="move('target')">
|
|
217
|
+
<cb-icon name="chevron-right" [size]="16" aria-hidden="true" />
|
|
218
|
+
</button>
|
|
219
|
+
<button type="button" class="cb-picklist__btn" [attr.aria-label]="t().moveAllToTarget" [disabled]="!source().length" (click)="moveAll('target')">
|
|
220
|
+
<cb-icon name="chevrons-right" [size]="16" aria-hidden="true" />
|
|
221
|
+
</button>
|
|
222
|
+
<button type="button" class="cb-picklist__btn" [attr.aria-label]="t().moveToSource" [disabled]="!selected().target.size" (click)="move('source')">
|
|
223
|
+
<cb-icon name="chevron-left" [size]="16" aria-hidden="true" />
|
|
224
|
+
</button>
|
|
225
|
+
<button type="button" class="cb-picklist__btn" [attr.aria-label]="t().moveAllToSource" [disabled]="!target().length" (click)="moveAll('source')">
|
|
226
|
+
<cb-icon name="chevrons-left" [size]="16" aria-hidden="true" />
|
|
227
|
+
</button>
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
<ng-container *ngTemplateOutlet="listTpl; context: { side: 'target', items: target(), header: targetHeader() ?? t().selected }" />
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
<ng-template #listTpl let-side="side" let-items="items" let-header="header">
|
|
234
|
+
<section class="cb-picklist__panel">
|
|
235
|
+
<div class="cb-picklist__header" [id]="headerId(side)">{{ header }}</div>
|
|
236
|
+
<ul
|
|
237
|
+
class="cb-picklist__list"
|
|
238
|
+
role="listbox"
|
|
239
|
+
aria-multiselectable="true"
|
|
240
|
+
[attr.aria-labelledby]="headerId(side)"
|
|
241
|
+
[attr.data-side]="side"
|
|
242
|
+
(keydown)="onKeydown($event, side)"
|
|
243
|
+
>
|
|
244
|
+
@for (item of items; track $index; let i = $index) {
|
|
245
|
+
<li
|
|
246
|
+
class="cb-picklist__item"
|
|
247
|
+
role="option"
|
|
248
|
+
[attr.aria-selected]="isSelected(side, i)"
|
|
249
|
+
[attr.tabindex]="i === tabbable(side) ? 0 : -1"
|
|
250
|
+
(focus)="setFocused(side, i)"
|
|
251
|
+
(click)="toggle(side, i)"
|
|
252
|
+
(dblclick)="moveOne(side, i)"
|
|
253
|
+
>
|
|
254
|
+
@if (itemTemplate(); as tpl) {
|
|
255
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: item, index: i, list: side }" />
|
|
256
|
+
} @else {
|
|
257
|
+
{{ item }}
|
|
258
|
+
}
|
|
259
|
+
</li>
|
|
260
|
+
}
|
|
261
|
+
</ul>
|
|
262
|
+
</section>
|
|
263
|
+
</ng-template>
|
|
264
|
+
`, styles: [":host{display:block;color:var(--cb-color-text)}.cb-picklist{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:var(--cb-space-3, .75rem);align-items:stretch}.cb-picklist__controls{display:flex;flex-direction:column;justify-content:center;gap:var(--cb-space-2, .5rem)}.cb-picklist__btn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem);background:var(--cb-color-surface-raised);color:var(--cb-color-text);cursor:pointer}.cb-picklist__btn:hover:not(:disabled){border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-600)}.cb-picklist__btn:disabled{opacity:.45;cursor:not-allowed}.cb-picklist__btn:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500));outline-offset:2px}.cb-picklist__panel{display:flex;flex-direction:column;min-width:0;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);background:var(--cb-color-surface-raised);overflow:hidden}.cb-picklist__header{padding:.65rem .85rem;font-weight:var(--cb-font-weight-semibold, 600);border-bottom:1px solid var(--cb-color-border)}.cb-picklist__list{flex:1;height:14rem;margin:0;padding:var(--cb-space-1, .25rem);list-style:none;overflow-y:auto}.cb-picklist__item{padding:.6rem .75rem;border-radius:var(--cb-radius-md, .5rem);cursor:pointer;outline:none;font-size:var(--cb-text-sm, .875rem);-webkit-user-select:none;user-select:none}.cb-picklist__item:hover{background:color-mix(in srgb,var(--cb-color-text) 6%,transparent)}.cb-picklist__item[aria-selected=true]{color:var(--cb-color-primary-700);background:color-mix(in srgb,var(--cb-color-primary-500) 14%,transparent);font-weight:var(--cb-font-weight-medium, 500)}.cb-picklist__item:focus-visible{box-shadow:inset 0 0 0 2px var(--cb-color-focus-ring, var(--cb-color-primary-500))}@media(max-width:640px){.cb-picklist{grid-template-columns:minmax(0,1fr)}.cb-picklist__controls{flex-direction:row;justify-content:center}.cb-picklist__controls cb-icon{transform:rotate(90deg)}}:host-context([data-theme=\"dark\"]) .cb-picklist__item[aria-selected=true]{color:var(--cb-color-primary-300)}\n"] }]
|
|
265
|
+
}], propDecorators: { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: false }] }, { type: i0.Output, args: ["sourceChange"] }], target: [{ type: i0.Input, args: [{ isSignal: true, alias: "target", required: false }] }, { type: i0.Output, args: ["targetChange"] }], sourceHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "sourceHeader", required: false }] }], targetHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "targetHeader", required: false }] }], moved: [{ type: i0.Output, args: ["moved"] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CbPickListItemTemplate), { isSignal: true }] }] } });
|
|
29
266
|
|
|
30
267
|
/**
|
|
31
268
|
* Generated bundle index. Do not edit.
|
|
32
269
|
*/
|
|
33
270
|
|
|
34
|
-
export { CbPickList };
|
|
271
|
+
export { CbPickList, CbPickListItemTemplate };
|