@solcre-org/core-ui 2.12.10 → 2.12.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { TemplateRef, AfterViewInit, OnDestroy, ElementRef, OnInit, SimpleChanges, OnChanges, Type, ViewContainerRef, AfterViewChecked, RendererFactory2, Signal, InjectionToken, Provider } from '@angular/core';
2
+ import { TemplateRef, AfterViewInit, OnDestroy, ElementRef, OnInit, SimpleChanges, OnChanges, Signal, Type, ViewContainerRef, AfterViewChecked, RendererFactory2, InjectionToken, Provider } from '@angular/core';
3
3
  import { ValidatorFn, FormControl, FormGroup } from '@angular/forms';
4
4
  import { DataBaseModelInterface } from '@solcre-org/core';
5
5
  import { NgSelectComponent } from '@ng-select/ng-select';
@@ -1370,7 +1370,7 @@ interface CustomAction<T> {
1370
1370
  shouldDisable?: (row: T) => boolean;
1371
1371
  }
1372
1372
 
1373
- interface TableActionConfig {
1373
+ interface TableActionConfig<T = any> {
1374
1374
  action: TableAction;
1375
1375
  isExtra?: boolean;
1376
1376
  icon?: string;
@@ -1381,6 +1381,8 @@ interface TableActionConfig {
1381
1381
  resource: string;
1382
1382
  action: string;
1383
1383
  };
1384
+ shouldShow?: (row: T) => boolean;
1385
+ shouldDisable?: (row: T) => boolean;
1384
1386
  }
1385
1387
 
1386
1388
  declare class DropdownComponent<T> implements OnDestroy {
@@ -1419,9 +1421,11 @@ declare class DropdownComponent<T> implements OnDestroy {
1419
1421
  closeDropdown(): void;
1420
1422
  triggerAction(action: TableAction): void;
1421
1423
  triggerCustomAction(action: CustomAction<T>): void;
1422
- hasPermission(action: TableActionConfig | CustomAction<T>): boolean;
1424
+ hasPermission(action: TableActionConfig<T> | CustomAction<T>): boolean;
1425
+ shouldShowAction(actionConfig: TableActionConfig<T>): boolean;
1426
+ shouldShowCustomAction(customAction: CustomAction<T>): boolean;
1423
1427
  getActionLabel(action: TableAction): string;
1424
- getDefaultActionButtonConfig(actionConfig: TableActionConfig): ButtonConfig;
1428
+ getDefaultActionButtonConfig(actionConfig: TableActionConfig<T>): ButtonConfig;
1425
1429
  getCustomActionButtonConfig(customAction: CustomAction<T>): ButtonConfig;
1426
1430
  getCustomActionButtonConfigForRow(customAction: CustomAction<T>): ButtonConfig;
1427
1431
  onButtonClick(event: ButtonActionEvent, action: any): void;
@@ -2009,7 +2013,7 @@ declare class GenericTableComponent<T extends DataBaseModelInterface & {
2009
2013
  columns: _angular_core.InputSignal<ColumnConfig<T>[]>;
2010
2014
  modalFields: _angular_core.InputSignal<ModalFieldConfig<T>[]>;
2011
2015
  modalTabs: _angular_core.InputSignal<ModalTabConfig<T>[]>;
2012
- actions: _angular_core.InputSignal<TableActionConfig[]>;
2016
+ actions: _angular_core.InputSignal<TableActionConfig<T>[]>;
2013
2017
  customActions: _angular_core.InputSignal<CustomAction<T>[]>;
2014
2018
  globalActions: _angular_core.InputSignal<GlobalAction<T>[]>;
2015
2019
  pageSizeOptions: _angular_core.InputSignal<number[] | undefined>;
@@ -2079,9 +2083,10 @@ declare class GenericTableComponent<T extends DataBaseModelInterface & {
2079
2083
  regularCustomActions: _angular_core.Signal<CustomAction<T>[]>;
2080
2084
  extraCustomActions: _angular_core.Signal<CustomAction<T>[]>;
2081
2085
  getVisibleCustomActions(row: T, isExtra?: boolean): CustomAction<T>[];
2086
+ getVisibleDefaultActions(row: T, isExtra?: boolean): TableActionConfig<T>[];
2082
2087
  hasExtraCustomActions: _angular_core.Signal<boolean>;
2083
- regularDefaultActions: _angular_core.Signal<TableActionConfig[]>;
2084
- extraDefaultActions: _angular_core.Signal<TableActionConfig[]>;
2088
+ regularDefaultActions: _angular_core.Signal<TableActionConfig<T>[]>;
2089
+ extraDefaultActions: _angular_core.Signal<TableActionConfig<T>[]>;
2085
2090
  hasExtraDefaultActions: _angular_core.Signal<boolean>;
2086
2091
  hasExtraActions: _angular_core.Signal<boolean>;
2087
2092
  currentFilterValues: _angular_core.WritableSignal<Map<string, any>>;
@@ -2153,7 +2158,7 @@ declare class GenericTableComponent<T extends DataBaseModelInterface & {
2153
2158
  closeModal(): void;
2154
2159
  emitDataEvent(data: T, mode: ModalMode): void;
2155
2160
  getRowId(row: T): number;
2156
- hasPermission(action: TableActionConfig | CustomAction<T> | GlobalAction<T> | TableActionConfig): boolean;
2161
+ hasPermission(action: TableActionConfig<T> | CustomAction<T> | GlobalAction<T>): boolean;
2157
2162
  showFiltersPopup(): void;
2158
2163
  closeFiltersPopup(): void;
2159
2164
  handleFilterChange(filterValues: Map<string, any>): void;
@@ -2207,7 +2212,7 @@ declare class GenericTableComponent<T extends DataBaseModelInterface & {
2207
2212
  loadMoreItems(): void;
2208
2213
  onModalData(data: T): void;
2209
2214
  getExpandButtonConfig(row: T): ButtonConfig;
2210
- getActionButtonConfig(action: TableAction, actionConfig: TableActionConfig): ButtonConfig;
2215
+ getActionButtonConfig(action: TableAction, actionConfig: TableActionConfig<T>, row?: T): ButtonConfig;
2211
2216
  getCustomActionButtonConfig(customAction: CustomAction<T>): ButtonConfig;
2212
2217
  getCustomActionButtonConfigForRow(customAction: CustomAction<T>, row: T): ButtonConfig;
2213
2218
  getMoreActionsButtonConfig(rowId: number): ButtonConfig;
@@ -2500,6 +2505,32 @@ interface ConfirmUploadRequest {
2500
2505
  company_id: string;
2501
2506
  }
2502
2507
 
2508
+ interface DynamicFieldsHelperConfig<T extends DataBaseModelInterface> {
2509
+ fields: ModalFieldConfig<T>[];
2510
+ initialData?: Partial<T>;
2511
+ modelFactory?: (data: Partial<T>) => T;
2512
+ customValidators?: ((data: T) => string[])[];
2513
+ onDataChange?: (data: T) => void;
2514
+ onValidationChange?: (errors: Record<string, string[]>) => void;
2515
+ }
2516
+ interface DynamicFieldsHelperState<T extends DataBaseModelInterface> {
2517
+ editedData: Signal<T | null>;
2518
+ fieldErrors: Signal<Record<string, string[]>>;
2519
+ hasUnsavedChanges: Signal<boolean>;
2520
+ isValid: Signal<boolean>;
2521
+ }
2522
+ interface DynamicFieldsHelperMethods<T extends DataBaseModelInterface> {
2523
+ getFieldValue(fieldKey: keyof T): any;
2524
+ onFieldValueChange(fieldKey: keyof T, value: any): void;
2525
+ onFieldBlur(fieldKey: keyof T): void;
2526
+ getFieldErrors(fieldKey: keyof T): string[];
2527
+ validateAllFields(): boolean;
2528
+ validateField(fieldKey: keyof T): void;
2529
+ reset(): void;
2530
+ setData(data: Partial<T>): void;
2531
+ getPayloadData(): T | null;
2532
+ }
2533
+
2503
2534
  interface HeaderActionConfig {
2504
2535
  id: string;
2505
2536
  label: string;
@@ -3987,6 +4018,33 @@ declare class DateUtility {
3987
4018
 
3988
4019
  declare const isSameDate: (date1: Date, date2: Date) => boolean;
3989
4020
 
4021
+ declare class DynamicFieldsHelper<T extends DataBaseModelInterface> implements DynamicFieldsHelperMethods<T> {
4022
+ private formBuilder;
4023
+ private config;
4024
+ private mode;
4025
+ private _editedData;
4026
+ private _fieldErrors;
4027
+ private _originalData;
4028
+ private _form;
4029
+ readonly state: DynamicFieldsHelperState<T>;
4030
+ constructor(config: DynamicFieldsHelperConfig<T>, mode?: ModalMode);
4031
+ private initializeData;
4032
+ getFieldValue(fieldKey: keyof T): any;
4033
+ onFieldValueChange(fieldKey: keyof T, value: any): void;
4034
+ onFieldBlur(fieldKey: keyof T): void;
4035
+ getFieldErrors(fieldKey: keyof T): string[];
4036
+ validateField(fieldKey: keyof T): void;
4037
+ validateAllFields(): boolean;
4038
+ reset(): void;
4039
+ setData(data: Partial<T>): void;
4040
+ getPayloadData(): T | null;
4041
+ private updateField;
4042
+ private getFieldConfig;
4043
+ private detectChanges;
4044
+ private isFormValid;
4045
+ private convertEmptyStringsToNull;
4046
+ }
4047
+
3990
4048
  declare const VERSION: {
3991
4049
  full: string;
3992
4050
  major: number;
@@ -3996,5 +4054,5 @@ declare const VERSION: {
3996
4054
  buildDate: string;
3997
4055
  };
3998
4056
 
3999
- export { ActiveFiltersComponent, AlertComponent, AlertContainerComponent, AlertService, AlertType, ApiConfigurationProvider, BaseFieldComponent, ButtonContext, ButtonSize, ButtonType, CacheBustingInterceptor, CardComponent, CarouselComponent, CheckboxFieldComponent, ConfigurationModel, ConfirmationDialogComponent, ConfirmationDialogService, CoreHostDirective, CoreUiHttpLoaderFactory, CoreUiTranslateLoader, CoreUiTranslateService, DataListComponent, DataListItemComponent, DateFieldComponent, DateUtility, DatetimeFieldComponent, DialogActions, DocumentAction, DocumentDisplayMode, DropdownComponent, DropdownDirection, DropdownService, DynamicFieldDirective, FieldErrorsComponent, FieldType, FileFieldComponent, FileModel, FileTemplateModel, FileTemplateType, FileType, FileTypeModel, FileUploadService, FilterModalComponent, FilterService, FilterType, GenericButtonComponent, GenericDocumentationComponent, GenericModalComponent, GenericPaginationComponent, GenericRatingComponent, GenericSidebarComponent, GenericStepsComponent, GenericTableComponent, GenericTabsComponent, GenericTimelineComponent, GlobalApiConfigService, HeaderComponent, HeaderConfigurationService, HeaderElementType, HeaderService, HttpLoaderFactory, ImageModalComponent, ImageModalService, ImagePreviewComponent, LayoutAuth, LayoutBreakpoint, LayoutComponent, LayoutService, LayoutStateService, LayoutType, LoaderComponent, LoaderService, MainNavComponent, MainNavService, ModalMode, ModelApiService, MultiEntryFieldComponent, MultiEntryOutputFormat, NumberFieldComponent, NumberFieldConfigType, NumberFieldType, NumberRange, PERMISSION_ACTIONS_PROVIDER, PERMISSION_PROVIDER, PERMISSION_RESOURCES_PROVIDER, PaginationService, PasswordFieldComponent, PermissionEnumsService, PermissionModel, PermissionService, PermissionWrapperService, PermissionsActions, PermissionsInterceptor, PermissionsResources, ProgressBarComponent, ProgressBarSize, RatingService, RatingSize, RatingType, ResetPasswordModel, RoleModel, SelectFieldComponent, ServerSelectFieldComponent, ServerSelectService, SidebarCustomModalComponent, SidebarCustomModalService, SidebarHeight, SidebarMobileModalService, SidebarMobileType, SidebarPosition, SidebarService, SidebarState, SidebarTemplateRegistryService, SidebarVisibility, SidebarWidth, SmartFieldComponent, SortDirection, SortMode, StepSize, StepStatus, StepType, StepsService, SwitchFieldComponent, TableAction, TableActionService, TableDataService, TableSortService, TextAreaFieldComponent, TextFieldComponent, TimeFieldComponent, TimeInterval, TimelineService, TimelineStatus, TimelineType, TranslationMergeService, UsersModel, VERSION, equalToValidator, isSameDate, provideCoreUiTranslateLoader, providePermissionActions, providePermissionEnums, providePermissionResources, providePermissionService, providePermissionServiceFactory, provideTranslateLoader };
4000
- export type { ActiveFilterItem, ActiveFiltersConfig, AdditionalPermissionResources, AddressModel, Alert, ApiConfig, ApiResponse, BottomNavItem, ButtonActionEvent, ButtonConfig, CarouselConfig, CarouselImage, CheckboxFieldConfig, CheckboxModalFieldConfig, CheckboxOption, ColumnConfig, ColumnDisabledConfig, CompanyInfo, ConfirmUploadRequest, ConfirmationDialogConfig, CustomAction, DataListItem, DateFieldConfig, DateModalFieldConfig, DocumentActionEvent, DocumentConfig, DocumentItem, ExpansionConfig, ExtendedModalFieldConfig, ExtendedPermissionProvider, FileFieldConfig, FileUploadConfig, FilterConfig, FilterParams, GenericTab, GenericTabClickEvent, GenericTabConfig, GlobalAction, HeaderActionConfig, HeaderConfig, HeaderElementConfig, HeaderOrderConfig, ImageModalData, InlineEditConfig, LayoutConfig, LayoutDataAttributes, LogoImagesConfig, ModalButtonConfig, ModalFieldConfig, ModalTabConfig, ModalValidationResult, MoreDataConfig, MultiEntryFieldConfig, MultiEntryFieldValue, NavConfig, NavItem, NumberFieldConfig, NumberModalFieldConfig, PaginatedResponse, PaginationEvent, PermissionActionsProvider, PermissionProvider, PermissionResourcesProvider, PresignedDownloadUrlResponse, PresignedUrlRequest, PresignedUrlResponse, PreviewFileUrl, RatingConfig, RatingStar, RatingSubmitEvent, RowStyleConfig, RowVisibilityConfig, SearchResponse, SelectServerSideConfig, SidebarBackButton, SidebarComponentConfig, SidebarComponentEvents, SidebarConfig, SidebarCustomModalConfig, SidebarItem, SidebarResponsiveConfig, SidebarSubItem, SidebarTemplateContext, SortConfig, StepChangeEvent, StepClickEvent, StepItemConfig, StepsConfig, SwitchFieldConfig, SwitchModalFieldConfig, TableActionConfig, TableSortConfig, TimeFieldConfig, TimeFieldValue, TimeOption, TimelineConfig, TimelineItem };
4057
+ export { ActiveFiltersComponent, AlertComponent, AlertContainerComponent, AlertService, AlertType, ApiConfigurationProvider, BaseFieldComponent, ButtonContext, ButtonSize, ButtonType, CacheBustingInterceptor, CardComponent, CarouselComponent, CheckboxFieldComponent, ConfigurationModel, ConfirmationDialogComponent, ConfirmationDialogService, CoreHostDirective, CoreUiHttpLoaderFactory, CoreUiTranslateLoader, CoreUiTranslateService, DataListComponent, DataListItemComponent, DateFieldComponent, DateUtility, DatetimeFieldComponent, DialogActions, DocumentAction, DocumentDisplayMode, DropdownComponent, DropdownDirection, DropdownService, DynamicFieldDirective, DynamicFieldsHelper, FieldErrorsComponent, FieldType, FileFieldComponent, FileModel, FileTemplateModel, FileTemplateType, FileType, FileTypeModel, FileUploadService, FilterModalComponent, FilterService, FilterType, GenericButtonComponent, GenericDocumentationComponent, GenericModalComponent, GenericPaginationComponent, GenericRatingComponent, GenericSidebarComponent, GenericStepsComponent, GenericTableComponent, GenericTabsComponent, GenericTimelineComponent, GlobalApiConfigService, HeaderComponent, HeaderConfigurationService, HeaderElementType, HeaderService, HttpLoaderFactory, ImageModalComponent, ImageModalService, ImagePreviewComponent, LayoutAuth, LayoutBreakpoint, LayoutComponent, LayoutService, LayoutStateService, LayoutType, LoaderComponent, LoaderService, MainNavComponent, MainNavService, ModalMode, ModelApiService, MultiEntryFieldComponent, MultiEntryOutputFormat, NumberFieldComponent, NumberFieldConfigType, NumberFieldType, NumberRange, PERMISSION_ACTIONS_PROVIDER, PERMISSION_PROVIDER, PERMISSION_RESOURCES_PROVIDER, PaginationService, PasswordFieldComponent, PermissionEnumsService, PermissionModel, PermissionService, PermissionWrapperService, PermissionsActions, PermissionsInterceptor, PermissionsResources, ProgressBarComponent, ProgressBarSize, RatingService, RatingSize, RatingType, ResetPasswordModel, RoleModel, SelectFieldComponent, ServerSelectFieldComponent, ServerSelectService, SidebarCustomModalComponent, SidebarCustomModalService, SidebarHeight, SidebarMobileModalService, SidebarMobileType, SidebarPosition, SidebarService, SidebarState, SidebarTemplateRegistryService, SidebarVisibility, SidebarWidth, SmartFieldComponent, SortDirection, SortMode, StepSize, StepStatus, StepType, StepsService, SwitchFieldComponent, TableAction, TableActionService, TableDataService, TableSortService, TextAreaFieldComponent, TextFieldComponent, TimeFieldComponent, TimeInterval, TimelineService, TimelineStatus, TimelineType, TranslationMergeService, UsersModel, VERSION, equalToValidator, isSameDate, provideCoreUiTranslateLoader, providePermissionActions, providePermissionEnums, providePermissionResources, providePermissionService, providePermissionServiceFactory, provideTranslateLoader };
4058
+ export type { ActiveFilterItem, ActiveFiltersConfig, AdditionalPermissionResources, AddressModel, Alert, ApiConfig, ApiResponse, BottomNavItem, ButtonActionEvent, ButtonConfig, CarouselConfig, CarouselImage, CheckboxFieldConfig, CheckboxModalFieldConfig, CheckboxOption, ColumnConfig, ColumnDisabledConfig, CompanyInfo, ConfirmUploadRequest, ConfirmationDialogConfig, CustomAction, DataListItem, DateFieldConfig, DateModalFieldConfig, DocumentActionEvent, DocumentConfig, DocumentItem, DynamicFieldsHelperConfig, DynamicFieldsHelperMethods, DynamicFieldsHelperState, ExpansionConfig, ExtendedModalFieldConfig, ExtendedPermissionProvider, FileFieldConfig, FileUploadConfig, FilterConfig, FilterParams, GenericTab, GenericTabClickEvent, GenericTabConfig, GlobalAction, HeaderActionConfig, HeaderConfig, HeaderElementConfig, HeaderOrderConfig, ImageModalData, InlineEditConfig, LayoutConfig, LayoutDataAttributes, LogoImagesConfig, ModalButtonConfig, ModalFieldConfig, ModalTabConfig, ModalValidationResult, MoreDataConfig, MultiEntryFieldConfig, MultiEntryFieldValue, NavConfig, NavItem, NumberFieldConfig, NumberModalFieldConfig, PaginatedResponse, PaginationEvent, PermissionActionsProvider, PermissionProvider, PermissionResourcesProvider, PresignedDownloadUrlResponse, PresignedUrlRequest, PresignedUrlResponse, PreviewFileUrl, RatingConfig, RatingStar, RatingSubmitEvent, RowStyleConfig, RowVisibilityConfig, SearchResponse, SelectServerSideConfig, SidebarBackButton, SidebarComponentConfig, SidebarComponentEvents, SidebarConfig, SidebarCustomModalConfig, SidebarItem, SidebarResponsiveConfig, SidebarSubItem, SidebarTemplateContext, SortConfig, StepChangeEvent, StepClickEvent, StepItemConfig, StepsConfig, SwitchFieldConfig, SwitchModalFieldConfig, TableActionConfig, TableSortConfig, TimeFieldConfig, TimeFieldValue, TimeOption, TimelineConfig, TimelineItem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solcre-org/core-ui",
3
- "version": "2.12.10",
3
+ "version": "2.12.12",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"