@simpleangularcontrols/sac-common 10.0.0-rc.11 → 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 (62) hide show
  1. package/bundles/simpleangularcontrols-sac-common.umd.js +1096 -707
  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/layout/formlayout.d.ts +4 -0
  13. package/controls/list/buildvaluestring.d.ts +6 -0
  14. package/controls/list/buildvaluestring.ngfactory.d.ts +1 -0
  15. package/controls/list/dropdown.d.ts +9 -51
  16. package/controls/list/dropdownoptions.d.ts +38 -0
  17. package/controls/list/dropdownoptions.ngfactory.d.ts +1 -0
  18. package/controls/static/formcontainer.d.ts +11 -3
  19. package/controls/tooltip/tooltip.d.ts +33 -51
  20. package/esm2015/common/basedatetimecontrol.js +178 -30
  21. package/esm2015/common/basemodelcontrol.js +57 -46
  22. package/esm2015/controls/checkbox/radiobutton.js +94 -45
  23. package/esm2015/controls/datetime/date.js +43 -41
  24. package/esm2015/controls/datetime/datetime.js +42 -41
  25. package/esm2015/controls/datetime/time.js +42 -41
  26. package/esm2015/controls/dialog/dialog.js +41 -83
  27. package/esm2015/controls/layout/formlayout.js +7 -6
  28. package/esm2015/controls/list/buildvaluestring.js +18 -0
  29. package/esm2015/controls/list/buildvaluestring.ngfactory.js +7 -0
  30. package/esm2015/controls/list/dropdown.js +16 -114
  31. package/esm2015/controls/list/dropdownoptions.js +72 -0
  32. package/esm2015/controls/list/dropdownoptions.ngfactory.js +7 -0
  33. package/esm2015/controls/static/formcontainer.js +16 -6
  34. package/esm2015/controls/tooltip/tooltip.js +60 -250
  35. package/esm2015/interfaces/ISacConfigurationService.js +1 -1
  36. package/esm2015/public_api.js +3 -2
  37. package/esm2015/services/sac-configuration.service.js +7 -5
  38. package/esm2015/utilities/enums.js +5 -1
  39. package/esm2015/utilities/popuphelper.js +343 -0
  40. package/esm2015/utilities/popuphelper.ngfactory.js +7 -0
  41. package/esm2015/validation/equals.validator.js +14 -0
  42. package/esm2015/validation/equals.validator.ngfactory.js +7 -0
  43. package/esm2015/validation/notequals.validator.js +14 -0
  44. package/esm2015/validation/notequals.validator.ngfactory.js +7 -0
  45. package/esm2015/validation/validation.class.js +30 -6
  46. package/fesm2015/simpleangularcontrols-sac-common.js +1071 -702
  47. package/fesm2015/simpleangularcontrols-sac-common.js.map +1 -1
  48. package/interfaces/ISacConfigurationService.d.ts +4 -0
  49. package/package.json +1 -1
  50. package/public_api.d.ts +2 -1
  51. package/services/sac-configuration.service.d.ts +8 -0
  52. package/simpleangularcontrols-sac-common-10.0.0-rc.12.tgz +0 -0
  53. package/simpleangularcontrols-sac-common.metadata.json +1 -1
  54. package/utilities/enums.d.ts +3 -1
  55. package/utilities/popuphelper.d.ts +83 -0
  56. package/utilities/popuphelper.ngfactory.d.ts +1 -0
  57. package/validation/equals.validator.d.ts +2 -0
  58. package/validation/equals.validator.ngfactory.d.ts +1 -0
  59. package/validation/notequals.validator.d.ts +2 -0
  60. package/validation/notequals.validator.ngfactory.d.ts +1 -0
  61. package/validation/validation.class.d.ts +19 -0
  62. package/simpleangularcontrols-sac-common-10.0.0-rc.11.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
@@ -4654,29 +4736,9 @@
4654
4736
  { type: SacDropdownCommon }
4655
4737
  ]; };
4656
4738
  SacDropdownOptionCommon.propDecorators = {
4657
- ngValue: [{ type: i0.Input }],
4658
- value: [{ type: i0.Input }]
4659
- };
4660
- // #endregion Classes
4661
- // #region Functions
4662
- /**
4663
- * Function um ein Key Value Pair für das Dropdown zu erzeugen
4664
- * @param id ID
4665
- * @param value Wert der an das Element gebunden werden soll
4666
- */
4667
- function _buildValueString(id, value) {
4668
- // Wenn ID null ist Object zurückgeben
4669
- if (id == null) {
4670
- return "" + value;
4671
- }
4672
- // Mapping Objekt zu String
4673
- if (value && typeof value === 'object') {
4674
- value = 'Object';
4675
- }
4676
- // String als ID
4677
- return (id + ": " + value).slice(0, 50);
4678
- }
4679
- // #endregion Functions
4739
+ ngValue: [{ type: i0.Input }],
4740
+ value: [{ type: i0.Input }]
4741
+ };
4680
4742
 
4681
4743
  // #endregion Interfaces
4682
4744
  // #region Classes
@@ -6590,9 +6652,370 @@
6590
6652
  };
6591
6653
 
6592
6654
  /**
6593
- * Moment
6655
+ * Enum für Tooltip Positionen
6594
6656
  */
6595
- 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
+
6596
7019
  /**
6597
7020
  * Base Klasse für Date/Time Controls
6598
7021
  */
@@ -6606,22 +7029,65 @@
6606
7029
  * @param injector Injector for injecting services
6607
7030
  * @param elementRef reference to html element
6608
7031
  */
