@c80/ui 1.0.57 → 1.0.62
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/esm2022/index.js +13 -8
- package/esm2022/index.js.map +1 -1
- package/esm2022/lib/action-list/action-list.component.js +7 -0
- package/esm2022/lib/action-list/action-list.component.js.map +1 -1
- package/esm2022/lib/action-list/action-list.types.js.map +1 -1
- package/esm2022/lib/card-level/card-level.component.js +4 -3
- package/esm2022/lib/card-level/card-level.component.js.map +1 -1
- package/esm2022/lib/card-level/card-level.interface.js.map +1 -1
- package/esm2022/lib/card-level/index.js.map +1 -1
- package/esm2022/lib/error-notification/error-notification.component.js +41 -0
- package/esm2022/lib/error-notification/error-notification.component.js.map +1 -0
- package/esm2022/lib/error-notification/error-notification.types.js +2 -0
- package/esm2022/lib/error-notification/error-notification.types.js.map +1 -0
- package/esm2022/lib/error-notification/index.js +3 -0
- package/esm2022/lib/error-notification/index.js.map +1 -0
- package/esm2022/lib/header/header.component.js +8 -2
- package/esm2022/lib/header/header.component.js.map +1 -1
- package/esm2022/lib/header/header.types.js.map +1 -1
- package/esm2022/lib/icon/icon.component.js +11 -5
- package/esm2022/lib/icon/icon.component.js.map +1 -1
- package/esm2022/lib/icon/icon.definitions.js +108 -2
- package/esm2022/lib/icon/icon.definitions.js.map +1 -1
- package/esm2022/lib/icon/icon.types.js.map +1 -1
- package/esm2022/lib/icon/icon.utils.js +7 -0
- package/esm2022/lib/icon/icon.utils.js.map +1 -1
- package/esm2022/lib/icon/theme.service.js +20 -0
- package/esm2022/lib/icon/theme.service.js.map +1 -1
- package/esm2022/lib/info-list/info-list.component.js +3 -0
- package/esm2022/lib/info-list/info-list.component.js.map +1 -1
- package/esm2022/lib/input-field/input-field.component.js +19 -2
- package/esm2022/lib/input-field/input-field.component.js.map +1 -1
- package/esm2022/lib/input-search/c80-input-search.component.js +26 -0
- package/esm2022/lib/input-search/c80-input-search.component.js.map +1 -0
- package/esm2022/lib/input-search/index.js +2 -0
- package/esm2022/lib/input-search/index.js.map +1 -0
- package/esm2022/lib/modal/index.js.map +1 -1
- package/esm2022/lib/modal/modal.component.js +59 -2
- package/esm2022/lib/modal/modal.component.js.map +1 -1
- package/esm2022/lib/modal/modal.service.js +60 -3
- package/esm2022/lib/modal/modal.service.js.map +1 -1
- package/esm2022/lib/modal/modal.types.js +2 -0
- package/esm2022/lib/modal/modal.types.js.map +1 -0
- package/esm2022/lib/profile-stats/profile-stats.component.js +6 -2
- package/esm2022/lib/profile-stats/profile-stats.component.js.map +1 -1
- package/esm2022/lib/profile-stats/profile-stats.types.js.map +1 -1
- package/esm2022/lib/rating-display/index.js +2 -0
- package/esm2022/lib/rating-display/index.js.map +1 -0
- package/esm2022/lib/rating-display/rating-display.component.js +24 -0
- package/esm2022/lib/rating-display/rating-display.component.js.map +1 -0
- package/esm2022/lib/rating-stars/index.js +2 -0
- package/esm2022/lib/rating-stars/index.js.map +1 -0
- package/esm2022/lib/rating-stars/rating-stars.component.js +33 -0
- package/esm2022/lib/rating-stars/rating-stars.component.js.map +1 -0
- package/esm2022/lib/select/index.js +1 -1
- package/esm2022/lib/select/index.js.map +1 -1
- package/esm2022/lib/select/select.component.js +31 -1
- package/esm2022/lib/select/select.component.js.map +1 -1
- package/esm2022/lib/select/select.types.js +2 -0
- package/esm2022/lib/select/select.types.js.map +1 -0
- package/esm2022/lib/snackbar/index.js.map +1 -1
- package/esm2022/lib/snackbar/snackbar.component.js +19 -2
- package/esm2022/lib/snackbar/snackbar.component.js.map +1 -1
- package/esm2022/lib/snackbar/snackbar.service.js +9 -0
- package/esm2022/lib/snackbar/snackbar.service.js.map +1 -1
- package/esm2022/lib/snackbar/snackbar.types.js +2 -0
- package/esm2022/lib/snackbar/{snackbar.model.js.map → snackbar.types.js.map} +1 -1
- package/esm2022/lib/spinner/index.js +2 -0
- package/esm2022/lib/spinner/index.js.map +1 -0
- package/esm2022/lib/spinner/spinner.component.js +22 -0
- package/esm2022/lib/spinner/spinner.component.js.map +1 -0
- package/esm2022/lib/stat-card/index.js.map +1 -1
- package/esm2022/lib/stat-card/stat-card.component.js +3 -0
- package/esm2022/lib/stat-card/stat-card.component.js.map +1 -1
- package/esm2022/lib/stat-card/stat-card.types.js +2 -0
- package/esm2022/lib/stat-card/stat-card.types.js.map +1 -0
- package/esm2022/lib/tab/c80-tab.component.js +19 -2
- package/esm2022/lib/tab/c80-tab.component.js.map +1 -1
- package/esm2022/lib/tab/c80-tab.types.js +2 -0
- package/esm2022/lib/tab/c80-tab.types.js.map +1 -0
- package/esm2022/lib/tab/directives/c80-tab-item.directive.js +3 -0
- package/esm2022/lib/tab/directives/c80-tab-item.directive.js.map +1 -1
- package/esm2022/lib/tab/directives/c80-tab-label.directive.js +3 -0
- package/esm2022/lib/tab/directives/c80-tab-label.directive.js.map +1 -1
- package/esm2022/lib/tab/index.js.map +1 -1
- package/esm2022/lib/table/index.js +2 -0
- package/esm2022/lib/table/index.js.map +1 -1
- package/esm2022/lib/table/table-column-visibility.service.js +27 -34
- package/esm2022/lib/table/table-column-visibility.service.js.map +1 -1
- package/esm2022/lib/table/table-crud-state.service.js +7 -7
- package/esm2022/lib/table/table-crud-state.service.js.map +1 -1
- package/esm2022/lib/table/table-data-converter.service.js +18 -10
- package/esm2022/lib/table/table-data-converter.service.js.map +1 -1
- package/esm2022/lib/table/table-data-utils.service.js +18 -4
- package/esm2022/lib/table/table-data-utils.service.js.map +1 -1
- package/esm2022/lib/table/table-dto-mapper.service.js +98 -0
- package/esm2022/lib/table/table-dto-mapper.service.js.map +1 -0
- package/esm2022/lib/table/table-pagination.service.js +79 -0
- package/esm2022/lib/table/table-pagination.service.js.map +1 -0
- package/esm2022/lib/table/table-selection.service.js +14 -3
- package/esm2022/lib/table/table-selection.service.js.map +1 -1
- package/esm2022/lib/table/table.component.js +124 -22
- package/esm2022/lib/table/table.component.js.map +1 -1
- package/esm2022/lib/table/table.types.js.map +1 -1
- package/esm2022/lib/table/table.utils.js +10 -2
- package/esm2022/lib/table/table.utils.js.map +1 -1
- package/index.d.ts +13 -8
- package/lib/action-list/action-list.component.d.ts +7 -0
- package/lib/action-list/action-list.types.d.ts +2 -1
- package/lib/card-level/card-level.component.d.ts +4 -1
- package/lib/error-notification/error-notification.component.d.ts +20 -0
- package/lib/error-notification/error-notification.types.d.ts +4 -0
- package/lib/error-notification/index.d.ts +2 -0
- package/lib/header/header.component.d.ts +7 -1
- package/lib/header/header.types.d.ts +2 -0
- package/lib/icon/icon.component.d.ts +8 -0
- package/lib/icon/icon.types.d.ts +2 -0
- package/lib/icon/icon.utils.d.ts +7 -0
- package/lib/icon/theme.service.d.ts +17 -0
- package/lib/info-list/info-list.component.d.ts +3 -0
- package/lib/input-field/input-field.component.d.ts +17 -0
- package/lib/input-search/c80-input-search.component.d.ts +16 -0
- package/lib/input-search/index.d.ts +1 -0
- package/lib/modal/index.d.ts +1 -0
- package/lib/modal/modal.component.d.ts +58 -16
- package/lib/modal/modal.service.d.ts +73 -4
- package/lib/modal/modal.types.d.ts +15 -0
- package/lib/profile-stats/profile-stats.component.d.ts +4 -0
- package/lib/profile-stats/profile-stats.types.d.ts +6 -2
- package/lib/rating-display/index.d.ts +1 -0
- package/lib/rating-display/rating-display.component.d.ts +12 -0
- package/lib/rating-stars/index.d.ts +1 -0
- package/lib/rating-stars/rating-stars.component.d.ts +19 -0
- package/lib/select/index.d.ts +1 -1
- package/lib/select/select.component.d.ts +29 -1
- package/lib/snackbar/index.d.ts +1 -1
- package/lib/snackbar/snackbar.component.d.ts +18 -1
- package/lib/snackbar/snackbar.service.d.ts +10 -1
- package/lib/spinner/index.d.ts +1 -0
- package/lib/spinner/spinner.component.d.ts +12 -0
- package/lib/stat-card/index.d.ts +1 -0
- package/lib/stat-card/stat-card.component.d.ts +4 -7
- package/lib/stat-card/stat-card.types.d.ts +7 -0
- package/lib/tab/c80-tab.component.d.ts +17 -0
- package/lib/tab/directives/c80-tab-item.directive.d.ts +3 -0
- package/lib/tab/directives/c80-tab-label.directive.d.ts +3 -0
- package/lib/tab/index.d.ts +1 -1
- package/lib/table/index.d.ts +2 -0
- package/lib/table/table-column-visibility.service.d.ts +19 -6
- package/lib/table/table-crud-state.service.d.ts +23 -13
- package/lib/table/table-data-converter.service.d.ts +2 -0
- package/lib/table/table-data-utils.service.d.ts +7 -0
- package/lib/table/table-dto-mapper.service.d.ts +34 -0
- package/lib/table/table-pagination.service.d.ts +41 -0
- package/lib/table/table-selection.service.d.ts +14 -12
- package/lib/table/table.component.d.ts +27 -3
- package/lib/table/table.types.d.ts +17 -1
- package/lib/table/table.utils.d.ts +4 -1
- package/package.json +1 -1
- package/esm2022/lib/select/select.model.js +0 -2
- package/esm2022/lib/select/select.model.js.map +0 -1
- package/esm2022/lib/snackbar/snackbar.model.js +0 -2
- package/esm2022/lib/tab/c80-tab.model.js +0 -2
- package/esm2022/lib/tab/c80-tab.model.js.map +0 -1
- /package/lib/select/{select.model.d.ts → select.types.d.ts} +0 -0
- /package/lib/snackbar/{snackbar.model.d.ts → snackbar.types.d.ts} +0 -0
- /package/lib/tab/{c80-tab.model.d.ts → c80-tab.types.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/select/select.component.ts","../../../../../libs/ui/src/lib/select/select.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAmB,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;AAGhI,IAAI,eAAe,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/select/select.component.ts","../../../../../libs/ui/src/lib/select/select.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAmB,uBAAuB,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAA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AAC,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,gBAAgB;QACd,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAClC,IAAI,YAAY,KAAK,IAAI,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YACxD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;QAC5B,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC;QACxE,OAAO,QAAQ,EAAE,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;IAC/C,CAAC;IAED;;OAEG;IACH,aAAa;QACX,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvB,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAED;;;OAGG;IACH,cAAc,CAAC,IAAY;QACzB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,WAAW;QACT,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;wGAzHU,eAAe;4FAAf,eAAe,u5CCjB5B,i0EA6CM;;4FD5BO,eAAe;kBAT3B,SAAS;+BAEE,YAAY,cACV,IAAI,WACP,EAAE,mBAGM,uBAAuB,CAAC,MAAM;whCA6BgB,aAAa","sourcesContent":["import { type ElementRef, ChangeDetectionStrategy, Component, computed, input, output, signal, viewChild } from '@angular/core';\nimport type { SelectOption } from './select.types';\n\nlet uniqueIdCounter = 0;\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-select',\n standalone: true,\n imports: [],\n templateUrl: './select.component.html',\n styleUrl: './select.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SelectComponent<T = string> {\n readonly label = input.required<string>();\n /* v8 ignore next */\n readonly placeholder = input<string>('Seleccionar');\n /* v8 ignore next */\n readonly value = input<T | null>(null);\n /* v8 ignore next */\n readonly options = input<SelectOption<T>[]>([]);\n /* v8 ignore next */\n readonly disabled = input<boolean>(false);\n /* v8 ignore next */\n readonly loading = input<boolean>(false);\n /* v8 ignore next */\n readonly emptyMessage = input<string>('No hay opciones disponibles');\n /* v8 ignore next */\n readonly maxHeight = input<string>('300px');\n /* v8 ignore next */\n readonly filterable = input<boolean>(false);\n\n readonly valueChange = output<T | null>();\n readonly opened = output<void>();\n\n /* v8 ignore next */\n readonly isOpen = signal(false);\n /* v8 ignore next */\n readonly searchTerm = signal<string>('');\n readonly controlId = `c80-select-${++uniqueIdCounter}`;\n readonly searchInput = viewChild<ElementRef<HTMLInputElement>>('searchInput');\n\n readonly filteredOptions = computed(() => {\n const term = this.normalizeString(this.searchTerm());\n if (!term || !this.filterable()) {\n return this.options();\n }\n return this.options().filter(opt =>\n opt.label.toLowerCase().includes(term)\n );\n });\n\n normalizeString(str: string): string {\n return str.toLowerCase().trim();\n }\n\n /**\n *\n */\n toggleDropdown(): void {\n if (this.disabled() || this.loading()) {\n return;\n }\n\n const wasOpen = this.isOpen();\n this.isOpen.set(!wasOpen);\n\n if (wasOpen) {\n this.clearSearch();\n } else {\n this.opened.emit();\n if (this.filterable()) {\n /* v8 ignore next 2 */\n setTimeout(() => this.searchInput()?.nativeElement.focus(), 0);\n }\n }\n }\n\n /**\n *\n * @param option\n */\n selectOption(option: SelectOption<T>): void {\n if (option.disabled) {\n return;\n }\n\n this.valueChange.emit(option.value);\n this.isOpen.set(false);\n }\n\n /**\n *\n */\n selectNull(): void {\n this.valueChange.emit(null);\n this.isOpen.set(false);\n }\n\n /**\n *\n * @returns Etiqueta del valor seleccionado o placeholder\n */\n getSelectedLabel(): string {\n const currentValue = this.value();\n if (currentValue === null || currentValue === undefined) {\n return this.placeholder();\n }\n\n const selected = this.options().find(opt => opt.value === currentValue);\n return selected?.label ?? this.placeholder();\n }\n\n /**\n *\n */\n closeDropdown(): void {\n this.isOpen.set(false);\n this.clearSearch();\n }\n\n /**\n *\n * @param term\n */\n onSearchChange(term: string): void {\n this.searchTerm.set(term);\n }\n\n /**\n *\n */\n clearSearch(): void {\n this.searchTerm.set('');\n }\n}\n","<div class=\"k-select\" [class.k-select--disabled]=\"disabled()\" [class.k-select--open]=\"isOpen()\">\n <button type=\"button\" class=\"k-select__control\" [attr.id]=\"controlId\" [attr.aria-label]=\"label()\" [attr.aria-expanded]=\"isOpen()\" [disabled]=\"disabled() || loading()\" (click)=\"toggleDropdown()\" (keydown.enter)=\"toggleDropdown()\"\n (keydown.space)=\"$event.preventDefault(); toggleDropdown()\">\n <span class=\"k-select__value\" [class.k-select__value--placeholder]=\"value() === null\">\n @if (loading()) {\n Cargando...\n } @else {\n {{ getSelectedLabel() }}\n }\n </span>\n <span class=\"k-select__arrow\" [class.k-select__arrow--up]=\"isOpen()\">▼</span>\n </button>\n\n @if (isOpen()) {\n <div class=\"k-select__backdrop\" tabindex=\"-1\" (click)=\"closeDropdown()\" (keydown.escape)=\"closeDropdown()\"></div>\n <!-- eslint-disable-next-line @angular-eslint/template/no-inline-styles -->\n <div class=\"k-select__dropdown\" [style.max-height]=\"maxHeight()\">\n @if (filterable()) {\n <div class=\"k-select__search\">\n <input type=\"text\" class=\"k-select__search-input\" [value]=\"searchTerm()\" (input)=\"onSearchChange($any($event.target).value)\" placeholder=\"Buscar...\" (click)=\"$event.stopPropagation()\" (keydown.escape)=\"closeDropdown()\" #searchInput />\n </div>\n }\n\n <button type=\"button\" class=\"k-select__option\" (click)=\"selectNull()\" (keydown.enter)=\"selectNull()\">\n -- {{ placeholder() }} --\n </button>\n\n @if (loading()) {\n <button type=\"button\" class=\"k-select__option k-select__option--disabled\" disabled>\n Cargando...\n </button>\n } @else if (filteredOptions().length === 0) {\n <button type=\"button\" class=\"k-select__option k-select__option--disabled\" disabled>\n {{ searchTerm() ? 'No se encontraron resultados' : emptyMessage() }}\n </button>\n } @else {\n @for (option of filteredOptions(); track option.value) {\n <button type=\"button\" class=\"k-select__option\" [class.k-select__option--selected]=\"option.value === value()\" [class.k-select__option--disabled]=\"option.disabled\" [disabled]=\"option.disabled\" (click)=\"selectOption(option)\"\n (keydown.enter)=\"selectOption(option)\">\n {{ option.label }}\n </button>\n }\n }\n </div>\n }\n</div>"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select.types.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/select/select.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SelectOption<T = string> {\n value: T;\n label: string;\n disabled?: boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { SnackbarComponent } from './snackbar.component';\nexport { SnackbarService } from './snackbar.service';\nexport type { SnackbarConfig, SnackbarData } from './snackbar.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { SnackbarComponent } from './snackbar.component';\nexport { SnackbarService } from './snackbar.service';\nexport type { SnackbarConfig, SnackbarData } from './snackbar.types';\n"]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Component, computed, signal, ElementRef, inject, Renderer2, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
3
6
|
export class SnackbarComponent {
|
|
4
7
|
elementRef = inject(ElementRef);
|
|
5
8
|
renderer = inject(Renderer2);
|
|
@@ -10,6 +13,10 @@ export class SnackbarComponent {
|
|
|
10
13
|
visible = signal(false, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
11
14
|
timerId;
|
|
12
15
|
panelClasses = computed(() => this.data()?.config.panelClass.join(' ') ?? '', ...(ngDevMode ? [{ debugName: "panelClasses" }] : []));
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param data
|
|
19
|
+
*/
|
|
13
20
|
show(data) {
|
|
14
21
|
this.clearTimer();
|
|
15
22
|
this.data.set(data);
|
|
@@ -21,18 +28,28 @@ export class SnackbarComponent {
|
|
|
21
28
|
this.timerId = setTimeout(() => this.dismiss(), data.config.duration);
|
|
22
29
|
}
|
|
23
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
24
34
|
dismiss() {
|
|
25
35
|
this.visible.set(false);
|
|
26
36
|
this.clearTimer();
|
|
27
37
|
// Marcar para revisión de cambios con OnPush
|
|
28
38
|
this.cdr.markForCheck();
|
|
29
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
30
43
|
clearTimer() {
|
|
31
44
|
if (this.timerId !== undefined) {
|
|
32
45
|
clearTimeout(this.timerId);
|
|
33
46
|
this.timerId = undefined;
|
|
34
47
|
}
|
|
35
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param config
|
|
52
|
+
*/
|
|
36
53
|
applyPosition(config) {
|
|
37
54
|
const host = this.elementRef.nativeElement;
|
|
38
55
|
const { verticalPosition, horizontalPosition } = config;
|
|
@@ -50,10 +67,10 @@ export class SnackbarComponent {
|
|
|
50
67
|
}
|
|
51
68
|
}
|
|
52
69
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SnackbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
53
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: SnackbarComponent, isStandalone: true, selector: "c80-snackbar", ngImport: i0, template: "@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}", styles: [":host{position:fixed;z-index:9999;pointer-events:none}.snackbar{display:flex;align-items:center;gap:.75rem;padding
|
|
70
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: SnackbarComponent, isStandalone: true, selector: "c80-snackbar", ngImport: i0, template: "@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}", styles: [":host{position:fixed;z-index:9999;pointer-events:none}.snackbar{display:flex;align-items:center;gap:.75rem;padding:1rem 1.25rem;background:var(--color-bg-secondary);color:var(--color-text-primary);border:1px solid var(--color-border-default);border-radius:.5rem;box-shadow:var(--shadow-lg);pointer-events:auto;animation:slideIn .3s ease-out;min-width:20rem;max-width:35rem}.snackbar-message{flex:1;font-size:.875rem;line-height:1.5;font-weight:500}.snackbar-action{background:transparent;border:1px solid var(--color-border-default);color:var(--color-text-secondary);cursor:pointer;font-size:.75rem;font-weight:600;text-transform:uppercase;padding:.375rem .75rem;border-radius:.375rem;transition:all .2s ease;white-space:nowrap}.snackbar-action:hover{background-color:var(--color-bg-hover);border-color:var(--color-border-medium);color:var(--color-text-primary)}.snackbar-action:active{transform:scale(.98)}.notification-success{background:var(--color-bg-success-light);border-color:var(--color-border-success);color:var(--color-text-success)}.notification-success .snackbar-message{color:var(--color-text-success)}.notification-success .snackbar-action{color:var(--color-text-success);border-color:var(--color-border-success)}.notification-success .snackbar-action:hover{background-color:var(--color-bg-success);border-color:var(--color-border-success)}.notification-error{background:var(--color-bg-danger-light);border-color:var(--color-border-danger);color:var(--color-text-danger)}.notification-error .snackbar-message{color:var(--color-text-danger)}.notification-error .snackbar-action{color:var(--color-text-danger);border-color:var(--color-border-danger)}.notification-error .snackbar-action:hover{background-color:var(--color-bg-danger);border-color:var(--color-border-danger)}@keyframes slideIn{0%{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
54
71
|
}
|
|
55
72
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SnackbarComponent, decorators: [{
|
|
56
73
|
type: Component,
|
|
57
|
-
args: [{ selector: 'c80-snackbar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}", styles: [":host{position:fixed;z-index:9999;pointer-events:none}.snackbar{display:flex;align-items:center;gap:.75rem;padding
|
|
74
|
+
args: [{ selector: 'c80-snackbar', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}", styles: [":host{position:fixed;z-index:9999;pointer-events:none}.snackbar{display:flex;align-items:center;gap:.75rem;padding:1rem 1.25rem;background:var(--color-bg-secondary);color:var(--color-text-primary);border:1px solid var(--color-border-default);border-radius:.5rem;box-shadow:var(--shadow-lg);pointer-events:auto;animation:slideIn .3s ease-out;min-width:20rem;max-width:35rem}.snackbar-message{flex:1;font-size:.875rem;line-height:1.5;font-weight:500}.snackbar-action{background:transparent;border:1px solid var(--color-border-default);color:var(--color-text-secondary);cursor:pointer;font-size:.75rem;font-weight:600;text-transform:uppercase;padding:.375rem .75rem;border-radius:.375rem;transition:all .2s ease;white-space:nowrap}.snackbar-action:hover{background-color:var(--color-bg-hover);border-color:var(--color-border-medium);color:var(--color-text-primary)}.snackbar-action:active{transform:scale(.98)}.notification-success{background:var(--color-bg-success-light);border-color:var(--color-border-success);color:var(--color-text-success)}.notification-success .snackbar-message{color:var(--color-text-success)}.notification-success .snackbar-action{color:var(--color-text-success);border-color:var(--color-border-success)}.notification-success .snackbar-action:hover{background-color:var(--color-bg-success);border-color:var(--color-border-success)}.notification-error{background:var(--color-bg-danger-light);border-color:var(--color-border-danger);color:var(--color-text-danger)}.notification-error .snackbar-message{color:var(--color-text-danger)}.notification-error .snackbar-action{color:var(--color-text-danger);border-color:var(--color-border-danger)}.notification-error .snackbar-action:hover{background-color:var(--color-bg-danger);border-color:var(--color-border-danger)}@keyframes slideIn{0%{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}\n"] }]
|
|
58
75
|
}] });
|
|
59
76
|
//# sourceMappingURL=snackbar.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snackbar.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.component.ts","../../../../../libs/ui/src/lib/snackbar/snackbar.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;;
|
|
1
|
+
{"version":3,"file":"snackbar.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.component.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1EU,iBAAiB;4FAAjB,iBAAiB,wECd9B,oUASC;;4FDKY,iBAAiB;kBAR7B,SAAS;+BAEE,cAAc,cACZ,IAAI,mBAGC,uBAAuB,CAAC,MAAM","sourcesContent":["import { Component, computed, signal, ElementRef, inject, Renderer2, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';\nimport type { SnackbarData } from './snackbar.types';\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-snackbar',\n standalone: true,\n templateUrl: './snackbar.component.html',\n styleUrl: './snackbar.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SnackbarComponent {\n private readonly elementRef = inject(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly cdr = inject(ChangeDetectorRef);\n\n /* v8 ignore next */\n readonly data = signal<SnackbarData | null>(null);\n /* v8 ignore next */\n readonly visible = signal(false);\n\n private timerId?: ReturnType<typeof setTimeout>;\n\n readonly panelClasses = computed(() => this.data()?.config.panelClass.join(' ') ?? '');\n\n /**\n *\n * @param data\n */\n show(data: SnackbarData): void {\n this.clearTimer();\n this.data.set(data);\n this.applyPosition(data.config);\n this.visible.set(true);\n\n // Marcar para revisión de cambios con OnPush\n this.cdr.markForCheck();\n\n if (data.config.duration > 0) {\n this.timerId = setTimeout(() => this.dismiss(), data.config.duration);\n }\n }\n\n /**\n *\n */\n dismiss(): void {\n this.visible.set(false);\n this.clearTimer();\n\n // Marcar para revisión de cambios con OnPush\n this.cdr.markForCheck();\n }\n\n /**\n *\n */\n private clearTimer(): void {\n if (this.timerId !== undefined) {\n clearTimeout(this.timerId);\n this.timerId = undefined;\n }\n }\n\n /**\n *\n * @param config\n */\n private applyPosition(config: SnackbarData['config']): void {\n const host = this.elementRef.nativeElement;\n const { verticalPosition, horizontalPosition } = config;\n\n const positions = ['top', 'bottom', 'left', 'right', 'transform'];\n for (const pos of positions) {\n this.renderer.removeStyle(host, pos);\n }\n\n this.renderer.setStyle(host, verticalPosition, '1rem');\n\n if (horizontalPosition === 'center') {\n this.renderer.setStyle(host, 'left', '50%');\n this.renderer.setStyle(host, 'transform', 'translateX(-50%)');\n } else {\n this.renderer.setStyle(host, horizontalPosition, '1rem');\n }\n }\n}\n","@if (visible() && data(); as snackData) {\n<div class=\"snackbar\" [class]=\"panelClasses()\">\n <span class=\"snackbar-message\">{{ snackData.message }}</span>\n @if (snackData.action) {\n <button class=\"snackbar-action\" type=\"button\" (click)=\"dismiss()\">\n {{ snackData.action }}\n </button>\n }\n</div>\n}"]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Injectable, inject, ApplicationRef, createComponent, EnvironmentInjector } from '@angular/core';
|
|
2
2
|
import { SnackbarComponent } from './snackbar.component';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
4
7
|
export class SnackbarService {
|
|
5
8
|
appRef = inject(ApplicationRef);
|
|
6
9
|
injector = inject(EnvironmentInjector);
|
|
@@ -11,6 +14,12 @@ export class SnackbarService {
|
|
|
11
14
|
verticalPosition: 'top',
|
|
12
15
|
panelClass: [],
|
|
13
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @param message
|
|
20
|
+
* @param action
|
|
21
|
+
* @param config
|
|
22
|
+
*/
|
|
14
23
|
open(message, action, config) {
|
|
15
24
|
const mergedConfig = {
|
|
16
25
|
...this.defaultConfig,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snackbar.service.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,MAAM,EACN,cAAc,EACd,eAAe,EACf,mBAAmB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;;
|
|
1
|
+
{"version":3,"file":"snackbar.service.js","sourceRoot":"","sources":["../../../../../libs/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AzCU,eAAe;4GAAf,eAAe,cAFd,MAAM;;4FAEP,eAAe;kBAH3B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import {\n type ComponentRef,\n Injectable,\n inject,\n ApplicationRef,\n createComponent,\n EnvironmentInjector\n} from '@angular/core';\nimport { SnackbarComponent } from './snackbar.component';\nimport type { SnackbarConfig, SnackbarData } from './snackbar.types';\n\n/**\n *\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SnackbarService {\n private readonly appRef = inject(ApplicationRef);\n private readonly injector = inject(EnvironmentInjector);\n private componentRef?: ComponentRef<SnackbarComponent>;\n\n private readonly defaultConfig: Required<SnackbarConfig> = {\n duration: 2000,\n horizontalPosition: 'right',\n verticalPosition: 'top',\n panelClass: [],\n };\n\n /**\n *\n * @param message\n * @param action\n * @param config\n */\n open(message: string, action?: string, config?: SnackbarConfig): void {\n const mergedConfig: Required<SnackbarConfig> = {\n ...this.defaultConfig,\n ...config,\n panelClass: config?.panelClass ?? this.defaultConfig.panelClass,\n };\n\n const data: SnackbarData = {\n message,\n action,\n config: mergedConfig,\n };\n\n if (!this.componentRef) {\n this.componentRef = createComponent(SnackbarComponent, {\n environmentInjector: this.injector,\n });\n\n this.appRef.attachView(this.componentRef.hostView);\n document.body.appendChild(this.componentRef.location.nativeElement);\n }\n\n this.componentRef.instance.show(data);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snackbar.
|
|
1
|
+
{"version":3,"file":"snackbar.types.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/snackbar/snackbar.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface SnackbarConfig {\n duration?: number;\n horizontalPosition?: 'left' | 'center' | 'right';\n verticalPosition?: 'top' | 'bottom';\n panelClass?: string[];\n}\n\nexport interface SnackbarData {\n message: string;\n action?: string;\n config: Required<SnackbarConfig>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/spinner/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC","sourcesContent":["export * from './spinner.component';\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export class SpinnerComponent {
|
|
7
|
+
size = input(40, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
8
|
+
borderWidth = input(3, ...(ngDevMode ? [{ debugName: "borderWidth" }] : []));
|
|
9
|
+
color = input('var(--color-primary)', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
10
|
+
message = input('', ...(ngDevMode ? [{ debugName: "message" }] : []));
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SpinnerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
12
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: SpinnerComponent, isStandalone: true, selector: "c80-spinner", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, borderWidth: { classPropertyName: "borderWidth", publicName: "borderWidth", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--size.px": "size()", "style.--border-width.px": "borderWidth()", "style.--border-top-color": "color()" } }, ngImport: i0, template: "<div class=\"spinner\">\n <div class=\"spinner__circle\"></div>\n @if (message()) {\n <p class=\"spinner__message\">{{ message() }}</p>\n }\n</div>", styles: [".spinner{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--spacing-md)}.spinner__circle{border:var(--border-width, 3px) solid var(--color-border);border-top-color:var(--border-top-color, var(--color-primary));width:var(--size, 40px);height:var(--size, 40px);border-radius:50%;animation:spin .8s linear infinite}.spinner__message{margin:0;color:var(--color-text-secondary);font-size:.875rem;text-align:center}@keyframes spin{to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
13
|
+
}
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: SpinnerComponent, decorators: [{
|
|
15
|
+
type: Component,
|
|
16
|
+
args: [{ selector: 'c80-spinner', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
17
|
+
'[style.--size.px]': 'size()',
|
|
18
|
+
'[style.--border-width.px]': 'borderWidth()',
|
|
19
|
+
'[style.--border-top-color]': 'color()'
|
|
20
|
+
}, template: "<div class=\"spinner\">\n <div class=\"spinner__circle\"></div>\n @if (message()) {\n <p class=\"spinner__message\">{{ message() }}</p>\n }\n</div>", styles: [".spinner{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--spacing-md)}.spinner__circle{border:var(--border-width, 3px) solid var(--color-border);border-top-color:var(--border-top-color, var(--color-primary));width:var(--size, 40px);height:var(--size, 40px);border-radius:50%;animation:spin .8s linear infinite}.spinner__message{margin:0;color:var(--color-text-secondary);font-size:.875rem;text-align:center}@keyframes spin{to{transform:rotate(360deg)}}\n"] }]
|
|
21
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], borderWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderWidth", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }] } });
|
|
22
|
+
//# sourceMappingURL=spinner.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/spinner/spinner.component.ts","../../../../../libs/ui/src/lib/spinner/spinner.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;AAE1E;;GAEG;AAcH,MAAM,OAAO,gBAAgB;IAChB,IAAI,GAAG,KAAK,CAAS,EAAE,gDAAC,CAAC;IACzB,WAAW,GAAG,KAAK,CAAS,CAAC,uDAAC,CAAC;IAC/B,KAAK,GAAG,KAAK,CAAS,sBAAsB,iDAAC,CAAC;IAC9C,OAAO,GAAG,KAAK,CAAS,EAAE,mDAAC,CAAC;wGAJ5B,gBAAgB;4FAAhB,gBAAgB,ktBClB7B,iKAKM;;4FDaO,gBAAgB;kBAb5B,SAAS;+BAEI,aAAa,WACd,EAAE,mBAGM,uBAAuB,CAAC,MAAM,QACzC;wBACF,mBAAmB,EAAE,QAAQ;wBAC7B,2BAA2B,EAAE,eAAe;wBAC5C,4BAA4B,EAAE,SAAS;qBAC1C","sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-spinner',\n imports: [],\n templateUrl: './spinner.component.html',\n styleUrl: './spinner.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[style.--size.px]': 'size()',\n '[style.--border-width.px]': 'borderWidth()',\n '[style.--border-top-color]': 'color()'\n }\n})\nexport class SpinnerComponent {\n readonly size = input<number>(40);\n readonly borderWidth = input<number>(3);\n readonly color = input<string>('var(--color-primary)');\n readonly message = input<string>('');\n}\n","<div class=\"spinner\">\n <div class=\"spinner__circle\"></div>\n @if (message()) {\n <p class=\"spinner__message\">{{ message() }}</p>\n }\n</div>"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './stat-card.component';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC","sourcesContent":["export * from './stat-card.component';\nexport type { CardDef } from './stat-card.types';\n"]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Component, input, ChangeDetectionStrategy } from '@angular/core';
|
|
2
2
|
import { IconComponent } from '../icon';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
4
7
|
export class StatCardComponent {
|
|
5
8
|
/* v8 ignore next */
|
|
6
9
|
cards = input([], ...(ngDevMode ? [{ debugName: "cards" }] : []));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-card.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/stat-card.component.ts","../../../../../libs/ui/src/lib/stat-card/stat-card.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;;
|
|
1
|
+
{"version":3,"file":"stat-card.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/stat-card.component.ts","../../../../../libs/ui/src/lib/stat-card/stat-card.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;;AAGxC;;GAEG;AAUH,MAAM,OAAO,iBAAiB;IAC5B,oBAAoB;IACX,KAAK,GAAG,KAAK,CAAY,EAAE,iDAAC,CAAC;wGAF3B,iBAAiB;4FAAjB,iBAAiB,6MChB9B,+lBAeM,6zBDJM,aAAa;;4FAKZ,iBAAiB;kBAT7B,SAAS;+BAEE,eAAe,cACb,IAAI,WACP,CAAC,aAAa,CAAC,mBAGP,uBAAuB,CAAC,MAAM","sourcesContent":["import { Component, input, ChangeDetectionStrategy } from '@angular/core';\nimport { IconComponent } from '../icon';\nimport type { CardDef } from './stat-card.types';\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-stat-card',\n standalone: true,\n imports: [IconComponent],\n templateUrl: './stat-card.component.html',\n styleUrls: ['./stat-card.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class StatCardComponent {\n /* v8 ignore next */\n readonly cards = input<CardDef[]>([]);\n}\n","<div class=\"stats-section py-4\">\n @for (card of cards(); track card.text) {\n <!-- eslint-disable-next-line @angular-eslint/template/no-inline-styles -->\n <div class=\"stat-card\" [style.border-left-color]=\"card.color\">\n <div class=\"stat-card-content\">\n <div class=\"stat-content\">\n <c80-icon [icon]=\"card.icon\" [color]=\"'secondary'\" [size]=\"1.1\" />\n <div class=\"stat-info\">\n <div class=\"stat-number\">{{ card.count }}</div>\n <div class=\"stat-label\">{{ card.text }}</div>\n </div>\n </div>\n </div>\n </div>\n }\n</div>"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat-card.types.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/stat-card/stat-card.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { IconType } from '../icon/icon.types';\n\nexport interface CardDef {\n color: string; // Acepta cualquier color CSS\n icon: IconType;\n text: string;\n count: number;\n}\n"]}
|
|
@@ -3,31 +3,48 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
3
3
|
import { C80TabItemDirective } from './directives/c80-tab-item.directive';
|
|
4
4
|
import { C80TabLabelDirective } from './directives/c80-tab-label.directive';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
6
9
|
export class TabComponent {
|
|
7
10
|
tabs = contentChildren(C80TabItemDirective, ...(ngDevMode ? [{ debugName: "tabs" }] : []));
|
|
8
11
|
labels = contentChildren(C80TabLabelDirective, ...(ngDevMode ? [{ debugName: "labels" }] : []));
|
|
9
12
|
/* v8 ignore next */
|
|
10
13
|
selectedIndex = model(0, ...(ngDevMode ? [{ debugName: "selectedIndex" }] : []));
|
|
11
14
|
selectedIndexChange = output();
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param index
|
|
18
|
+
*/
|
|
12
19
|
onTabClick(index) {
|
|
13
20
|
this.selectedIndex.set(index);
|
|
14
21
|
this.selectedIndexChange.emit(index);
|
|
15
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @param index
|
|
26
|
+
* @returns Template del contenido del tab o null
|
|
27
|
+
*/
|
|
16
28
|
getTabContent(index) {
|
|
17
29
|
const tabList = this.tabs();
|
|
18
30
|
const tab = tabList[index];
|
|
19
31
|
return tab?.content ?? null;
|
|
20
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param index
|
|
36
|
+
* @returns Template de la etiqueta del tab o null
|
|
37
|
+
*/
|
|
21
38
|
getTabLabel(index) {
|
|
22
39
|
const labelList = this.labels();
|
|
23
40
|
const label = labelList[index];
|
|
24
41
|
return label?.template ?? null;
|
|
25
42
|
}
|
|
26
43
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: TabComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
27
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: TabComponent, isStandalone: true, selector: "c80-tab", inputs: { selectedIndex: { classPropertyName: "selectedIndex", publicName: "selectedIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIndex: "selectedIndexChange", selectedIndexChange: "selectedIndexChange" }, queries: [{ propertyName: "tabs", predicate: C80TabItemDirective, isSignal: true }, { propertyName: "labels", predicate: C80TabLabelDirective, isSignal: true }], ngImport: i0, template: "<div class=\"c80-tab-container\">\n <div class=\"c80-tab-header\">\n <div class=\"c80-tab-labels\">\n @for (tab of tabs(); track $index) {\n <button type=\"button\" class=\"c80-tab-label\" [class.active]=\"selectedIndex() === $index\" (click)=\"onTabClick($index)\">\n @if (getTabLabel($index); as labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n </button>\n }\n </div>\n </div>\n\n <div class=\"c80-tab-body\">\n @for (tab of tabs(); track $index) {\n @if (selectedIndex() === $index) {\n <div class=\"c80-tab-content\">\n <ng-container *ngTemplateOutlet=\"getTabContent($index)\" />\n </div>\n }\n }\n </div>\n</div>", styles: [".c80-tab-container{display:flex;flex-direction:column;height:100%}.c80-tab-header{border-bottom:1px solid
|
|
44
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.10", type: TabComponent, isStandalone: true, selector: "c80-tab", inputs: { selectedIndex: { classPropertyName: "selectedIndex", publicName: "selectedIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedIndex: "selectedIndexChange", selectedIndexChange: "selectedIndexChange" }, queries: [{ propertyName: "tabs", predicate: C80TabItemDirective, isSignal: true }, { propertyName: "labels", predicate: C80TabLabelDirective, isSignal: true }], ngImport: i0, template: "<div class=\"c80-tab-container\">\n <div class=\"c80-tab-header\">\n <div class=\"c80-tab-labels\">\n @for (tab of tabs(); track $index) {\n <button type=\"button\" class=\"c80-tab-label\" [class.active]=\"selectedIndex() === $index\" (click)=\"onTabClick($index)\">\n @if (getTabLabel($index); as labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n </button>\n }\n </div>\n </div>\n\n <div class=\"c80-tab-body\">\n @for (tab of tabs(); track $index) {\n @if (selectedIndex() === $index) {\n <div class=\"c80-tab-content\">\n <ng-container *ngTemplateOutlet=\"getTabContent($index)\" />\n </div>\n }\n }\n </div>\n</div>", styles: [".c80-tab-container{display:flex;flex-direction:column;height:100%}.c80-tab-header{border-bottom:1px solid var(--color-border);background:transparent;margin-bottom:8px}.c80-tab-labels{display:flex;gap:0;width:100%;max-height:40px}.c80-tab-labels button{padding:10px}.c80-tab-label{flex:1;min-width:120px;padding:16px;background:transparent;border:none;border-bottom:1px solid transparent;cursor:pointer;opacity:.7;transition:all .2s;display:flex;align-items:center;justify-content:center;gap:8px;font-family:inherit;font-size:14px;font-weight:500;color:inherit}.c80-tab-label:hover{opacity:.9;background:rgba(var(--color-primary-rgb),.05)}.c80-tab-label.active{opacity:1;border-bottom-color:var(--color-primary);color:var(--color-primary)}.c80-tab-label:focus-visible{outline:none;outline-offset:-2px}.c80-tab-body{flex:1;overflow-y:auto;position:relative}.c80-tab-content{height:100%;animation:fadeIn .2s ease-in;padding:.2rem}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@media(max-width:768px){.c80-tab-label{min-width:80px;padding:12px 8px}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
28
45
|
}
|
|
29
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: TabComponent, decorators: [{
|
|
30
47
|
type: Component,
|
|
31
|
-
args: [{ selector: 'c80-tab', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"c80-tab-container\">\n <div class=\"c80-tab-header\">\n <div class=\"c80-tab-labels\">\n @for (tab of tabs(); track $index) {\n <button type=\"button\" class=\"c80-tab-label\" [class.active]=\"selectedIndex() === $index\" (click)=\"onTabClick($index)\">\n @if (getTabLabel($index); as labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n </button>\n }\n </div>\n </div>\n\n <div class=\"c80-tab-body\">\n @for (tab of tabs(); track $index) {\n @if (selectedIndex() === $index) {\n <div class=\"c80-tab-content\">\n <ng-container *ngTemplateOutlet=\"getTabContent($index)\" />\n </div>\n }\n }\n </div>\n</div>", styles: [".c80-tab-container{display:flex;flex-direction:column;height:100%}.c80-tab-header{border-bottom:1px solid
|
|
48
|
+
args: [{ selector: 'c80-tab', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"c80-tab-container\">\n <div class=\"c80-tab-header\">\n <div class=\"c80-tab-labels\">\n @for (tab of tabs(); track $index) {\n <button type=\"button\" class=\"c80-tab-label\" [class.active]=\"selectedIndex() === $index\" (click)=\"onTabClick($index)\">\n @if (getTabLabel($index); as labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n </button>\n }\n </div>\n </div>\n\n <div class=\"c80-tab-body\">\n @for (tab of tabs(); track $index) {\n @if (selectedIndex() === $index) {\n <div class=\"c80-tab-content\">\n <ng-container *ngTemplateOutlet=\"getTabContent($index)\" />\n </div>\n }\n }\n </div>\n</div>", styles: [".c80-tab-container{display:flex;flex-direction:column;height:100%}.c80-tab-header{border-bottom:1px solid var(--color-border);background:transparent;margin-bottom:8px}.c80-tab-labels{display:flex;gap:0;width:100%;max-height:40px}.c80-tab-labels button{padding:10px}.c80-tab-label{flex:1;min-width:120px;padding:16px;background:transparent;border:none;border-bottom:1px solid transparent;cursor:pointer;opacity:.7;transition:all .2s;display:flex;align-items:center;justify-content:center;gap:8px;font-family:inherit;font-size:14px;font-weight:500;color:inherit}.c80-tab-label:hover{opacity:.9;background:rgba(var(--color-primary-rgb),.05)}.c80-tab-label.active{opacity:1;border-bottom-color:var(--color-primary);color:var(--color-primary)}.c80-tab-label:focus-visible{outline:none;outline-offset:-2px}.c80-tab-body{flex:1;overflow-y:auto;position:relative}.c80-tab-content{height:100%;animation:fadeIn .2s ease-in;padding:.2rem}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@media(max-width:768px){.c80-tab-label{min-width:80px;padding:12px 8px}}\n"] }]
|
|
32
49
|
}], propDecorators: { tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => C80TabItemDirective), { isSignal: true }] }], labels: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => C80TabLabelDirective), { isSignal: true }] }], selectedIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedIndex", required: false }] }, { type: i0.Output, args: ["selectedIndexChange"] }], selectedIndexChange: [{ type: i0.Output, args: ["selectedIndexChange"] }] } });
|
|
33
50
|
//# sourceMappingURL=c80-tab.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c80-tab.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/tab/c80-tab.component.ts","../../../../../libs/ui/src/lib/tab/c80-tab.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAoB,MAAM,eAAe,CAAC;AACrH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;;
|
|
1
|
+
{"version":3,"file":"c80-tab.component.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/tab/c80-tab.component.ts","../../../../../libs/ui/src/lib/tab/c80-tab.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAoB,MAAM,eAAe,CAAC;AACrH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;;AAE5E;;GAEG;AAUH,MAAM,OAAO,YAAY;IACd,IAAI,GAAG,eAAe,CAAsB,mBAAmB,gDAAC,CAAC;IACjE,MAAM,GAAG,eAAe,CAAuB,oBAAoB,kDAAC,CAAC;IAE9E,oBAAoB;IACX,aAAa,GAAG,KAAK,CAAS,CAAC,yDAAC,CAAC;IACjC,mBAAmB,GAAG,MAAM,EAAU,CAAC;IAEhD;;;OAGG;IACH,UAAU,CAAC,KAAa;QACtB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC9B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,aAAa,CAAC,KAAa;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC3B,OAAO,GAAG,EAAE,OAAO,IAAI,IAAI,CAAC;IAC9B,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,KAAa;QACvB,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAChC,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC;IACjC,CAAC;wGArCU,YAAY;4FAAZ,YAAY,mVAC8B,mBAAmB,yDAChB,oBAAoB,6CCnB9E,mtBAsBM,glCDVM,gBAAgB;;4FAKf,YAAY;kBATxB,SAAS;+BAEE,SAAS,cACP,IAAI,WACP,CAAC,gBAAgB,CAAC,mBAGV,uBAAuB,CAAC,MAAM;4FAGM,mBAAmB,2FAChB,oBAAoB","sourcesContent":["import { Component, output, model, ChangeDetectionStrategy, contentChildren, type TemplateRef } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { C80TabItemDirective } from './directives/c80-tab-item.directive';\nimport { C80TabLabelDirective } from './directives/c80-tab-label.directive';\n\n/**\n *\n */\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'c80-tab',\n standalone: true,\n imports: [NgTemplateOutlet],\n templateUrl: './c80-tab.component.html',\n styleUrl: './c80-tab.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TabComponent {\n readonly tabs = contentChildren<C80TabItemDirective>(C80TabItemDirective);\n readonly labels = contentChildren<C80TabLabelDirective>(C80TabLabelDirective);\n\n /* v8 ignore next */\n readonly selectedIndex = model<number>(0);\n readonly selectedIndexChange = output<number>();\n\n /**\n *\n * @param index\n */\n onTabClick(index: number): void {\n this.selectedIndex.set(index);\n this.selectedIndexChange.emit(index);\n }\n\n /**\n *\n * @param index\n * @returns Template del contenido del tab o null\n */\n getTabContent(index: number): TemplateRef<unknown> | null {\n const tabList = this.tabs();\n const tab = tabList[index];\n return tab?.content ?? null;\n }\n\n /**\n *\n * @param index\n * @returns Template de la etiqueta del tab o null\n */\n getTabLabel(index: number): TemplateRef<unknown> | null {\n const labelList = this.labels();\n const label = labelList[index];\n return label?.template ?? null;\n }\n}\n","<div class=\"c80-tab-container\">\n <div class=\"c80-tab-header\">\n <div class=\"c80-tab-labels\">\n @for (tab of tabs(); track $index) {\n <button type=\"button\" class=\"c80-tab-label\" [class.active]=\"selectedIndex() === $index\" (click)=\"onTabClick($index)\">\n @if (getTabLabel($index); as labelTemplate) {\n <ng-container *ngTemplateOutlet=\"labelTemplate\" />\n }\n </button>\n }\n </div>\n </div>\n\n <div class=\"c80-tab-body\">\n @for (tab of tabs(); track $index) {\n @if (selectedIndex() === $index) {\n <div class=\"c80-tab-content\">\n <ng-container *ngTemplateOutlet=\"getTabContent($index)\" />\n </div>\n }\n }\n </div>\n</div>"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"c80-tab.types.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/tab/c80-tab.types.ts"],"names":[],"mappings":"","sourcesContent":["export interface C80Tab {\n readonly label: string;\n readonly icon?: string;\n}\n"]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Directive, inject, TemplateRef } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
3
6
|
export class C80TabItemDirective {
|
|
4
7
|
content = inject((TemplateRef));
|
|
5
8
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: C80TabItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c80-tab-item.directive.js","sourceRoot":"","sources":["../../../../../../libs/ui/src/lib/tab/directives/c80-tab-item.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;
|
|
1
|
+
{"version":3,"file":"c80-tab-item.directive.js","sourceRoot":"","sources":["../../../../../../libs/ui/src/lib/tab/directives/c80-tab-item.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;AAE/D;;GAEG;AAMH,MAAM,OAAO,mBAAmB;IACrB,OAAO,GAAG,MAAM,CAAC,CAAA,WAAoB,CAAA,CAAC,CAAC;wGADrC,mBAAmB;4FAAnB,mBAAmB;;4FAAnB,mBAAmB;kBAL/B,SAAS;mBAAC;oBACT,8DAA8D;oBAC9D,QAAQ,EAAE,WAAW;oBACrB,UAAU,EAAE,IAAI;iBACjB","sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n *\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[tabItem]',\n standalone: true,\n})\nexport class C80TabItemDirective {\n readonly content = inject(TemplateRef<unknown>);\n}\n"]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Directive, inject, TemplateRef } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
3
6
|
export class C80TabLabelDirective {
|
|
4
7
|
template = inject((TemplateRef));
|
|
5
8
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.10", ngImport: i0, type: C80TabLabelDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"c80-tab-label.directive.js","sourceRoot":"","sources":["../../../../../../libs/ui/src/lib/tab/directives/c80-tab-label.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;
|
|
1
|
+
{"version":3,"file":"c80-tab-label.directive.js","sourceRoot":"","sources":["../../../../../../libs/ui/src/lib/tab/directives/c80-tab-label.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;;AAE/D;;GAEG;AAMH,MAAM,OAAO,oBAAoB;IACtB,QAAQ,GAAG,MAAM,CAAC,CAAA,WAAoB,CAAA,CAAC,CAAC;wGADtC,oBAAoB;4FAApB,oBAAoB;;4FAApB,oBAAoB;kBALhC,SAAS;mBAAC;oBACT,8DAA8D;oBAC9D,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,IAAI;iBACjB","sourcesContent":["import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n *\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[tabLabel]',\n standalone: true,\n})\nexport class C80TabLabelDirective {\n readonly template = inject(TemplateRef<unknown>);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/tab/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC","sourcesContent":["export { TabComponent } from './c80-tab.component';\nexport { C80TabItemDirective } from './directives/c80-tab-item.directive';\nexport { C80TabLabelDirective } from './directives/c80-tab-label.directive';\nexport type { C80Tab } from './c80-tab.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/tab/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC","sourcesContent":["export { TabComponent } from './c80-tab.component';\nexport { C80TabItemDirective } from './directives/c80-tab-item.directive';\nexport { C80TabLabelDirective } from './directives/c80-tab-label.directive';\nexport type { C80Tab } from './c80-tab.types';\n"]}
|
|
@@ -6,4 +6,6 @@ export * from './table-column-visibility.service';
|
|
|
6
6
|
export * from './table-data-utils.service';
|
|
7
7
|
export * from './table-selection.service';
|
|
8
8
|
export * from './table-crud-state.service';
|
|
9
|
+
export * from './table-dto-mapper.service';
|
|
10
|
+
export * from './table-pagination.service';
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './table.types';\nexport * from './table.component';\nexport * from './table.utils';\nexport * from './table-data-converter.service';\nexport * from './table-column-visibility.service';\nexport * from './table-data-utils.service';\nexport * from './table-selection.service';\nexport * from './table-crud-state.service';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/ui/src/lib/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './table.types';\nexport * from './table.component';\nexport * from './table.utils';\nexport * from './table-data-converter.service';\nexport * from './table-column-visibility.service';\nexport * from './table-data-utils.service';\nexport * from './table-selection.service';\nexport * from './table-crud-state.service';\nexport * from './table-dto-mapper.service';\nexport * from './table-pagination.service';\n"]}
|
|
@@ -16,13 +16,11 @@ export class TableColumnVisibilityService {
|
|
|
16
16
|
/**
|
|
17
17
|
* Actualiza las keys de columnas visibles basándose en el estado actual
|
|
18
18
|
* @param columns - Definiciones de columnas
|
|
19
|
-
* @param
|
|
20
|
-
* @param creating - Si está en modo creación
|
|
21
|
-
* @param editing - ID de fila en edición (null si no hay edición)
|
|
19
|
+
* @param context - Contexto con datos, estado de creación y edición
|
|
22
20
|
* @returns Array de accessors de columnas visibles
|
|
23
21
|
*/
|
|
24
|
-
updateVisibleKeys(columns,
|
|
25
|
-
const visibleColumns = columns.filter(col => this.isColumnVisibleInHeader(col,
|
|
22
|
+
updateVisibleKeys(columns, context) {
|
|
23
|
+
const visibleColumns = columns.filter(col => this.isColumnVisibleInHeader(col, context));
|
|
26
24
|
return visibleColumns.map(col => col.accessor);
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
@@ -34,52 +32,47 @@ export class TableColumnVisibilityService {
|
|
|
34
32
|
* @returns true si la columna debe ser visible
|
|
35
33
|
*/
|
|
36
34
|
isColumnVisible(column, data, options = {}) {
|
|
37
|
-
|
|
38
|
-
if (column.visible === false) {
|
|
35
|
+
if (column.visible === false)
|
|
39
36
|
return false;
|
|
40
|
-
|
|
41
|
-
// Si no tiene hideIfAllValuesAreNull, mostrar siempre
|
|
42
|
-
if (!column.hideIfAllValuesAreNull) {
|
|
37
|
+
if (!column.hideIfAllValuesAreNull)
|
|
43
38
|
return true;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// CONTEXTO: Modo creación
|
|
39
|
+
return this.checkColumnVisibilityByContext(column, data, options);
|
|
40
|
+
}
|
|
41
|
+
checkColumnVisibilityByContext(column, data, options) {
|
|
48
42
|
if (options.creating) {
|
|
49
|
-
|
|
50
|
-
const creatingRow = options.row;
|
|
51
|
-
if (creatingRow) {
|
|
52
|
-
const cellValue = this.dataUtils.getCellValue(creatingRow, column.accessor);
|
|
53
|
-
return !this.dataConverter.isValueEmpty(cellValue);
|
|
54
|
-
}
|
|
55
|
-
// Si no hay fila, ocultar (valor vacío por defecto)
|
|
56
|
-
return false;
|
|
43
|
+
return this.isVisibleInCreation(column, options.row);
|
|
57
44
|
}
|
|
58
|
-
// CONTEXTO: Fila en edición
|
|
59
45
|
if (options.editing !== undefined && options.editing !== null) {
|
|
60
|
-
|
|
61
|
-
if (editingRow) {
|
|
62
|
-
const cellValue = this.dataUtils.getCellValue(editingRow, column.accessor);
|
|
63
|
-
return !this.dataConverter.isValueEmpty(cellValue);
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
46
|
+
return this.isVisibleInEditing(column, data, { editing: options.editing, row: options.row });
|
|
66
47
|
}
|
|
67
|
-
// CONTEXTO: Vista normal - verificar si todos los valores están vacíos
|
|
68
48
|
return !this.areAllColumnValuesEmpty(column, data);
|
|
69
49
|
}
|
|
50
|
+
isVisibleInCreation(column, row) {
|
|
51
|
+
if (!row)
|
|
52
|
+
return false;
|
|
53
|
+
const cellValue = this.dataUtils.getCellValue(row, column.accessor);
|
|
54
|
+
return !this.dataConverter.isValueEmpty(cellValue);
|
|
55
|
+
}
|
|
56
|
+
isVisibleInEditing(column, data, options) {
|
|
57
|
+
const editingRow = options.row ?? data.find(r => r['id'] === options.editing);
|
|
58
|
+
if (!editingRow)
|
|
59
|
+
return false;
|
|
60
|
+
const cellValue = this.dataUtils.getCellValue(editingRow, column.accessor);
|
|
61
|
+
return !this.dataConverter.isValueEmpty(cellValue);
|
|
62
|
+
}
|
|
70
63
|
/**
|
|
71
64
|
* Determina si una columna debe ser visible en los headers
|
|
72
65
|
* Wrapper para mantener compatibilidad con API existente
|
|
73
66
|
*/
|
|
74
|
-
isColumnVisibleInHeader(column,
|
|
75
|
-
return this.isColumnVisible(column, data, { creating, editing });
|
|
67
|
+
isColumnVisibleInHeader(column, context) {
|
|
68
|
+
return this.isColumnVisible(column, context.data, { creating: context.creating, editing: context.editing });
|
|
76
69
|
}
|
|
77
70
|
/**
|
|
78
71
|
* Determina si una columna debe ser visible en una fila específica
|
|
79
72
|
* Wrapper para mantener compatibilidad con API existente
|
|
80
73
|
*/
|
|
81
|
-
isColumnVisibleForRow(column,
|
|
82
|
-
return this.isColumnVisible(column, data, { editing, row });
|
|
74
|
+
isColumnVisibleForRow(column, context) {
|
|
75
|
+
return this.isColumnVisible(column, context.data, { editing: context.editing, row: context.row });
|
|
83
76
|
}
|
|
84
77
|
/**
|
|
85
78
|
* Verifica si todos los valores de una columna están vacíos/nulos
|