@simpleangularcontrols/sac-common 10.0.0-rc.11 → 10.0.0-rc.13

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.
Files changed (86) hide show
  1. package/bundles/simpleangularcontrols-sac-common.umd.js +1425 -1088
  2. package/bundles/simpleangularcontrols-sac-common.umd.js.map +1 -1
  3. package/bundles/simpleangularcontrols-sac-common.umd.min.js +1 -1
  4. package/bundles/simpleangularcontrols-sac-common.umd.min.js.map +1 -1
  5. package/common/basedatetimecontrol.d.ts +99 -13
  6. package/common/basemodelcontrol.d.ts +33 -29
  7. package/controls/checkbox/radiobutton.d.ts +61 -26
  8. package/controls/contextmenu/contextmenu.d.ts +26 -19
  9. package/controls/contextmenu/contextmenu.interface.d.ts +3 -0
  10. package/controls/contextmenu/contextmenuitem.d.ts +5 -0
  11. package/controls/contextmenu/contextmenuitembutton.d.ts +21 -20
  12. package/controls/datetime/date.d.ts +28 -27
  13. package/controls/datetime/datetime.d.ts +27 -27
  14. package/controls/datetime/time.d.ts +26 -26
  15. package/controls/dialog/dialog.d.ts +31 -43
  16. package/controls/layout/formlayout.d.ts +4 -0
  17. package/controls/list/buildvaluestring.d.ts +6 -0
  18. package/controls/list/dropdown.d.ts +9 -51
  19. package/controls/list/dropdownoptions.d.ts +38 -0
  20. package/controls/list/dropdownoptions.ngfactory.d.ts +1 -0
  21. package/controls/static/formcontainer.d.ts +11 -3
  22. package/controls/tooltip/tooltip.d.ts +33 -51
  23. package/controls/treeview/treeview.d.ts +87 -121
  24. package/esm2015/common/basedatetimecontrol.js +178 -30
  25. package/esm2015/common/basemodelcontrol.js +71 -56
  26. package/esm2015/controls/checkbox/radiobutton.js +94 -45
  27. package/esm2015/controls/contextmenu/contextmenu.interface.js +1 -0
  28. package/esm2015/controls/contextmenu/contextmenu.interface.ngfactory.js +7 -0
  29. package/esm2015/controls/contextmenu/contextmenu.js +22 -23
  30. package/esm2015/controls/contextmenu/contextmenuitem.js +13 -2
  31. package/esm2015/controls/contextmenu/contextmenuitembutton.js +34 -25
  32. package/esm2015/controls/datetime/date.js +43 -41
  33. package/esm2015/controls/datetime/datetime.js +42 -41
  34. package/esm2015/controls/datetime/time.js +42 -41
  35. package/esm2015/controls/dialog/dialog.js +41 -83
  36. package/esm2015/controls/layout/formlayout.js +7 -6
  37. package/esm2015/controls/list/buildvaluestring.js +18 -0
  38. package/esm2015/controls/{treeview/ngtreeitemaction.ngfactory.js → list/buildvaluestring.ngfactory.js} +1 -1
  39. package/esm2015/controls/list/dropdown.js +16 -114
  40. package/esm2015/controls/list/dropdownoptions.js +72 -0
  41. package/esm2015/controls/{treeview/treeviewchild.ngfactory.js → list/dropdownoptions.ngfactory.js} +1 -1
  42. package/esm2015/controls/static/formcontainer.js +16 -6
  43. package/esm2015/controls/tooltip/tooltip.js +60 -250
  44. package/esm2015/controls/treeview/treeview.js +232 -247
  45. package/esm2015/interfaces/ISacConfigurationService.js +1 -1
  46. package/esm2015/interfaces/ISacIconService.js +1 -1
  47. package/esm2015/interfaces/treeviewaction.interface.js +1 -0
  48. package/esm2015/interfaces/treeviewaction.interface.ngfactory.js +7 -0
  49. package/esm2015/public_api.js +6 -6
  50. package/esm2015/services/sac-configuration.service.js +7 -5
  51. package/esm2015/services/sac-icon.service.js +25 -1
  52. package/esm2015/utilities/enums.js +5 -1
  53. package/esm2015/utilities/popuphelper.js +343 -0
  54. package/esm2015/utilities/popuphelper.ngfactory.js +7 -0
  55. package/esm2015/validation/equals.validator.js +14 -0
  56. package/esm2015/validation/equals.validator.ngfactory.js +7 -0
  57. package/esm2015/validation/notequals.validator.js +14 -0
  58. package/esm2015/validation/notequals.validator.ngfactory.js +7 -0
  59. package/esm2015/validation/validation.class.js +30 -6
  60. package/fesm2015/simpleangularcontrols-sac-common.js +1398 -1075
  61. package/fesm2015/simpleangularcontrols-sac-common.js.map +1 -1
  62. package/interfaces/ISacConfigurationService.d.ts +4 -0
  63. package/interfaces/ISacIconService.d.ts +16 -0
  64. package/interfaces/treeviewaction.interface.d.ts +4 -0
  65. package/interfaces/treeviewaction.interface.ngfactory.d.ts +1 -0
  66. package/package.json +1 -1
  67. package/public_api.d.ts +5 -5
  68. package/services/sac-configuration.service.d.ts +8 -0
  69. package/services/sac-icon.service.d.ts +33 -1
  70. package/simpleangularcontrols-sac-common-10.0.0-rc.13.tgz +0 -0
  71. package/simpleangularcontrols-sac-common.metadata.json +1 -1
  72. package/utilities/enums.d.ts +3 -1
  73. package/utilities/popuphelper.d.ts +83 -0
  74. package/utilities/popuphelper.ngfactory.d.ts +1 -0
  75. package/validation/equals.validator.d.ts +2 -0
  76. package/validation/equals.validator.ngfactory.d.ts +1 -0
  77. package/validation/notequals.validator.d.ts +2 -0
  78. package/validation/notequals.validator.ngfactory.d.ts +1 -0
  79. package/validation/validation.class.d.ts +19 -0
  80. package/controls/treeview/ngtreeitemaction.d.ts +0 -40
  81. package/controls/treeview/treeviewchild.d.ts +0 -12
  82. package/esm2015/controls/treeview/ngtreeitemaction.js +0 -60
  83. package/esm2015/controls/treeview/treeviewchild.js +0 -18
  84. package/simpleangularcontrols-sac-common-10.0.0-rc.11.tgz +0 -0
  85. /package/controls/{treeview/ngtreeitemaction.ngfactory.d.ts → contextmenu/contextmenu.interface.ngfactory.d.ts} +0 -0
  86. /package/controls/{treeview/treeviewchild.ngfactory.d.ts → list/buildvaluestring.ngfactory.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('rxjs'), require('@angular/common/http'), require('moment'), require('imask'), require('ngx-uploadx'), require('@angular/common')) :
3
- typeof define === 'function' && define.amd ? define('@simpleangularcontrols/sac-common', ['exports', '@angular/core', '@angular/forms', 'rxjs', '@angular/common/http', 'moment', 'imask', 'ngx-uploadx', '@angular/common'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.simpleangularcontrols = global.simpleangularcontrols || {}, global.simpleangularcontrols['sac-common'] = {}), global.ng.core, global.ng.forms, global.rxjs, global.ng.common.http, global.moment, global.IMask, global.ngxUploadx, global.ng.common));
5
- }(this, (function (exports, i0, forms, rxjs, i1, moment_, IMask, ngxUploadx, common) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('@angular/forms'), require('moment'), require('imask'), require('ngx-uploadx'), require('@angular/common')) :
3
+ typeof define === 'function' && define.amd ? define('@simpleangularcontrols/sac-common', ['exports', '@angular/core', '@angular/common/http', 'rxjs', '@angular/forms', 'moment', 'imask', 'ngx-uploadx', '@angular/common'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.simpleangularcontrols = global.simpleangularcontrols || {}, global.simpleangularcontrols['sac-common'] = {}), global.ng.core, global.ng.common.http, global.rxjs, global.ng.forms, global.moment, global.IMask, global.ngxUploadx, global.ng.common));
5
+ }(this, (function (exports, i0, i1, rxjs, forms, moment_, IMask, ngxUploadx, common) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -647,7 +647,6 @@
647
647
  */
648
648
  var SacFormLayoutCommon = /** @class */ (function () {
649
649
  function SacFormLayoutCommon() {
650
- // #region Properties
651
650
  /**
652
651
  * Defines the default display for a checkbox. You can choose between a checkbox and a switch. If no style is defined, the global style or the style on the control is used.
653
652
  */
@@ -692,11 +691,12 @@
692
691
  * default label size for extra extra large devices
693
692
  */
694
693
  this.labelSizeXxl = null;
695
- // #endregion Public Getters And Setters
694
+ /**
695
+ * Detach label text and tooltip from each other in Label so that label and tooltip can be aligned differently. This is in Bootstrap 3 not supported!
696
+ */
697
+ this.splitlabelandhelptext = null;
696
698
  }
697
699
  Object.defineProperty(SacFormLayoutCommon.prototype, "IsInlineErrorEnabled", {
698
- // #endregion Properties
699
- // #region Public Getters And Setters
700
700
  /**
701
701
  * Returns whether the inline error messages for the form are active.
702
702
  */
@@ -723,7 +723,8 @@
723
723
  labelSizeSm: [{ type: i0.Input }],
724
724
  labelSizeXl: [{ type: i0.Input }],
725
725
  labelSizeXs: [{ type: i0.Input }],
726
- labelSizeXxl: [{ type: i0.Input }]
726
+ labelSizeXxl: [{ type: i0.Input }],
727
+ splitlabelandhelptext: [{ type: i0.Input }]
727
728
  };
728
729
 
729
730
  /**
@@ -744,7 +745,6 @@
744
745
  ControlHeight[ControlHeight["Large"] = 2] = "Large";
745
746
  })(exports.ControlHeight || (exports.ControlHeight = {}));
746
747
 
747
- // #region Classes
748
748
  /**
749
749
  * abstract class for configuration settings providing in components
750
750
  */
@@ -766,7 +766,6 @@
766
766
  return _super !== null && _super.apply(this, arguments) || this;
767
767
  }
768
768
  Object.defineProperty(SacDefaultConfigurationService.prototype, "CheckboxStyle", {
769
- // #region Public Getters And Setters
770
769
  /**
771
770
  * @inheritdoc
772
771
  */
@@ -886,14 +885,22 @@
886
885
  enumerable: false,
887
886
  configurable: true
888
887
  });
888
+ Object.defineProperty(SacDefaultConfigurationService.prototype, "SplitLabelAndHelptext", {
889
+ /**
890
+ * @inheritdoc
891
+ */
892
+ get: function () {
893
+ return false;
894
+ },
895
+ enumerable: false,
896
+ configurable: true
897
+ });
889
898
  return SacDefaultConfigurationService;
890
899
  }(SacAbstractConfigurationService));
891
900
  SacDefaultConfigurationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SacDefaultConfigurationService_Factory() { return new SacDefaultConfigurationService(); }, token: SacDefaultConfigurationService, providedIn: "root" });
892
901
  SacDefaultConfigurationService.decorators = [
893
902
  { type: i0.Injectable, args: [{ providedIn: 'root' },] }
894
903
  ];
895
- // #endregion Classes
896
- // #region Variables
897
904
  /**
898
905
  * injection token for component configuration service
899
906
  */
@@ -1397,6 +1404,46 @@
1397
1404
  enumerable: false,
1398
1405
  configurable: true
1399
1406
  });
1407
+ Object.defineProperty(SacDefaultIconService.prototype, "TreeviewNodeActionIcon", {
1408
+ /**
1409
+ * @inheritdoc
1410
+ */
1411
+ get: function () {
1412
+ return 'fa fa-pen';
1413
+ },
1414
+ enumerable: false,
1415
+ configurable: true
1416
+ });
1417
+ Object.defineProperty(SacDefaultIconService.prototype, "TreeviewNodeClosedIcon", {
1418
+ /**
1419
+ * @inheritdoc
1420
+ */
1421
+ get: function () {
1422
+ return 'fa fa-folder-plus';
1423
+ },
1424
+ enumerable: false,
1425
+ configurable: true
1426
+ });
1427
+ Object.defineProperty(SacDefaultIconService.prototype, "TreeviewNodeEmptyIcon", {
1428
+ /**
1429
+ * @inheritdoc
1430
+ */
1431
+ get: function () {
1432
+ return 'fa fa-folder';
1433
+ },
1434
+ enumerable: false,
1435
+ configurable: true
1436
+ });
1437
+ Object.defineProperty(SacDefaultIconService.prototype, "TreeviewNodeOpenIcon", {
1438
+ /**
1439
+ * @inheritdoc
1440
+ */
1441
+ get: function () {
1442
+ return 'fa fa-folder-open';
1443
+ },
1444
+ enumerable: false,
1445
+ configurable: true
1446
+ });
1400
1447
  Object.defineProperty(SacDefaultIconService.prototype, "UploadComponentBrowseIcon", {
1401
1448
  /**
1402
1449
  * @inheritdoc
@@ -2637,6 +2684,9 @@
2637
2684
  * Inline Errors für das Control
2638
2685
  */
2639
2686
  this._inlineerrorenabled = null;
2687
+ /**
2688
+ * Label Text
2689
+ */
2640
2690
  this._label = '';
2641
2691
  /**
2642
2692
  * Boolean Property dirty; default Wert - false
@@ -2658,6 +2708,10 @@
2658
2708
  * Form layout instance if exists
2659
2709
  */
2660
2710
  this.formlayout = null;
2711
+ /**
2712
+ * ControlHeight enum for use in HTML markup
2713
+ */
2714
+ this.ControlHeight = exports.ControlHeight;
2661
2715
  /**
2662
2716
  * Defines the standard height of the components
2663
2717
  */
@@ -2710,10 +2764,6 @@
2710
2764
  * Name des Controls
2711
2765
  */
2712
2766
  this.name = createGuid();
2713
- /**
2714
- * ControlHeight enum for use in HTML markup
2715
- */
2716
- this.ControlHeight = exports.ControlHeight;
2717
2767
  /**
2718
2768
  * Leere Implementation von "propagateChange". Muss gemacht werden, damit kein Fehler entsteht
2719
2769
  */
@@ -2722,92 +2772,58 @@
2722
2772
  * Leere Implementation von "propagateTouch". Muss gemacht werden, damit kein Fehler entsteht
2723
2773
  */
2724
2774
  this.propagateTouch = function () { };
2775
+ /**
2776
+ * Detach label text and tooltip from each other in Label so that label and tooltip can be aligned differently. This is in Bootstrap 3 not supported!
2777
+ */
2778
+ this.splitlabelandhelptext = null;
2725
2779
  this.formlayout = formlayout;
2726
2780
  this.validationKeyService = injector.get(SACVALIDATIONKEY_SERVICE, new SacDefaultValidationKeyService());
2727
2781
  this.lngResourceService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService(this.validationKeyService));
2728
2782
  this.configurationService = injector.get(SACCONFIGURATION_SERVICE, new SacDefaultConfigurationService());
2729
2783
  this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
2730
2784
  }
