sf-i-events 1.0.875 → 1.0.876

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.
package/dev/index.html CHANGED
@@ -738,7 +738,7 @@
738
738
  </div>
739
739
 
740
740
  </sf-i-events> -->
741
- <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
741
+ <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
742
742
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
743
743
  apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
744
744
  apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
@@ -765,8 +765,8 @@
765
765
  <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
766
766
  </div>
767
767
 
768
- </sf-i-events> -->
769
- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
768
+ </sf-i-events>
769
+ <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
770
770
  apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
771
771
  apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
772
772
  apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
@@ -793,7 +793,7 @@
793
793
  <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
794
794
  </div>
795
795
 
796
- </sf-i-events>
796
+ </sf-i-events> -->
797
797
  <!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="Viewer J1" userprofileid="344c84d2-5976-47ff-949b-49f6fa9627eb" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="viewer" showregisterexport="false" features="[&quot;notices&quot;]" eventfielddependencies="[{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;country&quot;, &quot;child&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;category&quot;, &quot;child&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;foreignkey&quot;, &quot;parent&quot;: &quot;frequency&quot;, &quot;child&quot;: &quot;subfrequency&quot;}]" eventfields="[{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/riskarea&quot;, &quot;field&quot;: &quot;riskarea&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/jurisdiction&quot;, &quot;field&quot;: &quot;jurisdiction&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/updatetype&quot;, &quot;field&quot;: &quot;updatetype&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/country&quot;, &quot;field&quot;: &quot;country&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/specificity&quot;, &quot;field&quot;: &quot;specificity&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/risk&quot;, &quot;field&quot;: &quot;risk&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/frequency&quot;, &quot;field&quot;: &quot;frequency&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/category&quot;, &quot;field&quot;: &quot;category&quot;},{&quot;type&quot;: &quot;sf-i-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/obligationtype&quot;, &quot;field&quot;: &quot;obligationtype&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/state&quot;, &quot;field&quot;: &quot;state&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subfrequency&quot;, &quot;field&quot;: &quot;subfrequency&quot;},{&quot;type&quot;: &quot;sf-i-sub-select&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/subcategory&quot;, &quot;field&quot;: &quot;subcategory&quot;},{&quot;type&quot;: &quot;sf-i-form&quot;, &quot;apiId&quot;: &quot;dnytrdlrmxgsy.cloudfront.net/statute&quot;, &quot;field&quot;: &quot;statute&quot;, &quot;projectField&quot;: &quot;name&quot;}]" eventpreviewfields="[&quot;obligation&quot;]" eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
798
798
 
799
799
  <div slot="uploader">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.875",
4
+ "version": "1.0.876",
5
5
  "description": "Superflows Navigation Component",
6
6
  "main": "sf-i-events.js",
7
7
  "module": "sf-i-events.js",
package/sf-i-events.js CHANGED
@@ -2604,7 +2604,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2604
2604
  if (event.reporters != null && remarks.length > 0) {
2605
2605
  html += '<div part="stream-events-event-subtitle" class="stream-events-event-subtitle">' + remarks + ', occurred on ' + occurrenceDate + '</div>';
2606
2606
  }
2607
- console.log('returning divstarthtml', html);
2607
+ // console.log('returning divstarthtml', html);
2608
2608
  return html;
2609
2609
  };