6609
- function SacBaseDateTimeControl(formlayout, injector, elementRef) {
7032
+ function SacBaseDateTimeControl(formlayout, injector, elementRef, cdRef) {
6610
7033
  var _this = _super.call(this, formlayout, injector) || this;
6611
7034
  _this.elementRef = elementRef;
7035
+ _this.cdRef = cdRef;
6612
7036
  // #region Properties
7037
+ /**
7038
+ * Helper class to display tooltip on correct position
7039
+ */
7040
+ _this.popupHelper = new PopUpHelper();
6613
7041
  /**
6614
7042
  * das property enthielt das Value als string. Default ist ''
6615
7043
  */
6616
- _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;
6617
7081
  /**
6618
- * Definiert das Control als Required
7082
+ * Position of the picker at the top
6619
7083
  */
6620
- _this.isrequired = false;
7084
+ _this.posPopupTop = 0;
6621
7085
  /**
6622
- * TextBox Placeholder
7086
+ * Position of the datetime picker. Values: left|top|right|bottom|auto
7087
+ *
7088
+ * Value 'auto' can be combined with another value.
6623
7089
  */
6624
- _this.placeholder = null;
7090
+ _this.position = 'bottomend|topend';
6625
7091
  /**
6626
7092
  * Resource Key für Validation Message DateTimeFormat bei Control
6627
7093
  */
@@ -6638,8 +7104,47 @@
6638
7104
  * Resource Key für Validation Message Required in Validation Summary
6639
7105
  */
6640
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
+ };
6641
7122
  return _this;
6642
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
+ });
6643
7148
  Object.defineProperty(SacBaseDateTimeControl.prototype, "valuestring", {
6644
7149
  /**
6645
7150
  * getter für valuestring
@@ -6649,18 +7154,16 @@
6649
7154
  return this._valueAsString;
6650
7155
  }
6651
7156
  else {
6652
- var date = moment$2.utc(this.value);
7157
+ var date = this.moment.utc(this.value);
6653
7158
  return date.local().format(this.GetDateTimeFormatString());
6654
7159
  }
6655
7160
  },
6656
- // #endregion Constructors
6657
- // #region Public Getters And Setters
6658
7161
  /**
6659
7162
  * Das Input bekommt das value von typ string
6660
7163
  */
6661
7164
  set: function (v) {
6662
7165
  this._valueAsString = v;
6663
- var date = moment$2(v, [this.GetDateTimeFormatString()], true);
7166
+ var date = this.moment(v, [this.GetDateTimeFormatString()], true);
6664
7167
  date = this.ModifyParsedDateTimeValue(date).utc();
6665
7168
  if (date.isValid()) {
6666
7169
  this.value = date.toDate();
@@ -6672,8 +7175,12 @@
6672
7175
  enumerable: false,
6673
7176
  configurable: true
6674
7177
  });
6675
- // #endregion Public Getters And Setters
6676
- // #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
+ };
6677
7184
  /**
6678
7185
  * JSON Date String in ein UTC DateTime Object konvertieren, welches vom Control verwendete werden kann
6679
7186
  */
@@ -6685,14 +7192,37 @@
6685
7192
  var hours = date.getUTCHours();
6686
7193
  var minutes = date.getUTCMinutes();
6687
7194
  var seconds = date.getUTCSeconds();
6688
- 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);
6689
7216
  };
6690
7217
  /**
6691
7218
  * Init Event
6692
7219
  */
6693
- SacBaseDateTimeControl.prototype.ngAfterViewInit = function () {
6694
- _super.prototype.ngAfterViewInit.call(this);
6695
- 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);
6696
7226
  };
6697
7227
  /**
6698
7228
  * setzt das value von typ string zu property valuestring
@@ -6726,13 +7256,59 @@
6726
7256
  }
6727
7257
  _super.prototype.writeValue.call(this, this._value);
6728
7258
  };
6729
- // #endregion Public Abstract Methods
6730
- // #region Private Methods
6731
- 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 () {
6732
7309
  // HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
6733
7310
  if (this.ngControl) {
6734
- this.ngControl.datetimeformatstring =
6735
- this.GetDateTimeFormatString();
7311
+ this.ngControl.datetimeformatstring = this.GetDateTimeFormatString();
6736
7312
  }
6737
7313
  };
6738
7314
  return SacBaseDateTimeControl;
@@ -6743,22 +7319,23 @@
6743
7319
  SacBaseDateTimeControl.ctorParameters = function () { return [
6744
7320
  { type: SacFormLayoutCommon },
6745
7321
  { type: i0.Injector },
6746
- { type: i0.ElementRef }
7322
+ { type: i0.ElementRef },
7323
+ { type: i0.ChangeDetectorRef }
6747
7324
  ]; };
6748
7325
  SacBaseDateTimeControl.propDecorators = {
6749
7326
  isrequired: [{ type: i0.Input }],
7327
+ pickerarrow: [{ type: i0.ViewChild, args: ['pickerarrow', { static: false },] }],
7328
+ pickerbutton: [{ type: i0.ViewChild, args: ['pickerbutton', { static: true },] }],
6750
7329
  placeholder: [{ type: i0.Input }],
7330
+ position: [{ type: i0.Input }],
6751
7331
  validationmessagedatetimeformat: [{ type: i0.Input }],
6752
7332
  validationmessagedatetimeformatsummary: [{ type: i0.Input }],
6753
7333
  validationmessagerequired: [{ type: i0.Input }],
6754
7334
  validationmessagerequiredsummary: [{ type: i0.Input }],
7335
+ picker: [{ type: i0.ViewChild, args: ['picker', { static: false },] }],
6755
7336
  valuestring: [{ type: i0.Input }]
6756
7337
  };
6757
7338
 
6758
- /**
6759
- * Moment
6760
- */
6761
- var moment$3 = moment___default['default'];
6762
7339
  /**
6763
7340
  * Komponente für SacDateCommon. Extends SacBaseDateTimeControl
6764
7341
  */
@@ -6771,9 +7348,10 @@
6771
7348
  * @param formlayout SacFormLayoutCommon to define scoped layout settings
6772
7349
  * @param injector Injector for injecting services
6773
7350
  * @param elementRef reference to html element
7351
+ * @param cdRef Change Dectection Servie
6774
7352
  */
