@simpleangularcontrols/sac-common 10.0.0-rc.10 → 10.0.0-rc.12

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 (64) hide show
  1. package/bundles/simpleangularcontrols-sac-common.umd.js +1110 -710
  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 +30 -22
  7. package/controls/checkbox/radiobutton.d.ts +61 -26
  8. package/controls/datetime/date.d.ts +28 -27
  9. package/controls/datetime/datetime.d.ts +27 -27
  10. package/controls/datetime/time.d.ts +26 -26
  11. package/controls/dialog/dialog.d.ts +31 -43
  12. package/controls/grid/gridcolumnbase.d.ts +9 -1
  13. package/controls/layout/formlayout.d.ts +4 -0
  14. package/controls/list/buildvaluestring.d.ts +6 -0
  15. package/controls/list/buildvaluestring.ngfactory.d.ts +1 -0
  16. package/controls/list/dropdown.d.ts +9 -51
  17. package/controls/list/dropdownoptions.d.ts +38 -0
  18. package/controls/list/dropdownoptions.ngfactory.d.ts +1 -0
  19. package/controls/static/formcontainer.d.ts +11 -3
  20. package/controls/tooltip/tooltip.d.ts +33 -51
  21. package/esm2015/common/basedatetimecontrol.js +178 -30
  22. package/esm2015/common/basemodelcontrol.js +57 -46
  23. package/esm2015/controls/checkbox/radiobutton.js +94 -45
  24. package/esm2015/controls/datetime/date.js +43 -41
  25. package/esm2015/controls/datetime/datetime.js +42 -41
  26. package/esm2015/controls/datetime/time.js +42 -41
  27. package/esm2015/controls/dialog/dialog.js +41 -83
  28. package/esm2015/controls/grid/gridcolumnbase.js +14 -3
  29. package/esm2015/controls/layout/formlayout.js +7 -6
  30. package/esm2015/controls/list/buildvaluestring.js +18 -0
  31. package/esm2015/controls/list/buildvaluestring.ngfactory.js +7 -0
  32. package/esm2015/controls/list/dropdown.js +16 -114
  33. package/esm2015/controls/list/dropdownoptions.js +72 -0
  34. package/esm2015/controls/list/dropdownoptions.ngfactory.js +7 -0
  35. package/esm2015/controls/static/formcontainer.js +16 -6
  36. package/esm2015/controls/tooltip/tooltip.js +60 -250
  37. package/esm2015/interfaces/ISacConfigurationService.js +1 -1
  38. package/esm2015/public_api.js +3 -2
  39. package/esm2015/services/sac-configuration.service.js +7 -5
  40. package/esm2015/utilities/enums.js +5 -1
  41. package/esm2015/utilities/popuphelper.js +343 -0
  42. package/esm2015/utilities/popuphelper.ngfactory.js +7 -0
  43. package/esm2015/validation/equals.validator.js +14 -0
  44. package/esm2015/validation/equals.validator.ngfactory.js +7 -0
  45. package/esm2015/validation/notequals.validator.js +14 -0
  46. package/esm2015/validation/notequals.validator.ngfactory.js +7 -0
  47. package/esm2015/validation/validation.class.js +30 -6
  48. package/fesm2015/simpleangularcontrols-sac-common.js +1083 -703
  49. package/fesm2015/simpleangularcontrols-sac-common.js.map +1 -1
  50. package/interfaces/ISacConfigurationService.d.ts +4 -0
  51. package/package.json +1 -1
  52. package/public_api.d.ts +2 -1
  53. package/services/sac-configuration.service.d.ts +8 -0
  54. package/simpleangularcontrols-sac-common-10.0.0-rc.12.tgz +0 -0
  55. package/simpleangularcontrols-sac-common.metadata.json +1 -1
  56. package/utilities/enums.d.ts +3 -1
  57. package/utilities/popuphelper.d.ts +83 -0
  58. package/utilities/popuphelper.ngfactory.d.ts +1 -0
  59. package/validation/equals.validator.d.ts +2 -0
  60. package/validation/equals.validator.ngfactory.d.ts +1 -0
  61. package/validation/notequals.validator.d.ts +2 -0
  62. package/validation/notequals.validator.ngfactory.d.ts +1 -0
  63. package/validation/validation.class.d.ts +19 -0
  64. package/simpleangularcontrols-sac-common-10.0.0-rc.10.tgz +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('rxjs'), require('@angular/forms'), 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', 'rxjs', '@angular/forms', '@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.rxjs, global.ng.forms, global.ng.common.http, global.moment, global.IMask, global.ngxUploadx, global.ng.common));
