sf-i-events 1.0.763 → 1.0.765
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 +12 -2
- package/package.json +1 -1
- package/sf-i-events.js +243 -139
- package/src/sf-i-events.ts +249 -138
- package/src/util.ts +9 -1
- package/util.d.ts +2 -0
- package/util.js +8 -1
package/src/sf-i-events.ts
CHANGED
|
@@ -1620,7 +1620,7 @@ export class SfIEvents extends LitElement {
|
|
|
1620
1620
|
return ['compliances',...JSON.parse(this.features)]
|
|
1621
1621
|
}
|
|
1622
1622
|
|
|
1623
|
-
selectedFeatures: string[] =
|
|
1623
|
+
selectedFeatures: string[] = ['compliances']
|
|
1624
1624
|
|
|
1625
1625
|
nextPage: number = 0;
|
|
1626
1626
|
|
|
@@ -3581,26 +3581,38 @@ export class SfIEvents extends LitElement {
|
|
|
3581
3581
|
|
|
3582
3582
|
}
|
|
3583
3583
|
|
|
3584
|
-
getYearFromMonthAndCalendarStart = (mm: string) => {
|
|
3584
|
+
// getYearFromMonthAndCalendarStart = (mm: string) => {
|
|
3585
3585
|
|
|
3586
|
-
|
|
3586
|
+
// var yyyy = "";
|
|
3587
3587
|
|
|
3588
|
-
|
|
3588
|
+
// var currMonth = new Date().getMonth() + 1;
|
|
3589
|
+
// console.log('CurrentMonth', currMonth, "MM", mm);
|
|
3590
|
+
// if(parseInt(mm) < parseInt(this.calendarStartMM) && currMonth < parseInt(this.calendarStartMM)) {
|
|
3591
|
+
// //console.log('getpastduedate returning', 0);
|
|
3592
|
+
// yyyy = parseInt(this.calendarStartYYYY) + "";
|
|
3593
|
+
// } else if(parseInt(mm) >= parseInt(this.calendarStartMM) && currMonth < parseInt(this.calendarStartMM)) {
|
|
3594
|
+
// //console.log('getpastduedate returning', 1);
|
|
3595
|
+
// yyyy = (parseInt(this.calendarStartYYYY) - 1) + "";
|
|
3596
|
+
// } else if(parseInt(mm) < parseInt(this.calendarStartMM) && currMonth >= parseInt(this.calendarStartMM)) {
|
|
3597
|
+
// //console.log('getpastduedate returning', 2);
|
|
3598
|
+
// yyyy = (parseInt(this.calendarStartYYYY) + 1) + "";
|
|
3599
|
+
// } else if(parseInt(mm) >= parseInt(this.calendarStartMM) && currMonth >= parseInt(this.calendarStartMM)) {
|
|
3600
|
+
// //console.log('getpastduedate returning', 3);
|
|
3601
|
+
// yyyy = (parseInt(this.calendarStartYYYY)) + "";
|
|
3602
|
+
// }
|
|
3589
3603
|
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
//console.log('getpastduedate returning', 2);
|
|
3604
|
+
// return yyyy;
|
|
3605
|
+
|
|
3606
|
+
// }
|
|
3607
|
+
getYearFromMonthAndCalendarStart = (mm: string) => {
|
|
3608
|
+
|
|
3609
|
+
var yyyy = "";
|
|
3610
|
+
if(parseInt(mm) < parseInt(this.calendarStartMM)){
|
|
3598
3611
|
yyyy = (parseInt(this.calendarStartYYYY) + 1) + "";
|
|
3599
|
-
}
|
|
3600
|
-
|
|
3601
|
-
yyyy = (parseInt(this.calendarStartYYYY)) + "";
|
|
3612
|
+
}else{
|
|
3613
|
+
yyyy = parseInt(this.calendarStartYYYY) + "";
|
|
3602
3614
|
}
|
|
3603
|
-
|
|
3615
|
+
|
|
3604
3616
|
return yyyy;
|
|
3605
3617
|
|
|
3606
3618
|
}
|
|
@@ -4245,15 +4257,15 @@ export class SfIEvents extends LitElement {
|
|
|
4245
4257
|
html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
|
|
4246
4258
|
html += '<div class="align-center d-flex flex-wrap align-start justify-between mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title" class="m-0">' + parametersTitle + '</h4>'
|
|
4247
4259
|
if(this.getFeatures().length > 1){
|
|
4248
|
-
html += '<div class="filter-button-container"><button part="button-icon" id="filter-button" class="material-
|
|
4260
|
+
html += '<div class="filter-button-container"><button part="button-icon" id="filter-button" class="material-symbols-outlined">category</button>'
|
|
4249
4261
|
html += '<div id="filter-list-container" class="filter-list-container hide flex-col justify-between align-start p-10" part="filter-list-container" anchor="filter-button">'
|
|
4250
4262
|
html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons button-expand invisible">check</button></div>'
|
|
4251
|
-
html += `<div class="filter-input-container d-flex"><input class="input-select-feature-all" type="checkbox" ${this.selectedFeatures.length >= (this.getFeatures().length) ? 'checked' : ''} id="input-select-feature-all" part="input-select-feature" name="all"></input><label for="input-select-feature-all" class="input-select-feature-label-all" id="input-select-feature-label-all"
|
|
4252
|
-
|
|
4263
|
+
// html += `<div class="filter-input-container d-flex"><input class="input-select-feature-all" type="checkbox" ${this.selectedFeatures.length >= (this.getFeatures().length) ? 'checked' : ''} id="input-select-feature-all" part="input-select-feature" name="all"></input><label for="input-select-feature-all" class="input-select-feature-label-all" id="input-select-feature-label-all"
|
|
4264
|
+
// part="input-select-feature-label">all</label></div>`
|
|
4253
4265
|
// html += `<div class="filter-input-container d-flex"><input class="input-select-feature-compliances" type="checkbox" ${this.selectedFeatures.indexOf('compliances') >= 0 ? 'checked' : ''} id="input-select-feature-compliances" part="input-select-feature" name="compliances"></input><label for="input-select-feature-compliances" class="input-select-feature-label" part="input-select-feature-label">compliances</label></div>`
|
|
4254
4266
|
for(let [index,feature] of this.getFeatures().entries()){
|
|
4255
4267
|
console.log('rendering features', feature, this.selectedFeatures);
|
|
4256
|
-
html += `<div class="filter-input-container d-flex"><input class="input-select-feature" type="
|
|
4268
|
+
html += `<div class="filter-input-container d-flex"><input class="input-select-feature" type="radio" ${this.selectedFeatures.indexOf(feature) >= 0 ? 'checked' : ''} id="input-select-feature-${index}" name="features" part="input-select-feature" value="${feature}"></input><label for="input-select-feature-${index}" id="input-select-feature-label-${index}" class="input-select-feature-label" part="input-select-feature-label">${feature}</label></div>`
|
|
4257
4269
|
}
|
|
4258
4270
|
html += '</div></div>'
|
|
4259
4271
|
}
|
|
@@ -4309,7 +4321,21 @@ export class SfIEvents extends LitElement {
|
|
|
4309
4321
|
var html = '';
|
|
4310
4322
|
|
|
4311
4323
|
html += '<div class="mb-20 stream-event-list" part="stream-event-list-charts">';
|
|
4312
|
-
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
|
|
4324
|
+
html += '<div class="align-center justify-between d-flex flex-wrap mb-10 w-100-m-0" part="duration-title-container"><h4 part="duration-title">' + parametersTitle + '</h4>'
|
|
4325
|
+
if(this.getFeatures().length > 1){
|
|
4326
|
+
html += '<div class="filter-button-container"><button part="button-icon" id="filter-button" class="material-symbols-outlined">category</button>'
|
|
4327
|
+
html += '<div id="filter-list-container" class="filter-list-container hide flex-col justify-between align-start p-10" part="filter-list-container" anchor="filter-button">'
|
|
4328
|
+
html += '<div id="filter-label-container" class="filter-label-container d-flex justify-between align-center" part="filter-label-container"><label class="filter-label" part="filter-label">Filters</label><button id="button-submit-features" part="button-icon-small" class="material-icons button-expand invisible">check</button></div>'
|
|
4329
|
+
// html += `<div class="filter-input-container d-flex"><input class="input-select-feature-all" type="checkbox" ${this.selectedFeatures.length >= (this.getFeatures().length) ? 'checked' : ''} id="input-select-feature-all" part="input-select-feature" name="all"></input><label for="input-select-feature-all" class="input-select-feature-label-all" id="input-select-feature-label-all"
|
|
4330
|
+
// part="input-select-feature-label">all</label></div>`
|
|
4331
|
+
// html += `<div class="filter-input-container d-flex"><input class="input-select-feature-compliances" type="checkbox" ${this.selectedFeatures.indexOf('compliances') >= 0 ? 'checked' : ''} id="input-select-feature-compliances" part="input-select-feature" name="compliances"></input><label for="input-select-feature-compliances" class="input-select-feature-label" part="input-select-feature-label">compliances</label></div>`
|
|
4332
|
+
for(let [index,feature] of this.getFeatures().entries()){
|
|
4333
|
+
console.log('rendering features statistics', feature, this.selectedFeatures);
|
|
4334
|
+
html += `<div class="filter-input-container d-flex"><input class="input-select-feature" type="radio" ${this.selectedFeatures.indexOf(feature) >= 0 ? 'checked' : ''} id="input-select-feature-${index}" name="features" part="input-select-feature" value="${feature}"></input><label for="input-select-feature-${index}" id="input-select-feature-label-${index}" class="input-select-feature-label" part="input-select-feature-label">${feature}</label></div>`
|
|
4335
|
+
}
|
|
4336
|
+
html += '</div></div>'
|
|
4337
|
+
}
|
|
4338
|
+
html +='<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>';
|
|
4313
4339
|
html += '<div class="align-center d-flex flex-wrap mb-10 w-100-m-0" part="last-update-title-container"><h6 part="last-update-title" class="align-center d-flex"><span class="material-symbols-outlined">update</span> Last Updated on ' + this.lastupdated + '</h6></div>';
|
|
4314
4340
|
if(showGraph) {
|
|
4315
4341
|
html += '<div class="chart-container d-flex scroll-x align-center"><div part="chart-item" class="chart-item"><canvas id="myChart"></canvas></div><div part="chart-item" class="chart-item"><canvas id="myChart4" class="gone"></canvas></div><div part="chart-item chart-item-middle" class="chart-item"><canvas id="myChart2" class="gone"></canvas></div><div part="chart-item" class="chart-item"><canvas id="myChart3" class="gone"></canvas></div></div>';
|
|
@@ -6078,37 +6104,37 @@ export class SfIEvents extends LitElement {
|
|
|
6078
6104
|
filterButton?.addEventListener('click',() => {
|
|
6079
6105
|
const filterList = eventsContainer.querySelector('#filter-list-container') as HTMLDivElement
|
|
6080
6106
|
filterList.style.display = (filterList.style.display != 'block' ? 'block' : 'none')
|
|
6081
|
-
filterButton.innerHTML = (filterList.style.display != 'block' ? '
|
|
6107
|
+
filterButton.innerHTML = (filterList.style.display != 'block' ? 'category' : 'close')
|
|
6082
6108
|
const filterSubmitButton = filterList.querySelector('#button-submit-features') as HTMLButtonElement
|
|
6083
6109
|
filterSubmitButton.addEventListener('click',() => {
|
|
6084
6110
|
this.processDateSelection(eventsContainer);
|
|
6085
6111
|
})
|
|
6086
|
-
const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
6087
|
-
selectFeatureAll.addEventListener('click',async(ev: any) => {
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
})
|
|
6107
|
-
const selectFeatureAllLabel = filterList.querySelector('#input-select-feature-label-all') as HTMLLabelElement
|
|
6108
|
-
selectFeatureAllLabel.addEventListener('click',()=>{
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
})
|
|
6112
|
+
// const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
6113
|
+
// selectFeatureAll.addEventListener('click',async(ev: any) => {
|
|
6114
|
+
// let target = ev.target;
|
|
6115
|
+
// if(target.checked){
|
|
6116
|
+
// for(let feature of this.getFeatures()){
|
|
6117
|
+
// if(this.selectedFeatures.indexOf(feature) < 0){
|
|
6118
|
+
// this.selectedFeatures.push(feature);
|
|
6119
|
+
// }
|
|
6120
|
+
// }
|
|
6121
|
+
// }else{
|
|
6122
|
+
// this.selectedFeatures = []
|
|
6123
|
+
// }
|
|
6124
|
+
// const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
|
|
6125
|
+
// for(let selectFeature of selectFeatures){
|
|
6126
|
+
// let id = selectFeature.id;
|
|
6127
|
+
// let i = id.split('-')[3];
|
|
6128
|
+
// let selectedFeature = this.getFeatures()[parseInt(i)]
|
|
6129
|
+
// selectFeature.checked = this.selectedFeatures.indexOf(selectedFeature) >= 0
|
|
6130
|
+
// }
|
|
6131
|
+
// filterSubmitButton.style.visibility = 'visible'
|
|
6132
|
+
// })
|
|
6133
|
+
// const selectFeatureAllLabel = filterList.querySelector('#input-select-feature-label-all') as HTMLLabelElement
|
|
6134
|
+
// selectFeatureAllLabel.addEventListener('click',()=>{
|
|
6135
|
+
// selectFeatureAll.checked = !selectFeatureAll.checked
|
|
6136
|
+
// selectFeatureAll.click();
|
|
6137
|
+
// })
|
|
6112
6138
|
const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
|
|
6113
6139
|
const selectFeatureLabels = filterList.querySelectorAll('.input-select-feature-label') as NodeListOf<HTMLLabelElement>
|
|
6114
6140
|
for(let [i,selectFeature] of selectFeatures.entries()){
|
|
@@ -6119,15 +6145,18 @@ export class SfIEvents extends LitElement {
|
|
|
6119
6145
|
let selectedFeature = this.getFeatures()[index]
|
|
6120
6146
|
if(target.checked){
|
|
6121
6147
|
if(this.selectedFeatures.indexOf(selectedFeature) < 0){
|
|
6122
|
-
this.selectedFeatures.push(selectedFeature)
|
|
6123
|
-
|
|
6124
|
-
}else{
|
|
6125
|
-
selectFeatureAll.checked = false;
|
|
6126
|
-
if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
|
|
6127
|
-
this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
|
|
6148
|
+
// this.selectedFeatures.push(selectedFeature)
|
|
6149
|
+
this.selectedFeatures = [selectedFeature]
|
|
6128
6150
|
}
|
|
6129
6151
|
}
|
|
6130
|
-
|
|
6152
|
+
// else{
|
|
6153
|
+
// // selectFeatureAll.checked = false;
|
|
6154
|
+
// if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
|
|
6155
|
+
// this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
|
|
6156
|
+
// }
|
|
6157
|
+
// }
|
|
6158
|
+
// filterSubmitButton.style.visibility = 'visible'
|
|
6159
|
+
filterSubmitButton.click();
|
|
6131
6160
|
})
|
|
6132
6161
|
selectFeatureLabels[i].addEventListener('click',() => {
|
|
6133
6162
|
selectFeature.checked = !selectFeature.checked
|
|
@@ -6799,6 +6828,70 @@ export class SfIEvents extends LitElement {
|
|
|
6799
6828
|
|
|
6800
6829
|
eventsContainer.querySelector('.calendar-right-data')!.innerHTML = html;
|
|
6801
6830
|
this.renderButtonRefresh(eventsContainer);
|
|
6831
|
+
const filterButton = eventsContainer.querySelector('#filter-button') as HTMLButtonElement
|
|
6832
|
+
filterButton?.addEventListener('click',() => {
|
|
6833
|
+
const filterList = eventsContainer.querySelector('#filter-list-container') as HTMLDivElement
|
|
6834
|
+
filterList.style.display = (filterList.style.display != 'block' ? 'block' : 'none')
|
|
6835
|
+
filterButton.innerHTML = (filterList.style.display != 'block' ? 'category' : 'close')
|
|
6836
|
+
const filterSubmitButton = filterList.querySelector('#button-submit-features') as HTMLButtonElement
|
|
6837
|
+
filterSubmitButton.addEventListener('click',() => {
|
|
6838
|
+
this.processDateSelectionViewer(eventsContainer);
|
|
6839
|
+
})
|
|
6840
|
+
// const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
6841
|
+
// selectFeatureAll.addEventListener('click',async(ev: any) => {
|
|
6842
|
+
// let target = ev.target;
|
|
6843
|
+
// if(target.checked){
|
|
6844
|
+
// for(let feature of this.getFeatures()){
|
|
6845
|
+
// if(this.selectedFeatures.indexOf(feature) < 0){
|
|
6846
|
+
// this.selectedFeatures.push(feature);
|
|
6847
|
+
// }
|
|
6848
|
+
// }
|
|
6849
|
+
// }else{
|
|
6850
|
+
// this.selectedFeatures = []
|
|
6851
|
+
// }
|
|
6852
|
+
// const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
|
|
6853
|
+
// for(let selectFeature of selectFeatures){
|
|
6854
|
+
// let id = selectFeature.id;
|
|
6855
|
+
// let i = id.split('-')[3];
|
|
6856
|
+
// let selectedFeature = this.getFeatures()[parseInt(i)]
|
|
6857
|
+
// selectFeature.checked = this.selectedFeatures.indexOf(selectedFeature) >= 0
|
|
6858
|
+
// }
|
|
6859
|
+
// filterSubmitButton.style.visibility = 'visible'
|
|
6860
|
+
// })
|
|
6861
|
+
// const selectFeatureAllLabel = filterList.querySelector('#input-select-feature-label-all') as HTMLLabelElement
|
|
6862
|
+
// selectFeatureAllLabel.addEventListener('click',()=>{
|
|
6863
|
+
// selectFeatureAll.checked = !selectFeatureAll.checked
|
|
6864
|
+
// selectFeatureAll.click();
|
|
6865
|
+
// })
|
|
6866
|
+
const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
|
|
6867
|
+
const selectFeatureLabels = filterList.querySelectorAll('.input-select-feature-label') as NodeListOf<HTMLLabelElement>
|
|
6868
|
+
for(let [i,selectFeature] of selectFeatures.entries()){
|
|
6869
|
+
selectFeature.addEventListener('click',(ev: any) => {
|
|
6870
|
+
let target = ev.target;
|
|
6871
|
+
let id = target.id;
|
|
6872
|
+
let index = id.split('-')[3];
|
|
6873
|
+
let selectedFeature = this.getFeatures()[index]
|
|
6874
|
+
if(target.checked){
|
|
6875
|
+
if(this.selectedFeatures.indexOf(selectedFeature) < 0){
|
|
6876
|
+
// this.selectedFeatures.push(selectedFeature)
|
|
6877
|
+
this.selectedFeatures = [selectedFeature]
|
|
6878
|
+
}
|
|
6879
|
+
}
|
|
6880
|
+
// else{
|
|
6881
|
+
// // selectFeatureAll.checked = false;
|
|
6882
|
+
// if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
|
|
6883
|
+
// this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
|
|
6884
|
+
// }
|
|
6885
|
+
// }
|
|
6886
|
+
// filterSubmitButton.style.visibility = 'visible'
|
|
6887
|
+
filterSubmitButton.click();
|
|
6888
|
+
})
|
|
6889
|
+
selectFeatureLabels[i].addEventListener('click',() => {
|
|
6890
|
+
selectFeature.checked = !selectFeature.checked
|
|
6891
|
+
selectFeature.click();
|
|
6892
|
+
})
|
|
6893
|
+
}
|
|
6894
|
+
})
|
|
6802
6895
|
// let innerhtml = eventsContainer.innerHTML;
|
|
6803
6896
|
// innerhtml += this.renderSelectAllButtons();
|
|
6804
6897
|
// eventsContainer.innerHTML = innerhtml
|
|
@@ -7370,7 +7463,8 @@ export class SfIEvents extends LitElement {
|
|
|
7370
7463
|
tsStart.setDate(tsStart.getDate() - 2);
|
|
7371
7464
|
tsEnd.setDate(tsEnd.getDate() + 2);
|
|
7372
7465
|
|
|
7373
|
-
await this.
|
|
7466
|
+
await this.renderWithFeatures((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear())
|
|
7467
|
+
// await this.fetchAndYearlyRenderUserCalendar_2((tsStart.getMonth() + 1) + "/" + tsStart.getDate() + "/" + tsStart.getFullYear(), (tsEnd.getMonth() + 1) + "/" + tsEnd.getDate() + "/" + tsEnd.getFullYear());
|
|
7374
7468
|
this.renderRangeEvents(new Date(valueStart), ((new Date(valueEnd).getTime()+24*60*60*1000) - new Date(valueStart).getTime())/(1000*60*60*24), (this._SfCustomContainer as HTMLDivElement));
|
|
7375
7469
|
} else if(valueStart != "" && valueEnd == "") {
|
|
7376
7470
|
(this._SfStreamEventStatus as HTMLDivElement).innerHTML = "Please select End Date";
|
|
@@ -8535,14 +8629,14 @@ export class SfIEvents extends LitElement {
|
|
|
8535
8629
|
|
|
8536
8630
|
for(var j = 0; j < 12; j++) {
|
|
8537
8631
|
if(j === index) {
|
|
8538
|
-
|
|
8632
|
+
|
|
8539
8633
|
let currentMonth = month;
|
|
8540
8634
|
let nowMonth = new Date().getMonth() + 1;
|
|
8541
8635
|
//let nowYear = new Date().getFullYear();
|
|
8542
8636
|
let nowYear = parseInt(this.getCurrentYear(nowMonth + ""));
|
|
8543
8637
|
let lastMonth = -1;
|
|
8544
8638
|
let nextMonth = -1;
|
|
8545
|
-
|
|
8639
|
+
console.log('calculating startAndEndOfStream', index, nowMonth, currentMonth)
|
|
8546
8640
|
let lastMonthsYear = -1;
|
|
8547
8641
|
let nextMonthsYear = -1;
|
|
8548
8642
|
|
|
@@ -8742,8 +8836,8 @@ export class SfIEvents extends LitElement {
|
|
|
8742
8836
|
// nextMonthsYear = parseInt(this.calendarStartYYYY) + 1;
|
|
8743
8837
|
// }
|
|
8744
8838
|
|
|
8745
|
-
let startDate = lastMonth + "/25/" + lastMonthsYear;
|
|
8746
|
-
let endDate = nextMonth + "/01/" + nextMonthsYear;
|
|
8839
|
+
let startDate = ("0" + lastMonth).slice(-2) + "/25/" + lastMonthsYear;
|
|
8840
|
+
let endDate = ("0" + nextMonth).slice(-2) + "/01/" + nextMonthsYear;
|
|
8747
8841
|
|
|
8748
8842
|
return {startDate: startDate, endDate: endDate};
|
|
8749
8843
|
|
|
@@ -9798,7 +9892,7 @@ export class SfIEvents extends LitElement {
|
|
|
9798
9892
|
filterButton?.addEventListener('click',() => {
|
|
9799
9893
|
const filterList = (this._SfThisContainer as HTMLDivElement).querySelector('#filter-list-container') as HTMLDivElement
|
|
9800
9894
|
filterList.style.display = (filterList.style.display != 'block' ? 'block' : 'none')
|
|
9801
|
-
filterButton.innerHTML = (filterList.style.display != 'block' ? '
|
|
9895
|
+
filterButton.innerHTML = (filterList.style.display != 'block' ? 'category' : 'close')
|
|
9802
9896
|
const filterSubmitButton = filterList.querySelector('#button-submit-features') as HTMLButtonElement
|
|
9803
9897
|
filterSubmitButton.addEventListener('click',async() => {
|
|
9804
9898
|
const dateResult = this.calculateStartAndEndDateOfStream(index);
|
|
@@ -9811,32 +9905,32 @@ export class SfIEvents extends LitElement {
|
|
|
9811
9905
|
this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
|
|
9812
9906
|
this.renderStream(index);
|
|
9813
9907
|
})
|
|
9814
|
-
const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
9815
|
-
selectFeatureAll.addEventListener('click',async(ev: any) => {
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
})
|
|
9835
|
-
const selectFeatureAllLabel = filterList.querySelector('#input-select-feature-label-all') as HTMLLabelElement
|
|
9836
|
-
selectFeatureAllLabel.addEventListener('click',()=>{
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
})
|
|
9908
|
+
// const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
9909
|
+
// selectFeatureAll.addEventListener('click',async(ev: any) => {
|
|
9910
|
+
// let target = ev.target;
|
|
9911
|
+
// if(target.checked){
|
|
9912
|
+
// for(let feature of this.getFeatures()){
|
|
9913
|
+
// if(this.selectedFeatures.indexOf(feature) < 0){
|
|
9914
|
+
// this.selectedFeatures.push(feature);
|
|
9915
|
+
// }
|
|
9916
|
+
// }
|
|
9917
|
+
// }else{
|
|
9918
|
+
// this.selectedFeatures = []
|
|
9919
|
+
// }
|
|
9920
|
+
// const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
|
|
9921
|
+
// for(let selectFeature of selectFeatures){
|
|
9922
|
+
// let id = selectFeature.id;
|
|
9923
|
+
// let i = id.split('-')[3];
|
|
9924
|
+
// let selectedFeature = this.getFeatures()[parseInt(i)]
|
|
9925
|
+
// selectFeature.checked = this.selectedFeatures.indexOf(selectedFeature) >= 0
|
|
9926
|
+
// }
|
|
9927
|
+
// filterSubmitButton.style.visibility = 'visible'
|
|
9928
|
+
// })
|
|
9929
|
+
// const selectFeatureAllLabel = filterList.querySelector('#input-select-feature-label-all') as HTMLLabelElement
|
|
9930
|
+
// selectFeatureAllLabel.addEventListener('click',()=>{
|
|
9931
|
+
// selectFeatureAll.checked = !selectFeatureAll.checked
|
|
9932
|
+
// selectFeatureAll.click();
|
|
9933
|
+
// })
|
|
9840
9934
|
const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
|
|
9841
9935
|
const selectFeatureLabels = filterList.querySelectorAll('.input-select-feature-label') as NodeListOf<HTMLLabelElement>
|
|
9842
9936
|
for(let [i,selectFeature] of selectFeatures.entries()){
|
|
@@ -9847,15 +9941,18 @@ export class SfIEvents extends LitElement {
|
|
|
9847
9941
|
let selectedFeature = this.getFeatures()[i]
|
|
9848
9942
|
if(target.checked){
|
|
9849
9943
|
if(this.selectedFeatures.indexOf(selectedFeature) < 0){
|
|
9850
|
-
this.selectedFeatures.push(selectedFeature)
|
|
9851
|
-
|
|
9852
|
-
}else{
|
|
9853
|
-
selectFeatureAll.checked = false;
|
|
9854
|
-
if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
|
|
9855
|
-
this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
|
|
9944
|
+
// this.selectedFeatures.push(selectedFeature)
|
|
9945
|
+
this.selectedFeatures = [selectedFeature]
|
|
9856
9946
|
}
|
|
9857
9947
|
}
|
|
9858
|
-
|
|
9948
|
+
// else{
|
|
9949
|
+
// // selectFeatureAll.checked = false;
|
|
9950
|
+
// if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
|
|
9951
|
+
// this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
|
|
9952
|
+
// }
|
|
9953
|
+
// }
|
|
9954
|
+
// filterSubmitButton.style.visibility = 'visible'
|
|
9955
|
+
filterSubmitButton.click();
|
|
9859
9956
|
})
|
|
9860
9957
|
selectFeatureLabels[i].addEventListener('click',() => {
|
|
9861
9958
|
selectFeature.checked = !selectFeature.checked
|
|
@@ -10023,7 +10120,8 @@ export class SfIEvents extends LitElement {
|
|
|
10023
10120
|
this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
|
|
10024
10121
|
this.currentColumnIndex = index + "";
|
|
10025
10122
|
const dateResult = this.calculateStartAndEndDateOfThis(index);
|
|
10026
|
-
await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate);
|
|
10123
|
+
// await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate);
|
|
10124
|
+
await this.renderWithFeatures(dateResult.startDate, dateResult.endDate);
|
|
10027
10125
|
this.renderThis(index);
|
|
10028
10126
|
})
|
|
10029
10127
|
this.attachListReportingListeners(this._SfThisContainer as HTMLDivElement);
|
|
@@ -10308,7 +10406,7 @@ export class SfIEvents extends LitElement {
|
|
|
10308
10406
|
filterButton?.addEventListener('click',() => {
|
|
10309
10407
|
const filterList = (this._SfStreamContainer as HTMLDivElement).querySelector('#filter-list-container') as HTMLDivElement
|
|
10310
10408
|
filterList.style.display = (filterList.style.display != 'block' ? 'block' : 'none')
|
|
10311
|
-
filterButton.innerHTML = (filterList.style.display != 'block' ? '
|
|
10409
|
+
filterButton.innerHTML = (filterList.style.display != 'block' ? 'category' : 'close')
|
|
10312
10410
|
const filterSubmitButton = filterList.querySelector('#button-submit-features') as HTMLButtonElement
|
|
10313
10411
|
filterSubmitButton.addEventListener('click',async() => {
|
|
10314
10412
|
const dateResult = this.calculateStartAndEndDateOfStream(index);
|
|
@@ -10323,32 +10421,32 @@ export class SfIEvents extends LitElement {
|
|
|
10323
10421
|
this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
|
|
10324
10422
|
this.renderStream(index);
|
|
10325
10423
|
})
|
|
10326
|
-
const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
10327
|
-
selectFeatureAll
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
})
|
|
10347
|
-
const selectFeatureAllLabel = filterList.querySelector('#input-select-feature-label-all') as HTMLLabelElement
|
|
10348
|
-
selectFeatureAllLabel
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
})
|
|
10424
|
+
// const selectFeatureAll = filterList.querySelector('.input-select-feature-all') as HTMLInputElement
|
|
10425
|
+
// selectFeatureAll?.addEventListener('click',async(ev: any) => {
|
|
10426
|
+
// let target = ev.target;
|
|
10427
|
+
// if(target.checked){
|
|
10428
|
+
// for(let feature of this.getFeatures()){
|
|
10429
|
+
// if(this.selectedFeatures.indexOf(feature) < 0){
|
|
10430
|
+
// this.selectedFeatures.push(feature);
|
|
10431
|
+
// }
|
|
10432
|
+
// }
|
|
10433
|
+
// }else{
|
|
10434
|
+
// this.selectedFeatures = []
|
|
10435
|
+
// }
|
|
10436
|
+
// const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
|
|
10437
|
+
// for(let selectFeature of selectFeatures){
|
|
10438
|
+
// let id = selectFeature.id;
|
|
10439
|
+
// let i = id.split('-')[3];
|
|
10440
|
+
// let selectedFeature = this.getFeatures()[parseInt(i)]
|
|
10441
|
+
// selectFeature.checked = this.selectedFeatures.indexOf(selectedFeature) >= 0
|
|
10442
|
+
// }
|
|
10443
|
+
// filterSubmitButton.style.visibility = 'visible'
|
|
10444
|
+
// })
|
|
10445
|
+
// const selectFeatureAllLabel = filterList.querySelector('#input-select-feature-label-all') as HTMLLabelElement
|
|
10446
|
+
// selectFeatureAllLabel?.addEventListener('click',()=>{
|
|
10447
|
+
// selectFeatureAll.checked = !selectFeatureAll.checked;
|
|
10448
|
+
// selectFeatureAll.click();
|
|
10449
|
+
// })
|
|
10352
10450
|
const selectFeatures = filterList.querySelectorAll('.input-select-feature') as NodeListOf<HTMLInputElement>
|
|
10353
10451
|
const selectFeatureLabels = filterList.querySelectorAll('.input-select-feature-label') as NodeListOf<HTMLLabelElement>
|
|
10354
10452
|
for(let [i,selectFeature] of selectFeatures.entries()){
|
|
@@ -10359,16 +10457,18 @@ export class SfIEvents extends LitElement {
|
|
|
10359
10457
|
let selectedFeature = this.getFeatures()[i]
|
|
10360
10458
|
if(target.checked){
|
|
10361
10459
|
if(this.selectedFeatures.indexOf(selectedFeature) < 0){
|
|
10362
|
-
this.selectedFeatures.push(selectedFeature)
|
|
10363
|
-
|
|
10364
|
-
}else{
|
|
10365
|
-
selectFeatureAll.checked = false;
|
|
10366
|
-
if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
|
|
10367
|
-
this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
|
|
10460
|
+
// this.selectedFeatures.push(selectedFeature)
|
|
10461
|
+
this.selectedFeatures = [selectedFeature]
|
|
10368
10462
|
}
|
|
10369
10463
|
}
|
|
10370
|
-
|
|
10371
|
-
|
|
10464
|
+
// else{
|
|
10465
|
+
// // selectFeatureAll.checked = false;
|
|
10466
|
+
// if(this.selectedFeatures.indexOf(selectedFeature) >= 0){
|
|
10467
|
+
// this.selectedFeatures.splice(this.selectedFeatures.indexOf(selectedFeature),1);
|
|
10468
|
+
// }
|
|
10469
|
+
// }
|
|
10470
|
+
// filterSubmitButton.style.visibility = 'visible'
|
|
10471
|
+
filterSubmitButton.click();
|
|
10372
10472
|
})
|
|
10373
10473
|
selectFeatureLabels[i].addEventListener('click',() => {
|
|
10374
10474
|
selectFeature.checked = !selectFeature.checked
|
|
@@ -10541,7 +10641,8 @@ export class SfIEvents extends LitElement {
|
|
|
10541
10641
|
console.log('dateresult', dateResult);
|
|
10542
10642
|
this.currentColumnIndex = index + "";
|
|
10543
10643
|
if(dateResult != null) {
|
|
10544
|
-
await this.
|
|
10644
|
+
await this.renderWithFeatures(dateResult.startDate, dateResult.endDate,"","yes",("0" + monthResult).slice(-2));
|
|
10645
|
+
// await this.fetchAndYearlyRenderUserCalendar_2(dateResult.startDate, dateResult.endDate,"","yes",("0" + monthResult).slice(-2));
|
|
10545
10646
|
}
|
|
10546
10647
|
this.flowGraph = this.FLOW_GRAPH_COMPLETENESS;
|
|
10547
10648
|
this.renderStream(index);
|
|
@@ -10784,6 +10885,12 @@ export class SfIEvents extends LitElement {
|
|
|
10784
10885
|
// yyyy = (parseInt(this.calendarStartYYYY) + 1) + "";
|
|
10785
10886
|
// }
|
|
10786
10887
|
|
|
10888
|
+
// if(parseInt(mm) >= 4){
|
|
10889
|
+
// return new Date().getFullYear() + ""
|
|
10890
|
+
// }else{
|
|
10891
|
+
// return (new Date().getFullYear() + 1) + ""
|
|
10892
|
+
// }
|
|
10893
|
+
|
|
10787
10894
|
var yyyy = this.getYearFromMonthAndCalendarStart(mm);
|
|
10788
10895
|
|
|
10789
10896
|
return yyyy;
|
|
@@ -23433,9 +23540,9 @@ export class SfIEvents extends LitElement {
|
|
|
23433
23540
|
console.log('rendering appropriate string', list);
|
|
23434
23541
|
this.renderAppropriateStream(startDate, endDate, list == "no");
|
|
23435
23542
|
this.fetchBulkReportingData();
|
|
23436
|
-
if(this.selectedFeatures.indexOf('notices') >= 0){
|
|
23437
|
-
|
|
23438
|
-
}
|
|
23543
|
+
// if(this.selectedFeatures.indexOf('notices') >= 0){
|
|
23544
|
+
// this.fetchAndRenderNotices(startDate, endDate);
|
|
23545
|
+
// }
|
|
23439
23546
|
// this.events = {}
|
|
23440
23547
|
// this.events = {...JSON.parse(JSON.stringify(jsonRespose.data.events))};
|
|
23441
23548
|
|
|
@@ -23562,7 +23669,7 @@ export class SfIEvents extends LitElement {
|
|
|
23562
23669
|
console.log('jsonRespose', jsonRespose);
|
|
23563
23670
|
let notices = (await this.fetchPresignedUrl(jsonRespose.signedUrlGet));
|
|
23564
23671
|
await this.fetchPresignedUrlDelete(jsonRespose.signedUrlDelete)
|
|
23565
|
-
|
|
23672
|
+
this.lastupdated = new Date().toLocaleDateString('en-IN') + " - " + new Date().toLocaleTimeString('en-IN')
|
|
23566
23673
|
let tempEvents = this.events
|
|
23567
23674
|
for(let mmddyyyy of Object.keys(notices)){
|
|
23568
23675
|
tempEvents[mmddyyyy] = [...(tempEvents[mmddyyyy] ?? []),...notices[mmddyyyy]]
|
|
@@ -23609,8 +23716,12 @@ export class SfIEvents extends LitElement {
|
|
|
23609
23716
|
eDate = endDate;
|
|
23610
23717
|
}
|
|
23611
23718
|
|
|
23612
|
-
|
|
23613
|
-
|
|
23719
|
+
let url = ""
|
|
23720
|
+
if(this.selectedFeatures.indexOf('compliances') >= 0){
|
|
23721
|
+
url = "https://"+this.apiId+"/"+ path;
|
|
23722
|
+
}else if(this.selectedFeatures.indexOf('notices') >= 0){
|
|
23723
|
+
url = "https://"+this.apiIdNotices+"/"+ path;
|
|
23724
|
+
}
|
|
23614
23725
|
|
|
23615
23726
|
//console.log('fetch calendar url', url);
|
|
23616
23727
|
let urlBody :any = {"projectid": this.projectId, "userid": this.userProfileId, "role": this.myRole, "sdate": sDate, "edate": eDate,"filtercriteria": filtercriteria};
|
|
@@ -25147,7 +25258,7 @@ export class SfIEvents extends LitElement {
|
|
|
25147
25258
|
if(tempRole != "") {
|
|
25148
25259
|
this._SfRoleTabContainer.innerHTML = '';
|
|
25149
25260
|
}
|
|
25150
|
-
this.selectedFeatures = this.getFeatures()
|
|
25261
|
+
// this.selectedFeatures = this.getFeatures()
|
|
25151
25262
|
//console.log('stream received', this.stream, this.TAB_STREAM, this.TAB_YEAR);
|
|
25152
25263
|
|
|
25153
25264
|
if(this.stream == this.TAB_YEAR) {
|
package/src/util.ts
CHANGED
|
@@ -457,8 +457,16 @@ function percentageString(val: number, valTotal: number){
|
|
|
457
457
|
return " (" + (Math.round((num + Number.EPSILON) * 100) / 100) + "%)"
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
+
function getCurrentFiscal(){
|
|
461
|
+
let date = new Date()
|
|
462
|
+
if(date.getMonth() < 4){
|
|
463
|
+
return (date.getFullYear() - 1)
|
|
464
|
+
}
|
|
465
|
+
return date.getFullYear();
|
|
466
|
+
}
|
|
467
|
+
|
|
460
468
|
const exportFunctions = {
|
|
461
|
-
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString
|
|
469
|
+
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal
|
|
462
470
|
};
|
|
463
471
|
|
|
464
472
|
export default exportFunctions;
|
package/util.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare function parseCsv(csv: string): any;
|
|
|
15
15
|
declare function titleCase(str: string): string;
|
|
16
16
|
declare function alphabeticalSort(arr: string[]): string[];
|
|
17
17
|
declare function percentageString(val: number, valTotal: number): string;
|
|
18
|
+
declare function getCurrentFiscal(): number;
|
|
18
19
|
declare const exportFunctions: {
|
|
19
20
|
callApiPresignedDelete: typeof callApiPresignedDelete;
|
|
20
21
|
callApiPresignedGet: typeof callApiPresignedGet;
|
|
@@ -35,6 +36,7 @@ declare const exportFunctions: {
|
|
|
35
36
|
titleCase: typeof titleCase;
|
|
36
37
|
alphabeticalSort: typeof alphabeticalSort;
|
|
37
38
|
percentageString: typeof percentageString;
|
|
39
|
+
getCurrentFiscal: typeof getCurrentFiscal;
|
|
38
40
|
};
|
|
39
41
|
export default exportFunctions;
|
|
40
42
|
//# sourceMappingURL=util.d.ts.map
|
package/util.js
CHANGED
|
@@ -382,8 +382,15 @@ function percentageString(val, valTotal) {
|
|
|
382
382
|
let num = (100 * val) / valTotal;
|
|
383
383
|
return " (" + (Math.round((num + Number.EPSILON) * 100) / 100) + "%)";
|
|
384
384
|
}
|
|
385
|
+
function getCurrentFiscal() {
|
|
386
|
+
let date = new Date();
|
|
387
|
+
if (date.getMonth() < 4) {
|
|
388
|
+
return (date.getFullYear() - 1);
|
|
389
|
+
}
|
|
390
|
+
return date.getFullYear();
|
|
391
|
+
}
|
|
385
392
|
const exportFunctions = {
|
|
386
|
-
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString
|
|
393
|
+
callApiPresignedDelete, callApiPresignedGet, callApiPresigned, jsonObjectToHtml, clearListeners, isInteger, callApi, validateName, readCookie, timeSince, createDiagonalPattern1, createDiagonalPattern2, createDiagonalPattern3, getRandomColor, convertToCSV, parseCsv, titleCase, alphabeticalSort, percentageString, getCurrentFiscal
|
|
387
394
|
};
|
|
388
395
|
export default exportFunctions;
|
|
389
396
|
//# sourceMappingURL=util.js.map
|