6775
- function SacDateCommon(formlayout, injector, elementRef) {
6776
- 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;
6777
7355
  _this.elementRef = elementRef;
6778
7356
  // #region Properties
6779
7357
  /**
@@ -6809,6 +7387,18 @@
6809
7387
  lazy: false,
6810
7388
  overwrite: true,
6811
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'];
6812
7402
  /**
6813
7403
  * Resource Key für Validation Message MaxDate bei Control
6814
7404
  */
@@ -6825,28 +7415,26 @@
6825
7415
  * Resource Key für Validation Message MinDate in Validation Summary
6826
7416
  */
6827
7417
  _this.validationmessagesummarymindate = _this.validationKeyService.ValidationErrorSummaryMinDate;
6828
- /**
6829
- * Min Date
6830
- */
6831
- _this._maxdate = null;
6832
- /**
6833
- * Min Date
6834
- */
6835
- _this._mindate = null;
6836
- /**
6837
- * Definiert ob der Date Selector angezeigt wird
6838
- */
6839
- _this._showselector = false;
6840
7418
  return _this;
6841
7419
  }
6842
- Object.defineProperty(SacDateCommon.prototype, "maxdate", {
7420
+ Object.defineProperty(SacDateCommon.prototype, "IconSelector", {
6843
7421
  // #endregion Constructors
6844
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", {
6845
7433
  /**
6846
7434
  * Min Date
6847
7435
  */
6848
7436
  set: function (v) {
6849
- var date = moment$3(v, [this.DATEFORMAT], true);
7437
+ var date = this.moment(v, [this.DATEFORMAT], true);
6850
7438
  if (date.isValid()) {
6851
7439
  this._maxdate = _super.prototype.getDate.call(this, date).toDate();
6852
7440
  }
@@ -6862,7 +7450,7 @@
6862
7450
  * Min Date
6863
7451
  */
6864
7452
  set: function (v) {
6865
- var date = moment$3(v, [this.DATEFORMAT], true);
7453
+ var date = this.moment(v, [this.DATEFORMAT], true);
6866
7454
  if (date.isValid()) {
6867
7455
  this._mindate = _super.prototype.getDate.call(this, date).toDate();
6868
7456
  }
@@ -6873,27 +7461,8 @@
6873
7461
  enumerable: false,
6874
7462
  configurable: true
6875
7463
  });
6876
- Object.defineProperty(SacDateCommon.prototype, "IconSelector", {
6877
- /**
6878
- * icon for date selector button
6879
- */
6880
- get: function () {
6881
- return this.iconService.DateComponentSelectorIcon;
6882
- },
6883
- enumerable: false,
6884
- configurable: true
6885
- });
6886
7464
  // #endregion Public Getters And Setters
6887
7465
  // #region Public Methods
6888
- /**
6889
- * HostListener
6890
- */
6891
- SacDateCommon.prototype.onClick = function (targetElement) {
6892
- var clickedInside = this.elementRef.nativeElement.contains(targetElement);
6893
- if (!clickedInside) {
6894
- this._showselector = false;
6895
- }
6896
- };
6897
7466
  /**
6898
7467
  * Methode ergibt Datum-Format vom String
6899
7468
  */
@@ -6914,10 +7483,23 @@
6914
7483
  this.setValueString('');
6915
7484
  }
6916
7485
  else {
6917
- this.value = moment$3(v.date).utc().toDate();
7486
+ this.value = this.moment(v.date).utc().toDate();
6918
7487
  }
6919
7488
  this._showselector = false;
6920
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
+ };
6921
7503
  /**
6922
7504
  * Zeigt Date Selector an
6923
7505
  */
@@ -6963,7 +7545,8 @@
6963
7545
  SacDateCommon.ctorParameters = function () { return [
6964
7546
  { type: SacFormLayoutCommon },
6965
7547
  { type: i0.Injector },
6966
- { type: i0.ElementRef }
7548
+ { type: i0.ElementRef },
7549
+ { type: i0.ChangeDetectorRef }
6967
7550
  ]; };
6968
7551
  SacDateCommon.propDecorators = {
6969
7552
  validationmessagemaxdate: [{ type: i0.Input }],
@@ -7101,11 +7684,11 @@
7101
7684
  this._initialValue = null;
7102
7685
  }
7103
7686
  else {
7104
- this._initialValue = moment$4(v);
7687
+ this._initialValue = moment$2(v);
7105
7688
  }
7106
7689
  this._selectedValue = null;
7107
7690
  if (this._initialValue === null) {
7108
- this.initCalendar(moment$4());
7691
+ this.initCalendar(moment$2());
7109
7692
  }
7110
7693
  else {
7111
7694
  this.initCalendar(this._initialValue);
@@ -7242,7 +7825,7 @@
7242
7825
  .forEach(function (itm) { return (itm.isselected = false); }); });
7243
7826
  v.isnew = true;
7244
7827
  v.isselected = true;
7245
- var dateValue = moment$4(v.date);
7828
+ var dateValue = moment$2(v.date);
7246
7829
  // Übernehmen der Zeit aus dem bestehenden Wert
7247
7830
  if (this._selectedValue === null) {
7248
7831
  if (this._initialValue !== null) {
@@ -7297,7 +7880,7 @@
7297
7880
  * Auswahl auf aktuelle Zeit stellen
7298
7881
  */
7299
7882
  SacDateSelectorCommon.prototype.setToday = function () {
7300
- this._selectedValue = moment$4();
7883
+ this._selectedValue = moment$2();
7301
7884
  /**
7302
7885
  * Sekunden un Milisekunden Clean
7303
7886
  */
@@ -7333,20 +7916,20 @@
7333
7916
  * Initial Datum
7334
7917
  */
7335
7918
  SacDateSelectorCommon.prototype.initDates = function () {
7336
- var currentMonth = moment$4(new Date(this.year, this.month, 1));
7337
- var lastMonth = moment$4(new Date(this.year, this.month, 1));
7919
+ var currentMonth = moment$2(new Date(this.year, this.month, 1));
7920
+ var lastMonth = moment$2(new Date(this.year, this.month, 1));
7338
7921
  lastMonth.add({ months: -1 });
7339
- var nextMonths = moment$4(new Date(this.year, this.month, 1));
7922
+ var nextMonths = moment$2(new Date(this.year, this.month, 1));
7340
7923
  nextMonths.add({ months: 1 });
7341
7924
  var weekdayBegin = currentMonth.weekday();
7342
- 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();
7343
7926
  // Clear Array
7344
7927
  var daysInCalendar = [];
7345
7928
  this.dates = [];
7346
7929
  if (weekdayBegin !== this.beginOfCalendar) {
7347
7930
  var lastMonthDay = lastMonth.daysInMonth();
7348
7931
  var lastMonthDate = new Date(lastMonth.year(), lastMonth.month(), lastMonthDay);
7349
- var lastMonthWeekday = moment$4(lastMonthDate).weekday();
7932
+ var lastMonthWeekday = moment$2(lastMonthDate).weekday();
7350
7933
  var daysInLastMonth = 7 - ((7 + this.beginOfCalendar - lastMonthWeekday) % 7);
7351
7934
  if (daysInLastMonth === 7) {
7352
7935
  daysInLastMonth = 0;
@@ -7359,9 +7942,9 @@
7359
7942
  for (var dayinmonth = 1; dayinmonth <= currentMonth.daysInMonth(); dayinmonth++) {
7360
7943
  var isSelectedDate = false;
7361
7944
  var isNewDate = false;
7362
- var isCurrentDate = moment$4().month() === this.month &&
7363
- moment$4().year() === this.year &&
7364
- moment$4().date() === dayinmonth;
7945
+ var isCurrentDate = moment$2().month() === this.month &&
7946
+ moment$2().year() === this.year &&
7947
+ moment$2().date() === dayinmonth;
7365
7948
  // Initial Wert setzen, falls vorhanden
7366
7949
  if (this._initialValue !== null) {
7367
7950
  isSelectedDate =
@@ -7376,7 +7959,7 @@
7376
7959
  this._selectedValue.year() === this.year &&
7377
7960
  this._selectedValue.date() === dayinmonth;
7378
7961
  }
7379
- 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));
7380
7963
  }
7381
7964
  var endOfCalender;
7382
7965
  if (this.beginOfCalendar === 0) {
@@ -7412,7 +7995,7 @@
7412
7995
  */
7413
7996
  if (this._selectedValue === null) {
7414
7997
  if (this._initialValue === null) {
7415
- this._selectedValue = moment$4();
7998
+ this._selectedValue = moment$2();
7416
7999
  }
7417
8000
  else {
7418
8001
  this._selectedValue = this._initialValue;
@@ -7441,13 +8024,9 @@
7441
8024
  /**
7442
8025
  * Moment
7443
8026
  */
7444
- var moment$4 = moment___default['default'];
8027
+ var moment$2 = moment___default['default'];
7445
8028
  // #endregion Variables
7446
8029
 
7447
- /**
7448
- * Moment
7449
- */
7450
- var moment$5 = moment___default['default'];
7451
8030
  /**
7452
8031
  * Komponente für SacDateTimeCommon. Extends SacBaseDateTimeControl
7453
8032
  */
@@ -7461,8 +8040,8 @@
7461
8040
  * @param injector Injector for injecting services
7462
8041
  * @param elementRef reference to html element
7463
8042
  */
7464
- function SacDateTimeCommon(formlayout, injector, elementRef) {
7465
- 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;
7466
8045
  _this.elementRef = elementRef;
7467
8046
  // #region Properties
7468
8047
  /**
@@ -7513,6 +8092,18 @@
7513
8092
  lazy: false,
7514
8093
  overwrite: true,
7515
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'];
7516
8107
  /**
7517
8108
  * Resource Key für Validation Message MaxDate bei Control
7518
8109
  */
@@ -7529,28 +8120,26 @@
7529
8120
  * Resource Key für Validation Message MinDate in Validation Summary
7530
8121
  */
7531
8122
  _this.validationmessagesummarymindate = _this.validationKeyService.ValidationErrorSummaryMinDate;
7532
- /**
7533
- * Maximaler Wert des Datums
7534
- */
7535
- _this._maxdate = null;
7536
- /**
7537
- * Minimaler Wert des Datums
7538
- */
7539
- _this._mindate = null;
7540
- /**
7541
- * Definiert ob der Date Selector angezeigt wird
7542
- */
7543
- _this._showselector = false;
7544
8123
  return _this;
7545
8124
  }
7546
- Object.defineProperty(SacDateTimeCommon.prototype, "maxdate", {
8125
+ Object.defineProperty(SacDateTimeCommon.prototype, "IconSelector", {
7547
8126
  // #endregion Constructors
7548
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", {
7549
8138
  /**
7550
8139
  * Max Date
7551
8140
  */
7552
8141
  set: function (v) {
7553
- var date = moment$5(v, [this.DATEFORMAT], true);
8142
+ var date = this.moment(v, [this.DATEFORMAT], true);
7554
8143
  if (date.isValid()) {
7555
8144
  this._maxdate = _super.prototype.getDate.call(this, date).toDate();
7556
8145
  }
@@ -7566,7 +8155,7 @@
7566
8155
  * Min Date
7567
8156
  */
7568
8157
  set: function (v) {
7569
- var date = moment$5(v, [this.DATEFORMAT], true);
8158
+ var date = this.moment(v, [this.DATEFORMAT], true);
7570
8159
  if (date.isValid()) {
7571
8160
  this._mindate = _super.prototype.getDate.call(this, date).toDate();
7572
8161
  }
@@ -7577,27 +8166,8 @@
7577
8166
  enumerable: false,
7578
8167
  configurable: true
7579
8168
  });
7580
- Object.defineProperty(SacDateTimeCommon.prototype, "IconSelector", {
7581
- /**
7582
- * icon for date selector button
7583
- */
7584
- get: function () {
7585
- return this.iconService.DateTimeComponentSelectorIcon;
7586
- },
7587
- enumerable: false,
7588
- configurable: true
7589
- });
7590
8169
  // #endregion Public Getters And Setters
7591
8170
  // #region Public Methods
7592
- /**
7593
- * HostListener
7594
- */
7595
- SacDateTimeCommon.prototype.onClick = function (targetElement) {
7596
- var clickedInside = this.elementRef.nativeElement.contains(targetElement);
7597
- if (!clickedInside) {
7598
- this._showselector = false;
7599
- }
7600
- };
7601
8171
  /**
7602
8172
  * Methode ergibt Datum-Format vom String
7603
8173
  */
@@ -7618,10 +8188,23 @@
7618
8188
  this.setValueString('');
7619
8189
  }
7620
8190
  else {
7621
- this.value = moment$5(v.date).utc().toDate();
8191
+ this.value = this.moment(v.date).utc().toDate();
7622
8192
  }
7623
8193
  this._showselector = false;
7624
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
+ };
7625
8208
  /**
7626
8209
  * DateSelector wird beim Click-Event angezeigt
7627
8210
  */
@@ -7669,7 +8252,8 @@
7669
8252
  SacDateTimeCommon.ctorParameters = function () { return [
7670
8253
  { type: SacFormLayoutCommon },
7671
8254
  { type: i0.Injector },
7672
- { type: i0.ElementRef }
8255
+ { type: i0.ElementRef },
8256
+ { type: i0.ChangeDetectorRef }
7673
8257
  ]; };
7674
8258
  SacDateTimeCommon.propDecorators = {
7675
8259
  validationmessagemaxdate: [{ type: i0.Input }],
@@ -7681,10 +8265,6 @@
7681
8265
  onClick: [{ type: i0.HostListener, args: ['document:click', ['$event.target'],] }]
7682
8266
  };
7683
8267
 
7684
- /**
7685
- * Moment
7686
- */
7687
- var moment$6 = moment___default['default'];
7688
8268
  /**
7689
8269
  * Komponente für SacTimeCommon. Extends SacBaseDateTimeControl
7690
8270
  */
@@ -7698,8 +8278,8 @@
7698
8278
  * @param injector Injector for injecting services
7699
8279
  * @param elementRef reference to html element
7700
8280
  */
7701
- function SacTimeCommon(formlayout, injector, elementRef) {
7702
- 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;
7703
8283
  _this.elementRef = elementRef;
7704
8284
  // #region Properties
7705
8285
  /**
@@ -7730,6 +8310,18 @@
7730
8310
  lazy: false,
7731
8311
  overwrite: true,
7732
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'];
7733
8325
  /**
7734
8326
  * Resource Key für Validation Message MinTime bei Control
7735
8327
  */
@@ -7746,28 +8338,26 @@
7746
8338
  * Resource Key für Validation Message MinTime in Validation Summary
7747
8339
  */
7748
8340
  _this.validationmessagesummarymintime = _this.validationKeyService.ValidationErrorSummaryMinTime;
7749
- /**
7750
- * Max Time
7751
- */
7752
- _this._maxtime = null;
7753
- /**
7754
- * Min Time
7755
- */
7756
- _this._mintime = null;
7757
- /**
7758
- * Definiert ob der Date Selector angezeigt wird
7759
- */
7760
- _this._showselector = false;
7761
8341
  return _this;
7762
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
+ });
7763
8355
  Object.defineProperty(SacTimeCommon.prototype, "maxtime", {
7764
- // #endregion Constructors
7765
- // #region Public Getters And Setters
7766
8356
  /**
7767
8357
  * Max Time
7768
8358
  */
7769
8359
  set: function (v) {
7770
- var time = moment$6(v, [this.TIMEFORMAT], true);
8360
+ var time = this.moment(v, [this.TIMEFORMAT], true);
7771
8361
  time = this.ModifyParsedDateTimeValue(time);
7772
8362
  if (time.isValid()) {
7773
8363
  this._maxtime = _super.prototype.getDate.call(this, time).toDate();
@@ -7784,7 +8374,7 @@
7784
8374
  * Min Time
7785
8375
  */
7786
8376
  set: function (v) {
7787
- var time = moment$6(v, [this.TIMEFORMAT], true);
8377
+ var time = this.moment(v, [this.TIMEFORMAT], true);
7788
8378
  time = this.ModifyParsedDateTimeValue(time);
7789
8379
  if (time.isValid()) {
7790
8380
  this._mintime = _super.prototype.getDate.call(this, time).toDate();
@@ -7796,27 +8386,8 @@
7796
8386
  enumerable: false,
7797
8387
  configurable: true
7798
8388
  });
7799
- Object.defineProperty(SacTimeCommon.prototype, "IconSelector", {
7800
- /**
7801
- * icon for date selector button
7802
- */
7803
- get: function () {
7804
- return this.iconService.TimeComponentSelectorIcon;
7805
- },
7806
- enumerable: false,
7807
- configurable: true
7808
- });
7809
8389
  // #endregion Public Getters And Setters
7810
8390
  // #region Public Methods
7811
- /**
7812
- * HostListener
7813
- */
7814
- SacTimeCommon.prototype.onClick = function (targetElement) {
7815
- var clickedInside = this.elementRef.nativeElement.contains(targetElement);
7816
- if (!clickedInside) {
7817
- this._showselector = false;
7818
- }
7819
- };
7820
8391
  /**
7821
8392
  * Methode ergibt Datum-Format vom String
7822
8393
  */
@@ -7832,6 +8403,19 @@
7832
8403
  v.year(1900);
7833
8404
  return v;
7834
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
+ };
7835
8419
  /**
7836
8420
  * Zeigt Date Selector an
7837
8421
  */
@@ -7853,7 +8437,7 @@
7853
8437
  this.setValueString('');
7854
8438
  }
7855
8439
  else {
7856
- this.value = moment$6(v.date).utc().toDate();
8440
+ this.value = this.moment(v.date).utc().toDate();
7857
8441
  }
7858
8442
  this._showselector = false;
7859
8443
  };
@@ -7889,7 +8473,8 @@
7889
8473
  SacTimeCommon.ctorParameters = function () { return [
7890
8474
  { type: SacFormLayoutCommon },
7891
8475
  { type: i0.Injector },
7892
- { type: i0.ElementRef }
8476
+ { type: i0.ElementRef },
8477
+ { type: i0.ChangeDetectorRef }
7893
8478
  ]; };
7894
8479
  SacTimeCommon.propDecorators = {
7895
8480
  validationmessagemaxtime: [{ type: i0.Input }],
@@ -7912,18 +8497,26 @@
7912
8497
  * Definiert den Container als Required Form Item
7913
8498
  */
7914
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;
7915
8508
  return _this;
7916
8509
  // #endregion Public Methods
7917
8510
  }
7918
8511
  Object.defineProperty(SacStaticFormContainerCommon.prototype, "isrequired", {
8512
+ // #endregion Properties
8513
+ // #region Public Getters And Setters
7919
8514
  /**
7920
8515
  * Definiert den Container als Required Form Item
7921
8516
  */
7922
8517
  get: function () {
7923
8518
  return this._isrequired;
7924
8519
  },
7925
- // #endregion Properties
7926
- // #region Public Getters And Setters
7927
8520
  /**
7928
8521
  * Definiert den Container als Required Form Item
7929
8522
  */
@@ -7952,6 +8545,8 @@
7952
8545
  { type: i0.Directive }
7953
8546
  ];
7954
8547
  SacStaticFormContainerCommon.propDecorators = {
8548
+ errormessage: [{ type: i0.Input }],
8549
+ isinvalid: [{ type: i0.Input }],
7955
8550
  isrequired: [{ type: i0.Input }]
7956
8551
  };
7957
8552
 
@@ -8846,21 +9441,6 @@
8846
9441
  { type: i0.Directive }
8847
9442
  ];
8848
9443
 
8849
- /**
8850
- * Enum für Tooltip Positionen
8851
- */
8852
- (function (TooltipPosition) {
8853
- TooltipPosition[TooltipPosition["none"] = 0] = "none";
8854
- // tslint:disable-next-line:no-bitwise
8855
- TooltipPosition[TooltipPosition["top"] = 1] = "top";
8856
- // tslint:disable-next-line:no-bitwise
8857
- TooltipPosition[TooltipPosition["right"] = 2] = "right";
8858
- // tslint:disable-next-line:no-bitwise
8859
- TooltipPosition[TooltipPosition["bottom"] = 4] = "bottom";
8860
- // tslint:disable-next-line:no-bitwise
8861
- TooltipPosition[TooltipPosition["left"] = 8] = "left";
8862
- })(exports.TooltipPosition || (exports.TooltipPosition = {}));
8863
-
8864
9444
  /**
8865
9445
  * Tooltip Component
8866
9446
  *
@@ -8883,29 +9463,15 @@
8883
9463
  var _this = this;
8884
9464
  this.cdRef = cdRef;
8885
9465
  this.ref = ref;
9466
+ // #region Properties
8886
9467
  /**
8887
- * Defines whether the tooltip is visible
8888
- */
8889
- this._isTooltipVisible = false;
8890
- /**
8891
- * method if content has changed and proportions need to be reset in the UI.
9468
+ * Helper class to display tooltip on correct position
8892
9469
  */
8893
- this.onContentChange = function () {
8894
- // Do nothing if is not visible
8895
- if (!_this._isTooltipVisible) {
8896
- return;
8897
- }
8898
- setTimeout(function () {
8899
- _this.getLeftPosition();
8900
- _this.getTopPosition();
8901
- });
8902
- };
9470
+ this.popupHelper = new PopUpHelper();
8903
9471
  /**
8904
- * Position of the tooltip. Values: left|top|right|bottom|auto
8905
- *
8906
- * Value 'auto' can be combined with another value.
9472
+ * Defines whether the tooltip is visible
8907
9473
  */
8908
- this.position = 'right|auto';
9474
+ this._isTooltipVisible = false;
8909
9475
  /**
8910
9476
  * Position of the tooltip on the left
8911
9477
  */
@@ -8922,16 +9488,43 @@
8922
9488
  * Position of the tooltip at the top
8923
9489
  */
8924
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
+ };
8925
9518
  }
8926
9519
  Object.defineProperty(SacTooltipCommon.prototype, "inlinemode", {
9520
+ // #endregion Constructors
9521
+ // #region Public Getters And Setters
8927
9522
  /**
8928
9523
  * Property for inline mode for tooltip. Sets the display mode on the wrapper element to `inline`
8929
9524
  */
8930
9525
  get: function () {
8931
9526
  return this._inlinemode;
8932
9527
  },
8933
- // #endregion Constructors
8934
- // #region Public Getters And Setters
8935
9528
  /**
8936
9529
  * Setter for inline mode for tooltip
8937
9530
  */
@@ -8969,50 +9562,7 @@
8969
9562
  * Returns the position of the tooltip
8970
9563
  */
8971
9564
  SacTooltipCommon.prototype.GetTooltipPosition = function () {
8972
- var validPositions = this.ValidatePositions();
8973
- // tslint:disable-next-line:no-bitwise
8974
- if (this.HasPosition(exports.TooltipPosition.right) &&
8975
- validPositions & exports.TooltipPosition.right) {
8976
- return exports.TooltipPosition.right;
8977
- }
8978
- // tslint:disable-next-line:no-bitwise
8979
- if (this.HasPosition(exports.TooltipPosition.top) &&
8980
- validPositions & exports.TooltipPosition.top) {
8981
- return exports.TooltipPosition.top;
8982
- }
8983
- // tslint:disable-next-line:no-bitwise
8984
- if (this.HasPosition(exports.TooltipPosition.left) &&
8985
- validPositions & exports.TooltipPosition.left) {
8986
- return exports.TooltipPosition.left;
8987
- }
8988
- // tslint:disable-next-line:no-bitwise
8989
- if (this.HasPosition(exports.TooltipPosition.bottom) &&
8990
- validPositions & exports.TooltipPosition.bottom) {
8991
- return exports.TooltipPosition.bottom;
8992
- }
8993
- // Get Auto Position or Default
8994
- if (this.IsAutoPosition()) {
8995
- // tslint:disable-next-line:no-bitwise
8996
- if (validPositions & exports.TooltipPosition.right) {
8997
- return exports.TooltipPosition.right;
8998
- }
8999
- // tslint:disable-next-line:no-bitwise
9000
- if (validPositions & exports.TooltipPosition.top) {
9001
- return exports.TooltipPosition.top;
9002
- }
9003
- // tslint:disable-next-line:no-bitwise
9004
- if (validPositions & exports.TooltipPosition.left) {
9005
- return exports.TooltipPosition.left;
9006
- }
9007
- // tslint:disable-next-line:no-bitwise
9008
- if (validPositions & exports.TooltipPosition.bottom) {
9009
- return exports.TooltipPosition.bottom;
9010
- }
9011
- return exports.TooltipPosition.right;
9012
- }
9013
- else {
9014
- return this.GetPosition();
9015
- }
9565
+ return this.popupHelper.getDisplayPosition(this.content, this.tooltipcontainer, this.getTooltipOffset(), this.getTooltipOffset(), this.position, true);
9016
9566
  };
9017
9567
  /**
9018
9568
  * Hide tooltip
@@ -9044,24 +9594,13 @@
9044
9594
  * Calculates the height of the tooltip
9045
9595
  */
9046
9596
  SacTooltipCommon.prototype.getToolTipHeight = function () {
9047
- var _a;
9048
- if (this.tooltipcontainer) {
9049
- return (_a = this.tooltipcontainer.nativeElement.firstElementChild.clientHeight) !== null && _a !== void 0 ? _a : 0;
9050
- }
9051
- else {
9052
- return 0;
9053
- }
9597
+ return this.popupHelper.getPopupHeight(this.tooltipcontainer);
9054
9598
  };
9055
9599
  /**
9056
9600
  * Calculates the width of the tooltips
9057
9601
  */
9058
9602
  SacTooltipCommon.prototype.getToolTipWidth = function () {
9059
- if (this.tooltipcontainer) {
9060
- return this.tooltipcontainer.nativeElement.firstElementChild.clientWidth;
9061
- }
9062
- else {
9063
- return 0;
9064
- }
9603
+ return this.popupHelper.getPopupWidth(this.tooltipcontainer);
9065
9604
  };
9066
9605
  /**
9067
9606
  * Detect Changes after view checked. Prevent ExpressionChangedAfterItHasBeenCheckedError error
@@ -9106,187 +9645,37 @@
9106
9645
  document.body.appendChild(this.tooltipcontainer.nativeElement);
9107
9646
  }
9108
9647
  };
9109
- // #endregion Protected Abstract Methods
9648
+ // #endregion Protected Methods
9110
9649
  // #region Private Methods
9111
- /**
9112
- * Returns the defined position for the tooltip
9113
- */
9114
- SacTooltipCommon.prototype.GetPosition = function () {
9115
- var positions = this.position.split('|');
9116
- if (this.HasPosition(exports.TooltipPosition.left)) {
9117
- return exports.TooltipPosition.left;
9118
- }
9119
- if (this.HasPosition(exports.TooltipPosition.top)) {
9120
- return exports.TooltipPosition.top;
9121
- }
9122
- if (this.HasPosition(exports.TooltipPosition.right)) {
9123
- return exports.TooltipPosition.right;
9124
- }
9125
- if (this.HasPosition(exports.TooltipPosition.bottom)) {
9126
- return exports.TooltipPosition.bottom;
9127
- }
9128
- // Default Position if empty
9129
- return exports.TooltipPosition.right;
9130
- };
9131
- /**
9132
- * Returns whether the position has been configured
9133
- *
9134
- * @param position Position to be checked
9135
- */
9136
- SacTooltipCommon.prototype.HasPosition = function (position) {
9137
- var positions = this.position.split('|');
9138
- if (position === exports.TooltipPosition.right && positions.indexOf('right') >= 0) {
9139
- return true;
9140
- }
9141
- if (position === exports.TooltipPosition.top && positions.indexOf('top') >= 0) {
9142
- return true;
9143
- }
9144
- if (position === exports.TooltipPosition.left && positions.indexOf('left') >= 0) {
9145
- return true;
9146
- }
9147
- if (position === exports.TooltipPosition.bottom &&
9148
- positions.indexOf('bottom') >= 0) {
9149
- return true;
9150
- }
9151
- return false;
9152
- };
9153
- /**
9154
- * Defines whether AutoPosition is active
9155
- */
9156
- SacTooltipCommon.prototype.IsAutoPosition = function () {
9157
- var positions = this.position.split('|');
9158
- return positions.indexOf('auto') >= 0;
9159
- };
9160
- /**
9161
- * Checks whether the position is valid or whether the tooltip on the position has space
9162
- */
9163
- SacTooltipCommon.prototype.ValidatePositions = function () {
9164
- // Check if Container is false
9165
- if (this.tooltipcontainer === undefined) {
9166
- return exports.TooltipPosition.right;
9167
- }
9168
- var allowedPositions = exports.TooltipPosition.none;
9169
- var basePosition = this.content.nativeElement.firstElementChild.getBoundingClientRect();
9170
- var tooltipRect = this.tooltipcontainer.nativeElement.firstElementChild.getBoundingClientRect();
9171
- var leftPosOk = basePosition.left - tooltipRect.width + (this.getTooltipOffset() * -1) > 0;
9172
- var rightPosOk = basePosition.right + tooltipRect.width + this.getTooltipOffset() < window.innerWidth;
9173
- var topPosOk = basePosition.top - tooltipRect.height > 0;
9174
- var bottomPosOk = basePosition.bottom + tooltipRect.height < window.innerHeight;
9175
- var leftHalfPosOk = basePosition.left - tooltipRect.width / 2 > 0;
9176
- var rightHalfPosOk = basePosition.right + tooltipRect.width / 2 < window.innerWidth;
9177
- var topHalfPosOk = basePosition.top - tooltipRect.height / 2 > 0;
9178
- var bottomHalfPosOk = basePosition.bottom + tooltipRect.height / 2 < window.innerHeight;
9179
- if (leftPosOk && topHalfPosOk && bottomHalfPosOk) {
9180
- // tslint:disable-next-line:no-bitwise
9181
- allowedPositions = allowedPositions | exports.TooltipPosition.left;
9182
- }
9183
- if (rightPosOk && topHalfPosOk && bottomHalfPosOk) {
9184
- // tslint:disable-next-line:no-bitwise
9185
- allowedPositions = allowedPositions | exports.TooltipPosition.right;
9186
- }
9187
- if (topPosOk && leftHalfPosOk && rightHalfPosOk) {
9188
- // tslint:disable-next-line:no-bitwise
9189
- allowedPositions = allowedPositions | exports.TooltipPosition.top;
9190
- }
9191
- if (bottomPosOk && leftHalfPosOk && rightHalfPosOk) {
9192
- // tslint:disable-next-line:no-bitwise
9193
- allowedPositions = allowedPositions | exports.TooltipPosition.bottom;
9194
- }
9195
- return allowedPositions;
9196
- };
9197
9650
  /**
9198
9651
  * Calculates the position of the tooltip from links
9199
9652
  */
9200
9653
  SacTooltipCommon.prototype.getLeftPosition = function () {
9201
- if (this.content !== null && this.content !== undefined) {
9202
- var item = this.content.nativeElement;
9203
- if (item.children.length >= 1) {
9204
- var childItem = item.firstElementChild;
9205
- var contentPosition = childItem.getBoundingClientRect();
9206
- switch (this.GetTooltipPosition()) {
9207
- case exports.TooltipPosition.top:
9208
- this.LeftPos = contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2;
9209
- return (contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2);
9210
- case exports.TooltipPosition.right:
9211
- this.LeftPos = contentPosition.left + contentPosition.width + this.getTooltipOffset();
9212
- return contentPosition.left + contentPosition.width + this.getTooltipOffset();
9213
- case exports.TooltipPosition.bottom:
9214
- this.LeftPos = contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2;
9215
- return (contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2);
9216
- case exports.TooltipPosition.left:
9217
- this.LeftPos = contentPosition.left - this.getToolTipWidth() + (this.getTooltipOffset() * -1);
9218
- return contentPosition.left - this.getToolTipWidth() + (this.getTooltipOffset() * -1);
9219
- }
9220
- return this.content.nativeElement.offsetTop;
9221
- }
9222
- else {
9223
- return this.content.nativeElement.offsetTop;
9224
- }
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;
9225
9659
  }
9226
9660
  else {
9227
- return this.ref.nativeElement.offsetLeft;
9661
+ this.posArrowTop = null;
9228
9662
  }
9663
+ return value;
9229
9664
  };
9230
9665
  /**
9231
9666
  * Calculates the position of the tooltip from the top
9232
9667
  */
9233
9668
  SacTooltipCommon.prototype.getTopPosition = function () {
9234
- if (this.content !== null && this.content !== undefined) {
9235
- var item = this.content.nativeElement;
9236
- if (item.children.length >= 1) {
9237
- var childItem = item.firstElementChild;
9238
- var contentPosition = childItem.getBoundingClientRect();
9239
- // Get Position with Scroll (Scrollbars inside page should be substracted)
9240
- var contentPositionTop = childItem.offsetTop + this.getOffsetTopParent(childItem.offsetParent) - this.getScrollTopParent(childItem.parentElement);
9241
- switch (this.GetTooltipPosition()) {
9242
- case exports.TooltipPosition.top:
9243
- this.TopPos = contentPositionTop - this.getToolTipHeight() + (this.getTooltipOffset() * -1);
9244
- return contentPositionTop - this.getToolTipHeight() + (this.getTooltipOffset() * -1);
9245
- case exports.TooltipPosition.right:
9246
- this.TopPos = contentPositionTop + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
9247
- return contentPositionTop + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
9248
- case exports.TooltipPosition.bottom:
9249
- this.TopPos = contentPositionTop + contentPosition.height + this.getTooltipOffset();
9250
- return contentPositionTop + contentPosition.height + this.getTooltipOffset();
9251
- case exports.TooltipPosition.left:
9252
- this.TopPos = contentPositionTop + contentPosition.height / 2 - this.getToolTipHeight() / 2;
9253
- return (contentPositionTop + contentPosition.height / 2 - this.getToolTipHeight() / 2);
9254
- }
9255
- return (childItem.clientTop + childItem.offsetTop - (this.getToolTipHeight() / 2 - childItem.clientHeight / 2));
9256
- }
9257
- else {
9258
- return this.content.nativeElement.offsetTop;
9259
- }
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;
9260
9674
  }
9261
9675
  else {
9262
- return this.ref.nativeElement.offsetTop;
9263
- }
9264
- };
9265
- /**
9266
- * Calculates the top of the page inside all elements
9267
- * @param element HTML Element
9268
- * @returns summarized top value for absolute position
9269
- */
9270
- SacTooltipCommon.prototype.getOffsetTopParent = function (element) {
9271
- if (!element.offsetParent) {
9272
- return element.offsetTop;
9676
+ this.posArrowLeft = null;
9273
9677
  }
9274
- var parentValue = this.getOffsetTopParent(element.offsetParent);
9275
- var offset = element.offsetTop;
9276
- return parentValue + offset;
9277
- };
9278
- /**
9279
- * Caclulate Scrollbars inside tree
9280
- * @param element HTML Element
9281
- * @returns Scroll top value of element with all childs
9282
- */
9283
- SacTooltipCommon.prototype.getScrollTopParent = function (element) {
9284
- // Body Scroll should not be calculated
9285
- if (!element.parentElement) {
9286
- return 0;
9287
- }
9288
- var parentValue = this.getScrollTopParent(element.parentElement);
9289
- return parentValue + element.scrollTop;
9678
+ return value;
9290
9679
  };
9291
9680
  return SacTooltipCommon;
9292
9681
  }());
@@ -9298,9 +9687,9 @@
9298
9687
  { type: i0.ElementRef }
9299
9688
  ]; };
9300
9689
  SacTooltipCommon.propDecorators = {
9690
+ content: [{ type: i0.ViewChild, args: ['container', { static: true },] }],
9301
9691
  position: [{ type: i0.Input }],
9302
9692
  tooltiptext: [{ type: i0.Input }],
9303
- content: [{ type: i0.ViewChild, args: ['container', { static: true },] }],
9304
9693
  inlinemode: [{ type: i0.Input }],
9305
9694
  tooltip: [{ type: i0.ViewChild, args: ['tooltip', { static: false },] }]
9306
9695
  };