2610
2610
  this.renderCalendarRowDivItemDivEnd = () => {
@@ -15023,7 +15023,7 @@ let SfIEvents = class SfIEvents extends LitElement {
15023
15023
  html += '<div id="locations-list-container" class="d-flex flex-col w-100 scroll-x">';
15024
15024
  html += '</div>';
15025
15025
  this._SfOnboardingLocationsContainer.innerHTML = html;
15026
- this.renderTaggingTable(this._SfOnboardingLocationsListContainer, mappedSerializedEntities, mappedLocations, ["firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "reference"], this.uploadLocationsMapping, this.loadOnboardingLocations, "locations", ["id", "countryname", "entityname"], this.apiIdTags, "&Location", ["locations"], locationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15026
+ this.renderTaggingTable(this._SfOnboardingLocationsListContainer, mappedSerializedEntities, mappedLocations, ["shortid", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "reference"], this.uploadLocationsMapping, this.loadOnboardingLocations, "locations", ["id", "countryname", "entityname"], this.apiIdTags, "&Location", ["locations"], locationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15027
15027
  };
15028
15028
  this.renderOnboardingCompliances = (mappedStatutes, mappedCompliances) => {
15029
15029
  //console.log('mappedcompliances', mappedCompliances);
@@ -15138,7 +15138,7 @@ let SfIEvents = class SfIEvents extends LitElement {
15138
15138
  html += '<div id="entities-list-container" class="d-flex flex-col w-100 scroll-x">';
15139
15139
  html += '</div>';
15140
15140
  this._SfOnboardingEntitiesContainer.innerHTML = html;
15141
- this.renderTaggingTable(this._SfOnboardingEntitiesListContainer, mappedSerializedCountries, mappedEntities, ["firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute"], this.uploadEntitiesMapping, this.loadOnboardingEntities, "entities", ["id", "countryname"], this.apiIdTags, "&Entity", ["entities"], entitiesJobs, null, ["Client remarks", "FlaggGRC response"], arrFeedbackReference, "Guideline", "");
15141
+ this.renderTaggingTable(this._SfOnboardingEntitiesListContainer, mappedSerializedCountries, mappedEntities, ["shortid", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute"], this.uploadEntitiesMapping, this.loadOnboardingEntities, "entities", ["id", "countryname"], this.apiIdTags, "&Entity", ["entities"], entitiesJobs, null, ["Client remarks", "FlaggGRC response"], arrFeedbackReference, "Guideline", "");
15142
15142
  };
15143
15143
  this.renderOnboardingCountries = (mappedCountries, mappedCompliances, countriesJobs) => {
15144
15144
  var html = '';
@@ -15159,7 +15159,7 @@ let SfIEvents = class SfIEvents extends LitElement {
15159
15159
  // }
15160
15160
  // }
15161
15161
  // mappedCountries.data.mappings.mappings = arr2;
15162
- this.renderTaggingTable(this._SfOnboardingCountriesListContainer, mappedCompliances, mappedCountries, ["firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "state", "subcategory"], this.uploadCountriesMapping, this.loadOnboardingCountries, "countries", ["id"], this.apiIdTags, "-Country", ["countries"], countriesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15162
+ this.renderTaggingTable(this._SfOnboardingCountriesListContainer, mappedCompliances, mappedCountries, ["shortid", "firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "state", "subcategory"], this.uploadCountriesMapping, this.loadOnboardingCountries, "countries", ["id"], this.apiIdTags, "-Country", ["countries"], countriesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
15163
15163
  };
15164
15164
  this.renderOnboardingStatutes = (mappedStatutes) => {
15165
15165
  var initCursor = "";
@@ -16146,9 +16146,18 @@ let SfIEvents = class SfIEvents extends LitElement {
16146
16146
  }
16147
16147
  this.filterEventsInWindow(query, ctx, eventContainer);
16148
16148
  });
16149
- (_b = container.querySelector('#chart-control-cancel')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => {
16150
- container.innerHTML = '';
16151
- container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
16149
+ (_b = container.querySelector('#chart-control-cancel')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', (e) => {
16150
+ var _a, _b, _c, _f, _g, _h, _j;
16151
+ let targetDiv = e.target;
16152
+ let containerDiv = (_a = targetDiv.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
16153
+ if (containerDiv != null) {
16154
+ containerDiv.innerHTML = '';
16155
+ (_f = (_c = (_b = containerDiv.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.querySelector('#chart-control-settings')) === null || _f === void 0 ? void 0 : _f.setAttribute('part', 'calendar-tab-button-not-selected');
16156
+ (_j = (_h = (_g = containerDiv.parentElement) === null || _g === void 0 ? void 0 : _g.parentElement) === null || _h === void 0 ? void 0 : _h.querySelector('#chart-control-summary')) === null || _j === void 0 ? void 0 : _j.setAttribute('part', 'calendar-tab-button-not-selected');
16157
+ // containerDiv.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
16158
+ }
16159
+ // container.innerHTML = '';
16160
+ // container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
16152
16161
  });
16153
16162
  };
16154
16163
  this.renderChartSettingsSettings = (container, selectedTab = 1) => {
@@ -16259,13 +16268,34 @@ let SfIEvents = class SfIEvents extends LitElement {
16259
16268
  `;
16260
16269
  }
16261
16270
  container.innerHTML = html;
16262
- (_a = container.querySelector('#chart-control-cancel')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
16263
- container.innerHTML = '';
16264
- container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
16271
+ (_a = container.querySelector('#chart-control-cancel')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', (e) => {
16272
+ var _a, _b, _c, _f, _g, _h, _j;
16273
+ let targetDiv = e.target;
16274
+ let containerDiv = (_a = targetDiv.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement;
16275
+ console.log('containerDiv', containerDiv);
16276
+ if (containerDiv != null) {
16277
+ containerDiv.innerHTML = '';
16278
+ (_f = (_c = (_b = containerDiv.parentElement) === null || _b === void 0 ? void 0 : _b.parentElement) === null || _c === void 0 ? void 0 : _c.querySelector('#chart-control-settings')) === null || _f === void 0 ? void 0 : _f.setAttribute('part', 'calendar-tab-button-not-selected');
16279
+ (_j = (_h = (_g = containerDiv.parentElement) === null || _g === void 0 ? void 0 : _g.parentElement) === null || _h === void 0 ? void 0 : _h.querySelector('#chart-control-summary')) === null || _j === void 0 ? void 0 : _j.setAttribute('part', 'calendar-tab-button-not-selected');
16280
+ // containerDiv.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
16281
+ }
16265
16282
  });
16266
16283
  (_b = container.querySelector('#button-download-stats')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', async () => {
16267
- if (selectedTab === -1)
16268
- await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
16284
+ if (selectedTab === -1) {
16285
+ if (this.selectedFeatures.indexOf('compliances') >= 0) {
16286
+ await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
16287
+ }
16288
+ else if (this.selectedFeatures.indexOf('notices') >= 0) {
16289
+ await this.fetchAndRenderNotices(this.sdate, this.edate, "", "no");
16290
+ }
16291
+ else if (this.selectedFeatures.indexOf('contracts') >= 0) {
16292
+ await this.fetchAndRenderContracts(this.sdate, this.edate, "", "no");
16293
+ }
16294
+ else if (this.selectedFeatures.indexOf('licenses') >= 0) {
16295
+ await this.fetchAndRenderLicenses(this.sdate, this.edate, "", "no");
16296
+ }
16297
+ // await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
16298
+ }
16269
16299
  const radioCsv = container.querySelector('#radio-csv');
16270
16300
  const radioImage = container.querySelector('#radio-image');
16271
16301
  const radioStats = container.querySelector('#radio-stats');
@@ -16433,7 +16463,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16433
16463
  });
16434
16464
  };
16435
16465
  this.renderChartSettings = (container, selectedTab = -1, selectedSummary = -1, ctx) => {
16436
- var _a, _b;
16466
+ var _a, _b, _c;
16437
16467
  console.log('rendering chart settings', selectedSummary);
16438
16468
  var html = '';
16439
16469
  html += '<div class="d-flex justify-end align-start">';
@@ -16456,14 +16486,16 @@ let SfIEvents = class SfIEvents extends LitElement {
16456
16486
  html += '<button class="tab-button" id="chart-control-summary" part="calendar-tab-button-not-selected" class="mr-10"><span class="material-icons">summarize</span></button>';
16457
16487
  }
16458
16488
  html += '</div>';
16459
- container.querySelector('#chart-settings-controls').innerHTML = html;
16460
- (_a = container.querySelector('#chart-settings-controls').querySelector('#chart-control-settings')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
16461
- this.renderChartSettings(container, 1, selectedSummary, ctx);
16462
- });
16463
- (_b = container.querySelector('#chart-settings-controls').querySelector('#chart-control-summary')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => {
16464
- console.log('summary clicked');
16465
- this.renderChartSummary();
16466
- });
16489
+ if (container.querySelector('#chart-settings-controls') != null) {
16490
+ container.querySelector('#chart-settings-controls').innerHTML = html;
16491
+ (_a = container.querySelector('#chart-settings-controls').querySelector('#chart-control-settings')) === null || _a === void 0 ? void 0 : _a.addEventListener('click', () => {
16492
+ this.renderChartSettings(container, 1, selectedSummary, ctx);
16493
+ });
16494
+ (_b = container.querySelector('#chart-settings-controls').querySelector('#chart-control-summary')) === null || _b === void 0 ? void 0 : _b.addEventListener('click', () => {
16495
+ console.log('summary clicked');
16496
+ this.renderChartSummary();
16497
+ });
16498
+ }
16467
16499
  // (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-filters')?.addEventListener('click', () => {
16468
16500
  // this.renderChartSettings(container, 0, ctx);
16469
16501
  // });
@@ -16477,7 +16509,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16477
16509
  // radioCompleteness.click();
16478
16510
  this.renderChartSettingsSettings(container.querySelector('#chart-settings'), selectedSummary);
16479
16511
  }
16480
- container.querySelector('#chart-settings').addEventListener('canceled', () => {
16512
+ (_c = container.querySelector('#chart-settings')) === null || _c === void 0 ? void 0 : _c.addEventListener('canceled', () => {
16481
16513
  //console.log('canceled');
16482
16514
  if (this.getCurrentTab() == this.TAB_STREAM) {
16483
16515
  this.renderChartSettings(container, -1, -1, ctx);
@@ -4804,7 +4804,7 @@ export class SfIEvents extends LitElement {
4804
4804
  if (event.reporters != null && remarks.length > 0) {
4805
4805
  html += '<div part="stream-events-event-subtitle" class="stream-events-event-subtitle">' + remarks + ', occurred on ' + occurrenceDate + '</div>';
4806
4806
  }
4807
- console.log('returning divstarthtml', html);
4807
+ // console.log('returning divstarthtml', html);
4808
4808
  return html;
4809
4809
 
4810
4810
  }
@@ -19800,7 +19800,7 @@ export class SfIEvents extends LitElement {
19800
19800
 
19801
19801
  (this._SfOnboardingLocationsContainer as HTMLDivElement).innerHTML = html;
19802
19802
 
19803
- this.renderTaggingTable((this._SfOnboardingLocationsListContainer as HTMLDivElement), mappedSerializedEntities, mappedLocations, ["firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "reference"], this.uploadLocationsMapping, this.loadOnboardingLocations, "locations", ["id", "countryname", "entityname"], this.apiIdTags, "&Location", ["locations"], locationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19803
+ this.renderTaggingTable((this._SfOnboardingLocationsListContainer as HTMLDivElement), mappedSerializedEntities, mappedLocations, ["shortid","firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "reference"], this.uploadLocationsMapping, this.loadOnboardingLocations, "locations", ["id", "countryname", "entityname"], this.apiIdTags, "&Location", ["locations"], locationsJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19804
19804
 
19805
19805
  }
19806
19806
 
@@ -19961,7 +19961,7 @@ export class SfIEvents extends LitElement {
19961
19961
 
19962
19962
  (this._SfOnboardingEntitiesContainer as HTMLDivElement).innerHTML = html;
19963
19963
 
19964
- this.renderTaggingTable((this._SfOnboardingEntitiesListContainer as HTMLDivElement), mappedSerializedCountries, mappedEntities, ["firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute"], this.uploadEntitiesMapping, this.loadOnboardingEntities, "entities", ["id", "countryname"], this.apiIdTags, "&Entity", ["entities"], entitiesJobs, null, ["Client remarks", "FlaggGRC response"], arrFeedbackReference, "Guideline", "");
19964
+ this.renderTaggingTable((this._SfOnboardingEntitiesListContainer as HTMLDivElement), mappedSerializedCountries, mappedEntities, ["shortid","firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute"], this.uploadEntitiesMapping, this.loadOnboardingEntities, "entities", ["id", "countryname"], this.apiIdTags, "&Entity", ["entities"], entitiesJobs, null, ["Client remarks", "FlaggGRC response"], arrFeedbackReference, "Guideline", "");
19965
19965
 
19966
19966
  }
19967
19967
 
@@ -19993,7 +19993,7 @@ export class SfIEvents extends LitElement {
19993
19993
 
19994
19994
  // mappedCountries.data.mappings.mappings = arr2;
19995
19995
 
19996
- this.renderTaggingTable((this._SfOnboardingCountriesListContainer as HTMLDivElement), mappedCompliances, mappedCountries, ["firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "state", "subcategory"], this.uploadCountriesMapping, this.loadOnboardingCountries, "countries", ["id"], this.apiIdTags, "-Country", ["countries"], countriesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19996
+ this.renderTaggingTable((this._SfOnboardingCountriesListContainer as HTMLDivElement), mappedCompliances, mappedCountries, ["shortid","firstlineofdefence", "obligationtitle", "obligationtype", "country", "statute", "state", "subcategory"], this.uploadCountriesMapping, this.loadOnboardingCountries, "countries", ["id"], this.apiIdTags, "-Country", ["countries"], countriesJobs, null, ["Client remarks", "FlaggGRC response"], null, "", "");
19997
19997
 
19998
19998
  }
19999
19999
 
@@ -21271,10 +21271,19 @@ export class SfIEvents extends LitElement {
21271
21271
 
21272
21272
  });
21273
21273
 
21274
- container.querySelector('#chart-control-cancel')?.addEventListener('click', () => {
21274
+ container.querySelector('#chart-control-cancel')?.addEventListener('click', (e) => {
21275
21275
 
21276
- container.innerHTML = '';
21277
- container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
21276
+ let targetDiv = e.target as HTMLDivElement;
21277
+ let containerDiv = targetDiv.parentElement?.parentElement as HTMLDivElement;
21278
+ if(containerDiv != null){
21279
+ containerDiv.innerHTML = '';
21280
+ containerDiv.parentElement?.parentElement?.querySelector('#chart-control-settings')?.setAttribute('part', 'calendar-tab-button-not-selected');
21281
+ containerDiv.parentElement?.parentElement?.querySelector('#chart-control-summary')?.setAttribute('part', 'calendar-tab-button-not-selected');
21282
+ // containerDiv.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
21283
+ }
21284
+
21285
+ // container.innerHTML = '';
21286
+ // container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
21278
21287
 
21279
21288
  });
21280
21289
 
@@ -21389,16 +21398,32 @@ export class SfIEvents extends LitElement {
21389
21398
 
21390
21399
  container.innerHTML = html;
21391
21400
 
21392
- container.querySelector('#chart-control-cancel')?.addEventListener('click', () => {
21393
-
21394
- container.innerHTML = '';
21395
- container.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
21401
+ container.querySelector('#chart-control-cancel')?.addEventListener('click', (e) => {
21396
21402
 
21403
+ let targetDiv = e.target as HTMLDivElement;
21404
+ let containerDiv = targetDiv.parentElement?.parentElement as HTMLDivElement;
21405
+ console.log('containerDiv', containerDiv);
21406
+ if(containerDiv != null){
21407
+ containerDiv.innerHTML = '';
21408
+ containerDiv.parentElement?.parentElement?.querySelector('#chart-control-settings')?.setAttribute('part', 'calendar-tab-button-not-selected');
21409
+ containerDiv.parentElement?.parentElement?.querySelector('#chart-control-summary')?.setAttribute('part', 'calendar-tab-button-not-selected');
21410
+ // containerDiv.dispatchEvent(new CustomEvent('canceled', { bubbles: true }));
21411
+ }
21397
21412
  });
21398
21413
 
21399
21414
  container.querySelector('#button-download-stats')?.addEventListener('click', async () => {
21400
- if (selectedTab === -1)
21401
- await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
21415
+ if (selectedTab === -1){
21416
+ if (this.selectedFeatures.indexOf('compliances') >= 0) {
21417
+ await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no")
21418
+ } else if (this.selectedFeatures.indexOf('notices') >= 0) {
21419
+ await this.fetchAndRenderNotices(this.sdate, this.edate, "", "no");
21420
+ } else if (this.selectedFeatures.indexOf('contracts') >= 0) {
21421
+ await this.fetchAndRenderContracts(this.sdate, this.edate, "", "no");
21422
+ } else if (this.selectedFeatures.indexOf('licenses') >= 0) {
21423
+ await this.fetchAndRenderLicenses(this.sdate, this.edate, "", "no");
21424
+ }
21425
+ // await this.fetchAndYearlyRenderUserCalendar_2(this.sdate, this.edate, "", "no");
21426
+ }
21402
21427
  const radioCsv = (container.querySelector('#radio-csv') as HTMLInputElement);
21403
21428
  const radioImage = (container.querySelector('#radio-image') as HTMLInputElement);
21404
21429
  const radioStats = (container.querySelector('#radio-stats') as HTMLInputElement);
@@ -21622,18 +21647,20 @@ export class SfIEvents extends LitElement {
21622
21647
  }
21623
21648
  html += '</div>';
21624
21649
 
21625
- (container.querySelector('#chart-settings-controls') as HTMLDivElement).innerHTML = html;
21650
+ if((container.querySelector('#chart-settings-controls') as HTMLDivElement) != null){
21651
+ (container.querySelector('#chart-settings-controls') as HTMLDivElement).innerHTML = html;
21626
21652
 
21627
- (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-settings')?.addEventListener('click', () => {
21653
+ (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-settings')?.addEventListener('click', () => {
21628
21654
 
21629
- this.renderChartSettings(container, 1, selectedSummary, ctx);
21655
+ this.renderChartSettings(container, 1, selectedSummary, ctx);
21630
21656
 
21631
- });
21632
- (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-summary')?.addEventListener('click', () => {
21633
- console.log('summary clicked');
21634
- this.renderChartSummary();
21657
+ });
21658
+ (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-summary')?.addEventListener('click', () => {
21659
+ console.log('summary clicked');
21660
+ this.renderChartSummary();
21635
21661
 
21636
- });
21662
+ });
21663
+ }
21637
21664
 
21638
21665
  // (container.querySelector('#chart-settings-controls') as HTMLDivElement).querySelector('#chart-control-filters')?.addEventListener('click', () => {
21639
21666
 
@@ -21654,7 +21681,7 @@ export class SfIEvents extends LitElement {
21654
21681
  this.renderChartSettingsSettings((container.querySelector('#chart-settings') as HTMLDivElement), selectedSummary);
21655
21682
  }
21656
21683
 
21657
- (container.querySelector('#chart-settings') as HTMLDivElement).addEventListener('canceled', () => {
21684
+ (container.querySelector('#chart-settings') as HTMLDivElement)?.addEventListener('canceled', () => {
21658
21685
  //console.log('canceled');
21659
21686
  if (this.getCurrentTab() == this.TAB_STREAM) {
21660
21687
  this.renderChartSettings(container, -1, -1, ctx);