5
+ }(this, (function (exports, i0, rxjs, forms, i1, 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
  */
@@ -2623,8 +2630,6 @@
2623
2630
  * Abstract Klasse für SacBaseModelControl. Implements ControlValueAccessor, Validator, OnInit
2624
2631
  */
2625
2632
  var SacBaseModelControl = /** @class */ (function () {
2626
- // #endregion Properties
2627
- // #region Constructors
2628
2633
  /**
2629
2634
  * Constructor
2630
2635
  * @param formlayout SacFormLayoutCommon to define scoped layout settings
@@ -2632,11 +2637,13 @@
2632
2637
  */
2633
2638
  function SacBaseModelControl(formlayout, injector) {
2634
2639
  this.injector = injector;
2635
- // #region Properties
2636
2640
  /**
2637
2641
  * Inline Errors für das Control
2638
2642
  */
2639
2643
  this._inlineerrorenabled = null;
2644
+ /**
2645
+ * Label Text
2646
+ */
2640
2647
  this._label = '';
2641
2648
  /**
2642
2649
  * Boolean Property dirty; default Wert - false
@@ -2658,6 +2665,10 @@
2658
2665
  * Form layout instance if exists
2659
2666
  */
2660
2667
  this.formlayout = null;
2668
+ /**
2669
+ * ControlHeight enum for use in HTML markup
2670
+ */
2671
+ this.ControlHeight = exports.ControlHeight;
2661
2672
  /**
2662
2673
  * Defines the standard height of the components
2663
2674
  */
@@ -2710,10 +2721,6 @@
2710
2721
  * Name des Controls
2711
2722
  */
2712
2723
  this.name = createGuid();
2713
- /**
2714
- * ControlHeight enum for use in HTML markup
2715
- */
2716
- this.ControlHeight = exports.ControlHeight;
2717
2724
  /**
2718
2725
  * Leere Implementation von "propagateChange". Muss gemacht werden, damit kein Fehler entsteht
2719
2726
  */
@@ -2722,92 +2729,56 @@
2722
2729
  * Leere Implementation von "propagateTouch". Muss gemacht werden, damit kein Fehler entsteht
2723
2730
  */
2724
2731
  this.propagateTouch = function () { };
2732
+ /**
2733
+ * 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!
2734
+ */
2735
+ this.splitlabelandhelptext = null;
2725
2736
  this.formlayout = formlayout;
2726
2737
  this.validationKeyService = injector.get(SACVALIDATIONKEY_SERVICE, new SacDefaultValidationKeyService());
2727
2738
  this.lngResourceService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService(this.validationKeyService));
2728
2739
  this.configurationService = injector.get(SACCONFIGURATION_SERVICE, new SacDefaultConfigurationService());
2729
2740
  this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
2730
2741
  }
2731
- Object.defineProperty(SacBaseModelControl.prototype, "inlineerrorenabled", {
2732
- /**
2733
- * Show error messages inline
2734
- */
2735
- get: function () {
2736
- return this._inlineerrorenabled;
2737
- },
2738
- // #endregion Constructors
2739
- // #region Public Getters And Setters
2740
- /**
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", {
2742
+ Object.defineProperty(SacBaseModelControl.prototype, "HelptextTooltipIcon", {
2755
2743
  /**
2756
- * Definiert den Label Text
2744
+ * Get Icon for Helptext Tooltip
2757
2745
  */
2758
2746
  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();
2747
+ return this.iconService.GenericHelptextIcon;
2767
2748
  },
2768
2749
  enumerable: false,
2769
2750
  configurable: true
2770
2751
  });
2771
- Object.defineProperty(SacBaseModelControl.prototype, "value", {
2752
+ Object.defineProperty(SacBaseModelControl.prototype, "dirty", {
2772
2753
  /**
2773
- * Get Methode für NgModel Binding in Html Markup
2754
+ * Methode ergibt Boolean Wert für dirty
2774
2755
  */
2775
2756
  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;
2757
+ if (this.ngControl !== null) {
2758
+ this._dirty = this.ngControl.dirty;
2785
2759
  }
2786
- this._value = this.ConvertInputValue(v);
2787
- this.propagateChange(this._value);
2760
+ return this._dirty;
2788
2761
  },
2789
2762
  enumerable: false,
2790
2763
  configurable: true
2791
2764
  });
2792
- Object.defineProperty(SacBaseModelControl.prototype, "HelptextTooltipIcon", {
2765
+ Object.defineProperty(SacBaseModelControl.prototype, "inlineerrorenabled", {
2793
2766
  /**
2794
- * Get Icon for Helptext Tooltip
2767
+ * Show error messages inline
2795
2768
  */
2796
2769
  get: function () {
2797
- return this.iconService.GenericHelptextIcon;
2770
+ return this._inlineerrorenabled;
2798
2771
  },
2799
- enumerable: false,
2800
- configurable: true
2801
- });
2802
- Object.defineProperty(SacBaseModelControl.prototype, "dirty", {
2803
2772
  /**
2804
- * Methode ergibt Boolean Wert für dirty
2773
+ * Aktiviert oder Deaktiviert die Inline Errors für das Control
2805
2774
  */
2806
- get: function () {
2807
- if (this.ngControl !== null) {
2808
- this._dirty = this.ngControl.dirty;
2775
+ set: function (value) {
2776
+ if (value === null || value === undefined) {
2777
+ this._inlineerrorenabled = null;
2778
+ }
2779
+ else {
2780
+ this._inlineerrorenabled = convertToBoolean(value);
2809
2781
  }
2810
- return this._dirty;
2811
2782
  },
2812
2783
  enumerable: false,
2813
2784
  configurable: true
@@ -2855,6 +2826,23 @@
2855
2826
  enumerable: false,
2856
2827
  configurable: true
2857
2828
  });
2829
+ Object.defineProperty(SacBaseModelControl.prototype, "label", {
2830
+ /**
2831
+ * Definiert den Label Text
2832
+ */
2833
+ get: function () {
2834
+ return this._label;
2835
+ },
2836
+ /**
2837
+ * Definiert den Label Text
2838
+ */
2839
+ set: function (v) {
2840
+ this._label = v;
2841
+ this.UpdateLabelToControl();
2842
+ },
2843
+ enumerable: false,
2844
+ configurable: true
2845
+ });
2858
2846
  Object.defineProperty(SacBaseModelControl.prototype, "labelSizes", {
2859
2847
  /**
2860
2848
  * returns an object with all label sizes. These values can then be transferred to corresponding CSS classes using a pipe
@@ -2885,8 +2873,27 @@
2885
2873
  enumerable: false,
2886
2874
  configurable: true
2887
2875
  });
2888
- // #endregion Public Getters And Setters
2889
- // #region Public Methods
2876
+ Object.defineProperty(SacBaseModelControl.prototype, "value", {
2877
+ /**
2878
+ * Get Methode für NgModel Binding in Html Markup
2879
+ */
2880
+ get: function () {
2881
+ return this._value;
2882
+ },
2883
+ /**
2884
+ * Set Methode für NgModel Binding in Html Markup
2885
+ * Input wird benötigt, damit der Wert auch über das Markup gesetzt werden kann.
2886
+ */
2887
+ set: function (v) {
2888
+ if (this.disabled) {
2889
+ return;
2890
+ }
2891
+ this._value = this.ConvertInputValue(v);
2892
+ this.propagateChange(this._value);
2893
+ },
2894
+ enumerable: false,
2895
+ configurable: true
2896
+ });
2890
2897
  /**
2891
2898
  * Methode ergibt Error anhand von gegebenen Kriterien
2892
2899
  */
@@ -2949,6 +2956,8 @@
2949
2956
  this.setIsAdaptiveLabel();
2950
2957
  // set method to display helptext
2951
2958
  this.setHelpTextMode();
2959
+ // set SplitMode for Labels
2960
+ this.setLabelSplitMode();
2952
2961
  this.OnClassInit();
2953
2962
  };
2954
2963
  /**
@@ -3002,8 +3011,6 @@
3002
3011
  SacBaseModelControl.prototype.writeValue = function (value) {
3003
3012
  this._value = value;
3004
3013
  };
3005
- // #endregion Public Abstract Methods
3006
- // #region Protected Methods
3007
3014
  /**
3008
3015
  * Method can Overwriten in Parent Classes
3009
3016
  * @param value Wert welcher in den korrekten Typ konvertiert werden soll
@@ -3030,8 +3037,6 @@
3030
3037
  this.ngControl.updateValueAndValidity({ onlySelf: true });
3031
3038
  }
3032
3039
  };
3033
- // #endregion Protected Methods
3034
- // #region Private Methods
3035
3040
  SacBaseModelControl.prototype.UpdateLabelToControl = function () {
3036
3041
  // HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
3037
3042
  if (this.ngControl) {
@@ -3141,6 +3146,18 @@
3141
3146
  }
3142
3147
  }
3143
3148
  };
3149
+ SacBaseModelControl.prototype.setLabelSplitMode = function () {
3150
+ var _a;
3151
+ if (!this.splitlabelandhelptext) {
3152
+ if ((_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.splitlabelandhelptext) {
3153
+ this.splitlabelandhelptext = this.formlayout.splitlabelandhelptext;
3154
+ }
3155
+ else {
3156
+ this.splitlabelandhelptext =
3157
+ this.configurationService.SplitLabelAndHelptext;
3158
+ }
3159
+ }
3160
+ };
3144
3161
  return SacBaseModelControl;
3145
3162
  }());
3146
3163
  SacBaseModelControl.decorators = [
@@ -3165,6 +3182,7 @@
3165
3182
  labelSizeXs: [{ type: i0.Input }],
3166
3183
  labelSizeXxl: [{ type: i0.Input }],
3167
3184
  name: [{ type: i0.Input }],
3185
+ splitlabelandhelptext: [{ type: i0.Input }],
3168
3186
  inlineerrorenabled: [{ type: i0.Input }],
3169
3187
  label: [{ type: i0.Input }],
3170
3188
  value: [{ type: i0.Input }]
@@ -3278,6 +3296,19 @@
3278
3296
  };
3279
3297
  }
3280
3298
 
3299
+ function equalsValueValidator(requiredvalue, validationMessage, validationMessageSummary) {
3300
+ return function (control) {
3301
+ if (control.value !== requiredvalue) {
3302
+ var parameters = new Map();
3303
+ parameters.set('EQUALSVALUE', requiredvalue);
3304
+ return CreateValidationError('equals', validationMessage, validationMessageSummary, parameters);
3305
+ }
3306
+ else {
3307
+ return null;
3308
+ }
3309
+ };
3310
+ }
3311
+
3281
3312
  // #region Variables
3282
3313
  /**
3283
3314
  * Moment
@@ -3491,6 +3522,19 @@
3491
3522
  };
3492
3523
  }
3493
3524
 
3525
+ function notEqualsValueValidator(invalidValue, validationMessage, validationMessageSummary) {
3526
+ return function (control) {
3527
+ if (control.value === invalidValue) {
3528
+ var parameters = new Map();
3529
+ parameters.set('EQUALSVALUE', invalidValue);
3530
+ return CreateValidationError('notequals', validationMessage, validationMessageSummary, parameters);
3531
+ }
3532
+ else {
3533
+ return null;
3534
+ }
3535
+ };
3536
+ }
3537
+
3494
3538
  function patternValidator(pattern, validationMessage, validationMessageSummary) {
3495
3539
  return function (control) {
3496
3540
  var validator = forms.Validators.pattern(pattern);
@@ -3516,17 +3560,12 @@
3516
3560
  };
3517
3561
  }
3518
3562
 
3519
- /**
3520
- * Moment
3521
- */
3522
- var moment$1 = moment___default['default'];
3523
3563
  /**
3524
3564
  * Klasse mit Standard Validatoren
3525
3565
  */
3526
3566
  var Validation = /** @class */ (function () {
3527
3567
  function Validation() {
3528
3568
  }
3529
- // #region Public Static Methods
3530
3569
  /**
3531
3570
  * 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
3571
  * @param errorType Typ den Fehler
@@ -3550,6 +3589,18 @@
3550
3589
  Validation.email = function (validationMessage, validationMessageSummary) {
3551
3590
  return emailValidator(validationMessage, validationMessageSummary);
3552
3591
  };
3592
+ /**
3593
+ * Validator validate if value is the requiredValue
3594
+ * @param requiredValue Value that control should have
3595
+ * @param control Control to be validate
3596
+ * @param fieldName Label of control
3597
+ * @param validationMessage validation message near the control
3598
+ * @param validationMessageSummary validation inside the validation summary
3599
+
3600
+ */
3601
+ Validation.equals = function (requiredValue, validationMessage, validationMessageSummary) {
3602
+ return equalsValueValidator(requiredValue, validationMessage, validationMessageSummary);
3603
+ };
3553
3604
  /**
3554
3605
  * Validator der prüft ob der Wert ein Datum ist.
3555
3606
  * @param control Control mit IDateTimeControl Interface implementierung
@@ -3670,6 +3721,17 @@
3670
3721
  Validation.multilanguageRequiredAny = function (languages, validationMessage, validationMessageSummary) {
3671
3722
  return multilanguageRequiredAnyValidator(languages, validationMessage, validationMessageSummary);
3672
3723
  };
3724
+ /**
3725
+ * Validator validate if value is not the invalidValue
3726
+ * @param invalidValue Value that control doesn't should have
3727
+ * @param control Control to be validate
3728
+ * @param fieldName Label of control
3729
+ * @param validationMessage validation message near the control
3730
+ * @param validationMessageSummary validation inside the validation summary
3731
+ */
3732
+ Validation.notequals = function (invalidValue, validationMessage, validationMessageSummary) {
3733
+ return notEqualsValueValidator(invalidValue, validationMessage, validationMessageSummary);
3734
+ };
3673
3735
  /**
3674
3736
  * Validierung mit einem RegEx Pattern
3675
3737
  * @param control Control das validiert werden soll.
@@ -3692,7 +3754,11 @@
3692
3754
  return requiredValidator(validationMessage, validationMessageSummary);
3693
3755
  };
3694
3756
  return Validation;
3695
- }());
3757
+ }());
3758
+ /**
3759
+ * Moment
3760
+ */
3761
+ var moment$1 = moment___default['default'];
3696
3762
 
3697
3763
  /**
3698
3764
  * Basis Komponente für SacRadiobuttonsCommon. Extends SacBaseModelControl
@@ -3810,59 +3876,66 @@
3810
3876
  * Basis Komponente für SacRadiobutton.
3811
3877
  */
3812
3878
  var SacRadiobuttonCommon = /** @class */ (function () {
3879
+ // #endregion Properties
3880
+ // #region Constructors
3813
3881
  /**
3814
3882
  * Konstruktor
3815
3883
  * @param SacRadioButtons
3884
+ * @param formlayout SacFormLayoutCommon to define scoped layout settings
3885
+ * @param injector Injector for injecting services
3816
3886
  */
3817
- function SacRadiobuttonCommon(sacRadioButtons) {
3887
+ function SacRadiobuttonCommon(sacRadioButtons, formlayout, injector) {
3818
3888
  this.sacRadioButtons = sacRadioButtons;
3889
+ this.injector = injector;
3890
+ // #region Properties
3819
3891
  /**
3820
- * ControlHeight enum for use in HTML markup
3892
+ * Boolean Property zum Ausblenden des Controls; default Wert - false
3821
3893
  */
3822
- this.ControlHeight = exports.ControlHeight;
3894
+ this._hidden = false;
3823
3895
  /**
3824
- * Output Event
3896
+ * Form layout instance if exists
3825
3897
  */
3826
- this.onselectitem = new i0.EventEmitter();
3898
+ this.formlayout = null;
3827
3899
  /**
3828
- * Boolean Property zum Ausblenden des Controls; default Wert - false
3900
+ * public public public public public public public public public public public public public ControlHeight enum for use in HTML markup
3829
3901
  */
3830
- this._hidden = false;
3902
+ this.ControlHeight = exports.ControlHeight;
3831
3903
  /**
3832
3904
  * Unique Index für RadioButton
3833
3905
  */
3834
3906
  this._index = null;
3907
+ /**
3908
+ * Text to support the user during input.
3909
+ */
3910
+ this.helptext = '';
3911
+ /**
3912
+ * Output Event
3913
+ */
3914
+ this.onselectitem = new i0.EventEmitter();
3915
+ this.formlayout = formlayout;
3916
+ this.configurationService = injector.get(SACCONFIGURATION_SERVICE, new SacDefaultConfigurationService());
3917
+ this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
3835
3918
  // Registration des Controls in SacRadioButtons Container
3836
3919
  this.sacRadioButtons.RegisterRadioButton(this);
3837
3920
  }
3838
- Object.defineProperty(SacRadiobuttonCommon.prototype, "isDisabled", {
3921
+ Object.defineProperty(SacRadiobuttonCommon.prototype, "HelptextTooltipIcon", {
3922
+ // #endregion Constructors
3923
+ // #region Public Getters And Setters
3839
3924
  /**
3840
- * Methode ergibt Boolean, ob Control disabled ist
3925
+ * Get Icon for Helptext Tooltip
3841
3926
  */
3842
3927
  get: function () {
3843
- return this.disabled || this.sacRadioButtons.disabled;
3928
+ return this.iconService.GenericHelptextIcon;
3844
3929
  },
3845
3930
  enumerable: false,
3846
3931
  configurable: true
3847
3932
  });
3848
- Object.defineProperty(SacRadiobuttonCommon.prototype, "hidden", {
3849
- get: function () {
3850
- return this._hidden;
3851
- },
3933
+ Object.defineProperty(SacRadiobuttonCommon.prototype, "componentHeight", {
3852
3934
  /**
3853
- * Setter für hidden Property
3935
+ * define the control height from parent control
3854
3936
  */
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
- }
3937
+ get: function () {
3938
+ return this.sacRadioButtons.componentHeight;
3866
3939
  },
3867
3940
  enumerable: false,
3868
3941
  configurable: true
@@ -3872,9 +3945,7 @@
3872
3945
  * Getter für Unique Index
3873
3946
  */
3874
3947
  get: function () {
3875
- if (this._index === null &&
3876
- this.sacRadioButtons !== null &&
3877
- this.sacRadioButtons !== undefined) {
3948
+ if (this._index === null && this.sacRadioButtons !== null && this.sacRadioButtons !== undefined) {
3878
3949
  this._index = this.sacRadioButtons.GetRadionButtonIndex();
3879
3950
  }
3880
3951
  return this._index;
@@ -3892,18 +3963,49 @@
3892
3963
  enumerable: false,
3893
3964
  configurable: true
3894
3965
  });
3895
- Object.defineProperty(SacRadiobuttonCommon.prototype, "componentHeight", {
3896
- /**
3897
- * define the control height from parent control
3898
- */
3966
+ Object.defineProperty(SacRadiobuttonCommon.prototype, "hidden", {
3899
3967
  get: function () {
3900
- return this.sacRadioButtons.componentHeight;
3968
+ return this._hidden;
3901
3969
  },
3902
- enumerable: false,
3903
- configurable: true
3970
+ /**
3971
+ * Setter für hidden Property
3972
+ */
3973
+ set: function (v) {
3974
+ if (v === null || v === undefined || typeof v === 'boolean') {
3975
+ this._hidden = v;
3976
+ }
3977
+ else {
3978
+ this._hidden = v === 'true';
3979
+ }
3980
+ // Model Reset falls RadioButton selektiert war
3981
+ if (this._hidden && this.checked) {
3982
+ this.sacRadioButtons.SelectItem(null);
3983
+ }
3984
+ },
3985
+ enumerable: false,
3986
+ configurable: true
3904
3987
  });
3905
- //#endregion
3906
- //#region Control Events
3988
+ Object.defineProperty(SacRadiobuttonCommon.prototype, "isDisabled", {
3989
+ /**
3990
+ * Methode ergibt Boolean, ob Control disabled ist
3991
+ */
3992
+ get: function () {
3993
+ return this.disabled || this.sacRadioButtons.disabled;
3994
+ },
3995
+ enumerable: false,
3996
+ configurable: true
3997
+ });
3998
+ // #endregion Public Getters And Setters
3999
+ // #region Public Methods
4000
+ /**
4001
+ * Event bei Änderungen
4002
+ */
4003
+ SacRadiobuttonCommon.prototype.ChangeEvent = function () {
4004
+ if (!this.disabled) {
4005
+ this.sacRadioButtons.SelectItem(this.value);
4006
+ this.onselectitem.emit();
4007
+ }
4008
+ };
3907
4009
  /**
3908
4010
  * Event wenn die Komponente zerstört wird
3909
4011
  */
@@ -3911,14 +4013,24 @@
3911
4013
  // De-Registration des Controls in SacRadioButtons Container
3912
4014
  this.sacRadioButtons.UnregisterRadioButton(this);
3913
4015
  };
3914
- //#endregion
4016
+ SacRadiobuttonCommon.prototype.ngOnInit = function () {
4017
+ // set method to display helptext
4018
+ this.setHelpTextMode();
4019
+ };
4020
+ // #endregion Public Methods
4021
+ // #region Private Methods
3915
4022
  /**
3916
- * Event bei Änderungen
4023
+ * Set mode for helptext. Can be tooltip or text
3917
4024
  */
3918
- SacRadiobuttonCommon.prototype.ChangeEvent = function () {
3919
- if (!this.disabled) {
3920
- this.sacRadioButtons.SelectItem(this.value);
3921
- this.onselectitem.emit();
4025
+ SacRadiobuttonCommon.prototype.setHelpTextMode = function () {
4026
+ var _a;
4027
+ if (!this.helptextmode) {
4028
+ if ((_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.helptextmode) {
4029
+ this.helptextmode = this.formlayout.helptextmode;
4030
+ }
4031
+ else {
4032
+ this.helptextmode = this.configurationService.HelptextMode;
4033
+ }
3922
4034
  }
3923
4035
  };
3924
4036
  return SacRadiobuttonCommon;
@@ -3927,24 +4039,26 @@
3927
4039
  { type: i0.Directive }
3928
4040
  ];
3929
4041
  SacRadiobuttonCommon.ctorParameters = function () { return [
3930
- { type: SacRadiobuttonsCommon }
4042
+ { type: SacRadiobuttonsCommon },
4043
+ { type: SacFormLayoutCommon, decorators: [{ type: i0.Host }] },
4044
+ { type: i0.Injector }
3931
4045
  ]; };
3932
4046
  SacRadiobuttonCommon.propDecorators = {
3933
- value: [{ type: i0.Input }],
3934
- label: [{ type: i0.Input }],
3935
4047
  checked: [{ type: i0.Input }],
3936
4048
  disabled: [{ type: i0.Input }],
4049
+ helptext: [{ type: i0.Input }],
4050
+ helptextmode: [{ type: i0.Input }],
4051
+ label: [{ type: i0.Input }],
4052
+ labeltemplate: [{ type: i0.Input }],
3937
4053
  onselectitem: [{ type: i0.Output }],
3938
- hidden: [{ type: i0.Input }],
3939
- labeltemplate: [{ type: i0.Input }]
4054
+ value: [{ type: i0.Input }],
4055
+ hidden: [{ type: i0.Input }]
3940
4056
  };
3941
4057
 
3942
4058
  /**
3943
4059
  * Base Komponente für Dialog
3944
4060
  */
3945
4061
  var SacDialogCommon = /** @class */ (function () {
3946
- // #endregion
3947
- // #region Constructor
3948
4062
  /**
3949
4063
  * Konstruktor
3950
4064
  * Inject des Formulars
@@ -3961,11 +4075,6 @@
3961
4075
  * Die akzeptabel keywordssind: 'small', 'large', 'extralarge', 'medium', ''.
3962
4076
  */
3963
4077
  this._size = '';
3964
- // #region Properties
3965
- /**
3966
- * Input Property. Erhält den Title des Dialog. Default Value: 'Dialog'.
3967
- */
3968
- this.title = 'Dialog';
3969
4078
  /**
3970
4079
  * Das input property akzeptiert boolen Wert. Definiert ob das Dialog darf durch ESC geschlossen werden. Default ist true.
3971
4080
  */
@@ -3974,26 +4083,22 @@
3974
4083
  * Das input property akzeptiert boolen Wert. Definiert ob das Dialog darf durch click außerhalb des Dialog-Fenster geschlossen werden. Default ist true.
3975
4084
  */
3976
4085
  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
4086
  /**
3982
4087
  * Steuert ob im Header des Dialogs ein Button angezeigt wird.
3983
4088
  */
3984
4089
  this.closebutton = true;
3985
4090
  /**
3986
- * Input Property. Erhält die Breite des Dialog
4091
+ * Output Emitter. Wird aufgerufen, wenn das Wert des _show property geändert ist - damait das Dialog geöfnet/geschlossen wird.
3987
4092
  */
3988
- this.width = null;
4093
+ this.isvisibleChange = new i0.EventEmitter();
3989
4094
  /**
3990
- * Definiert eine feste Höhe beim Dialog.
4095
+ * Input Property. Erhält den Namen des Dialog - benutzt für das ID. Default Value: ''
3991
4096
  */
3992
- this.height = null;
4097
+ this.name = '';
3993
4098
  /**
3994
- * Output Emitter. Wird aufgerufen, wenn das Wert des _show property geändert ist - damait das Dialog geöfnet/geschlossen wird.
4099
+ * Input Property. Erhält den Title des Dialog. Default Value: 'Dialog'.
3995
4100
  */
3996
- this.isvisibleChange = new i0.EventEmitter();
4101
+ this.title = 'Dialog';
3997
4102
  }
3998
4103
  Object.defineProperty(SacDialogCommon.prototype, "dialogElementSetter", {
3999
4104
  /**
@@ -4005,20 +4110,6 @@
4005
4110
  enumerable: false,
4006
4111
  configurable: true
4007
4112
  });
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
4113
  Object.defineProperty(SacDialogCommon.prototype, "isvisible", {
4023
4114
  /**
4024
4115
  * Getter. Ergibt das boolen Wert des _show property
@@ -4047,76 +4138,49 @@
4047
4138
  enumerable: false,
4048
4139
  configurable: true
4049
4140
  });
4141
+ Object.defineProperty(SacDialogCommon.prototype, "size", {
4142
+ /**
4143
+ * Das Input akzeptiert sowohl default size-css-Klassen als auch custom Klassen.
4144
+ * case insensitive.
4145
+ * Die akzeptabel default-size-Klassen sind: 'small', 'large', 'extralarge', 'medium', ''.
4146
+ * Wenn size ist NICHT gesetzt (oder 'medium' oder ''), default ist in medium size: max-width 500px.
4147
+ */
4148
+ set: function (v) {
4149
+ this._size = v;
4150
+ },
4151
+ enumerable: false,
4152
+ configurable: true
4153
+ });
4154
+ Object.defineProperty(SacDialogCommon.prototype, "ChangeDetector", {
4155
+ /**
4156
+ * Getter for ChangeDetector.
4157
+ */
4158
+ get: function () {
4159
+ return this.cdRef;
4160
+ },
4161
+ enumerable: false,
4162
+ configurable: true
4163
+ });
4050
4164
  /**
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
4165
+ * Die Methode setz den Wert des _show property auf false
4077
4166
  */
4078
- SacDialogCommon.prototype.ngOnDestroy = function () {
4167
+ SacDialogCommon.prototype.hide = function () {
4079
4168
  if (this.hasSetBodyTag && document.body.classList.contains('modal-open')) {
4080
4169
  document.body.classList.remove('modal-open');
4081
4170
  this.hasSetBodyTag = false;
4082
4171
  }
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
- }
4172
+ this._show = false;
4095
4173
  this.isvisibleChange.emit(this._show);
4096
4174
  };
4097
4175
  /**
4098
- * Die Methode setz den Wert des _show property auf false
4176
+ * Methode wenn Componente entfernt wird
4099
4177
  */
4100
- SacDialogCommon.prototype.hide = function () {
4178
+ SacDialogCommon.prototype.ngOnDestroy = function () {
4101
4179
  if (this.hasSetBodyTag && document.body.classList.contains('modal-open')) {
4102
4180
  document.body.classList.remove('modal-open');
4103
4181
  this.hasSetBodyTag = false;
4104
4182
  }
4105
- this._show = false;
4106
- this.isvisibleChange.emit(this._show);
4107
4183
  };
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
4184
  /**
4121
4185
  * Allow Close by Click outside Dialog
4122
4186
  */
@@ -4138,6 +4202,18 @@
4138
4202
  this.hide();
4139
4203
  }
4140
4204
  };
4205
+ /**
4206
+ * Die Methode setz den Wert des _show property auf true
4207
+ */
4208
+ SacDialogCommon.prototype.show = function () {
4209
+ this._show = true;
4210
+ if (!this.hasSetBodyTag &&
4211
+ !document.body.classList.contains('modal-open')) {
4212
+ document.body.classList.add('modal-open');
4213
+ this.hasSetBodyTag = true;
4214
+ }
4215
+ this.isvisibleChange.emit(this._show);
4216
+ };
4141
4217
  return SacDialogCommon;
4142
4218
  }());
4143
4219
  SacDialogCommon.decorators = [
@@ -4147,17 +4223,15 @@
4147
4223
  { type: i0.ChangeDetectorRef }
4148
4224
  ]; };
4149
4225
  SacDialogCommon.propDecorators = {
4150
- dialogElementSetter: [{ type: i0.ViewChild, args: ['dialog', { static: false },] }],
4151
- title: [{ type: i0.Input }],
4152
4226
  allowesc: [{ type: i0.Input }],
4153
4227
  backdrop: [{ type: i0.Input }],
4154
- name: [{ type: i0.Input }],
4155
4228
  closebutton: [{ type: i0.Input }],
4156
- width: [{ type: i0.Input }],
4157
- height: [{ type: i0.Input }],
4158
- size: [{ type: i0.Input }],
4159
4229
  isvisibleChange: [{ type: i0.Output }],
4230
+ name: [{ type: i0.Input }],
4231
+ title: [{ type: i0.Input }],
4232
+ dialogElementSetter: [{ type: i0.ViewChild, args: ['dialog', { static: false },] }],
4160
4233
  isvisible: [{ type: i0.Input }],
4234
+ size: [{ type: i0.Input }],
4161
4235
  onClick: [{ type: i0.HostListener, args: ['click', ['$event'],] }],
4162
4236
  onKeydownHandler: [{ type: i0.HostListener, args: ['document:keydown', ['$event'],] }]
4163
4237
  };
@@ -4385,14 +4459,29 @@
4385
4459
  groupitems: [{ type: i0.Input }]
4386
4460
  };
4387
4461
 
4388
- // #region Classes
4462
+ /**
4463
+ * Function um ein Key Value Pair für das Dropdown zu erzeugen
4464
+ * @param id ID
4465
+ * @param value Wert der an das Element gebunden werden soll
4466
+ */
4467
+ function _buildValueString(id, value) {
4468
+ // Wenn ID null ist Object zurückgeben
4469
+ if (id == null) {
4470
+ return "" + value;
4471
+ }
4472
+ // Mapping Objekt zu String
4473
+ if (value && typeof value === 'object') {
4474
+ value = 'Object';
4475
+ }
4476
+ // String als ID
4477
+ return (id + ": " + value).slice(0, 50);
4478
+ }
4479
+
4389
4480
  /**
4390
4481
  * Base Dropdown Komponente
4391
4482
  */
4392
4483
  var SacDropdownCommon = /** @class */ (function (_super) {
4393
4484
  __extends(SacDropdownCommon, _super);
4394
- // #endregion Properties
4395
- // #region Constructors
4396
4485
  /**
4397
4486
  * Constructor
4398
4487
  * @param formlayout SacFormLayoutCommon to define scoped layout settings
@@ -4404,11 +4493,18 @@
4404
4493
  var _this = _super.call(this, formlayout, injector) || this;
4405
4494
  _this.renderer = renderer;
4406
4495
  _this.elementRef = elementRef;
4407
- // #region Properties
4408
4496
  /**
4409
4497
  * compareWith-Funktion
4410
4498
  */
4411
4499
  _this._compareWith = Object.is;
4500
+ /**
4501
+ * Counter vom OptionID; default Wert = 0
4502
+ */
4503
+ _this._optionIdCounter = 0;
4504
+ /**
4505
+ * OptionMap
4506
+ */
4507
+ _this._optionMap = new Map();
4412
4508
  /**
4413
4509
  * Label Text für Empty Item
4414
4510
  */
@@ -4425,19 +4521,9 @@
4425
4521
  * Resource Key für Validation Message Required in Validation Summary
4426
4522
  */
4427
4523
  _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
4524
  return _this;
4437
4525
  }
4438
4526
  Object.defineProperty(SacDropdownCommon.prototype, "comparewith", {
4439
- // #endregion Constructors
4440
- // #region Public Getters And Setters
4441
4527
  /**
4442
4528
  * compareWith-Funktion
4443
4529
  */
@@ -4450,8 +4536,6 @@
4450
4536
  enumerable: false,
4451
4537
  configurable: true
4452
4538
  });
4453
- // #endregion Public Getters And Setters
4454
- // #region Public Methods
4455
4539
  /**
4456
4540
  * Registriert das OptionID-Counter als String
4457
4541
  */
@@ -4486,6 +4570,12 @@
4486
4570
  if (this.isrequired) {
4487
4571
  error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
4488
4572
  }
4573
+ if (error) {
4574
+ return error;
4575
+ }
4576
+ if (this.isrequired && this.emptyvalue !== null) {
4577
+ error = Validation.notequals(this.emptyvalue, this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
4578
+ }
4489
4579
  return error;
4490
4580
  };
4491
4581
  /**
@@ -4496,8 +4586,6 @@
4496
4586
  this.setSelectedValue(value);
4497
4587
  _super.prototype.writeValue.call(this, value);
4498
4588
  };
4499
- // #endregion Public Methods
4500
- // #region Private Methods
4501
4589
  /**
4502
4590
  * ID extrahieren
4503
4591
  * @param valueString String bei welchem die ID Extrahiert werden soll
@@ -4572,13 +4660,12 @@
4572
4660
  validationmessagerequired: [{ type: i0.Input }],
4573
4661
  validationmessagesummaryrequired: [{ type: i0.Input }],
4574
4662
  comparewith: [{ type: i0.Input }]
4575
- };
4663
+ };
4664
+
4576
4665
  /**
4577
4666
  * SacDropdownOption-Klasse
4578
4667
  */
4579
4668
  var SacDropdownOptionCommon = /** @class */ (function () {
4580
- // #endregion Properties
4581
- // #region Constructors
4582
4669
  /**
4583
4670
  * Konstruktor
4584
4671
  * @param _element Referenz auf HTML Element
@@ -4589,7 +4676,6 @@
4589
4676
  this._element = _element;
4590
4677
  this._renderer = _renderer;
4591
4678
  this._dropdown = _dropdown;
4592
- // #region Properties
4593
4679
  /**
4594
4680
  * ID-String
4595
4681
  */
@@ -4599,8 +4685,6 @@
4599
4685
  }
4600
4686
  }
4601
4687
  Object.defineProperty(SacDropdownOptionCommon.prototype, "ngValue", {
4602
- // #endregion Constructors
4603
- // #region Public Getters And Setters
4604
4688
  /**
4605
4689
  * Option ngValue
4606
4690
  */
@@ -4626,8 +4710,6 @@
4626
4710
  enumerable: false,
4627
4711
  configurable: true
4628
4712
  });
4629
- // #endregion Public Getters And Setters
4630
- // #region Public Methods
4631
4713
  /**
4632
4714
  * Den Wert vom Option-Element einstellen
4633
4715
  * @param value Wert
@@ -4656,32 +4738,12 @@
4656
4738
  SacDropdownOptionCommon.propDecorators = {
4657
4739
  ngValue: [{ type: i0.Input }],
4658
4740
  value: [{ type: i0.Input }]
4659
- };
4660
- // #endregion Classes
4661
- // #region Functions
4741
+ };
4742
+
4743
+ // #endregion Interfaces
4744
+ // #region Classes
4662
4745
  /**
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
4680
-
4681
- // #endregion Interfaces
4682
- // #region Classes
4683
- /**
4684
- * Basis Komponente für SacListboxOption
4746
+ * Basis Komponente für SacListboxOption
4685
4747
  */
4686
4748
  var SacListboxOptionCommon = /** @class */ (function () {
4687
4749
  // #endregion Properties
@@ -6097,6 +6159,10 @@
6097
6159
  this.grid = grid;
6098
6160
  this.injector = injector;
6099
6161
  this.el = el;
6162
+ /**
6163
+ * Click on Column Element
6164
+ */
6165
+ this.rowclicked = new i0.EventEmitter();
6100
6166
  this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
6101
6167
  }
6102
6168
  Object.defineProperty(SacGridColumnBaseCommon.prototype, "IconSortDown", {
@@ -6123,6 +6189,12 @@
6123
6189
  });
6124
6190
  // #endregion Public Getters And Setters
6125
6191
  // #region Public Methods
6192
+ /**
6193
+ * Method when Colument element is clicked. Triggers a RowClicked
6194
+ */
6195
+ SacGridColumnBaseCommon.prototype.ColumnClick = function () {
6196
+ this.rowclicked.emit();
6197
+ };
6126
6198
  /**
6127
6199
  * Indicates the direction of sorting. The possible values are `none`,`asc`,`desc`
6128
6200
  */
@@ -6210,7 +6282,8 @@
6210
6282
  sortkey: [{ type: i0.Input }],
6211
6283
  type: [{ type: i0.Input }],
6212
6284
  value: [{ type: i0.Input }],
6213
- width: [{ type: i0.Input }]
6285
+ width: [{ type: i0.Input }],
6286
+ rowclicked: [{ type: i0.Output }]
6214
6287
  };
6215
6288
 
6216
6289
  /**
@@ -6579,9 +6652,370 @@
6579
6652
  };
6580
6653
 
6581
6654
  /**
6582
- * Moment
6655
+ * Enum für Tooltip Positionen
6583
6656
  */
6584
- var moment$2 = moment___default['default'];
6657
+ (function (TooltipPosition) {
6658
+ TooltipPosition[TooltipPosition["none"] = 0] = "none";
6659
+ // tslint:disable-next-line:no-bitwise
6660
+ TooltipPosition[TooltipPosition["top"] = 1] = "top";
6661
+ // tslint:disable-next-line:no-bitwise
6662
+ TooltipPosition[TooltipPosition["right"] = 2] = "right";
6663
+ // tslint:disable-next-line:no-bitwise
6664
+ TooltipPosition[TooltipPosition["bottom"] = 4] = "bottom";
6665
+ // tslint:disable-next-line:no-bitwise
6666
+ TooltipPosition[TooltipPosition["left"] = 8] = "left";
6667
+ // tslint:disable-next-line:no-bitwise
6668
+ TooltipPosition[TooltipPosition["topend"] = 16] = "topend";
6669
+ // tslint:disable-next-line:no-bitwise
6670
+ TooltipPosition[TooltipPosition["bottomend"] = 32] = "bottomend";
6671
+ })(exports.TooltipPosition || (exports.TooltipPosition = {}));
6672
+
6673
+ var PopUpHelper = /** @class */ (function () {
6674
+ function PopUpHelper() {
6675
+ }
6676
+ // #region Public Methods
6677
+ PopUpHelper.prototype.getContainerHeight = function (referenceContainer, referenceIsContainer) {
6678
+ if (referenceContainer) {
6679
+ return referenceIsContainer
6680
+ ? referenceContainer.nativeElement.firstElementChild.clientHeight
6681
+ : referenceContainer.nativeElement.offsetHeight;
6682
+ }
6683
+ else {
6684
+ return 0;
6685
+ }
6686
+ };
6687
+ PopUpHelper.prototype.getContainerWidth = function (referenceContainer, referenceIsContainer) {
6688
+ if (referenceContainer) {
6689
+ return referenceIsContainer
6690
+ ? referenceContainer.nativeElement.firstElementChild.clientWidth
6691
+ : referenceContainer.nativeElement.offsetWidth;
6692
+ }
6693
+ else {
6694
+ return 0;
6695
+ }
6696
+ };
6697
+ /**
6698
+ * Get Position who the popup would be positioned
6699
+ *
6700
+ * @param referenceContainer Element Reference to HTML Element which is the reference to positioning the popup
6701
+ * @param popupcontentcontainer Element Reference to container of popup
6702
+ * @param popupOffset Offset for popup positioning
6703
+ * @param allowedPositions Allowed Positions for the popup
6704
+ * @returns Returns the position where the popup should be displayed
6705
+ */
6706
+ PopUpHelper.prototype.getDisplayPosition = function (referenceContainer, popupcontentcontainer, arrowWidth, arrowHeight, allowedPositions, referenceIsContainer) {
6707
+ var validPositions = this.validatePositions(referenceContainer, popupcontentcontainer, arrowWidth, arrowHeight, referenceIsContainer);
6708
+ // tslint:disable-next-line:no-bitwise
6709
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.right) && validPositions & exports.TooltipPosition.right) {
6710
+ return exports.TooltipPosition.right;
6711
+ }
6712
+ // tslint:disable-next-line:no-bitwise
6713
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.top) && validPositions & exports.TooltipPosition.top) {
6714
+ return exports.TooltipPosition.top;
6715
+ }
6716
+ // tslint:disable-next-line:no-bitwise
6717
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.left) && validPositions & exports.TooltipPosition.left) {
6718
+ return exports.TooltipPosition.left;
6719
+ }
6720
+ // tslint:disable-next-line:no-bitwise
6721
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.bottom) && validPositions & exports.TooltipPosition.bottom) {
6722
+ return exports.TooltipPosition.bottom;
6723
+ }
6724
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.topend) && validPositions & exports.TooltipPosition.topend) {
6725
+ return exports.TooltipPosition.topend;
6726
+ }
6727
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.bottomend) &&
6728
+ validPositions & exports.TooltipPosition.bottomend) {
6729
+ return exports.TooltipPosition.bottomend;
6730
+ }
6731
+ // Get Auto Position or Default
6732
+ if (this.isAutoPosition(allowedPositions)) {
6733
+ // tslint:disable-next-line:no-bitwise
6734
+ if (validPositions & exports.TooltipPosition.right) {
6735
+ return exports.TooltipPosition.right;
6736
+ }
6737
+ // tslint:disable-next-line:no-bitwise
6738
+ if (validPositions & exports.TooltipPosition.top) {
6739
+ return exports.TooltipPosition.top;
6740
+ }
6741
+ // tslint:disable-next-line:no-bitwise
6742
+ if (validPositions & exports.TooltipPosition.left) {
6743
+ return exports.TooltipPosition.left;
6744
+ }
6745
+ // tslint:disable-next-line:no-bitwise
6746
+ if (validPositions & exports.TooltipPosition.bottom) {
6747
+ return exports.TooltipPosition.bottom;
6748
+ }
6749
+ return exports.TooltipPosition.right;
6750
+ }
6751
+ else {
6752
+ return this.getPosition(allowedPositions);
6753
+ }
6754
+ };
6755
+ /**
6756
+ * Calculates the height of the popup
6757
+ *
6758
+ * @param container Element Reference to container of popup
6759
+ */
6760
+ PopUpHelper.prototype.getPopupHeight = function (container) {
6761
+ var _a;
6762
+ if (container) {
6763
+ return (_a = container.nativeElement.firstElementChild.clientHeight) !== null && _a !== void 0 ? _a : 0;
6764
+ }
6765
+ else {
6766
+ return 0;
6767
+ }
6768
+ };
6769
+ /**
6770
+ * Calculates the width of the popup
6771
+ *
6772
+ * @param container Element Reference to container of popup
6773
+ */
6774
+ PopUpHelper.prototype.getPopupWidth = function (container) {
6775
+ if (container) {
6776
+ return container.nativeElement.firstElementChild.clientWidth;
6777
+ }
6778
+ else {
6779
+ return 0;
6780
+ }
6781
+ };
6782
+ /**
6783
+ * Returns the defined position for the tooltip
6784
+ *
6785
+ * @param allowedPositions Allowed positions defined in markup for popup
6786
+ */
6787
+ PopUpHelper.prototype.getPosition = function (allowedPositions) {
6788
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.left)) {
6789
+ return exports.TooltipPosition.left;
6790
+ }
6791
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.top)) {
6792
+ return exports.TooltipPosition.top;
6793
+ }
6794
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.right)) {
6795
+ return exports.TooltipPosition.right;
6796
+ }
6797
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.bottom)) {
6798
+ return exports.TooltipPosition.bottom;
6799
+ }
6800
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.topend)) {
6801
+ return exports.TooltipPosition.topend;
6802
+ }
6803
+ if (this.hasPosition(allowedPositions, exports.TooltipPosition.bottomend)) {
6804
+ return exports.TooltipPosition.bottomend;
6805
+ }
6806
+ // Default Position if empty
6807
+ return exports.TooltipPosition.right;
6808
+ };
6809
+ /**
6810
+ * Calculates the position of the tooltip from links
6811
+ *
6812
+ * @param controlReference Element Reference to angular component
6813
+ * @param popupContainer Element Reference to container of popup
6814
+ * @param referenceContainer Element Reference to HTML Element which is the reference to positioning the popup
6815
+ * @param popupOffset Offset for popup positioning
6816
+ * @param requestedPosition Requested Position by Control
6817
+ */
6818
+ PopUpHelper.prototype.getPositionLeft = function (referenceContainer, popupContainer, controlReference, arrowWidth, arrowHeight, requestedPosition, referenceIsContainer) {
6819
+ if (referenceContainer !== null && referenceContainer !== undefined) {
6820
+ var item = referenceContainer.nativeElement;
6821
+ if (item.children.length >= 1) {
6822
+ var childItem = referenceIsContainer ? item.firstElementChild : item;
6823
+ var contentPosition = childItem.getBoundingClientRect();
6824
+ switch (this.getDisplayPosition(referenceContainer, popupContainer, arrowWidth, arrowHeight, requestedPosition, referenceIsContainer)) {
6825
+ case exports.TooltipPosition.top:
6826
+ case exports.TooltipPosition.bottom:
6827
+ return (contentPosition.left + contentPosition.width / 2 - this.getPopupWidth(popupContainer) / 2);
6828
+ case exports.TooltipPosition.topend:
6829
+ case exports.TooltipPosition.bottomend:
6830
+ return contentPosition.left + contentPosition.width - this.getPopupWidth(popupContainer);
6831
+ case exports.TooltipPosition.right:
6832
+ return contentPosition.left + contentPosition.width + arrowWidth / 2;
6833
+ case exports.TooltipPosition.left:
6834
+ return contentPosition.left - this.getPopupWidth(popupContainer) + (arrowWidth / 2) * -1;
6835
+ }
6836
+ return referenceContainer.nativeElement.offsetTop;
6837
+ }
6838
+ else {
6839
+ return referenceContainer.nativeElement.offsetTop;
6840
+ }
6841
+ }
6842
+ else {
6843
+ return controlReference.nativeElement.offsetLeft;
6844
+ }
6845
+ };
6846
+ /**
6847
+ * Calculates the position of the tooltip from the top
6848
+ *
6849
+ * @param controlReference Element Reference to angular component
6850
+ * @param popupContainer Element Reference to container of popup
6851
+ * @param referenceContainer Element Reference to HTML Element which is the reference to positioning the popup
6852
+ * @param popupOffset Offset for popup positioning
6853
+ * @param requestedPosition Requested Position by Control
6854
+ */
6855
+ PopUpHelper.prototype.getPositionTop = function (referenceContainer, popupContainer, controlReference, arrowWidth, arrowHeight, requestedPosition, referenceIsContainer) {
6856
+ if (referenceContainer !== null && referenceContainer !== undefined) {
6857
+ var item = referenceContainer.nativeElement;
6858
+ if (item.children.length >= 1) {
6859
+ var childItem = referenceIsContainer ? item.firstElementChild : item;
6860
+ var contentPosition = childItem.getBoundingClientRect();
6861
+ // Get Position with Scroll (Scrollbars inside page should be substracted)
6862
+ var contentPositionTop = childItem.offsetTop +
6863
+ this.getOffsetTopParent(childItem.offsetParent) +
6864
+ this.getScrollTopParent(childItem.parentElement);
6865
+ switch (this.getDisplayPosition(referenceContainer, popupContainer, arrowWidth, arrowHeight, requestedPosition, referenceIsContainer)) {
6866
+ case exports.TooltipPosition.top:
6867
+ case exports.TooltipPosition.topend:
6868
+ return contentPositionTop - this.getPopupHeight(popupContainer) + (arrowHeight / 2) * -1;
6869
+ case exports.TooltipPosition.right:
6870
+ case exports.TooltipPosition.left:
6871
+ return (contentPositionTop + contentPosition.height / 2 - this.getPopupHeight(popupContainer) / 2);
6872
+ case exports.TooltipPosition.bottom:
6873
+ case exports.TooltipPosition.bottomend:
6874
+ return contentPositionTop + contentPosition.height + arrowHeight / 2;
6875
+ }
6876
+ return (childItem.clientTop +
6877
+ childItem.offsetTop -
6878
+ (this.getPopupHeight(popupContainer) / 2 - childItem.offsetHeight / 2));
6879
+ }
6880
+ else {
6881
+ return referenceContainer.nativeElement.offsetTop;
6882
+ }
6883
+ }
6884
+ else {
6885
+ return controlReference.nativeElement.offsetTop;
6886
+ }
6887
+ };
6888
+ /**
6889
+ * Returns whether the position has been configured
6890
+ *
6891
+ * @param allowedPositions Positions that allowed by control
6892
+ * @param requestedPosition Position to be checked
6893
+ */
6894
+ PopUpHelper.prototype.hasPosition = function (allowedPositions, requestedPosition) {
6895
+ var positions = allowedPositions.split('|');
6896
+ if (requestedPosition === exports.TooltipPosition.right && positions.indexOf('right') >= 0) {
6897
+ return true;
6898
+ }
6899
+ if (requestedPosition === exports.TooltipPosition.top && positions.indexOf('top') >= 0) {
6900
+ return true;
6901
+ }
6902
+ if (requestedPosition === exports.TooltipPosition.left && positions.indexOf('left') >= 0) {
6903
+ return true;
6904
+ }
6905
+ if (requestedPosition === exports.TooltipPosition.bottom && positions.indexOf('bottom') >= 0) {
6906
+ return true;
6907
+ }
6908
+ if (requestedPosition === exports.TooltipPosition.topend && positions.indexOf('topend') >= 0) {
6909
+ return true;
6910
+ }
6911
+ if (requestedPosition === exports.TooltipPosition.bottomend && positions.indexOf('bottomend') >= 0) {
6912
+ return true;
6913
+ }
6914
+ return false;
6915
+ };
6916
+ /**
6917
+ * Defines whether AutoPosition is active
6918
+ * @param positionProperty List of allowed positions
6919
+ */
6920
+ PopUpHelper.prototype.isAutoPosition = function (positionProperty) {
6921
+ var positions = positionProperty.split('|');
6922
+ return positions.indexOf('auto') >= 0;
6923
+ };
6924
+ /**
6925
+ * Checks whether the position is valid or whether the tooltip on the position has space
6926
+ */
6927
+ PopUpHelper.prototype.validatePositions = function (referenceContainer, popupcontentcontainer, arrowWidth, arrowHeight, referenceIsContainer) {
6928
+ // Check if Container is false
6929
+ if (popupcontentcontainer === undefined) {
6930
+ return exports.TooltipPosition.right;
6931
+ }
6932
+ var allowedPositions = exports.TooltipPosition.none;
6933
+ var basePosition = referenceIsContainer
6934
+ ? referenceContainer.nativeElement.firstElementChild.getBoundingClientRect()
6935
+ : referenceContainer.nativeElement.getBoundingClientRect();
6936
+ var tooltipRect = popupcontentcontainer.nativeElement.firstElementChild.getBoundingClientRect();
6937
+ var leftPosOk = basePosition.left - tooltipRect.width + arrowWidth * -1 > 0;
6938
+ var rightPosOk = basePosition.right + tooltipRect.width + arrowWidth < window.innerWidth;
6939
+ var topPosOk = basePosition.top - tooltipRect.height + arrowHeight > 0;
6940
+ var bottomPosOk = basePosition.bottom + tooltipRect.height + arrowHeight < window.innerHeight;
6941
+ var leftHalfPosOk = basePosition.left - tooltipRect.width / 2 > 0;
6942
+ var rightHalfPosOk = basePosition.right + tooltipRect.width / 2 < window.innerWidth;
6943
+ var topHalfPosOk = basePosition.top - tooltipRect.height / 2 > 0;
6944
+ var bottomHalfPosOk = basePosition.bottom + tooltipRect.height / 2 < window.innerHeight;
6945
+ if (leftPosOk && topPosOk) {
6946
+ // tslint:disable-next-line:no-bitwise
6947
+ allowedPositions = allowedPositions | exports.TooltipPosition.topend;
6948
+ }
6949
+ if (leftPosOk && bottomPosOk) {
6950
+ // tslint:disable-next-line:no-bitwise
6951
+ allowedPositions = allowedPositions | exports.TooltipPosition.bottomend;
6952
+ }
6953
+ if (leftPosOk && topHalfPosOk && bottomHalfPosOk) {
6954
+ // tslint:disable-next-line:no-bitwise
6955
+ allowedPositions = allowedPositions | exports.TooltipPosition.left;
6956
+ }
6957
+ if (rightPosOk && topHalfPosOk && bottomHalfPosOk) {
6958
+ // tslint:disable-next-line:no-bitwise
6959
+ allowedPositions = allowedPositions | exports.TooltipPosition.right;
6960
+ }
6961
+ if (topPosOk && leftHalfPosOk && rightHalfPosOk) {
6962
+ // tslint:disable-next-line:no-bitwise
6963
+ allowedPositions = allowedPositions | exports.TooltipPosition.top;
6964
+ }
6965
+ if (bottomPosOk && leftHalfPosOk && rightHalfPosOk) {
6966
+ // tslint:disable-next-line:no-bitwise
6967
+ allowedPositions = allowedPositions | exports.TooltipPosition.bottom;
6968
+ }
6969
+ return allowedPositions;
6970
+ };
6971
+ // #endregion Public Methods
6972
+ // #region Private Methods
6973
+ /**
6974
+ * Calculates the top of the page inside all elements
6975
+ * @param element HTML Element
6976
+ * @returns summarized top value for absolute position
6977
+ */
6978
+ PopUpHelper.prototype.getOffsetTopParent = function (element) {
6979
+ if (element === null) {
6980
+ return 0;
6981
+ }
6982
+ if (!element.offsetParent) {
6983
+ return element.offsetTop;
6984
+ }
6985
+ var parentValue = this.getOffsetTopParent(element.offsetParent);
6986
+ var offset = element.offsetTop;
6987
+ return parentValue + offset;
6988
+ };
6989
+ /**
6990
+ * Caclulate Scrollbars inside tree
6991
+ * @param element HTML Element
6992
+ * @param [isFixed=false] Invert Scroll Position value when style is fixed to preserve negative values
6993
+ * @returns Scroll top value of element with all childs
6994
+ */
6995
+ PopUpHelper.prototype.getScrollTopParent = function (element, isFixed) {
6996
+ if (isFixed === void 0) { isFixed = false; }
6997
+ if (element === null) {
6998
+ return 0;
6999
+ }
7000
+ // Body Scroll should not be calculated
7001
+ if (!element.parentElement) {
7002
+ return isFixed ? element.scrollTop : 0;
7003
+ }
7004
+ var isCurrentFixed = false;
7005
+ if (window.getComputedStyle(element).getPropertyValue('position') === 'fixed') {
7006
+ isCurrentFixed = true;
7007
+ }
7008
+ var parentValue = this.getScrollTopParent(element.parentElement, isFixed || isCurrentFixed);
7009
+ if (isFixed) {
7010
+ return parentValue + element.scrollTop;
7011
+ }
7012
+ else {
7013
+ return parentValue + element.scrollTop * -1;
7014
+ }
7015
+ };
7016
+ return PopUpHelper;
7017
+ }());
7018
+
6585
7019
  /**
6586
7020
  * Base Klasse für Date/Time Controls
6587
7021
  */
