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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/bundles/simpleangularcontrols-sac-common.umd.js +356 -408
  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/basemodelcontrol.d.ts +4 -8
  6. package/controls/contextmenu/contextmenu.d.ts +26 -19
  7. package/controls/contextmenu/contextmenu.interface.d.ts +3 -0
  8. package/controls/contextmenu/contextmenuitem.d.ts +5 -0
  9. package/controls/contextmenu/contextmenuitembutton.d.ts +21 -20
  10. package/controls/treeview/treeview.d.ts +87 -121
  11. package/esm2015/common/basemodelcontrol.js +28 -24
  12. package/esm2015/controls/contextmenu/contextmenu.interface.js +1 -0
  13. package/esm2015/controls/contextmenu/contextmenu.interface.ngfactory.js +7 -0
  14. package/esm2015/controls/contextmenu/contextmenu.js +22 -23
  15. package/esm2015/controls/contextmenu/contextmenuitem.js +13 -2
  16. package/esm2015/controls/contextmenu/contextmenuitembutton.js +34 -25
  17. package/esm2015/controls/treeview/treeview.js +232 -247
  18. package/esm2015/interfaces/ISacIconService.js +1 -1
  19. package/esm2015/interfaces/treeviewaction.interface.js +1 -0
  20. package/esm2015/interfaces/treeviewaction.interface.ngfactory.js +7 -0
  21. package/esm2015/public_api.js +4 -5
  22. package/esm2015/services/sac-icon.service.js +25 -1
  23. package/fesm2015/simpleangularcontrols-sac-common.js +343 -389
  24. package/fesm2015/simpleangularcontrols-sac-common.js.map +1 -1
  25. package/interfaces/ISacIconService.d.ts +16 -0
  26. package/interfaces/treeviewaction.interface.d.ts +4 -0
  27. package/package.json +1 -1
  28. package/public_api.d.ts +3 -4
  29. package/services/sac-icon.service.d.ts +33 -1
  30. package/simpleangularcontrols-sac-common-10.0.0-rc.13.tgz +0 -0
  31. package/simpleangularcontrols-sac-common.metadata.json +1 -1
  32. package/controls/treeview/ngtreeitemaction.d.ts +0 -40
  33. package/controls/treeview/treeviewchild.d.ts +0 -12
  34. package/esm2015/controls/treeview/ngtreeitemaction.js +0 -60
  35. package/esm2015/controls/treeview/ngtreeitemaction.ngfactory.js +0 -7
  36. package/esm2015/controls/treeview/treeviewchild.js +0 -18
  37. package/esm2015/controls/treeview/treeviewchild.ngfactory.js +0 -7
  38. package/simpleangularcontrols-sac-common-10.0.0-rc.12.tgz +0 -0
  39. /package/controls/{treeview/ngtreeitemaction.ngfactory.d.ts → contextmenu/contextmenu.interface.ngfactory.d.ts} +0 -0
  40. /package/{controls/treeview/treeviewchild.ngfactory.d.ts → interfaces/treeviewaction.interface.ngfactory.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('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';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('rxjs'), require('@angular/forms'), require('moment'), require('imask'), require('ngx-uploadx'), require('@angular/common')) :
3
+ typeof define === 'function' && define.amd ? define('@simpleangularcontrols/sac-common', ['exports', '@angular/core', '@angular/common/http', 'rxjs', '@angular/forms', 'moment', 'imask', 'ngx-uploadx', '@angular/common'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.simpleangularcontrols = global.simpleangularcontrols || {}, global.simpleangularcontrols['sac-common'] = {}), global.ng.core, global.ng.common.http, global.rxjs, global.ng.forms, global.moment, global.IMask, global.ngxUploadx, global.ng.common));
5
+ }(this, (function (exports, i0, i1, rxjs, forms, moment_, IMask, ngxUploadx, common) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -1404,6 +1404,46 @@
1404
1404
  enumerable: false,
1405
1405
  configurable: true
1406
1406
  });
