@simpleangularcontrols/sac-common 16.0.0-rc.2 → 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/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 -201
- 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 -1813
- 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-16.0.0-rc.2.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
|
*/
|
|
@@ -1347,6 +973,99 @@ class SacBaseModelControl {
|
|
|
1347
973
|
parameters['FIELD'] = errorItem.fieldName;
|
|
1348
974
|
return this.lngResourceService.GetString(errorItem.errorMessageKey, parameters);
|
|
1349
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() { }
|
|
1350
1069
|
/**
|
|
1351
1070
|
* Aktualisiert den NgModel Wert und die Gültigkeit des Validators des Controls
|
|
1352
1071
|
*/
|
|
@@ -1355,56 +1074,109 @@ class SacBaseModelControl {
|
|
|
1355
1074
|
this.ngControl.updateValueAndValidity({ onlySelf: true });
|
|
1356
1075
|
}
|
|
1357
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
|
+
}
|
|
1358
1085
|
/**
|
|
1359
|
-
*
|
|
1086
|
+
* Set adaptive label property from parent layout control
|
|
1360
1087
|
*/
|
|
1361
|
-
|
|
1362
|
-
if (
|
|
1363
|
-
this.
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
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
|
+
}
|
|
1367
1096
|
}
|
|
1368
1097
|
}
|
|
1369
|
-
get inlineerrorenabled() {
|
|
1370
|
-
return this._inlineerrorenabled;
|
|
1371
|
-
}
|
|
1372
1098
|
/**
|
|
1373
|
-
*
|
|
1099
|
+
* Set label sizes from property or parent layout control
|
|
1374
1100
|
*/
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
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
|
+
}
|
|
1379
1143
|
}
|
|
1380
|
-
return (this.parent.IsInlineErrorEnabled !== false &&
|
|
1381
|
-
this._inlineerrorenabled !== false);
|
|
1382
1144
|
}
|
|
1383
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacBaseModelControl, deps: [{ token:
|
|
1384
|
-
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 }); }
|
|
1385
1147
|
}
|
|
1386
1148
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacBaseModelControl, decorators: [{
|
|
1387
1149
|
type: Directive
|
|
1388
|
-
}], ctorParameters: function () { return [{ type:
|
|
1150
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
1389
1151
|
type: Host
|
|
1390
|
-
}] }, { type: i0.Injector }]; }, propDecorators: {
|
|
1152
|
+
}] }, { type: i0.Injector }]; }, propDecorators: { disabled: [{
|
|
1391
1153
|
type: Input
|
|
1392
|
-
}],
|
|
1154
|
+
}], disablelabel: [{
|
|
1393
1155
|
type: Input
|
|
1394
|
-
}],
|
|
1156
|
+
}], inlineError: [{
|
|
1395
1157
|
type: Input
|
|
1396
|
-
}],
|
|
1158
|
+
}], isAdaptiveLabel: [{
|
|
1397
1159
|
type: Input
|
|
1398
|
-
}],
|
|
1160
|
+
}], labelSizeLg: [{
|
|
1399
1161
|
type: Input
|
|
1400
|
-
}],
|
|
1162
|
+
}], labelSizeMd: [{
|
|
1401
1163
|
type: Input
|
|
1402
|
-
}],
|
|
1164
|
+
}], labelSizeSm: [{
|
|
1403
1165
|
type: Input
|
|
1404
|
-
}],
|
|
1166
|
+
}], labelSizeXl: [{
|
|
1167
|
+
type: Input
|
|
1168
|
+
}], labelSizeXs: [{
|
|
1169
|
+
type: Input
|
|
1170
|
+
}], labelSizeXxl: [{
|
|
1171
|
+
type: Input
|
|
1172
|
+
}], name: [{
|
|
1405
1173
|
type: Input
|
|
1406
1174
|
}], inlineerrorenabled: [{
|
|
1407
1175
|
type: Input
|
|
1176
|
+
}], label: [{
|
|
1177
|
+
type: Input
|
|
1178
|
+
}], value: [{
|
|
1179
|
+
type: Input
|
|
1408
1180
|
}] } });
|
|
1409
1181
|
|
|
1410
1182
|
/**
|
|
@@ -1414,9 +1186,13 @@ class SacCheckboxCommon extends SacBaseModelControl {
|
|
|
1414
1186
|
constructor() {
|
|
1415
1187
|
super(...arguments);
|
|
1416
1188
|
/**
|
|
1417
|
-
|
|
1418
|
-
|
|
1189
|
+
* Text welcher als Tooltip angezeigt wird.
|
|
1190
|
+
*/
|
|
1419
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;
|
|
1420
1196
|
}
|
|
1421
1197
|
/**
|
|
1422
1198
|
* Control hat keinen Validator
|
|
@@ -1425,7 +1201,7 @@ class SacCheckboxCommon extends SacBaseModelControl {
|
|
|
1425
1201
|
return null;
|
|
1426
1202
|
}
|
|
1427
1203
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacCheckboxCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1428
|
-
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 }); }
|
|
1429
1205
|
}
|
|
1430
1206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacCheckboxCommon, decorators: [{
|
|
1431
1207
|
type: Directive
|
|
@@ -1433,6 +1209,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1433
1209
|
type: Input
|
|
1434
1210
|
}], checkboxtext: [{
|
|
1435
1211
|
type: Input
|
|
1212
|
+
}], stacked: [{
|
|
1213
|
+
type: Input
|
|
1436
1214
|
}] } });
|
|
1437
1215
|
|
|
1438
1216
|
/**
|
|
@@ -1890,11 +1668,12 @@ class Validation {
|
|
|
1890
1668
|
*/
|
|
1891
1669
|
class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
1892
1670
|
/**
|
|
1893
|
-
*
|
|
1894
|
-
*
|
|
1671
|
+
* Constructor
|
|
1672
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
1673
|
+
* @param injector Injector for injecting services
|
|
1895
1674
|
*/
|
|
1896
|
-
constructor(
|
|
1897
|
-
super(
|
|
1675
|
+
constructor(formlayout, injector) {
|
|
1676
|
+
super(formlayout, injector);
|
|
1898
1677
|
/**
|
|
1899
1678
|
* Radio Button Index
|
|
1900
1679
|
*/
|
|
@@ -1943,7 +1722,7 @@ class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
|
1943
1722
|
writeValue(value) {
|
|
1944
1723
|
super.writeValue(value);
|
|
1945
1724
|
if (value !== null && value !== undefined) {
|
|
1946
|
-
this.contentRadiobuttons.forEach(itm => {
|
|
1725
|
+
this.contentRadiobuttons.forEach((itm) => {
|
|
1947
1726
|
itm.checked = itm.value === value;
|
|
1948
1727
|
});
|
|
1949
1728
|
}
|
|
@@ -1953,7 +1732,7 @@ class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
|
1953
1732
|
* Item selektieren
|
|
1954
1733
|
*/
|
|
1955
1734
|
SelectItem(value) {
|
|
1956
|
-
this.contentRadiobuttons.forEach(itm => {
|
|
1735
|
+
this.contentRadiobuttons.forEach((itm) => {
|
|
1957
1736
|
itm.checked = itm.value === value;
|
|
1958
1737
|
});
|
|
1959
1738
|
this.value = value;
|
|
@@ -1966,7 +1745,7 @@ class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
|
1966
1745
|
if (radioButtons === undefined || radioButtons === null) {
|
|
1967
1746
|
return false;
|
|
1968
1747
|
}
|
|
1969
|
-
return this.contentRadiobuttons.some(itm => itm.checked);
|
|
1748
|
+
return this.contentRadiobuttons.some((itm) => itm.checked);
|
|
1970
1749
|
}
|
|
1971
1750
|
/**
|
|
1972
1751
|
* Validator
|
|
@@ -1979,12 +1758,12 @@ class SacRadiobuttonsCommon extends SacBaseModelControl {
|
|
|
1979
1758
|
return null;
|
|
1980
1759
|
}
|
|
1981
1760
|
}
|
|
1982
|
-
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 }); }
|
|
1983
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 }); }
|
|
1984
1763
|
}
|
|
1985
1764
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacRadiobuttonsCommon, decorators: [{
|
|
1986
1765
|
type: Directive
|
|
1987
|
-
}], ctorParameters: function () { return [{ type:
|
|
1766
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
1988
1767
|
type: Host
|
|
1989
1768
|
}] }, { type: i0.Injector }]; }, propDecorators: { validationmessagerequired: [{
|
|
1990
1769
|
type: Input
|
|
@@ -2098,6 +1877,330 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2098
1877
|
type: Input
|
|
2099
1878
|
}] } });
|
|
2100
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
|
+
|
|
2101
2204
|
/**
|
|
2102
2205
|
* Abstract Klasse für SacBaseListControl. Extendes SacBaseModelControl
|
|
2103
2206
|
*/
|
|
@@ -2184,55 +2287,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2184
2287
|
type: Input
|
|
2185
2288
|
}] } });
|
|
2186
2289
|
|
|
2187
|
-
|
|
2188
|
-
* Function um ein Key Value Pair für das Dropdown zu erzeugen
|
|
2189
|
-
* @param id ID
|
|
2190
|
-
* @param value Wert der an das Element gebunden werden soll
|
|
2191
|
-
*/
|
|
2192
|
-
function _buildValueString(id, value) {
|
|
2193
|
-
// Wenn ID null ist Object zurückgeben
|
|
2194
|
-
if (id == null) {
|
|
2195
|
-
return `${value}`;
|
|
2196
|
-
}
|
|
2197
|
-
// Mapping Objekt zu String
|
|
2198
|
-
if (value && typeof value === 'object') {
|
|
2199
|
-
value = 'Object';
|
|
2200
|
-
}
|
|
2201
|
-
// String als ID
|
|
2202
|
-
return `${id}: ${value}`.slice(0, 50);
|
|
2203
|
-
}
|
|
2290
|
+
// #region Classes
|
|
2204
2291
|
/**
|
|
2205
2292
|
* Base Dropdown Komponente
|
|
2206
2293
|
*/
|
|
2207
2294
|
class SacDropdownCommon extends SacBaseSelectControl {
|
|
2295
|
+
// #endregion Properties
|
|
2296
|
+
// #region Constructors
|
|
2208
2297
|
/**
|
|
2209
|
-
*
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
}
|
|
2215
|
-
this._compareWith = fn;
|
|
2216
|
-
}
|
|
2217
|
-
/**
|
|
2218
|
-
* Konstruktor
|
|
2219
|
-
* @param parent Übergeordnetes HTML Element
|
|
2220
|
-
* @param injector Injector für Services
|
|
2221
|
-
* @param _renderer Render Engine
|
|
2222
|
-
* @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
|
|
2223
2303
|
*/
|
|
2224
|
-
constructor(
|
|
2225
|
-
super(
|
|
2226
|
-
this.
|
|
2227
|
-
this.
|
|
2228
|
-
|
|
2229
|
-
* Counter vom OptionID; default Wert = 0
|
|
2230
|
-
*/
|
|
2231
|
-
this._optionIdCounter = 0;
|
|
2232
|
-
/**
|
|
2233
|
-
* OptionMap
|
|
2234
|
-
*/
|
|
2235
|
-
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
|
|
2236
2309
|
/**
|
|
2237
2310
|
* compareWith-Funktion
|
|
2238
2311
|
*/
|
|
@@ -2253,22 +2326,28 @@ class SacDropdownCommon extends SacBaseSelectControl {
|
|
|
2253
2326
|
* Resource Key für Validation Message Required in Validation Summary
|
|
2254
2327
|
*/
|
|
2255
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();
|
|
2256
2337
|
}
|
|
2338
|
+
// #endregion Constructors
|
|
2339
|
+
// #region Public Getters And Setters
|
|
2257
2340
|
/**
|
|
2258
|
-
*
|
|
2259
|
-
* @param value - Wert
|
|
2260
|
-
*/
|
|
2261
|
-
setValue(value) {
|
|
2262
|
-
super.setValue(this.getOptionValue(value));
|
|
2263
|
-
}
|
|
2264
|
-
/**
|
|
2265
|
-
* Wert schreiben
|
|
2266
|
-
* @param value - Wert
|
|
2341
|
+
* compareWith-Funktion
|
|
2267
2342
|
*/
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
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;
|
|
2271
2348
|
}
|
|
2349
|
+
// #endregion Public Getters And Setters
|
|
2350
|
+
// #region Public Methods
|
|
2272
2351
|
/**
|
|
2273
2352
|
* Registriert das OptionID-Counter als String
|
|
2274
2353
|
*/
|
|
@@ -2288,23 +2367,39 @@ class SacDropdownCommon extends SacBaseSelectControl {
|
|
|
2288
2367
|
}
|
|
2289
2368
|
}
|
|
2290
2369
|
/**
|
|
2291
|
-
*
|
|
2292
|
-
* @param value
|
|
2370
|
+
* Wert einstellen
|
|
2371
|
+
* @param value - Wert
|
|
2293
2372
|
*/
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
if (selectItem !== undefined) {
|
|
2306
|
-
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);
|
|
2307
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];
|
|
2308
2403
|
}
|
|
2309
2404
|
/**
|
|
2310
2405
|
* Nimmt das ID vom Option
|
|
@@ -2327,45 +2422,48 @@ class SacDropdownCommon extends SacBaseSelectControl {
|
|
|
2327
2422
|
return this._optionMap.has(id) ? this._optionMap.get(id) : valueString;
|
|
2328
2423
|
}
|
|
2329
2424
|
/**
|
|
2330
|
-
*
|
|
2331
|
-
* @param
|
|
2332
|
-
*/
|
|
2333
|
-
extractId(valueString) {
|
|
2334
|
-
return valueString.split(':')[0];
|
|
2335
|
-
}
|
|
2336
|
-
/**
|
|
2337
|
-
* Validator
|
|
2338
|
-
* @param c Control Instanz
|
|
2425
|
+
* Setzt den Selected Value auf dem Control
|
|
2426
|
+
* @param value Value
|
|
2339
2427
|
*/
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
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);
|
|
2344
2441
|
}
|
|
2345
|
-
return error;
|
|
2346
2442
|
}
|
|
2347
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDropdownCommon, deps: [{ token:
|
|
2348
|
-
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 }); }
|
|
2349
2445
|
}
|
|
2350
2446
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDropdownCommon, decorators: [{
|
|
2351
2447
|
type: Directive
|
|
2352
|
-
}], ctorParameters: function () { return [{ type:
|
|
2448
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
2353
2449
|
type: Host
|
|
2354
2450
|
}] }, { type: i0.Injector }, { type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { emptylabel: [{
|
|
2355
2451
|
type: Input
|
|
2356
2452
|
}], emptyvalue: [{
|
|
2357
2453
|
type: Input
|
|
2358
|
-
}], comparewith: [{
|
|
2359
|
-
type: Input
|
|
2360
2454
|
}], validationmessagerequired: [{
|
|
2361
2455
|
type: Input
|
|
2362
2456
|
}], validationmessagesummaryrequired: [{
|
|
2363
2457
|
type: Input
|
|
2458
|
+
}], comparewith: [{
|
|
2459
|
+
type: Input
|
|
2364
2460
|
}] } });
|
|
2365
2461
|
/**
|
|
2366
2462
|
* SacDropdownOption-Klasse
|
|
2367
2463
|
*/
|
|
2368
2464
|
class SacDropdownOptionCommon {
|
|
2465
|
+
// #endregion Properties
|
|
2466
|
+
// #region Constructors
|
|
2369
2467
|
/**
|
|
2370
2468
|
* Konstruktor
|
|
2371
2469
|
* @param _element Referenz auf HTML Element
|
|
@@ -2376,6 +2474,7 @@ class SacDropdownOptionCommon {
|
|
|
2376
2474
|
this._element = _element;
|
|
2377
2475
|
this._renderer = _renderer;
|
|
2378
2476
|
this._dropdown = _dropdown;
|
|
2477
|
+
// #region Properties
|
|
2379
2478
|
/**
|
|
2380
2479
|
* ID-String
|
|
2381
2480
|
*/
|
|
@@ -2384,6 +2483,8 @@ class SacDropdownOptionCommon {
|
|
|
2384
2483
|
this.id = this._dropdown.registerOption();
|
|
2385
2484
|
}
|
|
2386
2485
|
}
|
|
2486
|
+
// #endregion Constructors
|
|
2487
|
+
// #region Public Getters And Setters
|
|
2387
2488
|
/**
|
|
2388
2489
|
* Option ngValue
|
|
2389
2490
|
*/
|
|
@@ -2402,6 +2503,8 @@ class SacDropdownOptionCommon {
|
|
|
2402
2503
|
set value(value) {
|
|
2403
2504
|
this._setElementValue(value);
|
|
2404
2505
|
}
|
|
2506
|
+
// #endregion Public Getters And Setters
|
|
2507
|
+
// #region Public Methods
|
|
2405
2508
|
/**
|
|
2406
2509
|
* Den Wert vom Option-Element einstellen
|
|
2407
2510
|
* @param value Wert
|
|
@@ -2427,6 +2530,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2427
2530
|
}], value: [{
|
|
2428
2531
|
type: Input
|
|
2429
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
|
+
}
|
|
2430
2552
|
|
|
2431
2553
|
/**
|
|
2432
2554
|
* Basis Komponente für SacListboxOption
|
|
@@ -2583,20 +2705,133 @@ class SacListboxCommon extends SacBaseSelectControl {
|
|
|
2583
2705
|
const index = this.optionlist.indexOf(option);
|
|
2584
2706
|
this.optionlist.splice(index, 1);
|
|
2585
2707
|
}
|
|
2586
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacListboxCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2587
|
-
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 }); }
|
|
2588
2786
|
}
|
|
2589
|
-
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: [{
|
|
2590
2788
|
type: Directive
|
|
2591
|
-
}], propDecorators: {
|
|
2789
|
+
}], propDecorators: { name: [{
|
|
2592
2790
|
type: Input
|
|
2593
|
-
}],
|
|
2791
|
+
}], tablabeltemplate: [{
|
|
2594
2792
|
type: Input
|
|
2595
|
-
}],
|
|
2793
|
+
}], unloadtabitemswhenhidden: [{
|
|
2596
2794
|
type: Input
|
|
2597
|
-
}],
|
|
2598
|
-
type:
|
|
2599
|
-
|
|
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 }]
|
|
2600
2835
|
}] } });
|
|
2601
2836
|
|
|
2602
2837
|
/**
|
|
@@ -2721,119 +2956,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2721
2956
|
type: Input
|
|
2722
2957
|
}] } });
|
|
2723
2958
|
|
|
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 }); }
|
|
2786
|
-
}
|
|
2787
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTabCommon, decorators: [{
|
|
2788
|
-
type: Directive
|
|
2789
|
-
}], propDecorators: { name: [{
|
|
2790
|
-
type: Input
|
|
2791
|
-
}], tablabeltemplate: [{
|
|
2792
|
-
type: Input
|
|
2793
|
-
}], unloadtabitemswhenhidden: [{
|
|
2794
|
-
type: Input
|
|
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 }]
|
|
2835
|
-
}] } });
|
|
2836
|
-
|
|
2837
2959
|
/**
|
|
2838
2960
|
* Abstract Klasse für SacInputBase. Extendes SacBaseModelControl
|
|
2839
2961
|
*/
|
|
@@ -2841,6 +2963,14 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2841
2963
|
constructor() {
|
|
2842
2964
|
super(...arguments);
|
|
2843
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;
|
|
2844
2974
|
/**
|
|
2845
2975
|
* Definiert das Control als Required
|
|
2846
2976
|
*/
|
|
@@ -2849,10 +2979,6 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2849
2979
|
* TextBox Placeholder
|
|
2850
2980
|
*/
|
|
2851
2981
|
this.placeholder = null;
|
|
2852
|
-
/**
|
|
2853
|
-
* Erlaubte Zeichen bei der Eingabe
|
|
2854
|
-
*/
|
|
2855
|
-
this.allowedchars = '';
|
|
2856
2982
|
/**
|
|
2857
2983
|
* Macht das Input readonly
|
|
2858
2984
|
*/
|
|
@@ -2861,13 +2987,9 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2861
2987
|
* Text welcher als Tooltip angezeigt wird.
|
|
2862
2988
|
*/
|
|
2863
2989
|
this.tooltiptext = '';
|
|
2864
|
-
/**
|
|
2865
|
-
* Autofill aktivieren oder deaktivieren
|
|
2866
|
-
*/
|
|
2867
|
-
this.disableautocomplete = false;
|
|
2868
2990
|
}
|
|
2869
|
-
// #endregion
|
|
2870
|
-
// #region
|
|
2991
|
+
// #endregion Properties
|
|
2992
|
+
// #region Public Methods
|
|
2871
2993
|
/**
|
|
2872
2994
|
* Methode validiert Input wenn KeyPress-Event passiert
|
|
2873
2995
|
*/
|
|
@@ -2887,8 +3009,8 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2887
3009
|
event.preventDefault();
|
|
2888
3010
|
}
|
|
2889
3011
|
}
|
|
2890
|
-
// #endregion
|
|
2891
|
-
// #region Protected
|
|
3012
|
+
// #endregion Public Methods
|
|
3013
|
+
// #region Protected Methods
|
|
2892
3014
|
/**
|
|
2893
3015
|
* Methode validiert wenn ein Drück-Event passiert
|
|
2894
3016
|
*/
|
|
@@ -2896,15 +3018,17 @@ class SacInputBase extends SacBaseModelControl {
|
|
|
2896
3018
|
return true;
|
|
2897
3019
|
}
|
|
2898
3020
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacInputBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2899
|
-
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 }); }
|
|
2900
3022
|
}
|
|
2901
3023
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacInputBase, decorators: [{
|
|
2902
3024
|
type: Directive
|
|
2903
|
-
}], propDecorators: {
|
|
3025
|
+
}], propDecorators: { allowedchars: [{
|
|
2904
3026
|
type: Input
|
|
2905
|
-
}],
|
|
3027
|
+
}], disableautocomplete: [{
|
|
3028
|
+
type: Input
|
|
3029
|
+
}], isrequired: [{
|
|
2906
3030
|
type: Input
|
|
2907
|
-
}],
|
|
3031
|
+
}], placeholder: [{
|
|
2908
3032
|
type: Input
|
|
2909
3033
|
}], readonly: [{
|
|
2910
3034
|
type: Input
|
|
@@ -2912,8 +3036,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
2912
3036
|
type: Input
|
|
2913
3037
|
}], tooltiptext: [{
|
|
2914
3038
|
type: Input
|
|
2915
|
-
}], disableautocomplete: [{
|
|
2916
|
-
type: Input
|
|
2917
3039
|
}] } });
|
|
2918
3040
|
|
|
2919
3041
|
/**
|
|
@@ -3042,56 +3164,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3042
3164
|
class SacInputDecimalCommon extends SacInputBase {
|
|
3043
3165
|
constructor() {
|
|
3044
3166
|
super(...arguments);
|
|
3167
|
+
// #region Properties
|
|
3045
3168
|
/**
|
|
3046
3169
|
* Definiert das Negative Werte erlaubt sind
|
|
3047
3170
|
*/
|
|
3048
3171
|
this.allownegativ = false;
|
|
3049
|
-
/**
|
|
3050
|
-
* Definiert den minimalen Wert
|
|
3051
|
-
*/
|
|
3052
|
-
this.minvalue = undefined;
|
|
3053
3172
|
/**
|
|
3054
3173
|
* Definiert den maximalen Wert
|
|
3055
3174
|
*/
|
|
3056
3175
|
this.maxvalue = undefined;
|
|
3057
3176
|
/**
|
|
3058
|
-
*
|
|
3177
|
+
* Definiert den minimalen Wert
|
|
3059
3178
|
*/
|
|
3060
|
-
this.
|
|
3179
|
+
this.minvalue = undefined;
|
|
3061
3180
|
/**
|
|
3062
|
-
* Resource Key für Validation Message
|
|
3181
|
+
* Resource Key für Validation Message MaxValue bei Control
|
|
3063
3182
|
*/
|
|
3064
|
-
this.
|
|
3183
|
+
this.validationmessagemaxvalue = 'VALIDATION_ERROR_MAXVALUE';
|
|
3065
3184
|
/**
|
|
3066
3185
|
* Resource Key für Validation Message MinValue bei Control
|
|
3067
3186
|
*/
|
|
3068
3187
|
this.validationmessageminvalue = 'VALIDATION_ERROR_MINVALUE';
|
|
3069
3188
|
/**
|
|
3070
|
-
* Resource Key für Validation Message
|
|
3071
|
-
*/
|
|
3072
|
-
this.validationmessagesummaryminvalue = 'VALIDATION_ERROR_SUMMARY_MINVALUE';
|
|
3073
|
-
/**
|
|
3074
|
-
* Resource Key für Validation Message MaxValue bei Control
|
|
3189
|
+
* Resource Key für Validation Message Required bei Control
|
|
3075
3190
|
*/
|
|
3076
|
-
this.
|
|
3191
|
+
this.validationmessagerequired = 'VALIDATION_ERROR_REQUIRED';
|
|
3077
3192
|
/**
|
|
3078
3193
|
* Resource Key für Validation Message MaxValue in Validation Summary
|
|
3079
3194
|
*/
|
|
3080
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';
|
|
3081
3204
|
}
|
|
3205
|
+
// #endregion Properties
|
|
3206
|
+
// #region Public Methods
|
|
3082
3207
|
/**
|
|
3083
|
-
* Methode
|
|
3208
|
+
* Methode validiert ob der Wert entspricht den gegebenen Kriterien
|
|
3084
3209
|
*/
|
|
3085
|
-
|
|
3086
|
-
super.OnClassInit();
|
|
3210
|
+
validateData(c) {
|
|
3087
3211
|
/**
|
|
3088
|
-
*
|
|
3212
|
+
* Error Meldung, die angezeigt wird, wenn die Kriterien nicht erfüllt sind
|
|
3089
3213
|
*/
|
|
3090
|
-
|
|
3091
|
-
if (this.
|
|
3092
|
-
|
|
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);
|
|
3093
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;
|
|
3094
3229
|
}
|
|
3230
|
+
// #endregion Public Methods
|
|
3231
|
+
// #region Protected Methods
|
|
3095
3232
|
/**
|
|
3096
3233
|
* Konvertiert den Wert des Inputs
|
|
3097
3234
|
*/
|
|
@@ -3111,6 +3248,19 @@ class SacInputDecimalCommon extends SacInputBase {
|
|
|
3111
3248
|
}
|
|
3112
3249
|
}
|
|
3113
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
|
+
}
|
|
3114
3264
|
/**
|
|
3115
3265
|
* Methode validiert ob der Wert entspricht den gegebenen Kriterien wenn ein Key gedrückt wird
|
|
3116
3266
|
*/
|
|
@@ -3134,52 +3284,29 @@ class SacInputDecimalCommon extends SacInputBase {
|
|
|
3134
3284
|
return true;
|
|
3135
3285
|
}
|
|
3136
3286
|
}
|
|
3137
|
-
/**
|
|
3138
|
-
* Methode validiert ob der Wert entspricht den gegebenen Kriterien
|
|
3139
|
-
*/
|
|
3140
|
-
validateData(c) {
|
|
3141
|
-
/**
|
|
3142
|
-
* Error Meldung, die angezeigt wird, wenn die Kriterien nicht erfüllt sind
|
|
3143
|
-
*/
|
|
3144
|
-
let error = null;
|
|
3145
|
-
if (this.isrequired) {
|
|
3146
|
-
error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
3147
|
-
}
|
|
3148
|
-
if (error === null &&
|
|
3149
|
-
this.minvalue !== undefined &&
|
|
3150
|
-
this.minvalue !== null) {
|
|
3151
|
-
error = Validation.minValue(this.minvalue, this.validationmessageminvalue, this.validationmessagesummaryminvalue)(c);
|
|
3152
|
-
}
|
|
3153
|
-
if (error === null &&
|
|
3154
|
-
this.maxvalue !== undefined &&
|
|
3155
|
-
this.maxvalue !== null) {
|
|
3156
|
-
error = Validation.maxValue(this.maxvalue, this.validationmessagemaxvalue, this.validationmessagesummarymaxvalue)(c);
|
|
3157
|
-
}
|
|
3158
|
-
return error;
|
|
3159
|
-
}
|
|
3160
3287
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacInputDecimalCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3161
|
-
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 }); }
|
|
3162
3289
|
}
|
|
3163
3290
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacInputDecimalCommon, decorators: [{
|
|
3164
3291
|
type: Directive
|
|
3165
3292
|
}], propDecorators: { allownegativ: [{
|
|
3166
3293
|
type: Input
|
|
3167
|
-
}], minvalue: [{
|
|
3168
|
-
type: Input
|
|
3169
3294
|
}], maxvalue: [{
|
|
3170
3295
|
type: Input
|
|
3171
|
-
}],
|
|
3296
|
+
}], minvalue: [{
|
|
3172
3297
|
type: Input
|
|
3173
|
-
}],
|
|
3298
|
+
}], validationmessagemaxvalue: [{
|
|
3174
3299
|
type: Input
|
|
3175
3300
|
}], validationmessageminvalue: [{
|
|
3176
3301
|
type: Input
|
|
3177
|
-
}],
|
|
3178
|
-
type: Input
|
|
3179
|
-
}], validationmessagemaxvalue: [{
|
|
3302
|
+
}], validationmessagerequired: [{
|
|
3180
3303
|
type: Input
|
|
3181
3304
|
}], validationmessagesummarymaxvalue: [{
|
|
3182
3305
|
type: Input
|
|
3306
|
+
}], validationmessagesummaryminvalue: [{
|
|
3307
|
+
type: Input
|
|
3308
|
+
}], validationmessagesummaryrequired: [{
|
|
3309
|
+
type: Input
|
|
3183
3310
|
}] } });
|
|
3184
3311
|
|
|
3185
3312
|
/**
|
|
@@ -3671,6 +3798,63 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
3671
3798
|
type: Input
|
|
3672
3799
|
}] } });
|
|
3673
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
|
+
|
|
3674
3858
|
/**
|
|
3675
3859
|
* Enum für Icon Types in Componenten
|
|
3676
3860
|
*/
|
|
@@ -4348,6 +4532,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4348
4532
|
type: Directive
|
|
4349
4533
|
}], ctorParameters: function () { return [{ type: SacGridCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; } });
|
|
4350
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
|
+
|
|
4351
4548
|
/**
|
|
4352
4549
|
* Basiskomponente für Paging
|
|
4353
4550
|
*/
|
|
@@ -4597,76 +4794,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
4597
4794
|
type: Output
|
|
4598
4795
|
}] } });
|
|
4599
4796
|
|
|
4600
|
-
/**
|
|
4601
|
-
* Base Grid Action Button
|
|
4602
|
-
*/
|
|
4603
|
-
class SacGridButtonCommon {
|
|
4604
|
-
constructor() {
|
|
4605
|
-
/**
|
|
4606
|
-
* Input Property für Styling des Buttons. Deffiniert die Css Klassen des Buttons
|
|
4607
|
-
*/
|
|
4608
|
-
this.iconstyle = '';
|
|
4609
|
-
/**
|
|
4610
|
-
* Button ist deaktiviert
|
|
4611
|
-
*/
|
|
4612
|
-
this._isdisabledvalue = false;
|
|
4613
|
-
/**
|
|
4614
|
-
* Event wenn auf den Button geklickt wird
|
|
4615
|
-
*/
|
|
4616
|
-
this.clicked = new EventEmitter();
|
|
4617
|
-
}
|
|
4618
|
-
/**
|
|
4619
|
-
* Deaktivieren von Buttons
|
|
4620
|
-
* @param v Deaktiviert den Button
|
|
4621
|
-
* @return Definiert ob der Button deaktiviert ist
|
|
4622
|
-
*/
|
|
4623
|
-
set isdisabled(v) {
|
|
4624
|
-
if (v === null || v === undefined || typeof v === 'boolean') {
|
|
4625
|
-
this._isdisabledvalue = v;
|
|
4626
|
-
}
|
|
4627
|
-
else {
|
|
4628
|
-
this._isdisabledvalue = v === 'true';
|
|
4629
|
-
}
|
|
4630
|
-
}
|
|
4631
|
-
get isdisabled() {
|
|
4632
|
-
return this._isdisabledvalue;
|
|
4633
|
-
}
|
|
4634
|
-
/**
|
|
4635
|
-
* Die Methode wird das cklickaction Emitter aktivieren
|
|
4636
|
-
*/
|
|
4637
|
-
callaction() {
|
|
4638
|
-
if (!this._isdisabledvalue) {
|
|
4639
|
-
this.clicked.emit(this.iconstyle);
|
|
4640
|
-
}
|
|
4641
|
-
}
|
|
4642
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridButtonCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4643
|
-
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 }); }
|
|
4644
|
-
}
|
|
4645
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridButtonCommon, decorators: [{
|
|
4646
|
-
type: Directive
|
|
4647
|
-
}], propDecorators: { iconstyle: [{
|
|
4648
|
-
type: Input
|
|
4649
|
-
}], icon: [{
|
|
4650
|
-
type: Input
|
|
4651
|
-
}], isdisabled: [{
|
|
4652
|
-
type: Input
|
|
4653
|
-
}], clicked: [{
|
|
4654
|
-
type: Output
|
|
4655
|
-
}] } });
|
|
4656
|
-
|
|
4657
|
-
/**
|
|
4658
|
-
* Basis Komponente für SacGridImage
|
|
4659
|
-
*/
|
|
4660
|
-
class SacGridImageCommon {
|
|
4661
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridImageCommon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4662
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacGridImageCommon, inputs: { iconstyle: "iconstyle" }, ngImport: i0 }); }
|
|
4663
|
-
}
|
|
4664
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacGridImageCommon, decorators: [{
|
|
4665
|
-
type: Directive
|
|
4666
|
-
}], propDecorators: { iconstyle: [{
|
|
4667
|
-
type: Input
|
|
4668
|
-
}] } });
|
|
4669
|
-
|
|
4670
4797
|
/**
|
|
4671
4798
|
* Moment
|
|
4672
4799
|
*/
|
|
@@ -4675,17 +4802,18 @@ const moment$4 = moment_['default'];
|
|
|
4675
4802
|
* Base Klasse für Date/Time Controls
|
|
4676
4803
|
*/
|
|
4677
4804
|
class SacBaseDateTimeControl extends SacBaseModelControl {
|
|
4678
|
-
// #
|
|
4805
|
+
// #endregion Properties
|
|
4806
|
+
// #region Constructors
|
|
4679
4807
|
/**
|
|
4680
|
-
*
|
|
4681
|
-
* @param
|
|
4682
|
-
* @param injector
|
|
4683
|
-
* @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
|
|
4684
4812
|
*/
|
|
4685
|
-
constructor(
|
|
4686
|
-
super(
|
|
4687
|
-
this.
|
|
4688
|
-
|
|
4813
|
+
constructor(formlayout, injector, elementRef) {
|
|
4814
|
+
super(formlayout, injector);
|
|
4815
|
+
this.elementRef = elementRef;
|
|
4816
|
+
// #region Properties
|
|
4689
4817
|
/**
|
|
4690
4818
|
* das property enthielt das Value als string. Default ist ''
|
|
4691
4819
|
*/
|
|
@@ -4693,72 +4821,30 @@ class SacBaseDateTimeControl extends SacBaseModelControl {
|
|
|
4693
4821
|
/**
|
|
4694
4822
|
* Definiert das Control als Required
|
|
4695
4823
|
*/
|
|
4696
|
-
this.isrequired = false;
|
|
4697
|
-
/**
|
|
4698
|
-
* TextBox Placeholder
|
|
4699
|
-
*/
|
|
4700
|
-
this.placeholder = null;
|
|
4701
|
-
/**
|
|
4702
|
-
* Resource Key für Validation Message
|
|
4703
|
-
*/
|
|
4704
|
-
this.
|
|
4705
|
-
/**
|
|
4706
|
-
* Resource Key für Validation Message
|
|
4707
|
-
*/
|
|
4708
|
-
this.
|
|
4709
|
-
/**
|
|
4710
|
-
* Resource Key für Validation Message
|
|
4711
|
-
*/
|
|
4712
|
-
this.
|
|
4713
|
-
/**
|
|
4714
|
-
* Resource Key für Validation Message
|
|
4715
|
-
*/
|
|
4716
|
-
this.
|
|
4717
|
-
}
|
|
4718
|
-
// #endregion
|
|
4719
|
-
/**
|
|
4720
|
-
* Init Event
|
|
4721
|
-
*/
|
|
4722
|
-
ngOnInit() {
|
|
4723
|
-
super.ngOnInit();
|
|
4724
|
-
this.SetDateTimeFormat();
|
|
4725
|
-
}
|
|
4726
|
-
//#endregion
|
|
4727
|
-
//#region Variablen
|
|
4728
|
-
//#endregion
|
|
4729
|
-
// #region Properties
|
|
4730
|
-
//#endregion
|
|
4731
|
-
//#region ValueControlAccess
|
|
4732
|
-
/**
|
|
4733
|
-
* Overwrite WriteValue to Set correct Date Object
|
|
4734
|
-
*/
|
|
4735
|
-
writeValue(value) {
|
|
4736
|
-
if (value === '' || value === null || value === undefined) {
|
|
4737
|
-
// Reset Value String, damit beim Update des Models auch das Input Feld geleert wird.
|
|
4738
|
-
this._valueAsString = '';
|
|
4739
|
-
// Set Internal Property
|
|
4740
|
-
this._value = null;
|
|
4741
|
-
}
|
|
4742
|
-
else {
|
|
4743
|
-
this._value = this.getDate(value).toDate();
|
|
4744
|
-
}
|
|
4745
|
-
super.writeValue(this._value);
|
|
4746
|
-
}
|
|
4747
|
-
/**
|
|
4748
|
-
* JSON Date String in ein UTC DateTime Object konvertieren, welches vom Control verwendete werden kann
|
|
4749
|
-
*/
|
|
4750
|
-
getDate(timestamp) {
|
|
4751
|
-
const date = new Date(timestamp);
|
|
4752
|
-
const year = date.getUTCFullYear();
|
|
4753
|
-
const month = date.getUTCMonth();
|
|
4754
|
-
const day = date.getUTCDate();
|
|
4755
|
-
const hours = date.getUTCHours();
|
|
4756
|
-
const minutes = date.getUTCMinutes();
|
|
4757
|
-
const seconds = date.getUTCSeconds();
|
|
4758
|
-
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';
|
|
4759
4845
|
}
|
|
4760
|
-
|
|
4761
|
-
// #region
|
|
4846
|
+
// #endregion Constructors
|
|
4847
|
+
// #region Public Getters And Setters
|
|
4762
4848
|
/**
|
|
4763
4849
|
* Das Input bekommt das value von typ string
|
|
4764
4850
|
*/
|
|
@@ -4785,23 +4871,34 @@ class SacBaseDateTimeControl extends SacBaseModelControl {
|
|
|
4785
4871
|
return date.local().format(this.GetDateTimeFormatString());
|
|
4786
4872
|
}
|
|
4787
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
|
+
}
|
|
4788
4896
|
/**
|
|
4789
4897
|
* setzt das value von typ string zu property valuestring
|
|
4790
4898
|
*/
|
|
4791
4899
|
setValueString(v) {
|
|
4792
4900
|
this.valuestring = v;
|
|
4793
4901
|
}
|
|
4794
|
-
// #endregion
|
|
4795
|
-
// #region Private Methods
|
|
4796
|
-
SetDateTimeFormat() {
|
|
4797
|
-
// HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
|
|
4798
|
-
if (this.ngControl) {
|
|
4799
|
-
this.ngControl.datetimeformatstring =
|
|
4800
|
-
this.GetDateTimeFormatString();
|
|
4801
|
-
}
|
|
4802
|
-
}
|
|
4803
|
-
// #endregion
|
|
4804
|
-
//#region Validation
|
|
4805
4902
|
/**
|
|
4806
4903
|
* Validator
|
|
4807
4904
|
*/
|
|
@@ -4813,23 +4910,47 @@ class SacBaseDateTimeControl extends SacBaseModelControl {
|
|
|
4813
4910
|
}
|
|
4814
4911
|
return error;
|
|
4815
4912
|
}
|
|
4816
|
-
|
|
4817
|
-
|
|
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 }); }
|
|
4818
4939
|
}
|
|
4819
4940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacBaseDateTimeControl, decorators: [{
|
|
4820
4941
|
type: Directive
|
|
4821
|
-
}], ctorParameters: function () { return [{ type:
|
|
4942
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { isrequired: [{
|
|
4822
4943
|
type: Input
|
|
4823
4944
|
}], placeholder: [{
|
|
4824
4945
|
type: Input
|
|
4825
|
-
}], validationmessagerequired: [{
|
|
4826
|
-
type: Input
|
|
4827
|
-
}], validationmessagerequiredsummary: [{
|
|
4828
|
-
type: Input
|
|
4829
4946
|
}], validationmessagedatetimeformat: [{
|
|
4830
4947
|
type: Input
|
|
4831
4948
|
}], validationmessagedatetimeformatsummary: [{
|
|
4832
4949
|
type: Input
|
|
4950
|
+
}], validationmessagerequired: [{
|
|
4951
|
+
type: Input
|
|
4952
|
+
}], validationmessagerequiredsummary: [{
|
|
4953
|
+
type: Input
|
|
4833
4954
|
}], valuestring: [{
|
|
4834
4955
|
type: Input
|
|
4835
4956
|
}] } });
|
|
@@ -4870,14 +4991,14 @@ class SacDateCommon extends SacBaseDateTimeControl {
|
|
|
4870
4991
|
}
|
|
4871
4992
|
// #endregion
|
|
4872
4993
|
/**
|
|
4873
|
-
*
|
|
4874
|
-
* @param
|
|
4875
|
-
* @param injector
|
|
4876
|
-
* @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
|
|
4877
4998
|
*/
|
|
4878
|
-
constructor(
|
|
4879
|
-
super(
|
|
4880
|
-
this.
|
|
4999
|
+
constructor(formlayout, injector, elementRef) {
|
|
5000
|
+
super(formlayout, injector, elementRef);
|
|
5001
|
+
this.elementRef = elementRef;
|
|
4881
5002
|
// #region Constants
|
|
4882
5003
|
/**
|
|
4883
5004
|
* Format des Datums
|
|
@@ -4980,7 +5101,7 @@ class SacDateCommon extends SacBaseDateTimeControl {
|
|
|
4980
5101
|
* HostListener
|
|
4981
5102
|
*/
|
|
4982
5103
|
onClick(targetElement) {
|
|
4983
|
-
const clickedInside = this.
|
|
5104
|
+
const clickedInside = this.elementRef.nativeElement.contains(targetElement);
|
|
4984
5105
|
if (!clickedInside) {
|
|
4985
5106
|
this._showselector = false;
|
|
4986
5107
|
}
|
|
@@ -5022,12 +5143,12 @@ class SacDateCommon extends SacBaseDateTimeControl {
|
|
|
5022
5143
|
}
|
|
5023
5144
|
return error;
|
|
5024
5145
|
}
|
|
5025
|
-
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 }); }
|
|
5026
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 }); }
|
|
5027
5148
|
}
|
|
5028
5149
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDateCommon, decorators: [{
|
|
5029
5150
|
type: Directive
|
|
5030
|
-
}], ctorParameters: function () { return [{ type:
|
|
5151
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { mindate: [{
|
|
5031
5152
|
type: Input
|
|
5032
5153
|
}], maxdate: [{
|
|
5033
5154
|
type: Input
|
|
@@ -5538,14 +5659,14 @@ class SacDateTimeCommon extends SacBaseDateTimeControl {
|
|
|
5538
5659
|
}
|
|
5539
5660
|
// #endregion
|
|
5540
5661
|
/**
|
|
5541
|
-
*
|
|
5542
|
-
* @param
|
|
5543
|
-
* @param injector
|
|
5544
|
-
* @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
|
|
5545
5666
|
*/
|
|
5546
|
-
constructor(
|
|
5547
|
-
super(
|
|
5548
|
-
this.
|
|
5667
|
+
constructor(formlayout, injector, elementRef) {
|
|
5668
|
+
super(formlayout, injector, elementRef);
|
|
5669
|
+
this.elementRef = elementRef;
|
|
5549
5670
|
//#endregion
|
|
5550
5671
|
// #region Constants
|
|
5551
5672
|
/**
|
|
@@ -5666,7 +5787,7 @@ class SacDateTimeCommon extends SacBaseDateTimeControl {
|
|
|
5666
5787
|
* HostListener
|
|
5667
5788
|
*/
|
|
5668
5789
|
onClick(targetElement) {
|
|
5669
|
-
const clickedInside = this.
|
|
5790
|
+
const clickedInside = this.elementRef.nativeElement.contains(targetElement);
|
|
5670
5791
|
if (!clickedInside) {
|
|
5671
5792
|
this._showselector = false;
|
|
5672
5793
|
}
|
|
@@ -5708,12 +5829,12 @@ class SacDateTimeCommon extends SacBaseDateTimeControl {
|
|
|
5708
5829
|
}
|
|
5709
5830
|
return error;
|
|
5710
5831
|
}
|
|
5711
|
-
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 }); }
|
|
5712
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 }); }
|
|
5713
5834
|
}
|
|
5714
5835
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacDateTimeCommon, decorators: [{
|
|
5715
5836
|
type: Directive
|
|
5716
|
-
}], ctorParameters: function () { return [{ type:
|
|
5837
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { mindate: [{
|
|
5717
5838
|
type: Input
|
|
5718
5839
|
}], maxdate: [{
|
|
5719
5840
|
type: Input
|
|
@@ -5767,14 +5888,14 @@ class SacTimeCommon extends SacBaseDateTimeControl {
|
|
|
5767
5888
|
}
|
|
5768
5889
|
// #endregion
|
|
5769
5890
|
/**
|
|
5770
|
-
*
|
|
5771
|
-
* @param
|
|
5772
|
-
* @param injector
|
|
5773
|
-
* @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
|
|
5774
5895
|
*/
|
|
5775
|
-
constructor(
|
|
5776
|
-
super(
|
|
5777
|
-
this.
|
|
5896
|
+
constructor(formlayout, injector, elementRef) {
|
|
5897
|
+
super(formlayout, injector, elementRef);
|
|
5898
|
+
this.elementRef = elementRef;
|
|
5778
5899
|
// #region Constants
|
|
5779
5900
|
/**
|
|
5780
5901
|
* Format des Datums
|
|
@@ -5875,7 +5996,7 @@ class SacTimeCommon extends SacBaseDateTimeControl {
|
|
|
5875
5996
|
* HostListener
|
|
5876
5997
|
*/
|
|
5877
5998
|
onClick(targetElement) {
|
|
5878
|
-
const clickedInside = this.
|
|
5999
|
+
const clickedInside = this.elementRef.nativeElement.contains(targetElement);
|
|
5879
6000
|
if (!clickedInside) {
|
|
5880
6001
|
this._showselector = false;
|
|
5881
6002
|
}
|
|
@@ -5917,12 +6038,12 @@ class SacTimeCommon extends SacBaseDateTimeControl {
|
|
|
5917
6038
|
}
|
|
5918
6039
|
return error;
|
|
5919
6040
|
}
|
|
5920
|
-
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 }); }
|
|
5921
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 }); }
|
|
5922
6043
|
}
|
|
5923
6044
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTimeCommon, decorators: [{
|
|
5924
6045
|
type: Directive
|
|
5925
|
-
}], ctorParameters: function () { return [{ type:
|
|
6046
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon }, { type: i0.Injector }, { type: i0.ElementRef }]; }, propDecorators: { mintime: [{
|
|
5926
6047
|
type: Input
|
|
5927
6048
|
}], maxtime: [{
|
|
5928
6049
|
type: Input
|
|
@@ -5939,36 +6060,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
5939
6060
|
args: ['document:click', ['$event.target']]
|
|
5940
6061
|
}] } });
|
|
5941
6062
|
|
|
5942
|
-
/**
|
|
5943
|
-
* Common Klasse für Static Label Control
|
|
5944
|
-
**/
|
|
5945
|
-
class SacStaticLabelCommon extends SacInputBase {
|
|
5946
|
-
constructor() {
|
|
5947
|
-
super(...arguments);
|
|
5948
|
-
/**
|
|
5949
|
-
* Erlaubt HTML Content in der Anzeige des Wertes
|
|
5950
|
-
*/
|
|
5951
|
-
this.allowhtml = false;
|
|
5952
|
-
}
|
|
5953
|
-
/**
|
|
5954
|
-
* Validierung des Controls
|
|
5955
|
-
*
|
|
5956
|
-
* @param c Control das Validiert werden soll
|
|
5957
|
-
* @returns Fehlermeldung aus Validation oder NULL
|
|
5958
|
-
*/
|
|
5959
|
-
validateData(c) {
|
|
5960
|
-
// Keine Validierung, daher immer NULL
|
|
5961
|
-
return null;
|
|
5962
|
-
}
|
|
5963
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacStaticLabelCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
5964
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacStaticLabelCommon, inputs: { allowhtml: "allowhtml" }, usesInheritance: true, ngImport: i0 }); }
|
|
5965
|
-
}
|
|
5966
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacStaticLabelCommon, decorators: [{
|
|
5967
|
-
type: Directive
|
|
5968
|
-
}], propDecorators: { allowhtml: [{
|
|
5969
|
-
type: Input
|
|
5970
|
-
}] } });
|
|
5971
|
-
|
|
5972
6063
|
/**
|
|
5973
6064
|
* Common Control für Form Item Container.
|
|
5974
6065
|
**/
|
|
@@ -6018,6 +6109,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
6018
6109
|
type: Input
|
|
6019
6110
|
}] } });
|
|
6020
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
|
+
|
|
6021
6142
|
/**
|
|
6022
6143
|
* Base Komponente für SacWizardCommon
|
|
6023
6144
|
*/
|
|
@@ -6208,33 +6329,18 @@ class TinyMceDialogSettings {
|
|
|
6208
6329
|
* Basis Komponente für TinyMCE Editor
|
|
6209
6330
|
*/
|
|
6210
6331
|
class SacTinyMceCommon extends SacBaseModelControl {
|
|
6332
|
+
// #endregion Properties
|
|
6333
|
+
// #region Constructors
|
|
6211
6334
|
/**
|
|
6212
|
-
*
|
|
6213
|
-
* @
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
this._config = {
|
|
6217
|
-
...this.getDynamicSettings(),
|
|
6218
|
-
...this.baseConfig,
|
|
6219
|
-
...this.overwriteDefaultSettings(),
|
|
6220
|
-
...v,
|
|
6221
|
-
};
|
|
6222
|
-
}
|
|
6223
|
-
/**
|
|
6224
|
-
* TinyMCE Konfiguration
|
|
6225
|
-
*/
|
|
6226
|
-
get config() {
|
|
6227
|
-
return this._config;
|
|
6228
|
-
}
|
|
6229
|
-
/**
|
|
6230
|
-
* Konstruktor
|
|
6231
|
-
* @param parent Instanz vom Formular
|
|
6232
|
-
* @param injector Injector Service
|
|
6233
|
-
* @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
|
|
6234
6339
|
*/
|
|
6235
|
-
constructor(
|
|
6236
|
-
super(
|
|
6340
|
+
constructor(formlayout, injector, ngZone) {
|
|
6341
|
+
super(formlayout, injector);
|
|
6237
6342
|
this.ngZone = ngZone;
|
|
6343
|
+
// #region Properties
|
|
6238
6344
|
/**
|
|
6239
6345
|
* Default Config mit Standardwerten für TinyMCE
|
|
6240
6346
|
*/
|
|
@@ -6248,49 +6354,37 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6248
6354
|
save_onsavecallback: () => { },
|
|
6249
6355
|
};
|
|
6250
6356
|
/**
|
|
6251
|
-
*
|
|
6252
|
-
*/
|
|
6253
|
-
this._config = {};
|
|
6254
|
-
/**
|
|
6255
|
-
* Der Select Dialog wird angezeigt
|
|
6256
|
-
*/
|
|
6257
|
-
this.selectdialogvisible = false;
|
|
6258
|
-
/**
|
|
6259
|
-
* Definiert das Control als Required
|
|
6357
|
+
* Erlaubt im Filebrowser das löschen von Dateien
|
|
6260
6358
|
*/
|
|
6261
|
-
this.
|
|
6359
|
+
this.allowfiledelete = false;
|
|
6262
6360
|
/**
|
|
6263
|
-
*
|
|
6361
|
+
* Erlaubt im Filebrowser das umbennen von Dateien
|
|
6264
6362
|
*/
|
|
6265
|
-
this.
|
|
6363
|
+
this.allowfilerename = false;
|
|
6266
6364
|
/**
|
|
6267
|
-
*
|
|
6365
|
+
* Erlaubt im Filebrowser das hochladen von Files
|
|
6268
6366
|
*/
|
|
6269
|
-
this.
|
|
6367
|
+
this.allowfileupload = false;
|
|
6270
6368
|
/**
|
|
6271
6369
|
* Erlaubt im Filebrowser das anlegen eines Ordners
|
|
6272
6370
|
*/
|
|
6273
6371
|
this.allowfoldercreate = false;
|
|
6274
|
-
/**
|
|
6275
|
-
* Erlaubt im Filebrowser das umbennen eines Ordners
|
|
6276
|
-
*/
|
|
6277
|
-
this.allowfolderrename = false;
|
|
6278
6372
|
/**
|
|
6279
6373
|
* Erlaubt im Filebrowser das löschen eines Ordners
|
|
6280
6374
|
*/
|
|
6281
6375
|
this.allowfolderdelete = false;
|
|
6282
6376
|
/**
|
|
6283
|
-
* Erlaubt im Filebrowser das
|
|
6377
|
+
* Erlaubt im Filebrowser das umbennen eines Ordners
|
|
6284
6378
|
*/
|
|
6285
|
-
this.
|
|
6379
|
+
this.allowfolderrename = false;
|
|
6286
6380
|
/**
|
|
6287
|
-
*
|
|
6381
|
+
* URL zu Filebrowser Backend
|
|
6288
6382
|
*/
|
|
6289
|
-
this.
|
|
6383
|
+
this.filebrowserapiurl = null;
|
|
6290
6384
|
/**
|
|
6291
|
-
*
|
|
6385
|
+
* File Extensions für Links (Format: .xxx,.yyy,.eee)
|
|
6292
6386
|
*/
|
|
6293
|
-
this.
|
|
6387
|
+
this.filetypesfiles = '';
|
|
6294
6388
|
/**
|
|
6295
6389
|
* File Extensions für Images (Format: .xxx,.yyy,.eee)
|
|
6296
6390
|
*/
|
|
@@ -6300,9 +6394,13 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6300
6394
|
*/
|
|
6301
6395
|
this.filetypesvideo = '.mp4,.m4v,.ogv,.webm,.mov';
|
|
6302
6396
|
/**
|
|
6303
|
-
*
|
|
6397
|
+
* Höhe des Editors
|
|
6304
6398
|
*/
|
|
6305
|
-
this.
|
|
6399
|
+
this.height = undefined;
|
|
6400
|
+
/**
|
|
6401
|
+
* Definiert das Control als Required
|
|
6402
|
+
*/
|
|
6403
|
+
this.isrequired = false;
|
|
6306
6404
|
/**
|
|
6307
6405
|
* Resource Key für Validation Message Required bei Control
|
|
6308
6406
|
*/
|
|
@@ -6315,10 +6413,66 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6315
6413
|
* Event wenn Save Action in TinyMCE ausgelöst wird
|
|
6316
6414
|
*/
|
|
6317
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;
|
|
6318
6424
|
this.lngResourceService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService());
|
|
6319
6425
|
this.config = {};
|
|
6320
6426
|
}
|
|
6321
|
-
|
|
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
|
+
}
|
|
6322
6476
|
/**
|
|
6323
6477
|
* Zeigt den Dateiauswahl Dialog an
|
|
6324
6478
|
* @param callback Callback Methode welche aufgerufen wird, wenn der Dialog geschlossen wird
|
|
@@ -6353,34 +6507,6 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6353
6507
|
});
|
|
6354
6508
|
});
|
|
6355
6509
|
}
|
|
6356
|
-
/**
|
|
6357
|
-
* Setzt das Resultat aus dem Dateiauswahl Dialog
|
|
6358
|
-
*/
|
|
6359
|
-
setSelectDialogResult() {
|
|
6360
|
-
if (this.selectDialogSettings.value) {
|
|
6361
|
-
if (this.selectDialogSettings.value.startsWith('/') ||
|
|
6362
|
-
this.selectDialogSettings.value.startsWith('\\')) {
|
|
6363
|
-
this.selectDialogSettings.value =
|
|
6364
|
-
this.selectDialogSettings.value.substring(1);
|
|
6365
|
-
}
|
|
6366
|
-
this.selectDialogSettings.callback(this.selectDialogSettings.value);
|
|
6367
|
-
}
|
|
6368
|
-
this.closeSelectDialog();
|
|
6369
|
-
}
|
|
6370
|
-
/**
|
|
6371
|
-
* Schliesst den Dateiauswahl Dialog
|
|
6372
|
-
*/
|
|
6373
|
-
closeSelectDialog() {
|
|
6374
|
-
this.selectdialogvisible = false;
|
|
6375
|
-
}
|
|
6376
|
-
//#endregion
|
|
6377
|
-
/**
|
|
6378
|
-
* Löst die Speichern Action aus
|
|
6379
|
-
* @param content Content als String
|
|
6380
|
-
*/
|
|
6381
|
-
save(content) {
|
|
6382
|
-
this.onsave.emit(content);
|
|
6383
|
-
}
|
|
6384
6510
|
/**
|
|
6385
6511
|
* Validiert das Control
|
|
6386
6512
|
* @param c Control Instanz die valdidiert wird
|
|
@@ -6393,6 +6519,8 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6393
6519
|
}
|
|
6394
6520
|
return error;
|
|
6395
6521
|
}
|
|
6522
|
+
// #endregion Public Abstract Methods
|
|
6523
|
+
// #region Private Methods
|
|
6396
6524
|
/**
|
|
6397
6525
|
* Gibt die TinyMCE Settings zurück, die aus den Properties der Angular Komponenten erzeugt werden
|
|
6398
6526
|
* @returns Objekt mit Settings
|
|
@@ -6404,44 +6532,104 @@ class SacTinyMceCommon extends SacBaseModelControl {
|
|
|
6404
6532
|
};
|
|
6405
6533
|
return settings;
|
|
6406
6534
|
}
|
|
6407
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTinyMceCommon, deps: [{ token:
|
|
6408
|
-
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 }); }
|
|
6409
6537
|
}
|
|
6410
6538
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTinyMceCommon, decorators: [{
|
|
6411
6539
|
type: Directive
|
|
6412
|
-
}], ctorParameters: function () { return [{ type:
|
|
6540
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
6413
6541
|
type: Host
|
|
6414
|
-
}] }, { type: i0.Injector }, { type: i0.NgZone }]; }, propDecorators: {
|
|
6542
|
+
}] }, { type: i0.Injector }, { type: i0.NgZone }]; }, propDecorators: { allowfiledelete: [{
|
|
6415
6543
|
type: Input
|
|
6416
|
-
}],
|
|
6544
|
+
}], allowfilerename: [{
|
|
6417
6545
|
type: Input
|
|
6418
|
-
}],
|
|
6546
|
+
}], allowfileupload: [{
|
|
6419
6547
|
type: Input
|
|
6420
6548
|
}], allowfoldercreate: [{
|
|
6421
6549
|
type: Input
|
|
6422
|
-
}], allowfolderrename: [{
|
|
6423
|
-
type: Input
|
|
6424
6550
|
}], allowfolderdelete: [{
|
|
6425
6551
|
type: Input
|
|
6426
|
-
}],
|
|
6552
|
+
}], allowfolderrename: [{
|
|
6427
6553
|
type: Input
|
|
6428
|
-
}],
|
|
6554
|
+
}], filebrowserapiurl: [{
|
|
6429
6555
|
type: Input
|
|
6430
|
-
}],
|
|
6556
|
+
}], filetypesfiles: [{
|
|
6431
6557
|
type: Input
|
|
6432
6558
|
}], filetypesimages: [{
|
|
6433
6559
|
type: Input
|
|
6434
6560
|
}], filetypesvideo: [{
|
|
6435
6561
|
type: Input
|
|
6436
|
-
}],
|
|
6562
|
+
}], height: [{
|
|
6563
|
+
type: Input
|
|
6564
|
+
}], isrequired: [{
|
|
6437
6565
|
type: Input
|
|
6438
6566
|
}], validationmessagerequired: [{
|
|
6439
6567
|
type: Input
|
|
6440
6568
|
}], validationmessagesummaryrequired: [{
|
|
6441
6569
|
type: Input
|
|
6570
|
+
}], onsave: [{
|
|
6571
|
+
type: Output
|
|
6442
6572
|
}], config: [{
|
|
6443
6573
|
type: Input
|
|
6444
|
-
}]
|
|
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: [{
|
|
6445
6633
|
type: Output
|
|
6446
6634
|
}] } });
|
|
6447
6635
|
|
|
@@ -6804,66 +6992,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
6804
6992
|
type: Directive
|
|
6805
6993
|
}] });
|
|
6806
6994
|
|
|
6807
|
-
/**
|
|
6808
|
-
*Basis Komponente für SacTreeItemAction
|
|
6809
|
-
*/
|
|
6810
|
-
class SacTreeItemActionCommon {
|
|
6811
|
-
/**
|
|
6812
|
-
* Konstruktor
|
|
6813
|
-
* @param el Element Referenz
|
|
6814
|
-
*/
|
|
6815
|
-
constructor(el) {
|
|
6816
|
-
this.el = el;
|
|
6817
|
-
/**
|
|
6818
|
-
* Event wenn auf das Icon geclickt wird
|
|
6819
|
-
*/
|
|
6820
|
-
this.clicked = new EventEmitter();
|
|
6821
|
-
}
|
|
6822
|
-
/**
|
|
6823
|
-
* lifecycle OnInit hook. Wird aufgeruren sobald das Komponent initialisiert ist.
|
|
6824
|
-
*/
|
|
6825
|
-
ngOnInit() {
|
|
6826
|
-
let rootElement = this.el.nativeElement;
|
|
6827
|
-
let parentElement = rootElement.parentElement;
|
|
6828
|
-
while (rootElement.firstChild) {
|
|
6829
|
-
parentElement.insertBefore(rootElement.firstChild, rootElement);
|
|
6830
|
-
}
|
|
6831
|
-
parentElement.removeChild(rootElement);
|
|
6832
|
-
}
|
|
6833
|
-
/**
|
|
6834
|
-
* Die Methode erstellt die CSS Klasse des Icon. Akzeptiert ein Key-word und baut ein vollständige CSS Klasse.
|
|
6835
|
-
*/
|
|
6836
|
-
transformClass(initialClass) {
|
|
6837
|
-
switch (initialClass) {
|
|
6838
|
-
case 'add':
|
|
6839
|
-
return 'jstree-icon icon icon-base-add jstree-add';
|
|
6840
|
-
case 'delete':
|
|
6841
|
-
return 'jstree-icon icon icon-base-delete jstree-delete';
|
|
6842
|
-
default:
|
|
6843
|
-
return initialClass;
|
|
6844
|
-
}
|
|
6845
|
-
}
|
|
6846
|
-
/**
|
|
6847
|
-
* Die Methode wird das cklickaction Emitter aktivieren.
|
|
6848
|
-
*/
|
|
6849
|
-
iconaction() {
|
|
6850
|
-
this.clicked.emit();
|
|
6851
|
-
}
|
|
6852
|
-
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 }); }
|
|
6853
|
-
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 }); }
|
|
6854
|
-
}
|
|
6855
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacTreeItemActionCommon, decorators: [{
|
|
6856
|
-
type: Directive
|
|
6857
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { item: [{
|
|
6858
|
-
type: Input
|
|
6859
|
-
}], title: [{
|
|
6860
|
-
type: Input
|
|
6861
|
-
}], iconstyle: [{
|
|
6862
|
-
type: Input
|
|
6863
|
-
}], clicked: [{
|
|
6864
|
-
type: Output
|
|
6865
|
-
}] } });
|
|
6866
|
-
|
|
6867
6995
|
/**
|
|
6868
6996
|
* Enum für Tooltip Positionen
|
|
6869
6997
|
*/
|
|
@@ -7236,87 +7364,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7236
7364
|
}], content: [{
|
|
7237
7365
|
type: ViewChild,
|
|
7238
7366
|
args: ['container', { static: true }]
|
|
7239
|
-
}], tooltip: [{
|
|
7240
|
-
type: ViewChild,
|
|
7241
|
-
args: ['tooltip', { static: true }]
|
|
7242
|
-
}] } });
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
*/
|
|
7252
|
-
constructor(ufile) {
|
|
7253
|
-
this.uploadId = ufile.uploadId;
|
|
7254
|
-
this.name = ufile.name;
|
|
7255
|
-
this.progress = ufile.progress;
|
|
7256
|
-
this.status = ufile.status;
|
|
7257
|
-
this.documentid = null;
|
|
7258
|
-
}
|
|
7259
|
-
}
|
|
7260
|
-
/**
|
|
7261
|
-
* Base Klasse für Uploader Control
|
|
7262
|
-
*/
|
|
7263
|
-
class SacUploadBase extends SacBaseModelControl {
|
|
7264
|
-
/**
|
|
7265
|
-
* Erlaubte Dateitypen für den Upload. Format: ".xxx,.yyy,.zzz"
|
|
7266
|
-
*/
|
|
7267
|
-
set allowedtypes(types) {
|
|
7268
|
-
this._allowedtypes = types;
|
|
7269
|
-
this.setAllowedTypes(types);
|
|
7270
|
-
}
|
|
7271
|
-
get allowedtypes() {
|
|
7272
|
-
return this._allowedtypes;
|
|
7273
|
-
}
|
|
7274
|
-
/**
|
|
7275
|
-
* Files nach der Auswahl automatisch hochladen
|
|
7276
|
-
*/
|
|
7277
|
-
set autoupload(v) {
|
|
7278
|
-
this._autoupload = v;
|
|
7279
|
-
this.options.autoUpload = v;
|
|
7280
|
-
this.uploadService.connect(this.options);
|
|
7281
|
-
}
|
|
7282
|
-
get autoupload() {
|
|
7283
|
-
return this._autoupload;
|
|
7284
|
-
}
|
|
7285
|
-
/**
|
|
7286
|
-
* Uploads können unterbrochen werden
|
|
7287
|
-
*/
|
|
7288
|
-
set enablepause(v) {
|
|
7289
|
-
this._enablepause = v;
|
|
7290
|
-
}
|
|
7291
|
-
get enablepause() {
|
|
7292
|
-
return this._enablepause;
|
|
7293
|
-
}
|
|
7294
|
-
//#endregion
|
|
7295
|
-
/**
|
|
7296
|
-
* Definiert den Registration Endpoint für Uploads.
|
|
7297
|
-
*/
|
|
7298
|
-
set endpoint(v) {
|
|
7299
|
-
this._endpoint = v;
|
|
7300
|
-
this.setEndpoint(v);
|
|
7301
|
-
}
|
|
7302
|
-
get endpoint() {
|
|
7303
|
-
return this._endpoint;
|
|
7304
|
-
}
|
|
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
|
|
7305
7379
|
/**
|
|
7306
7380
|
* Constructor
|
|
7307
|
-
* @param
|
|
7308
|
-
* @param injector Injector
|
|
7309
|
-
* @param renderer
|
|
7310
|
-
* @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
|
|
7311
7385
|
*/
|
|
7312
|
-
constructor(
|
|
7313
|
-
super(
|
|
7386
|
+
constructor(formlayout, injector, renderer, ngZone) {
|
|
7387
|
+
super(formlayout, injector);
|
|
7314
7388
|
this.renderer = renderer;
|
|
7315
7389
|
this.ngZone = ngZone;
|
|
7316
|
-
/**
|
|
7317
|
-
* Upload Settings
|
|
7318
|
-
*/
|
|
7319
|
-
this.options = {};
|
|
7320
7390
|
/**
|
|
7321
7391
|
* Erlaubte Dateitypen
|
|
7322
7392
|
*/
|
|
@@ -7333,23 +7403,26 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7333
7403
|
* API Endpoint
|
|
7334
7404
|
*/
|
|
7335
7405
|
this._endpoint = null;
|
|
7336
|
-
//#region Properties
|
|
7337
7406
|
/**
|
|
7338
|
-
*
|
|
7407
|
+
* Upload Settings
|
|
7339
7408
|
*/
|
|
7340
|
-
this.
|
|
7409
|
+
this.options = {};
|
|
7341
7410
|
/**
|
|
7342
|
-
*
|
|
7411
|
+
* Definiert das Control als Required
|
|
7343
7412
|
*/
|
|
7344
|
-
this.
|
|
7413
|
+
this.isrequired = false;
|
|
7345
7414
|
/**
|
|
7346
7415
|
* Max. Dateigrösse für Files die hochgeladen werden können. 0 deaktiviert den Filter
|
|
7347
7416
|
*/
|
|
7348
7417
|
this.maxfilesize = 0;
|
|
7349
7418
|
/**
|
|
7350
|
-
*
|
|
7419
|
+
* Resource Key für Validation Message Required bei Control
|
|
7351
7420
|
*/
|
|
7352
|
-
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';
|
|
7353
7426
|
/**
|
|
7354
7427
|
* Event wenn ein Error in der Komponente ausgelöst wird.
|
|
7355
7428
|
*/
|
|
@@ -7380,107 +7453,80 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7380
7453
|
// Subscripe Event for State changes
|
|
7381
7454
|
this.uploadService.events.subscribe((ufile) => this.onUpload(ufile));
|
|
7382
7455
|
}
|
|
7456
|
+
// #endregion Constructors
|
|
7457
|
+
// #region Public Getters And Setters
|
|
7383
7458
|
/**
|
|
7384
|
-
*
|
|
7459
|
+
* Erlaubte Dateitypen für den Upload. Format: ".xxx,.yyy,.zzz"
|
|
7385
7460
|
*/
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
this.listenerFn = this.renderer.listen(this.uploadInput.nativeElement, 'change', this.fileListener);
|
|
7390
|
-
this.setAllowedTypes(this._allowedtypes);
|
|
7391
|
-
this.setEndpoint(this._endpoint);
|
|
7392
|
-
if (this._endpoint === null) {
|
|
7393
|
-
throw new Error('endpoint is not defined!');
|
|
7394
|
-
}
|
|
7395
|
-
this.uploadService.connect(this.options);
|
|
7461
|
+
set allowedtypes(types) {
|
|
7462
|
+
this._allowedtypes = types;
|
|
7463
|
+
this.setAllowedTypes(types);
|
|
7396
7464
|
}
|
|
7397
7465
|
/**
|
|
7398
|
-
*
|
|
7466
|
+
* Files nach der Auswahl automatisch hochladen
|
|
7399
7467
|
*/
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7468
|
+
set autoupload(v) {
|
|
7469
|
+
this._autoupload = v;
|
|
7470
|
+
this.options.autoUpload = v;
|
|
7471
|
+
this.uploadService.connect(this.options);
|
|
7404
7472
|
}
|
|
7405
|
-
//#region All File Events
|
|
7406
7473
|
/**
|
|
7407
|
-
*
|
|
7474
|
+
* Uploads können unterbrochen werden
|
|
7408
7475
|
*/
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
this.uploadService.control({ action: 'cancel' });
|
|
7412
|
-
}
|
|
7476
|
+
set enablepause(v) {
|
|
7477
|
+
this._enablepause = v;
|
|
7413
7478
|
}
|
|
7414
7479
|
/**
|
|
7415
|
-
*
|
|
7480
|
+
* Definiert den Registration Endpoint für Uploads.
|
|
7416
7481
|
*/
|
|
7417
|
-
|
|
7418
|
-
|
|
7419
|
-
|
|
7420
|
-
}
|
|
7482
|
+
set endpoint(v) {
|
|
7483
|
+
this._endpoint = v;
|
|
7484
|
+
this.setEndpoint(v);
|
|
7421
7485
|
}
|
|
7422
7486
|
/**
|
|
7423
|
-
*
|
|
7487
|
+
* Icon for browse button
|
|
7424
7488
|
*/
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
this.uploadService.control({ action: 'pause' });
|
|
7428
|
-
}
|
|
7489
|
+
get IconBrowse() {
|
|
7490
|
+
return this.iconService.UploadComponentBrowseIcon;
|
|
7429
7491
|
}
|
|
7430
|
-
//#endregion
|
|
7431
|
-
//#region Singel File Events
|
|
7432
7492
|
/**
|
|
7433
|
-
*
|
|
7434
|
-
* @param uploadId ID of File to cancel
|
|
7493
|
+
* icon for continous buttons
|
|
7435
7494
|
*/
|
|
7436
|
-
|
|
7437
|
-
this.
|
|
7495
|
+
get IconContinue() {
|
|
7496
|
+
return this.iconService.UploadComponentContinueIcon;
|
|
7438
7497
|
}
|
|
7439
7498
|
/**
|
|
7440
|
-
*
|
|
7441
|
-
* @param uploadId ID of File to Cancel
|
|
7499
|
+
* icon for delete buttons
|
|
7442
7500
|
*/
|
|
7443
|
-
|
|
7444
|
-
this.
|
|
7501
|
+
get IconDelete() {
|
|
7502
|
+
return this.iconService.UploadComponentDeleteIcon;
|
|
7445
7503
|
}
|
|
7446
7504
|
/**
|
|
7447
|
-
*
|
|
7448
|
-
*
|
|
7449
|
-
* @param uploadId ID of File to Upload
|
|
7505
|
+
* icon for pause buttons
|
|
7450
7506
|
*/
|
|
7451
|
-
|
|
7452
|
-
this.
|
|
7507
|
+
get IconPause() {
|
|
7508
|
+
return this.iconService.UploadComponentPauseIcon;
|
|
7453
7509
|
}
|
|
7454
|
-
//#endregion
|
|
7455
|
-
//#region UI Property Helper
|
|
7456
7510
|
/**
|
|
7457
|
-
*
|
|
7458
|
-
* @returns Elemente in der Queue
|
|
7511
|
+
* icon for upload button
|
|
7459
7512
|
*/
|
|
7460
|
-
|
|
7461
|
-
return this.
|
|
7513
|
+
get IconUpload() {
|
|
7514
|
+
return this.iconService.UploadComponentUploadIcon;
|
|
7462
7515
|
}
|
|
7463
|
-
|
|
7464
|
-
|
|
7465
|
-
* @returns Elemente für Upload vorhanden
|
|
7466
|
-
*/
|
|
7467
|
-
IsStateToUpload() {
|
|
7468
|
-
return (this.uploads.filter((itm) => itm.status === 'added' || itm.status === 'paused').length > 0);
|
|
7516
|
+
get allowedtypes() {
|
|
7517
|
+
return this._allowedtypes;
|
|
7469
7518
|
}
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
* @returns Upload ist am laufen
|
|
7473
|
-
*/
|
|
7474
|
-
IsUploading() {
|
|
7475
|
-
return this.uploads.filter((itm) => itm.status === 'uploading').length > 0;
|
|
7519
|
+
get autoupload() {
|
|
7520
|
+
return this._autoupload;
|
|
7476
7521
|
}
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
* @returns Pausierter Upload ist vorhanden
|
|
7480
|
-
*/
|
|
7481
|
-
IsPaused() {
|
|
7482
|
-
return this.uploads.filter((itm) => itm.status === 'paused').length > 0;
|
|
7522
|
+
get enablepause() {
|
|
7523
|
+
return this._enablepause;
|
|
7483
7524
|
}
|
|
7525
|
+
get endpoint() {
|
|
7526
|
+
return this._endpoint;
|
|
7527
|
+
}
|
|
7528
|
+
// #endregion Public Getters And Setters
|
|
7529
|
+
// #region Public Methods
|
|
7484
7530
|
/**
|
|
7485
7531
|
* Name der Datei die Hochgeladen wird
|
|
7486
7532
|
* @returns Observable des Dateinamens.
|
|
@@ -7493,6 +7539,13 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7493
7539
|
return this.lngResourceService.GetString('UPLOAD_NO_FILE_SELECTED');
|
|
7494
7540
|
}
|
|
7495
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
|
+
}
|
|
7496
7549
|
/**
|
|
7497
7550
|
* Gibt an ob ein Upload abgeschlossen ist
|
|
7498
7551
|
* @returns Upload erfolgreich
|
|
@@ -7505,6 +7558,27 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7505
7558
|
return false;
|
|
7506
7559
|
}
|
|
7507
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
|
+
}
|
|
7508
7582
|
/**
|
|
7509
7583
|
* Gibt den Uploadfortschritt zurück
|
|
7510
7584
|
* @returns Upload Fortschritt. Wert von 0-100
|
|
@@ -7517,67 +7591,42 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7517
7591
|
return 0;
|
|
7518
7592
|
}
|
|
7519
7593
|
}
|
|
7520
|
-
//#endregion
|
|
7521
|
-
//#region Validation
|
|
7522
7594
|
/**
|
|
7523
|
-
*
|
|
7524
|
-
* @param
|
|
7595
|
+
* Cancel single upload
|
|
7596
|
+
* @param uploadId ID of File to cancel
|
|
7525
7597
|
*/
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
if (this.isrequired) {
|
|
7529
|
-
error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
7530
|
-
}
|
|
7531
|
-
return error;
|
|
7598
|
+
cancel(uploadId) {
|
|
7599
|
+
this.uploadService.control({ action: 'cancel', uploadId: uploadId });
|
|
7532
7600
|
}
|
|
7533
|
-
//#endregion
|
|
7534
7601
|
/**
|
|
7535
|
-
*
|
|
7536
|
-
*
|
|
7537
|
-
* @param types Erlaubte File Extensions
|
|
7602
|
+
* Cancel all Uploaded files
|
|
7538
7603
|
*/
|
|
7539
|
-
|
|
7540
|
-
|
|
7541
|
-
|
|
7542
|
-
this.renderer.setAttribute(this.uploadInput.nativeElement, 'accept', types);
|
|
7604
|
+
cancelAll() {
|
|
7605
|
+
if (this.HasQueueItem() === true) {
|
|
7606
|
+
this.uploadService.control({ action: 'cancel' });
|
|
7543
7607
|
}
|
|
7544
|
-
this.options.allowedTypes = types;
|
|
7545
|
-
}
|
|
7546
|
-
/**
|
|
7547
|
-
* Setzt den Upload Endpoit
|
|
7548
|
-
* @param url Register URI
|
|
7549
|
-
*/
|
|
7550
|
-
setEndpoint(url) {
|
|
7551
|
-
this.options.endpoint = url;
|
|
7552
7608
|
}
|
|
7553
7609
|
/**
|
|
7554
|
-
*
|
|
7555
|
-
*
|
|
7556
|
-
* @param filename Dateiname
|
|
7610
|
+
* Destroy des Controls
|
|
7557
7611
|
*/
|
|
7558
|
-
|
|
7559
|
-
if (this.
|
|
7560
|
-
|
|
7612
|
+
ngOnDestroy() {
|
|
7613
|
+
if (this.listenerFn) {
|
|
7614
|
+
this.listenerFn();
|
|
7561
7615
|
}
|
|
7562
|
-
let isValid = false;
|
|
7563
|
-
const extensions = this._allowedtypes.split(',');
|
|
7564
|
-
extensions.forEach((itm) => {
|
|
7565
|
-
if (filename.toLowerCase().endsWith(itm.toLowerCase())) {
|
|
7566
|
-
isValid = true;
|
|
7567
|
-
}
|
|
7568
|
-
});
|
|
7569
|
-
return isValid;
|
|
7570
7616
|
}
|
|
7571
7617
|
/**
|
|
7572
|
-
*
|
|
7573
|
-
*
|
|
7574
|
-
* @param filesize Max File Size in Bytes
|
|
7618
|
+
* Initialisiert das Control
|
|
7575
7619
|
*/
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
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!');
|
|
7579
7628
|
}
|
|
7580
|
-
|
|
7629
|
+
this.uploadService.connect(this.options);
|
|
7581
7630
|
}
|
|
7582
7631
|
/**
|
|
7583
7632
|
* Upload Event
|
|
@@ -7619,14 +7668,52 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7619
7668
|
this.uploads[index].status = ufile.status;
|
|
7620
7669
|
}
|
|
7621
7670
|
}
|
|
7622
|
-
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
|
+
}
|
|
7623
7687
|
}
|
|
7624
7688
|
/**
|
|
7625
|
-
*
|
|
7689
|
+
* Upload Single File
|
|
7690
|
+
*
|
|
7691
|
+
* @param uploadId ID of File to Upload
|
|
7626
7692
|
*/
|
|
7627
|
-
|
|
7628
|
-
|
|
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;
|
|
7629
7714
|
}
|
|
7715
|
+
// #endregion Public Abstract Methods
|
|
7716
|
+
// #region Private Methods
|
|
7630
7717
|
UpdateFileCount() {
|
|
7631
7718
|
// HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
|
|
7632
7719
|
if (this.ngControl) {
|
|
@@ -7635,140 +7722,127 @@ class SacUploadBase extends SacBaseModelControl {
|
|
|
7635
7722
|
}
|
|
7636
7723
|
}
|
|
7637
7724
|
/**
|
|
7638
|
-
*
|
|
7725
|
+
* Returns the number of uploaded files
|
|
7639
7726
|
*/
|
|
7640
|
-
|
|
7641
|
-
return this.
|
|
7727
|
+
UploadedFileCount() {
|
|
7728
|
+
return this.uploads.filter((itm) => itm.status === 'complete').length;
|
|
7642
7729
|
}
|
|
7643
7730
|
/**
|
|
7644
|
-
*
|
|
7731
|
+
* Prüft ob die Dateierweiterung gültig ist
|
|
7732
|
+
*
|
|
7733
|
+
* @param filename Dateiname
|
|
7645
7734
|
*/
|
|
7646
|
-
|
|
7647
|
-
|
|
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;
|
|
7648
7747
|
}
|
|
7649
7748
|
/**
|
|
7650
|
-
*
|
|
7749
|
+
* Prüft ob das File nicht zu gross ist.
|
|
7750
|
+
*
|
|
7751
|
+
* @param filesize Max File Size in Bytes
|
|
7651
7752
|
*/
|
|
7652
|
-
|
|
7653
|
-
|
|
7753
|
+
isFileSizeValid(filesize) {
|
|
7754
|
+
if (this.maxfilesize === 0) {
|
|
7755
|
+
return true;
|
|
7756
|
+
}
|
|
7757
|
+
return this.maxfilesize >= filesize;
|
|
7654
7758
|
}
|
|
7655
7759
|
/**
|
|
7656
|
-
*
|
|
7760
|
+
* Setzt die erlaubten Datentypen für den Upload
|
|
7761
|
+
*
|
|
7762
|
+
* @param types Erlaubte File Extensions
|
|
7657
7763
|
*/
|
|
7658
|
-
|
|
7659
|
-
|
|
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;
|
|
7660
7770
|
}
|
|
7661
7771
|
/**
|
|
7662
|
-
*
|
|
7772
|
+
* Setzt den Upload Endpoit
|
|
7773
|
+
* @param url Register URI
|
|
7663
7774
|
*/
|
|
7664
|
-
|
|
7665
|
-
|
|
7775
|
+
setEndpoint(url) {
|
|
7776
|
+
this.options.endpoint = url;
|
|
7666
7777
|
}
|
|
7667
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadBase, deps: [{ token:
|
|
7668
|
-
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 }); }
|
|
7669
7780
|
}
|
|
7670
7781
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadBase, decorators: [{
|
|
7671
7782
|
type: Directive
|
|
7672
|
-
}], 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: [{
|
|
7673
7791
|
type: Input
|
|
7674
7792
|
}], validationmessagesummaryrequired: [{
|
|
7675
7793
|
type: Input
|
|
7794
|
+
}], onfileerror: [{
|
|
7795
|
+
type: Output
|
|
7676
7796
|
}], allowedtypes: [{
|
|
7677
7797
|
type: Input
|
|
7678
7798
|
}], autoupload: [{
|
|
7679
7799
|
type: Input
|
|
7680
7800
|
}], enablepause: [{
|
|
7681
7801
|
type: Input
|
|
7682
|
-
}], maxfilesize: [{
|
|
7683
|
-
type: Input
|
|
7684
|
-
}], isrequired: [{
|
|
7685
|
-
type: Input
|
|
7686
7802
|
}], endpoint: [{
|
|
7687
7803
|
type: Input
|
|
7688
|
-
}], onfileerror: [{
|
|
7689
|
-
type: Output
|
|
7690
|
-
}], uploadInput: [{
|
|
7691
|
-
type: ViewChild,
|
|
7692
|
-
args: ['files', { static: true }]
|
|
7693
7804
|
}] } });
|
|
7694
|
-
|
|
7695
7805
|
/**
|
|
7696
|
-
* Upload
|
|
7806
|
+
* Klasse für den Upload einer Datei in der Upload Component
|
|
7697
7807
|
*/
|
|
7698
|
-
class
|
|
7699
|
-
|
|
7700
|
-
|
|
7701
|
-
/**
|
|
7702
|
-
* Label für Browse Button
|
|
7703
|
-
*/
|
|
7704
|
-
this.buttonbrowse = 'Browse';
|
|
7705
|
-
/**
|
|
7706
|
-
* Label für Upload Button
|
|
7707
|
-
*/
|
|
7708
|
-
this.buttonupload = 'Upload';
|
|
7709
|
-
}
|
|
7710
|
-
/**
|
|
7711
|
-
* Macht keine Validierung in diesem Control
|
|
7712
|
-
*
|
|
7713
|
-
* @param file File das hinzugefügt wurde
|
|
7714
|
-
*/
|
|
7715
|
-
CustomAddValidation(file) {
|
|
7716
|
-
return true;
|
|
7717
|
-
}
|
|
7808
|
+
class SacUploadFile {
|
|
7809
|
+
// #endregion Properties
|
|
7810
|
+
// #region Constructors
|
|
7718
7811
|
/**
|
|
7719
|
-
*
|
|
7720
|
-
*
|
|
7721
|
-
* @param file ID des Files
|
|
7812
|
+
* Konstruktor
|
|
7813
|
+
* @param ufile Upload Status
|
|
7722
7814
|
*/
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
file.response !== null &&
|
|
7730
|
-
file.response.documentid !== null &&
|
|
7731
|
-
file.response.documentid !== undefined) {
|
|
7732
|
-
super.setValue(file.response.documentid);
|
|
7733
|
-
}
|
|
7734
|
-
else {
|
|
7735
|
-
super.setValue(file.uploadId);
|
|
7736
|
-
}
|
|
7737
|
-
}
|
|
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;
|
|
7738
7821
|
}
|
|
7739
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadSingleCommon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
7740
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacUploadSingleCommon, inputs: { buttonbrowse: "buttonbrowse", buttonupload: "buttonupload" }, usesInheritance: true, ngImport: i0 }); }
|
|
7741
7822
|
}
|
|
7742
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacUploadSingleCommon, decorators: [{
|
|
7743
|
-
type: Directive
|
|
7744
|
-
}], propDecorators: { buttonbrowse: [{
|
|
7745
|
-
type: Input
|
|
7746
|
-
}], buttonupload: [{
|
|
7747
|
-
type: Input
|
|
7748
|
-
}] } });
|
|
7749
7823
|
|
|
7750
7824
|
/**
|
|
7751
|
-
* Upload
|
|
7825
|
+
* Upload Komponente für ein einzelnes File
|
|
7752
7826
|
*/
|
|
7753
|
-
class
|
|
7827
|
+
class SacDropzoneMultipleCommon extends SacUploadBase {
|
|
7754
7828
|
constructor() {
|
|
7755
7829
|
super(...arguments);
|
|
7756
7830
|
/**
|
|
7757
|
-
*
|
|
7831
|
+
* Property wenn Drag Event aktiv ist (Maus über Zone)
|
|
7758
7832
|
*/
|
|
7759
|
-
this.
|
|
7833
|
+
this.active = false;
|
|
7760
7834
|
/**
|
|
7761
|
-
*
|
|
7835
|
+
* Höhe des Upload Controls
|
|
7762
7836
|
*/
|
|
7763
|
-
this.
|
|
7837
|
+
this.uploadheight = null;
|
|
7764
7838
|
/**
|
|
7765
|
-
*
|
|
7839
|
+
* Max. Anzahl Files die hochgeladen werden können
|
|
7766
7840
|
*/
|
|
7767
|
-
this.
|
|
7841
|
+
this.maxfiles = 0;
|
|
7768
7842
|
/**
|
|
7769
|
-
*
|
|
7843
|
+
* Min. Anzahl Files die hochgeladen werden müssen
|
|
7770
7844
|
*/
|
|
7771
|
-
this.
|
|
7845
|
+
this.minfiles = 0;
|
|
7772
7846
|
/**
|
|
7773
7847
|
* Resource Key für Validation Message Required bei Control
|
|
7774
7848
|
*/
|
|
@@ -7778,6 +7852,49 @@ class SacUploadMultipleCommon extends SacUploadBase {
|
|
|
7778
7852
|
*/
|
|
7779
7853
|
this.validationmessagesummaryminfiles = 'VALIDATION_ERROR_SUMMARY_FILESMIN';
|
|
7780
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
|
+
}
|
|
7781
7898
|
/**
|
|
7782
7899
|
* Prüft ob die max. Files in der Queue nicht überschritten werden
|
|
7783
7900
|
*
|
|
@@ -7848,18 +7965,16 @@ class SacUploadMultipleCommon extends SacUploadBase {
|
|
|
7848
7965
|
}
|
|
7849
7966
|
return error;
|
|
7850
7967
|
}
|
|
7851
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
7852
|
-
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 }); }
|
|
7853
7970
|
}
|
|
7854
|
-
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: [{
|
|
7855
7972
|
type: Directive
|
|
7856
|
-
}], propDecorators: {
|
|
7857
|
-
type: Input
|
|
7858
|
-
}], minfiles: [{
|
|
7973
|
+
}], propDecorators: { uploadheight: [{
|
|
7859
7974
|
type: Input
|
|
7860
|
-
}],
|
|
7975
|
+
}], maxfiles: [{
|
|
7861
7976
|
type: Input
|
|
7862
|
-
}],
|
|
7977
|
+
}], minfiles: [{
|
|
7863
7978
|
type: Input
|
|
7864
7979
|
}], validationmessageminfiles: [{
|
|
7865
7980
|
type: Input
|
|
@@ -7971,27 +8086,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
7971
8086
|
}] } });
|
|
7972
8087
|
|
|
7973
8088
|
/**
|
|
7974
|
-
* Upload
|
|
8089
|
+
* Upload Componente für mehrere Files
|
|
7975
8090
|
*/
|
|
7976
|
-
class
|
|
8091
|
+
class SacUploadMultipleCommon extends SacUploadBase {
|
|
7977
8092
|
constructor() {
|
|
7978
8093
|
super(...arguments);
|
|
7979
8094
|
/**
|
|
7980
|
-
*
|
|
8095
|
+
* Max. Files die hochgeladen werden können. 0 deaktiviert das Limit
|
|
7981
8096
|
*/
|
|
7982
|
-
this.
|
|
8097
|
+
this.maxfiles = 0;
|
|
7983
8098
|
/**
|
|
7984
|
-
*
|
|
8099
|
+
* Min. Files die hochgeladen werden müssen. 0 deaktiviert das Limit
|
|
7985
8100
|
*/
|
|
7986
|
-
this.
|
|
8101
|
+
this.minfiles = 0;
|
|
7987
8102
|
/**
|
|
7988
|
-
*
|
|
8103
|
+
* Label für Browse Button
|
|
7989
8104
|
*/
|
|
7990
|
-
this.
|
|
8105
|
+
this.buttonbrowse = 'Browse';
|
|
7991
8106
|
/**
|
|
7992
|
-
*
|
|
8107
|
+
* Label für Upload Button
|
|
7993
8108
|
*/
|
|
7994
|
-
this.
|
|
8109
|
+
this.buttonupload = 'Upload';
|
|
7995
8110
|
/**
|
|
7996
8111
|
* Resource Key für Validation Message Required bei Control
|
|
7997
8112
|
*/
|
|
@@ -8001,49 +8116,6 @@ class SacDropzoneMultipleCommon extends SacUploadBase {
|
|
|
8001
8116
|
*/
|
|
8002
8117
|
this.validationmessagesummaryminfiles = 'VALIDATION_ERROR_SUMMARY_FILESMIN';
|
|
8003
8118
|
}
|
|
8004
|
-
/**
|
|
8005
|
-
* Ervent wenn das Control initialisert wird
|
|
8006
|
-
*/
|
|
8007
|
-
ngOnInit() {
|
|
8008
|
-
super.ngOnInit();
|
|
8009
|
-
this.autoupload = true;
|
|
8010
|
-
}
|
|
8011
|
-
/**
|
|
8012
|
-
* Methode für Drag and Drop von Files
|
|
8013
|
-
* @param event Drag Event
|
|
8014
|
-
*/
|
|
8015
|
-
dropHandler(event) {
|
|
8016
|
-
if (event.dataTransfer &&
|
|
8017
|
-
event.dataTransfer.files &&
|
|
8018
|
-
event.dataTransfer.files.item(0)) {
|
|
8019
|
-
event.stopPropagation();
|
|
8020
|
-
event.preventDefault();
|
|
8021
|
-
this.active = false;
|
|
8022
|
-
this.uploadService.handleFiles(event.dataTransfer.files);
|
|
8023
|
-
}
|
|
8024
|
-
}
|
|
8025
|
-
/**
|
|
8026
|
-
* Methode wenn Drag in die Zone eintritt
|
|
8027
|
-
* @param event DragEnter Event
|
|
8028
|
-
*/
|
|
8029
|
-
onDragOver(event) {
|
|
8030
|
-
if (event.dataTransfer &&
|
|
8031
|
-
event.dataTransfer.files &&
|
|
8032
|
-
event.dataTransfer.types.every((itm) => itm === 'Files') &&
|
|
8033
|
-
event.dataTransfer.types.length > 0) {
|
|
8034
|
-
event.dataTransfer.dropEffect = 'copy';
|
|
8035
|
-
event.stopPropagation();
|
|
8036
|
-
event.preventDefault();
|
|
8037
|
-
this.active = true;
|
|
8038
|
-
}
|
|
8039
|
-
}
|
|
8040
|
-
/**
|
|
8041
|
-
* Methode wenn Drag die Zone verlässt
|
|
8042
|
-
* @param event DragLeave Event
|
|
8043
|
-
*/
|
|
8044
|
-
onDragLeave(event) {
|
|
8045
|
-
this.active = false;
|
|
8046
|
-
}
|
|
8047
8119
|
/**
|
|
8048
8120
|
* Prüft ob die max. Files in der Queue nicht überschritten werden
|
|
8049
8121
|
*
|
|
@@ -8114,33 +8186,91 @@ class SacDropzoneMultipleCommon extends SacUploadBase {
|
|
|
8114
8186
|
}
|
|
8115
8187
|
return error;
|
|
8116
8188
|
}
|
|
8117
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type:
|
|
8118
|
-
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 }); }
|
|
8119
8191
|
}
|
|
8120
|
-
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: [{
|
|
8121
8193
|
type: Directive
|
|
8122
|
-
}], propDecorators: {
|
|
8123
|
-
type: Input
|
|
8124
|
-
}], maxfiles: [{
|
|
8194
|
+
}], propDecorators: { maxfiles: [{
|
|
8125
8195
|
type: Input
|
|
8126
8196
|
}], minfiles: [{
|
|
8127
8197
|
type: Input
|
|
8198
|
+
}], buttonbrowse: [{
|
|
8199
|
+
type: Input
|
|
8200
|
+
}], buttonupload: [{
|
|
8201
|
+
type: Input
|
|
8128
8202
|
}], validationmessageminfiles: [{
|
|
8129
8203
|
type: Input
|
|
8130
8204
|
}], validationmessagesummaryminfiles: [{
|
|
8131
8205
|
type: Input
|
|
8132
8206
|
}] } });
|
|
8133
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
|
+
|
|
8134
8263
|
/**
|
|
8135
8264
|
* Base Klasse für Multi Language Input Control
|
|
8136
8265
|
*/
|
|
8137
8266
|
class SacMultilanguageInputCommon extends SacInputBase {
|
|
8138
8267
|
/**
|
|
8139
|
-
*
|
|
8140
|
-
*
|
|
8268
|
+
* Constructor
|
|
8269
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
8270
|
+
* @param injector Injector for injecting services
|
|
8141
8271
|
*/
|
|
8142
|
-
constructor(
|
|
8143
|
-
super(
|
|
8272
|
+
constructor(formlayout, injector) {
|
|
8273
|
+
super(formlayout, injector);
|
|
8144
8274
|
/**
|
|
8145
8275
|
* Max länge an Zeichen für Eingabefeld
|
|
8146
8276
|
*/
|
|
@@ -8329,12 +8459,12 @@ class SacMultilanguageInputCommon extends SacInputBase {
|
|
|
8329
8459
|
}
|
|
8330
8460
|
return error;
|
|
8331
8461
|
}
|
|
8332
|
-
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 }); }
|
|
8333
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 }); }
|
|
8334
8464
|
}
|
|
8335
8465
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacMultilanguageInputCommon, decorators: [{
|
|
8336
8466
|
type: Directive
|
|
8337
|
-
}], ctorParameters: function () { return [{ type:
|
|
8467
|
+
}], ctorParameters: function () { return [{ type: SacFormLayoutCommon, decorators: [{
|
|
8338
8468
|
type: Host
|
|
8339
8469
|
}] }, { type: i0.Injector }]; }, propDecorators: { maxlength: [{
|
|
8340
8470
|
type: Input
|
|
@@ -8357,11 +8487,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
8357
8487
|
*/
|
|
8358
8488
|
class SacMultilanguageInputAreaCommon extends SacInputBase {
|
|
8359
8489
|
/**
|
|
8360
|
-
*
|
|
8361
|
-
*
|
|
8490
|
+
* Constructor
|
|
8491
|
+
* @param formlayout SacFormLayoutCommon to define scoped layout settings
|
|
8492
|
+
* @param injector Injector for injecting services
|
|
8362
8493
|
*/
|
|
8363
|
-
constructor(
|
|
8364
|
-
super(
|
|
8494
|
+
constructor(formlayout, injector) {
|
|
8495
|
+
super(formlayout, injector);
|
|
8365
8496
|
/**
|
|
8366
8497
|
* Max länge an Zeichen für Eingabefeld
|
|
8367
8498
|
*/
|
|
@@ -8518,142 +8649,62 @@ class SacMultilanguageInputAreaCommon extends SacInputBase {
|
|
|
8518
8649
|
}
|
|
8519
8650
|
if (this.value[itm.IsoCode] === undefined ||
|
|
8520
8651
|
this.value[itm.IsoCode] === '' ||
|
|
8521
|
-
this.value[itm.IsoCode] === null) {
|
|
8522
|
-
found = true;
|
|
8523
|
-
return;
|
|
8524
|
-
}
|
|
8525
|
-
});
|
|
8526
|
-
}
|
|
8527
|
-
return found;
|
|
8528
|
-
}
|
|
8529
|
-
/**
|
|
8530
|
-
* Methode validiert, ob der Wert den gegebenen Kriterien entspricht
|
|
8531
|
-
* @param c Controls das validiert wird
|
|
8532
|
-
*/
|
|
8533
|
-
validateData(c) {
|
|
8534
|
-
let error = null;
|
|
8535
|
-
if (error === null &&
|
|
8536
|
-
c.value !== null &&
|
|
8537
|
-
c.value !== undefined &&
|
|
8538
|
-
c.value !== '' &&
|
|
8539
|
-
this.isrequired !== undefined &&
|
|
8540
|
-
this.isrequired === true) {
|
|
8541
|
-
error = Validation.multilanguageRequired(this.languages, this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
|
|
8542
|
-
}
|
|
8543
|
-
if (error === null &&
|
|
8544
|
-
c.value !== null &&
|
|
8545
|
-
c.value !== undefined &&
|
|
8546
|
-
c.value !== '' &&
|
|
8547
|
-
this.requiredany !== undefined &&
|
|
8548
|
-
this.requiredany === true) {
|
|
8549
|
-
error = Validation.multilanguageRequiredAny(this.languages, this.validationmessagerequiredany, this.validationmessagesummaryrequiredany)(c);
|
|
8550
|
-
}
|
|
8551
|
-
return error;
|
|
8552
|
-
}
|
|
8553
|
-
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 }); }
|
|
8554
|
-
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 }); }
|
|
8555
|
-
}
|
|
8556
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacMultilanguageInputAreaCommon, decorators: [{
|
|
8557
|
-
type: Directive
|
|
8558
|
-
}], ctorParameters: function () { return [{ type: SacFormCommon, decorators: [{
|
|
8559
|
-
type: Host
|
|
8560
|
-
}] }, { type: i0.Injector }]; }, propDecorators: { maxlength: [{
|
|
8561
|
-
type: Input
|
|
8562
|
-
}], rows: [{
|
|
8563
|
-
type: Input
|
|
8564
|
-
}], controlwidth: [{
|
|
8565
|
-
type: Input
|
|
8566
|
-
}], requiredany: [{
|
|
8567
|
-
type: Input
|
|
8568
|
-
}], validationmessagerequired: [{
|
|
8569
|
-
type: Input
|
|
8570
|
-
}], validationmessagesummaryrequired: [{
|
|
8571
|
-
type: Input
|
|
8572
|
-
}], validationmessagerequiredany: [{
|
|
8573
|
-
type: Input
|
|
8574
|
-
}], validationmessagesummaryrequiredany: [{
|
|
8575
|
-
type: Input
|
|
8576
|
-
}] } });
|
|
8577
|
-
|
|
8578
|
-
/**
|
|
8579
|
-
* Basis Klasse für Confirm Service implementation
|
|
8580
|
-
*/
|
|
8581
|
-
class ServiceConfirmCommon {
|
|
8582
|
-
/**
|
|
8583
|
-
* Konstruktor
|
|
8584
|
-
* @param appRef ApplicationRef zum Anhängen des Dialogs an den Content
|
|
8585
|
-
* @param injector Injector um die Instanz zu erzeuge
|
|
8586
|
-
*/
|
|
8587
|
-
constructor(appRef, injector) {
|
|
8588
|
-
this.appRef = appRef;
|
|
8589
|
-
this.injector = injector;
|
|
8590
|
-
//#region Properties
|
|
8591
|
-
/**
|
|
8592
|
-
* Referenz auf IConfirm Instanz.
|
|
8593
|
-
*/
|
|
8594
|
-
this.component = null;
|
|
8595
|
-
this.localisationService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService());
|
|
8596
|
-
this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
|
|
8597
|
-
}
|
|
8598
|
-
/**
|
|
8599
|
-
* Erzeugt eine Instanz für den Dialog
|
|
8600
|
-
*/
|
|
8601
|
-
CreateInstance() {
|
|
8602
|
-
// ComponentFactory aus Service laden
|
|
8603
|
-
const factory = this.GetComponentFactory();
|
|
8604
|
-
// Instanz der Komponente erzeugen und an die View anhängen
|
|
8605
|
-
this.component = factory.create(this.injector);
|
|
8606
|
-
this.appRef.attachView(this.component.hostView);
|
|
8607
|
-
}
|
|
8608
|
-
/**
|
|
8609
|
-
* Entfernt die Instanz des Dialogs
|
|
8610
|
-
*/
|
|
8611
|
-
DestroyInstance() {
|
|
8612
|
-
// Dialog aus View entfernen und Komponenten löschen
|
|
8613
|
-
this.appRef.detachView(this.component.hostView);
|
|
8614
|
-
this.component.destroy();
|
|
8615
|
-
}
|
|
8616
|
-
/**
|
|
8617
|
-
* Zeigt den Dialog an
|
|
8618
|
-
*/
|
|
8619
|
-
OpenDialog() {
|
|
8620
|
-
const dialog = this.component.instance;
|
|
8621
|
-
dialog.show();
|
|
8622
|
-
return dialog;
|
|
8623
|
-
}
|
|
8624
|
-
/**
|
|
8625
|
-
* Blendet den Dialog aus
|
|
8626
|
-
*/
|
|
8627
|
-
CloseDialog() {
|
|
8628
|
-
const dialog = this.component.instance;
|
|
8629
|
-
dialog.hide();
|
|
8630
|
-
}
|
|
8631
|
-
/**
|
|
8632
|
-
* Interne Methode für die Implementation des Confirm Dialogs. Steuert die Feedbacks, die Erzeugung und Anzeige des Dialogs
|
|
8633
|
-
*/
|
|
8634
|
-
Confirm() {
|
|
8635
|
-
// Dialog erzeugen
|
|
8636
|
-
this.CreateInstance();
|
|
8637
|
-
const instance = this.OpenDialog();
|
|
8638
|
-
// Konfiguration der Dialog Instanz durch Service Implementation zulassen
|
|
8639
|
-
this.ConfigureDialog(instance);
|
|
8640
|
-
// Event Emitter für Confirmation im Service. Event Emitter Asynchron initialiseren
|
|
8641
|
-
const confirmTask = new EventEmitter(true);
|
|
8642
|
-
// Callback wenn Dialog bestätigt wurde
|
|
8643
|
-
instance.onconfirm.subscribe((value) => {
|
|
8644
|
-
// Dialog entfernen
|
|
8645
|
-
this.CloseDialog();
|
|
8646
|
-
// Emit auf Service auslösen
|
|
8647
|
-
confirmTask.emit(value);
|
|
8648
|
-
}, (err) => {
|
|
8649
|
-
// Do nothing on Error
|
|
8650
|
-
}, () => {
|
|
8651
|
-
this.DestroyInstance();
|
|
8652
|
-
});
|
|
8653
|
-
// Confirm Emitter für Result zurückgeben
|
|
8654
|
-
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;
|
|
8655
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 }); }
|
|
8656
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
|
+
}] } });
|
|
8657
8708
|
|
|
8658
8709
|
/**
|
|
8659
8710
|
* Basis Klasse für Confirm Dialog
|
|
@@ -8756,6 +8807,86 @@ class SacConfirmButton {
|
|
|
8756
8807
|
}
|
|
8757
8808
|
}
|
|
8758
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
|
+
|
|
8759
8890
|
/**
|
|
8760
8891
|
* Position Utility Klasse
|
|
8761
8892
|
* @see https://github.com/ng-bootstrap/ng-bootstrap/blob/master/src/util/positioning.ts
|
|
@@ -9061,12 +9192,14 @@ function positionElements(hostElement, targetElement, placement, appendToBody, b
|
|
|
9061
9192
|
* Base Context Menu Anchor Component für Open/Close Event
|
|
9062
9193
|
*/
|
|
9063
9194
|
class SacContextmenuAnchorCommon {
|
|
9195
|
+
// #endregion Properties
|
|
9196
|
+
// #region Constructors
|
|
9064
9197
|
/**
|
|
9065
9198
|
* Konstruktor
|
|
9066
|
-
* @param
|
|
9199
|
+
* @param elementRef Refernz auf das HTML welcher als Anker für das Context Menü verwendet wird
|
|
9067
9200
|
*/
|
|
9068
|
-
constructor(
|
|
9069
|
-
this.nativeElement =
|
|
9201
|
+
constructor(elementRef) {
|
|
9202
|
+
this.nativeElement = elementRef.nativeElement;
|
|
9070
9203
|
}
|
|
9071
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 }); }
|
|
9072
9205
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacContextmenuAnchorCommon, ngImport: i0 }); }
|
|
@@ -9079,12 +9212,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
9079
9212
|
* Common Marker Klasse für den Menü Container
|
|
9080
9213
|
*/
|
|
9081
9214
|
class SacContextMenuContrainerCommon {
|
|
9215
|
+
// #endregion Properties
|
|
9216
|
+
// #region Constructors
|
|
9082
9217
|
/**
|
|
9083
9218
|
* Konstruktor
|
|
9084
|
-
* @param
|
|
9219
|
+
* @param elementRef Referenz auf das HTML Element mit der Marker Direktive
|
|
9085
9220
|
*/
|
|
9086
|
-
constructor(
|
|
9087
|
-
this.nativeElement =
|
|
9221
|
+
constructor(elementRef) {
|
|
9222
|
+
this.nativeElement = elementRef.nativeElement;
|
|
9088
9223
|
}
|
|
9089
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 }); }
|
|
9090
9225
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SacContextMenuContrainerCommon, ngImport: i0 }); }
|
|
@@ -9097,46 +9232,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
9097
9232
|
* Base Context Menü Element. Die Logik wurde aus NG-BOOTSTRAP übernommen.
|
|
9098
9233
|
*/
|
|
9099
9234
|
class SacContextmenuCommon {
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
*/
|
|
9103
|
-
onClick(targetElement) {
|
|
9104
|
-
const anchor = this._anchor || this._anchorTemplate;
|
|
9105
|
-
if (this._menu &&
|
|
9106
|
-
!this._menu.nativeElement.contains(targetElement) &&
|
|
9107
|
-
!anchor.nativeElement.contains(targetElement)) {
|
|
9108
|
-
this.close();
|
|
9109
|
-
}
|
|
9110
|
-
}
|
|
9235
|
+
// #endregion Properties
|
|
9236
|
+
// #region Constructors
|
|
9111
9237
|
/**
|
|
9112
9238
|
* Konstruktor
|
|
9113
|
-
* @param
|
|
9114
|
-
* @param
|
|
9115
|
-
* @param
|
|
9116
|
-
* @param
|
|
9117
|
-
* @param
|
|
9118
|
-
*/
|
|
9119
|
-
constructor(
|
|
9120
|
-
this.
|
|
9121
|
-
this.
|
|
9122
|
-
this.
|
|
9123
|
-
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;
|
|
9124
9250
|
/**
|
|
9125
9251
|
* Body HTML Element
|
|
9126
9252
|
*/
|
|
9127
9253
|
this.bodyContainer = null;
|
|
9128
9254
|
/**
|
|
9129
|
-
*
|
|
9255
|
+
* Container an welchem die Position ausgerichtet wird. Aktuell wird nun Body Supported
|
|
9130
9256
|
*/
|
|
9131
|
-
this.
|
|
9257
|
+
this.container = 'body';
|
|
9132
9258
|
/**
|
|
9133
9259
|
* Extra CSS Klassen für das Control
|
|
9134
9260
|
*/
|
|
9135
9261
|
this.cssclass = '';
|
|
9136
9262
|
/**
|
|
9137
|
-
*
|
|
9263
|
+
* Definiert ob das Dropdown offen ist.
|
|
9138
9264
|
*/
|
|
9139
|
-
this.
|
|
9265
|
+
this.isopen = false;
|
|
9140
9266
|
/**
|
|
9141
9267
|
* The preferred placement of the dropdown.
|
|
9142
9268
|
*
|
|
@@ -9156,34 +9282,31 @@ class SacContextmenuCommon {
|
|
|
9156
9282
|
'top-left',
|
|
9157
9283
|
'top-right',
|
|
9158
9284
|
];
|
|
9159
|
-
this.zoneSubscription = this.
|
|
9285
|
+
this.zoneSubscription = this.ngZone.onStable.subscribe(() => {
|
|
9160
9286
|
this._positionMenu();
|
|
9161
9287
|
});
|
|
9162
|
-
this.iconService =
|
|
9288
|
+
this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
|
|
9163
9289
|
}
|
|
9290
|
+
// #endregion Constructors
|
|
9291
|
+
// #region Public Getters And Setters
|
|
9164
9292
|
/**
|
|
9165
|
-
*
|
|
9293
|
+
* icon for default context menü button
|
|
9166
9294
|
*/
|
|
9167
|
-
|
|
9168
|
-
this.
|
|
9295
|
+
get IconContextMenu() {
|
|
9296
|
+
return this.iconService.ContextMenuOpenIcon;
|
|
9169
9297
|
}
|
|
9298
|
+
// #endregion Public Getters And Setters
|
|
9299
|
+
// #region Public Methods
|
|
9170
9300
|
/**
|
|
9171
|
-
*
|
|
9301
|
+
* HostListener um das Dropdown zu schliessen wenn nicht auf das Element geklickt wird.
|
|
9172
9302
|
*/
|
|
9173
|
-
|
|
9174
|
-
|
|
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)) {
|
|
9175
9308
|
this.close();
|
|
9176
9309
|
}
|
|
9177
|
-
else {
|
|
9178
|
-
this.open();
|
|
9179
|
-
}
|
|
9180
|
-
}
|
|
9181
|
-
/**
|
|
9182
|
-
* Öffnet das Dropdown / Zeigt das Menü an.
|
|
9183
|
-
*/
|
|
9184
|
-
open() {
|
|
9185
|
-
this._applyContainer(this.container);
|
|
9186
|
-
this.isopen = true;
|
|
9187
9310
|
}
|
|
9188
9311
|
/**
|
|
9189
9312
|
* Schliesst das Dropdown
|
|
@@ -9193,11 +9316,31 @@ class SacContextmenuCommon {
|
|
|
9193
9316
|
this.isopen = false;
|
|
9194
9317
|
}
|
|
9195
9318
|
/**
|
|
9196
|
-
*
|
|
9319
|
+
* Event wenn Component entfernt wird.
|
|
9197
9320
|
*/
|
|
9198
|
-
|
|
9199
|
-
|
|
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
|
+
}
|
|
9200
9341
|
}
|
|
9342
|
+
// #endregion Public Methods
|
|
9343
|
+
// #region Protected Methods
|
|
9201
9344
|
/**
|
|
9202
9345
|
* Setzt die Position des Menüs im Markup
|
|
9203
9346
|
*/
|
|
@@ -9207,23 +9350,8 @@ class SacContextmenuCommon {
|
|
|
9207
9350
|
positionElements(anchor.nativeElement, this.bodyContainer || this._menu.nativeElement, this.placement, this.container === 'body');
|
|
9208
9351
|
}
|
|
9209
9352
|
}
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
*/
|
|
9213
|
-
_resetContainer() {
|
|
9214
|
-
const renderer = this._renderer;
|
|
9215
|
-
if (this._menu) {
|
|
9216
|
-
const dropdownElement = this._elementRef.nativeElement;
|
|
9217
|
-
const dropdownMenuElement = this._menu.nativeElement;
|
|
9218
|
-
renderer.appendChild(dropdownElement, dropdownMenuElement);
|
|
9219
|
-
renderer.removeStyle(dropdownMenuElement, 'position');
|
|
9220
|
-
renderer.removeStyle(dropdownMenuElement, 'transform');
|
|
9221
|
-
}
|
|
9222
|
-
if (this.bodyContainer) {
|
|
9223
|
-
renderer.removeChild(this._document.body, this.bodyContainer);
|
|
9224
|
-
this.bodyContainer = null;
|
|
9225
|
-
}
|
|
9226
|
-
}
|
|
9353
|
+
// #endregion Protected Methods
|
|
9354
|
+
// #region Private Methods
|
|
9227
9355
|
/**
|
|
9228
9356
|
* Setzt die Position des Menüs innerhalb der Seite. Die Ausrichtung passiert innerhalb der Seite
|
|
9229
9357
|
* damit das Menü innerhalb eines Dialogs sauber funktionioniert.
|
|
@@ -9233,7 +9361,7 @@ class SacContextmenuCommon {
|
|
|
9233
9361
|
// Reset Classes on Container
|
|
9234
9362
|
this._resetContainer();
|
|
9235
9363
|
if (container === 'body') {
|
|
9236
|
-
const renderer = this.
|
|
9364
|
+
const renderer = this.renderer;
|
|
9237
9365
|
const dropdownMenuElement = this._menu.nativeElement;
|
|
9238
9366
|
const bodyContainer = (this.bodyContainer =
|
|
9239
9367
|
this.bodyContainer || renderer.createElement('div'));
|
|
@@ -9242,34 +9370,51 @@ class SacContextmenuCommon {
|
|
|
9242
9370
|
renderer.setStyle(dropdownMenuElement, 'position', 'static');
|
|
9243
9371
|
renderer.setStyle(bodyContainer, 'z-index', '1050');
|
|
9244
9372
|
renderer.appendChild(bodyContainer, dropdownMenuElement);
|
|
9245
|
-
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;
|
|
9246
9391
|
}
|
|
9247
9392
|
}
|
|
9248
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 }); }
|
|
9249
|
-
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 }); }
|
|
9250
9395
|
}
|
|
9251
9396
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SacContextmenuCommon, decorators: [{
|
|
9252
9397
|
type: Directive
|
|
9253
9398
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
9254
9399
|
type: Inject,
|
|
9255
9400
|
args: [DOCUMENT]
|
|
9256
|
-
}] }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }]; }, propDecorators: {
|
|
9257
|
-
type: ViewChild,
|
|
9258
|
-
args: [SacContextmenuAnchorCommon, { static: false }]
|
|
9259
|
-
}], _anchorTemplate: [{
|
|
9401
|
+
}] }, { type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.Injector }]; }, propDecorators: { _anchorTemplate: [{
|
|
9260
9402
|
type: ContentChild,
|
|
9261
9403
|
args: [SacContextmenuAnchorCommon, { static: false }]
|
|
9404
|
+
}], _anchor: [{
|
|
9405
|
+
type: ViewChild,
|
|
9406
|
+
args: [SacContextmenuAnchorCommon, { static: false }]
|
|
9262
9407
|
}], _menu: [{
|
|
9263
9408
|
type: ViewChild,
|
|
9264
9409
|
args: [SacContextMenuContrainerCommon, { static: false }]
|
|
9265
|
-
}], isopen: [{
|
|
9266
|
-
type: Input
|
|
9267
|
-
}], cssclass: [{
|
|
9268
|
-
type: Input
|
|
9269
9410
|
}], buttontemplate: [{
|
|
9270
9411
|
type: Input
|
|
9271
9412
|
}], container: [{
|
|
9272
9413
|
type: Input
|
|
9414
|
+
}], cssclass: [{
|
|
9415
|
+
type: Input
|
|
9416
|
+
}], isopen: [{
|
|
9417
|
+
type: Input
|
|
9273
9418
|
}], placement: [{
|
|
9274
9419
|
type: Input
|
|
9275
9420
|
}], onClick: [{
|
|
@@ -9954,5 +10099,5 @@ class LanguageModel {
|
|
|
9954
10099
|
* Generated bundle index. Do not edit.
|
|
9955
10100
|
*/
|
|
9956
10101
|
|
|
9957
|
-
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 };
|
|
9958
10103
|
//# sourceMappingURL=simpleangularcontrols-sac-common.mjs.map
|