@flusys/ng-shared 7.1.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flusys/ng-shared",
3
- "version": "7.1.0",
3
+ "version": "8.0.0",
4
4
  "description": "Shared components and utilities for FLUSYS Angular packages",
5
5
  "license": "MIT",
6
6
  "peerDependencies": {
@@ -8,8 +8,8 @@
8
8
  "@angular/core": ">=22.0.0",
9
9
  "@angular/forms": ">=22.0.0",
10
10
  "@angular/router": ">=22.0.0",
11
- "@flusys/ng-core": ">=7.1.0",
12
- "@flusys/ng-ui": ">=7.1.0",
11
+ "@flusys/ng-core": ">=8.0.0",
12
+ "@flusys/ng-ui": ">=8.0.0",
13
13
  "rxjs": "^7.8.0"
14
14
  },
15
15
  "sideEffects": false,
@@ -3,13 +3,10 @@ import { Observable } from 'rxjs';
3
3
  import * as _angular_core from '@angular/core';
4
4
  import { Signal, PipeTransform, ResourceRef, ResourceStatus, Injector, model, TemplateRef, OnDestroy, ElementRef, DestroyRef, InjectionToken } from '@angular/core';
5
5
  import { HttpContextToken, HttpRequest, HttpHandlerFn, HttpEvent, HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
6
- import * as i3 from '@angular/router';
7
6
  import { ResolveFn, CanActivateFn } from '@angular/router';
8
- import * as i1 from '@angular/common';
9
- import * as i2 from '@angular/forms';
10
- import { ControlValueAccessor } from '@angular/forms';
11
7
  import * as _flusys_ng_shared from '@flusys/ng-shared';
12
8
  import { ServiceName } from '@flusys/ng-core';
9
+ import { ControlValueAccessor } from '@angular/forms';
13
10
  import { FormValueControl } from '@angular/forms/signals';
14
11
  import * as _angular_platform_browser from '@angular/platform-browser';
15
12
  import { CheckboxChangeEvent } from '@flusys/ng-ui';
@@ -537,6 +534,8 @@ interface IUserProvider {
537
534
  isActive?: boolean;
538
535
  [key: string]: unknown;
539
536
  }): Observable<IListResponse<IUserBasicInfo>>;
537
+ /** Resolve basic display info for a specific set of user IDs (e.g. reverse permission lookups) */
538
+ getUsersByIds?(ids: string[]): Observable<IListResponse<IUserBasicInfo>>;
540
539
  }
541
540
  /** Filter params passed to loadUsers function */
