@esfaenza/es-table 11.2.152 → 11.2.154

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.
@@ -766,10 +766,30 @@
766
766
  _this.LoadedSignal.complete();
767
767
  });
768
768
  };
769
+ ThTdProvider.prototype.asyncLoad = function () {
770
+ return __awaiter(this, void 0, void 0, function () {
771
+ return __generator(this, function (_a) {
772
+ return [2 /*return*/];
773
+ });
774
+ });
775
+ };
776
+ ThTdProvider.prototype.ngOnInit = function () {
777
+ return __awaiter(this, void 0, void 0, function () {
778
+ return __generator(this, function (_a) {
779
+ switch (_a.label) {
780
+ case 0: return [4 /*yield*/, this.asyncLoad()];
781
+ case 1:
782
+ _a.sent();
783
+ this.setLoaded();
784
+ return [2 /*return*/];
785
+ }
786
+ });
787
+ });
788
+ };
769
789
  return ThTdProvider;
770
790
  }());
771
791
  ThTdProvider.decorators = [
772
- { type: i0.Directive, args: [{ selector: '[td_th_provider]' },] }
792
+ { type: i0.Directive, args: [{ selector: '[td_th_provider]', exportAs: "tdThProvider" },] }
773
793
  ];
774
794
  ThTdProvider.propDecorators = {
775
795
  EsTdsDirective: [{ type: i0.ContentChildren, args: [EsTdDirective,] }],
@@ -4410,25 +4430,26 @@
4410
4430
  };
4411
4431
  /** @ignore */
