sf-i-events 1.0.708 → 1.0.710

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
@@ -693,7 +693,7 @@
693
693
  </div>
694
694
 
695
695
  </sf-i-events> -->
696
- <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" fill="solid" username="Auditor J1" userprofileid="bda0d59b-058b-4098-b0fc-54aa54aa5998" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="auditor" showregisterexport="false" 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="2024">
696
+ <!-- <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" fill="solid" username="Auditor J1" userprofileid="bda0d59b-058b-4098-b0fc-54aa54aa5998" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="auditor" showregisterexport="false" 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="2024">
697
697
 
698
698
  <div slot="uploader">
699
699
  <sf-i-uploader id="uploader" max="10" apiid="1peg5170d3" allowedextensions="[&quot;jpg&quot;,&quot;png&quot;,&quot;pdf&quot;,&quot;xls&quot;,&quot;xlsx&quot;,&quot;doc&quot;,&quot;docx&quot;]" extract="yes" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" maxsize="5242880" allowdownload="yes"></sf-i-uploader>
@@ -702,7 +702,7 @@
702
702
  <sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
703
703
  </div>
704
704
 
705
- </sf-i-events>
705
+ </sf-i-events> -->
706
706
  <!-- <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" fill="pattern" username="Chief Compliance Officer " userprofileid="5fe96caa-1a44-4a2d-921a-920d29433eca" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" enabledeletelatestreport="true" 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;obligationtitle&quot;]" eventhidefields="[&quot;comments&quot;,&quot;documents&quot;,&quot;lastupdated&quot;,&quot;approved&quot;,&quot;tags&quot;]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2024">
707
707
 
708
708
  <div slot="uploader">
@@ -722,9 +722,9 @@
722
722
 
723
723
  </sf-i-events> -->
724
724
 
725
- <!-- <sf-i-events projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" mode="onboarding" locations="{&quot;India&quot;:{&quot;Maharashtra&quot;:[&quot;Pune&quot;,&quot;Mumbai&quot;],&quot;Telangana&quot;:[&quot;Telangana&quot;]},&quot;Canada&quot;:{&quot;CanadaSO&quot;:[&quot;CanadaLO&quot;]},&quot;Singapore&quot;:{&quot;SingaporeSO&quot;:[&quot;Orchard&quot;,&quot;Raffles&quot;,&quot;Robinson&quot;,&quot;Tanjong&quot;,&quot;Tras&quot;]},&quot;United Kingdom&quot;:{&quot;UnitedSO&quot;:[&quot;UnitedLO&quot;]},&quot;United States of America&quot;:{&quot;AmericaSO&quot;:[&quot;AmericaLO&quot;]}}" contractstartdate="1/4/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
725
+ <sf-i-events projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" mode="onboarding" locations="{&quot;India&quot;:{&quot;Maharashtra&quot;:[&quot;Pune&quot;,&quot;Mumbai&quot;],&quot;Telangana&quot;:[&quot;Telangana&quot;]},&quot;Canada&quot;:{&quot;CanadaSO&quot;:[&quot;CanadaLO&quot;]},&quot;Singapore&quot;:{&quot;SingaporeSO&quot;:[&quot;Orchard&quot;,&quot;Raffles&quot;,&quot;Robinson&quot;,&quot;Tanjong&quot;,&quot;Tras&quot;]},&quot;United Kingdom&quot;:{&quot;UnitedSO&quot;:[&quot;UnitedLO&quot;]},&quot;United States of America&quot;:{&quot;AmericaSO&quot;:[&quot;AmericaLO&quot;]}}" contractstartdate="1/4/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="ninad.t@flagggrc.tech" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
726
726
 
727
- </sf-i-events> -->
727
+ </sf-i-events>
728
728
 
729
729
  <!-- <sf-i-events projectid="5c073644-5dce-4d8f-b82e-2bc2def2390f" projectname="ABC Hospitals" mode="onboarding" locations="{}" contractstartdate="01/04/2024" apiid="dwqyez2puoxmu.cloudfront.net/event" username="hrushi.mehendale@gmail.com" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiidcompliances="dnytrdlrmxgsy.cloudfront.net/compliance" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidusers="dnytrdlrmxgsy.cloudfront.net/userprofile" disablesignoff="yes" disableclientresponse="yes">
730
730
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sf-i-events",
3
3
  "private": false,
4
- "version": "1.0.708",
4
+ "version": "1.0.710",
5
5
  "description": "Superflows Navigation Component",
6
6
  "main": "sf-i-events.js",
7
7
  "module": "sf-i-events.js",
