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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/bundles/simpleangularcontrols-sac-common.umd.js +696 -412
  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 +1 -1
  6. package/common/baseinputcontrol.d.ts +0 -4
  7. package/common/basemodelcontrol.d.ts +25 -1
  8. package/common/baseuploadcontrol.d.ts +0 -5
  9. package/controls/checkbox/checkbox.d.ts +12 -3
  10. package/controls/datetime/date.d.ts +0 -4
  11. package/controls/datetime/datetime.d.ts +0 -4
  12. package/controls/datetime/time.d.ts +0 -4
  13. package/controls/grid/grid.d.ts +38 -36
  14. package/controls/grid/gridbutton.d.ts +13 -13
  15. package/controls/grid/gridcolumn.d.ts +8 -8
  16. package/controls/grid/gridcolumnaction.d.ts +3 -3
  17. package/controls/grid/gridcolumnbase.d.ts +45 -37
  18. package/controls/grid/gridimage.d.ts +2 -2
  19. package/controls/grid/model.d.ts +51 -42
  20. package/controls/grid/paging.d.ts +41 -43
  21. package/controls/input/inputsearch.d.ts +13 -4
  22. package/controls/layout/formlayout.d.ts +13 -1
  23. package/controls/static/formcontainer.d.ts +2 -6
  24. package/controls/tooltip/tooltip.d.ts +88 -63
  25. package/esm2015/common/basedatetimecontrol.js +1 -1
  26. package/esm2015/common/baseinputcontrol.js +2 -7
  27. package/esm2015/common/basemodelcontrol.js +44 -7
  28. package/esm2015/common/baseuploadcontrol.js +2 -3
  29. package/esm2015/controls/checkbox/checkbox.js +29 -6
  30. package/esm2015/controls/datetime/date.js +2 -3
  31. package/esm2015/controls/datetime/datetime.js +2 -3
  32. package/esm2015/controls/datetime/time.js +2 -3
  33. package/esm2015/controls/grid/grid.js +21 -21
  34. package/esm2015/controls/grid/gridbutton.js +19 -13
  35. package/esm2015/controls/grid/gridcolumn.js +14 -7
  36. package/esm2015/controls/grid/gridcolumnaction.js +6 -5
  37. package/esm2015/controls/grid/gridcolumnbase.js +67 -55
  38. package/esm2015/controls/grid/gridimage.js +3 -3
  39. package/esm2015/controls/grid/model.js +51 -30
  40. package/esm2015/controls/grid/paging.js +40 -42
  41. package/esm2015/controls/input/inputsearch.js +35 -6
  42. package/esm2015/controls/layout/formlayout.js +14 -3
  43. package/esm2015/controls/static/formcontainer.js +11 -10
  44. package/esm2015/controls/tooltip/tooltip.js +260 -189
  45. package/esm2015/interfaces/ISacConfigurationService.js +1 -1
  46. package/esm2015/interfaces/ISacIconService.js +1 -1
  47. package/esm2015/public_api.js +10 -3
  48. package/esm2015/services/sac-configuration.service.js +25 -1
  49. package/esm2015/services/sac-icon.service.js +13 -1
  50. package/esm2015/simpleangularcontrols-sac-common.js +1 -7
  51. package/esm2015/utilities/guid.js +4 -2
  52. package/esm2015/validation/isDateValid.js +9 -1
  53. package/fesm2015/simpleangularcontrols-sac-common.js +652 -395
  54. package/fesm2015/simpleangularcontrols-sac-common.js.map +1 -1
  55. package/interfaces/ISacConfigurationService.d.ts +16 -0
  56. package/interfaces/ISacIconService.d.ts +8 -0
  57. package/package.json +4 -4
  58. package/public_api.d.ts +7 -1
  59. package/services/sac-configuration.service.d.ts +32 -0
  60. package/services/sac-icon.service.d.ts +16 -0
  61. package/simpleangularcontrols-sac-common-10.0.0-rc.11.tgz +0 -0
  62. package/simpleangularcontrols-sac-common.d.ts +0 -6
  63. package/simpleangularcontrols-sac-common.metadata.json +1 -1
  64. package/simpleangularcontrols-sac-common-10.0.0-rc.1.tgz +0 -0
