sync
This commit is contained in:
1 parent
9da1c4cf30
commit
634e8b71ab
18 files changed
+367
-143
No files matched your search
@@ -81,8 +81,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.question {
|
.question {
|
||||||
min-height: 24px;
|
/*min-height: 24px;*/
|
||||||
line-height: 24px;
|
/*line-height: 24px;*/
|
||||||
padding-left: 70px;
|
padding-left: 70px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -92,8 +92,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.answer {
|
.answer {
|
||||||
min-height: 24px;
|
/*min-height: 24px;*/
|
||||||
line-height: 24px;
|
/*line-height: 24px;*/
|
||||||
padding-left: 90px;
|
padding-left: 90px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
@@ -186,12 +186,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.question_line {
|
.question_line tr {
|
||||||
border-collapse: collapse;
|
|
||||||
border-top: 1px solid #dbdbdb;
|
border-top: 1px solid #dbdbdb;
|
||||||
border-bottom: 1px solid #dbdbdb;
|
border-bottom: 1px solid #dbdbdb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.question_line {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.answer_line {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
.question_table_grid {
|
.question_table_grid {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
@@ -200,10 +207,20 @@
|
|||||||
border: 1px solid #dbdbdb;
|
border: 1px solid #dbdbdb;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question_div_grid {
|
.question_standard_table_line {
|
||||||
|
border-top: 1px solid #dbdbdb;
|
||||||
|
border-bottom: 1px solid #dbdbdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question_standard_table_grid {
|
||||||
border: 1px solid #dbdbdb;
|
border: 1px solid #dbdbdb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.answer_div_grid {
|
||||||
|
border-left: 1px solid #dbdbdb;
|
||||||
|
border-right: 1px solid #dbdbdb;
|
||||||
|
}
|
||||||
|
|
||||||
.mediacaption {
|
.mediacaption {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
clear: both;
|
clear: both;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
.page {
|
.page {
|
||||||
/*background-color: #d3d3d3;*/
|
/*background-color: #d3d3d3;*/
|
||||||
/*height: 52px;*/
|
/*height: 52px;*/
|
||||||
line-height: 52px;
|
line-height: 25px;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
.section {
|
.section {
|
||||||
/*background-color: #eaeaea;*/
|
/*background-color: #eaeaea;*/
|
||||||
/*height: 40px;*/
|
/*height: 40px;*/
|
||||||
line-height: 40px;
|
line-height: 20px;
|
||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
@@ -81,8 +81,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.question {
|
.question {
|
||||||
min-height: 30px;
|
min-height: 24px;
|
||||||
line-height: 30px;
|
line-height: 24px;
|
||||||
padding-left: 70px;
|
padding-left: 70px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -92,12 +92,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.answer {
|
.answer {
|
||||||
min-height: 30px;
|
min-height: 24px;
|
||||||
line-height: 30px;
|
line-height: 24px;
|
||||||
padding-left: 90px;
|
padding-left: 90px;
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.table_content {
|
||||||
|
padding-left: 3px;
|
||||||
|
padding-right: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pagedoublespace {
|
||||||
|
line-height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
.media {
|
.media {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
@@ -176,6 +185,50 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.question_line tr {
|
||||||
|
border-top: 1px solid #dbdbdb;
|
||||||
|
border-bottom: 1px solid #dbdbdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question_line {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.answer_line {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question_table_grid {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question_table_grid td {
|
||||||
|
border: 1px solid #dbdbdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question_standard_table_line {
|
||||||
|
border-top: 1px solid #dbdbdb;
|
||||||
|
border-bottom: 1px solid #dbdbdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question_standard_table_grid {
|
||||||
|
border: 1px solid #dbdbdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.answer_div_grid {
|
||||||
|
border-left: 1px solid #dbdbdb;
|
||||||
|
border-right: 1px solid #dbdbdb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mediacaption {
|
||||||
|
text-align: center;
|
||||||
|
clear: both;
|
||||||
|
height: 25px;
|
||||||
|
width: 120px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
|
<script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
|
||||||
<script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
|
<script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
|
||||||
@@ -249,6 +302,19 @@
|
|||||||
<span id="button-print" class="sbutton iconprint" style="margin-right: 20px;" onclick="OnPrint();" data-lgid="P_IPT_PRINT">Print</span>
|
<span id="button-print" class="sbutton iconprint" style="margin-right: 20px;" onclick="OnPrint();" data-lgid="P_IPT_PRINT">Print</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="divreport" style="width: 1100px; margin: 0 auto;">
|
<div id="divreport" style="width: 1100px; margin: 0 auto;">
|
||||||
|
<div v-if="report.ReportLayout!=null">
|
||||||
|
<table class="maintable" style="width: 100%;">
|
||||||
|
<tr class="assettr">
|
||||||
|
<td style="width: 33%; text-align: left;">
|
||||||
|
<img id="reportlayoutlogo" style="width: 100px; margin-top: 5px; display: none;" /></td>
|
||||||
|
<td style="width: 33%; text-align: center;">
|
||||||
|
<img id="reportlayoutcenterlogo" style="width: 100px; margin-top: 5px; display: none;" /></td>
|
||||||
|
<td style="width: 33%; text-align: right;">
|
||||||
|
<img id="reportlayoutrightlogo" style="width: 100px; margin-top: 5px; display: none;" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
<h1 style="text-align: center;" v-show="report.Template.DisplayInspectionTitle">{{report.Template.Name}}</h1>
|
<h1 style="text-align: center;" v-show="report.Template.DisplayInspectionTitle">{{report.Template.Name}}</h1>
|
||||||
<div style="text-align: center; margin-bottom: 10px;"><span v-show="report.Template.DisplayCommitTime">{{report.CommitTimeLocalStr}}</span><span v-show="report.Template.DisplayCommitBy"> by {{report.CommitedByUserName}}</span></div>
|
<div style="text-align: center; margin-bottom: 10px;"><span v-show="report.Template.DisplayCommitTime">{{report.CommitTimeLocalStr}}</span><span v-show="report.Template.DisplayCommitBy"> by {{report.CommitedByUserName}}</span></div>
|
||||||
<table class="maintable">
|
<table class="maintable">
|
||||||
@@ -361,7 +427,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
|
<div id="mask_bg" style="display: none;">
|
||||||
|
<div class="loading c-spin"></div>
|
||||||
|
</div>
|
||||||
<div id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;">
|
<div id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;">
|
||||||
</div>
|
</div>
|
||||||
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe>
|
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ require.config({
|
|||||||
//spectrum: "../../js/spectrum"
|
//spectrum: "../../js/spectrum"
|
||||||
},
|
},
|
||||||
waitSeconds: 0,
|
waitSeconds: 0,
|
||||||
urlArgs: "v=455" //+ Math.random()
|
urlArgs: "v=464" //+ Math.random()
|
||||||
})
|
})
|
||||||
|
|
||||||
requirejs(['modules/pageloader'], function (loader) {
|
requirejs(['modules/pageloader'], function (loader) {
|
||||||
|
|||||||
@@ -113,10 +113,10 @@
|
|||||||
_this.loading && _this.loading.fadeOut(100);
|
_this.loading && _this.loading.fadeOut(100);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (q.QuestionType === Question.types.AssetStatus) {
|
//if (q.QuestionType === Question.types.AssetStatus) {
|
||||||
a.Result = a.Comment;
|
// a.Result = a.Comment;
|
||||||
a.Comment = "";
|
// a.Comment = "";
|
||||||
}
|
//}
|
||||||
|
|
||||||
answers.push(a);
|
answers.push(a);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -852,15 +852,15 @@
|
|||||||
content.append('<div style="clear: both"></div>');
|
content.append('<div style="clear: both"></div>');
|
||||||
|
|
||||||
cnt = $('<div style="margin: 6px 0 0 0px"></div>');
|
cnt = $('<div style="margin: 6px 0 0 0px"></div>');
|
||||||
var divComment = $('<div style="padding: 6px 0"></div>');
|
var divResult = $('<div style="padding: 6px 0"></div>');
|
||||||
var comment = $('<textarea class="form-control" style="width: 100%; box-sizing: border-box; height: 70px" placeholder="Comment"></textarea>');
|
var rst = $('<textarea class="form-control" style="width: 100%; box-sizing: border-box; height: 70px"></textarea>');
|
||||||
comment.attr('maxlength', 500);
|
rst.attr('maxlength', 500);
|
||||||
if (answer && answer.Result) {
|
if (answer && answer.Result) {
|
||||||
comment.val(answer.Result);
|
rst.val(answer.Result);
|
||||||
}
|
}
|
||||||
this.ui.comment = comment;
|
this.ui.assetstatusresult = rst;
|
||||||
divComment.append(comment);
|
divResult.append(rst);
|
||||||
cnt.append(divComment);
|
cnt.append(divResult);
|
||||||
content.append(cnt);
|
content.append(cnt);
|
||||||
|
|
||||||
return content;
|
return content;
|
||||||
@@ -874,12 +874,8 @@
|
|||||||
items.push(item);
|
items.push(item);
|
||||||
}
|
}
|
||||||
answer.SelectedItems = items;
|
answer.SelectedItems = items;
|
||||||
if (items.length > 0) {
|
answer.Result = this.ui.assetstatusresult.val();
|
||||||
answer.Result = items.map(function (i) { return i.Value || i.Text }).join('\n');
|
|
||||||
//answer.SeverityLevel = items[0].SeverityLevel;
|
|
||||||
} else {
|
|
||||||
answer.Result = '';
|
|
||||||
}
|
|
||||||
return answer;
|
return answer;
|
||||||
};
|
};
|
||||||
assetStatusQuestion.prototype.focus = function () {
|
assetStatusQuestion.prototype.focus = function () {
|
||||||
|
|||||||
@@ -573,7 +573,7 @@
|
|||||||
content.find('.layout-footers-middle .editor-content').val(info.PageFooterCenter);
|
content.find('.layout-footers-middle .editor-content').val(info.PageFooterCenter);
|
||||||
content.find('.layout-footers-right .editor-content').val(info.PageFooterRight);
|
content.find('.layout-footers-right .editor-content').val(info.PageFooterRight);
|
||||||
|
|
||||||
content.find('#layout-style').val(info.Style);
|
content.find('#layout-style').val(info.Style).change();
|
||||||
content.find('#layout-spacing').val(info.Spacing);
|
content.find('#layout-spacing').val(info.Spacing);
|
||||||
content.find('#layout-picturesdisplay').val(info.PicturesDisplay);
|
content.find('#layout-picturesdisplay').val(info.PicturesDisplay);
|
||||||
content.find('#layout-captionimages').prop('checked', info.CaptionImages);
|
content.find('#layout-captionimages').prop('checked', info.CaptionImages);
|
||||||
|
|||||||
+116
-80
@@ -158,7 +158,7 @@ function showIdentifiedQuestions(questions) {
|
|||||||
var content = $('<div></div>');
|
var content = $('<div></div>');
|
||||||
content.append($('<div class="catelog">IDENTIFIED ISSUES</div>'));
|
content.append($('<div class="catelog">IDENTIFIED ISSUES</div>'));
|
||||||
if (questions && questions.length > 0) {
|
if (questions && questions.length > 0) {
|
||||||
createQuestionContent1(content, questions);
|
createQuestionContent1(content, questions, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
|
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
|
||||||
@@ -210,8 +210,7 @@ function showSignature(report) {
|
|||||||
else if (layoutDivider == 2)//Grid
|
else if (layoutDivider == 2)//Grid
|
||||||
div_pic.addClass('question_div_grid');
|
div_pic.addClass('question_div_grid');
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
div_pic.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
|
||||||
div_pic.css('line-height', '30px');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,8 +246,7 @@ function showMedias() {
|
|||||||
else if (layoutDivider == 2)//Grid
|
else if (layoutDivider == 2)//Grid
|
||||||
div_question.addClass('question_table_grid');
|
div_question.addClass('question_table_grid');
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
|
||||||
div_question.css('line-height', '30px');
|
|
||||||
}
|
}
|
||||||
else if (layoutStyle == 2) {//Split
|
else if (layoutStyle == 2) {//Split
|
||||||
var div_question = $('<table style="width:100%;" class="question_table"></table>');
|
var div_question = $('<table style="width:100%;" class="question_table"></table>');
|
||||||
@@ -279,8 +277,7 @@ function showMedias() {
|
|||||||
else if (layoutDivider == 2)//Grid
|
else if (layoutDivider == 2)//Grid
|
||||||
div_question.addClass('question_table_grid');
|
div_question.addClass('question_table_grid');
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
|
||||||
div_question.css('line-height', '30px');
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var div_question = $('<table style="width:100%;" class="question_table"></table>');
|
var div_question = $('<table style="width:100%;" class="question_table"></table>');
|
||||||
@@ -297,14 +294,13 @@ function showMedias() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (layoutDivider == 1)//Line
|
if (layoutDivider == 1)//Line
|
||||||
div_question.addClass('question_line');
|
div_question.addClass('question_standard_table_line');
|
||||||
else if (layoutDivider == 2)//Grid
|
else if (layoutDivider == 2)//Grid
|
||||||
div_question.addClass('question_table_grid');
|
div_question.addClass('question_standard_table_grid');
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
if (layoutSpacing == 1)//Double Space
|
||||||
div_question.css('line-height', '30px');
|
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#divpages').append(content);
|
$('#divpages').append(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,8 +351,7 @@ function createPage(page) {
|
|||||||
else if (layoutDivider == 2)//Grid
|
else if (layoutDivider == 2)//Grid
|
||||||
tabpage.addClass('question_table_grid');
|
tabpage.addClass('question_table_grid');
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
tabpage.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
|
||||||
tabpage.css('line-height', '30px');
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var divpage = $('<div class="page"></div>');
|
var divpage = $('<div class="page"></div>');
|
||||||
@@ -404,8 +399,7 @@ function createSectionContent(page) {
|
|||||||
else if (layoutDivider == 2)//Grid
|
else if (layoutDivider == 2)//Grid
|
||||||
tabsection.addClass('question_table_grid');
|
tabsection.addClass('question_table_grid');
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
tabsection.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
|
||||||
tabsection.css('line-height', '30px');
|
|
||||||
|
|
||||||
var qc = createQuestionContent(s);
|
var qc = createQuestionContent(s);
|
||||||
content.append(qc);
|
content.append(qc);
|
||||||
@@ -459,35 +453,36 @@ function createSectionContent(page) {
|
|||||||
function createQuestionContent(section) {
|
function createQuestionContent(section) {
|
||||||
var content = $('<div style="margin-bottom:30px;"></div>');
|
var content = $('<div style="margin-bottom:30px;"></div>');
|
||||||
if (section.Questions && section.Questions.length > 0) {
|
if (section.Questions && section.Questions.length > 0) {
|
||||||
createQuestionContent1(content, section.Questions);
|
createQuestionContent1(content, section.Questions, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
|
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createQuestionContent1(content, questions) {
|
function createQuestionContent1(content, questions, isidentified) {
|
||||||
if (questions && questions.length > 0) {
|
if (questions && questions.length > 0) {
|
||||||
if (layoutStyle == 1) {//Compressed
|
if (layoutStyle == 1) {//Compressed
|
||||||
var div_question = $('<table style="width:100%;" class="question_table"></table>');
|
var div_question = $('<table style="width:100%;" class="question_table"></table>');
|
||||||
content.append(div_question);
|
content.append(div_question);
|
||||||
for (var i = 0; i < questions.length; i++) {
|
for (var i = 0; i < questions.length; i++) {
|
||||||
var q = questions[i];
|
var q = questions[i];
|
||||||
|
if (ignoreQuestion(q, isidentified)) continue;
|
||||||
|
|
||||||
var tr_question = $('<tr style="width:100%;"></tr>');
|
var tr_question = $('<tr style="width:100%;"></tr>');
|
||||||
div_question.append(tr_question);
|
div_question.append(tr_question);
|
||||||
tr_question.append($('<td style="width:33%;"></td>').text(q.DisplayText));
|
tr_question.append($('<td style="width:33%;"></td>').text(q.DisplayText));
|
||||||
var td_answer = $('<td style="width:33%;"></td>');
|
var td_answer = $('<td style="width:33%;"></td>');
|
||||||
tr_question.append(td_answer);
|
tr_question.append(td_answer);
|
||||||
createAnswerContent(td_answer, q);
|
createAnswerContent(td_answer, q, isidentified);
|
||||||
var td_comment = $('<td style="width:33%;"></td>');
|
var td_comment = $('<td style="width:33%;"></td>');
|
||||||
tr_question.append(td_comment);
|
tr_question.append(td_comment);
|
||||||
var comment = td_answer.data('comment');
|
var comment = td_answer.data('comment');
|
||||||
if (comment && comment != "") {
|
if (comment && comment != "") {
|
||||||
td_comment.append($('<div class="answer"></div>').html(replaceHtmlText(comment)));
|
td_comment.append($('<div class="answer"></div>').html(replaceHtmlText(comment)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (q.IsImportant && layoutHighlightColor)
|
if (q.IsImportant && layoutHighlightColor)
|
||||||
tr_question.css('background-color', layoutHighlightColor);
|
tr_question.css('color', layoutHighlightColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layoutDivider == 1)//Line
|
if (layoutDivider == 1)//Line
|
||||||
@@ -495,16 +490,18 @@ function createQuestionContent1(content, questions) {
|
|||||||
else if (layoutDivider == 2)//Grid
|
else if (layoutDivider == 2)//Grid
|
||||||
div_question.addClass('question_table_grid');
|
div_question.addClass('question_table_grid');
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
|
||||||
div_question.css('line-height', '30px');
|
|
||||||
}
|
}
|
||||||
else if (layoutStyle == 2) {//Split
|
else if (layoutStyle == 2) {//Split
|
||||||
var div_question = $('<table style="width:100%;" class="question_table"></table>');
|
var div_question = $('<table style="width:100%;" class="question_table"></table>');
|
||||||
content.append(div_question);
|
content.append(div_question);
|
||||||
var tr_question = "";
|
var tr_question = "";
|
||||||
|
var qindex = 0;
|
||||||
for (var i = 0; i < questions.length; i++) {
|
for (var i = 0; i < questions.length; i++) {
|
||||||
var q = questions[i];
|
var q = questions[i];
|
||||||
if (i % 2 == 0) {
|
if (ignoreQuestion(q, isidentified)) continue;
|
||||||
|
|
||||||
|
if (qindex % 2 == 0) {
|
||||||
tr_question = $('<tr style="width:100%;"></tr>');
|
tr_question = $('<tr style="width:100%;"></tr>');
|
||||||
div_question.append(tr_question);
|
div_question.append(tr_question);
|
||||||
}
|
}
|
||||||
@@ -512,13 +509,15 @@ function createQuestionContent1(content, questions) {
|
|||||||
tr_question.append(td_question);
|
tr_question.append(td_question);
|
||||||
var td_answer = $('<td style="width:25%;"></td>');
|
var td_answer = $('<td style="width:25%;"></td>');
|
||||||
tr_question.append(td_answer);
|
tr_question.append(td_answer);
|
||||||
createAnswerContent(td_answer, q);
|
createAnswerContent(td_answer, q, isidentified);
|
||||||
if (q.IsImportant && layoutHighlightColor) {
|
if (q.IsImportant && layoutHighlightColor) {
|
||||||
td_question.css('background-color', layoutHighlightColor);
|
td_question.css('color', layoutHighlightColor);
|
||||||
td_answer.css('background-color', layoutHighlightColor);
|
td_answer.css('color', layoutHighlightColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qindex++;
|
||||||
}
|
}
|
||||||
if (questions.length % 2 != 0) {
|
if (qindex % 2 != 0) {
|
||||||
tr_question.append($('<td style="width:25%;"></td><td style="width:25%;"></td>'));
|
tr_question.append($('<td style="width:25%;"></td><td style="width:25%;"></td>'));
|
||||||
}
|
}
|
||||||
if (layoutDivider == 1)//Line
|
if (layoutDivider == 1)//Line
|
||||||
@@ -526,16 +525,21 @@ function createQuestionContent1(content, questions) {
|
|||||||
else if (layoutDivider == 2)//Grid
|
else if (layoutDivider == 2)//Grid
|
||||||
div_question.addClass('question_table_grid');
|
div_question.addClass('question_table_grid');
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
|
||||||
div_question.css('line-height', '30px');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (var i = 0; i < questions.length; i++) {
|
for (var i = 0; i < questions.length; i++) {
|
||||||
var q = questions[i];
|
var q = questions[i];
|
||||||
var div_question = $('<div class="question"></div>');
|
if (ignoreQuestion(q, isidentified)) continue;
|
||||||
content.append(div_question);
|
|
||||||
|
|
||||||
|
var tab_question = $('<table style="width:100%;" class="question_table"></table>');
|
||||||
|
content.append(tab_question);
|
||||||
|
var tr_question = $('<tr style="width:100%;"></tr>');
|
||||||
|
tab_question.append(tr_question);
|
||||||
|
var td_question = $('<td style="width:100%;"></td>');
|
||||||
|
tr_question.append(td_question);
|
||||||
|
var div_question = $('<div class="question"></div>');
|
||||||
|
td_question.append(div_question);
|
||||||
var div_title = $('<div style="width:320px;flex-grow:1;"></div>').text(q.DisplayText);
|
var div_title = $('<div style="width:320px;flex-grow:1;"></div>').text(q.DisplayText);
|
||||||
div_question.append(div_title);
|
div_question.append(div_title);
|
||||||
if (q.StaticPictures && q.StaticPictures.length > 0) {
|
if (q.StaticPictures && q.StaticPictures.length > 0) {
|
||||||
@@ -544,18 +548,23 @@ function createQuestionContent1(content, questions) {
|
|||||||
div_question.append(div_pic)
|
div_question.append(div_pic)
|
||||||
}
|
}
|
||||||
|
|
||||||
createAnswerContent(content, q);
|
tr_question = $('<tr style="width:100%;"></tr>');
|
||||||
|
tab_question.append(tr_question);
|
||||||
|
var td_answer = $('<td style="width:100%;"></td>');
|
||||||
|
tr_question.append(td_answer);
|
||||||
|
createAnswerContent(td_answer, q, isidentified);
|
||||||
|
|
||||||
if (layoutDivider == 1)//Line
|
if (layoutDivider == 1)//Line
|
||||||
div_question.addClass('question_line');
|
tab_question.addClass('question_standard_table_line');
|
||||||
else if (layoutDivider == 2)//Grid
|
else if (layoutDivider == 2)//Grid
|
||||||
div_question.addClass('question_div_grid');
|
tab_question.addClass('question_standard_table_grid');
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
tab_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
|
||||||
div_question.css('line-height', '30px');
|
|
||||||
|
|
||||||
if (q.IsImportant && layoutHighlightColor)
|
if (q.IsImportant && layoutHighlightColor) {
|
||||||
div_question.css('background-color', layoutHighlightColor);
|
tab_question.css('color', layoutHighlightColor);
|
||||||
|
div_question.css('color', layoutHighlightColor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,38 +573,12 @@ function createQuestionContent1(content, questions) {
|
|||||||
if (layoutStyle == 1 || layoutStyle == 2) {
|
if (layoutStyle == 1 || layoutStyle == 2) {
|
||||||
div_answer.addClass('table_content');
|
div_answer.addClass('table_content');
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
var isimportant = div_answer.data('isimportant');
|
|
||||||
if (isimportant && layoutHighlightColor)
|
|
||||||
div_answer.css('background-color', layoutHighlightColor);
|
|
||||||
|
|
||||||
if (layoutDivider == 1)//Line
|
|
||||||
div_answer.addClass('question_line');
|
|
||||||
else if (layoutDivider == 2)//Grid
|
|
||||||
div_answer.addClass('question_div_grid');
|
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
|
||||||
div_answer.css('line-height', '30px');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
content.find('.div_media').each(function () {
|
content.find('.div_media').each(function () {
|
||||||
var div_media = $(this);
|
var div_media = $(this);
|
||||||
if (layoutStyle == 1 || layoutStyle == 2) {
|
if (layoutStyle == 1 || layoutStyle == 2) {
|
||||||
div_media.css('padding-left', '3px');
|
div_media.css('padding-left', '3px');
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
var isimportant = div_media.data('isimportant');
|
|
||||||
if (isimportant && layoutHighlightColor)
|
|
||||||
div_media.css('background-color', layoutHighlightColor);
|
|
||||||
|
|
||||||
if (layoutDivider == 1)//Line
|
|
||||||
div_media.addClass('question_line');
|
|
||||||
else if (layoutDivider == 2)//Grid
|
|
||||||
div_media.addClass('question_div_grid');
|
|
||||||
|
|
||||||
if (layoutSpacing == 1)//Double Space
|
|
||||||
div_media.css('line-height', '30px');
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return content;
|
return content;
|
||||||
@@ -612,8 +595,39 @@ function createPictures(pictures, p) {
|
|||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
function ignoreQuestion(q, isidentified) {
|
||||||
|
var ignore = false;
|
||||||
|
if (q.QuestionType == 10 || (q.QuestionType == 15 && q.SubType == 15)) {//Picture
|
||||||
|
var hasPicture = false;
|
||||||
|
if (reportdata && reportdata.Answers) {
|
||||||
|
for (var i = 0; i < reportdata.Answers.length; i++) {
|
||||||
|
var a = reportdata.Answers[i];
|
||||||
|
if (a.QuestionId.toLowerCase() == q.Id.toLowerCase()) {
|
||||||
|
if (reportdata.Medias && reportdata.Medias.length > 0) {
|
||||||
|
for (var j = 0; j < reportdata.Medias.length; j++) {
|
||||||
|
var m = reportdata.Medias[j];
|
||||||
|
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
|
||||||
|
if (layoutPicturesDisplay == 1)//Displayed At Bottom
|
||||||
|
{
|
||||||
|
if (isidentified == false)
|
||||||
|
mediasdata.push(m);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
hasPicture = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ignore = !hasPicture;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ignore = false;
|
||||||
|
return ignore;
|
||||||
|
}
|
||||||
|
|
||||||
function createAnswerContent(p, q) {
|
function createAnswerContent(p, q, isidentified) {
|
||||||
var leveltext = showSeverityLevel(q.SeverityLevel);
|
var leveltext = showSeverityLevel(q.SeverityLevel);
|
||||||
var label_level = $('<label class="label_level"></label>').text(leveltext);
|
var label_level = $('<label class="label_level"></label>').text(leveltext);
|
||||||
if (reportdata && reportdata.Answers) {
|
if (reportdata && reportdata.Answers) {
|
||||||
@@ -638,16 +652,19 @@ function createAnswerContent(p, q) {
|
|||||||
var div_answer = $('<div class="answer"></div>').data('isimportant', q.IsImportant);
|
var div_answer = $('<div class="answer"></div>').data('isimportant', q.IsImportant);
|
||||||
if (q.QuestionType == 1
|
if (q.QuestionType == 1
|
||||||
|| (q.QuestionType == 15 && q.SubType == 14))
|
|| (q.QuestionType == 15 && q.SubType == 14))
|
||||||
p.append(div_answer.html(replaceHtmlText(result))).append("<div style='clear:both;'></div>");
|
p.append(div_answer.html(replaceHtmlText(result)));
|
||||||
else if (q.QuestionType == 17 && q.TextToCompare != null && result.toLowerCase() != q.TextToCompare.toLowerCase()) // BarCodeValidate
|
else if (q.QuestionType == 17 && q.TextToCompare != null && result.toLowerCase() != q.TextToCompare.toLowerCase()) // BarCodeValidate
|
||||||
p.append(div_answer
|
p.append(div_answer
|
||||||
.append($('<span style="color:red"></span>').text(result))
|
.append($('<span style="color:red"></span>').text(result))
|
||||||
.append($('<span style="margin-left:6px"></span>').text('(' + q.TextToCompare + ')'))
|
.append($('<span style="margin-left:6px"></span>').text('(' + q.TextToCompare + ')'))
|
||||||
).append("<div style='clear:both;'></div>");
|
);
|
||||||
else
|
else
|
||||||
p.append(div_answer.text(result)).append("<div style='clear:both;'></div>");
|
p.append(div_answer.text(result));
|
||||||
|
|
||||||
div_answer.append(label_level);
|
div_answer.append(label_level);
|
||||||
|
p.append(item);
|
||||||
|
if (layoutStyle == 0)
|
||||||
|
p.append("<div style='clear:both;'></div>");
|
||||||
}
|
}
|
||||||
else if (q.QuestionType == 5) {//YesOrNo
|
else if (q.QuestionType == 5) {//YesOrNo
|
||||||
if (a.SelectedItems && a.SelectedItems.length > 0) {
|
if (a.SelectedItems && a.SelectedItems.length > 0) {
|
||||||
@@ -662,7 +679,10 @@ function createAnswerContent(p, q) {
|
|||||||
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
|
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
|
||||||
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
|
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
|
||||||
}
|
}
|
||||||
p.append(item).append("<div style='clear:both;'></div>");
|
|
||||||
|
p.append(item);
|
||||||
|
if (layoutStyle == 0)
|
||||||
|
p.append("<div style='clear:both;'></div>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (q.QuestionType == 8 || q.QuestionType == 9//DropDown、List
|
else if (q.QuestionType == 8 || q.QuestionType == 9//DropDown、List
|
||||||
@@ -682,7 +702,10 @@ function createAnswerContent(p, q) {
|
|||||||
if (a.SelectedItems[j].BackgroundColor && a.SelectedItems[j].BackgroundColor != "") {
|
if (a.SelectedItems[j].BackgroundColor && a.SelectedItems[j].BackgroundColor != "") {
|
||||||
div_bg.css('background-color', a.SelectedItems[j].BackgroundColor);
|
div_bg.css('background-color', a.SelectedItems[j].BackgroundColor);
|
||||||
}
|
}
|
||||||
p.append(item).append("<div style='clear:both;'></div>");
|
|
||||||
|
p.append(item);
|
||||||
|
if (layoutStyle == 0)
|
||||||
|
p.append("<div style='clear:both;'></div>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -699,7 +722,9 @@ function createAnswerContent(p, q) {
|
|||||||
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
|
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
|
||||||
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
|
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
|
||||||
}
|
}
|
||||||
p.append(item).append("<div style='clear:both;'></div>");
|
p.append(item);
|
||||||
|
if (layoutStyle == 0)
|
||||||
|
p.append("<div style='clear:both;'></div>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -726,7 +751,10 @@ function createAnswerContent(p, q) {
|
|||||||
var m = reportdata.Medias[j];
|
var m = reportdata.Medias[j];
|
||||||
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
|
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
|
||||||
if (layoutPicturesDisplay == 1)//Displayed At Bottom
|
if (layoutPicturesDisplay == 1)//Displayed At Bottom
|
||||||
mediasdata.push(m);
|
{
|
||||||
|
if (isidentified == false)
|
||||||
|
mediasdata.push(m);
|
||||||
|
}
|
||||||
else {//Displayed As Taken
|
else {//Displayed As Taken
|
||||||
var media = createMedias(m);
|
var media = createMedias(m);
|
||||||
pics.append(media);
|
pics.append(media);
|
||||||
@@ -745,8 +773,10 @@ function createAnswerContent(p, q) {
|
|||||||
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
|
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
|
||||||
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
|
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
|
||||||
}
|
}
|
||||||
p.append(divanswer).append("<div style='clear:both;'></div>");
|
|
||||||
|
|
||||||
|
p.append(divanswer);
|
||||||
|
if (layoutStyle == 0)
|
||||||
|
p.append("<div style='clear:both;'></div>");
|
||||||
}
|
}
|
||||||
divanswer.append(label_level);
|
divanswer.append(label_level);
|
||||||
if (layoutPicturesDisplay != 1) {//Displayed At Bottom
|
if (layoutPicturesDisplay != 1) {//Displayed At Bottom
|
||||||
@@ -758,7 +788,10 @@ function createAnswerContent(p, q) {
|
|||||||
var m = reportdata.Medias[j];
|
var m = reportdata.Medias[j];
|
||||||
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
|
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
|
||||||
if (layoutPicturesDisplay == 1)//Displayed At Bottom
|
if (layoutPicturesDisplay == 1)//Displayed At Bottom
|
||||||
mediasdata.push(m);
|
{
|
||||||
|
if (isidentified == false)
|
||||||
|
mediasdata.push(m);
|
||||||
|
}
|
||||||
else {//Displayed As Taken
|
else {//Displayed As Taken
|
||||||
var media = createMedias(m);
|
var media = createMedias(m);
|
||||||
pics.append(media);
|
pics.append(media);
|
||||||
@@ -767,17 +800,21 @@ function createAnswerContent(p, q) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (a.Result && a.Result != "") {
|
if (a.Result && a.Result != "") {
|
||||||
p.append($('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Result)));
|
var divresult = $('<div class="answer"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Result));
|
||||||
|
p.append(divresult);
|
||||||
|
if (q.IsImportant && layoutHighlightColor)
|
||||||
|
divresult.css('color', layoutHighlightColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (layoutStyle != 1 && layoutStyle != 2 && a.Comment && a.Comment != "") {
|
if (layoutStyle != 1 && layoutStyle != 2 && a.Comment && a.Comment != "") {
|
||||||
p.append($('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Comment)));
|
var divcomment = $('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Comment));
|
||||||
|
p.append(divcomment);
|
||||||
|
if (q.IsImportant && layoutHighlightColor)
|
||||||
|
divcomment.css('color', layoutHighlightColor);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.append($('<div class="answer"></div>').text(""));
|
|
||||||
|
|
||||||
|
|
||||||
//public string Id { get; set; }
|
//public string Id { get; set; }
|
||||||
@@ -811,7 +848,6 @@ function createAnswerContent(p, q) {
|
|||||||
//如果AssetStatus类型,result存的是notes
|
//如果AssetStatus类型,result存的是notes
|
||||||
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function convertUnits(u) {
|
function convertUnits(u) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
//spectrum: "../../js/spectrum"
|
//spectrum: "../../js/spectrum"
|
||||||
},
|
},
|
||||||
waitSeconds: 0,
|
waitSeconds: 0,
|
||||||
urlArgs: "v=38" //+ Math.random()
|
urlArgs: "v=39" //+ Math.random()
|
||||||
})
|
})
|
||||||
|
|
||||||
requirejs(['modules/inspects/editinspection'], function (EditModule) {
|
requirejs(['modules/inspects/editinspection'], function (EditModule) {
|
||||||
|
|||||||
@@ -1072,7 +1072,7 @@
|
|||||||
|
|
||||||
<div style="line-height: 30px;">
|
<div style="line-height: 30px;">
|
||||||
<div style="margin-left: 10px;">
|
<div style="margin-left: 10px;">
|
||||||
<input type="checkbox" id="chkSelectAll" style="height: 26px;" v-on:change="selectAll($event)" /><span data-lgid="P_MAIN_SELECTALL">Select All</span>
|
<input type="checkbox" style="height: 26px;" v-on:change="selectAll($event)" /><span data-lgid="P_MAIN_SELECTALL">Select All</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="divmsgcontainer" style="overflow: auto; position: absolute; top: 60px; bottom: 0; width: 100%;">
|
<div id="divmsgcontainer" style="overflow: auto; position: absolute; top: 60px; bottom: 0; width: 100%;">
|
||||||
<div v-bind:style="bodyContainerStyle" style="position: relative">
|
<div v-bind:style="bodyContainerStyle" style="position: relative">
|
||||||
|
|||||||
@@ -166,6 +166,39 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
opacity: initial
|
opacity: initial
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
|
html::-webkit-scrollbar-thumb {
|
||||||
|
background-color: rgba(168, 168, 168, 0.9);
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workorderspliter {
|
||||||
|
height: 6px;
|
||||||
|
background-color: gray;
|
||||||
|
cursor: ns-resize;
|
||||||
|
margin: 6px 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workorderdetail {
|
||||||
|
position: relative;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
#workorderdetail::-webkit-scrollbar {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
}
|
||||||
|
#workorderdetail::-webkit-scrollbar-thumb {
|
||||||
|
background-color: rgba(168, 168, 168, 0.9);
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workorderdetail>.ui-popup-mask {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
|
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
|
||||||
@@ -1010,6 +1043,10 @@
|
|||||||
|
|
||||||
|
|
||||||
var dialogWidgets;
|
var dialogWidgets;
|
||||||
|
var widgetHeight = Number(localStorage.getItem('spliter_height'));
|
||||||
|
if (isNaN(widgetHeight) || widgetHeight < 100 || widgetHeight > 1000) {
|
||||||
|
widgetHeight = 300;
|
||||||
|
}
|
||||||
$(function () {
|
$(function () {
|
||||||
setPageTitle(GetTextByKey("P_WORKORDER", "Work Order"), true);
|
setPageTitle(GetTextByKey("P_WORKORDER", "Work Order"), true);
|
||||||
$('.iconlayout').on('click', function (ev) {
|
$('.iconlayout').on('click', function (ev) {
|
||||||
@@ -1062,8 +1099,17 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(window).resize(function () {
|
$(window).resize(function () {
|
||||||
$("#workorderlist").css("height", $(window).height() - $("#workorderlist").offset().top - 10);
|
var top = $("#workorderlist").offset().top;
|
||||||
|
var height = $(window).height() - top - 10;
|
||||||
|
var widget = wowidgetobj?.workorderwidgets?.length > 0;
|
||||||
|
if (widget) {
|
||||||
|
height -= widgetHeight + 10;
|
||||||
|
}
|
||||||
|
$("#workorderlist").css("height", height);
|
||||||
grid_dt && grid_dt.resize();
|
grid_dt && grid_dt.resize();
|
||||||
|
//if (widget) {
|
||||||
|
// $('#workorderdetail').css('height', top + height + 6);
|
||||||
|
//}
|
||||||
}).resize();
|
}).resize();
|
||||||
|
|
||||||
$('#dialog_alerts').prop('iframe', true).dialog(function () {
|
$('#dialog_alerts').prop('iframe', true).dialog(function () {
|
||||||
@@ -1102,6 +1148,46 @@
|
|||||||
$('#spExport').hide();
|
$('#spExport').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var list = document.querySelector('#workorderlist');
|
||||||
|
var detail = document.querySelector('#workorderdetail');
|
||||||
|
detail.style.height = widgetHeight + 'px';
|
||||||
|
document.querySelector('#workorderspliter').addEventListener('mousedown', function (e) {
|
||||||
|
if (e.buttons !== 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var oy = e.clientY;
|
||||||
|
var oheight = widgetHeight;
|
||||||
|
var parent = document.body;
|
||||||
|
var top = document.querySelector('#workorderlist').offsetTop;
|
||||||
|
var windowHeight = window.innerHeight;
|
||||||
|
var gridbody = list.querySelector('.data-grid-body');
|
||||||
|
var headerHeight = list.querySelector('.data-grid-table-header').offsetHeight;
|
||||||
|
var move = function (e2) {
|
||||||
|
if (e2.buttons !== 1) {
|
||||||
|
parent.dispatchEvent(new MouseEvent('mouseup'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var y = e2.clientY - oy;
|
||||||
|
var height = oheight - y;
|
||||||
|
if (height > 100) {
|
||||||
|
widgetHeight = height;
|
||||||
|
detail.style.height = widgetHeight + 'px';
|
||||||
|
|
||||||
|
height = windowHeight - top - 10 - height - 10;
|
||||||
|
list.style.height = height + 'px';
|
||||||
|
gridbody.style.height = (height - headerHeight) + 'px';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
parent.addEventListener('mousemove', move, { passive: false });
|
||||||
|
var up = function () {
|
||||||
|
grid_dt?.resize();
|
||||||
|
parent.removeEventListener('mousemove', move, { passive: false });
|
||||||
|
parent.removeEventListener('mouseup', up);
|
||||||
|
localStorage.setItem('spliter_height', String(widgetHeight));
|
||||||
|
};
|
||||||
|
parent.addEventListener('mouseup', up);
|
||||||
|
});
|
||||||
|
|
||||||
openmsgwebsocket();
|
openmsgwebsocket();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1437,7 +1523,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<div id="workorderlist"></div>
|
<div id="workorderlist"></div>
|
||||||
<div id="workorderdetail"></div>
|
<div id="workorderspliter" style="display: none"></div>
|
||||||
|
<div id="workorderdetail" style="display: none"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="mask_bg" style="display: none;">
|
<div id="mask_bg" style="display: none;">
|
||||||
<div class="loading c-spin"></div>
|
<div class="loading c-spin"></div>
|
||||||
|
|||||||
@@ -1292,9 +1292,12 @@ function InitGridData() {
|
|||||||
grid_dt.selectedrowchanged = function (rowindex) {
|
grid_dt.selectedrowchanged = function (rowindex) {
|
||||||
var rowdata = grid_dt.source[rowindex];
|
var rowdata = grid_dt.source[rowindex];
|
||||||
if (rowdata && rowdata.Values.Id.Value > 0) {
|
if (rowdata && rowdata.Values.Id.Value > 0) {
|
||||||
if (!wowidgetobj)
|
if (!wowidgetobj) {
|
||||||
wowidgetobj = new WorkOrderWidget();
|
wowidgetobj = new WorkOrderWidget();
|
||||||
wowidgetobj.changeWorkOrder(rowdata.Values);
|
wowidgetobj.changeWorkOrder(rowdata.Values);
|
||||||
|
} else {
|
||||||
|
wowidgetobj.changeWorkOrder(rowdata.Values);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -391,7 +391,7 @@ if (typeof ($woestimate) !== "function") {
|
|||||||
tb_att.append(tr_att);
|
tb_att.append(tr_att);
|
||||||
var td_att = $('<td></td>');
|
var td_att = $('<td></td>');
|
||||||
tr_att.append(td_att);
|
tr_att.append(td_att);
|
||||||
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
|
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
|
||||||
td_att.append(div_att);
|
td_att.append(div_att);
|
||||||
tb_att = $('<table id="tab_est_atts" style="table-layout: fixed;"></table>');
|
tb_att = $('<table id="tab_est_atts" style="table-layout: fixed;"></table>');
|
||||||
div_att.append(tb_att);
|
div_att.append(tb_att);
|
||||||
@@ -528,7 +528,7 @@ if (typeof ($woestimate) !== "function") {
|
|||||||
tb_att.append(tr_att);
|
tb_att.append(tr_att);
|
||||||
var td_att = $('<td></td>');
|
var td_att = $('<td></td>');
|
||||||
tr_att.append(td_att);
|
tr_att.append(td_att);
|
||||||
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
|
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
|
||||||
td_att.append(div_att);
|
td_att.append(div_att);
|
||||||
tb_att = $('<table id="tab_woest_atts" style="table-layout: fixed;"></table>');
|
tb_att = $('<table id="tab_woest_atts" style="table-layout: fixed;"></table>');
|
||||||
div_att.append(tb_att);
|
div_att.append(tb_att);
|
||||||
@@ -944,7 +944,7 @@ if (typeof ($woestimate) !== "function") {
|
|||||||
tb_att.append(tr_att);
|
tb_att.append(tr_att);
|
||||||
var td_att = $('<td></td>');
|
var td_att = $('<td></td>');
|
||||||
tr_att.append(td_att);
|
tr_att.append(td_att);
|
||||||
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
|
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
|
||||||
td_att.append(div_att);
|
td_att.append(div_att);
|
||||||
tb_att = $('<table id="tab_est_atts' + estimateindex + '" style="table-layout: fixed;"></table>');
|
tb_att = $('<table id="tab_est_atts' + estimateindex + '" style="table-layout: fixed;"></table>');
|
||||||
div_att.append(tb_att);
|
div_att.append(tb_att);
|
||||||
@@ -1812,7 +1812,7 @@ if (typeof ($woinvoice) !== "function") {
|
|||||||
tb_att.append(tr_att);
|
tb_att.append(tr_att);
|
||||||
var td_att = $('<td></td>');
|
var td_att = $('<td></td>');
|
||||||
tr_att.append(td_att);
|
tr_att.append(td_att);
|
||||||
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
|
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
|
||||||
td_att.append(div_att);
|
td_att.append(div_att);
|
||||||
tb_att = $('<table id="tab_invoice_atts" style="table-layout: fixed;"></table>');
|
tb_att = $('<table id="tab_invoice_atts" style="table-layout: fixed;"></table>');
|
||||||
div_att.append(tb_att);
|
div_att.append(tb_att);
|
||||||
@@ -1943,7 +1943,7 @@ if (typeof ($woinvoice) !== "function") {
|
|||||||
tb_att.append(tr_att);
|
tb_att.append(tr_att);
|
||||||
var td_att = $('<td></td>');
|
var td_att = $('<td></td>');
|
||||||
tr_att.append(td_att);
|
tr_att.append(td_att);
|
||||||
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
|
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
|
||||||
td_att.append(div_att);
|
td_att.append(div_att);
|
||||||
tb_att = $('<table id="tab_woinvoice_atts" style="table-layout: fixed;"></table>');
|
tb_att = $('<table id="tab_woinvoice_atts" style="table-layout: fixed;"></table>');
|
||||||
div_att.append(tb_att);
|
div_att.append(tb_att);
|
||||||
@@ -2369,7 +2369,7 @@ if (typeof ($woinvoice) !== "function") {
|
|||||||
tb_att.append(tr_att);
|
tb_att.append(tr_att);
|
||||||
var td_att = $('<td></td>');
|
var td_att = $('<td></td>');
|
||||||
tr_att.append(td_att);
|
tr_att.append(td_att);
|
||||||
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>');
|
div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
|
||||||
td_att.append(div_att);
|
td_att.append(div_att);
|
||||||
tb_att = $('<table id="tab_invoice_atts' + invoice_index + '" style="table-layout: fixed;"></table>');
|
tb_att = $('<table id="tab_invoice_atts' + invoice_index + '" style="table-layout: fixed;"></table>');
|
||||||
div_att.append(tb_att);
|
div_att.append(tb_att);
|
||||||
|
|||||||
@@ -195,9 +195,15 @@ var WorkOrderWidget = function () {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_this.workorderwidgets = data;
|
_this.workorderwidgets = data;
|
||||||
|
var display = data?.length > 0 ? 'block' : 'none';
|
||||||
|
$('#workorderspliter').css('display', display);
|
||||||
|
$('#workorderdetail').css('display', display);
|
||||||
_this.showWorkOrderWidgets();
|
_this.showWorkOrderWidgets();
|
||||||
_this.getWorkOrderContacts(_this.workorderid);
|
_this.getWorkOrderContacts(_this.workorderid);
|
||||||
|
setTimeout(function () {
|
||||||
|
$(window).resize();
|
||||||
|
document.querySelector('#workorderdetail').scrollTop = 0;
|
||||||
|
}, 0);
|
||||||
}, function () {
|
}, function () {
|
||||||
showAlert(GetTextByKey("P_XXXX", 'Failed to get the work order widget list.'), title);
|
showAlert(GetTextByKey("P_XXXX", 'Failed to get the work order widget list.'), title);
|
||||||
});
|
});
|
||||||
@@ -259,6 +265,9 @@ var WorkOrderWidget = function () {
|
|||||||
this.workorderwidgets = null;
|
this.workorderwidgets = null;
|
||||||
this.popups = [];
|
this.popups = [];
|
||||||
this.widgets = [];
|
this.widgets = [];
|
||||||
|
$('#workorderspliter').css('display', 'none');
|
||||||
|
$('#workorderdetail').css('display', 'none');
|
||||||
|
$(window).resize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -313,25 +322,33 @@ var WorkOrderWidget = function () {
|
|||||||
this.createWidgetDialog = function (widget) {
|
this.createWidgetDialog = function (widget) {
|
||||||
const ui = window['lib-ui'];
|
const ui = window['lib-ui'];
|
||||||
|
|
||||||
|
let width = $(document.body).width();
|
||||||
let layout = widget.Layout;
|
let layout = widget.Layout;
|
||||||
if (!layout || layout === '') {
|
if (!layout || layout === '') {
|
||||||
let x = this.defX;
|
let x = this.defX;
|
||||||
let y = this.defY;
|
let y = this.defY;
|
||||||
let width = $(document.body).width();
|
let left = 10 + 315 * x;
|
||||||
let height = $(document.body).height();
|
|
||||||
let left = 20 + 320 * x;
|
|
||||||
if (left + 300 > width) {
|
if (left + 300 > width) {
|
||||||
x = 0;
|
x = 0;
|
||||||
left = 20;
|
left = 10;
|
||||||
y++;
|
y++;
|
||||||
this.defY = y;
|
this.defY = y;
|
||||||
}
|
}
|
||||||
let top = height - (y == 0 ? 420 : 320 * (y + 1));
|
let top = 10 + 165 * y;
|
||||||
|
if (top >= widgetHeight) {
|
||||||
|
top = widgetHeight - 40;
|
||||||
|
}
|
||||||
x++;
|
x++;
|
||||||
this.defX = x;
|
this.defX = x;
|
||||||
layout = { left, top, width: 300, height: 400 };
|
layout = { left, top, width: 300, height: 400 };
|
||||||
} else {
|
} else {
|
||||||
layout = JSON.parse(widget.Layout);
|
layout = JSON.parse(widget.Layout);
|
||||||
|
if (layout.top >= widgetHeight) {
|
||||||
|
layout.top = widgetHeight - 40;
|
||||||
|
}
|
||||||
|
if (layout.left >= width) {
|
||||||
|
layout.left = width - 10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let zIndex = this.currentZIndex--;
|
let zIndex = this.currentZIndex--;
|
||||||
|
|
||||||
@@ -361,7 +378,7 @@ var WorkOrderWidget = function () {
|
|||||||
onMoveEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) },
|
onMoveEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) },
|
||||||
onResizeEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) }
|
onResizeEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) }
|
||||||
});
|
});
|
||||||
popup.show();
|
popup.show(document.querySelector('#workorderdetail'));
|
||||||
popup.rect = layout;
|
popup.rect = layout;
|
||||||
this.popups[widget.WidgetId] = popup;
|
this.popups[widget.WidgetId] = popup;
|
||||||
|
|
||||||
|
|||||||
Vendored
+6
-6
@@ -1,11 +1,11 @@
|
|||||||
(function(v,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(v=typeof globalThis<"u"?globalThis:v||self,E(v["lib-app"]={}))})(this,function(v){var _,q,K,Q,V,X,w,k,Z,ee,Y,G,W,A,U,H,te,de,ne,ue,fe,Ae,ye,$e,ge,Fe,z,$,j,oe;"use strict";var ve=(v,E,P)=>{if(!E.has(v))throw TypeError("Cannot "+P)};var e=(v,E,P)=>(ve(v,E,"read from private field"),P?P.call(v):E.get(v)),N=(v,E,P)=>{if(E.has(v))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(v):E.set(v,P)},O=(v,E,P,re)=>(ve(v,E,"write to private field"),re?re.call(v,P):E.set(v,P),P);var be=(v,E,P)=>(ve(v,E,"access private method"),P);const E="",P=window["lib-ui"].createElement;function re(ie,t){const n=P("div","comm"),s=P("div","title-bar",ie,P("div","title-functions",...t));return n.appendChild(s),n}const Ce=window["lib-ui"].Grid,_e=window["lib-ui"].Dropdown,S=window["lib-ui"].createElement,Ue=window["lib-ui"].createCheckbox,Oe=window["lib-ui"].Popup,we=window["lib-ui"].showAlert,De=window["lib-utility"].isEmail,ce=window["lib-utility"].nullOrEmpty,x=window["lib-utility"].r;class Ee{constructor(t={}){N(this,_,void 0);N(this,q,void 0);O(this,_,t)}async show(t=document.body){const n=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(l=>l.tabIndex??0))+3,s=e(this,_).contact,u=S("input",l=>{l.type="text",l.className="ui-input",l.tabIndex=n+1,l.maxLength=200,l.autocomplete="off"}),p=new _e({tabIndex:n+2});p.source=[{value:"0",text:x("text","Text")},{value:"1",text:x("email","Email")},{value:"2",text:x("phone","Phone")}];const i=S("input",l=>{l.type="email",l.className="ui-input",l.tabIndex=n+3,l.maxLength=100,l.autocomplete="off"}),d=S("input",l=>{l.type="tel",l.className="ui-input",l.tabIndex=n+4,l.maxLength=50,l.autocomplete="off"}),o=Ue({tabIndex:n+5}),a=S("textarea",l=>{l.className="ui-text",l.tabIndex=n+6,l.maxLength=2e3,l.style.height="100px"}),b=[];e(this,_).company&&b.push({text:s==null?x("addContactRecord","Add Contact Record"):x("editContactRecord","Edit Contact Record"),trigger:()=>{const l=this.prepare();if(l==null)return!1;if(l.SaveToCustomer=1,typeof e(this,_).onSave=="function")return e(this,_).onSave.call(this,l,"customerrecord")}}),b.push({text:x("workOrderOnly","Work Order Only"),trigger:()=>{const l=this.prepare();if(l==null)return!1;if(l.Id=-1,l.SaveToCustomer=0,typeof e(this,_).onSave=="function")return e(this,_).onSave.call(this,l,"workorder")}},{text:x("cancel","Cancel")});const y=new Oe({onMasking:e(this,_).onMasking,title:s==null?x("addContact","Add Contact"):x("editContact","Edit Contact"),content:S("div",l=>{l.className="setting-wrapper",l.style.width="500px"},S("div","setting-item",S("span","setting-label setting-required",x("contactNameColon","Contact Name:")),u),S("div","setting-item",S("span","setting-label",x("contactPreferencesColon","Contact Preferences:")),p.create()),S("div","setting-item",S("span","setting-label",x("contactEmailColon","Email Address:")),i),S("div","setting-item",S("span","setting-label",x("contactMobileColon","Mobile:")),d),S("div","setting-item",S("span","setting-label",x("contactOptColon","Opt Out:")),o),S("div","setting-item",S("span","setting-label",x("contactNotesColon","Notes:")),a)),buttons:b});s!=null?(u.value=s.Name,p.select(String(s.ContactPreference)),i.value=s.Email,d.value=s.MobilePhone,o.querySelector("input").checked=s.OptOut,a.value=s.Notes):p.select("0"),O(this,q,{contactName:u,preferences:p,contactEmail:i,contactMobile:d,checkOpt:o,contactNotes:a});const C=await y.show(t);return setTimeout(()=>u.focus()),C}prepare(){const t=e(this,q).contactName.value,n=e(this,q).preferences.selected.value,s=e(this,q).contactEmail.value,u=e(this,q).contactMobile.value,p=e(this,q).checkOpt.querySelector("input").checked,i=e(this,q).contactNotes.value,d=e(this,_).contact==null?x("addContact","Add Contact"):x("editContact","Edit Contact");if(ce(t))return we(d,x("contactNameRequired","Contact Name cannot be empty."),"warn").then(()=>e(this,q).contactName.focus()),null;if(ce(s)&&ce(u))return we(d,x("contactEmailPhoneRequired","Email and Mobile Phone cannot both be empty."),"warn").then(()=>ce(s)?e(this,q).contactEmail.focus():e(this,q).contactMobile.focus()),null;if(!ce(s)&&!De(s))return we(d,x("contactEmailInvalid","The email address is invalid."),"warn").then(()=>e(this,q).contactEmail.focus()),null;let o=e(this,_).contact;return o==null?o={}:o.OptOut!==p&&(p!==!1||o.OptOut_BC===!1)&&(o.selected=!p),o.Name=t,o.ContactPreference=n,o.Email=s,o.MobilePhone=u,o.OptOut=p,o.Notes=i,o}}_=new WeakMap,q=new WeakMap;class Be{constructor(t={}){N(this,K,void 0);N(this,Q,void 0);O(this,K,t)}async show(t,n=document.body){const s=S("div","selcontact-grid"),p=await new Oe({onMasking:e(this,K).onMasking,title:t,content:S("div","selcontact-wrapper",s),buttons:[{text:x("ok","OK"),key:"ok",trigger:()=>{if(typeof e(this,K).onOk=="function")return e(this,K).onOk.call(this,e(this,Q).source.filter(d=>d.selectLine truncated
|
(function(O,E){typeof exports=="object"&&typeof module<"u"?E(exports):typeof define=="function"&&define.amd?define(["exports"],E):(O=typeof globalThis<"u"?globalThis:O||self,E(O["lib-app"]={}))})(this,function(O){var _,q,K,Q,V,X,w,k,Z,ee,Y,G,W,A,U,H,te,de,ne,ue,fe,Ae,ye,$e,ge,Fe,z,$,j,oe;"use strict";var Oe=(O,E,P)=>{if(!E.has(O))throw TypeError("Cannot "+P)};var e=(O,E,P)=>(Oe(O,E,"read from private field"),P?P.call(O):E.get(O)),N=(O,E,P)=>{if(E.has(O))throw TypeError("Cannot add the same private member more than once");E instanceof WeakSet?E.add(O):E.set(O,P)},v=(O,E,P,re)=>(Oe(O,E,"write to private field"),re?re.call(O,P):E.set(O,P),P);var be=(O,E,P)=>(Oe(O,E,"access private method"),P);const E="",P=window["lib-ui"].createElement;function re(ie,t){const n=P("div","comm"),s=P("div","title-bar",ie,P("div","title-functions",...t));return n.appendChild(s),n}const Ce=window["lib-ui"].Grid,_e=window["lib-ui"].Dropdown,S=window["lib-ui"].createElement,Ue=window["lib-ui"].createCheckbox,ve=window["lib-ui"].Popup,we=window["lib-ui"].showAlert,De=window["lib-utility"].isEmail,ce=window["lib-utility"].nullOrEmpty,x=window["lib-utility"].r;class Ee{constructor(t={}){N(this,_,void 0);N(this,q,void 0);v(this,_,t)}async show(t=document.body){const n=Math.max.apply(null,[...document.querySelectorAll("[tabindex]")].map(l=>l.tabIndex??0))+3,s=e(this,_).contact,u=S("input",l=>{l.type="text",l.className="ui-input",l.tabIndex=n+1,l.maxLength=200,l.autocomplete="off"}),p=new _e({tabIndex:n+2});p.source=[{value:"0",text:x("text","Text")},{value:"1",text:x("email","Email")},{value:"2",text:x("phone","Phone")}];const i=S("input",l=>{l.type="email",l.className="ui-input",l.tabIndex=n+3,l.maxLength=100,l.autocomplete="off"}),d=S("input",l=>{l.type="tel",l.className="ui-input",l.tabIndex=n+4,l.maxLength=50,l.autocomplete="off"}),o=Ue({tabIndex:n+5}),a=S("textarea",l=>{l.className="ui-text",l.tabIndex=n+6,l.maxLength=2e3,l.style.height="100px"}),b=[];e(this,_).company&&b.push({text:s==null?x("addContactRecord","Add Contact Record"):x("editContactRecord","Edit Contact Record"),trigger:()=>{const l=this.prepare();if(l==null)return!1;if(l.SaveToCustomer=1,typeof e(this,_).onSave=="function")return e(this,_).onSave.call(this,l,"customerrecord")}}),b.push({text:x("workOrderOnly","Work Order Only"),trigger:()=>{const l=this.prepare();if(l==null)return!1;if(l.Id=-1,l.SaveToCustomer=0,typeof e(this,_).onSave=="function")return e(this,_).onSave.call(this,l,"workorder")}},{text:x("cancel","Cancel")});const y=new ve({onMasking:e(this,_).onMasking,title:s==null?x("addContact","Add Contact"):x("editContact","Edit Contact"),content:S("div",l=>{l.className="setting-wrapper",l.style.width="500px"},S("div","setting-item",S("span","setting-label setting-required",x("contactNameColon","Contact Name:")),u),S("div","setting-item",S("span","setting-label",x("contactPreferencesColon","Contact Preferences:")),p.create()),S("div","setting-item",S("span","setting-label",x("contactEmailColon","Email Address:")),i),S("div","setting-item",S("span","setting-label",x("contactMobileColon","Mobile:")),d),S("div","setting-item",S("span","setting-label",x("contactOptColon","Opt Out:")),o),S("div","setting-item",S("span","setting-label",x("contactNotesColon","Notes:")),a)),buttons:b});s!=null?(u.value=s.Name,p.select(String(s.ContactPreference)),i.value=s.Email,d.value=s.MobilePhone,o.querySelector("input").checked=s.OptOut,a.value=s.Notes):p.select("0"),v(this,q,{contactName:u,preferences:p,contactEmail:i,contactMobile:d,checkOpt:o,contactNotes:a});const C=await y.show(t);return setTimeout(()=>u.focus()),C}prepare(){const t=e(this,q).contactName.value,n=e(this,q).preferences.selected.value,s=e(this,q).contactEmail.value,u=e(this,q).contactMobile.value,p=e(this,q).checkOpt.querySelector("input").checked,i=e(this,q).contactNotes.value,d=e(this,_).contact==null?x("addContact","Add Contact"):x("editContact","Edit Contact");if(ce(t))return we(d,x("contactNameRequired","Contact Name cannot be empty."),"warn").then(()=>e(this,q).contactName.focus()),null;if(ce(s)&&ce(u))return we(d,x("contactEmailPhoneRequired","Email and Mobile Phone cannot both be empty."),"warn").then(()=>ce(s)?e(this,q).contactEmail.focus():e(this,q).contactMobile.focus()),null;if(!ce(s)&&!De(s))return we(d,x("contactEmailInvalid","The email address is invalid."),"warn").then(()=>e(this,q).contactEmail.focus()),null;let o=e(this,_).contact;return o==null?o={}:o.OptOut!==p&&(p!==!1||o.OptOut_BC===!1)&&(o.selected=!p),o.Name=t,o.ContactPreference=n,o.Email=s,o.MobilePhone=u,o.OptOut=p,o.Notes=i,o}}_=new WeakMap,q=new WeakMap;class Be{constructor(t={}){N(this,K,void 0);N(this,Q,void 0);v(this,K,t)}async show(t,n=document.body){const s=S("div","selcontact-grid"),p=await new ve({onMasking:e(this,K).onMasking,title:t,content:S("div","selcontact-wrapper",s),buttons:[{text:x("ok","OK"),key:"ok",trigger:()=>{if(typeof e(this,K).onOk=="function")return e(this,K).onOk.call(this,e(this,Q).source.filter(d=>d.selectLine truncated
|
||||||
${C}`),M(b,C)}e(this,W).scrollTop=e(this,W).scrollHeight}}set readonly(t){if(e(this,k).readonly=t,e(this,w)==null)return;const n=e(this,w).querySelector(".check-status-link");t===!0?n.classList.add("disabled"):n.classList.remove("disabled"),n.querySelector("input").disabled=t;const s=t===!0?"none":"";e(this,w).querySelector(".button-edit-contacts").style.display=s,e(this,w).querySelector(".button-edit-followers").style.display=s,e(this,w).querySelector(".message-bar").style.display=s}set recordReadonly(t){e(this,k).recordReadonly=t,e(this,w)!=null&&(e(this,w).querySelector(".button-edit-contacts").style.display=t===!0?"none":"",e(this,w).querySelector(".button-edit-followers").style.display=t===!0?"none":"")}set companyName(t){e(this,k).companyName=t;const n=e(this,w).querySelector(".title-company");T(t)?n.style.display="none":(n.innerText=t,n.style.display="")}set companyCode(t){e(this,k).companyCode=t;const n=e(this,w).querySelector(".title-company");T(e(this,k).companyName)?n.style.display="none":(n.innerText=e(this,k).companyName,T(t)||(n.innerText=e(this,k).companyName+"/"+t),n.style.display="")}get followers(){return[...e(this,ee).children].map(t=>{const n=t.querySelector("span");return{Email:n.dataset.email,MobilePhone:n.dataset.mp,Value:n.dataset.name}})}set followers(t){if(e(this,A).followers=t,e(this,ee).replaceChildren(),(t==null?void 0:t.length)>0){e(this,w).querySelector(".follower-bar").style.display="",M(e(this,Y),r("editFollower","Edit Followers")),e(this,w).querySelector(".follower-bar>.bar-list").appendChild(e(this,Y));for(let n of t){if(n.OptOut)continue;const s=String(n.MobilePhone).trim(),u=String(n.Email).trim(),p=[];n.SendEmail&&p.push(r("emailsToColon","Emails to:")+` ${u}`),n.SendText&&p.push(r("textsToColon",`Texts to: ${s}`));let i;n.SendText&&n.SendEmail?i="at":i=n.SendText?"comment-lines":"envelope";const d=f("span",a=>{n.SendEmail&&(a.dataset.email=u),n.SendText&&(a.dataset.mp=s),a.dataset.name=n.Name,a.innerText=n.Name}),o=f("div","contact-item",F("fa-light",i),d);e(this,ee).appendChild(o),d.scrollWidth>d.offsetWidth&&p.splice(0,0,r("nameColon","Name:")+` ${c.Name}`),M(d,p.join(`
|
${C}`),M(b,C)}e(this,W).scrollTop=e(this,W).scrollHeight}}set readonly(t){if(e(this,k).readonly=t,e(this,w)==null)return;const n=e(this,w).querySelector(".check-status-link");t===!0?n.classList.add("disabled"):n.classList.remove("disabled"),n.querySelector("input").disabled=t;const s=t===!0?"none":"";e(this,w).querySelector(".button-edit-contacts").style.display=s,e(this,w).querySelector(".button-edit-followers").style.display=s,e(this,w).querySelector(".message-bar").style.display=s}set recordReadonly(t){e(this,k).recordReadonly=t,e(this,w)!=null&&(e(this,w).querySelector(".button-edit-contacts").style.display=t===!0?"none":"",e(this,w).querySelector(".button-edit-followers").style.display=t===!0?"none":"")}set companyName(t){e(this,k).companyName=t;const n=e(this,w).querySelector(".title-company");T(t)?n.style.display="none":(n.innerText=t,n.style.display="")}set companyCode(t){e(this,k).companyCode=t;const n=e(this,w).querySelector(".title-company");T(e(this,k).companyName)?n.style.display="none":(n.innerText=e(this,k).companyName,T(t)||(n.innerText=e(this,k).companyName+"/"+t),n.style.display="")}get followers(){return[...e(this,ee).children].map(t=>{const n=t.querySelector("span");return{Email:n.dataset.email,MobilePhone:n.dataset.mp,Value:n.dataset.name}})}set followers(t){if(e(this,A).followers=t,e(this,ee).replaceChildren(),(t==null?void 0:t.length)>0){e(this,w).querySelector(".follower-bar").style.display="",M(e(this,Y),r("editFollower","Edit Followers")),e(this,w).querySelector(".follower-bar>.bar-list").appendChild(e(this,Y));for(let n of t){if(n.OptOut)continue;const s=String(n.MobilePhone).trim(),u=String(n.Email).trim(),p=[];n.SendEmail&&p.push(r("emailsToColon","Emails to:")+` ${u}`),n.SendText&&p.push(r("textsToColon",`Texts to: ${s}`));let i;n.SendText&&n.SendEmail?i="at":i=n.SendText?"comment-lines":"envelope";const d=f("span",a=>{n.SendEmail&&(a.dataset.email=u),n.SendText&&(a.dataset.mp=s),a.dataset.name=n.Name,a.innerText=n.Name}),o=f("div","contact-item",F("fa-light",i),d);e(this,ee).appendChild(o),d.scrollWidth>d.offsetWidth&&p.splice(0,0,r("nameColon","Name:")+` ${c.Name}`),M(d,p.join(`
|
||||||
`))}}else e(this,w).querySelector(".follower-bar").style.display="none",M(e(this,Y),r("addFollowers","Add Followers")),e(this,w).querySelector(".button-edit-contacts").insertAdjacentElement("beforebegin",e(this,Y));e(this,W).scrollTop=e(this,W).scrollHeight}setData(t,n){e(this,A)[t]=n}create(){const t=e(this,k),n=t.readonly,s=Te({className:"check-auto-update",checked:t.autoUpdates,checkedNode:F("fa-regular","redo-alt"),uncheckedNode:F("fa-regular","ban"),onchange:function(){M(s,this.checked?r("autoUpdateEnabled","Auto Updates Enabled"):r("autoUpdateDisabled","Auto Updates Disabled"))}});t.autoUpdatesVisible===!1&&(s.style.display="none");const u=Te({className:"check-status-link",enabled:!n,checked:t.statusLink,checkedNode:F("fa-regular","link"),uncheckedNode:F("fa-regular","unlink"),onchange:function(){M(u,this.checked?r("statusLinkIncluded","Status Link Included"):r("statusLinkExcluded","Status Link Excluded"))}});t.statusLinkVisible===!1&&(u.style.display="none");const p=re(f("div",null,f("div",o=>{o.className="title-module",o.innerText=t.title??r("messages","Customer Communication")}),f("div",o=>{o.className="title-company",T(t.companyName)?o.style.display="none":T(t.companyCode)?o.innerText=t.companyName:o.innerText=t.companyName+"/"+t.companyCode})),[M(s,r("autoUpdateEnabled","Auto Updates Enabled")),M(u,r("statusLinkExcluded","Status Link Excluded"))]);O(this,Z,be(this,fe,Ae).call(this,p,t)),O(this,ee,be(this,ye,$e).call(this,p,t));const i=f("textarea","ui-text");i.placeholder=r("typeMessage","Enter Message Here"),t.maxLength??(t.maxLength=3e3),i.maxLength=t.maxLength,i.addEventListener("input",()=>{const o=e(this,G).value,a=String(T(o)?0:o.length)+"/"+String(t.maxLength);e(this,w).querySelector(".message-bar .prompt-count").innerText=a}),O(this,G,i),p.appendChild(f("div",o=>{o.className="message-bar",n===!0&&(o.style.display="none")},i,f("div",o=>o.style.textAlign="right",f("div",o=>{o.className="customer-name",t.customerNameVisible!==!0&&(o.style.display="none")},f("span",o=>o.innerText=r("nameColon","Name:")),f("input",o=>{o.type="text",o.className="ui-input"})),f("div","prompt-count"),f("button",o=>{o.className="roundbtn button-send-message",o.style.backgroundColor="rgb(19, 150, 204)",o.appendChild(F("fa-solid","paper-plane")),M(o,r("sendMessage","Send Message")),o.addEventListener("click",()=>{const a=e(this,G).value;if(T(a==null?void 0:a.trim())){pe(r("error","Error"),r("messageRequired","Please input the message."),"warn");return}typeof e(this,k).onAddMessage=="function"&&e(this,k).onAddMessage(e(this,G).value)})}))));const d=f("div","list-bar");return O(this,W,d),p.appendChild(d),O(this,w,p)}load(t,n,s){var p;const u=[];if((t==null?void 0:t.length)>0){n??(n=e(this,A).contacts),s??(s=e(this,A).allfollowers);for(let i of t){const d=f("div","item-div");let o;if(i.IsReply&&(n==null?void 0:n.length)>0){const y=he(i.Sender)?n.find(C=>C.Email===i.Sender):n.find(C=>C.MobilePhone===i.Sender);o=y==null?void 0:y.Name}o??(o=i.IsReply&&String(i.FormatSender)!==""?i.FormatSender:i.Sender);let a="";if(!i.IsReply&&((p=i.OriPhoneNumbers)==null?void 0:p.length)>0)for(let y of i.OriPhoneNumbers){let C;const l=he(y);if((n==null?void 0:n.length)>0){let m=l?n.find(g=>g.Email===y):n.find(g=>g.MobilePhone===y);m!=null?C=`${l?m.Email:m.MobilePhoneDisplayText} - ${m.Name}`:(s==null?void 0:s.length)>0&&(m=l?s.find(g=>g.Email===y):s.find(g=>g.MobilePhone===y),m!=null&&(C=`${l?m.Email:m.MobilePhoneDisplayText} - ${m.Name}`))}a+=(C??y)+`
|
`))}}else e(this,w).querySelector(".follower-bar").style.display="none",M(e(this,Y),r("addFollowers","Add Followers")),e(this,w).querySelector(".button-edit-contacts").insertAdjacentElement("beforebegin",e(this,Y));e(this,W).scrollTop=e(this,W).scrollHeight}setData(t,n){e(this,A)[t]=n}create(){const t=e(this,k),n=t.readonly,s=Te({className:"check-auto-update",checked:t.autoUpdates,checkedNode:F("fa-regular","redo-alt"),uncheckedNode:F("fa-regular","ban"),onchange:function(){M(s,this.checked?r("autoUpdateEnabled","Auto Updates Enabled"):r("autoUpdateDisabled","Auto Updates Disabled"))}});t.autoUpdatesVisible===!1&&(s.style.display="none");const u=Te({className:"check-status-link",enabled:!n,checked:t.statusLink,checkedNode:F("fa-regular","link"),uncheckedNode:F("fa-regular","unlink"),onchange:function(){M(u,this.checked?r("statusLinkIncluded","Status Link Included"):r("statusLinkExcluded","Status Link Excluded"))}});t.statusLinkVisible===!1&&(u.style.display="none");const p=re(f("div",null,f("div",o=>{o.className="title-module",o.innerText=t.title??r("messages","Customer Communication")}),f("div",o=>{o.className="title-company",T(t.companyName)?o.style.display="none":T(t.companyCode)?o.innerText=t.companyName:o.innerText=t.companyName+"/"+t.companyCode})),[M(s,r("autoUpdateEnabled","Auto Updates Enabled")),M(u,r("statusLinkExcluded","Status Link Excluded"))]);v(this,Z,be(this,fe,Ae).call(this,p,t)),v(this,ee,be(this,ye,$e).call(this,p,t));const i=f("textarea","ui-text");i.placeholder=r("typeMessage","Enter Message Here"),t.maxLength??(t.maxLength=3e3),i.maxLength=t.maxLength,i.addEventListener("input",()=>{const o=e(this,G).value,a=String(T(o)?0:o.length)+"/"+String(t.maxLength);e(this,w).querySelector(".message-bar .prompt-count").innerText=a}),v(this,G,i),p.appendChild(f("div",o=>{o.className="message-bar",n===!0&&(o.style.display="none")},i,f("div",o=>o.style.textAlign="right",f("div",o=>{o.className="customer-name",t.customerNameVisible!==!0&&(o.style.display="none")},f("span",o=>o.innerText=r("nameColon","Name:")),f("input",o=>{o.type="text",o.className="ui-input"})),f("div","prompt-count"),f("button",o=>{o.className="roundbtn button-send-message",o.style.backgroundColor="rgb(19, 150, 204)",o.appendChild(F("fa-solid","paper-plane")),M(o,r("sendMessage","Send Message")),o.addEventListener("click",()=>{const a=e(this,G).value;if(T(a==null?void 0:a.trim())){pe(r("error","Error"),r("messageRequired","Please input the message."),"warn");return}typeof e(this,k).onAddMessage=="function"&&e(this,k).onAddMessage(e(this,G).value)})}))));const d=f("div","list-bar");return v(this,W,d),p.appendChild(d),v(this,w,p)}load(t,n,s){var p;const u=[];if((t==null?void 0:t.length)>0){n??(n=e(this,A).contacts),s??(s=e(this,A).allfollowers);for(let i of t){const d=f("div","item-div");let o;if(i.IsReply&&(n==null?void 0:n.length)>0){const y=he(i.Sender)?n.find(C=>C.Email===i.Sender):n.find(C=>C.MobilePhone===i.Sender);o=y==null?void 0:y.Name}o??(o=i.IsReply&&String(i.FormatSender)!==""?i.FormatSender:i.Sender);let a="";if(!i.IsReply&&((p=i.OriPhoneNumbers)==null?void 0:p.length)>0)for(let y of i.OriPhoneNumbers){let C;const l=he(y);if((n==null?void 0:n.length)>0){let m=l?n.find(g=>g.Email===y):n.find(g=>g.MobilePhone===y);m!=null?C=`${l?m.Email:m.MobilePhoneDisplayText} - ${m.Name}`:(s==null?void 0:s.length)>0&&(m=l?s.find(g=>g.Email===y):s.find(g=>g.MobilePhone===y),m!=null&&(C=`${l?m.Email:m.MobilePhoneDisplayText} - ${m.Name}`))}a+=(C??y)+`
|
||||||
`}a!==""&&(a=r("sendToColon","Send To :")+`
|
`}a!==""&&(a=r("sendToColon","Send To :")+`
|
||||||
${a}`),d.appendChild(f("div",y=>{y.className="item-poster",y.innerText=o,!i.IsReply&&(a==null?void 0:a.length)>0&&M(y,a)}));const b=f("div","item-content");if(b.appendChild(f("span",y=>{/https?:\/\//i.test(i.Message)?y.innerHTML=je(i.Message):y.innerText=i.Message})),i.IsReply)d.classList.add("item-other");else{d.classList.add("item-self");const[y,C]=be(this,ge,Fe).call(this,i);if(y!==-100){let l;switch(y){case 0:l=r("pending","Pending"),b.style.backgroundColor="#ffc107";break;case 1:l=r("sent","Sent");break;case 9:l=r("failed","Failed"),b.style.backgroundColor="#ffc107";break;case 10:l=r("optOut","Opt-Out"),b.style.backgroundColor="#ffc107";break;case 412:l=r("landline","Landline"),b.style.backgroundColor="#ffc107";break;default:l=r("undelivered","Undelivered"),b.style.backgroundColor="#ffc107";break}const m=f("div",g=>{g.className="item-status",g.innerText=l,y==-10&&M(g,C)});b.appendChild(m)}}d.append(b,f("div",y=>{y.className="item-time",y.innerText=i.TimeStr})),u.push(d)}u[0].style.marginTop="0"}e(this,W).replaceChildren(...u),e(this,W).scrollTop=e(this,W).scrollHeight}}w=new WeakMap,k=new WeakMap,Z=new WeakMap,ee=new WeakMap,Y=new WeakMap,G=new WeakMap,W=new WeakMap,A=new WeakMap,U=new WeakMap,H=new WeakMap,te=new WeakSet,de=function(){return e(this,w).querySelector(".check-auto-update>input")},ne=new WeakSet,ue=function(){return e(this,w).querySelector(".check-status-link>input")},fe=new WeakSet,Ae=function(t,n){const s=n.readonly,u=n.recordReadonly,p=f("div","bar-list-container");return t.append(f("div","contact-bar",f("div","bar-icon",F("fa-solid","user-circle",{fill:"lightgray"})),f("div","bar-list",p,f("button",i=>{i.className="roundbtn button-edit-contacts",i.style.backgroundColor="rgb(1, 199, 172)",s===!0&&(i.style.display="none"),i.appendChild(F("fa-solid","user-edit")),M(i,r("editContacts","Edit Contacts")),i.addEventListener("click",()=>{const d=new Ge({onMasking:n.onMasking,title:f("div",o=>{o.style.display="flex",o.style.alignItems="center",o.append(f("div",a=>{a.className="ui-popup-move",a.style.flex="1 1 auto"},f("div",a=>a.innerText=r("editContacts","Edit Contacts")),f("div",a=>{a.className="title-company",T(n.companyName)?a.style.display="none":T(n.companyCode)?a.innerText=n.companyName:a.innerText=n.companyName+"/"+n.companyCode})),f("button",a=>{a.style.flex="0 0 auto",a.style.backgroundColor="rgb(1, 199, 172)",a.style.marginRight="10px",a.className="roundbtn button-from-customer-record",u&&(a.style.display="none"),a.appendChild(F("fa-solid","handshake",{width:"16px",height:"16px"})),a.addEventListener("click",()=>{const b=new Be({contacts:[],onOk:C=>{typeof e(this,k).onSelectCRContacts=="function"&&(C==null||C.map(m=>(delete m.selected,m)),e(this,k).onSelectCRContacts(C));const l=e(this,A).contacts;e(this,U).source=l.filter(m=>m.Id>=0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m)),e(this,H).source=l.filter(m=>m.Id<0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m))}});var y=r("selectFromCustomerRecord","Select from Customer Record");if(b.show(y,t),typeof e(this,k).onOpenSelectCRContacts=="function"){const C=e(this,k).onOpenSelectCRContacts();return typeof(C==null?void 0:C.then)=="function"?C.then(l=>(l.map(m=>{for(let g of e(this,A).contacts)if(m.Id===g.Id){m.selected=!0;break}return typeof m.selected>"u"&&(m.selected=!1),m}),e(this,A).contacts.filter(m=>m.Id>=0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m)),b.source=l,l)):!1}}),M(a,r("selectFromCustomerRecord","Select from Customer Record"))}),f("button",a=>{a.style.flex="0 0 auto",a.style.backgroundColor="rgb(1, 199, 172)",a.style.marginRight="10px",a.className="roundbtn button-add-contact",u&&(a.style.display="none"),a.appendChild(F("fa-solid","user-plus",{width:"16px",height:"16px"})),a.addEventListener("click",()=>{new Ee({company:!T(e(this,k).companyName),onSave:y=>{if(e(this,U).source.some(l=>l.Name===y.Name&&l.MobilePhone===y.MobilePhone))return pe(r("addContact","Add Contact"),r("contactUniqueRequired","Contact name and contact mobile must be a unique combination."),"warn"),!1;if(typeof n.onSave=="function"){const l=n.onSave(y,!0);return typeof(l==null?void 0:l.then)=="function"?l.then(m=>(e(this,U).source=m.filter(g=>g.Id>=0).map(g=>(g.OptOut||g.OptOut_BC||typeof g.selected>"u"&&(g.selected=!0),g)),e(this,H).source=m.filter(g=>g.Id<0).map(g=>(g.OptOut||g.OptOut_BC||typeof g.selected>"u"&&(g.selected=!0),g)),m)):!1}}}).show(t)}),M(a,r("addContact","Add Contact"))}))}),content:f("div",null,f("div",o=>{T(e(this,k).companyName)&&(o.style.display="none"),o.style.fontWeight="bold",o.innerText=r("contactFromRecord","Contacts from Customer Record")}),f("div",o=>{T(e(this,k).companyName)&&(o.style.display="none"),o.className="contacts-record",o.style.maxHeight="200px",o.style.width="675px",o.style.overflow="auto"}),f("div",o=>{o.style.fontWeight="bold",o.innerText=r("contactFromWorkOrder","Contacts not on Customer Record")}),f("div",o=>{o.className="co
Line truncated
|
${a}`),d.appendChild(f("div",y=>{y.className="item-poster",y.innerText=o,!i.IsReply&&(a==null?void 0:a.length)>0&&M(y,a)}));const b=f("div","item-content");if(b.appendChild(f("span",y=>{/https?:\/\//i.test(i.Message)?y.innerHTML=je(i.Message):y.innerText=i.Message})),i.IsReply)d.classList.add("item-other");else{d.classList.add("item-self");const[y,C]=be(this,ge,Fe).call(this,i);if(y!==-100){let l;switch(y){case 0:l=r("pending","Pending"),b.style.backgroundColor="#ffc107";break;case 1:l=r("sent","Sent");break;case 9:l=r("failed","Failed"),b.style.backgroundColor="#ffc107";break;case 10:l=r("optOut","Opt-Out"),b.style.backgroundColor="#ffc107";break;case 412:l=r("landline","Landline"),b.style.backgroundColor="#ffc107";break;default:l=r("undelivered","Undelivered"),b.style.backgroundColor="#ffc107";break}const m=f("div",g=>{g.className="item-status",g.innerText=l,y==-10&&M(g,C)});b.appendChild(m)}}d.append(b,f("div",y=>{y.className="item-time",y.innerText=i.TimeStr})),u.push(d)}u[0].style.marginTop="0"}e(this,W).replaceChildren(...u),e(this,W).scrollTop=e(this,W).scrollHeight}}w=new WeakMap,k=new WeakMap,Z=new WeakMap,ee=new WeakMap,Y=new WeakMap,G=new WeakMap,W=new WeakMap,A=new WeakMap,U=new WeakMap,H=new WeakMap,te=new WeakSet,de=function(){return e(this,w).querySelector(".check-auto-update>input")},ne=new WeakSet,ue=function(){return e(this,w).querySelector(".check-status-link>input")},fe=new WeakSet,Ae=function(t,n){const s=n.readonly,u=n.recordReadonly,p=f("div","bar-list-container");return t.append(f("div","contact-bar",f("div","bar-icon",F("fa-solid","user-circle",{fill:"lightgray"})),f("div","bar-list",p,f("button",i=>{i.className="roundbtn button-edit-contacts",i.style.backgroundColor="rgb(1, 199, 172)",s===!0&&(i.style.display="none"),i.appendChild(F("fa-solid","user-edit")),M(i,r("editContacts","Edit Contacts")),i.addEventListener("click",()=>{const d=new Ge({onMasking:n.onMasking,title:f("div",o=>{o.style.display="flex",o.style.alignItems="center",o.style.padding="10px 0 6px 12px",o.append(f("div",a=>{a.className="ui-popup-move",a.style.flex="1 1 auto"},f("div",a=>a.innerText=r("editContacts","Edit Contacts")),f("div",a=>{a.className="title-company",T(n.companyName)?a.style.display="none":T(n.companyCode)?a.innerText=n.companyName:a.innerText=n.companyName+"/"+n.companyCode})),f("button",a=>{a.style.flex="0 0 auto",a.style.backgroundColor="rgb(1, 199, 172)",a.style.marginRight="10px",a.className="roundbtn button-from-customer-record",u&&(a.style.display="none"),a.appendChild(F("fa-solid","handshake",{width:"16px",height:"16px"})),a.addEventListener("click",()=>{const b=new Be({contacts:[],onOk:C=>{typeof e(this,k).onSelectCRContacts=="function"&&(C==null||C.map(m=>(delete m.selected,m)),e(this,k).onSelectCRContacts(C));const l=e(this,A).contacts;e(this,U).source=l.filter(m=>m.Id>=0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m)),e(this,H).source=l.filter(m=>m.Id<0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m))}});var y=r("selectFromCustomerRecord","Select from Customer Record");if(b.show(y,t),typeof e(this,k).onOpenSelectCRContacts=="function"){const C=e(this,k).onOpenSelectCRContacts();return typeof(C==null?void 0:C.then)=="function"?C.then(l=>(l.map(m=>{for(let g of e(this,A).contacts)if(m.Id===g.Id){m.selected=!0;break}return typeof m.selected>"u"&&(m.selected=!1),m}),e(this,A).contacts.filter(m=>m.Id>=0).map(m=>(m.OptOut||m.OptOut_BC||typeof m.selected>"u"&&(m.selected=!0),m)),b.source=l,l)):!1}}),M(a,r("selectFromCustomerRecord","Select from Customer Record"))}),f("button",a=>{a.style.flex="0 0 auto",a.style.backgroundColor="rgb(1, 199, 172)",a.style.marginRight="10px",a.className="roundbtn button-add-contact",u&&(a.style.display="none"),a.appendChild(F("fa-solid","user-plus",{width:"16px",height:"16px"})),a.addEventListener("click",()=>{new Ee({company:!T(e(this,k).companyName),onSave:y=>{if(e(this,U).source.some(l=>l.Name===y.Name&&l.MobilePhone===y.MobilePhone))return pe(r("addContact","Add Contact"),r("contactUniqueRequired","Contact name and contact mobile must be a unique combination."),"warn"),!1;if(typeof n.onSave=="function"){const l=n.onSave(y,!0);return typeof(l==null?void 0:l.then)=="function"?l.then(m=>(e(this,U).source=m.filter(g=>g.Id>=0).map(g=>(g.OptOut||g.OptOut_BC||typeof g.selected>"u"&&(g.selected=!0),g)),e(this,H).source=m.filter(g=>g.Id<0).map(g=>(g.OptOut||g.OptOut_BC||typeof g.selected>"u"&&(g.selected=!0),g)),m)):!1}}}).show(t)}),M(a,r("addContact","Add Contact"))}))}),content:f("div",null,f("div",o=>{T(e(this,k).companyName)&&(o.style.display="none"),o.style.fontWeight="bold",o.innerText=r("contactFromRecord","Contacts from Customer Record")}),f("div",o=>{T(e(this,k).companyName)&&(o.style.display="none"),o.className="contacts-record",o.style.maxHeight="200px",o.style.width="675px",o.style.overflow="auto"}),f("div",o=>{o.style.fontWeight="bold",o.innerText=r("contactFromWorkOrder","Contacts not on Customer Reco
Line truncated
|
||||||
|
|
||||||
Do you want to Continue?`).replace("{name}",this.Name),[{key:"continue",text:r("continue","Continue")},{key:"cancel",text:r("cancel","Cancel")}]).then(h=>{if((h==null?void 0:h.key)==="continue"){typeof n.onDelete=="function"&&n.onDelete(h.key,this);const I=g.source.indexOf(this);if(I>=0){const D=g.source;D.splice(I,1),g.extraRows=D.filter(ae=>!T(ae.Notes)).length,g.source=D}}})}}}],g.init(d.container.querySelector(".contacts-wo"));const Le=e(this,A).contacts.filter(h=>h.Id<0).map(h=>(h.OptOut||h.OptOut_BC||typeof h.selected>"u"&&(h.selected=!0),h));g.extraRows=Le.filter(h=>!T(h.Notes)).length,g.source=Le,g.selectedRowChanged=h=>{var I;h>=0&&((I=e(this,U).selectedIndexes)==null?void 0:I.length)>0&&(e(this,U).selectedIndexes=[])},O(this,H,g)})})})))),p},ye=new WeakSet,$e=function(t,n){const s=n.readonly,u=n.recordReadonly,p=f("div","bar-list-container"),i=f("button",d=>{d.className="roundbtn button-edit-followers",d.style.backgroundColor="rgb(48, 107, 255)",(s===!0||u)&&(d.style.display="none"),d.appendChild(F("fa-solid","pen")),M(d,r("editFollower","Edit Followers")),d.addEventListener("click",()=>{typeof e(this,k).onInitFollower=="function"&&e(this,k).onInitFollower(e(this,A).followers).then(o=>{var y;if(typeof o=="string"){pe(r("customerRecord","Customer Record"),o,"warn");return}const a=new Ve({onMasking:n.onMasking,followers:o,onOk:C=>{if(typeof e(this,k).onAddFollower=="function"){const l=e(this,k).onAddFollower(C);return typeof(l==null?void 0:l.then)=="function"?l.then(m=>m):!1}}});var b=((y=e(this,A).followers)==null?void 0:y.length)>0?r("editFollowers","Edit Followers"):r("addFollowers","Add Followers");a.show(b,t)})})});return O(this,Y,i),t.append(f("div",d=>{d.className="contact-bar follower-bar",d.style.display="none"},M(f("div","bar-icon",F("fa-solid","user-tag",{fill:"#fff","background-color":"lightgray","box-sizing":"border-box","border-radius":"15px",padding:"4px"})),r("copied","Copied")),f("div","bar-list",p,i))),p},ge=new WeakSet,Fe=function(t){var p;let n=-100;const s=[];let u="";if(!t.StatusIncorrect&&((p=t.Participator)==null?void 0:p.length)>0){for(let i of t.Participator)if(!he(i.CustomerNumber)){s.indexOf(i.Status)<0&&s.push(i.Status),u.length>0&&(u+=`
|
Do you want to Continue?`).replace("{name}",this.Name),[{key:"continue",text:r("continue","Continue")},{key:"cancel",text:r("cancel","Cancel")}]).then(h=>{if((h==null?void 0:h.key)==="continue"){typeof n.onDelete=="function"&&n.onDelete(h.key,this);const I=g.source.indexOf(this);if(I>=0){const D=g.source;D.splice(I,1),g.extraRows=D.filter(ae=>!T(ae.Notes)).length,g.source=D}}})}}}],g.init(d.container.querySelector(".contacts-wo"));const Le=e(this,A).contacts.filter(h=>h.Id<0).map(h=>(h.OptOut||h.OptOut_BC||typeof h.selected>"u"&&(h.selected=!0),h));g.extraRows=Le.filter(h=>!T(h.Notes)).length,g.source=Le,g.selectedRowChanged=h=>{var I;h>=0&&((I=e(this,U).selectedIndexes)==null?void 0:I.length)>0&&(e(this,U).selectedIndexes=[])},v(this,H,g)})})})))),p},ye=new WeakSet,$e=function(t,n){const s=n.readonly,u=n.recordReadonly,p=f("div","bar-list-container"),i=f("button",d=>{d.className="roundbtn button-edit-followers",d.style.backgroundColor="rgb(48, 107, 255)",(s===!0||u)&&(d.style.display="none"),d.appendChild(F("fa-solid","pen")),M(d,r("editFollower","Edit Followers")),d.addEventListener("click",()=>{typeof e(this,k).onInitFollower=="function"&&e(this,k).onInitFollower(e(this,A).followers).then(o=>{var y;if(typeof o=="string"){pe(r("customerRecord","Customer Record"),o,"warn");return}const a=new Ve({onMasking:n.onMasking,followers:o,onOk:C=>{if(typeof e(this,k).onAddFollower=="function"){const l=e(this,k).onAddFollower(C);return typeof(l==null?void 0:l.then)=="function"?l.then(m=>m):!1}}});var b=((y=e(this,A).followers)==null?void 0:y.length)>0?r("editFollowers","Edit Followers"):r("addFollowers","Add Followers");a.show(b,t)})})});return v(this,Y,i),t.append(f("div",d=>{d.className="contact-bar follower-bar",d.style.display="none"},M(f("div","bar-icon",F("fa-solid","user-tag",{fill:"#fff","background-color":"lightgray","box-sizing":"border-box","border-radius":"15px",padding:"4px"})),r("copied","Copied")),f("div","bar-list",p,i))),p},ge=new WeakSet,Fe=function(t){var p;let n=-100;const s=[];let u="";if(!t.StatusIncorrect&&((p=t.Participator)==null?void 0:p.length)>0){for(let i of t.Participator)if(!he(i.CustomerNumber)){s.indexOf(i.Status)<0&&s.push(i.Status),u.length>0&&(u+=`
|
||||||
`),u+=`${i.CustomerNumber}: `;const d={0:r("undelivered","Undelivered"),1:r("sent","Sent"),9:r("failed","Failed")}[i.Status];d!=null&&(u+=d)}}return s.length===1?n=s[0]:s.length>1&&(n=-10),[n,u]};const L=window["lib-ui"].createElement,ke=window["lib-ui"].setTooltip,Pe=window["lib-ui"].createIcon,le=window["lib-utility"].r,Ie=window["lib-utility"].nullOrEmpty,Je=window["lib-utility"].escapeHtml;class Qe{constructor(t){N(this,z,void 0);N(this,$,void 0);N(this,j,void 0);N(this,oe,void 0);O(this,$,t??{})}get text(){var t;return(t=e(this,j))==null?void 0:t.value}set text(t){const n=e(this,j);n!=null&&(n.value=t,t=String(Ie(t)?0:val.length)+"/"+String(e(this,$).maxLength),e(this,z).querySelector(".message-bar .prompt-count").innerText=t)}set readonly(t){e(this,$).readonly=t,e(this,z)!=null&&(e(this,j).disabled=t===!0,e(this,z).querySelector(".button-send-message").style.display=t===!0?"none":"",e(this,z).querySelector(".button-post-note").style.display=t===!0?"none":"")}create(){var p;const t=re(L("div",null,L("div",i=>{i.className="title-module",i.innerText=le("internalComments","Internal Comments")})),[]),n=e(this,$).readonly,s=L("textarea","ui-text");s.placeholder=le("typeComment","Enter Comment Here"),s.maxLength=(p=e(this,$)).maxLength??(p.maxLength=3e3),s.addEventListener("input",()=>{const i=e(this,j).value,d=String(Ie(i)?0:i.length)+"/"+String(e(this,$).maxLength);e(this,z).querySelector(".message-bar .prompt-count").innerText=d}),n===!0&&(s.disabled=!0),O(this,j,s),t.appendChild(L("div","message-bar",s,L("div",i=>i.style.textAlign="right",L("div","prompt-count"),L("button",i=>{i.className="roundbtn button-send-message",i.style.backgroundColor="rgb(19, 150, 204)",(n===!0||e(this,$).noMessage===!0)&&(i.style.display="none"),i.appendChild(Pe("fa-solid","paper-plane")),ke(i,le("sendMessage","Send Message")),i.addEventListener("click",()=>{typeof e(this,$).onAddMessage=="function"&&e(this,$).onAddMessage(e(this,j).value)})}),L("button",i=>{i.className="roundbtn button-post-note",i.style.border="1px solid rgb(19, 150, 204)",i.style.fill="rgb(19, 150, 204)",n===!0&&(i.style.display="none"),i.appendChild(Pe("fa-solid","comment-alt-lines")),ke(i,le("postNote","Post Note")),i.addEventListener("click",()=>{typeof e(this,$).onAddComment=="function"&&e(this,$).onAddComment(e(this,j).value)})}))));const u=L("div","list-bar");return O(this,oe,u),t.appendChild(u),O(this,z,t)}load(t){var s;const n=[];if((t==null?void 0:t.length)>0){for(let u of t){const p=L("div","item-div");p.appendChild(L("div",d=>{d.className="item-poster",d.innerText=u.UserName}));const i=L("div","item-content");if(i.appendChild(L("span",d=>d.innerHTML=Je(u.Comment))),((s=u.FollowUp)==null?void 0:s.length)>0){p.classList.add("item-sent");const d=le("sendToColon","Send To :")+`\r
|
`),u+=`${i.CustomerNumber}: `;const d={0:r("undelivered","Undelivered"),1:r("sent","Sent"),9:r("failed","Failed")}[i.Status];d!=null&&(u+=d)}}return s.length===1?n=s[0]:s.length>1&&(n=-10),[n,u]};const L=window["lib-ui"].createElement,ke=window["lib-ui"].setTooltip,Pe=window["lib-ui"].createIcon,le=window["lib-utility"].r,Ie=window["lib-utility"].nullOrEmpty,Je=window["lib-utility"].escapeHtml;class Qe{constructor(t){N(this,z,void 0);N(this,$,void 0);N(this,j,void 0);N(this,oe,void 0);v(this,$,t??{})}get text(){var t;return(t=e(this,j))==null?void 0:t.value}set text(t){const n=e(this,j);n!=null&&(n.value=t,t=String(Ie(t)?0:val.length)+"/"+String(e(this,$).maxLength),e(this,z).querySelector(".message-bar .prompt-count").innerText=t)}set readonly(t){e(this,$).readonly=t,e(this,z)!=null&&(e(this,j).disabled=t===!0,e(this,z).querySelector(".button-send-message").style.display=t===!0?"none":"",e(this,z).querySelector(".button-post-note").style.display=t===!0?"none":"")}create(){var p;const t=re(L("div",null,L("div",i=>{i.className="title-module",i.innerText=le("internalComments","Internal Comments")})),[]),n=e(this,$).readonly,s=L("textarea","ui-text");s.placeholder=le("typeComment","Enter Comment Here"),s.maxLength=(p=e(this,$)).maxLength??(p.maxLength=3e3),s.addEventListener("input",()=>{const i=e(this,j).value,d=String(Ie(i)?0:i.length)+"/"+String(e(this,$).maxLength);e(this,z).querySelector(".message-bar .prompt-count").innerText=d}),n===!0&&(s.disabled=!0),v(this,j,s),t.appendChild(L("div","message-bar",s,L("div",i=>i.style.textAlign="right",L("div","prompt-count"),L("button",i=>{i.className="roundbtn button-send-message",i.style.backgroundColor="rgb(19, 150, 204)",(n===!0||e(this,$).noMessage===!0)&&(i.style.display="none"),i.appendChild(Pe("fa-solid","paper-plane")),ke(i,le("sendMessage","Send Message")),i.addEventListener("click",()=>{typeof e(this,$).onAddMessage=="function"&&e(this,$).onAddMessage(e(this,j).value)})}),L("button",i=>{i.className="roundbtn button-post-note",i.style.border="1px solid rgb(19, 150, 204)",i.style.fill="rgb(19, 150, 204)",n===!0&&(i.style.display="none"),i.appendChild(Pe("fa-solid","comment-alt-lines")),ke(i,le("postNote","Post Note")),i.addEventListener("click",()=>{typeof e(this,$).onAddComment=="function"&&e(this,$).onAddComment(e(this,j).value)})}))));const u=L("div","list-bar");return v(this,oe,u),t.appendChild(u),v(this,z,t)}load(t){var s;const n=[];if((t==null?void 0:t.length)>0){for(let u of t){const p=L("div","item-div");p.appendChild(L("div",d=>{d.className="item-poster",d.innerText=u.UserName}));const i=L("div","item-content");if(i.appendChild(L("span",d=>d.innerHTML=Je(u.Comment))),((s=u.FollowUp)==null?void 0:s.length)>0){p.classList.add("item-sent");const d=le("sendToColon","Send To :")+`\r
|
||||||
`+u.FollowUp.split(";").join(`\r
|
`+u.FollowUp.split(";").join(`\r
|
||||||
`);i.appendChild(L("div",o=>{o.className="item-status",o.innerText=le("sent","Sent"),ke(o,d)}))}p.append(i,L("div",d=>{d.className="item-time",d.innerText=u.SubmitDateStr})),n.push(p)}n[0].style.marginTop="0"}e(this,oe).replaceChildren(...n),e(this,oe).scrollTop=e(this,oe).scrollHeight}}z=new WeakMap,$=new WeakMap,j=new WeakMap,oe=new WeakMap,v.CustomerCommunication=Ye,v.InternalComment=Qe,Object.defineProperty(v,Symbol.toStringTag,{value:"Module"})});
|
`);i.appendChild(L("div",o=>{o.className="item-status",o.innerText=le("sent","Sent"),ke(o,d)}))}p.append(i,L("div",d=>{d.className="item-time",d.innerText=u.SubmitDateStr})),n.push(p)}n[0].style.marginTop="0"}e(this,oe).replaceChildren(...n),e(this,oe).scrollTop=e(this,oe).scrollHeight}}z=new WeakMap,$=new WeakMap,j=new WeakMap,oe=new WeakMap,O.CustomerCommunication=Ye,O.InternalComment=Qe,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
|
||||||
//# sourceMappingURL=app.min.js.map
|
//# sourceMappingURL=app.min.js.map
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"app.min.js","sources":["../../../../../../UILib/ui-lib/lib/app/communications/lib.js","../../../../../../UILib/ui-lib/lib/app/communications/contact.js","../../../../../../UILib/ui-lib/lib/app/communications/follower.js","../../../../../../UILib/ui-lib/lib/app/communications/customer.js","../../../../../../UILib/ui-lib/lib/app/communications/internal.js"],"sourcesContent":["import { createElement } from \"../../ui\";\r\n\r\nfunction createBox(title, functions) {\r\n const container = createElement('div', 'comm');\r\n const header = createElement('div', 'title-bar',\r\n title,\r\n createElement('div', 'title-functions', ...functions)\r\n );\r\n container.appendChild(header);\r\n return container;\r\n}\r\n\r\nexport {\r\n createBox\r\n}","import { Grid, Dropdown, createElement, createCheckbox, Popup, showAlert } from \"../../ui\";\r\nimport { isEmail, nullOrEmpty, r } from \"../../utility\";\r\n\r\nclass Contact {\r\n #option;\r\n #refs;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const c = this.#option.contact;\r\n const contactName = createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 1;\r\n input.maxLength = 200;\r\n input.autocomplete = 'off';\r\n });\r\n const preferences = new Dropdown({ tabIndex: tabIndex + 2 });\r\n preferences.source = [\r\n { value: '0', text: r('text', 'Text') },\r\n { value: '1', text: r('email', 'Email') },\r\n { value: '2', text: r('phone', 'Phone') }\r\n ];\r\n const contactEmail = createElement('input', input => {\r\n input.type = 'email';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 3;\r\n input.maxLength = 100;\r\n input.autocomplete = 'off';\r\n });\r\n const contactMobile = createElement('input', input => {\r\n input.type = 'tel';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 4;\r\n input.maxLength = 50;\r\n input.autocomplete = 'off';\r\n });\r\n const checkOpt = createCheckbox({ tabIndex: tabIndex + 5 });\r\n const contactNotes = createElement('textarea', txt => {\r\n txt.className = 'ui-text';\r\n txt.tabIndex = tabIndex + 6;\r\n txt.maxLength = 2000;\r\n txt.style.height = '100px';\r\n });\r\n const buttons = [];\r\n if (this.#option.company) {\r\n buttons.push({\r\n text: c == null ? r('addContactRecord', 'Add Contact Record') : r('editContactRecord', 'Edit Contact Record'),\r\n // tabIndex: tabIndex + 7,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.SaveToCustomer = 1;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'customerrecord');\r\n }\r\n }\r\n });\r\n }\r\n buttons.push(\r\n {\r\n text: r('workOrderOnly', 'Work Order Only'),\r\n // tabIndex: tabIndex + 8,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.Id = -1;\r\n item.SaveToCustomer = 0;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'workorder');\r\n }\r\n }\r\n },\r\n {\r\n text: r('cancel', 'Cancel'),\r\n // tabIndex: tabIndex + 9\r\n }\r\n );\r\n const popup = new Popup({\r\n onMasking: this.#option.onMasking,\r\n title: c == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact'),\r\n content: createElement('div', wrapper => {\r\n wrapper.className = 'setting-wrapper';\r\n wrapper.style.width = '500px';\r\n },\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label setting-required', r('contactNameColon', 'Contact Name:')),\r\n contactName\r\n ),\r\n createElement('div', 'settingLine truncated
|
{"version":3,"file":"app.min.js","sources":["../../../../../../UILib/ui-lib/lib/app/communications/lib.js","../../../../../../UILib/ui-lib/lib/app/communications/contact.js","../../../../../../UILib/ui-lib/lib/app/communications/follower.js","../../../../../../UILib/ui-lib/lib/app/communications/customer.js","../../../../../../UILib/ui-lib/lib/app/communications/internal.js"],"sourcesContent":["import { createElement } from \"../../ui\";\r\n\r\nfunction createBox(title, functions) {\r\n const container = createElement('div', 'comm');\r\n const header = createElement('div', 'title-bar',\r\n title,\r\n createElement('div', 'title-functions', ...functions)\r\n );\r\n container.appendChild(header);\r\n return container;\r\n}\r\n\r\nexport {\r\n createBox\r\n}","import { Grid, Dropdown, createElement, createCheckbox, Popup, showAlert } from \"../../ui\";\r\nimport { isEmail, nullOrEmpty, r } from \"../../utility\";\r\n\r\nclass Contact {\r\n #option;\r\n #refs;\r\n\r\n constructor(option = {}) {\r\n this.#option = option;\r\n }\r\n\r\n async show(parent = document.body) {\r\n const tabIndex = Math.max.apply(null, [...document.querySelectorAll('[tabindex]')].map(e => e.tabIndex ?? 0)) + 3;\r\n\r\n const c = this.#option.contact;\r\n const contactName = createElement('input', input => {\r\n input.type = 'text';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 1;\r\n input.maxLength = 200;\r\n input.autocomplete = 'off';\r\n });\r\n const preferences = new Dropdown({ tabIndex: tabIndex + 2 });\r\n preferences.source = [\r\n { value: '0', text: r('text', 'Text') },\r\n { value: '1', text: r('email', 'Email') },\r\n { value: '2', text: r('phone', 'Phone') }\r\n ];\r\n const contactEmail = createElement('input', input => {\r\n input.type = 'email';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 3;\r\n input.maxLength = 100;\r\n input.autocomplete = 'off';\r\n });\r\n const contactMobile = createElement('input', input => {\r\n input.type = 'tel';\r\n input.className = 'ui-input';\r\n input.tabIndex = tabIndex + 4;\r\n input.maxLength = 50;\r\n input.autocomplete = 'off';\r\n });\r\n const checkOpt = createCheckbox({ tabIndex: tabIndex + 5 });\r\n const contactNotes = createElement('textarea', txt => {\r\n txt.className = 'ui-text';\r\n txt.tabIndex = tabIndex + 6;\r\n txt.maxLength = 2000;\r\n txt.style.height = '100px';\r\n });\r\n const buttons = [];\r\n if (this.#option.company) {\r\n buttons.push({\r\n text: c == null ? r('addContactRecord', 'Add Contact Record') : r('editContactRecord', 'Edit Contact Record'),\r\n // tabIndex: tabIndex + 7,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.SaveToCustomer = 1;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'customerrecord');\r\n }\r\n }\r\n });\r\n }\r\n buttons.push(\r\n {\r\n text: r('workOrderOnly', 'Work Order Only'),\r\n // tabIndex: tabIndex + 8,\r\n trigger: () => {\r\n const item = this.prepare();\r\n if (item == null) {\r\n return false;\r\n }\r\n item.Id = -1;\r\n item.SaveToCustomer = 0;\r\n if (typeof this.#option.onSave === 'function') {\r\n return this.#option.onSave.call(this, item, 'workorder');\r\n }\r\n }\r\n },\r\n {\r\n text: r('cancel', 'Cancel'),\r\n // tabIndex: tabIndex + 9\r\n }\r\n );\r\n const popup = new Popup({\r\n onMasking: this.#option.onMasking,\r\n title: c == null ? r('addContact', 'Add Contact') : r('editContact', 'Edit Contact'),\r\n content: createElement('div', wrapper => {\r\n wrapper.className = 'setting-wrapper';\r\n wrapper.style.width = '500px';\r\n },\r\n createElement('div', 'setting-item',\r\n createElement('span', 'setting-label setting-required', r('contactNameColon', 'Contact Name:')),\r\n contactName\r\n ),\r\n createElement('div', 'settingLine truncated
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
@-webkit-keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}:root{--color: #201f1e;--bg-color: #fff;--border-color: #b9b9b9;--focus-border-color: #666;--shadow-color: rgba(0, 0, 0,.11);--disabled-color: #aaa;--disabled-bg-color: #e9e9e9;--disabled-border-color: #d9d9d9;--red-color: red;--title-color: #fff;--title-bg-color: rgb(68, 114, 196);--hover-bg-color: #eee;--link-color: #1890ff;--primary-color: rgb(123, 28, 33);--loading-bg-color: hsla(0, 0%, 100%, .4);--loading-fore-color: rgba(0, 0, 0, .2);--border-radius: 2px;--text-indent: 4px;--line-height: 24px;--font-size: .8125rem;--font-smaller-size: .75rem;--font-larger-size: .875rem;--font-family: "Franklin Gothic Book", "San Francisco", "Segoe UI", "Open Sans", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei UI", sans-serif}.ui-text,.ui-input[type]{font-size:var(--font-size);font-family:var(--font-family);border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-text:focus,.ui-text:focus-visible,.ui-input[type]:focus,.ui-input[type]:focus-visible{outline:none}.ui-text:focus,.ui-text:hover,.ui-input[type]:focus,.ui-input[type]:hover{border-color:var(--focus-border-color)}.ui-text:disabled,.ui-input[type]:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-input{text-indent:var(--text-indent);line-height:var(--line-height)}.ui-check-image-wrapper>input[type=checkbox]{display:none}.ui-check-image-wrapper>input[type=checkbox]:checked~.checked{display:inline}.ui-check-image-wrapper>input[type=checkbox]:checked~.unchecked{display:none}.ui-check-image-wrapper>.checked{display:none}.ui-check-image-wrapper>.unchecked{display:inline}.ui-check-wrapper{display:inline-flex;align-items:center;padding:0 8px;height:36px}.ui-check-wrapper .ui-check-inner{position:relative;display:inline-block;padding:0;width:14px;height:14px;background-color:#fff;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:focus-visible{outline:none}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:hover{border-color:var(--focus-border-color)}.ui-check-wrapper .ui-check-inner:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-check-wrapper .ui-check-inner>svg{position:absolute;top:0;left:0;width:100%;height:100%;fill:#fff;-webkit-transform:scale(0);transform:scale(0);opacity:0;transition:all .08s cubic-bezier(.78,.14,.15,.86)}.ui-check-wrapper.ui-radio-wrapper .ui-check-inner{box-sizing:border-box;border-radius:8px;width:16px;height:16px}.ui-check-wrapper>input[type=checkbox],.ui-check-wrapper>input[type=radio]{display:none}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner{border-color:var(--link-color);background-color:var(--link-color)}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner>svg,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner>svg{-webkit-transform:scale(1);transform:scale(1);opacity:1}.ui-check-wrapper>input[type=checkbox]:disabled:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled:checked+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-border-color)}.ui-check-wrapper>input[type=checkbox]:disabled+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-bg-color);cursor:default}.ui-check-wrapper>input[type=checkbox]:disabled~span,.ui-check-wrapper>input[type=radio]:disabled~span{color:var(--disabled-border-color);cursor:default}.ui-check-wrapper .ui-check-inner{flex:0 0 auto}.ui-check-wrapper .ui-check-inner+*{flex:1 1 auto;font-weight:400;font-size:var(--font-size);padding-left:8px;padding-right:6px;align-self:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;color:var(--color)}.ui-tooltip-color{background-color:#fff;color:#323130;border-color:#cccc}.ui-tooltip-color:focus,.ui-tooltip-color:focus-visible{outline:none}.ui-tooltip-wrapper{position:absolute;word-wrap:break-word;height:auto;text-align:left;z-index:250;min-width:45px;max-width:480px;min-height:32px;border-radius:2px;box-shadow:0 3.2px 7.2px #00000021,0 .6px 1.8px #0000001c;transition:visibility 0s linear .12s,opacity .12s ease}.ui-tooltip-wrapper>.ui-tooltip-pointer{box-sizing:border-box;box-shadow:0 5px 15px 2px #0000004d;border:1px solid #fff;z-index:-1;width:16px;height:16px;positionLine truncated
|
@-webkit-keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes loading-spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}:root{--color: #201f1e;--bg-color: #fff;--border-color: #b9b9b9;--focus-border-color: #666;--shadow-color: rgba(0, 0, 0,.11);--disabled-color: #aaa;--disabled-bg-color: #e9e9e9;--disabled-border-color: #d9d9d9;--red-color: red;--title-color: #fff;--title-bg-color: rgb(68, 114, 196);--hover-bg-color: #eee;--link-color: #1890ff;--primary-color: rgb(123, 28, 33);--loading-bg-color: hsla(0, 0%, 100%, .4);--loading-fore-color: rgba(0, 0, 0, .2);--border-radius: 2px;--text-indent: 4px;--line-height: 24px;--font-size: .8125rem;--font-smaller-size: .75rem;--font-larger-size: .875rem;--font-family: "Franklin Gothic Book", "San Francisco", "Segoe UI", "Open Sans", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei UI", sans-serif}.ui-text,.ui-input[type]{font-size:var(--font-size);font-family:var(--font-family);border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-text:focus,.ui-text:focus-visible,.ui-input[type]:focus,.ui-input[type]:focus-visible{outline:none}.ui-text:focus,.ui-text:hover,.ui-input[type]:focus,.ui-input[type]:hover{border-color:var(--focus-border-color)}.ui-text:disabled,.ui-input[type]:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-input{text-indent:var(--text-indent);line-height:var(--line-height)}.ui-check-image-wrapper>input[type=checkbox]{display:none}.ui-check-image-wrapper>input[type=checkbox]:checked~.checked{display:inline}.ui-check-image-wrapper>input[type=checkbox]:checked~.unchecked{display:none}.ui-check-image-wrapper>.checked{display:none}.ui-check-image-wrapper>.unchecked{display:inline}.ui-check-wrapper{display:inline-flex;align-items:center;padding:0 8px;height:36px}.ui-check-wrapper .ui-check-inner{position:relative;display:inline-block;padding:0;width:14px;height:14px;background-color:#fff;-webkit-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;border:1px solid var(--border-color);border-radius:var(--border-radius);transition:border-color .12s ease}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:focus-visible{outline:none}.ui-check-wrapper .ui-check-inner:focus,.ui-check-wrapper .ui-check-inner:hover{border-color:var(--focus-border-color)}.ui-check-wrapper .ui-check-inner:disabled{border-color:var(--disabled-border-color);color:var(--disabled-color);background-color:var(--disabled-bg-color)}.ui-check-wrapper .ui-check-inner>svg{position:absolute;top:0;left:0;width:100%;height:100%;fill:#fff;-webkit-transform:scale(0);transform:scale(0);opacity:0;transition:all .08s cubic-bezier(.78,.14,.15,.86)}.ui-check-wrapper.ui-radio-wrapper .ui-check-inner{box-sizing:border-box;border-radius:8px;width:16px;height:16px}.ui-check-wrapper>input[type=checkbox],.ui-check-wrapper>input[type=radio]{display:none}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner{border-color:var(--link-color);background-color:var(--link-color)}.ui-check-wrapper>input[type=checkbox]:checked+.ui-check-inner>svg,.ui-check-wrapper>input[type=radio]:checked+.ui-check-inner>svg{-webkit-transform:scale(1);transform:scale(1);opacity:1}.ui-check-wrapper>input[type=checkbox]:disabled:checked+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled:checked+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-border-color)}.ui-check-wrapper>input[type=checkbox]:disabled+.ui-check-inner,.ui-check-wrapper>input[type=radio]:disabled+.ui-check-inner{border-color:var(--disabled-border-color);background-color:var(--disabled-bg-color);cursor:default}.ui-check-wrapper>input[type=checkbox]:disabled~span,.ui-check-wrapper>input[type=radio]:disabled~span{color:var(--disabled-border-color);cursor:default}.ui-check-wrapper .ui-check-inner{flex:0 0 auto}.ui-check-wrapper .ui-check-inner+*{flex:1 1 auto;font-weight:400;font-size:var(--font-size);padding-left:8px;padding-right:6px;align-self:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;color:var(--color)}.ui-tooltip-color{background-color:#fff;color:#323130;border-color:#cccc}.ui-tooltip-color:focus,.ui-tooltip-color:focus-visible{outline:none}.ui-tooltip-wrapper{position:absolute;word-wrap:break-word;height:auto;text-align:left;z-index:250;min-width:45px;max-width:480px;min-height:32px;border-radius:2px;box-shadow:0 3.2px 7.2px #00000021,0 .6px 1.8px #0000001c;transition:visibility 0s linear .12s,opacity .12s ease}.ui-tooltip-wrapper>.ui-tooltip-pointer{box-sizing:border-box;box-shadow:0 5px 15px 2px #0000004d;border:1px solid #fff;z-index:-1;width:16px;height:16px;positionLine truncated
|
||||||
Vendored
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
(function(w,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(w=typeof globalThis<"u"?globalThis:w||self,L(w["lib-ui"]={}))})(this,function(w){var I,D,R,O,Y,be,He,oe,ae,ce,Ue,ve,wt,xe,kt,Oe,_t,$e,zt,Pe,Rt,Ve,Ht,F,H,we,V,v,ke,Ce,M,K,de,ue,ie,Z,Le,he,Ee,A,At,Te,Ct,ot,ti,at,ii,ct,si,dt,ni,fe,Ge,ut,li,ht,ri,Me,Ot,$,X,se,Ne,pe,Ze,We,$t,De,Pt,Fe,Vt,ye,Je,ft,oi,je,Mt,Be,Wt,pt,ai,yt,ci,gt,di,mt,ui,bt,hi,vt,fi,xt,pi,Xe,Dt,Ye,Ft,Se,Lt,j,U,J,B,Q;"use strict";var zi=Object.defineProperty;var Ri=Object.getPrototypeOf;var Hi=Reflect.get;var Oi=(w,L,N)=>L in w?zi(w,L,{enumerable:!0,configurable:!0,writable:!0,value:N}):w[L]=N;var C=(w,L,N)=>(Oi(w,typeof L!="symbol"?L+"":L,N),N),qt=(w,L,N)=>{if(!L.has(w))throw TypeError("Cannot "+N)};var a=(w,L,N)=>(qt(w,L,"read from private field"),N?N.call(w):L.get(w)),g=(w,L,N)=>{if(L.has(w))throw TypeError("Cannot add the same private member more than once");L instanceof WeakSet?L.add(w):L.set(w,N)},x=(w,L,N,p)=>(qt(w,L,"write to private field"),p?p.call(w,N):L.set(w,N),N);var y=(w,L,N)=>(qt(w,L,"access private method"),N),ei=(w,L,N)=>Hi(Ri(w),N,L);const L="",N="";function p(d,e,...t){const s=document.createElement(d);return typeof e=="function"?e(s):e!=null&&(s.className=e),t.length>0&&s.append(...t),s}const jt="http://www.w3.org/2000/svg";function Et(d,e){const t=typeof consts<"u"?consts:{},s=t.path||"",n=t.resver==null?"":`?${t.resver}`,l=document.createElementNS(jt,"use");return l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`${s}fonts/${d}.svg${n}#${e}`),l}function Ie(d,e,t){return d instanceof SVGElement&&d.replaceChildren(Et(e,t)),d}function P(d,e,t){const s=document.createElementNS(jt,"svg");if(s.appendChild(Et(d,e)),t!=null)for(let n of Object.entries(t))s.style.setProperty(n[0],n[1]);return s}function yi(d){const e=d.querySelectorAll("svg[data-id]");for(let t of e){const s=t.dataset.type,n=t.dataset.id;t.replaceChildren(Et(s,n)),t.removeAttribute("data-type"),t.removeAttribute("data-id")}return d}const $i="";function Qe(d,e="fa-regular",t,s=-1,n="check"){d.appendChild(p("layer",l=>{l.className="ui-check-inner",l.addEventListener("keypress",i=>{if(i.key===" "||i.key==="Enter"){const r=d.querySelector("input");r!=null&&(r.checked=!r.checked,r.dispatchEvent(new Event("change")))}}),s>=0&&(l.tabIndex=s)},P(e,n))),t instanceof Element?d.appendChild(t):(t==null?void 0:t.length)>0&&d.appendChild(p("span",l=>l.innerText=t))}function gi(d={}){const e=p("label","ui-check-wrapper ui-radio-wrapper",p("input",t=>{if(t.setAttribute("type","radio"),t.name=d.name,d.checked===!0&&(t.checked=!0),d.enabled===!1&&(t.disabled=!0),d.customerAttributes!=null)for(let s of Object.entries(d.customerAttributes))t.setAttribute(s[0],s[1]);typeof d.onchange=="function"&&t.addEventListener("change",d.onchange)}));return d.className&&e.classList.add(d.className),Qe(e,d.type,d.label,d.tabIndex,"circle"),e}function ne(d={}){const e=p("label","ui-check-wrapper",p("input",t=>{if(t.setAttribute("type","checkbox"),d.checked===!0&&(t.checked=!0),d.enabled===!1&&(t.disabled=!0),d.customerAttributes!=null)for(let s of Object.entries(d.customerAttributes))t.setAttribute(s[0],s[1]);typeof d.onchange=="function"&&t.addEventListener("change",d.onchange)}));return d.className&&e.classList.add(d.className),d.enabled===!1&&e.classList.add("disabled"),d.checkedNode!=null&&d.uncheckedNode!=null?(e.classList.add("ui-check-image-wrapper"),d.imageHeight,d.checkedNode.classList.add("checked"),e.appendChild(d.checkedNode),d.uncheckedNode.classList.add("unchecked"),e.appendChild(d.uncheckedNode)):Qe(e,d.type,d.label,d.tabIndex),e}function mi(d=document.body,e){if(e){const s=d.querySelectorAll('input[type="checkbox"]');for(let n of s){if(n.parentElement.classList.contains("ui-check-wrapper"))continue;const l=n.id;let i,r;if(l!=null&&(i=d.querySelector(`label[for="${l}"]`)),i==null){const o=n.nextElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:o.tagName==="SPAN"&&o.dataset.lgid!=null&&(r=o.innerText,o.style.display="none"))}if(i==null){const o=n.previousElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:r==null&&o.tagName==="SPAN"&&o.dataset.lgid!=null&&(r=o.innerText,o.style.display="none"))}i==null?(i=p("label"),n.parentElement.insertBefore(i,n)):r=i.innerText,n.disabled?i.className="ui-check-wrapper disabled":i.className="ui-check-wrapper",i.replaceChildren(),Qe(i,"fa-regular",r,n.tabIndex),i.insertBefore(n,i.firstChild)}}const t=d.querySelectorAll("label[data-checkbox]");for(let s of t){s.classList.contains("ui-check-wrapper")||s.classList.add("ui-check-wrapper"),s.hasChildNodes()?s.classList.contains("ui-check-image-wrapper")||s.classList.add("ui-check-image-wrapper"):(Qe(s,s.dataset.type,s.dataset.label,s.dataset.tabIndex),s.removeAttribute("data-type"),s.removeAttribute("data-label"));const n=p("input"),l=s.dataset.id;(l==null?void 0:l.length)>0&&(n.id=l),s.dataset.checked!=null&&(n.checked=!0),n.setAttribute("type","checkbox"),s.insertBefore(nLine truncated
|
(function(w,L){typeof exports=="object"&&typeof module<"u"?L(exports):typeof define=="function"&&define.amd?define(["exports"],L):(w=typeof globalThis<"u"?globalThis:w||self,L(w["lib-ui"]={}))})(this,function(w){var I,D,R,O,Y,be,He,oe,ae,ce,Ue,ve,wt,xe,kt,Oe,_t,Pe,zt,$e,Rt,Ve,Ht,F,H,we,V,v,ke,Ce,M,K,de,ue,ie,Z,Le,he,Ee,q,At,Te,Ct,ot,ti,at,ii,ct,si,dt,ni,fe,Ge,ut,li,ht,ri,Me,Ot,P,X,se,Ne,pe,Ze,We,Pt,De,$t,Fe,Vt,ye,Je,ft,oi,je,Mt,Be,Wt,pt,ai,yt,ci,gt,di,mt,ui,bt,hi,vt,fi,xt,pi,Xe,Dt,Ye,Ft,Se,Lt,j,U,J,B,Q;"use strict";var zi=Object.defineProperty;var Ri=Object.getPrototypeOf;var Hi=Reflect.get;var Oi=(w,L,N)=>L in w?zi(w,L,{enumerable:!0,configurable:!0,writable:!0,value:N}):w[L]=N;var C=(w,L,N)=>(Oi(w,typeof L!="symbol"?L+"":L,N),N),qt=(w,L,N)=>{if(!L.has(w))throw TypeError("Cannot "+N)};var a=(w,L,N)=>(qt(w,L,"read from private field"),N?N.call(w):L.get(w)),b=(w,L,N)=>{if(L.has(w))throw TypeError("Cannot add the same private member more than once");L instanceof WeakSet?L.add(w):L.set(w,N)},x=(w,L,N,p)=>(qt(w,L,"write to private field"),p?p.call(w,N):L.set(w,N),N);var y=(w,L,N)=>(qt(w,L,"access private method"),N),ei=(w,L,N)=>Hi(Ri(w),N,L);const L="",N="";function p(d,e,...t){const s=document.createElement(d);return typeof e=="function"?e(s):e!=null&&(s.className=e),t.length>0&&s.append(...t),s}const jt="http://www.w3.org/2000/svg";function Et(d,e){const t=typeof consts<"u"?consts:{},s=t.path||"",n=t.resver==null?"":`?${t.resver}`,r=document.createElementNS(jt,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",`${s}fonts/${d}.svg${n}#${e}`),r}function Ie(d,e,t){return d instanceof SVGElement&&d.replaceChildren(Et(e,t)),d}function $(d,e,t){const s=document.createElementNS(jt,"svg");if(s.appendChild(Et(d,e)),t!=null)for(let n of Object.entries(t))s.style.setProperty(n[0],n[1]);return s}function yi(d){const e=d.querySelectorAll("svg[data-id]");for(let t of e){const s=t.dataset.type,n=t.dataset.id;t.replaceChildren(Et(s,n)),t.removeAttribute("data-type"),t.removeAttribute("data-id")}return d}const Pi="";function Qe(d,e="fa-regular",t,s=-1,n="check"){d.appendChild(p("layer",r=>{r.className="ui-check-inner",r.addEventListener("keypress",i=>{if(i.key===" "||i.key==="Enter"){const l=d.querySelector("input");l!=null&&(l.checked=!l.checked,l.dispatchEvent(new Event("change")))}}),s>=0&&(r.tabIndex=s)},$(e,n))),t instanceof Element?d.appendChild(t):(t==null?void 0:t.length)>0&&d.appendChild(p("span",r=>r.innerText=t))}function gi(d={}){const e=p("label","ui-check-wrapper ui-radio-wrapper",p("input",t=>{if(t.setAttribute("type","radio"),t.name=d.name,d.checked===!0&&(t.checked=!0),d.enabled===!1&&(t.disabled=!0),d.customerAttributes!=null)for(let s of Object.entries(d.customerAttributes))t.setAttribute(s[0],s[1]);typeof d.onchange=="function"&&t.addEventListener("change",d.onchange)}));return d.className&&e.classList.add(d.className),Qe(e,d.type,d.label,d.tabIndex,"circle"),e}function ne(d={}){const e=p("label","ui-check-wrapper",p("input",t=>{if(t.setAttribute("type","checkbox"),d.checked===!0&&(t.checked=!0),d.enabled===!1&&(t.disabled=!0),d.customerAttributes!=null)for(let s of Object.entries(d.customerAttributes))t.setAttribute(s[0],s[1]);typeof d.onchange=="function"&&t.addEventListener("change",d.onchange)}));return d.className&&e.classList.add(d.className),d.enabled===!1&&e.classList.add("disabled"),d.checkedNode!=null&&d.uncheckedNode!=null?(e.classList.add("ui-check-image-wrapper"),d.imageHeight,d.checkedNode.classList.add("checked"),e.appendChild(d.checkedNode),d.uncheckedNode.classList.add("unchecked"),e.appendChild(d.uncheckedNode)):Qe(e,d.type,d.label,d.tabIndex),e}function mi(d=document.body,e){if(e){const s=d.querySelectorAll('input[type="checkbox"]');for(let n of s){if(n.parentElement.classList.contains("ui-check-wrapper"))continue;const r=n.id;let i,l;if(r!=null&&(i=d.querySelector(`label[for="${r}"]`)),i==null){const o=n.nextElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:o.tagName==="SPAN"&&o.dataset.lgid!=null&&(l=o.innerText,o.style.display="none"))}if(i==null){const o=n.previousElementSibling;o!=null&&(o.tagName==="LABEL"?i=o:l==null&&o.tagName==="SPAN"&&o.dataset.lgid!=null&&(l=o.innerText,o.style.display="none"))}i==null?(i=p("label"),n.parentElement.insertBefore(i,n)):l=i.innerText,n.disabled?i.className="ui-check-wrapper disabled":i.className="ui-check-wrapper",i.replaceChildren(),Qe(i,"fa-regular",l,n.tabIndex),i.insertBefore(n,i.firstChild)}}const t=d.querySelectorAll("label[data-checkbox]");for(let s of t){s.classList.contains("ui-check-wrapper")||s.classList.add("ui-check-wrapper"),s.hasChildNodes()?s.classList.contains("ui-check-image-wrapper")||s.classList.add("ui-check-image-wrapper"):(Qe(s,s.dataset.type,s.dataset.label,s.dataset.tabIndex),s.removeAttribute("data-type"),s.removeAttribute("data-label"));const n=p("input"),r=s.dataset.id;(r==null?void 0:r.length)>0&&(n.id=r),s.dataset.checked!=null&&(n.checked=!0),n.setAttribute("type","checkbox"),s.insertBefore(nLine truncated
|
||||||
`).length;e.style.height=`${i*l.lineHeight+12}px`}}}const Ei=Symbol.for("ui-dropdown"),It=class extends te{static createEdit(e,t,s){const n=new tt({...t.dropOptions,parent:s});return n.onselected=e,n.create()}static setValue(e,t,s,n){if(e.tagName!=="DIV"){let i=y(this,Pe,Rt).call(this,s,n);i instanceof Promise?i.then(r=>y(this,Ve,Ht).call(this,r,e,t)):y(this,Ve,Ht).call(this,i,e,t);return}const l=y(this,$e,zt).call(this,e);if(l!=null){if(l.source==null||l.source.length===0){let i=y(this,Pe,Rt).call(this,s,n);if(i instanceof Promise){i.then(r=>{l.source=r,l.select(t,!0)});return}else i!=null&&(l.source=i)}l.select(t,!0)}}static getValue(e){return e.value}static setEnabled(e,t){super.setEnabled(e,t);const s=y(this,$e,zt).call(this,e);s!=null&&(s.disabled=t===!1)}};let me=It;$e=new WeakSet,zt=function(e){const t=le[Ei];if(t==null)return null;const s=e.dataset.dropId,n=t[s];return n??null},Pe=new WeakSet,Rt=function(e,t){let s=t.source;return typeof s=="function"&&(s=s(e)),s},Ve=new WeakSet,Ht=function(e,t,s){const n=e==null?void 0:e.find(l=>l.value===s);n!=null&&(s=n.text),ei(It,this,"setValue").call(this,t,s)},g(me,$e),g(me,Pe),g(me,Ve);class St extends te{static createEdit(e){return ne({onchange:typeof e=="function"?e:null})}static setValue(e,t){e.querySelector("input").checked=t}static getValue(e){return e.target.checked}static setEnabled(e,t){super.setEnabled(e,t),e.querySelector("input").disabled=t===!1}}class Ti extends te{static create(){return p("span","col-icon")}static setValue(e,t,s,n,l){let i=n.className;typeof i=="function"&&(i=i.call(n,s)),i==null?e.className="col-icon":e.className=`col-icon ${i}`;let r=n.iconType;if(typeof r=="function"&&(r=r.call(n,s)),r??(r="fa-regular"),e.dataset.type!==r||e.dataset.icon!==t){const o=P(r,t);e.replaceChildren(o),e.dataset.type=r,e.dataset.icon=t}}static setEnabled(e,t){super.setEnabled(e,t),t===!1?e.classList.add("disabled"):e.classList.remove("disabled")}}const it={Reorder:"reorder",Resize:"resize",Sort:"sort"},st=xi()?32:0,Si=200,Kt=4,Ut=4,_e=50,Gt=200;function nt(d){var t;return d==null?null:(d.touches&&((t=d.touches[0])==null?void 0:t.clientX))??d.clientX}function Ni(d){let e=0;for(;d!=null;)e+=d.offsetLeft,d=d.offsetParent;return e}function ze(d){return Array.prototype.indexOf.call(d.parentElement.children,d)}const Ii={0:te,1:Yt,2:me,3:St,4:Ti,5:Li},Ke=class{constructor(e){g(this,Te);g(this,ot);g(this,at);g(this,ct);g(this,dt);g(this,fe);g(this,ut);g(this,ht);g(this,Me);g(this,$);g(this,se);g(this,pe);g(this,We);g(this,De);g(this,Fe);g(this,ye);g(this,ft);g(this,je);g(this,Be);g(this,pt);g(this,yt);g(this,gt);g(this,mt);g(this,bt);g(this,vt);g(this,xt);g(this,Xe);g(this,Ye);g(this,Se);g(this,F,void 0);g(this,H,void 0);g(this,we,void 0);g(this,V,void 0);g(this,v,void 0);g(this,ke,void 0);g(this,Ce,-1);g(this,M,void 0);g(this,K,0);g(this,de,void 0);g(this,ue,void 0);g(this,ie,void 0);g(this,Z,-1);g(this,Le,void 0);g(this,he,void 0);g(this,Ee,{});g(this,A,{});g(this,At,[]);C(this,"columns",[]);C(this,"langs",{all:W("allItem","( All )"),ok:W("ok","OK"),reset:W("reset","Reset")});C(this,"virtualCount",100);C(this,"rowHeight",36);C(this,"lineHeight",24);C(this,"extraRows",0);C(this,"filterRowHeight",30);C(this,"height");C(this,"readonly");C(this,"multiSelect",!1);C(this,"fullrowClick",!0);C(this,"allowHtml",!1);C(this,"holderDisabled",!1);C(this,"headerVisible",!0);C(this,"window",le);C(this,"sortIndex",-1);C(this,"sortDirection",1);C(this,"willSelect");C(this,"selectedRowChanged");C(this,"cellDblClicked");C(this,"cellClicked");C(this,"rowDblClicked");C(this,"columnChanged");x(this,we,e)}get element(){return a(this,V)}get source(){var e;return(e=a(this,F))==null?void 0:e.map(t=>t.values)}set source(e){if(a(this,V)==null)throw new Error("grid has not been initialized.");if(!Array.isArray(e))throw new Error("source is not an Array.");e=e.map(t=>({values:t})),x(this,F,e),y(this,Te,Ct).call(this,e)}get virtual(){var e;return((e=a(this,H))==null?void 0:e.length)>this.virtualCount}get sortKey(){var e;return this.columns==null?null:(e=this.columns[this.sortIndex])==null?void 0:e.key}get selectedIndexes(){return a(this,M)}set selectedIndexes(e){const t=a(this,K);a(this,M).splice(0,a(this,M).length,...e),this.readonly!==!0?this.refresh():[...a(this,v).bodyContent.children].forEach((s,n)=>{e.indexOf(t+n)>=0?s.classList.add("selected"):s.classList.contains("selected")&&s.classList.remove("selected")}),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged()}get selectedIndex(){return(a(this,M)&&a(this,M)[0])??-1}get loading(){var e,t;return((t=(e=a(this,v).loading)==null?void 0:e.style)==null?void 0:t.visibility)==="visible"}set loading(e){a(this,v).loading!=null&&(e===!1?(a(this,v).loading.style.visibility="hidden",a(this,v).loading.style.opacity=0):(a(this,v).loading.style.visibility="visible",a(this,v).loading.style.opacity=1))}get scrollTop(){var e;return(e=a(this,v).body)==null?void 0:e.scrollTop}set scrollTop(e){a(this,v).body!=null&&(a(this,v).body.sc
Line truncated
|
`).length;e.style.height=`${i*r.lineHeight+12}px`}}}const Ei=Symbol.for("ui-dropdown"),It=class extends te{static createEdit(e,t,s){const n=new tt({...t.dropOptions,parent:s});return n.onselected=e,n.create()}static setValue(e,t,s,n){if(e.tagName!=="DIV"){let i=y(this,$e,Rt).call(this,s,n);i instanceof Promise?i.then(l=>y(this,Ve,Ht).call(this,l,e,t)):y(this,Ve,Ht).call(this,i,e,t);return}const r=y(this,Pe,zt).call(this,e);if(r!=null){if(r.source==null||r.source.length===0){let i=y(this,$e,Rt).call(this,s,n);if(i instanceof Promise){i.then(l=>{r.source=l,r.select(t,!0)});return}else i!=null&&(r.source=i)}r.select(t,!0)}}static getValue(e){return e.value}static setEnabled(e,t){super.setEnabled(e,t);const s=y(this,Pe,zt).call(this,e);s!=null&&(s.disabled=t===!1)}};let me=It;Pe=new WeakSet,zt=function(e){const t=le[Ei];if(t==null)return null;const s=e.dataset.dropId,n=t[s];return n??null},$e=new WeakSet,Rt=function(e,t){let s=t.source;return typeof s=="function"&&(s=s(e)),s},Ve=new WeakSet,Ht=function(e,t,s){const n=e==null?void 0:e.find(r=>r.value===s);n!=null&&(s=n.text),ei(It,this,"setValue").call(this,t,s)},b(me,Pe),b(me,$e),b(me,Ve);class St extends te{static createEdit(e){return ne({onchange:typeof e=="function"?e:null})}static setValue(e,t){e.querySelector("input").checked=t}static getValue(e){return e.target.checked}static setEnabled(e,t){super.setEnabled(e,t),e.querySelector("input").disabled=t===!1}}class Ti extends te{static create(){return p("span","col-icon")}static setValue(e,t,s,n,r){let i=n.className;typeof i=="function"&&(i=i.call(n,s)),i==null?e.className="col-icon":e.className=`col-icon ${i}`;let l=n.iconType;if(typeof l=="function"&&(l=l.call(n,s)),l??(l="fa-regular"),e.dataset.type!==l||e.dataset.icon!==t){const o=$(l,t);e.replaceChildren(o),e.dataset.type=l,e.dataset.icon=t}}static setEnabled(e,t){super.setEnabled(e,t),t===!1?e.classList.add("disabled"):e.classList.remove("disabled")}}const it={Reorder:"reorder",Resize:"resize",Sort:"sort"},st=xi()?32:0,Si=200,Kt=4,Ut=4,_e=50,Gt=200;function nt(d){var t;return d==null?null:(d.touches&&((t=d.touches[0])==null?void 0:t.clientX))??d.clientX}function Ni(d){let e=0;for(;d!=null;)e+=d.offsetLeft,d=d.offsetParent;return e}function ze(d){return Array.prototype.indexOf.call(d.parentElement.children,d)}const Ii={0:te,1:Yt,2:me,3:St,4:Ti,5:Li},Ke=class{constructor(e){b(this,Te);b(this,ot);b(this,at);b(this,ct);b(this,dt);b(this,fe);b(this,ut);b(this,ht);b(this,Me);b(this,P);b(this,se);b(this,pe);b(this,We);b(this,De);b(this,Fe);b(this,ye);b(this,ft);b(this,je);b(this,Be);b(this,pt);b(this,yt);b(this,gt);b(this,mt);b(this,bt);b(this,vt);b(this,xt);b(this,Xe);b(this,Ye);b(this,Se);b(this,F,void 0);b(this,H,void 0);b(this,we,void 0);b(this,V,void 0);b(this,v,void 0);b(this,ke,void 0);b(this,Ce,-1);b(this,M,void 0);b(this,K,0);b(this,de,void 0);b(this,ue,void 0);b(this,ie,void 0);b(this,Z,-1);b(this,Le,void 0);b(this,he,void 0);b(this,Ee,{});b(this,q,{});b(this,At,[]);C(this,"columns",[]);C(this,"langs",{all:W("allItem","( All )"),ok:W("ok","OK"),reset:W("reset","Reset")});C(this,"virtualCount",100);C(this,"rowHeight",36);C(this,"lineHeight",24);C(this,"extraRows",0);C(this,"filterRowHeight",30);C(this,"height");C(this,"readonly");C(this,"multiSelect",!1);C(this,"fullrowClick",!0);C(this,"allowHtml",!1);C(this,"holderDisabled",!1);C(this,"headerVisible",!0);C(this,"window",le);C(this,"sortIndex",-1);C(this,"sortDirection",1);C(this,"willSelect");C(this,"selectedRowChanged");C(this,"cellDblClicked");C(this,"cellClicked");C(this,"rowDblClicked");C(this,"columnChanged");x(this,we,e)}get element(){return a(this,V)}get source(){var e;return(e=a(this,F))==null?void 0:e.map(t=>t.values)}set source(e){if(a(this,V)==null)throw new Error("grid has not been initialized.");if(!Array.isArray(e))throw new Error("source is not an Array.");e=e.map(t=>({values:t})),x(this,F,e),y(this,Te,Ct).call(this,e)}get virtual(){var e;return((e=a(this,H))==null?void 0:e.length)>this.virtualCount}get sortKey(){var e;return this.columns==null?null:(e=this.columns[this.sortIndex])==null?void 0:e.key}get selectedIndexes(){return a(this,M)}set selectedIndexes(e){const t=a(this,K);a(this,M).splice(0,a(this,M).length,...e),this.readonly!==!0?this.refresh():[...a(this,v).bodyContent.children].forEach((s,n)=>{e.indexOf(t+n)>=0?s.classList.add("selected"):s.classList.contains("selected")&&s.classList.remove("selected")}),typeof this.selectedRowChanged=="function"&&this.selectedRowChanged()}get selectedIndex(){return(a(this,M)&&a(this,M)[0])??-1}get loading(){var e,t;return((t=(e=a(this,v).loading)==null?void 0:e.style)==null?void 0:t.visibility)==="visible"}set loading(e){a(this,v).loading!=null&&(e===!1?(a(this,v).loading.style.visibility="hidden",a(this,v).loading.style.opacity=0):(a(this,v).loading.style.visibility="visible",a(this,v).loading.style.opacity=1))}get scrollTop(){var e;return(e=a(this,v).body)==null?void 0:e.scrollTop}set scrollTop(e){a(this,v).body!=null&&(a(this,v).body.sc
Line truncated
|
||||||
//# sourceMappingURL=ui.min.js.map
|
//# sourceMappingURL=ui.min.js.map
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"ui.min.js","sources":["../lib/functions.js","../lib/ui/icon.js","../lib/ui/checkbox.js","../lib/ui/tooltip.js","../lib/utility/strings.js","../lib/utility/lgres.js","../lib/utility.js","../lib/ui/dropdown.js","../lib/ui/grid/column.js","../lib/ui/grid/grid.js","../lib/ui/popup.js"],"sourcesContent":["export function createElement(tagName, init, ...children) {\r\n const element = document.createElement(tagName);\r\n if (typeof init === 'function') {\r\n init(element);\r\n } else if (init != null) {\r\n element.className = init;\r\n }\r\n if (children.length > 0) {\r\n element.append(...children);\r\n }\r\n return element;\r\n}\r\n","const svgns = 'http://www.w3.org/2000/svg';\r\n\r\nfunction createUse(type, id) {\r\n const c = typeof consts !== 'undefined' ? consts : {};\r\n const path = c.path || '';\r\n const ver = c.resver == null ? '' : `?${c.resver}`;\r\n const use = document.createElementNS(svgns, 'use');\r\n use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', `${path}fonts/${type}.svg${ver}#${id}`);\r\n return use;\r\n}\r\n\r\nfunction changeIcon(svg, type, id) {\r\n if (svg instanceof SVGElement) {\r\n svg.replaceChildren(createUse(type, id));\r\n }\r\n return svg;\r\n}\r\n\r\nfunction createIcon(type, id, style) {\r\n const svg = document.createElementNS(svgns, 'svg');\r\n svg.appendChild(createUse(type, id));\r\n if (style != null) {\r\n for (let css of Object.entries(style)) {\r\n svg.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n return svg;\r\n}\r\n\r\nfunction resolveIcon(container) {\r\n const svgs = container.querySelectorAll('svg[data-id]');\r\n for (let icon of svgs) {\r\n const type = icon.dataset.type;\r\n const id = icon.dataset.id;\r\n icon.replaceChildren(createUse(type, id));\r\n icon.removeAttribute('data-type');\r\n icon.removeAttribute('data-id');\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n createIcon,\r\n changeIcon,\r\n resolveIcon\r\n}","import './css/checkbox.scss';\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon } from \"./icon\";\r\n\r\nfunction fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, charactor = 'check') {\r\n container.appendChild(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-check-inner';\r\n layer.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n const input = container.querySelector('input');\r\n if (input != null) {\r\n input.checked = !input.checked;\r\n input.dispatchEvent(new Event('change'));\r\n }\r\n }\r\n });\r\n if (tabindex >= 0) {\r\n layer.tabIndex = tabindex;\r\n }\r\n }, createIcon(type, charactor))\r\n );\r\n if (label instanceof Element) {\r\n container.appendChild(label);\r\n } else if (label?.length > 0) {\r\n container.appendChild(\r\n createElement('span', span => span.innerText = label)\r\n );\r\n }\r\n}\r\n\r\nfunction createRadiobox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper ui-radio-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'radio');\r\n input.name = opts.name;\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex, 'circle');\r\n return container;\r\n}\r\n\r\nfunction createCheckbox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'checkbox');\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n Line truncated
|
{"version":3,"file":"ui.min.js","sources":["../lib/functions.js","../lib/ui/icon.js","../lib/ui/checkbox.js","../lib/ui/tooltip.js","../lib/utility/strings.js","../lib/utility/lgres.js","../lib/utility.js","../lib/ui/dropdown.js","../lib/ui/grid/column.js","../lib/ui/grid/grid.js","../lib/ui/popup.js"],"sourcesContent":["export function createElement(tagName, init, ...children) {\r\n const element = document.createElement(tagName);\r\n if (typeof init === 'function') {\r\n init(element);\r\n } else if (init != null) {\r\n element.className = init;\r\n }\r\n if (children.length > 0) {\r\n element.append(...children);\r\n }\r\n return element;\r\n}\r\n","const svgns = 'http://www.w3.org/2000/svg';\r\n\r\nfunction createUse(type, id) {\r\n const c = typeof consts !== 'undefined' ? consts : {};\r\n const path = c.path || '';\r\n const ver = c.resver == null ? '' : `?${c.resver}`;\r\n const use = document.createElementNS(svgns, 'use');\r\n use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', `${path}fonts/${type}.svg${ver}#${id}`);\r\n return use;\r\n}\r\n\r\nfunction changeIcon(svg, type, id) {\r\n if (svg instanceof SVGElement) {\r\n svg.replaceChildren(createUse(type, id));\r\n }\r\n return svg;\r\n}\r\n\r\nfunction createIcon(type, id, style) {\r\n const svg = document.createElementNS(svgns, 'svg');\r\n svg.appendChild(createUse(type, id));\r\n if (style != null) {\r\n for (let css of Object.entries(style)) {\r\n svg.style.setProperty(css[0], css[1]);\r\n }\r\n }\r\n return svg;\r\n}\r\n\r\nfunction resolveIcon(container) {\r\n const svgs = container.querySelectorAll('svg[data-id]');\r\n for (let icon of svgs) {\r\n const type = icon.dataset.type;\r\n const id = icon.dataset.id;\r\n icon.replaceChildren(createUse(type, id));\r\n icon.removeAttribute('data-type');\r\n icon.removeAttribute('data-id');\r\n }\r\n return container;\r\n}\r\n\r\nexport {\r\n createIcon,\r\n changeIcon,\r\n resolveIcon\r\n}","import './css/checkbox.scss';\r\nimport { createElement } from \"../functions\";\r\nimport { createIcon } from \"./icon\";\r\n\r\nfunction fillCheckbox(container, type = 'fa-regular', label, tabindex = -1, charactor = 'check') {\r\n container.appendChild(\r\n createElement('layer', layer => {\r\n layer.className = 'ui-check-inner';\r\n layer.addEventListener('keypress', e => {\r\n if (e.key === ' ' || e.key === 'Enter') {\r\n const input = container.querySelector('input');\r\n if (input != null) {\r\n input.checked = !input.checked;\r\n input.dispatchEvent(new Event('change'));\r\n }\r\n }\r\n });\r\n if (tabindex >= 0) {\r\n layer.tabIndex = tabindex;\r\n }\r\n }, createIcon(type, charactor))\r\n );\r\n if (label instanceof Element) {\r\n container.appendChild(label);\r\n } else if (label?.length > 0) {\r\n container.appendChild(\r\n createElement('span', span => span.innerText = label)\r\n );\r\n }\r\n}\r\n\r\nfunction createRadiobox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper ui-radio-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'radio');\r\n input.name = opts.name;\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n }\r\n }\r\n if (typeof opts.onchange === 'function') {\r\n input.addEventListener('change', opts.onchange);\r\n }\r\n }));\r\n if (opts.className) {\r\n container.classList.add(opts.className);\r\n }\r\n fillCheckbox(container, opts.type, opts.label, opts.tabIndex, 'circle');\r\n return container;\r\n}\r\n\r\nfunction createCheckbox(opts = {}) {\r\n const container = createElement('label', 'ui-check-wrapper',\r\n createElement('input', input => {\r\n input.setAttribute('type', 'checkbox');\r\n if (opts.checked === true) {\r\n input.checked = true;\r\n }\r\n if (opts.enabled === false) {\r\n input.disabled = true;\r\n }\r\n if (opts.customerAttributes != null) {\r\n for (let entry of Object.entries(opts.customerAttributes)) {\r\n input.setAttribute(entry[0], entry[1]);\r\n Line truncated
|
||||||
Reference in new issue
Block a user