sf-i-events 1.0.887 → 1.0.889
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 +4 -4
- package/package.json +1 -1
- package/sf-i-events.d.ts +1 -1
- package/sf-i-events.js +59 -22
- package/src/sf-i-events.ts +68 -22
package/dev/index.html
CHANGED
|
@@ -757,7 +757,7 @@
|
|
|
757
757
|
</div>
|
|
758
758
|
|
|
759
759
|
</sf-i-events> -->
|
|
760
|
-
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
|
|
760
|
+
<!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
|
|
761
761
|
apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
|
|
762
762
|
apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
|
|
763
763
|
apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
|
|
@@ -785,7 +785,7 @@
|
|
|
785
785
|
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
786
786
|
</div>
|
|
787
787
|
|
|
788
|
-
</sf-i-events>
|
|
788
|
+
</sf-i-events> -->
|
|
789
789
|
<!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
|
|
790
790
|
apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
|
|
791
791
|
apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
|
|
@@ -814,7 +814,7 @@
|
|
|
814
814
|
</div>
|
|
815
815
|
|
|
816
816
|
</sf-i-events> -->
|
|
817
|
-
|
|
817
|
+
<sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer"
|
|
818
818
|
apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute"
|
|
819
819
|
apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition"
|
|
820
820
|
apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat"
|
|
@@ -841,7 +841,7 @@
|
|
|
841
841
|
<sf-i-reporting id="reporting-format" mode="view"></sf-i-reporting>
|
|
842
842
|
</div>
|
|
843
843
|
|
|
844
|
-
</sf-i-events>
|
|
844
|
+
</sf-i-events>
|
|
845
845
|
<!-- <sf-i-events name="Calendar" apiid="dwqyez2puoxmu.cloudfront.net/event" mode="consumer" apiidtags="dnytrdlrmxgsy.cloudfront.net/tagging" apiidstatutes="dnytrdlrmxgsy.cloudfront.net/statute" apiiddefinitions="dwqyez2puoxmu.cloudfront.net/definition" apiidreportformats="dwqyez2puoxmu.cloudfront.net/reportformat" apiidnotices="gghnbi7hku2qj5twrea6xxcaya0aqeis.lambda-url.us-east-1.on.aws" fill="solid" username="Viewer J1" userprofileid="344c84d2-5976-47ff-949b-49f6fa9627eb" projectid="41ab3c86-ccc0-4c0e-8e31-cd079a07a710" projectname="ABC Global" countryid="07d73b44-648d-4301-82c4-d6df43397824" myrole="viewer" showregisterexport="false" features="["notices"]" eventfielddependencies="[{"type": "foreignkey", "parent": "country", "child": "state"},{"type": "foreignkey", "parent": "category", "child": "subcategory"},{"type": "foreignkey", "parent": "frequency", "child": "subfrequency"}]" eventfields="[{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/riskarea", "field": "riskarea"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/jurisdiction", "field": "jurisdiction"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/updatetype", "field": "updatetype"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/country", "field": "country"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/specificity", "field": "specificity"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/risk", "field": "risk"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/frequency", "field": "frequency"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/category", "field": "category"},{"type": "sf-i-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/obligationtype", "field": "obligationtype"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/state", "field": "state"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subfrequency", "field": "subfrequency"},{"type": "sf-i-sub-select", "apiId": "dnytrdlrmxgsy.cloudfront.net/subcategory", "field": "subcategory"},{"type": "sf-i-form", "apiId": "dnytrdlrmxgsy.cloudfront.net/statute", "field": "statute", "projectField": "name"}]" eventpreviewfields="["obligation"]" eventhidefields="["comments","documents","lastupdated","approved","tags"]" calendarstartdd="01" calendarstartmm="04" calendarstartyyyy="2025">
|
|
846
846
|
|
|
847
847
|
<div slot="uploader">
|
package/package.json
CHANGED
package/sf-i-events.d.ts
CHANGED
|
@@ -478,7 +478,7 @@ export declare class SfIEvents extends LitElement {
|
|
|
478
478
|
renderCalendarEventSummary: () => string;
|
|
479
479
|
renderCalendarEventSummaryViewer: () => string;
|
|
480
480
|
renderStatisticsFiltersTableStart: () => string;
|
|
481
|
-
renderStatisticsFiltersTableRow: (index: number, filterUser?: boolean) => string;
|
|
481
|
+
renderStatisticsFiltersTableRow: (index: number, filterUser?: boolean, isLocation?: boolean) => string;
|
|
482
482
|
renderStatisticsFiltersTableEnd: () => string;
|
|
483
483
|
getCalendarRowHide: (events: any, i: number, lastDay: number, month: number, firstDate?: any, currDate?: any) => boolean;
|
|
484
484
|
renderCalendarRowDivStart: (i: number, firstDate?: any, ddmm?: string) => string;
|
package/sf-i-events.js
CHANGED
|
@@ -2449,19 +2449,19 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2449
2449
|
html += '<table id="statistics-table" part="statistics-table" class="statistics-table w-100"><tbody>';
|
|
2450
2450
|
return html;
|
|
2451
2451
|
};
|
|
2452
|
-
this.renderStatisticsFiltersTableRow = (index, filterUser = false) => {
|
|
2452
|
+
this.renderStatisticsFiltersTableRow = (index, filterUser = false, isLocation = false) => {
|
|
2453
2453
|
var html = '';
|
|
2454
2454
|
html += '<tr class="tablerow">';
|
|
2455
|
-
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">FILTER_CRITERIA_NAME</div><div part="td-head-click" id="filter-' + index + '">DASHBOARD_FILTER_NAME</div>';
|
|
2455
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">FILTER_CRITERIA_NAME</div><div part="td-head' + (isLocation ? '' : '-click') + '" id="filter-' + index + '">DASHBOARD_FILTER_NAME</div>';
|
|
2456
2456
|
if (filterUser) {
|
|
2457
2457
|
html += '<div part="td-head" class="pl-0-imp w-100 d-flex align-center">Last Access</div><div>DASHBOARD_LAST_ACTIVE</div><div part="td-head" class="pl-0-imp w-100 d-flex align-center">Last Action</div><div>DASHBOARD_LAST_ACTION</div>';
|
|
2458
2458
|
}
|
|
2459
2459
|
html += '</div></td>';
|
|
2460
|
-
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" id="filter-not-started-' + index + '" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-icons color-not-started">schedule</span> Not Started</div><div>DASHBOARD_NOT_STARTED</div></div></td>';
|
|
2461
|
-
html += '<td part="td-body" id="filter-pending-approval-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-pending">pending</span> Pending Approval</div><div>DASHBOARD_PENDING_APPROVAL</div></div></td>';
|
|
2462
|
-
html += '<td part="td-body" id="filter-rejected-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-rejected">block</span> Rejected</div><div>DASHBOARD_REJECTED</div></div></td>';
|
|
2463
|
-
html += '<td part="td-body" id="filter-approved-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-done">check_circle</span> Approved</div><div>DASHBOARD_APPROVED</div></div></td>';
|
|
2464
|
-
html += '<td part="td-body" id="filter-total-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>';
|
|
2460
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" id="filter-not-started-' + index + '" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-icons color-not-started">schedule</span> Not Started</div><div>DASHBOARD_NOT_STARTED</div></div></td>';
|
|
2461
|
+
html += '<td part="td-body" id="filter-pending-approval-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-pending">pending</span> Pending Approval</div><div>DASHBOARD_PENDING_APPROVAL</div></div></td>';
|
|
2462
|
+
html += '<td part="td-body" id="filter-rejected-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-rejected">block</span> Rejected</div><div>DASHBOARD_REJECTED</div></div></td>';
|
|
2463
|
+
html += '<td part="td-body" id="filter-approved-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-done">check_circle</span> Approved</div><div>DASHBOARD_APPROVED</div></div></td>';
|
|
2464
|
+
html += '<td part="td-body" id="filter-total-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') + '" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>';
|
|
2465
2465
|
html += '</tr>';
|
|
2466
2466
|
return html;
|
|
2467
2467
|
};
|
|
@@ -2547,7 +2547,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2547
2547
|
html += '<div class="stream-events-container flex-grow" part="' + bgStatus + '">';
|
|
2548
2548
|
html += '<div class="hidden-tags hide">' + JSON.stringify(event['tags']) + '</div>';
|
|
2549
2549
|
html += '<div class="hidden-title hide"><table><thead><th part="badge-filtered"><i>not filtered</i></th></thead></table></div>';
|
|
2550
|
-
// html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + '<input id="button-select-' + mmdd.replace('/', '-') + '-' + itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g, '_') + '-' + ((event.module ?? false) ? event.module : 'compliance') + '-' + ((event.isbulk == null || event.isbulk == false) ? "" : "bulk") + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? "reportformat" : "") + '" class="button-select mr-10 ' + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? 'hide' : '') + '" type="checkbox"/>' + (event.isbulk != null && event.isbulk == true ? '<div class="lds-dual-ring1 bulk-loader mr-10"></div>' : '') + '<sf-i-elastic-text class="stream-event-title' + (event.isbulk == null || event.isbulk == false ? ' button-event-title' : '') + '" id="stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + itemNumber + '-' + ((event.module ?? false) ? event.module : 'compliance') + '" text="' + event['obligationtitle'] + '" minLength="' + (event.
|
|
2550
|
+
// html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + '<input id="button-select-' + mmdd.replace('/', '-') + '-' + itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g, '_') + '-' + ((event.module ?? false) ? event.module : 'compliance') + '-' + ((event.isbulk == null || event.isbulk == false) ? "" : "bulk") + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? "reportformat" : "") + '" class="button-select mr-10 ' + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? 'hide' : '') + '" type="checkbox"/>' + (event.isbulk != null && event.isbulk == true ? '<div class="lds-dual-ring1 bulk-loader mr-10"></div>' : '') + '<sf-i-elastic-text class="stream-event-title' + (event.isbulk == null || event.isbulk == false ? ' button-event-title' : '') + '" id="stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + itemNumber + '-' + ((event.module ?? false) ? event.module : 'compliance') + '" text="' + event['obligationtitle'] + '" minLength="' + (event.concise == null ? "100" : "60") + '"></sf-i-elastic-text>' + event.concise == null ? ('') : ('<div part="stream-event-location" class="stream-event-location ml-5">' + event.locationname.replace(/ *\([^)]*\) */g, "") + '</div><div part="stream-event-risk-' + event.risk[0].toLowerCase().replace(/ /g, '-') + '" class="stream-event-risk ml-5">' + event.risk[0] + '</div>') + (((event.reportformat != null && event.reportformat.length > 0) || (event.customreporting != null)) ? '' : ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + itemNumber + '" part="button-list-reporting" class="material-icons ml-10 button-list-reporting">edit_note</button>')) + ((event.concise == null && lastUpdated.length > 0) ? (' <div part="event-last-updated-time" class="d-flex align-center">' + lastUpdated + '</div>') : "") + '</div>';
|
|
2551
2551
|
const isBulk = event.isbulk === true;
|
|
2552
2552
|
const hasReportFormat = ((_a = event.reportformat) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
2553
2553
|
const hasCustomReporting = event.customreporting != null;
|
|
@@ -2563,7 +2563,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2563
2563
|
const showCheckbox = !(hasReportFormat || isBulk || hasCustomReporting);
|
|
2564
2564
|
const showReportingButton = !hasReportFormat && !hasCustomReporting && event.reporters == null;
|
|
2565
2565
|
const showLocationRisk = event.reporters == null;
|
|
2566
|
-
const showLastUpdated = event.
|
|
2566
|
+
const showLastUpdated = event.concise == null && lastUpdated.length > 0;
|
|
2567
2567
|
html += `
|
|
2568
2568
|
<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">
|
|
2569
2569
|
<input
|
|
@@ -2576,7 +2576,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2576
2576
|
class="stream-event-title${!isBulk ? ' button-event-title' : ''}"
|
|
2577
2577
|
id="stream-event-title-${mmddSanitized}-${itemNumber}-${moduleType}"
|
|
2578
2578
|
text="${event.obligationtitle}"
|
|
2579
|
-
minLength="${event.
|
|
2579
|
+
minLength="${event.concise == null ? '100' : '60'}">
|
|
2580
2580
|
</sf-i-elastic-text>
|
|
2581
2581
|
${showLocationRisk ? `
|
|
2582
2582
|
<div part="stream-event-location" class="stream-event-location ml-5">
|
|
@@ -2601,7 +2601,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2601
2601
|
` : ''}
|
|
2602
2602
|
</div>
|
|
2603
2603
|
`;
|
|
2604
|
-
if (event.
|
|
2604
|
+
if (event.concise == null && remarks.length > 0) {
|
|
2605
2605
|
html += '<div part="stream-events-event-subtitle" class="stream-events-event-subtitle">' + remarks + ', occurred on ' + occurrenceDate + '</div>';
|
|
2606
2606
|
}
|
|
2607
2607
|
// console.log('returning divstarthtml', html);
|
|
@@ -2877,12 +2877,12 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
2877
2877
|
this.renderCalendarAnnotations = (event, mmdd, j) => {
|
|
2878
2878
|
var html = '';
|
|
2879
2879
|
html += '<div class="hidden-filtername hide"><table><thead><th part="badge-filter-name" class="filtername"></th></thead></table></div>';
|
|
2880
|
-
// if(event.
|
|
2881
|
-
let reporterStr = event.
|
|
2880
|
+
// if(event.concise == null && event.approvers != null){
|
|
2881
|
+
let reporterStr = event.concise == null ? this.getReporterStringFromEvent(event) : "";
|
|
2882
2882
|
let approverStr = event.approvers != null ? this.getApproverStringFromEvent(event) : "";
|
|
2883
2883
|
let graphParam = this.getGraphParam(event);
|
|
2884
2884
|
// console.log("graphParam", graphParam.split(';')[0]);
|
|
2885
|
-
html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.
|
|
2885
|
+
html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + '</div>';
|
|
2886
2886
|
// }
|
|
2887
2887
|
return html;
|
|
2888
2888
|
};
|
|
@@ -3442,7 +3442,7 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
3442
3442
|
}
|
|
3443
3443
|
}
|
|
3444
3444
|
}
|
|
3445
|
-
filtersTableHtml += this.renderStatisticsFiltersTableRow(filterindex, lastAction != "" || lastActive != "");
|
|
3445
|
+
filtersTableHtml += this.renderStatisticsFiltersTableRow(filterindex, lastAction != "" || lastActive != "", filtercriteria == "location");
|
|
3446
3446
|
if (filterindex % 2 == 0) {
|
|
3447
3447
|
filtersTableHtml = filtersTableHtml.replace(/TD_BODY_CLASS/g, "td-light");
|
|
3448
3448
|
}
|
|
@@ -5167,7 +5167,8 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
5167
5167
|
buttonRefresh.addEventListener('click', async () => {
|
|
5168
5168
|
this.processDateSelectionViewer(eventsContainer);
|
|
5169
5169
|
});
|
|
5170
|
-
|
|
5170
|
+
let filtercriteria = this._SfCustomContainer.querySelector('#select-filter-criteria').value;
|
|
5171
|
+
if (Object.keys(this.statisticsFiltersData).length > 0 && filtercriteria != "location") {
|
|
5171
5172
|
this.renderDrilldownListeners(eventsContainer);
|
|
5172
5173
|
}
|
|
5173
5174
|
};
|
|
@@ -7480,8 +7481,20 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7480
7481
|
(_j = this._SfCustomContainer.querySelector('#button-this-year-mobile')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
|
|
7481
7482
|
this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
7482
7483
|
this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
7483
|
-
|
|
7484
|
-
|
|
7484
|
+
let year = parseInt(this.calendarStartYYYY);
|
|
7485
|
+
let month = parseInt(this.calendarStartMM) - 1;
|
|
7486
|
+
if (month === 0) {
|
|
7487
|
+
month = 12;
|
|
7488
|
+
year -= 1;
|
|
7489
|
+
}
|
|
7490
|
+
// Pad month
|
|
7491
|
+
const monthStr = month < 10 ? '0' + month : '' + month;
|
|
7492
|
+
// Determine last day of month (safe)
|
|
7493
|
+
const lastDay = new Date(year, month, 0).getDate(); // day 0 of next month gives last day of `month`
|
|
7494
|
+
const dayStr = lastDay < 10 ? '0' + lastDay : '' + lastDay;
|
|
7495
|
+
const finalDate = `${year + 1}-${monthStr}-${dayStr}`;
|
|
7496
|
+
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = finalDate;
|
|
7497
|
+
this._SfCustomContainer.querySelector('#stream-end-date').value = finalDate;
|
|
7485
7498
|
this.processDateSelection(this._SfCustomContainer);
|
|
7486
7499
|
});
|
|
7487
7500
|
(_k = this._SfCustomContainer.querySelector('#button-this-year')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', () => {
|
|
@@ -7688,15 +7701,39 @@ let SfIEvents = class SfIEvents extends LitElement {
|
|
|
7688
7701
|
(_j = this._SfCustomContainer.querySelector('#button-this-year-mobile')) === null || _j === void 0 ? void 0 : _j.addEventListener('click', () => {
|
|
7689
7702
|
this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
7690
7703
|
this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
7691
|
-
|
|
7692
|
-
|
|
7704
|
+
let year = parseInt(this.calendarStartYYYY);
|
|
7705
|
+
let month = parseInt(this.calendarStartMM) - 1;
|
|
7706
|
+
if (month === 0) {
|
|
7707
|
+
month = 12;
|
|
7708
|
+
year -= 1;
|
|
7709
|
+
}
|
|
7710
|
+
// Pad month
|
|
7711
|
+
const monthStr = month < 10 ? '0' + month : '' + month;
|
|
7712
|
+
// Determine last day of month (safe)
|
|
7713
|
+
const lastDay = new Date(year, month, 0).getDate(); // day 0 of next month gives last day of `month`
|
|
7714
|
+
const dayStr = lastDay < 10 ? '0' + lastDay : '' + lastDay;
|
|
7715
|
+
const finalDate = `${year + 1}-${monthStr}-${dayStr}`;
|
|
7716
|
+
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = finalDate;
|
|
7717
|
+
this._SfCustomContainer.querySelector('#stream-end-date').value = finalDate;
|
|
7693
7718
|
this.processDateSelectionViewer(this._SfCustomContainer);
|
|
7694
7719
|
});
|
|
7695
7720
|
(_k = this._SfCustomContainer.querySelector('#button-this-year')) === null || _k === void 0 ? void 0 : _k.addEventListener('click', () => {
|
|
7696
7721
|
this._SfCustomContainer.querySelector('#stream-start-date-mobile').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
7697
7722
|
this._SfCustomContainer.querySelector('#stream-start-date').value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
7698
|
-
|
|
7699
|
-
|
|
7723
|
+
let year = parseInt(this.calendarStartYYYY);
|
|
7724
|
+
let month = parseInt(this.calendarStartMM) - 1;
|
|
7725
|
+
if (month === 0) {
|
|
7726
|
+
month = 12;
|
|
7727
|
+
year -= 1;
|
|
7728
|
+
}
|
|
7729
|
+
// Pad month
|
|
7730
|
+
const monthStr = month < 10 ? '0' + month : '' + month;
|
|
7731
|
+
// Determine last day of month (safe)
|
|
7732
|
+
const lastDay = new Date(year, month, 0).getDate(); // day 0 of next month gives last day of `month`
|
|
7733
|
+
const dayStr = lastDay < 10 ? '0' + lastDay : '' + lastDay;
|
|
7734
|
+
const finalDate = `${year + 1}-${monthStr}-${dayStr}`;
|
|
7735
|
+
this._SfCustomContainer.querySelector('#stream-end-date-mobile').value = finalDate;
|
|
7736
|
+
this._SfCustomContainer.querySelector('#stream-end-date').value = finalDate;
|
|
7700
7737
|
this.processDateSelectionViewer(this._SfCustomContainer);
|
|
7701
7738
|
});
|
|
7702
7739
|
(_l = this._SfCustomContainer.querySelector('#button-this-quarter-mobile')) === null || _l === void 0 ? void 0 : _l.addEventListener('click', () => {
|
package/src/sf-i-events.ts
CHANGED
|
@@ -4631,20 +4631,20 @@ export class SfIEvents extends LitElement {
|
|
|
4631
4631
|
|
|
4632
4632
|
}
|
|
4633
4633
|
|
|
4634
|
-
renderStatisticsFiltersTableRow = (index: number, filterUser: boolean = false) => {
|
|
4634
|
+
renderStatisticsFiltersTableRow = (index: number, filterUser: boolean = false, isLocation: boolean = false) => {
|
|
4635
4635
|
|
|
4636
4636
|
var html = '';
|
|
4637
4637
|
html += '<tr class="tablerow">'
|
|
4638
|
-
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">FILTER_CRITERIA_NAME</div><div part="td-head-click" id="filter-' + index + '">DASHBOARD_FILTER_NAME</div>'
|
|
4638
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head" class="pl-0-imp w-100 d-flex align-center">FILTER_CRITERIA_NAME</div><div part="td-head' + (isLocation ? '' : '-click') +'" id="filter-' + index + '">DASHBOARD_FILTER_NAME</div>'
|
|
4639
4639
|
if (filterUser) {
|
|
4640
4640
|
html += '<div part="td-head" class="pl-0-imp w-100 d-flex align-center">Last Access</div><div>DASHBOARD_LAST_ACTIVE</div><div part="td-head" class="pl-0-imp w-100 d-flex align-center">Last Action</div><div>DASHBOARD_LAST_ACTION</div>'
|
|
4641
4641
|
}
|
|
4642
4642
|
html += '</div></td>'
|
|
4643
|
-
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" id="filter-not-started-' + index + '" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-icons color-not-started">schedule</span> Not Started</div><div>DASHBOARD_NOT_STARTED</div></div></td>'
|
|
4644
|
-
html += '<td part="td-body" id="filter-pending-approval-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-pending">pending</span> Pending Approval</div><div>DASHBOARD_PENDING_APPROVAL</div></div></td>'
|
|
4645
|
-
html += '<td part="td-body" id="filter-rejected-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-rejected">block</span> Rejected</div><div>DASHBOARD_REJECTED</div></div></td>'
|
|
4646
|
-
html += '<td part="td-body" id="filter-approved-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-done">check_circle</span> Approved</div><div>DASHBOARD_APPROVED</div></div></td>'
|
|
4647
|
-
html += '<td part="td-body" id="filter-total-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head-click" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>'
|
|
4643
|
+
html += '<td part="td-body" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" id="filter-not-started-' + index + '" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-icons color-not-started">schedule</span> Not Started</div><div>DASHBOARD_NOT_STARTED</div></div></td>'
|
|
4644
|
+
html += '<td part="td-body" id="filter-pending-approval-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-pending">pending</span> Pending Approval</div><div>DASHBOARD_PENDING_APPROVAL</div></div></td>'
|
|
4645
|
+
html += '<td part="td-body" id="filter-rejected-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-rejected">block</span> Rejected</div><div>DASHBOARD_REJECTED</div></div></td>'
|
|
4646
|
+
html += '<td part="td-body" id="filter-approved-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" class="pl-0-imp w-100 d-flex align-center"><span class="small-icon material-symbols-outlined color-done">check_circle</span> Approved</div><div>DASHBOARD_APPROVED</div></div></td>'
|
|
4647
|
+
html += '<td part="td-body" id="filter-total-' + index + '" class="td-body TD_BODY_CLASS"><div class="d-flex align-center flex-wrap"><div part="td-head' + (isLocation ? '' : '-click') +'" class="pl-0-imp w-100 d-flex align-center">Total</div><div>DASHBOARD_TOTAL</div></div></td>'
|
|
4648
4648
|
html += '</tr>';
|
|
4649
4649
|
|
|
4650
4650
|
return html;
|
|
@@ -4759,7 +4759,7 @@ export class SfIEvents extends LitElement {
|
|
|
4759
4759
|
html += '<div class="stream-events-container flex-grow" part="' + bgStatus + '">';
|
|
4760
4760
|
html += '<div class="hidden-tags hide">' + JSON.stringify(event['tags']) + '</div>'
|
|
4761
4761
|
html += '<div class="hidden-title hide"><table><thead><th part="badge-filtered"><i>not filtered</i></th></thead></table></div>'
|
|
4762
|
-
// html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + '<input id="button-select-' + mmdd.replace('/', '-') + '-' + itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g, '_') + '-' + ((event.module ?? false) ? event.module : 'compliance') + '-' + ((event.isbulk == null || event.isbulk == false) ? "" : "bulk") + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? "reportformat" : "") + '" class="button-select mr-10 ' + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? 'hide' : '') + '" type="checkbox"/>' + (event.isbulk != null && event.isbulk == true ? '<div class="lds-dual-ring1 bulk-loader mr-10"></div>' : '') + '<sf-i-elastic-text class="stream-event-title' + (event.isbulk == null || event.isbulk == false ? ' button-event-title' : '') + '" id="stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + itemNumber + '-' + ((event.module ?? false) ? event.module : 'compliance') + '" text="' + event['obligationtitle'] + '" minLength="' + (event.
|
|
4762
|
+
// html += '<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">' + '<input id="button-select-' + mmdd.replace('/', '-') + '-' + itemNumber + '-' + (((event.makercheckers != null && (event.makercheckers).length > 0)) ? '1' : '0') + '-' + (((event.docs != null && (event.docs).length > 0)) ? '1' : '0') + '-' + event.entityid.replace(/-/g, '_') + '-' + event.locationid.replace(/-/g, '_') + '-' + event.id.replace(/-/g, '_') + '-' + event.duedate.split('/')[1] + '-' + event.duedate.split('/')[0] + '-' + event.duedate.split('/')[2] + '-' + partStatus.replace(/-/g, '_') + '-' + ((event.module ?? false) ? event.module : 'compliance') + '-' + ((event.isbulk == null || event.isbulk == false) ? "" : "bulk") + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? "reportformat" : "") + '" class="button-select mr-10 ' + (((event.reportformat != null && event.reportformat.length > 0) || (event.isbulk != null && event.isbulk == true) || (event.customreporting != null)) ? 'hide' : '') + '" type="checkbox"/>' + (event.isbulk != null && event.isbulk == true ? '<div class="lds-dual-ring1 bulk-loader mr-10"></div>' : '') + '<sf-i-elastic-text class="stream-event-title' + (event.isbulk == null || event.isbulk == false ? ' button-event-title' : '') + '" id="stream-event-title-' + mmdd.replace(/\//g, '-') + '-' + itemNumber + '-' + ((event.module ?? false) ? event.module : 'compliance') + '" text="' + event['obligationtitle'] + '" minLength="' + (event.concise == null ? "100" : "60") + '"></sf-i-elastic-text>' + event.concise == null ? ('') : ('<div part="stream-event-location" class="stream-event-location ml-5">' + event.locationname.replace(/ *\([^)]*\) */g, "") + '</div><div part="stream-event-risk-' + event.risk[0].toLowerCase().replace(/ /g, '-') + '" class="stream-event-risk ml-5">' + event.risk[0] + '</div>') + (((event.reportformat != null && event.reportformat.length > 0) || (event.customreporting != null)) ? '' : ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + itemNumber + '" part="button-list-reporting" class="material-icons ml-10 button-list-reporting">edit_note</button>')) + ((event.concise == null && lastUpdated.length > 0) ? (' <div part="event-last-updated-time" class="d-flex align-center">' + lastUpdated + '</div>') : "") + '</div>';
|
|
4763
4763
|
|
|
4764
4764
|
const isBulk = event.isbulk === true;
|
|
4765
4765
|
const hasReportFormat = event.reportformat?.length > 0;
|
|
@@ -4776,7 +4776,7 @@ export class SfIEvents extends LitElement {
|
|
|
4776
4776
|
const showCheckbox = !(hasReportFormat || isBulk || hasCustomReporting);
|
|
4777
4777
|
const showReportingButton = !hasReportFormat && !hasCustomReporting && event.reporters == null;
|
|
4778
4778
|
const showLocationRisk = event.reporters == null;
|
|
4779
|
-
const showLastUpdated = event.
|
|
4779
|
+
const showLastUpdated = event.concise == null && lastUpdated.length > 0;
|
|
4780
4780
|
|
|
4781
4781
|
html += `
|
|
4782
4782
|
<div part="stream-events-event-title" class="stream-events-event-title d-flex align-center pl-5 pb-5">
|
|
@@ -4790,7 +4790,7 @@ export class SfIEvents extends LitElement {
|
|
|
4790
4790
|
class="stream-event-title${!isBulk ? ' button-event-title' : ''}"
|
|
4791
4791
|
id="stream-event-title-${mmddSanitized}-${itemNumber}-${moduleType}"
|
|
4792
4792
|
text="${event.obligationtitle}"
|
|
4793
|
-
minLength="${event.
|
|
4793
|
+
minLength="${event.concise == null ? '100' : '60'}">
|
|
4794
4794
|
</sf-i-elastic-text>
|
|
4795
4795
|
${showLocationRisk ? `
|
|
4796
4796
|
<div part="stream-event-location" class="stream-event-location ml-5">
|
|
@@ -4816,7 +4816,7 @@ export class SfIEvents extends LitElement {
|
|
|
4816
4816
|
</div>
|
|
4817
4817
|
`;
|
|
4818
4818
|
|
|
4819
|
-
if (event.
|
|
4819
|
+
if (event.concise == null && remarks.length > 0) {
|
|
4820
4820
|
html += '<div part="stream-events-event-subtitle" class="stream-events-event-subtitle">' + remarks + ', occurred on ' + occurrenceDate + '</div>';
|
|
4821
4821
|
}
|
|
4822
4822
|
// console.log('returning divstarthtml', html);
|
|
@@ -5132,13 +5132,13 @@ export class SfIEvents extends LitElement {
|
|
|
5132
5132
|
var html = '';
|
|
5133
5133
|
|
|
5134
5134
|
html += '<div class="hidden-filtername hide"><table><thead><th part="badge-filter-name" class="filtername"></th></thead></table></div>'
|
|
5135
|
-
// if(event.
|
|
5136
|
-
let reporterStr = event.
|
|
5135
|
+
// if(event.concise == null && event.approvers != null){
|
|
5136
|
+
let reporterStr = event.concise == null ? this.getReporterStringFromEvent(event) : "";
|
|
5137
5137
|
let approverStr = event.approvers != null ? this.getApproverStringFromEvent(event) : "";
|
|
5138
5138
|
|
|
5139
5139
|
let graphParam = this.getGraphParam(event);
|
|
5140
5140
|
// console.log("graphParam", graphParam.split(';')[0]);
|
|
5141
|
-
html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.
|
|
5141
|
+
html += '<div class="d-flex align-center event-user-labels-container"><div part="badge-filter-name" class="graphparamname graphparamname1 mb-20' + (event.concise == null ? "" : ' hide') + '">' + graphParam.split(';')[0] + '</div>' + reporterStr + approverStr + ((event.concise == null && ((event.reportformat == null || event.reportformat.length == 0) && (event.customreporting == null))) ? ('<button id="button-list-reporting-' + mmdd.replace('/', '-') + '-' + j + '" part="button-list-reporting" class="material-icons ml-10 mb-20 button-list-reporting">edit_note</button>') : '') + '</div>';
|
|
5142
5142
|
// }
|
|
5143
5143
|
|
|
5144
5144
|
return html;
|
|
@@ -5760,7 +5760,7 @@ export class SfIEvents extends LitElement {
|
|
|
5760
5760
|
}
|
|
5761
5761
|
}
|
|
5762
5762
|
}
|
|
5763
|
-
filtersTableHtml += this.renderStatisticsFiltersTableRow(filterindex, lastAction != "" || lastActive != "")
|
|
5763
|
+
filtersTableHtml += this.renderStatisticsFiltersTableRow(filterindex, lastAction != "" || lastActive != "", filtercriteria == "location")
|
|
5764
5764
|
if (filterindex % 2 == 0) {
|
|
5765
5765
|
filtersTableHtml = filtersTableHtml.replace(/TD_BODY_CLASS/g, "td-light");
|
|
5766
5766
|
} else {
|
|
@@ -7708,7 +7708,8 @@ export class SfIEvents extends LitElement {
|
|
|
7708
7708
|
buttonRefresh.addEventListener('click', async () => {
|
|
7709
7709
|
this.processDateSelectionViewer(eventsContainer)
|
|
7710
7710
|
})
|
|
7711
|
-
|
|
7711
|
+
let filtercriteria = ((this._SfCustomContainer as HTMLDivElement).querySelector('#select-filter-criteria') as HTMLSelectElement).value
|
|
7712
|
+
if (Object.keys(this.statisticsFiltersData).length > 0 && filtercriteria != "location") {
|
|
7712
7713
|
this.renderDrilldownListeners(eventsContainer);
|
|
7713
7714
|
}
|
|
7714
7715
|
}
|
|
@@ -10503,8 +10504,23 @@ export class SfIEvents extends LitElement {
|
|
|
10503
10504
|
(this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year-mobile')?.addEventListener('click', () => {
|
|
10504
10505
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
10505
10506
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
10506
|
-
|
|
10507
|
-
|
|
10507
|
+
let year = parseInt(this.calendarStartYYYY);
|
|
10508
|
+
let month = parseInt(this.calendarStartMM) - 1;
|
|
10509
|
+
|
|
10510
|
+
if (month === 0) {
|
|
10511
|
+
month = 12;
|
|
10512
|
+
year -= 1;
|
|
10513
|
+
}
|
|
10514
|
+
|
|
10515
|
+
// Pad month
|
|
10516
|
+
const monthStr = month < 10 ? '0' + month : '' + month;
|
|
10517
|
+
|
|
10518
|
+
// Determine last day of month (safe)
|
|
10519
|
+
const lastDay = new Date(year, month, 0).getDate(); // day 0 of next month gives last day of `month`
|
|
10520
|
+
const dayStr = lastDay < 10 ? '0' + lastDay : '' + lastDay;
|
|
10521
|
+
const finalDate = `${year + 1}-${monthStr}-${dayStr}`;
|
|
10522
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = finalDate;
|
|
10523
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = finalDate;
|
|
10508
10524
|
this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
10509
10525
|
});
|
|
10510
10526
|
(this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year')?.addEventListener('click', () => {
|
|
@@ -10751,15 +10767,45 @@ export class SfIEvents extends LitElement {
|
|
|
10751
10767
|
(this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year-mobile')?.addEventListener('click', () => {
|
|
10752
10768
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
10753
10769
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
10754
|
-
|
|
10755
|
-
|
|
10770
|
+
let year = parseInt(this.calendarStartYYYY);
|
|
10771
|
+
let month = parseInt(this.calendarStartMM) - 1;
|
|
10772
|
+
|
|
10773
|
+
if (month === 0) {
|
|
10774
|
+
month = 12;
|
|
10775
|
+
year -= 1;
|
|
10776
|
+
}
|
|
10777
|
+
|
|
10778
|
+
// Pad month
|
|
10779
|
+
const monthStr = month < 10 ? '0' + month : '' + month;
|
|
10780
|
+
|
|
10781
|
+
// Determine last day of month (safe)
|
|
10782
|
+
const lastDay = new Date(year, month, 0).getDate(); // day 0 of next month gives last day of `month`
|
|
10783
|
+
const dayStr = lastDay < 10 ? '0' + lastDay : '' + lastDay;
|
|
10784
|
+
const finalDate = `${year + 1}-${monthStr}-${dayStr}`;
|
|
10785
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = finalDate;
|
|
10786
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = finalDate;
|
|
10756
10787
|
this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
|
|
10757
10788
|
});
|
|
10758
10789
|
(this._SfCustomContainer as HTMLDivElement).querySelector('#button-this-year')?.addEventListener('click', () => {
|
|
10759
10790
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date-mobile') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
10760
10791
|
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-start-date') as HTMLInputElement).value = this.calendarStartYYYY + '-' + this.calendarStartMM + '-' + this.calendarStartDD;
|
|
10761
|
-
|
|
10762
|
-
|
|
10792
|
+
let year = parseInt(this.calendarStartYYYY);
|
|
10793
|
+
let month = parseInt(this.calendarStartMM) - 1;
|
|
10794
|
+
|
|
10795
|
+
if (month === 0) {
|
|
10796
|
+
month = 12;
|
|
10797
|
+
year -= 1;
|
|
10798
|
+
}
|
|
10799
|
+
|
|
10800
|
+
// Pad month
|
|
10801
|
+
const monthStr = month < 10 ? '0' + month : '' + month;
|
|
10802
|
+
|
|
10803
|
+
// Determine last day of month (safe)
|
|
10804
|
+
const lastDay = new Date(year, month, 0).getDate(); // day 0 of next month gives last day of `month`
|
|
10805
|
+
const dayStr = lastDay < 10 ? '0' + lastDay : '' + lastDay;
|
|
10806
|
+
const finalDate = `${year + 1}-${monthStr}-${dayStr}`;
|
|
10807
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date-mobile') as HTMLInputElement).value = finalDate;
|
|
10808
|
+
((this._SfCustomContainer as HTMLDivElement).querySelector('#stream-end-date') as HTMLInputElement).value = finalDate;
|
|
10763
10809
|
this.processDateSelectionViewer((this._SfCustomContainer as HTMLDivElement));
|
|
10764
10810
|
});
|
|
10765
10811
|
|