ngx-wapp-components 3.0.40-alpha.9 → 3.1.0-alpha.1

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.
@@ -4115,6 +4115,7 @@ class WTreeFieldComponent {
4115
4115
  if (!productSectionList)
4116
4116
  return [];
4117
4117
  return productSectionList.map((product) => ({
4118
+ key: `${product[this.getFieldId()]}`,
4118
4119
  label: product.name,
4119
4120
  data: product[this.getFieldId()],
4120
4121
  children: this.itemsToTreeNodeMap(product[this.getEntityInverseParent()])
@@ -4343,7 +4344,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
4343
4344
  args: ['translationsOptions']
4344
4345
  }] } });
4345
4346
 
4346
- const ticketsPeriodSelectType$1 = 'ticketsPeriodSelectType';
4347
4347
  class WPeriodSelectFieldComponent {
4348
4348
  constructor(wLocalStorage, wSessionStorage) {
4349
4349
  this.wLocalStorage = wLocalStorage;
@@ -4360,16 +4360,17 @@ class WPeriodSelectFieldComponent {
4360
4360
  }
4361
4361
  initPeriodCategorySelect() {
4362
4362
  const key24H = PeriodSelectEnum[PeriodSelectEnum.Last24Hours].toLowerCase();
4363
- const keyCustom = PeriodSelectEnum[PeriodSelectEnum.Custom].toLowerCase();
4364
4363
  const key3M = PeriodSelectEnum[PeriodSelectEnum.Last3Months].toLowerCase();
4364
+ const keyCustom = PeriodSelectEnum[PeriodSelectEnum.Custom].toLowerCase();
4365
4365
  this.translationsMap = {
4366
4366
  [PeriodSelectEnum.Last24Hours]: this.translationsObject?.translatedSelectOptions[key24H] || 'Últimas 24 horas',
4367
- [PeriodSelectEnum.Custom]: this.translationsObject?.translatedSelectOptions[keyCustom] || 'Personalizado',
4368
4367
  [PeriodSelectEnum.Last3Months]: this.translationsObject?.translatedSelectOptions[key3M] || 'Últimos 3 meses',
4368
+ [PeriodSelectEnum.Custom]: this.translationsObject?.translatedSelectOptions[keyCustom] || 'Personalizado',
4369
4369
  };
4370
- this.periodCategories = Object.entries(this.translationsMap).map(([key, value]) => ({
4371
- value: Number(key),
4372
- name: value
4370
+ const order = [PeriodSelectEnum.Last24Hours, PeriodSelectEnum.Last3Months, PeriodSelectEnum.Custom];
4371
+ this.periodCategories = order.map(key => ({
4372
+ value: key,
4373
+ name: this.translationsMap[key]
4373
4374
  }));
4374
4375
  this.initValues();
4375
4376
  }
@@ -4409,12 +4410,12 @@ class WPeriodSelectFieldComponent {
4409
4410
  this.toDateValue = now;
4410
4411
  }
4411
4412
  else {
4412
- const startYesterday = new Date(now);
4413
- startYesterday.setDate(now.getDate() - 1);
4413
+ const startYesterday = new Date();
4414
+ startYesterday.setDate(new Date().getDate() - 1);
4414
4415
  startYesterday.setHours(0, 0, 0, 0);
4415
4416
  this.fromDateValue = startYesterday;
4416
- const endYesterday = new Date(now);
4417
- endYesterday.setDate(now.getDate() - 1);
4417
+ const endYesterday = new Date();
4418
+ endYesterday.setDate(new Date().getDate() - 1);
4418
4419
  endYesterday.setHours(23, 59, 59, 999);
4419
4420
  this.toDateValue = endYesterday;
4420
4421
  }
@@ -5883,7 +5884,7 @@ class WFilterPanelComponent {
5883
5884
  this.advancedQueryConfig.fields = this.translateFields(this.advancedQueryConfig.fields);
5884
5885
  let rules = Object.keys(this.basicQueryConfig.fields)
5885
5886
  .filter(fieldKey => {
5886
- if (this.filterId == 'tickets' &&
5887
+ if ((this.filterId == 'tickets' || this.filterId == 'last-3-months-tickets') &&
5887
5888
  Object.keys(this.basicQueryConfig.fields).includes('periodSelect')) {
5888
5889
  return fieldKey !== 'todevicedate' && fieldKey !== 'fromdevicedate';
5889
5890
  }
@@ -6193,7 +6194,7 @@ class WFilterPanelComponent {
6193
6194
  return this.fieldsToKeepLocalDate.length == 0 ? false : this.fieldsToKeepLocalDate.includes(field);
6194
6195
  }
6195
6196
  disableFilterButton() {
6196
- if (this.filterId == 'tickets') {
6197
+ if (this.filterId == 'tickets' || this.filterId == 'last-3-months-tickets') {
6197
6198
  return this.periodSelectComponent ? !this.periodSelectComponent.isValid() : false;
6198
6199
  }
6199
6200
  else {