mmhglobal-dynamicform 2.41.5 → 2.43.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.
@@ -34,9 +34,7 @@ export declare class ZComponentService {
34
34
  translateComponentProperties(componentProperties: ZComponentProperties, group: ZGroup): Observable<any>;
35
35
  private translateCompByProperty;
36
36
  private readonly timePickerDateType;
37
- localizeDateTimeByIgnoringTimeZone(value: string, data: ZField): Date;
38
- private removeTimeZoneAndConvertToISOString;
39
- private convertOffsetMinToHour;
37
+ localizeDateTimeByIgnoringTimeZone(value: any, field: ZField): Date;
40
38
  decrementComponentCounterForField(field: ZField): void;
41
39
  isMobileScreen(): boolean;
42
40
  static ɵfac: i0.ɵɵFactoryDeclaration<ZComponentService, never>;
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
5
5
  export declare class DateParserFilter implements PipeTransform {
6
6
  componentService: ZComponentService;
7
7
  constructor(componentService: ZComponentService);
8
- transform(value: any, data: ZField): any;
8
+ transform(rawValue: any, field: ZField): Date | null;
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<DateParserFilter, never>;
10
10
  static ɵpipe: i0.ɵɵPipeDeclaration<DateParserFilter, "dateParser">;
11
11
  }
@@ -26,6 +26,11 @@ export declare class ZdatetimeComponent extends InputFieldBase implements ZCompo
26
26
  private setStepValue;
27
27
  private setDisabledDates;
28
28
  private convertDateTimeValueToString;
29
+ /**
30
+ * Adjusts a Date so that its wall-clock time stays the same
31
+ * when ignoring the browser timezone.
32
+ */
33
+ private adjustForIgnoreTimeZone;
29
34
  private parseAnyValueToDate;
30
35
  private parseAnyValueToDateOnly;
31
36
  focus(): boolean;
@@ -10,13 +10,24 @@ import * as i0 from "@angular/core";
10
10
  export declare class ZgaugeComponent extends FieldBase implements ZComponent, OnInit {
11
11
  componentService: ZComponentService;
12
12
  isLoading: boolean;
13
+ private value;
14
+ private title;
15
+ private color;
16
+ private majorTicks;
17
+ private minorTicks;
18
+ private startAngle;
19
+ private endAngle;
20
+ private minValue;
21
+ private maxValue;
13
22
  options: {
14
23
  value: number;
15
24
  title: string;
16
25
  chartInnerText1: string;
17
26
  chartInnerText2: string;
18
27
  scaleMax: number;
19
- colors: any[];
28
+ colors: {
29
+ color: string;
30
+ }[];
20
31
  transitions: boolean;
21
32
  majorTicks: {
22
33
  visible: boolean;
@@ -33,12 +44,12 @@ export declare class ZgaugeComponent extends FieldBase implements ZComponent, On
33
44
  endAngle: number;
34
45
  rangePlaceholderColor: string;
35
46
  labelsColor: string;
36
- rangeFrom: number;
37
- rangeTo: number;
38
47
  rangeColor: string;
39
48
  rangeLineCap: string;
40
49
  showLabels: boolean;
41
50
  rangeSize: number;
51
+ labelStyle: string;
52
+ arcgaugeStyle: string;
42
53
  };
43
54
  constructor(componentService: ZComponentService);
44
55
  ngOnInit(): void;
@@ -1,18 +1,17 @@
1
1
  /********** Angular **********/
2
- import { OnInit } from '@angular/core';
3
- /********** Ionic **********/
2
+ import { OnInit, AfterViewInit } from '@angular/core';
4
3
  /********** Plugin **********/
5
4
  import { EditorComponent, EditorPasteEvent } from '@progress/kendo-angular-editor';
5
+ import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
6
+ import { DialogRef, DialogService } from '@progress/kendo-angular-dialog';
6
7
  /********** Component & Service **********/
7
8
  import { InputFieldBase } from '../components/inputfieldbase.component';
8
9
  import { ZComponentService } from '../services/zcomponent.service';
9
- import { ZComponent, FontAweSomeService, CompressImageService, AlertService, ToastService } from 'mmhglobal-zcore';
10
- import { DialogService, DialogRef } from "@progress/kendo-angular-dialog";
11
- import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
10
+ import { AlertService, CompressImageService, FontAweSomeService, ToastService, ZComponent } from 'mmhglobal-zcore';
12
11
  import * as i0 from "@angular/core";
13
- export declare class ZtexteditorComponent extends InputFieldBase implements ZComponent, OnInit {
14
- componentService: ZComponentService;
15
- fontAweSomeService: FontAweSomeService;
12
+ export declare class ZtexteditorComponent extends InputFieldBase implements ZComponent, OnInit, AfterViewInit {
13
+ readonly componentService: ZComponentService;
14
+ readonly fontAweSomeService: FontAweSomeService;
16
15
  private readonly dialogService;
17
16
  private readonly alertService;
18
17
  private readonly compressImage;
@@ -23,35 +22,77 @@ export declare class ZtexteditorComponent extends InputFieldBase implements ZCom
23
22
  removeMsClasses: boolean;
24
23
  removeMsStyles: boolean;
25
24
  removeInvalidHTML: boolean;
25
+ [key: string]: any;
26
26
  };
27
27
  componentSettings: {
28
28
  iframe: boolean;
29
+ [key: string]: any;
29
30
  };
30
31
  isCompressModeOn: boolean;
31
32
  CloseEnlargeBtn: boolean;
32
- private style;
33
- private readonly CompressionEnableIcon;
34
- private readonly CompressionDisabledIcon;
35
- dialogRef: DialogRef;
33
+ dialogRef?: DialogRef;
34
+ private originalInlineStyle;
35
+ private readonly compressionEnableIcon;
36
+ private readonly compressionDisabledIcon;
36
37
  constructor(componentService: ZComponentService, fontAweSomeService: FontAweSomeService, dialogService: DialogService, alertService: AlertService, compressImage: CompressImageService, toastService: ToastService);
38
+ /** Initialize component state and editor configuration. */
37
39
  ngOnInit(): void;
40
+ /** Notify component service once view is ready. */
38
41
  ngAfterViewInit(): void;
39
- onChange(value: any): void;
40
- onPaste($event: EditorPasteEvent): Promise<void>;
41
- OnOffCompressMode($event: any): void;
42
+ /** Sync editor content to zModel and trigger configured change handler. */
43
+ onChange(value: unknown): void;
44
+ /** Handle paste: normalize plain-text special entities, then optionally compress pasted base64 images. */
45
+ onPaste(e: EditorPasteEvent): Promise<void>;
46
+ /**
47
+ * If the paste is plain text (no HTML tags and no images), normalize common entities and insert as real text.
48
+ * Returns true when the event is handled and default paste is prevented.
49
+ */
50
+ private handleCommonSymbolTags;
51
+ /**
52
+ * If compression is enabled and compress mode is ON, compress any pasted base64 images (data:image/*).
53
+ * IMPORTANT: modifies e.cleanedHtml (what gets pasted), not editor.value.
54
+ */
55
+ private handleImageCompression;
56
+ /**
57
+ * Toggle compress mode via confirmation dialog.
58
+ */
59
+ onOffCompressMode(event: Event): void;
60
+ /** Focus editor if available. Returns true if focus succeeded. */
42
61
  focus(): boolean;
43
- getFontAwesome(iconName: any, fontAwesomeService: FontAweSomeService): any;
62
+ getFontAwesome(iconName: string, fontAwesomeService: FontAweSomeService): unknown;
63
+ /** Merge paste cleanup options from data.Options (string expression or object) into pasteCleanupSettings. */
44
64
  private setupPasteCleanupSettings;
65
+ /** Trigger hidden file input click for image upload. */
45
66
  openFileExplorer(): void;
67
+ /** Open an enlarged popup editor. */
46
68
  openPopup(): void;
69
+ /** Close the popup editor if open. */
47
70
  onPopupClose(): void;
48
- uploadImage(fileInput: any): void;
71
+ /**
72
+ * Handle <input type="file"> change and insert selected image into editor.
73
+ * NOTE: Prefer typing fileInput as Event for better safety.
74
+ */
75
+ uploadImage(fileInput: Event): void;
76
+ /** Insert image into editor, optionally compressing first. */
49
77
  private insertImageIntoEditor;
78
+ /** Convert base64 (data URL) to File. */
50
79
  private base64ToFile;
51
- private ImageCompression;
80
+ /**
81
+ * Compress an image file if it is an image and above min threshold.
82
+ * Returns the compressed file, or null if not compressible / compression skipped.
83
+ */
84
+ private imageCompression;
85
+ /** Normalize image compression config into byte-based thresholds. */
52
86
  private compressionConfigHandler;
87
+ /**
88
+ * Convert size string like "100kb", "1 MB", "2gb" to bytes.
89
+ * If no unit is provided, bytes are assumed.
90
+ */
53
91
  private convertSizeToByte;
92
+ /** Read a File as base64 data URL. */
54
93
  private readFileAsDataURL;
94
+ /** Extract event target as HTMLElement safely. */
95
+ private getEventTargetElement;
55
96
  static ɵfac: i0.ɵɵFactoryDeclaration<ZtexteditorComponent, never>;
56
97
  static ɵcmp: i0.ɵɵComponentDeclaration<ZtexteditorComponent, "app-ztexteditor", never, {}, {}, never, never>;
57
98
  }
@@ -1,50 +1,117 @@
1
1
  /********** Angular **********/
2
- import { OnInit, NgZone } from "@angular/core";
3
- import { FileInfo, SuccessEvent, RemoveEvent, UploadEvent, FileRestrictions, ChunkSettings, SelectEvent, UploadComponent } from "@progress/kendo-angular-upload";
2
+ import { NgZone, OnInit } from "@angular/core";
3
+ import { ChunkSettings, FileInfo, FileRestrictions, RemoveEvent, SelectEvent, SuccessEvent, UploadComponent, UploadEvent } from "@progress/kendo-angular-upload";
4
4
  /********** Component & Service **********/
5
5
  import { InputFieldBase } from "../components/inputfieldbase.component";
6
6
  import { ZComponentService } from "../services/zcomponent.service";
7
- import { AuthService, ZCoreService, CompressImageService, AlertService, ZComponent, SharePointService } from "mmhglobal-zcore";
7
+ import { AlertService, AuthService, CompressImageService, SharePointService, ZComponent, ZCoreService } from "mmhglobal-zcore";
8
8
  import * as i0 from "@angular/core";
9
+ /**
10
+ * Kendo FileInfo + optional base64 payload (used by SelectFileOnly mode).
11
+ * NOTE: Keeps runtime behavior the same; only improves type safety.
12
+ */
13
+ declare type SelectedFileData = FileInfo & {
14
+ /**
15
+ * Base64 Data URL or ArrayBuffer from FileReader.
16
+ * Present only when SelectFileOnly reads file content into memory.
17
+ */
18
+ file?: string | ArrayBuffer | null;
19
+ };
9
20
  export declare class MyFileInfo implements FileInfo {
10
21
  name: string;
11
22
  uid?: string;
23
+ /**
24
+ * Server or application-defined UID used for remove/download operations.
25
+ * (Set from API response fileUid when upload succeeds)
26
+ */
12
27
  myUid?: string;
13
28
  }
14
29
  export declare class ZuploadComponent extends InputFieldBase implements ZComponent, OnInit {
15
- componentService: ZComponentService;
16
- private authService;
17
- private compressImage;
18
- private zcoreService;
19
- private ngZone;
20
- private sharePointService;
21
- private alertService;
30
+ readonly componentService: ZComponentService;
31
+ private readonly authService;
32
+ private readonly compressImage;
33
+ private readonly zcoreService;
34
+ private readonly ngZone;
35
+ private readonly sharePointService;
36
+ private readonly alertService;
22
37
  uploadComponent: UploadComponent;
23
- uploadAttachmentUrl: string;
38
+ private readonly defaultUploadSaveUrl;
39
+ private readonly defaultUploadRemoveUrl;
40
+ uploadAttachmentUrl: string | null;
24
41
  uploadSaveUrl: string;
25
42
  uploadRemoveUrl: string;
26
- downloadFileUrl: string;
27
- getImageUrl: string;
43
+ readonly downloadFileUrl = "/Attachment/downloadFile";
44
+ readonly getImageUrl = "/Attachment/getImage";
28
45
  isAutoUpload: boolean;
29
46
  isMultiple: boolean;
30
- imagePreviews: any[];
31
- uid: string[];
32
47
  showFileList: boolean;
33
- fileList: any[];
48
+ imagePreviews: Array<Record<string, unknown>>;
49
+ uid: string[];
50
+ fileList: SelectedFileData[];
34
51
  restrictions: FileRestrictions;
35
- chunkSettings: ChunkSettings;
52
+ readonly chunkSettings: ChunkSettings;
36
53
  constructor(componentService: ZComponentService, authService: AuthService, compressImage: CompressImageService, zcoreService: ZCoreService, ngZone: NgZone, sharePointService: SharePointService, alertService: AlertService);
54
+ /**
55
+ * Angular lifecycle hook - initializes restrictions and upload behavior from field config.
56
+ */
37
57
  ngOnInit(): void;
58
+ /**
59
+ * Kendo Upload success callback for both upload and remove.
60
+ * Keeps zModel in sync and emits ZComponent output events.
61
+ */
38
62
  onSuccess(e: SuccessEvent): void;
63
+ /**
64
+ * Normalize and enrich image compression config with byte-based thresholds.
65
+ */
39
66
  private compressionConfigHandler;
67
+ /**
68
+ * Convert string size values like "10KB", "2 MB", "1gb", "1024" into bytes.
69
+ * If unit is omitted, bytes are assumed.
70
+ *
71
+ * @param sizeString Human readable size string.
72
+ * @returns Size in bytes. Returns 0 if parsing fails.
73
+ */
40
74
  private convertSizeToByte;
75
+ /**
76
+ * Kendo Upload upload event: validates files, builds image previews, injects metadata and auth header.
77
+ */
41
78
  uploadEventHandler(e: UploadEvent): void;
79
+ /**
80
+ * Kendo Upload remove event: updates component memory, fires project event if defined,
81
+ * otherwise attaches required payload and authorization headers.
82
+ */
42
83
  onRemove(e: RemoveEvent): void;
43
- onChange(file: FileInfo[]): void;
84
+ /**
85
+ * Kendo Upload change event handler. Emits project event if configured.
86
+ */
87
+ onChange(files: FileInfo[]): void;
88
+ /**
89
+ * Validate a selected/uploaded file against configured restrictions (size + extension).
90
+ *
91
+ * @param file Kendo FileInfo
92
+ * @returns true if file passes restrictions, otherwise false (and shows alert).
93
+ */
44
94
  private isValidUploadedFile;
95
+ /**
96
+ * Kendo Upload select event handler:
97
+ * - Handles SharePoint endpoint switching
98
+ * - Supports SelectFileOnly mode (read file content into memory and emit event)
99
+ * - Supports image compression when AutoUpload is false
100
+ */
45
101
  selectEventHandler(e: SelectEvent): void;
102
+ /**
103
+ * Clears UI-selected files and syncs group state.
104
+ * NOTE: Original behavior sets group value to fileList (not empty); preserved.
105
+ */
46
106
  clearFiles(): void;
107
+ /**
108
+ * Format bytes into human-readable string.
109
+ *
110
+ * @param bytes Raw byte size
111
+ * @returns Formatted file size string (e.g. "12.5MB")
112
+ */
47
113
  private formatFileSize;
48
114
  static ɵfac: i0.ɵɵFactoryDeclaration<ZuploadComponent, never>;
49
115
  static ɵcmp: i0.ɵɵComponentDeclaration<ZuploadComponent, "app-zupload", never, {}, {}, never, never>;
50
116
  }
117
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mmhglobal-dynamicform",
3
- "version": "2.41.5",
3
+ "version": "2.43.0",
4
4
  "peerDependencies": {},
5
5
  "dependencies": {
6
6
  "tslib": "^2.3.1"