spiderly 19.7.1 → 19.7.3

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.
@@ -106,12 +106,12 @@ export declare class BaseFormComponent<TMainUIForm extends BaseEntity = any, TSa
106
106
  * @example
107
107
  * ```ts
108
108
  * // Override to navigate to a custom route after save
109
- * rerouteToSavedObject = (rerouteId: number | string): void => {
109
+ * override rerouteToSavedObject(rerouteId: number | string): void {
110
110
  * this.router.navigateByUrl(`/products/${rerouteId}/details`);
111
- * };
111
+ * }
112
112
  * ```
113
113
  */
114
- rerouteToSavedObject: (rerouteId: number | string) => void;
114
+ rerouteToSavedObject(rerouteId: number | string): void;
115
115
  /**
116
116
  * Hook that runs **before** form validation and the save request.
117
117
  * Use this to modify the save body or perform any pre-save logic (e.g., transforming data, setting computed fields).
@@ -24,10 +24,8 @@ export declare class ProfileAvatarComponent {
24
24
  private initTopBarSubscription;
25
25
  currentUser: UserBase;
26
26
  userProfilePath: string;
27
- unreadNotificationsCount: number;
28
27
  avatarLabel: string;
29
28
  showProfileIcon: boolean;
30
- notificationMenuItem: ProfileAvatarModalMenuItem;
31
29
  menu: ElementRef;
32
30
  topbarProfileDropdownMenuButton: ElementRef;
33
31
  constructor(layoutService: LayoutServiceBase, authService: AuthServiceBase, router: Router, translocoService: TranslocoService, config: ConfigServiceBase);
@@ -45,5 +43,4 @@ export interface ProfileAvatarModalMenuItem {
45
43
  icon?: string;
46
44
  showSeparator?: boolean;
47
45
  onClick?: () => void;
48
- showNotificationBadge?: boolean;
49
46
  }
@@ -17,11 +17,14 @@ export declare class SpiderlyFileComponent extends BaseControl implements OnInit
17
17
  acceptedFileTypes: Array<'image/*' | 'image/png' | 'image/jpeg' | 'image/webp' | 'image/gif' | 'image/avif' | 'image/svg+xml' | '.png' | '.jpg' | '.jpeg' | '.webp' | '.gif' | '.avif' | '.svg' | 'application/pdf' | '.pdf' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' | 'application/vnd.ms-excel' | '.xlsx' | '.xls' | 'video/*' | 'video/mp4' | '.mp4' | 'audio/*' | 'audio/mpeg' | '.mp3' | 'application/zip' | '.zip' | 'text/csv' | '.csv'>;
18
18
  required: boolean;
19
19
  multiple: boolean;
20
- isCloudinaryFileData: boolean;
20
+ isUrlFileData: boolean;
21
21
  imageWidth: number;
22
22
  imageHeight: number;
23
23
  maxFileSize: number;
24
24
  acceptedFileTypesCommaSeparated: string;
25
+ existingFileUrl: string | null;
26
+ existingFileIsImage: boolean;
27
+ existingFileName: string;
25
28
  files: File[];
26
29
  constructor(translocoService: TranslocoService, messageService: SpiderlyMessageService, validatorService: ValidatorAbstractService);
27
30
  ngOnInit(): void;
@@ -30,12 +33,14 @@ export declare class SpiderlyFileComponent extends BaseControl implements OnInit
30
33
  private hasImageDimensionConstraints;
31
34
  choose(event: any, chooseCallback: any): void;
32
35
  fileRemoved(removeFileCallback: any, index: number): void;
33
- pushFileFromCloudinaryUrl(cloudinaryUrl: string): Promise<File>;
36
+ removeExistingFile(): void;
37
+ private clearFile;
38
+ private setExistingFileUrl;
34
39
  getFileFromBase64(base64String: string): File;
35
40
  isFileImageType(mimeType: string): boolean;
36
41
  isExcelFileType(mimeType: string): boolean;
37
42
  static ɵfac: i0.ɵɵFactoryDeclaration<SpiderlyFileComponent, never>;
38
- static ɵcmp: i0.ɵɵComponentDeclaration<SpiderlyFileComponent, "spiderly-file", never, { "objectId": { "alias": "objectId"; "required": false; }; "fileData": { "alias": "fileData"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; "required": { "alias": "required"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "isCloudinaryFileData": { "alias": "isCloudinaryFileData"; "required": false; }; "imageWidth": { "alias": "imageWidth"; "required": false; }; "imageHeight": { "alias": "imageHeight"; "required": false; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; }; "files": { "alias": "files"; "required": false; }; }, { "onFileSelected": "onFileSelected"; "onFileRemoved": "onFileRemoved"; }, never, never, true, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpiderlyFileComponent, "spiderly-file", never, { "objectId": { "alias": "objectId"; "required": false; }; "fileData": { "alias": "fileData"; "required": false; }; "acceptedFileTypes": { "alias": "acceptedFileTypes"; "required": false; }; "required": { "alias": "required"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "isUrlFileData": { "alias": "isUrlFileData"; "required": false; }; "imageWidth": { "alias": "imageWidth"; "required": false; }; "imageHeight": { "alias": "imageHeight"; "required": false; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; }; "files": { "alias": "files"; "required": false; }; }, { "onFileSelected": "onFileSelected"; "onFileRemoved": "onFileRemoved"; }, never, never, true, never>;
39
44
  }
40
45
  export declare class SpiderlyFileSelectEvent extends BaseEntity {
41
46
  file?: File;
@@ -3,13 +3,11 @@ import { UserBase } from './security-entities';
3
3
  export declare class InitTopBarData extends BaseEntity {
4
4
  companyName?: string;
5
5
  userProfilePath?: string;
6
- unreadNotificationsCount?: number;
7
6
  showProfileIcon?: boolean;
8
7
  currentUser?: UserBase;
9
- constructor({ companyName, userProfilePath, unreadNotificationsCount, showProfileIcon, currentUser, }?: {
8
+ constructor({ companyName, userProfilePath, showProfileIcon, currentUser, }?: {
10
9
  companyName?: string;
11
10
  userProfilePath?: string;
12
- unreadNotificationsCount?: number;
13
11
  showProfileIcon?: boolean;
14
12
  currentUser?: UserBase;
15
13
  });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Machine-readable error codes returned in `ApiErrorDTO.errorCode`.
3
+ * Mirror of Spiderly.Shared.DTO.ApiErrorCodes — keep in sync.
4
+ */
5
+ export declare const ApiErrorCodes: {
6
+ readonly InvalidToken: "invalid_token";
7
+ readonly ValidationFailed: "validation_failed";
8
+ readonly UniqueViolation: "unique_violation";
9
+ readonly ForeignKeyViolation: "foreign_key_violation";
10
+ readonly ConcurrencyConflict: "concurrency_conflict";
11
+ };
12
+ export type ApiErrorCode = (typeof ApiErrorCodes)[keyof typeof ApiErrorCodes];
@@ -18,7 +18,6 @@ export declare class ApiSecurityService {
18
18
  refreshTokenWithCookies: (browserId: string) => Observable<AuthResultWithCookies>;
19
19
  getCurrentUserBase: () => Observable<UserBase>;
20
20
  getCurrentUserPermissionCodes: () => Observable<string[]>;
21
- getUnreadNotificationsCountForCurrentUser: () => Observable<number>;
22
21
  static ɵfac: i0.ɵɵFactoryDeclaration<ApiSecurityService, never>;
23
22
  static ɵprov: i0.ɵɵInjectableDeclaration<ApiSecurityService>;
24
23
  }
