@simpleangularcontrols/sac-common 10.0.0-rc.14 → 10.0.0-rc.16

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,20 +1,17 @@
1
+ import { SacFormLayoutCommon } from '../controls/layout/formlayout';
2
+ import { ISacLocalisationService } from '../interfaces/ISacLocalisationService';
3
+ import { ISacUploadEventCompleteState } from '../interfaces/ISacUploadEventCompleteState';
4
+ import { SacBaseModelControl } from './basemodelcontrol';
1
5
  import { EventEmitter, Injector, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core';
2
6
  import { AbstractControl, ValidationErrors } from '@angular/forms';
3
7
  import { UploadState, UploadxService } from 'ngx-uploadx';
4
8
  import { Observable } from 'rxjs';
5
- import { SacFormLayoutCommon } from '../controls/layout/formlayout';
6
- import { ISacLocalisationService } from '../interfaces/ISacLocalisationService';
7
- import { SacBaseModelControl } from './basemodelcontrol';
8
9
  /**
9
10
  * Base Klasse für Uploader Control
10
11
  */
11
12
  export declare abstract class SacUploadBase<VALUE> extends SacBaseModelControl<VALUE> implements OnInit, OnDestroy {
12
13
  private renderer;
13
14
  private ngZone;
14
- /**
15
- * File Input Control
16
- */
17
- private uploadInput;
18
15
  /**
19
16
  * Erlaubte Dateitypen
20
17
  */
@@ -31,50 +28,62 @@ export declare abstract class SacUploadBase<VALUE> extends SacBaseModelControl<V
31
28
  * API Endpoint
32
29
  */
33
30
  private _endpoint;
31
+ /**
32
+ * Token for Bearer Authentication
33
+ */
34
+ private _token;
34
35
  /**
35
36
  * Upload Settings
36
37
  */
37
38
  private options;
39
+ /**
40
+ * File Input Control
41
+ */
42
+ private uploadInput;
38
43
  /**
39
44
  * Upload Service
40
45
  */
41
46
  protected uploadService: UploadxService;
47
+ /**
48
+ * Handling von neuen Files im Input Control
49
+ */
50
+ fileListener: () => void;
42
51
  /**
43
52
  * Definiert das Control als Required
44
53
  */
45
54
  isrequired: boolean;
46
55
  /**
47
- * Max. Dateigrösse für Files die hochgeladen werden können. 0 deaktiviert den Filter
56
+ * Listener für Files
48
57
  */
49
- maxfilesize: number;
58
+ listenerFn: () => void;
50
59
  /**
51
- * Resource Key für Validation Message Required bei Control
60
+ * Service für Error Localisation
52
61
  */
53
- validationmessagerequired: string;
62
+ lngResourceService: ISacLocalisationService;
54
63
  /**
55
- * Resource Key für Validation Message Required in Validation Summary
64
+ * Max. Dateigrösse für Files die hochgeladen werden können. 0 deaktiviert den Filter
56
65
  */
57
- validationmessagesummaryrequired: string;
66
+ maxfilesize: number;
58
67
  /**
59
- * Event wenn ein Error in der Komponente ausgelöst wird.
68
+ * Event when an error is triggered in the component.
60
69
  */
61
70
  onfileerror: EventEmitter<string>;
62
71
  /**
63
- * Handling von neuen Files im Input Control
72
+ * Event when a file has been uploaded. The event is triggered for multiple uploads per file.
64
73
  */
65
- fileListener: () => void;
74
+ onuploadcomplete: EventEmitter<ISacUploadEventCompleteState>;
66
75
  /**
67
- * Listener für Files
76
+ * Array von Uploads
68
77
  */
69
- listenerFn: () => void;
78
+ uploads: SacUploadFile[];
70
79
  /**
71
- * Service für Error Localisation
80
+ * Resource Key für Validation Message Required bei Control
72
81
  */
73
- lngResourceService: ISacLocalisationService;
82
+ validationmessagerequired: string;
74
83
  /**
75
- * Array von Uploads
84
+ * Resource Key für Validation Message Required in Validation Summary
76
85
  */
77
- uploads: SacUploadFile[];
86
+ validationmessagesummaryrequired: string;
78
87
  /**
79
88
  * Constructor
80
89
  * @param formlayout SacFormLayoutCommon to define scoped layout settings
@@ -83,22 +92,6 @@ export declare abstract class SacUploadBase<VALUE> extends SacBaseModelControl<V
83
92
  * @param ngZone ngzone for handling external scripts
84
93
  */
85
94
  constructor(formlayout: SacFormLayoutCommon, injector: Injector, renderer: Renderer2, ngZone: NgZone);
86
- /**
87
- * Erlaubte Dateitypen für den Upload. Format: ".xxx,.yyy,.zzz"
88
- */
89
- set allowedtypes(types: string);
90
- /**
91
- * Files nach der Auswahl automatisch hochladen
92
- */
93
- set autoupload(v: boolean);
94
- /**
95
- * Uploads können unterbrochen werden
96
- */
97
- set enablepause(v: boolean);
98
- /**
99
- * Definiert den Registration Endpoint für Uploads.
100
- */
101
- set endpoint(v: string);
102
95
  /**
103
96
  * Icon for browse button
104
97
  */
@@ -120,9 +113,40 @@ export declare abstract class SacUploadBase<VALUE> extends SacBaseModelControl<V
120
113
  */
121
114
  get IconUpload(): string;
122
115
  get allowedtypes(): string;
116
+ /**
117
+ * Erlaubte Dateitypen für den Upload. Format: ".xxx,.yyy,.zzz"
118
+ */
119
+ set allowedtypes(types: string);
123
120
  get autoupload(): boolean;
121
+ /**
122
+ * Files nach der Auswahl automatisch hochladen
123
+ */
124
+ set autoupload(v: boolean);
124
125
  get enablepause(): boolean;
126
+ /**
127
+ * Uploads können unterbrochen werden
128
+ */
129
+ set enablepause(v: boolean);
125
130
  get endpoint(): string;
131
+ /**
132
+ * Definiert den Registration Endpoint für Uploads.
133
+ */
134
+ set endpoint(v: string);
135
+ /**
136
+ * Token for Bearer Authentication
137
+ */
138
+ get token(): string | null;
139
+ /**
140
+ * Token for Bearer Authentication
141
+ */
142
+ set token(v: string | null);
143
+ /**
144
+ * Methode kann für Controls verwendet werden, zusätzliche Validierungen bei hinzufügen der Files zu machen
145
+ *
146
+ * @param file File das hinzugefügt wurde.
147
+ * @returns Valdierung ist erfolgreich
148
+ */
149
+ abstract CustomAddValidation(file: UploadState): boolean;
126
150
  /**
127
151
  * Name der Datei die Hochgeladen wird
128
152
  * @returns Observable des Dateinamens.
@@ -158,6 +182,12 @@ export declare abstract class SacUploadBase<VALUE> extends SacBaseModelControl<V
158
182
  * @returns Upload Fortschritt. Wert von 0-100
159
183
  */
160
184
  Progress(): number;
185
+ /**
186
+ * Methode welche die Upload ID's in das Model setzt oder löscht
187
+ *
188
+ * @param file Type von File ID's
189
+ */
190
+ abstract SetUploadValue(file: UploadState): void;
161
191
  /**
162
192
  * Cancel single upload
163
193
  * @param uploadId ID of File to cancel
@@ -172,7 +202,7 @@ export declare abstract class SacUploadBase<VALUE> extends SacBaseModelControl<V
172
202
  */
173
203
  ngOnDestroy(): void;
174
204
  /**
175
- * Initialisiert das Control
205
+ * Initializes the control
176
206
  */
177
207
  ngOnInit(): void;
178
208
  /**
@@ -190,6 +220,10 @@ export declare abstract class SacUploadBase<VALUE> extends SacBaseModelControl<V
190
220
  * Pause all Uploads
191
221
  */
192
222
  pauseAll(): void;
223
+ /**
224
+ * Sets the bearer token in the upload service
225
+ */
226
+ setToken(value: string): void;
193
227
  /**
194
228
  * Upload Single File
195
229
  *
@@ -205,19 +239,6 @@ export declare abstract class SacUploadBase<VALUE> extends SacBaseModelControl<V
205
239
  * @param c Control das validiert werden soll
206
240
  */
207
241
  validateData(c: AbstractControl): ValidationErrors | null;
208
- /**
209
- * Methode kann für Controls verwendet werden, zusätzliche Validierungen bei hinzufügen der Files zu machen
210
- *
211
- * @param file File das hinzugefügt wurde.
212
- * @returns Valdierung ist erfolgreich
213
- */
214
- abstract CustomAddValidation(file: UploadState): boolean;
215
- /**
216
- * Methode welche die Upload ID's in das Model setzt oder löscht
217
- *
218
- * @param file Type von File ID's
219
- */
220
- abstract SetUploadValue(file: UploadState): void;
221
242
  private UpdateFileCount;
222
243
  /**
223
244
  * Returns the number of uploaded files
@@ -91,6 +91,10 @@ export declare class SacTreeviewCommon extends SacBaseModelControl<any> {
91
91
  * Custom template for actions per node. Template parameters are: 'node'
92
92
  */
93
93
  templateaction: TemplateRef<any>;
94
+ /**
95
+ * Custom template for icon per node. Template parameters are: 'node'
96
+ */
97
+ templateicon: TemplateRef<any>;
94
98
  /**
95
99
  * Custom template for the label area per node. Template parameters are: 'node' and 'label'
96
100
  */
@@ -142,10 +146,40 @@ export declare class SacTreeviewCommon extends SacBaseModelControl<any> {
142
146
  * @param action action and node
143
147
  */
144
148
  onActionClicked(action: TreeviewAction): void;
149
+ /**
150
+ * Method is called when Node in Tree is clicked
151
+ * @param node Selected Node
152
+ */
145
153
  onNodeClicked(node: any): void;
154
+ /**
155
+ * Sets the hover state on a node
156
+ * @param node Node on which the status is set
157
+ * @param state Activate or deactivate HoverState
158
+ */
146
159
  setHoverState(node: any, state: boolean): void;
160
+ /**
161
+ * Sets the selected state on a node
162
+ * @param node Node which is marked as Selected
163
+ */
147
164
  setSelectedState(node: any): void;
165
+ /**
166
+ * Validates the model state of the control
167
+ * @param c Control instance
168
+ * @returns Returns a validation error, if present. Otherwise, as Result is NULL
169
+ */
148
170
  validateData(c: AbstractControl): ValidationErrors | null;
171
+ /**
172
+ * Saves the data from the model binding
173
+ * @param value Id of the selected node
174
+ */
175
+ writeValue(value: any): void;
176
+ /**
177
+ * Searches for a node based on the value in the ID attribute
178
+ * @param node Node
179
+ * @param value Value of the Id attribute
180
+ * @returns Returns the node if it is found. If not, NULL is returned.
181
+ */
182
+ private findNodeById;
149
183
  private invertExpandedState;
150
184
  private resetSelectedState;
151
185
  }