@@ -6595,22 +7029,65 @@
6595
7029
  * @param injector Injector for injecting services
6596
7030
  * @param elementRef reference to html element
6597
7031
  */
6598
- function SacBaseDateTimeControl(formlayout, injector, elementRef) {
7032
+ function SacBaseDateTimeControl(formlayout, injector, elementRef, cdRef) {
6599
7033
  var _this = _super.call(this, formlayout, injector) || this;
6600
7034
  _this.elementRef = elementRef;
7035
+ _this.cdRef = cdRef;
6601
7036
  // #region Properties
7037
+ /**
7038
+ * Helper class to display tooltip on correct position
7039
+ */
7040
+ _this.popupHelper = new PopUpHelper();
6602
7041
  /**
6603
7042
  * das property enthielt das Value als string. Default ist ''
6604
7043
  */
6605
- _this._valueAsString = '';
7044
+ _this._valueAsString = '';
7045
+ /**
7046
+ * Property for enum in Angular HTML template
7047
+ */
7048
+ _this.TooltipPosition = exports.TooltipPosition;
7049
+ /**
7050
+ * Definiert ob der Date Selector angezeigt wird
7051
+ */
7052
+ _this._showselector = false;
7053
+ /**
7054
+ * Definiert das Control als Required
7055
+ */
7056
+ _this.isrequired = false;
7057
+ /**
7058
+ * Moment JS Instance
7059
+ */
7060
+ _this.moment = moment___default['default'];
7061
+ /**
7062
+ * Arrow Item of Picker Element. Required to set the position of arrow correctly
7063
+ */
7064
+ _this.pickerPosition = exports.TooltipPosition;
7065
+ /**
7066
+ * TextBox Placeholder
7067
+ */
7068
+ _this.placeholder = null;
7069
+ /**
7070
+ * Position of the picker arrow at the left
7071
+ */
7072
+ _this.posArrowLeft = null;
7073
+ /**
7074
+ * Position of the picker arrow at the top
7075
+ */
7076
+ _this.posArrowTop = null;
7077
+ /**
7078
+ * Position of the picker at the left
7079
+ */
7080
+ _this.posPopupLeft = 0;
6606
7081
  /**
6607
- * Definiert das Control als Required
7082
+ * Position of the picker at the top
6608
7083
  */
6609
- _this.isrequired = false;
7084
+ _this.posPopupTop = 0;
6610
7085
  /**
6611
- * TextBox Placeholder
7086
+ * Position of the datetime picker. Values: left|top|right|bottom|auto
7087
+ *
7088
+ * Value 'auto' can be combined with another value.
6612
7089
  */
6613
- _this.placeholder = null;
7090
+ _this.position = 'bottomend|topend';
6614
7091
  /**
6615
7092
  * Resource Key für Validation Message DateTimeFormat bei Control
6616
7093
  */
@@ -6627,8 +7104,47 @@
6627
7104
  * Resource Key für Validation Message Required in Validation Summary
6628
7105
  */
6629
7106
  _this.validationmessagerequiredsummary = _this.validationKeyService.ValidationErrorSummaryRequired;
7107
+ // #endregion Protected Methods
7108
+ // #region Private Methods
7109
+ /**
7110
+ * method if content has changed and proportions need to be reset in the UI.
7111
+ */
7112
+ _this.onContentChange = function () {
7113
+ // Do nothing if is not visible
7114
+ if (!_this._showselector) {
7115
+ return;
7116
+ }
7117
+ setTimeout(function () {
7118
+ _this.getPositionLeft();
7119
+ _this.getPositionTop();
7120
+ });
7121
+ };
6630
7122
  return _this;
6631
7123
  }
7124
+ Object.defineProperty(SacBaseDateTimeControl.prototype, "picker", {
7125
+ // #endregion Constructors
7126
+ // #region Public Getters And Setters
7127
+ /**
7128
+ * Setter for the name of the container for the tooltip. Is required as the tooltip can be hidden via ngIf.
7129
+ */
7130
+ set: function (picker) {
7131
+ if (picker !== undefined) {
7132
+ document.body.appendChild(picker.nativeElement);
7133
+ }
7134
+ this.pickercontainer = picker;
7135
+ this.onContentChange();
7136
+ this.cdRef.detectChanges();
7137
+ },
7138
+ enumerable: false,
7139
+ configurable: true
7140
+ });
7141
+ Object.defineProperty(SacBaseDateTimeControl.prototype, "tooltop", {
7142
+ get: function () {
7143
+ return this.pickercontainer;
7144
+ },
7145
+ enumerable: false,
7146
+ configurable: true
7147
+ });
6632
7148
  Object.defineProperty(SacBaseDateTimeControl.prototype, "valuestring", {
6633
7149
  /**
6634
7150
  * getter für valuestring
@@ -6638,18 +7154,16 @@
6638
7154
  return this._valueAsString;
6639
7155
  }
6640
7156
  else {
6641
- var date = moment$2.utc(this.value);
7157
+ var date = this.moment.utc(this.value);
6642
7158
  return date.local().format(this.GetDateTimeFormatString());
6643
7159
  }
6644
7160
  },
6645
- // #endregion Constructors
6646
- // #region Public Getters And Setters
6647
7161
  /**
6648
7162
  * Das Input bekommt das value von typ string
6649
7163
  */
6650
7164
  set: function (v) {
6651
7165
  this._valueAsString = v;
6652
- var date = moment$2(v, [this.GetDateTimeFormatString()], true);
7166
+ var date = this.moment(v, [this.GetDateTimeFormatString()], true);
6653
7167
  date = this.ModifyParsedDateTimeValue(date).utc();
6654
7168
  if (date.isValid()) {
6655
7169
  this.value = date.toDate();
@@ -6661,8 +7175,12 @@
6661
7175
  enumerable: false,
6662
7176
  configurable: true
6663
7177
  });
6664
- // #endregion Public Getters And Setters
6665
- // #region Public Methods
7178
+ /**
7179
+ * Returns the position of the tooltip
7180
+ */
7181
+ SacBaseDateTimeControl.prototype.GetPickerPosition = function () {
7182
+ return this.popupHelper.getDisplayPosition(this.pickerbutton, this.pickercontainer, this.getArrowWidth(), this.getArrowHeight(), this.position, false);
7183
+ };
6666
7184
  /**
6667
7185
  * JSON Date String in ein UTC DateTime Object konvertieren, welches vom Control verwendete werden kann
6668
7186
  */
@@ -6674,14 +7192,37 @@
6674
7192
  var hours = date.getUTCHours();
6675
7193
  var minutes = date.getUTCMinutes();
6676
7194
  var seconds = date.getUTCSeconds();
6677
- return moment$2(Date.UTC(year, month, day, hours, minutes, seconds));
7195
+ return this.moment(Date.UTC(year, month, day, hours, minutes, seconds));
7196
+ };
7197
+ /**
7198
+ * Calculates the height of the tooltip
7199
+ */
7200
+ SacBaseDateTimeControl.prototype.getPickerHeight = function () {
7201
+ return this.popupHelper.getPopupHeight(this.pickercontainer);
7202
+ };
7203
+ /**
7204
+ * Calculates the width of the picker
7205
+ */
7206
+ SacBaseDateTimeControl.prototype.getPickerWidth = function () {
7207
+ return this.popupHelper.getPopupWidth(this.pickercontainer);
7208
+ };
7209
+ SacBaseDateTimeControl.prototype.ngDoCheck = function () {
7210
+ // this.onContentChange();
7211
+ };
7212
+ SacBaseDateTimeControl.prototype.ngOnDestroy = function () {
7213
+ // Unregister Event Listener
7214
+ window.removeEventListener('scroll', this.onContentChange, true);
7215
+ window.removeEventListener('resize', this.onContentChange, true);
6678
7216
  };
6679
7217
  /**
6680
7218
  * Init Event
6681
7219
  */
6682
- SacBaseDateTimeControl.prototype.ngAfterViewInit = function () {
6683
- _super.prototype.ngAfterViewInit.call(this);
6684
- this.SetDateTimeFormat();
7220
+ SacBaseDateTimeControl.prototype.ngOnInit = function () {
7221
+ _super.prototype.ngOnInit.call(this);
7222
+ this.setDateTimeFormat();
7223
+ // Register Event Listener
7224
+ window.addEventListener('scroll', this.onContentChange, true);
7225
+ window.addEventListener('resize', this.onContentChange, true);
6685
7226
  };
6686
7227
  /**
6687
7228
  * setzt das value von typ string zu property valuestring
@@ -6715,13 +7256,59 @@
6715
7256
  }
6716
7257
  _super.prototype.writeValue.call(this, this._value);
6717
7258
  };
6718
- // #endregion Public Abstract Methods
6719
- // #region Private Methods
6720
- SacBaseDateTimeControl.prototype.SetDateTimeFormat = function () {
7259
+ // #endregion Public Methods
7260
+ // #region Protected Methods
7261
+ SacBaseDateTimeControl.prototype.getArrowHeight = function () {
7262
+ return this.pickerarrow ? this.pickerarrow.nativeElement.offsetHeight : 0;
7263
+ };
7264
+ SacBaseDateTimeControl.prototype.getArrowWidth = function () {
7265
+ return this.pickerarrow ? this.pickerarrow.nativeElement.offsetWidth : 0;
7266
+ };
7267
+ /**
7268
+ * Calculates the position of the tooltip from links
7269
+ */
7270
+ SacBaseDateTimeControl.prototype.getPositionLeft = function () {
7271
+ var value = this.popupHelper.getPositionLeft(this.pickerbutton, this.pickercontainer, this.elementRef, this.getArrowWidth(), this.getArrowHeight(), this.position, false);
7272
+ this.posPopupLeft = value;
7273
+ switch (this.GetPickerPosition()) {
7274
+ case exports.TooltipPosition.top:
7275
+ case exports.TooltipPosition.bottom:
7276
+ this.posArrowLeft = this.getPickerWidth() / 2 - -this.getArrowWidth();
7277
+ break;
7278
+ case exports.TooltipPosition.topend:
7279
+ case exports.TooltipPosition.bottomend:
7280
+ this.posArrowLeft =
7281
+ this.getPickerWidth() -
7282
+ this.getArrowWidth() / 2 -
7283
+ this.popupHelper.getContainerWidth(this.pickerbutton, false) / 2;
7284
+ break;
7285
+ default:
7286
+ this.posArrowLeft = null;
7287
+ break;
7288
+ }
7289
+ return value;
7290
+ };
7291
+ /**
7292
+ * Calculates the position of the tooltip from the top
7293
+ */
7294
+ SacBaseDateTimeControl.prototype.getPositionTop = function () {
7295
+ var value = this.popupHelper.getPositionTop(this.pickerbutton, this.pickercontainer, this.elementRef, this.getArrowWidth(), this.getArrowHeight(), this.position, false);
7296
+ this.posPopupTop = value;
7297
+ switch (this.GetPickerPosition()) {
7298
+ case exports.TooltipPosition.left:
7299
+ case exports.TooltipPosition.right:
7300
+ this.posArrowTop = this.getPickerHeight() / 2 - 6.5;
7301
+ break;
7302
+ default:
7303
+ this.posArrowTop = null;
7304
+ break;
7305
+ }
7306
+ return value;
7307
+ };
7308
+ SacBaseDateTimeControl.prototype.setDateTimeFormat = function () {
6721
7309
  // HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
6722
7310
  if (this.ngControl) {
6723
- this.ngControl.datetimeformatstring =
6724
- this.GetDateTimeFormatString();
7311
+ this.ngControl.datetimeformatstring = this.GetDateTimeFormatString();
6725
7312
  }
6726
7313
  };
6727
7314
  return SacBaseDateTimeControl;
@@ -6732,22 +7319,23 @@
6732
7319
  SacBaseDateTimeControl.ctorParameters = function () { return [
6733
7320
  { type: SacFormLayoutCommon },
6734
7321
  { type: i0.Injector },
6735
- { type: i0.ElementRef }
7322
+ { type: i0.ElementRef },
7323
+ { type: i0.ChangeDetectorRef }
6736
7324
  ]; };
6737
7325
  SacBaseDateTimeControl.propDecorators = {
6738
7326
  isrequired: [{ type: i0.Input }],
7327
+ pickerarrow: [{ type: i0.ViewChild, args: ['pickerarrow', { static: false },] }],
7328
+ pickerbutton: [{ type: i0.ViewChild, args: ['pickerbutton', { static: true },] }],
6739
7329
  placeholder: [{ type: i0.Input }],
7330
+ position: [{ type: i0.Input }],
6740
7331
  validationmessagedatetimeformat: [{ type: i0.Input }],
6741
7332
  validationmessagedatetimeformatsummary: [{ type: i0.Input }],
6742
7333
  validationmessagerequired: [{ type: i0.Input }],
6743
7334
  validationmessagerequiredsummary: [{ type: i0.Input }],
7335
+ picker: [{ type: i0.ViewChild, args: ['picker', { static: false },] }],
6744
7336
  valuestring: [{ type: i0.Input }]
6745
7337
  };
6746
7338
 
6747
- /**
6748
- * Moment
6749
- */
6750
- var moment$3 = moment___default['default'];
6751
7339
  /**
6752
7340
  * Komponente für SacDateCommon. Extends SacBaseDateTimeControl
6753
7341
  */
@@ -6760,9 +7348,10 @@
6760
7348
  * @param formlayout SacFormLayoutCommon to define scoped layout settings
6761
7349
  * @param injector Injector for injecting services
6762
7350
  * @param elementRef reference to html element
7351
+ * @param cdRef Change Dectection Servie
6763
7352
  */
6764
- function SacDateCommon(formlayout, injector, elementRef) {
6765
- var _this = _super.call(this, formlayout, injector, elementRef) || this;
7353
+ function SacDateCommon(formlayout, injector, elementRef, cdRef) {
7354
+ var _this = _super.call(this, formlayout, injector, elementRef, cdRef) || this;
6766
7355
  _this.elementRef = elementRef;
6767
7356
  // #region Properties
6768
7357
  /**
@@ -6798,6 +7387,18 @@
6798
7387
  lazy: false,
6799
7388
  overwrite: true,
6800
7389
  };
7390
+ /**
7391
+ * Min Date
7392
+ */
7393
+ _this._maxdate = null;
7394
+ /**
7395
+ * Min Date
7396
+ */
7397
+ _this._mindate = null;
7398
+ /**
7399
+ * Moment JS module instance
7400
+ */
7401
+ _this.moment = moment___default['default'];
6801
7402
  /**
6802
7403
  * Resource Key für Validation Message MaxDate bei Control
6803
7404
  */
@@ -6814,28 +7415,26 @@
6814
7415
  * Resource Key für Validation Message MinDate in Validation Summary
6815
7416
  */
6816
7417
  _this.validationmessagesummarymindate = _this.validationKeyService.ValidationErrorSummaryMinDate;
6817
- /**
6818
- * Min Date
6819
- */
6820
- _this._maxdate = null;
6821
- /**
6822
- * Min Date
6823
- */
6824
- _this._mindate = null;
6825
- /**
6826
- * Definiert ob der Date Selector angezeigt wird
6827
- */
6828
- _this._showselector = false;
6829
7418
  return _this;
6830
7419
  }
6831
- Object.defineProperty(SacDateCommon.prototype, "maxdate", {
7420
+ Object.defineProperty(SacDateCommon.prototype, "IconSelector", {
6832
7421
  // #endregion Constructors
6833
7422
  // #region Public Getters And Setters
7423
+ /**
7424
+ * icon for date selector button
7425
+ */
7426
+ get: function () {
7427
+ return this.iconService.DateComponentSelectorIcon;
7428
+ },
7429
+ enumerable: false,
7430
+ configurable: true
7431
+ });
7432
+ Object.defineProperty(SacDateCommon.prototype, "maxdate", {
6834
7433
  /**
6835
7434
  * Min Date
6836
7435
  */
6837
7436
  set: function (v) {
6838
- var date = moment$3(v, [this.DATEFORMAT], true);
7437
+ var date = this.moment(v, [this.DATEFORMAT], true);
6839
7438
  if (date.isValid()) {
6840
7439
  this._maxdate = _super.prototype.getDate.call(this, date).toDate();
6841
7440
  }
@@ -6851,7 +7450,7 @@
6851
7450
  * Min Date
6852
7451
  */
6853
7452
  set: function (v) {
6854
- var date = moment$3(v, [this.DATEFORMAT], true);
7453
+ var date = this.moment(v, [this.DATEFORMAT], true);
6855
7454
  if (date.isValid()) {
6856
7455
  this._mindate = _super.prototype.getDate.call(this, date).toDate();
6857
7456
  }
@@ -6862,27 +7461,8 @@
6862
7461
  enumerable: false,
6863
7462
  configurable: true
6864
7463
  });
6865
- Object.defineProperty(SacDateCommon.prototype, "IconSelector", {
6866
- /**
6867
- * icon for date selector button
6868
- */
6869
- get: function () {
6870
- return this.iconService.DateComponentSelectorIcon;
6871
- },
6872
- enumerable: false,
6873
- configurable: true
6874
- });
6875
7464
  // #endregion Public Getters And Setters
6876
7465
  // #region Public Methods
6877
- /**
6878
- * HostListener
6879
- */
6880
- SacDateCommon.prototype.onClick = function (targetElement) {
6881
- var clickedInside = this.elementRef.nativeElement.contains(targetElement);
6882
- if (!clickedInside) {
6883
- this._showselector = false;
6884
- }
6885
- };
6886
7466
  /**
6887
7467
  * Methode ergibt Datum-Format vom String
6888
7468
  */
@@ -6903,10 +7483,23 @@
6903
7483
  this.setValueString('');
6904
7484
  }
6905
7485
  else {
6906
- this.value = moment$3(v.date).utc().toDate();
7486
+ this.value = this.moment(v.date).utc().toDate();
6907
7487
  }
6908
7488
  this._showselector = false;
6909
7489
  };
7490
+ /**
7491
+ * HostListener
7492
+ */
7493
+ SacDateCommon.prototype.onClick = function (targetElement) {
7494
+ if (!this.pickercontainer) {
7495
+ return;
7496
+ }
7497
+ var clickedInsideContainer = this.pickercontainer.nativeElement.contains(targetElement);
7498
+ var clickedInsideReference = this.pickerbutton.nativeElement.contains(targetElement);
7499
+ if (!clickedInsideContainer && !clickedInsideReference) {
7500
+ this._showselector = false;
7501
+ }
7502
+ };
6910
7503
  /**
6911
7504
  * Zeigt Date Selector an
6912
7505
  */
@@ -6952,7 +7545,8 @@
6952
7545
  SacDateCommon.ctorParameters = function () { return [
6953
7546
  { type: SacFormLayoutCommon },
6954
7547
  { type: i0.Injector },
6955
- { type: i0.ElementRef }
7548
+ { type: i0.ElementRef },
7549
+ { type: i0.ChangeDetectorRef }
6956
7550
  ]; };
6957
7551
  SacDateCommon.propDecorators = {
6958
7552
  validationmessagemaxdate: [{ type: i0.Input }],
@@ -7090,11 +7684,11 @@
7090
7684
  this._initialValue = null;
7091
7685
  }
7092
7686
  else {
7093
- this._initialValue = moment$4(v);
7687
+ this._initialValue = moment$2(v);
7094
7688
  }
7095
7689
  this._selectedValue = null;
7096
7690
  if (this._initialValue === null) {
7097
- this.initCalendar(moment$4());
7691
+ this.initCalendar(moment$2());
7098
7692
  }
7099
7693
  else {
7100
7694
  this.initCalendar(this._initialValue);
@@ -7231,7 +7825,7 @@
7231
7825
  .forEach(function (itm) { return (itm.isselected = false); }); });
7232
7826
  v.isnew = true;
7233
7827
  v.isselected = true;
7234
- var dateValue = moment$4(v.date);
7828
+ var dateValue = moment$2(v.date);
7235
7829
  // Übernehmen der Zeit aus dem bestehenden Wert
7236
7830
  if (this._selectedValue === null) {
7237
7831
  if (this._initialValue !== null) {
@@ -7286,7 +7880,7 @@
7286
7880
  * Auswahl auf aktuelle Zeit stellen
7287
7881
  */
7288
7882
  SacDateSelectorCommon.prototype.setToday = function () {
7289
- this._selectedValue = moment$4();
7883
+ this._selectedValue = moment$2();
7290
7884
  /**
7291
7885
  * Sekunden un Milisekunden Clean
7292
7886
  */
@@ -7322,20 +7916,20 @@
7322
7916
  * Initial Datum
7323
7917
  */
7324
7918
  SacDateSelectorCommon.prototype.initDates = function () {
7325
- var currentMonth = moment$4(new Date(this.year, this.month, 1));
7326
- var lastMonth = moment$4(new Date(this.year, this.month, 1));
7919
+ var currentMonth = moment$2(new Date(this.year, this.month, 1));
7920
+ var lastMonth = moment$2(new Date(this.year, this.month, 1));
7327
7921
  lastMonth.add({ months: -1 });
7328
- var nextMonths = moment$4(new Date(this.year, this.month, 1));
7922
+ var nextMonths = moment$2(new Date(this.year, this.month, 1));
7329
7923
  nextMonths.add({ months: 1 });
7330
7924
  var weekdayBegin = currentMonth.weekday();
7331
- var weekdayEnd = moment$4(new Date(currentMonth.year(), currentMonth.month(), currentMonth.daysInMonth())).weekday();
7925
+ var weekdayEnd = moment$2(new Date(currentMonth.year(), currentMonth.month(), currentMonth.daysInMonth())).weekday();
7332
7926
  // Clear Array
7333
7927
  var daysInCalendar = [];
7334
7928
  this.dates = [];
7335
7929
  if (weekdayBegin !== this.beginOfCalendar) {
7336
7930
  var lastMonthDay = lastMonth.daysInMonth();
7337
7931
  var lastMonthDate = new Date(lastMonth.year(), lastMonth.month(), lastMonthDay);
7338
- var lastMonthWeekday = moment$4(lastMonthDate).weekday();
7932
+ var lastMonthWeekday = moment$2(lastMonthDate).weekday();
7339
7933
  var daysInLastMonth = 7 - ((7 + this.beginOfCalendar - lastMonthWeekday) % 7);
7340
7934
  if (daysInLastMonth === 7) {
7341
7935
  daysInLastMonth = 0;
@@ -7348,9 +7942,9 @@
7348
7942
  for (var dayinmonth = 1; dayinmonth <= currentMonth.daysInMonth(); dayinmonth++) {
7349
7943
  var isSelectedDate = false;
7350
7944
  var isNewDate = false;
7351
- var isCurrentDate = moment$4().month() === this.month &&
7352
- moment$4().year() === this.year &&
7353
- moment$4().date() === dayinmonth;
7945
+ var isCurrentDate = moment$2().month() === this.month &&
7946
+ moment$2().year() === this.year &&
7947
+ moment$2().date() === dayinmonth;
7354
7948
  // Initial Wert setzen, falls vorhanden
7355
7949
  if (this._initialValue !== null) {
7356
7950
  isSelectedDate =
@@ -7365,7 +7959,7 @@
7365
7959
  this._selectedValue.year() === this.year &&
7366
7960
  this._selectedValue.date() === dayinmonth;
7367
7961
  }
7368
- daysInCalendar.push(new DateSelectorItem(dayinmonth.toString(), moment$4([this.year, this.month, dayinmonth]).toDate(), true, isSelectedDate, isCurrentDate, isNewDate));
7962
+ daysInCalendar.push(new DateSelectorItem(dayinmonth.toString(), moment$2([this.year, this.month, dayinmonth]).toDate(), true, isSelectedDate, isCurrentDate, isNewDate));
7369
7963
  }
7370
7964
  var endOfCalender;
7371
7965
  if (this.beginOfCalendar === 0) {
@@ -7401,7 +7995,7 @@
7401
7995
  */
7402
7996
  if (this._selectedValue === null) {
7403
7997
  if (this._initialValue === null) {
7404
- this._selectedValue = moment$4();
7998
+ this._selectedValue = moment$2();
7405
7999
  }
7406
8000
  else {
7407
8001
  this._selectedValue = this._initialValue;
@@ -7430,13 +8024,9 @@
7430
8024
  /**
7431
8025
  * Moment
7432
8026
  */
7433
- var moment$4 = moment___default['default'];
8027
+ var moment$2 = moment___default['default'];
7434
8028
  // #endregion Variables
7435
8029
 
7436
- /**
7437
- * Moment
7438
- */
7439
- var moment$5 = moment___default['default'];
7440
8030
  /**
7441
8031
  * Komponente für SacDateTimeCommon. Extends SacBaseDateTimeControl
7442
8032
  */
@@ -7450,8 +8040,8 @@
7450
8040
  * @param injector Injector for injecting services
7451
8041
  * @param elementRef reference to html element
7452
8042
  */
7453
- function SacDateTimeCommon(formlayout, injector, elementRef) {
7454
- var _this = _super.call(this, formlayout, injector, elementRef) || this;
8043
+ function SacDateTimeCommon(formlayout, injector, elementRef, cdRef) {
8044
+ var _this = _super.call(this, formlayout, injector, elementRef, cdRef) || this;
7455
8045
  _this.elementRef = elementRef;
7456
8046
  // #region Properties
7457
8047
  /**
@@ -7502,6 +8092,18 @@
7502
8092
  lazy: false,
7503
8093
  overwrite: true,
7504
8094
  };
8095
+ /**
8096
+ * Maximaler Wert des Datums
8097
+ */
8098
+ _this._maxdate = null;
8099
+ /**
8100
+ * Minimaler Wert des Datums
8101
+ */
8102
+ _this._mindate = null;
8103
+ /**
8104
+ * Moment JS module instance
8105
+ */
8106
+ _this.moment = moment___default['default'];
7505
8107
  /**
7506
8108
  * Resource Key für Validation Message MaxDate bei Control
7507
8109
  */
@@ -7518,28 +8120,26 @@
7518
8120
  * Resource Key für Validation Message MinDate in Validation Summary
7519
8121
  */
7520
8122
  _this.validationmessagesummarymindate = _this.validationKeyService.ValidationErrorSummaryMinDate;
7521
- /**
7522
- * Maximaler Wert des Datums
7523
- */
7524
- _this._maxdate = null;
7525
- /**
7526
- * Minimaler Wert des Datums
7527
- */
7528
- _this._mindate = null;
7529
- /**
7530
- * Definiert ob der Date Selector angezeigt wird
7531
- */
7532
- _this._showselector = false;
7533
8123
  return _this;
7534
8124
  }
7535
- Object.defineProperty(SacDateTimeCommon.prototype, "maxdate", {
8125
+ Object.defineProperty(SacDateTimeCommon.prototype, "IconSelector", {
7536
8126
  // #endregion Constructors
7537
8127
  // #region Public Getters And Setters
8128
+ /**
8129
+ * icon for date selector button
8130
+ */
8131
+ get: function () {
8132
+ return this.iconService.DateTimeComponentSelectorIcon;
8133
+ },
8134
+ enumerable: false,
8135
+ configurable: true
8136
+ });
8137
+ Object.defineProperty(SacDateTimeCommon.prototype, "maxdate", {
7538
8138
  /**
7539
8139
  * Max Date
7540
8140
  */
7541
8141
  set: function (v) {
7542
- var date = moment$5(v, [this.DATEFORMAT], true);
8142
+ var date = this.moment(v, [this.DATEFORMAT], true);
7543
8143
  if (date.isValid()) {
7544
8144
  this._maxdate = _super.prototype.getDate.call(this, date).toDate();
7545
8145
  }
@@ -7555,7 +8155,7 @@
7555
8155
  * Min Date
7556
8156
  */
7557
8157
  set: function (v) {
7558
- var date = moment$5(v, [this.DATEFORMAT], true);
8158
+ var date = this.moment(v, [this.DATEFORMAT], true);
7559
8159
  if (date.isValid()) {
7560
8160
  this._mindate = _super.prototype.getDate.call(this, date).toDate();
7561
8161
  }
@@ -7566,27 +8166,8 @@
7566
8166
  enumerable: false,
7567
8167
  configurable: true
7568
8168
  });
7569
- Object.defineProperty(SacDateTimeCommon.prototype, "IconSelector", {
7570
- /**
7571
- * icon for date selector button
7572
- */
7573
- get: function () {
7574
- return this.iconService.DateTimeComponentSelectorIcon;
7575
- },
7576
- enumerable: false,
7577
- configurable: true
7578
- });
7579
8169
  // #endregion Public Getters And Setters
7580
8170
  // #region Public Methods
7581
- /**
7582
- * HostListener
7583
- */
7584
- SacDateTimeCommon.prototype.onClick = function (targetElement) {
7585
- var clickedInside = this.elementRef.nativeElement.contains(targetElement);
7586
- if (!clickedInside) {
7587
- this._showselector = false;
7588
- }
7589
- };
7590
8171
  /**
7591
8172
  * Methode ergibt Datum-Format vom String
7592
8173
  */
@@ -7607,10 +8188,23 @@
7607
8188
  this.setValueString('');
7608
8189
  }
7609
8190
  else {
7610
- this.value = moment$5(v.date).utc().toDate();
8191
+ this.value = this.moment(v.date).utc().toDate();
7611
8192
  }
7612
8193
  this._showselector = false;
7613
8194
  };
8195
+ /**
8196
+ * HostListener
8197
+ */
8198
+ SacDateTimeCommon.prototype.onClick = function (targetElement) {
8199
+ if (!this.pickercontainer) {
8200
+ return;
8201
+ }
8202
+ var clickedInsideContainer = this.pickercontainer.nativeElement.contains(targetElement);
8203
+ var clickedInsideReference = this.pickerbutton.nativeElement.contains(targetElement);
8204
+ if (!clickedInsideContainer && !clickedInsideReference) {
8205
+ this._showselector = false;
8206
+ }
8207
+ };
7614
8208
  /**
7615
8209
  * DateSelector wird beim Click-Event angezeigt
7616
8210
  */
@@ -7658,7 +8252,8 @@
7658
8252
  SacDateTimeCommon.ctorParameters = function () { return [
7659
8253
  { type: SacFormLayoutCommon },
7660
8254
  { type: i0.Injector },
7661
- { type: i0.ElementRef }
8255
+ { type: i0.ElementRef },
8256
+ { type: i0.ChangeDetectorRef }
7662
8257
  ]; };
7663
8258
  SacDateTimeCommon.propDecorators = {
7664
8259
  validationmessagemaxdate: [{ type: i0.Input }],
@@ -7670,10 +8265,6 @@
7670
8265
  onClick: [{ type: i0.HostListener, args: ['document:click', ['$event.target'],] }]
7671
8266
  };
7672
8267
 
7673
- /**
7674
- * Moment
7675
- */
7676
- var moment$6 = moment___default['default'];
7677
8268
  /**
7678
8269
  * Komponente für SacTimeCommon. Extends SacBaseDateTimeControl
7679
8270
  */
@@ -7687,8 +8278,8 @@
7687
8278
  * @param injector Injector for injecting services
7688
8279
  * @param elementRef reference to html element
7689
8280
  */
7690
- function SacTimeCommon(formlayout, injector, elementRef) {
7691
- var _this = _super.call(this, formlayout, injector, elementRef) || this;
8281
+ function SacTimeCommon(formlayout, injector, elementRef, cdRef) {
8282
+ var _this = _super.call(this, formlayout, injector, elementRef, cdRef) || this;
7692
8283
  _this.elementRef = elementRef;
7693
8284
  // #region Properties
7694
8285
  /**
@@ -7719,6 +8310,18 @@
7719
8310
  lazy: false,
7720
8311
  overwrite: true,
7721
8312
  };
8313
+ /**
8314
+ * Max Time
8315
+ */
8316
+ _this._maxtime = null;
8317
+ /**
8318
+ * Min Time
8319
+ */
8320
+ _this._mintime = null;
8321
+ /**
8322
+ * Moment JS module instance
8323
+ */
8324
+ _this.moment = moment___default['default'];
7722
8325
  /**
7723
8326
  * Resource Key für Validation Message MinTime bei Control
7724
8327
  */
@@ -7735,28 +8338,26 @@
7735
8338
  * Resource Key für Validation Message MinTime in Validation Summary
7736
8339
  */
7737
8340
  _this.validationmessagesummarymintime = _this.validationKeyService.ValidationErrorSummaryMinTime;
7738
- /**
7739
- * Max Time
7740
- */
7741
- _this._maxtime = null;
7742
- /**
7743
- * Min Time
7744
- */
7745
- _this._mintime = null;
7746
- /**
7747
- * Definiert ob der Date Selector angezeigt wird
7748
- */
7749
- _this._showselector = false;
7750
8341
  return _this;
7751
8342
  }
8343
+ Object.defineProperty(SacTimeCommon.prototype, "IconSelector", {
8344
+ // #endregion Constructors
8345
+ // #region Public Getters And Setters
8346
+ /**
8347
+ * icon for date selector button
8348
+ */
8349
+ get: function () {
8350
+ return this.iconService.TimeComponentSelectorIcon;
8351
+ },
8352
+ enumerable: false,
8353
+ configurable: true
8354
+ });
7752
8355
  Object.defineProperty(SacTimeCommon.prototype, "maxtime", {
7753
- // #endregion Constructors
7754
- // #region Public Getters And Setters
7755
8356
  /**
7756
8357
  * Max Time
7757
8358
  */
7758
8359
  set: function (v) {
7759
- var time = moment$6(v, [this.TIMEFORMAT], true);
8360
+ var time = this.moment(v, [this.TIMEFORMAT], true);
7760
8361
  time = this.ModifyParsedDateTimeValue(time);
7761
8362
  if (time.isValid()) {
7762
8363
  this._maxtime = _super.prototype.getDate.call(this, time).toDate();
@@ -7773,7 +8374,7 @@
7773
8374
  * Min Time
7774
8375
  */
7775
8376
  set: function (v) {
7776
- var time = moment$6(v, [this.TIMEFORMAT], true);
8377
+ var time = this.moment(v, [this.TIMEFORMAT], true);
7777
8378
  time = this.ModifyParsedDateTimeValue(time);
7778
8379
  if (time.isValid()) {
7779
8380
  this._mintime = _super.prototype.getDate.call(this, time).toDate();
@@ -7785,27 +8386,8 @@
7785
8386
  enumerable: false,
7786
8387
  configurable: true
7787
8388
  });
7788
- Object.defineProperty(SacTimeCommon.prototype, "IconSelector", {
7789
- /**
7790
- * icon for date selector button
7791
- */
7792
- get: function () {
7793
- return this.iconService.TimeComponentSelectorIcon;
7794
- },
7795
- enumerable: false,
7796
- configurable: true
7797
- });
7798
8389
  // #endregion Public Getters And Setters
7799
8390
  // #region Public Methods
7800
- /**
7801
- * HostListener
7802
- */
7803
- SacTimeCommon.prototype.onClick = function (targetElement) {
7804
- var clickedInside = this.elementRef.nativeElement.contains(targetElement);
7805
- if (!clickedInside) {
7806
- this._showselector = false;
7807
- }
7808
- };
7809
8391
  /**
7810
8392
  * Methode ergibt Datum-Format vom String
7811
8393
  */
@@ -7821,6 +8403,19 @@
7821
8403
  v.year(1900);
7822
8404
  return v;
7823
8405
  };
8406
+ /**
8407
+ * HostListener
8408
+ */
8409
+ SacTimeCommon.prototype.onClick = function (targetElement) {
8410
+ if (!this.pickercontainer) {
8411
+ return;
8412
+ }
8413
+ var clickedInsideContainer = this.pickercontainer.nativeElement.contains(targetElement);
8414
+ var clickedInsideReference = this.pickerbutton.nativeElement.contains(targetElement);
8415
+ if (!clickedInsideContainer && !clickedInsideReference) {
8416
+ this._showselector = false;
8417
+ }
8418
+ };
7824
8419
  /**
7825
8420
  * Zeigt Date Selector an
7826
8421
  */
@@ -7842,7 +8437,7 @@
7842
8437
  this.setValueString('');
7843
8438
  }
7844
8439
  else {
7845
- this.value = moment$6(v.date).utc().toDate();
8440
+ this.value = this.moment(v.date).utc().toDate();
7846
8441
  }
7847
8442
  this._showselector = false;
7848
8443
  };
@@ -7878,7 +8473,8 @@
7878
8473
  SacTimeCommon.ctorParameters = function () { return [
7879
8474
  { type: SacFormLayoutCommon },
7880
8475
  { type: i0.Injector },
7881
- { type: i0.ElementRef }
8476
+ { type: i0.ElementRef },
8477
+ { type: i0.ChangeDetectorRef }
7882
8478
  ]; };
7883
8479
  SacTimeCommon.propDecorators = {
7884
8480
  validationmessagemaxtime: [{ type: i0.Input }],
@@ -7901,18 +8497,26 @@
7901
8497
  * Definiert den Container als Required Form Item
7902
8498
  */
7903
8499
  _this._isrequired = false;
8500
+ /**
8501
+ * Error message to be displayed
8502
+ */
8503
+ _this.errormessage = '';
8504
+ /**
8505
+ * Activates the error message on the container control
8506
+ */
8507
+ _this.isinvalid = false;
7904
8508
  return _this;
7905
8509
  // #endregion Public Methods
7906
8510
  }
7907
8511
  Object.defineProperty(SacStaticFormContainerCommon.prototype, "isrequired", {
8512
+ // #endregion Properties
8513
+ // #region Public Getters And Setters
7908
8514
  /**
7909
8515
  * Definiert den Container als Required Form Item
7910
8516
  */
7911
8517
  get: function () {
7912
8518
  return this._isrequired;
7913
8519
  },
7914
- // #endregion Properties
7915
- // #region Public Getters And Setters
7916
8520
  /**
7917
8521
  * Definiert den Container als Required Form Item
7918
8522
  */
@@ -7941,6 +8545,8 @@
7941
8545
  { type: i0.Directive }
7942
8546
  ];
7943
8547
  SacStaticFormContainerCommon.propDecorators = {
8548
+ errormessage: [{ type: i0.Input }],
8549
+ isinvalid: [{ type: i0.Input }],
7944
8550
  isrequired: [{ type: i0.Input }]
7945
8551
  };
7946
8552
 
@@ -8835,21 +9441,6 @@
8835
9441
  { type: i0.Directive }
8836
9442
  ];
8837
9443
 
8838
- /**
8839
- * Enum für Tooltip Positionen
8840
- */
8841
- (function (TooltipPosition) {
8842
- TooltipPosition[TooltipPosition["none"] = 0] = "none";
8843
- // tslint:disable-next-line:no-bitwise
8844
- TooltipPosition[TooltipPosition["top"] = 1] = "top";
8845
- // tslint:disable-next-line:no-bitwise
8846
- TooltipPosition[TooltipPosition["right"] = 2] = "right";
8847
- // tslint:disable-next-line:no-bitwise
8848
- TooltipPosition[TooltipPosition["bottom"] = 4] = "bottom";
8849
- // tslint:disable-next-line:no-bitwise
8850
- TooltipPosition[TooltipPosition["left"] = 8] = "left";
8851
- })(exports.TooltipPosition || (exports.TooltipPosition = {}));
8852
-
8853
9444
  /**
8854
9445
  * Tooltip Component
8855
9446
  *
@@ -8872,29 +9463,15 @@
8872
9463
  var _this = this;
8873
9464
  this.cdRef = cdRef;
8874
9465
  this.ref = ref;
9466
+ // #region Properties
8875
9467
  /**
8876
- * Defines whether the tooltip is visible
8877
- */
8878
- this._isTooltipVisible = false;
8879
- /**
8880
- * method if content has changed and proportions need to be reset in the UI.
9468
+ * Helper class to display tooltip on correct position
8881
9469
  */
8882
- this.onContentChange = function () {
8883
- // Do nothing if is not visible
8884
- if (!_this._isTooltipVisible) {
8885
- return;
8886
- }
8887
- setTimeout(function () {
8888
- _this.getLeftPosition();
8889
- _this.getTopPosition();
8890
- });
8891
- };
9470
+ this.popupHelper = new PopUpHelper();
8892
9471
  /**
8893
- * Position of the tooltip. Values: left|top|right|bottom|auto
8894
- *
8895
- * Value 'auto' can be combined with another value.
9472
+ * Defines whether the tooltip is visible
8896
9473
  */
8897
- this.position = 'right|auto';
9474
+ this._isTooltipVisible = false;
8898
9475
  /**
8899
9476
  * Position of the tooltip on the left
8900
9477
  */
@@ -8911,16 +9488,43 @@
8911
9488
  * Position of the tooltip at the top
8912
9489
  */
8913
9490
  this.TopPos = 0;
9491
+ /**
9492
+ * Position of the picker arrow at the left
9493
+ */
9494
+ this.posArrowLeft = null;
9495
+ /**
9496
+ * Position of the picker arrow at the top
9497
+ */
9498
+ this.posArrowTop = null;
9499
+ /**
9500
+ * Position of the tooltip. Values: left|top|right|bottom|auto
9501
+ *
9502
+ * Value 'auto' can be combined with another value.
9503
+ */
9504
+ this.position = 'right|auto';
9505
+ /**
9506
+ * method if content has changed and proportions need to be reset in the UI.
9507
+ */
9508
+ this.onContentChange = function () {
9509
+ // Do nothing if is not visible
9510
+ if (!_this._isTooltipVisible) {
9511
+ return;
9512
+ }
9513
+ setTimeout(function () {
9514
+ _this.getLeftPosition();
9515
+ _this.getTopPosition();
9516
+ });
9517
+ };
8914
9518
  }
8915
9519
  Object.defineProperty(SacTooltipCommon.prototype, "inlinemode", {
9520
+ // #endregion Constructors
9521
+ // #region Public Getters And Setters
8916
9522
  /**
8917
9523
  * Property for inline mode for tooltip. Sets the display mode on the wrapper element to `inline`
8918
9524
  */
8919
9525
  get: function () {
8920
9526
  return this._inlinemode;
8921
9527
  },
8922
- // #endregion Constructors
8923
- // #region Public Getters And Setters
8924
9528
  /**
8925
9529
  * Setter for inline mode for tooltip
8926
9530
  */
@@ -8958,50 +9562,7 @@
8958
9562
  * Returns the position of the tooltip
8959
9563
  */
8960
9564
  SacTooltipCommon.prototype.GetTooltipPosition = function () {
8961
- var validPositions = this.ValidatePositions();
8962
- // tslint:disable-next-line:no-bitwise
8963
- if (this.HasPosition(exports.TooltipPosition.right) &&
8964
- validPositions & exports.TooltipPosition.right) {
8965
- return exports.TooltipPosition.right;
8966
- }
8967
- // tslint:disable-next-line:no-bitwise
8968
- if (this.HasPosition(exports.TooltipPosition.top) &&
8969
- validPositions & exports.TooltipPosition.top) {
8970
- return exports.TooltipPosition.top;
8971
- }
8972
- // tslint:disable-next-line:no-bitwise
8973
- if (this.HasPosition(exports.TooltipPosition.left) &&
8974
- validPositions & exports.TooltipPosition.left) {
8975
- return exports.TooltipPosition.left;
8976
- }
8977
- // tslint:disable-next-line:no-bitwise
8978
- if (this.HasPosition(exports.TooltipPosition.bottom) &&
8979
- validPositions & exports.TooltipPosition.bottom) {
8980
- return exports.TooltipPosition.bottom;
8981
- }
8982
- // Get Auto Position or Default
8983
- if (this.IsAutoPosition()) {
8984
- // tslint:disable-next-line:no-bitwise
8985
- if (validPositions & exports.TooltipPosition.right) {
8986
- return exports.TooltipPosition.right;
8987
- }
8988
- // tslint:disable-next-line:no-bitwise
8989
- if (validPositions & exports.TooltipPosition.top) {
8990
- return exports.TooltipPosition.top;
8991
- }
8992
- // tslint:disable-next-line:no-bitwise
8993
- if (validPositions & exports.TooltipPosition.left) {
8994
- return exports.TooltipPosition.left;
8995
- }
8996
- // tslint:disable-next-line:no-bitwise
8997
- if (validPositions & exports.TooltipPosition.bottom) {
8998
- return exports.TooltipPosition.bottom;
8999
- }
9000
- return exports.TooltipPosition.right;
9001
- }
9002
- else {
9003
- return this.GetPosition();
9004
- }
9565
+ return this.popupHelper.getDisplayPosition(this.content, this.tooltipcontainer, this.getTooltipOffset(), this.getTooltipOffset(), this.position, true);
9005
9566
  };
9006
9567
  /**
9007
9568
  * Hide tooltip
@@ -9033,24 +9594,13 @@
9033
9594
  * Calculates the height of the tooltip
9034
9595
  */
9035
9596
  SacTooltipCommon.prototype.getToolTipHeight = function () {
9036
- var _a;
9037
- if (this.tooltipcontainer) {
9038
- return (_a = this.tooltipcontainer.nativeElement.firstElementChild.clientHeight) !== null && _a !== void 0 ? _a : 0;
9039
- }
9040
- else {
9041
- return 0;
9042
- }
9597
+ return this.popupHelper.getPopupHeight(this.tooltipcontainer);
9043
9598
  };
9044
9599
  /**
9045
9600
  * Calculates the width of the tooltips
9046
9601
  */
9047
9602
  SacTooltipCommon.prototype.getToolTipWidth = function () {
9048
- if (this.tooltipcontainer) {
9049
- return this.tooltipcontainer.nativeElement.firstElementChild.clientWidth;
9050
- }
9051
- else {
9052
- return 0;
9053
- }
9603
+ return this.popupHelper.getPopupWidth(this.tooltipcontainer);
9054
9604
  };
9055
9605
  /**
9056
9606
  * Detect Changes after view checked. Prevent ExpressionChangedAfterItHasBeenCheckedError error
@@ -9095,187 +9645,37 @@
9095
9645
  document.body.appendChild(this.tooltipcontainer.nativeElement);
9096
9646
  }
9097
9647
  };
9098
- // #endregion Protected Abstract Methods
9648
+ // #endregion Protected Methods
9099
9649
  // #region Private Methods
9100
- /**
9101
- * Returns the defined position for the tooltip
9102
- */
9103
- SacTooltipCommon.prototype.GetPosition = function () {
9104
- var positions = this.position.split('|');
9105
- if (this.HasPosition(exports.TooltipPosition.left)) {
9106
- return exports.TooltipPosition.left;
9107
- }
9108
- if (this.HasPosition(exports.TooltipPosition.top)) {
9109
- return exports.TooltipPosition.top;
9110
- }
9111
- if (this.HasPosition(exports.TooltipPosition.right)) {
9112
- return exports.TooltipPosition.right;
9113
- }
9114
- if (this.HasPosition(exports.TooltipPosition.bottom)) {
9115
- return exports.TooltipPosition.bottom;
9116
- }
9117
- // Default Position if empty
9118
- return exports.TooltipPosition.right;
9119
- };
9120
- /**
9121
- * Returns whether the position has been configured
9122
- *
9123
- * @param position Position to be checked
9124
- */
9125
- SacTooltipCommon.prototype.HasPosition = function (position) {
9126
- var positions = this.position.split('|');
9127
- if (position === exports.TooltipPosition.right && positions.indexOf('right') >= 0) {
9128
- return true;
9129
- }
9130
- if (position === exports.TooltipPosition.top && positions.indexOf('top') >= 0) {
9131
- return true;
9132
- }
9133
- if (position === exports.TooltipPosition.left && positions.indexOf('left') >= 0) {
9134
- return true;
9135
- }
9136
- if (position === exports.TooltipPosition.bottom &&
9137
- positions.indexOf('bottom') >= 0) {
9138
- return true;
9139
- }
9140
- return false;
9141
- };
9142
- /**
9143
- * Defines whether AutoPosition is active
9144
- */
9145
- SacTooltipCommon.prototype.IsAutoPosition = function () {
9146
- var positions = this.position.split('|');
9147
- return positions.indexOf('auto') >= 0;
9148
- };
9149
- /**
9150
- * Checks whether the position is valid or whether the tooltip on the position has space
9151
- */
9152
- SacTooltipCommon.prototype.ValidatePositions = function () {
9153
- // Check if Container is false
9154
- if (this.tooltipcontainer === undefined) {
9155
- return exports.TooltipPosition.right;
9156
- }
9157
- var allowedPositions = exports.TooltipPosition.none;
9158
- var basePosition = this.content.nativeElement.firstElementChild.getBoundingClientRect();
9159
- var tooltipRect = this.tooltipcontainer.nativeElement.firstElementChild.getBoundingClientRect();
9160
- var leftPosOk = basePosition.left - tooltipRect.width + (this.getTooltipOffset() * -1) > 0;
9161
- var rightPosOk = basePosition.right + tooltipRect.width + this.getTooltipOffset() < window.innerWidth;
9162
- var topPosOk = basePosition.top - tooltipRect.height > 0;
9163
- var bottomPosOk = basePosition.bottom + tooltipRect.height < window.innerHeight;
9164
- var leftHalfPosOk = basePosition.left - tooltipRect.width / 2 > 0;
9165
- var rightHalfPosOk = basePosition.right + tooltipRect.width / 2 < window.innerWidth;
9166
- var topHalfPosOk = basePosition.top - tooltipRect.height / 2 > 0;
9167
- var bottomHalfPosOk = basePosition.bottom + tooltipRect.height / 2 < window.innerHeight;
9168
- if (leftPosOk && topHalfPosOk && bottomHalfPosOk) {
9169
- // tslint:disable-next-line:no-bitwise
9170
- allowedPositions = allowedPositions | exports.TooltipPosition.left;
9171
- }
9172
- if (rightPosOk && topHalfPosOk && bottomHalfPosOk) {
9173
- // tslint:disable-next-line:no-bitwise
9174
- allowedPositions = allowedPositions | exports.TooltipPosition.right;
9175
- }
9176
- if (topPosOk && leftHalfPosOk && rightHalfPosOk) {
9177
- // tslint:disable-next-line:no-bitwise
9178
- allowedPositions = allowedPositions | exports.TooltipPosition.top;
9179
- }
9180
- if (bottomPosOk && leftHalfPosOk && rightHalfPosOk) {
9181
- // tslint:disable-next-line:no-bitwise
9182
- allowedPositions = allowedPositions | exports.TooltipPosition.bottom;
9183
- }
9184
- return allowedPositions;
9185
- };
9186
9650
  /**
9187
9651
  * Calculates the position of the tooltip from links
9188
9652
  */
9189
9653
  SacTooltipCommon.prototype.getLeftPosition = function () {
9190
- if (this.content !== null && this.content !== undefined) {
9191
- var item = this.content.nativeElement;
9192
- if (item.children.length >= 1) {
9193
- var childItem = item.firstElementChild;
9194
- var contentPosition = childItem.getBoundingClientRect();
9195
- switch (this.GetTooltipPosition()) {
9196
- case exports.TooltipPosition.top:
9197
- this.LeftPos = contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2;
9198
- return (contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2);
9199
- case exports.TooltipPosition.right:
9200
- this.LeftPos = contentPosition.left + contentPosition.width + this.getTooltipOffset();
9201
- return contentPosition.left + contentPosition.width + this.getTooltipOffset();
9202
- case exports.TooltipPosition.bottom:
9203
- this.LeftPos = contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2;
9204
- return (contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2);
9205
- case exports.TooltipPosition.left:
9206
- this.LeftPos = contentPosition.left - this.getToolTipWidth() + (this.getTooltipOffset() * -1);
9207
- return contentPosition.left - this.getToolTipWidth() + (this.getTooltipOffset() * -1);
9208
- }
9209
- return this.content.nativeElement.offsetTop;
9210
- }
9211
- else {
9212
- return this.content.nativeElement.offsetTop;
9213
- }
9654
+ var value = this.popupHelper.getPositionLeft(this.content, this.tooltipcontainer, this.ref, this.getTooltipOffset(), this.getTooltipOffset(), this.position, true);
9655
+ this.LeftPos = value;
9656
+ var requiredPosition = this.GetTooltipPosition();
9657
+ if (requiredPosition === exports.TooltipPosition.left || requiredPosition === exports.TooltipPosition.right) {
9658
+ this.posArrowTop = this.getToolTipHeight() / 2 - 6.5;
9214
9659
  }
9215
9660
  else {
9216
- return this.ref.nativeElement.offsetLeft;
9661
+ this.posArrowTop = null;
9217
9662
  }
9663
+ return value;
9218
9664
  };
9219
9665
  /**
9220
9666
  * Calculates the position of the tooltip from the top
9221
9667
  */
9222
9668
  SacTooltipCommon.prototype.getTopPosition = function () {
9223
- if (this.content !== null && this.content !== undefined) {
9224
- var item = this.content.nativeElement;
9225
- if (item.children.length >= 1) {
9226
- var childItem = item.firstElementChild;
9227
- var contentPosition = childItem.getBoundingClientRect();
9228
- // Get Position with Scroll (Scrollbars inside page should be substracted)
9229
- var contentPositionTop = childItem.offsetTop + this.getOffsetTopParent(childItem.offsetParent) - this.getScrollTopParent(childItem.parentElement);
9230
- switch (this.GetTooltipPosition()) {
9231
- case exports.TooltipPosition.top:
9232
- this.TopPos = contentPositionTop - this.getToolTipHeight() + (this.getTooltipOffset() * -1);
9233
- return contentPositionTop - this.getToolTipHeight() + (this.getTooltipOffset() * -1);
9234
- case exports.TooltipPosition.right:
9235
- this.TopPos = contentPositionTop + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
9236
- return contentPositionTop + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
9237
- case exports.TooltipPosition.bottom:
9238
- this.TopPos = contentPositionTop + contentPosition.height + this.getTooltipOffset();
9239
- return contentPositionTop + contentPosition.height + this.getTooltipOffset();
9240
- case exports.TooltipPosition.left:
9241
- this.TopPos = contentPositionTop + contentPosition.height / 2 - this.getToolTipHeight() / 2;
9242
- return (contentPositionTop + contentPosition.height / 2 - this.getToolTipHeight() / 2);
9243
- }
9244
- return (childItem.clientTop + childItem.offsetTop - (this.getToolTipHeight() / 2 - childItem.clientHeight / 2));
9245
- }
9246
- else {
9247
- return this.content.nativeElement.offsetTop;
9248
- }
9669
+ var value = this.popupHelper.getPositionTop(this.content, this.tooltipcontainer, this.ref, this.getTooltipOffset(), this.getTooltipOffset(), this.position, true);
9670
+ this.TopPos = value;
9671
+ var requiredPosition = this.GetTooltipPosition();
9672
+ if (requiredPosition === exports.TooltipPosition.bottom || requiredPosition === exports.TooltipPosition.top) {
9673
+ this.posArrowLeft = this.getToolTipWidth() / 2 - 6.5;
9249
9674
  }
9250
9675
  else {
9251
- return this.ref.nativeElement.offsetTop;
9252
- }
9253
- };
9254
- /**
9255
- * Calculates the top of the page inside all elements
9256
- * @param element HTML Element
9257
- * @returns summarized top value for absolute position
9258
- */
9259
- SacTooltipCommon.prototype.getOffsetTopParent = function (element) {
9260
- if (!element.offsetParent) {
9261
- return element.offsetTop;
9676
+ this.posArrowLeft = null;
9262
9677
  }
9263
- var parentValue = this.getOffsetTopParent(element.offsetParent);
9264
- var offset = element.offsetTop;
9265
- return parentValue + offset;
9266
- };
9267
- /**
9268
- * Caclulate Scrollbars inside tree
9269
- * @param element HTML Element
9270
- * @returns Scroll top value of element with all childs
9271
- */
9272
- SacTooltipCommon.prototype.getScrollTopParent = function (element) {
9273
- // Body Scroll should not be calculated
9274
- if (!element.parentElement) {
9275
- return 0;
9276
- }
9277
- var parentValue = this.getScrollTopParent(element.parentElement);
9278
- return parentValue + element.scrollTop;
9678
+ return value;
9279
9679
  };
9280
9680
  return SacTooltipCommon;
9281
9681
  }());
@@ -9287,9 +9687,9 @@
9287
9687
  { type: i0.ElementRef }
9288
9688
  ]; };
9289
9689
  SacTooltipCommon.propDecorators = {
9690
+ content: [{ type: i0.ViewChild, args: ['container', { static: true },] }],
9290
9691
  position: [{ type: i0.Input }],
9291
9692
  tooltiptext: [{ type: i0.Input }],
9292
- content: [{ type: i0.ViewChild, args: ['container', { static: true },] }],
9293
9693
  inlinemode: [{ type: i0.Input }],
9294
9694
  tooltip: [{ type: i0.ViewChild, args: ['tooltip', { static: false },] }]
9295
9695
  };