package/sf-i-events.d.ts CHANGED
@@ -265,12 +265,14 @@ export declare class SfIEvents extends LitElement {
265
265
  nextTabStatus: string;
266
266
  sdate: string;
267
267
  edate: string;
268
+ changedOnboardingItemIds: string[];
268
269
  static styles: import("lit").CSSResult;
269
270
  _SfIEventsC: any;
270
271
  _SfRowError: any;
271
272
  _SfRowErrorMessage: any;
272
273
  _SfRowSuccess: any;
273
274
  _SfRowSuccessMessage: any;
275
+ _SfRowSuccessMessageBtnContainer: any;
274
276
  _SfLoader: any;
275
277
  _SfCalendarContainer: any;
276
278
  _SfButtonGenerate: any;
@@ -396,6 +398,7 @@ export declare class SfIEvents extends LitElement {
396
398
  clearMessages: () => void;
397
399
  setError: (msg: string) => void;
398
400
  setSuccess: (msg: string) => void;
401
+ setSuccessBtn: (msg: string, btnCaptions: string[], btnCallbacks: Function[]) => void;
399
402
  getLastDayOfLastMonth: (month: number, year: number) => number;
400
403
  getLastDayOfMonth: (month: number, year: number) => number;
401
404
  getFirstDateOfLastWeek: (startDate: Date) => Date;
@@ -530,6 +533,7 @@ export declare class SfIEvents extends LitElement {
530
533
  renderFind: () => void;
531
534
  renderCustom: () => void;
532
535
  renderThis: (index?: number, showGraph?: boolean) => void;
536
+ renderButtonRefresh: (eventsContainer: HTMLDivElement) => void;
533
537
  renderStream: (index?: number, showGraph?: boolean) => void;
534
538
  attachTimelineFilterHandlers: (divContainer: HTMLDivElement) => void;
535
539
  getCurrentYear: (mm: string) => string;
package/sf-i-events.js CHANGED
@@ -1203,6 +1203,7 @@ let SfIEvents = class SfIEvents extends LitElement {
1203
1203
  this.nextTabStatus = "";
1204
1204
  this.sdate = "";
1205
1205
  this.edate = "";
1206
+ this.changedOnboardingItemIds = [];
1206
1207
  this.isSelectedLegend = (value) => {
1207
1208
  return this.chartSelectedLegend.includes(value);
1208
1209
  };
@@ -1365,18 +1366,36 @@ let SfIEvents = class SfIEvents extends LitElement {
1365
1366
  this._SfRowErrorMessage.innerHTML = '';
1366
1367
  this._SfRowSuccess.style.display = 'none';
1367
1368
  this._SfRowSuccessMessage.innerHTML = '';
1369
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
1368
1370
  };
1369
1371
  this.setError = (msg) => {
1370
1372
  this._SfRowError.style.display = 'flex';
1371
1373
  this._SfRowErrorMessage.innerHTML = msg;
1372
1374
  this._SfRowSuccess.style.display = 'none';
1373
1375
  this._SfRowSuccessMessage.innerHTML = '';
1376
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
1374
1377
  };
1375
1378
  this.setSuccess = (msg) => {
1376
1379
  this._SfRowError.style.display = 'none';
1377
1380
  this._SfRowErrorMessage.innerHTML = '';
1378
1381
  this._SfRowSuccess.style.display = 'flex';
1379
1382
  this._SfRowSuccessMessage.innerHTML = msg;
1383
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
1384
+ };
1385
+ this.setSuccessBtn = (msg, btnCaptions, btnCallbacks) => {
1386
+ this._SfRowError.style.display = 'none';
1387
+ this._SfRowErrorMessage.innerHTML = '';
1388
+ this._SfRowSuccess.style.display = 'flex';
1389
+ this._SfRowSuccessMessage.innerHTML = msg;
1390
+ let btnHtml = '';
1391
+ for (let [i, caption] of btnCaptions.entries()) {
1392
+ btnHtml += '<button part="successmsgbtn" id="successbtn-' + i + '" class="d-flex align-center mt-10' + ((i > 0) ? ' ml-10' : '') + '">' + caption + '</button>';
1393
+ }
1394
+ this._SfRowSuccessMessageBtnContainer.innerHTML = btnHtml;
1395
+ for (let [i, callback] of btnCallbacks.entries()) {
1396
+ let btn = this._SfRowSuccessMessageBtnContainer.querySelector('#successbtn-' + i);
1397
+ btn.addEventListener('click', () => { callback(); });
1398
+ }
1380
1399
  };
1381
1400
  this.getLastDayOfLastMonth = (month, year) => {
1382
1401
  const date = new Date(year, month, 0);
@@ -2076,7 +2095,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2076
2095
  //console.log('flowGraph', this.flowGraph);
2077
2096
  var html = '';
2078
2097
  html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
2079
- html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title">' + parametersTitle + '</h4></div>';
2098
+ html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title">' + parametersTitle + '</h4><button id="button-refresh" part="button-duration-title" class="align-center d-flex justify-center"><h4 part="duration-title">' + parametersTitle + '</h4><span part="duration-title-icon" class="material-icons ml-10">refresh</span></button></div>';
2080
2099
  if (showGraph) {
2081
2100
  html += '<div part="stream-event-chart-selection" class="mb-20">';
2082
2101
  html += '<div part="td-head" class="mb-5">Select Chart</div>';
@@ -2720,6 +2739,7 @@ let SfIEvents = class SfIEvents extends LitElement {
2720
2739
  //console.log('rangeperiod', period)
2721
2740
  var html = this.renderEvents(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate, "From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'));
2722
2741
  eventsContainer.querySelector('.calendar-right-data').innerHTML = html;
2742
+ this.renderButtonRefresh(eventsContainer);
2723
2743
  this.attachTimelineFilterHandlers(eventsContainer);
2724
2744
  const radioExpander = eventsContainer.querySelector('#graph-radios-expander');
2725
2745
  radioExpander === null || radioExpander === void 0 ? void 0 : radioExpander.addEventListener('click', (e) => {
@@ -2730,6 +2750,10 @@ let SfIEvents = class SfIEvents extends LitElement {
2730
2750
  div.style.display = 'block';
2731
2751
  });
2732
2752
  });
2753
+ const buttonRefresh = eventsContainer.querySelector('#button-refresh');
2754
+ buttonRefresh.addEventListener('click', async () => {
2755
+ this.processDateSelection(eventsContainer);
2756
+ });
2733
2757
  const buttonArr = eventsContainer.querySelectorAll('.button-expand');
2734
2758
  for (var i = 0; i < buttonArr.length; i++) {
2735
2759
  buttonArr[i].addEventListener('click', (ev) => {
@@ -5169,6 +5193,7 @@ let SfIEvents = class SfIEvents extends LitElement {
5169
5193
  html += '</div>';
5170
5194
  html += '</div>';
5171
5195
  this._SfThisContainer.innerHTML = html;
5196
+ this.renderButtonRefresh(this._SfThisContainer);
5172
5197
  const radioExpander = this._SfThisContainer.querySelector('#graph-radios-expander');
5173
5198
  radioExpander === null || radioExpander === void 0 ? void 0 : radioExpander.addEventListener('click', (e) => {
5174
5199
  const button = e.currentTarget;
@@ -5278,6 +5303,14 @@ let SfIEvents = class SfIEvents extends LitElement {
5278
5303
  this.renderThis(target);
5279
5304
  });
5280
5305
  }
5306
+ const buttonRefresh = this._SfThisContainer.querySelector('#button-refresh');
5307
+ buttonRefresh.addEventListener('click', async () => {
5308
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
5309
+ this.currentColumnIndex = index + "";
5310
+ const dateResult = this.calculateStartAndEndDateOfThis(index);
5311
+ await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate);
5312
+ this.renderThis(index);
5313
+ });
5281
5314
  const buttonArr = this._SfThisContainer.querySelectorAll('.button-expand');
5282
5315
  for (i = 0; i < buttonArr.length; i++) {
5283
5316
  buttonArr[i].addEventListener('click', (ev) => {
@@ -5389,6 +5422,26 @@ let SfIEvents = class SfIEvents extends LitElement {
5389
5422
  }
5390
5423
  }
5391
5424
  };
5425
+ this.renderButtonRefresh = (eventsContainer) => {
5426
+ document.addEventListener('scroll', () => {
5427
+ console.log('scroll', window.scrollY);
5428
+ let buttonRefresh = eventsContainer.querySelector('#button-refresh');
5429
+ if (window.scrollY > 720) {
5430
+ if (buttonRefresh.style.display == "flex") {
5431
+ }
5432
+ else {
5433
+ buttonRefresh.style.display = 'flex';
5434
+ }
5435
+ }
5436
+ else {
5437
+ if (buttonRefresh.style.display == "none") {
5438
+ }
5439
+ else {
5440
+ buttonRefresh.style.display = 'none';
5441
+ }
5442
+ }
5443
+ });
5444
+ };
5392
5445
  this.renderStream = (index = 0, showGraph = true) => {
5393
5446
  //console.log('flowgraph renderStream', this.flowGraph);
5394
5447
  var _a, _b;
@@ -5438,6 +5491,7 @@ let SfIEvents = class SfIEvents extends LitElement {
5438
5491
  html += '</div>';
5439
5492
  html += '</div>';
5440
5493
  this._SfStreamContainer.innerHTML = html;
5494
+ this.renderButtonRefresh(this._SfStreamContainer);
5441
5495
  this.attachTimelineFilterHandlers(this._SfStreamContainer);
5442
5496
  const radioExpander = this._SfStreamContainer.querySelector('#graph-radios-expander');
5443
5497
  radioExpander === null || radioExpander === void 0 ? void 0 : radioExpander.addEventListener('click', (e) => {
@@ -5548,6 +5602,19 @@ let SfIEvents = class SfIEvents extends LitElement {
5548
5602
  this.renderStream(target);
5549
5603
  });
5550
5604
  }
5605
+ const buttonRefresh = this._SfStreamContainer.querySelector('#button-refresh');
5606
+ buttonRefresh === null || buttonRefresh === void 0 ? void 0 : buttonRefresh.addEventListener('click', async () => {
5607
+ const dateResult = this.calculateStartAndEndDateOfStream(index);
5608
+ const monthResult = this.calculateMonthFromIndex(index);
5609
+ console.log('monthResult', monthResult);
5610
+ console.log('dateresult', dateResult);
5611
+ this.currentColumnIndex = index + "";
5612
+ if (dateResult != null) {
5613
+ await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate, "", "yes", ("0" + monthResult).slice(-2));
5614
+ }
5615
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
5616
+ this.renderStream(index);
5617
+ });
5551
5618
  const buttonArr = this._SfStreamContainer.querySelectorAll('.button-expand');
5552
5619
  for (i = 0; i < buttonArr.length; i++) {
5553
5620
  buttonArr[i].addEventListener('click', (ev) => {
@@ -7646,6 +7713,9 @@ let SfIEvents = class SfIEvents extends LitElement {
7646
7713
  if (sourceArray.data.mappings.mappings[j] != null && taggingArray.data.mappings.mappings[i] != null) {
7647
7714
  if (sourceArray.data.mappings.mappings[j][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
7648
7715
  equal = false;
7716
+ // if(taggingArray.data.mappings.mappings.length > 0){
7717
+ // console.log('taggingarray col not found', uniqCols[k], taggingArray.data.mappings.mappings[i])
7718
+ // }
7649
7719
  }
7650
7720
  }
7651
7721
  }
@@ -7867,10 +7937,20 @@ let SfIEvents = class SfIEvents extends LitElement {
7867
7937
  // }
7868
7938
  var classBg = "";
7869
7939
  if (i % 2 === 0) {
7870
- classBg = 'td-light';
7940
+ if (this.changedOnboardingItemIds.length > 0 && this.changedOnboardingItemIds.indexOf(taggingArray.data.mappings.mappings[i].id) >= 0) {
7941
+ classBg = 'td-light-selected';
7942
+ }
7943
+ else {
7944
+ classBg = 'td-light';
7945
+ }
7871
7946
  }
7872
7947
  else {
7873
- classBg = 'td-dark';
7948
+ if (this.changedOnboardingItemIds.length > 0 && this.changedOnboardingItemIds.indexOf(taggingArray.data.mappings.mappings[i].id) >= 0) {
7949
+ classBg = 'td-dark-selected';
7950
+ }
7951
+ else {
7952
+ classBg = 'td-dark';
7953
+ }
7874
7954
  }
7875
7955
  html += '<tr class="" id="tablerow-' + i + '">';
7876
7956
  html += '<td class="left-sticky td-body ' + classBg + '" ><div class="' + (!showSearch ? 'truncate' : '') + '"><input id="cb-' + i + '" type="checkbox" class="checkbox-row cb-select"/></div></td>';
@@ -8264,14 +8344,94 @@ let SfIEvents = class SfIEvents extends LitElement {
8264
8344
  });
8265
8345
  const buttonExportMappingCSVNew = Util.clearListeners(buttonExportMappingCSV);
8266
8346
  buttonExportMappingCSVNew === null || buttonExportMappingCSVNew === void 0 ? void 0 : buttonExportMappingCSVNew.addEventListener('click', async () => {
8267
- let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
8347
+ let csvArray = JSON.parse(JSON.stringify(taggingArray.data.mappings.mappings));
8348
+ for (let [i, obj] of csvArray.entries()) {
8349
+ let tempCsvObj = obj;
8350
+ if (obj['cols'] != null && obj['data'] != null) {
8351
+ let dataArr = JSON.parse(obj['data']);
8352
+ let colsArr = JSON.parse(obj['cols']);
8353
+ for (let [j, colKey] of colsArr.entries()) {
8354
+ tempCsvObj['cols_' + colKey] = dataArr[j];
8355
+ }
8356
+ }
8357
+ csvArray[i] = tempCsvObj;
8358
+ }
8359
+ console.log('csv array', csvArray);
8360
+ let csvData = Util.convertToCSV(csvArray);
8361
+ // let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
8268
8362
  console.log('csvData', csvData);
8363
+ const blob = new Blob([csvData], { type: 'text/csv;charset=utf-8;' });
8364
+ const url = window.URL.createObjectURL(blob);
8365
+ const a = document.createElement('a');
8366
+ a.setAttribute('href', url);
8367
+ a.setAttribute('download', 'mapping_' + colName + '_' + new Date().getTime() + '.csv');
8368
+ a.click();
8269
8369
  });
8270
8370
  const buttonLoadLocalNew = Util.clearListeners(buttonLoadLocal);
8271
8371
  buttonLoadLocalNew === null || buttonLoadLocalNew === void 0 ? void 0 : buttonLoadLocalNew.addEventListener('click', async () => {
8272
8372
  console.log('load-local');
8273
8373
  divElement.querySelector('#fileInput').click();
8274
8374
  });
8375
+ const fileInput = divElement.querySelector('#fileInput');
8376
+ fileInput.value = '';
8377
+ const fileInputNew = Util.clearListeners(fileInput);
8378
+ fileInputNew.addEventListener('change', (e) => {
8379
+ var fr = new FileReader();
8380
+ fr.onload = () => {
8381
+ this.renderTaggingTable(divElement, sourceArray, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
8382
+ };
8383
+ var frCsv = new FileReader();
8384
+ frCsv.onload = () => {
8385
+ console.log('taggingarray onload called');
8386
+ console.log('csv result', frCsv.result);
8387
+ const tempArr = Util.parseCsv(frCsv.result + "");
8388
+ console.log('csv data', tempArr);
8389
+ let changeCount = 0;
8390
+ for (let [i, obj] of tempArr.entries()) {
8391
+ if (JSON.stringify(taggingArray.data.mappings.mappings[i]) !== JSON.stringify(obj)) {
8392
+ console.log('item changed', taggingArray.data.mappings.mappings[i], obj);
8393
+ this.changedOnboardingItemIds.push(taggingArray.data.mappings.mappings[i].id);
8394
+ changeCount++;
8395
+ }
8396
+ }
8397
+ this.setSuccessBtn(changeCount + " items changed. Do you wish to apply?", ["No", "Yes"], [
8398
+ () => {
8399
+ this.clearMessages();
8400
+ this.changedOnboardingItemIds = [];
8401
+ buttonToggleMoreBack.click();
8402
+ },
8403
+ () => {
8404
+ this.clearMessages();
8405
+ let tempObj = {};
8406
+ tempObj["data"] = {};
8407
+ // let mappingsObj:any = {}
8408
+ // mappingsObj.mappings = tempArr
8409
+ // console.log('csv mappingsobj', mappingsObj)
8410
+ tempObj["data"]["mappings"] = {};
8411
+ tempObj["data"]["mappings"]["mappings"] = tempArr;
8412
+ // for(let tempItem of tempArr){
8413
+ // tempObj["data"]["mappings"]["mappings"].push(tempItem)
8414
+ // }
8415
+ // tempObj.data.mappings.mappings.push("pqrs")
8416
+ let tempObjStr = JSON.stringify(tempObj);
8417
+ // console.log('csv taggingarray tempobj', tempObj, tempObjStr, tempObj.data.mappings.mappings[0])
8418
+ console.log('csv taggingarray cols', uniqCols, tempObjStr, Object.keys(tempObj.data.mappings.mappings[0]));
8419
+ this.renderTaggingTable(divElement, sourceArray, JSON.parse(tempObjStr), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
8420
+ }
8421
+ ]);
8422
+ // let tempObj:any = {"data":{"mappings":{"mappings":tempArr}}}
8423
+ // let tempObj:{data:{mappings:{mappings:any[]}}} = {data:{mappings:{mappings:tempArr}}}
8424
+ };
8425
+ if (e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
8426
+ let ext = e.target.files[0].name.split('.')[e.target.files[0].name.split('.').length - 1];
8427
+ if (ext.toLowerCase() == "csv") {
8428
+ frCsv.readAsText(e.target.files[0]);
8429
+ }
8430
+ else {
8431
+ fr.readAsText(e.target.files[0]);
8432
+ }
8433
+ }
8434
+ });
8275
8435
  const buttonSaveLocalNew = Util.clearListeners(buttonSaveLocal);
8276
8436
  buttonSaveLocalNew === null || buttonSaveLocalNew === void 0 ? void 0 : buttonSaveLocalNew.addEventListener('click', async () => {
8277
8437
  console.log('save-local');
@@ -8306,16 +8466,6 @@ let SfIEvents = class SfIEvents extends LitElement {
8306
8466
  // console.log('load-local');
8307
8467
  // ((divElement as HTMLDivElement).querySelector('#fileInput') as HTMLInputElement).click();
8308
8468
  // });
8309
- const fileInput = divElement.querySelector('#fileInput');
8310
- fileInput.addEventListener('change', (e) => {
8311
- var fr = new FileReader();
8312
- fr.onload = () => {
8313
- this.renderTaggingTable(divElement, sourceArray, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols, apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
8314
- };
8315
- if (e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
8316
- fr.readAsText(e.target.files[0]);
8317
- }
8318
- });
8319
8469
  // const buttonSaveLocal = (divElement as HTMLDivElement).querySelector('.button-local-save') as HTMLButtonElement;
8320
8470
  // buttonSaveLocal?.addEventListener('click', async () => {
8321
8471
  // console.log('save-local');
@@ -8366,6 +8516,7 @@ let SfIEvents = class SfIEvents extends LitElement {
8366
8516
  //(divElement as HTMLDivElement).querySelector("#span-extra-filled")!.innerHTML = "Fields: " + filledFields + "/" + totalFields + " completed";
8367
8517
  //console.log('Total fields = ' + totalFields + ', filled fields = ' + filledFields);
8368
8518
  }
8519
+ this.changedOnboardingItemIds = [];
8369
8520
  };
8370
8521
  this.renderMappingTable = (divElement, jsonData, cursor, fetchFunction, searchString, mappedArray, found, uploadFunction, refreshFunction, extraFields, uploadBlock, extraFieldPosition, colName, subfilter, statuteColName, extraHintsArr) => {
8371
8522
  var _a, _b, _c, _f;
@@ -16006,6 +16157,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16006
16157
  </div>
16007
16158
  <div class="div-row-success div-row-submit gone">
16008
16159
  <div part="successmsg" class="div-row-success-message"></div>
16160
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16009
16161
  </div>
16010
16162
  </div>
16011
16163
  <div class="rb"></div>
@@ -16056,6 +16208,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16056
16208
  </div>
16057
16209
  <div class="div-row-success div-row-submit gone">
16058
16210
  <div part="successmsg" class="div-row-success-message"></div>
16211
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16059
16212
  </div>
16060
16213
  </div>
16061
16214
  <div class="rb"></div>
@@ -16164,6 +16317,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16164
16317
  </div>
16165
16318
  <div class="div-row-success div-row-submit gone">
16166
16319
  <div part="successmsg" class="div-row-success-message"></div>
16320
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16167
16321
  </div>
16168
16322
  </div>
16169
16323
  <div class="rb"></div>
@@ -16279,6 +16433,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16279
16433
  </div>
16280
16434
  <div class="div-row-success div-row-submit gone">
16281
16435
  <div part="successmsg" class="div-row-success-message"></div>
16436
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16282
16437
  </div>
16283
16438
  </div>
16284
16439
  <div class="rb"></div>
@@ -16325,6 +16480,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16325
16480
  </div>
16326
16481
  <div class="div-row-success div-row-submit">
16327
16482
  <div part="successmsg" class="div-row-success-message"></div>
16483
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16328
16484
  </div>
16329
16485
  <div class="div-row-notif div-row-submit">
16330
16486
  <div part="notifmsg" class="div-row-notif-message"></div>
@@ -16364,6 +16520,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16364
16520
  </div>
16365
16521
  <div class="div-row-success div-row-submit gone">
16366
16522
  <div part="successmsg" class="div-row-success-message"></div>
16523
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16367
16524
  </div>
16368
16525
  </div>
16369
16526
  <div class="rb"></div>
@@ -16392,6 +16549,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16392
16549
  </div>
16393
16550
  <div class="div-row-success div-row-submit gone">
16394
16551
  <div part="successmsg" class="div-row-success-message"></div>
16552
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16395
16553
  </div>
16396
16554
  </div>
16397
16555
  <div class="rb"></div>
@@ -16460,6 +16618,7 @@ let SfIEvents = class SfIEvents extends LitElement {
16460
16618
  </div>
16461
16619
  <div class="div-row-success div-row-submit gone">
16462
16620
  <div part="successmsg" class="div-row-success-message"></div>
16621
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
16463
16622
  </div>
16464
16623
  </div>
16465
16624
  <div class="rb"></div>
@@ -16711,9 +16870,16 @@ SfIEvents.styles = css `
16711
16870
  background-color: #e9e9e9;
16712
16871
  }
16713
16872
 
16873
+ .td-dark-selected {
16874
+ background-color: #e3e0c8;
16875
+ }
16876
+
16714
16877
  .td-light {
16715
16878
  background-color: #f6f6f6;
16716
16879
  }
16880
+ .td-light-selected {
16881
+ background-color: #f5f2d9;
16882
+ }
16717
16883
 
16718
16884
  .invisible {
16719
16885
  visibility: hidden;
@@ -17391,6 +17557,7 @@ SfIEvents.styles = css `
17391
17557
 
17392
17558
  .div-row-success {
17393
17559
  display: flex;
17560
+ flex-direction: column;
17394
17561
  justify-content: center;
17395
17562
  position: fixed;
17396
17563
  top: 0px;
@@ -17398,7 +17565,7 @@ SfIEvents.styles = css `
17398
17565
  margin-top: 20px;
17399
17566
  margin-right: 20px;
17400
17567
  display: none;
17401
- align-items:center;
17568
+ align-items:stretch;
17402
17569
  background-color: white;
17403
17570
  border: dashed 1px green;
17404
17571
  padding: 20px;
@@ -17412,6 +17579,14 @@ SfIEvents.styles = css `
17412
17579
  text-align: center;
17413
17580
  }
17414
17581
 
17582
+ .div-row-success-message-btn-container {
17583
+ background-color: white;
17584
+ display: flex;
17585
+ flex-direction: row;
17586
+ justify-content: end;
17587
+ align-items: center;
17588
+ }
17589
+
17415
17590
  .d-flex {
17416
17591
  display: flex;
17417
17592
  }
@@ -17478,6 +17653,13 @@ SfIEvents.styles = css `
17478
17653
  }
17479
17654
 
17480
17655
  }
17656
+
17657
+ #button-refresh {
17658
+ display: none;
17659
+ position: fixed;
17660
+ bottom: 10px;
17661
+ right: 10px
17662
+ }
17481
17663
 
17482
17664
 
17483
17665
  `;
@@ -17913,6 +18095,9 @@ __decorate([
17913
18095
  __decorate([
17914
18096
  query('.div-row-success-message')
17915
18097
  ], SfIEvents.prototype, "_SfRowSuccessMessage", void 0);
18098
+ __decorate([
18099
+ query('.div-row-success-message-btn-container')
18100
+ ], SfIEvents.prototype, "_SfRowSuccessMessageBtnContainer", void 0);
17916
18101
  __decorate([
17917
18102
  query('.loader-element')
17918
18103
  ], SfIEvents.prototype, "_SfLoader", void 0);
@@ -1588,6 +1588,8 @@ export class SfIEvents extends LitElement {
1588
1588
 
1589
1589
  edate: string = "";
1590
1590
 
1591
+ changedOnboardingItemIds: string[] = []
1592
+
1591
1593
  static override styles = css`
1592
1594
 
1593
1595
  .bg-white {
@@ -1829,9 +1831,16 @@ export class SfIEvents extends LitElement {
1829
1831
  background-color: #e9e9e9;
1830
1832
  }
1831
1833
 
1834
+ .td-dark-selected {
1835
+ background-color: #e3e0c8;
1836
+ }
1837
+
1832
1838
  .td-light {
1833
1839
  background-color: #f6f6f6;
1834
1840
  }
1841
+ .td-light-selected {
1842
+ background-color: #f5f2d9;
1843
+ }
1835
1844
 
1836
1845
  .invisible {
1837
1846
  visibility: hidden;
@@ -2509,6 +2518,7 @@ export class SfIEvents extends LitElement {
2509
2518
 
2510
2519
  .div-row-success {
2511
2520
  display: flex;
2521
+ flex-direction: column;
2512
2522
  justify-content: center;
2513
2523
  position: fixed;
2514
2524
  top: 0px;
@@ -2516,7 +2526,7 @@ export class SfIEvents extends LitElement {
2516
2526
  margin-top: 20px;
2517
2527
  margin-right: 20px;
2518
2528
  display: none;
2519
- align-items:center;
2529
+ align-items:stretch;
2520
2530
  background-color: white;
2521
2531
  border: dashed 1px green;
2522
2532
  padding: 20px;
@@ -2530,6 +2540,14 @@ export class SfIEvents extends LitElement {
2530
2540
  text-align: center;
2531
2541
  }
2532
2542
 
2543
+ .div-row-success-message-btn-container {
2544
+ background-color: white;
2545
+ display: flex;
2546
+ flex-direction: row;
2547
+ justify-content: end;
2548
+ align-items: center;
2549
+ }
2550
+
2533
2551
  .d-flex {
2534
2552
  display: flex;
2535
2553
  }
@@ -2596,6 +2614,13 @@ export class SfIEvents extends LitElement {
2596
2614
  }
2597
2615
 
2598
2616
  }
2617
+
2618
+ #button-refresh {
2619
+ display: none;
2620
+ position: fixed;
2621
+ bottom: 10px;
2622
+ right: 10px
2623
+ }
2599
2624
 
2600
2625
 
2601
2626
  `;
@@ -2615,6 +2640,9 @@ export class SfIEvents extends LitElement {
2615
2640
  @query('.div-row-success-message')
2616
2641
  _SfRowSuccessMessage: any;
2617
2642
 
2643
+ @query('.div-row-success-message-btn-container')
2644
+ _SfRowSuccessMessageBtnContainer: any;
2645
+
2618
2646
  @query('.loader-element')
2619
2647
  _SfLoader: any;
2620
2648
 
@@ -3172,6 +3200,7 @@ export class SfIEvents extends LitElement {
3172
3200
  this._SfRowErrorMessage.innerHTML = '';
3173
3201
  this._SfRowSuccess.style.display = 'none';
3174
3202
  this._SfRowSuccessMessage.innerHTML = '';
3203
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
3175
3204
  }
3176
3205
 
3177
3206
  setError = (msg: string) => {
@@ -3179,6 +3208,7 @@ export class SfIEvents extends LitElement {
3179
3208
  this._SfRowErrorMessage.innerHTML = msg;
3180
3209
  this._SfRowSuccess.style.display = 'none';
3181
3210
  this._SfRowSuccessMessage.innerHTML = '';
3211
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
3182
3212
  }
3183
3213
 
3184
3214
  setSuccess = (msg: string) => {
@@ -3186,6 +3216,23 @@ export class SfIEvents extends LitElement {
3186
3216
  this._SfRowErrorMessage.innerHTML = '';
3187
3217
  this._SfRowSuccess.style.display = 'flex';
3188
3218
  this._SfRowSuccessMessage.innerHTML = msg;
3219
+ this._SfRowSuccessMessageBtnContainer.innerHTML = '';
3220
+ }
3221
+
3222
+ setSuccessBtn = (msg: string, btnCaptions:string[], btnCallbacks:Function[]) => {
3223
+ this._SfRowError.style.display = 'none';
3224
+ this._SfRowErrorMessage.innerHTML = '';
3225
+ this._SfRowSuccess.style.display = 'flex';
3226
+ this._SfRowSuccessMessage.innerHTML = msg;
3227
+ let btnHtml = ''
3228
+ for(let [i, caption] of btnCaptions.entries()){
3229
+ btnHtml += '<button part="successmsgbtn" id="successbtn-' + i + '" class="d-flex align-center mt-10' + ((i > 0) ? ' ml-10' : '' )+'">' + caption + '</button>'
3230
+ }
3231
+ this._SfRowSuccessMessageBtnContainer.innerHTML = btnHtml
3232
+ for(let [i, callback] of btnCallbacks.entries()){
3233
+ let btn = this._SfRowSuccessMessageBtnContainer.querySelector('#successbtn-' + i) as HTMLButtonElement
3234
+ btn.addEventListener('click',() => {callback()})
3235
+ }
3189
3236
  }
3190
3237
 
3191
3238
  getLastDayOfLastMonth = (month: number, year: number) => {
@@ -4108,7 +4155,7 @@ export class SfIEvents extends LitElement {
4108
4155
  var html = '';
4109
4156
 
4110
4157
  html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
4111
- html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title">' + parametersTitle + '</h4></div>';
4158
+ html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title">' + parametersTitle + '</h4><button id="button-refresh" part="button-duration-title" class="align-center d-flex justify-center"><h4 part="duration-title">' + parametersTitle + '</h4><span part="duration-title-icon" class="material-icons ml-10">refresh</span></button></div>';
4112
4159
  if(showGraph) {
4113
4160
  html += '<div part="stream-event-chart-selection" class="mb-20">';
4114
4161
  html += '<div part="td-head" class="mb-5">Select Chart</div>';
@@ -4623,7 +4670,6 @@ export class SfIEvents extends LitElement {
4623
4670
  this.clearSelectedGraphParam();
4624
4671
  this.clearSelectedLegend();
4625
4672
 
4626
-
4627
4673
  html += this.renderCalendarGraphs(showGraph, parametersTitle);
4628
4674
  html += this.renderCalendarContainerDivStart(index)
4629
4675
  html += this.renderCalendarEventSummary();
@@ -4924,7 +4970,7 @@ export class SfIEvents extends LitElement {
4924
4970
  var html = this.renderEvents(firstDay, endDay, 1, lastDay, true, 0, (firstDate.getMonth()), period, firstDate,"From " + firstDay.toLocaleDateString('en-IN') + " To " + endDay.toLocaleDateString('en-IN'));
4925
4971
 
4926
4972
  eventsContainer.querySelector('.calendar-right-data')!.innerHTML = html;
4927
-
4973
+ this.renderButtonRefresh(eventsContainer);
4928
4974
  this.attachTimelineFilterHandlers(eventsContainer);
4929
4975
 
4930
4976
  const radioExpander = eventsContainer.querySelector('#graph-radios-expander') as HTMLButtonElement;
@@ -4940,7 +4986,10 @@ export class SfIEvents extends LitElement {
4940
4986
 
4941
4987
 
4942
4988
  });
4943
-
4989
+ const buttonRefresh = eventsContainer.querySelector('#button-refresh') as HTMLButtonElement
4990
+ buttonRefresh.addEventListener('click',async ()=>{
4991
+ this.processDateSelection(eventsContainer)
4992
+ })
4944
4993
  const buttonArr = eventsContainer.querySelectorAll('.button-expand') as NodeListOf<HTMLButtonElement>;
4945
4994
 
4946
4995
  for(var i = 0; i < buttonArr.length; i++) {
@@ -7978,7 +8027,7 @@ export class SfIEvents extends LitElement {
7978
8027
  html += '</div>';
7979
8028
 
7980
8029
  (this._SfThisContainer as HTMLDivElement).innerHTML = html;
7981
-
8030
+ this.renderButtonRefresh((this._SfThisContainer as HTMLDivElement));
7982
8031
  const radioExpander = (this._SfThisContainer as HTMLDivElement).querySelector('#graph-radios-expander') as HTMLButtonElement;
7983
8032
  radioExpander?.addEventListener('click', (e: any) => {
7984
8033
 
@@ -8112,7 +8161,7 @@ export class SfIEvents extends LitElement {
8112
8161
  // (buttonStatusMore as HTMLButtonElement).style.display = 'none';
8113
8162
 
8114
8163
  // });
8115
-
8164
+
8116
8165
  for(var i = 0; i < 3; i++) {
8117
8166
  (this._SfThisContainer as HTMLDivElement).querySelector('#stream-month-' + i)?.addEventListener('click', async (ev: any)=> {
8118
8167
  const target = parseInt((ev.target as HTMLDivElement).id.split('-')[2]);
@@ -8134,7 +8183,14 @@ export class SfIEvents extends LitElement {
8134
8183
  this.renderThis(target);
8135
8184
  })
8136
8185
  }
8137
-
8186
+ const buttonRefresh = (this._SfThisContainer as HTMLDivElement).querySelector('#button-refresh') as HTMLButtonElement
8187
+ buttonRefresh.addEventListener('click', async ()=>{
8188
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
8189
+ this.currentColumnIndex = index + "";
8190
+ const dateResult = this.calculateStartAndEndDateOfThis(index);
8191
+ await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate);
8192
+ this.renderThis(index);
8193
+ })
8138
8194
  const buttonArr = (this._SfThisContainer as HTMLDivElement).querySelectorAll('.button-expand') as NodeListOf<HTMLButtonElement>;
8139
8195
 
8140
8196
  for(i = 0; i < buttonArr.length; i++) {
@@ -8282,6 +8338,26 @@ export class SfIEvents extends LitElement {
8282
8338
 
8283
8339
  }
8284
8340
 
8341
+ renderButtonRefresh = (eventsContainer: HTMLDivElement) => {
8342
+ document.addEventListener('scroll',() => {
8343
+ console.log('scroll',window.scrollY)
8344
+ let buttonRefresh = eventsContainer.querySelector('#button-refresh') as HTMLButtonElement
8345
+ if(window.scrollY > 720){
8346
+ if(buttonRefresh.style.display == "flex"){
8347
+
8348
+ }else{
8349
+ buttonRefresh.style.display = 'flex'
8350
+ }
8351
+ }else{
8352
+ if(buttonRefresh.style.display == "none"){
8353
+
8354
+ }else{
8355
+ buttonRefresh.style.display = 'none'
8356
+ }
8357
+ }
8358
+ })
8359
+ }
8360
+
8285
8361
  renderStream = (index: number = 0, showGraph: boolean = true) => {
8286
8362
  //console.log('flowgraph renderStream', this.flowGraph);
8287
8363
 
@@ -8349,7 +8425,7 @@ export class SfIEvents extends LitElement {
8349
8425
  html += '</div>';
8350
8426
 
8351
8427
  (this._SfStreamContainer as HTMLDivElement).innerHTML = html;
8352
-
8428
+ this.renderButtonRefresh((this._SfStreamContainer as HTMLDivElement));
8353
8429
  this.attachTimelineFilterHandlers((this._SfStreamContainer as HTMLDivElement));
8354
8430
 
8355
8431
  const radioExpander = (this._SfStreamContainer as HTMLDivElement).querySelector('#graph-radios-expander') as HTMLButtonElement;
@@ -8507,7 +8583,19 @@ export class SfIEvents extends LitElement {
8507
8583
 
8508
8584
  })
8509
8585
  }
8510
-
8586
+ const buttonRefresh = (this._SfStreamContainer as HTMLDivElement).querySelector('#button-refresh') as HTMLButtonElement
8587
+ buttonRefresh?.addEventListener('click', async ()=>{
8588
+ const dateResult = this.calculateStartAndEndDateOfStream(index);
8589
+ const monthResult = this.calculateMonthFromIndex(index);
8590
+ console.log('monthResult', monthResult);
8591
+ console.log('dateresult', dateResult);
8592
+ this.currentColumnIndex = index + "";
8593
+ if(dateResult != null) {
8594
+ await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate,"","yes",("0" + monthResult).slice(-2));
8595
+ }
8596
+ this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
8597
+ this.renderStream(index);
8598
+ })
8511
8599
  const buttonArr = (this._SfStreamContainer as HTMLDivElement).querySelectorAll('.button-expand') as NodeListOf<HTMLButtonElement>;
8512
8600
 
8513
8601
  for(i = 0; i < buttonArr.length; i++) {
@@ -11199,6 +11287,9 @@ export class SfIEvents extends LitElement {
11199
11287
  if(sourceArray.data.mappings.mappings[j] != null && taggingArray.data.mappings.mappings[i] != null) {
11200
11288
  if(sourceArray.data.mappings.mappings[j][uniqCols[k]] != taggingArray.data.mappings.mappings[i][uniqCols[k]]) {
11201
11289
  equal = false;
11290
+ // if(taggingArray.data.mappings.mappings.length > 0){
11291
+ // console.log('taggingarray col not found', uniqCols[k], taggingArray.data.mappings.mappings[i])
11292
+ // }
11202
11293
  }
11203
11294
  }
11204
11295
 
@@ -11223,7 +11314,6 @@ export class SfIEvents extends LitElement {
11223
11314
  }
11224
11315
 
11225
11316
  taggingArray.data.mappings.mappings = foundArr;
11226
-
11227
11317
  let mandatoryPresent = true;
11228
11318
 
11229
11319
  for(i = 0; i < (mandatoryFields as Array<string>).length; i++) {
@@ -11519,9 +11609,17 @@ export class SfIEvents extends LitElement {
11519
11609
  var classBg = "";
11520
11610
 
11521
11611
  if(i%2 === 0) {
11522
- classBg = 'td-light';
11612
+ if(this.changedOnboardingItemIds.length > 0 && this.changedOnboardingItemIds.indexOf(taggingArray.data.mappings.mappings[i].id) >= 0 ){
11613
+ classBg = 'td-light-selected';
11614
+ }else{
11615
+ classBg = 'td-light';
11616
+ }
11523
11617
  } else {
11524
- classBg = 'td-dark';
11618
+ if(this.changedOnboardingItemIds.length > 0 && this.changedOnboardingItemIds.indexOf(taggingArray.data.mappings.mappings[i].id) >= 0 ){
11619
+ classBg = 'td-dark-selected';
11620
+ }else{
11621
+ classBg = 'td-dark';
11622
+ }
11525
11623
  }
11526
11624
 
11527
11625
  html += '<tr class="" id="tablerow-'+i+'">';
@@ -12099,8 +12197,28 @@ export class SfIEvents extends LitElement {
12099
12197
 
12100
12198
  const buttonExportMappingCSVNew = Util.clearListeners(buttonExportMappingCSV);
12101
12199
  buttonExportMappingCSVNew?.addEventListener('click', async () => {
12102
- let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
12200
+ let csvArray = JSON.parse(JSON.stringify(taggingArray.data.mappings.mappings))
12201
+ for(let [i, obj] of csvArray.entries()){
12202
+ let tempCsvObj = obj
12203
+ if(obj['cols'] != null && obj['data'] != null){
12204
+ let dataArr = JSON.parse(obj['data'])
12205
+ let colsArr = JSON.parse(obj['cols'])
12206
+ for(let [j, colKey] of colsArr.entries()){
12207
+ tempCsvObj['cols_' + colKey] = dataArr[j]
12208
+ }
12209
+ }
12210
+ csvArray[i] = tempCsvObj
12211
+ }
12212
+ console.log('csv array', csvArray)
12213
+ let csvData = Util.convertToCSV(csvArray);
12214
+ // let csvData = Util.convertToCSV(taggingArray.data.mappings.mappings);
12103
12215
  console.log('csvData', csvData);
12216
+ const blob = new Blob([csvData], { type: 'text/csv;charset=utf-8;'});
12217
+ const url = window.URL.createObjectURL(blob)
12218
+ const a = document.createElement('a')
12219
+ a.setAttribute('href', url)
12220
+ a.setAttribute('download', 'mapping_'+colName+'_'+new Date().getTime()+'.csv');
12221
+ a.click()
12104
12222
  })
12105
12223
 
12106
12224
  const buttonLoadLocalNew = Util.clearListeners(buttonLoadLocal);
@@ -12109,6 +12227,70 @@ export class SfIEvents extends LitElement {
12109
12227
  ((divElement as HTMLDivElement).querySelector('#fileInput') as HTMLInputElement).click();
12110
12228
  });
12111
12229
 
12230
+ const fileInput = (divElement as HTMLDivElement).querySelector('#fileInput') as HTMLButtonElement;
12231
+ fileInput.value = '';
12232
+ const fileInputNew = Util.clearListeners(fileInput);
12233
+ fileInputNew.addEventListener('change', (e: any) => {
12234
+ var fr=new FileReader();
12235
+ fr.onload = () => {
12236
+ this.renderTaggingTable(divElement, sourceArray, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols,apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
12237
+ };
12238
+ var frCsv = new FileReader();
12239
+ frCsv.onload = () => {
12240
+ console.log('taggingarray onload called');
12241
+ console.log('csv result', frCsv.result);
12242
+ const tempArr = Util.parseCsv(frCsv.result + "");
12243
+ console.log('csv data', tempArr)
12244
+ let changeCount = 0;
12245
+ for(let [i,obj] of tempArr.entries()){
12246
+ if(JSON.stringify(taggingArray.data.mappings.mappings[i]) !== JSON.stringify(obj)){
12247
+ console.log('item changed', taggingArray.data.mappings.mappings[i], obj)
12248
+ this.changedOnboardingItemIds.push(taggingArray.data.mappings.mappings[i].id)
12249
+ changeCount++
12250
+ }
12251
+ }
12252
+ this.setSuccessBtn( changeCount + " items changed. Do you wish to apply?",["No","Yes"],[
12253
+ ()=>{
12254
+ this.clearMessages();
12255
+ this.changedOnboardingItemIds = [];
12256
+ (buttonToggleMoreBack as HTMLButtonElement).click();
12257
+ },
12258
+ ()=>{
12259
+ this.clearMessages();
12260
+ let tempObj:any = {}
12261
+ tempObj["data"] = {}
12262
+ // let mappingsObj:any = {}
12263
+ // mappingsObj.mappings = tempArr
12264
+ // console.log('csv mappingsobj', mappingsObj)
12265
+ tempObj["data"]["mappings"] = {}
12266
+ tempObj["data"]["mappings"]["mappings"] = tempArr
12267
+ // for(let tempItem of tempArr){
12268
+ // tempObj["data"]["mappings"]["mappings"].push(tempItem)
12269
+ // }
12270
+ // tempObj.data.mappings.mappings.push("pqrs")
12271
+ let tempObjStr = JSON.stringify(tempObj)
12272
+
12273
+ // console.log('csv taggingarray tempobj', tempObj, tempObjStr, tempObj.data.mappings.mappings[0])
12274
+ console.log('csv taggingarray cols', uniqCols, tempObjStr, Object.keys(tempObj.data.mappings.mappings[0]))
12275
+
12276
+ this.renderTaggingTable(divElement, sourceArray, JSON.parse(tempObjStr), sourceCols, uploadFunction, refreshFunction, colName, uniqCols,apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
12277
+ }
12278
+ ])
12279
+ // let tempObj:any = {"data":{"mappings":{"mappings":tempArr}}}
12280
+ // let tempObj:{data:{mappings:{mappings:any[]}}} = {data:{mappings:{mappings:tempArr}}}
12281
+
12282
+
12283
+ }
12284
+ if(e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
12285
+ let ext = e.target.files[0].name.split('.')[e.target.files[0].name.split('.').length - 1]
12286
+ if(ext.toLowerCase() == "csv"){
12287
+ frCsv.readAsText(e.target.files[0]);
12288
+ }else{
12289
+ fr.readAsText(e.target.files[0]);
12290
+ }
12291
+ }
12292
+ })
12293
+
12112
12294
  const buttonSaveLocalNew = Util.clearListeners(buttonSaveLocal);
12113
12295
  buttonSaveLocalNew?.addEventListener('click', async () => {
12114
12296
  console.log('save-local');
@@ -12149,17 +12331,7 @@ export class SfIEvents extends LitElement {
12149
12331
  // ((divElement as HTMLDivElement).querySelector('#fileInput') as HTMLInputElement).click();
12150
12332
  // });
12151
12333
 
12152
- const fileInput = (divElement as HTMLDivElement).querySelector('#fileInput') as HTMLButtonElement;
12153
- fileInput.addEventListener('change', (e: any) => {
12154
- var fr=new FileReader();
12155
- fr.onload = () => {
12156
-
12157
- this.renderTaggingTable(divElement, sourceArray, JSON.parse(fr.result + ""), sourceCols, uploadFunction, refreshFunction, colName, uniqCols,apiIdDropdown, dropdownSearchPhrase, mandatoryFields, jobs, anotherProjection, extraFields, _arrFeedbackReference, proposedUsersLabel, subfilter);
12158
- };
12159
- if(e.target.files[0].name.toLowerCase().indexOf(colName.toLowerCase()) >= 0) {
12160
- fr.readAsText(e.target.files[0]);
12161
- }
12162
- })
12334
+
12163
12335
 
12164
12336
 
12165
12337
  // const buttonSaveLocal = (divElement as HTMLDivElement).querySelector('.button-local-save') as HTMLButtonElement;
@@ -12216,7 +12388,7 @@ export class SfIEvents extends LitElement {
12216
12388
  //(divElement as HTMLDivElement).querySelector("#span-extra-filled")!.innerHTML = "Fields: " + filledFields + "/" + totalFields + " completed";
12217
12389
  //console.log('Total fields = ' + totalFields + ', filled fields = ' + filledFields);
12218
12390
  }
12219
-
12391
+ this.changedOnboardingItemIds = []
12220
12392
  }
12221
12393
 
12222
12394
  renderMappingTable = (divElement: any, jsonData: Array<any>, cursor: Array<any>, fetchFunction: any, searchString: string, mappedArray: any, found: number, uploadFunction: any, refreshFunction: any, extraFields: Array<string>, uploadBlock: number, extraFieldPosition: number, colName: string, subfilter: string, statuteColName: string, extraHintsArr: Array<string>) => {
@@ -21952,6 +22124,7 @@ export class SfIEvents extends LitElement {
21952
22124
  </div>
21953
22125
  <div class="div-row-success div-row-submit gone">
21954
22126
  <div part="successmsg" class="div-row-success-message"></div>
22127
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
21955
22128
  </div>
21956
22129
  </div>
21957
22130
  <div class="rb"></div>
@@ -22003,6 +22176,7 @@ export class SfIEvents extends LitElement {
22003
22176
  </div>
22004
22177
  <div class="div-row-success div-row-submit gone">
22005
22178
  <div part="successmsg" class="div-row-success-message"></div>
22179
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22006
22180
  </div>
22007
22181
  </div>
22008
22182
  <div class="rb"></div>
@@ -22112,6 +22286,7 @@ export class SfIEvents extends LitElement {
22112
22286
  </div>
22113
22287
  <div class="div-row-success div-row-submit gone">
22114
22288
  <div part="successmsg" class="div-row-success-message"></div>
22289
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22115
22290
  </div>
22116
22291
  </div>
22117
22292
  <div class="rb"></div>
@@ -22229,6 +22404,7 @@ export class SfIEvents extends LitElement {
22229
22404
  </div>
22230
22405
  <div class="div-row-success div-row-submit gone">
22231
22406
  <div part="successmsg" class="div-row-success-message"></div>
22407
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22232
22408
  </div>
22233
22409
  </div>
22234
22410
  <div class="rb"></div>
@@ -22276,6 +22452,7 @@ export class SfIEvents extends LitElement {
22276
22452
  </div>
22277
22453
  <div class="div-row-success div-row-submit">
22278
22454
  <div part="successmsg" class="div-row-success-message"></div>
22455
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22279
22456
  </div>
22280
22457
  <div class="div-row-notif div-row-submit">
22281
22458
  <div part="notifmsg" class="div-row-notif-message"></div>
@@ -22316,6 +22493,7 @@ export class SfIEvents extends LitElement {
22316
22493
  </div>
22317
22494
  <div class="div-row-success div-row-submit gone">
22318
22495
  <div part="successmsg" class="div-row-success-message"></div>
22496
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22319
22497
  </div>
22320
22498
  </div>
22321
22499
  <div class="rb"></div>
@@ -22344,6 +22522,7 @@ export class SfIEvents extends LitElement {
22344
22522
  </div>
22345
22523
  <div class="div-row-success div-row-submit gone">
22346
22524
  <div part="successmsg" class="div-row-success-message"></div>
22525
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22347
22526
  </div>
22348
22527
  </div>
22349
22528
  <div class="rb"></div>
@@ -22412,6 +22591,7 @@ export class SfIEvents extends LitElement {
22412
22591
  </div>
22413
22592
  <div class="div-row-success div-row-submit gone">
22414
22593
  <div part="successmsg" class="div-row-success-message"></div>
22594
+ <div part="successmsgbtncontainer" class="div-row-success-message-btn-container"></div>
22415
22595
  </div>
22416
22596
  </div>
22417
22597
  <div class="rb"></div>
package/src/util.ts CHANGED
@@ -382,15 +382,53 @@ function jsonObjectToHtml(json: any) {
382
382
 
383
383
  function convertToCSV(arr:any[]) {
384
384
  const array = [Object.keys(arr[0])].concat(arr)
385
-
386
- return array.map(it => {
387
- console.log('csv it', it);
388
- return Object.values(it).toString()
385
+ return array.map((it, index) => {
386
+ let strIt = ""
387
+ for(let [i,objkey] of Object.keys(it).entries()){
388
+ if(index == 0){
389
+ strIt += "\"" + it[objkey as any].replace(/"/g,"\"\"") + "\""
390
+ }else{
391
+ strIt += "\"" + JSON.stringify(it[objkey as any]).replace(/"/g,"\"\"") + "\""
392
+ }
393
+ if(i < (Object.keys(it).length - 1)){
394
+ strIt += ","
395
+ }
396
+ }
397
+ return strIt
389
398
  }).join('\n')
390
399
  }
391
400
 
401
+ function parseCsv(csv:string){
402
+ const re = /(,|\r?\n|\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^,\r\n]*))/gi
403
+ const result:any = [[]]
404
+ let matches:any;
405
+ while ((matches = re.exec(csv))) {
406
+ if (matches[1].length && matches[1] !== ',') result.push([])
407
+ result[result.length - 1].push(
408
+ matches[2] !== undefined ? matches[2].replace(/""/g, '"') : matches[3]
409
+ )
410
+ }
411
+ console.log('csv arr result', result, result.length);
412
+ let csvResult = arrayToObject(result)
413
+ return csvResult
414
+ }
415
+ function arrayToObject (csvArray:any) {
416
+
417
+ //Take the first line (headers) from the array and remove it from the array.
418
+ const headers = csvArray.shift()
419
+
420
+ // Iterate through the rows and reduce each column to an object
421
+
422
+ return csvArray.filter((row:any)=>{
423
+ console.log('csv object keys lngth', Object.keys(row).length)
424
+ return Object.keys(row).length > 1
425
+ }).map((row: { [x: string]: any; } ) =>{
426
+ return headers.reduce((acc: any, currentHeader: any, i: string | number) => ((currentHeader.indexOf('cols_') >= 0 || currentHeader == '') ? acc : ((row[i] != '' && row[i] != null) ? { ...acc, ...{ [currentHeader]: JSON.parse(row[i] == "TRUE" ? "true" : row[i])}} : acc)), {})
427
+ })
428
+ }
429
+
392
430
  const exportFunctions = {
393
- callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV
431
+ callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv
394
432
  };
395
433
 
396
434
  export default exportFunctions;
package/util.d.ts CHANGED
@@ -11,6 +11,7 @@ declare function isInteger(value: string): boolean;
11
11
  declare function clearListeners(old_element: HTMLElement): Node;
12
12
  declare function jsonObjectToHtml(json: any): string;
13
13
  declare function convertToCSV(arr: any[]): string;
14
+ declare function parseCsv(csv: string): any;
14
15
  declare const exportFunctions: {
15
16
  callApiPresignedDelete: typeof callApiPresignedDelete;
16
17
  callApiPresignedGet: typeof callApiPresignedGet;
@@ -27,6 +28,7 @@ declare const exportFunctions: {
27
28
  createDiagonalPattern3: typeof createDiagonalPattern3;
28
29
  getRandomColor: typeof getRandomColor;
29
30
  convertToCSV: typeof convertToCSV;
31
+ parseCsv: typeof parseCsv;
30
32
  };
31
33
  export default exportFunctions;
32
34
  //# sourceMappingURL=util.d.ts.map
package/util.js CHANGED
@@ -316,13 +316,48 @@ function jsonObjectToHtml(json) {
316
316
  }
317
317
  function convertToCSV(arr) {
318
318
  const array = [Object.keys(arr[0])].concat(arr);
319
- return array.map(it => {
320
- console.log('csv it', it);
321
- return Object.values(it).toString();
319
+ return array.map((it, index) => {
320
+ let strIt = "";
321
+ for (let [i, objkey] of Object.keys(it).entries()) {
322
+ if (index == 0) {
323
+ strIt += "\"" + it[objkey].replace(/"/g, "\"\"") + "\"";
324
+ }
325
+ else {
326
+ strIt += "\"" + JSON.stringify(it[objkey]).replace(/"/g, "\"\"") + "\"";
327
+ }
328
+ if (i < (Object.keys(it).length - 1)) {
329
+ strIt += ",";
330
+ }
331
+ }
332
+ return strIt;
322
333
  }).join('\n');
323
334
  }
335
+ function parseCsv(csv) {
336
+ const re = /(,|\r?\n|\r|^)(?:"([^"]*(?:""[^"]*)*)"|([^,\r\n]*))/gi;
337
+ const result = [[]];
338
+ let matches;
339
+ while ((matches = re.exec(csv))) {
340
+ if (matches[1].length && matches[1] !== ',')
341
+ result.push([]);
342
+ result[result.length - 1].push(matches[2] !== undefined ? matches[2].replace(/""/g, '"') : matches[3]);
343
+ }
344
+ console.log('csv arr result', result, result.length);
345
+ let csvResult = arrayToObject(result);
346
+ return csvResult;
347
+ }
348
+ function arrayToObject(csvArray) {
349
+ //Take the first line (headers) from the array and remove it from the array.
350
+ const headers = csvArray.shift();
351
+ // Iterate through the rows and reduce each column to an object
352
+ return csvArray.filter((row) => {
353
+ console.log('csv object keys lngth', Object.keys(row).length);
354
+ return Object.keys(row).length > 1;
355
+ }).map((row) => {
356
+ return headers.reduce((acc, currentHeader, i) => ((currentHeader.indexOf('cols_') >= 0 || currentHeader == '') ? acc : ((row[i] != '' && row[i] != null) ? { ...acc, ...{ [currentHeader]: JSON.parse(row[i] == "TRUE" ? "true" : row[i]) } } : acc)), {});
357
+ });
358
+ }
324
359
  const exportFunctions = {
325
- callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV
360
+ callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv
326
361
  };
327
362
  export default exportFunctions;
328
363
  //# sourceMappingURL=util.js.map