@@ -1,7 +1,7 @@
1
1
  import { AuthServiceBase } from './auth.service.base';
2
2
  import { ApiSecurityService } from './api.service.security';
3
3
  import { OnDestroy } from '@angular/core';
4
- import { BehaviorSubject, Observable, Subscription } from 'rxjs';
4
+ import { Observable, Subscription } from 'rxjs';
5
5
  import { InitTopBarData } from '../entities/init-top-bar-data';
6
6
  import { ConfigServiceBase } from './config.service.base';
7
7
  import { AutoCompleteCompleteEvent } from 'primeng/autocomplete';
@@ -30,8 +30,6 @@ export declare class LayoutServiceBase implements OnDestroy {
30
30
  protected config: ConfigServiceBase;
31
31
  protected authService: AuthServiceBase;
32
32
  userSubscription: Subscription;
33
- protected _unreadNotificationsNumber: BehaviorSubject<number>;
34
- unreadNotificationsCount$: Observable<number>;
35
33
  layoutConfig: AppConfig;
36
34
  state: LayoutState;
37
35
  private configUpdate;
@@ -39,9 +37,6 @@ export declare class LayoutServiceBase implements OnDestroy {
39
37
  configUpdate$: Observable<AppConfig>;
40
38
  overlayOpen$: Observable<any>;
41
39
  constructor(apiService: ApiSecurityService, config: ConfigServiceBase, authService: AuthServiceBase);
42
- initUnreadNotificationsCountForCurrentUser: () => void;
43
- initUnreadNotificationsCountForCurrentUserObservable: () => Observable<any>;
44
- setUnreadNotificationsCountForCurrentUser: () => Observable<any>;
45
40
  onMenuToggle(): void;
46
41
  showProfileSidebar(): void;
47
42
  showProfileDropdownSidebar(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spiderly",
3
- "version": "19.7.1",
3
+ "version": "19.7.3",
4
4
  "author": "Filip Trivan",
5
5
  "license": "MIT",
6
6
  "description": "Spiderly Angular Library to use in combination with Spiderly.",
package/public-api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './lib/errors/api-error-codes';
1
2
  export * from './lib/controls/base-autocomplete-control';
2
3
  export * from './lib/controls/base-control';
3
4
  export * from './lib/controls/base-dropdown-control';