sf-i-reporting 1.0.70 → 1.0.71
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/package.json +1 -1
- package/sf-i-reporting.d.ts.map +1 -1
- package/sf-i-reporting.js +80 -46
- package/sf-i-reporting.js.map +1 -1
- package/src/sf-i-reporting.ts +86 -53
package/package.json
CHANGED
package/sf-i-reporting.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-i-reporting.d.ts","sourceRoot":"","sources":["src/sf-i-reporting.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,UAAU,EAAa,gBAAgB,EAAC,MAAM,KAAK,CAAC;AAO5D,OAAO,EAAC,UAAU,EAAE,eAAe,EAA6D,MAAM,eAAe,CAAC;AAYtH;;;;;;;;;;GAUG;AACH,qBACa,YAAa,SAAQ,UAAU;IAE1C,KAAK,EAAE,MAAM,CAAM;IAGnB,aAAa,EAAE,MAAM,CAAM;IAG3B,SAAS,EAAE,MAAM,CAAM;IAGvB,WAAW,EAAE,MAAM,CAAM;IAGzB,UAAU,EAAE,MAAM,CAAQ;IAO1B,aAAa,YAGZ;IAGD,kBAAkB,EAAE,MAAM,CAAQ;IAGlC,kBAAkB,YAEjB;IAGD,IAAI,EAAE,MAAM,CAAM;IAGlB,IAAI,EAAE,MAAM,CAAM;IAGlB,IAAI,EAAE,MAAM,CAAe;IAG3B,iBAAiB,EAAE,MAAM,CAAQ;IAGjC,WAAW,EAAE,MAAM,CAAM;IAEzB,oBAAoB,YAEnB;IAGD,OAAO,EAAE,MAAM,CAAO;IAEtB,UAAU,YAET;IAGD,aAAa,EAAE,MAAM,CAAa;IAElC,SAAS,EAAE,GAAG,EAAE,CAAM;IAEtB,IAAI,EAAE,GAAG,EAAE,CAAM;IAEjB,SAAS,EAAE,OAAO,CAAS;IAE3B,qBAAqB,EAAE,MAAM,CAAK;IAClC,qBAAqB,EAAE,MAAM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MT;IAED,UAAU,sBAKT;cAEkB,YAAY,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,IAAI;IAMnG,iBAAiB;IAIjB,MAAM;CAsKhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
package/sf-i-reporting.js
CHANGED
|
@@ -386,6 +386,9 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
386
386
|
else {
|
|
387
387
|
if (element.type == "section") {
|
|
388
388
|
let dataObj = createDataObject({ id: 'section-' + sectionCount, name: element.name, type: element.type });
|
|
389
|
+
if (this.editdisable == "true") {
|
|
390
|
+
dataObj.collapse = "true";
|
|
391
|
+
}
|
|
389
392
|
this.dataModel.push(dataObj);
|
|
390
393
|
sectionCount++;
|
|
391
394
|
}
|
|
@@ -406,7 +409,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
406
409
|
// <h3 part="results-title" class="m-0">${this.name}</h3>
|
|
407
410
|
// <button id="button-detail-close" part="button-icon" class="material-icons">close</button>
|
|
408
411
|
// </div>`
|
|
409
|
-
html += `<div class="d-flex flex-col md-20-ml-10" part="title-section">
|
|
412
|
+
html += `${this.name.length > 1 ? `<div class="d-flex flex-col md-20-ml-10" part="title-section">
|
|
410
413
|
<div class="d-flex w-100-m-0 justify-between align-center">
|
|
411
414
|
${this.editdisable != "true" ? `
|
|
412
415
|
<button id="button-back" part="button-icon" class="button-icon-click"><span class="material-icons">keyboard_backspace</span></button>` : ''}
|
|
@@ -436,7 +439,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
436
439
|
<div class="progress-bar-finished" part="progress-bar-finished"></div>
|
|
437
440
|
<div class="progress-bar-incomplete" part="progress-bar-incomplete"></div>
|
|
438
441
|
</div>
|
|
439
|
-
</div
|
|
442
|
+
</div>` : ``}
|
|
440
443
|
<div class="d-flex ${this.formviewclass} form-container align-stretch p-10" part="${this.published ? "form-container-published" : "form-container"}">`;
|
|
441
444
|
let firstFlag = true;
|
|
442
445
|
for (let element of this.dataModel) {
|
|
@@ -703,7 +706,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
703
706
|
let customEvent = new CustomEvent('valueChanged');
|
|
704
707
|
this.dispatchEvent(customEvent);
|
|
705
708
|
}, 500);
|
|
706
|
-
if (this.getPrepopulateJson().history != null && this.getPrepopulateJson().history.length > 0) {
|
|
709
|
+
if (this.getPrepopulateJson().history != null && Object.keys(this.getPrepopulateJson().history).length > 0) {
|
|
707
710
|
this.populateHistory();
|
|
708
711
|
}
|
|
709
712
|
};
|
|
@@ -715,54 +718,60 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
715
718
|
html += `
|
|
716
719
|
<div class="d-flex flex-col" part="section-container"><div id="history" class="section-head d-flex align-center justify-between" part="section-head-collapsed"><h3 part="section-title-collapsed" id="section-history-title">History</h3><div class="material-icons" id="section-history-icon">keyboard_arrow_down</div></div><div id="section-history-body" class="section-body d-flex ${this.formviewclass} hide" part="section-body">
|
|
717
720
|
`;
|
|
718
|
-
for (let [
|
|
719
|
-
console.log('history',
|
|
720
|
-
html +=
|
|
721
|
-
|
|
722
|
-
|
|
721
|
+
for (let [indexDate, historyDate] of Object.keys(this.getPrepopulateJson().history).entries()) {
|
|
722
|
+
console.log('history', historyDate);
|
|
723
|
+
html += `
|
|
724
|
+
<div class="d-flex flex-col" part="section-container"><div id="history-date-${indexDate}" class="history-section-head section-head d-flex align-center justify-between" part="section-head-collapsed"><h3 part="section-title-collapsed" id="section-history-title-${indexDate}">${historyDate}</h3><div class="material-icons" id="section-history-icon-${indexDate}">keyboard_arrow_down</div></div><div id="section-history-body-${indexDate}" class="section-body d-flex ${this.formviewclass} hide" part="section-body">
|
|
725
|
+
`;
|
|
726
|
+
for (let [index, historyItem] of this.getPrepopulateJson().history[historyDate].entries()) {
|
|
727
|
+
html += `<sf-i-reporting name="" id="history-reporting-${historyDate}-${index}" class="history-reporting" exportparts="uploader-extracted-text:reporting-uploader-extracted-text, uploader-sf-upload-message:reporting-uploader-sf-upload-message, uploader-sf-upload-submessage:reporting-uploader-sf-upload-submessage, uploader-extracted-text-chip:reporting-uploader-extracted-text-chip, uploader-extracted-text-chip-failed:reporting-uploader-extracted-text-chip-failed, uploader-doctype-verify-badge:reporting-uploader-doctype-verify-badge,span-submit-published:reporting-span-submit-published, span-submit-unpublished:reporting-span-submit-unpublished, reporting-container:reporting-reporting-container, button-icon:reporting-button-icon, uploader-button-icon:reporting-uploader-button-icon, sf-i-form-modal-container:reporting-sf-i-form-modal-container, next-calendar-date:reporting-next-calendar-date, last-calendar-date:reporting-last-calendar-date, input-publish-checkbox:reporting-input-publish-checkbox, button-icon-light:reporting-button-icon-light, button-icon-small:reporting-button-icon-small, uploader-input-label:reporting-uploader-input-label, input-radio:reporting-input-radio, radio-label:reporting-radio-label, input-textarea:reporting-input-textarea, input-date:reporting-input-date, input-select-single:reporting-input-select-single, textarea-container:reporting-textarea-container, section-body:reporting-section-body, section-container:reporting-section-container, date-container:reporting-date-container, input-sf-i-uploader:reporting-input-sf-i-uploader, published-container:reporting-published-container, selected-option:reporting-selected-option, input-select-multi-option:reporting-input-select-multi-option, select-option-label:reporting-select-option-label, input-sf-i-form:reporting-input-sf-i-form, input-sf-i-bricks:reporting-input-sf-i-bricks, uploader-input:reporting-uploader-input, form-container:reporting-form-container, published-container:reporting-published-container, form-container-published:reporting-form-container-published, subsection:reporting-subsection, results-title:reporting-results-title, td-head:reporting-td-head, td-action:reporting-td-action, td-body:reporting-td-body, td-body-2:reporting-td-body-2, add-button:reporting-add-button, uploader-button:reporting-uploader-button, section-head-collapsed:reporting-section-head-collapsed, section-title-expanded:reporting-section-title-expanded, section-title-collapsed:reporting-section-title-collapsed, section-head-expanded:reporting-section-head-expanded, progress-bar-finished:reporting-progress-bar-finished, progress-bar-complete:reporting-progress-bar-complete, progress-bar-incomplete:reporting-progress-bar-incomplete, section-success-icon:reporting-section-success-icon, section-body:reporting-section-body, title-section:reporting-title-section, button-lg:reporting-button-lg, uploader-detail-container:reporting-uploader-detail-container, textarea-label:reporting-textarea-label, date-label:reporting-date-label, commentbox:reporting-commentbox, comment-username:reporting-comment-username, detail-head:reporting-detail-head" name="Notice Details" mode="view" editdisable="true" formviewclass="flex-wrap" prepopulatevaljson="${JSON.stringify(historyItem.object).replace(/"/g, '"')}"></sf-i-reporting>`;
|
|
728
|
+
let comments = (_a = historyItem.object.comments) !== null && _a !== void 0 ? _a : [];
|
|
729
|
+
if (historyItem.object.documents != null && historyItem.object.documents.length > 0) {
|
|
730
|
+
html += '<div class="d-flex justify-between m-20">';
|
|
731
|
+
html += '<h3 part="history-docs-title" class="m-0"><br />Documents</h3>';
|
|
732
|
+
html += '</div>';
|
|
733
|
+
html += `
|
|
734
|
+
<sf-i-uploader prepopulatedInputArr="${JSON.stringify(historyItem.object.documents).replace(/"/g, '"')}" exportparts="detail-container:uploader-detail-container, errmsg:uploader-errmsg, successmsg:uploader-successmsg, sf-upload-message:uploader:sf-upload-message, sf-upload-submessage: uploader-sf-upload-submessage, doctype-verify-badge: uploader-doctype-verify-badge, details-controls-container: uploader-details-controls-container, button-icon: uploader-button-icon, pdf-controls-container: uploader-pdf-controls-container, pdf-pages: uploader-pdf-pages, pdf-page-num: uploader-pdf-page-num, pdf-page-count: uploader-pdf-page-count, pdf-canvas: uploader-pdf-canvas, image-container: uploader-image-container, image-component: uploader-image-component, pdf-thumbnail-container: uploader-pdf-thumbnail-container, pdf-canvas-thumbnail: uploader-pdf-canvas-thumbnail, sf-uploader-download-message: uploader-sf-uploader-download-message, input: uploader-input, upload-buttons-container: uploader-upload-buttons-container, doctype-badge: uploader-doctype-badge, upload-status: uploader-upload-status, ext-badge:uploader-ext-badge, extracted-meta: uploader-extracted-meta, extracted-text-chip: uploader-extracted-text-chip, extracted-text-chip-parsed: uploader-extracted-text-chip-parsed, extracted-text-chip-failed: uploader-extracted-text-chip-failed, matches-title: uploader-matches-title, matches:uploader-matches, extracted-title: uploader-extracted-title, extracted-text: uploader-extracted-text, disclaimer-message-container: uploader-disclaimer-message-container, message-container: uploader-message-container, button: uploader-button" class="reporting-sf-i-uploader" part="input-sf-i-uploader" id="history-doc-uploader-${index}" maximize="yes" max="${historyItem.object.documents.length}" apiid="${this.apiIdUploader}" projectid="${this.projectid}" mode="view"></sf-i-uploader>
|
|
735
|
+
`;
|
|
736
|
+
}
|
|
723
737
|
html += '<div class="d-flex justify-between m-20">';
|
|
724
|
-
html += '<h3 part="history-
|
|
738
|
+
html += '<h3 part="history-comments-title" class="m-0"><br />Comments</h3>';
|
|
725
739
|
html += '</div>';
|
|
726
|
-
html +=
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
for (var j = 0; j < Object.keys(jsonComments).length; j++) {
|
|
748
|
-
htmlTable += '<div class="mb-20">';
|
|
749
|
-
htmlTable += ('<div part="detail-head">' + Object.keys(jsonComments)[j] + '</div>');
|
|
750
|
-
htmlTable += ('<sf-i-elastic-text text="' + jsonComments[Object.keys(jsonComments)[j]] + '" minLength="20"></sf-i-elastic-text>');
|
|
751
|
-
htmlTable += '</div>';
|
|
740
|
+
html += '<div class="m-20">';
|
|
741
|
+
html += '<div class="d-flex flex-col">';
|
|
742
|
+
for (var i = 0; i < comments.length; i++) {
|
|
743
|
+
html += '<div part="commentbox" class="d-flex commentbox ' + (comments[i].author + "").toLowerCase() + 'box">';
|
|
744
|
+
html += '<div class="mr-20 d-flex flex-col align-end"><span part="comment-username">' + (comments[i].username != null ? comments[i].username : '') + '</span><span part="td-head">' + comments[i].author + '</span></div>';
|
|
745
|
+
const onlyCommentText = (comments[i].comment + "").replace(/ *\([^)]*\) */g, "").trim();
|
|
746
|
+
try {
|
|
747
|
+
const jsonComments = JSON.parse(onlyCommentText);
|
|
748
|
+
if (Util.isInteger(jsonComments)) {
|
|
749
|
+
html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + comments[i].timestamp + '</span></small></div>';
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
//console.log('json comments', jsonComments);
|
|
753
|
+
var htmlTable = '';
|
|
754
|
+
for (var j = 0; j < Object.keys(jsonComments).length; j++) {
|
|
755
|
+
htmlTable += '<div class="mb-20">';
|
|
756
|
+
htmlTable += ('<div part="detail-head">' + Object.keys(jsonComments)[j] + '</div>');
|
|
757
|
+
htmlTable += ('<sf-i-elastic-text text="' + jsonComments[Object.keys(jsonComments)[j]] + '" minLength="20"></sf-i-elastic-text>');
|
|
758
|
+
htmlTable += '</div>';
|
|
759
|
+
}
|
|
760
|
+
html += '<div class="">' + htmlTable + '<small><span class="muted">' + comments[i].timestamp + '</span></small></div>';
|
|
752
761
|
}
|
|
753
|
-
html += '<div class="">' + htmlTable + '<small><span class="muted">' + comments[i].timestamp + '</span></small></div>';
|
|
754
762
|
}
|
|
763
|
+
catch (e) {
|
|
764
|
+
//console.log('json comments exception', comments[i]);
|
|
765
|
+
html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + comments[i].timestamp + '</span></small></div>';
|
|
766
|
+
}
|
|
767
|
+
html += '</div>';
|
|
755
768
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
html += '<div class="">' + comments[i].comment + '<br /><small><span class="muted">' + comments[i].timestamp + '</span></small></div>';
|
|
769
|
+
if (comments.length === 0) {
|
|
770
|
+
html += '<div><strong>No comments!</strong></div>';
|
|
759
771
|
}
|
|
760
772
|
html += '</div>';
|
|
773
|
+
html += '</div>';
|
|
761
774
|
}
|
|
762
|
-
if (comments.length === 0) {
|
|
763
|
-
html += '<div><strong>No comments!</strong></div>';
|
|
764
|
-
}
|
|
765
|
-
html += '</div>';
|
|
766
775
|
html += '</div>';
|
|
767
776
|
}
|
|
768
777
|
html += '</div>';
|
|
@@ -785,11 +794,35 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
785
794
|
sectionHistoryIcon.innerHTML = 'keyboard_arrow_up';
|
|
786
795
|
}
|
|
787
796
|
});
|
|
797
|
+
let sectionHistoryDates = formContainer.querySelectorAll('.history-section-head');
|
|
798
|
+
for (let sectionHistoryDate of sectionHistoryDates) {
|
|
799
|
+
sectionHistoryDate.addEventListener('click', () => {
|
|
800
|
+
let id = sectionHistoryDate.id;
|
|
801
|
+
let dateIndex = id.split('-')[2];
|
|
802
|
+
let sectionHistoryDateBody = formContainer.querySelector('#section-history-body-' + dateIndex);
|
|
803
|
+
let sectionHistoryDateTitle = formContainer.querySelector('#section-history-title-' + dateIndex);
|
|
804
|
+
let sectionHistoryDateIcon = formContainer.querySelector('#section-history-icon-' + dateIndex);
|
|
805
|
+
if (sectionHistoryDateBody.style.display == 'block') {
|
|
806
|
+
sectionHistory.setAttribute('part', 'section-head-collapsed');
|
|
807
|
+
sectionHistoryDateBody.style.display = 'none';
|
|
808
|
+
sectionHistoryDateTitle.setAttribute('part', 'section-title-collapsed');
|
|
809
|
+
sectionHistoryDateIcon.innerHTML = 'keyboard_arrow_down';
|
|
810
|
+
}
|
|
811
|
+
else {
|
|
812
|
+
sectionHistory.setAttribute('part', 'section-head-expanded');
|
|
813
|
+
sectionHistoryDateBody.style.display = 'block';
|
|
814
|
+
sectionHistoryDateTitle.setAttribute('part', 'section-title-expanded');
|
|
815
|
+
sectionHistoryDateIcon.innerHTML = 'keyboard_arrow_up';
|
|
816
|
+
}
|
|
817
|
+
});
|
|
818
|
+
}
|
|
788
819
|
let historyReportings = formContainer.querySelectorAll('.history-reporting');
|
|
789
820
|
for (let historyReporting of historyReportings) {
|
|
790
821
|
let id = historyReporting.id;
|
|
791
|
-
let
|
|
792
|
-
|
|
822
|
+
let date = id.split('-')[2] + '-' + id.split('-')[3] + '-' + id.split('-')[4];
|
|
823
|
+
let index = id.split('-')[5];
|
|
824
|
+
console.log('historyConfigJSON', this.getPrepopulateJson().history[date][index].schema);
|
|
825
|
+
historyReporting.configjson = JSON.stringify(this.getPrepopulateJson().history[date][index].schema);
|
|
793
826
|
// historyReporting.loadMode();
|
|
794
827
|
}
|
|
795
828
|
}
|
|
@@ -813,7 +846,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
813
846
|
}
|
|
814
847
|
}
|
|
815
848
|
else {
|
|
816
|
-
if (element.type == "section") {
|
|
849
|
+
if (element.type == "section" && this.editdisable != "true") {
|
|
817
850
|
this.dataModel[i].collapse = "false";
|
|
818
851
|
}
|
|
819
852
|
else {
|
|
@@ -1408,6 +1441,7 @@ let SfIReporting = class SfIReporting extends LitElement {
|
|
|
1408
1441
|
elementLabel = elementLabel.replace(/ */g, '');
|
|
1409
1442
|
}
|
|
1410
1443
|
if (dataObj.type == "section") {
|
|
1444
|
+
console.log('renderingSection', dataObj);
|
|
1411
1445
|
elementHtml += `<div class="d-flex flex-col" part="section-container"><div id="${dataObj.id}" class="section-head d-flex align-center justify-between" part="${dataObj.collapse == "true" ? 'section-head-collapsed' : 'section-head-expanded'}"><h3 part="${dataObj.collapse == "true" ? 'section-title-collapsed' : 'section-title-expanded'}">${dataObj.name}</h3><div id="${dataObj.id}-success" part="section-success-icon"><div class="material-icons">${dataObj.collapse == "true" ? "keyboard_arrow_down" : "keyboard_arrow_up"}</div></div></div><div class="section-body d-flex ${this.formviewclass} ${dataObj.collapse == "true" ? 'hide' : ''}" part="section-body"> `;
|
|
1412
1446
|
}
|
|
1413
1447
|
else if (dataObj.type == "subsection") {
|