542
541
  interface IUserSelectFilter {
@@ -858,7 +857,6 @@ declare const SKIP_ERROR_TOAST: HttpContextToken<boolean>;
858
857
  * ```typescript
859
858
  * // In app.config.ts
860
859
  * provideHttpClient(
861
- * withFetch(),
862
860
  * withInterceptors([
863
861
  * authInterceptor, // from @flusys/ng-auth
864
862
  * tokenRefreshInterceptor, // from @flusys/ng-auth
@@ -876,12 +874,6 @@ interface IResolverModuleConfig {
876
874
  }
877
875
  declare function resolveTranslationModule(config: IResolverModuleConfig): ResolveFn<boolean>;
878
876
 
879
- declare class AngularModule {
880
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AngularModule, never>;
881
- static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AngularModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.RouterOutlet, typeof i3.RouterLink, typeof i3.RouterLinkActive, typeof IsEmptyImageDirective, typeof i1.NgOptimizedImage, typeof i1.NgComponentOutlet, typeof PreventDefaultDirective], [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.RouterOutlet, typeof i3.RouterLink, typeof i3.RouterLinkActive, typeof IsEmptyImageDirective, typeof i1.NgOptimizedImage, typeof i1.NgComponentOutlet, typeof PreventDefaultDirective]>;
882
- static ɵinj: _angular_core.ɵɵInjectorDeclaration<AngularModule>;
883
- }
884
-
885
877
  interface IApiService<DtoT, InterfaceT> {
886
878
  insert(dto: DtoT): Promise<ISingleResponse<InterfaceT>>;
887
879
  insertMany(dtos: DtoT[]): Promise<IBulkResponse<InterfaceT>>;
@@ -1038,7 +1030,6 @@ declare class BaseFormComponent {
1038
1030
  private readonly _submitted;
1039
1031
  private readonly _isLoadingInternal;
1040
1032
  private readonly _touchedFields;
1041
- private readonly _visiblePasswordFields;
1042
1033
  readonly formData: _angular_core.Signal<Record<string, unknown>>;
1043
1034
  readonly submitted: _angular_core.Signal<boolean>;
1044
1035
  readonly effectiveIsEditMode: _angular_core.Signal<boolean>;
@@ -1051,8 +1042,6 @@ declare class BaseFormComponent {
1051
1042
  getFieldValue(key: string): unknown;
1052
1043
  setFieldValue(key: string, value: unknown): void;
1053
1044
  markFieldTouched(key: string): void;
1054
- isPasswordVisible(key: string): boolean;
1055
- togglePasswordVisibility(key: string): void;
1056
1045
  isFieldInvalid(field: IFormField): boolean;
1057
1046
  getFieldTemplate(key: string): TemplateRef<unknown> | null;
1058
1047
  handleSubmit(): Promise<void>;
@@ -1280,8 +1269,8 @@ declare class FileUploaderComponent {
1280
1269
  }
1281
1270
 
1282
1271
  declare class IconComponent {
1283
- icon: _angular_core.InputSignal<string>;
1284
- iconType: _angular_core.InputSignal<IconTypeEnum | undefined>;
1272
+ readonly icon: _angular_core.InputSignal<string>;
1273
+ readonly iconType: _angular_core.InputSignal<IconTypeEnum | undefined>;
1285
1274
  protected readonly IconTypeEnum: typeof IconTypeEnum;
1286
1275
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<IconComponent, never>;
1287
1276
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<IconComponent, "lib-icon", never, { "icon": { "alias": "icon"; "required": true; "isSignal": true; }; "iconType": { "alias": "iconType"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
@@ -1608,6 +1597,19 @@ declare function anyPermissionGuard(permissions: string[], redirectTo?: string):
1608
1597
  */
1609
1598
  declare function allPermissionsGuard(permissions: string[], redirectTo?: string): CanActivateFn;
1610
1599
 
1600
+ /**
1601
+ * Authenticated Guard - Redirects to login when the user isn't authenticated.
1602
+ *
1603
+ * Uses AUTH_STATE_PROVIDER so feature packages can gate routes requiring
1604
+ * authentication without depending on ng-auth directly.
1605
+ *
1606
+ * @example
1607
+ * ```typescript
1608
+ * { path: 'notifications', canActivate: [authenticatedGuard()] }
1609
+ * ```
1610
+ */
1611
+ declare function authenticatedGuard(redirectTo?: string): CanActivateFn;
1612
+
1611
1613
  declare function localToUtc(dateStr: string, timeStr: string, timezone: string): Date;
1612
1614
  declare function utcToLocal(utcDate: Date | string, timezone: string): {
1613
1615
  date: string;
@@ -1667,5 +1669,5 @@ interface ScrollPaginationConfig {
1667
1669
  */
1668
1670
  declare function checkScrollPagination(event: Event, config: ScrollPaginationConfig): IPagination | null;
1669
1671
 
1670
- export { ACTION_PERMISSIONS, AUTH_STATE_PROVIDER, AngularModule, ApiResourceService, ApiResourceService as ApiService, BRANCH_PERMISSIONS, BaseFormComponent, BaseFormControl, BaseFormTemplateDirective, BaseListComponent, BaseListTemplateDirective, BaseUserSelectComponent, COMPANY_ACTION_PERMISSIONS, COMPANY_API_PROVIDER, COMPANY_PERMISSIONS, CookieService, EMAIL_CONFIG_PERMISSIONS, EMAIL_TEMPLATE_PERMISSIONS, EVENT_PERMISSIONS, EditModeElementChangerDirective, FILE_PERMISSIONS, FILE_PROVIDER, FILE_TYPE_FILTERS, FOLDER_PERMISSIONS, FORM_PERMISSIONS, FORM_RESULT_PERMISSIONS, FaviconService, FileSelectorDialogComponent, FileUploaderComponent, FileUrlService, HasPermissionDirective, IconComponent, IconTypeEnum, InlineSvgComponent, IsEmptyImageDirective, LANGUAGE_PERMISSIONS, LazyMultiSelectComponent, LazySelectComponent, NOTIFICATION_PERMISSIONS, PERMISSIONS, PROFILE_PERMISSION_PROVIDER, PermissionValidatorService, PlatformService, PreventDefaultDirective, ROLE_ACTION_PERMISSIONS, ROLE_PERMISSIONS, RouterTabsComponent, SHARED_MESSAGES, SKIP_ERROR_TOAST, SOCIAL_AUTH_CONFIG_PERMISSIONS, STORAGE_CONFIG_PERMISSIONS, TRANSLATION_KEY_PERMISSIONS, TRANSLATION_PERMISSIONS, TranslatePipe, TranslateService, UPLOAD_CONFIG_PERMISSIONS, USER_ACTION_PERMISSIONS, USER_PERMISSIONS, USER_PERMISSION_PROVIDER, USER_PROVIDER, USER_ROLE_PERMISSIONS, UserMultiSelectComponent, UserSelectComponent, allPermissionsGuard, anyPermissionGuard, checkScrollPagination, errorCatchingInterceptor, evaluateLogicNode, evaluatePermission, formatFileSize, formatInTimezone, getAcceptString, getFileIconClass, getUserTimezone, hasAllPermissions, hasAnyPermission, hasPermission, isFileTypeAllowed, localToUtc, permissionGuard, provideValueAccessor, resolveTranslationModule, utcToLocal };
1672
+ export { ACTION_PERMISSIONS, AUTH_STATE_PROVIDER, ApiResourceService, ApiResourceService as ApiService, BRANCH_PERMISSIONS, BaseFormComponent, BaseFormControl, BaseFormTemplateDirective, BaseListComponent, BaseListTemplateDirective, BaseUserSelectComponent, COMPANY_ACTION_PERMISSIONS, COMPANY_API_PROVIDER, COMPANY_PERMISSIONS, CookieService, EMAIL_CONFIG_PERMISSIONS, EMAIL_TEMPLATE_PERMISSIONS, EVENT_PERMISSIONS, EditModeElementChangerDirective, FILE_PERMISSIONS, FILE_PROVIDER, FILE_TYPE_FILTERS, FOLDER_PERMISSIONS, FORM_PERMISSIONS, FORM_RESULT_PERMISSIONS, FaviconService, FileSelectorDialogComponent, FileUploaderComponent, FileUrlService, HasPermissionDirective, IconComponent, IconTypeEnum, InlineSvgComponent, IsEmptyImageDirective, LANGUAGE_PERMISSIONS, LazyMultiSelectComponent, LazySelectComponent, NOTIFICATION_PERMISSIONS, PERMISSIONS, PROFILE_PERMISSION_PROVIDER, PermissionValidatorService, PlatformService, PreventDefaultDirective, ROLE_ACTION_PERMISSIONS, ROLE_PERMISSIONS, RouterTabsComponent, SHARED_MESSAGES, SKIP_ERROR_TOAST, SOCIAL_AUTH_CONFIG_PERMISSIONS, STORAGE_CONFIG_PERMISSIONS, TRANSLATION_KEY_PERMISSIONS, TRANSLATION_PERMISSIONS, TranslatePipe, TranslateService, UPLOAD_CONFIG_PERMISSIONS, USER_ACTION_PERMISSIONS, USER_PERMISSIONS, USER_PERMISSION_PROVIDER, USER_PROVIDER, USER_ROLE_PERMISSIONS, UserMultiSelectComponent, UserSelectComponent, allPermissionsGuard, anyPermissionGuard, authenticatedGuard, checkScrollPagination, errorCatchingInterceptor, evaluateLogicNode, evaluatePermission, formatFileSize, formatInTimezone, getAcceptString, getFileIconClass, getUserTimezone, hasAllPermissions, hasAnyPermission, hasPermission, isFileTypeAllowed, localToUtc, permissionGuard, provideValueAccessor, resolveTranslationModule, utcToLocal };
1671
1673
  export type { ActionSeverity, DeleteType, FilesResponseDto, FormFieldType, IActionNode, IActivatable, IApiService, IAuthStateProvider, IBaseEntity, IBulkMeta, IBulkResponse, ICompanyApiProvider, ICompanyBasicInfo, IDeleteData, IDropDown, IFileBasicInfo, IFileProvider, IFileSelectFilter, IFileUploadOptions, IFilter, IFilterData, IFolderBasicInfo, IFormField, IFormSelectOption, IGroupNode, IListResponse, ILoggedUserInfo, ILogicNode, IMessageResponse, IOrderable, IPagination, IPaginationMeta, IProfileActionInfo, IProfilePermissionProvider, IProfileRoleInfo, IRequestMeta, IResolverModuleConfig, ISelectFilter, ISingleResponse, ISoftDeletable, ISort, IStorageConfigBasicInfo, ITableAction, ITableColumn, ITagConfig, ITimestampable, IUploadedFile, IUserBasicInfo, IUserBranchPermission, IUserCompanyInfo, IUserPermissionProvider, IUserProvider, IUserSelectFilter, LoadUsersFn, PermissionCode, RouterTabItem, ScrollPaginationConfig, TableColumnType, UploadFileFn, UploadMultipleFilesFn };