@seniorsistemas/angular-components 17.10.8 → 17.10.9

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.
@@ -2133,7 +2133,6 @@ var TieredMenuDirective = /** @class */ (function () {
2133
2133
  this._tieredMenuService = _tieredMenuService;
2134
2134
  this._tieredMenuGlobalService = _tieredMenuGlobalService;
2135
2135
  this._changeDetectorRef = _changeDetectorRef;
2136
- this.items = [];
2137
2136
  this.focusedItem = undefined;
2138
2137
  this.triggerEvent = "click";
2139
2138
  this._componentRef = null;
@@ -2141,28 +2140,26 @@ var TieredMenuDirective = /** @class */ (function () {
2141
2140
  this._isOpen = false;
2142
2141
  this._unsubscribe$ = new Subject();
2143
2142
  }
2144
- TieredMenuDirective.prototype.onClick = function (event) {
2145
- if (this.triggerEvent === "click" && !this._isOpen) {
2146
- this._lastActiveElement = document.activeElement;
2147
- this._createMenu();
2148
- event.preventDefault();
2149
- event.stopPropagation();
2150
- }
2151
- };
2152
2143
  TieredMenuDirective.prototype.ngOnInit = function () {
2144
+ var _a;
2145
+ this._itemsAreValid = !!((_a = this.items) === null || _a === void 0 ? void 0 : _a.length);
2146
+ if (!this._itemsAreValid)
2147
+ return;
2153
2148
  this._subscribeEvents();
2154
2149
  };
2155
2150
  TieredMenuDirective.prototype.ngDoCheck = function () {
2156
- if (!this.previousItems) {
2157
- this.previousItems = this._tieredMenuService.cloneItems(this.items);
2151
+ if (!this._itemsAreValid)
2152
+ return;
2153
+ if (!this._previousItems) {
2154
+ this._previousItems = this._tieredMenuService.cloneItems(this.items);
2158
2155
  }
2159
2156
  var hasChanges = false;
2160
- if (this.items.length !== this.previousItems.length) {
2157
+ if (this.items.length !== this._previousItems.length) {
2161
2158
  hasChanges = true;
2162
2159
  }
2163
2160
  else {
2164
2161
  for (var i = 0; i < this.items.length; i++) {
2165
- if (!this._compareItems(this.items[i], this.previousItems[i])) {
2162
+ if (!this._compareItems(this.items[i], this._previousItems[i])) {
2166
2163
  hasChanges = true;
2167
2164
  break;
2168
2165
  }
@@ -2173,13 +2170,25 @@ var TieredMenuDirective = /** @class */ (function () {
2173
2170
  this._changeDetectorRef.detectChanges();
2174
2171
  this._rebuildMenu();
2175
2172
  }
2176
- this.previousItems = this._tieredMenuService.cloneItems(this.items);
2173
+ this._previousItems = this._tieredMenuService.cloneItems(this.items);
2177
2174
  };
2178
2175
  TieredMenuDirective.prototype.ngOnDestroy = function () {
2176
+ if (!this._itemsAreValid)
2177
+ return;
2179
2178
  this._unsubscribe$.next();
2180
2179
  this._unsubscribe$.complete();
2181
2180
  this._destroy();
2182
2181
  };
2182
+ TieredMenuDirective.prototype.onClick = function (event) {
2183
+ if (!this._itemsAreValid)
2184
+ return;
2185
+ if (this.triggerEvent === "click" && !this._isOpen) {
2186
+ this._lastActiveElement = document.activeElement;
2187
+ this._createMenu();
2188
+ event.preventDefault();
2189
+ event.stopPropagation();
2190
+ }
2191
+ };
2183
2192
  TieredMenuDirective.prototype._createMenu = function () {
2184
2193
  var _a, _b, _c;
2185
2194
  this._updateServiceItems();