@solcre-org/core-ui 2.15.43 → 2.15.45
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { HostBinding, Directive, input, Component, inject, output, computed, signal, effect, Pipe, Injectable, ElementRef, untracked, HostListener, ViewChild, ViewContainerRef, TemplateRef, InjectionToken, ContentChild, ChangeDetectionStrategy, viewChild, ChangeDetectorRef, afterNextRender, importProvidersFrom } from '@angular/core';
|
|
2
|
+
import { HostBinding, Directive, input, Component, inject, output, computed, signal, effect, Pipe, Injectable, ElementRef, untracked, HostListener, ViewChild, ViewContainerRef, TemplateRef, InjectionToken, ContentChild, ChangeDetectionStrategy, viewChild, ChangeDetectorRef, afterNextRender, makeEnvironmentProviders, importProvidersFrom } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule, DatePipe } from '@angular/common';
|
|
5
5
|
import * as i3 from '@ngx-translate/core';
|
|
@@ -12440,7 +12440,7 @@ class FixedActionsMobileModalComponent {
|
|
|
12440
12440
|
});
|
|
12441
12441
|
shouldShowAction(action) {
|
|
12442
12442
|
if (action.requiredPermission) {
|
|
12443
|
-
const hasPermission = this.permissionService.hasPermission(action.requiredPermission.resource, action.requiredPermission.action);
|
|
12443
|
+
const hasPermission = this.permissionService.hasPermission(action.requiredPermission.resource, action.requiredPermission.action, action.requiredPermission.custom_action);
|
|
12444
12444
|
if (!hasPermission)
|
|
12445
12445
|
return false;
|
|
12446
12446
|
}
|
|
@@ -12449,7 +12449,7 @@ class FixedActionsMobileModalComponent {
|
|
|
12449
12449
|
return action.shouldShow(data.data);
|
|
12450
12450
|
}
|
|
12451
12451
|
if (action.customAction?.requiredPermission) {
|
|
12452
|
-
const hasPermission = this.permissionService.hasPermission(action.customAction.requiredPermission.resource, action.customAction.requiredPermission.action);
|
|
12452
|
+
const hasPermission = this.permissionService.hasPermission(action.customAction.requiredPermission.resource, action.customAction.requiredPermission.action, action.customAction.requiredPermission.custom_action);
|
|
12453
12453
|
if (!hasPermission)
|
|
12454
12454
|
return false;
|
|
12455
12455
|
}
|
|
@@ -12457,7 +12457,7 @@ class FixedActionsMobileModalComponent {
|
|
|
12457
12457
|
return action.customAction.shouldShow(data.data);
|
|
12458
12458
|
}
|
|
12459
12459
|
if (action.globalAction?.requiredPermission) {
|
|
12460
|
-
const hasPermission = this.permissionService.hasPermission(action.globalAction.requiredPermission.resource, action.globalAction.requiredPermission.action);
|
|
12460
|
+
const hasPermission = this.permissionService.hasPermission(action.globalAction.requiredPermission.resource, action.globalAction.requiredPermission.action, action.globalAction.requiredPermission.custom_action);
|
|
12461
12461
|
if (!hasPermission)
|
|
12462
12462
|
return false;
|
|
12463
12463
|
}
|
|
@@ -14738,7 +14738,7 @@ class GenericTableComponent {
|
|
|
14738
14738
|
};
|
|
14739
14739
|
}
|
|
14740
14740
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: GenericTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14741
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: GenericTableComponent, isStandalone: true, selector: "core-generic-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, modalFields: { classPropertyName: "modalFields", publicName: "modalFields", isSignal: true, isRequired: false, transformFunction: null }, modalTabs: { classPropertyName: "modalTabs", publicName: "modalTabs", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: true, transformFunction: null }, customActions: { classPropertyName: "customActions", publicName: "customActions", isSignal: true, isRequired: false, transformFunction: null }, globalActions: { classPropertyName: "globalActions", publicName: "globalActions", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showFilter: { classPropertyName: "showFilter", publicName: "showFilter", isSignal: true, isRequired: false, transformFunction: null }, showSelection: { classPropertyName: "showSelection", publicName: "showSelection", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, filterButtonConfig: { classPropertyName: "filterButtonConfig", publicName: "filterButtonConfig", isSignal: true, isRequired: false, transformFunction: null }, createButtonConfig: { classPropertyName: "createButtonConfig", publicName: "createButtonConfig", isSignal: true, isRequired: false, transformFunction: null }, createButtonText: { classPropertyName: "createButtonText", publicName: "createButtonText", isSignal: true, isRequired: false, transformFunction: null }, dataInput: { classPropertyName: "dataInput", publicName: "dataInput", isSignal: true, isRequired: false, transformFunction: null }, customFilters: { classPropertyName: "customFilters", publicName: "customFilters", isSignal: true, isRequired: false, transformFunction: null }, enablePagination: { classPropertyName: "enablePagination", publicName: "enablePagination", isSignal: true, isRequired: false, transformFunction: null }, modelFactory: { classPropertyName: "modelFactory", publicName: "modelFactory", isSignal: true, isRequired: false, transformFunction: null }, endpoint: { classPropertyName: "endpoint", publicName: "endpoint", isSignal: true, isRequired: false, transformFunction: null }, customParams: { classPropertyName: "customParams", publicName: "customParams", isSignal: true, isRequired: false, transformFunction: null }, customArrayKey: { classPropertyName: "customArrayKey", publicName: "customArrayKey", isSignal: true, isRequired: false, transformFunction: null }, listTitle: { classPropertyName: "listTitle", publicName: "listTitle", isSignal: true, isRequired: false, transformFunction: null }, moreData: { classPropertyName: "moreData", publicName: "moreData", isSignal: true, isRequired: false, transformFunction: null }, inModal: { classPropertyName: "inModal", publicName: "inModal", isSignal: true, isRequired: false, transformFunction: null }, expansionConfig: { classPropertyName: "expansionConfig", publicName: "expansionConfig", isSignal: true, isRequired: false, transformFunction: null }, fileUploadConfig: { classPropertyName: "fileUploadConfig", publicName: "fileUploadConfig", isSignal: true, isRequired: false, transformFunction: null }, rowStyleConfigs: { classPropertyName: "rowStyleConfigs", publicName: "rowStyleConfigs", isSignal: true, isRequired: false, transformFunction: null }, columnDisabledConfigs: { classPropertyName: "columnDisabledConfigs", publicName: "columnDisabledConfigs", isSignal: true, isRequired: false, transformFunction: null }, rowVisibilityConfigs: { classPropertyName: "rowVisibilityConfigs", publicName: "rowVisibilityConfigs", isSignal: true, isRequired: false, transformFunction: null }, headerOrder: { classPropertyName: "headerOrder", publicName: "headerOrder", isSignal: true, isRequired: false, transformFunction: null }, showActiveFilters: { classPropertyName: "showActiveFilters", publicName: "showActiveFilters", isSignal: true, isRequired: false, transformFunction: null }, activeFiltersConfig: { classPropertyName: "activeFiltersConfig", publicName: "activeFiltersConfig", isSignal: true, isRequired: false, transformFunction: null }, sortConfig: { classPropertyName: "sortConfig", publicName: "sortConfig", isSignal: true, isRequired: false, transformFunction: null }, showManualRefresh: { classPropertyName: "showManualRefresh", publicName: "showManualRefresh", isSignal: true, isRequired: false, transformFunction: null }, manualRefreshConfig: { classPropertyName: "manualRefreshConfig", publicName: "manualRefreshConfig", isSignal: true, isRequired: false, transformFunction: null }, refreshButtonConfig: { classPropertyName: "refreshButtonConfig", publicName: "refreshButtonConfig", isSignal: true, isRequired: false, transformFunction: null }, fixedActionsConfig: { classPropertyName: "fixedActionsConfig", publicName: "fixedActionsConfig", isSignal: true, isRequired: false, transformFunction: null }, deletedFilterKey: { classPropertyName: "deletedFilterKey", publicName: "deletedFilterKey", isSignal: true, isRequired: false, transformFunction: null }, scrollTable: { classPropertyName: "scrollTable", publicName: "scrollTable", isSignal: true, isRequired: false, transformFunction: null }, customEdit: { classPropertyName: "customEdit", publicName: "customEdit", isSignal: true, isRequired: false, transformFunction: null }, customDelete: { classPropertyName: "customDelete", publicName: "customDelete", isSignal: true, isRequired: false, transformFunction: null }, customView: { classPropertyName: "customView", publicName: "customView", isSignal: true, isRequired: false, transformFunction: null }, customSave: { classPropertyName: "customSave", publicName: "customSave", isSignal: true, isRequired: false, transformFunction: null }, useCustomSave: { classPropertyName: "useCustomSave", publicName: "useCustomSave", isSignal: true, isRequired: false, transformFunction: null }, onApiError: { classPropertyName: "onApiError", publicName: "onApiError", isSignal: true, isRequired: false, transformFunction: null }, inlineEditConfig: { classPropertyName: "inlineEditConfig", publicName: "inlineEditConfig", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionTriggered: "actionTriggered", selectionChanged: "selectionChanged", dataCreated: "dataCreated", dataUpdated: "dataUpdated", dataDeleted: "dataDeleted", dataFetched: "dataFetched", onMoreDataLoaded: "onMoreDataLoaded", globalActionTriggered: "globalActionTriggered", modalData: "modalData", beforeSave: "beforeSave", onFilterChange: "onFilterChange", onClearFilters: "onClearFilters", activeFilterRemoved: "activeFilterRemoved", activeFiltersCleared: "activeFiltersCleared", dataRefreshed: "dataRefreshed", inlineEditSave: "inlineEditSave", inlineEditModeChanged: "inlineEditModeChanged", inlineEditValidationError: "inlineEditValidationError" }, host: { listeners: { "window:beforeunload": "onBeforeUnload($event)", "document:click": "closeSubmenu()" } }, providers: [TableDataService, FilterService, PaginationService, ModelApiService, InlineEditService], viewQueries: [{ propertyName: "sentinel", first: true, predicate: ["sentinel"], descendants: true }, { propertyName: "dropdownTrigger", first: true, predicate: ["dropdownTrigger"], descendants: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "manualRefreshComponent", first: true, predicate: CoreManualRefreshComponent, descendants: true }], hostDirectives: [{ directive: CoreHostDirective }], ngImport: i0, template: "@if (showActiveFilters()) {\n <core-active-filters\n [activeFilters]=\"currentActiveFilters()\"\n [config]=\"activeFiltersConfig()\"\n (onFilterRemove)=\"onActiveFilterRemove($event)\"\n (onClearAll)=\"onActiveFiltersClear()\">\n </core-active-filters>\n}\n<div class=\"c-table\" [class.c-table--scroll]=\"scrollTable()\" [class.in-modal]=\"inModal()\" [class.inline-edit-mode]=\"inlineEditService.isInlineEditMode()\">\n @if (shouldShowManualRefresh()) {\n <core-manual-refresh \n [config]=\"getManualRefreshConfig()\"\n (onRefresh)=\"onManualRefresh()\">\n </core-manual-refresh>\n }\n <table>\n <thead>\n <tr>\n @if (showSelection()) {\n <!-- Todo: Tabla con row selection -->\n <th class=\"select-column\">\n <input type=\"checkbox\" [checked]=\"isAllSelected()\" (change)=\"masterToggle()\" />\n </th>\n }\n @for (column of columns(); track $index) {\n <th [ngClass]=\"column.align ? 'u-align-' + column.align : ''\">\n @if (isColumnSortable(column)) {\n <button class=\"c-table-order\" tabindex=\"-1\"\n [class.is-asc]=\"getColumnSortState(column) === SortDirection.ASC\"\n [class.is-desc]=\"getColumnSortState(column) === SortDirection.DESC\"\n [class.has-multiple-sorts]=\"isMultiColumnSortEnabled() && getColumnSortPriority(column) !== null\"\n [title]=\"getSortButtonTitle(column)\"\n (click)=\"onColumnHeaderClick(column)\">\n {{ column.label | translate }}\n <!-- @if (isMultiColumnSortEnabled() && getColumnSortPriority(column) !== null) {\n <span class=\"c-table-order__priority\">{{ getColumnSortPriority(column)! + 1 }}</span>\n } -->\n <span class=\"c-table-order__controls\">\n <span class=\"c-table-order__arrow--desc icon-arrow-up\"></span>\n <span class=\"c-table-order__arrow--asc icon-arrow-down\"></span>\n </span>\n </button>\n } @else {\n {{ column.label | translate }}\n }\n </th>\n }\n @if (showActions() && (actions().length > 0 || customActions().length > 0)) {\n <th class=\"u-align-right\">{{ 'table.actions' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of displayedData(); track row.getId()) {\n <tr [ngClass]=\"getRowClasses(row)\" \n [class.is-editable]=\"isRowInEditMode(row.getId())\"\n [class.is-disabled]=\"isRowDisabled(row)\">\n @if (showSelection()) {\n <!-- Todo: Tabla con row selection -->\n <td class=\"select-column\">\n <input type=\"checkbox\" [checked]=\"isRowSelected(row)\" (change)=\"toggleRow(row)\" />\n </td>\n }\n @for (column of columns(); track $index) {\n <td [attr.data-label]=\"column.label | translate\" \n [ngClass]=\"[\n column.align ? 'u-align-' + column.align : '',\n getCellDisabledClasses(row, column)\n ]\" \n [class.is-editing]=\"isColumnEditable(column, row)\"\n [class.is-column-disabled]=\"isColumnDisabledForRow(row, column)\">\n @if (column.template) {\n <!-- Todo: Ver qu\u00E9 es esto -->\n <ng-container *ngTemplateOutlet=\"column.template; context: { $implicit: row, column: column }\"></ng-container>\n } @else if (isColumnEditable(column, row)) {\n <!-- !Solcre: Modo de edici\u00F3n en l\u00EDnea usando DynamicField -->\n <div class=\"c-table__inline-edit\">\n <strong class=\"c-table__mobile-heading\">{{ column.label | translate }}:</strong>\n <div\n coreDynamicField\n [field]=\"getInlineEditableConfigWithState(row, column)!\"\n [value]=\"getEditingValue(row, column)\"\n [mode]=\"ModalMode.EDIT\"\n [errors]=\"getCellErrors(row, column)\"\n [rowData]=\"row\"\n (valueChange)=\"onCellValueChange(row, column, $event)\"\n (onBlurEvent)=\"onCellBlur(row, column)\"\n (onEnterEvent)=\"onCellEnter(row, column)\"\n ></div>\n </div>\n } @else {\n <div class=\"c-table__content\">\n <strong class=\"c-table__mobile-heading\">{{ column.label | translate }}:</strong> {{ getFormattedValue(row,\n column) }}\n </div>\n }\n </td>\n }\n\n <!-- Actions-->\n\n @if (showActions() && (actions().length > 0 || customActions().length > 0 || expansionConfig()?.enabled)) {\n\n <td class=\"u-align-right\">\n <div class=\"c-table__actions\">\n <core-dropdown [rowId]=\"row.getId()\" [extraDefaultActions]=\"getVisibleDefaultActions(row, true)\"\n [extraCustomActions]=\"getVisibleCustomActions(row, true)\" [row]=\"row\"\n [triggerElementId]=\"'dropdown-trigger-' + row.getId()\"\n (actionTriggered)=\"triggerAction($event.action, $event.row)\"\n (customActionTriggered)=\"triggerCustomAction($event.action, $event.row)\" #dropdown>\n </core-dropdown>\n @for (actionConfig of getVisibleDefaultActions(row, false); track actionConfig.action) {\n @if (hasPermission(actionConfig)) {\n @if (actionConfig.action === TableAction.VIEW || actionConfig.action === TableAction.EDIT ||\n actionConfig.action === TableAction.DELETE || actionConfig.action === TableAction.RECOVER) {\n <core-generic-button [config]=\"getActionButtonConfig(actionConfig.action, actionConfig, row)\"\n (buttonClick)=\"onButtonClick($event, actionConfig.action, row)\">\n </core-generic-button>\n }\n }\n }\n @for (customAction of getVisibleCustomActions(row, false); track customAction.label || $index) {\n @if (hasPermission(customAction)) {\n @if (customAction.isSwitch && customAction.switchOptions) {\n <core-generic-switch\n [options]=\"customAction.switchOptions\"\n [selectedValue]=\"customAction.switchValue ? customAction.switchValue(row) : null\"\n [ariaLabel]=\"customAction.switchAriaLabel || customAction.title\"\n (valueChange)=\"onCustomActionSwitchChange($event, customAction, row)\">\n </core-generic-switch>\n } @else {\n <core-generic-button [config]=\"getCustomActionButtonConfigForRow(customAction, row)\"\n (buttonClick)=\"onButtonClick($event, customAction, row)\">\n </core-generic-button>\n }\n }\n }\n\n @for (outsideAction of getOutsideFixedActionsForRow(row); track $index) {\n @if (outsideAction.type === 'table' || outsideAction.type === 'custom' ? hasPermission(outsideAction.config) : true) {\n <core-generic-button \n [config]=\"getOutsideFixedActionButtonConfig(outsideAction, row)\"\n (buttonClick)=\"onOutsideFixedActionClick($event, outsideAction, row)\">\n </core-generic-button>\n }\n }\n\n @if (hasExtraActionsForRow(row)) {\n <core-generic-button [config]=\"getMoreActionsButtonConfig(row.getId())\" [data]=\"row\"\n (buttonClick)=\"onMoreActionsClick($event, row.getId())\" #dropdownTrigger>\n </core-generic-button>\n }\n\n @if (expansionConfig()?.enabled) {\n <!-- \u2705 Solcre: Celda dedicada para expansi\u00F3n en su posici\u00F3n correcta -->\n <core-generic-button [config]=\"getExpandButtonConfig(row)\" (buttonClick)=\"onExpandButtonClick($event, row)\">\n </core-generic-button>\n }\n\n </div> <!-- .c-table__actions -->\n </td> <!-- td parent of .c-table__actions -->\n } <!-- @if (showActions() -->\n\n\n </tr>\n @if (expansionConfig()?.enabled && isRowExpanded(row)) {\n <!-- Todo: Ver que es esto -->\n <tr class=\"expansion-row\" [ngClass]=\"getRowClasses(row)\">\n <td [attr.colspan]=\"displayedColumns().length\" class=\"expansion-content\">\n <ng-container *ngTemplateOutlet=\"expansionConfig()!.template; context: { $implicit: row }\">\n </ng-container>\n </td>\n </tr>\n }\n } @empty {\n <tr>\n <!-- Todo: Estilo .no-data -->\n <td [attr.colspan]=\"displayedColumns().length\">\n <p class=\"c-placeholder\">{{ 'table.noData' | translate }}</p>\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div> <!-- .c-table -->\n\n<!-- Todo: Todo lo que viene dsp de la tabla -->\n\n@if (!enablePagination()) {\n<!-- Todo: Ver qu\u00E9 onda esto -->\n<div #sentinel class=\"sentinel\"></div>\n}\n\n@if (enablePagination()) {\n<core-generic-pagination \n [tableId]=\"tableId\" \n [isServerSide]=\"!!endpoint()\"\n [showPagination]=\"shouldShowPagination()\"\n [showPageSizeSelector]=\"shouldShowPageSizeSelector()\">\n</core-generic-pagination>\n}\n\n<core-generic-modal [isOpen]=\"tableActionService.getIsModalOpen()\" [mode]=\"tableActionService.getModalMode()\"\n [data]=\"tableActionService.getModalData()\" [fields]=\"hasTabs() ? [] : tableActionService.getModalFieldsToShow()\"\n [tabs]=\"hasTabs() ? modalTabs() : []\" [title]=\"tableActionService.getModalTitle()\" [modelFactory]=\"modelFactory() || null\"\n (save)=\"onModalSave($event)\" (close)=\"tableActionService.closeModal()\" (modalData)=\"onModalData($event)\">\n</core-generic-modal>\n\n<core-filter-modal [isOpen]=\"isFilterModalOpen()\" [filters]=\"customFilters()\" [currentFilterValues]=\"currentFilterValues()\" (close)=\"closeFiltersPopup()\"\n (filterChange)=\"handleFilterChange($event)\" (globalFilterChange)=\"applyGlobalFilter($event)\"\n (clearFilters)=\"handleClearFilters()\">\n</core-filter-modal>\n\n@if (shouldShowFixedActions()) {\n <div class=\"c-fixed-actions\" [ngClass]=\"'c-fixed-actions--' + (fixedActionsConfig()?.position || 'right')\">\n @for (action of fixedActionsArray(); track $index) {\n @if (shouldShowFixedAction(action)) {\n <button \n type=\"button\"\n [ngClass]=\"getFixedActionClass(action)\"\n [disabled]=\"isFixedActionDisabled(action)\"\n [title]=\"getFixedActionTooltip(action) || ''\"\n [attr.aria-label]=\"getFixedActionTooltip(action) || action.label || ''\"\n (click)=\"onFixedActionClick(action)\">\n </button>\n }\n }\n </div>\n}\n\n<core-fixed-actions-mobile-modal />\n", styles: [".expansion-row .expansion-content{padding:16px;background-color:#f8f9fa;border-top:1px solid #dee2e6}.expansion-row td{border-bottom:none}@keyframes newItemHighlight{0%{background-color:#f8f9fa;border-left-color:#28a745}25%{background-color:#e9ecef}50%{background-color:#f8f9fa}75%{background-color:#e9ecef}to{background-color:transparent;border-left-color:transparent}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "component", type: GenericModalComponent, selector: "core-generic-modal", inputs: ["isOpen", "mode", "data", "fields", "tabs", "steps", "title", "isMultiple", "customTemplate", "customViewTemplate", "finalStepTemplate", "buttonConfig", "modelFactory", "errors", "validators", "customHasChanges", "stepValidationEnabled", "allowFreeNavigation", "autoMarkCompleted"], outputs: ["save", "close", "modalData"] }, { kind: "component", type: GenericPaginationComponent, selector: "core-generic-pagination", inputs: ["tableId", "isServerSide", "showPagination", "showPageSizeSelector"] }, { kind: "component", type: DropdownComponent, selector: "core-dropdown", inputs: ["rowId", "triggerElementId", "extraDefaultActions", "extraCustomActions", "row"], outputs: ["actionTriggered", "customActionTriggered"] }, { kind: "component", type: FilterModalComponent, selector: "core-filter-modal", inputs: ["isOpen", "filters", "currentFilterValues"], outputs: ["close", "filterChange", "clearFilters", "globalFilterChange"] }, { kind: "component", type: GenericButtonComponent, selector: "core-generic-button", inputs: ["config", "data"], outputs: ["buttonClick"] }, { kind: "directive", type: DynamicFieldDirective, selector: "[coreDynamicField]", inputs: ["field", "value", "mode", "errors", "rowData", "formValue"], outputs: ["valueChange", "onBlurEvent", "onEnterEvent", "selectionChange"] }, { kind: "component", type: ActiveFiltersComponent, selector: "core-active-filters", inputs: ["activeFilters", "config"], outputs: ["onFilterRemove", "onClearAll"] }, { kind: "component", type: CoreManualRefreshComponent, selector: "core-manual-refresh", inputs: ["config", "refreshId"], outputs: ["onRefresh", "timestampUpdated"] }, { kind: "component", type: GenericSwitchComponent, selector: "core-generic-switch", inputs: ["options", "selectedValue", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: FixedActionsMobileModalComponent, selector: "core-fixed-actions-mobile-modal" }] });
|
|
14741
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: GenericTableComponent, isStandalone: true, selector: "core-generic-table", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, modalFields: { classPropertyName: "modalFields", publicName: "modalFields", isSignal: true, isRequired: false, transformFunction: null }, modalTabs: { classPropertyName: "modalTabs", publicName: "modalTabs", isSignal: true, isRequired: false, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: true, transformFunction: null }, customActions: { classPropertyName: "customActions", publicName: "customActions", isSignal: true, isRequired: false, transformFunction: null }, globalActions: { classPropertyName: "globalActions", publicName: "globalActions", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showFilter: { classPropertyName: "showFilter", publicName: "showFilter", isSignal: true, isRequired: false, transformFunction: null }, showSelection: { classPropertyName: "showSelection", publicName: "showSelection", isSignal: true, isRequired: false, transformFunction: null }, showActions: { classPropertyName: "showActions", publicName: "showActions", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, filterButtonConfig: { classPropertyName: "filterButtonConfig", publicName: "filterButtonConfig", isSignal: true, isRequired: false, transformFunction: null }, createButtonConfig: { classPropertyName: "createButtonConfig", publicName: "createButtonConfig", isSignal: true, isRequired: false, transformFunction: null }, createButtonText: { classPropertyName: "createButtonText", publicName: "createButtonText", isSignal: true, isRequired: false, transformFunction: null }, dataInput: { classPropertyName: "dataInput", publicName: "dataInput", isSignal: true, isRequired: false, transformFunction: null }, customFilters: { classPropertyName: "customFilters", publicName: "customFilters", isSignal: true, isRequired: false, transformFunction: null }, enablePagination: { classPropertyName: "enablePagination", publicName: "enablePagination", isSignal: true, isRequired: false, transformFunction: null }, modelFactory: { classPropertyName: "modelFactory", publicName: "modelFactory", isSignal: true, isRequired: false, transformFunction: null }, endpoint: { classPropertyName: "endpoint", publicName: "endpoint", isSignal: true, isRequired: false, transformFunction: null }, customParams: { classPropertyName: "customParams", publicName: "customParams", isSignal: true, isRequired: false, transformFunction: null }, customArrayKey: { classPropertyName: "customArrayKey", publicName: "customArrayKey", isSignal: true, isRequired: false, transformFunction: null }, listTitle: { classPropertyName: "listTitle", publicName: "listTitle", isSignal: true, isRequired: false, transformFunction: null }, moreData: { classPropertyName: "moreData", publicName: "moreData", isSignal: true, isRequired: false, transformFunction: null }, inModal: { classPropertyName: "inModal", publicName: "inModal", isSignal: true, isRequired: false, transformFunction: null }, expansionConfig: { classPropertyName: "expansionConfig", publicName: "expansionConfig", isSignal: true, isRequired: false, transformFunction: null }, fileUploadConfig: { classPropertyName: "fileUploadConfig", publicName: "fileUploadConfig", isSignal: true, isRequired: false, transformFunction: null }, rowStyleConfigs: { classPropertyName: "rowStyleConfigs", publicName: "rowStyleConfigs", isSignal: true, isRequired: false, transformFunction: null }, columnDisabledConfigs: { classPropertyName: "columnDisabledConfigs", publicName: "columnDisabledConfigs", isSignal: true, isRequired: false, transformFunction: null }, rowVisibilityConfigs: { classPropertyName: "rowVisibilityConfigs", publicName: "rowVisibilityConfigs", isSignal: true, isRequired: false, transformFunction: null }, headerOrder: { classPropertyName: "headerOrder", publicName: "headerOrder", isSignal: true, isRequired: false, transformFunction: null }, showActiveFilters: { classPropertyName: "showActiveFilters", publicName: "showActiveFilters", isSignal: true, isRequired: false, transformFunction: null }, activeFiltersConfig: { classPropertyName: "activeFiltersConfig", publicName: "activeFiltersConfig", isSignal: true, isRequired: false, transformFunction: null }, sortConfig: { classPropertyName: "sortConfig", publicName: "sortConfig", isSignal: true, isRequired: false, transformFunction: null }, showManualRefresh: { classPropertyName: "showManualRefresh", publicName: "showManualRefresh", isSignal: true, isRequired: false, transformFunction: null }, manualRefreshConfig: { classPropertyName: "manualRefreshConfig", publicName: "manualRefreshConfig", isSignal: true, isRequired: false, transformFunction: null }, refreshButtonConfig: { classPropertyName: "refreshButtonConfig", publicName: "refreshButtonConfig", isSignal: true, isRequired: false, transformFunction: null }, fixedActionsConfig: { classPropertyName: "fixedActionsConfig", publicName: "fixedActionsConfig", isSignal: true, isRequired: false, transformFunction: null }, deletedFilterKey: { classPropertyName: "deletedFilterKey", publicName: "deletedFilterKey", isSignal: true, isRequired: false, transformFunction: null }, scrollTable: { classPropertyName: "scrollTable", publicName: "scrollTable", isSignal: true, isRequired: false, transformFunction: null }, customEdit: { classPropertyName: "customEdit", publicName: "customEdit", isSignal: true, isRequired: false, transformFunction: null }, customDelete: { classPropertyName: "customDelete", publicName: "customDelete", isSignal: true, isRequired: false, transformFunction: null }, customView: { classPropertyName: "customView", publicName: "customView", isSignal: true, isRequired: false, transformFunction: null }, customSave: { classPropertyName: "customSave", publicName: "customSave", isSignal: true, isRequired: false, transformFunction: null }, useCustomSave: { classPropertyName: "useCustomSave", publicName: "useCustomSave", isSignal: true, isRequired: false, transformFunction: null }, onApiError: { classPropertyName: "onApiError", publicName: "onApiError", isSignal: true, isRequired: false, transformFunction: null }, inlineEditConfig: { classPropertyName: "inlineEditConfig", publicName: "inlineEditConfig", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { actionTriggered: "actionTriggered", selectionChanged: "selectionChanged", dataCreated: "dataCreated", dataUpdated: "dataUpdated", dataDeleted: "dataDeleted", dataFetched: "dataFetched", onMoreDataLoaded: "onMoreDataLoaded", globalActionTriggered: "globalActionTriggered", modalData: "modalData", beforeSave: "beforeSave", onFilterChange: "onFilterChange", onClearFilters: "onClearFilters", activeFilterRemoved: "activeFilterRemoved", activeFiltersCleared: "activeFiltersCleared", dataRefreshed: "dataRefreshed", inlineEditSave: "inlineEditSave", inlineEditModeChanged: "inlineEditModeChanged", inlineEditValidationError: "inlineEditValidationError" }, host: { listeners: { "window:beforeunload": "onBeforeUnload($event)", "document:click": "closeSubmenu()" } }, providers: [TableDataService, FilterService, PaginationService, ModelApiService, InlineEditService], viewQueries: [{ propertyName: "sentinel", first: true, predicate: ["sentinel"], descendants: true }, { propertyName: "dropdownTrigger", first: true, predicate: ["dropdownTrigger"], descendants: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }, { propertyName: "manualRefreshComponent", first: true, predicate: CoreManualRefreshComponent, descendants: true }], hostDirectives: [{ directive: CoreHostDirective }], ngImport: i0, template: "@if (showActiveFilters()) {\n <core-active-filters\n [activeFilters]=\"currentActiveFilters()\"\n [config]=\"activeFiltersConfig()\"\n (onFilterRemove)=\"onActiveFilterRemove($event)\"\n (onClearAll)=\"onActiveFiltersClear()\">\n </core-active-filters>\n}\n<div class=\"c-table\" [class.c-table--scroll]=\"scrollTable()\" [class.in-modal]=\"inModal()\" [class.inline-edit-mode]=\"inlineEditService.isInlineEditMode()\">\n @if (shouldShowManualRefresh()) {\n <core-manual-refresh \n [config]=\"getManualRefreshConfig()\"\n (onRefresh)=\"onManualRefresh()\">\n </core-manual-refresh>\n }\n <table>\n <thead>\n <tr>\n @if (showSelection()) {\n <!-- Todo: Tabla con row selection -->\n <th class=\"select-column\">\n <input type=\"checkbox\" [checked]=\"isAllSelected()\" (change)=\"masterToggle()\" />\n </th>\n }\n @for (column of columns(); track $index) {\n <th [ngClass]=\"column.align ? 'u-align-' + column.align : ''\">\n @if (isColumnSortable(column)) {\n <button class=\"c-table-order\" tabindex=\"-1\"\n [class.is-asc]=\"getColumnSortState(column) === SortDirection.ASC\"\n [class.is-desc]=\"getColumnSortState(column) === SortDirection.DESC\"\n [class.has-multiple-sorts]=\"isMultiColumnSortEnabled() && getColumnSortPriority(column) !== null\"\n [title]=\"getSortButtonTitle(column)\"\n (click)=\"onColumnHeaderClick(column)\">\n {{ column.label | translate }}\n <!-- @if (isMultiColumnSortEnabled() && getColumnSortPriority(column) !== null) {\n <span class=\"c-table-order__priority\">{{ getColumnSortPriority(column)! + 1 }}</span>\n } -->\n <span class=\"c-table-order__controls\">\n <span class=\"c-table-order__arrow--desc icon-arrow-up\"></span>\n <span class=\"c-table-order__arrow--asc icon-arrow-down\"></span>\n </span>\n </button>\n } @else {\n {{ column.label | translate }}\n }\n </th>\n }\n @if (showActions() && (actions().length > 0 || customActions().length > 0)) {\n <th class=\"u-align-right\">{{ 'table.actions' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of displayedData(); track row.getId()) {\n <tr [ngClass]=\"getRowClasses(row)\" \n [class.is-editable]=\"isRowInEditMode(row.getId())\"\n [class.is-disabled]=\"isRowDisabled(row)\">\n @if (showSelection()) {\n <!-- Todo: Tabla con row selection -->\n <td class=\"select-column\">\n <input type=\"checkbox\" [checked]=\"isRowSelected(row)\" (change)=\"toggleRow(row)\" />\n </td>\n }\n @for (column of columns(); track $index) {\n <td [attr.data-label]=\"column.label | translate\" \n [ngClass]=\"[\n column.align ? 'u-align-' + column.align : '',\n getCellDisabledClasses(row, column)\n ]\" \n [class.is-editing]=\"isColumnEditable(column, row)\"\n [class.is-column-disabled]=\"isColumnDisabledForRow(row, column)\">\n @if (column.template) {\n <!-- Todo: Ver qu\u00E9 es esto -->\n <ng-container *ngTemplateOutlet=\"column.template; context: { $implicit: row, column: column }\"></ng-container>\n } @else if (isColumnEditable(column, row)) {\n <!-- !Solcre: Modo de edici\u00F3n en l\u00EDnea usando DynamicField -->\n <div class=\"c-table__inline-edit\">\n <strong class=\"c-table__mobile-heading\">{{ column.label | translate }}:</strong>\n <div\n coreDynamicField\n [field]=\"getInlineEditableConfigWithState(row, column)!\"\n [value]=\"getEditingValue(row, column)\"\n [mode]=\"ModalMode.EDIT\"\n [errors]=\"getCellErrors(row, column)\"\n [rowData]=\"row\"\n (valueChange)=\"onCellValueChange(row, column, $event)\"\n (onBlurEvent)=\"onCellBlur(row, column)\"\n (onEnterEvent)=\"onCellEnter(row, column)\"\n ></div>\n </div>\n } @else {\n <div class=\"c-table__content\">\n <strong class=\"c-table__mobile-heading\">{{ column.label | translate }}:</strong> {{ getFormattedValue(row,\n column) }}\n </div>\n }\n </td>\n }\n\n <!-- Actions-->\n\n @if (showActions() && (actions().length > 0 || customActions().length > 0 || expansionConfig()?.enabled)) {\n\n <td class=\"u-align-right\">\n <div class=\"c-table__actions\">\n <core-dropdown [rowId]=\"row.getId()\" [extraDefaultActions]=\"getVisibleDefaultActions(row, true)\"\n [extraCustomActions]=\"getVisibleCustomActions(row, true)\" [row]=\"row\"\n [triggerElementId]=\"'dropdown-trigger-' + row.getId()\"\n (actionTriggered)=\"triggerAction($event.action, $event.row)\"\n (customActionTriggered)=\"triggerCustomAction($event.action, $event.row)\" #dropdown>\n </core-dropdown>\n @for (actionConfig of getVisibleDefaultActions(row, false); track actionConfig.action) {\n @if (hasPermission(actionConfig)) {\n @if (actionConfig.action === TableAction.VIEW || actionConfig.action === TableAction.EDIT ||\n actionConfig.action === TableAction.DELETE || actionConfig.action === TableAction.RECOVER) {\n <core-generic-button [config]=\"getActionButtonConfig(actionConfig.action, actionConfig, row)\"\n (buttonClick)=\"onButtonClick($event, actionConfig.action, row)\">\n </core-generic-button>\n }\n }\n }\n @for (customAction of getVisibleCustomActions(row, false); track customAction.label || $index) {\n @if (hasPermission(customAction)) {\n @if (customAction.isSwitch && customAction.switchOptions) {\n <core-generic-switch\n [options]=\"customAction.switchOptions\"\n [selectedValue]=\"customAction.switchValue ? customAction.switchValue(row) : null\"\n [ariaLabel]=\"customAction.switchAriaLabel || customAction.title\"\n (valueChange)=\"onCustomActionSwitchChange($event, customAction, row)\">\n </core-generic-switch>\n } @else {\n <core-generic-button [config]=\"getCustomActionButtonConfigForRow(customAction, row)\"\n (buttonClick)=\"onButtonClick($event, customAction, row)\">\n </core-generic-button>\n }\n }\n }\n\n @for (outsideAction of getOutsideFixedActionsForRow(row); track $index) {\n @if (outsideAction.type === 'table' || outsideAction.type === 'custom' ? hasPermission(outsideAction.config) : true) {\n <core-generic-button \n [config]=\"getOutsideFixedActionButtonConfig(outsideAction, row)\"\n (buttonClick)=\"onOutsideFixedActionClick($event, outsideAction, row)\">\n </core-generic-button>\n }\n }\n\n @if (hasExtraActionsForRow(row)) {\n <core-generic-button [config]=\"getMoreActionsButtonConfig(row.getId())\" [data]=\"row\"\n (buttonClick)=\"onMoreActionsClick($event, row.getId())\" #dropdownTrigger>\n </core-generic-button>\n }\n\n @if (expansionConfig()?.enabled) {\n <!-- \u2705 Solcre: Celda dedicada para expansi\u00F3n en su posici\u00F3n correcta -->\n <core-generic-button [config]=\"getExpandButtonConfig(row)\" (buttonClick)=\"onExpandButtonClick($event, row)\">\n </core-generic-button>\n }\n\n </div> <!-- .c-table__actions -->\n </td> <!-- td parent of .c-table__actions -->\n } <!-- @if (showActions() -->\n\n\n </tr>\n @if (expansionConfig()?.enabled && isRowExpanded(row)) {\n <!-- Todo: Ver que es esto -->\n <tr class=\"expansion-row\" [ngClass]=\"getRowClasses(row)\">\n <td [attr.colspan]=\"displayedColumns().length\" class=\"expansion-content\">\n <ng-container *ngTemplateOutlet=\"expansionConfig()!.template; context: { $implicit: row }\">\n </ng-container>\n </td>\n </tr>\n }\n } @empty {\n <tr>\n <!-- Todo: Estilo .no-data -->\n <td [attr.colspan]=\"displayedColumns().length\">\n <p class=\"c-placeholder\">{{ 'table.noData' | translate }}</p>\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div> <!-- .c-table -->\n\n<!-- Todo: Todo lo que viene dsp de la tabla -->\n\n@if (!enablePagination()) {\n<!-- Todo: Ver qu\u00E9 onda esto -->\n<div #sentinel class=\"sentinel\"></div>\n}\n\n@if (enablePagination()) {\n<core-generic-pagination \n [tableId]=\"tableId\" \n [isServerSide]=\"!!endpoint()\"\n [showPagination]=\"shouldShowPagination()\"\n [showPageSizeSelector]=\"shouldShowPageSizeSelector()\">\n</core-generic-pagination>\n}\n\n<core-generic-modal [isOpen]=\"tableActionService.getIsModalOpen()\" [mode]=\"tableActionService.getModalMode()\"\n [data]=\"tableActionService.getModalData()\" [fields]=\"hasTabs() ? [] : tableActionService.getModalFieldsToShow()\"\n [tabs]=\"hasTabs() ? modalTabs() : []\" [title]=\"tableActionService.getModalTitle()\" [modelFactory]=\"modelFactory() || null\"\n (save)=\"onModalSave($event)\" (close)=\"tableActionService.closeModal()\" (modalData)=\"onModalData($event)\">\n</core-generic-modal>\n\n<core-filter-modal [isOpen]=\"isFilterModalOpen()\" [filters]=\"customFilters()\" [currentFilterValues]=\"currentFilterValues()\" (close)=\"closeFiltersPopup()\"\n (filterChange)=\"handleFilterChange($event)\" (globalFilterChange)=\"applyGlobalFilter($event)\"\n (clearFilters)=\"handleClearFilters()\">\n</core-filter-modal>\n\n<!-- @if (shouldShowFixedActions()) {\n <div class=\"c-fixed-actions\" [ngClass]=\"'c-fixed-actions--' + (fixedActionsConfig()?.position || 'right')\">\n @for (action of fixedActionsArray(); track $index) {\n @if (shouldShowFixedAction(action)) {\n <button \n type=\"button\"\n [ngClass]=\"getFixedActionClass(action)\"\n [disabled]=\"isFixedActionDisabled(action)\"\n [title]=\"getFixedActionTooltip(action) || ''\"\n [attr.aria-label]=\"getFixedActionTooltip(action) || action.label || ''\"\n (click)=\"onFixedActionClick(action)\">\n </button>\n }\n }\n </div>\n} -->\n\n<core-fixed-actions-mobile-modal />\n", styles: [".expansion-row .expansion-content{padding:16px;background-color:#f8f9fa;border-top:1px solid #dee2e6}.expansion-row td{border-bottom:none}@keyframes newItemHighlight{0%{background-color:#f8f9fa;border-left-color:#28a745}25%{background-color:#e9ecef}50%{background-color:#f8f9fa}75%{background-color:#e9ecef}to{background-color:transparent;border-left-color:transparent}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "component", type: GenericModalComponent, selector: "core-generic-modal", inputs: ["isOpen", "mode", "data", "fields", "tabs", "steps", "title", "isMultiple", "customTemplate", "customViewTemplate", "finalStepTemplate", "buttonConfig", "modelFactory", "errors", "validators", "customHasChanges", "stepValidationEnabled", "allowFreeNavigation", "autoMarkCompleted"], outputs: ["save", "close", "modalData"] }, { kind: "component", type: GenericPaginationComponent, selector: "core-generic-pagination", inputs: ["tableId", "isServerSide", "showPagination", "showPageSizeSelector"] }, { kind: "component", type: DropdownComponent, selector: "core-dropdown", inputs: ["rowId", "triggerElementId", "extraDefaultActions", "extraCustomActions", "row"], outputs: ["actionTriggered", "customActionTriggered"] }, { kind: "component", type: FilterModalComponent, selector: "core-filter-modal", inputs: ["isOpen", "filters", "currentFilterValues"], outputs: ["close", "filterChange", "clearFilters", "globalFilterChange"] }, { kind: "component", type: GenericButtonComponent, selector: "core-generic-button", inputs: ["config", "data"], outputs: ["buttonClick"] }, { kind: "directive", type: DynamicFieldDirective, selector: "[coreDynamicField]", inputs: ["field", "value", "mode", "errors", "rowData", "formValue"], outputs: ["valueChange", "onBlurEvent", "onEnterEvent", "selectionChange"] }, { kind: "component", type: ActiveFiltersComponent, selector: "core-active-filters", inputs: ["activeFilters", "config"], outputs: ["onFilterRemove", "onClearAll"] }, { kind: "component", type: CoreManualRefreshComponent, selector: "core-manual-refresh", inputs: ["config", "refreshId"], outputs: ["onRefresh", "timestampUpdated"] }, { kind: "component", type: GenericSwitchComponent, selector: "core-generic-switch", inputs: ["options", "selectedValue", "ariaLabel"], outputs: ["valueChange"] }, { kind: "component", type: FixedActionsMobileModalComponent, selector: "core-fixed-actions-mobile-modal" }] });
|
|
14742
14742
|
}
|
|
14743
14743
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: GenericTableComponent, decorators: [{
|
|
14744
14744
|
type: Component,
|
|
@@ -14755,7 +14755,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
14755
14755
|
CoreManualRefreshComponent,
|
|
14756
14756
|
GenericSwitchComponent,
|
|
14757
14757
|
FixedActionsMobileModalComponent,
|
|
14758
|
-
], hostDirectives: [CoreHostDirective], providers: [TableDataService, FilterService, PaginationService, ModelApiService, InlineEditService], template: "@if (showActiveFilters()) {\n <core-active-filters\n [activeFilters]=\"currentActiveFilters()\"\n [config]=\"activeFiltersConfig()\"\n (onFilterRemove)=\"onActiveFilterRemove($event)\"\n (onClearAll)=\"onActiveFiltersClear()\">\n </core-active-filters>\n}\n<div class=\"c-table\" [class.c-table--scroll]=\"scrollTable()\" [class.in-modal]=\"inModal()\" [class.inline-edit-mode]=\"inlineEditService.isInlineEditMode()\">\n @if (shouldShowManualRefresh()) {\n <core-manual-refresh \n [config]=\"getManualRefreshConfig()\"\n (onRefresh)=\"onManualRefresh()\">\n </core-manual-refresh>\n }\n <table>\n <thead>\n <tr>\n @if (showSelection()) {\n <!-- Todo: Tabla con row selection -->\n <th class=\"select-column\">\n <input type=\"checkbox\" [checked]=\"isAllSelected()\" (change)=\"masterToggle()\" />\n </th>\n }\n @for (column of columns(); track $index) {\n <th [ngClass]=\"column.align ? 'u-align-' + column.align : ''\">\n @if (isColumnSortable(column)) {\n <button class=\"c-table-order\" tabindex=\"-1\"\n [class.is-asc]=\"getColumnSortState(column) === SortDirection.ASC\"\n [class.is-desc]=\"getColumnSortState(column) === SortDirection.DESC\"\n [class.has-multiple-sorts]=\"isMultiColumnSortEnabled() && getColumnSortPriority(column) !== null\"\n [title]=\"getSortButtonTitle(column)\"\n (click)=\"onColumnHeaderClick(column)\">\n {{ column.label | translate }}\n <!-- @if (isMultiColumnSortEnabled() && getColumnSortPriority(column) !== null) {\n <span class=\"c-table-order__priority\">{{ getColumnSortPriority(column)! + 1 }}</span>\n } -->\n <span class=\"c-table-order__controls\">\n <span class=\"c-table-order__arrow--desc icon-arrow-up\"></span>\n <span class=\"c-table-order__arrow--asc icon-arrow-down\"></span>\n </span>\n </button>\n } @else {\n {{ column.label | translate }}\n }\n </th>\n }\n @if (showActions() && (actions().length > 0 || customActions().length > 0)) {\n <th class=\"u-align-right\">{{ 'table.actions' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of displayedData(); track row.getId()) {\n <tr [ngClass]=\"getRowClasses(row)\" \n [class.is-editable]=\"isRowInEditMode(row.getId())\"\n [class.is-disabled]=\"isRowDisabled(row)\">\n @if (showSelection()) {\n <!-- Todo: Tabla con row selection -->\n <td class=\"select-column\">\n <input type=\"checkbox\" [checked]=\"isRowSelected(row)\" (change)=\"toggleRow(row)\" />\n </td>\n }\n @for (column of columns(); track $index) {\n <td [attr.data-label]=\"column.label | translate\" \n [ngClass]=\"[\n column.align ? 'u-align-' + column.align : '',\n getCellDisabledClasses(row, column)\n ]\" \n [class.is-editing]=\"isColumnEditable(column, row)\"\n [class.is-column-disabled]=\"isColumnDisabledForRow(row, column)\">\n @if (column.template) {\n <!-- Todo: Ver qu\u00E9 es esto -->\n <ng-container *ngTemplateOutlet=\"column.template; context: { $implicit: row, column: column }\"></ng-container>\n } @else if (isColumnEditable(column, row)) {\n <!-- !Solcre: Modo de edici\u00F3n en l\u00EDnea usando DynamicField -->\n <div class=\"c-table__inline-edit\">\n <strong class=\"c-table__mobile-heading\">{{ column.label | translate }}:</strong>\n <div\n coreDynamicField\n [field]=\"getInlineEditableConfigWithState(row, column)!\"\n [value]=\"getEditingValue(row, column)\"\n [mode]=\"ModalMode.EDIT\"\n [errors]=\"getCellErrors(row, column)\"\n [rowData]=\"row\"\n (valueChange)=\"onCellValueChange(row, column, $event)\"\n (onBlurEvent)=\"onCellBlur(row, column)\"\n (onEnterEvent)=\"onCellEnter(row, column)\"\n ></div>\n </div>\n } @else {\n <div class=\"c-table__content\">\n <strong class=\"c-table__mobile-heading\">{{ column.label | translate }}:</strong> {{ getFormattedValue(row,\n column) }}\n </div>\n }\n </td>\n }\n\n <!-- Actions-->\n\n @if (showActions() && (actions().length > 0 || customActions().length > 0 || expansionConfig()?.enabled)) {\n\n <td class=\"u-align-right\">\n <div class=\"c-table__actions\">\n <core-dropdown [rowId]=\"row.getId()\" [extraDefaultActions]=\"getVisibleDefaultActions(row, true)\"\n [extraCustomActions]=\"getVisibleCustomActions(row, true)\" [row]=\"row\"\n [triggerElementId]=\"'dropdown-trigger-' + row.getId()\"\n (actionTriggered)=\"triggerAction($event.action, $event.row)\"\n (customActionTriggered)=\"triggerCustomAction($event.action, $event.row)\" #dropdown>\n </core-dropdown>\n @for (actionConfig of getVisibleDefaultActions(row, false); track actionConfig.action) {\n @if (hasPermission(actionConfig)) {\n @if (actionConfig.action === TableAction.VIEW || actionConfig.action === TableAction.EDIT ||\n actionConfig.action === TableAction.DELETE || actionConfig.action === TableAction.RECOVER) {\n <core-generic-button [config]=\"getActionButtonConfig(actionConfig.action, actionConfig, row)\"\n (buttonClick)=\"onButtonClick($event, actionConfig.action, row)\">\n </core-generic-button>\n }\n }\n }\n @for (customAction of getVisibleCustomActions(row, false); track customAction.label || $index) {\n @if (hasPermission(customAction)) {\n @if (customAction.isSwitch && customAction.switchOptions) {\n <core-generic-switch\n [options]=\"customAction.switchOptions\"\n [selectedValue]=\"customAction.switchValue ? customAction.switchValue(row) : null\"\n [ariaLabel]=\"customAction.switchAriaLabel || customAction.title\"\n (valueChange)=\"onCustomActionSwitchChange($event, customAction, row)\">\n </core-generic-switch>\n } @else {\n <core-generic-button [config]=\"getCustomActionButtonConfigForRow(customAction, row)\"\n (buttonClick)=\"onButtonClick($event, customAction, row)\">\n </core-generic-button>\n }\n }\n }\n\n @for (outsideAction of getOutsideFixedActionsForRow(row); track $index) {\n @if (outsideAction.type === 'table' || outsideAction.type === 'custom' ? hasPermission(outsideAction.config) : true) {\n <core-generic-button \n [config]=\"getOutsideFixedActionButtonConfig(outsideAction, row)\"\n (buttonClick)=\"onOutsideFixedActionClick($event, outsideAction, row)\">\n </core-generic-button>\n }\n }\n\n @if (hasExtraActionsForRow(row)) {\n <core-generic-button [config]=\"getMoreActionsButtonConfig(row.getId())\" [data]=\"row\"\n (buttonClick)=\"onMoreActionsClick($event, row.getId())\" #dropdownTrigger>\n </core-generic-button>\n }\n\n @if (expansionConfig()?.enabled) {\n <!-- \u2705 Solcre: Celda dedicada para expansi\u00F3n en su posici\u00F3n correcta -->\n <core-generic-button [config]=\"getExpandButtonConfig(row)\" (buttonClick)=\"onExpandButtonClick($event, row)\">\n </core-generic-button>\n }\n\n </div> <!-- .c-table__actions -->\n </td> <!-- td parent of .c-table__actions -->\n } <!-- @if (showActions() -->\n\n\n </tr>\n @if (expansionConfig()?.enabled && isRowExpanded(row)) {\n <!-- Todo: Ver que es esto -->\n <tr class=\"expansion-row\" [ngClass]=\"getRowClasses(row)\">\n <td [attr.colspan]=\"displayedColumns().length\" class=\"expansion-content\">\n <ng-container *ngTemplateOutlet=\"expansionConfig()!.template; context: { $implicit: row }\">\n </ng-container>\n </td>\n </tr>\n }\n } @empty {\n <tr>\n <!-- Todo: Estilo .no-data -->\n <td [attr.colspan]=\"displayedColumns().length\">\n <p class=\"c-placeholder\">{{ 'table.noData' | translate }}</p>\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div> <!-- .c-table -->\n\n<!-- Todo: Todo lo que viene dsp de la tabla -->\n\n@if (!enablePagination()) {\n<!-- Todo: Ver qu\u00E9 onda esto -->\n<div #sentinel class=\"sentinel\"></div>\n}\n\n@if (enablePagination()) {\n<core-generic-pagination \n [tableId]=\"tableId\" \n [isServerSide]=\"!!endpoint()\"\n [showPagination]=\"shouldShowPagination()\"\n [showPageSizeSelector]=\"shouldShowPageSizeSelector()\">\n</core-generic-pagination>\n}\n\n<core-generic-modal [isOpen]=\"tableActionService.getIsModalOpen()\" [mode]=\"tableActionService.getModalMode()\"\n [data]=\"tableActionService.getModalData()\" [fields]=\"hasTabs() ? [] : tableActionService.getModalFieldsToShow()\"\n [tabs]=\"hasTabs() ? modalTabs() : []\" [title]=\"tableActionService.getModalTitle()\" [modelFactory]=\"modelFactory() || null\"\n (save)=\"onModalSave($event)\" (close)=\"tableActionService.closeModal()\" (modalData)=\"onModalData($event)\">\n</core-generic-modal>\n\n<core-filter-modal [isOpen]=\"isFilterModalOpen()\" [filters]=\"customFilters()\" [currentFilterValues]=\"currentFilterValues()\" (close)=\"closeFiltersPopup()\"\n (filterChange)=\"handleFilterChange($event)\" (globalFilterChange)=\"applyGlobalFilter($event)\"\n (clearFilters)=\"handleClearFilters()\">\n</core-filter-modal>\n\n@if (shouldShowFixedActions()) {\n <div class=\"c-fixed-actions\" [ngClass]=\"'c-fixed-actions--' + (fixedActionsConfig()?.position || 'right')\">\n @for (action of fixedActionsArray(); track $index) {\n @if (shouldShowFixedAction(action)) {\n <button \n type=\"button\"\n [ngClass]=\"getFixedActionClass(action)\"\n [disabled]=\"isFixedActionDisabled(action)\"\n [title]=\"getFixedActionTooltip(action) || ''\"\n [attr.aria-label]=\"getFixedActionTooltip(action) || action.label || ''\"\n (click)=\"onFixedActionClick(action)\">\n </button>\n }\n }\n </div>\n}\n\n<core-fixed-actions-mobile-modal />\n", styles: [".expansion-row .expansion-content{padding:16px;background-color:#f8f9fa;border-top:1px solid #dee2e6}.expansion-row td{border-bottom:none}@keyframes newItemHighlight{0%{background-color:#f8f9fa;border-left-color:#28a745}25%{background-color:#e9ecef}50%{background-color:#f8f9fa}75%{background-color:#e9ecef}to{background-color:transparent;border-left-color:transparent}}\n"] }]
|
|
14758
|
+
], hostDirectives: [CoreHostDirective], providers: [TableDataService, FilterService, PaginationService, ModelApiService, InlineEditService], template: "@if (showActiveFilters()) {\n <core-active-filters\n [activeFilters]=\"currentActiveFilters()\"\n [config]=\"activeFiltersConfig()\"\n (onFilterRemove)=\"onActiveFilterRemove($event)\"\n (onClearAll)=\"onActiveFiltersClear()\">\n </core-active-filters>\n}\n<div class=\"c-table\" [class.c-table--scroll]=\"scrollTable()\" [class.in-modal]=\"inModal()\" [class.inline-edit-mode]=\"inlineEditService.isInlineEditMode()\">\n @if (shouldShowManualRefresh()) {\n <core-manual-refresh \n [config]=\"getManualRefreshConfig()\"\n (onRefresh)=\"onManualRefresh()\">\n </core-manual-refresh>\n }\n <table>\n <thead>\n <tr>\n @if (showSelection()) {\n <!-- Todo: Tabla con row selection -->\n <th class=\"select-column\">\n <input type=\"checkbox\" [checked]=\"isAllSelected()\" (change)=\"masterToggle()\" />\n </th>\n }\n @for (column of columns(); track $index) {\n <th [ngClass]=\"column.align ? 'u-align-' + column.align : ''\">\n @if (isColumnSortable(column)) {\n <button class=\"c-table-order\" tabindex=\"-1\"\n [class.is-asc]=\"getColumnSortState(column) === SortDirection.ASC\"\n [class.is-desc]=\"getColumnSortState(column) === SortDirection.DESC\"\n [class.has-multiple-sorts]=\"isMultiColumnSortEnabled() && getColumnSortPriority(column) !== null\"\n [title]=\"getSortButtonTitle(column)\"\n (click)=\"onColumnHeaderClick(column)\">\n {{ column.label | translate }}\n <!-- @if (isMultiColumnSortEnabled() && getColumnSortPriority(column) !== null) {\n <span class=\"c-table-order__priority\">{{ getColumnSortPriority(column)! + 1 }}</span>\n } -->\n <span class=\"c-table-order__controls\">\n <span class=\"c-table-order__arrow--desc icon-arrow-up\"></span>\n <span class=\"c-table-order__arrow--asc icon-arrow-down\"></span>\n </span>\n </button>\n } @else {\n {{ column.label | translate }}\n }\n </th>\n }\n @if (showActions() && (actions().length > 0 || customActions().length > 0)) {\n <th class=\"u-align-right\">{{ 'table.actions' | translate }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of displayedData(); track row.getId()) {\n <tr [ngClass]=\"getRowClasses(row)\" \n [class.is-editable]=\"isRowInEditMode(row.getId())\"\n [class.is-disabled]=\"isRowDisabled(row)\">\n @if (showSelection()) {\n <!-- Todo: Tabla con row selection -->\n <td class=\"select-column\">\n <input type=\"checkbox\" [checked]=\"isRowSelected(row)\" (change)=\"toggleRow(row)\" />\n </td>\n }\n @for (column of columns(); track $index) {\n <td [attr.data-label]=\"column.label | translate\" \n [ngClass]=\"[\n column.align ? 'u-align-' + column.align : '',\n getCellDisabledClasses(row, column)\n ]\" \n [class.is-editing]=\"isColumnEditable(column, row)\"\n [class.is-column-disabled]=\"isColumnDisabledForRow(row, column)\">\n @if (column.template) {\n <!-- Todo: Ver qu\u00E9 es esto -->\n <ng-container *ngTemplateOutlet=\"column.template; context: { $implicit: row, column: column }\"></ng-container>\n } @else if (isColumnEditable(column, row)) {\n <!-- !Solcre: Modo de edici\u00F3n en l\u00EDnea usando DynamicField -->\n <div class=\"c-table__inline-edit\">\n <strong class=\"c-table__mobile-heading\">{{ column.label | translate }}:</strong>\n <div\n coreDynamicField\n [field]=\"getInlineEditableConfigWithState(row, column)!\"\n [value]=\"getEditingValue(row, column)\"\n [mode]=\"ModalMode.EDIT\"\n [errors]=\"getCellErrors(row, column)\"\n [rowData]=\"row\"\n (valueChange)=\"onCellValueChange(row, column, $event)\"\n (onBlurEvent)=\"onCellBlur(row, column)\"\n (onEnterEvent)=\"onCellEnter(row, column)\"\n ></div>\n </div>\n } @else {\n <div class=\"c-table__content\">\n <strong class=\"c-table__mobile-heading\">{{ column.label | translate }}:</strong> {{ getFormattedValue(row,\n column) }}\n </div>\n }\n </td>\n }\n\n <!-- Actions-->\n\n @if (showActions() && (actions().length > 0 || customActions().length > 0 || expansionConfig()?.enabled)) {\n\n <td class=\"u-align-right\">\n <div class=\"c-table__actions\">\n <core-dropdown [rowId]=\"row.getId()\" [extraDefaultActions]=\"getVisibleDefaultActions(row, true)\"\n [extraCustomActions]=\"getVisibleCustomActions(row, true)\" [row]=\"row\"\n [triggerElementId]=\"'dropdown-trigger-' + row.getId()\"\n (actionTriggered)=\"triggerAction($event.action, $event.row)\"\n (customActionTriggered)=\"triggerCustomAction($event.action, $event.row)\" #dropdown>\n </core-dropdown>\n @for (actionConfig of getVisibleDefaultActions(row, false); track actionConfig.action) {\n @if (hasPermission(actionConfig)) {\n @if (actionConfig.action === TableAction.VIEW || actionConfig.action === TableAction.EDIT ||\n actionConfig.action === TableAction.DELETE || actionConfig.action === TableAction.RECOVER) {\n <core-generic-button [config]=\"getActionButtonConfig(actionConfig.action, actionConfig, row)\"\n (buttonClick)=\"onButtonClick($event, actionConfig.action, row)\">\n </core-generic-button>\n }\n }\n }\n @for (customAction of getVisibleCustomActions(row, false); track customAction.label || $index) {\n @if (hasPermission(customAction)) {\n @if (customAction.isSwitch && customAction.switchOptions) {\n <core-generic-switch\n [options]=\"customAction.switchOptions\"\n [selectedValue]=\"customAction.switchValue ? customAction.switchValue(row) : null\"\n [ariaLabel]=\"customAction.switchAriaLabel || customAction.title\"\n (valueChange)=\"onCustomActionSwitchChange($event, customAction, row)\">\n </core-generic-switch>\n } @else {\n <core-generic-button [config]=\"getCustomActionButtonConfigForRow(customAction, row)\"\n (buttonClick)=\"onButtonClick($event, customAction, row)\">\n </core-generic-button>\n }\n }\n }\n\n @for (outsideAction of getOutsideFixedActionsForRow(row); track $index) {\n @if (outsideAction.type === 'table' || outsideAction.type === 'custom' ? hasPermission(outsideAction.config) : true) {\n <core-generic-button \n [config]=\"getOutsideFixedActionButtonConfig(outsideAction, row)\"\n (buttonClick)=\"onOutsideFixedActionClick($event, outsideAction, row)\">\n </core-generic-button>\n }\n }\n\n @if (hasExtraActionsForRow(row)) {\n <core-generic-button [config]=\"getMoreActionsButtonConfig(row.getId())\" [data]=\"row\"\n (buttonClick)=\"onMoreActionsClick($event, row.getId())\" #dropdownTrigger>\n </core-generic-button>\n }\n\n @if (expansionConfig()?.enabled) {\n <!-- \u2705 Solcre: Celda dedicada para expansi\u00F3n en su posici\u00F3n correcta -->\n <core-generic-button [config]=\"getExpandButtonConfig(row)\" (buttonClick)=\"onExpandButtonClick($event, row)\">\n </core-generic-button>\n }\n\n </div> <!-- .c-table__actions -->\n </td> <!-- td parent of .c-table__actions -->\n } <!-- @if (showActions() -->\n\n\n </tr>\n @if (expansionConfig()?.enabled && isRowExpanded(row)) {\n <!-- Todo: Ver que es esto -->\n <tr class=\"expansion-row\" [ngClass]=\"getRowClasses(row)\">\n <td [attr.colspan]=\"displayedColumns().length\" class=\"expansion-content\">\n <ng-container *ngTemplateOutlet=\"expansionConfig()!.template; context: { $implicit: row }\">\n </ng-container>\n </td>\n </tr>\n }\n } @empty {\n <tr>\n <!-- Todo: Estilo .no-data -->\n <td [attr.colspan]=\"displayedColumns().length\">\n <p class=\"c-placeholder\">{{ 'table.noData' | translate }}</p>\n </td>\n </tr>\n }\n </tbody>\n </table>\n</div> <!-- .c-table -->\n\n<!-- Todo: Todo lo que viene dsp de la tabla -->\n\n@if (!enablePagination()) {\n<!-- Todo: Ver qu\u00E9 onda esto -->\n<div #sentinel class=\"sentinel\"></div>\n}\n\n@if (enablePagination()) {\n<core-generic-pagination \n [tableId]=\"tableId\" \n [isServerSide]=\"!!endpoint()\"\n [showPagination]=\"shouldShowPagination()\"\n [showPageSizeSelector]=\"shouldShowPageSizeSelector()\">\n</core-generic-pagination>\n}\n\n<core-generic-modal [isOpen]=\"tableActionService.getIsModalOpen()\" [mode]=\"tableActionService.getModalMode()\"\n [data]=\"tableActionService.getModalData()\" [fields]=\"hasTabs() ? [] : tableActionService.getModalFieldsToShow()\"\n [tabs]=\"hasTabs() ? modalTabs() : []\" [title]=\"tableActionService.getModalTitle()\" [modelFactory]=\"modelFactory() || null\"\n (save)=\"onModalSave($event)\" (close)=\"tableActionService.closeModal()\" (modalData)=\"onModalData($event)\">\n</core-generic-modal>\n\n<core-filter-modal [isOpen]=\"isFilterModalOpen()\" [filters]=\"customFilters()\" [currentFilterValues]=\"currentFilterValues()\" (close)=\"closeFiltersPopup()\"\n (filterChange)=\"handleFilterChange($event)\" (globalFilterChange)=\"applyGlobalFilter($event)\"\n (clearFilters)=\"handleClearFilters()\">\n</core-filter-modal>\n\n<!-- @if (shouldShowFixedActions()) {\n <div class=\"c-fixed-actions\" [ngClass]=\"'c-fixed-actions--' + (fixedActionsConfig()?.position || 'right')\">\n @for (action of fixedActionsArray(); track $index) {\n @if (shouldShowFixedAction(action)) {\n <button \n type=\"button\"\n [ngClass]=\"getFixedActionClass(action)\"\n [disabled]=\"isFixedActionDisabled(action)\"\n [title]=\"getFixedActionTooltip(action) || ''\"\n [attr.aria-label]=\"getFixedActionTooltip(action) || action.label || ''\"\n (click)=\"onFixedActionClick(action)\">\n </button>\n }\n }\n </div>\n} -->\n\n<core-fixed-actions-mobile-modal />\n", styles: [".expansion-row .expansion-content{padding:16px;background-color:#f8f9fa;border-top:1px solid #dee2e6}.expansion-row td{border-bottom:none}@keyframes newItemHighlight{0%{background-color:#f8f9fa;border-left-color:#28a745}25%{background-color:#e9ecef}50%{background-color:#f8f9fa}75%{background-color:#e9ecef}to{background-color:transparent;border-left-color:transparent}}\n"] }]
|
|
14759
14759
|
}], ctorParameters: () => [], propDecorators: { sentinel: [{
|
|
14760
14760
|
type: ViewChild,
|
|
14761
14761
|
args: ['sentinel', { static: false }]
|
|
@@ -16389,12 +16389,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
16389
16389
|
// Este archivo es generado automáticamente por scripts/update-version.js
|
|
16390
16390
|
// No edites manualmente este archivo
|
|
16391
16391
|
const VERSION = {
|
|
16392
|
-
full: '2.15.
|
|
16392
|
+
full: '2.15.45',
|
|
16393
16393
|
major: 2,
|
|
16394
16394
|
minor: 15,
|
|
16395
|
-
patch:
|
|
16396
|
-
timestamp: '2025-
|
|
16397
|
-
buildDate: '
|
|
16395
|
+
patch: 45,
|
|
16396
|
+
timestamp: '2025-12-02T13:27:03.712Z',
|
|
16397
|
+
buildDate: '2/12/2025'
|
|
16398
16398
|
};
|
|
16399
16399
|
|
|
16400
16400
|
class MainNavComponent {
|
|
@@ -17616,7 +17616,7 @@ class GenericFixedActionsComponent {
|
|
|
17616
17616
|
})
|
|
17617
17617
|
.filter(action => {
|
|
17618
17618
|
if (action.requiredPermission) {
|
|
17619
|
-
return this.permissionService.hasPermission(action.requiredPermission.resource, action.requiredPermission.action);
|
|
17619
|
+
return this.permissionService.hasPermission(action.requiredPermission.resource, action.requiredPermission.action, action.requiredPermission.custom_action);
|
|
17620
17620
|
}
|
|
17621
17621
|
return true;
|
|
17622
17622
|
})
|
|
@@ -17638,7 +17638,7 @@ class GenericFixedActionsComponent {
|
|
|
17638
17638
|
})
|
|
17639
17639
|
.filter(action => {
|
|
17640
17640
|
if (action.requiredPermission) {
|
|
17641
|
-
return this.permissionService.hasPermission(action.requiredPermission.resource, action.requiredPermission.action);
|
|
17641
|
+
return this.permissionService.hasPermission(action.requiredPermission.resource, action.requiredPermission.action, action.requiredPermission.custom_action);
|
|
17642
17642
|
}
|
|
17643
17643
|
return true;
|
|
17644
17644
|
})
|
|
@@ -17702,8 +17702,8 @@ class GenericFixedActionsComponent {
|
|
|
17702
17702
|
id: action.id,
|
|
17703
17703
|
icon: action.icon,
|
|
17704
17704
|
label: action.label,
|
|
17705
|
-
class: action.class,
|
|
17706
|
-
tooltip: action.tooltip,
|
|
17705
|
+
class: action.class || 'c-icon-btn',
|
|
17706
|
+
tooltip: action.tooltip || action.label,
|
|
17707
17707
|
callback: action.callback,
|
|
17708
17708
|
requiredPermission: action.requiredPermission
|
|
17709
17709
|
});
|
|
@@ -17712,15 +17712,11 @@ class GenericFixedActionsComponent {
|
|
|
17712
17712
|
});
|
|
17713
17713
|
getActionClass(action) {
|
|
17714
17714
|
const classes = ['c-fixed-actions__btn'];
|
|
17715
|
-
|
|
17715
|
+
const hasPrimaryClass = action.class && action.class.includes('c-fixed-actions__btn--primary');
|
|
17716
|
+
if (hasPrimaryClass) {
|
|
17716
17717
|
classes.push('c-fixed-actions__btn--primary');
|
|
17717
17718
|
}
|
|
17718
|
-
|
|
17719
|
-
classes.push(action.class);
|
|
17720
|
-
}
|
|
17721
|
-
else {
|
|
17722
|
-
classes.push('c-icon-btn');
|
|
17723
|
-
}
|
|
17719
|
+
classes.push('c-icon-btn');
|
|
17724
17720
|
if (action.icon) {
|
|
17725
17721
|
classes.push(action.icon);
|
|
17726
17722
|
}
|
|
@@ -19919,6 +19915,552 @@ var FixedActionPosition;
|
|
|
19919
19915
|
FixedActionPosition["CENTER"] = "center";
|
|
19920
19916
|
})(FixedActionPosition || (FixedActionPosition = {}));
|
|
19921
19917
|
|
|
19918
|
+
var AdInteractionType;
|
|
19919
|
+
(function (AdInteractionType) {
|
|
19920
|
+
AdInteractionType["POPUP"] = "popup";
|
|
19921
|
+
AdInteractionType["REDIRECT"] = "redirect";
|
|
19922
|
+
})(AdInteractionType || (AdInteractionType = {}));
|
|
19923
|
+
|
|
19924
|
+
const AD_AUTH_CONFIG = new InjectionToken('AD_AUTH_CONFIG');
|
|
19925
|
+
class AdAuthService {
|
|
19926
|
+
config = inject(AD_AUTH_CONFIG, { optional: true });
|
|
19927
|
+
msalInstance = null;
|
|
19928
|
+
msalModule = null;
|
|
19929
|
+
initializationPromise = null;
|
|
19930
|
+
authState = signal({
|
|
19931
|
+
isAuthenticated: false,
|
|
19932
|
+
user: null,
|
|
19933
|
+
isLoading: false,
|
|
19934
|
+
error: null
|
|
19935
|
+
});
|
|
19936
|
+
isAuthenticated = computed(() => this.authState().isAuthenticated);
|
|
19937
|
+
currentUser = computed(() => this.authState().user);
|
|
19938
|
+
isLoading = computed(() => this.authState().isLoading);
|
|
19939
|
+
error = computed(() => this.authState().error);
|
|
19940
|
+
constructor() {
|
|
19941
|
+
// Only initialize if config is provided
|
|
19942
|
+
if (this.config) {
|
|
19943
|
+
this.initializationPromise = this.initializeMsal();
|
|
19944
|
+
}
|
|
19945
|
+
}
|
|
19946
|
+
/**
|
|
19947
|
+
* Dynamically loads MSAL library only when needed
|
|
19948
|
+
*/
|
|
19949
|
+
async loadMsalModule() {
|
|
19950
|
+
if (this.msalModule) {
|
|
19951
|
+
return this.msalModule;
|
|
19952
|
+
}
|
|
19953
|
+
try {
|
|
19954
|
+
this.msalModule = await import('@azure/msal-browser');
|
|
19955
|
+
return this.msalModule;
|
|
19956
|
+
}
|
|
19957
|
+
catch (error) {
|
|
19958
|
+
console.error('[AdAuthService] Failed to load @azure/msal-browser. ' +
|
|
19959
|
+
'Please install it with: npm install @azure/msal-browser');
|
|
19960
|
+
throw new Error('@azure/msal-browser is required for AD authentication. ' +
|
|
19961
|
+
'Please install it: npm install @azure/msal-browser');
|
|
19962
|
+
}
|
|
19963
|
+
}
|
|
19964
|
+
async initializeMsal() {
|
|
19965
|
+
if (!this.config) {
|
|
19966
|
+
return;
|
|
19967
|
+
}
|
|
19968
|
+
try {
|
|
19969
|
+
const msal = await this.loadMsalModule();
|
|
19970
|
+
const msalConfig = {
|
|
19971
|
+
auth: {
|
|
19972
|
+
clientId: this.config.clientId,
|
|
19973
|
+
authority: this.config.authority,
|
|
19974
|
+
redirectUri: this.config.redirectUri,
|
|
19975
|
+
postLogoutRedirectUri: this.config.postLogoutRedirectUri || this.config.redirectUri,
|
|
19976
|
+
navigateToLoginRequestUrl: this.config.interactionType === AdInteractionType.REDIRECT
|
|
19977
|
+
},
|
|
19978
|
+
cache: {
|
|
19979
|
+
cacheLocation: (this.config.cacheLocation || 'sessionStorage'),
|
|
19980
|
+
storeAuthStateInCookie: false,
|
|
19981
|
+
},
|
|
19982
|
+
system: {
|
|
19983
|
+
loggerOptions: {
|
|
19984
|
+
loggerCallback: this.config.enableLogging ? this.loggerCallback : undefined,
|
|
19985
|
+
logLevel: this.config.logLevel || 0,
|
|
19986
|
+
piiLoggingEnabled: false
|
|
19987
|
+
}
|
|
19988
|
+
}
|
|
19989
|
+
};
|
|
19990
|
+
this.msalInstance = new msal.PublicClientApplication(msalConfig);
|
|
19991
|
+
await this.msalInstance.initialize();
|
|
19992
|
+
if (this.config.interactionType === AdInteractionType.REDIRECT) {
|
|
19993
|
+
await this.handleRedirectResponse();
|
|
19994
|
+
}
|
|
19995
|
+
await this.checkActiveSession();
|
|
19996
|
+
}
|
|
19997
|
+
catch (error) {
|
|
19998
|
+
this.updateAuthState({ error });
|
|
19999
|
+
}
|
|
20000
|
+
}
|
|
20001
|
+
/**
|
|
20002
|
+
* Ensures MSAL is initialized before performing operations
|
|
20003
|
+
*/
|
|
20004
|
+
async ensureInitialized() {
|
|
20005
|
+
if (this.initializationPromise) {
|
|
20006
|
+
await this.initializationPromise;
|
|
20007
|
+
}
|
|
20008
|
+
}
|
|
20009
|
+
loggerCallback(logLevel, message, containsPii) {
|
|
20010
|
+
if (containsPii)
|
|
20011
|
+
return;
|
|
20012
|
+
const timestamp = new Date().toISOString();
|
|
20013
|
+
const levels = ['ERROR', 'WARNING', 'INFO', 'VERBOSE'];
|
|
20014
|
+
console.log(`[MSAL ${levels[logLevel]}] ${timestamp}: ${message}`);
|
|
20015
|
+
}
|
|
20016
|
+
async handleRedirectResponse() {
|
|
20017
|
+
if (!this.msalInstance)
|
|
20018
|
+
return;
|
|
20019
|
+
try {
|
|
20020
|
+
const response = await this.msalInstance.handleRedirectPromise();
|
|
20021
|
+
if (response) {
|
|
20022
|
+
this.handleAuthenticationResult(response);
|
|
20023
|
+
}
|
|
20024
|
+
}
|
|
20025
|
+
catch (error) {
|
|
20026
|
+
this.updateAuthState({ error });
|
|
20027
|
+
}
|
|
20028
|
+
}
|
|
20029
|
+
async checkActiveSession() {
|
|
20030
|
+
if (!this.msalInstance)
|
|
20031
|
+
return;
|
|
20032
|
+
const accounts = this.msalInstance.getAllAccounts();
|
|
20033
|
+
if (accounts.length > 0) {
|
|
20034
|
+
const account = accounts[0];
|
|
20035
|
+
const user = this.mapAccountToUser(account);
|
|
20036
|
+
this.updateAuthState({
|
|
20037
|
+
isAuthenticated: true,
|
|
20038
|
+
user
|
|
20039
|
+
});
|
|
20040
|
+
}
|
|
20041
|
+
}
|
|
20042
|
+
mapAccountToUser(account) {
|
|
20043
|
+
return {
|
|
20044
|
+
id: account.localAccountId,
|
|
20045
|
+
name: account.name,
|
|
20046
|
+
email: account.username,
|
|
20047
|
+
username: account.username,
|
|
20048
|
+
tenantId: account.tenantId,
|
|
20049
|
+
claims: account.idTokenClaims,
|
|
20050
|
+
roles: account.idTokenClaims?.roles || []
|
|
20051
|
+
};
|
|
20052
|
+
}
|
|
20053
|
+
updateAuthState(partialState) {
|
|
20054
|
+
this.authState.update(state => ({
|
|
20055
|
+
...state,
|
|
20056
|
+
...partialState
|
|
20057
|
+
}));
|
|
20058
|
+
}
|
|
20059
|
+
handleAuthenticationResult(result) {
|
|
20060
|
+
if (result.account) {
|
|
20061
|
+
const user = this.mapAccountToUser(result.account);
|
|
20062
|
+
this.updateAuthState({
|
|
20063
|
+
isAuthenticated: true,
|
|
20064
|
+
user,
|
|
20065
|
+
isLoading: false,
|
|
20066
|
+
error: null
|
|
20067
|
+
});
|
|
20068
|
+
}
|
|
20069
|
+
}
|
|
20070
|
+
async loginWithPopup() {
|
|
20071
|
+
await this.ensureInitialized();
|
|
20072
|
+
if (!this.msalInstance || !this.config) {
|
|
20073
|
+
throw new Error('MSAL is not initialized or configuration is not available');
|
|
20074
|
+
}
|
|
20075
|
+
this.updateAuthState({ isLoading: true, error: null });
|
|
20076
|
+
try {
|
|
20077
|
+
const loginRequest = {
|
|
20078
|
+
scopes: this.config.scopes || ['openid', 'profile', 'email']
|
|
20079
|
+
};
|
|
20080
|
+
const result = await this.msalInstance.loginPopup(loginRequest);
|
|
20081
|
+
this.handleAuthenticationResult(result);
|
|
20082
|
+
return this.currentUser();
|
|
20083
|
+
}
|
|
20084
|
+
catch (error) {
|
|
20085
|
+
this.updateAuthState({
|
|
20086
|
+
isLoading: false,
|
|
20087
|
+
error
|
|
20088
|
+
});
|
|
20089
|
+
throw error;
|
|
20090
|
+
}
|
|
20091
|
+
}
|
|
20092
|
+
async loginWithRedirect() {
|
|
20093
|
+
await this.ensureInitialized();
|
|
20094
|
+
if (!this.msalInstance || !this.config) {
|
|
20095
|
+
throw new Error('MSAL is not initialized or configuration is not available');
|
|
20096
|
+
}
|
|
20097
|
+
this.updateAuthState({ isLoading: true, error: null });
|
|
20098
|
+
try {
|
|
20099
|
+
const loginRequest = {
|
|
20100
|
+
scopes: this.config.scopes || ['openid', 'profile', 'email']
|
|
20101
|
+
};
|
|
20102
|
+
await this.msalInstance.loginRedirect(loginRequest);
|
|
20103
|
+
}
|
|
20104
|
+
catch (error) {
|
|
20105
|
+
this.updateAuthState({
|
|
20106
|
+
isLoading: false,
|
|
20107
|
+
error
|
|
20108
|
+
});
|
|
20109
|
+
throw error;
|
|
20110
|
+
}
|
|
20111
|
+
}
|
|
20112
|
+
async login() {
|
|
20113
|
+
const interactionType = this.config?.interactionType || AdInteractionType.POPUP;
|
|
20114
|
+
if (interactionType === AdInteractionType.REDIRECT) {
|
|
20115
|
+
await this.loginWithRedirect();
|
|
20116
|
+
return null;
|
|
20117
|
+
}
|
|
20118
|
+
else {
|
|
20119
|
+
return await this.loginWithPopup();
|
|
20120
|
+
}
|
|
20121
|
+
}
|
|
20122
|
+
async logoutWithPopup() {
|
|
20123
|
+
await this.ensureInitialized();
|
|
20124
|
+
if (!this.msalInstance) {
|
|
20125
|
+
throw new Error('MSAL is not initialized');
|
|
20126
|
+
}
|
|
20127
|
+
this.updateAuthState({ isLoading: true });
|
|
20128
|
+
try {
|
|
20129
|
+
const account = this.msalInstance.getAllAccounts()[0];
|
|
20130
|
+
if (account) {
|
|
20131
|
+
const logoutRequest = {
|
|
20132
|
+
account
|
|
20133
|
+
};
|
|
20134
|
+
await this.msalInstance.logoutPopup(logoutRequest);
|
|
20135
|
+
}
|
|
20136
|
+
this.updateAuthState({
|
|
20137
|
+
isAuthenticated: false,
|
|
20138
|
+
user: null,
|
|
20139
|
+
isLoading: false,
|
|
20140
|
+
error: null
|
|
20141
|
+
});
|
|
20142
|
+
}
|
|
20143
|
+
catch (error) {
|
|
20144
|
+
this.updateAuthState({
|
|
20145
|
+
isLoading: false,
|
|
20146
|
+
error
|
|
20147
|
+
});
|
|
20148
|
+
throw error;
|
|
20149
|
+
}
|
|
20150
|
+
}
|
|
20151
|
+
async logoutWithRedirect() {
|
|
20152
|
+
await this.ensureInitialized();
|
|
20153
|
+
if (!this.msalInstance) {
|
|
20154
|
+
throw new Error('MSAL is not initialized');
|
|
20155
|
+
}
|
|
20156
|
+
this.updateAuthState({ isLoading: true });
|
|
20157
|
+
try {
|
|
20158
|
+
const account = this.msalInstance.getAllAccounts()[0];
|
|
20159
|
+
if (account) {
|
|
20160
|
+
const logoutRequest = {
|
|
20161
|
+
account,
|
|
20162
|
+
postLogoutRedirectUri: this.config?.postLogoutRedirectUri || this.config?.redirectUri
|
|
20163
|
+
};
|
|
20164
|
+
await this.msalInstance.logoutRedirect(logoutRequest);
|
|
20165
|
+
}
|
|
20166
|
+
}
|
|
20167
|
+
catch (error) {
|
|
20168
|
+
this.updateAuthState({
|
|
20169
|
+
isLoading: false,
|
|
20170
|
+
error
|
|
20171
|
+
});
|
|
20172
|
+
throw error;
|
|
20173
|
+
}
|
|
20174
|
+
}
|
|
20175
|
+
async logout() {
|
|
20176
|
+
const interactionType = this.config?.interactionType || AdInteractionType.POPUP;
|
|
20177
|
+
if (interactionType === AdInteractionType.REDIRECT) {
|
|
20178
|
+
await this.logoutWithRedirect();
|
|
20179
|
+
}
|
|
20180
|
+
else {
|
|
20181
|
+
await this.logoutWithPopup();
|
|
20182
|
+
}
|
|
20183
|
+
}
|
|
20184
|
+
async acquireToken(scopes) {
|
|
20185
|
+
await this.ensureInitialized();
|
|
20186
|
+
if (!this.msalInstance || !this.config) {
|
|
20187
|
+
throw new Error('MSAL is not initialized or configuration is not available');
|
|
20188
|
+
}
|
|
20189
|
+
const account = this.msalInstance.getAllAccounts()[0];
|
|
20190
|
+
if (!account) {
|
|
20191
|
+
console.warn('No authenticated account found to acquire token');
|
|
20192
|
+
return null;
|
|
20193
|
+
}
|
|
20194
|
+
const tokenRequest = {
|
|
20195
|
+
scopes: scopes || this.config.scopes || ['openid', 'profile', 'email'],
|
|
20196
|
+
account
|
|
20197
|
+
};
|
|
20198
|
+
try {
|
|
20199
|
+
const result = await this.msalInstance.acquireTokenSilent(tokenRequest);
|
|
20200
|
+
return result.accessToken;
|
|
20201
|
+
}
|
|
20202
|
+
catch (error) {
|
|
20203
|
+
try {
|
|
20204
|
+
const interactionType = this.config.interactionType || AdInteractionType.POPUP;
|
|
20205
|
+
if (interactionType === AdInteractionType.REDIRECT) {
|
|
20206
|
+
await this.msalInstance.acquireTokenRedirect(tokenRequest);
|
|
20207
|
+
return null;
|
|
20208
|
+
}
|
|
20209
|
+
else {
|
|
20210
|
+
const result = await this.msalInstance.acquireTokenPopup(tokenRequest);
|
|
20211
|
+
return result.accessToken;
|
|
20212
|
+
}
|
|
20213
|
+
}
|
|
20214
|
+
catch (interactionError) {
|
|
20215
|
+
throw interactionError;
|
|
20216
|
+
}
|
|
20217
|
+
}
|
|
20218
|
+
}
|
|
20219
|
+
async getAllAccounts() {
|
|
20220
|
+
await this.ensureInitialized();
|
|
20221
|
+
if (!this.msalInstance) {
|
|
20222
|
+
return [];
|
|
20223
|
+
}
|
|
20224
|
+
return this.msalInstance.getAllAccounts();
|
|
20225
|
+
}
|
|
20226
|
+
isConfigured() {
|
|
20227
|
+
return !!this.config;
|
|
20228
|
+
}
|
|
20229
|
+
async isReady() {
|
|
20230
|
+
await this.ensureInitialized();
|
|
20231
|
+
return !!this.msalInstance;
|
|
20232
|
+
}
|
|
20233
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: AdAuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
20234
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: AdAuthService, providedIn: 'root' });
|
|
20235
|
+
}
|
|
20236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: AdAuthService, decorators: [{
|
|
20237
|
+
type: Injectable,
|
|
20238
|
+
args: [{
|
|
20239
|
+
providedIn: 'root'
|
|
20240
|
+
}]
|
|
20241
|
+
}], ctorParameters: () => [] });
|
|
20242
|
+
|
|
20243
|
+
function adAuthGuard(redirectTo = '/login') {
|
|
20244
|
+
return () => {
|
|
20245
|
+
const authService = inject(AdAuthService);
|
|
20246
|
+
const router = inject(Router);
|
|
20247
|
+
if (!authService.isConfigured()) {
|
|
20248
|
+
return false;
|
|
20249
|
+
}
|
|
20250
|
+
if (authService.isAuthenticated()) {
|
|
20251
|
+
return true;
|
|
20252
|
+
}
|
|
20253
|
+
return router.createUrlTree([redirectTo]);
|
|
20254
|
+
};
|
|
20255
|
+
}
|
|
20256
|
+
function adGuestGuard(redirectTo = '/') {
|
|
20257
|
+
return () => {
|
|
20258
|
+
const authService = inject(AdAuthService);
|
|
20259
|
+
const router = inject(Router);
|
|
20260
|
+
if (!authService.isConfigured()) {
|
|
20261
|
+
return true;
|
|
20262
|
+
}
|
|
20263
|
+
if (!authService.isAuthenticated()) {
|
|
20264
|
+
return true;
|
|
20265
|
+
}
|
|
20266
|
+
return router.createUrlTree([redirectTo]);
|
|
20267
|
+
};
|
|
20268
|
+
}
|
|
20269
|
+
function adRoleGuard(requiredRoles, redirectTo = '/unauthorized') {
|
|
20270
|
+
return () => {
|
|
20271
|
+
const authService = inject(AdAuthService);
|
|
20272
|
+
const router = inject(Router);
|
|
20273
|
+
if (!authService.isConfigured()) {
|
|
20274
|
+
return router.createUrlTree([redirectTo]);
|
|
20275
|
+
}
|
|
20276
|
+
if (!authService.isAuthenticated()) {
|
|
20277
|
+
return router.createUrlTree(['/login']);
|
|
20278
|
+
}
|
|
20279
|
+
const user = authService.currentUser();
|
|
20280
|
+
if (!user) {
|
|
20281
|
+
return router.createUrlTree(['/login']);
|
|
20282
|
+
}
|
|
20283
|
+
const userRoles = user.roles || [];
|
|
20284
|
+
const hasRequiredRole = requiredRoles.some(role => userRoles.includes(role));
|
|
20285
|
+
if (hasRequiredRole) {
|
|
20286
|
+
return true;
|
|
20287
|
+
}
|
|
20288
|
+
return router.createUrlTree([redirectTo]);
|
|
20289
|
+
};
|
|
20290
|
+
}
|
|
20291
|
+
|
|
20292
|
+
const DEFAULT_AD_AUTH_INTERCEPTOR_CONFIG = {
|
|
20293
|
+
protectedUrls: [],
|
|
20294
|
+
scopes: undefined
|
|
20295
|
+
};
|
|
20296
|
+
const AD_AUTH_INTERCEPTOR_CONFIG = new InjectionToken('AD_AUTH_INTERCEPTOR_CONFIG', {
|
|
20297
|
+
providedIn: 'root',
|
|
20298
|
+
factory: () => DEFAULT_AD_AUTH_INTERCEPTOR_CONFIG
|
|
20299
|
+
});
|
|
20300
|
+
function isProtectedUrl(url, protectedUrls) {
|
|
20301
|
+
return protectedUrls.some(pattern => {
|
|
20302
|
+
if (typeof pattern === 'string') {
|
|
20303
|
+
return url.startsWith(pattern);
|
|
20304
|
+
}
|
|
20305
|
+
else {
|
|
20306
|
+
return pattern.test(url);
|
|
20307
|
+
}
|
|
20308
|
+
});
|
|
20309
|
+
}
|
|
20310
|
+
const adAuthInterceptor = (req, next) => {
|
|
20311
|
+
const authService = inject(AdAuthService);
|
|
20312
|
+
const config = inject(AD_AUTH_INTERCEPTOR_CONFIG);
|
|
20313
|
+
if (!authService.isConfigured()) {
|
|
20314
|
+
return next(req);
|
|
20315
|
+
}
|
|
20316
|
+
if (!authService.isAuthenticated()) {
|
|
20317
|
+
return next(req);
|
|
20318
|
+
}
|
|
20319
|
+
if (!isProtectedUrl(req.url, config.protectedUrls)) {
|
|
20320
|
+
return next(req);
|
|
20321
|
+
}
|
|
20322
|
+
return from(authService.acquireToken(config.scopes)).pipe(switchMap(token => {
|
|
20323
|
+
if (!token) {
|
|
20324
|
+
return next(req);
|
|
20325
|
+
}
|
|
20326
|
+
const clonedReq = req.clone({
|
|
20327
|
+
setHeaders: {
|
|
20328
|
+
Authorization: `Bearer ${token}`
|
|
20329
|
+
}
|
|
20330
|
+
});
|
|
20331
|
+
return next(clonedReq);
|
|
20332
|
+
}));
|
|
20333
|
+
};
|
|
20334
|
+
|
|
20335
|
+
function provideAdAuth(config) {
|
|
20336
|
+
return {
|
|
20337
|
+
provide: AD_AUTH_CONFIG,
|
|
20338
|
+
useValue: config
|
|
20339
|
+
};
|
|
20340
|
+
}
|
|
20341
|
+
function provideAdAuthInterceptor(config) {
|
|
20342
|
+
return {
|
|
20343
|
+
provide: AD_AUTH_INTERCEPTOR_CONFIG,
|
|
20344
|
+
useValue: config
|
|
20345
|
+
};
|
|
20346
|
+
}
|
|
20347
|
+
function provideAdAuthWithInterceptor(authConfig, interceptorConfig) {
|
|
20348
|
+
const providers = [
|
|
20349
|
+
provideAdAuth(authConfig)
|
|
20350
|
+
];
|
|
20351
|
+
if (interceptorConfig) {
|
|
20352
|
+
providers.push(provideAdAuthInterceptor(interceptorConfig));
|
|
20353
|
+
}
|
|
20354
|
+
return makeEnvironmentProviders(providers);
|
|
20355
|
+
}
|
|
20356
|
+
|
|
20357
|
+
class AdLoginButtonComponent {
|
|
20358
|
+
authService = inject(AdAuthService);
|
|
20359
|
+
config = input({});
|
|
20360
|
+
disabled = input(false);
|
|
20361
|
+
authEvent = output();
|
|
20362
|
+
isAuthenticated = this.authService.isAuthenticated;
|
|
20363
|
+
currentUser = this.authService.currentUser;
|
|
20364
|
+
isLoading = this.authService.isLoading;
|
|
20365
|
+
error = this.authService.error;
|
|
20366
|
+
isConfigured = this.authService.isConfigured();
|
|
20367
|
+
loginButtonConfig = computed(() => {
|
|
20368
|
+
const userConfig = this.config();
|
|
20369
|
+
return {
|
|
20370
|
+
type: ButtonType.SECONDARY,
|
|
20371
|
+
context: ButtonContext.DEFAULT,
|
|
20372
|
+
text: userConfig.loginText || 'adAuth.loginButton',
|
|
20373
|
+
icon: userConfig.loginIcon || 'fa-brands fa-microsoft',
|
|
20374
|
+
disabled: this.disabled() || this.isLoading(),
|
|
20375
|
+
loading: this.isLoading(),
|
|
20376
|
+
...userConfig.buttonConfig
|
|
20377
|
+
};
|
|
20378
|
+
});
|
|
20379
|
+
logoutButtonConfig = computed(() => {
|
|
20380
|
+
const userConfig = this.config();
|
|
20381
|
+
return {
|
|
20382
|
+
type: ButtonType.SECONDARY,
|
|
20383
|
+
context: ButtonContext.DEFAULT,
|
|
20384
|
+
text: userConfig.logoutText || 'adAuth.logoutButton',
|
|
20385
|
+
icon: userConfig.logoutIcon || 'fa-solid fa-arrow-right-from-bracket',
|
|
20386
|
+
disabled: this.disabled() || this.isLoading(),
|
|
20387
|
+
loading: this.isLoading(),
|
|
20388
|
+
customClass: 'logout-button',
|
|
20389
|
+
...userConfig.buttonConfig
|
|
20390
|
+
};
|
|
20391
|
+
});
|
|
20392
|
+
showUserInfo = computed(() => {
|
|
20393
|
+
return this.config().showUserInfo !== false;
|
|
20394
|
+
});
|
|
20395
|
+
userInitials = computed(() => {
|
|
20396
|
+
const user = this.currentUser();
|
|
20397
|
+
if (!user)
|
|
20398
|
+
return '?';
|
|
20399
|
+
if (user.name) {
|
|
20400
|
+
const parts = user.name.split(' ');
|
|
20401
|
+
if (parts.length >= 2) {
|
|
20402
|
+
return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
|
20403
|
+
}
|
|
20404
|
+
return user.name.substring(0, 2).toUpperCase();
|
|
20405
|
+
}
|
|
20406
|
+
if (user.email) {
|
|
20407
|
+
return user.email.substring(0, 2).toUpperCase();
|
|
20408
|
+
}
|
|
20409
|
+
return '?';
|
|
20410
|
+
});
|
|
20411
|
+
constructor() {
|
|
20412
|
+
effect(() => {
|
|
20413
|
+
const authenticated = this.isAuthenticated();
|
|
20414
|
+
const user = this.currentUser();
|
|
20415
|
+
const error = this.error();
|
|
20416
|
+
if (authenticated && user) {
|
|
20417
|
+
this.authEvent.emit({
|
|
20418
|
+
type: 'login-success',
|
|
20419
|
+
user,
|
|
20420
|
+
message: 'adAuth.events.loginSuccess'
|
|
20421
|
+
});
|
|
20422
|
+
}
|
|
20423
|
+
else if (error) {
|
|
20424
|
+
this.authEvent.emit({
|
|
20425
|
+
type: 'login-error',
|
|
20426
|
+
error,
|
|
20427
|
+
message: 'adAuth.events.loginError'
|
|
20428
|
+
});
|
|
20429
|
+
}
|
|
20430
|
+
});
|
|
20431
|
+
}
|
|
20432
|
+
async onLoginClick() {
|
|
20433
|
+
try {
|
|
20434
|
+
await this.authService.login();
|
|
20435
|
+
}
|
|
20436
|
+
catch (error) {
|
|
20437
|
+
console.error('Error en login:', error);
|
|
20438
|
+
}
|
|
20439
|
+
}
|
|
20440
|
+
async onLogoutClick() {
|
|
20441
|
+
try {
|
|
20442
|
+
await this.authService.logout();
|
|
20443
|
+
this.authEvent.emit({
|
|
20444
|
+
type: 'logout-success',
|
|
20445
|
+
message: 'adAuth.events.logoutSuccess'
|
|
20446
|
+
});
|
|
20447
|
+
}
|
|
20448
|
+
catch (error) {
|
|
20449
|
+
this.authEvent.emit({
|
|
20450
|
+
type: 'logout-error',
|
|
20451
|
+
error,
|
|
20452
|
+
message: 'adAuth.events.logoutError'
|
|
20453
|
+
});
|
|
20454
|
+
}
|
|
20455
|
+
}
|
|
20456
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: AdLoginButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20457
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: AdLoginButtonComponent, isStandalone: true, selector: "core-ad-login-button", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { authEvent: "authEvent" }, ngImport: i0, template: "<div class=\"ad-auth-container\" [ngClass]=\"config().customClass\">\n @if (!isConfigured) {\n <div class=\"ad-auth-not-configured\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n {{ \"adAuth.not Configured\" | translate }}\n </div>\n } @else if (isLoading() && config().showLoader !== false) {\n <div class=\"ad-auth-loading\">\n <span class=\"ad-auth-spinner\"></span>\n {{ \"adAuth.authenticating\" | translate }}\n </div>\n } @else if (isAuthenticated() && currentUser()) { @if (showUserInfo()) {\n <div class=\"ad-auth-user-info\">\n <div class=\"ad-auth-user-avatar\">\n {{ userInitials() }}\n </div>\n <div class=\"ad-auth-user-details\">\n <p class=\"ad-auth-user-name\">\n {{ currentUser()!.name || (\"adAuth.user\" | translate) }}\n </p>\n <p class=\"ad-auth-user-email\">{{ currentUser()!.email }}</p>\n </div>\n </div>\n }\n\n <div class=\"ad-auth-buttons\">\n <core-generic-button\n [config]=\"logoutButtonConfig()\"\n (buttonClick)=\"onLogoutClick()\"\n />\n </div>\n } @else { @if (error()) {\n <div class=\"ad-auth-error\">\n <i class=\"fa-solid fa-circle-exclamation\"></i>\n {{ \"adAuth.authError\" | translate }}\n </div>\n }\n\n <div class=\"ad-auth-buttons\">\n <core-generic-button\n [config]=\"loginButtonConfig()\"\n (buttonClick)=\"onLoginClick()\"\n />\n </div>\n }\n</div>\n", styles: [":host{display:block}.ad-auth-container{display:flex;flex-direction:column;gap:.75rem}.ad-auth-user-info{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;background-color:var(--color-background-secondary, #f5f5f5);border-radius:var(--border-radius, .375rem);font-size:.875rem}.ad-auth-user-avatar{width:2.5rem;height:2.5rem;border-radius:50%;background:linear-gradient(135deg,var(--color-primary, #0078d4) 0%,var(--color-primary-dark, #106ebe) 100%);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:600;font-size:1rem;flex-shrink:0}.ad-auth-user-details{flex:1;min-width:0}.ad-auth-user-name{font-weight:600;color:var(--color-text-primary, #1a1a1a);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ad-auth-user-email{color:var(--color-text-secondary, #666);margin:0;font-size:.8125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ad-auth-loading{display:flex;align-items:center;justify-content:center;padding:1rem;color:var(--color-text-secondary, #666);font-size:.875rem}.ad-auth-spinner{display:inline-block;width:1rem;height:1rem;border:2px solid var(--color-border, #e0e0e0);border-top-color:var(--color-primary, #0078d4);border-radius:50%;animation:spin .6s linear infinite;margin-right:.5rem}@keyframes spin{to{transform:rotate(360deg)}}.ad-auth-error{padding:.75rem 1rem;background-color:var(--color-danger-light, #fee);color:var(--color-danger, #d32f2f);border-radius:var(--border-radius, .375rem);font-size:.875rem}.ad-auth-not-configured{padding:1rem;background-color:var(--color-warning-light, #fff8e1);color:var(--color-warning-dark, #f57c00);border-radius:var(--border-radius, .375rem);font-size:.875rem;text-align:center}.ad-auth-buttons{display:flex;gap:.5rem}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: GenericButtonComponent, selector: "core-generic-button", inputs: ["config", "data"], outputs: ["buttonClick"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }] });
|
|
20458
|
+
}
|
|
20459
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: AdLoginButtonComponent, decorators: [{
|
|
20460
|
+
type: Component,
|
|
20461
|
+
args: [{ selector: 'core-ad-login-button', standalone: true, imports: [CommonModule, GenericButtonComponent, TranslateModule], template: "<div class=\"ad-auth-container\" [ngClass]=\"config().customClass\">\n @if (!isConfigured) {\n <div class=\"ad-auth-not-configured\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n {{ \"adAuth.not Configured\" | translate }}\n </div>\n } @else if (isLoading() && config().showLoader !== false) {\n <div class=\"ad-auth-loading\">\n <span class=\"ad-auth-spinner\"></span>\n {{ \"adAuth.authenticating\" | translate }}\n </div>\n } @else if (isAuthenticated() && currentUser()) { @if (showUserInfo()) {\n <div class=\"ad-auth-user-info\">\n <div class=\"ad-auth-user-avatar\">\n {{ userInitials() }}\n </div>\n <div class=\"ad-auth-user-details\">\n <p class=\"ad-auth-user-name\">\n {{ currentUser()!.name || (\"adAuth.user\" | translate) }}\n </p>\n <p class=\"ad-auth-user-email\">{{ currentUser()!.email }}</p>\n </div>\n </div>\n }\n\n <div class=\"ad-auth-buttons\">\n <core-generic-button\n [config]=\"logoutButtonConfig()\"\n (buttonClick)=\"onLogoutClick()\"\n />\n </div>\n } @else { @if (error()) {\n <div class=\"ad-auth-error\">\n <i class=\"fa-solid fa-circle-exclamation\"></i>\n {{ \"adAuth.authError\" | translate }}\n </div>\n }\n\n <div class=\"ad-auth-buttons\">\n <core-generic-button\n [config]=\"loginButtonConfig()\"\n (buttonClick)=\"onLoginClick()\"\n />\n </div>\n }\n</div>\n", styles: [":host{display:block}.ad-auth-container{display:flex;flex-direction:column;gap:.75rem}.ad-auth-user-info{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;background-color:var(--color-background-secondary, #f5f5f5);border-radius:var(--border-radius, .375rem);font-size:.875rem}.ad-auth-user-avatar{width:2.5rem;height:2.5rem;border-radius:50%;background:linear-gradient(135deg,var(--color-primary, #0078d4) 0%,var(--color-primary-dark, #106ebe) 100%);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:600;font-size:1rem;flex-shrink:0}.ad-auth-user-details{flex:1;min-width:0}.ad-auth-user-name{font-weight:600;color:var(--color-text-primary, #1a1a1a);margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ad-auth-user-email{color:var(--color-text-secondary, #666);margin:0;font-size:.8125rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ad-auth-loading{display:flex;align-items:center;justify-content:center;padding:1rem;color:var(--color-text-secondary, #666);font-size:.875rem}.ad-auth-spinner{display:inline-block;width:1rem;height:1rem;border:2px solid var(--color-border, #e0e0e0);border-top-color:var(--color-primary, #0078d4);border-radius:50%;animation:spin .6s linear infinite;margin-right:.5rem}@keyframes spin{to{transform:rotate(360deg)}}.ad-auth-error{padding:.75rem 1rem;background-color:var(--color-danger-light, #fee);color:var(--color-danger, #d32f2f);border-radius:var(--border-radius, .375rem);font-size:.875rem}.ad-auth-not-configured{padding:1rem;background-color:var(--color-warning-light, #fff8e1);color:var(--color-warning-dark, #f57c00);border-radius:var(--border-radius, .375rem);font-size:.875rem;text-align:center}.ad-auth-buttons{display:flex;gap:.5rem}\n"] }]
|
|
20462
|
+
}], ctorParameters: () => [] });
|
|
20463
|
+
|
|
19922
20464
|
class CacheBustingInterceptor {
|
|
19923
20465
|
intercept(req, next) {
|
|
19924
20466
|
if (req.url.includes('/assets/i18n/') && req.url.endsWith('.json')) {
|
|
@@ -20200,5 +20742,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
20200
20742
|
* Generated bundle index. Do not edit.
|
|
20201
20743
|
*/
|
|
20202
20744
|
|
|
20203
|
-
export { ALL_COUNTRY_CODES, ActiveFiltersComponent, AgeValidationHelper, AlertComponent, AlertContainerComponent, AlertService, AlertType, ApiConfigurationProvider, BaseFieldComponent, ButtonContext, ButtonSize, ButtonType, COMMON_COUNTRIES, CacheBustingInterceptor, CardComponent, CarouselComponent, ChatMessagePosition, ChatMessageType, CheckboxFieldComponent, ConfigurationModel, ConfirmationDialogComponent, ConfirmationDialogService, CoreHostDirective, CoreManualRefreshComponent, CoreUiHttpLoaderFactory, CoreUiTranslateLoader, CoreUiTranslateService, CountryCode, CustomClassService, DEFAULT_COUNTRIES, DataListComponent, DataListItemComponent, DataStoreService, DateFieldComponent, DateUtility, DatetimeFieldComponent, DialogActions, DocumentAction, DocumentDisplayMode, DocumentFieldComponent, DocumentFieldValidators, DocumentPayloadMode, DropdownComponent, DropdownDirection, DropdownService, DynamicFieldDirective, DynamicFieldsHelper, FieldErrorsComponent, FieldType, FileFieldComponent, FileModel, FilePreviewActionType, FileTemplateModel, FileTemplateType, FileType, FileTypeModel, FileUploadService, FilterModalComponent, FilterService, FilterType, FixedActionPosition, FixedActionsMobileModalComponent, FixedActionsMobileModalService, GalleryAnimationType, GalleryLayoutType, GalleryModalComponent, GalleryModalGlobalService, GenericButtonComponent, GenericChatComponent, GenericChatService, GenericDocumentationComponent, GenericFixedActionsComponent, GenericGalleryComponent, GenericModalComponent, GenericPaginationComponent, GenericRatingComponent, GenericSidebarComponent, GenericSkeletonComponent, GenericStepsComponent, GenericSwitchComponent, GenericTableComponent, GenericTabsComponent, GenericTimelineComponent, GlobalApiConfigService, HeaderComponent, HeaderConfigurationService, HeaderElementType, HeaderService, HttpLoaderFactory, ImageModalComponent, ImageModalService, ImagePreviewComponent, LATIN_AMERICA_COUNTRIES, LayoutAuth, LayoutBreakpoint, LayoutComponent, LayoutService, LayoutStateService, LayoutType, LoaderComponent, LoaderService, MODEL_REFERENCE_SORT_KEY, MainNavComponent, MainNavService, ManualRefreshService, MobileHeaderComponent, MobileResolutionService, ModalMode, ModelApiService, MultiEntryFieldComponent, MultiEntryOutputFormat, NumberFieldComponent, NumberFieldConfigType, NumberFieldType, NumberRange, PERMISSION_ACTIONS_PROVIDER, PERMISSION_PROVIDER, PERMISSION_RESOURCES_PROVIDER, PaginationService, PasswordFieldComponent, PermissionEnumsService, PermissionModel, PermissionService, PermissionWrapperService, PermissionsActions, PermissionsCustomActions, PermissionsInterceptor, PermissionsResources, PhoneFieldComponent, ProgressBarComponent, ProgressBarSize, RatingService, RatingSize, RatingType, RedirectUrlService, ResetPasswordModel, RoleModel, SOUTH_AMERICA_COUNTRIES, SelectFieldComponent, ServerSelectFieldComponent, ServerSelectService, SidebarCustomModalComponent, SidebarCustomModalService, SidebarHeight, SidebarMobileModalService, SidebarMobileType, SidebarPosition, SidebarService, SidebarState, SidebarTemplateRegistryService, SidebarVisibility, SidebarWidth, SkeletonAnimation, SkeletonService, SkeletonSize, SkeletonType, SmartFieldComponent, SortDirection, SortMode, StepSize, StepStatus, StepType, StepsService, SwitchFieldComponent, TableAction, TableActionService, TableDataService, TableFixedActionsService, TableSortService, TextAreaFieldComponent, TextFieldComponent, TimeFieldComponent, TimeInterval, TimelineService, TimelineStatus, TimelineType, TranslationMergeService, UruguayanDocumentValidationHelper, UsersModel, VERSION, ageValidator, calculateAge, equalToValidator, generateRandomUruguayanDocument, getCountryCodeStrings, getLatestBirthDateForAge, getRandomCi, getUruguayanDocumentValidationDigit, getValidationDigit, isSameDate, isValidCountryCode, provideCoreUiTranslateLoader, providePermissionActions, providePermissionEnums, providePermissionResources, providePermissionService, providePermissionServiceFactory, provideTranslateLoader, random, transform, transformUruguayanDocument, uruguayanDocumentValidator, validate, validateAge, validateCi, validateUruguayanDocument, validationDigit };
|
|
20745
|
+
export { AD_AUTH_CONFIG, AD_AUTH_INTERCEPTOR_CONFIG, ALL_COUNTRY_CODES, ActiveFiltersComponent, AdAuthService, AdInteractionType, AdLoginButtonComponent, AgeValidationHelper, AlertComponent, AlertContainerComponent, AlertService, AlertType, ApiConfigurationProvider, BaseFieldComponent, ButtonContext, ButtonSize, ButtonType, COMMON_COUNTRIES, CacheBustingInterceptor, CardComponent, CarouselComponent, ChatMessagePosition, ChatMessageType, CheckboxFieldComponent, ConfigurationModel, ConfirmationDialogComponent, ConfirmationDialogService, CoreHostDirective, CoreManualRefreshComponent, CoreUiHttpLoaderFactory, CoreUiTranslateLoader, CoreUiTranslateService, CountryCode, CustomClassService, DEFAULT_AD_AUTH_INTERCEPTOR_CONFIG, DEFAULT_COUNTRIES, DataListComponent, DataListItemComponent, DataStoreService, DateFieldComponent, DateUtility, DatetimeFieldComponent, DialogActions, DocumentAction, DocumentDisplayMode, DocumentFieldComponent, DocumentFieldValidators, DocumentPayloadMode, DropdownComponent, DropdownDirection, DropdownService, DynamicFieldDirective, DynamicFieldsHelper, FieldErrorsComponent, FieldType, FileFieldComponent, FileModel, FilePreviewActionType, FileTemplateModel, FileTemplateType, FileType, FileTypeModel, FileUploadService, FilterModalComponent, FilterService, FilterType, FixedActionPosition, FixedActionsMobileModalComponent, FixedActionsMobileModalService, GalleryAnimationType, GalleryLayoutType, GalleryModalComponent, GalleryModalGlobalService, GenericButtonComponent, GenericChatComponent, GenericChatService, GenericDocumentationComponent, GenericFixedActionsComponent, GenericGalleryComponent, GenericModalComponent, GenericPaginationComponent, GenericRatingComponent, GenericSidebarComponent, GenericSkeletonComponent, GenericStepsComponent, GenericSwitchComponent, GenericTableComponent, GenericTabsComponent, GenericTimelineComponent, GlobalApiConfigService, HeaderComponent, HeaderConfigurationService, HeaderElementType, HeaderService, HttpLoaderFactory, ImageModalComponent, ImageModalService, ImagePreviewComponent, LATIN_AMERICA_COUNTRIES, LayoutAuth, LayoutBreakpoint, LayoutComponent, LayoutService, LayoutStateService, LayoutType, LoaderComponent, LoaderService, MODEL_REFERENCE_SORT_KEY, MainNavComponent, MainNavService, ManualRefreshService, MobileHeaderComponent, MobileResolutionService, ModalMode, ModelApiService, MultiEntryFieldComponent, MultiEntryOutputFormat, NumberFieldComponent, NumberFieldConfigType, NumberFieldType, NumberRange, PERMISSION_ACTIONS_PROVIDER, PERMISSION_PROVIDER, PERMISSION_RESOURCES_PROVIDER, PaginationService, PasswordFieldComponent, PermissionEnumsService, PermissionModel, PermissionService, PermissionWrapperService, PermissionsActions, PermissionsCustomActions, PermissionsInterceptor, PermissionsResources, PhoneFieldComponent, ProgressBarComponent, ProgressBarSize, RatingService, RatingSize, RatingType, RedirectUrlService, ResetPasswordModel, RoleModel, SOUTH_AMERICA_COUNTRIES, SelectFieldComponent, ServerSelectFieldComponent, ServerSelectService, SidebarCustomModalComponent, SidebarCustomModalService, SidebarHeight, SidebarMobileModalService, SidebarMobileType, SidebarPosition, SidebarService, SidebarState, SidebarTemplateRegistryService, SidebarVisibility, SidebarWidth, SkeletonAnimation, SkeletonService, SkeletonSize, SkeletonType, SmartFieldComponent, SortDirection, SortMode, StepSize, StepStatus, StepType, StepsService, SwitchFieldComponent, TableAction, TableActionService, TableDataService, TableFixedActionsService, TableSortService, TextAreaFieldComponent, TextFieldComponent, TimeFieldComponent, TimeInterval, TimelineService, TimelineStatus, TimelineType, TranslationMergeService, UruguayanDocumentValidationHelper, UsersModel, VERSION, adAuthGuard, adAuthInterceptor, adGuestGuard, adRoleGuard, ageValidator, calculateAge, equalToValidator, generateRandomUruguayanDocument, getCountryCodeStrings, getLatestBirthDateForAge, getRandomCi, getUruguayanDocumentValidationDigit, getValidationDigit, isSameDate, isValidCountryCode, provideAdAuth, provideAdAuthInterceptor, provideAdAuthWithInterceptor, provideCoreUiTranslateLoader, providePermissionActions, providePermissionEnums, providePermissionResources, providePermissionService, providePermissionServiceFactory, provideTranslateLoader, random, transform, transformUruguayanDocument, uruguayanDocumentValidator, validate, validateAge, validateCi, validateUruguayanDocument, validationDigit };
|
|
20204
20746
|
//# sourceMappingURL=solcre-org-core-ui.mjs.map
|