@simpleangularcontrols/sac-common 16.0.0-rc.1 → 16.0.0-rc.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.
- package/README.md +8 -16
- package/common/basedatetimecontrol.d.ts +33 -33
- package/common/basedatetimecontrol.d.ts.map +1 -1
- package/common/baseinputcontrol.d.ts +9 -9
- package/common/baseinputcontrol.d.ts.map +1 -1
- package/common/basemodelcontrol.d.ts +117 -89
- package/common/basemodelcontrol.d.ts.map +1 -1
- package/common/baseuploadcontrol.d.ts +140 -140
- package/common/baseuploadcontrol.d.ts.map +1 -1
- package/controls/checkbox/checkbox.d.ts +7 -3
- package/controls/checkbox/checkbox.d.ts.map +1 -1
- package/controls/checkbox/radiobuttons.d.ts +5 -4
- package/controls/checkbox/radiobuttons.d.ts.map +1 -1
- package/controls/contextmenu/contextmenu.d.ts +42 -42
- package/controls/contextmenu/contextmenu.d.ts.map +1 -1
- package/controls/contextmenu/contextmenuanchor.d.ts +2 -2
- package/controls/contextmenu/contextmenuanchor.d.ts.map +1 -1
- package/controls/contextmenu/contextmenucontainer.d.ts +2 -2
- package/controls/contextmenu/contextmenucontainer.d.ts.map +1 -1
- package/controls/datetime/date.d.ts +7 -7
- package/controls/datetime/date.d.ts.map +1 -1
- package/controls/datetime/datetime.d.ts +7 -7
- package/controls/datetime/datetime.d.ts.map +1 -1
- package/controls/datetime/time.d.ts +7 -7
- package/controls/datetime/time.d.ts.map +1 -1
- package/controls/form/form.d.ts +7 -43
- package/controls/form/form.d.ts.map +1 -1
- package/controls/input/inputdecimal.d.ts +21 -21
- package/controls/input/inputdecimal.d.ts.map +1 -1
- package/controls/layout/formlayout.d.ts +45 -0
- package/controls/layout/formlayout.d.ts.map +1 -0
- package/controls/list/dropdown.d.ts +45 -45
- package/controls/list/dropdown.d.ts.map +1 -1
- package/controls/multilanguage/multilanguageinput.d.ts +5 -4
- package/controls/multilanguage/multilanguageinput.d.ts.map +1 -1
- package/controls/multilanguage/multilanguageinputarea.d.ts +5 -4
- package/controls/multilanguage/multilanguageinputarea.d.ts.map +1 -1
- package/controls/tinymce/tinymce.d.ts +63 -63
- package/controls/tinymce/tinymce.d.ts.map +1 -1
- package/esm2022/common/basedatetimecontrol.mjs +75 -81
- package/esm2022/common/baseinputcontrol.mjs +20 -20
- package/esm2022/common/basemodelcontrol.mjs +280 -202
- package/esm2022/common/baseuploadcontrol.mjs +225 -224
- package/esm2022/controls/checkbox/checkbox.mjs +11 -5
- package/esm2022/controls/checkbox/radiobuttons.mjs +13 -12
- package/esm2022/controls/contextmenu/contextmenu.mjs +85 -75
- package/esm2022/controls/contextmenu/contextmenuanchor.mjs +6 -4
- package/esm2022/controls/contextmenu/contextmenucontainer.mjs +6 -4
- package/esm2022/controls/datetime/date.mjs +12 -12
- package/esm2022/controls/datetime/datetime.mjs +15 -15
- package/esm2022/controls/datetime/time.mjs +15 -15
- package/esm2022/controls/form/form.mjs +26 -80
- package/esm2022/controls/input/inputdecimal.mjs +58 -53
- package/esm2022/controls/layout/formlayout.mjs +73 -0
- package/esm2022/controls/list/dropdown.mjs +110 -91
- package/esm2022/controls/multilanguage/multilanguageinput.mjs +10 -9
- package/esm2022/controls/multilanguage/multilanguageinputarea.mjs +10 -9
- package/esm2022/controls/tinymce/tinymce.mjs +102 -95
- package/esm2022/interfaces/ISacLabelSizes.mjs +2 -0
- package/esm2022/public_api.mjs +20 -18
- package/fesm2022/simpleangularcontrols-sac-common.mjs +1958 -1814
- package/fesm2022/simpleangularcontrols-sac-common.mjs.map +1 -1
- package/interfaces/ISacLabelSizes.d.ts +27 -0
- package/interfaces/ISacLabelSizes.d.ts.map +1 -0
- package/package.json +1 -1
- package/public_api.d.ts +19 -17
- package/public_api.d.ts.map +1 -1
- package/simpleangularcontrols-sac-common-16.0.0-rc.3.tgz +0 -0
- package/simpleangularcontrols-sac-common-13.0.0-rc.1.tgz +0 -0
- package/simpleangularcontrols-sac-common-16.0.0-rc.1.tgz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Directive, Input, Output,
|
|
2
|
+
import { EventEmitter, Directive, Input, Output, InjectionToken, Injectable, Host, ViewChild, HostListener, ViewChildren, TemplateRef, ContentChild, Inject } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
|
-
import {
|
|
4
|
+
import { NgControl, FormControlName, FormGroupDirective, Validators, UntypedFormGroup } from '@angular/forms';
|
|
5
5
|
import { Observable, of } from 'rxjs';
|
|
6
6
|
import * as moment_ from 'moment';
|
|
7
7
|
import moment___default from 'moment';
|
|
@@ -151,225 +151,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
151
151
|
type: Output
|
|
152
152
|
}] } });
|
|
153
153
|
|
|
154
|
-
/**
|
|
155
|
-
* Base Komponente für Dialog
|
|
156
|
-
*/
|
|
157
|
-
class SacDialogCommon {
|
|
158
|
-
/**
|
|
159
|
-
* Implementation als Setter, da mit ngIf das Element bei Unsichtbarkeit UNDEFINED ist.
|
|
160
|
-
*/
|
|
161
|
-
set dialogElementSetter(content) {
|
|
162
|
-
this.dialogElement = content;
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Das Input akzeptiert sowohl default size-css-Klassen als auch custom Klassen.
|
|
166
|
-
* case insensitive.
|
|
167
|
-
* Die akzeptabel default-size-Klassen sind: 'small', 'large', 'extralarge', 'medium', ''.
|
|
168
|
-
* Wenn size ist NICHT gesetzt (oder 'medium' oder ''), default ist in medium size: max-width 500px.
|
|
169
|
-
*/
|
|
170
|
-
set size(v) {
|
|
171
|
-
v = v.toLowerCase();
|
|
172
|
-
this._size = v;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Setter. Erhält das boolen Wert des _show property
|
|
176
|
-
*/
|
|
177
|
-
set isvisible(v) {
|
|
178
|
-
if (v &&
|
|
179
|
-
!this.hasSetBodyTag &&
|
|
180
|
-
!document.body.classList.contains('modal-open')) {
|
|
181
|
-
document.body.classList.add('modal-open');
|
|
182
|
-
this.hasSetBodyTag = true;
|
|
183
|
-
}
|
|
184
|
-
if (!v &&
|
|
185
|
-
this.hasSetBodyTag &&
|
|
186
|
-
document.body.classList.contains('modal-open')) {
|
|
187
|
-
document.body.classList.remove('modal-open');
|
|
188
|
-
this.hasSetBodyTag = false;
|
|
189
|
-
}
|
|
190
|
-
this._show = v;
|
|
191
|
-
}
|
|
192
|
-
/**
|
|
193
|
-
* Getter. Ergibt das boolen Wert des _show property
|
|
194
|
-
*/
|
|
195
|
-
get isvisible() {
|
|
196
|
-
return this._show;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Die Funktion prüft ob es ein default css classe für Size des Dialog durch den size Input gesetzt wurde.
|
|
200
|
-
*/
|
|
201
|
-
issetdefaultsize() {
|
|
202
|
-
let result = false;
|
|
203
|
-
switch (this._size) {
|
|
204
|
-
case 'small':
|
|
205
|
-
result = true;
|
|
206
|
-
break;
|
|
207
|
-
case 'medium':
|
|
208
|
-
result = true;
|
|
209
|
-
break;
|
|
210
|
-
case 'large':
|
|
211
|
-
result = true;
|
|
212
|
-
break;
|
|
213
|
-
case 'extralarge':
|
|
214
|
-
result = true;
|
|
215
|
-
break;
|
|
216
|
-
case '':
|
|
217
|
-
result = true;
|
|
218
|
-
break;
|
|
219
|
-
}
|
|
220
|
-
return result;
|
|
221
|
-
}
|
|
222
|
-
// #endregion
|
|
223
|
-
// #region Constructor
|
|
224
|
-
/**
|
|
225
|
-
* Konstruktor
|
|
226
|
-
* Inject des Formulars
|
|
227
|
-
*/
|
|
228
|
-
constructor(cdRef) {
|
|
229
|
-
this.cdRef = cdRef;
|
|
230
|
-
this.hasSetBodyTag = false;
|
|
231
|
-
/**
|
|
232
|
-
* Boolean Property definiert ob das Dialog angezeigt wird
|
|
233
|
-
*/
|
|
234
|
-
this._show = false;
|
|
235
|
-
/**
|
|
236
|
-
* Das property enthielt (wenn überhaupt gesetzt) entweder keywords für sizing oder custom css Klassen.
|
|
237
|
-
* Die akzeptabel keywordssind: 'small', 'large', 'extralarge', 'medium', ''.
|
|
238
|
-
*/
|
|
239
|
-
this._size = '';
|
|
240
|
-
// #region Properties
|
|
241
|
-
/**
|
|
242
|
-
* Input Property. Erhält den Title des Dialog. Default Value: 'Dialog'.
|
|
243
|
-
*/
|
|
244
|
-
this.title = 'Dialog';
|
|
245
|
-
/**
|
|
246
|
-
* Das input property akzeptiert boolen Wert. Definiert ob das Dialog darf durch ESC geschlossen werden. Default ist true.
|
|
247
|
-
*/
|
|
248
|
-
this.allowesc = true;
|
|
249
|
-
/**
|
|
250
|
-
* Das input property akzeptiert boolen Wert. Definiert ob das Dialog darf durch click außerhalb des Dialog-Fenster geschlossen werden. Default ist true.
|
|
251
|
-
*/
|
|
252
|
-
this.backdrop = true;
|
|
253
|
-
/**
|
|
254
|
-
* Input Property. Erhält den Namen des Dialog - benutzt für das ID. Default Value: ''
|
|
255
|
-
*/
|
|
256
|
-
this.name = '';
|
|
257
|
-
/**
|
|
258
|
-
* Steuert ob im Header des Dialogs ein Button angezeigt wird.
|
|
259
|
-
*/
|
|
260
|
-
this.closebutton = true;
|
|
261
|
-
/**
|
|
262
|
-
* Input Property. Erhält die Breite des Dialog
|
|
263
|
-
*/
|
|
264
|
-
this.width = null;
|
|
265
|
-
/**
|
|
266
|
-
* Definiert eine feste Höhe beim Dialog.
|
|
267
|
-
*/
|
|
268
|
-
this.height = null;
|
|
269
|
-
/**
|
|
270
|
-
* Output Emitter. Wird aufgerufen, wenn das Wert des _show property geändert ist - damait das Dialog geöfnet/geschlossen wird.
|
|
271
|
-
*/
|
|
272
|
-
this.isvisibleChange = new EventEmitter();
|
|
273
|
-
}
|
|
274
|
-
// #endregion
|
|
275
|
-
/**
|
|
276
|
-
* Methode wenn Componente entfernt wird
|
|
277
|
-
*/
|
|
278
|
-
ngOnDestroy() {
|
|
279
|
-
if (this.hasSetBodyTag && document.body.classList.contains('modal-open')) {
|
|
280
|
-
document.body.classList.remove('modal-open');
|
|
281
|
-
this.hasSetBodyTag = false;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
// #region Methods
|
|
285
|
-
/**
|
|
286
|
-
* Die Methode setz den Wert des _show property auf true
|
|
287
|
-
*/
|
|
288
|
-
show() {
|
|
289
|
-
this._show = true;
|
|
290
|
-
if (!this.hasSetBodyTag &&
|
|
291
|
-
!document.body.classList.contains('modal-open')) {
|
|
292
|
-
document.body.classList.add('modal-open');
|
|
293
|
-
this.hasSetBodyTag = true;
|
|
294
|
-
}
|
|
295
|
-
this.isvisibleChange.emit(this._show);
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Die Methode setz den Wert des _show property auf false
|
|
299
|
-
*/
|
|
300
|
-
hide() {
|
|
301
|
-
if (this.hasSetBodyTag && document.body.classList.contains('modal-open')) {
|
|
302
|
-
document.body.classList.remove('modal-open');
|
|
303
|
-
this.hasSetBodyTag = false;
|
|
304
|
-
}
|
|
305
|
-
this._show = false;
|
|
306
|
-
this.isvisibleChange.emit(this._show);
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Getter for ChangeDetector.
|
|
310
|
-
*/
|
|
311
|
-
get ChangeDetector() {
|
|
312
|
-
return this.cdRef;
|
|
313
|
-
}
|
|
314
|
-
// #endregion
|
|
315
|
-
// #region Host Actions
|
|
316
|
-
/**
|
|
317
|
-
* Allow Close by Click outside Dialog
|
|
318
|
-
*/
|
|
319
|
-
onClick(event) {
|
|
320
|
-
if (this.allowesc === false ||
|
|
321
|
-
(this.dialogElement !== null &&
|
|
322
|
-
this.dialogElement !== undefined &&
|
|
323
|
-
event.target !== this.dialogElement.nativeElement)) {
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
this.hide();
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Allow Close by ESC
|
|
330
|
-
*/
|
|
331
|
-
onKeydownHandler(event) {
|
|
332
|
-
const ESCAPE_KEYCODE = 'Escape';
|
|
333
|
-
if (this.allowesc === true && event.key === ESCAPE_KEYCODE) {
|
|
334
|
-
this.hide();
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDialogCommon, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
338
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacDialogCommon, inputs: { title: "title", allowesc: "allowesc", backdrop: "backdrop", name: "name", closebutton: "closebutton", width: "width", height: "height", size: "size", isvisible: "isvisible" }, outputs: { isvisibleChange: "isvisibleChange" }, host: { listeners: { "click": "onClick($event)", "document:keydown": "onKeydownHandler($event)" } }, viewQueries: [{ propertyName: "dialogElementSetter", first: true, predicate: ["dialog"], descendants: true }], ngImport: i0 }); }
|
|
339
|
-
}
|
|
340
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDialogCommon, decorators: [{
|
|
341
|
-
type: Directive
|
|
342
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { dialogElementSetter: [{
|
|
343
|
-
type: ViewChild,
|
|
344
|
-
args: ['dialog', { static: false }]
|
|
345
|
-
}], title: [{
|
|
346
|
-
type: Input
|
|
347
|
-
}], allowesc: [{
|
|
348
|
-
type: Input
|
|
349
|
-
}], backdrop: [{
|
|
350
|
-
type: Input
|
|
351
|
-
}], name: [{
|
|
352
|
-
type: Input
|
|
353
|
-
}], closebutton: [{
|
|
354
|
-
type: Input
|
|
355
|
-
}], width: [{
|
|
356
|
-
type: Input
|
|
357
|
-
}], height: [{
|
|
358
|
-
type: Input
|
|
359
|
-
}], size: [{
|
|
360
|
-
type: Input
|
|
361
|
-
}], isvisibleChange: [{
|
|
362
|
-
type: Output
|
|
363
|
-
}], isvisible: [{
|
|
364
|
-
type: Input
|
|
365
|
-
}], onClick: [{
|
|
366
|
-
type: HostListener,
|
|
367
|
-
args: ['click', ['$event']]
|
|
368
|
-
}], onKeydownHandler: [{
|
|
369
|
-
type: HostListener,
|
|
370
|
-
args: ['document:keydown', ['$event']]
|
|
371
|
-
}] } });
|
|
372
|
-
|
|
373
154
|
/**
|
|
374
155
|
* Prüft ob ein Objekt Defined ist
|
|
375
156
|
* @param value Objekt
|
|
@@ -889,161 +670,73 @@ function mapToObject(map) {
|
|
|
889
670
|
return obj;
|
|
890
671
|
}
|
|
891
672
|
|
|
892
|
-
|
|
893
|
-
*
|
|
673
|
+
/***
|
|
674
|
+
* base component for form options
|
|
894
675
|
*/
|
|
895
|
-
class
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
this.
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
676
|
+
class SacFormLayoutCommon {
|
|
677
|
+
constructor() {
|
|
678
|
+
// #region Properties
|
|
679
|
+
/**
|
|
680
|
+
* defines that error messages are displayed under the controls
|
|
681
|
+
*/
|
|
682
|
+
this.inlineError = true;
|
|
683
|
+
/**
|
|
684
|
+
* defines that the labels are displayed as adaptive labels
|
|
685
|
+
*/
|
|
686
|
+
this.isAdaptiveLabel = false;
|
|
687
|
+
/**
|
|
688
|
+
* default label size for medium devices
|
|
689
|
+
*/
|
|
690
|
+
this.labelSizeMd = null;
|
|
691
|
+
/**
|
|
692
|
+
* default label size for small devices
|
|
693
|
+
*/
|
|
694
|
+
this.labelSizeSm = null;
|
|
695
|
+
/**
|
|
696
|
+
* default label column size
|
|
697
|
+
*/
|
|
698
|
+
this.labelSizeXs = null;
|
|
699
|
+
/**
|
|
700
|
+
* default label size for extra extra large devices
|
|
701
|
+
*/
|
|
702
|
+
this.labelSizeXxl = null;
|
|
703
|
+
/**
|
|
704
|
+
* default labe size for large devices
|
|
705
|
+
*/
|
|
706
|
+
this.labelSizeLg = null;
|
|
707
|
+
/**
|
|
708
|
+
* default label size for extra large devices
|
|
709
|
+
*/
|
|
710
|
+
this.labelSizeXl = null;
|
|
905
711
|
}
|
|
712
|
+
// #endregion Properties
|
|
713
|
+
// #region Public Getters And Setters
|
|
906
714
|
/**
|
|
907
|
-
*
|
|
908
|
-
*/
|
|
909
|
-
set inlineerrorenabled(value) {
|
|
910
|
-
if (value === null || value === undefined) {
|
|
911
|
-
this._inlineerrorenabled = null;
|
|
912
|
-
}
|
|
913
|
-
else {
|
|
914
|
-
this._inlineerrorenabled = convertToBoolean(value);
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
/**
|
|
918
|
-
* Aktiviert oder Deaktiviert die Inline Errors für das Control
|
|
919
|
-
*/
|
|
920
|
-
get inlineerrorenabled() {
|
|
921
|
-
return this._inlineerrorenabled;
|
|
922
|
-
}
|
|
923
|
-
/**
|
|
924
|
-
* Vertikale oder horizontale Orientierung des Formulars zurück
|
|
925
|
-
*/
|
|
926
|
-
getOrientation() {
|
|
927
|
-
switch (this.orientation.toLowerCase()) {
|
|
928
|
-
case 'horizontal':
|
|
929
|
-
return 'horizontal';
|
|
930
|
-
case 'vertical':
|
|
931
|
-
return 'vertical';
|
|
932
|
-
case 'none':
|
|
933
|
-
return 'none';
|
|
934
|
-
default:
|
|
935
|
-
throw new Error('Invalid formtype at SacFormCommon. Valid values are horizontal, vertical, none');
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
/**
|
|
939
|
-
* Gibt die NgForm Instanz zurück
|
|
940
|
-
*/
|
|
941
|
-
getForm() {
|
|
942
|
-
return this.form;
|
|
943
|
-
}
|
|
944
|
-
/**
|
|
945
|
-
* Konstruktor
|
|
946
|
-
* @param form Instanz von NgForm
|
|
947
|
-
*/
|
|
948
|
-
constructor(form) {
|
|
949
|
-
this.form = form;
|
|
950
|
-
/**
|
|
951
|
-
* Inline Errors für das Formular
|
|
952
|
-
*/
|
|
953
|
-
this._inlineerrorenabled = null;
|
|
954
|
-
/**
|
|
955
|
-
* Default Label Size for Form
|
|
956
|
-
*/
|
|
957
|
-
this.labelsize = 3;
|
|
958
|
-
/**
|
|
959
|
-
* Kontroliert, ob das Label adaptive ist
|
|
960
|
-
*/
|
|
961
|
-
this.isadaptivelabel = false;
|
|
962
|
-
/**
|
|
963
|
-
* Type des Forms
|
|
964
|
-
*/
|
|
965
|
-
this.orientation = 'horizontal';
|
|
966
|
-
/**
|
|
967
|
-
* Standardwert wann die Werte via NgModel aktualisiert werden
|
|
968
|
-
*/
|
|
969
|
-
this._updateon = 'change';
|
|
970
|
-
this.form.options = { updateOn: this._updateon };
|
|
971
|
-
}
|
|
972
|
-
/**
|
|
973
|
-
* Markiert alle Controls innerhalb des Formulares als Touched
|
|
974
|
-
*/
|
|
975
|
-
markAsTouched() {
|
|
976
|
-
if (this.form && this.form.invalid) {
|
|
977
|
-
this.markAsTouchedInternal(this.form.controls);
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
/**
|
|
981
|
-
* Aktualisiert die Werte und den Gültigkeitsstatus des Formulars
|
|
982
|
-
*/
|
|
983
|
-
updateValueAndValidity(markAsTouched = true) {
|
|
984
|
-
// Update all Controls
|
|
985
|
-
this.updateValueAndValidityInternal(this.form.controls);
|
|
986
|
-
// Update Main Form
|
|
987
|
-
this.getForm().form.updateValueAndValidity();
|
|
988
|
-
// Mark all Controls as Touched
|
|
989
|
-
if (markAsTouched) {
|
|
990
|
-
this.markAsTouched();
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
/**
|
|
994
|
-
* Markiert alle Controls inkl. dem Tree als Touched
|
|
995
|
-
* @param controls Controls Collection
|
|
996
|
-
*/
|
|
997
|
-
markAsTouchedInternal(controls) {
|
|
998
|
-
const keyList = Object.keys(controls);
|
|
999
|
-
for (const field of keyList) {
|
|
1000
|
-
const control = controls[field];
|
|
1001
|
-
if (control instanceof UntypedFormGroup) {
|
|
1002
|
-
this.markAsTouchedInternal(control.controls);
|
|
1003
|
-
}
|
|
1004
|
-
else {
|
|
1005
|
-
control.markAsTouched({ onlySelf: true });
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
/**
|
|
1010
|
-
* Aktualisiert die Werte und die gültigkeit des Formulars
|
|
1011
|
-
* @param controls Controls Collection
|
|
1012
|
-
*/
|
|
1013
|
-
updateValueAndValidityInternal(controls) {
|
|
1014
|
-
const keyList = Object.keys(controls);
|
|
1015
|
-
for (const field of keyList) {
|
|
1016
|
-
const control = controls[field];
|
|
1017
|
-
if (control instanceof UntypedFormGroup) {
|
|
1018
|
-
this.updateValueAndValidityInternal(control.controls);
|
|
1019
|
-
}
|
|
1020
|
-
else {
|
|
1021
|
-
control.updateValueAndValidity({ onlySelf: true });
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
/**
|
|
1026
|
-
* Gibt zurück, ob die Inline Error Meldungen für das Formular aktiv sind.
|
|
715
|
+
* Returns whether the inline error messages for the form are active.
|
|
1027
716
|
*/
|
|
1028
717
|
get IsInlineErrorEnabled() {
|
|
1029
|
-
return this.
|
|
718
|
+
return this.inlineError !== false;
|
|
1030
719
|
}
|
|
1031
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
1032
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type:
|
|
720
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacFormLayoutCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
721
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacFormLayoutCommon, inputs: { inlineError: "inlineError", isAdaptiveLabel: "isAdaptiveLabel", labelSizeMd: "labelSizeMd", labelSizeSm: "labelSizeSm", labelSizeXs: "labelSizeXs", labelSizeXxl: "labelSizeXxl", labelSizeLg: "labelSizeLg", labelSizeXl: "labelSizeXl" }, ngImport: i0 }); }
|
|
1033
722
|
}
|
|
1034
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
723
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacFormLayoutCommon, decorators: [{
|
|
1035
724
|
type: Directive
|
|
1036
|
-
}],
|
|
725
|
+
}], propDecorators: { inlineError: [{
|
|
1037
726
|
type: Input
|
|
1038
|
-
}],
|
|
727
|
+
}], isAdaptiveLabel: [{
|
|
1039
728
|
type: Input
|
|
1040
|
-
}],
|
|
729
|
+
}], labelSizeMd: [{
|
|
1041
730
|
type: Input
|
|
1042
|
-
}],
|
|
731
|
+
}], labelSizeSm: [{
|
|
1043
732
|
type: Input
|
|
1044
|
-
}],
|
|
733
|
+
}], labelSizeXs: [{
|
|
1045
734
|
type: Input
|
|
1046
|
-
}],
|
|
735
|
+
}], labelSizeXxl: [{
|
|
736
|
+
type: Input
|
|
737
|
+
}], labelSizeLg: [{
|
|
738
|
+
type: Input
|
|
739
|
+
}], labelSizeXl: [{
|
|
1047
740
|
type: Input
|
|
1048
741
|
}] } });
|
|
1049
742
|
|
|
@@ -1051,84 +744,85 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1051
744
|
* Abstract Klasse für SacBaseModelControl. Implements ControlValueAccessor, Validator, OnInit
|
|
1052
745
|
*/
|
|
1053
746
|
class SacBaseModelControl {
|
|
747
|
+
// #endregion Properties
|
|
748
|
+
// #region Constructors
|
|
1054
749
|
/**
|
|
1055
|
-
*
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
this._label = v;
|
|
1059
|
-
this.UpdateLabelToControl();
|
|
1060
|
-
}
|
|
1061
|
-
/**
|
|
1062
|
-
* Definiert den Label Text
|
|
1063
|
-
*/
|
|
1064
|
-
get label() {
|
|
1065
|
-
return this._label;
|
|
1066
|
-
}
|
|
1067
|
-
/**
|
|
1068
|
-
* Definiert ob das Control disabled ist
|
|
1069
|
-
*/
|
|
1070
|
-
get isdisabled() {
|
|
1071
|
-
return this._disabledForm || this.disabled;
|
|
1072
|
-
}
|
|
1073
|
-
// #endregion
|
|
1074
|
-
// #region Constructor
|
|
1075
|
-
/**
|
|
1076
|
-
* Konstruktor
|
|
1077
|
-
* Inject des Formulars
|
|
1078
|
-
* @parent SacFormCommon
|
|
1079
|
-
* @injector Injector
|
|
750
|
+
* Constructor
|
|
751
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
752
|
+
* @param injector Injector for injecting services
|
|
1080
753
|
*/
|
|
1081
|
-
constructor(
|
|
754
|
+
constructor(formlayout, injector) {
|
|
1082
755
|
this.injector = injector;
|
|
756
|
+
// #region Properties
|
|
757
|
+
/**
|
|
758
|
+
* Inline Errors für das Control
|
|
759
|
+
*/
|
|
760
|
+
this._inlineerrorenabled = null;
|
|
761
|
+
this._label = '';
|
|
762
|
+
/**
|
|
763
|
+
* Boolean Property dirty; default Wert - false
|
|
764
|
+
*/
|
|
765
|
+
this._dirty = false;
|
|
1083
766
|
/**
|
|
1084
767
|
* SacModel Form ist disabled
|
|
1085
768
|
*/
|
|
1086
769
|
this._disabledForm = false;
|
|
1087
|
-
this._label = '';
|
|
1088
|
-
// #endregion
|
|
1089
|
-
// #region Properties
|
|
1090
770
|
/**
|
|
1091
|
-
*
|
|
771
|
+
* Boolean Property touched; default Wert - false
|
|
1092
772
|
*/
|
|
1093
|
-
this.
|
|
773
|
+
this._touched = false;
|
|
1094
774
|
/**
|
|
1095
|
-
*
|
|
775
|
+
* Interne Variable, die den Wert des Controls hält
|
|
1096
776
|
*/
|
|
1097
|
-
this.
|
|
777
|
+
this._value = null;
|
|
1098
778
|
/**
|
|
1099
|
-
*
|
|
779
|
+
* Form layout instance if exists
|
|
1100
780
|
*/
|
|
1101
|
-
this.
|
|
781
|
+
this.formlayout = null;
|
|
1102
782
|
/**
|
|
1103
783
|
* Deaktiviert das Input Control
|
|
1104
784
|
*/
|
|
1105
785
|
this.disabled = false;
|
|
1106
786
|
/**
|
|
1107
|
-
*
|
|
787
|
+
* Deaktiviert das Label im Template
|
|
1108
788
|
*/
|
|
1109
|
-
this.
|
|
789
|
+
this.disablelabel = false;
|
|
1110
790
|
/**
|
|
1111
|
-
*
|
|
791
|
+
* defines that error messages are displayed under the controls
|
|
1112
792
|
*/
|
|
1113
|
-
this.
|
|
793
|
+
this.inlineError = true;
|
|
1114
794
|
/**
|
|
1115
|
-
*
|
|
795
|
+
* defines that the labels are displayed as adaptive labels
|
|
1116
796
|
*/
|
|
1117
|
-
this.
|
|
797
|
+
this.isAdaptiveLabel = false;
|
|
1118
798
|
/**
|
|
1119
|
-
*
|
|
799
|
+
* default labe size for large devices
|
|
1120
800
|
*/
|
|
1121
|
-
this.
|
|
801
|
+
this.labelSizeLg = null;
|
|
1122
802
|
/**
|
|
1123
|
-
*
|
|
803
|
+
* default label size for medium devices
|
|
1124
804
|
*/
|
|
1125
|
-
this.
|
|
805
|
+
this.labelSizeMd = null;
|
|
1126
806
|
/**
|
|
1127
|
-
*
|
|
807
|
+
* default label size for small devices
|
|
1128
808
|
*/
|
|
1129
|
-
this.
|
|
1130
|
-
|
|
1131
|
-
|
|
809
|
+
this.labelSizeSm = null;
|
|
810
|
+
/**
|
|
811
|
+
* default label size for extra large devices
|
|
812
|
+
*/
|
|
813
|
+
this.labelSizeXl = null;
|
|
814
|
+
/**
|
|
815
|
+
* default label column size
|
|
816
|
+
*/
|
|
817
|
+
this.labelSizeXs = null;
|
|
818
|
+
/**
|
|
819
|
+
* default label size for extra extra large devices
|
|
820
|
+
*/
|
|
821
|
+
this.labelSizeXxl = null;
|
|
822
|
+
/**
|
|
823
|
+
* Name des Controls
|
|
824
|
+
*/
|
|
825
|
+
this.name = '';
|
|
1132
826
|
/**
|
|
1133
827
|
* Leere Implementation von "propagateChange". Muss gemacht werden, damit kein Fehler entsteht
|
|
1134
828
|
*/
|
|
@@ -1137,76 +831,29 @@ class SacBaseModelControl {
|
|
|
1137
831
|
* Leere Implementation von "propagateTouch". Muss gemacht werden, damit kein Fehler entsteht
|
|
1138
832
|
*/
|
|
1139
833
|
this.propagateTouch = () => { };
|
|
1140
|
-
this.
|
|
834
|
+
this.formlayout = formlayout;
|
|
1141
835
|
this.lngResourceService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService());
|
|
1142
836
|
}
|
|
1143
|
-
// #endregion
|
|
1144
|
-
// #region
|
|
837
|
+
// #endregion Constructors
|
|
838
|
+
// #region Public Getters And Setters
|
|
1145
839
|
/**
|
|
1146
|
-
*
|
|
840
|
+
* Aktiviert oder Deaktiviert die Inline Errors für das Control
|
|
1147
841
|
*/
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
if (formControl instanceof FormControlName) {
|
|
1152
|
-
const form = this.injector.get(FormGroupDirective, null);
|
|
1153
|
-
this.ngControl = form.getControl(formControl);
|
|
842
|
+
set inlineerrorenabled(value) {
|
|
843
|
+
if (value === null || value === undefined) {
|
|
844
|
+
this._inlineerrorenabled = null;
|
|
1154
845
|
}
|
|
1155
846
|
else {
|
|
1156
|
-
this.
|
|
1157
|
-
}
|
|
1158
|
-
this.UpdateLabelToControl();
|
|
1159
|
-
/**
|
|
1160
|
-
* Label Size von Formular lesen
|
|
1161
|
-
*/
|
|
1162
|
-
if (this.labelsize === undefined) {
|
|
1163
|
-
if (this.parent?.labelsize !== undefined) {
|
|
1164
|
-
this.labelsize = this.parent.labelsize;
|
|
1165
|
-
}
|
|
1166
|
-
else {
|
|
1167
|
-
this.labelsize = 4;
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
/**
|
|
1171
|
-
* Adaptive Label from Form
|
|
1172
|
-
*/
|
|
1173
|
-
if (this.isadaptivelabel === undefined) {
|
|
1174
|
-
if (this.parent?.isadaptivelabel !== undefined) {
|
|
1175
|
-
this.isadaptivelabel = this.parent.isadaptivelabel;
|
|
1176
|
-
}
|
|
1177
|
-
else {
|
|
1178
|
-
this.isadaptivelabel = false;
|
|
1179
|
-
}
|
|
847
|
+
this._inlineerrorenabled = convertToBoolean(value);
|
|
1180
848
|
}
|
|
1181
|
-
this.OnClassInit();
|
|
1182
|
-
}
|
|
1183
|
-
/**
|
|
1184
|
-
* Methode, damit andere Controls änderungen im Control mitbekommen können
|
|
1185
|
-
* Zur Änderungsinfo die Methode propagateChange aufrufen.
|
|
1186
|
-
*/
|
|
1187
|
-
registerOnChange(fn) {
|
|
1188
|
-
this.propagateChange = (obj) => fn(obj);
|
|
1189
|
-
}
|
|
1190
|
-
/**
|
|
1191
|
-
* Methode, damit andere Controls änderungen mitbekommen, wenn das Control aktiviert (Focus) wird.
|
|
1192
|
-
*/
|
|
1193
|
-
registerOnTouched(fn) {
|
|
1194
|
-
this.propagateTouch = (obj) => fn(obj);
|
|
1195
|
-
}
|
|
1196
|
-
/**
|
|
1197
|
-
* Methode zum schreiben von Werten aus dem Model in das Control
|
|
1198
|
-
*/
|
|
1199
|
-
writeValue(value) {
|
|
1200
|
-
this._value = value;
|
|
1201
849
|
}
|
|
1202
850
|
/**
|
|
1203
|
-
*
|
|
851
|
+
* Definiert den Label Text
|
|
1204
852
|
*/
|
|
1205
|
-
|
|
1206
|
-
this.
|
|
853
|
+
set label(v) {
|
|
854
|
+
this._label = v;
|
|
855
|
+
this.UpdateLabelToControl();
|
|
1207
856
|
}
|
|
1208
|
-
// #endregion
|
|
1209
|
-
// #region Control Value
|
|
1210
857
|
/**
|
|
1211
858
|
* Set Methode für NgModel Binding in Html Markup
|
|
1212
859
|
* Input wird benötigt, damit der Wert auch über das Markup gesetzt werden kann.
|
|
@@ -1219,74 +866,60 @@ class SacBaseModelControl {
|
|
|
1219
866
|
this.propagateChange(this._value);
|
|
1220
867
|
}
|
|
1221
868
|
/**
|
|
1222
|
-
*
|
|
869
|
+
* Methode ergibt Boolean Wert für dirty
|
|
1223
870
|
*/
|
|
1224
|
-
get
|
|
1225
|
-
|
|
871
|
+
get dirty() {
|
|
872
|
+
if (this.ngControl !== null) {
|
|
873
|
+
this._dirty = this.ngControl.dirty;
|
|
874
|
+
}
|
|
875
|
+
return this._dirty;
|
|
876
|
+
}
|
|
877
|
+
get inlineerrorenabled() {
|
|
878
|
+
return this._inlineerrorenabled;
|
|
1226
879
|
}
|
|
1227
880
|
/**
|
|
1228
|
-
* Methode
|
|
881
|
+
* Methode ergibt boolean Wert wenn Form invalid oder nicht invalid ist
|
|
1229
882
|
*/
|
|
1230
|
-
|
|
1231
|
-
this.
|
|
883
|
+
get invalid() {
|
|
884
|
+
return (this.ngControl !== undefined &&
|
|
885
|
+
this.ngControl !== null &&
|
|
886
|
+
this.ngControl.invalid);
|
|
1232
887
|
}
|
|
1233
|
-
// #endregion
|
|
1234
|
-
// #region Internal Properties
|
|
1235
888
|
/**
|
|
1236
|
-
*
|
|
889
|
+
* Definiert ob das Control disabled ist
|
|
1237
890
|
*/
|
|
1238
|
-
get
|
|
1239
|
-
return
|
|
891
|
+
get isdisabled() {
|
|
892
|
+
return this._disabledForm || this.disabled;
|
|
1240
893
|
}
|
|
1241
|
-
// #endregion
|
|
1242
|
-
// #region Protected Helper Methods
|
|
1243
894
|
/**
|
|
1244
|
-
*
|
|
895
|
+
* Returns whether the inline error messages are active for this control.
|
|
1245
896
|
*/
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
GetDecimalSymbol() {
|
|
1251
|
-
return '.';
|
|
1252
|
-
}
|
|
1253
|
-
/**
|
|
1254
|
-
* Method can Overwriten in Parent Classes
|
|
1255
|
-
* @param value Wert welcher in den korrekten Typ konvertiert werden soll
|
|
1256
|
-
* @returns Wert im korrekten Typ
|
|
1257
|
-
*/
|
|
1258
|
-
ConvertInputValue(value) {
|
|
1259
|
-
return value;
|
|
1260
|
-
}
|
|
1261
|
-
UpdateLabelToControl() {
|
|
1262
|
-
// HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
|
|
1263
|
-
if (this.ngControl) {
|
|
1264
|
-
this.ngControl.controllabel = this.label;
|
|
897
|
+
get isinlineerrorenabled() {
|
|
898
|
+
if (this.formlayout?.IsInlineErrorEnabled === null ||
|
|
899
|
+
this.formlayout?.IsInlineErrorEnabled === undefined) {
|
|
900
|
+
return this._inlineerrorenabled;
|
|
1265
901
|
}
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
//#region Validation Base
|
|
1269
|
-
/**
|
|
1270
|
-
* Validator Methode
|
|
1271
|
-
*/
|
|
1272
|
-
validate(c) {
|
|
1273
|
-
const error = this.validateData(c);
|
|
1274
|
-
return error;
|
|
902
|
+
return (this.formlayout.IsInlineErrorEnabled !== false &&
|
|
903
|
+
this._inlineerrorenabled !== false);
|
|
1275
904
|
}
|
|
1276
905
|
/**
|
|
1277
|
-
*
|
|
906
|
+
* Definiert den Label Text
|
|
1278
907
|
*/
|
|
1279
|
-
|
|
1280
|
-
this.
|
|
908
|
+
get label() {
|
|
909
|
+
return this._label;
|
|
1281
910
|
}
|
|
1282
911
|
/**
|
|
1283
|
-
*
|
|
912
|
+
* returns an object with all label sizes. These values can then be transferred to corresponding CSS classes using a pipe
|
|
1284
913
|
*/
|
|
1285
|
-
get
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
914
|
+
get labelSizes() {
|
|
915
|
+
return {
|
|
916
|
+
labelSizeSm: this.labelSizeSm,
|
|
917
|
+
labelSizeMd: this.labelSizeMd,
|
|
918
|
+
labelSizeXs: this.labelSizeXs,
|
|
919
|
+
labelSizeXl: this.labelSizeXl,
|
|
920
|
+
labelSizeXxl: this.labelSizeXxl,
|
|
921
|
+
labelSizeLg: this.labelSizeLg,
|
|
922
|
+
};
|
|
1290
923
|
}
|
|
1291
924
|
/**
|
|
1292
925
|
* Methode ergibt Boolean Wert für touched
|
|
@@ -1298,20 +931,13 @@ class SacBaseModelControl {
|
|
|
1298
931
|
return this._touched;
|
|
1299
932
|
}
|
|
1300
933
|
/**
|
|
1301
|
-
* Methode
|
|
1302
|
-
*/
|
|
1303
|
-
get invalid() {
|
|
1304
|
-
return (this.ngControl !== undefined &&
|
|
1305
|
-
this.ngControl !== null &&
|
|
1306
|
-
this.ngControl.invalid);
|
|
1307
|
-
}
|
|
1308
|
-
/**
|
|
1309
|
-
* Methode ergibt boolean touched = true
|
|
934
|
+
* Get Methode für NgModel Binding in Html Markup
|
|
1310
935
|
*/
|
|
1311
|
-
|
|
1312
|
-
this.
|
|
1313
|
-
this.propagateTouch();
|
|
936
|
+
get value() {
|
|
937
|
+
return this._value;
|
|
1314
938
|
}
|
|
939
|
+
// #endregion Public Getters And Setters
|
|
940
|
+
// #region Public Methods
|
|
1315
941
|
/**
|
|
1316
942
|
* Methode ergibt Error anhand von gegebenen Kriterien
|
|
1317
943
|
*/
|
|
@@ -1336,7 +962,6 @@ class SacBaseModelControl {
|
|
|
1336
962
|
observer.complete();
|
|
1337
963
|
});
|
|
1338
964
|
}
|
|
1339
|
-
console.log('Step4: ' + JSON.stringify(errors));
|
|
1340
965
|
const errorItem = errors[keys[0]];
|
|
1341
966
|
// Validation Parameters
|
|
1342
967
|
const parameters = {};
|
|
@@ -1348,6 +973,99 @@ class SacBaseModelControl {
|
|
|
1348
973
|
parameters['FIELD'] = errorItem.fieldName;
|
|
1349
974
|
return this.lngResourceService.GetString(errorItem.errorMessageKey, parameters);
|
|
1350
975
|
}
|
|
976
|
+
/**
|
|
977
|
+
* Init Event
|
|
978
|
+
*/
|
|
979
|
+
ngOnInit() {
|
|
980
|
+
// receive form via formcontrolname or formcontrol instance
|
|
981
|
+
const formControl = this.injector.get(NgControl, null);
|
|
982
|
+
if (formControl instanceof FormControlName) {
|
|
983
|
+
const form = this.injector.get(FormGroupDirective, null);
|
|
984
|
+
this.ngControl = form.getControl(formControl);
|
|
985
|
+
}
|
|
986
|
+
else {
|
|
987
|
+
if (formControl) {
|
|
988
|
+
this.ngControl = formControl.control;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
this.UpdateLabelToControl();
|
|
992
|
+
// set label sizes from formlayout directive
|
|
993
|
+
this.setLabelSizes();
|
|
994
|
+
// set adaptive label property from formlayout directive
|
|
995
|
+
this.setIsAdaptiveLabel();
|
|
996
|
+
this.OnClassInit();
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Methode ergibt boolean touched = true
|
|
1000
|
+
*/
|
|
1001
|
+
onTouch() {
|
|
1002
|
+
this._touched = true;
|
|
1003
|
+
this.propagateTouch();
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Methode, damit andere Controls änderungen im Control mitbekommen können
|
|
1007
|
+
* Zur Änderungsinfo die Methode propagateChange aufrufen.
|
|
1008
|
+
*/
|
|
1009
|
+
registerOnChange(fn) {
|
|
1010
|
+
this.propagateChange = (obj) => fn(obj);
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Methode, damit andere Controls änderungen mitbekommen, wenn das Control aktiviert (Focus) wird.
|
|
1014
|
+
*/
|
|
1015
|
+
registerOnTouched(fn) {
|
|
1016
|
+
this.propagateTouch = (obj) => fn(obj);
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Methode registriert Änderungen bei der Validierung
|
|
1020
|
+
*/
|
|
1021
|
+
registerOnValidatorChange(fn) {
|
|
1022
|
+
this._onChange = fn;
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Setzt das Control auf Disabled
|
|
1026
|
+
*/
|
|
1027
|
+
setDisabledState(isDisabled) {
|
|
1028
|
+
this._disabledForm = isDisabled;
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* Methode die den Wert des Inputs setzt
|
|
1032
|
+
*/
|
|
1033
|
+
setValue(v) {
|
|
1034
|
+
this.value = v;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Validator Methode
|
|
1038
|
+
*/
|
|
1039
|
+
validate(c) {
|
|
1040
|
+
const error = this.validateData(c);
|
|
1041
|
+
return error;
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Methode zum schreiben von Werten aus dem Model in das Control
|
|
1045
|
+
*/
|
|
1046
|
+
writeValue(value) {
|
|
1047
|
+
this._value = value;
|
|
1048
|
+
}
|
|
1049
|
+
// #endregion Public Abstract Methods
|
|
1050
|
+
// #region Protected Methods
|
|
1051
|
+
/**
|
|
1052
|
+
* Method can Overwriten in Parent Classes
|
|
1053
|
+
* @param value Wert welcher in den korrekten Typ konvertiert werden soll
|
|
1054
|
+
* @returns Wert im korrekten Typ
|
|
1055
|
+
*/
|
|
1056
|
+
ConvertInputValue(value) {
|
|
1057
|
+
return value;
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Methode ergibt Decimal Symbol
|
|
1061
|
+
*/
|
|
1062
|
+
GetDecimalSymbol() {
|
|
1063
|
+
return '.';
|
|
1064
|
+
}
|
|
1065
|
+
/**
|
|
1066
|
+
* Method can be used to Set Properties at Class Init
|
|
1067
|
+
*/
|
|
1068
|
+
OnClassInit() { }
|
|
1351
1069
|
/**
|
|
1352
1070
|
* Aktualisiert den NgModel Wert und die Gültigkeit des Validators des Controls
|
|
1353
1071
|
*/
|
|
@@ -1356,56 +1074,109 @@ class SacBaseModelControl {
|
|
|
1356
1074
|
this.ngControl.updateValueAndValidity({ onlySelf: true });
|
|
1357
1075
|
}
|
|
1358
1076
|
}
|
|
1077
|
+
// #endregion Protected Methods
|
|
1078
|
+
// #region Private Methods
|
|
1079
|
+
UpdateLabelToControl() {
|
|
1080
|
+
// HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
|
|
1081
|
+
if (this.ngControl) {
|
|
1082
|
+
this.ngControl.controllabel = this.label;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1359
1085
|
/**
|
|
1360
|
-
*
|
|
1086
|
+
* Set adaptive label property from parent layout control
|
|
1361
1087
|
*/
|
|
1362
|
-
|
|
1363
|
-
if (
|
|
1364
|
-
this.
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1088
|
+
setIsAdaptiveLabel() {
|
|
1089
|
+
if (!this.isAdaptiveLabel) {
|
|
1090
|
+
if (this.formlayout?.isAdaptiveLabel !== undefined) {
|
|
1091
|
+
this.isAdaptiveLabel = this.formlayout.isAdaptiveLabel;
|
|
1092
|
+
}
|
|
1093
|
+
else {
|
|
1094
|
+
this.isAdaptiveLabel = false;
|
|
1095
|
+
}
|
|
1368
1096
|
}
|
|
1369
1097
|
}
|
|
1370
|
-
get inlineerrorenabled() {
|
|
1371
|
-
return this._inlineerrorenabled;
|
|
1372
|
-
}
|
|
1373
1098
|
/**
|
|
1374
|
-
*
|
|
1099
|
+
* Set label sizes from property or parent layout control
|
|
1375
1100
|
*/
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1101
|
+
setLabelSizes() {
|
|
1102
|
+
// set size extra small
|
|
1103
|
+
if (!this.labelSizeXs) {
|
|
1104
|
+
if (this.formlayout?.labelSizeXs) {
|
|
1105
|
+
this.labelSizeXs = this.formlayout.labelSizeXs;
|
|
1106
|
+
}
|
|
1107
|
+
else {
|
|
1108
|
+
this.labelSizeXs = 12;
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
// set size small
|
|
1112
|
+
if (!this.labelSizeSm) {
|
|
1113
|
+
if (this.formlayout?.labelSizeSm) {
|
|
1114
|
+
this.labelSizeSm = this.formlayout.labelSizeSm;
|
|
1115
|
+
}
|
|
1116
|
+
else {
|
|
1117
|
+
this.labelSizeSm = 4;
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
// set size medium
|
|
1121
|
+
if (!this.labelSizeMd) {
|
|
1122
|
+
if (this.formlayout?.labelSizeMd) {
|
|
1123
|
+
this.labelSizeMd = this.formlayout.labelSizeMd;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
// set size large
|
|
1127
|
+
if (!this.labelSizeLg) {
|
|
1128
|
+
if (this.formlayout?.labelSizeLg) {
|
|
1129
|
+
this.labelSizeLg = this.formlayout.labelSizeLg;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
// set size extra large
|
|
1133
|
+
if (!this.labelSizeXl) {
|
|
1134
|
+
if (this.formlayout?.labelSizeXl) {
|
|
1135
|
+
this.labelSizeXl = this.formlayout.labelSizeXl;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
// set size extra extra large
|
|
1139
|
+
if (!this.labelSizeXxl) {
|
|
1140
|
+
if (this.formlayout?.labelSizeXxl) {
|
|
1141
|
+
this.labelSizeXxl = this.formlayout.labelSizeXxl;
|
|
1142
|
+
}
|
|
1380
1143
|
}
|
|
1381
|
-
return (this.parent.IsInlineErrorEnabled !== false &&
|
|
1382
|
-
this._inlineerrorenabled !== false);
|
|
1383
1144
|
}
|
|
1384
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacBaseModelControl, deps: [{ token:
|
|
1385
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacBaseModelControl, inputs: {
|
|
1145
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacBaseModelControl, deps: [{ token: SacFormLayoutCommon, host: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1146
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacBaseModelControl, inputs: { disabled: "disabled", disablelabel: "disablelabel", inlineError: "inlineError", isAdaptiveLabel: "isAdaptiveLabel", labelSizeLg: "labelSizeLg", labelSizeMd: "labelSizeMd", labelSizeSm: "labelSizeSm", labelSizeXl: "labelSizeXl", labelSizeXs: "labelSizeXs", labelSizeXxl: "labelSizeXxl", name: "name", inlineerrorenabled: "inlineerrorenabled", label: "label", value: "value" }, ngImport: i0 }); }
|
|
1386
1147
|
}
|
|
1387
1148
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacBaseModelControl, decorators: [{
|
|
1388
1149
|
type: Directive
|
|
1389
|
-
}], ctorParameters: function () { return [{ type:
|
|
1150
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
1390
1151
|
type: Host
|
|
1391
|
-
}] }, { type: i0.Injector }]; }, propDecorators: {
|
|
1152
|
+
}] }, { type: i0.Injector }]; }, propDecorators: { disabled: [{
|
|
1392
1153
|
type: Input
|
|
1393
|
-
}],
|
|
1154
|
+
}], disablelabel: [{
|
|
1394
1155
|
type: Input
|
|
1395
|
-
}],
|
|
1156
|
+
}], inlineError: [{
|
|
1396
1157
|
type: Input
|
|
1397
|
-
}],
|
|
1158
|
+
}], isAdaptiveLabel: [{
|
|
1398
1159
|
type: Input
|
|
1399
|
-
}],
|
|
1160
|
+
}], labelSizeLg: [{
|
|
1400
1161
|
type: Input
|
|
1401
|
-
}],
|
|
1162
|
+
}], labelSizeMd: [{
|
|
1402
1163
|
type: Input
|
|
1403
|
-
}],
|
|
1164
|
+
}], labelSizeSm: [{
|
|
1404
1165
|
type: Input
|
|
1405
|
-
}],
|
|
1166
|
+
}], labelSizeXl: [{
|
|
1167
|
+
type: Input
|
|
1168
|
+
}], labelSizeXs: [{
|
|
1169
|
+
type: Input
|
|
1170
|
+
}], labelSizeXxl: [{
|
|
1171
|
+
type: Input
|
|
1172
|
+
}], name: [{
|
|
1406
1173
|
type: Input
|
|
1407
1174
|
}], inlineerrorenabled: [{
|
|
1408
1175
|
type: Input
|
|
1176
|
+
}], label: [{
|
|
1177
|
+
type: Input
|
|
1178
|
+
}], value: [{
|
|
1179
|
+
type: Input
|
|
1409
1180
|
}] } });
|
|
1410
1181
|
|
|
1411
1182
|
/**
|
|
@@ -1415,9 +1186,13 @@ class SacCheckboxCommon extends SacBaseModelControl {
|
|
|
1415
1186
|
constructor() {
|
|
1416
1187
|
super(...arguments);
|
|
1417
1188
|
/**
|
|
1418
|
-
|
|
1419
|
-
|
|
1189
|
+
* Text welcher als Tooltip angezeigt wird.
|
|
1190
|
+
*/
|
|
1420
1191
|
this.tooltiptext = '';
|
|
1192
|
+
/**
|
|
1193
|
+
* Defines that the checkbox can be used in a list of checkboxes and is not handled as a single form control
|
|
1194
|
+
*/
|
|
1195
|
+
this.stacked = false;
|
|
1421
1196
|
}
|
|
1422
1197
|
/**
|
|
1423
1198
|
* Control hat keinen Validator
|
|
@@ -1426,7 +1201,7 @@ class SacCheckboxCommon extends SacBaseModelControl {
|
|
|
1426
1201
|
return null;
|
|
1427
1202
|
}
|
|
1428
1203
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacCheckboxCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1429
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacCheckboxCommon, inputs: { tooltiptext: "tooltiptext", checkboxtext: "checkboxtext" }, usesInheritance: true, ngImport: i0 }); }
|
|
1204
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacCheckboxCommon, inputs: { tooltiptext: "tooltiptext", checkboxtext: "checkboxtext", stacked: "stacked" }, usesInheritance: true, ngImport: i0 }); }
|
|
1430
1205
|
}
|
|
1431
1206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacCheckboxCommon, decorators: [{
|
|
1432
1207
|
type: Directive
|
|
@@ -1434,6 +1209,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1434
1209
|
type: Input
|
|
1435
1210
|
}], checkboxtext: [{
|
|
1436
1211
|
type: Input
|
|
1212
|
+
}], stacked: [{
|
|
1213
|
+
type: Input
|
|
1437
1214
|
}] } });
|
|
1438
1215
|
|
|
1439
1216
|
/**
|
|
@@ -1891,11 +1668,12 @@ class Validation {
|
|
|
1891
1668
|
*/
|
|
1892
1669
|
class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
1893
1670
|
/**
|
|
1894
|
-
*
|
|
1895
|
-
*
|
|
1671
|
+
* Constructor
|
|
1672
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
1673
|
+
* @param injector Injector for injecting services
|
|
1896
1674
|
*/
|
|
1897
|
-
constructor(
|
|
1898
|
-
super(
|
|
1675
|
+
constructor(formlayout, injector) {
|
|
1676
|
+
super(formlayout, injector);
|
|
1899
1677
|
/**
|
|
1900
1678
|
* Radio Button Index
|
|
1901
1679
|
*/
|
|
@@ -1944,7 +1722,7 @@ class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
|
1944
1722
|
writeValue(value) {
|
|
1945
1723
|
super.writeValue(value);
|
|
1946
1724
|
if (value !== null && value !== undefined) {
|
|
1947
|
-
this.contentRadiobuttons.forEach(itm => {
|
|
1725
|
+
this.contentRadiobuttons.forEach((itm) => {
|
|
1948
1726
|
itm.checked = itm.value === value;
|
|
1949
1727
|
});
|
|
1950
1728
|
}
|
|
@@ -1954,7 +1732,7 @@ class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
|
1954
1732
|
* Item selektieren
|
|
1955
1733
|
*/
|
|
1956
1734
|
SelectItem(value) {
|
|
1957
|
-
this.contentRadiobuttons.forEach(itm => {
|
|
1735
|
+
this.contentRadiobuttons.forEach((itm) => {
|
|
1958
1736
|
itm.checked = itm.value === value;
|
|
1959
1737
|
});
|
|
1960
1738
|
this.value = value;
|
|
@@ -1967,7 +1745,7 @@ class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
|
1967
1745
|
if (radioButtons === undefined || radioButtons === null) {
|
|
1968
1746
|
return false;
|
|
1969
1747
|
}
|
|
1970
|
-
return this.contentRadiobuttons.some(itm => itm.checked);
|
|
1748
|
+
return this.contentRadiobuttons.some((itm) => itm.checked);
|
|
1971
1749
|
}
|
|
1972
1750
|
/**
|
|
1973
1751
|
* Validator
|
|
@@ -1980,12 +1758,12 @@ class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
|
1980
1758
|
return null;
|
|
1981
1759
|
}
|
|
1982
1760
|
}
|
|
1983
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacRadiobuttonsCommon, deps: [{ token:
|
|
1761
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacRadiobuttonsCommon, deps: [{ token: SacFormLayoutCommon, host: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1984
1762
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacRadiobuttonsCommon, inputs: { validationmessagerequired: "validationmessagerequired", validationmessagesummaryrequired: "validationmessagesummaryrequired" }, usesInheritance: true, ngImport: i0 }); }
|
|
1985
1763
|
}
|
|
1986
1764
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacRadiobuttonsCommon, decorators: [{
|
|
1987
1765
|
type: Directive
|
|
1988
|
-
}], ctorParameters: function () { return [{ type:
|
|
1766
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
1989
1767
|
type: Host
|
|
1990
1768
|
}] }, { type: i0.Injector }]; }, propDecorators: { validationmessagerequired: [{
|
|
1991
1769
|
type: Input
|
|
@@ -2099,6 +1877,330 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2099
1877
|
type: Input
|
|
2100
1878
|
}] } });
|
|
2101
1879
|
|
|
1880
|
+
/**
|
|
1881
|
+
* Base Komponente für Dialog
|
|
1882
|
+
*/
|
|
1883
|
+
class SacDialogCommon {
|
|
1884
|
+
/**
|
|
1885
|
+
* Implementation als Setter, da mit ngIf das Element bei Unsichtbarkeit UNDEFINED ist.
|
|
1886
|
+
*/
|
|
1887
|
+
set dialogElementSetter(content) {
|
|
1888
|
+
this.dialogElement = content;
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Das Input akzeptiert sowohl default size-css-Klassen als auch custom Klassen.
|
|
1892
|
+
* case insensitive.
|
|
1893
|
+
* Die akzeptabel default-size-Klassen sind: 'small', 'large', 'extralarge', 'medium', ''.
|
|
1894
|
+
* Wenn size ist NICHT gesetzt (oder 'medium' oder ''), default ist in medium size: max-width 500px.
|
|
1895
|
+
*/
|
|
1896
|
+
set size(v) {
|
|
1897
|
+
v = v.toLowerCase();
|
|
1898
|
+
this._size = v;
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* Setter. Erhält das boolen Wert des _show property
|
|
1902
|
+
*/
|
|
1903
|
+
set isvisible(v) {
|
|
1904
|
+
if (v &&
|
|
1905
|
+
!this.hasSetBodyTag &&
|
|
1906
|
+
!document.body.classList.contains('modal-open')) {
|
|
1907
|
+
document.body.classList.add('modal-open');
|
|
1908
|
+
this.hasSetBodyTag = true;
|
|
1909
|
+
}
|
|
1910
|
+
if (!v &&
|
|
1911
|
+
this.hasSetBodyTag &&
|
|
1912
|
+
document.body.classList.contains('modal-open')) {
|
|
1913
|
+
document.body.classList.remove('modal-open');
|
|
1914
|
+
this.hasSetBodyTag = false;
|
|
1915
|
+
}
|
|
1916
|
+
this._show = v;
|
|
1917
|
+
}
|
|
1918
|
+
/**
|
|
1919
|
+
* Getter. Ergibt das boolen Wert des _show property
|
|
1920
|
+
*/
|
|
1921
|
+
get isvisible() {
|
|
1922
|
+
return this._show;
|
|
1923
|
+
}
|
|
1924
|
+
/**
|
|
1925
|
+
* Die Funktion prüft ob es ein default css classe für Size des Dialog durch den size Input gesetzt wurde.
|
|
1926
|
+
*/
|
|
1927
|
+
issetdefaultsize() {
|
|
1928
|
+
let result = false;
|
|
1929
|
+
switch (this._size) {
|
|
1930
|
+
case 'small':
|
|
1931
|
+
result = true;
|
|
1932
|
+
break;
|
|
1933
|
+
case 'medium':
|
|
1934
|
+
result = true;
|
|
1935
|
+
break;
|
|
1936
|
+
case 'large':
|
|
1937
|
+
result = true;
|
|
1938
|
+
break;
|
|
1939
|
+
case 'extralarge':
|
|
1940
|
+
result = true;
|
|
1941
|
+
break;
|
|
1942
|
+
case '':
|
|
1943
|
+
result = true;
|
|
1944
|
+
break;
|
|
1945
|
+
}
|
|
1946
|
+
return result;
|
|
1947
|
+
}
|
|
1948
|
+
// #endregion
|
|
1949
|
+
// #region Constructor
|
|
1950
|
+
/**
|
|
1951
|
+
* Konstruktor
|
|
1952
|
+
* Inject des Formulars
|
|
1953
|
+
*/
|
|
1954
|
+
constructor(cdRef) {
|
|
1955
|
+
this.cdRef = cdRef;
|
|
1956
|
+
this.hasSetBodyTag = false;
|
|
1957
|
+
/**
|
|
1958
|
+
* Boolean Property definiert ob das Dialog angezeigt wird
|
|
1959
|
+
*/
|
|
1960
|
+
this._show = false;
|
|
1961
|
+
/**
|
|
1962
|
+
* Das property enthielt (wenn überhaupt gesetzt) entweder keywords für sizing oder custom css Klassen.
|
|
1963
|
+
* Die akzeptabel keywordssind: 'small', 'large', 'extralarge', 'medium', ''.
|
|
1964
|
+
*/
|
|
1965
|
+
this._size = '';
|
|
1966
|
+
// #region Properties
|
|
1967
|
+
/**
|
|
1968
|
+
* Input Property. Erhält den Title des Dialog. Default Value: 'Dialog'.
|
|
1969
|
+
*/
|
|
1970
|
+
this.title = 'Dialog';
|
|
1971
|
+
/**
|
|
1972
|
+
* Das input property akzeptiert boolen Wert. Definiert ob das Dialog darf durch ESC geschlossen werden. Default ist true.
|
|
1973
|
+
*/
|
|
1974
|
+
this.allowesc = true;
|
|
1975
|
+
/**
|
|
1976
|
+
* Das input property akzeptiert boolen Wert. Definiert ob das Dialog darf durch click außerhalb des Dialog-Fenster geschlossen werden. Default ist true.
|
|
1977
|
+
*/
|
|
1978
|
+
this.backdrop = true;
|
|
1979
|
+
/**
|
|
1980
|
+
* Input Property. Erhält den Namen des Dialog - benutzt für das ID. Default Value: ''
|
|
1981
|
+
*/
|
|
1982
|
+
this.name = '';
|
|
1983
|
+
/**
|
|
1984
|
+
* Steuert ob im Header des Dialogs ein Button angezeigt wird.
|
|
1985
|
+
*/
|
|
1986
|
+
this.closebutton = true;
|
|
1987
|
+
/**
|
|
1988
|
+
* Input Property. Erhält die Breite des Dialog
|
|
1989
|
+
*/
|
|
1990
|
+
this.width = null;
|
|
1991
|
+
/**
|
|
1992
|
+
* Definiert eine feste Höhe beim Dialog.
|
|
1993
|
+
*/
|
|
1994
|
+
this.height = null;
|
|
1995
|
+
/**
|
|
1996
|
+
* Output Emitter. Wird aufgerufen, wenn das Wert des _show property geändert ist - damait das Dialog geöfnet/geschlossen wird.
|
|
1997
|
+
*/
|
|
1998
|
+
this.isvisibleChange = new EventEmitter();
|
|
1999
|
+
}
|
|
2000
|
+
// #endregion
|
|
2001
|
+
/**
|
|
2002
|
+
* Methode wenn Componente entfernt wird
|
|
2003
|
+
*/
|
|
2004
|
+
ngOnDestroy() {
|
|
2005
|
+
if (this.hasSetBodyTag && document.body.classList.contains('modal-open')) {
|
|
2006
|
+
document.body.classList.remove('modal-open');
|
|
2007
|
+
this.hasSetBodyTag = false;
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
// #region Methods
|
|
2011
|
+
/**
|
|
2012
|
+
* Die Methode setz den Wert des _show property auf true
|
|
2013
|
+
*/
|
|
2014
|
+
show() {
|
|
2015
|
+
this._show = true;
|
|
2016
|
+
if (!this.hasSetBodyTag &&
|
|
2017
|
+
!document.body.classList.contains('modal-open')) {
|
|
2018
|
+
document.body.classList.add('modal-open');
|
|
2019
|
+
this.hasSetBodyTag = true;
|
|
2020
|
+
}
|
|
2021
|
+
this.isvisibleChange.emit(this._show);
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2024
|
+
* Die Methode setz den Wert des _show property auf false
|
|
2025
|
+
*/
|
|
2026
|
+
hide() {
|
|
2027
|
+
if (this.hasSetBodyTag && document.body.classList.contains('modal-open')) {
|
|
2028
|
+
document.body.classList.remove('modal-open');
|
|
2029
|
+
this.hasSetBodyTag = false;
|
|
2030
|
+
}
|
|
2031
|
+
this._show = false;
|
|
2032
|
+
this.isvisibleChange.emit(this._show);
|
|
2033
|
+
}
|
|
2034
|
+
/**
|
|
2035
|
+
* Getter for ChangeDetector.
|
|
2036
|
+
*/
|
|
2037
|
+
get ChangeDetector() {
|
|
2038
|
+
return this.cdRef;
|
|
2039
|
+
}
|
|
2040
|
+
// #endregion
|
|
2041
|
+
// #region Host Actions
|
|
2042
|
+
/**
|
|
2043
|
+
* Allow Close by Click outside Dialog
|
|
2044
|
+
*/
|
|
2045
|
+
onClick(event) {
|
|
2046
|
+
if (this.allowesc === false ||
|
|
2047
|
+
(this.dialogElement !== null &&
|
|
2048
|
+
this.dialogElement !== undefined &&
|
|
2049
|
+
event.target !== this.dialogElement.nativeElement)) {
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2052
|
+
this.hide();
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* Allow Close by ESC
|
|
2056
|
+
*/
|
|
2057
|
+
onKeydownHandler(event) {
|
|
2058
|
+
const ESCAPE_KEYCODE = 'Escape';
|
|
2059
|
+
if (this.allowesc === true && event.key === ESCAPE_KEYCODE) {
|
|
2060
|
+
this.hide();
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDialogCommon, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2064
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacDialogCommon, inputs: { title: "title", allowesc: "allowesc", backdrop: "backdrop", name: "name", closebutton: "closebutton", width: "width", height: "height", size: "size", isvisible: "isvisible" }, outputs: { isvisibleChange: "isvisibleChange" }, host: { listeners: { "click": "onClick($event)", "document:keydown": "onKeydownHandler($event)" } }, viewQueries: [{ propertyName: "dialogElementSetter", first: true, predicate: ["dialog"], descendants: true }], ngImport: i0 }); }
|
|
2065
|
+
}
|
|
2066
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDialogCommon, decorators: [{
|
|
2067
|
+
type: Directive
|
|
2068
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { dialogElementSetter: [{
|
|
2069
|
+
type: ViewChild,
|
|
2070
|
+
args: ['dialog', { static: false }]
|
|
2071
|
+
}], title: [{
|
|
2072
|
+
type: Input
|
|
2073
|
+
}], allowesc: [{
|
|
2074
|
+
type: Input
|
|
2075
|
+
}], backdrop: [{
|
|
2076
|
+
type: Input
|
|
2077
|
+
}], name: [{
|
|
2078
|
+
type: Input
|
|
2079
|
+
}], closebutton: [{
|
|
2080
|
+
type: Input
|
|
2081
|
+
}], width: [{
|
|
2082
|
+
type: Input
|
|
2083
|
+
}], height: [{
|
|
2084
|
+
type: Input
|
|
2085
|
+
}], size: [{
|
|
2086
|
+
type: Input
|
|
2087
|
+
}], isvisibleChange: [{
|
|
2088
|
+
type: Output
|
|
2089
|
+
}], isvisible: [{
|
|
2090
|
+
type: Input
|
|
2091
|
+
}], onClick: [{
|
|
2092
|
+
type: HostListener,
|
|
2093
|
+
args: ['click', ['$event']]
|
|
2094
|
+
}], onKeydownHandler: [{
|
|
2095
|
+
type: HostListener,
|
|
2096
|
+
args: ['document:keydown', ['$event']]
|
|
2097
|
+
}] } });
|
|
2098
|
+
|
|
2099
|
+
// #endregion Type aliases
|
|
2100
|
+
// #region Classes
|
|
2101
|
+
/**
|
|
2102
|
+
* Base Komponente für SacFormular
|
|
2103
|
+
*/
|
|
2104
|
+
class SacFormCommon {
|
|
2105
|
+
// #endregion Properties
|
|
2106
|
+
// #region Constructors
|
|
2107
|
+
/**
|
|
2108
|
+
* Konstruktor
|
|
2109
|
+
* @param form Instanz von NgForm
|
|
2110
|
+
*/
|
|
2111
|
+
constructor(form) {
|
|
2112
|
+
this.form = form;
|
|
2113
|
+
// #region Properties
|
|
2114
|
+
/**
|
|
2115
|
+
* Standardwert wann die Werte via NgModel aktualisiert werden
|
|
2116
|
+
*/
|
|
2117
|
+
this._updateon = 'change';
|
|
2118
|
+
this.form.options = { updateOn: this._updateon };
|
|
2119
|
+
}
|
|
2120
|
+
// #endregion Constructors
|
|
2121
|
+
// #region Public Getters And Setters
|
|
2122
|
+
/**
|
|
2123
|
+
* Definiert, wenn das Model geupdatet wird
|
|
2124
|
+
*/
|
|
2125
|
+
set updateon(v) {
|
|
2126
|
+
this._updateon = v;
|
|
2127
|
+
this.form.options.updateOn = v;
|
|
2128
|
+
}
|
|
2129
|
+
get updateon() {
|
|
2130
|
+
return this._updateon;
|
|
2131
|
+
}
|
|
2132
|
+
// #endregion Public Getters And Setters
|
|
2133
|
+
// #region Public Methods
|
|
2134
|
+
/**
|
|
2135
|
+
* Gibt die NgForm Instanz zurück
|
|
2136
|
+
*/
|
|
2137
|
+
getForm() {
|
|
2138
|
+
return this.form;
|
|
2139
|
+
}
|
|
2140
|
+
/**
|
|
2141
|
+
* Markiert alle Controls innerhalb des Formulares als Touched
|
|
2142
|
+
*/
|
|
2143
|
+
markAsTouched() {
|
|
2144
|
+
if (this.form && this.form.invalid) {
|
|
2145
|
+
this.markAsTouchedInternal(this.form.controls);
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
/**
|
|
2149
|
+
* Aktualisiert die Werte und den Gültigkeitsstatus des Formulars
|
|
2150
|
+
*/
|
|
2151
|
+
updateValueAndValidity(markAsTouched = true) {
|
|
2152
|
+
// Update all Controls
|
|
2153
|
+
this.updateValueAndValidityInternal(this.form.controls);
|
|
2154
|
+
// Update Main Form
|
|
2155
|
+
this.getForm().form.updateValueAndValidity();
|
|
2156
|
+
// Mark all Controls as Touched
|
|
2157
|
+
if (markAsTouched) {
|
|
2158
|
+
this.markAsTouched();
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
// #endregion Public Methods
|
|
2162
|
+
// #region Private Methods
|
|
2163
|
+
/**
|
|
2164
|
+
* Markiert alle Controls inkl. dem Tree als Touched
|
|
2165
|
+
* @param controls Controls Collection
|
|
2166
|
+
*/
|
|
2167
|
+
markAsTouchedInternal(controls) {
|
|
2168
|
+
const keyList = Object.keys(controls);
|
|
2169
|
+
for (const field of keyList) {
|
|
2170
|
+
const control = controls[field];
|
|
2171
|
+
if (control instanceof UntypedFormGroup) {
|
|
2172
|
+
this.markAsTouchedInternal(control.controls);
|
|
2173
|
+
}
|
|
2174
|
+
else {
|
|
2175
|
+
control.markAsTouched({ onlySelf: true });
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2180
|
+
* Aktualisiert die Werte und die gültigkeit des Formulars
|
|
2181
|
+
* @param controls Controls Collection
|
|
2182
|
+
*/
|
|
2183
|
+
updateValueAndValidityInternal(controls) {
|
|
2184
|
+
const keyList = Object.keys(controls);
|
|
2185
|
+
for (const field of keyList) {
|
|
2186
|
+
const control = controls[field];
|
|
2187
|
+
if (control instanceof UntypedFormGroup) {
|
|
2188
|
+
this.updateValueAndValidityInternal(control.controls);
|
|
2189
|
+
}
|
|
2190
|
+
else {
|
|
2191
|
+
control.updateValueAndValidity({ onlySelf: true });
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacFormCommon, deps: [{ token: i1.NgForm }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2196
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacFormCommon, inputs: { updateon: "updateon" }, ngImport: i0 }); }
|
|
2197
|
+
}
|
|
2198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacFormCommon, decorators: [{
|
|
2199
|
+
type: Directive
|
|
2200
|
+
}], ctorParameters: function () { return [{ type: i1.NgForm }]; }, propDecorators: { updateon: [{
|
|
2201
|
+
type: Input
|
|
2202
|
+
}] } });
|
|
2203
|
+
|
|
2102
2204
|
/**
|
|
2103
2205
|
* Abstract Klasse für SacBaseListControl. Extendes SacBaseModelControl
|
|
2104
2206
|
*/
|
|
@@ -2185,55 +2287,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2185
2287
|
type: Input
|
|
2186
2288
|
}] } });
|
|
2187
2289
|
|
|
2188
|
-
|
|
2189
|
-
* Function um ein Key Value Pair für das Dropdown zu erzeugen
|
|
2190
|
-
* @param id ID
|
|
2191
|
-
* @param value Wert der an das Element gebunden werden soll
|
|
2192
|
-
*/
|
|
2193
|
-
function _buildValueString(id, value) {
|
|
2194
|
-
// Wenn ID null ist Object zurückgeben
|
|
2195
|
-
if (id == null) {
|
|
2196
|
-
return `${value}`;
|
|
2197
|
-
}
|
|
2198
|
-
// Mapping Objekt zu String
|
|
2199
|
-
if (value && typeof value === 'object') {
|
|
2200
|
-
value = 'Object';
|
|
2201
|
-
}
|
|
2202
|
-
// String als ID
|
|
2203
|
-
return `${id}: ${value}`.slice(0, 50);
|
|
2204
|
-
}
|
|
2290
|
+
// #region Classes
|
|
2205
2291
|
/**
|
|
2206
2292
|
* Base Dropdown Komponente
|
|
2207
2293
|
*/
|
|
2208
2294
|
class SacDropdownCommon extends SacBaseSelectControl {
|
|
2295
|
+
// #endregion Properties
|
|
2296
|
+
// #region Constructors
|
|
2209
2297
|
/**
|
|
2210
|
-
*
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
}
|
|
2216
|
-
this._compareWith = fn;
|
|
2217
|
-
}
|
|
2218
|
-
/**
|
|
2219
|
-
* Konstruktor
|
|
2220
|
-
* @param parent Übergeordnetes HTML Element
|
|
2221
|
-
* @param injector Injector für Services
|
|
2222
|
-
* @param _renderer Render Engine
|
|
2223
|
-
* @param _elementRef Referenz von HTML Element
|
|
2298
|
+
* Constructor
|
|
2299
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
2300
|
+
* @param injector Injector for injecting services
|
|
2301
|
+
* @param renderer html rendering engine
|
|
2302
|
+
* @param elementRef reference to html element
|
|
2224
2303
|
*/
|
|
2225
|
-
constructor(
|
|
2226
|
-
super(
|
|
2227
|
-
this.
|
|
2228
|
-
this.
|
|
2229
|
-
|
|
2230
|
-
* Counter vom OptionID; default Wert = 0
|
|
2231
|
-
*/
|
|
2232
|
-
this._optionIdCounter = 0;
|
|
2233
|
-
/**
|
|
2234
|
-
* OptionMap
|
|
2235
|
-
*/
|
|
2236
|
-
this._optionMap = new Map();
|
|
2304
|
+
constructor(formlayout, injector, renderer, elementRef) {
|
|
2305
|
+
super(formlayout, injector);
|
|
2306
|
+
this.renderer = renderer;
|
|
2307
|
+
this.elementRef = elementRef;
|
|
2308
|
+
// #region Properties
|
|
2237
2309
|
/**
|
|
2238
2310
|
* compareWith-Funktion
|
|
2239
2311
|
*/
|
|
@@ -2254,22 +2326,28 @@ class SacDropdownCommon extends SacBaseSelectControl {
|
|
|
2254
2326
|
* Resource Key für Validation Message Required in Validation Summary
|
|
2255
2327
|
*/
|
|
2256
2328
|
this.validationmessagesummaryrequired = 'VALIDATION_ERROR_SUMMARY_REQUIRED';
|
|
2329
|
+
/**
|
|
2330
|
+
* Counter vom OptionID; default Wert = 0
|
|
2331
|
+
*/
|
|
2332
|
+
this._optionIdCounter = 0;
|
|
2333
|
+
/**
|
|
2334
|
+
* OptionMap
|
|
2335
|
+
*/
|
|
2336
|
+
this._optionMap = new Map();
|
|
2257
2337
|
}
|
|
2338
|
+
// #endregion Constructors
|
|
2339
|
+
// #region Public Getters And Setters
|
|
2258
2340
|
/**
|
|
2259
|
-
*
|
|
2260
|
-
* @param value - Wert
|
|
2261
|
-
*/
|
|
2262
|
-
setValue(value) {
|
|
2263
|
-
super.setValue(this.getOptionValue(value));
|
|
2264
|
-
}
|
|
2265
|
-
/**
|
|
2266
|
-
* Wert schreiben
|
|
2267
|
-
* @param value - Wert
|
|
2341
|
+
* compareWith-Funktion
|
|
2268
2342
|
*/
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2343
|
+
set comparewith(fn) {
|
|
2344
|
+
if (typeof fn !== 'function') {
|
|
2345
|
+
throw new Error(`compareWith must be a function, but received ${JSON.stringify(fn)}`);
|
|
2346
|
+
}
|
|
2347
|
+
this._compareWith = fn;
|
|
2272
2348
|
}
|
|
2349
|
+
// #endregion Public Getters And Setters
|
|
2350
|
+
// #region Public Methods
|
|
2273
2351
|
/**
|
|
2274
2352
|
* Registriert das OptionID-Counter als String
|
|
2275
2353
|
*/
|
|
@@ -2289,23 +2367,39 @@ class SacDropdownCommon extends SacBaseSelectControl {
|
|
|
2289
2367
|
}
|
|
2290
2368
|
}
|
|
2291
2369
|
/**
|
|
2292
|
-
*
|
|
2293
|
-
* @param value
|
|
2370
|
+
* Wert einstellen
|
|
2371
|
+
* @param value - Wert
|
|
2294
2372
|
*/
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
if (selectItem !== undefined) {
|
|
2307
|
-
this._renderer.setProperty(selectItem, 'value', valueString);
|
|
2373
|
+
setValue(value) {
|
|
2374
|
+
super.setValue(this.getOptionValue(value));
|
|
2375
|
+
}
|
|
2376
|
+
/**
|
|
2377
|
+
* Validator
|
|
2378
|
+
* @param c Control Instanz
|
|
2379
|
+
*/
|
|
2380
|
+
validateData(c) {
|
|
2381
|
+
let error = null;
|
|
2382
|
+
if (this.isrequired) {
|
|
2383
|
+
error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
2308
2384
|
}
|
|
2385
|
+
return error;
|
|
2386
|
+
}
|
|
2387
|
+
/**
|
|
2388
|
+
* Wert schreiben
|
|
2389
|
+
* @param value - Wert
|
|
2390
|
+
*/
|
|
2391
|
+
writeValue(value) {
|
|
2392
|
+
this.setSelectedValue(value);
|
|
2393
|
+
super.writeValue(value);
|
|
2394
|
+
}
|
|
2395
|
+
// #endregion Public Methods
|
|
2396
|
+
// #region Private Methods
|
|
2397
|
+
/**
|
|
2398
|
+
* ID extrahieren
|
|
2399
|
+
* @param valueString String bei welchem die ID Extrahiert werden soll
|
|
2400
|
+
*/
|
|
2401
|
+
extractId(valueString) {
|
|
2402
|
+
return valueString.split(':')[0];
|
|
2309
2403
|
}
|
|
2310
2404
|
/**
|
|
2311
2405
|
* Nimmt das ID vom Option
|
|
@@ -2328,45 +2422,48 @@ class SacDropdownCommon extends SacBaseSelectControl {
|
|
|
2328
2422
|
return this._optionMap.has(id) ? this._optionMap.get(id) : valueString;
|
|
2329
2423
|
}
|
|
2330
2424
|
/**
|
|
2331
|
-
*
|
|
2332
|
-
* @param
|
|
2333
|
-
*/
|
|
2334
|
-
extractId(valueString) {
|
|
2335
|
-
return valueString.split(':')[0];
|
|
2336
|
-
}
|
|
2337
|
-
/**
|
|
2338
|
-
* Validator
|
|
2339
|
-
* @param c Control Instanz
|
|
2425
|
+
* Setzt den Selected Value auf dem Control
|
|
2426
|
+
* @param value Value
|
|
2340
2427
|
*/
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2428
|
+
setSelectedValue(value) {
|
|
2429
|
+
// Select Item aus Control lesen
|
|
2430
|
+
const selectItem = this.elementRef.nativeElement.getElementsByTagName('select')[0];
|
|
2431
|
+
/**
|
|
2432
|
+
* Id vom Select Item
|
|
2433
|
+
*/
|
|
2434
|
+
const id = this.getOptionId(value);
|
|
2435
|
+
/**
|
|
2436
|
+
* Value String
|
|
2437
|
+
*/
|
|
2438
|
+
const valueString = _buildValueString(id, value);
|
|
2439
|
+
if (selectItem !== undefined) {
|
|
2440
|
+
this.renderer.setProperty(selectItem, 'value', valueString);
|
|
2345
2441
|
}
|
|
2346
|
-
return error;
|
|
2347
2442
|
}
|
|
2348
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDropdownCommon, deps: [{ token:
|
|
2349
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacDropdownCommon, inputs: { emptylabel: "emptylabel", emptyvalue: "emptyvalue",
|
|
2443
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDropdownCommon, deps: [{ token: SacFormLayoutCommon, host: true }, { token: i0.Injector }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2444
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacDropdownCommon, inputs: { emptylabel: "emptylabel", emptyvalue: "emptyvalue", validationmessagerequired: "validationmessagerequired", validationmessagesummaryrequired: "validationmessagesummaryrequired", comparewith: "comparewith" }, usesInheritance: true, ngImport: i0 }); }
|
|
2350
2445
|
}
|
|
2351
2446
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDropdownCommon, decorators: [{
|
|
2352
2447
|
type: Directive
|
|
2353
|
-
}], ctorParameters: function () { return [{ type:
|
|
2448
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
2354
2449
|
type: Host
|
|
2355
2450
|
}] }, { type: i0.Injector }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { emptylabel: [{
|
|
2356
2451
|
type: Input
|
|
2357
2452
|
}], emptyvalue: [{
|
|
2358
2453
|
type: Input
|
|
2359
|
-
}], comparewith: [{
|
|
2360
|
-
type: Input
|
|
2361
2454
|
}], validationmessagerequired: [{
|
|
2362
2455
|
type: Input
|
|
2363
2456
|
}], validationmessagesummaryrequired: [{
|
|
2364
2457
|
type: Input
|
|
2458
|
+
}], comparewith: [{
|
|
2459
|
+
type: Input
|
|
2365
2460
|
}] } });
|
|
2366
2461
|
/**
|
|
2367
2462
|
* SacDropdownOption-Klasse
|
|
2368
2463
|
*/
|
|
2369
2464
|
class SacDropdownOptionCommon {
|
|
2465
|
+
// #endregion Properties
|
|
2466
|
+
// #region Constructors
|
|
2370
2467
|
/**
|
|
2371
2468
|
* Konstruktor
|
|
2372
2469
|
* @param _element Referenz auf HTML Element
|
|
@@ -2377,6 +2474,7 @@ class SacDropdownOptionCommon {
|
|
|
2377
2474
|
this._element = _element;
|
|
2378
2475
|
this._renderer = _renderer;
|
|
2379
2476
|
this._dropdown = _dropdown;
|
|
2477
|
+
// #region Properties
|
|
2380
2478
|
/**
|
|
2381
2479
|
* ID-String
|
|
2382
2480
|
*/
|
|
@@ -2385,6 +2483,8 @@ class SacDropdownOptionCommon {
|
|
|
2385
2483
|
this.id = this._dropdown.registerOption();
|
|
2386
2484
|
}
|
|
2387
2485
|
}
|
|
2486
|
+
// #endregion Constructors
|
|
2487
|
+
// #region Public Getters And Setters
|
|
2388
2488
|
/**
|
|
2389
2489
|
* Option ngValue
|
|
2390
2490
|
*/
|
|
@@ -2403,6 +2503,8 @@ class SacDropdownOptionCommon {
|
|
|
2403
2503
|
set value(value) {
|
|
2404
2504
|
this._setElementValue(value);
|
|
2405
2505
|
}
|
|
2506
|
+
// #endregion Public Getters And Setters
|
|
2507
|
+
// #region Public Methods
|
|
2406
2508
|
/**
|
|
2407
2509
|
* Den Wert vom Option-Element einstellen
|
|
2408
2510
|
* @param value Wert
|
|
@@ -2428,6 +2530,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2428
2530
|
}], value: [{
|
|
2429
2531
|
type: Input
|
|
2430
2532
|
}] } });
|
|
2533
|
+
// #endregion Classes
|
|
2534
|
+
// #region Functions
|
|
2535
|
+
/**
|
|
2536
|
+
* Function um ein Key Value Pair für das Dropdown zu erzeugen
|
|
2537
|
+
* @param id ID
|
|
2538
|
+
* @param value Wert der an das Element gebunden werden soll
|
|
2539
|
+
*/
|
|
2540
|
+
function _buildValueString(id, value) {
|
|
2541
|
+
// Wenn ID null ist Object zurückgeben
|
|
2542
|
+
if (id == null) {
|
|
2543
|
+
return `${value}`;
|
|
2544
|
+
}
|
|
2545
|
+
// Mapping Objekt zu String
|
|
2546
|
+
if (value && typeof value === 'object') {
|
|
2547
|
+
value = 'Object';
|
|
2548
|
+
}
|
|
2549
|
+
// String als ID
|
|
2550
|
+
return `${id}: ${value}`.slice(0, 50);
|
|
2551
|
+
}
|
|
2431
2552
|
|
|
2432
2553
|
/**
|
|
2433
2554
|
* Basis Komponente für SacListboxOption
|
|
@@ -2584,20 +2705,133 @@ class SacListboxCommon extends SacBaseSelectControl {
|
|
|
2584
2705
|
const index = this.optionlist.indexOf(option);
|
|
2585
2706
|
this.optionlist.splice(index, 1);
|
|
2586
2707
|
}
|
|
2587
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacListboxCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2588
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacListboxCommon, inputs: { rowsize: "rowsize", validationmessagerequired: "validationmessagerequired", validationmessagesummaryrequired: "validationmessagesummaryrequired" }, viewQueries: [{ propertyName: "contentOptions", predicate: SacListboxOptionCommon, descendants: true }], usesInheritance: true, ngImport: i0 }); }
|
|
2708
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacListboxCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2709
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacListboxCommon, inputs: { rowsize: "rowsize", validationmessagerequired: "validationmessagerequired", validationmessagesummaryrequired: "validationmessagesummaryrequired" }, viewQueries: [{ propertyName: "contentOptions", predicate: SacListboxOptionCommon, descendants: true }], usesInheritance: true, ngImport: i0 }); }
|
|
2710
|
+
}
|
|
2711
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacListboxCommon, decorators: [{
|
|
2712
|
+
type: Directive
|
|
2713
|
+
}], propDecorators: { rowsize: [{
|
|
2714
|
+
type: Input
|
|
2715
|
+
}], validationmessagerequired: [{
|
|
2716
|
+
type: Input
|
|
2717
|
+
}], validationmessagesummaryrequired: [{
|
|
2718
|
+
type: Input
|
|
2719
|
+
}], contentOptions: [{
|
|
2720
|
+
type: ViewChildren,
|
|
2721
|
+
args: [SacListboxOptionCommon]
|
|
2722
|
+
}] } });
|
|
2723
|
+
|
|
2724
|
+
/**
|
|
2725
|
+
* Base component for SacTab
|
|
2726
|
+
*/
|
|
2727
|
+
class SacTabCommon {
|
|
2728
|
+
constructor() {
|
|
2729
|
+
/**
|
|
2730
|
+
* control name
|
|
2731
|
+
*/
|
|
2732
|
+
this.name = '';
|
|
2733
|
+
/**
|
|
2734
|
+
* dispose tabs when they are hidden
|
|
2735
|
+
*/
|
|
2736
|
+
this.unloadtabitemswhenhidden = null;
|
|
2737
|
+
/**
|
|
2738
|
+
* Event when new tab is selected
|
|
2739
|
+
*/
|
|
2740
|
+
this.tabselected = new EventEmitter();
|
|
2741
|
+
}
|
|
2742
|
+
// #region Control initialisieren
|
|
2743
|
+
/**
|
|
2744
|
+
* AfterContentInit Event
|
|
2745
|
+
*/
|
|
2746
|
+
ngAfterContentInit() {
|
|
2747
|
+
this.initTabs();
|
|
2748
|
+
}
|
|
2749
|
+
/**
|
|
2750
|
+
* Initialisiert die Tabs
|
|
2751
|
+
*/
|
|
2752
|
+
initTabs() {
|
|
2753
|
+
const activeTab = this.tabItems().filter((tab) => tab.active);
|
|
2754
|
+
this.tabItems().forEach((itm) => {
|
|
2755
|
+
if (this.unloadtabitemswhenhidden !== null) {
|
|
2756
|
+
itm.unloadwhenhidden = this.unloadtabitemswhenhidden;
|
|
2757
|
+
}
|
|
2758
|
+
});
|
|
2759
|
+
if (activeTab.length === 0) {
|
|
2760
|
+
this.selectTab(this.tabItems()[0]);
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
// #endregion
|
|
2764
|
+
/**
|
|
2765
|
+
* select new tab
|
|
2766
|
+
* @param tab tab that should be selected
|
|
2767
|
+
*/
|
|
2768
|
+
selectTab(tab) {
|
|
2769
|
+
// Cancel if Selected Tab is disabled
|
|
2770
|
+
if (tab.disabled) {
|
|
2771
|
+
return;
|
|
2772
|
+
}
|
|
2773
|
+
this.tabItems().forEach((item) => (item.active = false));
|
|
2774
|
+
tab.active = true;
|
|
2775
|
+
this.tabselected.emit(tab.id);
|
|
2776
|
+
}
|
|
2777
|
+
/**
|
|
2778
|
+
* get id of tab button
|
|
2779
|
+
* @param tabitemid id of tab
|
|
2780
|
+
*/
|
|
2781
|
+
GetTabItemButtonId(tabitemid) {
|
|
2782
|
+
return this.name + '_' + tabitemid;
|
|
2783
|
+
}
|
|
2784
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTabCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2785
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacTabCommon, inputs: { name: "name", tablabeltemplate: "tablabeltemplate", unloadtabitemswhenhidden: "unloadtabitemswhenhidden" }, outputs: { tabselected: "tabselected" }, ngImport: i0 }); }
|
|
2589
2786
|
}
|
|
2590
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
2787
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTabCommon, decorators: [{
|
|
2591
2788
|
type: Directive
|
|
2592
|
-
}], propDecorators: {
|
|
2789
|
+
}], propDecorators: { name: [{
|
|
2593
2790
|
type: Input
|
|
2594
|
-
}],
|
|
2791
|
+
}], tablabeltemplate: [{
|
|
2595
2792
|
type: Input
|
|
2596
|
-
}],
|
|
2793
|
+
}], unloadtabitemswhenhidden: [{
|
|
2597
2794
|
type: Input
|
|
2598
|
-
}],
|
|
2599
|
-
type:
|
|
2600
|
-
|
|
2795
|
+
}], tabselected: [{
|
|
2796
|
+
type: Output
|
|
2797
|
+
}] } });
|
|
2798
|
+
|
|
2799
|
+
/**
|
|
2800
|
+
* Die Basis Komponente für SacTabItem
|
|
2801
|
+
*/
|
|
2802
|
+
class SacTabItemCommon {
|
|
2803
|
+
constructor() {
|
|
2804
|
+
/**
|
|
2805
|
+
* Boolean Property prüft ob das Tab aktiv ist
|
|
2806
|
+
*/
|
|
2807
|
+
this.active = false;
|
|
2808
|
+
/**
|
|
2809
|
+
* Boolean Property prüft ob das Tab disabled ist
|
|
2810
|
+
*/
|
|
2811
|
+
this.disabled = false;
|
|
2812
|
+
/**
|
|
2813
|
+
* Das Input property ekzeptiert boolen Wert. Default ist true. Definiert, ob die Komponente hidden sein sollte.
|
|
2814
|
+
*/
|
|
2815
|
+
this.unloadwhenhidden = true;
|
|
2816
|
+
}
|
|
2817
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTabItemCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2818
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacTabItemCommon, inputs: { active: "active", disabled: "disabled", id: "id", label: "label", unloadwhenhidden: "unloadwhenhidden" }, queries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, static: true }], ngImport: i0 }); }
|
|
2819
|
+
}
|
|
2820
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTabItemCommon, decorators: [{
|
|
2821
|
+
type: Directive
|
|
2822
|
+
}], propDecorators: { active: [{
|
|
2823
|
+
type: Input
|
|
2824
|
+
}], disabled: [{
|
|
2825
|
+
type: Input
|
|
2826
|
+
}], id: [{
|
|
2827
|
+
type: Input
|
|
2828
|
+
}], label: [{
|
|
2829
|
+
type: Input
|
|
2830
|
+
}], unloadwhenhidden: [{
|
|
2831
|
+
type: Input
|
|
2832
|
+
}], templateRef: [{
|
|
2833
|
+
type: ContentChild,
|
|
2834
|
+
args: [TemplateRef, { static: true }]
|
|
2601
2835
|
}] } });
|
|
2602
2836
|
|
|
2603
2837
|
/**
|
|
@@ -2722,119 +2956,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2722
2956
|
type: Input
|
|
2723
2957
|
}] } });
|
|
2724
2958
|
|
|
2725
|
-
/**
|
|
2726
|
-
* Base component for SacTab
|
|
2727
|
-
*/
|
|
2728
|
-
class SacTabCommon {
|
|
2729
|
-
constructor() {
|
|
2730
|
-
/**
|
|
2731
|
-
* control name
|
|
2732
|
-
*/
|
|
2733
|
-
this.name = '';
|
|
2734
|
-
/**
|
|
2735
|
-
* dispose tabs when they are hidden
|
|
2736
|
-
*/
|
|
2737
|
-
this.unloadtabitemswhenhidden = null;
|
|
2738
|
-
/**
|
|
2739
|
-
* Event when new tab is selected
|
|
2740
|
-
*/
|
|
2741
|
-
this.tabselected = new EventEmitter();
|
|
2742
|
-
}
|
|
2743
|
-
// #region Control initialisieren
|
|
2744
|
-
/**
|
|
2745
|
-
* AfterContentInit Event
|
|
2746
|
-
*/
|
|
2747
|
-
ngAfterContentInit() {
|
|
2748
|
-
this.initTabs();
|
|
2749
|
-
}
|
|
2750
|
-
/**
|
|
2751
|
-
* Initialisiert die Tabs
|
|
2752
|
-
*/
|
|
2753
|
-
initTabs() {
|
|
2754
|
-
const activeTab = this.tabItems().filter((tab) => tab.active);
|
|
2755
|
-
this.tabItems().forEach((itm) => {
|
|
2756
|
-
if (this.unloadtabitemswhenhidden !== null) {
|
|
2757
|
-
itm.unloadwhenhidden = this.unloadtabitemswhenhidden;
|
|
2758
|
-
}
|
|
2759
|
-
});
|
|
2760
|
-
if (activeTab.length === 0) {
|
|
2761
|
-
this.selectTab(this.tabItems()[0]);
|
|
2762
|
-
}
|
|
2763
|
-
}
|
|
2764
|
-
// #endregion
|
|
2765
|
-
/**
|
|
2766
|
-
* select new tab
|
|
2767
|
-
* @param tab tab that should be selected
|
|
2768
|
-
*/
|
|
2769
|
-
selectTab(tab) {
|
|
2770
|
-
// Cancel if Selected Tab is disabled
|
|
2771
|
-
if (tab.disabled) {
|
|
2772
|
-
return;
|
|
2773
|
-
}
|
|
2774
|
-
this.tabItems().forEach((item) => (item.active = false));
|
|
2775
|
-
tab.active = true;
|
|
2776
|
-
this.tabselected.emit(tab.id);
|
|
2777
|
-
}
|
|
2778
|
-
/**
|
|
2779
|
-
* get id of tab button
|
|
2780
|
-
* @param tabitemid id of tab
|
|
2781
|
-
*/
|
|
2782
|
-
GetTabItemButtonId(tabitemid) {
|
|
2783
|
-
return this.name + '_' + tabitemid;
|
|
2784
|
-
}
|
|
2785
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTabCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2786
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacTabCommon, inputs: { name: "name", tablabeltemplate: "tablabeltemplate", unloadtabitemswhenhidden: "unloadtabitemswhenhidden" }, outputs: { tabselected: "tabselected" }, ngImport: i0 }); }
|
|
2787
|
-
}
|
|
2788
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTabCommon, decorators: [{
|
|
2789
|
-
type: Directive
|
|
2790
|
-
}], propDecorators: { name: [{
|
|
2791
|
-
type: Input
|
|
2792
|
-
}], tablabeltemplate: [{
|
|
2793
|
-
type: Input
|
|
2794
|
-
}], unloadtabitemswhenhidden: [{
|
|
2795
|
-
type: Input
|
|
2796
|
-
}], tabselected: [{
|
|
2797
|
-
type: Output
|
|
2798
|
-
}] } });
|
|
2799
|
-
|
|
2800
|
-
/**
|
|
2801
|
-
* Die Basis Komponente für SacTabItem
|
|
2802
|
-
*/
|
|
2803
|
-
class SacTabItemCommon {
|
|
2804
|
-
constructor() {
|
|
2805
|
-
/**
|
|
2806
|
-
* Boolean Property prüft ob das Tab aktiv ist
|
|
2807
|
-
*/
|
|
2808
|
-
this.active = false;
|
|
2809
|
-
/**
|
|
2810
|
-
* Boolean Property prüft ob das Tab disabled ist
|
|
2811
|
-
*/
|
|
2812
|
-
this.disabled = false;
|
|
2813
|
-
/**
|
|
2814
|
-
* Das Input property ekzeptiert boolen Wert. Default ist true. Definiert, ob die Komponente hidden sein sollte.
|
|
2815
|
-
*/
|
|
2816
|
-
this.unloadwhenhidden = true;
|
|
2817
|
-
}
|
|
2818
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTabItemCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2819
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacTabItemCommon, inputs: { active: "active", disabled: "disabled", id: "id", label: "label", unloadwhenhidden: "unloadwhenhidden" }, queries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true, static: true }], ngImport: i0 }); }
|
|
2820
|
-
}
|
|
2821
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTabItemCommon, decorators: [{
|
|
2822
|
-
type: Directive
|
|
2823
|
-
}], propDecorators: { active: [{
|
|
2824
|
-
type: Input
|
|
2825
|
-
}], disabled: [{
|
|
2826
|
-
type: Input
|
|
2827
|
-
}], id: [{
|
|
2828
|
-
type: Input
|
|
2829
|
-
}], label: [{
|
|
2830
|
-
type: Input
|
|
2831
|
-
}], unloadwhenhidden: [{
|
|
2832
|
-
type: Input
|
|
2833
|
-
}], templateRef: [{
|
|
2834
|
-
type: ContentChild,
|
|
2835
|
-
args: [TemplateRef, { static: true }]
|
|
2836
|
-
}] } });
|
|
2837
|
-
|
|
2838
2959
|
/**
|
|
2839
2960
|
* Abstract Klasse für SacInputBase. Extendes SacBaseModelControl
|
|
2840
2961
|
*/
|
|
@@ -2842,6 +2963,14 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2842
2963
|
constructor() {
|
|
2843
2964
|
super(...arguments);
|
|
2844
2965
|
// #region Properties
|
|
2966
|
+
/**
|
|
2967
|
+
* Erlaubte Zeichen bei der Eingabe
|
|
2968
|
+
*/
|
|
2969
|
+
this.allowedchars = '';
|
|
2970
|
+
/**
|
|
2971
|
+
* Autofill aktivieren oder deaktivieren
|
|
2972
|
+
*/
|
|
2973
|
+
this.disableautocomplete = false;
|
|
2845
2974
|
/**
|
|
2846
2975
|
* Definiert das Control als Required
|
|
2847
2976
|
*/
|
|
@@ -2850,10 +2979,6 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2850
2979
|
* TextBox Placeholder
|
|
2851
2980
|
*/
|
|
2852
2981
|
this.placeholder = null;
|
|
2853
|
-
/**
|
|
2854
|
-
* Erlaubte Zeichen bei der Eingabe
|
|
2855
|
-
*/
|
|
2856
|
-
this.allowedchars = '';
|
|
2857
2982
|
/**
|
|
2858
2983
|
* Macht das Input readonly
|
|
2859
2984
|
*/
|
|
@@ -2862,13 +2987,9 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2862
2987
|
* Text welcher als Tooltip angezeigt wird.
|
|
2863
2988
|
*/
|
|
2864
2989
|
this.tooltiptext = '';
|
|
2865
|
-
/**
|
|
2866
|
-
* Autofill aktivieren oder deaktivieren
|
|
2867
|
-
*/
|
|
2868
|
-
this.disableautocomplete = false;
|
|
2869
2990
|
}
|
|
2870
|
-
// #endregion
|
|
2871
|
-
// #region
|
|
2991
|
+
// #endregion Properties
|
|
2992
|
+
// #region Public Methods
|
|
2872
2993
|
/**
|
|
2873
2994
|
* Methode validiert Input wenn KeyPress-Event passiert
|
|
2874
2995
|
*/
|
|
@@ -2888,8 +3009,8 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2888
3009
|
event.preventDefault();
|
|
2889
3010
|
}
|
|
2890
3011
|
}
|
|
2891
|
-
// #endregion
|
|
2892
|
-
// #region Protected
|
|
3012
|
+
// #endregion Public Methods
|
|
3013
|
+
// #region Protected Methods
|
|
2893
3014
|
/**
|
|
2894
3015
|
* Methode validiert wenn ein Drück-Event passiert
|
|
2895
3016
|
*/
|
|
@@ -2897,15 +3018,17 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2897
3018
|
return true;
|
|
2898
3019
|
}
|
|
2899
3020
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacInputBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2900
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacInputBase, inputs: {
|
|
3021
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacInputBase, inputs: { allowedchars: "allowedchars", disableautocomplete: "disableautocomplete", isrequired: "isrequired", placeholder: "placeholder", readonly: "readonly", regexvalidation: "regexvalidation", tooltiptext: "tooltiptext" }, usesInheritance: true, ngImport: i0 }); }
|
|
2901
3022
|
}
|
|
2902
3023
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacInputBase, decorators: [{
|
|
2903
3024
|
type: Directive
|
|
2904
|
-
}], propDecorators: {
|
|
3025
|
+
}], propDecorators: { allowedchars: [{
|
|
2905
3026
|
type: Input
|
|
2906
|
-
}],
|
|
3027
|
+
}], disableautocomplete: [{
|
|
3028
|
+
type: Input
|
|
3029
|
+
}], isrequired: [{
|
|
2907
3030
|
type: Input
|
|
2908
|
-
}],
|
|
3031
|
+
}], placeholder: [{
|
|
2909
3032
|
type: Input
|
|
2910
3033
|
}], readonly: [{
|
|
2911
3034
|
type: Input
|
|
@@ -2913,8 +3036,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2913
3036
|
type: Input
|
|
2914
3037
|
}], tooltiptext: [{
|
|
2915
3038
|
type: Input
|
|
2916
|
-
}], disableautocomplete: [{
|
|
2917
|
-
type: Input
|
|
2918
3039
|
}] } });
|
|
2919
3040
|
|
|
2920
3041
|
/**
|
|
@@ -3043,56 +3164,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3043
3164
|
class SacInputDecimalCommon extends SacInputBase {
|
|
3044
3165
|
constructor() {
|
|
3045
3166
|
super(...arguments);
|
|
3167
|
+
// #region Properties
|
|
3046
3168
|
/**
|
|
3047
3169
|
* Definiert das Negative Werte erlaubt sind
|
|
3048
3170
|
*/
|
|
3049
3171
|
this.allownegativ = false;
|
|
3050
|
-
/**
|
|
3051
|
-
* Definiert den minimalen Wert
|
|
3052
|
-
*/
|
|
3053
|
-
this.minvalue = undefined;
|
|
3054
3172
|
/**
|
|
3055
3173
|
* Definiert den maximalen Wert
|
|
3056
3174
|
*/
|
|
3057
3175
|
this.maxvalue = undefined;
|
|
3058
3176
|
/**
|
|
3059
|
-
*
|
|
3177
|
+
* Definiert den minimalen Wert
|
|
3060
3178
|
*/
|
|
3061
|
-
this.
|
|
3179
|
+
this.minvalue = undefined;
|
|
3062
3180
|
/**
|
|
3063
|
-
* Resource Key für Validation Message
|
|
3181
|
+
* Resource Key für Validation Message MaxValue bei Control
|
|
3064
3182
|
*/
|
|
3065
|
-
this.
|
|
3183
|
+
this.validationmessagemaxvalue = 'VALIDATION_ERROR_MAXVALUE';
|
|
3066
3184
|
/**
|
|
3067
3185
|
* Resource Key für Validation Message MinValue bei Control
|
|
3068
3186
|
*/
|
|
3069
3187
|
this.validationmessageminvalue = 'VALIDATION_ERROR_MINVALUE';
|
|
3070
3188
|
/**
|
|
3071
|
-
* Resource Key für Validation Message
|
|
3072
|
-
*/
|
|
3073
|
-
this.validationmessagesummaryminvalue = 'VALIDATION_ERROR_SUMMARY_MINVALUE';
|
|
3074
|
-
/**
|
|
3075
|
-
* Resource Key für Validation Message MaxValue bei Control
|
|
3189
|
+
* Resource Key für Validation Message Required bei Control
|
|
3076
3190
|
*/
|
|
3077
|
-
this.
|
|
3191
|
+
this.validationmessagerequired = 'VALIDATION_ERROR_REQUIRED';
|
|
3078
3192
|
/**
|
|
3079
3193
|
* Resource Key für Validation Message MaxValue in Validation Summary
|
|
3080
3194
|
*/
|
|
3081
3195
|
this.validationmessagesummarymaxvalue = 'VALIDATION_ERROR_SUMMARY_MAXVALUE';
|
|
3196
|
+
/**
|
|
3197
|
+
* Resource Key für Validation Message MinValue in Validation Summary
|
|
3198
|
+
*/
|
|
3199
|
+
this.validationmessagesummaryminvalue = 'VALIDATION_ERROR_SUMMARY_MINVALUE';
|
|
3200
|
+
/**
|
|
3201
|
+
* Resource Key für Validation Message Required in Validation Summary
|
|
3202
|
+
*/
|
|
3203
|
+
this.validationmessagesummaryrequired = 'VALIDATION_ERROR_SUMMARY_REQUIRED';
|
|
3082
3204
|
}
|
|
3205
|
+
// #endregion Properties
|
|
3206
|
+
// #region Public Methods
|
|
3083
3207
|
/**
|
|
3084
|
-
* Methode
|
|
3208
|
+
* Methode validiert ob der Wert entspricht den gegebenen Kriterien
|
|
3085
3209
|
*/
|
|
3086
|
-
|
|
3087
|
-
super.OnClassInit();
|
|
3210
|
+
validateData(c) {
|
|
3088
3211
|
/**
|
|
3089
|
-
*
|
|
3212
|
+
* Error Meldung, die angezeigt wird, wenn die Kriterien nicht erfüllt sind
|
|
3090
3213
|
*/
|
|
3091
|
-
|
|
3092
|
-
if (this.
|
|
3093
|
-
|
|
3214
|
+
let error = null;
|
|
3215
|
+
if (this.isrequired) {
|
|
3216
|
+
error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
3217
|
+
}
|
|
3218
|
+
if (error === null &&
|
|
3219
|
+
this.minvalue !== undefined &&
|
|
3220
|
+
this.minvalue !== null) {
|
|
3221
|
+
error = Validation.minValue(this.minvalue, this.validationmessageminvalue, this.validationmessagesummaryminvalue)(c);
|
|
3094
3222
|
}
|
|
3223
|
+
if (error === null &&
|
|
3224
|
+
this.maxvalue !== undefined &&
|
|
3225
|
+
this.maxvalue !== null) {
|
|
3226
|
+
error = Validation.maxValue(this.maxvalue, this.validationmessagemaxvalue, this.validationmessagesummarymaxvalue)(c);
|
|
3227
|
+
}
|
|
3228
|
+
return error;
|
|
3095
3229
|
}
|
|
3230
|
+
// #endregion Public Methods
|
|
3231
|
+
// #region Protected Methods
|
|
3096
3232
|
/**
|
|
3097
3233
|
* Konvertiert den Wert des Inputs
|
|
3098
3234
|
*/
|
|
@@ -3112,6 +3248,19 @@ class SacInputDecimalCommon extends SacInputBase {
|
|
|
3112
3248
|
}
|
|
3113
3249
|
}
|
|
3114
3250
|
}
|
|
3251
|
+
/**
|
|
3252
|
+
* Methode die erzeugt den Control in Abhängigkeit davon, ob negative Were erlaubt sing oder nicht
|
|
3253
|
+
*/
|
|
3254
|
+
OnClassInit() {
|
|
3255
|
+
super.OnClassInit();
|
|
3256
|
+
/**
|
|
3257
|
+
* Definiert die Werte die erlaubt sind
|
|
3258
|
+
*/
|
|
3259
|
+
this.allowedchars = '0123456789' + this.GetDecimalSymbol();
|
|
3260
|
+
if (this.allownegativ) {
|
|
3261
|
+
this.allowedchars = this.allowedchars + '-';
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3115
3264
|
/**
|
|
3116
3265
|
* Methode validiert ob der Wert entspricht den gegebenen Kriterien wenn ein Key gedrückt wird
|
|
3117
3266
|
*/
|
|
@@ -3135,52 +3284,29 @@ class SacInputDecimalCommon extends SacInputBase {
|
|
|
3135
3284
|
return true;
|
|
3136
3285
|
}
|
|
3137
3286
|
}
|
|
3138
|
-
/**
|
|
3139
|
-
* Methode validiert ob der Wert entspricht den gegebenen Kriterien
|
|
3140
|
-
*/
|
|
3141
|
-
validateData(c) {
|
|
3142
|
-
/**
|
|
3143
|
-
* Error Meldung, die angezeigt wird, wenn die Kriterien nicht erfüllt sind
|
|
3144
|
-
*/
|
|
3145
|
-
let error = null;
|
|
3146
|
-
if (this.isrequired) {
|
|
3147
|
-
error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
3148
|
-
}
|
|
3149
|
-
if (error === null &&
|
|
3150
|
-
this.minvalue !== undefined &&
|
|
3151
|
-
this.minvalue !== null) {
|
|
3152
|
-
error = Validation.minValue(this.minvalue, this.validationmessageminvalue, this.validationmessagesummaryminvalue)(c);
|
|
3153
|
-
}
|
|
3154
|
-
if (error === null &&
|
|
3155
|
-
this.maxvalue !== undefined &&
|
|
3156
|
-
this.maxvalue !== null) {
|
|
3157
|
-
error = Validation.maxValue(this.maxvalue, this.validationmessagemaxvalue, this.validationmessagesummarymaxvalue)(c);
|
|
3158
|
-
}
|
|
3159
|
-
return error;
|
|
3160
|
-
}
|
|
3161
3287
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacInputDecimalCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3162
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacInputDecimalCommon, inputs: { allownegativ: "allownegativ",
|
|
3288
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacInputDecimalCommon, inputs: { allownegativ: "allownegativ", maxvalue: "maxvalue", minvalue: "minvalue", validationmessagemaxvalue: "validationmessagemaxvalue", validationmessageminvalue: "validationmessageminvalue", validationmessagerequired: "validationmessagerequired", validationmessagesummarymaxvalue: "validationmessagesummarymaxvalue", validationmessagesummaryminvalue: "validationmessagesummaryminvalue", validationmessagesummaryrequired: "validationmessagesummaryrequired" }, usesInheritance: true, ngImport: i0 }); }
|
|
3163
3289
|
}
|
|
3164
3290
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacInputDecimalCommon, decorators: [{
|
|
3165
3291
|
type: Directive
|
|
3166
3292
|
}], propDecorators: { allownegativ: [{
|
|
3167
3293
|
type: Input
|
|
3168
|
-
}], minvalue: [{
|
|
3169
|
-
type: Input
|
|
3170
3294
|
}], maxvalue: [{
|
|
3171
3295
|
type: Input
|
|
3172
|
-
}],
|
|
3296
|
+
}], minvalue: [{
|
|
3173
3297
|
type: Input
|
|
3174
|
-
}],
|
|
3298
|
+
}], validationmessagemaxvalue: [{
|
|
3175
3299
|
type: Input
|
|
3176
3300
|
}], validationmessageminvalue: [{
|
|
3177
3301
|
type: Input
|
|
3178
|
-
}],
|
|
3179
|
-
type: Input
|
|
3180
|
-
}], validationmessagemaxvalue: [{
|
|
3302
|
+
}], validationmessagerequired: [{
|
|
3181
3303
|
type: Input
|
|
3182
3304
|
}], validationmessagesummarymaxvalue: [{
|
|
3183
3305
|
type: Input
|
|
3306
|
+
}], validationmessagesummaryminvalue: [{
|
|
3307
|
+
type: Input
|
|
3308
|
+
}], validationmessagesummaryrequired: [{
|
|
3309
|
+
type: Input
|
|
3184
3310
|
}] } });
|
|
3185
3311
|
|
|
3186
3312
|
/**
|
|
@@ -3672,6 +3798,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3672
3798
|
type: Input
|
|
3673
3799
|
}] } });
|
|
3674
3800
|
|
|
3801
|
+
/**
|
|
3802
|
+
* Base Grid Action Button
|
|
3803
|
+
*/
|
|
3804
|
+
class SacGridButtonCommon {
|
|
3805
|
+
constructor() {
|
|
3806
|
+
/**
|
|
3807
|
+
* Input Property für Styling des Buttons. Deffiniert die Css Klassen des Buttons
|
|
3808
|
+
*/
|
|
3809
|
+
this.iconstyle = '';
|
|
3810
|
+
/**
|
|
3811
|
+
* Button ist deaktiviert
|
|
3812
|
+
*/
|
|
3813
|
+
this._isdisabledvalue = false;
|
|
3814
|
+
/**
|
|
3815
|
+
* Event wenn auf den Button geklickt wird
|
|
3816
|
+
*/
|
|
3817
|
+
this.clicked = new EventEmitter();
|
|
3818
|
+
}
|
|
3819
|
+
/**
|
|
3820
|
+
* Deaktivieren von Buttons
|
|
3821
|
+
* @param v Deaktiviert den Button
|
|
3822
|
+
* @return Definiert ob der Button deaktiviert ist
|
|
3823
|
+
*/
|
|
3824
|
+
set isdisabled(v) {
|
|
3825
|
+
if (v === null || v === undefined || typeof v === 'boolean') {
|
|
3826
|
+
this._isdisabledvalue = v;
|
|
3827
|
+
}
|
|
3828
|
+
else {
|
|
3829
|
+
this._isdisabledvalue = v === 'true';
|
|
3830
|
+
}
|
|
3831
|
+
}
|
|
3832
|
+
get isdisabled() {
|
|
3833
|
+
return this._isdisabledvalue;
|
|
3834
|
+
}
|
|
3835
|
+
/**
|
|
3836
|
+
* Die Methode wird das cklickaction Emitter aktivieren
|
|
3837
|
+
*/
|
|
3838
|
+
callaction() {
|
|
3839
|
+
if (!this._isdisabledvalue) {
|
|
3840
|
+
this.clicked.emit(this.iconstyle);
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridButtonCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3844
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacGridButtonCommon, inputs: { iconstyle: "iconstyle", icon: "icon", isdisabled: "isdisabled" }, outputs: { clicked: "clicked" }, ngImport: i0 }); }
|
|
3845
|
+
}
|
|
3846
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridButtonCommon, decorators: [{
|
|
3847
|
+
type: Directive
|
|
3848
|
+
}], propDecorators: { iconstyle: [{
|
|
3849
|
+
type: Input
|
|
3850
|
+
}], icon: [{
|
|
3851
|
+
type: Input
|
|
3852
|
+
}], isdisabled: [{
|
|
3853
|
+
type: Input
|
|
3854
|
+
}], clicked: [{
|
|
3855
|
+
type: Output
|
|
3856
|
+
}] } });
|
|
3857
|
+
|
|
3675
3858
|
/**
|
|
3676
3859
|
* Enum für Icon Types in Componenten
|
|
3677
3860
|
*/
|
|
@@ -4349,6 +4532,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4349
4532
|
type: Directive
|
|
4350
4533
|
}], ctorParameters: function () { return [{ type: SacGridCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; } });
|
|
4351
4534
|
|
|
4535
|
+
/**
|
|
4536
|
+
* Basis Komponente für SacGridImage
|
|
4537
|
+
*/
|
|
4538
|
+
class SacGridImageCommon {
|
|
4539
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridImageCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4540
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacGridImageCommon, inputs: { iconstyle: "iconstyle" }, ngImport: i0 }); }
|
|
4541
|
+
}
|
|
4542
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridImageCommon, decorators: [{
|
|
4543
|
+
type: Directive
|
|
4544
|
+
}], propDecorators: { iconstyle: [{
|
|
4545
|
+
type: Input
|
|
4546
|
+
}] } });
|
|
4547
|
+
|
|
4352
4548
|
/**
|
|
4353
4549
|
* Basiskomponente für Paging
|
|
4354
4550
|
*/
|
|
@@ -4598,76 +4794,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4598
4794
|
type: Output
|
|
4599
4795
|
}] } });
|
|
4600
4796
|
|
|
4601
|
-
/**
|
|
4602
|
-
* Base Grid Action Button
|
|
4603
|
-
*/
|
|
4604
|
-
class SacGridButtonCommon {
|
|
4605
|
-
constructor() {
|
|
4606
|
-
/**
|
|
4607
|
-
* Input Property für Styling des Buttons. Deffiniert die Css Klassen des Buttons
|
|
4608
|
-
*/
|
|
4609
|
-
this.iconstyle = '';
|
|
4610
|
-
/**
|
|
4611
|
-
* Button ist deaktiviert
|
|
4612
|
-
*/
|
|
4613
|
-
this._isdisabledvalue = false;
|
|
4614
|
-
/**
|
|
4615
|
-
* Event wenn auf den Button geklickt wird
|
|
4616
|
-
*/
|
|
4617
|
-
this.clicked = new EventEmitter();
|
|
4618
|
-
}
|
|
4619
|
-
/**
|
|
4620
|
-
* Deaktivieren von Buttons
|
|
4621
|
-
* @param v Deaktiviert den Button
|
|
4622
|
-
* @return Definiert ob der Button deaktiviert ist
|
|
4623
|
-
*/
|
|
4624
|
-
set isdisabled(v) {
|
|
4625
|
-
if (v === null || v === undefined || typeof v === 'boolean') {
|
|
4626
|
-
this._isdisabledvalue = v;
|
|
4627
|
-
}
|
|
4628
|
-
else {
|
|
4629
|
-
this._isdisabledvalue = v === 'true';
|
|
4630
|
-
}
|
|
4631
|
-
}
|
|
4632
|
-
get isdisabled() {
|
|
4633
|
-
return this._isdisabledvalue;
|
|
4634
|
-
}
|
|
4635
|
-
/**
|
|
4636
|
-
* Die Methode wird das cklickaction Emitter aktivieren
|
|
4637
|
-
*/
|
|
4638
|
-
callaction() {
|
|
4639
|
-
if (!this._isdisabledvalue) {
|
|
4640
|
-
this.clicked.emit(this.iconstyle);
|
|
4641
|
-
}
|
|
4642
|
-
}
|
|
4643
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridButtonCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4644
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacGridButtonCommon, inputs: { iconstyle: "iconstyle", icon: "icon", isdisabled: "isdisabled" }, outputs: { clicked: "clicked" }, ngImport: i0 }); }
|
|
4645
|
-
}
|
|
4646
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridButtonCommon, decorators: [{
|
|
4647
|
-
type: Directive
|
|
4648
|
-
}], propDecorators: { iconstyle: [{
|
|
4649
|
-
type: Input
|
|
4650
|
-
}], icon: [{
|
|
4651
|
-
type: Input
|
|
4652
|
-
}], isdisabled: [{
|
|
4653
|
-
type: Input
|
|
4654
|
-
}], clicked: [{
|
|
4655
|
-
type: Output
|
|
4656
|
-
}] } });
|
|
4657
|
-
|
|
4658
|
-
/**
|
|
4659
|
-
* Basis Komponente für SacGridImage
|
|
4660
|
-
*/
|
|
4661
|
-
class SacGridImageCommon {
|
|
4662
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridImageCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4663
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacGridImageCommon, inputs: { iconstyle: "iconstyle" }, ngImport: i0 }); }
|
|
4664
|
-
}
|
|
4665
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridImageCommon, decorators: [{
|
|
4666
|
-
type: Directive
|
|
4667
|
-
}], propDecorators: { iconstyle: [{
|
|
4668
|
-
type: Input
|
|
4669
|
-
}] } });
|
|
4670
|
-
|
|
4671
4797
|
/**
|
|
4672
4798
|
* Moment
|
|
4673
4799
|
*/
|
|
@@ -4676,17 +4802,18 @@ const moment$4 = moment_['default'];
|
|
|
4676
4802
|
* Base Klasse für Date/Time Controls
|
|
4677
4803
|
*/
|
|
4678
4804
|
class SacBaseDateTimeControl extends SacBaseModelControl {
|
|
4679
|
-
// #
|
|
4805
|
+
// #endregion Properties
|
|
4806
|
+
// #region Constructors
|
|
4680
4807
|
/**
|
|
4681
|
-
*
|
|
4682
|
-
* @param
|
|
4683
|
-
* @param injector
|
|
4684
|
-
* @param
|
|
4808
|
+
* Constructor
|
|
4809
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
4810
|
+
* @param injector Injector for injecting services
|
|
4811
|
+
* @param elementRef reference to html element
|
|
4685
4812
|
*/
|
|
4686
|
-
constructor(
|
|
4687
|
-
super(
|
|
4688
|
-
this.
|
|
4689
|
-
|
|
4813
|
+
constructor(formlayout, injector, elementRef) {
|
|
4814
|
+
super(formlayout, injector);
|
|
4815
|
+
this.elementRef = elementRef;
|
|
4816
|
+
// #region Properties
|
|
4690
4817
|
/**
|
|
4691
4818
|
* das property enthielt das Value als string. Default ist ''
|
|
4692
4819
|
*/
|
|
@@ -4694,72 +4821,30 @@ class SacBaseDateTimeControl extends SacBaseModelControl {
|
|
|
4694
4821
|
/**
|
|
4695
4822
|
* Definiert das Control als Required
|
|
4696
4823
|
*/
|
|
4697
|
-
this.isrequired = false;
|
|
4698
|
-
/**
|
|
4699
|
-
* TextBox Placeholder
|
|
4700
|
-
*/
|
|
4701
|
-
this.placeholder = null;
|
|
4702
|
-
/**
|
|
4703
|
-
* Resource Key für Validation Message
|
|
4704
|
-
*/
|
|
4705
|
-
this.
|
|
4706
|
-
/**
|
|
4707
|
-
* Resource Key für Validation Message
|
|
4708
|
-
*/
|
|
4709
|
-
this.
|
|
4710
|
-
/**
|
|
4711
|
-
* Resource Key für Validation Message
|
|
4712
|
-
*/
|
|
4713
|
-
this.
|
|
4714
|
-
/**
|
|
4715
|
-
* Resource Key für Validation Message
|
|
4716
|
-
*/
|
|
4717
|
-
this.
|
|
4718
|
-
}
|
|
4719
|
-
// #endregion
|
|
4720
|
-
/**
|
|
4721
|
-
* Init Event
|
|
4722
|
-
*/
|
|
4723
|
-
ngOnInit() {
|
|
4724
|
-
super.ngOnInit();
|
|
4725
|
-
this.SetDateTimeFormat();
|
|
4726
|
-
}
|
|
4727
|
-
//#endregion
|
|
4728
|
-
//#region Variablen
|
|
4729
|
-
//#endregion
|
|
4730
|
-
// #region Properties
|
|
4731
|
-
//#endregion
|
|
4732
|
-
//#region ValueControlAccess
|
|
4733
|
-
/**
|
|
4734
|
-
* Overwrite WriteValue to Set correct Date Object
|
|
4735
|
-
*/
|
|
4736
|
-
writeValue(value) {
|
|
4737
|
-
if (value === '' || value === null || value === undefined) {
|
|
4738
|
-
// Reset Value String, damit beim Update des Models auch das Input Feld geleert wird.
|
|
4739
|
-
this._valueAsString = '';
|
|
4740
|
-
// Set Internal Property
|
|
4741
|
-
this._value = null;
|
|
4742
|
-
}
|
|
4743
|
-
else {
|
|
4744
|
-
this._value = this.getDate(value).toDate();
|
|
4745
|
-
}
|
|
4746
|
-
super.writeValue(this._value);
|
|
4747
|
-
}
|
|
4748
|
-
/**
|
|
4749
|
-
* JSON Date String in ein UTC DateTime Object konvertieren, welches vom Control verwendete werden kann
|
|
4750
|
-
*/
|
|
4751
|
-
getDate(timestamp) {
|
|
4752
|
-
const date = new Date(timestamp);
|
|
4753
|
-
const year = date.getUTCFullYear();
|
|
4754
|
-
const month = date.getUTCMonth();
|
|
4755
|
-
const day = date.getUTCDate();
|
|
4756
|
-
const hours = date.getUTCHours();
|
|
4757
|
-
const minutes = date.getUTCMinutes();
|
|
4758
|
-
const seconds = date.getUTCSeconds();
|
|
4759
|
-
return moment$4(Date.UTC(year, month, day, hours, minutes, seconds));
|
|
4824
|
+
this.isrequired = false;
|
|
4825
|
+
/**
|
|
4826
|
+
* TextBox Placeholder
|
|
4827
|
+
*/
|
|
4828
|
+
this.placeholder = null;
|
|
4829
|
+
/**
|
|
4830
|
+
* Resource Key für Validation Message DateTimeFormat bei Control
|
|
4831
|
+
*/
|
|
4832
|
+
this.validationmessagedatetimeformat = 'VALIDATION_ERROR_DATETIMEFORMAT';
|
|
4833
|
+
/**
|
|
4834
|
+
* Resource Key für Validation Message DateTimeFormat in Validation Summary
|
|
4835
|
+
*/
|
|
4836
|
+
this.validationmessagedatetimeformatsummary = 'VALIDATION_ERROR_SUMMARY_DATETIMEFORMAT';
|
|
4837
|
+
/**
|
|
4838
|
+
* Resource Key für Validation Message Required bei Control
|
|
4839
|
+
*/
|
|
4840
|
+
this.validationmessagerequired = 'VALIDATION_ERROR_REQUIRED';
|
|
4841
|
+
/**
|
|
4842
|
+
* Resource Key für Validation Message Required in Validation Summary
|
|
4843
|
+
*/
|
|
4844
|
+
this.validationmessagerequiredsummary = 'VALIDATION_ERROR_SUMMARY_REQUIRED';
|
|
4760
4845
|
}
|
|
4761
|
-
|
|
4762
|
-
// #region
|
|
4846
|
+
// #endregion Constructors
|
|
4847
|
+
// #region Public Getters And Setters
|
|
4763
4848
|
/**
|
|
4764
4849
|
* Das Input bekommt das value von typ string
|
|
4765
4850
|
*/
|
|
@@ -4786,23 +4871,34 @@ class SacBaseDateTimeControl extends SacBaseModelControl {
|
|
|
4786
4871
|
return date.local().format(this.GetDateTimeFormatString());
|
|
4787
4872
|
}
|
|
4788
4873
|
}
|
|
4874
|
+
// #endregion Public Getters And Setters
|
|
4875
|
+
// #region Public Methods
|
|
4876
|
+
/**
|
|
4877
|
+
* JSON Date String in ein UTC DateTime Object konvertieren, welches vom Control verwendete werden kann
|
|
4878
|
+
*/
|
|
4879
|
+
getDate(timestamp) {
|
|
4880
|
+
const date = new Date(timestamp);
|
|
4881
|
+
const year = date.getUTCFullYear();
|
|
4882
|
+
const month = date.getUTCMonth();
|
|
4883
|
+
const day = date.getUTCDate();
|
|
4884
|
+
const hours = date.getUTCHours();
|
|
4885
|
+
const minutes = date.getUTCMinutes();
|
|
4886
|
+
const seconds = date.getUTCSeconds();
|
|
4887
|
+
return moment$4(Date.UTC(year, month, day, hours, minutes, seconds));
|
|
4888
|
+
}
|
|
4889
|
+
/**
|
|
4890
|
+
* Init Event
|
|
4891
|
+
*/
|
|
4892
|
+
ngOnInit() {
|
|
4893
|
+
super.ngOnInit();
|
|
4894
|
+
this.SetDateTimeFormat();
|
|
4895
|
+
}
|
|
4789
4896
|
/**
|
|
4790
4897
|
* setzt das value von typ string zu property valuestring
|
|
4791
4898
|
*/
|
|
4792
4899
|
setValueString(v) {
|
|
4793
4900
|
this.valuestring = v;
|
|
4794
4901
|
}
|
|
4795
|
-
// #endregion
|
|
4796
|
-
// #region Private Methods
|
|
4797
|
-
SetDateTimeFormat() {
|
|
4798
|
-
// HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
|
|
4799
|
-
if (this.ngControl) {
|
|
4800
|
-
this.ngControl.datetimeformatstring =
|
|
4801
|
-
this.GetDateTimeFormatString();
|
|
4802
|
-
}
|
|
4803
|
-
}
|
|
4804
|
-
// #endregion
|
|
4805
|
-
//#region Validation
|
|
4806
4902
|
/**
|
|
4807
4903
|
* Validator
|
|
4808
4904
|
*/
|
|
@@ -4814,23 +4910,47 @@ class SacBaseDateTimeControl extends SacBaseModelControl {
|
|
|
4814
4910
|
}
|
|
4815
4911
|
return error;
|
|
4816
4912
|
}
|
|
4817
|
-
|
|
4818
|
-
|
|
4913
|
+
/**
|
|
4914
|
+
* Overwrite WriteValue to Set correct Date Object
|
|
4915
|
+
*/
|
|
4916
|
+
writeValue(value) {
|
|
4917
|
+
if (value === '' || value === null || value === undefined) {
|
|
4918
|
+
// Reset Value String, damit beim Update des Models auch das Input Feld geleert wird.
|
|
4919
|
+
this._valueAsString = '';
|
|
4920
|
+
// Set Internal Property
|
|
4921
|
+
this._value = null;
|
|
4922
|
+
}
|
|
4923
|
+
else {
|
|
4924
|
+
this._value = this.getDate(value).toDate();
|
|
4925
|
+
}
|
|
4926
|
+
super.writeValue(this._value);
|
|
4927
|
+
}
|
|
4928
|
+
// #endregion Public Abstract Methods
|
|
4929
|
+
// #region Private Methods
|
|
4930
|
+
SetDateTimeFormat() {
|
|
4931
|
+
// HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
|
|
4932
|
+
if (this.ngControl) {
|
|
4933
|
+
this.ngControl.datetimeformatstring =
|
|
4934
|
+
this.GetDateTimeFormatString();
|
|
4935
|
+
}
|
|
4936
|
+
}
|
|
4937
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacBaseDateTimeControl, deps: [{ token: SacFormLayoutCommon }, { token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4938
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacBaseDateTimeControl, inputs: { isrequired: "isrequired", placeholder: "placeholder", validationmessagedatetimeformat: "validationmessagedatetimeformat", validationmessagedatetimeformatsummary: "validationmessagedatetimeformatsummary", validationmessagerequired: "validationmessagerequired", validationmessagerequiredsummary: "validationmessagerequiredsummary", valuestring: "valuestring" }, usesInheritance: true, ngImport: i0 }); }
|
|
4819
4939
|
}
|
|
4820
4940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacBaseDateTimeControl, decorators: [{
|
|
4821
4941
|
type: Directive
|
|
4822
|
-
}], ctorParameters: function () { return [{ type:
|
|
4942
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { isrequired: [{
|
|
4823
4943
|
type: Input
|
|
4824
4944
|
}], placeholder: [{
|
|
4825
4945
|
type: Input
|
|
4826
|
-
}], validationmessagerequired: [{
|
|
4827
|
-
type: Input
|
|
4828
|
-
}], validationmessagerequiredsummary: [{
|
|
4829
|
-
type: Input
|
|
4830
4946
|
}], validationmessagedatetimeformat: [{
|
|
4831
4947
|
type: Input
|
|
4832
4948
|
}], validationmessagedatetimeformatsummary: [{
|
|
4833
4949
|
type: Input
|
|
4950
|
+
}], validationmessagerequired: [{
|
|
4951
|
+
type: Input
|
|
4952
|
+
}], validationmessagerequiredsummary: [{
|
|
4953
|
+
type: Input
|
|
4834
4954
|
}], valuestring: [{
|
|
4835
4955
|
type: Input
|
|
4836
4956
|
}] } });
|
|
@@ -4871,14 +4991,14 @@ class SacDateCommon extends SacBaseDateTimeControl {
|
|
|
4871
4991
|
}
|
|
4872
4992
|
// #endregion
|
|
4873
4993
|
/**
|
|
4874
|
-
*
|
|
4875
|
-
* @param
|
|
4876
|
-
* @param injector
|
|
4877
|
-
* @param
|
|
4994
|
+
* Constructor
|
|
4995
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
4996
|
+
* @param injector Injector for injecting services
|
|
4997
|
+
* @param elementRef reference to html element
|
|
4878
4998
|
*/
|
|
4879
|
-
constructor(
|
|
4880
|
-
super(
|
|
4881
|
-
this.
|
|
4999
|
+
constructor(formlayout, injector, elementRef) {
|
|
5000
|
+
super(formlayout, injector, elementRef);
|
|
5001
|
+
this.elementRef = elementRef;
|
|
4882
5002
|
// #region Constants
|
|
4883
5003
|
/**
|
|
4884
5004
|
* Format des Datums
|
|
@@ -4981,7 +5101,7 @@ class SacDateCommon extends SacBaseDateTimeControl {
|
|
|
4981
5101
|
* HostListener
|
|
4982
5102
|
*/
|
|
4983
5103
|
onClick(targetElement) {
|
|
4984
|
-
const clickedInside = this.
|
|
5104
|
+
const clickedInside = this.elementRef.nativeElement.contains(targetElement);
|
|
4985
5105
|
if (!clickedInside) {
|
|
4986
5106
|
this._showselector = false;
|
|
4987
5107
|
}
|
|
@@ -5023,12 +5143,12 @@ class SacDateCommon extends SacBaseDateTimeControl {
|
|
|
5023
5143
|
}
|
|
5024
5144
|
return error;
|
|
5025
5145
|
}
|
|
5026
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDateCommon, deps: [{ token:
|
|
5146
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDateCommon, deps: [{ token: SacFormLayoutCommon }, { token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5027
5147
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacDateCommon, inputs: { mindate: "mindate", maxdate: "maxdate", validationmessagemindate: "validationmessagemindate", validationmessagesummarymindate: "validationmessagesummarymindate", validationmessagemaxdate: "validationmessagemaxdate", validationmessagesummarymaxdate: "validationmessagesummarymaxdate" }, host: { listeners: { "document:click": "onClick($event.target)" } }, usesInheritance: true, ngImport: i0 }); }
|
|
5028
5148
|
}
|
|
5029
5149
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDateCommon, decorators: [{
|
|
5030
5150
|
type: Directive
|
|
5031
|
-
}], ctorParameters: function () { return [{ type:
|
|
5151
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { mindate: [{
|
|
5032
5152
|
type: Input
|
|
5033
5153
|
}], maxdate: [{
|
|
5034
5154
|
type: Input
|
|
@@ -5539,14 +5659,14 @@ class SacDateTimeCommon extends SacBaseDateTimeControl {
|
|
|
5539
5659
|
}
|
|
5540
5660
|
// #endregion
|
|
5541
5661
|
/**
|
|
5542
|
-
*
|
|
5543
|
-
* @param
|
|
5544
|
-
* @param injector
|
|
5545
|
-
* @param
|
|
5662
|
+
* Constructor
|
|
5663
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
5664
|
+
* @param injector Injector for injecting services
|
|
5665
|
+
* @param elementRef reference to html element
|
|
5546
5666
|
*/
|
|
5547
|
-
constructor(
|
|
5548
|
-
super(
|
|
5549
|
-
this.
|
|
5667
|
+
constructor(formlayout, injector, elementRef) {
|
|
5668
|
+
super(formlayout, injector, elementRef);
|
|
5669
|
+
this.elementRef = elementRef;
|
|
5550
5670
|
//#endregion
|
|
5551
5671
|
// #region Constants
|
|
5552
5672
|
/**
|
|
@@ -5667,7 +5787,7 @@ class SacDateTimeCommon extends SacBaseDateTimeControl {
|
|
|
5667
5787
|
* HostListener
|
|
5668
5788
|
*/
|
|
5669
5789
|
onClick(targetElement) {
|
|
5670
|
-
const clickedInside = this.
|
|
5790
|
+
const clickedInside = this.elementRef.nativeElement.contains(targetElement);
|
|
5671
5791
|
if (!clickedInside) {
|
|
5672
5792
|
this._showselector = false;
|
|
5673
5793
|
}
|
|
@@ -5709,12 +5829,12 @@ class SacDateTimeCommon extends SacBaseDateTimeControl {
|
|
|
5709
5829
|
}
|
|
5710
5830
|
return error;
|
|
5711
5831
|
}
|
|
5712
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDateTimeCommon, deps: [{ token:
|
|
5832
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDateTimeCommon, deps: [{ token: SacFormLayoutCommon }, { token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5713
5833
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacDateTimeCommon, inputs: { mindate: "mindate", maxdate: "maxdate", validationmessagemindate: "validationmessagemindate", validationmessagesummarymindate: "validationmessagesummarymindate", validationmessagemaxdate: "validationmessagemaxdate", validationmessagesummarymaxdate: "validationmessagesummarymaxdate" }, host: { listeners: { "document:click": "onClick($event.target)" } }, usesInheritance: true, ngImport: i0 }); }
|
|
5714
5834
|
}
|
|
5715
5835
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDateTimeCommon, decorators: [{
|
|
5716
5836
|
type: Directive
|
|
5717
|
-
}], ctorParameters: function () { return [{ type:
|
|
5837
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { mindate: [{
|
|
5718
5838
|
type: Input
|
|
5719
5839
|
}], maxdate: [{
|
|
5720
5840
|
type: Input
|
|
@@ -5768,14 +5888,14 @@ class SacTimeCommon extends SacBaseDateTimeControl {
|
|
|
5768
5888
|
}
|
|
5769
5889
|
// #endregion
|
|
5770
5890
|
/**
|
|
5771
|
-
*
|
|
5772
|
-
* @param
|
|
5773
|
-
* @param injector
|
|
5774
|
-
* @param
|
|
5891
|
+
* Constructor
|
|
5892
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
5893
|
+
* @param injector Injector for injecting services
|
|
5894
|
+
* @param elementRef reference to html element
|
|
5775
5895
|
*/
|
|
5776
|
-
constructor(
|
|
5777
|
-
super(
|
|
5778
|
-
this.
|
|
5896
|
+
constructor(formlayout, injector, elementRef) {
|
|
5897
|
+
super(formlayout, injector, elementRef);
|
|
5898
|
+
this.elementRef = elementRef;
|
|
5779
5899
|
// #region Constants
|
|
5780
5900
|
/**
|
|
5781
5901
|
* Format des Datums
|
|
@@ -5876,7 +5996,7 @@ class SacTimeCommon extends SacBaseDateTimeControl {
|
|
|
5876
5996
|
* HostListener
|
|
5877
5997
|
*/
|
|
5878
5998
|
onClick(targetElement) {
|
|
5879
|
-
const clickedInside = this.
|
|
5999
|
+
const clickedInside = this.elementRef.nativeElement.contains(targetElement);
|
|
5880
6000
|
if (!clickedInside) {
|
|
5881
6001
|
this._showselector = false;
|
|
5882
6002
|
}
|
|
@@ -5918,12 +6038,12 @@ class SacTimeCommon extends SacBaseDateTimeControl {
|
|
|
5918
6038
|
}
|
|
5919
6039
|
return error;
|
|
5920
6040
|
}
|
|
5921
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTimeCommon, deps: [{ token:
|
|
6041
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTimeCommon, deps: [{ token: SacFormLayoutCommon }, { token: i0.Injector }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5922
6042
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacTimeCommon, inputs: { mintime: "mintime", maxtime: "maxtime", validationmessagemintime: "validationmessagemintime", validationmessagesummarymintime: "validationmessagesummarymintime", validationmessagemaxtime: "validationmessagemaxtime", validationmessagesummarymaxtime: "validationmessagesummarymaxtime" }, host: { listeners: { "document:click": "onClick($event.target)" } }, usesInheritance: true, ngImport: i0 }); }
|
|
5923
6043
|
}
|
|
5924
6044
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTimeCommon, decorators: [{
|
|
5925
6045
|
type: Directive
|
|
5926
|
-
}], ctorParameters: function () { return [{ type:
|
|
6046
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { mintime: [{
|
|
5927
6047
|
type: Input
|
|
5928
6048
|
}], maxtime: [{
|
|
5929
6049
|
type: Input
|
|
@@ -5940,36 +6060,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
5940
6060
|
args: ['document:click', ['$event.target']]
|
|
5941
6061
|
}] } });
|
|
5942
6062
|
|
|
5943
|
-
/**
|
|
5944
|
-
* Common Klasse für Static Label Control
|
|
5945
|
-
**/
|
|
5946
|
-
class SacStaticLabelCommon extends SacInputBase {
|
|
5947
|
-
constructor() {
|
|
5948
|
-
super(...arguments);
|
|
5949
|
-
/**
|
|
5950
|
-
* Erlaubt HTML Content in der Anzeige des Wertes
|
|
5951
|
-
*/
|
|
5952
|
-
this.allowhtml = false;
|
|
5953
|
-
}
|
|
5954
|
-
/**
|
|
5955
|
-
* Validierung des Controls
|
|
5956
|
-
*
|
|
5957
|
-
* @param c Control das Validiert werden soll
|
|
5958
|
-
* @returns Fehlermeldung aus Validation oder NULL
|
|
5959
|
-
*/
|
|
5960
|
-
validateData(c) {
|
|
5961
|
-
// Keine Validierung, daher immer NULL
|
|
5962
|
-
return null;
|
|
5963
|
-
}
|
|
5964
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacStaticLabelCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5965
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacStaticLabelCommon, inputs: { allowhtml: "allowhtml" }, usesInheritance: true, ngImport: i0 }); }
|
|
5966
|
-
}
|
|
5967
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacStaticLabelCommon, decorators: [{
|
|
5968
|
-
type: Directive
|
|
5969
|
-
}], propDecorators: { allowhtml: [{
|
|
5970
|
-
type: Input
|
|
5971
|
-
}] } });
|
|
5972
|
-
|
|
5973
6063
|
/**
|
|
5974
6064
|
* Common Control für Form Item Container.
|
|
5975
6065
|
**/
|
|
@@ -6019,6 +6109,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
6019
6109
|
type: Input
|
|
6020
6110
|
}] } });
|
|
6021
6111
|
|
|
6112
|
+
/**
|
|
6113
|
+
* Common Klasse für Static Label Control
|
|
6114
|
+
**/
|
|
6115
|
+
class SacStaticLabelCommon extends SacInputBase {
|
|
6116
|
+
constructor() {
|
|
6117
|
+
super(...arguments);
|
|
6118
|
+
/**
|
|
6119
|
+
* Erlaubt HTML Content in der Anzeige des Wertes
|
|
6120
|
+
*/
|
|
6121
|
+
this.allowhtml = false;
|
|
6122
|
+
}
|
|
6123
|
+
/**
|
|
6124
|
+
* Validierung des Controls
|
|
6125
|
+
*
|
|
6126
|
+
* @param c Control das Validiert werden soll
|
|
6127
|
+
* @returns Fehlermeldung aus Validation oder NULL
|
|
6128
|
+
*/
|
|
6129
|
+
validateData(c) {
|
|
6130
|
+
// Keine Validierung, daher immer NULL
|
|
6131
|
+
return null;
|
|
6132
|
+
}
|
|
6133
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacStaticLabelCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6134
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacStaticLabelCommon, inputs: { allowhtml: "allowhtml" }, usesInheritance: true, ngImport: i0 }); }
|
|
6135
|
+
}
|
|
6136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacStaticLabelCommon, decorators: [{
|
|
6137
|
+
type: Directive
|
|
6138
|
+
}], propDecorators: { allowhtml: [{
|
|
6139
|
+
type: Input
|
|
6140
|
+
}] } });
|
|
6141
|
+
|
|
6022
6142
|
/**
|
|
6023
6143
|
* Base Komponente für SacWizardCommon
|
|
6024
6144
|
*/
|
|
@@ -6209,33 +6329,18 @@ class TinyMceDialogSettings {
|
|
|
6209
6329
|
* Basis Komponente für TinyMCE Editor
|
|
6210
6330
|
*/
|
|
6211
6331
|
class SacTinyMceCommon extends SacBaseModelControl {
|
|
6332
|
+
// #endregion Properties
|
|
6333
|
+
// #region Constructors
|
|
6212
6334
|
/**
|
|
6213
|
-
*
|
|
6214
|
-
* @
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
this._config = {
|
|
6218
|
-
...this.getDynamicSettings(),
|
|
6219
|
-
...this.baseConfig,
|
|
6220
|
-
...this.overwriteDefaultSettings(),
|
|
6221
|
-
...v,
|
|
6222
|
-
};
|
|
6223
|
-
}
|
|
6224
|
-
/**
|
|
6225
|
-
* TinyMCE Konfiguration
|
|
6226
|
-
*/
|
|
6227
|
-
get config() {
|
|
6228
|
-
return this._config;
|
|
6229
|
-
}
|
|
6230
|
-
/**
|
|
6231
|
-
* Konstruktor
|
|
6232
|
-
* @param parent Instanz vom Formular
|
|
6233
|
-
* @param injector Injector Service
|
|
6234
|
-
* @param ngZone NgZone für Javascript in TinyMCE
|
|
6335
|
+
* Constructor
|
|
6336
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
6337
|
+
* @param injector Injector for injecting services
|
|
6338
|
+
* @param ngZone ngzone for handling external javascripts
|
|
6235
6339
|
*/
|
|
6236
|
-
constructor(
|
|
6237
|
-
super(
|
|
6340
|
+
constructor(formlayout, injector, ngZone) {
|
|
6341
|
+
super(formlayout, injector);
|
|
6238
6342
|
this.ngZone = ngZone;
|
|
6343
|
+
// #region Properties
|
|
6239
6344
|
/**
|
|
6240
6345
|
* Default Config mit Standardwerten für TinyMCE
|
|
6241
6346
|
*/
|
|
@@ -6249,49 +6354,37 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6249
6354
|
save_onsavecallback: () => { },
|
|
6250
6355
|
};
|
|
6251
6356
|
/**
|
|
6252
|
-
*
|
|
6253
|
-
*/
|
|
6254
|
-
this._config = {};
|
|
6255
|
-
/**
|
|
6256
|
-
* Der Select Dialog wird angezeigt
|
|
6257
|
-
*/
|
|
6258
|
-
this.selectdialogvisible = false;
|
|
6259
|
-
/**
|
|
6260
|
-
* Definiert das Control als Required
|
|
6357
|
+
* Erlaubt im Filebrowser das löschen von Dateien
|
|
6261
6358
|
*/
|
|
6262
|
-
this.
|
|
6359
|
+
this.allowfiledelete = false;
|
|
6263
6360
|
/**
|
|
6264
|
-
*
|
|
6361
|
+
* Erlaubt im Filebrowser das umbennen von Dateien
|
|
6265
6362
|
*/
|
|
6266
|
-
this.
|
|
6363
|
+
this.allowfilerename = false;
|
|
6267
6364
|
/**
|
|
6268
|
-
*
|
|
6365
|
+
* Erlaubt im Filebrowser das hochladen von Files
|
|
6269
6366
|
*/
|
|
6270
|
-
this.
|
|
6367
|
+
this.allowfileupload = false;
|
|
6271
6368
|
/**
|
|
6272
6369
|
* Erlaubt im Filebrowser das anlegen eines Ordners
|
|
6273
6370
|
*/
|
|
6274
6371
|
this.allowfoldercreate = false;
|
|
6275
|
-
/**
|
|
6276
|
-
* Erlaubt im Filebrowser das umbennen eines Ordners
|
|
6277
|
-
*/
|
|
6278
|
-
this.allowfolderrename = false;
|
|
6279
6372
|
/**
|
|
6280
6373
|
* Erlaubt im Filebrowser das löschen eines Ordners
|
|
6281
6374
|
*/
|
|
6282
6375
|
this.allowfolderdelete = false;
|
|
6283
6376
|
/**
|
|
6284
|
-
* Erlaubt im Filebrowser das
|
|
6377
|
+
* Erlaubt im Filebrowser das umbennen eines Ordners
|
|
6285
6378
|
*/
|
|
6286
|
-
this.
|
|
6379
|
+
this.allowfolderrename = false;
|
|
6287
6380
|
/**
|
|
6288
|
-
*
|
|
6381
|
+
* URL zu Filebrowser Backend
|
|
6289
6382
|
*/
|
|
6290
|
-
this.
|
|
6383
|
+
this.filebrowserapiurl = null;
|
|
6291
6384
|
/**
|
|
6292
|
-
*
|
|
6385
|
+
* File Extensions für Links (Format: .xxx,.yyy,.eee)
|
|
6293
6386
|
*/
|
|
6294
|
-
this.
|
|
6387
|
+
this.filetypesfiles = '';
|
|
6295
6388
|
/**
|
|
6296
6389
|
* File Extensions für Images (Format: .xxx,.yyy,.eee)
|
|
6297
6390
|
*/
|
|
@@ -6301,9 +6394,13 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6301
6394
|
*/
|
|
6302
6395
|
this.filetypesvideo = '.mp4,.m4v,.ogv,.webm,.mov';
|
|
6303
6396
|
/**
|
|
6304
|
-
*
|
|
6397
|
+
* Höhe des Editors
|
|
6305
6398
|
*/
|
|
6306
|
-
this.
|
|
6399
|
+
this.height = undefined;
|
|
6400
|
+
/**
|
|
6401
|
+
* Definiert das Control als Required
|
|
6402
|
+
*/
|
|
6403
|
+
this.isrequired = false;
|
|
6307
6404
|
/**
|
|
6308
6405
|
* Resource Key für Validation Message Required bei Control
|
|
6309
6406
|
*/
|
|
@@ -6316,10 +6413,66 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6316
6413
|
* Event wenn Save Action in TinyMCE ausgelöst wird
|
|
6317
6414
|
*/
|
|
6318
6415
|
this.onsave = new EventEmitter();
|
|
6416
|
+
/**
|
|
6417
|
+
* TinyMCE Config
|
|
6418
|
+
*/
|
|
6419
|
+
this._config = {};
|
|
6420
|
+
/**
|
|
6421
|
+
* Der Select Dialog wird angezeigt
|
|
6422
|
+
*/
|
|
6423
|
+
this.selectdialogvisible = false;
|
|
6319
6424
|
this.lngResourceService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService());
|
|
6320
6425
|
this.config = {};
|
|
6321
6426
|
}
|
|
6322
|
-
|
|
6427
|
+
// #endregion Constructors
|
|
6428
|
+
// #region Public Getters And Setters
|
|
6429
|
+
/**
|
|
6430
|
+
* TinyMCE Konfiguration
|
|
6431
|
+
* @link https://www.tiny.cloud/docs/configure/
|
|
6432
|
+
*/
|
|
6433
|
+
set config(v) {
|
|
6434
|
+
this._config = {
|
|
6435
|
+
...this.getDynamicSettings(),
|
|
6436
|
+
...this.baseConfig,
|
|
6437
|
+
...this.overwriteDefaultSettings(),
|
|
6438
|
+
...v,
|
|
6439
|
+
};
|
|
6440
|
+
}
|
|
6441
|
+
/**
|
|
6442
|
+
* TinyMCE Konfiguration
|
|
6443
|
+
*/
|
|
6444
|
+
get config() {
|
|
6445
|
+
return this._config;
|
|
6446
|
+
}
|
|
6447
|
+
// #endregion Public Getters And Setters
|
|
6448
|
+
// #region Public Methods
|
|
6449
|
+
/**
|
|
6450
|
+
* Schliesst den Dateiauswahl Dialog
|
|
6451
|
+
*/
|
|
6452
|
+
closeSelectDialog() {
|
|
6453
|
+
this.selectdialogvisible = false;
|
|
6454
|
+
}
|
|
6455
|
+
/**
|
|
6456
|
+
* Löst die Speichern Action aus
|
|
6457
|
+
* @param content Content als String
|
|
6458
|
+
*/
|
|
6459
|
+
save(content) {
|
|
6460
|
+
this.onsave.emit(content);
|
|
6461
|
+
}
|
|
6462
|
+
/**
|
|
6463
|
+
* Setzt das Resultat aus dem Dateiauswahl Dialog
|
|
6464
|
+
*/
|
|
6465
|
+
setSelectDialogResult() {
|
|
6466
|
+
if (this.selectDialogSettings.value) {
|
|
6467
|
+
if (this.selectDialogSettings.value.startsWith('/') ||
|
|
6468
|
+
this.selectDialogSettings.value.startsWith('\\')) {
|
|
6469
|
+
this.selectDialogSettings.value =
|
|
6470
|
+
this.selectDialogSettings.value.substring(1);
|
|
6471
|
+
}
|
|
6472
|
+
this.selectDialogSettings.callback(this.selectDialogSettings.value);
|
|
6473
|
+
}
|
|
6474
|
+
this.closeSelectDialog();
|
|
6475
|
+
}
|
|
6323
6476
|
/**
|
|
6324
6477
|
* Zeigt den Dateiauswahl Dialog an
|
|
6325
6478
|
* @param callback Callback Methode welche aufgerufen wird, wenn der Dialog geschlossen wird
|
|
@@ -6354,34 +6507,6 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6354
6507
|
});
|
|
6355
6508
|
});
|
|
6356
6509
|
}
|
|
6357
|
-
/**
|
|
6358
|
-
* Setzt das Resultat aus dem Dateiauswahl Dialog
|
|
6359
|
-
*/
|
|
6360
|
-
setSelectDialogResult() {
|
|
6361
|
-
if (this.selectDialogSettings.value) {
|
|
6362
|
-
if (this.selectDialogSettings.value.startsWith('/') ||
|
|
6363
|
-
this.selectDialogSettings.value.startsWith('\\')) {
|
|
6364
|
-
this.selectDialogSettings.value =
|
|
6365
|
-
this.selectDialogSettings.value.substring(1);
|
|
6366
|
-
}
|
|
6367
|
-
this.selectDialogSettings.callback(this.selectDialogSettings.value);
|
|
6368
|
-
}
|
|
6369
|
-
this.closeSelectDialog();
|
|
6370
|
-
}
|
|
6371
|
-
/**
|
|
6372
|
-
* Schliesst den Dateiauswahl Dialog
|
|
6373
|
-
*/
|
|
6374
|
-
closeSelectDialog() {
|
|
6375
|
-
this.selectdialogvisible = false;
|
|
6376
|
-
}
|
|
6377
|
-
//#endregion
|
|
6378
|
-
/**
|
|
6379
|
-
* Löst die Speichern Action aus
|
|
6380
|
-
* @param content Content als String
|
|
6381
|
-
*/
|
|
6382
|
-
save(content) {
|
|
6383
|
-
this.onsave.emit(content);
|
|
6384
|
-
}
|
|
6385
6510
|
/**
|
|
6386
6511
|
* Validiert das Control
|
|
6387
6512
|
* @param c Control Instanz die valdidiert wird
|
|
@@ -6394,6 +6519,8 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6394
6519
|
}
|
|
6395
6520
|
return error;
|
|
6396
6521
|
}
|
|
6522
|
+
// #endregion Public Abstract Methods
|
|
6523
|
+
// #region Private Methods
|
|
6397
6524
|
/**
|
|
6398
6525
|
* Gibt die TinyMCE Settings zurück, die aus den Properties der Angular Komponenten erzeugt werden
|
|
6399
6526
|
* @returns Objekt mit Settings
|
|
@@ -6405,44 +6532,104 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6405
6532
|
};
|
|
6406
6533
|
return settings;
|
|
6407
6534
|
}
|
|
6408
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTinyMceCommon, deps: [{ token:
|
|
6409
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacTinyMceCommon, inputs: {
|
|
6535
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTinyMceCommon, deps: [{ token: SacFormLayoutCommon, host: true }, { token: i0.Injector }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6536
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacTinyMceCommon, inputs: { allowfiledelete: "allowfiledelete", allowfilerename: "allowfilerename", allowfileupload: "allowfileupload", allowfoldercreate: "allowfoldercreate", allowfolderdelete: "allowfolderdelete", allowfolderrename: "allowfolderrename", filebrowserapiurl: "filebrowserapiurl", filetypesfiles: "filetypesfiles", filetypesimages: "filetypesimages", filetypesvideo: "filetypesvideo", height: "height", isrequired: "isrequired", validationmessagerequired: "validationmessagerequired", validationmessagesummaryrequired: "validationmessagesummaryrequired", config: "config" }, outputs: { onsave: "onsave" }, usesInheritance: true, ngImport: i0 }); }
|
|
6410
6537
|
}
|
|
6411
6538
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTinyMceCommon, decorators: [{
|
|
6412
6539
|
type: Directive
|
|
6413
|
-
}], ctorParameters: function () { return [{ type:
|
|
6540
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
6414
6541
|
type: Host
|
|
6415
|
-
}] }, { type: i0.Injector }, { type: i0.NgZone }]; }, propDecorators: {
|
|
6542
|
+
}] }, { type: i0.Injector }, { type: i0.NgZone }]; }, propDecorators: { allowfiledelete: [{
|
|
6416
6543
|
type: Input
|
|
6417
|
-
}],
|
|
6544
|
+
}], allowfilerename: [{
|
|
6418
6545
|
type: Input
|
|
6419
|
-
}],
|
|
6546
|
+
}], allowfileupload: [{
|
|
6420
6547
|
type: Input
|
|
6421
6548
|
}], allowfoldercreate: [{
|
|
6422
6549
|
type: Input
|
|
6423
|
-
}], allowfolderrename: [{
|
|
6424
|
-
type: Input
|
|
6425
6550
|
}], allowfolderdelete: [{
|
|
6426
6551
|
type: Input
|
|
6427
|
-
}],
|
|
6552
|
+
}], allowfolderrename: [{
|
|
6428
6553
|
type: Input
|
|
6429
|
-
}],
|
|
6554
|
+
}], filebrowserapiurl: [{
|
|
6430
6555
|
type: Input
|
|
6431
|
-
}],
|
|
6556
|
+
}], filetypesfiles: [{
|
|
6432
6557
|
type: Input
|
|
6433
6558
|
}], filetypesimages: [{
|
|
6434
6559
|
type: Input
|
|
6435
6560
|
}], filetypesvideo: [{
|
|
6436
6561
|
type: Input
|
|
6437
|
-
}],
|
|
6562
|
+
}], height: [{
|
|
6563
|
+
type: Input
|
|
6564
|
+
}], isrequired: [{
|
|
6438
6565
|
type: Input
|
|
6439
6566
|
}], validationmessagerequired: [{
|
|
6440
6567
|
type: Input
|
|
6441
6568
|
}], validationmessagesummaryrequired: [{
|
|
6442
6569
|
type: Input
|
|
6570
|
+
}], onsave: [{
|
|
6571
|
+
type: Output
|
|
6443
6572
|
}], config: [{
|
|
6444
6573
|
type: Input
|
|
6445
|
-
}]
|
|
6574
|
+
}] } });
|
|
6575
|
+
|
|
6576
|
+
/**
|
|
6577
|
+
*Basis Komponente für SacTreeItemAction
|
|
6578
|
+
*/
|
|
6579
|
+
class SacTreeItemActionCommon {
|
|
6580
|
+
/**
|
|
6581
|
+
* Konstruktor
|
|
6582
|
+
* @param el Element Referenz
|
|
6583
|
+
*/
|
|
6584
|
+
constructor(el) {
|
|
6585
|
+
this.el = el;
|
|
6586
|
+
/**
|
|
6587
|
+
* Event wenn auf das Icon geclickt wird
|
|
6588
|
+
*/
|
|
6589
|
+
this.clicked = new EventEmitter();
|
|
6590
|
+
}
|
|
6591
|
+
/**
|
|
6592
|
+
* lifecycle OnInit hook. Wird aufgeruren sobald das Komponent initialisiert ist.
|
|
6593
|
+
*/
|
|
6594
|
+
ngOnInit() {
|
|
6595
|
+
let rootElement = this.el.nativeElement;
|
|
6596
|
+
let parentElement = rootElement.parentElement;
|
|
6597
|
+
while (rootElement.firstChild) {
|
|
6598
|
+
parentElement.insertBefore(rootElement.firstChild, rootElement);
|
|
6599
|
+
}
|
|
6600
|
+
parentElement.removeChild(rootElement);
|
|
6601
|
+
}
|
|
6602
|
+
/**
|
|
6603
|
+
* Die Methode erstellt die CSS Klasse des Icon. Akzeptiert ein Key-word und baut ein vollständige CSS Klasse.
|
|
6604
|
+
*/
|
|
6605
|
+
transformClass(initialClass) {
|
|
6606
|
+
switch (initialClass) {
|
|
6607
|
+
case 'add':
|
|
6608
|
+
return 'jstree-icon icon icon-base-add jstree-add';
|
|
6609
|
+
case 'delete':
|
|
6610
|
+
return 'jstree-icon icon icon-base-delete jstree-delete';
|
|
6611
|
+
default:
|
|
6612
|
+
return initialClass;
|
|
6613
|
+
}
|
|
6614
|
+
}
|
|
6615
|
+
/**
|
|
6616
|
+
* Die Methode wird das cklickaction Emitter aktivieren.
|
|
6617
|
+
*/
|
|
6618
|
+
iconaction() {
|
|
6619
|
+
this.clicked.emit();
|
|
6620
|
+
}
|
|
6621
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTreeItemActionCommon, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6622
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacTreeItemActionCommon, inputs: { item: "item", title: "title", iconstyle: "iconstyle" }, outputs: { clicked: "clicked" }, ngImport: i0 }); }
|
|
6623
|
+
}
|
|
6624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTreeItemActionCommon, decorators: [{
|
|
6625
|
+
type: Directive
|
|
6626
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { item: [{
|
|
6627
|
+
type: Input
|
|
6628
|
+
}], title: [{
|
|
6629
|
+
type: Input
|
|
6630
|
+
}], iconstyle: [{
|
|
6631
|
+
type: Input
|
|
6632
|
+
}], clicked: [{
|
|
6446
6633
|
type: Output
|
|
6447
6634
|
}] } });
|
|
6448
6635
|
|
|
@@ -6805,66 +6992,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
6805
6992
|
type: Directive
|
|
6806
6993
|
}] });
|
|
6807
6994
|
|
|
6808
|
-
/**
|
|
6809
|
-
*Basis Komponente für SacTreeItemAction
|
|
6810
|
-
*/
|
|
6811
|
-
class SacTreeItemActionCommon {
|
|
6812
|
-
/**
|
|
6813
|
-
* Konstruktor
|
|
6814
|
-
* @param el Element Referenz
|
|
6815
|
-
*/
|
|
6816
|
-
constructor(el) {
|
|
6817
|
-
this.el = el;
|
|
6818
|
-
/**
|
|
6819
|
-
* Event wenn auf das Icon geclickt wird
|
|
6820
|
-
*/
|
|
6821
|
-
this.clicked = new EventEmitter();
|
|
6822
|
-
}
|
|
6823
|
-
/**
|
|
6824
|
-
* lifecycle OnInit hook. Wird aufgeruren sobald das Komponent initialisiert ist.
|
|
6825
|
-
*/
|
|
6826
|
-
ngOnInit() {
|
|
6827
|
-
let rootElement = this.el.nativeElement;
|
|
6828
|
-
let parentElement = rootElement.parentElement;
|
|
6829
|
-
while (rootElement.firstChild) {
|
|
6830
|
-
parentElement.insertBefore(rootElement.firstChild, rootElement);
|
|
6831
|
-
}
|
|
6832
|
-
parentElement.removeChild(rootElement);
|
|
6833
|
-
}
|
|
6834
|
-
/**
|
|
6835
|
-
* Die Methode erstellt die CSS Klasse des Icon. Akzeptiert ein Key-word und baut ein vollständige CSS Klasse.
|
|
6836
|
-
*/
|
|
6837
|
-
transformClass(initialClass) {
|
|
6838
|
-
switch (initialClass) {
|
|
6839
|
-
case 'add':
|
|
6840
|
-
return 'jstree-icon icon icon-base-add jstree-add';
|
|
6841
|
-
case 'delete':
|
|
6842
|
-
return 'jstree-icon icon icon-base-delete jstree-delete';
|
|
6843
|
-
default:
|
|
6844
|
-
return initialClass;
|
|
6845
|
-
}
|
|
6846
|
-
}
|
|
6847
|
-
/**
|
|
6848
|
-
* Die Methode wird das cklickaction Emitter aktivieren.
|
|
6849
|
-
*/
|
|
6850
|
-
iconaction() {
|
|
6851
|
-
this.clicked.emit();
|
|
6852
|
-
}
|
|
6853
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTreeItemActionCommon, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
6854
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacTreeItemActionCommon, inputs: { item: "item", title: "title", iconstyle: "iconstyle" }, outputs: { clicked: "clicked" }, ngImport: i0 }); }
|
|
6855
|
-
}
|
|
6856
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTreeItemActionCommon, decorators: [{
|
|
6857
|
-
type: Directive
|
|
6858
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { item: [{
|
|
6859
|
-
type: Input
|
|
6860
|
-
}], title: [{
|
|
6861
|
-
type: Input
|
|
6862
|
-
}], iconstyle: [{
|
|
6863
|
-
type: Input
|
|
6864
|
-
}], clicked: [{
|
|
6865
|
-
type: Output
|
|
6866
|
-
}] } });
|
|
6867
|
-
|
|
6868
6995
|
/**
|
|
6869
6996
|
* Enum für Tooltip Positionen
|
|
6870
6997
|
*/
|
|
@@ -7237,87 +7364,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7237
7364
|
}], content: [{
|
|
7238
7365
|
type: ViewChild,
|
|
7239
7366
|
args: ['container', { static: true }]
|
|
7240
|
-
}], tooltip: [{
|
|
7241
|
-
type: ViewChild,
|
|
7242
|
-
args: ['tooltip', { static: true }]
|
|
7243
|
-
}] } });
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
*/
|
|
7253
|
-
constructor(ufile) {
|
|
7254
|
-
this.uploadId = ufile.uploadId;
|
|
7255
|
-
this.name = ufile.name;
|
|
7256
|
-
this.progress = ufile.progress;
|
|
7257
|
-
this.status = ufile.status;
|
|
7258
|
-
this.documentid = null;
|
|
7259
|
-
}
|
|
7260
|
-
}
|
|
7261
|
-
/**
|
|
7262
|
-
* Base Klasse für Uploader Control
|
|
7263
|
-
*/
|
|
7264
|
-
class SacUploadBase extends SacBaseModelControl {
|
|
7265
|
-
/**
|
|
7266
|
-
* Erlaubte Dateitypen für den Upload. Format: ".xxx,.yyy,.zzz"
|
|
7267
|
-
*/
|
|
7268
|
-
set allowedtypes(types) {
|
|
7269
|
-
this._allowedtypes = types;
|
|
7270
|
-
this.setAllowedTypes(types);
|
|
7271
|
-
}
|
|
7272
|
-
get allowedtypes() {
|
|
7273
|
-
return this._allowedtypes;
|
|
7274
|
-
}
|
|
7275
|
-
/**
|
|
7276
|
-
* Files nach der Auswahl automatisch hochladen
|
|
7277
|
-
*/
|
|
7278
|
-
set autoupload(v) {
|
|
7279
|
-
this._autoupload = v;
|
|
7280
|
-
this.options.autoUpload = v;
|
|
7281
|
-
this.uploadService.connect(this.options);
|
|
7282
|
-
}
|
|
7283
|
-
get autoupload() {
|
|
7284
|
-
return this._autoupload;
|
|
7285
|
-
}
|
|
7286
|
-
/**
|
|
7287
|
-
* Uploads können unterbrochen werden
|
|
7288
|
-
*/
|
|
7289
|
-
set enablepause(v) {
|
|
7290
|
-
this._enablepause = v;
|
|
7291
|
-
}
|
|
7292
|
-
get enablepause() {
|
|
7293
|
-
return this._enablepause;
|
|
7294
|
-
}
|
|
7295
|
-
//#endregion
|
|
7296
|
-
/**
|
|
7297
|
-
* Definiert den Registration Endpoint für Uploads.
|
|
7298
|
-
*/
|
|
7299
|
-
set endpoint(v) {
|
|
7300
|
-
this._endpoint = v;
|
|
7301
|
-
this.setEndpoint(v);
|
|
7302
|
-
}
|
|
7303
|
-
get endpoint() {
|
|
7304
|
-
return this._endpoint;
|
|
7305
|
-
}
|
|
7367
|
+
}], tooltip: [{
|
|
7368
|
+
type: ViewChild,
|
|
7369
|
+
args: ['tooltip', { static: true }]
|
|
7370
|
+
}] } });
|
|
7371
|
+
|
|
7372
|
+
// #region Classes
|
|
7373
|
+
/**
|
|
7374
|
+
* Base Klasse für Uploader Control
|
|
7375
|
+
*/
|
|
7376
|
+
class SacUploadBase extends SacBaseModelControl {
|
|
7377
|
+
// #endregion Properties
|
|
7378
|
+
// #region Constructors
|
|
7306
7379
|
/**
|
|
7307
7380
|
* Constructor
|
|
7308
|
-
* @param
|
|
7309
|
-
* @param injector Injector
|
|
7310
|
-
* @param renderer
|
|
7311
|
-
* @param ngZone
|
|
7381
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
7382
|
+
* @param injector Injector for injecting services
|
|
7383
|
+
* @param renderer angular rendering engine
|
|
7384
|
+
* @param ngZone ngzone for handling external scripts
|
|
7312
7385
|
*/
|
|
7313
|
-
constructor(
|
|
7314
|
-
super(
|
|
7386
|
+
constructor(formlayout, injector, renderer, ngZone) {
|
|
7387
|
+
super(formlayout, injector);
|
|
7315
7388
|
this.renderer = renderer;
|
|
7316
7389
|
this.ngZone = ngZone;
|
|
7317
|
-
/**
|
|
7318
|
-
* Upload Settings
|
|
7319
|
-
*/
|
|
7320
|
-
this.options = {};
|
|
7321
7390
|
/**
|
|
7322
7391
|
* Erlaubte Dateitypen
|
|
7323
7392
|
*/
|
|
@@ -7334,23 +7403,26 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7334
7403
|
* API Endpoint
|
|
7335
7404
|
*/
|
|
7336
7405
|
this._endpoint = null;
|
|
7337
|
-
//#region Properties
|
|
7338
7406
|
/**
|
|
7339
|
-
*
|
|
7407
|
+
* Upload Settings
|
|
7340
7408
|
*/
|
|
7341
|
-
this.
|
|
7409
|
+
this.options = {};
|
|
7342
7410
|
/**
|
|
7343
|
-
*
|
|
7411
|
+
* Definiert das Control als Required
|
|
7344
7412
|
*/
|
|
7345
|
-
this.
|
|
7413
|
+
this.isrequired = false;
|
|
7346
7414
|
/**
|
|
7347
7415
|
* Max. Dateigrösse für Files die hochgeladen werden können. 0 deaktiviert den Filter
|
|
7348
7416
|
*/
|
|
7349
7417
|
this.maxfilesize = 0;
|
|
7350
7418
|
/**
|
|
7351
|
-
*
|
|
7419
|
+
* Resource Key für Validation Message Required bei Control
|
|
7352
7420
|
*/
|
|
7353
|
-
this.
|
|
7421
|
+
this.validationmessagerequired = 'VALIDATION_ERROR_REQUIRED';
|
|
7422
|
+
/**
|
|
7423
|
+
* Resource Key für Validation Message Required in Validation Summary
|
|
7424
|
+
*/
|
|
7425
|
+
this.validationmessagesummaryrequired = 'VALIDATION_ERROR_SUMMARY_REQUIRED';
|
|
7354
7426
|
/**
|
|
7355
7427
|
* Event wenn ein Error in der Komponente ausgelöst wird.
|
|
7356
7428
|
*/
|
|
@@ -7381,107 +7453,80 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7381
7453
|
// Subscripe Event for State changes
|
|
7382
7454
|
this.uploadService.events.subscribe((ufile) => this.onUpload(ufile));
|
|
7383
7455
|
}
|
|
7456
|
+
// #endregion Constructors
|
|
7457
|
+
// #region Public Getters And Setters
|
|
7384
7458
|
/**
|
|
7385
|
-
*
|
|
7459
|
+
* Erlaubte Dateitypen für den Upload. Format: ".xxx,.yyy,.zzz"
|
|
7386
7460
|
*/
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
this.listenerFn = this.renderer.listen(this.uploadInput.nativeElement, 'change', this.fileListener);
|
|
7391
|
-
this.setAllowedTypes(this._allowedtypes);
|
|
7392
|
-
this.setEndpoint(this._endpoint);
|
|
7393
|
-
if (this._endpoint === null) {
|
|
7394
|
-
throw new Error('endpoint is not defined!');
|
|
7395
|
-
}
|
|
7396
|
-
this.uploadService.connect(this.options);
|
|
7461
|
+
set allowedtypes(types) {
|
|
7462
|
+
this._allowedtypes = types;
|
|
7463
|
+
this.setAllowedTypes(types);
|
|
7397
7464
|
}
|
|
7398
7465
|
/**
|
|
7399
|
-
*
|
|
7466
|
+
* Files nach der Auswahl automatisch hochladen
|
|
7400
7467
|
*/
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7468
|
+
set autoupload(v) {
|
|
7469
|
+
this._autoupload = v;
|
|
7470
|
+
this.options.autoUpload = v;
|
|
7471
|
+
this.uploadService.connect(this.options);
|
|
7405
7472
|
}
|
|
7406
|
-
//#region All File Events
|
|
7407
7473
|
/**
|
|
7408
|
-
*
|
|
7474
|
+
* Uploads können unterbrochen werden
|
|
7409
7475
|
*/
|
|
7410
|
-
|
|
7411
|
-
|
|
7412
|
-
this.uploadService.control({ action: 'cancel' });
|
|
7413
|
-
}
|
|
7476
|
+
set enablepause(v) {
|
|
7477
|
+
this._enablepause = v;
|
|
7414
7478
|
}
|
|
7415
7479
|
/**
|
|
7416
|
-
*
|
|
7480
|
+
* Definiert den Registration Endpoint für Uploads.
|
|
7417
7481
|
*/
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
}
|
|
7482
|
+
set endpoint(v) {
|
|
7483
|
+
this._endpoint = v;
|
|
7484
|
+
this.setEndpoint(v);
|
|
7422
7485
|
}
|
|
7423
7486
|
/**
|
|
7424
|
-
*
|
|
7487
|
+
* Icon for browse button
|
|
7425
7488
|
*/
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
this.uploadService.control({ action: 'pause' });
|
|
7429
|
-
}
|
|
7489
|
+
get IconBrowse() {
|
|
7490
|
+
return this.iconService.UploadComponentBrowseIcon;
|
|
7430
7491
|
}
|
|
7431
|
-
//#endregion
|
|
7432
|
-
//#region Singel File Events
|
|
7433
7492
|
/**
|
|
7434
|
-
*
|
|
7435
|
-
* @param uploadId ID of File to cancel
|
|
7493
|
+
* icon for continous buttons
|
|
7436
7494
|
*/
|
|
7437
|
-
|
|
7438
|
-
this.
|
|
7495
|
+
get IconContinue() {
|
|
7496
|
+
return this.iconService.UploadComponentContinueIcon;
|
|
7439
7497
|
}
|
|
7440
7498
|
/**
|
|
7441
|
-
*
|
|
7442
|
-
* @param uploadId ID of File to Cancel
|
|
7499
|
+
* icon for delete buttons
|
|
7443
7500
|
*/
|
|
7444
|
-
|
|
7445
|
-
this.
|
|
7501
|
+
get IconDelete() {
|
|
7502
|
+
return this.iconService.UploadComponentDeleteIcon;
|
|
7446
7503
|
}
|
|
7447
7504
|
/**
|
|
7448
|
-
*
|
|
7449
|
-
*
|
|
7450
|
-
* @param uploadId ID of File to Upload
|
|
7505
|
+
* icon for pause buttons
|
|
7451
7506
|
*/
|
|
7452
|
-
|
|
7453
|
-
this.
|
|
7507
|
+
get IconPause() {
|
|
7508
|
+
return this.iconService.UploadComponentPauseIcon;
|
|
7454
7509
|
}
|
|
7455
|
-
//#endregion
|
|
7456
|
-
//#region UI Property Helper
|
|
7457
7510
|
/**
|
|
7458
|
-
*
|
|
7459
|
-
* @returns Elemente in der Queue
|
|
7511
|
+
* icon for upload button
|
|
7460
7512
|
*/
|
|
7461
|
-
|
|
7462
|
-
return this.
|
|
7513
|
+
get IconUpload() {
|
|
7514
|
+
return this.iconService.UploadComponentUploadIcon;
|
|
7463
7515
|
}
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
* @returns Elemente für Upload vorhanden
|
|
7467
|
-
*/
|
|
7468
|
-
IsStateToUpload() {
|
|
7469
|
-
return (this.uploads.filter((itm) => itm.status === 'added' || itm.status === 'paused').length > 0);
|
|
7516
|
+
get allowedtypes() {
|
|
7517
|
+
return this._allowedtypes;
|
|
7470
7518
|
}
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
* @returns Upload ist am laufen
|
|
7474
|
-
*/
|
|
7475
|
-
IsUploading() {
|
|
7476
|
-
return this.uploads.filter((itm) => itm.status === 'uploading').length > 0;
|
|
7519
|
+
get autoupload() {
|
|
7520
|
+
return this._autoupload;
|
|
7477
7521
|
}
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
* @returns Pausierter Upload ist vorhanden
|
|
7481
|
-
*/
|
|
7482
|
-
IsPaused() {
|
|
7483
|
-
return this.uploads.filter((itm) => itm.status === 'paused').length > 0;
|
|
7522
|
+
get enablepause() {
|
|
7523
|
+
return this._enablepause;
|
|
7484
7524
|
}
|
|
7525
|
+
get endpoint() {
|
|
7526
|
+
return this._endpoint;
|
|
7527
|
+
}
|
|
7528
|
+
// #endregion Public Getters And Setters
|
|
7529
|
+
// #region Public Methods
|
|
7485
7530
|
/**
|
|
7486
7531
|
* Name der Datei die Hochgeladen wird
|
|
7487
7532
|
* @returns Observable des Dateinamens.
|
|
@@ -7494,6 +7539,13 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7494
7539
|
return this.lngResourceService.GetString('UPLOAD_NO_FILE_SELECTED');
|
|
7495
7540
|
}
|
|
7496
7541
|
}
|
|
7542
|
+
/**
|
|
7543
|
+
* Gibt an ob Queue Elemente beinhaltet
|
|
7544
|
+
* @returns Elemente in der Queue
|
|
7545
|
+
*/
|
|
7546
|
+
HasQueueItem() {
|
|
7547
|
+
return this.uploads.length > 0;
|
|
7548
|
+
}
|
|
7497
7549
|
/**
|
|
7498
7550
|
* Gibt an ob ein Upload abgeschlossen ist
|
|
7499
7551
|
* @returns Upload erfolgreich
|
|
@@ -7506,6 +7558,27 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7506
7558
|
return false;
|
|
7507
7559
|
}
|
|
7508
7560
|
}
|
|
7561
|
+
/**
|
|
7562
|
+
* Prüft ob ein Upload pausiert
|
|
7563
|
+
* @returns Pausierter Upload ist vorhanden
|
|
7564
|
+
*/
|
|
7565
|
+
IsPaused() {
|
|
7566
|
+
return this.uploads.filter((itm) => itm.status === 'paused').length > 0;
|
|
7567
|
+
}
|
|
7568
|
+
/**
|
|
7569
|
+
* Prüft ob in der Queue Elemente die zum Upload bereit sind vorhanden sind.
|
|
7570
|
+
* @returns Elemente für Upload vorhanden
|
|
7571
|
+
*/
|
|
7572
|
+
IsStateToUpload() {
|
|
7573
|
+
return (this.uploads.filter((itm) => itm.status === 'added' || itm.status === 'paused').length > 0);
|
|
7574
|
+
}
|
|
7575
|
+
/**
|
|
7576
|
+
* Prüft ob ein Upload eines Files am laufen ist
|
|
7577
|
+
* @returns Upload ist am laufen
|
|
7578
|
+
*/
|
|
7579
|
+
IsUploading() {
|
|
7580
|
+
return this.uploads.filter((itm) => itm.status === 'uploading').length > 0;
|
|
7581
|
+
}
|
|
7509
7582
|
/**
|
|
7510
7583
|
* Gibt den Uploadfortschritt zurück
|
|
7511
7584
|
* @returns Upload Fortschritt. Wert von 0-100
|
|
@@ -7518,67 +7591,42 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7518
7591
|
return 0;
|
|
7519
7592
|
}
|
|
7520
7593
|
}
|
|
7521
|
-
//#endregion
|
|
7522
|
-
//#region Validation
|
|
7523
7594
|
/**
|
|
7524
|
-
*
|
|
7525
|
-
* @param
|
|
7595
|
+
* Cancel single upload
|
|
7596
|
+
* @param uploadId ID of File to cancel
|
|
7526
7597
|
*/
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
if (this.isrequired) {
|
|
7530
|
-
error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
7531
|
-
}
|
|
7532
|
-
return error;
|
|
7598
|
+
cancel(uploadId) {
|
|
7599
|
+
this.uploadService.control({ action: 'cancel', uploadId: uploadId });
|
|
7533
7600
|
}
|
|
7534
|
-
//#endregion
|
|
7535
7601
|
/**
|
|
7536
|
-
*
|
|
7537
|
-
*
|
|
7538
|
-
* @param types Erlaubte File Extensions
|
|
7602
|
+
* Cancel all Uploaded files
|
|
7539
7603
|
*/
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
|
|
7543
|
-
this.renderer.setAttribute(this.uploadInput.nativeElement, 'accept', types);
|
|
7604
|
+
cancelAll() {
|
|
7605
|
+
if (this.HasQueueItem() === true) {
|
|
7606
|
+
this.uploadService.control({ action: 'cancel' });
|
|
7544
7607
|
}
|
|
7545
|
-
this.options.allowedTypes = types;
|
|
7546
|
-
}
|
|
7547
|
-
/**
|
|
7548
|
-
* Setzt den Upload Endpoit
|
|
7549
|
-
* @param url Register URI
|
|
7550
|
-
*/
|
|
7551
|
-
setEndpoint(url) {
|
|
7552
|
-
this.options.endpoint = url;
|
|
7553
7608
|
}
|
|
7554
7609
|
/**
|
|
7555
|
-
*
|
|
7556
|
-
*
|
|
7557
|
-
* @param filename Dateiname
|
|
7610
|
+
* Destroy des Controls
|
|
7558
7611
|
*/
|
|
7559
|
-
|
|
7560
|
-
if (this.
|
|
7561
|
-
|
|
7612
|
+
ngOnDestroy() {
|
|
7613
|
+
if (this.listenerFn) {
|
|
7614
|
+
this.listenerFn();
|
|
7562
7615
|
}
|
|
7563
|
-
let isValid = false;
|
|
7564
|
-
const extensions = this._allowedtypes.split(',');
|
|
7565
|
-
extensions.forEach((itm) => {
|
|
7566
|
-
if (filename.toLowerCase().endsWith(itm.toLowerCase())) {
|
|
7567
|
-
isValid = true;
|
|
7568
|
-
}
|
|
7569
|
-
});
|
|
7570
|
-
return isValid;
|
|
7571
7616
|
}
|
|
7572
7617
|
/**
|
|
7573
|
-
*
|
|
7574
|
-
*
|
|
7575
|
-
* @param filesize Max File Size in Bytes
|
|
7618
|
+
* Initialisiert das Control
|
|
7576
7619
|
*/
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7620
|
+
ngOnInit() {
|
|
7621
|
+
super.ngOnInit();
|
|
7622
|
+
// Init Event Listener for Input File Control and Handling Files
|
|
7623
|
+
this.listenerFn = this.renderer.listen(this.uploadInput.nativeElement, 'change', this.fileListener);
|
|
7624
|
+
this.setAllowedTypes(this._allowedtypes);
|
|
7625
|
+
this.setEndpoint(this._endpoint);
|
|
7626
|
+
if (this._endpoint === null) {
|
|
7627
|
+
throw new Error('endpoint is not defined!');
|
|
7580
7628
|
}
|
|
7581
|
-
|
|
7629
|
+
this.uploadService.connect(this.options);
|
|
7582
7630
|
}
|
|
7583
7631
|
/**
|
|
7584
7632
|
* Upload Event
|
|
@@ -7620,14 +7668,52 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7620
7668
|
this.uploads[index].status = ufile.status;
|
|
7621
7669
|
}
|
|
7622
7670
|
}
|
|
7623
|
-
this.UpdateFileCount();
|
|
7671
|
+
this.UpdateFileCount();
|
|
7672
|
+
}
|
|
7673
|
+
/**
|
|
7674
|
+
* Cancel Single File
|
|
7675
|
+
* @param uploadId ID of File to Cancel
|
|
7676
|
+
*/
|
|
7677
|
+
pause(uploadId) {
|
|
7678
|
+
this.uploadService.control({ action: 'pause', uploadId });
|
|
7679
|
+
}
|
|
7680
|
+
/**
|
|
7681
|
+
* Pause all Uploads
|
|
7682
|
+
*/
|
|
7683
|
+
pauseAll() {
|
|
7684
|
+
if (this.IsUploading() === true) {
|
|
7685
|
+
this.uploadService.control({ action: 'pause' });
|
|
7686
|
+
}
|
|
7624
7687
|
}
|
|
7625
7688
|
/**
|
|
7626
|
-
*
|
|
7689
|
+
* Upload Single File
|
|
7690
|
+
*
|
|
7691
|
+
* @param uploadId ID of File to Upload
|
|
7627
7692
|
*/
|
|
7628
|
-
|
|
7629
|
-
|
|
7693
|
+
upload(uploadId) {
|
|
7694
|
+
this.uploadService.control({ action: 'upload', uploadId });
|
|
7695
|
+
}
|
|
7696
|
+
/**
|
|
7697
|
+
* Upload all queued Files
|
|
7698
|
+
*/
|
|
7699
|
+
uploadAll() {
|
|
7700
|
+
if (this.IsStateToUpload() === true) {
|
|
7701
|
+
this.uploadService.control({ action: 'upload' });
|
|
7702
|
+
}
|
|
7703
|
+
}
|
|
7704
|
+
/**
|
|
7705
|
+
* Validiert das Upload Control
|
|
7706
|
+
* @param c Control das validiert werden soll
|
|
7707
|
+
*/
|
|
7708
|
+
validateData(c) {
|
|
7709
|
+
let error = null;
|
|
7710
|
+
if (this.isrequired) {
|
|
7711
|
+
error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
7712
|
+
}
|
|
7713
|
+
return error;
|
|
7630
7714
|
}
|
|
7715
|
+
// #endregion Public Abstract Methods
|
|
7716
|
+
// #region Private Methods
|
|
7631
7717
|
UpdateFileCount() {
|
|
7632
7718
|
// HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
|
|
7633
7719
|
if (this.ngControl) {
|
|
@@ -7636,140 +7722,127 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7636
7722
|
}
|
|
7637
7723
|
}
|
|
7638
7724
|
/**
|
|
7639
|
-
*
|
|
7725
|
+
* Returns the number of uploaded files
|
|
7640
7726
|
*/
|
|
7641
|
-
|
|
7642
|
-
return this.
|
|
7727
|
+
UploadedFileCount() {
|
|
7728
|
+
return this.uploads.filter((itm) => itm.status === 'complete').length;
|
|
7643
7729
|
}
|
|
7644
7730
|
/**
|
|
7645
|
-
*
|
|
7731
|
+
* Prüft ob die Dateierweiterung gültig ist
|
|
7732
|
+
*
|
|
7733
|
+
* @param filename Dateiname
|
|
7646
7734
|
*/
|
|
7647
|
-
|
|
7648
|
-
|
|
7735
|
+
isExtensionValid(filename) {
|
|
7736
|
+
if (this._allowedtypes === '*') {
|
|
7737
|
+
return true;
|
|
7738
|
+
}
|
|
7739
|
+
let isValid = false;
|
|
7740
|
+
const extensions = this._allowedtypes.split(',');
|
|
7741
|
+
extensions.forEach((itm) => {
|
|
7742
|
+
if (filename.toLowerCase().endsWith(itm.toLowerCase())) {
|
|
7743
|
+
isValid = true;
|
|
7744
|
+
}
|
|
7745
|
+
});
|
|
7746
|
+
return isValid;
|
|
7649
7747
|
}
|
|
7650
7748
|
/**
|
|
7651
|
-
*
|
|
7749
|
+
* Prüft ob das File nicht zu gross ist.
|
|
7750
|
+
*
|
|
7751
|
+
* @param filesize Max File Size in Bytes
|
|
7652
7752
|
*/
|
|
7653
|
-
|
|
7654
|
-
|
|
7753
|
+
isFileSizeValid(filesize) {
|
|
7754
|
+
if (this.maxfilesize === 0) {
|
|
7755
|
+
return true;
|
|
7756
|
+
}
|
|
7757
|
+
return this.maxfilesize >= filesize;
|
|
7655
7758
|
}
|
|
7656
7759
|
/**
|
|
7657
|
-
*
|
|
7760
|
+
* Setzt die erlaubten Datentypen für den Upload
|
|
7761
|
+
*
|
|
7762
|
+
* @param types Erlaubte File Extensions
|
|
7658
7763
|
*/
|
|
7659
|
-
|
|
7660
|
-
|
|
7764
|
+
setAllowedTypes(types) {
|
|
7765
|
+
// Prüfen UploadInput bereits geladen, ist NULL wenn Extension im Markup nach NgModel gesetzt wird.
|
|
7766
|
+
if (this.uploadInput && this.uploadInput.nativeElement) {
|
|
7767
|
+
this.renderer.setAttribute(this.uploadInput.nativeElement, 'accept', types);
|
|
7768
|
+
}
|
|
7769
|
+
this.options.allowedTypes = types;
|
|
7661
7770
|
}
|
|
7662
7771
|
/**
|
|
7663
|
-
*
|
|
7772
|
+
* Setzt den Upload Endpoit
|
|
7773
|
+
* @param url Register URI
|
|
7664
7774
|
*/
|
|
7665
|
-
|
|
7666
|
-
|
|
7775
|
+
setEndpoint(url) {
|
|
7776
|
+
this.options.endpoint = url;
|
|
7667
7777
|
}
|
|
7668
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadBase, deps: [{ token:
|
|
7669
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacUploadBase, inputs: {
|
|
7778
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadBase, deps: [{ token: SacFormLayoutCommon }, { token: i0.Injector }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
7779
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacUploadBase, inputs: { isrequired: "isrequired", maxfilesize: "maxfilesize", validationmessagerequired: "validationmessagerequired", validationmessagesummaryrequired: "validationmessagesummaryrequired", allowedtypes: "allowedtypes", autoupload: "autoupload", enablepause: "enablepause", endpoint: "endpoint" }, outputs: { onfileerror: "onfileerror" }, viewQueries: [{ propertyName: "uploadInput", first: true, predicate: ["files"], descendants: true, static: true }], usesInheritance: true, ngImport: i0 }); }
|
|
7670
7780
|
}
|
|
7671
7781
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadBase, decorators: [{
|
|
7672
7782
|
type: Directive
|
|
7673
|
-
}], ctorParameters: function () { return [{ type:
|
|
7783
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon }, { type: i0.Injector }, { type: i0.Renderer2 }, { type: i0.NgZone }]; }, propDecorators: { uploadInput: [{
|
|
7784
|
+
type: ViewChild,
|
|
7785
|
+
args: ['files', { static: true }]
|
|
7786
|
+
}], isrequired: [{
|
|
7787
|
+
type: Input
|
|
7788
|
+
}], maxfilesize: [{
|
|
7789
|
+
type: Input
|
|
7790
|
+
}], validationmessagerequired: [{
|
|
7674
7791
|
type: Input
|
|
7675
7792
|
}], validationmessagesummaryrequired: [{
|
|
7676
7793
|
type: Input
|
|
7794
|
+
}], onfileerror: [{
|
|
7795
|
+
type: Output
|
|
7677
7796
|
}], allowedtypes: [{
|
|
7678
7797
|
type: Input
|
|
7679
7798
|
}], autoupload: [{
|
|
7680
7799
|
type: Input
|
|
7681
7800
|
}], enablepause: [{
|
|
7682
7801
|
type: Input
|
|
7683
|
-
}], maxfilesize: [{
|
|
7684
|
-
type: Input
|
|
7685
|
-
}], isrequired: [{
|
|
7686
|
-
type: Input
|
|
7687
7802
|
}], endpoint: [{
|
|
7688
7803
|
type: Input
|
|
7689
|
-
}], onfileerror: [{
|
|
7690
|
-
type: Output
|
|
7691
|
-
}], uploadInput: [{
|
|
7692
|
-
type: ViewChild,
|
|
7693
|
-
args: ['files', { static: true }]
|
|
7694
7804
|
}] } });
|
|
7695
|
-
|
|
7696
7805
|
/**
|
|
7697
|
-
* Upload
|
|
7806
|
+
* Klasse für den Upload einer Datei in der Upload Component
|
|
7698
7807
|
*/
|
|
7699
|
-
class
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
/**
|
|
7703
|
-
* Label für Browse Button
|
|
7704
|
-
*/
|
|
7705
|
-
this.buttonbrowse = 'Browse';
|
|
7706
|
-
/**
|
|
7707
|
-
* Label für Upload Button
|
|
7708
|
-
*/
|
|
7709
|
-
this.buttonupload = 'Upload';
|
|
7710
|
-
}
|
|
7711
|
-
/**
|
|
7712
|
-
* Macht keine Validierung in diesem Control
|
|
7713
|
-
*
|
|
7714
|
-
* @param file File das hinzugefügt wurde
|
|
7715
|
-
*/
|
|
7716
|
-
CustomAddValidation(file) {
|
|
7717
|
-
return true;
|
|
7718
|
-
}
|
|
7808
|
+
class SacUploadFile {
|
|
7809
|
+
// #endregion Properties
|
|
7810
|
+
// #region Constructors
|
|
7719
7811
|
/**
|
|
7720
|
-
*
|
|
7721
|
-
*
|
|
7722
|
-
* @param file ID des Files
|
|
7812
|
+
* Konstruktor
|
|
7813
|
+
* @param ufile Upload Status
|
|
7723
7814
|
*/
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
file.response !== null &&
|
|
7731
|
-
file.response.documentid !== null &&
|
|
7732
|
-
file.response.documentid !== undefined) {
|
|
7733
|
-
super.setValue(file.response.documentid);
|
|
7734
|
-
}
|
|
7735
|
-
else {
|
|
7736
|
-
super.setValue(file.uploadId);
|
|
7737
|
-
}
|
|
7738
|
-
}
|
|
7815
|
+
constructor(ufile) {
|
|
7816
|
+
this.uploadId = ufile.uploadId;
|
|
7817
|
+
this.name = ufile.name;
|
|
7818
|
+
this.progress = ufile.progress;
|
|
7819
|
+
this.status = ufile.status;
|
|
7820
|
+
this.documentid = null;
|
|
7739
7821
|
}
|
|
7740
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadSingleCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
7741
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacUploadSingleCommon, inputs: { buttonbrowse: "buttonbrowse", buttonupload: "buttonupload" }, usesInheritance: true, ngImport: i0 }); }
|
|
7742
7822
|
}
|
|
7743
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadSingleCommon, decorators: [{
|
|
7744
|
-
type: Directive
|
|
7745
|
-
}], propDecorators: { buttonbrowse: [{
|
|
7746
|
-
type: Input
|
|
7747
|
-
}], buttonupload: [{
|
|
7748
|
-
type: Input
|
|
7749
|
-
}] } });
|
|
7750
7823
|
|
|
7751
7824
|
/**
|
|
7752
|
-
* Upload
|
|
7825
|
+
* Upload Komponente für ein einzelnes File
|
|
7753
7826
|
*/
|
|
7754
|
-
class
|
|
7827
|
+
class SacDropzoneMultipleCommon extends SacUploadBase {
|
|
7755
7828
|
constructor() {
|
|
7756
7829
|
super(...arguments);
|
|
7757
7830
|
/**
|
|
7758
|
-
*
|
|
7831
|
+
* Property wenn Drag Event aktiv ist (Maus über Zone)
|
|
7759
7832
|
*/
|
|
7760
|
-
this.
|
|
7833
|
+
this.active = false;
|
|
7761
7834
|
/**
|
|
7762
|
-
*
|
|
7835
|
+
* Höhe des Upload Controls
|
|
7763
7836
|
*/
|
|
7764
|
-
this.
|
|
7837
|
+
this.uploadheight = null;
|
|
7765
7838
|
/**
|
|
7766
|
-
*
|
|
7839
|
+
* Max. Anzahl Files die hochgeladen werden können
|
|
7767
7840
|
*/
|
|
7768
|
-
this.
|
|
7841
|
+
this.maxfiles = 0;
|
|
7769
7842
|
/**
|
|
7770
|
-
*
|
|
7843
|
+
* Min. Anzahl Files die hochgeladen werden müssen
|
|
7771
7844
|
*/
|
|
7772
|
-
this.
|
|
7845
|
+
this.minfiles = 0;
|
|
7773
7846
|
/**
|
|
7774
7847
|
* Resource Key für Validation Message Required bei Control
|
|
7775
7848
|
*/
|
|
@@ -7779,6 +7852,49 @@ class SacUploadMultipleCommon extends SacUploadBase {
|
|
|
7779
7852
|
*/
|
|
7780
7853
|
this.validationmessagesummaryminfiles = 'VALIDATION_ERROR_SUMMARY_FILESMIN';
|
|
7781
7854
|
}
|
|
7855
|
+
/**
|
|
7856
|
+
* Ervent wenn das Control initialisert wird
|
|
7857
|
+
*/
|
|
7858
|
+
ngOnInit() {
|
|
7859
|
+
super.ngOnInit();
|
|
7860
|
+
this.autoupload = true;
|
|
7861
|
+
}
|
|
7862
|
+
/**
|
|
7863
|
+
* Methode für Drag and Drop von Files
|
|
7864
|
+
* @param event Drag Event
|
|
7865
|
+
*/
|
|
7866
|
+
dropHandler(event) {
|
|
7867
|
+
if (event.dataTransfer &&
|
|
7868
|
+
event.dataTransfer.files &&
|
|
7869
|
+
event.dataTransfer.files.item(0)) {
|
|
7870
|
+
event.stopPropagation();
|
|
7871
|
+
event.preventDefault();
|
|
7872
|
+
this.active = false;
|
|
7873
|
+
this.uploadService.handleFiles(event.dataTransfer.files);
|
|
7874
|
+
}
|
|
7875
|
+
}
|
|
7876
|
+
/**
|
|
7877
|
+
* Methode wenn Drag in die Zone eintritt
|
|
7878
|
+
* @param event DragEnter Event
|
|
7879
|
+
*/
|
|
7880
|
+
onDragOver(event) {
|
|
7881
|
+
if (event.dataTransfer &&
|
|
7882
|
+
event.dataTransfer.files &&
|
|
7883
|
+
event.dataTransfer.types.every((itm) => itm === 'Files') &&
|
|
7884
|
+
event.dataTransfer.types.length > 0) {
|
|
7885
|
+
event.dataTransfer.dropEffect = 'copy';
|
|
7886
|
+
event.stopPropagation();
|
|
7887
|
+
event.preventDefault();
|
|
7888
|
+
this.active = true;
|
|
7889
|
+
}
|
|
7890
|
+
}
|
|
7891
|
+
/**
|
|
7892
|
+
* Methode wenn Drag die Zone verlässt
|
|
7893
|
+
* @param event DragLeave Event
|
|
7894
|
+
*/
|
|
7895
|
+
onDragLeave(event) {
|
|
7896
|
+
this.active = false;
|
|
7897
|
+
}
|
|
7782
7898
|
/**
|
|
7783
7899
|
* Prüft ob die max. Files in der Queue nicht überschritten werden
|
|
7784
7900
|
*
|
|
@@ -7849,18 +7965,16 @@ class SacUploadMultipleCommon extends SacUploadBase {
|
|
|
7849
7965
|
}
|
|
7850
7966
|
return error;
|
|
7851
7967
|
}
|
|
7852
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
7853
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type:
|
|
7968
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDropzoneMultipleCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
7969
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacDropzoneMultipleCommon, inputs: { uploadheight: "uploadheight", maxfiles: "maxfiles", minfiles: "minfiles", validationmessageminfiles: "validationmessageminfiles", validationmessagesummaryminfiles: "validationmessagesummaryminfiles" }, usesInheritance: true, ngImport: i0 }); }
|
|
7854
7970
|
}
|
|
7855
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
7971
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDropzoneMultipleCommon, decorators: [{
|
|
7856
7972
|
type: Directive
|
|
7857
|
-
}], propDecorators: {
|
|
7858
|
-
type: Input
|
|
7859
|
-
}], minfiles: [{
|
|
7973
|
+
}], propDecorators: { uploadheight: [{
|
|
7860
7974
|
type: Input
|
|
7861
|
-
}],
|
|
7975
|
+
}], maxfiles: [{
|
|
7862
7976
|
type: Input
|
|
7863
|
-
}],
|
|
7977
|
+
}], minfiles: [{
|
|
7864
7978
|
type: Input
|
|
7865
7979
|
}], validationmessageminfiles: [{
|
|
7866
7980
|
type: Input
|
|
@@ -7972,27 +8086,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7972
8086
|
}] } });
|
|
7973
8087
|
|
|
7974
8088
|
/**
|
|
7975
|
-
* Upload
|
|
8089
|
+
* Upload Componente für mehrere Files
|
|
7976
8090
|
*/
|
|
7977
|
-
class
|
|
8091
|
+
class SacUploadMultipleCommon extends SacUploadBase {
|
|
7978
8092
|
constructor() {
|
|
7979
8093
|
super(...arguments);
|
|
7980
8094
|
/**
|
|
7981
|
-
*
|
|
8095
|
+
* Max. Files die hochgeladen werden können. 0 deaktiviert das Limit
|
|
7982
8096
|
*/
|
|
7983
|
-
this.
|
|
8097
|
+
this.maxfiles = 0;
|
|
7984
8098
|
/**
|
|
7985
|
-
*
|
|
8099
|
+
* Min. Files die hochgeladen werden müssen. 0 deaktiviert das Limit
|
|
7986
8100
|
*/
|
|
7987
|
-
this.
|
|
8101
|
+
this.minfiles = 0;
|
|
7988
8102
|
/**
|
|
7989
|
-
*
|
|
8103
|
+
* Label für Browse Button
|
|
7990
8104
|
*/
|
|
7991
|
-
this.
|
|
8105
|
+
this.buttonbrowse = 'Browse';
|
|
7992
8106
|
/**
|
|
7993
|
-
*
|
|
8107
|
+
* Label für Upload Button
|
|
7994
8108
|
*/
|
|
7995
|
-
this.
|
|
8109
|
+
this.buttonupload = 'Upload';
|
|
7996
8110
|
/**
|
|
7997
8111
|
* Resource Key für Validation Message Required bei Control
|
|
7998
8112
|
*/
|
|
@@ -8002,49 +8116,6 @@ class SacDropzoneMultipleCommon extends SacUploadBase {
|
|
|
8002
8116
|
*/
|
|
8003
8117
|
this.validationmessagesummaryminfiles = 'VALIDATION_ERROR_SUMMARY_FILESMIN';
|
|
8004
8118
|
}
|
|
8005
|
-
/**
|
|
8006
|
-
* Ervent wenn das Control initialisert wird
|
|
8007
|
-
*/
|
|
8008
|
-
ngOnInit() {
|
|
8009
|
-
super.ngOnInit();
|
|
8010
|
-
this.autoupload = true;
|
|
8011
|
-
}
|
|
8012
|
-
/**
|
|
8013
|
-
* Methode für Drag and Drop von Files
|
|
8014
|
-
* @param event Drag Event
|
|
8015
|
-
*/
|
|
8016
|
-
dropHandler(event) {
|
|
8017
|
-
if (event.dataTransfer &&
|
|
8018
|
-
event.dataTransfer.files &&
|
|
8019
|
-
event.dataTransfer.files.item(0)) {
|
|
8020
|
-
event.stopPropagation();
|
|
8021
|
-
event.preventDefault();
|
|
8022
|
-
this.active = false;
|
|
8023
|
-
this.uploadService.handleFiles(event.dataTransfer.files);
|
|
8024
|
-
}
|
|
8025
|
-
}
|
|
8026
|
-
/**
|
|
8027
|
-
* Methode wenn Drag in die Zone eintritt
|
|
8028
|
-
* @param event DragEnter Event
|
|
8029
|
-
*/
|
|
8030
|
-
onDragOver(event) {
|
|
8031
|
-
if (event.dataTransfer &&
|
|
8032
|
-
event.dataTransfer.files &&
|
|
8033
|
-
event.dataTransfer.types.every((itm) => itm === 'Files') &&
|
|
8034
|
-
event.dataTransfer.types.length > 0) {
|
|
8035
|
-
event.dataTransfer.dropEffect = 'copy';
|
|
8036
|
-
event.stopPropagation();
|
|
8037
|
-
event.preventDefault();
|
|
8038
|
-
this.active = true;
|
|
8039
|
-
}
|
|
8040
|
-
}
|
|
8041
|
-
/**
|
|
8042
|
-
* Methode wenn Drag die Zone verlässt
|
|
8043
|
-
* @param event DragLeave Event
|
|
8044
|
-
*/
|
|
8045
|
-
onDragLeave(event) {
|
|
8046
|
-
this.active = false;
|
|
8047
|
-
}
|
|
8048
8119
|
/**
|
|
8049
8120
|
* Prüft ob die max. Files in der Queue nicht überschritten werden
|
|
8050
8121
|
*
|
|
@@ -8115,33 +8186,91 @@ class SacDropzoneMultipleCommon extends SacUploadBase {
|
|
|
8115
8186
|
}
|
|
8116
8187
|
return error;
|
|
8117
8188
|
}
|
|
8118
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
8119
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type:
|
|
8189
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadMultipleCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
8190
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacUploadMultipleCommon, inputs: { maxfiles: "maxfiles", minfiles: "minfiles", buttonbrowse: "buttonbrowse", buttonupload: "buttonupload", validationmessageminfiles: "validationmessageminfiles", validationmessagesummaryminfiles: "validationmessagesummaryminfiles" }, usesInheritance: true, ngImport: i0 }); }
|
|
8120
8191
|
}
|
|
8121
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
8192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadMultipleCommon, decorators: [{
|
|
8122
8193
|
type: Directive
|
|
8123
|
-
}], propDecorators: {
|
|
8124
|
-
type: Input
|
|
8125
|
-
}], maxfiles: [{
|
|
8194
|
+
}], propDecorators: { maxfiles: [{
|
|
8126
8195
|
type: Input
|
|
8127
8196
|
}], minfiles: [{
|
|
8128
8197
|
type: Input
|
|
8198
|
+
}], buttonbrowse: [{
|
|
8199
|
+
type: Input
|
|
8200
|
+
}], buttonupload: [{
|
|
8201
|
+
type: Input
|
|
8129
8202
|
}], validationmessageminfiles: [{
|
|
8130
8203
|
type: Input
|
|
8131
8204
|
}], validationmessagesummaryminfiles: [{
|
|
8132
8205
|
type: Input
|
|
8133
8206
|
}] } });
|
|
8134
8207
|
|
|
8208
|
+
/**
|
|
8209
|
+
* Upload Komponente für ein einzelnes File
|
|
8210
|
+
*/
|
|
8211
|
+
class SacUploadSingleCommon extends SacUploadBase {
|
|
8212
|
+
constructor() {
|
|
8213
|
+
super(...arguments);
|
|
8214
|
+
/**
|
|
8215
|
+
* Label für Browse Button
|
|
8216
|
+
*/
|
|
8217
|
+
this.buttonbrowse = 'Browse';
|
|
8218
|
+
/**
|
|
8219
|
+
* Label für Upload Button
|
|
8220
|
+
*/
|
|
8221
|
+
this.buttonupload = 'Upload';
|
|
8222
|
+
}
|
|
8223
|
+
/**
|
|
8224
|
+
* Macht keine Validierung in diesem Control
|
|
8225
|
+
*
|
|
8226
|
+
* @param file File das hinzugefügt wurde
|
|
8227
|
+
*/
|
|
8228
|
+
CustomAddValidation(file) {
|
|
8229
|
+
return true;
|
|
8230
|
+
}
|
|
8231
|
+
/**
|
|
8232
|
+
* Setzt die File ID des hochgeladen Files in das Model
|
|
8233
|
+
*
|
|
8234
|
+
* @param file ID des Files
|
|
8235
|
+
*/
|
|
8236
|
+
SetUploadValue(file) {
|
|
8237
|
+
if (file === null) {
|
|
8238
|
+
super.setValue(null);
|
|
8239
|
+
}
|
|
8240
|
+
else {
|
|
8241
|
+
if (file.response !== undefined &&
|
|
8242
|
+
file.response !== null &&
|
|
8243
|
+
file.response.documentid !== null &&
|
|
8244
|
+
file.response.documentid !== undefined) {
|
|
8245
|
+
super.setValue(file.response.documentid);
|
|
8246
|
+
}
|
|
8247
|
+
else {
|
|
8248
|
+
super.setValue(file.uploadId);
|
|
8249
|
+
}
|
|
8250
|
+
}
|
|
8251
|
+
}
|
|
8252
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadSingleCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
8253
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacUploadSingleCommon, inputs: { buttonbrowse: "buttonbrowse", buttonupload: "buttonupload" }, usesInheritance: true, ngImport: i0 }); }
|
|
8254
|
+
}
|
|
8255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadSingleCommon, decorators: [{
|
|
8256
|
+
type: Directive
|
|
8257
|
+
}], propDecorators: { buttonbrowse: [{
|
|
8258
|
+
type: Input
|
|
8259
|
+
}], buttonupload: [{
|
|
8260
|
+
type: Input
|
|
8261
|
+
}] } });
|
|
8262
|
+
|
|
8135
8263
|
/**
|
|
8136
8264
|
* Base Klasse für Multi Language Input Control
|
|
8137
8265
|
*/
|
|
8138
8266
|
class SacMultilanguageInputCommon extends SacInputBase {
|
|
8139
8267
|
/**
|
|
8140
|
-
*
|
|
8141
|
-
*
|
|
8268
|
+
* Constructor
|
|
8269
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
8270
|
+
* @param injector Injector for injecting services
|
|
8142
8271
|
*/
|
|
8143
|
-
constructor(
|
|
8144
|
-
super(
|
|
8272
|
+
constructor(formlayout, injector) {
|
|
8273
|
+
super(formlayout, injector);
|
|
8145
8274
|
/**
|
|
8146
8275
|
* Max länge an Zeichen für Eingabefeld
|
|
8147
8276
|
*/
|
|
@@ -8330,12 +8459,12 @@ class SacMultilanguageInputCommon extends SacInputBase {
|
|
|
8330
8459
|
}
|
|
8331
8460
|
return error;
|
|
8332
8461
|
}
|
|
8333
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacMultilanguageInputCommon, deps: [{ token:
|
|
8462
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacMultilanguageInputCommon, deps: [{ token: SacFormLayoutCommon, host: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
8334
8463
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacMultilanguageInputCommon, inputs: { maxlength: "maxlength", controlwidth: "controlwidth", requiredany: "requiredany", validationmessagerequired: "validationmessagerequired", validationmessagesummaryrequired: "validationmessagesummaryrequired", validationmessagerequiredany: "validationmessagerequiredany", validationmessagesummaryrequiredany: "validationmessagesummaryrequiredany" }, usesInheritance: true, ngImport: i0 }); }
|
|
8335
8464
|
}
|
|
8336
8465
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacMultilanguageInputCommon, decorators: [{
|
|
8337
8466
|
type: Directive
|
|
8338
|
-
}], ctorParameters: function () { return [{ type:
|
|
8467
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
8339
8468
|
type: Host
|
|
8340
8469
|
}] }, { type: i0.Injector }]; }, propDecorators: { maxlength: [{
|
|
8341
8470
|
type: Input
|
|
@@ -8358,11 +8487,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
8358
8487
|
*/
|
|
8359
8488
|
class SacMultilanguageInputAreaCommon extends SacInputBase {
|
|
8360
8489
|
/**
|
|
8361
|
-
*
|
|
8362
|
-
*
|
|
8490
|
+
* Constructor
|
|
8491
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
8492
|
+
* @param injector Injector for injecting services
|
|
8363
8493
|
*/
|
|
8364
|
-
constructor(
|
|
8365
|
-
super(
|
|
8494
|
+
constructor(formlayout, injector) {
|
|
8495
|
+
super(formlayout, injector);
|
|
8366
8496
|
/**
|
|
8367
8497
|
* Max länge an Zeichen für Eingabefeld
|
|
8368
8498
|
*/
|
|
@@ -8519,142 +8649,62 @@ class SacMultilanguageInputAreaCommon extends SacInputBase {
|
|
|
8519
8649
|
}
|
|
8520
8650
|
if (this.value[itm.IsoCode] === undefined ||
|
|
8521
8651
|
this.value[itm.IsoCode] === '' ||
|
|
8522
|
-
this.value[itm.IsoCode] === null) {
|
|
8523
|
-
found = true;
|
|
8524
|
-
return;
|
|
8525
|
-
}
|
|
8526
|
-
});
|
|
8527
|
-
}
|
|
8528
|
-
return found;
|
|
8529
|
-
}
|
|
8530
|
-
/**
|
|
8531
|
-
* Methode validiert, ob der Wert den gegebenen Kriterien entspricht
|
|
8532
|
-
* @param c Controls das validiert wird
|
|
8533
|
-
*/
|
|
8534
|
-
validateData(c) {
|
|
8535
|
-
let error = null;
|
|
8536
|
-
if (error === null &&
|
|
8537
|
-
c.value !== null &&
|
|
8538
|
-
c.value !== undefined &&
|
|
8539
|
-
c.value !== '' &&
|
|
8540
|
-
this.isrequired !== undefined &&
|
|
8541
|
-
this.isrequired === true) {
|
|
8542
|
-
error = Validation.multilanguageRequired(this.languages, this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
8543
|
-
}
|
|
8544
|
-
if (error === null &&
|
|
8545
|
-
c.value !== null &&
|
|
8546
|
-
c.value !== undefined &&
|
|
8547
|
-
c.value !== '' &&
|
|
8548
|
-
this.requiredany !== undefined &&
|
|
8549
|
-
this.requiredany === true) {
|
|
8550
|
-
error = Validation.multilanguageRequiredAny(this.languages, this.validationmessagerequiredany, this.validationmessagesummaryrequiredany)(c);
|
|
8551
|
-
}
|
|
8552
|
-
return error;
|
|
8553
|
-
}
|
|
8554
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacMultilanguageInputAreaCommon, deps: [{ token: SacFormCommon, host: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
8555
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacMultilanguageInputAreaCommon, inputs: { maxlength: "maxlength", rows: "rows", controlwidth: "controlwidth", requiredany: "requiredany", validationmessagerequired: "validationmessagerequired", validationmessagesummaryrequired: "validationmessagesummaryrequired", validationmessagerequiredany: "validationmessagerequiredany", validationmessagesummaryrequiredany: "validationmessagesummaryrequiredany" }, usesInheritance: true, ngImport: i0 }); }
|
|
8556
|
-
}
|
|
8557
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacMultilanguageInputAreaCommon, decorators: [{
|
|
8558
|
-
type: Directive
|
|
8559
|
-
}], ctorParameters: function () { return [{ type: SacFormCommon, decorators: [{
|
|
8560
|
-
type: Host
|
|
8561
|
-
}] }, { type: i0.Injector }]; }, propDecorators: { maxlength: [{
|
|
8562
|
-
type: Input
|
|
8563
|
-
}], rows: [{
|
|
8564
|
-
type: Input
|
|
8565
|
-
}], controlwidth: [{
|
|
8566
|
-
type: Input
|
|
8567
|
-
}], requiredany: [{
|
|
8568
|
-
type: Input
|
|
8569
|
-
}], validationmessagerequired: [{
|
|
8570
|
-
type: Input
|
|
8571
|
-
}], validationmessagesummaryrequired: [{
|
|
8572
|
-
type: Input
|
|
8573
|
-
}], validationmessagerequiredany: [{
|
|
8574
|
-
type: Input
|
|
8575
|
-
}], validationmessagesummaryrequiredany: [{
|
|
8576
|
-
type: Input
|
|
8577
|
-
}] } });
|
|
8578
|
-
|
|
8579
|
-
/**
|
|
8580
|
-
* Basis Klasse für Confirm Service implementation
|
|
8581
|
-
*/
|
|
8582
|
-
class ServiceConfirmCommon {
|
|
8583
|
-
/**
|
|
8584
|
-
* Konstruktor
|
|
8585
|
-
* @param appRef ApplicationRef zum Anhängen des Dialogs an den Content
|
|
8586
|
-
* @param injector Injector um die Instanz zu erzeuge
|
|
8587
|
-
*/
|
|
8588
|
-
constructor(appRef, injector) {
|
|
8589
|
-
this.appRef = appRef;
|
|
8590
|
-
this.injector = injector;
|
|
8591
|
-
//#region Properties
|
|
8592
|
-
/**
|
|
8593
|
-
* Referenz auf IConfirm Instanz.
|
|
8594
|
-
*/
|
|
8595
|
-
this.component = null;
|
|
8596
|
-
this.localisationService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService());
|
|
8597
|
-
this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
|
|
8598
|
-
}
|
|
8599
|
-
/**
|
|
8600
|
-
* Erzeugt eine Instanz für den Dialog
|
|
8601
|
-
*/
|
|
8602
|
-
CreateInstance() {
|
|
8603
|
-
// ComponentFactory aus Service laden
|
|
8604
|
-
const factory = this.GetComponentFactory();
|
|
8605
|
-
// Instanz der Komponente erzeugen und an die View anhängen
|
|
8606
|
-
this.component = factory.create(this.injector);
|
|
8607
|
-
this.appRef.attachView(this.component.hostView);
|
|
8608
|
-
}
|
|
8609
|
-
/**
|
|
8610
|
-
* Entfernt die Instanz des Dialogs
|
|
8611
|
-
*/
|
|
8612
|
-
DestroyInstance() {
|
|
8613
|
-
// Dialog aus View entfernen und Komponenten löschen
|
|
8614
|
-
this.appRef.detachView(this.component.hostView);
|
|
8615
|
-
this.component.destroy();
|
|
8616
|
-
}
|
|
8617
|
-
/**
|
|
8618
|
-
* Zeigt den Dialog an
|
|
8619
|
-
*/
|
|
8620
|
-
OpenDialog() {
|
|
8621
|
-
const dialog = this.component.instance;
|
|
8622
|
-
dialog.show();
|
|
8623
|
-
return dialog;
|
|
8624
|
-
}
|
|
8625
|
-
/**
|
|
8626
|
-
* Blendet den Dialog aus
|
|
8627
|
-
*/
|
|
8628
|
-
CloseDialog() {
|
|
8629
|
-
const dialog = this.component.instance;
|
|
8630
|
-
dialog.hide();
|
|
8631
|
-
}
|
|
8632
|
-
/**
|
|
8633
|
-
* Interne Methode für die Implementation des Confirm Dialogs. Steuert die Feedbacks, die Erzeugung und Anzeige des Dialogs
|
|
8634
|
-
*/
|
|
8635
|
-
Confirm() {
|
|
8636
|
-
// Dialog erzeugen
|
|
8637
|
-
this.CreateInstance();
|
|
8638
|
-
const instance = this.OpenDialog();
|
|
8639
|
-
// Konfiguration der Dialog Instanz durch Service Implementation zulassen
|
|
8640
|
-
this.ConfigureDialog(instance);
|
|
8641
|
-
// Event Emitter für Confirmation im Service. Event Emitter Asynchron initialiseren
|
|
8642
|
-
const confirmTask = new EventEmitter(true);
|
|
8643
|
-
// Callback wenn Dialog bestätigt wurde
|
|
8644
|
-
instance.onconfirm.subscribe((value) => {
|
|
8645
|
-
// Dialog entfernen
|
|
8646
|
-
this.CloseDialog();
|
|
8647
|
-
// Emit auf Service auslösen
|
|
8648
|
-
confirmTask.emit(value);
|
|
8649
|
-
}, (err) => {
|
|
8650
|
-
// Do nothing on Error
|
|
8651
|
-
}, () => {
|
|
8652
|
-
this.DestroyInstance();
|
|
8653
|
-
});
|
|
8654
|
-
// Confirm Emitter für Result zurückgeben
|
|
8655
|
-
return confirmTask;
|
|
8652
|
+
this.value[itm.IsoCode] === null) {
|
|
8653
|
+
found = true;
|
|
8654
|
+
return;
|
|
8655
|
+
}
|
|
8656
|
+
});
|
|
8657
|
+
}
|
|
8658
|
+
return found;
|
|
8659
|
+
}
|
|
8660
|
+
/**
|
|
8661
|
+
* Methode validiert, ob der Wert den gegebenen Kriterien entspricht
|
|
8662
|
+
* @param c Controls das validiert wird
|
|
8663
|
+
*/
|
|
8664
|
+
validateData(c) {
|
|
8665
|
+
let error = null;
|
|
8666
|
+
if (error === null &&
|
|
8667
|
+
c.value !== null &&
|
|
8668
|
+
c.value !== undefined &&
|
|
8669
|
+
c.value !== '' &&
|
|
8670
|
+
this.isrequired !== undefined &&
|
|
8671
|
+
this.isrequired === true) {
|
|
8672
|
+
error = Validation.multilanguageRequired(this.languages, this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
8673
|
+
}
|
|
8674
|
+
if (error === null &&
|
|
8675
|
+
c.value !== null &&
|
|
8676
|
+
c.value !== undefined &&
|
|
8677
|
+
c.value !== '' &&
|
|
8678
|
+
this.requiredany !== undefined &&
|
|
8679
|
+
this.requiredany === true) {
|
|
8680
|
+
error = Validation.multilanguageRequiredAny(this.languages, this.validationmessagerequiredany, this.validationmessagesummaryrequiredany)(c);
|
|
8681
|
+
}
|
|
8682
|
+
return error;
|
|
8656
8683
|
}
|
|
8684
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacMultilanguageInputAreaCommon, deps: [{ token: SacFormLayoutCommon, host: true }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
8685
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacMultilanguageInputAreaCommon, inputs: { maxlength: "maxlength", rows: "rows", controlwidth: "controlwidth", requiredany: "requiredany", validationmessagerequired: "validationmessagerequired", validationmessagesummaryrequired: "validationmessagesummaryrequired", validationmessagerequiredany: "validationmessagerequiredany", validationmessagesummaryrequiredany: "validationmessagesummaryrequiredany" }, usesInheritance: true, ngImport: i0 }); }
|
|
8657
8686
|
}
|
|
8687
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacMultilanguageInputAreaCommon, decorators: [{
|
|
8688
|
+
type: Directive
|
|
8689
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
8690
|
+
type: Host
|
|
8691
|
+
}] }, { type: i0.Injector }]; }, propDecorators: { maxlength: [{
|
|
8692
|
+
type: Input
|
|
8693
|
+
}], rows: [{
|
|
8694
|
+
type: Input
|
|
8695
|
+
}], controlwidth: [{
|
|
8696
|
+
type: Input
|
|
8697
|
+
}], requiredany: [{
|
|
8698
|
+
type: Input
|
|
8699
|
+
}], validationmessagerequired: [{
|
|
8700
|
+
type: Input
|
|
8701
|
+
}], validationmessagesummaryrequired: [{
|
|
8702
|
+
type: Input
|
|
8703
|
+
}], validationmessagerequiredany: [{
|
|
8704
|
+
type: Input
|
|
8705
|
+
}], validationmessagesummaryrequiredany: [{
|
|
8706
|
+
type: Input
|
|
8707
|
+
}] } });
|
|
8658
8708
|
|
|
8659
8709
|
/**
|
|
8660
8710
|
* Basis Klasse für Confirm Dialog
|
|
@@ -8757,6 +8807,86 @@ class SacConfirmButton {
|
|
|
8757
8807
|
}
|
|
8758
8808
|
}
|
|
8759
8809
|
|
|
8810
|
+
/**
|
|
8811
|
+
* Basis Klasse für Confirm Service implementation
|
|
8812
|
+
*/
|
|
8813
|
+
class ServiceConfirmCommon {
|
|
8814
|
+
/**
|
|
8815
|
+
* Konstruktor
|
|
8816
|
+
* @param appRef ApplicationRef zum Anhängen des Dialogs an den Content
|
|
8817
|
+
* @param injector Injector um die Instanz zu erzeuge
|
|
8818
|
+
*/
|
|
8819
|
+
constructor(appRef, injector) {
|
|
8820
|
+
this.appRef = appRef;
|
|
8821
|
+
this.injector = injector;
|
|
8822
|
+
//#region Properties
|
|
8823
|
+
/**
|
|
8824
|
+
* Referenz auf IConfirm Instanz.
|
|
8825
|
+
*/
|
|
8826
|
+
this.component = null;
|
|
8827
|
+
this.localisationService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService());
|
|
8828
|
+
this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
|
|
8829
|
+
}
|
|
8830
|
+
/**
|
|
8831
|
+
* Erzeugt eine Instanz für den Dialog
|
|
8832
|
+
*/
|
|
8833
|
+
CreateInstance() {
|
|
8834
|
+
// ComponentFactory aus Service laden
|
|
8835
|
+
const factory = this.GetComponentFactory();
|
|
8836
|
+
// Instanz der Komponente erzeugen und an die View anhängen
|
|
8837
|
+
this.component = factory.create(this.injector);
|
|
8838
|
+
this.appRef.attachView(this.component.hostView);
|
|
8839
|
+
}
|
|
8840
|
+
/**
|
|
8841
|
+
* Entfernt die Instanz des Dialogs
|
|
8842
|
+
*/
|
|
8843
|
+
DestroyInstance() {
|
|
8844
|
+
// Dialog aus View entfernen und Komponenten löschen
|
|
8845
|
+
this.appRef.detachView(this.component.hostView);
|
|
8846
|
+
this.component.destroy();
|
|
8847
|
+
}
|
|
8848
|
+
/**
|
|
8849
|
+
* Zeigt den Dialog an
|
|
8850
|
+
*/
|
|
8851
|
+
OpenDialog() {
|
|
8852
|
+
const dialog = this.component.instance;
|
|
8853
|
+
dialog.show();
|
|
8854
|
+
return dialog;
|
|
8855
|
+
}
|
|
8856
|
+
/**
|
|
8857
|
+
* Blendet den Dialog aus
|
|
8858
|
+
*/
|
|
8859
|
+
CloseDialog() {
|
|
8860
|
+
const dialog = this.component.instance;
|
|
8861
|
+
dialog.hide();
|
|
8862
|
+
}
|
|
8863
|
+
/**
|
|
8864
|
+
* Interne Methode für die Implementation des Confirm Dialogs. Steuert die Feedbacks, die Erzeugung und Anzeige des Dialogs
|
|
8865
|
+
*/
|
|
8866
|
+
Confirm() {
|
|
8867
|
+
// Dialog erzeugen
|
|
8868
|
+
this.CreateInstance();
|
|
8869
|
+
const instance = this.OpenDialog();
|
|
8870
|
+
// Konfiguration der Dialog Instanz durch Service Implementation zulassen
|
|
8871
|
+
this.ConfigureDialog(instance);
|
|
8872
|
+
// Event Emitter für Confirmation im Service. Event Emitter Asynchron initialiseren
|
|
8873
|
+
const confirmTask = new EventEmitter(true);
|
|
8874
|
+
// Callback wenn Dialog bestätigt wurde
|
|
8875
|
+
instance.onconfirm.subscribe((value) => {
|
|
8876
|
+
// Dialog entfernen
|
|
8877
|
+
this.CloseDialog();
|
|
8878
|
+
// Emit auf Service auslösen
|
|
8879
|
+
confirmTask.emit(value);
|
|
8880
|
+
}, (err) => {
|
|
8881
|
+
// Do nothing on Error
|
|
8882
|
+
}, () => {
|
|
8883
|
+
this.DestroyInstance();
|
|
8884
|
+
});
|
|
8885
|
+
// Confirm Emitter für Result zurückgeben
|
|
8886
|
+
return confirmTask;
|
|
8887
|
+
}
|
|
8888
|
+
}
|
|
8889
|
+
|
|
8760
8890
|
/**
|
|
8761
8891
|
* Position Utility Klasse
|
|
8762
8892
|
* @see https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/util/positioning.ts
|
|
@@ -9062,12 +9192,14 @@ function positionElements(hostElement, targetElement, placement, appendToBody, b
|
|
|
9062
9192
|
* Base Context Menu Anchor Component für Open/Close Event
|
|
9063
9193
|
*/
|
|
9064
9194
|
class SacContextmenuAnchorCommon {
|
|
9195
|
+
// #endregion Properties
|
|
9196
|
+
// #region Constructors
|
|
9065
9197
|
/**
|
|
9066
9198
|
* Konstruktor
|
|
9067
|
-
* @param
|
|
9199
|
+
* @param elementRef Refernz auf das HTML welcher als Anker für das Context Menü verwendet wird
|
|
9068
9200
|
*/
|
|
9069
|
-
constructor(
|
|
9070
|
-
this.nativeElement =
|
|
9201
|
+
constructor(elementRef) {
|
|
9202
|
+
this.nativeElement = elementRef.nativeElement;
|
|
9071
9203
|
}
|
|
9072
9204
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacContextmenuAnchorCommon, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
9073
9205
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacContextmenuAnchorCommon, ngImport: i0 }); }
|
|
@@ -9080,12 +9212,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
9080
9212
|
* Common Marker Klasse für den Menü Container
|
|
9081
9213
|
*/
|
|
9082
9214
|
class SacContextMenuContrainerCommon {
|
|
9215
|
+
// #endregion Properties
|
|
9216
|
+
// #region Constructors
|
|
9083
9217
|
/**
|
|
9084
9218
|
* Konstruktor
|
|
9085
|
-
* @param
|
|
9219
|
+
* @param elementRef Referenz auf das HTML Element mit der Marker Direktive
|
|
9086
9220
|
*/
|
|
9087
|
-
constructor(
|
|
9088
|
-
this.nativeElement =
|
|
9221
|
+
constructor(elementRef) {
|
|
9222
|
+
this.nativeElement = elementRef.nativeElement;
|
|
9089
9223
|
}
|
|
9090
9224
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacContextMenuContrainerCommon, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
9091
9225
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacContextMenuContrainerCommon, ngImport: i0 }); }
|
|
@@ -9098,46 +9232,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
9098
9232
|
* Base Context Menü Element. Die Logik wurde aus NG-BOOTSTRAP übernommen.
|
|
9099
9233
|
*/
|
|
9100
9234
|
class SacContextmenuCommon {
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
*/
|
|
9104
|
-
onClick(targetElement) {
|
|
9105
|
-
const anchor = this._anchor || this._anchorTemplate;
|
|
9106
|
-
if (this._menu &&
|
|
9107
|
-
!this._menu.nativeElement.contains(targetElement) &&
|
|
9108
|
-
!anchor.nativeElement.contains(targetElement)) {
|
|
9109
|
-
this.close();
|
|
9110
|
-
}
|
|
9111
|
-
}
|
|
9235
|
+
// #endregion Properties
|
|
9236
|
+
// #region Constructors
|
|
9112
9237
|
/**
|
|
9113
9238
|
* Konstruktor
|
|
9114
|
-
* @param
|
|
9115
|
-
* @param
|
|
9116
|
-
* @param
|
|
9117
|
-
* @param
|
|
9118
|
-
* @param
|
|
9119
|
-
*/
|
|
9120
|
-
constructor(
|
|
9121
|
-
this.
|
|
9122
|
-
this.
|
|
9123
|
-
this.
|
|
9124
|
-
this.
|
|
9239
|
+
* @param document HTML Document Element
|
|
9240
|
+
* @param ngZone Angular Zone Service
|
|
9241
|
+
* @param elementRef HTML Element des aktuellen Controls
|
|
9242
|
+
* @param renderer Angular Rendering Service
|
|
9243
|
+
* @param injector injector to resolve the icon service
|
|
9244
|
+
*/
|
|
9245
|
+
constructor(document, ngZone, elementRef, renderer, injector) {
|
|
9246
|
+
this.document = document;
|
|
9247
|
+
this.ngZone = ngZone;
|
|
9248
|
+
this.elementRef = elementRef;
|
|
9249
|
+
this.renderer = renderer;
|
|
9125
9250
|
/**
|
|
9126
9251
|
* Body HTML Element
|
|
9127
9252
|
*/
|
|
9128
9253
|
this.bodyContainer = null;
|
|
9129
9254
|
/**
|
|
9130
|
-
*
|
|
9255
|
+
* Container an welchem die Position ausgerichtet wird. Aktuell wird nun Body Supported
|
|
9131
9256
|
*/
|
|
9132
|
-
this.
|
|
9257
|
+
this.container = 'body';
|
|
9133
9258
|
/**
|
|
9134
9259
|
* Extra CSS Klassen für das Control
|
|
9135
9260
|
*/
|
|
9136
9261
|
this.cssclass = '';
|
|
9137
9262
|
/**
|
|
9138
|
-
*
|
|
9263
|
+
* Definiert ob das Dropdown offen ist.
|
|
9139
9264
|
*/
|
|
9140
|
-
this.
|
|
9265
|
+
this.isopen = false;
|
|
9141
9266
|
/**
|
|
9142
9267
|
* The preferred placement of the dropdown.
|
|
9143
9268
|
*
|
|
@@ -9157,34 +9282,31 @@ class SacContextmenuCommon {
|
|
|
9157
9282
|
'top-left',
|
|
9158
9283
|
'top-right',
|
|
9159
9284
|
];
|
|
9160
|
-
this.zoneSubscription = this.
|
|
9285
|
+
this.zoneSubscription = this.ngZone.onStable.subscribe(() => {
|
|
9161
9286
|
this._positionMenu();
|
|
9162
9287
|
});
|
|
9163
|
-
this.iconService =
|
|
9288
|
+
this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
|
|
9164
9289
|
}
|
|
9290
|
+
// #endregion Constructors
|
|
9291
|
+
// #region Public Getters And Setters
|
|
9165
9292
|
/**
|
|
9166
|
-
*
|
|
9293
|
+
* icon for default context menü button
|
|
9167
9294
|
*/
|
|
9168
|
-
|
|
9169
|
-
this.
|
|
9295
|
+
get IconContextMenu() {
|
|
9296
|
+
return this.iconService.ContextMenuOpenIcon;
|
|
9170
9297
|
}
|
|
9298
|
+
// #endregion Public Getters And Setters
|
|
9299
|
+
// #region Public Methods
|
|
9171
9300
|
/**
|
|
9172
|
-
*
|
|
9301
|
+
* HostListener um das Dropdown zu schliessen wenn nicht auf das Element geklickt wird.
|
|
9173
9302
|
*/
|
|
9174
|
-
|
|
9175
|
-
|
|
9303
|
+
onClick(targetElement) {
|
|
9304
|
+
const anchor = this._anchor || this._anchorTemplate;
|
|
9305
|
+
if (this._menu &&
|
|
9306
|
+
!this._menu.nativeElement.contains(targetElement) &&
|
|
9307
|
+
!anchor.nativeElement.contains(targetElement)) {
|
|
9176
9308
|
this.close();
|
|
9177
9309
|
}
|
|
9178
|
-
else {
|
|
9179
|
-
this.open();
|
|
9180
|
-
}
|
|
9181
|
-
}
|
|
9182
|
-
/**
|
|
9183
|
-
* Öffnet das Dropdown / Zeigt das Menü an.
|
|
9184
|
-
*/
|
|
9185
|
-
open() {
|
|
9186
|
-
this._applyContainer(this.container);
|
|
9187
|
-
this.isopen = true;
|
|
9188
9310
|
}
|
|
9189
9311
|
/**
|
|
9190
9312
|
* Schliesst das Dropdown
|
|
@@ -9194,11 +9316,31 @@ class SacContextmenuCommon {
|
|
|
9194
9316
|
this.isopen = false;
|
|
9195
9317
|
}
|
|
9196
9318
|
/**
|
|
9197
|
-
*
|
|
9319
|
+
* Event wenn Component entfernt wird.
|
|
9198
9320
|
*/
|
|
9199
|
-
|
|
9200
|
-
|
|
9321
|
+
ngOnDestroy() {
|
|
9322
|
+
this.zoneSubscription.unsubscribe();
|
|
9323
|
+
}
|
|
9324
|
+
/**
|
|
9325
|
+
* Öffnet das Dropdown / Zeigt das Menü an.
|
|
9326
|
+
*/
|
|
9327
|
+
open() {
|
|
9328
|
+
this._applyContainer(this.container);
|
|
9329
|
+
this.isopen = true;
|
|
9330
|
+
}
|
|
9331
|
+
/**
|
|
9332
|
+
* Toggle von Dropdown
|
|
9333
|
+
*/
|
|
9334
|
+
toggle() {
|
|
9335
|
+
if (this.isopen) {
|
|
9336
|
+
this.close();
|
|
9337
|
+
}
|
|
9338
|
+
else {
|
|
9339
|
+
this.open();
|
|
9340
|
+
}
|
|
9201
9341
|
}
|
|
9342
|
+
// #endregion Public Methods
|
|
9343
|
+
// #region Protected Methods
|
|
9202
9344
|
/**
|
|
9203
9345
|
* Setzt die Position des Menüs im Markup
|
|
9204
9346
|
*/
|
|
@@ -9208,23 +9350,8 @@ class SacContextmenuCommon {
|
|
|
9208
9350
|
positionElements(anchor.nativeElement, this.bodyContainer || this._menu.nativeElement, this.placement, this.container === 'body');
|
|
9209
9351
|
}
|
|
9210
9352
|
}
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
*/
|
|
9214
|
-
_resetContainer() {
|
|
9215
|
-
const renderer = this._renderer;
|
|
9216
|
-
if (this._menu) {
|
|
9217
|
-
const dropdownElement = this._elementRef.nativeElement;
|
|
9218
|
-
const dropdownMenuElement = this._menu.nativeElement;
|
|
9219
|
-
renderer.appendChild(dropdownElement, dropdownMenuElement);
|
|
9220
|
-
renderer.removeStyle(dropdownMenuElement, 'position');
|
|
9221
|
-
renderer.removeStyle(dropdownMenuElement, 'transform');
|
|
9222
|
-
}
|
|
9223
|
-
if (this.bodyContainer) {
|
|
9224
|
-
renderer.removeChild(this._document.body, this.bodyContainer);
|
|
9225
|
-
this.bodyContainer = null;
|
|
9226
|
-
}
|
|
9227
|
-
}
|
|
9353
|
+
// #endregion Protected Methods
|
|
9354
|
+
// #region Private Methods
|
|
9228
9355
|
/**
|
|
9229
9356
|
* Setzt die Position des Menüs innerhalb der Seite. Die Ausrichtung passiert innerhalb der Seite
|
|
9230
9357
|
* damit das Menü innerhalb eines Dialogs sauber funktionioniert.
|
|
@@ -9234,7 +9361,7 @@ class SacContextmenuCommon {
|
|
|
9234
9361
|
// Reset Classes on Container
|
|
9235
9362
|
this._resetContainer();
|
|
9236
9363
|
if (container === 'body') {
|
|
9237
|
-
const renderer = this.
|
|
9364
|
+
const renderer = this.renderer;
|
|
9238
9365
|
const dropdownMenuElement = this._menu.nativeElement;
|
|
9239
9366
|
const bodyContainer = (this.bodyContainer =
|
|
9240
9367
|
this.bodyContainer || renderer.createElement('div'));
|
|
@@ -9243,34 +9370,51 @@ class SacContextmenuCommon {
|
|
|
9243
9370
|
renderer.setStyle(dropdownMenuElement, 'position', 'static');
|
|
9244
9371
|
renderer.setStyle(bodyContainer, 'z-index', '1050');
|
|
9245
9372
|
renderer.appendChild(bodyContainer, dropdownMenuElement);
|
|
9246
|
-
renderer.appendChild(this.
|
|
9373
|
+
renderer.appendChild(this.document.body, bodyContainer);
|
|
9374
|
+
}
|
|
9375
|
+
}
|
|
9376
|
+
/**
|
|
9377
|
+
* Setzt die CSS Klassen auf dem Menü Container auf den Standard zurück
|
|
9378
|
+
*/
|
|
9379
|
+
_resetContainer() {
|
|
9380
|
+
const renderer = this.renderer;
|
|
9381
|
+
if (this._menu) {
|
|
9382
|
+
const dropdownElement = this.elementRef.nativeElement;
|
|
9383
|
+
const dropdownMenuElement = this._menu.nativeElement;
|
|
9384
|
+
renderer.appendChild(dropdownElement, dropdownMenuElement);
|
|
9385
|
+
renderer.removeStyle(dropdownMenuElement, 'position');
|
|
9386
|
+
renderer.removeStyle(dropdownMenuElement, 'transform');
|
|
9387
|
+
}
|
|
9388
|
+
if (this.bodyContainer) {
|
|
9389
|
+
renderer.removeChild(this.document.body, this.bodyContainer);
|
|
9390
|
+
this.bodyContainer = null;
|
|
9247
9391
|
}
|
|
9248
9392
|
}
|
|
9249
9393
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacContextmenuCommon, deps: [{ token: DOCUMENT }, { token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
9250
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacContextmenuCommon, inputs: {
|
|
9394
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacContextmenuCommon, inputs: { buttontemplate: "buttontemplate", container: "container", cssclass: "cssclass", isopen: "isopen", placement: "placement" }, host: { listeners: { "document:click": "onClick($event.target)" } }, queries: [{ propertyName: "_anchorTemplate", first: true, predicate: SacContextmenuAnchorCommon, descendants: true }], viewQueries: [{ propertyName: "_anchor", first: true, predicate: SacContextmenuAnchorCommon, descendants: true }, { propertyName: "_menu", first: true, predicate: SacContextMenuContrainerCommon, descendants: true }], ngImport: i0 }); }
|
|
9251
9395
|
}
|
|
9252
9396
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacContextmenuCommon, decorators: [{
|
|
9253
9397
|
type: Directive
|
|
9254
9398
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
9255
9399
|
type: Inject,
|
|
9256
9400
|
args: [DOCUMENT]
|
|
9257
|
-
}] }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }]; }, propDecorators: {
|
|
9258
|
-
type: ViewChild,
|
|
9259
|
-
args: [SacContextmenuAnchorCommon, { static: false }]
|
|
9260
|
-
}], _anchorTemplate: [{
|
|
9401
|
+
}] }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }]; }, propDecorators: { _anchorTemplate: [{
|
|
9261
9402
|
type: ContentChild,
|
|
9262
9403
|
args: [SacContextmenuAnchorCommon, { static: false }]
|
|
9404
|
+
}], _anchor: [{
|
|
9405
|
+
type: ViewChild,
|
|
9406
|
+
args: [SacContextmenuAnchorCommon, { static: false }]
|
|
9263
9407
|
}], _menu: [{
|
|
9264
9408
|
type: ViewChild,
|
|
9265
9409
|
args: [SacContextMenuContrainerCommon, { static: false }]
|
|
9266
|
-
}], isopen: [{
|
|
9267
|
-
type: Input
|
|
9268
|
-
}], cssclass: [{
|
|
9269
|
-
type: Input
|
|
9270
9410
|
}], buttontemplate: [{
|
|
9271
9411
|
type: Input
|
|
9272
9412
|
}], container: [{
|
|
9273
9413
|
type: Input
|
|
9414
|
+
}], cssclass: [{
|
|
9415
|
+
type: Input
|
|
9416
|
+
}], isopen: [{
|
|
9417
|
+
type: Input
|
|
9274
9418
|
}], placement: [{
|
|
9275
9419
|
type: Input
|
|
9276
9420
|
}], onClick: [{
|
|
@@ -9955,5 +10099,5 @@ class LanguageModel {
|
|
|
9955
10099
|
* Generated bundle index. Do not edit.
|
|
9956
10100
|
*/
|
|
9957
10101
|
|
|
9958
|
-
export { GridResponse, IconType, Interpolation, LanguageModel, PagerData, PagerRequest, Positioning, SACFILEBROWSER_SERVICE, SACICON_SERVICE, SACLANGUAGE_SERVICE, SACLOCALISATION_SERVICE, SacAbstractFileBrowserService, SacAbstractIconService, SacAbstractLanguageService, SacAbstractLocalisationService, SacButtonCommon, SacCheckboxCommon, SacConfirmButton, SacConfirmCommon, SacContextMenuContrainerCommon, SacContextmenuAnchorCommon, SacContextmenuCommon, SacContextmenuItemButtonCommon, SacContextmenuItemCommon, SacDateCommon, SacDateSelectorCommon, SacDateTimeCommon, SacDialogCommon, SacDropdownCommon, SacDropdownOptionCommon, SacDropzoneMultipleCommon, SacDropzoneSingleCommon, SacFileBrowserCommon, SacFormCommon, SacGridButtonCommon, SacGridColumnActionCommon, SacGridColumnBaseCommon, SacGridColumnCommon, SacGridCommon, SacGridImageCommon, SacInputAreaCommon, SacInputCommon, SacInputCurrencyCommon, SacInputDecimalCommon, SacInputEmailCommon, SacInputIntegerCommon, SacInputPasswordCommon, SacInputSearchCommon, SacListboxCommon, SacListboxOptionCommon, SacMultilanguageInputAreaCommon, SacMultilanguageInputCommon, SacPagingCommon, SacRadiobuttonCommon, SacRadiobuttonsCommon, SacStaticFormContainerCommon, SacStaticLabelCommon, SacTabCommon, SacTabItemCommon, SacTimeCommon, SacTinyMceCommon, SacTooltipCommon, SacTreeItemActionCommon, SacTreeViewChildCommon, SacTreeViewCommon, SacUploadFile, SacUploadMultipleCommon, SacUploadSingleCommon, SacValidationSummaryCommon, SacWizardCommon, SacWizardItemCommon, ServiceConfirmCommon, SortDescriptor, SortOrder, TooltipPosition, Validation, ValidationErrorItem, convertToBoolean, convertToNumber, isDefined, mapToObject, positionElements, positionService };
|
|
10102
|
+
export { GridResponse, IconType, Interpolation, LanguageModel, PagerData, PagerRequest, Positioning, SACFILEBROWSER_SERVICE, SACICON_SERVICE, SACLANGUAGE_SERVICE, SACLOCALISATION_SERVICE, SacAbstractFileBrowserService, SacAbstractIconService, SacAbstractLanguageService, SacAbstractLocalisationService, SacButtonCommon, SacCheckboxCommon, SacConfirmButton, SacConfirmCommon, SacContextMenuContrainerCommon, SacContextmenuAnchorCommon, SacContextmenuCommon, SacContextmenuItemButtonCommon, SacContextmenuItemCommon, SacDateCommon, SacDateSelectorCommon, SacDateTimeCommon, SacDialogCommon, SacDropdownCommon, SacDropdownOptionCommon, SacDropzoneMultipleCommon, SacDropzoneSingleCommon, SacFileBrowserCommon, SacFormCommon, SacFormLayoutCommon, SacGridButtonCommon, SacGridColumnActionCommon, SacGridColumnBaseCommon, SacGridColumnCommon, SacGridCommon, SacGridImageCommon, SacInputAreaCommon, SacInputCommon, SacInputCurrencyCommon, SacInputDecimalCommon, SacInputEmailCommon, SacInputIntegerCommon, SacInputPasswordCommon, SacInputSearchCommon, SacListboxCommon, SacListboxOptionCommon, SacMultilanguageInputAreaCommon, SacMultilanguageInputCommon, SacPagingCommon, SacRadiobuttonCommon, SacRadiobuttonsCommon, SacStaticFormContainerCommon, SacStaticLabelCommon, SacTabCommon, SacTabItemCommon, SacTimeCommon, SacTinyMceCommon, SacTooltipCommon, SacTreeItemActionCommon, SacTreeViewChildCommon, SacTreeViewCommon, SacUploadFile, SacUploadMultipleCommon, SacUploadSingleCommon, SacValidationSummaryCommon, SacWizardCommon, SacWizardItemCommon, ServiceConfirmCommon, SortDescriptor, SortOrder, TooltipPosition, Validation, ValidationErrorItem, convertToBoolean, convertToNumber, isDefined, mapToObject, positionElements, positionService };
|
|
9959
10103
|
//# sourceMappingURL=simpleangularcontrols-sac-common.mjs.map
|