4412
4432
  EsTableComponent.prototype.ngAfterViewInit = function () {
4413
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
4433
+ var _a, _b;
4414
4434
  return __awaiter(this, void 0, void 0, function () {
4415
- var usesThsAndTdsDirectives, hasNoContentProjection;
4435
+ var thsTdsProviders, usesThsAndTdsDirectives, hasNoContentProjection;
4416
4436
  return __generator(this, function (_u) {
4417
4437
  switch (_u.label) {
4418
4438
  case 0:
4419
4439
  // Se utilizzo la new spicy mode deduco tutti i parametri di lavoro possibili al caricamento della tabella
4420
4440
  // Vengono sovrascritte solo le proprietà non impostate dall'utente
4421
- this.EsTds = (this.EsTdsDirective.length == 0 ? ((_c = (_b = (_a = this.EsTableTemplate) === null || _a === void 0 ? void 0 : _a.Template) === null || _b === void 0 ? void 0 : _b.EsTdsDirective) === null || _c === void 0 ? void 0 : _c.length) > 0 ? (_e = (_d = this.EsTableTemplate) === null || _d === void 0 ? void 0 : _d.Template) === null || _e === void 0 ? void 0 : _e.EsTdsDirective : this.EsTdsDirective : this.EsTdsDirective).toArray();
4422
- this.EsThs = (this.EsThsDirective.length == 0 ? ((_h = (_g = (_f = this.EsTableTemplate) === null || _f === void 0 ? void 0 : _f.Template) === null || _g === void 0 ? void 0 : _g.EsThsDirective) === null || _h === void 0 ? void 0 : _h.length) > 0 ? (_k = (_j = this.EsTableTemplate) === null || _j === void 0 ? void 0 : _j.Template) === null || _k === void 0 ? void 0 : _k.EsThsDirective : this.EsThsDirective : this.EsThsDirective).toArray();
4423
- if (!(((_l = this.ThTdProvider) === null || _l === void 0 ? void 0 : _l.length) > 0)) return [3 /*break*/, 2];
4424
- return [4 /*yield*/, rxjs.forkJoin(this.ThTdProvider.map(function (t) { return t.LoadedSignal; })).toPromise()];
4441
+ this.EsTds = this.EsTdsDirective.toArray();
4442
+ this.EsThs = this.EsThsDirective.toArray();
4443
+ thsTdsProviders = __spread((this.EsThTdProvider ? [this.EsThTdProvider] : []), this.ThTdProvider);
4444
+ if (!((thsTdsProviders === null || thsTdsProviders === void 0 ? void 0 : thsTdsProviders.length) > 0)) return [3 /*break*/, 2];
4445
+ return [4 /*yield*/, rxjs.forkJoin(thsTdsProviders.map(function (t) { return t.LoadedSignal; })).toPromise()];
4425
4446
  case 1:
4426
4447
  _u.sent();
4427
- this.EsTds = __spread(this.EsTds, this.ThTdProvider.map(function (t) { return t.EsTdsDirective.toArray(); }).flat());
4428
- this.EsThs = __spread(this.EsThs, this.ThTdProvider.map(function (t) { return t.EsThsDirective.toArray(); }).flat());
4448
+ this.EsTds = __spread(this.EsTds, thsTdsProviders.map(function (t) { return t.EsTdsDirective.toArray(); }).flat());
4449
+ this.EsThs = __spread(this.EsThs, thsTdsProviders.map(function (t) { return t.EsThsDirective.toArray(); }).flat());
4429
4450
  _u.label = 2;
4430
4451
  case 2:
4431
- usesThsAndTdsDirectives = ((_m = this.EsTds) === null || _m === void 0 ? void 0 : _m.length) > 0 && ((_o = this.EsThs) === null || _o === void 0 ? void 0 : _o.length) > 0;
4452
+ usesThsAndTdsDirectives = ((_a = this.EsTds) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((_b = this.EsThs) === null || _b === void 0 ? void 0 : _b.length) > 0;
4432
4453
  hasNoContentProjection = !this.bodyRef && !this.headerRef && !this.headerGroupRef && !this.secondaryHeaderGroupRef;
4433
4454
  if (usesThsAndTdsDirectives || hasNoContentProjection) {
4434
4455
  if (this.UseCustomCells == null)
@@ -4735,15 +4756,16 @@
4735
4756
  };
4736
4757
  /** Per poter distinguere le chiamate a questo metodo: Dopo il setTimeout se uso gli EsTd/EsTh vecchi, senza il setTimeout se uso le nuove direttive */
4737
4758
  EsTableComponent.prototype.internalPostBoundSource = function () {
4738
- var _a, _b;
4759
+ var _a;
4739
4760
  return __awaiter(this, void 0, void 0, function () {
4740
- var View, view, itemsAndGroups, si, ret_1, ret_2, ret, i, th, hI, items, si;
4761
+ var View, thsTdsProviders, view, itemsAndGroups, si, ret_1, ret_2, ret, i, th, hI, items, si;
4741
4762
  return __generator(this, function (_u) {
4742
4763
  switch (_u.label) {
4743
4764
  case 0:
4744
4765
  View = this.View;
4745
- if (!(((_a = this.ThTdProvider) === null || _a === void 0 ? void 0 : _a.length) > 0)) return [3 /*break*/, 2];
4746
- return [4 /*yield*/, rxjs.forkJoin(this.ThTdProvider.map(function (t) { return t.LoadedSignal; })).toPromise()];
4766
+ thsTdsProviders = __spread((this.EsThTdProvider ? [this.EsThTdProvider] : []), this.ThTdProvider);
4767
+ if (!((thsTdsProviders === null || thsTdsProviders === void 0 ? void 0 : thsTdsProviders.length) > 0)) return [3 /*break*/, 2];
4768
+ return [4 /*yield*/, rxjs.forkJoin(thsTdsProviders.map(function (t) { return t.LoadedSignal; })).toPromise()];
4747
4769
  case 1:
4748
4770
  _u.sent();
4749
4771
  _u.label = 2;
@@ -4762,7 +4784,7 @@
4762
4784
  // N.B: Rispettare l'ordine di queste 3 macrocategorie è VITALE
4763
4785
  // ************************************* Sistemazioni di TH, TD, e visibilità varie *************************************
4764
4786
  // Se ho definizioni dinamiche, prima di qualsiasi altra cosa devo trasformarle in th/td in modo che poi il codice qui sotto faccia le sue magie
4765
- if (((_b = this.DynamicRowColumnsDefinition) === null || _b === void 0 ? void 0 : _b.length) > 0) {
4787
+ if (((_a = this.DynamicRowColumnsDefinition) === null || _a === void 0 ? void 0 : _a.length) > 0) {
4766
4788
  this.logger.log("Generating ths and tds from Dynamic definition");
4767
4789
  ret_1 = this.dynamicMode_H.emitThsAndTdsBasedOnDynamicDefinition();
4768
4790
  this.EsThs = ret_1.ths;
@@ -5731,7 +5753,7 @@
5731
5753
  EsTdsDirective: [{ type: i0.ContentChildren, args: [EsTdDirective,] }],
5732
5754
  EsThsDirective: [{ type: i0.ContentChildren, args: [EsThDirective,] }],
5733
5755
  ThTdProvider: [{ type: i0.ContentChildren, args: [ThTdProvider,] }],
5734
- EsTableTemplate: [{ type: i0.Input }],
5756
+ EsThTdProvider: [{ type: i0.Input }],
5735
5757
  bodyRef: [{ type: i0.ContentChild, args: ['body', { static: false },] }],
5736
5758
  headerRef: [{ type: i0.ContentChild, args: ['header', { static: false },] }],
5737
5759
  headerGroupRef: [{ type: i0.ContentChild, args: ['headerGroup', { static: false },] }],
@@ -5814,25 +5836,6 @@
5814
5836
  return EsTdReference;
5815
5837
  }());
5816
5838
 
5817
- //Angular
5818
- /** Componente rappresentante un template di th coi loro relativi td da poter riutilizzare quandomminchia si vuole */
5819
- var EsTableTemplate = /** @class */ (function () {
5820
- function EsTableTemplate() {
5821
- }
5822
- return EsTableTemplate;
5823
- }());
5824
- EsTableTemplate.decorators = [
5825
- { type: i0.Component, args: [{
5826
- selector: "es-table-template",
5827
- template: "",
5828
- changeDetection: i0.ChangeDetectionStrategy.OnPush
5829
- },] }
5830
- ];
5831
- EsTableTemplate.propDecorators = {
5832
- EsTdsDirective: [{ type: i0.ContentChildren, args: [EsTdDirective,] }],
5833
- EsThsDirective: [{ type: i0.ContentChildren, args: [EsThDirective,] }]
5834
- };
5835
-
5836
5839
  /** Modello di configurazione per L'EsTable */
5837
5840
  var EsTableModuleConfig = /** @class */ (function () {
5838
5841
  function EsTableModuleConfig() {
@@ -6248,7 +6251,6 @@
6248
6251
  // Componenti
6249
6252
  EsTableComponent,
6250
6253
  TablePagerComponent,
6251
- EsTableTemplate,
6252
6254
  ThTdProvider
6253
6255
  ];
6254
6256
  var PRIVATE_ELEMENTS = [
@@ -6400,7 +6402,6 @@
6400
6402
  exports.EsTableModuleConfig = EsTableModuleConfig;
6401
6403
  exports.EsTableMultiValue = EsTableMultiValue;
6402
6404
  exports.EsTableOperationDefinition = EsTableOperationDefinition;
6403
- exports.EsTableTemplate = EsTableTemplate;
6404
6405
  exports.EsTdDirective = EsTdDirective;
6405
6406
  exports.EsTdEditorDirective = EsTdEditorDirective;
6406
6407
  exports.EsTdReference = EsTdReference;