2731
- Object.defineProperty(SacBaseModelControl.prototype, "inlineerrorenabled", {
2732
- /**
2733
- * Show error messages inline
2734
- */
2735
- get: function () {
2736
- return this._inlineerrorenabled;
2737
- },
2785
+ Object.defineProperty(SacBaseModelControl.prototype, "HelptextTooltipIcon", {
2738
2786
  // #endregion Constructors
2739
2787
  // #region Public Getters And Setters
2740
2788
  /**
2741
- * Aktiviert oder Deaktiviert die Inline Errors für das Control
2742
- */
2743
- set: function (value) {
2744
- if (value === null || value === undefined) {
2745
- this._inlineerrorenabled = null;
2746
- }
2747
- else {
2748
- this._inlineerrorenabled = convertToBoolean(value);
2749
- }
2750
- },
2751
- enumerable: false,
2752
- configurable: true
2753
- });
2754
- Object.defineProperty(SacBaseModelControl.prototype, "label", {
2755
- /**
2756
- * Definiert den Label Text
2789
+ * Get Icon for Helptext Tooltip
2757
2790
  */
2758
2791
  get: function () {
2759
- return this._label;
2760
- },
2761
- /**
2762
- * Definiert den Label Text
2763
- */
2764
- set: function (v) {
2765
- this._label = v;
2766
- this.UpdateLabelToControl();
2792
+ return this.iconService.GenericHelptextIcon;
2767
2793
  },
2768
2794
  enumerable: false,
2769
2795
  configurable: true
2770
2796
  });
2771
- Object.defineProperty(SacBaseModelControl.prototype, "value", {
2797
+ Object.defineProperty(SacBaseModelControl.prototype, "dirty", {
2772
2798
  /**
2773
- * Get Methode für NgModel Binding in Html Markup
2799
+ * Methode ergibt Boolean Wert für dirty
2774
2800
  */
2775
2801
  get: function () {
2776
- return this._value;
2777
- },
2778
- /**
2779
- * Set Methode für NgModel Binding in Html Markup
2780
- * Input wird benötigt, damit der Wert auch über das Markup gesetzt werden kann.
2781
- */
2782
- set: function (v) {
2783
- if (this.disabled) {
2784
- return;
2802
+ if (this.ngControl !== null && this.ngControl !== undefined) {
2803
+ this._dirty = this.ngControl.dirty;
2785
2804
  }
2786
- this._value = this.ConvertInputValue(v);
2787
- this.propagateChange(this._value);
2805
+ return this._dirty;
2788
2806
  },
2789
2807
  enumerable: false,
2790
2808
  configurable: true
2791
2809
  });
2792
- Object.defineProperty(SacBaseModelControl.prototype, "HelptextTooltipIcon", {
2810
+ Object.defineProperty(SacBaseModelControl.prototype, "inlineerrorenabled", {
2793
2811
  /**
2794
- * Get Icon for Helptext Tooltip
2812
+ * Show error messages inline
2795
2813
  */
2796
2814
  get: function () {
2797
- return this.iconService.GenericHelptextIcon;
2815
+ return this._inlineerrorenabled;
2798
2816
  },
2799
- enumerable: false,
2800
- configurable: true
2801
- });
2802
- Object.defineProperty(SacBaseModelControl.prototype, "dirty", {
2803
2817
  /**
2804
- * Methode ergibt Boolean Wert für dirty
2818
+ * Aktiviert oder Deaktiviert die Inline Errors für das Control
2805
2819
  */
2806
- get: function () {
2807
- if (this.ngControl !== null) {
2808
- this._dirty = this.ngControl.dirty;
2820
+ set: function (value) {
2821
+ if (value === null || value === undefined) {
2822
+ this._inlineerrorenabled = null;
2823
+ }
2824
+ else {
2825
+ this._inlineerrorenabled = convertToBoolean(value);
2809
2826
  }
2810
- return this._dirty;
2811
2827
  },
2812
2828
  enumerable: false,
2813
2829
  configurable: true
@@ -2817,9 +2833,7 @@
2817
2833
  * Methode ergibt boolean Wert wenn Form invalid oder nicht invalid ist
2818
2834
  */
2819
2835
  get: function () {
2820
- return (this.ngControl !== undefined &&
2821
- this.ngControl !== null &&
2822
- this.ngControl.invalid);
2836
+ return this.ngControl !== undefined && this.ngControl !== null && this.ngControl.invalid;
2823
2837
  },
2824
2838
  enumerable: false,
2825
2839
  configurable: true
@@ -2843,8 +2857,7 @@
2843
2857
  if (this._inlineerrorenabled !== null) {
2844
2858
  return this._inlineerrorenabled;
2845
2859
  }
2846
- if (this.formlayout !== null &&
2847
- this.formlayout.IsInlineErrorEnabled !== null) {
2860
+ if (this.formlayout !== null && this.formlayout.IsInlineErrorEnabled !== null) {
2848
2861
  return (_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.IsInlineErrorEnabled;
2849
2862
  }
2850
2863
  if (this.configurationService.InlineErrorEnabled !== null) {
@@ -2855,6 +2868,23 @@
2855
2868
  enumerable: false,
2856
2869
  configurable: true
2857
2870
  });
2871
+ Object.defineProperty(SacBaseModelControl.prototype, "label", {
2872
+ /**
2873
+ * Definiert den Label Text
2874
+ */
2875
+ get: function () {
2876
+ return this._label;
2877
+ },
2878
+ /**
2879
+ * Definiert den Label Text
2880
+ */
2881
+ set: function (v) {
2882
+ this._label = v;
2883
+ this.UpdateLabelToControl();
2884
+ },
2885
+ enumerable: false,
2886
+ configurable: true
2887
+ });
2858
2888
  Object.defineProperty(SacBaseModelControl.prototype, "labelSizes", {
2859
2889
  /**
2860
2890
  * returns an object with all label sizes. These values can then be transferred to corresponding CSS classes using a pipe
@@ -2877,7 +2907,7 @@
2877
2907
  * Methode ergibt Boolean Wert für touched
2878
2908
  */
2879
2909
  get: function () {
2880
- if (this.ngControl !== null) {
2910
+ if (this.ngControl !== null && this.ngControl !== undefined) {
2881
2911
  this._touched = this.ngControl.touched;
2882
2912
  }
2883
2913
  return this._touched;
@@ -2885,6 +2915,27 @@
2885
2915
  enumerable: false,
2886
2916
  configurable: true
2887
2917
  });
2918
+ Object.defineProperty(SacBaseModelControl.prototype, "value", {
2919
+ /**
2920
+ * Get Methode für NgModel Binding in Html Markup
2921
+ */
2922
+ get: function () {
2923
+ return this._value;
2924
+ },
2925
+ /**
2926
+ * Set Methode für NgModel Binding in Html Markup
2927
+ * Input wird benötigt, damit der Wert auch über das Markup gesetzt werden kann.
2928
+ */
2929
+ set: function (v) {
2930
+ if (this.disabled) {
2931
+ return;
2932
+ }
2933
+ this._value = this.ConvertInputValue(v);
2934
+ this.propagateChange(this._value);
2935
+ },
2936
+ enumerable: false,
2937
+ configurable: true
2938
+ });
2888
2939
  // #endregion Public Getters And Setters
2889
2940
  // #region Public Methods
2890
2941
  /**
@@ -2923,24 +2974,21 @@
2923
2974
  return this.lngResourceService.GetString(errorItem.errorMessageKey, parameters);
2924
2975
  };
2925
2976
  /**
2926
- * In Angular 10 the Control Label for Reactive Forms can be set first time here. With Angular 13 is supported by init in OnInit
2977
+ * Init Event
2927
2978
  */
2928
- SacBaseModelControl.prototype.ngAfterViewInit = function () {
2979
+ SacBaseModelControl.prototype.ngOnInit = function () {
2929
2980
  // receive form via formcontrolname or formcontrol instance
2930
2981
  var formControl = this.injector.get(forms.NgControl, null);
2931
2982
  if (formControl instanceof forms.FormControlName) {
2932
2983
  var form = this.injector.get(forms.FormGroupDirective, null);
2933
2984
  this.ngControl = form.getControl(formControl);
2934
2985
  }
2935
- else if (formControl) {
2936
- this.ngControl = formControl.control;
2986
+ else {
2987
+ if (formControl) {
2988
+ this.ngControl = formControl.control;
2989
+ }
2937
2990
  }
2938
2991
  this.UpdateLabelToControl();
2939
- };
2940
- /**
2941
- * Init Event
2942
- */
2943
- SacBaseModelControl.prototype.ngOnInit = function () {
2944
2992
  // set label sizes from formlayout directive
2945
2993
  this.setLabelSizes();
2946
2994
  // set component heigth from fromlayout directive
@@ -2949,6 +2997,8 @@
2949
2997
  this.setIsAdaptiveLabel();
2950
2998
  // set method to display helptext
2951
2999
  this.setHelpTextMode();
3000
+ // set SplitMode for Labels
3001
+ this.setLabelSplitMode();
2952
3002
  this.OnClassInit();
2953
3003
  };
2954
3004
  /**
@@ -3002,7 +3052,7 @@
3002
3052
  SacBaseModelControl.prototype.writeValue = function (value) {
3003
3053
  this._value = value;
3004
3054
  };
3005
- // #endregion Public Abstract Methods
3055
+ // #endregion Public Methods
3006
3056
  // #region Protected Methods
3007
3057
  /**
3008
3058
  * Method can Overwriten in Parent Classes
@@ -3141,6 +3191,17 @@
3141
3191
  }
3142
3192
  }
3143
3193
  };
3194
+ SacBaseModelControl.prototype.setLabelSplitMode = function () {
3195
+ var _a;
3196
+ if (!this.splitlabelandhelptext) {
3197
+ if ((_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.splitlabelandhelptext) {
3198
+ this.splitlabelandhelptext = this.formlayout.splitlabelandhelptext;
3199
+ }
3200
+ else {
3201
+ this.splitlabelandhelptext = this.configurationService.SplitLabelAndHelptext;
3202
+ }
3203
+ }
3204
+ };
3144
3205
  return SacBaseModelControl;
3145
3206
  }());
3146
3207
  SacBaseModelControl.decorators = [
@@ -3165,6 +3226,7 @@
3165
3226
  labelSizeXs: [{ type: i0.Input }],
3166
3227
  labelSizeXxl: [{ type: i0.Input }],
3167
3228
  name: [{ type: i0.Input }],
3229
+ splitlabelandhelptext: [{ type: i0.Input }],
3168
3230
  inlineerrorenabled: [{ type: i0.Input }],
3169
3231
  label: [{ type: i0.Input }],
3170
3232
  value: [{ type: i0.Input }]
@@ -3278,6 +3340,19 @@
3278
3340
  };
3279
3341
  }
3280
3342
 
3343
+ function equalsValueValidator(requiredvalue, validationMessage, validationMessageSummary) {
3344
+ return function (control) {
3345
+ if (control.value !== requiredvalue) {
3346
+ var parameters = new Map();
3347
+ parameters.set('EQUALSVALUE', requiredvalue);
3348
+ return CreateValidationError('equals', validationMessage, validationMessageSummary, parameters);
3349
+ }
3350
+ else {
3351
+ return null;
3352
+ }
3353
+ };
3354
+ }
3355
+
3281
3356
  // #region Variables
3282
3357
  /**
3283
3358
  * Moment
@@ -3491,6 +3566,19 @@
3491
3566
  };
3492
3567
  }
3493
3568
 
3569
+ function notEqualsValueValidator(invalidValue, validationMessage, validationMessageSummary) {
3570
+ return function (control) {
3571
+ if (control.value === invalidValue) {
3572
+ var parameters = new Map();
3573
+ parameters.set('EQUALSVALUE', invalidValue);
3574
+ return CreateValidationError('notequals', validationMessage, validationMessageSummary, parameters);
3575
+ }
3576
+ else {
3577
+ return null;
3578
+ }
3579
+ };
3580
+ }
3581
+
3494
3582
  function patternValidator(pattern, validationMessage, validationMessageSummary) {
3495
3583
  return function (control) {
3496
3584
  var validator = forms.Validators.pattern(pattern);
@@ -3516,17 +3604,12 @@
3516
3604
  };
3517
3605
  }
3518
3606
 
3519
- /**
3520
- * Moment
3521
- */
3522
- var moment$1 = moment___default['default'];
3523
3607
  /**
3524
3608
  * Klasse mit Standard Validatoren
3525
3609
  */
3526
3610
  var Validation = /** @class */ (function () {
3527
3611
  function Validation() {
3528
3612
  }
3529
- // #region Public Static Methods
3530
3613
  /**
3531
3614
  * Die Methode ist von jedem Validator aufgerufen. Die setzt sowohl den errorType des gerpüfte Item, als auch die ErrorMessage (gemäss von errorType, FieldName und Parameters).
3532
3615
  * @param errorType Typ den Fehler
@@ -3550,6 +3633,18 @@
3550
3633
  Validation.email = function (validationMessage, validationMessageSummary) {
3551
3634
  return emailValidator(validationMessage, validationMessageSummary);
3552
3635
  };
3636
+ /**
3637
+ * Validator validate if value is the requiredValue
3638
+ * @param requiredValue Value that control should have
3639
+ * @param control Control to be validate
3640
+ * @param fieldName Label of control
3641
+ * @param validationMessage validation message near the control
3642
+ * @param validationMessageSummary validation inside the validation summary
3643
+
3644
+ */
3645
+ Validation.equals = function (requiredValue, validationMessage, validationMessageSummary) {
3646
+ return equalsValueValidator(requiredValue, validationMessage, validationMessageSummary);
3647
+ };
3553
3648
  /**
3554
3649
  * Validator der prüft ob der Wert ein Datum ist.
3555
3650
  * @param control Control mit IDateTimeControl Interface implementierung
@@ -3670,6 +3765,17 @@
3670
3765
  Validation.multilanguageRequiredAny = function (languages, validationMessage, validationMessageSummary) {
3671
3766
  return multilanguageRequiredAnyValidator(languages, validationMessage, validationMessageSummary);
3672
3767
  };
3768
+ /**
3769
+ * Validator validate if value is not the invalidValue
3770
+ * @param invalidValue Value that control doesn't should have
3771
+ * @param control Control to be validate
3772
+ * @param fieldName Label of control
3773
+ * @param validationMessage validation message near the control
3774
+ * @param validationMessageSummary validation inside the validation summary
3775
+ */
3776
+ Validation.notequals = function (invalidValue, validationMessage, validationMessageSummary) {
3777
+ return notEqualsValueValidator(invalidValue, validationMessage, validationMessageSummary);
3778
+ };
3673
3779
  /**
3674
3780
  * Validierung mit einem RegEx Pattern
3675
3781
  * @param control Control das validiert werden soll.
@@ -3692,7 +3798,11 @@
3692
3798
  return requiredValidator(validationMessage, validationMessageSummary);
3693
3799
  };
3694
3800
  return Validation;
3695
- }());
3801
+ }());
3802
+ /**
3803
+ * Moment
3804
+ */
3805
+ var moment$1 = moment___default['default'];
3696
3806
 
3697
3807
  /**
3698
3808
  * Basis Komponente für SacRadiobuttonsCommon. Extends SacBaseModelControl
@@ -3810,59 +3920,66 @@
3810
3920
  * Basis Komponente für SacRadiobutton.
3811
3921
  */
3812
3922
  var SacRadiobuttonCommon = /** @class */ (function () {
3923
+ // #endregion Properties
3924
+ // #region Constructors
3813
3925
  /**
3814
3926
  * Konstruktor
3815
3927
  * @param SacRadioButtons
3928
+ * @param formlayout SacFormLayoutCommon to define scoped layout settings
3929
+ * @param injector Injector for injecting services
3816
3930
  */
3817
- function SacRadiobuttonCommon(sacRadioButtons) {
3931
+ function SacRadiobuttonCommon(sacRadioButtons, formlayout, injector) {
3818
3932
  this.sacRadioButtons = sacRadioButtons;
3933
+ this.injector = injector;
3934
+ // #region Properties
3819
3935
  /**
3820
- * ControlHeight enum for use in HTML markup
3936
+ * Boolean Property zum Ausblenden des Controls; default Wert - false
3821
3937
  */
3822
- this.ControlHeight = exports.ControlHeight;
3938
+ this._hidden = false;
3823
3939
  /**
3824
- * Output Event
3940
+ * Form layout instance if exists
3825
3941
  */
3826
- this.onselectitem = new i0.EventEmitter();
3942
+ this.formlayout = null;
3827
3943
  /**
3828
- * Boolean Property zum Ausblenden des Controls; default Wert - false
3944
+ * public public public public public public public public public public public public public ControlHeight enum for use in HTML markup
3829
3945
  */
3830
- this._hidden = false;
3946
+ this.ControlHeight = exports.ControlHeight;
3831
3947
  /**
3832
3948
  * Unique Index für RadioButton
3833
3949
  */
3834
3950
  this._index = null;
3951
+ /**
3952
+ * Text to support the user during input.
3953
+ */
3954
+ this.helptext = '';
3955
+ /**
3956
+ * Output Event
3957
+ */
3958
+ this.onselectitem = new i0.EventEmitter();
3959
+ this.formlayout = formlayout;
3960
+ this.configurationService = injector.get(SACCONFIGURATION_SERVICE, new SacDefaultConfigurationService());
3961
+ this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
3835
3962
  // Registration des Controls in SacRadioButtons Container
3836
3963
  this.sacRadioButtons.RegisterRadioButton(this);
3837
3964
  }
3838
- Object.defineProperty(SacRadiobuttonCommon.prototype, "isDisabled", {
3965
+ Object.defineProperty(SacRadiobuttonCommon.prototype, "HelptextTooltipIcon", {
3966
+ // #endregion Constructors
3967
+ // #region Public Getters And Setters
3839
3968
  /**
3840
- * Methode ergibt Boolean, ob Control disabled ist
3969
+ * Get Icon for Helptext Tooltip
3841
3970
  */
3842
3971
  get: function () {
3843
- return this.disabled || this.sacRadioButtons.disabled;
3972
+ return this.iconService.GenericHelptextIcon;
3844
3973
  },
3845
3974
  enumerable: false,
3846
3975
  configurable: true
3847
3976
  });
3848
- Object.defineProperty(SacRadiobuttonCommon.prototype, "hidden", {
3849
- get: function () {
3850
- return this._hidden;
3851
- },
3977
+ Object.defineProperty(SacRadiobuttonCommon.prototype, "componentHeight", {
3852
3978
  /**
3853
- * Setter für hidden Property
3979
+ * define the control height from parent control
3854
3980
  */
3855
- set: function (v) {
3856
- if (v === null || v === undefined || typeof v === 'boolean') {
3857
- this._hidden = v;
3858
- }
3859
- else {
3860
- this._hidden = v === 'true';
3861
- }
3862
- // Model Reset falls RadioButton selektiert war
3863
- if (this._hidden && this.checked) {
3864
- this.sacRadioButtons.SelectItem(null);
3865
- }
3981
+ get: function () {
3982
+ return this.sacRadioButtons.componentHeight;
3866
3983
  },
3867
3984
  enumerable: false,
3868
3985
  configurable: true
@@ -3872,9 +3989,7 @@
3872
3989
  * Getter für Unique Index
3873
3990
  */
3874
3991
  get: function () {
3875
- if (this._index === null &&
3876
- this.sacRadioButtons !== null &&
3877
- this.sacRadioButtons !== undefined) {
3992
+ if (this._index === null && this.sacRadioButtons !== null && this.sacRadioButtons !== undefined) {
3878
3993
  this._index = this.sacRadioButtons.GetRadionButtonIndex();
3879
3994
  }
3880
3995
  return this._index;
@@ -3892,18 +4007,49 @@
3892
4007
  enumerable: false,
3893
4008
  configurable: true
3894
4009
  });
3895
- Object.defineProperty(SacRadiobuttonCommon.prototype, "componentHeight", {
4010
+ Object.defineProperty(SacRadiobuttonCommon.prototype, "hidden", {
4011
+ get: function () {
4012
+ return this._hidden;
4013
+ },
3896
4014
  /**
3897
- * define the control height from parent control
4015
+ * Setter für hidden Property
4016
+ */
4017
+ set: function (v) {
4018
+ if (v === null || v === undefined || typeof v === 'boolean') {
4019
+ this._hidden = v;
4020
+ }
4021
+ else {
4022
+ this._hidden = v === 'true';
4023
+ }
4024
+ // Model Reset falls RadioButton selektiert war
4025
+ if (this._hidden && this.checked) {
4026
+ this.sacRadioButtons.SelectItem(null);
4027
+ }
4028
+ },
4029
+ enumerable: false,
4030
+ configurable: true
4031
+ });
4032
+ Object.defineProperty(SacRadiobuttonCommon.prototype, "isDisabled", {
4033
+ /**
4034
+ * Methode ergibt Boolean, ob Control disabled ist
3898
4035
  */
3899
4036
  get: function () {
3900
- return this.sacRadioButtons.componentHeight;
4037
+ return this.disabled || this.sacRadioButtons.disabled;
3901
4038
  },
3902
4039
  enumerable: false,
3903
4040
  configurable: true
3904
4041
  });
3905
- //#endregion
3906
- //#region Control Events
4042
+ // #endregion Public Getters And Setters
4043
+ // #region Public Methods
4044
+ /**
4045
+ * Event bei Änderungen
4046
+ */
4047
+ SacRadiobuttonCommon.prototype.ChangeEvent = function () {
4048
+ if (!this.disabled) {
4049
+ this.sacRadioButtons.SelectItem(this.value);
4050
+ this.onselectitem.emit();
4051
+ }
4052
+ };
3907
4053
  /**
3908
4054
  * Event wenn die Komponente zerstört wird
3909
4055
  */
@@ -3911,14 +4057,24 @@
3911
4057
  // De-Registration des Controls in SacRadioButtons Container
3912
4058
  this.sacRadioButtons.UnregisterRadioButton(this);
3913
4059
  };
3914
- //#endregion
4060
+ SacRadiobuttonCommon.prototype.ngOnInit = function () {
4061
+ // set method to display helptext
4062
+ this.setHelpTextMode();
4063
+ };
4064
+ // #endregion Public Methods
4065
+ // #region Private Methods
3915
4066
  /**
3916
- * Event bei Änderungen
4067
+ * Set mode for helptext. Can be tooltip or text
3917
4068
  */
3918
- SacRadiobuttonCommon.prototype.ChangeEvent = function () {
3919
- if (!this.disabled) {
3920
- this.sacRadioButtons.SelectItem(this.value);
3921
- this.onselectitem.emit();
4069
+ SacRadiobuttonCommon.prototype.setHelpTextMode = function () {
4070
+ var _a;
4071
+ if (!this.helptextmode) {
4072
+ if ((_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.helptextmode) {
4073
+ this.helptextmode = this.formlayout.helptextmode;
4074
+ }
4075
+ else {
4076
+ this.helptextmode = this.configurationService.HelptextMode;
4077
+ }
3922
4078
  }
3923
4079
  };
3924
4080
  return SacRadiobuttonCommon;
@@ -3927,24 +4083,26 @@
3927
4083
  { type: i0.Directive }
3928
4084
  ];
3929
4085
  SacRadiobuttonCommon.ctorParameters = function () { return [
3930
- { type: SacRadiobuttonsCommon }
4086
+ { type: SacRadiobuttonsCommon },
4087
+ { type: SacFormLayoutCommon, decorators: [{ type: i0.Host }] },
4088
+ { type: i0.Injector }
3931
4089
  ]; };
3932
4090
  SacRadiobuttonCommon.propDecorators = {
3933
- value: [{ type: i0.Input }],
3934
- label: [{ type: i0.Input }],
3935
4091
  checked: [{ type: i0.Input }],
3936
4092
  disabled: [{ type: i0.Input }],
4093
+ helptext: [{ type: i0.Input }],
4094
+ helptextmode: [{ type: i0.Input }],
4095
+ label: [{ type: i0.Input }],
4096
+ labeltemplate: [{ type: i0.Input }],
3937
4097
  onselectitem: [{ type: i0.Output }],
3938
- hidden: [{ type: i0.Input }],
3939
- labeltemplate: [{ type: i0.Input }]
4098
+ value: [{ type: i0.Input }],
4099
+ hidden: [{ type: i0.Input }]
3940
4100
  };
3941
4101
 
3942
4102
  /**
3943
4103
  * Base Komponente für Dialog
3944
4104
  */
3945
4105
  var SacDialogCommon = /** @class */ (function () {
3946
- // #endregion
3947
- // #region Constructor
3948
4106
  /**
3949
4107
  * Konstruktor
3950
4108
  * Inject des Formulars
@@ -3961,11 +4119,6 @@
3961
4119
  * Die akzeptabel keywordssind: 'small', 'large', 'extralarge', 'medium', ''.
3962
4120
  */
3963
4121
  this._size = '';
3964
- // #region Properties
3965
- /**
3966
- * Input Property. Erhält den Title des Dialog. Default Value: 'Dialog'.
3967
- */
3968
- this.title = 'Dialog';
3969
4122
  /**
3970
4123
  * Das input property akzeptiert boolen Wert. Definiert ob das Dialog darf durch ESC geschlossen werden. Default ist true.
3971
4124
  */
@@ -3974,26 +4127,22 @@
3974
4127
  * Das input property akzeptiert boolen Wert. Definiert ob das Dialog darf durch click außerhalb des Dialog-Fenster geschlossen werden. Default ist true.
3975
4128
  */
3976
4129
  this.backdrop = true;
3977
- /**
3978
- * Input Property. Erhält den Namen des Dialog - benutzt für das ID. Default Value: ''
3979
- */
3980
- this.name = '';
3981
4130
  /**
3982
4131
  * Steuert ob im Header des Dialogs ein Button angezeigt wird.
3983
4132
  */
3984
4133
  this.closebutton = true;
3985
4134
  /**
3986
- * Input Property. Erhält die Breite des Dialog
4135
+ * Output Emitter. Wird aufgerufen, wenn das Wert des _show property geändert ist - damait das Dialog geöfnet/geschlossen wird.
3987
4136
  */
3988
- this.width = null;
4137
+ this.isvisibleChange = new i0.EventEmitter();
3989
4138
  /**
3990
- * Definiert eine feste Höhe beim Dialog.
4139
+ * Input Property. Erhält den Namen des Dialog - benutzt für das ID. Default Value: ''
3991
4140
  */
3992
- this.height = null;
4141
+ this.name = '';
3993
4142
  /**
3994
- * Output Emitter. Wird aufgerufen, wenn das Wert des _show property geändert ist - damait das Dialog geöfnet/geschlossen wird.
4143
+ * Input Property. Erhält den Title des Dialog. Default Value: 'Dialog'.
3995
4144
  */
3996
- this.isvisibleChange = new i0.EventEmitter();
4145
+ this.title = 'Dialog';
3997
4146
  }
3998
4147
  Object.defineProperty(SacDialogCommon.prototype, "dialogElementSetter", {
3999
4148
  /**
@@ -4005,20 +4154,6 @@
4005
4154
  enumerable: false,
4006
4155
  configurable: true
4007
4156
  });
4008
- Object.defineProperty(SacDialogCommon.prototype, "size", {
4009
- /**
4010
- * Das Input akzeptiert sowohl default size-css-Klassen als auch custom Klassen.
4011
- * case insensitive.
4012
- * Die akzeptabel default-size-Klassen sind: 'small', 'large', 'extralarge', 'medium', ''.
4013
- * Wenn size ist NICHT gesetzt (oder 'medium' oder ''), default ist in medium size: max-width 500px.
4014
- */
4015
- set: function (v) {
4016
- v = v.toLowerCase();
4017
- this._size = v;
4018
- },
4019
- enumerable: false,
4020
- configurable: true
4021
- });
4022
4157
  Object.defineProperty(SacDialogCommon.prototype, "isvisible", {
4023
4158
  /**
4024
4159
  * Getter. Ergibt das boolen Wert des _show property
@@ -4047,76 +4182,49 @@
4047
4182
  enumerable: false,
4048
4183
  configurable: true
4049
4184
  });
4185
+ Object.defineProperty(SacDialogCommon.prototype, "size", {
4186
+ /**
4187
+ * Das Input akzeptiert sowohl default size-css-Klassen als auch custom Klassen.
4188
+ * case insensitive.
4189
+ * Die akzeptabel default-size-Klassen sind: 'small', 'large', 'extralarge', 'medium', ''.
4190
+ * Wenn size ist NICHT gesetzt (oder 'medium' oder ''), default ist in medium size: max-width 500px.
4191
+ */
4192
+ set: function (v) {
4193
+ this._size = v;
4194
+ },
4195
+ enumerable: false,
4196
+ configurable: true
4197
+ });
4198
+ Object.defineProperty(SacDialogCommon.prototype, "ChangeDetector", {
4199
+ /**
4200
+ * Getter for ChangeDetector.
4201
+ */
4202
+ get: function () {
4203
+ return this.cdRef;
4204
+ },
4205
+ enumerable: false,
4206
+ configurable: true
4207
+ });
4050
4208
  /**
4051
- * Die Funktion prüft ob es ein default css classe für Size des Dialog durch den size Input gesetzt wurde.
4052
- */
4053
- SacDialogCommon.prototype.issetdefaultsize = function () {
4054
- var result = false;
4055
- switch (this._size) {
4056
- case 'small':
4057
- result = true;
4058
- break;
4059
- case 'medium':
4060
- result = true;
4061
- break;
4062
- case 'large':
4063
- result = true;
4064
- break;
4065
- case 'extralarge':
4066
- result = true;
4067
- break;
4068
- case '':
4069
- result = true;
4070
- break;
4071
- }
4072
- return result;
4073
- };
4074
- // #endregion
4075
- /**
4076
- * Methode wenn Componente entfernt wird
4209
+ * Die Methode setz den Wert des _show property auf false
4077
4210
  */
4078
- SacDialogCommon.prototype.ngOnDestroy = function () {
4211
+ SacDialogCommon.prototype.hide = function () {
4079
4212
  if (this.hasSetBodyTag && document.body.classList.contains('modal-open')) {
4080
4213
  document.body.classList.remove('modal-open');
4081
4214
  this.hasSetBodyTag = false;
4082
4215
  }
4083
- };
4084
- // #region Methods
4085
- /**
4086
- * Die Methode setz den Wert des _show property auf true
4087
- */
4088
- SacDialogCommon.prototype.show = function () {
4089
- this._show = true;
4090
- if (!this.hasSetBodyTag &&
4091
- !document.body.classList.contains('modal-open')) {
4092
- document.body.classList.add('modal-open');
4093
- this.hasSetBodyTag = true;
4094
- }
4216
+ this._show = false;
4095
4217
  this.isvisibleChange.emit(this._show);
4096
4218
  };
4097
4219
  /**
4098
- * Die Methode setz den Wert des _show property auf false
4220
+ * Methode wenn Componente entfernt wird
4099
4221
  */
4100
- SacDialogCommon.prototype.hide = function () {
4222
+ SacDialogCommon.prototype.ngOnDestroy = function () {
4101
4223
  if (this.hasSetBodyTag && document.body.classList.contains('modal-open')) {
4102
4224
  document.body.classList.remove('modal-open');
4103
4225
  this.hasSetBodyTag = false;
4104
4226
  }
4105
- this._show = false;
4106
- this.isvisibleChange.emit(this._show);
4107
4227
  };
4108
- Object.defineProperty(SacDialogCommon.prototype, "ChangeDetector", {
4109
- /**
4110
- * Getter for ChangeDetector.
4111
- */
4112
- get: function () {
4113
- return this.cdRef;
4114
- },
4115
- enumerable: false,
4116
- configurable: true
4117
- });
4118
- // #endregion
4119
- // #region Host Actions
4120
4228
  /**
4121
4229
  * Allow Close by Click outside Dialog
4122
4230
  */
@@ -4138,6 +4246,18 @@
4138
4246
  this.hide();
4139
4247
  }
4140
4248
  };
4249
+ /**
4250
+ * Die Methode setz den Wert des _show property auf true
4251
+ */
4252
+ SacDialogCommon.prototype.show = function () {
4253
+ this._show = true;
4254
+ if (!this.hasSetBodyTag &&
4255
+ !document.body.classList.contains('modal-open')) {
4256
+ document.body.classList.add('modal-open');
4257
+ this.hasSetBodyTag = true;
4258
+ }
4259
+ this.isvisibleChange.emit(this._show);
4260
+ };
4141
4261
  return SacDialogCommon;
4142
4262
  }());
4143
4263
  SacDialogCommon.decorators = [
@@ -4147,17 +4267,15 @@
4147
4267
  { type: i0.ChangeDetectorRef }
4148
4268
  ]; };
4149
4269
  SacDialogCommon.propDecorators = {
4150
- dialogElementSetter: [{ type: i0.ViewChild, args: ['dialog', { static: false },] }],
4151
- title: [{ type: i0.Input }],
4152
4270
  allowesc: [{ type: i0.Input }],
4153
4271
  backdrop: [{ type: i0.Input }],
4154
- name: [{ type: i0.Input }],
4155
4272
  closebutton: [{ type: i0.Input }],
4156
- width: [{ type: i0.Input }],
4157
- height: [{ type: i0.Input }],
4158
- size: [{ type: i0.Input }],
4159
4273
  isvisibleChange: [{ type: i0.Output }],
4274
+ name: [{ type: i0.Input }],
4275
+ title: [{ type: i0.Input }],
4276
+ dialogElementSetter: [{ type: i0.ViewChild, args: ['dialog', { static: false },] }],
4160
4277
  isvisible: [{ type: i0.Input }],
4278
+ size: [{ type: i0.Input }],
4161
4279
  onClick: [{ type: i0.HostListener, args: ['click', ['$event'],] }],
4162
4280
  onKeydownHandler: [{ type: i0.HostListener, args: ['document:keydown', ['$event'],] }]
4163
4281
  };
@@ -4385,14 +4503,29 @@
4385
4503
  groupitems: [{ type: i0.Input }]
4386
4504
  };
4387
4505
 
4388
- // #region Classes
4506
+ /**
4507
+ * Function um ein Key Value Pair für das Dropdown zu erzeugen
4508
+ * @param id ID
4509
+ * @param value Wert der an das Element gebunden werden soll
4510
+ */
4511
+ function _buildValueString(id, value) {
4512
+ // Wenn ID null ist Object zurückgeben
4513
+ if (id == null) {
4514
+ return "" + value;
4515
+ }
4516
+ // Mapping Objekt zu String
4517
+ if (value && typeof value === 'object') {
4518
+ value = 'Object';
4519
+ }
4520
+ // String als ID
4521
+ return (id + ": " + value).slice(0, 50);
4522
+ }
4523
+
4389
4524
  /**
4390
4525
  * Base Dropdown Komponente
4391
4526
  */
4392
4527
  var SacDropdownCommon = /** @class */ (function (_super) {
4393
4528
  __extends(SacDropdownCommon, _super);
4394
- // #endregion Properties
4395
- // #region Constructors
4396
4529
  /**
4397
4530
  * Constructor
4398
4531
  * @param formlayout SacFormLayoutCommon to define scoped layout settings
@@ -4404,11 +4537,18 @@
4404
4537
  var _this = _super.call(this, formlayout, injector) || this;
4405
4538
  _this.renderer = renderer;
4406
4539
  _this.elementRef = elementRef;
4407
- // #region Properties
4408
4540
  /**
4409
4541
  * compareWith-Funktion
4410
4542
  */
4411
4543
  _this._compareWith = Object.is;
4544
+ /**
4545
+ * Counter vom OptionID; default Wert = 0
4546
+ */
4547
+ _this._optionIdCounter = 0;
4548
+ /**
4549
+ * OptionMap
4550
+ */
4551
+ _this._optionMap = new Map();
4412
4552
  /**
4413
4553
  * Label Text für Empty Item
4414
4554
  */
@@ -4425,19 +4565,9 @@
4425
4565
  * Resource Key für Validation Message Required in Validation Summary
4426
4566
  */
4427
4567
  _this.validationmessagesummaryrequired = _this.validationKeyService.ValidationErrorSummaryRequired;
4428
- /**
4429
- * Counter vom OptionID; default Wert = 0
4430
- */
4431
- _this._optionIdCounter = 0;
4432
- /**
4433
- * OptionMap
4434
- */
4435
- _this._optionMap = new Map();
4436
4568
  return _this;
4437
4569
  }
4438
4570
  Object.defineProperty(SacDropdownCommon.prototype, "comparewith", {
4439
- // #endregion Constructors
4440
- // #region Public Getters And Setters
4441
4571
  /**
4442
4572
  * compareWith-Funktion
4443
4573
  */
@@ -4450,8 +4580,6 @@
4450
4580
  enumerable: false,
4451
4581
  configurable: true
4452
4582
  });
4453
- // #endregion Public Getters And Setters
4454
- // #region Public Methods
4455
4583
  /**
4456
4584
  * Registriert das OptionID-Counter als String
4457
4585
  */
@@ -4486,6 +4614,12 @@
4486
4614
  if (this.isrequired) {
4487
4615
  error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
4488
4616
  }
4617
+ if (error) {
4618
+ return error;
4619
+ }
4620
+ if (this.isrequired && this.emptyvalue !== null) {
4621
+ error = Validation.notequals(this.emptyvalue, this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
4622
+ }
4489
4623
  return error;
4490
4624
  };
4491
4625
  /**
@@ -4496,8 +4630,6 @@
4496
4630
  this.setSelectedValue(value);
4497
4631
  _super.prototype.writeValue.call(this, value);
4498
4632
  };
4499
- // #endregion Public Methods
4500
- // #region Private Methods
4501
4633
  /**
4502
4634
  * ID extrahieren
4503
4635
  * @param valueString String bei welchem die ID Extrahiert werden soll
@@ -4572,13 +4704,12 @@
4572
4704
  validationmessagerequired: [{ type: i0.Input }],
4573
4705
  validationmessagesummaryrequired: [{ type: i0.Input }],
4574
4706
  comparewith: [{ type: i0.Input }]
4575
- };
4707
+ };
4708
+
4576
4709
  /**
4577
4710
  * SacDropdownOption-Klasse
4578
4711
  */
4579
4712
  var SacDropdownOptionCommon = /** @class */ (function () {
4580
- // #endregion Properties
4581
- // #region Constructors
4582
4713
  /**
4583
4714
  * Konstruktor
4584
4715
  * @param _element Referenz auf HTML Element
@@ -4589,7 +4720,6 @@
4589
4720
  this._element = _element;
4590
4721
  this._renderer = _renderer;
4591
4722
  this._dropdown = _dropdown;
4592
- // #region Properties
4593
4723
  /**
4594
4724
  * ID-String
4595
4725
  */
@@ -4599,8 +4729,6 @@
4599
4729
  }
4600
4730
  }
4601
4731
  Object.defineProperty(SacDropdownOptionCommon.prototype, "ngValue", {
4602
- // #endregion Constructors
4603
- // #region Public Getters And Setters
4604
4732
  /**
4605
4733
  * Option ngValue
4606
4734
  */
@@ -4626,8 +4754,6 @@
4626
4754
  enumerable: false,
4627
4755
  configurable: true
4628
4756
  });
4629
- // #endregion Public Getters And Setters
4630
- // #region Public Methods
4631
4757
  /**
4632
4758
  * Den Wert vom Option-Element einstellen
4633
4759
  * @param value Wert
@@ -4656,27 +4782,7 @@
4656
4782
  SacDropdownOptionCommon.propDecorators = {
4657
4783
  ngValue: [{ type: i0.Input }],
4658
4784
  value: [{ type: i0.Input }]
4659
- };
4660
- // #endregion Classes
4661
- // #region Functions
4662
- /**
4663
- * Function um ein Key Value Pair für das Dropdown zu erzeugen
4664
- * @param id ID
4665
- * @param value Wert der an das Element gebunden werden soll
4666
- */
4667
- function _buildValueString(id, value) {
4668
- // Wenn ID null ist Object zurückgeben
4669
- if (id == null) {
4670
- return "" + value;
4671
- }
4672
- // Mapping Objekt zu String
4673
- if (value && typeof value === 'object') {
4674
- value = 'Object';
4675
- }
4676
- // String als ID
4677
- return (id + ": " + value).slice(0, 50);
4678
- }
4679
- // #endregion Functions
4785
+ };
4680
4786
 
4681
4787
  // #endregion Interfaces
4682
4788
  // #region Classes
@@ -6590,9 +6696,370 @@
6590
6696
  };
6591
6697
 
6592
6698
  /**
6593
- * Moment
6699
+ * Enum für Tooltip Positionen
6594
6700
  */
6595
- var moment$2 = moment___default['default'];
6701
+ (function (TooltipPosition) {
6702
+ TooltipPosition[TooltipPosition["none"] = 0] = "none";
6703
+ // tslint:disable-next-line:no-bitwise
6704
+ TooltipPosition[TooltipPosition["top"] = 1] = "top";
6705
+ // tslint:disable-next-line:no-bitwise
6706
+ TooltipPosition[TooltipPosition["right"] = 2] = "right";
6707
+ // tslint:disable-next-line:no-bitwise
6708
+ TooltipPosition[TooltipPosition["bottom"] = 4] = "bottom";
6709
+ // tslint:disable-next-line:no-bitwise
6710
+ TooltipPosition[TooltipPosition["left"] = 8] = "left";
6711
+ // tslint:disable-next-line:no-bitwise
6712
+ TooltipPosition[TooltipPosition["topend"] = 16] = "topend";
6713
+ // tslint:disable-next-line:no-bitwise
6714
+ TooltipPosition[TooltipPosition["bottomend"] = 32] = "bottomend";
6715
+ })(exports.TooltipPosition || (exports.TooltipPosition = {}));
6716
+
6717
+ var PopUpHelper = /** @class */ (function () {
6718
+ function PopUpHelper() {
6719
+ }
6720
+ // #region Public Methods
6721
+ PopUpHelper.prototype.getContainerHeight = function (referenceContainer, referenceIsContainer) {
6722
+ if (referenceContainer) {
6723
+ return referenceIsContainer
6724
+ ? referenceContainer.nativeElement.firstElementChild.clientHeight
6725
+ : referenceContainer.nativeElement.offsetHeight;
6726
+ }
6727
+ else {
6728
+ return 0;
6729
+ }
6730
+ };
6731
+ PopUpHelper.prototype.getContainerWidth = function (referenceContainer, referenceIsContainer) {
6732
+ if (referenceContainer) {
6733
+ return referenceIsContainer
6734
+ ? referenceContainer.nativeElement.firstElementChild.clientWidth
6735
+ : referenceContainer.nativeElement.offsetWidth;
6736
+ }
6737
+ else {
6738
+ return 0;
6739
+ }
6740
+ };
6741
+ /**
6742
+ * Get Position who the popup would be positioned
6743
+ *
6744
+ * @param referenceContainer Element Reference to HTML Element which is the reference to positioning the popup
6745
+ * @param popupcontentcontainer Element Reference to container of popup
6746
+ * @param popupOffset Offset for popup positioning
6747
+ * @param allowedPositions Allowed Positions for the popup
6748
+ * @returns Returns the position where the popup should be displayed
6749
+ */
6750
+ PopUpHelper.prototype.getDisplayPosition = function (referenceContainer, popupcontentcontainer, arrowWidth, arrowHeight, allowedPositions, referenceIsContainer) {
6751
+ var validPositions = this.validatePositions(referenceContainer, popupcontentcontainer, arrowWidth, arrowHeight, referenceIsContainer);
6752
+ // tslint:disable-next-line:no-bitwise
6753
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.right) && validPositions & exports.TooltipPosition.right) {
6754
+ return exports.TooltipPosition.right;
6755
+ }
6756
+ // tslint:disable-next-line:no-bitwise
6757
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.top) && validPositions & exports.TooltipPosition.top) {
6758
+ return exports.TooltipPosition.top;
6759
+ }
6760
+ // tslint:disable-next-line:no-bitwise
6761
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.left) && validPositions & exports.TooltipPosition.left) {
6762
+ return exports.TooltipPosition.left;
6763
+ }
6764
+ // tslint:disable-next-line:no-bitwise
6765
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.bottom) && validPositions & exports.TooltipPosition.bottom) {
6766
+ return exports.TooltipPosition.bottom;
6767
+ }
6768
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.topend) && validPositions & exports.TooltipPosition.topend) {
6769
+ return exports.TooltipPosition.topend;
6770
+ }
6771
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.bottomend) &&
6772
+ validPositions & exports.TooltipPosition.bottomend) {
6773
+ return exports.TooltipPosition.bottomend;
6774
+ }
6775
+ // Get Auto Position or Default
6776
+ if (this.isAutoPosition(allowedPositions)) {
6777
+ // tslint:disable-next-line:no-bitwise
6778
+ if (validPositions & exports.TooltipPosition.right) {
6779
+ return exports.TooltipPosition.right;
6780
+ }
6781
+ // tslint:disable-next-line:no-bitwise
6782
+ if (validPositions & exports.TooltipPosition.top) {
6783
+ return exports.TooltipPosition.top;
6784
+ }
6785
+ // tslint:disable-next-line:no-bitwise
6786
+ if (validPositions & exports.TooltipPosition.left) {
6787
+ return exports.TooltipPosition.left;
6788
+ }
6789
+ // tslint:disable-next-line:no-bitwise
6790
+ if (validPositions & exports.TooltipPosition.bottom) {
6791
+ return exports.TooltipPosition.bottom;
6792
+ }
6793
+ return exports.TooltipPosition.right;
6794
+ }
6795
+ else {
6796
+ return this.getPosition(allowedPositions);
6797
+ }
6798
+ };
6799
+ /**
6800
+ * Calculates the height of the popup
6801
+ *
6802
+ * @param container Element Reference to container of popup
6803
+ */
6804
+ PopUpHelper.prototype.getPopupHeight = function (container) {
6805
+ var _a;
6806
+ if (container) {
6807
+ return (_a = container.nativeElement.firstElementChild.clientHeight) !== null && _a !== void 0 ? _a : 0;
6808
+ }
6809
+ else {
6810
+ return 0;
6811
+ }
6812
+ };
6813
+ /**
6814
+ * Calculates the width of the popup
6815
+ *
6816
+ * @param container Element Reference to container of popup
6817
+ */
6818
+ PopUpHelper.prototype.getPopupWidth = function (container) {
6819
+ if (container) {
6820
+ return container.nativeElement.firstElementChild.clientWidth;
6821
+ }
6822
+ else {
6823
+ return 0;
6824
+ }
6825
+ };
6826
+ /**
6827
+ * Returns the defined position for the tooltip
6828
+ *
6829
+ * @param allowedPositions Allowed positions defined in markup for popup
6830
+ */
6831
+ PopUpHelper.prototype.getPosition = function (allowedPositions) {
6832
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.left)) {
6833
+ return exports.TooltipPosition.left;
6834
+ }
6835
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.top)) {
6836
+ return exports.TooltipPosition.top;
6837
+ }
6838
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.right)) {
6839
+ return exports.TooltipPosition.right;
6840
+ }
6841
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.bottom)) {
6842
+ return exports.TooltipPosition.bottom;
6843
+ }
6844
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.topend)) {
6845
+ return exports.TooltipPosition.topend;
6846
+ }
6847
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.bottomend)) {
6848
+ return exports.TooltipPosition.bottomend;
6849
+ }
6850
+ // Default Position if empty
6851
+ return exports.TooltipPosition.right;
6852
+ };
6853
+ /**
6854
+ * Calculates the position of the tooltip from links
6855
+ *
6856
+ * @param controlReference Element Reference to angular component
6857
+ * @param popupContainer Element Reference to container of popup
6858
+ * @param referenceContainer Element Reference to HTML Element which is the reference to positioning the popup
6859
+ * @param popupOffset Offset for popup positioning
6860
+ * @param requestedPosition Requested Position by Control
6861
+ */
6862
+ PopUpHelper.prototype.getPositionLeft = function (referenceContainer, popupContainer, controlReference, arrowWidth, arrowHeight, requestedPosition, referenceIsContainer) {
6863
+ if (referenceContainer !== null && referenceContainer !== undefined) {
6864
+ var item = referenceContainer.nativeElement;
6865
+ if (item.children.length >= 1) {
6866
+ var childItem = referenceIsContainer ? item.firstElementChild : item;
6867
+ var contentPosition = childItem.getBoundingClientRect();
6868
+ switch (this.getDisplayPosition(referenceContainer, popupContainer, arrowWidth, arrowHeight, requestedPosition, referenceIsContainer)) {
6869
+ case exports.TooltipPosition.top:
6870
+ case exports.TooltipPosition.bottom:
6871
+ return (contentPosition.left + contentPosition.width / 2 - this.getPopupWidth(popupContainer) / 2);
6872
+ case exports.TooltipPosition.topend:
6873
+ case exports.TooltipPosition.bottomend:
6874
+ return contentPosition.left + contentPosition.width - this.getPopupWidth(popupContainer);
6875
+ case exports.TooltipPosition.right:
6876
+ return contentPosition.left + contentPosition.width + arrowWidth / 2;
6877
+ case exports.TooltipPosition.left:
6878
+ return contentPosition.left - this.getPopupWidth(popupContainer) + (arrowWidth / 2) * -1;
6879
+ }
6880
+ return referenceContainer.nativeElement.offsetTop;
6881
+ }
6882
+ else {
6883
+ return referenceContainer.nativeElement.offsetTop;
6884
+ }
6885
+ }
6886
+ else {
6887
+ return controlReference.nativeElement.offsetLeft;
6888
+ }
6889
+ };
6890
+ /**
6891
+ * Calculates the position of the tooltip from the top
6892
+ *
6893
+ * @param controlReference Element Reference to angular component
6894
+ * @param popupContainer Element Reference to container of popup
6895
+ * @param referenceContainer Element Reference to HTML Element which is the reference to positioning the popup
6896
+ * @param popupOffset Offset for popup positioning
6897
+ * @param requestedPosition Requested Position by Control
6898
+ */
6899
+ PopUpHelper.prototype.getPositionTop = function (referenceContainer, popupContainer, controlReference, arrowWidth, arrowHeight, requestedPosition, referenceIsContainer) {
6900
+ if (referenceContainer !== null && referenceContainer !== undefined) {
6901
+ var item = referenceContainer.nativeElement;
6902
+ if (item.children.length >= 1) {
6903
+ var childItem = referenceIsContainer ? item.firstElementChild : item;
6904
+ var contentPosition = childItem.getBoundingClientRect();
6905
+ // Get Position with Scroll (Scrollbars inside page should be substracted)
6906
+ var contentPositionTop = childItem.offsetTop +
6907
+ this.getOffsetTopParent(childItem.offsetParent) +
6908
+ this.getScrollTopParent(childItem.parentElement);
6909
+ switch (this.getDisplayPosition(referenceContainer, popupContainer, arrowWidth, arrowHeight, requestedPosition, referenceIsContainer)) {
6910
+ case exports.TooltipPosition.top:
6911
+ case exports.TooltipPosition.topend:
6912
+ return contentPositionTop - this.getPopupHeight(popupContainer) + (arrowHeight / 2) * -1;
6913
+ case exports.TooltipPosition.right:
6914
+ case exports.TooltipPosition.left:
6915
+ return (contentPositionTop + contentPosition.height / 2 - this.getPopupHeight(popupContainer) / 2);
6916
+ case exports.TooltipPosition.bottom:
6917
+ case exports.TooltipPosition.bottomend:
6918
+ return contentPositionTop + contentPosition.height + arrowHeight / 2;
6919
+ }
6920
+ return (childItem.clientTop +
6921
+ childItem.offsetTop -
6922
+ (this.getPopupHeight(popupContainer) / 2 - childItem.offsetHeight / 2));
6923
+ }
6924
+ else {
6925
+ return referenceContainer.nativeElement.offsetTop;
6926
+ }
6927
+ }
6928
+ else {
6929
+ return controlReference.nativeElement.offsetTop;
6930
+ }
6931
+ };
6932
+ /**
6933
+ * Returns whether the position has been configured
6934
+ *
6935
+ * @param allowedPositions Positions that allowed by control
6936
+ * @param requestedPosition Position to be checked
6937
+ */
6938
+ PopUpHelper.prototype.hasPosition = function (allowedPositions, requestedPosition) {
6939
+ var positions = allowedPositions.split('|');
6940
+ if (requestedPosition === exports.TooltipPosition.right && positions.indexOf('right') >= 0) {
6941
+ return true;
6942
+ }
6943
+ if (requestedPosition === exports.TooltipPosition.top && positions.indexOf('top') >= 0) {
6944
+ return true;
6945
+ }
6946
+ if (requestedPosition === exports.TooltipPosition.left && positions.indexOf('left') >= 0) {
6947
+ return true;
6948
+ }
6949
+ if (requestedPosition === exports.TooltipPosition.bottom && positions.indexOf('bottom') >= 0) {
6950
+ return true;
6951
+ }
6952
+ if (requestedPosition === exports.TooltipPosition.topend && positions.indexOf('topend') >= 0) {
6953
+ return true;
6954
+ }
6955
+ if (requestedPosition === exports.TooltipPosition.bottomend && positions.indexOf('bottomend') >= 0) {
6956
+ return true;
6957
+ }
6958
+ return false;
6959
+ };
6960
+ /**
6961
+ * Defines whether AutoPosition is active
6962
+ * @param positionProperty List of allowed positions
6963
+ */
6964
+ PopUpHelper.prototype.isAutoPosition = function (positionProperty) {
6965
+ var positions = positionProperty.split('|');
6966
+ return positions.indexOf('auto') >= 0;
6967
+ };
6968
+ /**
6969
+ * Checks whether the position is valid or whether the tooltip on the position has space
6970
+ */
6971
+ PopUpHelper.prototype.validatePositions = function (referenceContainer, popupcontentcontainer, arrowWidth, arrowHeight, referenceIsContainer) {
6972
+ // Check if Container is false
6973
+ if (popupcontentcontainer === undefined) {
6974
+ return exports.TooltipPosition.right;
6975
+ }
6976
+ var allowedPositions = exports.TooltipPosition.none;
6977
+ var basePosition = referenceIsContainer
6978
+ ? referenceContainer.nativeElement.firstElementChild.getBoundingClientRect()
6979
+ : referenceContainer.nativeElement.getBoundingClientRect();
6980
+ var tooltipRect = popupcontentcontainer.nativeElement.firstElementChild.getBoundingClientRect();
6981
+ var leftPosOk = basePosition.left - tooltipRect.width + arrowWidth * -1 > 0;
6982
+ var rightPosOk = basePosition.right + tooltipRect.width + arrowWidth < window.innerWidth;
6983
+ var topPosOk = basePosition.top - tooltipRect.height + arrowHeight > 0;
6984
+ var bottomPosOk = basePosition.bottom + tooltipRect.height + arrowHeight < window.innerHeight;
6985
+ var leftHalfPosOk = basePosition.left - tooltipRect.width / 2 > 0;
6986
+ var rightHalfPosOk = basePosition.right + tooltipRect.width / 2 < window.innerWidth;
6987
+ var topHalfPosOk = basePosition.top - tooltipRect.height / 2 > 0;
6988
+ var bottomHalfPosOk = basePosition.bottom + tooltipRect.height / 2 < window.innerHeight;
6989
+ if (leftPosOk && topPosOk) {
6990
+ // tslint:disable-next-line:no-bitwise
6991
+ allowedPositions = allowedPositions | exports.TooltipPosition.topend;
6992
+ }
6993
+ if (leftPosOk && bottomPosOk) {
6994
+ // tslint:disable-next-line:no-bitwise
6995
+ allowedPositions = allowedPositions | exports.TooltipPosition.bottomend;
6996
+ }
6997
+ if (leftPosOk && topHalfPosOk && bottomHalfPosOk) {
6998
+ // tslint:disable-next-line:no-bitwise
6999
+ allowedPositions = allowedPositions | exports.TooltipPosition.left;
7000
+ }
7001
+ if (rightPosOk && topHalfPosOk && bottomHalfPosOk) {
7002
+ // tslint:disable-next-line:no-bitwise
7003
+ allowedPositions = allowedPositions | exports.TooltipPosition.right;
7004
+ }
7005
+ if (topPosOk && leftHalfPosOk && rightHalfPosOk) {
7006
+ // tslint:disable-next-line:no-bitwise
7007
+ allowedPositions = allowedPositions | exports.TooltipPosition.top;
7008
+ }
7009
+ if (bottomPosOk && leftHalfPosOk && rightHalfPosOk) {
7010
+ // tslint:disable-next-line:no-bitwise
7011
+ allowedPositions = allowedPositions | exports.TooltipPosition.bottom;
7012
+ }
7013
+ return allowedPositions;
7014
+ };
7015
+ // #endregion Public Methods
7016
+ // #region Private Methods
7017
+ /**
7018
+ * Calculates the top of the page inside all elements
7019
+ * @param element HTML Element
7020
+ * @returns summarized top value for absolute position
7021
+ */
7022
+ PopUpHelper.prototype.getOffsetTopParent = function (element) {
7023
+ if (element === null) {
7024
+ return 0;
7025
+ }
7026
+ if (!element.offsetParent) {
7027
+ return element.offsetTop;
7028
+ }
7029
+ var parentValue = this.getOffsetTopParent(element.offsetParent);
7030
+ var offset = element.offsetTop;
7031
+ return parentValue + offset;
7032
+ };
7033
+ /**
7034
+ * Caclulate Scrollbars inside tree
7035
+ * @param element HTML Element
7036
+ * @param [isFixed=false] Invert Scroll Position value when style is fixed to preserve negative values
7037
+ * @returns Scroll top value of element with all childs
7038
+ */
7039
+ PopUpHelper.prototype.getScrollTopParent = function (element, isFixed) {
7040
+ if (isFixed === void 0) { isFixed = false; }
7041
+ if (element === null) {
7042
+ return 0;
7043
+ }
7044
+ // Body Scroll should not be calculated
7045
+ if (!element.parentElement) {
7046
+ return isFixed ? element.scrollTop : 0;
7047
+ }
7048
+ var isCurrentFixed = false;
7049
+ if (window.getComputedStyle(element).getPropertyValue('position') === 'fixed') {
7050
+ isCurrentFixed = true;
7051
+ }
7052
+ var parentValue = this.getScrollTopParent(element.parentElement, isFixed || isCurrentFixed);
7053
+ if (isFixed) {
7054
+ return parentValue + element.scrollTop;
7055
+ }
7056
+ else {
7057
+ return parentValue + element.scrollTop * -1;
7058
+ }
7059
+ };
7060
+ return PopUpHelper;
7061
+ }());
7062
+
6596
7063
  /**
6597
7064
  * Base Klasse für Date/Time Controls
6598
7065
  */
@@ -6606,22 +7073,65 @@
6606
7073
  * @param injector Injector for injecting services
6607
7074
  * @param elementRef reference to html element
6608
7075
  */
6609
- function SacBaseDateTimeControl(formlayout, injector, elementRef) {
7076
+ function SacBaseDateTimeControl(formlayout, injector, elementRef, cdRef) {
6610
7077
  var _this = _super.call(this, formlayout, injector) || this;
6611
7078
  _this.elementRef = elementRef;
7079
+ _this.cdRef = cdRef;
6612
7080
  // #region Properties
7081
+ /**
7082
+ * Helper class to display tooltip on correct position
7083
+ */
7084
+ _this.popupHelper = new PopUpHelper();
6613
7085
  /**
6614
7086
  * das property enthielt das Value als string. Default ist ''
6615
7087
  */
6616
7088
  _this._valueAsString = '';
7089
+ /**
7090
+ * Property for enum in Angular HTML template
7091
+ */
7092
+ _this.TooltipPosition = exports.TooltipPosition;
7093
+ /**
7094
+ * Definiert ob der Date Selector angezeigt wird
7095
+ */
7096
+ _this._showselector = false;
6617
7097
  /**
6618
7098
  * Definiert das Control als Required
6619
7099
  */
6620
7100
  _this.isrequired = false;
7101
+ /**
7102
+ * Moment JS Instance
7103
+ */
7104
+ _this.moment = moment___default['default'];
7105
+ /**
7106
+ * Arrow Item of Picker Element. Required to set the position of arrow correctly
7107
+ */
7108
+ _this.pickerPosition = exports.TooltipPosition;
6621
7109
  /**
6622
7110
  * TextBox Placeholder
6623
7111
  */
6624
7112
  _this.placeholder = null;
7113
+ /**
7114
+ * Position of the picker arrow at the left
7115
+ */
7116
+ _this.posArrowLeft = null;
7117
+ /**
7118
+ * Position of the picker arrow at the top
7119
+ */
7120
+ _this.posArrowTop = null;
7121
+ /**
7122
+ * Position of the picker at the left
7123
+ */
7124
+ _this.posPopupLeft = 0;
7125
+ /**
7126
+ * Position of the picker at the top
7127
+ */
7128
+ _this.posPopupTop = 0;
7129
+ /**
7130
+ * Position of the datetime picker. Values: left|top|right|bottom|auto
7131
+ *
7132
+ * Value 'auto' can be combined with another value.
7133
+ */
7134
+ _this.position = 'bottomend|topend';
6625
7135
  /**
6626
7136
  * Resource Key für Validation Message DateTimeFormat bei Control
6627
7137
  */
@@ -6638,8 +7148,47 @@
6638
7148
  * Resource Key für Validation Message Required in Validation Summary
6639
7149
  */
6640
7150
  _this.validationmessagerequiredsummary = _this.validationKeyService.ValidationErrorSummaryRequired;
7151
+ // #endregion Protected Methods
7152
+ // #region Private Methods
7153
+ /**
7154
+ * method if content has changed and proportions need to be reset in the UI.
7155
+ */
7156
+ _this.onContentChange = function () {
7157
+ // Do nothing if is not visible
7158
+ if (!_this._showselector) {
7159
+ return;
7160
+ }
7161
+ setTimeout(function () {
7162
+ _this.getPositionLeft();
7163
+ _this.getPositionTop();
7164
+ });
7165
+ };
6641
7166
  return _this;
6642
7167
  }
7168
+ Object.defineProperty(SacBaseDateTimeControl.prototype, "picker", {
7169
+ // #endregion Constructors
7170
+ // #region Public Getters And Setters
7171
+ /**
7172
+ * Setter for the name of the container for the tooltip. Is required as the tooltip can be hidden via ngIf.
7173
+ */
7174
+ set: function (picker) {
7175
+ if (picker !== undefined) {
7176
+ document.body.appendChild(picker.nativeElement);
7177
+ }
7178
+ this.pickercontainer = picker;
7179
+ this.onContentChange();
7180
+ this.cdRef.detectChanges();
7181
+ },
7182
+ enumerable: false,
7183
+ configurable: true
7184
+ });
7185
+ Object.defineProperty(SacBaseDateTimeControl.prototype, "tooltop", {
7186
+ get: function () {
7187
+ return this.pickercontainer;
7188
+ },
7189
+ enumerable: false,
7190
+ configurable: true
7191
+ });
6643
7192
  Object.defineProperty(SacBaseDateTimeControl.prototype, "valuestring", {
6644
7193
  /**
6645
7194
  * getter für valuestring
@@ -6649,18 +7198,16 @@
6649
7198
  return this._valueAsString;
6650
7199
  }
6651
7200
  else {
6652
- var date = moment$2.utc(this.value);
7201
+ var date = this.moment.utc(this.value);
6653
7202
  return date.local().format(this.GetDateTimeFormatString());
6654
7203
  }
6655
7204
  },
6656
- // #endregion Constructors
6657
- // #region Public Getters And Setters
6658
7205
  /**
6659
7206
  * Das Input bekommt das value von typ string
6660
7207
  */
6661
7208
  set: function (v) {
6662
7209
  this._valueAsString = v;
6663
- var date = moment$2(v, [this.GetDateTimeFormatString()], true);
7210
+ var date = this.moment(v, [this.GetDateTimeFormatString()], true);
6664
7211
  date = this.ModifyParsedDateTimeValue(date).utc();
6665
7212
  if (date.isValid()) {
6666
7213
  this.value = date.toDate();
@@ -6672,8 +7219,12 @@
6672
7219
  enumerable: false,
6673
7220
  configurable: true
6674
7221
  });
6675
- // #endregion Public Getters And Setters
6676
- // #region Public Methods
7222
+ /**
7223
+ * Returns the position of the tooltip
7224
+ */
7225
+ SacBaseDateTimeControl.prototype.GetPickerPosition = function () {
7226
+ return this.popupHelper.getDisplayPosition(this.pickerbutton, this.pickercontainer, this.getArrowWidth(), this.getArrowHeight(), this.position, false);
7227
+ };
6677
7228
  /**
6678
7229
  * JSON Date String in ein UTC DateTime Object konvertieren, welches vom Control verwendete werden kann
6679
7230
  */
@@ -6685,14 +7236,37 @@
6685
7236
  var hours = date.getUTCHours();
6686
7237
  var minutes = date.getUTCMinutes();
6687
7238
  var seconds = date.getUTCSeconds();
6688
- return moment$2(Date.UTC(year, month, day, hours, minutes, seconds));
7239
+ return this.moment(Date.UTC(year, month, day, hours, minutes, seconds));
7240
+ };
7241
+ /**
7242
+ * Calculates the height of the tooltip
7243
+ */
7244
+ SacBaseDateTimeControl.prototype.getPickerHeight = function () {
7245
+ return this.popupHelper.getPopupHeight(this.pickercontainer);
7246
+ };
7247
+ /**
7248
+ * Calculates the width of the picker
7249
+ */
7250
+ SacBaseDateTimeControl.prototype.getPickerWidth = function () {
7251
+ return this.popupHelper.getPopupWidth(this.pickercontainer);
7252
+ };
7253
+ SacBaseDateTimeControl.prototype.ngDoCheck = function () {
7254
+ // this.onContentChange();
7255
+ };
7256
+ SacBaseDateTimeControl.prototype.ngOnDestroy = function () {
7257
+ // Unregister Event Listener
7258
+ window.removeEventListener('scroll', this.onContentChange, true);
7259
+ window.removeEventListener('resize', this.onContentChange, true);
6689
7260
  };
6690
7261
  /**
6691
7262
  * Init Event
6692
7263
  */
6693
- SacBaseDateTimeControl.prototype.ngAfterViewInit = function () {
6694
- _super.prototype.ngAfterViewInit.call(this);
6695
- this.SetDateTimeFormat();
7264
+ SacBaseDateTimeControl.prototype.ngOnInit = function () {
7265
+ _super.prototype.ngOnInit.call(this);
7266
+ this.setDateTimeFormat();
7267
+ // Register Event Listener
7268
+ window.addEventListener('scroll', this.onContentChange, true);
7269
+ window.addEventListener('resize', this.onContentChange, true);
6696
7270
  };
6697
7271
  /**
6698
7272
  * setzt das value von typ string zu property valuestring
@@ -6726,13 +7300,59 @@
6726
7300
  }
6727
7301
  _super.prototype.writeValue.call(this, this._value);
6728
7302
  };
6729
- // #endregion Public Abstract Methods
6730
- // #region Private Methods
6731
- SacBaseDateTimeControl.prototype.SetDateTimeFormat = function () {
7303
+ // #endregion Public Methods
7304
+ // #region Protected Methods
7305
+ SacBaseDateTimeControl.prototype.getArrowHeight = function () {
7306
+ return this.pickerarrow ? this.pickerarrow.nativeElement.offsetHeight : 0;
7307
+ };
7308
+ SacBaseDateTimeControl.prototype.getArrowWidth = function () {
7309
+ return this.pickerarrow ? this.pickerarrow.nativeElement.offsetWidth : 0;
7310
+ };
7311
+ /**
7312
+ * Calculates the position of the tooltip from links
7313
+ */
7314
+ SacBaseDateTimeControl.prototype.getPositionLeft = function () {
7315
+ var value = this.popupHelper.getPositionLeft(this.pickerbutton, this.pickercontainer, this.elementRef, this.getArrowWidth(), this.getArrowHeight(), this.position, false);
7316
+ this.posPopupLeft = value;
7317
+ switch (this.GetPickerPosition()) {
7318
+ case exports.TooltipPosition.top:
7319
+ case exports.TooltipPosition.bottom:
7320
+ this.posArrowLeft = this.getPickerWidth() / 2 - -this.getArrowWidth();
7321
+ break;
7322
+ case exports.TooltipPosition.topend:
7323
+ case exports.TooltipPosition.bottomend:
7324
+ this.posArrowLeft =
7325
+ this.getPickerWidth() -
7326
+ this.getArrowWidth() / 2 -
7327
+ this.popupHelper.getContainerWidth(this.pickerbutton, false) / 2;
7328
+ break;
7329
+ default:
7330
+ this.posArrowLeft = null;
7331
+ break;
7332
+ }
7333
+ return value;
7334
+ };
7335
+ /**
7336
+ * Calculates the position of the tooltip from the top
7337
+ */
7338
+ SacBaseDateTimeControl.prototype.getPositionTop = function () {
7339
+ var value = this.popupHelper.getPositionTop(this.pickerbutton, this.pickercontainer, this.elementRef, this.getArrowWidth(), this.getArrowHeight(), this.position, false);
7340
+ this.posPopupTop = value;
7341
+ switch (this.GetPickerPosition()) {
7342
+ case exports.TooltipPosition.left:
7343
+ case exports.TooltipPosition.right:
7344
+ this.posArrowTop = this.getPickerHeight() / 2 - 6.5;
7345
+ break;
7346
+ default:
7347
+ this.posArrowTop = null;
7348
+ break;
7349
+ }
7350
+ return value;
7351
+ };
7352
+ SacBaseDateTimeControl.prototype.setDateTimeFormat = function () {
6732
7353
  // HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
6733
7354
  if (this.ngControl) {
6734
- this.ngControl.datetimeformatstring =
6735
- this.GetDateTimeFormatString();
7355
+ this.ngControl.datetimeformatstring = this.GetDateTimeFormatString();
6736
7356
  }
6737
7357
  };
6738
7358
  return SacBaseDateTimeControl;
@@ -6743,22 +7363,23 @@
6743
7363
  SacBaseDateTimeControl.ctorParameters = function () { return [
6744
7364
  { type: SacFormLayoutCommon },
6745
7365
  { type: i0.Injector },
6746
- { type: i0.ElementRef }
7366
+ { type: i0.ElementRef },
7367
+ { type: i0.ChangeDetectorRef }
6747
7368
  ]; };
6748
7369
  SacBaseDateTimeControl.propDecorators = {
6749
7370
  isrequired: [{ type: i0.Input }],
7371
+ pickerarrow: [{ type: i0.ViewChild, args: ['pickerarrow', { static: false },] }],
7372
+ pickerbutton: [{ type: i0.ViewChild, args: ['pickerbutton', { static: true },] }],
6750
7373
  placeholder: [{ type: i0.Input }],
7374
+ position: [{ type: i0.Input }],
6751
7375
  validationmessagedatetimeformat: [{ type: i0.Input }],
6752
7376
  validationmessagedatetimeformatsummary: [{ type: i0.Input }],
6753
7377
  validationmessagerequired: [{ type: i0.Input }],
6754
7378
  validationmessagerequiredsummary: [{ type: i0.Input }],
7379
+ picker: [{ type: i0.ViewChild, args: ['picker', { static: false },] }],
6755
7380
  valuestring: [{ type: i0.Input }]
6756
7381
  };
6757
7382
 
6758
- /**
6759
- * Moment
6760
- */
6761
- var moment$3 = moment___default['default'];
6762
7383
  /**
6763
7384
  * Komponente für SacDateCommon. Extends SacBaseDateTimeControl
6764
7385
  */
@@ -6771,9 +7392,10 @@
6771
7392
  * @param formlayout SacFormLayoutCommon to define scoped layout settings
6772
7393
  * @param injector Injector for injecting services
6773
7394
  * @param elementRef reference to html element
7395
+ * @param cdRef Change Dectection Servie
6774
7396
  */
6775
- function SacDateCommon(formlayout, injector, elementRef) {
6776
- var _this = _super.call(this, formlayout, injector, elementRef) || this;
7397
+ function SacDateCommon(formlayout, injector, elementRef, cdRef) {
7398
+ var _this = _super.call(this, formlayout, injector, elementRef, cdRef) || this;
6777
7399
  _this.elementRef = elementRef;
6778
7400
  // #region Properties
6779
7401
  /**
@@ -6809,6 +7431,18 @@
6809
7431
  lazy: false,
6810
7432
  overwrite: true,
6811
7433
  };
7434
+ /**
7435
+ * Min Date
7436
+ */
7437
+ _this._maxdate = null;
7438
+ /**
7439
+ * Min Date
7440
+ */
7441
+ _this._mindate = null;
7442
+ /**
7443
+ * Moment JS module instance
7444
+ */
7445
+ _this.moment = moment___default['default'];
6812
7446
  /**
6813
7447
  * Resource Key für Validation Message MaxDate bei Control
6814
7448
  */
@@ -6825,28 +7459,26 @@
6825
7459
  * Resource Key für Validation Message MinDate in Validation Summary
6826
7460
  */
6827
7461
  _this.validationmessagesummarymindate = _this.validationKeyService.ValidationErrorSummaryMinDate;
6828
- /**
6829
- * Min Date
6830
- */
6831
- _this._maxdate = null;
6832
- /**
6833
- * Min Date
6834
- */
6835
- _this._mindate = null;
6836
- /**
6837
- * Definiert ob der Date Selector angezeigt wird
6838
- */
6839
- _this._showselector = false;
6840
7462
  return _this;
6841
7463
  }
6842
- Object.defineProperty(SacDateCommon.prototype, "maxdate", {
7464
+ Object.defineProperty(SacDateCommon.prototype, "IconSelector", {
6843
7465
  // #endregion Constructors
6844
7466
  // #region Public Getters And Setters
7467
+ /**
7468
+ * icon for date selector button
7469
+ */
7470
+ get: function () {
7471
+ return this.iconService.DateComponentSelectorIcon;
7472
+ },
7473
+ enumerable: false,
7474
+ configurable: true
7475
+ });
7476
+ Object.defineProperty(SacDateCommon.prototype, "maxdate", {
6845
7477
  /**
6846
7478
  * Min Date
6847
7479
  */
6848
7480
  set: function (v) {
6849
- var date = moment$3(v, [this.DATEFORMAT], true);
7481
+ var date = this.moment(v, [this.DATEFORMAT], true);
6850
7482
  if (date.isValid()) {
6851
7483
  this._maxdate = _super.prototype.getDate.call(this, date).toDate();
6852
7484
  }
@@ -6862,7 +7494,7 @@
6862
7494
  * Min Date
6863
7495
  */
6864
7496
  set: function (v) {
6865
- var date = moment$3(v, [this.DATEFORMAT], true);
7497
+ var date = this.moment(v, [this.DATEFORMAT], true);
6866
7498
  if (date.isValid()) {
6867
7499
  this._mindate = _super.prototype.getDate.call(this, date).toDate();
6868
7500
  }
@@ -6873,27 +7505,8 @@
6873
7505
  enumerable: false,
6874
7506
  configurable: true
6875
7507
  });
6876
- Object.defineProperty(SacDateCommon.prototype, "IconSelector", {
6877
- /**
6878
- * icon for date selector button
6879
- */
6880
- get: function () {
6881
- return this.iconService.DateComponentSelectorIcon;
6882
- },
6883
- enumerable: false,
6884
- configurable: true
6885
- });
6886
7508
  // #endregion Public Getters And Setters
6887
7509
  // #region Public Methods
6888
- /**
6889
- * HostListener
6890
- */
6891
- SacDateCommon.prototype.onClick = function (targetElement) {
6892
- var clickedInside = this.elementRef.nativeElement.contains(targetElement);
6893
- if (!clickedInside) {
6894
- this._showselector = false;
6895
- }
6896
- };
6897
7510
  /**
6898
7511
  * Methode ergibt Datum-Format vom String
6899
7512
  */
@@ -6914,10 +7527,23 @@
6914
7527
  this.setValueString('');
6915
7528
  }
6916
7529
  else {
6917
- this.value = moment$3(v.date).utc().toDate();
7530
+ this.value = this.moment(v.date).utc().toDate();
6918
7531
  }
6919
7532
  this._showselector = false;
6920
7533
  };
7534
+ /**
7535
+ * HostListener
7536
+ */
7537
+ SacDateCommon.prototype.onClick = function (targetElement) {
7538
+ if (!this.pickercontainer) {
7539
+ return;
7540
+ }
7541
+ var clickedInsideContainer = this.pickercontainer.nativeElement.contains(targetElement);
7542
+ var clickedInsideReference = this.pickerbutton.nativeElement.contains(targetElement);
7543
+ if (!clickedInsideContainer && !clickedInsideReference) {
7544
+ this._showselector = false;
7545
+ }
7546
+ };
6921
7547
  /**
6922
7548
  * Zeigt Date Selector an
6923
7549
  */
@@ -6963,7 +7589,8 @@
6963
7589
  SacDateCommon.ctorParameters = function () { return [
6964
7590
  { type: SacFormLayoutCommon },
6965
7591
  { type: i0.Injector },
6966
- { type: i0.ElementRef }
7592
+ { type: i0.ElementRef },
7593
+ { type: i0.ChangeDetectorRef }
6967
7594
  ]; };
6968
7595
  SacDateCommon.propDecorators = {
6969
7596
  validationmessagemaxdate: [{ type: i0.Input }],
@@ -7101,11 +7728,11 @@
7101
7728
  this._initialValue = null;
7102
7729
  }
7103
7730
  else {
7104
- this._initialValue = moment$4(v);
7731
+ this._initialValue = moment$2(v);
7105
7732
  }
7106
7733
  this._selectedValue = null;
7107
7734
  if (this._initialValue === null) {
7108
- this.initCalendar(moment$4());
7735
+ this.initCalendar(moment$2());
7109
7736
  }
7110
7737
  else {
7111
7738
  this.initCalendar(this._initialValue);
@@ -7242,7 +7869,7 @@
7242
7869
  .forEach(function (itm) { return (itm.isselected = false); }); });
7243
7870
  v.isnew = true;
7244
7871
  v.isselected = true;
7245
- var dateValue = moment$4(v.date);
7872
+ var dateValue = moment$2(v.date);
7246
7873
  // Übernehmen der Zeit aus dem bestehenden Wert
7247
7874
  if (this._selectedValue === null) {
7248
7875
  if (this._initialValue !== null) {
@@ -7297,7 +7924,7 @@
7297
7924
  * Auswahl auf aktuelle Zeit stellen
7298
7925
  */
7299
7926
  SacDateSelectorCommon.prototype.setToday = function () {
7300
- this._selectedValue = moment$4();
7927
+ this._selectedValue = moment$2();
7301
7928
  /**
7302
7929
  * Sekunden un Milisekunden Clean
7303
7930
  */
@@ -7333,20 +7960,20 @@
7333
7960
  * Initial Datum
7334
7961
  */
7335
7962
  SacDateSelectorCommon.prototype.initDates = function () {
7336
- var currentMonth = moment$4(new Date(this.year, this.month, 1));
7337
- var lastMonth = moment$4(new Date(this.year, this.month, 1));
7963
+ var currentMonth = moment$2(new Date(this.year, this.month, 1));
7964
+ var lastMonth = moment$2(new Date(this.year, this.month, 1));
7338
7965
  lastMonth.add({ months: -1 });
7339
- var nextMonths = moment$4(new Date(this.year, this.month, 1));
7966
+ var nextMonths = moment$2(new Date(this.year, this.month, 1));
7340
7967
  nextMonths.add({ months: 1 });
7341
7968
  var weekdayBegin = currentMonth.weekday();
7342
- var weekdayEnd = moment$4(new Date(currentMonth.year(), currentMonth.month(), currentMonth.daysInMonth())).weekday();
7969
+ var weekdayEnd = moment$2(new Date(currentMonth.year(), currentMonth.month(), currentMonth.daysInMonth())).weekday();
7343
7970
  // Clear Array
7344
7971
  var daysInCalendar = [];
7345
7972
  this.dates = [];
7346
7973
  if (weekdayBegin !== this.beginOfCalendar) {
7347
7974
  var lastMonthDay = lastMonth.daysInMonth();
7348
7975
  var lastMonthDate = new Date(lastMonth.year(), lastMonth.month(), lastMonthDay);
7349
- var lastMonthWeekday = moment$4(lastMonthDate).weekday();
7976
+ var lastMonthWeekday = moment$2(lastMonthDate).weekday();
7350
7977
  var daysInLastMonth = 7 - ((7 + this.beginOfCalendar - lastMonthWeekday) % 7);
7351
7978
  if (daysInLastMonth === 7) {
7352
7979
  daysInLastMonth = 0;
@@ -7359,9 +7986,9 @@
7359
7986
  for (var dayinmonth = 1; dayinmonth <= currentMonth.daysInMonth(); dayinmonth++) {
7360
7987
  var isSelectedDate = false;
7361
7988
  var isNewDate = false;
7362
- var isCurrentDate = moment$4().month() === this.month &&
7363
- moment$4().year() === this.year &&
7364
- moment$4().date() === dayinmonth;
7989
+ var isCurrentDate = moment$2().month() === this.month &&
7990
+ moment$2().year() === this.year &&
7991
+ moment$2().date() === dayinmonth;
7365
7992
  // Initial Wert setzen, falls vorhanden
7366
7993
  if (this._initialValue !== null) {
7367
7994
  isSelectedDate =
@@ -7376,7 +8003,7 @@
7376
8003
  this._selectedValue.year() === this.year &&
7377
8004
  this._selectedValue.date() === dayinmonth;
7378
8005
  }
7379
- daysInCalendar.push(new DateSelectorItem(dayinmonth.toString(), moment$4([this.year, this.month, dayinmonth]).toDate(), true, isSelectedDate, isCurrentDate, isNewDate));
8006
+ daysInCalendar.push(new DateSelectorItem(dayinmonth.toString(), moment$2([this.year, this.month, dayinmonth]).toDate(), true, isSelectedDate, isCurrentDate, isNewDate));
7380
8007
  }
7381
8008
  var endOfCalender;
7382
8009
  if (this.beginOfCalendar === 0) {
@@ -7412,7 +8039,7 @@
7412
8039
  */
7413
8040
  if (this._selectedValue === null) {
7414
8041
  if (this._initialValue === null) {
7415
- this._selectedValue = moment$4();
8042
+ this._selectedValue = moment$2();
7416
8043
  }
7417
8044
  else {
7418
8045
  this._selectedValue = this._initialValue;
@@ -7441,13 +8068,9 @@
7441
8068
  /**
7442
8069
  * Moment
7443
8070
  */
7444
- var moment$4 = moment___default['default'];
8071
+ var moment$2 = moment___default['default'];
7445
8072
  // #endregion Variables
7446
8073
 
7447
- /**
7448
- * Moment
7449
- */
7450
- var moment$5 = moment___default['default'];
7451
8074
  /**
7452
8075
  * Komponente für SacDateTimeCommon. Extends SacBaseDateTimeControl
7453
8076
  */
@@ -7461,8 +8084,8 @@
7461
8084
  * @param injector Injector for injecting services
7462
8085
  * @param elementRef reference to html element
7463
8086
  */
7464
- function SacDateTimeCommon(formlayout, injector, elementRef) {
7465
- var _this = _super.call(this, formlayout, injector, elementRef) || this;
8087
+ function SacDateTimeCommon(formlayout, injector, elementRef, cdRef) {
8088
+ var _this = _super.call(this, formlayout, injector, elementRef, cdRef) || this;
7466
8089
  _this.elementRef = elementRef;
7467
8090
  // #region Properties
7468
8091
  /**
@@ -7513,6 +8136,18 @@
7513
8136
  lazy: false,
7514
8137
  overwrite: true,
7515
8138
  };
8139
+ /**
8140
+ * Maximaler Wert des Datums
8141
+ */
8142
+ _this._maxdate = null;
8143
+ /**
8144
+ * Minimaler Wert des Datums
8145
+ */
8146
+ _this._mindate = null;
8147
+ /**
8148
+ * Moment JS module instance
8149
+ */
8150
+ _this.moment = moment___default['default'];
7516
8151
  /**
7517
8152
  * Resource Key für Validation Message MaxDate bei Control
7518
8153
  */
@@ -7529,28 +8164,26 @@
7529
8164
  * Resource Key für Validation Message MinDate in Validation Summary
7530
8165
  */
7531
8166
  _this.validationmessagesummarymindate = _this.validationKeyService.ValidationErrorSummaryMinDate;
7532
- /**
7533
- * Maximaler Wert des Datums
7534
- */
7535
- _this._maxdate = null;
7536
- /**
7537
- * Minimaler Wert des Datums
7538
- */
7539
- _this._mindate = null;
7540
- /**
7541
- * Definiert ob der Date Selector angezeigt wird
7542
- */
7543
- _this._showselector = false;
7544
8167
  return _this;
7545
8168
  }
7546
- Object.defineProperty(SacDateTimeCommon.prototype, "maxdate", {
8169
+ Object.defineProperty(SacDateTimeCommon.prototype, "IconSelector", {
7547
8170
  // #endregion Constructors
7548
8171
  // #region Public Getters And Setters
8172
+ /**
8173
+ * icon for date selector button
8174
+ */
8175
+ get: function () {
8176
+ return this.iconService.DateTimeComponentSelectorIcon;
8177
+ },
8178
+ enumerable: false,
8179
+ configurable: true
8180
+ });
8181
+ Object.defineProperty(SacDateTimeCommon.prototype, "maxdate", {
7549
8182
  /**
7550
8183
  * Max Date
7551
8184
  */
7552
8185
  set: function (v) {
7553
- var date = moment$5(v, [this.DATEFORMAT], true);
8186
+ var date = this.moment(v, [this.DATEFORMAT], true);
7554
8187
  if (date.isValid()) {
7555
8188
  this._maxdate = _super.prototype.getDate.call(this, date).toDate();
7556
8189
  }
@@ -7566,7 +8199,7 @@
7566
8199
  * Min Date
7567
8200
  */
7568
8201
  set: function (v) {
7569
- var date = moment$5(v, [this.DATEFORMAT], true);
8202
+ var date = this.moment(v, [this.DATEFORMAT], true);
7570
8203
  if (date.isValid()) {
7571
8204
  this._mindate = _super.prototype.getDate.call(this, date).toDate();
7572
8205
  }
@@ -7577,27 +8210,8 @@
7577
8210
  enumerable: false,
7578
8211
  configurable: true
7579
8212
  });
7580
- Object.defineProperty(SacDateTimeCommon.prototype, "IconSelector", {
7581
- /**
7582
- * icon for date selector button
7583
- */
7584
- get: function () {
7585
- return this.iconService.DateTimeComponentSelectorIcon;
7586
- },
7587
- enumerable: false,
7588
- configurable: true
7589
- });
7590
8213
  // #endregion Public Getters And Setters
7591
8214
  // #region Public Methods
7592
- /**
7593
- * HostListener
7594
- */
7595
- SacDateTimeCommon.prototype.onClick = function (targetElement) {
7596
- var clickedInside = this.elementRef.nativeElement.contains(targetElement);
7597
- if (!clickedInside) {
7598
- this._showselector = false;
7599
- }
7600
- };
7601
8215
  /**
7602
8216
  * Methode ergibt Datum-Format vom String
7603
8217
  */
@@ -7618,10 +8232,23 @@
7618
8232
  this.setValueString('');
7619
8233
  }
7620
8234
  else {
7621
- this.value = moment$5(v.date).utc().toDate();
8235
+ this.value = this.moment(v.date).utc().toDate();
7622
8236
  }
7623
8237
  this._showselector = false;
7624
8238
  };
8239
+ /**
8240
+ * HostListener
8241
+ */
8242
+ SacDateTimeCommon.prototype.onClick = function (targetElement) {
8243
+ if (!this.pickercontainer) {
8244
+ return;
8245
+ }
8246
+ var clickedInsideContainer = this.pickercontainer.nativeElement.contains(targetElement);
8247
+ var clickedInsideReference = this.pickerbutton.nativeElement.contains(targetElement);
8248
+ if (!clickedInsideContainer && !clickedInsideReference) {
8249
+ this._showselector = false;
8250
+ }
8251
+ };
7625
8252
  /**
7626
8253
  * DateSelector wird beim Click-Event angezeigt
7627
8254
  */
@@ -7669,7 +8296,8 @@
7669
8296
  SacDateTimeCommon.ctorParameters = function () { return [
7670
8297
  { type: SacFormLayoutCommon },
7671
8298
  { type: i0.Injector },
7672
- { type: i0.ElementRef }
8299
+ { type: i0.ElementRef },
8300
+ { type: i0.ChangeDetectorRef }
7673
8301
  ]; };
7674
8302
  SacDateTimeCommon.propDecorators = {
7675
8303
  validationmessagemaxdate: [{ type: i0.Input }],
@@ -7681,10 +8309,6 @@
7681
8309
  onClick: [{ type: i0.HostListener, args: ['document:click', ['$event.target'],] }]
7682
8310
  };
7683
8311
 
7684
- /**
7685
- * Moment
7686
- */
7687
- var moment$6 = moment___default['default'];
7688
8312
  /**
7689
8313
  * Komponente für SacTimeCommon. Extends SacBaseDateTimeControl
7690
8314
  */
@@ -7698,8 +8322,8 @@
7698
8322
  * @param injector Injector for injecting services
7699
8323
  * @param elementRef reference to html element
7700
8324
  */
7701
- function SacTimeCommon(formlayout, injector, elementRef) {
7702
- var _this = _super.call(this, formlayout, injector, elementRef) || this;
8325
+ function SacTimeCommon(formlayout, injector, elementRef, cdRef) {
8326
+ var _this = _super.call(this, formlayout, injector, elementRef, cdRef) || this;
7703
8327
  _this.elementRef = elementRef;
7704
8328
  // #region Properties
7705
8329
  /**
@@ -7730,6 +8354,18 @@
7730
8354
  lazy: false,
7731
8355
  overwrite: true,
7732
8356
  };
8357
+ /**
8358
+ * Max Time
8359
+ */
8360
+ _this._maxtime = null;
8361
+ /**
8362
+ * Min Time
8363
+ */
8364
+ _this._mintime = null;
8365
+ /**
8366
+ * Moment JS module instance
8367
+ */
8368
+ _this.moment = moment___default['default'];
7733
8369
  /**
7734
8370
  * Resource Key für Validation Message MinTime bei Control
7735
8371
  */
@@ -7746,28 +8382,26 @@
7746
8382
  * Resource Key für Validation Message MinTime in Validation Summary
7747
8383
  */
7748
8384
  _this.validationmessagesummarymintime = _this.validationKeyService.ValidationErrorSummaryMinTime;
7749
- /**
7750
- * Max Time
7751
- */
7752
- _this._maxtime = null;
7753
- /**
7754
- * Min Time
7755
- */
7756
- _this._mintime = null;
7757
- /**
7758
- * Definiert ob der Date Selector angezeigt wird
7759
- */
7760
- _this._showselector = false;
7761
8385
  return _this;
7762
8386
  }
7763
- Object.defineProperty(SacTimeCommon.prototype, "maxtime", {
8387
+ Object.defineProperty(SacTimeCommon.prototype, "IconSelector", {
7764
8388
  // #endregion Constructors
7765
8389
  // #region Public Getters And Setters
8390
+ /**
8391
+ * icon for date selector button
8392
+ */
8393
+ get: function () {
8394
+ return this.iconService.TimeComponentSelectorIcon;
8395
+ },
8396
+ enumerable: false,
8397
+ configurable: true
8398
+ });
8399
+ Object.defineProperty(SacTimeCommon.prototype, "maxtime", {
7766
8400
  /**
7767
8401
  * Max Time
7768
8402
  */
7769
8403
  set: function (v) {
7770
- var time = moment$6(v, [this.TIMEFORMAT], true);
8404
+ var time = this.moment(v, [this.TIMEFORMAT], true);
7771
8405
  time = this.ModifyParsedDateTimeValue(time);
7772
8406
  if (time.isValid()) {
7773
8407
  this._maxtime = _super.prototype.getDate.call(this, time).toDate();
@@ -7784,7 +8418,7 @@
7784
8418
  * Min Time
7785
8419
  */
7786
8420
  set: function (v) {
7787
- var time = moment$6(v, [this.TIMEFORMAT], true);
8421
+ var time = this.moment(v, [this.TIMEFORMAT], true);
7788
8422
  time = this.ModifyParsedDateTimeValue(time);
7789
8423
  if (time.isValid()) {
7790
8424
  this._mintime = _super.prototype.getDate.call(this, time).toDate();
@@ -7796,27 +8430,8 @@
7796
8430
  enumerable: false,
7797
8431
  configurable: true
7798
8432
  });
7799
- Object.defineProperty(SacTimeCommon.prototype, "IconSelector", {
7800
- /**
7801
- * icon for date selector button
7802
- */
7803
- get: function () {
7804
- return this.iconService.TimeComponentSelectorIcon;
7805
- },
7806
- enumerable: false,
7807
- configurable: true
7808
- });
7809
- // #endregion Public Getters And Setters
7810
- // #region Public Methods
7811
- /**
7812
- * HostListener
7813
- */
7814
- SacTimeCommon.prototype.onClick = function (targetElement) {
7815
- var clickedInside = this.elementRef.nativeElement.contains(targetElement);
7816
- if (!clickedInside) {
7817
- this._showselector = false;
7818
- }
7819
- };
8433
+ // #endregion Public Getters And Setters
8434
+ // #region Public Methods
7820
8435
  /**
7821
8436
  * Methode ergibt Datum-Format vom String
7822
8437
  */
@@ -7832,6 +8447,19 @@
7832
8447
  v.year(1900);
7833
8448
  return v;
7834
8449
  };
8450
+ /**
8451
+ * HostListener
8452
+ */
8453
+ SacTimeCommon.prototype.onClick = function (targetElement) {
8454
+ if (!this.pickercontainer) {
8455
+ return;
8456
+ }
8457
+ var clickedInsideContainer = this.pickercontainer.nativeElement.contains(targetElement);
8458
+ var clickedInsideReference = this.pickerbutton.nativeElement.contains(targetElement);
8459
+ if (!clickedInsideContainer && !clickedInsideReference) {
8460
+ this._showselector = false;
8461
+ }
8462
+ };
7835
8463
  /**
7836
8464
  * Zeigt Date Selector an
7837
8465
  */
@@ -7853,7 +8481,7 @@
7853
8481
  this.setValueString('');
7854
8482
  }
7855
8483
  else {
7856
- this.value = moment$6(v.date).utc().toDate();
8484
+ this.value = this.moment(v.date).utc().toDate();
7857
8485
  }
7858
8486
  this._showselector = false;
7859
8487
  };
@@ -7889,7 +8517,8 @@
7889
8517
  SacTimeCommon.ctorParameters = function () { return [
7890
8518
  { type: SacFormLayoutCommon },
7891
8519
  { type: i0.Injector },
7892
- { type: i0.ElementRef }
8520
+ { type: i0.ElementRef },
8521
+ { type: i0.ChangeDetectorRef }
7893
8522
  ]; };
7894
8523
  SacTimeCommon.propDecorators = {
7895
8524
  validationmessagemaxtime: [{ type: i0.Input }],
@@ -7912,18 +8541,26 @@
7912
8541
  * Definiert den Container als Required Form Item
7913
8542
  */
7914
8543
  _this._isrequired = false;
8544
+ /**
8545
+ * Error message to be displayed
8546
+ */
8547
+ _this.errormessage = '';
8548
+ /**
8549
+ * Activates the error message on the container control
8550
+ */
8551
+ _this.isinvalid = false;
7915
8552
  return _this;
7916
8553
  // #endregion Public Methods
7917
8554
  }
7918
8555
  Object.defineProperty(SacStaticFormContainerCommon.prototype, "isrequired", {
8556
+ // #endregion Properties
8557
+ // #region Public Getters And Setters
7919
8558
  /**
7920
8559
  * Definiert den Container als Required Form Item
7921
8560
  */
7922
8561
  get: function () {
7923
8562
  return this._isrequired;
7924
8563
  },
7925
- // #endregion Properties
7926
- // #region Public Getters And Setters
7927
8564
  /**
7928
8565
  * Definiert den Container als Required Form Item
7929
8566
  */
@@ -7952,6 +8589,8 @@
7952
8589
  { type: i0.Directive }
7953
8590
  ];
7954
8591
  SacStaticFormContainerCommon.propDecorators = {
8592
+ errormessage: [{ type: i0.Input }],
8593
+ isinvalid: [{ type: i0.Input }],
7955
8594
  isrequired: [{ type: i0.Input }]
7956
8595
  };
7957
8596
 
@@ -8411,456 +9050,329 @@
8411
9050
  };
8412
9051
 
8413
9052
  /**
8414
- *Basis Komponente für SacTreeItemAction
9053
+ * Basis Komponente für SacTreeView
8415
9054
  */
8416
- var SacTreeItemActionCommon = /** @class */ (function () {
8417
- /**
8418
- * Konstruktor
8419
- * @param el Element Referenz
8420
- */
8421
- function SacTreeItemActionCommon(el) {
8422
- this.el = el;
8423
- /**
8424
- * Event wenn auf das Icon geclickt wird
8425
- */
8426
- this.clicked = new i0.EventEmitter();
8427
- }
8428
- /**
8429
- * lifecycle OnInit hook. Wird aufgeruren sobald das Komponent initialisiert ist.
8430
- */
8431
- SacTreeItemActionCommon.prototype.ngOnInit = function () {
8432
- var rootElement = this.el.nativeElement;
8433
- var parentElement = rootElement.parentElement;
8434
- while (rootElement.firstChild) {
8435
- parentElement.insertBefore(rootElement.firstChild, rootElement);
8436
- }
8437
- parentElement.removeChild(rootElement);
8438
- };
8439
- /**
8440
- * Die Methode erstellt die CSS Klasse des Icon. Akzeptiert ein Key-word und baut ein vollständige CSS Klasse.
8441
- */
8442
- SacTreeItemActionCommon.prototype.transformClass = function (initialClass) {
8443
- switch (initialClass) {
8444
- case 'add':
8445
- return 'jstree-icon icon icon-base-add jstree-add';
8446
- case 'delete':
8447
- return 'jstree-icon icon icon-base-delete jstree-delete';
8448
- default:
8449
- return initialClass;
8450
- }
8451
- };
9055
+ var SacTreeviewCommon = /** @class */ (function (_super) {
9056
+ __extends(SacTreeviewCommon, _super);
9057
+ // #endregion Properties
9058
+ // #region Constructors
8452
9059
  /**
8453
- * Die Methode wird das cklickaction Emitter aktivieren.
9060
+ * Constructor
9061
+ * @param injector Service Injector
8454
9062
  */
8455
- SacTreeItemActionCommon.prototype.iconaction = function () {
8456
- this.clicked.emit();
8457
- };
8458
- return SacTreeItemActionCommon;
8459
- }());
8460
- SacTreeItemActionCommon.decorators = [
8461
- { type: i0.Directive }
8462
- ];
8463
- SacTreeItemActionCommon.ctorParameters = function () { return [
8464
- { type: i0.ElementRef }
8465
- ]; };
8466
- SacTreeItemActionCommon.propDecorators = {
8467
- item: [{ type: i0.Input }],
8468
- title: [{ type: i0.Input }],
8469
- iconstyle: [{ type: i0.Input }],
8470
- clicked: [{ type: i0.Output }]
8471
- };
8472
-
8473
- /**
8474
- * Basis Komponente für SacTreeView
8475
- */
8476
- var SacTreeViewCommon = /** @class */ (function () {
8477
- function SacTreeViewCommon() {
9063
+ function SacTreeviewCommon(formlayout, injector) {
9064
+ var _this = _super.call(this, formlayout, injector) || this;
9065
+ // #region Properties
8478
9066
  /**
8479
- * Das Property enthielt array of nodes. Default value: empty array [].
9067
+ * Event when Action is clicked on Node. An object of the type 'TreeviewAction' is returned. In the default case, 'action' in this object is always the value 'default'. The value can be changed via the 'templateaction'.
8480
9068
  */
8481
- this.nodes = [];
9069
+ _this.actionclicked = new i0.EventEmitter();
8482
9070
  /**
8483
- * Das Property enthielt node attribute: 'isCollapsed'. Es wird benutzt beim rendering. Für Expand/Collapsed Sicht des Node(Wert)
9071
+ * Property on the data object that contains the children of the structure element. Must be an array of objects. The default value is 'children'
8484
9072
  */
8485
- this.collapseAttr = 'isCollapsed';
9073
+ _this.attrchildren = 'children';
8486
9074
  /**
8487
- * Das Property enthielt node attribute: 'isSelected'. Es wird benutzt beim Vorbereitung des Data des TreeView
9075
+ * Defines the property on the 'data' object with which the actions for a node can be deactivated. A 'disabled' property is used by default.
8488
9076
  */
8489
- this.selectAttr = 'isSelected';
9077
+ _this.attrdisableaction = 'disabled';
8490
9078
  /**
8491
- * Das Property enthielt node attribute: 'isIndeterminate'. Es wird benutzt beim Vorbereitung des Data des TreeView
9079
+ * Property on the 'data' object that stores the expanded state. Property must be of type boolean. Default is 'expanded'
8492
9080
  */
8493
- this.inDeterminateAttr = 'isIndeterminate';
9081
+ _this.attrexanded = 'expanded';
8494
9082
  /**
8495
- * Providen data for tree.
9083
+ * Property for saving the HoverState on the field. If the property is not present on the node, it is automatically created and removed again. The value can usually be left at the default value unless there is a conflict with a property on the node that is required for other purposes.
8496
9084
  */
8497
- this._data = [];
9085
+ _this.attrhoverstate = 'hoverstate';
8498
9086
  /**
8499
- * Input property für den Namen des TreeView. Type string. Default value: ""
9087
+ * Property on 'data' object, which contains the icon for the node. By default, the property is not set, which hides the icon in the node.
8500
9088
  */
8501
- this.name = '';
9089
+ _this.attricon = null;
8502
9090
  /**
8503
- * A flag indicating data is flatten in array and prepare is required.(Default
8504
- * is false).
9091
+ * property on the 'data' object contains an ID of the node. The default is 'id'. If the property is set to NULL, the selectedId event is no longer triggered.
8505
9092
  */
8506
- this.prepareData = false;
9093
+ _this.attrid = 'id';
8507
9094
  /**
8508
- * Attribute for Text in Tree
9095
+ * Property on 'data' object, which contains the label for the node. Default is 'label'
8509
9096
  */
8510
- this.textAttr = 'data';
9097
+ _this.attrlabel = 'label';
8511
9098
  /**
8512
- * Name of ID property in input data.
9099
+ * Property on 'data' object, which defines whether the node is selected or not. It should be ensured that only 1 node has the value for Selected set to true. Default is 'selected'.
8513
9100
  */
8514
- this.idAttr = 'id';
9101
+ _this.attrselected = 'selected';
8515
9102
  /**
8516
- * Name of parent property in input data.
9103
+ * Event when a node is collapsed. Returns the node element as a parameter
8517
9104
  */
8518
- this.parentAttr = 'PARENT_ID';
9105
+ _this.collabsed = new i0.EventEmitter();
8519
9106
  /**
8520
- * Name of children list property in input data.
9107
+ * The property contains an array of nodes. The data must already map the tree via child properties.
8521
9108
  */
8522
- this.childrenAttr = 'children';
9109
+ _this.data = [];
8523
9110
  /**
8524
- * Output Emitter. Emit das ID des selected Node.
9111
+ * Activates the 'expand' and 'collabse' event even if a node has no children. This is helpful if node elements are to be reloaded at runtime.
8525
9112
  */
8526
- this.selectedidchange = new i0.EventEmitter();
9113
+ _this.enableasynchload = false;
8527
9114
  /**
8528
- * Output Emitter. Emit das TextAttr des selected Node.
9115
+ * Activates Ellipsis on the node labels
8529
9116
  */
8530
- this.selectedtextchanged = new i0.EventEmitter();
9117
+ _this.enableellipsis = true;
8531
9118
  /**
8532
- * Output Emitter. Emit wenn ein Node selektiert wird.
9119
+ * Event when a node is expanded. Returns the node element as a parameter
8533
9120
  */
8534
- this.selecteditem = new i0.EventEmitter();
8535
- }
8536
- Object.defineProperty(SacTreeViewCommon.prototype, "data", {
9121
+ _this.expanded = new i0.EventEmitter();
8537
9122
  /**
8538
- * Getter für Data des TreeView
9123
+ * Defines whether an icon for the expanded/collapsed status should be displayed.
8539
9124
  */
8540
- get: function () {
8541
- return this._data;
8542
- },
9125
+ _this.expandedstate = true;
8543
9126
  /**
8544
- * Input Property für Data des TreeView
9127
+ * A node must be selected
8545
9128
  */
8546
- set: function (value) {
8547
- this._data = value;
8548
- this.nodes = value;
8549
- // this.nodes.forEach(node => node["typeId"] = "13")
8550
- this.LoadTree();
8551
- if (this._collapseAll !== undefined) {
8552
- this.collapseAllNode(this._collapseAll);
8553
- }
8554
- },
8555
- enumerable: false,
8556
- configurable: true
8557
- });
8558
- Object.defineProperty(SacTreeViewCommon.prototype, "treeviewTemplate", {
9129
+ _this.isrequired = false;
8559
9130
  /**
8560
- * Getter für das TreeView Template
9131
+ * Name of the TreeView control
8561
9132
  */
8562
- get: function () {
8563
- return this.template;
8564
- },
9133
+ _this.name = '';
8565
9134
  /**
8566
- * Die Directive erhält die actions für das TreeView
9135
+ * Event when a node is selected. Returns the id attribute as a parameter. The event is not triggered if 'attrid' is not set.
8567
9136
  */
8568
- set: function (v) {
8569
- this.template = v;
8570
- },
8571
- enumerable: false,
8572
- configurable: true
8573
- });
8574
- Object.defineProperty(SacTreeViewCommon.prototype, "treefileicon", {
9137
+ _this.selected = new i0.EventEmitter();
8575
9138
  /**
8576
- * Getter property. Ergibt das FileIcon für das TreeView
9139
+ * Event when a node is selected. Returns the node element as a parameter.
8577
9140
  */
8578
- get: function () {
8579
- return this.fileicontemplate;
8580
- },
9141
+ _this.selectednode = new i0.EventEmitter();
8581
9142
  /**
8582
- * Setter property. Deffiniert das FileIcon für das TreeView
9143
+ * Resource Key für Validation Message Required bei Control
8583
9144
  */
8584
- set: function (v) {
8585
- this.fileicontemplate = v;
8586
- },
8587
- enumerable: false,
8588
- configurable: true
8589
- });
8590
- Object.defineProperty(SacTreeViewCommon.prototype, "collapseall", {
9145
+ _this.validationmessagerequired = _this.validationKeyService.ValidationErrorRequired;
8591
9146
  /**
8592
- * Getter für das collapse property. Ergibt boolean Wert, ob die Items collapsed/expand sind.
9147
+ * Resource Key für Validation Message Required in Validation Summary
8593
9148
  */
9149
+ _this.validationmessagesummaryrequired = _this.validationKeyService.ValidationErrorSummaryRequired;
9150
+ return _this;
9151
+ }
9152
+ Object.defineProperty(SacTreeviewCommon.prototype, "iconAction", {
9153
+ // #endregion Constructors
9154
+ // #region Public Getters And Setters
8594
9155
  get: function () {
8595
- return this._collapseAll;
8596
- },
8597
- // @Input("titleAction") _titleAction: string
8598
- /**
8599
- * Collapse or expand all parent nodes.
8600
- */
8601
- set: function (value) {
8602
- this._collapseAll = value;
8603
- if (this.nodes && this.nodes.length && this.nodes.length > 0) {
8604
- this.collapseAllNode(this._collapseAll);
8605
- }
8606
- // this._recursiveEdit(
8607
- // this.nodes, this.childrenAttr, this.collapseAttr, this._collapseAll);
8608
- // this.cd.detectChanges();
8609
- },
8610
- enumerable: false,
8611
- configurable: true
8612
- });
8613
- Object.defineProperty(SacTreeViewCommon.prototype, "selectall", {
8614
- /**
8615
- * Select or deselect all nodes.
8616
- */
8617
- set: function (value) {
8618
- this._selectAll = value;
8619
- this._recursiveEdit(this.nodes, this.childrenAttr, this.selectAttr, value);
8620
- this._recursiveEdit(this.nodes, this.childrenAttr, this.inDeterminateAttr, false);
9156
+ return this.iconService.TreeviewNodeActionIcon;
8621
9157
  },
8622
9158
  enumerable: false,
8623
9159
  configurable: true
8624
9160
  });
8625
- Object.defineProperty(SacTreeViewCommon.prototype, "selectedid", {
9161
+ Object.defineProperty(SacTreeviewCommon.prototype, "iconFolderCollabsed", {
8626
9162
  /**
8627
- * Input property - setter. Deffiniert das ID des selektierten Item(node)
9163
+ * CSS icon for folders in tree there are collabsed
9164
+ * @returns css class with icon
8628
9165
  */
8629
- set: function (v) {
8630
- this.selectedNode = this.findNode(this.nodes, v, this.idAttr);
8631
- // if (this.selectedNode) {
8632
- // this.selectedIdEmitter.emit(this.selectedNode[this.idAttr]);
8633
- // this.selectedTextEmitter.emit(this.selectedNode[this.textAttr]);
8634
- // }
9166
+ get: function () {
9167
+ return this.iconService.TreeviewNodeClosedIcon;
8635
9168
  },
8636
9169
  enumerable: false,
8637
9170
  configurable: true
8638
9171
  });
8639
- Object.defineProperty(SacTreeViewCommon.prototype, "selectedId", {
9172
+ Object.defineProperty(SacTreeviewCommon.prototype, "iconFolderEmpty", {
8640
9173
  /**
8641
- * Getter. Ergibt das ID des selektierten Item(node)
9174
+ * CSS icon class for folders without subfolders
9175
+ * @returns css class with icon
8642
9176
  */
8643
9177
  get: function () {
8644
- return this.selectedNode ? this.selectedNode[this.idAttr] : null;
9178
+ return this.iconService.TreeviewNodeEmptyIcon;
8645
9179
  },
8646
9180
  enumerable: false,
8647
9181
  configurable: true
8648
9182
  });
8649
- Object.defineProperty(SacTreeViewCommon.prototype, "selectedNode", {
9183
+ Object.defineProperty(SacTreeviewCommon.prototype, "iconFolderOpen", {
8650
9184
  /**
8651
- * Getter für das selektierte Wert(node). Ergibt das selektierte Wert(node).
9185
+ * CSS icon for folders in tree there are expanded
9186
+ * @returns css class with icon
8652
9187
  */
8653
9188
  get: function () {
8654
- return this._selectedNode;
8655
- },
8656
- /**
8657
- * Setter für das selektierte Wert(node). Wenn aufgerufen das ID und TextAttr des selected Node wird emitted
8658
- */
8659
- set: function (v) {
8660
- this._selectedNode = v;
8661
- if (this._selectedNode) {
8662
- this.selectedidchange.emit(this.selectedId);
8663
- this.selectedtextchanged.emit(v[this.textAttr]);
8664
- }
9189
+ return this.iconService.TreeviewNodeOpenIcon;
8665
9190
  },
8666
9191
  enumerable: false,
8667
9192
  configurable: true
8668
9193
  });
9194
+ // #endregion Public Getters And Setters
9195
+ // #region Public Methods
8669
9196
  /**
8670
- * A lifecycle hook that is called after Angular has initialized all data-bound properties of a directive.
8671
- * Define an ngOnInit() method to handle any additional initialization tasks.
9197
+ * Creates an array of a certain size. Is required for a For in the UI, as Angular does not support counting loops
9198
+ * @param size Size of the array
9199
+ * @returns Array
8672
9200
  */
8673
- SacTreeViewCommon.prototype.ngOnInit = function () {
8674
- this.collapseAllNode(this._collapseAll);
8675
- if (this.selectedId)
8676
- this.openSelectedNode(this.nodes);
9201
+ SacTreeviewCommon.prototype.count = function (size) {
9202
+ return new Array(size);
8677
9203
  };
8678
- /**
8679
- * Funktion setzt alle parent items recusiv zum selected node
8680
- * auf collapsed = false
8681
- */
8682
- SacTreeViewCommon.prototype.openSelectedNode = function (data) {
8683
- var result = false;
8684
- for (var i = 0; i < data.length; i++) {
8685
- if (data[i][this.childrenAttr].length &&
8686
- data[i][this.idAttr] != this.selectedId)
8687
- result = this.openSelectedNode(data[i][this.childrenAttr]);
8688
- if (result || data[i][this.idAttr] == this.selectedId) {
8689
- data[i][this.collapseAttr] = false;
8690
- return true;
8691
- }
9204
+ SacTreeviewCommon.prototype.getChildren = function (node) {
9205
+ if (!node || !this.attrchildren) {
9206
+ return [];
8692
9207
  }
8693
- return false;
9208
+ var children = node[this.attrchildren];
9209
+ if (!Array.isArray(children)) {
9210
+ return [];
9211
+ }
9212
+ return children;
8694
9213
  };
8695
- /**
8696
- * Die Methode vorbereitet die Daten für das TreeView. Die Funktion sollte geändert werden abhängig von dem kommenden Daten (wenn array)
8697
- */
8698
- SacTreeViewCommon.prototype.LoadTree = function () {
8699
- //if the tree structure require array the function below should be changed
8700
- var cloned = this._data.map(function (x) { return Object.assign({}, x); });
8701
- // If data is flat, prepare data with recursive function.
8702
- this.nodes = this.prepareData ? this._getPreparedData(cloned) : this._data;
9214
+ SacTreeviewCommon.prototype.getStringField = function (node, fieldname) {
9215
+ if (!node) {
9216
+ return '';
9217
+ }
9218
+ if (!fieldname) {
9219
+ return node;
9220
+ }
9221
+ var value = node[fieldname];
9222
+ if (!value) {
9223
+ return '';
9224
+ }
9225
+ return value;
8703
9226
  };
8704
- /**
8705
- * Die Methode collapse/expand den selectierten Node
8706
- */
8707
- SacTreeViewCommon.prototype.onCollapseClick = function (node) {
8708
- if (node[this.childrenAttr].length) {
8709
- node[this.collapseAttr] = !node[this.collapseAttr];
9227
+ SacTreeviewCommon.prototype.hasChildren = function (node) {
9228
+ return this.getChildren(node).length > 0;
9229
+ };
9230
+ SacTreeviewCommon.prototype.isDisabledState = function (node) {
9231
+ if (!node || !this.attrdisableaction) {
9232
+ return false;
8710
9233
  }
9234
+ var value = node[this.attrdisableaction];
9235
+ return value === true || value === 'true';
8711
9236
  };
8712
- /**
8713
- * Die Methode set den selektierten Node und emit es.
8714
- */
8715
- SacTreeViewCommon.prototype.onClick = function (node) {
8716
- this.selectedNode = node;
8717
- this.selecteditem.emit(this.selectedNode);
8718
- // this.cd.detectChanges();
9237
+ SacTreeviewCommon.prototype.isExpandedState = function (node) {
9238
+ if (!node || !this.attrexanded) {
9239
+ return false;
9240
+ }
9241
+ var value = node[this.attrexanded];
9242
+ return value === true || value === 'true';
8719
9243
  };
8720
- /**
8721
- * Die Methode wird ein event mit Meldung zu Parent emit-en.
8722
- */
8723
- SacTreeViewCommon.prototype.sendMsgToParent = function (msg) {
8724
- this.selecteditem.emit(msg);
9244
+ SacTreeviewCommon.prototype.isHoverState = function (node) {
9245
+ if (!node || !this.attrhoverstate) {
9246
+ return false;
9247
+ }
9248
+ var value = node[this.attrhoverstate];
9249
+ return value === true || value === 'true';
8725
9250
  };
8726
- /**
8727
- * Die Methode wird alle Nodes collapse
8728
- */
8729
- SacTreeViewCommon.prototype.collapseAllNode = function (command) {
8730
- var _this = this;
8731
- this.nodes.forEach(function (node) {
8732
- if (node[_this.childrenAttr].length) {
8733
- collapseAllHIdden(node, _this.collapseAttr, command, _this.childrenAttr);
8734
- }
8735
- });
8736
- function collapseAllHIdden(node, collapseAttr, command, childrenAttr) {
8737
- node[collapseAttr] = command;
8738
- node.children.forEach(function (child) {
8739
- if (child[childrenAttr].length) {
8740
- collapseAllHIdden(child, collapseAttr, command, childrenAttr);
8741
- }
8742
- });
9251
+ SacTreeviewCommon.prototype.isSelectedState = function (node) {
9252
+ if (!node || !this.attrselected) {
9253
+ return false;
8743
9254
  }
9255
+ var value = node[this.attrselected];
9256
+ return value === true || value === 'true';
8744
9257
  };
8745
9258
  /**
8746
- * Funktion gibt node aus der liste zurück, welches das Value auf dem gewünschten Attribut hat
8747
- * Wenn node nicht gefunden wird, wird null zurück gegeben
8748
- * @param data Liste der nodes
8749
- * @param searchValue Das gesuchte value
8750
- * @param attr Der namen des Attributs auf dem das value gesucht wird
9259
+ * Method is called by clicking an action
9260
+ * @param action action and node
8751
9261
  */
8752
- SacTreeViewCommon.prototype.findNode = function (data, searchValue, attr) {
8753
- var result = null;
8754
- for (var i = 0; i < data.length; i++) {
8755
- if (data[i][attr] == searchValue)
8756
- result = data[i];
8757
- else {
8758
- if (data[i][this.childrenAttr].length) {
8759
- var recursiveResult = this.findNode(data[i][this.childrenAttr], searchValue, attr);
8760
- if (recursiveResult)
8761
- result = recursiveResult;
8762
- }
8763
- }
9262
+ SacTreeviewCommon.prototype.onActionClicked = function (action) {
9263
+ this.actionclicked.emit(action);
9264
+ };
9265
+ SacTreeviewCommon.prototype.onNodeClicked = function (node) {
9266
+ if (this.isDisabledState(node) || this.isSelectedState(node)) {
9267
+ this.invertExpandedState(node);
8764
9268
  }
8765
- return result;
9269
+ this.setSelectedState(node);
8766
9270
  };
8767
- /**
8768
- * Die Methode editiert (recursive) alle eingegebene Nodes abhängig von gegebenen Attibute und Value Kriterien.
8769
- */
8770
- SacTreeViewCommon.prototype._recursiveEdit = function (list, childrenAttr, attr, value) {
8771
- if (Array.isArray(list)) {
8772
- for (var i = 0, len = list.length; i < len; i++) {
8773
- list[i][attr] = value;
8774
- if (list[i][childrenAttr].length) {
8775
- this._recursiveEdit(list[i][childrenAttr], childrenAttr, attr, value);
8776
- }
8777
- }
9271
+ SacTreeviewCommon.prototype.setHoverState = function (node, state) {
9272
+ if (!node || !this.attrhoverstate) {
9273
+ return;
9274
+ }
9275
+ if (state) {
9276
+ node[this.attrhoverstate] = true;
9277
+ return;
9278
+ }
9279
+ if (!node.hasOwnProperty(this.attrhoverstate)) {
9280
+ return;
8778
9281
  }
9282
+ delete node[this.attrhoverstate];
8779
9283
  };
8780
- /**
8781
- * Die Methode erstellt eine standarte Sicht-Liste von Nodes
8782
- */
8783
- SacTreeViewCommon.prototype._getPreparedData = function (list) {
8784
- var tree = [], lookup = {};
8785
- for (var i = 0, len = list.length; i < len; i++) {
8786
- lookup[list[i][this.idAttr]] = list[i];
8787
- list[i][this.childrenAttr] = [];
8788
- list[i][this.collapseAttr] = true;
8789
- list[i][this.selectAttr] = false;
8790
- list[i][this.inDeterminateAttr] = false;
9284
+ SacTreeviewCommon.prototype.setSelectedState = function (node) {
9285
+ var _this = this;
9286
+ if (!node || !this.attrselected) {
9287
+ return;
8791
9288
  }
8792
- for (var i = 0, len = list.length; i < len; i++) {
8793
- if (list[i][this.parentAttr]) {
8794
- lookup[list[i][this.parentAttr]][this.childrenAttr].push(list[i]);
8795
- }
8796
- else {
8797
- tree.push(list[i]);
8798
- }
9289
+ // reset selected state of any node
9290
+ this.data.forEach(function (rootNode) { return _this.resetSelectedState(rootNode); });
9291
+ // set selected node as selected
9292
+ node[this.attrselected] = true;
9293
+ // Update ngModel
9294
+ this.setValue(node);
9295
+ // Raise Selected Events
9296
+ this.selectednode.emit(node);
9297
+ if (!this.attrid) {
9298
+ return;
8799
9299
  }
8800
- return tree;
9300
+ var id = this.getStringField(node, this.attrid);
9301
+ this.selected.emit(id);
8801
9302
  };
8802
- return SacTreeViewCommon;
8803
- }());
8804
- SacTreeViewCommon.decorators = [
9303
+ SacTreeviewCommon.prototype.validateData = function (c) {
9304
+ var error = null;
9305
+ if (this.isrequired) {
9306
+ error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
9307
+ }
9308
+ return error;
9309
+ };
9310
+ // #endregion Public Methods
9311
+ // #region Private Methods
9312
+ SacTreeviewCommon.prototype.invertExpandedState = function (node) {
9313
+ if (!node || !this.attrexanded) {
9314
+ return;
9315
+ }
9316
+ // Items with no children cannot be collabsed
9317
+ if (!this.hasChildren(node) && !(this.enableasynchload === true || this.enableasynchload === 'true')) {
9318
+ return;
9319
+ }
9320
+ var value = node[this.attrexanded];
9321
+ if (value === true || value === 'true') {
9322
+ this.collabsed.emit(node);
9323
+ node[this.attrexanded] = false;
9324
+ }
9325
+ else {
9326
+ this.expanded.emit(node);
9327
+ node[this.attrexanded] = true;
9328
+ }
9329
+ };
9330
+ SacTreeviewCommon.prototype.resetSelectedState = function (node) {
9331
+ var _this = this;
9332
+ if (!node || !this.attrselected) {
9333
+ return;
9334
+ }
9335
+ node[this.attrselected] = false;
9336
+ this.getChildren(node).forEach(function (child) {
9337
+ _this.resetSelectedState(child);
9338
+ });
9339
+ };
9340
+ return SacTreeviewCommon;
9341
+ }(SacBaseModelControl));
9342
+ SacTreeviewCommon.decorators = [
8805
9343
  { type: i0.Directive }
8806
9344
  ];
8807
- SacTreeViewCommon.propDecorators = {
9345
+ SacTreeviewCommon.ctorParameters = function () { return [
9346
+ { type: SacFormLayoutCommon, decorators: [{ type: i0.Host }] },
9347
+ { type: i0.Injector }
9348
+ ]; };
9349
+ SacTreeviewCommon.propDecorators = {
9350
+ actionclicked: [{ type: i0.Output }],
9351
+ attrchildren: [{ type: i0.Input }],
9352
+ attrdisableaction: [{ type: i0.Input }],
9353
+ attrexanded: [{ type: i0.Input }],
9354
+ attrhoverstate: [{ type: i0.Input }],
9355
+ attricon: [{ type: i0.Input }],
9356
+ attrid: [{ type: i0.Input }],
9357
+ attrlabel: [{ type: i0.Input }],
9358
+ attrselected: [{ type: i0.Input }],
9359
+ collabsed: [{ type: i0.Output }],
8808
9360
  data: [{ type: i0.Input }],
8809
- template: [{ type: i0.Input }],
8810
- treeviewTemplate: [{ type: i0.ContentChild, args: ['actions', { static: true },] }],
8811
- fileicontemplate: [{ type: i0.Input }],
8812
- treefileicon: [{ type: i0.ContentChild, args: ['treefileicon', { static: true },] }],
9361
+ enableasynchload: [{ type: i0.Input }],
9362
+ enableellipsis: [{ type: i0.Input }],
9363
+ expanded: [{ type: i0.Output }],
9364
+ expandedstate: [{ type: i0.Input }],
9365
+ isrequired: [{ type: i0.Input }],
8813
9366
  name: [{ type: i0.Input }],
8814
- prepareData: [{ type: i0.Input }],
8815
- textAttr: [{ type: i0.Input }],
8816
- idAttr: [{ type: i0.Input }],
8817
- parentAttr: [{ type: i0.Input }],
8818
- childrenAttr: [{ type: i0.Input }],
8819
- title: [{ type: i0.Input }],
8820
- collapseall: [{ type: i0.Input }],
8821
- selectall: [{ type: i0.Input }],
8822
- selectedid: [{ type: i0.Input }],
8823
- selectedidchange: [{ type: i0.Output }],
8824
- selectedtextchanged: [{ type: i0.Output }],
8825
- selecteditem: [{ type: i0.Output }]
9367
+ selected: [{ type: i0.Output }],
9368
+ selectednode: [{ type: i0.Output }],
9369
+ showactionalways: [{ type: i0.Input }],
9370
+ templateaction: [{ type: i0.Input }],
9371
+ templatelabel: [{ type: i0.Input }],
9372
+ validationmessagerequired: [{ type: i0.Input }],
9373
+ validationmessagesummaryrequired: [{ type: i0.Input }]
8826
9374
  };
8827
9375
 
8828
- /**
8829
- * Komponente für SacTreeViewChildCommon. Extends SacTreeViewCommon
8830
- */
8831
- var SacTreeViewChildCommon = /** @class */ (function (_super) {
8832
- __extends(SacTreeViewChildCommon, _super);
8833
- function SacTreeViewChildCommon() {
8834
- return _super !== null && _super.apply(this, arguments) || this;
8835
- }
8836
- /**
8837
- * A lifecycle hook that is called after Angular has initialized all data-bound properties of a directive.
8838
- * Define an ngOnInit() method to handle any additional initialization tasks.
8839
- */
8840
- SacTreeViewChildCommon.prototype.ngOnInit = function () {
8841
- this.collapseAllNode(this.collapseall);
8842
- };
8843
- return SacTreeViewChildCommon;
8844
- }(SacTreeViewCommon));
8845
- SacTreeViewChildCommon.decorators = [
8846
- { type: i0.Directive }
8847
- ];
8848
-
8849
- /**
8850
- * Enum für Tooltip Positionen
8851
- */
8852
- (function (TooltipPosition) {
8853
- TooltipPosition[TooltipPosition["none"] = 0] = "none";
8854
- // tslint:disable-next-line:no-bitwise
8855
- TooltipPosition[TooltipPosition["top"] = 1] = "top";
8856
- // tslint:disable-next-line:no-bitwise
8857
- TooltipPosition[TooltipPosition["right"] = 2] = "right";
8858
- // tslint:disable-next-line:no-bitwise
8859
- TooltipPosition[TooltipPosition["bottom"] = 4] = "bottom";
8860
- // tslint:disable-next-line:no-bitwise
8861
- TooltipPosition[TooltipPosition["left"] = 8] = "left";
8862
- })(exports.TooltipPosition || (exports.TooltipPosition = {}));
8863
-
8864
9376
  /**
8865
9377
  * Tooltip Component
8866
9378
  *
@@ -8883,29 +9395,15 @@
8883
9395
  var _this = this;
8884
9396
  this.cdRef = cdRef;
8885
9397
  this.ref = ref;
9398
+ // #region Properties
8886
9399
  /**
8887
- * Defines whether the tooltip is visible
8888
- */
8889
- this._isTooltipVisible = false;
8890
- /**
8891
- * method if content has changed and proportions need to be reset in the UI.
9400
+ * Helper class to display tooltip on correct position
8892
9401
  */
8893
- this.onContentChange = function () {
8894
- // Do nothing if is not visible
8895
- if (!_this._isTooltipVisible) {
8896
- return;
8897
- }
8898
- setTimeout(function () {
8899
- _this.getLeftPosition();
8900
- _this.getTopPosition();
8901
- });
8902
- };
9402
+ this.popupHelper = new PopUpHelper();
8903
9403
  /**
8904
- * Position of the tooltip. Values: left|top|right|bottom|auto
8905
- *
8906
- * Value 'auto' can be combined with another value.
9404
+ * Defines whether the tooltip is visible
8907
9405
  */
8908
- this.position = 'right|auto';
9406
+ this._isTooltipVisible = false;
8909
9407
  /**
8910
9408
  * Position of the tooltip on the left
8911
9409
  */
@@ -8922,16 +9420,43 @@
8922
9420
  * Position of the tooltip at the top
8923
9421
  */
8924
9422
  this.TopPos = 0;
9423
+ /**
9424
+ * Position of the picker arrow at the left
9425
+ */
9426
+ this.posArrowLeft = null;
9427
+ /**
9428
+ * Position of the picker arrow at the top
9429
+ */
9430
+ this.posArrowTop = null;
9431
+ /**
9432
+ * Position of the tooltip. Values: left|top|right|bottom|auto
9433
+ *
9434
+ * Value 'auto' can be combined with another value.
9435
+ */
9436
+ this.position = 'right|auto';
9437
+ /**
9438
+ * method if content has changed and proportions need to be reset in the UI.
9439
+ */
9440
+ this.onContentChange = function () {
9441
+ // Do nothing if is not visible
9442
+ if (!_this._isTooltipVisible) {
9443
+ return;
9444
+ }
9445
+ setTimeout(function () {
9446
+ _this.getLeftPosition();
9447
+ _this.getTopPosition();
9448
+ });
9449
+ };
8925
9450
  }
8926
9451
  Object.defineProperty(SacTooltipCommon.prototype, "inlinemode", {
9452
+ // #endregion Constructors
9453
+ // #region Public Getters And Setters
8927
9454
  /**
8928
9455
  * Property for inline mode for tooltip. Sets the display mode on the wrapper element to `inline`
8929
9456
  */
8930
9457
  get: function () {
8931
9458
  return this._inlinemode;
8932
9459
  },
8933
- // #endregion Constructors
8934
- // #region Public Getters And Setters
8935
9460
  /**
8936
9461
  * Setter for inline mode for tooltip
8937
9462
  */
@@ -8969,50 +9494,7 @@
8969
9494
  * Returns the position of the tooltip
8970
9495
  */
8971
9496
  SacTooltipCommon.prototype.GetTooltipPosition = function () {
8972
- var validPositions = this.ValidatePositions();
8973
- // tslint:disable-next-line:no-bitwise
8974
- if (this.HasPosition(exports.TooltipPosition.right) &&
8975
- validPositions & exports.TooltipPosition.right) {
8976
- return exports.TooltipPosition.right;
8977
- }
8978
- // tslint:disable-next-line:no-bitwise
8979
- if (this.HasPosition(exports.TooltipPosition.top) &&
8980
- validPositions & exports.TooltipPosition.top) {
8981
- return exports.TooltipPosition.top;
8982
- }
8983
- // tslint:disable-next-line:no-bitwise
8984
- if (this.HasPosition(exports.TooltipPosition.left) &&
8985
- validPositions & exports.TooltipPosition.left) {
8986
- return exports.TooltipPosition.left;
8987
- }
8988
- // tslint:disable-next-line:no-bitwise
8989
- if (this.HasPosition(exports.TooltipPosition.bottom) &&
8990
- validPositions & exports.TooltipPosition.bottom) {
8991
- return exports.TooltipPosition.bottom;
8992
- }
8993
- // Get Auto Position or Default
8994
- if (this.IsAutoPosition()) {
8995
- // tslint:disable-next-line:no-bitwise
8996
- if (validPositions & exports.TooltipPosition.right) {
8997
- return exports.TooltipPosition.right;
8998
- }
8999
- // tslint:disable-next-line:no-bitwise
9000
- if (validPositions & exports.TooltipPosition.top) {
9001
- return exports.TooltipPosition.top;
9002
- }
9003
- // tslint:disable-next-line:no-bitwise
9004
- if (validPositions & exports.TooltipPosition.left) {
9005
- return exports.TooltipPosition.left;
9006
- }
9007
- // tslint:disable-next-line:no-bitwise
9008
- if (validPositions & exports.TooltipPosition.bottom) {
9009
- return exports.TooltipPosition.bottom;
9010
- }
9011
- return exports.TooltipPosition.right;
9012
- }
9013
- else {
9014
- return this.GetPosition();
9015
- }
9497
+ return this.popupHelper.getDisplayPosition(this.content, this.tooltipcontainer, this.getTooltipOffset(), this.getTooltipOffset(), this.position, true);
9016
9498
  };
9017
9499
  /**
9018
9500
  * Hide tooltip
@@ -9044,24 +9526,13 @@
9044
9526
  * Calculates the height of the tooltip
9045
9527
  */
9046
9528
  SacTooltipCommon.prototype.getToolTipHeight = function () {
9047
- var _a;
9048
- if (this.tooltipcontainer) {
9049
- return (_a = this.tooltipcontainer.nativeElement.firstElementChild.clientHeight) !== null && _a !== void 0 ? _a : 0;
9050
- }
9051
- else {
9052
- return 0;
9053
- }
9529
+ return this.popupHelper.getPopupHeight(this.tooltipcontainer);
9054
9530
  };
9055
9531
  /**
9056
9532
  * Calculates the width of the tooltips
9057
9533
  */
9058
9534
  SacTooltipCommon.prototype.getToolTipWidth = function () {
9059
- if (this.tooltipcontainer) {
9060
- return this.tooltipcontainer.nativeElement.firstElementChild.clientWidth;
9061
- }
9062
- else {
9063
- return 0;
9064
- }
9535
+ return this.popupHelper.getPopupWidth(this.tooltipcontainer);
9065
9536
  };
9066
9537
  /**
9067
9538
  * Detect Changes after view checked. Prevent ExpressionChangedAfterItHasBeenCheckedError error
@@ -9106,187 +9577,37 @@
9106
9577
  document.body.appendChild(this.tooltipcontainer.nativeElement);
9107
9578
  }
9108
9579
  };
9109
- // #endregion Protected Abstract Methods
9580
+ // #endregion Protected Methods
9110
9581
  // #region Private Methods
9111
- /**
9112
- * Returns the defined position for the tooltip
9113
- */
9114
- SacTooltipCommon.prototype.GetPosition = function () {
9115
- var positions = this.position.split('|');
9116
- if (this.HasPosition(exports.TooltipPosition.left)) {
9117
- return exports.TooltipPosition.left;
9118
- }
9119
- if (this.HasPosition(exports.TooltipPosition.top)) {
9120
- return exports.TooltipPosition.top;
9121
- }
9122
- if (this.HasPosition(exports.TooltipPosition.right)) {
9123
- return exports.TooltipPosition.right;
9124
- }
9125
- if (this.HasPosition(exports.TooltipPosition.bottom)) {
9126
- return exports.TooltipPosition.bottom;
9127
- }
9128
- // Default Position if empty
9129
- return exports.TooltipPosition.right;
9130
- };
9131
- /**
9132
- * Returns whether the position has been configured
9133
- *
9134
- * @param position Position to be checked
9135
- */
9136
- SacTooltipCommon.prototype.HasPosition = function (position) {
9137
- var positions = this.position.split('|');
9138
- if (position === exports.TooltipPosition.right && positions.indexOf('right') >= 0) {
9139
- return true;
9140
- }
9141
- if (position === exports.TooltipPosition.top && positions.indexOf('top') >= 0) {
9142
- return true;
9143
- }
9144
- if (position === exports.TooltipPosition.left && positions.indexOf('left') >= 0) {
9145
- return true;
9146
- }
9147
- if (position === exports.TooltipPosition.bottom &&
9148
- positions.indexOf('bottom') >= 0) {
9149
- return true;
9150
- }
9151
- return false;
9152
- };
9153
- /**
9154
- * Defines whether AutoPosition is active
9155
- */
9156
- SacTooltipCommon.prototype.IsAutoPosition = function () {
9157
- var positions = this.position.split('|');
9158
- return positions.indexOf('auto') >= 0;
9159
- };
9160
- /**
9161
- * Checks whether the position is valid or whether the tooltip on the position has space
9162
- */
9163
- SacTooltipCommon.prototype.ValidatePositions = function () {
9164
- // Check if Container is false
9165
- if (this.tooltipcontainer === undefined) {
9166
- return exports.TooltipPosition.right;
9167
- }
9168
- var allowedPositions = exports.TooltipPosition.none;
9169
- var basePosition = this.content.nativeElement.firstElementChild.getBoundingClientRect();
9170
- var tooltipRect = this.tooltipcontainer.nativeElement.firstElementChild.getBoundingClientRect();
9171
- var leftPosOk = basePosition.left - tooltipRect.width + (this.getTooltipOffset() * -1) > 0;
9172
- var rightPosOk = basePosition.right + tooltipRect.width + this.getTooltipOffset() < window.innerWidth;
9173
- var topPosOk = basePosition.top - tooltipRect.height > 0;
9174
- var bottomPosOk = basePosition.bottom + tooltipRect.height < window.innerHeight;
9175
- var leftHalfPosOk = basePosition.left - tooltipRect.width / 2 > 0;
9176
- var rightHalfPosOk = basePosition.right + tooltipRect.width / 2 < window.innerWidth;
9177
- var topHalfPosOk = basePosition.top - tooltipRect.height / 2 > 0;
9178
- var bottomHalfPosOk = basePosition.bottom + tooltipRect.height / 2 < window.innerHeight;
9179
- if (leftPosOk && topHalfPosOk && bottomHalfPosOk) {
9180
- // tslint:disable-next-line:no-bitwise
9181
- allowedPositions = allowedPositions | exports.TooltipPosition.left;
9182
- }
9183
- if (rightPosOk && topHalfPosOk && bottomHalfPosOk) {
9184
- // tslint:disable-next-line:no-bitwise
9185
- allowedPositions = allowedPositions | exports.TooltipPosition.right;
9186
- }
9187
- if (topPosOk && leftHalfPosOk && rightHalfPosOk) {
9188
- // tslint:disable-next-line:no-bitwise
9189
- allowedPositions = allowedPositions | exports.TooltipPosition.top;
9190
- }
9191
- if (bottomPosOk && leftHalfPosOk && rightHalfPosOk) {
9192
- // tslint:disable-next-line:no-bitwise
9193
- allowedPositions = allowedPositions | exports.TooltipPosition.bottom;
9194
- }
9195
- return allowedPositions;
9196
- };
9197
9582
  /**
9198
9583
  * Calculates the position of the tooltip from links
9199
9584
  */
9200
9585
  SacTooltipCommon.prototype.getLeftPosition = function () {
9201
- if (this.content !== null && this.content !== undefined) {
9202
- var item = this.content.nativeElement;
9203
- if (item.children.length >= 1) {
9204
- var childItem = item.firstElementChild;
9205
- var contentPosition = childItem.getBoundingClientRect();
9206
- switch (this.GetTooltipPosition()) {
9207
- case exports.TooltipPosition.top:
9208
- this.LeftPos = contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2;
9209
- return (contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2);
9210
- case exports.TooltipPosition.right:
9211
- this.LeftPos = contentPosition.left + contentPosition.width + this.getTooltipOffset();
9212
- return contentPosition.left + contentPosition.width + this.getTooltipOffset();
9213
- case exports.TooltipPosition.bottom:
9214
- this.LeftPos = contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2;
9215
- return (contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2);
9216
- case exports.TooltipPosition.left:
9217
- this.LeftPos = contentPosition.left - this.getToolTipWidth() + (this.getTooltipOffset() * -1);
9218
- return contentPosition.left - this.getToolTipWidth() + (this.getTooltipOffset() * -1);
9219
- }
9220
- return this.content.nativeElement.offsetTop;
9221
- }
9222
- else {
9223
- return this.content.nativeElement.offsetTop;
9224
- }
9586
+ var value = this.popupHelper.getPositionLeft(this.content, this.tooltipcontainer, this.ref, this.getTooltipOffset(), this.getTooltipOffset(), this.position, true);
9587
+ this.LeftPos = value;
9588
+ var requiredPosition = this.GetTooltipPosition();
9589
+ if (requiredPosition === exports.TooltipPosition.left || requiredPosition === exports.TooltipPosition.right) {
9590
+ this.posArrowTop = this.getToolTipHeight() / 2 - 6.5;
9225
9591
  }
9226
9592
  else {
9227
- return this.ref.nativeElement.offsetLeft;
9593
+ this.posArrowTop = null;
9228
9594
  }
9595
+ return value;
9229
9596
  };
9230
9597
  /**
9231
9598
  * Calculates the position of the tooltip from the top
9232
9599
  */
9233
9600
  SacTooltipCommon.prototype.getTopPosition = function () {
9234
- if (this.content !== null && this.content !== undefined) {
9235
- var item = this.content.nativeElement;
9236
- if (item.children.length >= 1) {
9237
- var childItem = item.firstElementChild;
9238
- var contentPosition = childItem.getBoundingClientRect();
9239
- // Get Position with Scroll (Scrollbars inside page should be substracted)
9240
- var contentPositionTop = childItem.offsetTop + this.getOffsetTopParent(childItem.offsetParent) - this.getScrollTopParent(childItem.parentElement);
9241
- switch (this.GetTooltipPosition()) {
9242
- case exports.TooltipPosition.top:
9243
- this.TopPos = contentPositionTop - this.getToolTipHeight() + (this.getTooltipOffset() * -1);
9244
- return contentPositionTop - this.getToolTipHeight() + (this.getTooltipOffset() * -1);
9245
- case exports.TooltipPosition.right:
9246
- this.TopPos = contentPositionTop + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
9247
- return contentPositionTop + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
9248
- case exports.TooltipPosition.bottom:
9249
- this.TopPos = contentPositionTop + contentPosition.height + this.getTooltipOffset();
9250
- return contentPositionTop + contentPosition.height + this.getTooltipOffset();
9251
- case exports.TooltipPosition.left:
9252
- this.TopPos = contentPositionTop + contentPosition.height / 2 - this.getToolTipHeight() / 2;
9253
- return (contentPositionTop + contentPosition.height / 2 - this.getToolTipHeight() / 2);
9254
- }
9255
- return (childItem.clientTop + childItem.offsetTop - (this.getToolTipHeight() / 2 - childItem.clientHeight / 2));
9256
- }
9257
- else {
9258
- return this.content.nativeElement.offsetTop;
9259
- }
9601
+ var value = this.popupHelper.getPositionTop(this.content, this.tooltipcontainer, this.ref, this.getTooltipOffset(), this.getTooltipOffset(), this.position, true);
9602
+ this.TopPos = value;
9603
+ var requiredPosition = this.GetTooltipPosition();
9604
+ if (requiredPosition === exports.TooltipPosition.bottom || requiredPosition === exports.TooltipPosition.top) {
9605
+ this.posArrowLeft = this.getToolTipWidth() / 2 - 6.5;
9260
9606
  }
9261
9607
  else {
9262
- return this.ref.nativeElement.offsetTop;
9263
- }
9264
- };
9265
- /**
9266
- * Calculates the top of the page inside all elements
9267
- * @param element HTML Element
9268
- * @returns summarized top value for absolute position
9269
- */
9270
- SacTooltipCommon.prototype.getOffsetTopParent = function (element) {
9271
- if (!element.offsetParent) {
9272
- return element.offsetTop;
9273
- }
9274
- var parentValue = this.getOffsetTopParent(element.offsetParent);
9275
- var offset = element.offsetTop;
9276
- return parentValue + offset;
9277
- };
9278
- /**
9279
- * Caclulate Scrollbars inside tree
9280
- * @param element HTML Element
9281
- * @returns Scroll top value of element with all childs
9282
- */
9283
- SacTooltipCommon.prototype.getScrollTopParent = function (element) {
9284
- // Body Scroll should not be calculated
9285
- if (!element.parentElement) {
9286
- return 0;
9608
+ this.posArrowLeft = null;
9287
9609
  }
9288
- var parentValue = this.getScrollTopParent(element.parentElement);
9289
- return parentValue + element.scrollTop;
9610
+ return value;
9290
9611
  };
9291
9612
  return SacTooltipCommon;
9292
9613
  }());
@@ -9298,9 +9619,9 @@
9298
9619
  { type: i0.ElementRef }
9299
9620
  ]; };
9300
9621
  SacTooltipCommon.propDecorators = {
9622
+ content: [{ type: i0.ViewChild, args: ['container', { static: true },] }],
9301
9623
  position: [{ type: i0.Input }],
9302
9624
  tooltiptext: [{ type: i0.Input }],
9303
- content: [{ type: i0.ViewChild, args: ['container', { static: true },] }],
9304
9625
  inlinemode: [{ type: i0.Input }],
9305
9626
  tooltip: [{ type: i0.ViewChild, args: ['tooltip', { static: false },] }]
9306
9627
  };
@@ -11287,6 +11608,27 @@
11287
11608
  { type: i0.ElementRef }
11288
11609
  ]; };
11289
11610
 
11611
+ /**
11612
+ * Base Context Menu Item
11613
+ */
11614
+ var SacContextmenuItemCommon = /** @class */ (function () {
11615
+ function SacContextmenuItemCommon() {
11616
+ // #region Properties
11617
+ /**
11618
+ * Reference to the higher-level context menu. This property is always set automatically by the context menu. However, it may be necessary to set the reference manually.
11619
+ */
11620
+ this.contextmenu = null;
11621
+ // #endregion Properties
11622
+ }
11623
+ return SacContextmenuItemCommon;
11624
+ }());
11625
+ SacContextmenuItemCommon.decorators = [
11626
+ { type: i0.Directive }
11627
+ ];
11628
+ SacContextmenuItemCommon.propDecorators = {
11629
+ contextmenu: [{ type: i0.Input }]
11630
+ };
11631
+
11290
11632
  /**
11291
11633
  * Base Context Menü Element. Die Logik wurde aus NG-BOOTSTRAP übernommen.
11292
11634
  */
@@ -11336,12 +11678,7 @@
11336
11678
  *
11337
11679
  * Please see the [positioning overview](#/positioning) for more details.
11338
11680
  */
11339
- this.placement = [
11340
- 'bottom-left',
11341
- 'bottom-right',
11342
- 'top-left',
11343
- 'top-right',
11344
- ];
11681
+ this.placement = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
11345
11682
  this.zoneSubscription = this.ngZone.onStable.subscribe(function () {
11346
11683
  _this._positionMenu();
11347
11684
  });
@@ -11361,17 +11698,6 @@
11361
11698
  });
11362
11699
  // #endregion Public Getters And Setters
11363
11700
  // #region Public Methods
11364
- /**
11365
- * HostListener um das Dropdown zu schliessen wenn nicht auf das Element geklickt wird.
11366
- */
11367
- SacContextmenuCommon.prototype.onClick = function (targetElement) {
11368
- var anchor = this._anchor || this._anchorTemplate;
11369
- if (this._menu &&
11370
- !this._menu.nativeElement.contains(targetElement) &&
11371
- !anchor.nativeElement.contains(targetElement)) {
11372
- this.close();
11373
- }
11374
- };
11375
11701
  /**
11376
11702
  * Schliesst das Dropdown
11377
11703
  */
@@ -11379,6 +11705,10 @@
11379
11705
  this._resetContainer();
11380
11706
  this.isopen = false;
11381
11707
  };
11708
+ SacContextmenuCommon.prototype.ngAfterContentInit = function () {
11709
+ var _this = this;
11710
+ this.menuitems.forEach(function (button) { return (button.contextmenu = _this); });
11711
+ };
11382
11712
  /**
11383
11713
  * Event wenn Component entfernt wird.
11384
11714
  */
@@ -11388,6 +11718,17 @@
11388
11718
  }
11389
11719
  this.zoneSubscription.unsubscribe();
11390
11720
  };
11721
+ /**
11722
+ * HostListener um das Dropdown zu schliessen wenn nicht auf das Element geklickt wird.
11723
+ */
11724
+ SacContextmenuCommon.prototype.onClick = function (targetElement) {
11725
+ var anchor = this._anchor || this._anchorTemplate;
11726
+ if (this._menu &&
11727
+ !this._menu.nativeElement.contains(targetElement) &&
11728
+ !anchor.nativeElement.contains(targetElement)) {
11729
+ this.close();
11730
+ }
11731
+ };
11391
11732
  /**
11392
11733
  * Öffnet das Dropdown / Zeigt das Menü an.
11393
11734
  */
@@ -11431,8 +11772,7 @@
11431
11772
  if (container === 'body') {
11432
11773
  var renderer = this.renderer;
11433
11774
  var dropdownMenuElement = this._menu.nativeElement;
11434
- var bodyContainer = (this.bodyContainer =
11435
- this.bodyContainer || renderer.createElement('div'));
11775
+ var bodyContainer = (this.bodyContainer = this.bodyContainer || renderer.createElement('div'));
11436
11776
  // Override some styles to have the positioning working
11437
11777
  renderer.setStyle(bodyContainer, 'position', 'absolute');
11438
11778
  renderer.setStyle(dropdownMenuElement, 'position', 'static');
@@ -11471,41 +11811,31 @@
11471
11811
  { type: i0.Injector }
11472
11812
  ]; };
11473
11813
  SacContextmenuCommon.propDecorators = {
11474
- _anchorTemplate: [{ type: i0.ContentChild, args: [SacContextmenuAnchorCommon, { static: false },] }],
11475
11814
  _anchor: [{ type: i0.ViewChild, args: [SacContextmenuAnchorCommon, { static: false },] }],
11815
+ _anchorTemplate: [{ type: i0.ContentChild, args: [SacContextmenuAnchorCommon, { static: false },] }],
11476
11816
  _menu: [{ type: i0.ViewChild, args: [SacContextMenuContrainerCommon, { static: false },] }],
11477
11817
  buttontemplate: [{ type: i0.Input }],
11478
11818
  container: [{ type: i0.Input }],
11479
11819
  cssclass: [{ type: i0.Input }],
11480
11820
  isopen: [{ type: i0.Input }],
11821
+ menuitems: [{ type: i0.ContentChildren, args: [i0.forwardRef(function () { return SacContextmenuItemCommon; }),] }],
11481
11822
  placement: [{ type: i0.Input }],
11482
11823
  onClick: [{ type: i0.HostListener, args: ['document:click', ['$event.target'],] }]
11483
11824
  };
11484
11825
 
11485
- /**
11486
- * Base Context Menu Item
11487
- */
11488
- var SacContextmenuItemCommon = /** @class */ (function () {
11489
- function SacContextmenuItemCommon() {
11490
- }
11491
- return SacContextmenuItemCommon;
11492
- }());
11493
- SacContextmenuItemCommon.decorators = [
11494
- { type: i0.Directive }
11495
- ];
11496
-
11497
11826
  /**
11498
11827
  * Base Context Menu Button Item
11499
11828
  */
11500
11829
  var SacContextmenuItemButtonCommon = /** @class */ (function (_super) {
11501
11830
  __extends(SacContextmenuItemButtonCommon, _super);
11831
+ // #endregion Properties
11832
+ // #region Constructors
11502
11833
  /**
11503
11834
  * Constructor
11504
- * @param contextmenu Instance of Context Menü.
11505
11835
  */
11506
- function SacContextmenuItemButtonCommon(contextmenu) {
11836
+ function SacContextmenuItemButtonCommon() {
11507
11837
  var _this = _super.call(this) || this;
11508
- _this.contextmenu = contextmenu;
11838
+ // #region Properties
11509
11839
  /**
11510
11840
  * Menu Item ist deaktiviert
11511
11841
  */
@@ -11514,6 +11844,10 @@
11514
11844
  * Icon Column in Menü ist deaktiviert
11515
11845
  */
11516
11846
  _this._isicondisabled = false;
11847
+ /**
11848
+ * Event wenn auf den Button geklickt wird
11849
+ */
11850
+ _this.clicked = new i0.EventEmitter();
11517
11851
  /**
11518
11852
  * css class for button styling
11519
11853
  */
@@ -11523,12 +11857,14 @@
11523
11857
  */
11524
11858
  _this.iconstyle = '';
11525
11859
  /**
11526
- * Event wenn auf den Button geklickt wird
11860
+ * name of button. used for generate id and name
11527
11861
  */
11528
- _this.clicked = new i0.EventEmitter();
11862
+ _this.name = '';
11529
11863
  return _this;
11530
11864
  }
11531
11865
  Object.defineProperty(SacContextmenuItemButtonCommon.prototype, "isdisabled", {
11866
+ // #endregion Constructors
11867
+ // #region Public Getters And Setters
11532
11868
  /**
11533
11869
  * Menu Item ist deaktiviert
11534
11870
  */
@@ -11570,13 +11906,17 @@
11570
11906
  enumerable: false,
11571
11907
  configurable: true
11572
11908
  });
11909
+ // #endregion Public Getters And Setters
11910
+ // #region Public Methods
11573
11911
  /**
11574
11912
  * Die Methode wird das cklickaction Emitter aktivieren
11575
11913
  */
11576
11914
  SacContextmenuItemButtonCommon.prototype.callaction = function (event) {
11577
11915
  if (!this._isdisabled) {
11578
11916
  this.clicked.emit();
11579
- this.contextmenu.close();
11917
+ if (this.contextmenu !== null) {
11918
+ this.contextmenu.close();
11919
+ }
11580
11920
  }
11581
11921
  event.stopPropagation();
11582
11922
  };
@@ -11585,18 +11925,17 @@
11585
11925
  SacContextmenuItemButtonCommon.decorators = [
11586
11926
  { type: i0.Directive }
11587
11927
  ];
11588
- SacContextmenuItemButtonCommon.ctorParameters = function () { return [
11589
- { type: SacContextmenuCommon }
11590
- ]; };
11928
+ SacContextmenuItemButtonCommon.ctorParameters = function () { return []; };
11591
11929
  SacContextmenuItemButtonCommon.propDecorators = {
11592
- icon: [{ type: i0.Input }],
11930
+ clicked: [{ type: i0.Output }],
11593
11931
  cssclass: [{ type: i0.Input }],
11932
+ icon: [{ type: i0.Input }],
11594
11933
  iconstyle: [{ type: i0.Input }],
11595
11934
  image: [{ type: i0.Input }],
11596
- isdisabled: [{ type: i0.Input }],
11597
- isicondisabled: [{ type: i0.Input }],
11935
+ name: [{ type: i0.Input }],
11598
11936
  text: [{ type: i0.Input }],
11599
- clicked: [{ type: i0.Output }]
11937
+ isdisabled: [{ type: i0.Input }],
11938
+ isicondisabled: [{ type: i0.Input }]
11600
11939
  };
11601
11940
 
11602
11941
  /**
@@ -12311,9 +12650,7 @@
12311
12650
  exports.SacTimeCommon = SacTimeCommon;
12312
12651
  exports.SacTinyMceCommon = SacTinyMceCommon;
12313
12652
  exports.SacTooltipCommon = SacTooltipCommon;
12314
- exports.SacTreeItemActionCommon = SacTreeItemActionCommon;
12315
- exports.SacTreeViewChildCommon = SacTreeViewChildCommon;
12316
- exports.SacTreeViewCommon = SacTreeViewCommon;
12653
+ exports.SacTreeviewCommon = SacTreeviewCommon;
12317
12654
  exports.SacUploadBase = SacUploadBase;
12318
12655
  exports.SacUploadFile = SacUploadFile;
12319
12656
  exports.SacUploadMultipleCommon = SacUploadMultipleCommon;