sf-i-reporting 1.0.63 → 1.0.65

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.
@@ -114,6 +114,14 @@ export class SfIReporting extends LitElement {
114
114
  .SfIReportingC {
115
115
  }
116
116
 
117
+ .SfIReportingCCopy {
118
+ width: 100%;
119
+ height: 100%;
120
+ z-index: 10;
121
+ display: none;
122
+ position: absolute;
123
+ }
124
+
117
125
  .invisible {
118
126
  visibility: hidden;
119
127
  }
@@ -454,6 +462,9 @@ export class SfIReporting extends LitElement {
454
462
  @query('.SfIReportingC')
455
463
  _SfIReportingC: any;
456
464
 
465
+ @query('.SfIReportingCCopy')
466
+ _SfIReportingCCopy: any;
467
+
457
468
  @query('#reporting-container')
458
469
  _SfReportingContainer: any;
459
470
 
@@ -1016,7 +1027,8 @@ export class SfIReporting extends LitElement {
1016
1027
  formSaveButton.style.visibility = 'hidden';
1017
1028
  }
1018
1029
  })
1019
- formSaveButton.addEventListener('click', () => {
1030
+ formSaveButton.addEventListener('click', async () => {
1031
+ await this.showLoader();
1020
1032
  formModalContainer.style.display = 'none'
1021
1033
  let formObj = formContainer.querySelector('#' + element.id) as SfIForm
1022
1034
  console.log("selected", formObj, element.id)
@@ -1051,7 +1063,8 @@ export class SfIReporting extends LitElement {
1051
1063
  if(this.flow != 'details'){
1052
1064
  let selectedOptions = (this._SfReportingContainer as HTMLDivElement).querySelectorAll('.selected-option') as NodeListOf<HTMLDivElement>
1053
1065
  for(let selectedOption of selectedOptions){
1054
- selectedOption?.addEventListener('click',(ev: any) => {
1066
+ selectedOption?.addEventListener('click',async (ev: any) => {
1067
+ await this.showLoader();
1055
1068
  let target = ev.target
1056
1069
  let elementId = target.id
1057
1070
  let id = elementId.split('-')[2]
@@ -1111,6 +1124,7 @@ export class SfIReporting extends LitElement {
1111
1124
  setTimeout(()=>{
1112
1125
  this.evalShowProgress();
1113
1126
  (this._SfReportingContainer.querySelector('.form-container') as HTMLDivElement).scrollTo({top: scrollTopTarget, left:0});
1127
+ this.hideLoader();
1114
1128
  },500)
1115
1129
 
1116
1130
  }
@@ -1298,7 +1312,8 @@ export class SfIReporting extends LitElement {
1298
1312
  initInputListeners = () => {
1299
1313
  let addButtons = (this._SfReportingContainer as HTMLDivElement).querySelectorAll('.add-button') as NodeListOf<HTMLButtonElement>
1300
1314
  for(let addButton of addButtons){
1301
- addButton.addEventListener('click', (ev: any)=>{
1315
+ addButton.addEventListener('click', async (ev: any)=>{
1316
+ await this.showLoader();
1302
1317
  let target = ev.target;
1303
1318
  for(let [i,element] of this.dataModel.entries()){
1304
1319
  if(isAddButtonObject(element)){
@@ -1328,7 +1343,8 @@ export class SfIReporting extends LitElement {
1328
1343
 
1329
1344
  let removeButtons = (this._SfReportingContainer as HTMLDivElement).querySelectorAll('.remove-child-button') as NodeListOf<HTMLButtonElement>
1330
1345
  for(let removeButton of removeButtons){
1331
- removeButton.addEventListener('click', (ev: any)=>{
1346
+ removeButton.addEventListener('click', async (ev: any)=>{
1347
+ await this.showLoader();
1332
1348
  let target = ev.target;
1333
1349
  console.log(target)
1334
1350
  let addId = target.id.split("-")[0]
@@ -1665,7 +1681,8 @@ export class SfIReporting extends LitElement {
1665
1681
  initSectionListeners = () => {
1666
1682
  let sectionHeads = (this._SfReportingContainer.querySelectorAll('.section-head')) as NodeListOf<HTMLDivElement>
1667
1683
  for(let sectionHead of sectionHeads){
1668
- sectionHead.addEventListener('click', () => {
1684
+ sectionHead.addEventListener('click', async () => {
1685
+ await this.showLoader();
1669
1686
  console.log('scroll position',(this._SfReportingContainer.querySelector('.form-container') as HTMLElement).scrollTop)
1670
1687
  for(let dataObj of this.dataModel){
1671
1688
  if(dataObj.id == sectionHead.id){
@@ -2247,6 +2264,21 @@ export class SfIReporting extends LitElement {
2247
2264
 
2248
2265
  }
2249
2266
 
2267
+ showLoader = async () => {
2268
+ if(this._SfIReportingCCopy != null){
2269
+ let loaderContainer = this._SfIReportingCCopy as HTMLDivElement
2270
+ loaderContainer.style.backgroundColor = "#efefef"
2271
+ loaderContainer.style.display = 'flex'
2272
+ }
2273
+ }
2274
+
2275
+ hideLoader = async () => {
2276
+ if(this._SfIReportingCCopy != null){
2277
+ let loaderContainer = this._SfIReportingCCopy as HTMLDivElement
2278
+ loaderContainer.style.display = 'none'
2279
+ }
2280
+ }
2281
+
2250
2282
  protected override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {
2251
2283
 
2252
2284
  this.loadMode();
@@ -2311,6 +2343,9 @@ export class SfIReporting extends LitElement {
2311
2343
  return html`
2312
2344
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
2313
2345
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />
2346
+ <div part="reporting-container-outer-copy" class="SfIReportingCCopy align-center d-flex flex-col justify-center hide">
2347
+ <div class="lds-dual-ring"></div>
2348
+ </div>
2314
2349
  <div part="reporting-container-outer" class="SfIReportingC d-flex flex-col align-center">
2315
2350
  <div id="reporting-container" part="reporting-container" class="w-100-m-0 hide"></div>
2316
2351
  <div class="loader-element"></div>
@@ -2335,6 +2370,9 @@ export class SfIReporting extends LitElement {
2335
2370
  return html`
2336
2371
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
2337
2372
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />
2373
+ <div part="reporting-container-outer-copy" class="SfIReportingCCopy align-center d-flex flex-col justify-center hide">
2374
+ <div class="lds-dual-ring"></div>
2375
+ </div>
2338
2376
  <div part="reporting-container-outer" class="SfIReportingC d-flex flex-col align-center">
2339
2377
  <div id="reporting-container" part="reporting-container" class="w-100-m-0 hide"></div>
2340
2378
  <div class="loader-element"></div>
@@ -2359,6 +2397,9 @@ export class SfIReporting extends LitElement {
2359
2397
  return html`
2360
2398
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
2361
2399
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0" />
2400
+ <div part="reporting-container-outer-copy" class="SfIReportingCCopy align-center d-flex flex-col justify-center hide">
2401
+ <div class="lds-dual-ring"></div>
2402
+ </div>
2362
2403
  <div part="reporting-container-outer" class="SfIReportingC d-flex flex-col align-center">
2363
2404
  <div id="reporting-container" part="reporting-container" class="w-100-m-0 hide"></div>
2364
2405
  <div class="loader-element"></div>