@caribeng/ui 22.1.1 → 22.2.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 +48 -8
- package/fesm2022/caribeng-ui-accordion.mjs +2 -2
- package/fesm2022/caribeng-ui-anchor.mjs +169 -0
- package/fesm2022/caribeng-ui-autocomplete.mjs +10 -8
- package/fesm2022/caribeng-ui-avatargroup.mjs +9 -3
- package/fesm2022/caribeng-ui-blockui.mjs +12 -4
- package/fesm2022/caribeng-ui-breadcrumb.mjs +5 -2
- 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 +2598 -303
- package/fesm2022/caribeng-ui-chip.mjs +9 -4
- package/fesm2022/caribeng-ui-chips.mjs +9 -5
- package/fesm2022/caribeng-ui-colorpicker.mjs +9 -7
- package/fesm2022/caribeng-ui-confirmdialog.mjs +74 -9
- package/fesm2022/caribeng-ui-confirmpopup.mjs +134 -9
- package/fesm2022/caribeng-ui-contextmenu.mjs +6 -3
- package/fesm2022/caribeng-ui-dataview.mjs +211 -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 +6 -3
- package/fesm2022/caribeng-ui-drawer.mjs +10 -7
- package/fesm2022/caribeng-ui-dynamicdialog.mjs +210 -6
- package/fesm2022/caribeng-ui-editor.mjs +4392 -243
- package/fesm2022/caribeng-ui-empty.mjs +80 -0
- package/fesm2022/caribeng-ui-file-card.mjs +2 -2
- package/fesm2022/caribeng-ui-fileupload.mjs +96 -19
- package/fesm2022/caribeng-ui-floatlabel.mjs +4 -2
- package/fesm2022/caribeng-ui-folder-card.mjs +10 -3
- package/fesm2022/caribeng-ui-galleria.mjs +76 -45
- package/fesm2022/caribeng-ui-image.mjs +52 -29
- 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 +14 -11
- package/fesm2022/caribeng-ui-inputotp.mjs +12 -6
- package/fesm2022/caribeng-ui-keyfilter.mjs +72 -0
- package/fesm2022/caribeng-ui-listbox.mjs +13 -11
- package/fesm2022/caribeng-ui-megamenu.mjs +222 -30
- package/fesm2022/caribeng-ui-menu.mjs +11 -5
- package/fesm2022/caribeng-ui-menubar.mjs +10 -5
- package/fesm2022/caribeng-ui-message.mjs +7 -4
- 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 +12 -7
- package/fesm2022/caribeng-ui-paginator.mjs +18 -15
- package/fesm2022/caribeng-ui-panel.mjs +5 -2
- package/fesm2022/caribeng-ui-panelmenu.mjs +6 -3
- package/fesm2022/caribeng-ui-password.mjs +8 -6
- package/fesm2022/caribeng-ui-pdfviewer.mjs +1553 -0
- package/fesm2022/caribeng-ui-picklist.mjs +251 -14
- package/fesm2022/caribeng-ui-pricing.mjs +17 -14
- 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-scrollpanel.mjs +6 -3
- package/fesm2022/caribeng-ui-scrolltop.mjs +6 -3
- package/fesm2022/caribeng-ui-select.mjs +379 -87
- package/fesm2022/caribeng-ui-selectbutton.mjs +2 -2
- 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 +8 -5
- package/fesm2022/caribeng-ui-steps.mjs +6 -3
- package/fesm2022/caribeng-ui-table.mjs +708 -82
- package/fesm2022/caribeng-ui-tabmenu.mjs +6 -3
- 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 +9 -6
- 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 +829 -6
- package/package.json +53 -3
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.js +125 -0
- package/schematics/ng-add/schema.js +2 -0
- package/schematics/ng-add/schema.json +66 -0
- package/styles/caribeng.css +380 -0
- package/styles/scss/_mixins.scss +46 -0
- package/styles/scss/_overlay.scss +15 -0
- package/styles/scss/_tokens.scss +267 -0
- package/styles/scss/_utilities.scss +73 -0
- package/styles/scss/_variables.scss +33 -0
- package/styles/scss/index.scss +16 -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-blockui.d.ts +9 -4
- package/types/caribeng-ui-breadcrumb.d.ts +3 -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 +469 -44
- package/types/caribeng-ui-chip.d.ts +6 -0
- package/types/caribeng-ui-chips.d.ts +6 -2
- package/types/caribeng-ui-colorpicker.d.ts +3 -1
- package/types/caribeng-ui-confirmdialog.d.ts +25 -6
- package/types/caribeng-ui-confirmpopup.d.ts +37 -5
- package/types/caribeng-ui-contextmenu.d.ts +4 -1
- package/types/caribeng-ui-dataview.d.ts +63 -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 +4 -1
- package/types/caribeng-ui-drawer.d.ts +4 -1
- 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 +1 -1
- package/types/caribeng-ui-fileupload.d.ts +27 -4
- package/types/caribeng-ui-folder-card.d.ts +4 -1
- 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 +5 -0
- package/types/caribeng-ui-inputotp.d.ts +7 -2
- 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 +26 -2
- package/types/caribeng-ui-menu.d.ts +7 -2
- package/types/caribeng-ui-menubar.d.ts +5 -1
- package/types/caribeng-ui-message.d.ts +3 -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 +4 -1
- package/types/caribeng-ui-password.d.ts +4 -2
- package/types/caribeng-ui-pdfviewer.d.ts +258 -0
- package/types/caribeng-ui-picklist.d.ts +67 -7
- package/types/caribeng-ui-pricing.d.ts +8 -5
- 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-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 +3 -0
- package/types/caribeng-ui-steps.d.ts +4 -1
- package/types/caribeng-ui-table.d.ts +184 -16
- package/types/caribeng-ui-tabmenu.d.ts +4 -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 +5 -2
- 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 +501 -12
|
@@ -1,27 +1,232 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, model, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { inject, TemplateRef, Directive, input, model, contentChild, linkedSignal, computed, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { injectCbTranslation } from '@caribeng/ui';
|
|
5
|
+
import { CbPaginator } from '@caribeng/ui/paginator';
|
|
3
6
|
|
|
7
|
+
/** Plantilla de cada elemento de un `<cb-dataview>`. */
|
|
8
|
+
class CbDataViewItemTemplate {
|
|
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: CbDataViewItemTemplate, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
16
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: CbDataViewItemTemplate, isStandalone: true, selector: "ng-template[cbDataViewItem]", ngImport: i0 }); }
|
|
17
|
+
}
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDataViewItemTemplate, decorators: [{
|
|
19
|
+
type: Directive,
|
|
20
|
+
args: [{ selector: 'ng-template[cbDataViewItem]' }]
|
|
21
|
+
}] });
|
|
22
|
+
/** Contenido de la cabecera de un `<cb-dataview>` (título, filtros, acciones…). */
|
|
23
|
+
class CbDataViewHeader {
|
|
24
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDataViewHeader, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
25
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: CbDataViewHeader, isStandalone: true, selector: "[cbDataViewHeader]", ngImport: i0 }); }
|
|
26
|
+
}
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDataViewHeader, decorators: [{
|
|
28
|
+
type: Directive,
|
|
29
|
+
args: [{ selector: '[cbDataViewHeader]' }]
|
|
30
|
+
}] });
|
|
31
|
+
/**
|
|
32
|
+
* DataView de CaribeNG: muestra una colección en lista o cuadrícula con la
|
|
33
|
+
* plantilla que definas, paginación opcional y botones para cambiar la vista.
|
|
34
|
+
* Sin plantilla, usa una tarjeta con título, categoría, descripción y botón
|
|
35
|
+
* de selección.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```html
|
|
39
|
+
* <cb-dataview [value]="productos" [(layout)]="vista" [rows]="6" showLayoutToggle>
|
|
40
|
+
* <h3 cbDataViewHeader>Productos</h3>
|
|
41
|
+
* <ng-template cbDataViewItem let-producto let-layout="layout">
|
|
42
|
+
* <app-producto [producto]="producto" [compacto]="layout === 'list'" />
|
|
43
|
+
* </ng-template>
|
|
44
|
+
* </cb-dataview>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
4
47
|
class CbDataView {
|
|
5
48
|
constructor() {
|
|
49
|
+
this.t = injectCbTranslation();
|
|
50
|
+
/** Colección a mostrar. */
|
|
6
51
|
this.value = input([], /* @ts-ignore */
|
|
7
52
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
53
|
+
/** Vista: cuadrícula o lista (two-way). */
|
|
8
54
|
this.layout = model('grid', /* @ts-ignore */
|
|
9
55
|
...(ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []));
|
|
56
|
+
/** Muestra los botones para cambiar entre lista y cuadrícula. */
|
|
57
|
+
this.showLayoutToggle = input(false, { ...(ngDevMode ? { debugName: "showLayoutToggle" } : /* istanbul ignore next */ {}), transform: toBoolean });
|
|
58
|
+
/** Elementos por página; 0 (por defecto) muestra todos sin paginador. */
|
|
59
|
+
this.rows = input(0, /* @ts-ignore */
|
|
60
|
+
...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
61
|
+
/** Propiedad que identifica cada elemento (para el seguimiento y la selección). */
|
|
62
|
+
this.dataKey = input('id', /* @ts-ignore */
|
|
63
|
+
...(ngDevMode ? [{ debugName: "dataKey" }] : /* istanbul ignore next */ []));
|
|
64
|
+
/** Elemento seleccionado con la presentación por defecto (two-way). */
|
|
10
65
|
this.selection = model(null, /* @ts-ignore */
|
|
11
66
|
...(ngDevMode ? [{ debugName: "selection" }] : /* istanbul ignore next */ []));
|
|
12
|
-
|
|
67
|
+
/** Mensaje cuando no hay elementos. Por defecto, el del idioma activo. */
|
|
68
|
+
this.emptyMessage = input(undefined, /* @ts-ignore */
|
|
13
69
|
...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
|
|
70
|
+
this.itemTemplate = contentChild(CbDataViewItemTemplate, /* @ts-ignore */
|
|
71
|
+
...(ngDevMode ? [{ debugName: "itemTemplate" }] : /* istanbul ignore next */ []));
|
|
72
|
+
this.header = contentChild(CbDataViewHeader, /* @ts-ignore */
|
|
73
|
+
...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
|
|
74
|
+
/** Índice del primer elemento de la página actual; vuelve a 0 si cambia la colección. */
|
|
75
|
+
this.first = linkedSignal({ ...(ngDevMode ? { debugName: "first" } : /* istanbul ignore next */ {}), source: this.value, computation: () => 0 });
|
|
76
|
+
this.page = computed(() => {
|
|
77
|
+
const rows = this.rows();
|
|
78
|
+
return rows > 0 ? this.value().slice(this.first(), this.first() + rows) : this.value();
|
|
79
|
+
}, /* @ts-ignore */
|
|
80
|
+
...(ngDevMode ? [{ debugName: "page" }] : /* istanbul ignore next */ []));
|
|
81
|
+
}
|
|
82
|
+
trackKey(item, index) {
|
|
83
|
+
const key = item?.[this.dataKey()];
|
|
84
|
+
return key ?? index;
|
|
85
|
+
}
|
|
86
|
+
isSelected(item) {
|
|
87
|
+
const sel = this.selection();
|
|
88
|
+
return !!sel && this.trackKey(sel, -1) === this.trackKey(item, -2);
|
|
89
|
+
}
|
|
90
|
+
asItem(item) {
|
|
91
|
+
return item;
|
|
14
92
|
}
|
|
15
93
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDataView, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDataView, isStandalone: true, selector: "cb-dataview", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null },
|
|
94
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: CbDataView, isStandalone: true, selector: "cb-dataview", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, layout: { classPropertyName: "layout", publicName: "layout", isSignal: true, isRequired: false, transformFunction: null }, showLayoutToggle: { classPropertyName: "showLayoutToggle", publicName: "showLayoutToggle", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { layout: "layoutChange", selection: "selectionChange" }, host: { classAttribute: "cb-dataview-host" }, queries: [{ propertyName: "itemTemplate", first: true, predicate: CbDataViewItemTemplate, descendants: true, isSignal: true }, { propertyName: "header", first: true, predicate: CbDataViewHeader, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
95
|
+
@if (showLayoutToggle() || header()) {
|
|
96
|
+
<div class="cb-dataview__header">
|
|
97
|
+
<div class="cb-dataview__title"><ng-content select="[cbDataViewHeader]" /></div>
|
|
98
|
+
@if (showLayoutToggle()) {
|
|
99
|
+
<div class="cb-dataview__layouts" role="group" [attr.aria-label]="t().changeLayout">
|
|
100
|
+
<button
|
|
101
|
+
type="button"
|
|
102
|
+
class="cb-dataview__layout-btn"
|
|
103
|
+
[attr.aria-pressed]="layout() === 'list'"
|
|
104
|
+
[attr.aria-label]="t().listView"
|
|
105
|
+
(click)="layout.set('list')"
|
|
106
|
+
>
|
|
107
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><line x1="8" y1="6" x2="21" y2="6" /><line x1="8" y1="12" x2="21" y2="12" /><line x1="8" y1="18" x2="21" y2="18" /><line x1="3" y1="6" x2="3.01" y2="6" /><line x1="3" y1="12" x2="3.01" y2="12" /><line x1="3" y1="18" x2="3.01" y2="18" /></svg>
|
|
108
|
+
</button>
|
|
109
|
+
<button
|
|
110
|
+
type="button"
|
|
111
|
+
class="cb-dataview__layout-btn"
|
|
112
|
+
[attr.aria-pressed]="layout() === 'grid'"
|
|
113
|
+
[attr.aria-label]="t().gridView"
|
|
114
|
+
(click)="layout.set('grid')"
|
|
115
|
+
>
|
|
116
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="7" height="7" /><rect x="14" y="3" width="7" height="7" /><rect x="3" y="14" width="7" height="7" /><rect x="14" y="14" width="7" height="7" /></svg>
|
|
117
|
+
</button>
|
|
118
|
+
</div>
|
|
119
|
+
}
|
|
120
|
+
</div>
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
<div class="cb-dataview" [attr.data-layout]="layout()" role="list">
|
|
124
|
+
@for (item of page(); track trackKey(item, $index); let i = $index) {
|
|
125
|
+
<div class="cb-dataview__cell" role="listitem">
|
|
126
|
+
@if (itemTemplate(); as tpl) {
|
|
127
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: item, layout: layout(), index: first() + i }" />
|
|
128
|
+
} @else {
|
|
129
|
+
<article class="cb-dataview__item">
|
|
130
|
+
<strong class="cb-dataview__item-title">{{ asItem(item).title }}</strong>
|
|
131
|
+
@if (asItem(item).category) {
|
|
132
|
+
<small>{{ asItem(item).category }}</small>
|
|
133
|
+
}
|
|
134
|
+
@if (asItem(item).description) {
|
|
135
|
+
<p>{{ asItem(item).description }}</p>
|
|
136
|
+
}
|
|
137
|
+
<button
|
|
138
|
+
type="button"
|
|
139
|
+
class="cb-dataview__select"
|
|
140
|
+
[attr.aria-pressed]="isSelected(item)"
|
|
141
|
+
(click)="selection.set(asItem(item))"
|
|
142
|
+
>
|
|
143
|
+
{{ t().select }}
|
|
144
|
+
</button>
|
|
145
|
+
</article>
|
|
146
|
+
}
|
|
147
|
+
</div>
|
|
148
|
+
} @empty {
|
|
149
|
+
<p class="cb-dataview__empty">{{ emptyMessage() ?? t().noResults }}</p>
|
|
150
|
+
}
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
@if (rows() > 0 && value().length > rows()) {
|
|
154
|
+
<cb-paginator class="cb-dataview__paginator" [totalRecords]="value().length" [rows]="rows()" [(first)]="first" />
|
|
155
|
+
}
|
|
156
|
+
`, isInline: true, styles: [":host{display:block;color:var(--cb-color-text)}.cb-dataview__header{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);margin-bottom:var(--cb-space-3, .75rem)}.cb-dataview__title{min-width:0}.cb-dataview__layouts{display:inline-flex;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem);overflow:hidden}.cb-dataview__layout-btn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:0;background:transparent;color:var(--cb-color-text-muted);cursor:pointer}.cb-dataview__layout-btn+.cb-dataview__layout-btn{border-inline-start:1px solid var(--cb-color-border)}.cb-dataview__layout-btn[aria-pressed=true]{color:var(--cb-color-primary-600);background:color-mix(in srgb,var(--cb-color-primary-500) 12%,transparent)}.cb-dataview__layout-btn:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500));outline-offset:-2px}.cb-dataview{display:grid;gap:var(--cb-space-3, .75rem)}.cb-dataview[data-layout=grid]{grid-template-columns:repeat(auto-fill,minmax(min(14rem,100%),1fr))}.cb-dataview__item{height:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:var(--cb-space-1, .25rem);padding:var(--cb-space-4, 1rem);border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);background:var(--cb-color-surface-raised)}.cb-dataview[data-layout=list] .cb-dataview__item{flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:var(--cb-space-3, .75rem)}.cb-dataview__item-title{color:var(--cb-color-text-strong)}.cb-dataview__item small{color:var(--cb-color-text-muted)}.cb-dataview__item p{margin:0;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem)}.cb-dataview[data-layout=list] .cb-dataview__item p{flex:1 1 12rem}.cb-dataview__select{align-self:flex-start;margin-top:auto;padding:.35rem .75rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem);background:transparent;color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-sm, .875rem);cursor:pointer}.cb-dataview[data-layout=list] .cb-dataview__select{margin-top:0;margin-inline-start:auto}.cb-dataview__select[aria-pressed=true]{border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-700);background:color-mix(in srgb,var(--cb-color-primary-500) 12%,transparent)}.cb-dataview__empty{grid-column:1 / -1;margin:0;padding:var(--cb-space-6, 1.5rem);text-align:center;color:var(--cb-color-text-muted)}.cb-dataview__paginator{margin-top:var(--cb-space-3, .75rem)}:host-context([data-theme=\"dark\"]) .cb-dataview__select[aria-pressed=true]{color:var(--cb-color-primary-300)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CbPaginator, selector: "cb-paginator", inputs: ["totalRecords", "rows", "first", "rowsPerPageOptions", "showReport", "maxPageLinks"], outputs: ["rowsChange", "firstChange", "pageChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
17
157
|
}
|
|
18
158
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CbDataView, decorators: [{
|
|
19
159
|
type: Component,
|
|
20
|
-
args: [{ selector: 'cb-dataview',
|
|
21
|
-
|
|
160
|
+
args: [{ selector: 'cb-dataview', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.Emulated, imports: [NgTemplateOutlet, CbPaginator], host: { class: 'cb-dataview-host' }, template: `
|
|
161
|
+
@if (showLayoutToggle() || header()) {
|
|
162
|
+
<div class="cb-dataview__header">
|
|
163
|
+
<div class="cb-dataview__title"><ng-content select="[cbDataViewHeader]" /></div>
|
|
164
|
+
@if (showLayoutToggle()) {
|
|
165
|
+
<div class="cb-dataview__layouts" role="group" [attr.aria-label]="t().changeLayout">
|
|
166
|
+
<button
|
|
167
|
+
type="button"
|
|
168
|
+
class="cb-dataview__layout-btn"
|
|
169
|
+
[attr.aria-pressed]="layout() === 'list'"
|
|
170
|
+
[attr.aria-label]="t().listView"
|
|
171
|
+
(click)="layout.set('list')"
|
|
172
|
+
>
|
|
173
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><line x1="8" y1="6" x2="21" y2="6" /><line x1="8" y1="12" x2="21" y2="12" /><line x1="8" y1="18" x2="21" y2="18" /><line x1="3" y1="6" x2="3.01" y2="6" /><line x1="3" y1="12" x2="3.01" y2="12" /><line x1="3" y1="18" x2="3.01" y2="18" /></svg>
|
|
174
|
+
</button>
|
|
175
|
+
<button
|
|
176
|
+
type="button"
|
|
177
|
+
class="cb-dataview__layout-btn"
|
|
178
|
+
[attr.aria-pressed]="layout() === 'grid'"
|
|
179
|
+
[attr.aria-label]="t().gridView"
|
|
180
|
+
(click)="layout.set('grid')"
|
|
181
|
+
>
|
|
182
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="7" height="7" /><rect x="14" y="3" width="7" height="7" /><rect x="3" y="14" width="7" height="7" /><rect x="14" y="14" width="7" height="7" /></svg>
|
|
183
|
+
</button>
|
|
184
|
+
</div>
|
|
185
|
+
}
|
|
186
|
+
</div>
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
<div class="cb-dataview" [attr.data-layout]="layout()" role="list">
|
|
190
|
+
@for (item of page(); track trackKey(item, $index); let i = $index) {
|
|
191
|
+
<div class="cb-dataview__cell" role="listitem">
|
|
192
|
+
@if (itemTemplate(); as tpl) {
|
|
193
|
+
<ng-container *ngTemplateOutlet="tpl.template; context: { $implicit: item, layout: layout(), index: first() + i }" />
|
|
194
|
+
} @else {
|
|
195
|
+
<article class="cb-dataview__item">
|
|
196
|
+
<strong class="cb-dataview__item-title">{{ asItem(item).title }}</strong>
|
|
197
|
+
@if (asItem(item).category) {
|
|
198
|
+
<small>{{ asItem(item).category }}</small>
|
|
199
|
+
}
|
|
200
|
+
@if (asItem(item).description) {
|
|
201
|
+
<p>{{ asItem(item).description }}</p>
|
|
202
|
+
}
|
|
203
|
+
<button
|
|
204
|
+
type="button"
|
|
205
|
+
class="cb-dataview__select"
|
|
206
|
+
[attr.aria-pressed]="isSelected(item)"
|
|
207
|
+
(click)="selection.set(asItem(item))"
|
|
208
|
+
>
|
|
209
|
+
{{ t().select }}
|
|
210
|
+
</button>
|
|
211
|
+
</article>
|
|
212
|
+
}
|
|
213
|
+
</div>
|
|
214
|
+
} @empty {
|
|
215
|
+
<p class="cb-dataview__empty">{{ emptyMessage() ?? t().noResults }}</p>
|
|
216
|
+
}
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
@if (rows() > 0 && value().length > rows()) {
|
|
220
|
+
<cb-paginator class="cb-dataview__paginator" [totalRecords]="value().length" [rows]="rows()" [(first)]="first" />
|
|
221
|
+
}
|
|
222
|
+
`, styles: [":host{display:block;color:var(--cb-color-text)}.cb-dataview__header{display:flex;align-items:center;justify-content:space-between;gap:var(--cb-space-3, .75rem);margin-bottom:var(--cb-space-3, .75rem)}.cb-dataview__title{min-width:0}.cb-dataview__layouts{display:inline-flex;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem);overflow:hidden}.cb-dataview__layout-btn{display:inline-flex;align-items:center;justify-content:center;width:2.25rem;height:2.25rem;padding:0;border:0;background:transparent;color:var(--cb-color-text-muted);cursor:pointer}.cb-dataview__layout-btn+.cb-dataview__layout-btn{border-inline-start:1px solid var(--cb-color-border)}.cb-dataview__layout-btn[aria-pressed=true]{color:var(--cb-color-primary-600);background:color-mix(in srgb,var(--cb-color-primary-500) 12%,transparent)}.cb-dataview__layout-btn:focus-visible{outline:2px solid var(--cb-color-focus-ring, var(--cb-color-primary-500));outline-offset:-2px}.cb-dataview{display:grid;gap:var(--cb-space-3, .75rem)}.cb-dataview[data-layout=grid]{grid-template-columns:repeat(auto-fill,minmax(min(14rem,100%),1fr))}.cb-dataview__item{height:100%;box-sizing:border-box;display:flex;flex-direction:column;gap:var(--cb-space-1, .25rem);padding:var(--cb-space-4, 1rem);border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-lg, .75rem);background:var(--cb-color-surface-raised)}.cb-dataview[data-layout=list] .cb-dataview__item{flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:var(--cb-space-3, .75rem)}.cb-dataview__item-title{color:var(--cb-color-text-strong)}.cb-dataview__item small{color:var(--cb-color-text-muted)}.cb-dataview__item p{margin:0;color:var(--cb-color-text-muted);font-size:var(--cb-text-sm, .875rem)}.cb-dataview[data-layout=list] .cb-dataview__item p{flex:1 1 12rem}.cb-dataview__select{align-self:flex-start;margin-top:auto;padding:.35rem .75rem;border:1px solid var(--cb-color-border);border-radius:var(--cb-radius-md, .5rem);background:transparent;color:var(--cb-color-text);font:inherit;font-size:var(--cb-text-sm, .875rem);cursor:pointer}.cb-dataview[data-layout=list] .cb-dataview__select{margin-top:0;margin-inline-start:auto}.cb-dataview__select[aria-pressed=true]{border-color:var(--cb-color-primary-500);color:var(--cb-color-primary-700);background:color-mix(in srgb,var(--cb-color-primary-500) 12%,transparent)}.cb-dataview__empty{grid-column:1 / -1;margin:0;padding:var(--cb-space-6, 1.5rem);text-align:center;color:var(--cb-color-text-muted)}.cb-dataview__paginator{margin-top:var(--cb-space-3, .75rem)}:host-context([data-theme=\"dark\"]) .cb-dataview__select[aria-pressed=true]{color:var(--cb-color-primary-300)}\n"] }]
|
|
223
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], layout: [{ type: i0.Input, args: [{ isSignal: true, alias: "layout", required: false }] }, { type: i0.Output, args: ["layoutChange"] }], showLayoutToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLayoutToggle", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }, { type: i0.Output, args: ["selectionChange"] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CbDataViewItemTemplate), { isSignal: true }] }], header: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CbDataViewHeader), { isSignal: true }] }] } });
|
|
224
|
+
function toBoolean(value) {
|
|
225
|
+
return value !== false && value != null && `${value}` !== 'false';
|
|
226
|
+
}
|
|
22
227
|
|
|
23
228
|
/**
|
|
24
229
|
* Generated bundle index. Do not edit.
|
|
25
230
|
*/
|
|
26
231
|
|
|
27
|
-
export { CbDataView };
|
|
232
|
+
export { CbDataView, CbDataViewHeader, CbDataViewItemTemplate };
|