1407
+ Object.defineProperty(SacDefaultIconService.prototype, "TreeviewNodeActionIcon", {
1408
+ /**
1409
+ * @inheritdoc
1410
+ */
1411
+ get: function () {
1412
+ return 'fa fa-pen';
1413
+ },
1414
+ enumerable: false,
1415
+ configurable: true
1416
+ });
1417
+ Object.defineProperty(SacDefaultIconService.prototype, "TreeviewNodeClosedIcon", {
1418
+ /**
1419
+ * @inheritdoc
1420
+ */
1421
+ get: function () {
1422
+ return 'fa fa-folder-plus';
1423
+ },
1424
+ enumerable: false,
1425
+ configurable: true
1426
+ });
1427
+ Object.defineProperty(SacDefaultIconService.prototype, "TreeviewNodeEmptyIcon", {
1428
+ /**
1429
+ * @inheritdoc
1430
+ */
1431
+ get: function () {
1432
+ return 'fa fa-folder';
1433
+ },
1434
+ enumerable: false,
1435
+ configurable: true
1436
+ });
1437
+ Object.defineProperty(SacDefaultIconService.prototype, "TreeviewNodeOpenIcon", {
1438
+ /**
1439
+ * @inheritdoc
1440
+ */
1441
+ get: function () {
1442
+ return 'fa fa-folder-open';
1443
+ },
1444
+ enumerable: false,
1445
+ configurable: true
1446
+ });
1407
1447
  Object.defineProperty(SacDefaultIconService.prototype, "UploadComponentBrowseIcon", {
1408
1448
  /**
1409
1449
  * @inheritdoc
@@ -2630,6 +2670,8 @@
2630
2670
  * Abstract Klasse für SacBaseModelControl. Implements ControlValueAccessor, Validator, OnInit
2631
2671
  */
2632
2672
  var SacBaseModelControl = /** @class */ (function () {
2673
+ // #endregion Properties
2674
+ // #region Constructors
2633
2675
  /**
2634
2676
  * Constructor
2635
2677
  * @param formlayout SacFormLayoutCommon to define scoped layout settings
@@ -2637,6 +2679,7 @@
2637
2679
  */
2638
2680
  function SacBaseModelControl(formlayout, injector) {
2639
2681
  this.injector = injector;
2682
+ // #region Properties
2640
2683
  /**
2641
2684
  * Inline Errors für das Control
2642
2685
  */
@@ -2740,6 +2783,8 @@
2740
2783
  this.iconService = injector.get(SACICON_SERVICE, new SacDefaultIconService());
2741
2784
  }
2742
2785
  Object.defineProperty(SacBaseModelControl.prototype, "HelptextTooltipIcon", {
2786
+ // #endregion Constructors
2787
+ // #region Public Getters And Setters
2743
2788
  /**
2744
2789
  * Get Icon for Helptext Tooltip
2745
2790
  */
@@ -2754,7 +2799,7 @@
2754
2799
  * Methode ergibt Boolean Wert für dirty
2755
2800
  */
2756
2801
  get: function () {
2757
- if (this.ngControl !== null) {
2802
+ if (this.ngControl !== null && this.ngControl !== undefined) {
2758
2803
  this._dirty = this.ngControl.dirty;
2759
2804
  }
2760
2805
  return this._dirty;
@@ -2788,9 +2833,7 @@
2788
2833
  * Methode ergibt boolean Wert wenn Form invalid oder nicht invalid ist
2789
2834
  */
2790
2835
  get: function () {
2791
- return (this.ngControl !== undefined &&
2792
- this.ngControl !== null &&
2793
- this.ngControl.invalid);
2836
+ return this.ngControl !== undefined && this.ngControl !== null && this.ngControl.invalid;
2794
2837
  },
2795
2838
  enumerable: false,
2796
2839
  configurable: true
@@ -2814,8 +2857,7 @@
2814
2857
  if (this._inlineerrorenabled !== null) {
2815
2858
  return this._inlineerrorenabled;
2816
2859
  }
2817
- if (this.formlayout !== null &&
2818
- this.formlayout.IsInlineErrorEnabled !== null) {
2860
+ if (this.formlayout !== null && this.formlayout.IsInlineErrorEnabled !== null) {
2819
2861
  return (_a = this.formlayout) === null || _a === void 0 ? void 0 : _a.IsInlineErrorEnabled;
2820
2862
  }
2821
2863
  if (this.configurationService.InlineErrorEnabled !== null) {
@@ -2865,7 +2907,7 @@
2865
2907
  * Methode ergibt Boolean Wert für touched
2866
2908
  */
2867
2909
  get: function () {
2868
- if (this.ngControl !== null) {
2910
+ if (this.ngControl !== null && this.ngControl !== undefined) {
2869
2911
  this._touched = this.ngControl.touched;
2870
2912
  }
2871
2913
  return this._touched;
@@ -2894,6 +2936,8 @@
2894
2936
  enumerable: false,
2895
2937
  configurable: true
2896
2938
  });
2939
+ // #endregion Public Getters And Setters
2940
+ // #region Public Methods
2897
2941
  /**
2898
2942
  * Methode ergibt Error anhand von gegebenen Kriterien
2899
2943
  */
@@ -2930,24 +2974,21 @@
2930
2974
  return this.lngResourceService.GetString(errorItem.errorMessageKey, parameters);
2931
2975
  };
2932
2976
  /**
2933
- * In Angular 10 the Control Label for Reactive Forms can be set first time here. With Angular 13 is supported by init in OnInit
2977
+ * Init Event
2934
2978
  */
2935
- SacBaseModelControl.prototype.ngAfterViewInit = function () {
2979
+ SacBaseModelControl.prototype.ngOnInit = function () {
2936
2980
  // receive form via formcontrolname or formcontrol instance
2937
2981
  var formControl = this.injector.get(forms.NgControl, null);
2938
2982
  if (formControl instanceof forms.FormControlName) {
2939
2983
  var form = this.injector.get(forms.FormGroupDirective, null);
2940
2984
  this.ngControl = form.getControl(formControl);
2941
2985
  }
2942
- else if (formControl) {
2943
- this.ngControl = formControl.control;
2986
+ else {
2987
+ if (formControl) {
2988
+ this.ngControl = formControl.control;
2989
+ }
2944
2990
  }
2945
2991
  this.UpdateLabelToControl();
2946
- };
2947
- /**
2948
- * Init Event
2949
- */
2950
- SacBaseModelControl.prototype.ngOnInit = function () {
2951
2992
  // set label sizes from formlayout directive
2952
2993
  this.setLabelSizes();
2953
2994
  // set component heigth from fromlayout directive
@@ -3011,6 +3052,8 @@
3011
3052
  SacBaseModelControl.prototype.writeValue = function (value) {
3012
3053
  this._value = value;
3013
3054
  };
3055
+ // #endregion Public Methods
3056
+ // #region Protected Methods
3014
3057
  /**
3015
3058
  * Method can Overwriten in Parent Classes
3016
3059
  * @param value Wert welcher in den korrekten Typ konvertiert werden soll
@@ -3037,6 +3080,8 @@
3037
3080
  this.ngControl.updateValueAndValidity({ onlySelf: true });
3038
3081
  }
3039
3082
  };
3083
+ // #endregion Protected Methods
3084
+ // #region Private Methods
3040
3085
  SacBaseModelControl.prototype.UpdateLabelToControl = function () {
3041
3086
  // HACK: Add addition property to FormControl. Can be fixed if solution for ticket: https://github.com/angular/angular/issues/19686
3042
3087
  if (this.ngControl) {
@@ -3153,8 +3198,7 @@
3153
3198
  this.splitlabelandhelptext = this.formlayout.splitlabelandhelptext;
3154
3199
  }
3155
3200
  else {
3156
- this.splitlabelandhelptext =
3157
- this.configurationService.SplitLabelAndHelptext;
3201
+ this.splitlabelandhelptext = this.configurationService.SplitLabelAndHelptext;
3158
3202
  }
3159
3203
  }
3160
3204
  };
@@ -9006,441 +9050,329 @@
9006
9050
  };
9007
9051
 
9008
9052
  /**
9009
- *Basis Komponente für SacTreeItemAction
9053
+ * Basis Komponente für SacTreeView
9010
9054
  */
9011
- var SacTreeItemActionCommon = /** @class */ (function () {
9012
- /**
9013
- * Konstruktor
9014
- * @param el Element Referenz
9015
- */
9016
- function SacTreeItemActionCommon(el) {
9017
- this.el = el;
9018
- /**
9019
- * Event wenn auf das Icon geclickt wird
9020
- */
9021
- this.clicked = new i0.EventEmitter();
9022
- }
9023
- /**
9024
- * lifecycle OnInit hook. Wird aufgeruren sobald das Komponent initialisiert ist.
9025
- */
9026
- SacTreeItemActionCommon.prototype.ngOnInit = function () {
9027
- var rootElement = this.el.nativeElement;
9028
- var parentElement = rootElement.parentElement;
9029
- while (rootElement.firstChild) {
9030
- parentElement.insertBefore(rootElement.firstChild, rootElement);
9031
- }
9032
- parentElement.removeChild(rootElement);
9033
- };
9034
- /**
9035
- * Die Methode erstellt die CSS Klasse des Icon. Akzeptiert ein Key-word und baut ein vollständige CSS Klasse.
9036
- */
9037
- SacTreeItemActionCommon.prototype.transformClass = function (initialClass) {
9038
- switch (initialClass) {
9039
- case 'add':
9040
- return 'jstree-icon icon icon-base-add jstree-add';
9041
- case 'delete':
9042
- return 'jstree-icon icon icon-base-delete jstree-delete';
9043
- default:
9044
- return initialClass;
9045
- }
9046
- };
9055
+ var SacTreeviewCommon = /** @class */ (function (_super) {
9056
+ __extends(SacTreeviewCommon, _super);
9057
+ // #endregion Properties
9058
+ // #region Constructors
9047
9059
  /**
9048
- * Die Methode wird das cklickaction Emitter aktivieren.
9060
+ * Constructor
9061
+ * @param injector Service Injector
9049
9062
  */
9050
- SacTreeItemActionCommon.prototype.iconaction = function () {
9051
- this.clicked.emit();
9052
- };
9053
- return SacTreeItemActionCommon;
9054
- }());
9055
- SacTreeItemActionCommon.decorators = [
9056
- { type: i0.Directive }
9057
- ];
9058
- SacTreeItemActionCommon.ctorParameters = function () { return [
9059
- { type: i0.ElementRef }
9060
- ]; };
9061
- SacTreeItemActionCommon.propDecorators = {
9062
- item: [{ type: i0.Input }],
9063
- title: [{ type: i0.Input }],
9064
- iconstyle: [{ type: i0.Input }],
9065
- clicked: [{ type: i0.Output }]
9066
- };
9067
-
9068
- /**
9069
- * Basis Komponente für SacTreeView
9070
- */
9071
- var SacTreeViewCommon = /** @class */ (function () {
9072
- function SacTreeViewCommon() {
9063
+ function SacTreeviewCommon(formlayout, injector) {
9064
+ var _this = _super.call(this, formlayout, injector) || this;
9065
+ // #region Properties
9073
9066
  /**
9074
- * Das Property enthielt array of nodes. Default value: empty array [].
9067
+ * Event when Action is clicked on Node. An object of the type 'TreeviewAction' is returned. In the default case, 'action' in this object is always the value 'default'. The value can be changed via the 'templateaction'.
9075
9068
  */
9076
- this.nodes = [];
9069
+ _this.actionclicked = new i0.EventEmitter();
9077
9070
  /**
9078
- * Das Property enthielt node attribute: 'isCollapsed'. Es wird benutzt beim rendering. Für Expand/Collapsed Sicht des Node(Wert)
9071
+ * Property on the data object that contains the children of the structure element. Must be an array of objects. The default value is 'children'
9079
9072
  */
9080
- this.collapseAttr = 'isCollapsed';
9073
+ _this.attrchildren = 'children';
9081
9074
  /**
9082
- * Das Property enthielt node attribute: 'isSelected'. Es wird benutzt beim Vorbereitung des Data des TreeView
9075
+ * Defines the property on the 'data' object with which the actions for a node can be deactivated. A 'disabled' property is used by default.
9083
9076
  */
9084
- this.selectAttr = 'isSelected';
9077
+ _this.attrdisableaction = 'disabled';
9085
9078
  /**
9086
- * Das Property enthielt node attribute: 'isIndeterminate'. Es wird benutzt beim Vorbereitung des Data des TreeView
9079
+ * Property on the 'data' object that stores the expanded state. Property must be of type boolean. Default is 'expanded'
9087
9080
  */
9088
- this.inDeterminateAttr = 'isIndeterminate';
9081
+ _this.attrexanded = 'expanded';
9089
9082
  /**
9090
- * Providen data for tree.
9083
+ * Property for saving the HoverState on the field. If the property is not present on the node, it is automatically created and removed again. The value can usually be left at the default value unless there is a conflict with a property on the node that is required for other purposes.
9091
9084
  */
9092
- this._data = [];
9085
+ _this.attrhoverstate = 'hoverstate';
9093
9086
  /**
9094
- * Input property für den Namen des TreeView. Type string. Default value: ""
9087
+ * Property on 'data' object, which contains the icon for the node. By default, the property is not set, which hides the icon in the node.
9095
9088
  */
9096
- this.name = '';
9089
+ _this.attricon = null;
9097
9090
  /**
9098
- * A flag indicating data is flatten in array and prepare is required.(Default
9099
- * is false).
9091
+ * property on the 'data' object contains an ID of the node. The default is 'id'. If the property is set to NULL, the selectedId event is no longer triggered.
9100
9092
  */
9101
- this.prepareData = false;
9093
+ _this.attrid = 'id';
9102
9094
  /**
9103
- * Attribute for Text in Tree
9095
+ * Property on 'data' object, which contains the label for the node. Default is 'label'
9104
9096
  */
9105
- this.textAttr = 'data';
9097
+ _this.attrlabel = 'label';
9106
9098
  /**
9107
- * Name of ID property in input data.
9099
+ * Property on 'data' object, which defines whether the node is selected or not. It should be ensured that only 1 node has the value for Selected set to true. Default is 'selected'.
9108
9100
  */
9109
- this.idAttr = 'id';
9101
+ _this.attrselected = 'selected';
9110
9102
  /**
9111
- * Name of parent property in input data.
9103
+ * Event when a node is collapsed. Returns the node element as a parameter
9112
9104
  */
9113
- this.parentAttr = 'PARENT_ID';
9105
+ _this.collabsed = new i0.EventEmitter();
9114
9106
  /**
9115
- * Name of children list property in input data.
9107
+ * The property contains an array of nodes. The data must already map the tree via child properties.
9116
9108
  */
9117
- this.childrenAttr = 'children';
9109
+ _this.data = [];
9118
9110
  /**
9119
- * Output Emitter. Emit das ID des selected Node.
9111
+ * Activates the 'expand' and 'collabse' event even if a node has no children. This is helpful if node elements are to be reloaded at runtime.
9120
9112
  */
9121
- this.selectedidchange = new i0.EventEmitter();
9113
+ _this.enableasynchload = false;
9122
9114
  /**
9123
- * Output Emitter. Emit das TextAttr des selected Node.
9115
+ * Activates Ellipsis on the node labels
9124
9116
  */
9125
- this.selectedtextchanged = new i0.EventEmitter();
9117
+ _this.enableellipsis = true;
9126
9118
  /**
9127
- * Output Emitter. Emit wenn ein Node selektiert wird.
9119
+ * Event when a node is expanded. Returns the node element as a parameter
9128
9120
  */
9129
- this.selecteditem = new i0.EventEmitter();
9130
- }
9131
- Object.defineProperty(SacTreeViewCommon.prototype, "data", {
9121
+ _this.expanded = new i0.EventEmitter();
9132
9122
  /**
9133
- * Getter für Data des TreeView
9123
+ * Defines whether an icon for the expanded/collapsed status should be displayed.
9134
9124
  */
9135
- get: function () {
9136
- return this._data;
9137
- },
9125
+ _this.expandedstate = true;
9138
9126
  /**
9139
- * Input Property für Data des TreeView
9127
+ * A node must be selected
9140
9128
  */
9141
- set: function (value) {
9142
- this._data = value;
9143
- this.nodes = value;
9144
- // this.nodes.forEach(node => node["typeId"] = "13")
9145
- this.LoadTree();
9146
- if (this._collapseAll !== undefined) {
9147
- this.collapseAllNode(this._collapseAll);
9148
- }
9149
- },
9150
- enumerable: false,
9151
- configurable: true
9152
- });
9153
- Object.defineProperty(SacTreeViewCommon.prototype, "treeviewTemplate", {
9129
+ _this.isrequired = false;
9154
9130
  /**
9155
- * Getter für das TreeView Template
9131
+ * Name of the TreeView control
9156
9132
  */
9157
- get: function () {
9158
- return this.template;
9159
- },
9133
+ _this.name = '';
9160
9134
  /**
9161
- * Die Directive erhält die actions für das TreeView
9135
+ * Event when a node is selected. Returns the id attribute as a parameter. The event is not triggered if 'attrid' is not set.
9162
9136
  */
9163
- set: function (v) {
9164
- this.template = v;
9165
- },
9166
- enumerable: false,
9167
- configurable: true
9168
- });
9169
- Object.defineProperty(SacTreeViewCommon.prototype, "treefileicon", {
9137
+ _this.selected = new i0.EventEmitter();
9170
9138
  /**
9171
- * Getter property. Ergibt das FileIcon für das TreeView
9139
+ * Event when a node is selected. Returns the node element as a parameter.
9172
9140
  */
9173
- get: function () {
9174
- return this.fileicontemplate;
9175
- },
9141
+ _this.selectednode = new i0.EventEmitter();
9176
9142
  /**
9177
- * Setter property. Deffiniert das FileIcon für das TreeView
9143
+ * Resource Key für Validation Message Required bei Control
9178
9144
  */
9179
- set: function (v) {
9180
- this.fileicontemplate = v;
9181
- },
9182
- enumerable: false,
9183
- configurable: true
9184
- });
9185
- Object.defineProperty(SacTreeViewCommon.prototype, "collapseall", {
9145
+ _this.validationmessagerequired = _this.validationKeyService.ValidationErrorRequired;
9186
9146
  /**
9187
- * Getter für das collapse property. Ergibt boolean Wert, ob die Items collapsed/expand sind.
9147
+ * Resource Key für Validation Message Required in Validation Summary
9188
9148
  */
9149
+ _this.validationmessagesummaryrequired = _this.validationKeyService.ValidationErrorSummaryRequired;
9150
+ return _this;
9151
+ }
9152
+ Object.defineProperty(SacTreeviewCommon.prototype, "iconAction", {
9153
+ // #endregion Constructors
9154
+ // #region Public Getters And Setters
9189
9155
  get: function () {
9190
- return this._collapseAll;
9191
- },
9192
- // @Input("titleAction") _titleAction: string
9193
- /**
9194
- * Collapse or expand all parent nodes.
9195
- */
9196
- set: function (value) {
9197
- this._collapseAll = value;
9198
- if (this.nodes && this.nodes.length && this.nodes.length > 0) {
9199
- this.collapseAllNode(this._collapseAll);
9200
- }
9201
- // this._recursiveEdit(
9202
- // this.nodes, this.childrenAttr, this.collapseAttr, this._collapseAll);
9203
- // this.cd.detectChanges();
9204
- },
9205
- enumerable: false,
9206
- configurable: true
9207
- });
9208
- Object.defineProperty(SacTreeViewCommon.prototype, "selectall", {
9209
- /**
9210
- * Select or deselect all nodes.
9211
- */
9212
- set: function (value) {
9213
- this._selectAll = value;
9214
- this._recursiveEdit(this.nodes, this.childrenAttr, this.selectAttr, value);
9215
- this._recursiveEdit(this.nodes, this.childrenAttr, this.inDeterminateAttr, false);
9156
+ return this.iconService.TreeviewNodeActionIcon;
9216
9157
  },
9217
9158
  enumerable: false,
9218
9159
  configurable: true
9219
9160
  });
9220
- Object.defineProperty(SacTreeViewCommon.prototype, "selectedid", {
9161
+ Object.defineProperty(SacTreeviewCommon.prototype, "iconFolderCollabsed", {
9221
9162
  /**
9222
- * Input property - setter. Deffiniert das ID des selektierten Item(node)
9163
+ * CSS icon for folders in tree there are collabsed
9164
+ * @returns css class with icon
9223
9165
  */
9224
- set: function (v) {
9225
- this.selectedNode = this.findNode(this.nodes, v, this.idAttr);
9226
- // if (this.selectedNode) {
9227
- // this.selectedIdEmitter.emit(this.selectedNode[this.idAttr]);
9228
- // this.selectedTextEmitter.emit(this.selectedNode[this.textAttr]);
9229
- // }
9166
+ get: function () {
9167
+ return this.iconService.TreeviewNodeClosedIcon;
9230
9168
  },
9231
9169
  enumerable: false,
9232
9170
  configurable: true
9233
9171
  });
9234
- Object.defineProperty(SacTreeViewCommon.prototype, "selectedId", {
9172
+ Object.defineProperty(SacTreeviewCommon.prototype, "iconFolderEmpty", {
9235
9173
  /**
9236
- * Getter. Ergibt das ID des selektierten Item(node)
9174
+ * CSS icon class for folders without subfolders
9175
+ * @returns css class with icon
9237
9176
  */
9238
9177
  get: function () {
9239
- return this.selectedNode ? this.selectedNode[this.idAttr] : null;
9178
+ return this.iconService.TreeviewNodeEmptyIcon;
9240
9179
  },
9241
9180
  enumerable: false,
9242
9181
  configurable: true
9243
9182
  });
9244
- Object.defineProperty(SacTreeViewCommon.prototype, "selectedNode", {
9183
+ Object.defineProperty(SacTreeviewCommon.prototype, "iconFolderOpen", {
9245
9184
  /**
9246
- * Getter für das selektierte Wert(node). Ergibt das selektierte Wert(node).
9185
+ * CSS icon for folders in tree there are expanded
9186
+ * @returns css class with icon
9247
9187
  */
9248
9188
  get: function () {
9249
- return this._selectedNode;
9250
- },
9251
- /**
9252
- * Setter für das selektierte Wert(node). Wenn aufgerufen das ID und TextAttr des selected Node wird emitted
9253
- */
9254
- set: function (v) {
9255
- this._selectedNode = v;
9256
- if (this._selectedNode) {
9257
- this.selectedidchange.emit(this.selectedId);
9258
- this.selectedtextchanged.emit(v[this.textAttr]);
9259
- }
9189
+ return this.iconService.TreeviewNodeOpenIcon;
9260
9190
  },
9261
9191
  enumerable: false,
9262
9192
  configurable: true
9263
9193
  });
9194
+ // #endregion Public Getters And Setters
9195
+ // #region Public Methods
9264
9196
  /**
9265
- * A lifecycle hook that is called after Angular has initialized all data-bound properties of a directive.
9266
- * Define an ngOnInit() method to handle any additional initialization tasks.
9197
+ * Creates an array of a certain size. Is required for a For in the UI, as Angular does not support counting loops
9198
+ * @param size Size of the array
9199
+ * @returns Array
9267
9200
  */
9268
- SacTreeViewCommon.prototype.ngOnInit = function () {
9269
- this.collapseAllNode(this._collapseAll);
9270
- if (this.selectedId)
9271
- this.openSelectedNode(this.nodes);
9201
+ SacTreeviewCommon.prototype.count = function (size) {
9202
+ return new Array(size);
9272
9203
  };
9273
- /**
9274
- * Funktion setzt alle parent items recusiv zum selected node
9275
- * auf collapsed = false
9276
- */
9277
- SacTreeViewCommon.prototype.openSelectedNode = function (data) {
9278
- var result = false;
9279
- for (var i = 0; i < data.length; i++) {
9280
- if (data[i][this.childrenAttr].length &&
9281
- data[i][this.idAttr] != this.selectedId)
9282
- result = this.openSelectedNode(data[i][this.childrenAttr]);
9283
- if (result || data[i][this.idAttr] == this.selectedId) {
9284
- data[i][this.collapseAttr] = false;
9285
- return true;
9286
- }
9204
+ SacTreeviewCommon.prototype.getChildren = function (node) {
9205
+ if (!node || !this.attrchildren) {
9206
+ return [];
9287
9207
  }
9288
- return false;
9208
+ var children = node[this.attrchildren];
9209
+ if (!Array.isArray(children)) {
9210
+ return [];
9211
+ }
9212
+ return children;
9289
9213
  };
9290
- /**
9291
- * Die Methode vorbereitet die Daten für das TreeView. Die Funktion sollte geändert werden abhängig von dem kommenden Daten (wenn array)
9292
- */
9293
- SacTreeViewCommon.prototype.LoadTree = function () {
9294
- //if the tree structure require array the function below should be changed
9295
- var cloned = this._data.map(function (x) { return Object.assign({}, x); });
9296
- // If data is flat, prepare data with recursive function.
9297
- this.nodes = this.prepareData ? this._getPreparedData(cloned) : this._data;
9214
+ SacTreeviewCommon.prototype.getStringField = function (node, fieldname) {
9215
+ if (!node) {
9216
+ return '';
9217
+ }
9218
+ if (!fieldname) {
9219
+ return node;
9220
+ }
9221
+ var value = node[fieldname];
9222
+ if (!value) {
9223
+ return '';
9224
+ }
9225
+ return value;
9298
9226
  };
9299
- /**
9300
- * Die Methode collapse/expand den selectierten Node
9301
- */
9302
- SacTreeViewCommon.prototype.onCollapseClick = function (node) {
9303
- if (node[this.childrenAttr].length) {
9304
- node[this.collapseAttr] = !node[this.collapseAttr];
9227
+ SacTreeviewCommon.prototype.hasChildren = function (node) {
9228
+ return this.getChildren(node).length > 0;
9229
+ };
9230
+ SacTreeviewCommon.prototype.isDisabledState = function (node) {
9231
+ if (!node || !this.attrdisableaction) {
9232
+ return false;
9305
9233
  }
9234
+ var value = node[this.attrdisableaction];
9235
+ return value === true || value === 'true';
9306
9236
  };
9307
- /**
9308
- * Die Methode set den selektierten Node und emit es.
9309
- */
9310
- SacTreeViewCommon.prototype.onClick = function (node) {
9311
- this.selectedNode = node;
9312
- this.selecteditem.emit(this.selectedNode);
9313
- // this.cd.detectChanges();
9237
+ SacTreeviewCommon.prototype.isExpandedState = function (node) {
9238
+ if (!node || !this.attrexanded) {
9239
+ return false;
9240
+ }
9241
+ var value = node[this.attrexanded];
9242
+ return value === true || value === 'true';
9314
9243
  };
9315
- /**
9316
- * Die Methode wird ein event mit Meldung zu Parent emit-en.
9317
- */
9318
- SacTreeViewCommon.prototype.sendMsgToParent = function (msg) {
9319
- this.selecteditem.emit(msg);
9244
+ SacTreeviewCommon.prototype.isHoverState = function (node) {
9245
+ if (!node || !this.attrhoverstate) {
9246
+ return false;
9247
+ }
9248
+ var value = node[this.attrhoverstate];
9249
+ return value === true || value === 'true';
9320
9250
  };
9321
- /**
9322
- * Die Methode wird alle Nodes collapse
9323
- */
9324
- SacTreeViewCommon.prototype.collapseAllNode = function (command) {
9325
- var _this = this;
9326
- this.nodes.forEach(function (node) {
9327
- if (node[_this.childrenAttr].length) {
9328
- collapseAllHIdden(node, _this.collapseAttr, command, _this.childrenAttr);
9329
- }
9330
- });
9331
- function collapseAllHIdden(node, collapseAttr, command, childrenAttr) {
9332
- node[collapseAttr] = command;
9333
- node.children.forEach(function (child) {
9334
- if (child[childrenAttr].length) {
9335
- collapseAllHIdden(child, collapseAttr, command, childrenAttr);
9336
- }
9337
- });
9251
+ SacTreeviewCommon.prototype.isSelectedState = function (node) {
9252
+ if (!node || !this.attrselected) {
9253
+ return false;
9338
9254
  }
9255
+ var value = node[this.attrselected];
9256
+ return value === true || value === 'true';
9339
9257
  };
9340
9258
  /**
9341
- * Funktion gibt node aus der liste zurück, welches das Value auf dem gewünschten Attribut hat
9342
- * Wenn node nicht gefunden wird, wird null zurück gegeben
9343
- * @param data Liste der nodes
9344
- * @param searchValue Das gesuchte value
9345
- * @param attr Der namen des Attributs auf dem das value gesucht wird
9259
+ * Method is called by clicking an action
9260
+ * @param action action and node
9346
9261
  */
9347
- SacTreeViewCommon.prototype.findNode = function (data, searchValue, attr) {
9348
- var result = null;
9349
- for (var i = 0; i < data.length; i++) {
9350
- if (data[i][attr] == searchValue)
9351
- result = data[i];
9352
- else {
9353
- if (data[i][this.childrenAttr].length) {
9354
- var recursiveResult = this.findNode(data[i][this.childrenAttr], searchValue, attr);
9355
- if (recursiveResult)
9356
- result = recursiveResult;
9357
- }
9358
- }
9262
+ SacTreeviewCommon.prototype.onActionClicked = function (action) {
9263
+ this.actionclicked.emit(action);
9264
+ };
9265
+ SacTreeviewCommon.prototype.onNodeClicked = function (node) {
9266
+ if (this.isDisabledState(node) || this.isSelectedState(node)) {
9267
+ this.invertExpandedState(node);
9359
9268
  }
9360
- return result;
9269
+ this.setSelectedState(node);
9361
9270
  };
9362
- /**
9363
- * Die Methode editiert (recursive) alle eingegebene Nodes abhängig von gegebenen Attibute und Value Kriterien.
9364
- */
9365
- SacTreeViewCommon.prototype._recursiveEdit = function (list, childrenAttr, attr, value) {
9366
- if (Array.isArray(list)) {
9367
- for (var i = 0, len = list.length; i < len; i++) {
9368
- list[i][attr] = value;
9369
- if (list[i][childrenAttr].length) {
9370
- this._recursiveEdit(list[i][childrenAttr], childrenAttr, attr, value);
9371
- }
9372
- }
9271
+ SacTreeviewCommon.prototype.setHoverState = function (node, state) {
9272
+ if (!node || !this.attrhoverstate) {
9273
+ return;
9274
+ }
9275
+ if (state) {
9276
+ node[this.attrhoverstate] = true;
9277
+ return;
9278
+ }
9279
+ if (!node.hasOwnProperty(this.attrhoverstate)) {
9280
+ return;
9373
9281
  }
9282
+ delete node[this.attrhoverstate];
9374
9283
  };
9375
- /**
9376
- * Die Methode erstellt eine standarte Sicht-Liste von Nodes
9377
- */
9378
- SacTreeViewCommon.prototype._getPreparedData = function (list) {
9379
- var tree = [], lookup = {};
9380
- for (var i = 0, len = list.length; i < len; i++) {
9381
- lookup[list[i][this.idAttr]] = list[i];
9382
- list[i][this.childrenAttr] = [];
9383
- list[i][this.collapseAttr] = true;
9384
- list[i][this.selectAttr] = false;
9385
- list[i][this.inDeterminateAttr] = false;
9284
+ SacTreeviewCommon.prototype.setSelectedState = function (node) {
9285
+ var _this = this;
9286
+ if (!node || !this.attrselected) {
9287
+ return;
9386
9288
  }
9387
- for (var i = 0, len = list.length; i < len; i++) {
9388
- if (list[i][this.parentAttr]) {
9389
- lookup[list[i][this.parentAttr]][this.childrenAttr].push(list[i]);
9390
- }
9391
- else {
9392
- tree.push(list[i]);
9393
- }
9289
+ // reset selected state of any node
9290
+ this.data.forEach(function (rootNode) { return _this.resetSelectedState(rootNode); });
9291
+ // set selected node as selected
9292
+ node[this.attrselected] = true;
9293
+ // Update ngModel
9294
+ this.setValue(node);
9295
+ // Raise Selected Events
9296
+ this.selectednode.emit(node);
9297
+ if (!this.attrid) {
9298
+ return;
9394
9299
  }
9395
- return tree;
9300
+ var id = this.getStringField(node, this.attrid);
9301
+ this.selected.emit(id);
9396
9302
  };
9397
- return SacTreeViewCommon;
9398
- }());
9399
- SacTreeViewCommon.decorators = [
9303
+ SacTreeviewCommon.prototype.validateData = function (c) {
9304
+ var error = null;
9305
+ if (this.isrequired) {
9306
+ error = Validation.required(this.validationmessagerequired, this.validationmessagesummaryrequired)(c);
9307
+ }
9308
+ return error;
9309
+ };
9310
+ // #endregion Public Methods
9311
+ // #region Private Methods
9312
+ SacTreeviewCommon.prototype.invertExpandedState = function (node) {
9313
+ if (!node || !this.attrexanded) {
9314
+ return;
9315
+ }
9316
+ // Items with no children cannot be collabsed
9317
+ if (!this.hasChildren(node) && !(this.enableasynchload === true || this.enableasynchload === 'true')) {
9318
+ return;
9319
+ }
9320
+ var value = node[this.attrexanded];
9321
+ if (value === true || value === 'true') {
9322
+ this.collabsed.emit(node);
9323
+ node[this.attrexanded] = false;
9324
+ }
9325
+ else {
9326
+ this.expanded.emit(node);
9327
+ node[this.attrexanded] = true;
9328
+ }
9329
+ };
9330
+ SacTreeviewCommon.prototype.resetSelectedState = function (node) {
9331
+ var _this = this;
9332
+ if (!node || !this.attrselected) {
9333
+ return;
9334
+ }
9335
+ node[this.attrselected] = false;
9336
+ this.getChildren(node).forEach(function (child) {
9337
+ _this.resetSelectedState(child);
9338
+ });
9339
+ };
9340
+ return SacTreeviewCommon;
9341
+ }(SacBaseModelControl));
9342
+ SacTreeviewCommon.decorators = [
9400
9343
  { type: i0.Directive }
9401
9344
  ];
9402
- SacTreeViewCommon.propDecorators = {
9345
+ SacTreeviewCommon.ctorParameters = function () { return [
9346
+ { type: SacFormLayoutCommon, decorators: [{ type: i0.Host }] },
9347
+ { type: i0.Injector }
9348
+ ]; };
9349
+ SacTreeviewCommon.propDecorators = {
9350
+ actionclicked: [{ type: i0.Output }],
9351
+ attrchildren: [{ type: i0.Input }],
9352
+ attrdisableaction: [{ type: i0.Input }],
9353
+ attrexanded: [{ type: i0.Input }],
9354
+ attrhoverstate: [{ type: i0.Input }],
9355
+ attricon: [{ type: i0.Input }],
9356
+ attrid: [{ type: i0.Input }],
9357
+ attrlabel: [{ type: i0.Input }],
9358
+ attrselected: [{ type: i0.Input }],
9359
+ collabsed: [{ type: i0.Output }],
9403
9360
  data: [{ type: i0.Input }],
9404
- template: [{ type: i0.Input }],
9405
- treeviewTemplate: [{ type: i0.ContentChild, args: ['actions', { static: true },] }],
9406
- fileicontemplate: [{ type: i0.Input }],
9407
- treefileicon: [{ type: i0.ContentChild, args: ['treefileicon', { static: true },] }],
9361
+ enableasynchload: [{ type: i0.Input }],
9362
+ enableellipsis: [{ type: i0.Input }],
9363
+ expanded: [{ type: i0.Output }],
9364
+ expandedstate: [{ type: i0.Input }],
9365
+ isrequired: [{ type: i0.Input }],
9408
9366
  name: [{ type: i0.Input }],
9409
- prepareData: [{ type: i0.Input }],
9410
- textAttr: [{ type: i0.Input }],
9411
- idAttr: [{ type: i0.Input }],
9412
- parentAttr: [{ type: i0.Input }],
9413
- childrenAttr: [{ type: i0.Input }],
9414
- title: [{ type: i0.Input }],
9415
- collapseall: [{ type: i0.Input }],
9416
- selectall: [{ type: i0.Input }],
9417
- selectedid: [{ type: i0.Input }],
9418
- selectedidchange: [{ type: i0.Output }],
9419
- selectedtextchanged: [{ type: i0.Output }],
9420
- selecteditem: [{ type: i0.Output }]
9367
+ selected: [{ type: i0.Output }],
9368
+ selectednode: [{ type: i0.Output }],
9369
+ showactionalways: [{ type: i0.Input }],
9370
+ templateaction: [{ type: i0.Input }],
9371
+ templatelabel: [{ type: i0.Input }],
9372
+ validationmessagerequired: [{ type: i0.Input }],
9373
+ validationmessagesummaryrequired: [{ type: i0.Input }]
9421
9374
  };
9422
9375
 
9423
- /**
9424
- * Komponente für SacTreeViewChildCommon. Extends SacTreeViewCommon
9425
- */
9426
- var SacTreeViewChildCommon = /** @class */ (function (_super) {
9427
- __extends(SacTreeViewChildCommon, _super);
9428
- function SacTreeViewChildCommon() {
9429
- return _super !== null && _super.apply(this, arguments) || this;
9430
- }
9431
- /**
9432
- * A lifecycle hook that is called after Angular has initialized all data-bound properties of a directive.
9433
- * Define an ngOnInit() method to handle any additional initialization tasks.
9434
- */
9435
- SacTreeViewChildCommon.prototype.ngOnInit = function () {
9436
- this.collapseAllNode(this.collapseall);
9437
- };
9438
- return SacTreeViewChildCommon;
9439
- }(SacTreeViewCommon));
9440
- SacTreeViewChildCommon.decorators = [
9441
- { type: i0.Directive }
9442
- ];
9443
-
9444
9376
  /**
9445
9377
  * Tooltip Component
9446
9378
  *
@@ -11676,6 +11608,27 @@
11676
11608
  { type: i0.ElementRef }
11677
11609
  ]; };
11678
11610
 
11611
+ /**
11612
+ * Base Context Menu Item
11613
+ */
11614
+ var SacContextmenuItemCommon = /** @class */ (function () {
11615
+ function SacContextmenuItemCommon() {
11616
+ // #region Properties
11617
+ /**
11618
+ * Reference to the higher-level context menu. This property is always set automatically by the context menu. However, it may be necessary to set the reference manually.
11619
+ */
11620
+ this.contextmenu = null;
11621
+ // #endregion Properties
11622
+ }
11623
+ return SacContextmenuItemCommon;
11624
+ }());
11625
+ SacContextmenuItemCommon.decorators = [
11626
+ { type: i0.Directive }
11627
+ ];
11628
+ SacContextmenuItemCommon.propDecorators = {
11629
+ contextmenu: [{ type: i0.Input }]
11630
+ };
11631
+
11679
11632
  /**
11680
11633
  * Base Context Menü Element. Die Logik wurde aus NG-BOOTSTRAP übernommen.
11681
11634
  */
@@ -11725,12 +11678,7 @@
11725
11678
  *
11726
11679
  * Please see the [positioning overview](#/positioning) for more details.
11727
11680
  */
11728
- this.placement = [
11729
- 'bottom-left',
11730
- 'bottom-right',
11731
- 'top-left',
11732
- 'top-right',
11733
- ];
11681
+ this.placement = ['bottom-left', 'bottom-right', 'top-left', 'top-right'];
11734
11682
  this.zoneSubscription = this.ngZone.onStable.subscribe(function () {
11735
11683
  _this._positionMenu();
11736
11684
  });
@@ -11750,17 +11698,6 @@
11750
11698
  });
11751
11699
  // #endregion Public Getters And Setters
11752
11700
  // #region Public Methods
11753
- /**
11754
- * HostListener um das Dropdown zu schliessen wenn nicht auf das Element geklickt wird.
11755
- */
11756
- SacContextmenuCommon.prototype.onClick = function (targetElement) {
11757
- var anchor = this._anchor || this._anchorTemplate;
11758
- if (this._menu &&
11759
- !this._menu.nativeElement.contains(targetElement) &&
11760
- !anchor.nativeElement.contains(targetElement)) {
11761
- this.close();
11762
- }
11763
- };
11764
11701
  /**
11765
11702
  * Schliesst das Dropdown
11766
11703
  */
@@ -11768,6 +11705,10 @@
11768
11705
  this._resetContainer();
11769
11706
  this.isopen = false;
11770
11707
  };
11708
+ SacContextmenuCommon.prototype.ngAfterContentInit = function () {
11709
+ var _this = this;
11710
+ this.menuitems.forEach(function (button) { return (button.contextmenu = _this); });
11711
+ };
11771
11712
  /**
11772
11713
  * Event wenn Component entfernt wird.
11773
11714
  */
@@ -11777,6 +11718,17 @@
11777
11718
  }
11778
11719
  this.zoneSubscription.unsubscribe();
11779
11720
  };
11721
+ /**
11722
+ * HostListener um das Dropdown zu schliessen wenn nicht auf das Element geklickt wird.
11723
+ */
11724
+ SacContextmenuCommon.prototype.onClick = function (targetElement) {
11725
+ var anchor = this._anchor || this._anchorTemplate;
11726
+ if (this._menu &&
11727
+ !this._menu.nativeElement.contains(targetElement) &&
11728
+ !anchor.nativeElement.contains(targetElement)) {
11729
+ this.close();
11730
+ }
11731
+ };
11780
11732
  /**
11781
11733
  * Öffnet das Dropdown / Zeigt das Menü an.
11782
11734
  */
@@ -11820,8 +11772,7 @@
11820
11772
  if (container === 'body') {
11821
11773
  var renderer = this.renderer;
11822
11774
  var dropdownMenuElement = this._menu.nativeElement;
11823
- var bodyContainer = (this.bodyContainer =
11824
- this.bodyContainer || renderer.createElement('div'));
11775
+ var bodyContainer = (this.bodyContainer = this.bodyContainer || renderer.createElement('div'));
11825
11776
  // Override some styles to have the positioning working
11826
11777
  renderer.setStyle(bodyContainer, 'position', 'absolute');
11827
11778
  renderer.setStyle(dropdownMenuElement, 'position', 'static');
@@ -11860,41 +11811,31 @@
11860
11811
  { type: i0.Injector }
11861
11812
  ]; };
11862
11813
  SacContextmenuCommon.propDecorators = {
11863
- _anchorTemplate: [{ type: i0.ContentChild, args: [SacContextmenuAnchorCommon, { static: false },] }],
11864
11814
  _anchor: [{ type: i0.ViewChild, args: [SacContextmenuAnchorCommon, { static: false },] }],
11815
+ _anchorTemplate: [{ type: i0.ContentChild, args: [SacContextmenuAnchorCommon, { static: false },] }],
11865
11816
  _menu: [{ type: i0.ViewChild, args: [SacContextMenuContrainerCommon, { static: false },] }],
11866
11817
  buttontemplate: [{ type: i0.Input }],
11867
11818
  container: [{ type: i0.Input }],
11868
11819
  cssclass: [{ type: i0.Input }],
11869
11820
  isopen: [{ type: i0.Input }],
11821
+ menuitems: [{ type: i0.ContentChildren, args: [i0.forwardRef(function () { return SacContextmenuItemCommon; }),] }],
11870
11822
  placement: [{ type: i0.Input }],
11871
11823
  onClick: [{ type: i0.HostListener, args: ['document:click', ['$event.target'],] }]
11872
11824
  };
11873
11825
 
11874
- /**
11875
- * Base Context Menu Item
11876
- */
11877
- var SacContextmenuItemCommon = /** @class */ (function () {
11878
- function SacContextmenuItemCommon() {
11879
- }
11880
- return SacContextmenuItemCommon;
11881
- }());
11882
- SacContextmenuItemCommon.decorators = [
11883
- { type: i0.Directive }
11884
- ];
11885
-
11886
11826
  /**
11887
11827
  * Base Context Menu Button Item
11888
11828
  */
11889
11829
  var SacContextmenuItemButtonCommon = /** @class */ (function (_super) {
11890
11830
  __extends(SacContextmenuItemButtonCommon, _super);
11831
+ // #endregion Properties
11832
+ // #region Constructors
11891
11833
  /**
11892
11834
  * Constructor
11893
- * @param contextmenu Instance of Context Menü.
11894
11835
  */
11895
- function SacContextmenuItemButtonCommon(contextmenu) {
11836
+ function SacContextmenuItemButtonCommon() {
11896
11837
  var _this = _super.call(this) || this;
11897
- _this.contextmenu = contextmenu;
11838
+ // #region Properties
11898
11839
  /**
11899
11840
  * Menu Item ist deaktiviert
11900
11841
  */
@@ -11903,6 +11844,10 @@
11903
11844
  * Icon Column in Menü ist deaktiviert
11904
11845
  */
11905
11846
  _this._isicondisabled = false;
11847
+ /**
11848
+ * Event wenn auf den Button geklickt wird
11849
+ */
11850
+ _this.clicked = new i0.EventEmitter();
11906
11851
  /**
11907
11852
  * css class for button styling
11908
11853
  */
@@ -11912,12 +11857,14 @@
11912
11857
  */
11913
11858
  _this.iconstyle = '';
11914
11859
  /**
11915
- * Event wenn auf den Button geklickt wird
11860
+ * name of button. used for generate id and name
11916
11861
  */
11917
- _this.clicked = new i0.EventEmitter();
11862
+ _this.name = '';
11918
11863
  return _this;
11919
11864
  }
11920
11865
  Object.defineProperty(SacContextmenuItemButtonCommon.prototype, "isdisabled", {
11866
+ // #endregion Constructors
11867
+ // #region Public Getters And Setters
11921
11868
  /**
11922
11869
  * Menu Item ist deaktiviert
11923
11870
  */
@@ -11959,13 +11906,17 @@
11959
11906
  enumerable: false,
11960
11907
  configurable: true
11961
11908
  });
11909
+ // #endregion Public Getters And Setters
11910
+ // #region Public Methods
11962
11911
  /**
11963
11912
  * Die Methode wird das cklickaction Emitter aktivieren
11964
11913
  */
11965
11914
  SacContextmenuItemButtonCommon.prototype.callaction = function (event) {
11966
11915
  if (!this._isdisabled) {
11967
11916
  this.clicked.emit();
11968
- this.contextmenu.close();
11917
+ if (this.contextmenu !== null) {
11918
+ this.contextmenu.close();
11919
+ }
11969
11920
  }
11970
11921
  event.stopPropagation();
11971
11922
  };
@@ -11974,18 +11925,17 @@
11974
11925
  SacContextmenuItemButtonCommon.decorators = [
11975
11926
  { type: i0.Directive }
11976
11927
  ];
11977
- SacContextmenuItemButtonCommon.ctorParameters = function () { return [
11978
- { type: SacContextmenuCommon }
11979
- ]; };
11928
+ SacContextmenuItemButtonCommon.ctorParameters = function () { return []; };
11980
11929
  SacContextmenuItemButtonCommon.propDecorators = {
11981
- icon: [{ type: i0.Input }],
11930
+ clicked: [{ type: i0.Output }],
11982
11931
  cssclass: [{ type: i0.Input }],
11932
+ icon: [{ type: i0.Input }],
11983
11933
  iconstyle: [{ type: i0.Input }],
11984
11934
  image: [{ type: i0.Input }],
11985
- isdisabled: [{ type: i0.Input }],
11986
- isicondisabled: [{ type: i0.Input }],
11935
+ name: [{ type: i0.Input }],
11987
11936
  text: [{ type: i0.Input }],
11988
- clicked: [{ type: i0.Output }]
11937
+ isdisabled: [{ type: i0.Input }],
11938
+ isicondisabled: [{ type: i0.Input }]
11989
11939
  };
11990
11940
 
11991
11941
  /**
@@ -12700,9 +12650,7 @@
12700
12650
  exports.SacTimeCommon = SacTimeCommon;
12701
12651
  exports.SacTinyMceCommon = SacTinyMceCommon;
12702
12652
  exports.SacTooltipCommon = SacTooltipCommon;
12703
- exports.SacTreeItemActionCommon = SacTreeItemActionCommon;
12704
- exports.SacTreeViewChildCommon = SacTreeViewChildCommon;
12705
- exports.SacTreeViewCommon = SacTreeViewCommon;
12653
+ exports.SacTreeviewCommon = SacTreeviewCommon;
12706
12654
  exports.SacUploadBase = SacUploadBase;
12707
12655
  exports.SacUploadFile = SacUploadFile;
12708
12656
  exports.SacUploadMultipleCommon = SacUploadMultipleCommon;