@@ -2,7 +2,7 @@ import { EventEmitter, Directive, Input, Output, ɵɵdefineInjectable, Injectabl
2
2
  import { NgControl, FormControlName, FormGroupDirective, Validators, FormGroup, NgForm } from '@angular/forms';
3
3
  import { Observable, of } from 'rxjs';
4
4
  import { HttpClient } from '@angular/common/http';
5
- import moment_ from 'moment';
5
+ import moment_, { ISO_8601 } from 'moment';
6
6
  import { MaskedRange } from 'imask';
7
7
  import { UploadxService } from 'ngx-uploadx';
8
8
  import { DOCUMENT } from '@angular/common';
@@ -172,6 +172,10 @@ var ControlHeight;
172
172
  class SacFormLayoutCommon {
173
173
  constructor() {
174
174
  // #region Properties
175
+ /**
176
+ * 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.
177
+ */
178
+ this.checkboxstyle = null;
175
179
  /**
176
180
  * Defines the standard height of the components
177
181
  */
@@ -179,7 +183,11 @@ class SacFormLayoutCommon {
179
183
  /**
180
184
  * defines that error messages are displayed under the controls
181
185
  */
182
- this.inlineError = true;
186
+ this.inlineError = null;
187
+ /**
188
+ * Defines if InputSearch uses an icon at the button or the text
189
+ */
190
+ this.inputsearchiconmode = null;
183
191
  /**
184
192
  * defines that the labels are displayed as adaptive labels
185
193
  */
@@ -216,15 +224,18 @@ class SacFormLayoutCommon {
216
224
  * Returns whether the inline error messages for the form are active.
217
225
  */
218
226
  get IsInlineErrorEnabled() {
219
- return this.inlineError !== false;
227
+ return this.inlineError;
220
228
  }
221
229
  }
222
230
  SacFormLayoutCommon.decorators = [
223
231
  { type: Directive }
224
232
  ];
225
233
  SacFormLayoutCommon.propDecorators = {
234
+ checkboxstyle: [{ type: Input }],
226
235
  componentHeight: [{ type: Input }],
236
+ helptextmode: [{ type: Input }],
227
237
  inlineError: [{ type: Input }],
238
+ inputsearchiconmode: [{ type: Input }],
228
239
  isAdaptiveLabel: [{ type: Input }],
229
240
  labelSizeLg: [{ type: Input }],
230
241
  labelSizeMd: [{ type: Input }],
@@ -249,6 +260,12 @@ SacAbstractConfigurationService.decorators = [
249
260
  * */
250
261
  class SacDefaultConfigurationService extends SacAbstractConfigurationService {
251
262
  // #region Public Getters And Setters
263
+ /**
264
+ * @inheritdoc
265
+ */
266
+ get CheckboxStyle() {
267
+ return 'checkbox';
268
+ }
252
269
  /**
253
270
  * @inheritdoc
254
271
  */
@@ -261,6 +278,24 @@ class SacDefaultConfigurationService extends SacAbstractConfigurationService {
261
278
  get CurrencyText() {
262
279
  return 'CHF';
263
280
  }
281
+ /**
282
+ * @inheritdoc
283
+ */
284
+ get HelptextMode() {
285
+ return 'text';
286
+ }
287
+ /**
288
+ * @inheritdoc
289
+ */
290
+ get InlineErrorEnabled() {
291
+ return true;
292
+ }
293
+ /**
294
+ * @inheritdoc
295
+ */
296
+ get InputSearchIconMode() {
297
+ return 'text';
298
+ }
264
299
  /**
265
300
  * @inheritdoc
266
301
  */
@@ -685,6 +720,12 @@ class SacDefaultIconService extends SacAbstractIconService {
685
720
  get DateTimeSelectorComponentMonthPrevIcon() {
686
721
  return 'fa fa-chevron-left';
687
722
  }
723
+ /**
724
+ * @inheritdoc
725
+ */
726
+ get GenericHelptextIcon() {
727
+ return 'fa fa-info-circle';
728
+ }
688
729
  /**
689
730
  * @inheritdoc
690
731
  */
@@ -697,6 +738,12 @@ class SacDefaultIconService extends SacAbstractIconService {
697
738
  get GridComponentSortUp() {
698
739
  return 'fa fa-caret-up';
699
740
  }
741
+ /**
742
+ * @inheritdoc
743
+ */
744
+ get InputSearchButtonIcon() {
745
+ return 'fas fa-search';
746
+ }
700
747
  /**
701
748
  * @inheritdoc
702
749
  */
@@ -1491,11 +1538,12 @@ function mapToObject(map) {
1491
1538
  return obj;
1492
1539
  }
1493
1540
 
1541
+ // #region Functions
1494
1542
  /**
1495
1543
  * create a guid with crypto library if availabe and a fallback to Math.Random implementation
1496
1544
  */
1497
1545
  function createGuid() {
1498
- if (typeof crypto !== undefined) {
1546
+ if (typeof crypto !== undefined && crypto['randomUUID'] !== undefined) {
1499
1547
  // return guid without hyphen
1500
1548
  return crypto['randomUUID']().replace(/\-/gi, '');
1501
1549
  }
@@ -1505,7 +1553,8 @@ function createGuid() {
1505
1553
  return v.toString(16);
1506
1554
  });
1507
1555
  }
1508
- }
1556
+ }
1557
+ // #endregion Functions
1509
1558
 
1510
1559
  /**
1511
1560
  * Abstract Klasse für SacBaseModelControl. Implements ControlValueAccessor, Validator, OnInit
@@ -1558,6 +1607,10 @@ class SacBaseModelControl {
1558
1607
  * Deaktiviert das Label im Template
1559
1608
  */
1560
1609
  this.disablelabel = false;
1610
+ /**
1611
+ * Text to support the user during input.
1612
+ */
1613
+ this.helptext = '';
1561
1614
  /**
1562
1615
  * defines that error messages are displayed under the controls
1563
1616
  */
@@ -1610,6 +1663,7 @@ class SacBaseModelControl {
1610
1663
  this.validationKeyService = injector.get(SACVALIDATIONKEY_SERVICE, new SacDefaultValidationKeyService());
1611
1664
  this.lngResourceService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService(this.validationKeyService));
1612
1665
  this.configurationService = injector.get(SACCONFIGURATION_SERVICE, new SacDefaultConfigurationService());
1666
+ this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
1613
1667
  }
1614
1668
  // #endregion Constructors
1615
1669
  // #region Public Getters And Setters
@@ -1642,6 +1696,12 @@ class SacBaseModelControl {
1642
1696
  this._value = this.ConvertInputValue(v);
1643
1697
  this.propagateChange(this._value);
1644
1698
  }
1699
+ /**
1700
+ * Get Icon for Helptext Tooltip
1701
+ */
1702
+ get HelptextTooltipIcon() {
1703
+ return this.iconService.GenericHelptextIcon;
1704
+ }
1645
1705
  /**
1646
1706
  * Methode ergibt Boolean Wert für dirty
1647
1707
  */
@@ -1651,6 +1711,9 @@ class SacBaseModelControl {
1651
1711
  }
1652
1712
  return this._dirty;
1653
1713
  }
1714
+ /**
1715
+ * Show error messages inline
1716
+ */
1654
1717
  get inlineerrorenabled() {
1655
1718
  return this._inlineerrorenabled;
1656
1719
  }
@@ -1672,13 +1735,18 @@ class SacBaseModelControl {
1672
1735
  * Returns whether the inline error messages are active for this control.
1673
1736
  */
1674
1737
  get isinlineerrorenabled() {
1675
- var _a, _b;
1676
- if (((_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.IsInlineErrorEnabled) === null ||
1677
- ((_b = this.formlayout) === null || _b === void 0 ? void 0 : _b.IsInlineErrorEnabled) === undefined) {
1738
+ var _a;
1739
+ if (this._inlineerrorenabled !== null) {
1678
1740
  return this._inlineerrorenabled;
1679
1741
  }
1680
- return (this.formlayout.IsInlineErrorEnabled !== false &&
1681
- this._inlineerrorenabled !== false);
1742
+ if (this.formlayout !== null &&
1743
+ this.formlayout.IsInlineErrorEnabled !== null) {
1744
+ return (_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.IsInlineErrorEnabled;
1745
+ }
1746
+ if (this.configurationService.InlineErrorEnabled !== null) {
1747
+ return this.configurationService.InlineErrorEnabled;
1748
+ }
1749
+ return true;
1682
1750
  }
1683
1751
  /**
1684
1752
  * Definiert den Label Text
@@ -1776,6 +1844,8 @@ class SacBaseModelControl {
1776
1844
  this.setComponentHeight();
1777
1845
  // set adaptive label property from formlayout directive
1778
1846
  this.setIsAdaptiveLabel();
1847
+ // set method to display helptext
1848
+ this.setHelpTextMode();
1779
1849
  this.OnClassInit();
1780
1850
  }
1781
1851
  /**
@@ -1880,6 +1950,20 @@ class SacBaseModelControl {
1880
1950
  }
1881
1951
  }
1882
1952
  }
1953
+ /**
1954
+ * Set mode for helptext. Can be tooltip or text
1955
+ */
1956
+ setHelpTextMode() {
1957
+ var _a;
1958
+ if (!this.helptextmode) {
1959
+ if ((_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.helptextmode) {
1960
+ this.helptextmode = this.formlayout.helptextmode;
1961
+ }
1962
+ else {
1963
+ this.helptextmode = this.configurationService.HelptextMode;
1964
+ }
1965
+ }
1966
+ }
1883
1967
  /**
1884
1968
  * Set adaptive label property from parent layout control
1885
1969
  */
@@ -1966,6 +2050,8 @@ SacBaseModelControl.propDecorators = {
1966
2050
  componentHeight: [{ type: Input }],
1967
2051
  disabled: [{ type: Input }],
1968
2052
  disablelabel: [{ type: Input }],
2053
+ helptext: [{ type: Input }],
2054
+ helptextmode: [{ type: Input }],
1969
2055
  inlineError: [{ type: Input }],
1970
2056
  isAdaptiveLabel: [{ type: Input }],
1971
2057
  labelSizeLg: [{ type: Input }],
@@ -1985,15 +2071,22 @@ SacBaseModelControl.propDecorators = {
1985
2071
  */
1986
2072
  class SacCheckboxCommon extends SacBaseModelControl {
1987
2073
  constructor() {
2074
+ // #region Properties
1988
2075
  super(...arguments);
1989
- /**
1990
- * Text welcher als Tooltip angezeigt wird.
1991
- */
1992
- this.tooltiptext = '';
1993
2076
  /**
1994
2077
  * Defines that the checkbox can be used in a list of checkboxes and is not handled as a single form control
1995
2078
  */
1996
2079
  this.stacked = false;
2080
+ // #endregion Private Methods
2081
+ }
2082
+ // #endregion Properties
2083
+ // #region Public Methods
2084
+ /**
2085
+ * Init Event
2086
+ */
2087
+ ngOnInit() {
2088
+ super.ngOnInit();
2089
+ this.setCheckboxStyle();
1997
2090
  }
1998
2091
  /**
1999
2092
  * Control hat keinen Validator
@@ -2001,12 +2094,28 @@ class SacCheckboxCommon extends SacBaseModelControl {
2001
2094
  validateData(c) {
2002
2095
  return null;
2003
2096
  }
2097
+ // #endregion Public Methods
2098
+ // #region Private Methods
2099
+ /**
2100
+ * Adopts the default display if no display has been defined on the component.
2101
+ */
2102
+ setCheckboxStyle() {
2103
+ var _a;
2104
+ if (!this.checkboxstyle) {
2105
+ if ((_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.checkboxstyle) {
2106
+ this.checkboxstyle = this.formlayout.checkboxstyle;
2107
+ }
2108
+ else {
2109
+ this.checkboxstyle = this.configurationService.CheckboxStyle;
2110
+ }
2111
+ }
2112
+ }
2004
2113
  }
2005
2114
  SacCheckboxCommon.decorators = [
2006
2115
  { type: Directive }
2007
2116
  ];
2008
2117
  SacCheckboxCommon.propDecorators = {
2009
- tooltiptext: [{ type: Input }],
2118
+ checkboxstyle: [{ type: Input }],
2010
2119
  checkboxtext: [{ type: Input }],
2011
2120
  stacked: [{ type: Input }]
2012
2121
  };
@@ -2059,19 +2168,27 @@ function emailValidator(validationMessage, validationMessageSummary) {
2059
2168
  };
2060
2169
  }
2061
2170
 
2171
+ // #region Variables
2062
2172
  /**
2063
2173
  * Moment
2064
2174
  */
2065
2175
  const moment = moment_;
2176
+ // #endregion Variables
2177
+ // #region Functions
2066
2178
  function isDateValid(value, format) {
2067
2179
  // NULL ist gültig
2068
2180
  if (value === null || value === undefined || value === '') {
2069
2181
  return true;
2070
2182
  }
2183
+ // Check is Iso Date (From API Call)
2184
+ if (moment(value, ISO_8601, true).isValid()) {
2185
+ return true;
2186
+ }
2071
2187
  let date = moment(value, [format], true);
2072
2188
  date = date.utc();
2073
2189
  return date.isValid();
2074
- }
2190
+ }
2191
+ // #endregion Functions
2075
2192
 
2076
2193
  function isValidDateValidator(validationMessage, validationMessageSummary) {
2077
2194
  return (control) => {
@@ -3781,10 +3898,6 @@ class SacInputBase extends SacBaseModelControl {
3781
3898
  * Macht das Input readonly
3782
3899
  */
3783
3900
  this.readonly = false;
3784
- /**
3785
- * Text welcher als Tooltip angezeigt wird.
3786
- */
3787
- this.tooltiptext = '';
3788
3901
  // #endregion Protected Methods
3789
3902
  }
3790
3903
  // #endregion Properties
@@ -3826,8 +3939,7 @@ SacInputBase.propDecorators = {
3826
3939
  isrequired: [{ type: Input }],
3827
3940
  placeholder: [{ type: Input }],
3828
3941
  readonly: [{ type: Input }],
3829
- regexvalidation: [{ type: Input }],
3830
- tooltiptext: [{ type: Input }]
3942
+ regexvalidation: [{ type: Input }]
3831
3943
  };
3832
3944
 
3833
3945
  /**
@@ -4330,19 +4442,33 @@ SacInputPasswordCommon.propDecorators = {
4330
4442
  */
4331
4443
  class SacInputSearchCommon extends SacInputCommon {
4332
4444
  constructor() {
4445
+ // #region Properties
4333
4446
  super(...arguments);
4334
- /**
4335
- * Name des Such-Icons
4336
- */
4337
- this.iconname = '';
4338
4447
  /**
4339
4448
  * Text welcher auf dem Button angezeigt wird
4340
4449
  */
4341
4450
  this.buttontext = '';
4451
+ /**
4452
+ * Name des Such-Icons
4453
+ */
4454
+ this.iconname = '';
4342
4455
  /**
4343
4456
  * Event wenn auf das Such-Icon geclickt wird
4344
4457
  */
4345
4458
  this.clicked = new EventEmitter();
4459
+ // #endregion Private Methods
4460
+ }
4461
+ // #endregion Properties
4462
+ // #region Public Methods
4463
+ /**
4464
+ * Init Event
4465
+ */
4466
+ ngOnInit() {
4467
+ super.ngOnInit();
4468
+ this.setButtonMode();
4469
+ if (!this.iconname) {
4470
+ this.iconname = this.iconService.InputSearchButtonIcon;
4471
+ }
4346
4472
  }
4347
4473
  /**
4348
4474
  * Methode sendet den Wert des Inputs durch das Event
@@ -4350,103 +4476,139 @@ class SacInputSearchCommon extends SacInputCommon {
4350
4476
  searchClick() {
4351
4477
  this.clicked.emit(this.value);
4352
4478
  }
4479
+ // #endregion Public Methods
4480
+ // #region Private Methods
4481
+ setButtonMode() {
4482
+ var _a;
4483
+ // set mode for search button
4484
+ if (!this.buttonmode) {
4485
+ if ((_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.inputsearchiconmode) {
4486
+ this.buttonmode = this.formlayout.inputsearchiconmode;
4487
+ }
4488
+ else {
4489
+ this.buttonmode = this.configurationService.InputSearchIconMode;
4490
+ }
4491
+ }
4492
+ }
4353
4493
  }
4354
4494
  SacInputSearchCommon.decorators = [
4355
4495
  { type: Directive }
4356
4496
  ];
4357
4497
  SacInputSearchCommon.propDecorators = {
4358
- iconname: [{ type: Input }],
4498
+ buttonmode: [{ type: Input }],
4359
4499
  buttontext: [{ type: Input }],
4500
+ iconname: [{ type: Input }],
4360
4501
  clicked: [{ type: Output }]
4361
4502
  };
4362
4503
 
4504
+ // #region Classes
4505
+ /**
4506
+ * GridResponse class
4507
+ */
4508
+ class GridResponse {
4509
+ }
4363
4510
  /**
4364
- * Model für Pager Settings
4511
+ * Model for pager settings
4365
4512
  */
4366
4513
  class PagerData {
4514
+ // #endregion Properties
4515
+ // #region Constructors
4367
4516
  /**
4368
- * Konstruktor
4369
- * @param PageSize Anzahl Elemente pro Seite
4370
- * @param CurrentPageIndex Aktuelle Seite
4371
- * @param TotalRowCount Total Rows in Datenbank
4517
+ * Constructor
4518
+ * @param PageSize Number of elements per page
4519
+ * @param CurrentPageIndex Current page
4520
+ * @param TotalRowCount Total Rows in database
4372
4521
  */
4373
4522
  constructor(PageSize, CurrentPageIndex, TotalRowCount) {
4523
+ // #region Properties
4374
4524
  /**
4375
- * Gesamte Anzahl der Zeilen
4376
- */
4377
- this.TotalRowCount = 0;
4378
- /**
4379
- * Aktueller Index der Seite
4525
+ * Current index of the page
4380
4526
  */
4381
4527
  this.CurrentPageIndex = 0;
4382
4528
  /**
4383
- * PageSize
4529
+ * Number of elements on the page
4384
4530
  */
4385
4531
  this.PageSize = 20;
4532
+ /**
4533
+ * Total number of data records
4534
+ */
4535
+ this.TotalRowCount = 0;
4386
4536
  this.PageSize = PageSize;
4387
4537
  this.CurrentPageIndex = CurrentPageIndex;
4388
4538
  this.TotalRowCount = TotalRowCount;
4389
4539
  }
4390
4540
  }
4391
4541
  /**
4392
- * Model wenn Seite geändert werden soll
4542
+ * Model if page is to be changed
4393
4543
  */
4394
4544
  class PagerRequest {
4545
+ // #endregion Properties
4546
+ // #region Constructors
4395
4547
  /**
4396
- * Konstruktor
4397
- * @param PageSize Seitegrösse / Anzahl Elemente pro Seite
4398
- * @param NewPageIndex Neuer Seitenindex
4548
+ * Constructor
4549
+ * @param PageSize Page size / number of elements per page
4550
+ * @param NewPageIndex New page index
4399
4551
  */
4400
4552
  constructor(PageSize, NewPageIndex) {
4553
+ // #region Properties
4401
4554
  /**
4402
- * Aktueller Index der Seite
4555
+ * Index of the page to which you want to switch
4403
4556
  */
4404
- this.PageSize = 0;
4557
+ this.NewPageIndex = 0;
4405
4558
  /**
4406
- * PageSize
4559
+ * Number of elements on the page
4407
4560
  */
4408
- this.NewPageIndex = 0;
4561
+ this.PageSize = 0;
4409
4562
  this.PageSize = PageSize;
4410
4563
  this.NewPageIndex = NewPageIndex;
4411
4564
  }
4412
4565
  }
4413
4566
  /**
4414
- * GridResponse-Klasse
4415
- */
4416
- class GridResponse {
4417
- }
4418
- /**
4419
- * Model für Sortierung
4567
+ * Model for sorting
4420
4568
  */
4421
4569
  class SortDescriptor {
4570
+ // #endregion Properties
4571
+ // #region Constructors
4422
4572
  /**
4423
- * Konstruktor
4424
- * @param sortcolumn Column die Sortiert wird
4425
- * @param sortorder Art der Sortierung
4573
+ * Constructor
4574
+ * @param sortcolumn Column by which to sort
4575
+ * @param sortorder Type of sorting
4426
4576
  */
4427
4577
  constructor(sortcolumn, sortorder) {
4428
4578
  this.SortColumn = sortcolumn;
4429
4579
  this.SortOrder = sortorder;
4430
4580
  }
4431
4581
  }
4582
+ // #endregion Classes
4583
+ // #region Enums
4432
4584
  /**
4433
- * Enum für Sortierung
4585
+ * Enum for sorting
4434
4586
  */
4435
4587
  var SortOrder;
4436
4588
  (function (SortOrder) {
4589
+ /**
4590
+ * No sorting
4591
+ */
4437
4592
  SortOrder[SortOrder["None"] = 0] = "None";
4593
+ /**
4594
+ * Ascending
4595
+ */
4438
4596
  SortOrder[SortOrder["Ascending"] = 1] = "Ascending";
4597
+ /**
4598
+ * Descending
4599
+ */
4439
4600
  SortOrder[SortOrder["Descending"] = 2] = "Descending";
4440
- })(SortOrder || (SortOrder = {}));
4601
+ })(SortOrder || (SortOrder = {}));
4602
+ // #endregion Enums
4441
4603
 
4442
4604
  /**
4443
- * Basis Komponente für SacGrid
4605
+ * Basic component for SacGrid
4444
4606
  */
4445
4607
  class SacGridCommon {
4446
4608
  // #endregion Properties
4447
4609
  // #region Constructors
4448
4610
  /**
4449
- * Konstruktor
4611
+ * Constructor
4450
4612
  * @param cd Change Detection Service
4451
4613
  * @param injector DI Injector
4452
4614
  */
@@ -4454,43 +4616,43 @@ class SacGridCommon {
4454
4616
  this.cd = cd;
4455
4617
  // #region Properties
4456
4618
  /**
4457
- * Protected Property. Enthielt die Nummer der aktiven Seite. Type: number. Default ist 1
4619
+ * Page number of the active page.
4458
4620
  */
4459
4621
  this.activePage = 1;
4460
4622
  /**
4461
- * Protected Property. Enthielt die Nummer der ersten angezeigtenen Seite in Pager. Type: number. Default ist 1
4623
+ * Contains the number of the first page displayed in Pager.
4462
4624
  */
4463
4625
  this.firstPageNumber = 1;
4464
4626
  /**
4465
- * Protected Property. Enthielt Array of Pages. Default value: empty array []
4627
+ * Contains Array of Pages.
4466
4628
  */
4467
4629
  this.paginators = [];
4468
4630
  /**
4469
- * Deaktiviert die Auswahl der PageSize im Pager
4631
+ * Deactivates the selection of the PageSize in the pager
4470
4632
  */
4471
4633
  this.pagesizedisabled = false;
4472
4634
  /**
4473
- * Definiert die Anzahl der Elemente pro Seite die ausgewählt werden können
4635
+ * Defines the number of elements per page that can be selected. The default is 20, 50 and 100. The values must be separated with a `|`.
4474
4636
  */
4475
4637
  this.pagesizes = '20|50|100';
4476
4638
  /**
4477
- * Output EventEmitter. Wird aufgerufen wenn das Pager geklickt ist.
4639
+ * Event when the pager is clicked.
4478
4640
  */
4479
4641
  this.paging = new EventEmitter();
4480
4642
  /**
4481
- * Output EventEmitter. Wird aufgerufen wenn ein Header geklickt ist, damit das Column soritert wird.
4643
+ * Event when a header is clicked so that the grid is sorted.
4482
4644
  */
4483
4645
  this.sorting = new EventEmitter();
4484
4646
  /**
4485
- * Private Property. Enthielt die Column Menge. Type: number. Default ist 0
4647
+ * Number of columns in the grid
4486
4648
  */
4487
4649
  this.ColumnCount = 0;
4488
4650
  /**
4489
- * Aktuell Sortierte Spalte
4651
+ * Column by which currently sorted.
4490
4652
  */
4491
4653
  this.sortColumn = '';
4492
4654
  /**
4493
- * Aktuelle Sortierung
4655
+ * Current direction of sorting
4494
4656
  */
4495
4657
  this.sortDirection = SortOrder.None;
4496
4658
  this.validationKeyService = injector.get(SACVALIDATIONKEY_SERVICE, new SacDefaultValidationKeyService());
@@ -4501,8 +4663,8 @@ class SacGridCommon {
4501
4663
  // #endregion Constructors
4502
4664
  // #region Public Getters And Setters
4503
4665
  /**
4504
- * Model für Sortierung
4505
- * @param sortDescription Settings für aktuelle sortierung
4666
+ * Model for sorting
4667
+ * @param sortDescription Settings for current sorting
4506
4668
  */
4507
4669
  set sortdata(sortDescription) {
4508
4670
  this.sortColumn = sortDescription.SortColumn;
@@ -4511,15 +4673,15 @@ class SacGridCommon {
4511
4673
  // #endregion Public Getters And Setters
4512
4674
  // #region Public Methods
4513
4675
  /**
4514
- * Die Methode erhöht die Column-Stücke um eins
4676
+ * The method increases the column elements by one
4515
4677
  */
4516
4678
  RegisterColumn() {
4517
4679
  this.ColumnCount++;
4518
- // Detect Changes ausführen, da ColumnChange nach OnInit ausgeführt wird.
4680
+ // Detect Changes, as ColumnChange is executed after OnInit.
4519
4681
  this.cd.detectChanges();
4520
4682
  }
4521
4683
  /**
4522
- * Die Methode deffiniert das Sortierung Flow
4684
+ * Method for sorting the data.
4523
4685
  */
4524
4686
  SortBy(command) {
4525
4687
  let direction;
@@ -4543,14 +4705,14 @@ class SacGridCommon {
4543
4705
  this.sorting.emit(result);
4544
4706
  }
4545
4707
  /**
4546
- * Die Methode verringert die Column-Stücke um eins
4708
+ * The method reduces the column elements by one
4547
4709
  */
4548
4710
  UnregisterColumn() {
4549
4711
  this.ColumnCount--;
4550
4712
  }
4551
4713
  /**
4552
- * Setzt die neue Seite
4553
- * @param newStartIndex Neuer Seiten Index (Zero-Based)
4714
+ * Method if Grid is to switch to a new page.
4715
+ * @param newStartIndex New Page Index (Zero-Based)
4554
4716
  */
4555
4717
  pageChange(newStartIndex) {
4556
4718
  this.paging.emit(newStartIndex);
@@ -4585,23 +4747,27 @@ SacGridCommon.propDecorators = {
4585
4747
  */
4586
4748
  class SacGridButtonCommon {
4587
4749
  constructor() {
4750
+ // #region Properties
4588
4751
  /**
4589
- * Input Property für Styling des Buttons. Deffiniert die Css Klassen des Buttons
4752
+ * Button is deactivated
4590
4753
  */
4591
- this.iconstyle = '';
4754
+ this._isdisabledvalue = false;
4592
4755
  /**
4593
- * Button ist deaktiviert
4756
+ * Input property for styling the button. Defines the CSS classes of the button
4594
4757
  */
4595
- this._isdisabledvalue = false;
4758
+ this.iconstyle = '';
4596
4759
  /**
4597
- * Event wenn auf den Button geklickt wird
4760
+ * Event when the button is clicked
4598
4761
  */
4599
4762
  this.clicked = new EventEmitter();
4763
+ // #endregion Public Methods
4600
4764
  }
4765
+ // #endregion Properties
4766
+ // #region Public Getters And Setters
4601
4767
  /**
4602
- * Deaktivieren von Buttons
4603
- * @param v Deaktiviert den Button
4604
- * @return Definiert ob der Button deaktiviert ist
4768
+ * Deactivating buttons
4769
+ * @param v Deactivates the button. Can be a Boolean or the strings `true` or `false`.
4770
+ * @return Defines whether the button is deactivated. Is always a Boolean type
4605
4771
  */
4606
4772
  set isdisabled(v) {
4607
4773
  if (v === null || v === undefined || typeof v === 'boolean') {
@@ -4614,8 +4780,10 @@ class SacGridButtonCommon {
4614
4780
  get isdisabled() {
4615
4781
  return this._isdisabledvalue;
4616
4782
  }
4783
+ // #endregion Public Getters And Setters
4784
+ // #region Public Methods
4617
4785
  /**
4618
- * Die Methode wird das cklickaction Emitter aktivieren
4786
+ * Triggers the clicked event if the button is not deactivated.
4619
4787
  */
4620
4788
  callaction() {
4621
4789
  if (!this._isdisabledvalue) {
@@ -4627,18 +4795,20 @@ SacGridButtonCommon.decorators = [
4627
4795
  { type: Directive }
4628
4796
  ];
4629
4797
  SacGridButtonCommon.propDecorators = {
4630
- iconstyle: [{ type: Input }],
4631
4798
  icon: [{ type: Input }],
4632
- isdisabled: [{ type: Input }],
4633
- clicked: [{ type: Output }]
4799
+ iconstyle: [{ type: Input }],
4800
+ clicked: [{ type: Output }],
4801
+ isdisabled: [{ type: Input }]
4634
4802
  };
4635
4803
 
4636
4804
  /**
4637
- * Base Komponente für GridColumn
4805
+ * Base component for GridColumn
4638
4806
  */
4639
4807
  class SacGridColumnBaseCommon {
4808
+ // #endregion Properties
4809
+ // #region Constructors
4640
4810
  /**
4641
- * Konstruktor
4811
+ * Constructor
4642
4812
  * @param grid reference to grid component
4643
4813
  * @param injector di injector to resolve icon service
4644
4814
  * @param el reference to html element
@@ -4647,67 +4817,75 @@ class SacGridColumnBaseCommon {
4647
4817
  this.grid = grid;
4648
4818
  this.injector = injector;
4649
4819
  this.el = el;
4820
+ /**
4821
+ * Click on Column Element
4822
+ */
4823
+ this.rowclicked = new EventEmitter();
4650
4824
  this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
4651
4825
  }
4652
- //#endregion
4653
- //#region Interface Implementations
4826
+ // #endregion Constructors
4827
+ // #region Public Getters And Setters
4654
4828
  /**
4655
- * lifecycle hook - OnInit. Wird aufgeruren sobald das Komponent initialisiert ist.
4829
+ * sort down icon for grid header
4656
4830
  */
4657
- ngOnInit() {
4658
- const rootElement = this.el.nativeElement;
4659
- const parentElement = rootElement.parentElement;
4660
- while (rootElement.firstChild) {
4661
- parentElement.insertBefore(rootElement.firstChild, rootElement);
4662
- }
4663
- parentElement.removeChild(rootElement);
4664
- if (this.IsHeader()) {
4665
- this.grid.RegisterColumn();
4666
- }
4831
+ get IconSortDown() {
4832
+ return this.iconService.GridComponentSortDown;
4667
4833
  }
4668
4834
  /**
4669
- * lifecycle hook - ngOnDestroy. Wird aufgeruren wenn das Component zerstört wird.
4835
+ * sort up icon for grid header
4670
4836
  */
4671
- ngOnDestroy() {
4672
- if (this.IsHeader()) {
4673
- this.grid.UnregisterColumn();
4674
- }
4837
+ get IconSortUp() {
4838
+ return this.iconService.GridComponentSortUp;
4675
4839
  }
4676
- //#endregion
4677
- //#region Type Handling
4840
+ // #endregion Public Getters And Setters
4841
+ // #region Public Methods
4678
4842
  /**
4679
- * die Methode ergibt boolean Wert, ob das Element Header ist.
4843
+ * Method when Colument element is clicked. Triggers a RowClicked
4680
4844
  */
4681
- IsHeader() {
4682
- return this.type === 'header';
4845
+ ColumnClick() {
4846
+ this.rowclicked.emit();
4683
4847
  }
4684
4848
  /**
4685
- * die Methode ergibt boolean Wert, ob das Element Body ist.
4849
+ * Indicates the direction of sorting. The possible values are `none`,`asc`,`desc`
4850
+ */
4851
+ GetSortDirection() {
4852
+ switch (this.grid.sortDirection) {
4853
+ case SortOrder.None:
4854
+ return 'none';
4855
+ case SortOrder.Ascending:
4856
+ return 'asc';
4857
+ case SortOrder.Descending:
4858
+ return 'desc';
4859
+ default:
4860
+ return 'none';
4861
+ }
4862
+ }
4863
+ /**
4864
+ * Defines whether the element is a cell in the table.
4686
4865
  */
4687
4866
  IsBody() {
4688
4867
  return this.type === 'body';
4689
4868
  }
4690
4869
  /**
4691
- * die Methode ergibt boolean Wert, ob das Element Footer ist.
4870
+ * Defines whether the element is a cell in the footer of the table
4692
4871
  */
4693
4872
  IsFooter() {
4694
4873
  return this.type === 'footer';
4695
4874
  }
4696
- //#endregion
4697
4875
  /**
4698
- * sort up icon for grid header
4876
+ * Defines whether the element is a cell in the table header
4699
4877
  */
4700
- get IconSortUp() {
4701
- return this.iconService.GridComponentSortUp;
4878
+ IsHeader() {
4879
+ return this.type === 'header';
4702
4880
  }
4703
4881
  /**
4704
- * sort down icon for grid header
4882
+ * Defines whether this column is sorted.
4705
4883
  */
4706
- get IconSortDown() {
4707
- return this.iconService.GridComponentSortDown;
4884
+ IsSortedColumn() {
4885
+ return this.grid.sortColumn === this.sortkey;
4708
4886
  }
4709
4887
  /**
4710
- * Die Methode deffiniert wie das Grid sortiert wird, abhängig von gekligte Column
4888
+ * Triggers the events so that the table is sorted according to this column.
4711
4889
  */
4712
4890
  SortByColumn() {
4713
4891
  if (this.sortkey !== undefined &&
@@ -4717,27 +4895,28 @@ class SacGridColumnBaseCommon {
4717
4895
  }
4718
4896
  }
4719
4897
  /**
4720
- * die Methode ergibt boolean Wert und definiert, ob das Column für Sortierung aktiviert ist, gemäß eingegebene sortKey
4898
+ * Called when the component is destroyed.
4721
4899
  */
4722
- IsSortedColumn() {
4723
- return this.grid.sortColumn === this.sortkey;
4900
+ ngOnDestroy() {
4901
+ if (this.IsHeader()) {
4902
+ this.grid.UnregisterColumn();
4903
+ }
4724
4904
  }
4725
4905
  /**
4726
- * Die methode definiert die Dortirung Richtung. Die Werte sind: none, asc, desc.
4906
+ * Is called when the component is initialized.
4727
4907
  */
4728
- GetSortDirection() {
4729
- switch (this.grid.sortDirection) {
4730
- case SortOrder.None:
4731
- return 'none';
4732
- case SortOrder.Ascending:
4733
- return 'asc';
4734
- case SortOrder.Descending:
4735
- return 'desc';
4736
- default:
4737
- return 'none';
4908
+ ngOnInit() {
4909
+ const rootElement = this.el.nativeElement;
4910
+ const parentElement = rootElement.parentElement;
4911
+ while (rootElement.firstChild) {
4912
+ parentElement.insertBefore(rootElement.firstChild, rootElement);
4738
4913
  }
4739
- }
4740
- }
4914
+ parentElement.removeChild(rootElement);
4915
+ if (this.IsHeader()) {
4916
+ this.grid.RegisterColumn();
4917
+ }
4918
+ }
4919
+ }
4741
4920
  SacGridColumnBaseCommon.decorators = [
4742
4921
  { type: Directive }
4743
4922
  ];
@@ -4747,42 +4926,50 @@ SacGridColumnBaseCommon.ctorParameters = () => [
4747
4926
  { type: ElementRef }
4748
4927
  ];
4749
4928
  SacGridColumnBaseCommon.propDecorators = {
4929
+ header: [{ type: Input }],
4750
4930
  name: [{ type: Input }],
4931
+ sortkey: [{ type: Input }],
4932
+ type: [{ type: Input }],
4751
4933
  value: [{ type: Input }],
4752
- header: [{ type: Input }],
4753
4934
  width: [{ type: Input }],
4754
- type: [{ type: Input }],
4755
- sortkey: [{ type: Input }]
4935
+ rowclicked: [{ type: Output }]
4756
4936
  };
4757
4937
 
4758
4938
  /**
4759
- * Komponente für SacGridColumnCommon. Extends SacGridColumnBaseCommon
4939
+ * Component for SacGridColumnCommon. Extends SacGridColumnBaseCommon
4760
4940
  */
4761
4941
  class SacGridColumnCommon extends SacGridColumnBaseCommon {
4942
+ // #endregion Properties
4943
+ // #region Constructors
4762
4944
  /**
4763
- * Konstruktor
4945
+ * Constructor
4764
4946
  */
4765
4947
  constructor(grid, injector, el) {
4766
4948
  super(grid, injector, el);
4949
+ // #region Properties
4767
4950
  /**
4768
- * Das Property enthielt boolean Wert für die CSS Klasse ellipsis. Default is false.
4951
+ * Defines whether the CSS class ellipsis is set.
4769
4952
  */
4770
4953
  this._ellipsis = false;
4771
4954
  }
4955
+ // #endregion Constructors
4956
+ // #region Public Getters And Setters
4772
4957
  /**
4773
- * Input Parameter für das css Class ellipsis. Das Setter setzt das boolean Wert auf das private property _ellipsis
4958
+ * Sets the ellipsis property. Can be a Boolean or the strings `true` or `false`.
4774
4959
  */
4775
4960
  set ellipsis(v) {
4776
4961
  this._ellipsis = convertToBoolean(v);
4777
4962
  }
4778
4963
  /**
4779
- * Getter für das private property _ellipsis. Ergibt das boolean Wert des Property
4964
+ * Getter for the ellipsis property. Always returns a boolean type.
4780
4965
  */
4781
4966
  get ellipsis() {
4782
4967
  return this._ellipsis;
4783
4968
  }
4969
+ // #endregion Public Getters And Setters
4970
+ // #region Public Methods
4784
4971
  /**
4785
- * Die Methode returns das Wert des Property _ellipsis
4972
+ * Checks whether ellipsis is set
4786
4973
  */
4787
4974
  IsEllipsis() {
4788
4975
  return this._ellipsis;
@@ -4801,12 +4988,13 @@ SacGridColumnCommon.propDecorators = {
4801
4988
  };
4802
4989
 
4803
4990
  /**
4804
- * Komponente für SacGridColumnActionCommon. Extends SacGridColumnBaseCommon
4991
+ * Component for SacGridColumnActionCommon. Extends SacGridColumnBaseCommon
4805
4992
  */
4806
4993
  class SacGridColumnActionCommon extends SacGridColumnBaseCommon {
4994
+ // #region Constructors
4807
4995
  /**
4808
- * Konstruktor
4809
- * @param el Element Referenz
4996
+ * Constructor
4997
+ * @param el Element reference
4810
4998
  * @param injector di inector to resolve icon service
4811
4999
  * @param grid SacGridCommon
4812
5000
  */
@@ -4824,7 +5012,7 @@ SacGridColumnActionCommon.ctorParameters = () => [
4824
5012
  ];
4825
5013
 
4826
5014
  /**
4827
- * Basis Komponente für SacGridImage
5015
+ * Basic component for SacGridImage
4828
5016
  */
4829
5017
  class SacGridImageCommon {
4830
5018
  }
@@ -4836,67 +5024,65 @@ SacGridImageCommon.propDecorators = {
4836
5024
  };
4837
5025
 
4838
5026
  /**
4839
- * Basiskomponente für Paging
5027
+ * Basic component for paging
4840
5028
  */
4841
5029
  class SacPagingCommon {
4842
5030
  // #endregion Properties
4843
5031
  // #region Constructors
4844
5032
  /**
4845
- * Konstruktor
4846
- * Inject des Formulars
5033
+ * Constructor
4847
5034
  * @parent SacFormCommon
4848
5035
  * @injector Injector
4849
5036
  */
4850
5037
  constructor(injector) {
4851
5038
  /**
4852
- * Total Anzahl Rows
5039
+ * Total number of rows
4853
5040
  */
4854
5041
  this.totalRowCount = 0;
4855
5042
  /**
4856
- * Auswahl der Seitengrösse deaktivieren
5043
+ * Deactivate page size selection
4857
5044
  */
4858
5045
  this.pagesizedisabled = false;
4859
5046
  /**
4860
- * Text in Page für Anzahl Seitenelemente pro Seite
4861
- * Folgende Interpolation Texte sind vorhanden:
4862
- * {{PAGESIZE}}: Anzahl Elemente pro Seite
5047
+ * Text in Page for number of page elements per page. The following interpolation texts are available:
5048
+ *
5049
+ * {{PAGESIZE}}: Number of elements per page
4863
5050
  */
4864
5051
  this.pagesizes = '20|50|100';
4865
5052
  /**
4866
- * Text in Page für Anzahl Seitenelemente pro Seite
4867
- * Folgende Interpolation Texte sind vorhanden:
4868
- * {{PAGESIZE}}: Anzahl Elemente pro Seite
5053
+ * Text in Page for number of page elements per page. The following interpolation texts are available:
5054
+ *
5055
+ * {{PAGESIZE}}: Number of elements per page
4869
5056
  */
4870
5057
  this.pagesizetext = '';
4871
5058
  /**
4872
- * Text in Pager für 'Seite x von y'.
4873
- * Folgende Interpolation Texte sind vorhanden:
4874
- * {{CURRENTPAGE}}: Aktuelle Seite
4875
- * {{TOTALPAGES}}: Anzahl Seiten
5059
+ * Text in pager for 'Page x of y'. The following interpolation texts are available:
5060
+ * {{CURRENTPAGE}}: Current page
5061
+ * {{TOTALPAGES}}: Number of pages
4876
5062
  */
4877
5063
  this.pagingtext = '';
4878
5064
  /**
4879
- * Event wenn im Grid die Seite geändert wird. Als Parameter wird der neue PageIndex mitgegeben.
5065
+ * Event when the page is changed in the grid. The new PageIndex is given as a parameter.
4880
5066
  */
4881
5067
  this.paging = new EventEmitter();
4882
5068
  /**
4883
- * Aktiver Seitenindex
5069
+ * Active page index
4884
5070
  */
4885
5071
  this.activePageIndex = 0;
4886
5072
  /**
4887
- * Erster Seitenindex
5073
+ * First page index
4888
5074
  */
4889
5075
  this.firstPageIndex = 0;
4890
5076
  /**
4891
- * Letzter Seitenindex
5077
+ * Last page index
4892
5078
  */
4893
5079
  this.lastPageIndex = 0;
4894
5080
  /**
4895
- * Anzahl Elemente pro Seite
5081
+ * Number of elements per page
4896
5082
  */
4897
5083
  this.pageSize = 20;
4898
5084
  /**
4899
- * Item für jedes Paging Element (Seitenzahl)
5085
+ * Item for each paging element (page number)
4900
5086
  */
4901
5087
  this.paginators = [];
4902
5088
  this.validationKeyService = injector.get(SACVALIDATIONKEY_SERVICE, new SacDefaultValidationKeyService());
@@ -4908,7 +5094,7 @@ class SacPagingCommon {
4908
5094
  // #endregion Constructors
4909
5095
  // #region Public Getters And Setters
4910
5096
  /**
4911
- * Property für Pager Data
5097
+ * Property for Pager Data
4912
5098
  */
4913
5099
  set pagerdata(p) {
4914
5100
  if (p != null) {
@@ -4919,13 +5105,13 @@ class SacPagingCommon {
4919
5105
  this.createPager();
4920
5106
  }
4921
5107
  /**
4922
- * Property mit Text für Total Einträge in Seite
5108
+ * Property with text for total entries in page
4923
5109
  */
4924
5110
  get PageSizeText() {
4925
5111
  return this.lngResourceService.GetString(this.pagesizetext);
4926
5112
  }
4927
5113
  /**
4928
- * Text mit Aktueller Seite und Total Seiten
5114
+ * Text with current page and total pages
4929
5115
  */
4930
5116
  get PagingText() {
4931
5117
  return this.lngResourceService.GetString(this.pagingtext, {
@@ -4934,7 +5120,7 @@ class SacPagingCommon {
4934
5120
  });
4935
5121
  }
4936
5122
  /**
4937
- * Gibt die Page Sizes als Number Array zurück
5123
+ * Returns the page sizes as a number array
4938
5124
  */
4939
5125
  get getPageSizes() {
4940
5126
  return this.pagesizes.split('|').map((itm) => Number(itm));
@@ -4942,8 +5128,8 @@ class SacPagingCommon {
4942
5128
  // #endregion Public Getters And Setters
4943
5129
  // #region Public Methods
4944
5130
  /**
4945
- * Andert die Seite auf den neuen Index
4946
- * @param newPageIndex Seiten Index. Dies entspricht der Seitenzahl - 1.
5131
+ * Changes the page to the new index
5132
+ * @param newPageIndex Page index. This corresponds to the page number - 1.
4947
5133
  */
4948
5134
  changePage(newPageIndex) {
4949
5135
  if (this.activePageIndex !== newPageIndex) {
@@ -4951,15 +5137,15 @@ class SacPagingCommon {
4951
5137
  }
4952
5138
  }
4953
5139
  /**
4954
- * Ändert die Seitengrösse im Pager
4955
- * @param newSize Neue Anzahl Elemente pro Seite
5140
+ * Changes the page size in the pager
5141
+ * @param newSize New number of elements per page
4956
5142
  */
4957
5143
  changePageSize(newSize) {
4958
5144
  const pagerData = new PagerRequest(newSize, this.activePageIndex);
4959
5145
  this.paging.emit(pagerData);
4960
5146
  }
4961
5147
  /**
4962
- * Paging auf 1. Seite
5148
+ *Switch to 1st page
4963
5149
  */
4964
5150
  firstPage() {
4965
5151
  if (this.activePageIndex !== this.firstPageIndex) {
@@ -4967,19 +5153,19 @@ class SacPagingCommon {
4967
5153
  }
4968
5154
  }
4969
5155
  /**
4970
- * Gibt die aktuelle Seitenzahl zurück
5156
+ * Returns the current page number
4971
5157
  */
4972
5158
  getCurrentPageNumber() {
4973
5159
  return this.activePageIndex + 1;
4974
5160
  }
4975
5161
  /**
4976
- * Gibt die totale Anzahl Seiten zurück
5162
+ * Returns the total number of pages
4977
5163
  */
4978
5164
  getTotalPageNumber() {
4979
5165
  return this.lastPageIndex + 1;
4980
5166
  }
4981
5167
  /**
4982
- * Paging auf letzter Seite
5168
+ * Paging on last page
4983
5169
  */
4984
5170
  lastPage() {
4985
5171
  if (this.activePageIndex !== this.lastPageIndex) {
@@ -4987,7 +5173,7 @@ class SacPagingCommon {
4987
5173
  }
4988
5174
  }
4989
5175
  /**
4990
- * Paging auf nächste Seite
5176
+ * Paging to next page
4991
5177
  */
4992
5178
  nextPage() {
4993
5179
  if (this.activePageIndex !== this.lastPageIndex) {
@@ -4995,7 +5181,7 @@ class SacPagingCommon {
4995
5181
  }
4996
5182
  }
4997
5183
  /**
4998
- * Paging eine Seite zurück
5184
+ * Paging one page back
4999
5185
  */
5000
5186
  previousPage() {
5001
5187
  if (this.activePageIndex !== this.firstPageIndex) {
@@ -5005,7 +5191,7 @@ class SacPagingCommon {
5005
5191
  // #endregion Public Methods
5006
5192
  // #region Protected Methods
5007
5193
  /**
5008
- * Erzeugt die Pager Daten
5194
+ * Generates the pager data
5009
5195
  */
5010
5196
  createPager() {
5011
5197
  this.paginators = [];
@@ -5032,8 +5218,8 @@ class SacPagingCommon {
5032
5218
  }
5033
5219
  }
5034
5220
  /**
5035
- * Gibt den letzten Seitenindex zurück.
5036
- * @param totalPageCount Total Anzahl Seiten
5221
+ * Returns the last page index.
5222
+ * @param totalPageCount Total number of pages
5037
5223
  */
5038
5224
  getEndPageIndex(totalPageCount) {
5039
5225
  let endingPageToDisplay = this.activePageIndex + 2;
@@ -5047,8 +5233,8 @@ class SacPagingCommon {
5047
5233
  return endingPageToDisplay;
5048
5234
  }
5049
5235
  /**
5050
- * Gibt den Start Index zurück
5051
- * @param totalPageCount Total Anzahl Seiten
5236
+ * Returns the start index
5237
+ * @param totalPageCount Total number of pages
5052
5238
  */
5053
5239
  getStartPageIndex(totalPageCount) {
5054
5240
  let startingPageToDisplay = 0;
@@ -5062,7 +5248,7 @@ class SacPagingCommon {
5062
5248
  return startingPageToDisplay;
5063
5249
  }
5064
5250
  /**
5065
- * Methode löst den Event aus, dass ein Paging stattgefunden hat
5251
+ * method triggers the event that paging has taken place
5066
5252
  */
5067
5253
  paged(newPageIndex) {
5068
5254
  const pagerData = new PagerRequest(this.pageSize, newPageIndex);
@@ -5263,6 +5449,7 @@ class SacDateCommon extends SacBaseDateTimeControl {
5263
5449
  constructor(formlayout, injector, elementRef) {
5264
5450
  super(formlayout, injector, elementRef);
5265
5451
  this.elementRef = elementRef;
5452
+ // #region Properties
5266
5453
  /**
5267
5454
  * Format des Datums
5268
5455
  */
@@ -5324,7 +5511,6 @@ class SacDateCommon extends SacBaseDateTimeControl {
5324
5511
  * Definiert ob der Date Selector angezeigt wird
5325
5512
  */
5326
5513
  this._showselector = false;
5327
- this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
5328
5514
  }
5329
5515
  // #endregion Constructors
5330
5516
  // #region Public Getters And Setters
@@ -5923,6 +6109,7 @@ class SacDateTimeCommon extends SacBaseDateTimeControl {
5923
6109
  constructor(formlayout, injector, elementRef) {
5924
6110
  super(formlayout, injector, elementRef);
5925
6111
  this.elementRef = elementRef;
6112
+ // #region Properties
5926
6113
  /**
5927
6114
  * Format des Datums
5928
6115
  */
@@ -5999,7 +6186,6 @@ class SacDateTimeCommon extends SacBaseDateTimeControl {
5999
6186
  * Definiert ob der Date Selector angezeigt wird
6000
6187
  */
6001
6188
  this._showselector = false;
6002
- this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
6003
6189
  }
6004
6190
  // #endregion Constructors
6005
6191
  // #region Public Getters And Setters
@@ -6145,6 +6331,7 @@ class SacTimeCommon extends SacBaseDateTimeControl {
6145
6331
  constructor(formlayout, injector, elementRef) {
6146
6332
  super(formlayout, injector, elementRef);
6147
6333
  this.elementRef = elementRef;
6334
+ // #region Properties
6148
6335
  /**
6149
6336
  * Format des Datums
6150
6337
  */
@@ -6201,7 +6388,6 @@ class SacTimeCommon extends SacBaseDateTimeControl {
6201
6388
  * Definiert ob der Date Selector angezeigt wird
6202
6389
  */
6203
6390
  this._showselector = false;
6204
- this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
6205
6391
  }
6206
6392
  // #endregion Constructors
6207
6393
  // #region Public Getters And Setters
@@ -6336,28 +6522,30 @@ SacTimeCommon.propDecorators = {
6336
6522
  **/
6337
6523
  class SacStaticFormContainerCommon extends SacBaseModelControl {
6338
6524
  constructor() {
6525
+ // #region Properties
6339
6526
  super(...arguments);
6340
6527
  /**
6341
6528
  * Definiert den Container als Required Form Item
6342
6529
  */
6343
6530
  this._isrequired = false;
6344
- /**
6345
- * Text welcher als Tooltip angezeigt wird.
6346
- */
6347
- this.tooltiptext = '';
6531
+ // #endregion Public Methods
6348
6532
  }
6533
+ // #endregion Properties
6534
+ // #region Public Getters And Setters
6349
6535
  /**
6350
6536
  * Definiert den Container als Required Form Item
6351
6537
  */
6352
- get isrequired() {
6353
- return this._isrequired;
6538
+ set isrequired(v) {
6539
+ this._isrequired = convertToBoolean(v);
6354
6540
  }
6355
6541
  /**
6356
6542
  * Definiert den Container als Required Form Item
6357
6543
  */
6358
- set isrequired(v) {
6359
- this._isrequired = convertToBoolean(v);
6544
+ get isrequired() {
6545
+ return this._isrequired;
6360
6546
  }
6547
+ // #endregion Public Getters And Setters
6548
+ // #region Public Methods
6361
6549
  /**
6362
6550
  * Validierung des Controls
6363
6551
  *
@@ -6374,7 +6562,6 @@ SacStaticFormContainerCommon.decorators = [
6374
6562
  { type: Directive }
6375
6563
  ];
6376
6564
  SacStaticFormContainerCommon.propDecorators = {
6377
- tooltiptext: [{ type: Input }],
6378
6565
  isrequired: [{ type: Input }]
6379
6566
  };
6380
6567
 
@@ -7230,15 +7417,17 @@ var TooltipPosition;
7230
7417
  /**
7231
7418
  * Tooltip Component
7232
7419
  *
7233
- * Benötigt im HTML Markup folgende Identifier
7234
- * - container: Container für ng-content in welchem das Element angezeigt wird, wo der Tooltip angehängt wird.
7235
- * - tooltip: Container für Tooltip
7420
+ * Requires the following identifiers in the HTML markup
7421
+ * - container: Container for ng-content in which the element is displayed where the tooltip is attached.
7422
+ * - tooltip: Container for tooltip
7236
7423
  *
7237
- * Tooltip muss in 2 Schritten angezeigt werden. In einem ersten Schritt wird der Tooltip Markup erzeugt mit (ngIf). In einem 2. Schritt
7238
- * kann der Tooltip dann über die CSS visibility angezeigt werden. Wird dies nicht so gemacht, kann es bei gewissen Browsern zu einem Flacker Effekt führen.
7424
+ * Tooltip must be displayed in 2 steps. In a first step the tooltip markup is created with (ngIf). In a 2nd step
7425
+ * the tooltip can then be displayed via the CSS visibility. If this is not done, it can lead to a flickering effect in certain browsers.
7239
7426
  *
7240
7427
  */
7241
7428
  class SacTooltipCommon {
7429
+ // #endregion Properties
7430
+ // #region Constructors
7242
7431
  /**
7243
7432
  * Konstruktor
7244
7433
  * @param ref Element Referenz
@@ -7247,55 +7436,55 @@ class SacTooltipCommon {
7247
7436
  this.cdRef = cdRef;
7248
7437
  this.ref = ref;
7249
7438
  /**
7250
- * Property für Enum in Angular HTML Template
7251
- */
7252
- this.TooltipPosition = TooltipPosition;
7253
- /**
7254
- * Definiert ob der Tooltip sichtbar ist
7439
+ * Defines whether the tooltip is visible
7255
7440
  */
7256
7441
  this._isTooltipVisible = false;
7257
7442
  /**
7258
- * Position des Tooltips oben
7259
- */
7260
- this.TopPos = 0;
7261
- /**
7262
- * Position des Tooltips links
7443
+ * method if content has changed and proportions need to be reset in the UI.
7263
7444
  */
7264
- this.LeftPos = 0;
7445
+ this.onContentChange = () => {
7446
+ // Do nothing if is not visible
7447
+ if (!this._isTooltipVisible) {
7448
+ return;
7449
+ }
7450
+ setTimeout(() => {
7451
+ this.getLeftPosition();
7452
+ this.getTopPosition();
7453
+ });
7454
+ };
7265
7455
  /**
7266
- * Position des Tooltips. Werte: left|top|right|bottom|auto
7456
+ * Position of the tooltip. Values: left|top|right|bottom|auto
7267
7457
  *
7268
- * Wert 'auto' kann mit einem anderen Wert kombiniert werden.
7458
+ * Value 'auto' can be combined with another value.
7269
7459
  */
7270
7460
  this.position = 'right|auto';
7271
7461
  /**
7272
- * Definiert ob der Tooltip sichtbar sein soll
7462
+ * Position of the tooltip on the left
7273
7463
  */
7274
7464
  this.IsTooltipContentVisible = false;
7275
7465
  /**
7276
- * Methode wenn Content geändert hat und Proporties im UI neu gesetzt werden müssen.
7466
+ * Position des Tooltips links
7277
7467
  */
7278
- this.onContentChange = () => {
7279
- setTimeout(() => {
7280
- this.getLeftPosition();
7281
- this.getTopPosition();
7282
- });
7283
- };
7468
+ this.LeftPos = 0;
7469
+ /**
7470
+ * Property for enum in Angular HTML template
7471
+ */
7472
+ this.TooltipPosition = TooltipPosition;
7473
+ /**
7474
+ * Position of the tooltip at the top
7475
+ */
7476
+ this.TopPos = 0;
7284
7477
  }
7478
+ // #endregion Constructors
7479
+ // #region Public Getters And Setters
7285
7480
  /**
7286
- * Setter für Inline Mode für Tooltip
7481
+ * Setter for inline mode for tooltip
7287
7482
  */
7288
7483
  set inlinemode(value) {
7289
7484
  this._inlinemode = convertToBoolean(value);
7290
7485
  }
7291
7486
  /**
7292
- * Getter für Inline Mode für Tooltip
7293
- */
7294
- get inlinemode() {
7295
- return this._inlinemode;
7296
- }
7297
- /**
7298
- * Setter für Name des Containers für den Tooltip. Wird benötigt, da Tooltip via NGIF ausgeblendet werden kann.
7487
+ * Setter for the name of the container for the tooltip. Is required as the tooltip can be hidden via ngIf.
7299
7488
  */
7300
7489
  set tooltip(content) {
7301
7490
  if (content !== undefined) {
@@ -7306,158 +7495,39 @@ class SacTooltipCommon {
7306
7495
  this.cdRef.detectChanges();
7307
7496
  }
7308
7497
  /**
7309
- * Ervent wenn das Control initialisert wird
7310
- */
7311
- ngOnInit() {
7312
- // Register Event Listener
7313
- window.addEventListener('scroll', this.onContentChange, true);
7314
- window.addEventListener('resize', this.onContentChange, true);
7315
- if (this.tooltipcontainer !== undefined) {
7316
- document.body.appendChild(this.tooltipcontainer.nativeElement);
7317
- }
7318
- }
7319
- /**
7320
- * Event wenn das Control zerstört wird.
7321
- */
7322
- ngOnDestroy() {
7323
- // Unregister Event Listener
7324
- window.removeEventListener('scroll', this.onContentChange, true);
7325
- window.removeEventListener('resize', this.onContentChange, true);
7326
- if (this.tooltipcontainer !== undefined) {
7327
- document.body.removeChild(this.tooltipcontainer.nativeElement);
7328
- }
7329
- }
7330
- /**
7331
- * Berechnet die Position des Tooltips von Oben
7332
- */
7333
- getTopPosition() {
7334
- if (this.content !== null && this.content !== undefined) {
7335
- const item = this.content.nativeElement;
7336
- if (item.children.length >= 1) {
7337
- const childItem = item.firstElementChild;
7338
- const contentPosition = childItem.getBoundingClientRect();
7339
- switch (this.GetTooltipPosition()) {
7340
- case TooltipPosition.top:
7341
- this.TopPos = contentPosition.top - this.getToolTipHeight();
7342
- return contentPosition.top - this.getToolTipHeight();
7343
- case TooltipPosition.right:
7344
- this.TopPos = contentPosition.top + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
7345
- return contentPosition.top + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
7346
- case TooltipPosition.bottom:
7347
- this.TopPos = contentPosition.top + contentPosition.height;
7348
- return contentPosition.top + contentPosition.height;
7349
- case TooltipPosition.left:
7350
- this.TopPos = contentPosition.top + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
7351
- return contentPosition.top + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
7352
- }
7353
- return childItem.clientTop + childItem.offsetTop - ((this.getToolTipHeight() / 2) - (childItem.clientHeight / 2));
7354
- }
7355
- else {
7356
- return this.content.nativeElement.offsetTop;
7357
- }
7358
- }
7359
- else {
7360
- return this.ref.nativeElement.offsetTop;
7361
- }
7362
- }
7363
- /**
7364
- * Berechnet die Position des Tooltips von Links
7365
- */
7366
- getLeftPosition() {
7367
- if (this.content !== null && this.content !== undefined) {
7368
- const item = this.content.nativeElement;
7369
- if (item.children.length >= 1) {
7370
- const childItem = item.firstElementChild;
7371
- const contentPosition = childItem.getBoundingClientRect();
7372
- switch (this.GetTooltipPosition()) {
7373
- case TooltipPosition.top:
7374
- this.LeftPos = contentPosition.left + (contentPosition.width / 2) - (this.getToolTipWidth() / 2);
7375
- return contentPosition.left + (contentPosition.width / 2) - (this.getToolTipWidth() / 2);
7376
- case TooltipPosition.right:
7377
- this.LeftPos = contentPosition.left + contentPosition.width;
7378
- return contentPosition.left + contentPosition.width;
7379
- case TooltipPosition.bottom:
7380
- this.LeftPos = contentPosition.left + (childItem.clientWidth / 2) - (this.getToolTipWidth() / 2);
7381
- return contentPosition.left + (childItem.clientWidth / 2) - (this.getToolTipWidth() / 2);
7382
- case TooltipPosition.left:
7383
- this.LeftPos = contentPosition.left - this.getToolTipWidth();
7384
- return contentPosition.left - this.getToolTipWidth();
7385
- }
7386
- return this.content.nativeElement.offsetTop;
7387
- }
7388
- else {
7389
- return this.content.nativeElement.offsetTop;
7390
- }
7391
- }
7392
- else {
7393
- return this.ref.nativeElement.offsetLeft;
7394
- }
7395
- }
7396
- /**
7397
- * Berechnet die Höhe des Tooltips
7498
+ * Property for inline mode for tooltip. Sets the display mode on the wrapper element to `inline`
7398
7499
  */
7399
- getToolTipHeight() {
7400
- if (this.tooltipcontainer) {
7401
- return this.tooltipcontainer.nativeElement.clientHeight;
7402
- }
7403
- else {
7404
- return 0;
7405
- }
7406
- }
7407
- /**
7408
- * Berechnet die Breite die Tooltips
7409
- */
7410
- getToolTipWidth() {
7411
- if (this.tooltipcontainer) {
7412
- return this.tooltipcontainer.nativeElement.clientWidth;
7413
- }
7414
- else {
7415
- return 0;
7416
- }
7417
- }
7418
- /**
7419
- * Definiert ob der Tooltip im Markup vorhanden ist
7420
- */
7421
- IsTooltipVisible() {
7422
- return this._isTooltipVisible;
7423
- }
7424
- /**
7425
- * Tooltip anzeigen
7426
- */
7427
- ShowTooltip() {
7428
- this._isTooltipVisible = true;
7429
- setTimeout(() => {
7430
- this.getLeftPosition();
7431
- this.getTopPosition();
7432
- this.IsTooltipContentVisible = true;
7433
- });
7500
+ get inlinemode() {
7501
+ return this._inlinemode;
7434
7502
  }
7435
- /**
7436
- * Tooltip ausblenden
7437
- */
7438
- HideTooltip() {
7439
- this._isTooltipVisible = false;
7440
- this.IsTooltipContentVisible = false;
7503
+ get tooltop() {
7504
+ return this.tooltipcontainer;
7441
7505
  }
7506
+ // #endregion Public Getters And Setters
7507
+ // #region Public Methods
7442
7508
  /**
7443
- * Gibt die Position des Tooltips zurück
7509
+ * Returns the position of the tooltip
7444
7510
  */
7445
7511
  GetTooltipPosition() {
7446
7512
  const validPositions = this.ValidatePositions();
7447
7513
  // tslint:disable-next-line:no-bitwise
7448
- if (this.HasPosition(TooltipPosition.right) && (validPositions & TooltipPosition.right)) {
7514
+ if (this.HasPosition(TooltipPosition.right) &&
7515
+ validPositions & TooltipPosition.right) {
7449
7516
  return TooltipPosition.right;
7450
7517
  }
7451
7518
  // tslint:disable-next-line:no-bitwise
7452
- if (this.HasPosition(TooltipPosition.top) && (validPositions & TooltipPosition.top)) {
7519
+ if (this.HasPosition(TooltipPosition.top) &&
7520
+ validPositions & TooltipPosition.top) {
7453
7521
  return TooltipPosition.top;
7454
7522
  }
7455
7523
  // tslint:disable-next-line:no-bitwise
7456
- if (this.HasPosition(TooltipPosition.left) && (validPositions & TooltipPosition.left)) {
7524
+ if (this.HasPosition(TooltipPosition.left) &&
7525
+ validPositions & TooltipPosition.left) {
7457
7526
  return TooltipPosition.left;
7458
7527
  }
7459
7528
  // tslint:disable-next-line:no-bitwise
7460
- if (this.HasPosition(TooltipPosition.bottom) && (validPositions & TooltipPosition.bottom)) {
7529
+ if (this.HasPosition(TooltipPosition.bottom) &&
7530
+ validPositions & TooltipPosition.bottom) {
7461
7531
  return TooltipPosition.bottom;
7462
7532
  }
7463
7533
  // Get Auto Position or Default
@@ -7485,14 +7555,100 @@ class SacTooltipCommon {
7485
7555
  }
7486
7556
  }
7487
7557
  /**
7488
- * Definiert ob AutoPosition aktiv ist
7558
+ * Hide tooltip
7489
7559
  */
7490
- IsAutoPosition() {
7491
- const positions = this.position.split('|');
7492
- return positions.indexOf('auto') >= 0;
7560
+ HideTooltip() {
7561
+ this._isTooltipVisible = false;
7562
+ this.IsTooltipContentVisible = false;
7563
+ }
7564
+ /**
7565
+ * Defines whether the tooltip is present in the markup
7566
+ */
7567
+ IsTooltipVisible() {
7568
+ return this._isTooltipVisible;
7569
+ }
7570
+ /**
7571
+ * Show tooltip
7572
+ */
7573
+ ShowTooltip() {
7574
+ this._isTooltipVisible = true;
7575
+ this.cdRef.detectChanges();
7576
+ setTimeout(() => {
7577
+ this.getLeftPosition();
7578
+ this.getTopPosition();
7579
+ this.IsTooltipContentVisible = true;
7580
+ });
7581
+ }
7582
+ /**
7583
+ * Calculates the height of the tooltip
7584
+ */
7585
+ getToolTipHeight() {
7586
+ var _a;
7587
+ if (this.tooltipcontainer) {
7588
+ return (_a = this.tooltipcontainer.nativeElement.firstElementChild.clientHeight) !== null && _a !== void 0 ? _a : 0;
7589
+ }
7590
+ else {
7591
+ return 0;
7592
+ }
7593
+ }
7594
+ /**
7595
+ * Calculates the width of the tooltips
7596
+ */
7597
+ getToolTipWidth() {
7598
+ if (this.tooltipcontainer) {
7599
+ return this.tooltipcontainer.nativeElement.firstElementChild.clientWidth;
7600
+ }
7601
+ else {
7602
+ return 0;
7603
+ }
7604
+ }
7605
+ /**
7606
+ * Detect Changes after view checked. Prevent ExpressionChangedAfterItHasBeenCheckedError error
7607
+ */
7608
+ ngAfterViewChecked() {
7609
+ // Do nothing if is not visibile
7610
+ if (!this._isTooltipVisible) {
7611
+ return;
7612
+ }
7613
+ this.cdRef.detectChanges();
7614
+ }
7615
+ /**
7616
+ * Detect UI Changes to Calculate Tooltip correct
7617
+ */
7618
+ ngDoCheck() {
7619
+ // Do nothing if is not visibile
7620
+ if (!this._isTooltipVisible) {
7621
+ return;
7622
+ }
7623
+ this.getLeftPosition();
7624
+ this.getTopPosition();
7625
+ }
7626
+ /**
7627
+ * Event when the control is destroyed.
7628
+ */
7629
+ ngOnDestroy() {
7630
+ // Unregister Event Listener
7631
+ window.removeEventListener('scroll', this.onContentChange, true);
7632
+ window.removeEventListener('resize', this.onContentChange, true);
7633
+ if (this.tooltipcontainer !== undefined) {
7634
+ document.body.removeChild(this.tooltipcontainer.nativeElement);
7635
+ }
7493
7636
  }
7494
7637
  /**
7495
- * Gibt die definierte Position für den Tooltip zurück
7638
+ * Event when the control is initialized
7639
+ */
7640
+ ngOnInit() {
7641
+ // Register Event Listener
7642
+ window.addEventListener('scroll', this.onContentChange, true);
7643
+ window.addEventListener('resize', this.onContentChange, true);
7644
+ if (this.tooltipcontainer !== undefined) {
7645
+ document.body.appendChild(this.tooltipcontainer.nativeElement);
7646
+ }
7647
+ }
7648
+ // #endregion Protected Abstract Methods
7649
+ // #region Private Methods
7650
+ /**
7651
+ * Returns the defined position for the tooltip
7496
7652
  */
7497
7653
  GetPosition() {
7498
7654
  const positions = this.position.split('|');
@@ -7512,9 +7668,9 @@ class SacTooltipCommon {
7512
7668
  return TooltipPosition.right;
7513
7669
  }
7514
7670
  /**
7515
- * Gibt zurück, ob die Position konfiguriert wurde
7671
+ * Returns whether the position has been configured
7516
7672
  *
7517
- * @param position Position auf welche geprüft wird
7673
+ * @param position Position to be checked
7518
7674
  */
7519
7675
  HasPosition(position) {
7520
7676
  const positions = this.position.split('|');
@@ -7527,13 +7683,21 @@ class SacTooltipCommon {
7527
7683
  if (position === TooltipPosition.left && positions.indexOf('left') >= 0) {
7528
7684
  return true;
7529
7685
  }
7530
- if (position === TooltipPosition.bottom && positions.indexOf('bottom') >= 0) {
7686
+ if (position === TooltipPosition.bottom &&
7687
+ positions.indexOf('bottom') >= 0) {
7531
7688
  return true;
7532
7689
  }
7533
7690
  return false;
7534
7691
  }
7535
7692
  /**
7536
- * Prüft ob die Position gültig ist, resp. der Tooltip auf die Position platz hat
7693
+ * Defines whether AutoPosition is active
7694
+ */
7695
+ IsAutoPosition() {
7696
+ const positions = this.position.split('|');
7697
+ return positions.indexOf('auto') >= 0;
7698
+ }
7699
+ /**
7700
+ * Checks whether the position is valid or whether the tooltip on the position has space
7537
7701
  */
7538
7702
  ValidatePositions() {
7539
7703
  // Check if Container is false
@@ -7542,15 +7706,15 @@ class SacTooltipCommon {
7542
7706
  }
7543
7707
  let allowedPositions = TooltipPosition.none;
7544
7708
  const basePosition = this.content.nativeElement.firstElementChild.getBoundingClientRect();
7545
- const tooltipRect = this.tooltipcontainer.nativeElement.getBoundingClientRect();
7546
- const leftPosOk = basePosition.left - tooltipRect.width > 0;
7547
- const rightPosOk = basePosition.right + tooltipRect.width < window.innerWidth;
7709
+ const tooltipRect = this.tooltipcontainer.nativeElement.firstElementChild.getBoundingClientRect();
7710
+ const leftPosOk = basePosition.left - tooltipRect.width + (this.getTooltipOffset() * -1) > 0;
7711
+ const rightPosOk = basePosition.right + tooltipRect.width + this.getTooltipOffset() < window.innerWidth;
7548
7712
  const topPosOk = basePosition.top - tooltipRect.height > 0;
7549
7713
  const bottomPosOk = basePosition.bottom + tooltipRect.height < window.innerHeight;
7550
- const leftHalfPosOk = basePosition.left - (tooltipRect.width / 2) > 0;
7551
- const rightHalfPosOk = basePosition.right + (tooltipRect.width / 2) < window.innerWidth;
7552
- const topHalfPosOk = basePosition.top - (tooltipRect.height / 2) > 0;
7553
- const bottomHalfPosOk = basePosition.bottom + (tooltipRect.height / 2) < window.innerHeight;
7714
+ const leftHalfPosOk = basePosition.left - tooltipRect.width / 2 > 0;
7715
+ const rightHalfPosOk = basePosition.right + tooltipRect.width / 2 < window.innerWidth;
7716
+ const topHalfPosOk = basePosition.top - tooltipRect.height / 2 > 0;
7717
+ const bottomHalfPosOk = basePosition.bottom + tooltipRect.height / 2 < window.innerHeight;
7554
7718
  if (leftPosOk && topHalfPosOk && bottomHalfPosOk) {
7555
7719
  // tslint:disable-next-line:no-bitwise
7556
7720
  allowedPositions = allowedPositions | TooltipPosition.left;
@@ -7569,6 +7733,100 @@ class SacTooltipCommon {
7569
7733
  }
7570
7734
  return allowedPositions;
7571
7735
  }
7736
+ /**
7737
+ * Calculates the position of the tooltip from links
7738
+ */
7739
+ getLeftPosition() {
7740
+ if (this.content !== null && this.content !== undefined) {
7741
+ const item = this.content.nativeElement;
7742
+ if (item.children.length >= 1) {
7743
+ const childItem = item.firstElementChild;
7744
+ const contentPosition = childItem.getBoundingClientRect();
7745
+ switch (this.GetTooltipPosition()) {
7746
+ case TooltipPosition.top:
7747
+ this.LeftPos = contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2;
7748
+ return (contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2);
7749
+ case TooltipPosition.right:
7750
+ this.LeftPos = contentPosition.left + contentPosition.width + this.getTooltipOffset();
7751
+ return contentPosition.left + contentPosition.width + this.getTooltipOffset();
7752
+ case TooltipPosition.bottom:
7753
+ this.LeftPos = contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2;
7754
+ return (contentPosition.left + contentPosition.width / 2 - this.getToolTipWidth() / 2);
7755
+ case TooltipPosition.left:
7756
+ this.LeftPos = contentPosition.left - this.getToolTipWidth() + (this.getTooltipOffset() * -1);
7757
+ return contentPosition.left - this.getToolTipWidth() + (this.getTooltipOffset() * -1);
7758
+ }
7759
+ return this.content.nativeElement.offsetTop;
7760
+ }
7761
+ else {
7762
+ return this.content.nativeElement.offsetTop;
7763
+ }
7764
+ }
7765
+ else {
7766
+ return this.ref.nativeElement.offsetLeft;
7767
+ }
7768
+ }
7769
+ /**
7770
+ * Calculates the position of the tooltip from the top
7771
+ */
7772
+ getTopPosition() {
7773
+ if (this.content !== null && this.content !== undefined) {
7774
+ const item = this.content.nativeElement;
7775
+ if (item.children.length >= 1) {
7776
+ const childItem = item.firstElementChild;
7777
+ const contentPosition = childItem.getBoundingClientRect();
7778
+ // Get Position with Scroll (Scrollbars inside page should be substracted)
7779
+ const contentPositionTop = childItem.offsetTop + this.getOffsetTopParent(childItem.offsetParent) - this.getScrollTopParent(childItem.parentElement);
7780
+ switch (this.GetTooltipPosition()) {
7781
+ case TooltipPosition.top:
7782
+ this.TopPos = contentPositionTop - this.getToolTipHeight() + (this.getTooltipOffset() * -1);
7783
+ return contentPositionTop - this.getToolTipHeight() + (this.getTooltipOffset() * -1);
7784
+ case TooltipPosition.right:
7785
+ this.TopPos = contentPositionTop + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
7786
+ return contentPositionTop + (contentPosition.height / 2) - (this.getToolTipHeight() / 2);
7787
+ case TooltipPosition.bottom:
7788
+ this.TopPos = contentPositionTop + contentPosition.height + this.getTooltipOffset();
7789
+ return contentPositionTop + contentPosition.height + this.getTooltipOffset();
7790
+ case TooltipPosition.left:
7791
+ this.TopPos = contentPositionTop + contentPosition.height / 2 - this.getToolTipHeight() / 2;
7792
+ return (contentPositionTop + contentPosition.height / 2 - this.getToolTipHeight() / 2);
7793
+ }
7794
+ return (childItem.clientTop + childItem.offsetTop - (this.getToolTipHeight() / 2 - childItem.clientHeight / 2));
7795
+ }
7796
+ else {
7797
+ return this.content.nativeElement.offsetTop;
7798
+ }
7799
+ }
7800
+ else {
7801
+ return this.ref.nativeElement.offsetTop;
7802
+ }
7803
+ }
7804
+ /**
7805
+ * Calculates the top of the page inside all elements
7806
+ * @param element HTML Element
7807
+ * @returns summarized top value for absolute position
7808
+ */
7809
+ getOffsetTopParent(element) {
7810
+ if (!element.offsetParent) {
7811
+ return element.offsetTop;
7812
+ }
7813
+ const parentValue = this.getOffsetTopParent(element.offsetParent);
7814
+ let offset = element.offsetTop;
7815
+ return parentValue + offset;
7816
+ }
7817
+ /**
7818
+ * Caclulate Scrollbars inside tree
7819
+ * @param element HTML Element
7820
+ * @returns Scroll top value of element with all childs
7821
+ */
7822
+ getScrollTopParent(element) {
7823
+ // Body Scroll should not be calculated
7824
+ if (!element.parentElement) {
7825
+ return 0;
7826
+ }
7827
+ const parentValue = this.getScrollTopParent(element.parentElement);
7828
+ return parentValue + element.scrollTop;
7829
+ }
7572
7830
  }
7573
7831
  SacTooltipCommon.decorators = [
7574
7832
  { type: Directive }
@@ -7580,9 +7838,9 @@ SacTooltipCommon.ctorParameters = () => [
7580
7838
  SacTooltipCommon.propDecorators = {
7581
7839
  position: [{ type: Input }],
7582
7840
  tooltiptext: [{ type: Input }],
7583
- inlinemode: [{ type: Input }],
7584
7841
  content: [{ type: ViewChild, args: ['container', { static: true },] }],
7585
- tooltip: [{ type: ViewChild, args: ['tooltip', { static: true },] }]
7842
+ inlinemode: [{ type: Input }],
7843
+ tooltip: [{ type: ViewChild, args: ['tooltip', { static: false },] }]
7586
7844
  };
7587
7845
 
7588
7846
  // #region Classes
@@ -7653,7 +7911,6 @@ class SacUploadBase extends SacBaseModelControl {
7653
7911
  };
7654
7912
  this.validationKeyService = injector.get(SACVALIDATIONKEY_SERVICE, new SacDefaultValidationKeyService());
7655
7913
  this.lngResourceService = injector.get(SACLOCALISATION_SERVICE, new SacDefaultLocalisationService(this.validationKeyService));
7656
- this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
7657
7914
  this.uploads = [];
7658
7915
  this.options.allowedTypes = '*';
7659
7916
  this.options.concurrency = 1;
@@ -10315,5 +10572,5 @@ SACCommonListboxOptionModule.decorators = [
10315
10572
  * Generated bundle index. Do not edit.
10316
10573
  */
10317
10574
 
10318
- export { ControlHeight, GridResponse, IconType, Interpolation, LanguageModel, PagerData, PagerRequest, Positioning, SACCONFIGURATION_SERVICE, SACCommonListboxOptionModule, SACFILEBROWSER_SERVICE, SACICON_SERVICE, SACLANGUAGE_SERVICE, SACLOCALISATION_SERVICE, SACVALIDATIONKEY_SERVICE, SacAbstractConfigurationService, SacAbstractFileBrowserService, SacAbstractIconService, SacAbstractLanguageService, SacAbstractLocalisationService, SacButtonCommon, SacCheckboxCommon, SacConfirmButton, SacConfirmCommon, SacContextMenuContrainerCommon, SacContextmenuAnchorCommon, SacContextmenuCommon, SacContextmenuItemButtonCommon, SacContextmenuItemCommon, SacDateCommon, SacDateSelectorCommon, SacDateTimeCommon, SacDialogCommon, SacDropdownCommon, SacDropdownOptionCommon, SacDropzoneMultipleCommon, SacDropzoneSingleCommon, SacFileBrowserCommon, SacFormCommon, SacFormLayoutCommon, SacGridButtonCommon, SacGridColumnActionCommon, SacGridColumnBaseCommon, SacGridColumnCommon, SacGridCommon, SacGridImageCommon, SacInputAreaCommon, SacInputCommon, SacInputCurrencyCommon, SacInputDecimalCommon, SacInputEmailCommon, SacInputIntegerCommon, SacInputPasswordCommon, SacInputSearchCommon, SacListboxCommon, SacListboxOptionCommon, SacMultilanguageInputAreaCommon, SacMultilanguageInputCommon, SacPagingCommon, SacRadiobuttonCommon, SacRadiobuttonsCommon, SacStaticFormContainerCommon, SacStaticLabelCommon, SacTabCommon, SacTabItemCommon, SacTimeCommon, SacTinyMceCommon, SacTooltipCommon, SacTreeItemActionCommon, SacTreeViewChildCommon, SacTreeViewCommon, SacUploadFile, SacUploadMultipleCommon, SacUploadSingleCommon, SacValidationSummaryCommon, SacWizardCommon, SacWizardItemCommon, ServiceConfirmCommon, SortDescriptor, SortOrder, TooltipPosition, Validation, ValidationErrorItem, convertToBoolean, convertToNumber, isDefined, mapToObject, positionElements, positionService, SacUploadBase as ɵa, SacBaseModelControl as ɵb, SacBaseSelectControl as ɵc, SacBaseListControl as ɵd, SacInputBase as ɵe, SacBaseDateTimeControl as ɵf };
10575
+ export { ControlHeight, GridResponse, IconType, Interpolation, LanguageModel, PagerData, PagerRequest, Positioning, SACCONFIGURATION_SERVICE, SACCommonListboxOptionModule, SACFILEBROWSER_SERVICE, SACICON_SERVICE, SACLANGUAGE_SERVICE, SACLOCALISATION_SERVICE, SACVALIDATIONKEY_SERVICE, SacAbstractConfigurationService, SacAbstractFileBrowserService, SacAbstractIconService, SacAbstractLanguageService, SacAbstractLocalisationService, SacBaseDateTimeControl, SacBaseListControl, SacBaseModelControl, SacBaseSelectControl, SacButtonCommon, SacCheckboxCommon, SacConfirmButton, SacConfirmCommon, SacContextMenuContrainerCommon, SacContextmenuAnchorCommon, SacContextmenuCommon, SacContextmenuItemButtonCommon, SacContextmenuItemCommon, SacDateCommon, SacDateSelectorCommon, SacDateTimeCommon, SacDialogCommon, SacDropdownCommon, SacDropdownOptionCommon, SacDropzoneMultipleCommon, SacDropzoneSingleCommon, SacFileBrowserCommon, SacFormCommon, SacFormLayoutCommon, SacGridButtonCommon, SacGridColumnActionCommon, SacGridColumnBaseCommon, SacGridColumnCommon, SacGridCommon, SacGridImageCommon, SacInputAreaCommon, SacInputBase, SacInputCommon, SacInputCurrencyCommon, SacInputDecimalCommon, SacInputEmailCommon, SacInputIntegerCommon, SacInputPasswordCommon, SacInputSearchCommon, SacListboxCommon, SacListboxOptionCommon, SacMultilanguageInputAreaCommon, SacMultilanguageInputCommon, SacPagingCommon, SacRadiobuttonCommon, SacRadiobuttonsCommon, SacStaticFormContainerCommon, SacStaticLabelCommon, SacTabCommon, SacTabItemCommon, SacTimeCommon, SacTinyMceCommon, SacTooltipCommon, SacTreeItemActionCommon, SacTreeViewChildCommon, SacTreeViewCommon, SacUploadBase, SacUploadFile, SacUploadMultipleCommon, SacUploadSingleCommon, SacValidationSummaryCommon, SacWizardCommon, SacWizardItemCommon, ServiceConfirmCommon, SortDescriptor, SortOrder, TooltipPosition, Validation, ValidationErrorItem, convertToBoolean, convertToNumber, isDefined, mapToObject, positionElements, positionService };
10319
10576
  //# sourceMappingURL=simpleangularcontrols-sac-common.js.map