diff --git a/public-typescript/lotOccupancySearch.js b/public-typescript/lotOccupancySearch.js index e7428fc7..ca9d2189 100644 --- a/public-typescript/lotOccupancySearch.js +++ b/public-typescript/lotOccupancySearch.js @@ -116,48 +116,19 @@ Object.defineProperty(exports, "__esModule", { value: true }); "" + ""); } - searchResultsContainerElement.innerHTML = - '' + - "" + - '' + - ("") + - ("") + - ("") + - "" + - ("") + - '' + - "" + - "
" + los.escapedAliases.Occupancy + " Type" + los.escapedAliases.Lot + "" + los.escapedAliases.OccupancyStartDate + "End Date" + los.escapedAliases.Occupants + "Print
" + - '
' + - ('
' + - '
' + - "Displaying " + - (responseJSON.offset + 1).toString() + - " to " + - Math.min(responseJSON.count, limit + responseJSON.offset) + - " of " + - responseJSON.count + - "
" + - "
") + - ('
' + - (responseJSON.offset > 0 - ? '
' + - '" + - "
" - : "") + - (limit + responseJSON.offset < responseJSON.count - ? '
' + - '" + - "
" - : "") + - "
") + - "
"; + searchResultsContainerElement.innerHTML = `
+ + + + + + + + + +
${los.escapedAliases.Occupancy} Type${los.escapedAliases.Lot}${los.escapedAliases.OccupancyStartDate}End Date${los.escapedAliases.Occupants}Print
`; searchResultsContainerElement.querySelector("table").append(resultsTbodyElement); + searchResultsContainerElement.insertAdjacentHTML("beforeend", los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count)); if (responseJSON.offset > 0) { searchResultsContainerElement .querySelector("button[data-page='previous']") diff --git a/public-typescript/lotOccupancySearch.ts b/public-typescript/lotOccupancySearch.ts index d1c29ba2..04bad799 100644 --- a/public-typescript/lotOccupancySearch.ts +++ b/public-typescript/lotOccupancySearch.ts @@ -149,50 +149,25 @@ declare const cityssm: cityssmGlobal; ); } - searchResultsContainerElement.innerHTML = - '
' + - "" + - '' + - ("") + - ("") + - ("") + - "" + - ("") + - '' + - "" + - "
" + los.escapedAliases.Occupancy + " Type" + los.escapedAliases.Lot + "" + los.escapedAliases.OccupancyStartDate + "End Date" + los.escapedAliases.Occupants + "Print
" + - '
' + - ('
' + - '
' + - "Displaying " + - (responseJSON.offset + 1).toString() + - " to " + - Math.min(responseJSON.count, limit + responseJSON.offset) + - " of " + - responseJSON.count + - "
" + - "
") + - ('
' + - (responseJSON.offset > 0 - ? '
' + - '" + - "
" - : "") + - (limit + responseJSON.offset < responseJSON.count - ? '
' + - '" + - "
" - : "") + - "
") + - "
"; + searchResultsContainerElement.innerHTML = `
+ + + + + + + + + +
${los.escapedAliases.Occupancy} Type${los.escapedAliases.Lot}${los.escapedAliases.OccupancyStartDate}End Date${los.escapedAliases.Occupants}Print
`; searchResultsContainerElement.querySelector("table")!.append(resultsTbodyElement); + searchResultsContainerElement.insertAdjacentHTML( + "beforeend", + los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count) + ); + if (responseJSON.offset > 0) { searchResultsContainerElement .querySelector("button[data-page='previous']")! diff --git a/public-typescript/lotSearch.js b/public-typescript/lotSearch.js index 295e9659..e34f0e25 100644 --- a/public-typescript/lotSearch.js +++ b/public-typescript/lotSearch.js @@ -52,44 +52,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); "") + ""); } - searchResultsContainerElement.innerHTML = - '
' + - "" + - ("") + - ("") + - ("") + - "" + - "" + - "
" + los.escapedAliases.Lot + "" + los.escapedAliases.Map + "" + los.escapedAliases.Lot + " TypeStatus
" + - '
' + - ('
' + - '
' + - "Displaying " + - (responseJSON.offset + 1).toString() + - " to " + - Math.min(responseJSON.count, limit + responseJSON.offset) + - " of " + - responseJSON.count + - "
" + - "
") + - ('
' + - (responseJSON.offset > 0 - ? '
' + - '" + - "
" - : "") + - (limit + responseJSON.offset < responseJSON.count - ? '
' + - '" + - "
" - : "") + - "
") + - "
"; + searchResultsContainerElement.innerHTML = `
+ + + + + + +
${los.escapedAliases.Lot}${los.escapedAliases.Map}${los.escapedAliases.Lot} TypeStatus
`; + searchResultsContainerElement.insertAdjacentHTML("beforeend", los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count)); searchResultsContainerElement.querySelector("table").append(resultsTbodyElement); if (responseJSON.offset > 0) { searchResultsContainerElement diff --git a/public-typescript/lotSearch.ts b/public-typescript/lotSearch.ts index aca986f3..ac311959 100644 --- a/public-typescript/lotSearch.ts +++ b/public-typescript/lotSearch.ts @@ -80,44 +80,19 @@ declare const cityssm: cityssmGlobal; ); } - searchResultsContainerElement.innerHTML = - '
' + - "" + - ("") + - ("") + - ("") + - "" + - "" + - "
" + los.escapedAliases.Lot + "" + los.escapedAliases.Map + "" + los.escapedAliases.Lot + " TypeStatus
" + - '
' + - ('
' + - '
' + - "Displaying " + - (responseJSON.offset + 1).toString() + - " to " + - Math.min(responseJSON.count, limit + responseJSON.offset) + - " of " + - responseJSON.count + - "
" + - "
") + - ('
' + - (responseJSON.offset > 0 - ? '
' + - '" + - "
" - : "") + - (limit + responseJSON.offset < responseJSON.count - ? '
' + - '" + - "
" - : "") + - "
") + - "
"; + searchResultsContainerElement.innerHTML = `
+ + + + + + +
${los.escapedAliases.Lot}${los.escapedAliases.Map}${los.escapedAliases.Lot} TypeStatus
`; + + searchResultsContainerElement.insertAdjacentHTML( + "beforeend", + los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count) + ); searchResultsContainerElement.querySelector("table")!.append(resultsTbodyElement); diff --git a/public-typescript/main.js b/public-typescript/main.js index 5b60e9e1..83611db5 100644 --- a/public-typescript/main.js +++ b/public-typescript/main.js @@ -312,6 +312,37 @@ Object.defineProperty(exports, "__esModule", { value: true }); ${cityssm.escapeHTML(captionText)}

`; } + function getSearchResultsPagerHTML(limit, offset, count) { + return ('
' + + ('
' + + '
' + + "Displaying " + + (offset + 1).toString() + + " to " + + Math.min(count, limit + offset) + + " of " + + count + + "
" + + "
") + + ('
' + + (offset > 0 + ? '
' + + '" + + "
" + : "") + + (limit + offset < count + ? '
' + + '" + + "
" + : "") + + "
") + + "
"); + } /* * Declare LOS */ @@ -328,7 +359,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); clearUnsavedChanges, hasUnsavedChanges, getMoveUpDownButtonFieldHTML, - getLoadingParagraphHTML + getLoadingParagraphHTML, + getSearchResultsPagerHTML }; exports.los = los; })(); diff --git a/public-typescript/main.ts b/public-typescript/main.ts index 0639af99..0f61627a 100644 --- a/public-typescript/main.ts +++ b/public-typescript/main.ts @@ -397,6 +397,40 @@ declare const bulmaJS: BulmaJS;

`; } + function getSearchResultsPagerHTML(limit: number, offset: number, count: number) { + return ( + '
' + + ('
' + + '
' + + "Displaying " + + (offset + 1).toString() + + " to " + + Math.min(count, limit + offset) + + " of " + + count + + "
" + + "
") + + ('
' + + (offset > 0 + ? '
' + + '" + + "
" + : "") + + (limit + offset < count + ? '
' + + '" + + "
" + : "") + + "
") + + "
" + ); + } + /* * Declare LOS */ @@ -418,7 +452,8 @@ declare const bulmaJS: BulmaJS; hasUnsavedChanges, getMoveUpDownButtonFieldHTML, - getLoadingParagraphHTML + getLoadingParagraphHTML, + getSearchResultsPagerHTML }; exports.los = los; diff --git a/public-typescript/workOrderSearch.js b/public-typescript/workOrderSearch.js index d55aaf41..9e439ff5 100644 --- a/public-typescript/workOrderSearch.js +++ b/public-typescript/workOrderSearch.js @@ -122,36 +122,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); '' + (workOrderPrints.length > 0 ? '' : "") + "" + - "
Progress
" + - '
' + - ('
' + - '
' + - "Displaying " + - (responseJSON.offset + 1).toString() + - " to " + - Math.min(responseJSON.count, limit + responseJSON.offset) + - " of " + - responseJSON.count + - "
" + - "
") + - ('
' + - (responseJSON.offset > 0 - ? '
' + - '" + - "
" - : "") + - (limit + responseJSON.offset < responseJSON.count - ? '
' + - '" + - "
" - : "") + - "
") + - "
"; + "
"; + searchResultsContainerElement.insertAdjacentHTML("beforeend", los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count)); searchResultsContainerElement.querySelector("table").append(resultsTbodyElement); if (responseJSON.offset > 0) { searchResultsContainerElement diff --git a/public-typescript/workOrderSearch.ts b/public-typescript/workOrderSearch.ts index fd38958f..4a86ff6e 100644 --- a/public-typescript/workOrderSearch.ts +++ b/public-typescript/workOrderSearch.ts @@ -155,36 +155,12 @@ declare const cityssm: cityssmGlobal; '' + (workOrderPrints.length > 0 ? '' : "") + "" + - "
Progress
" + - '
' + - ('
' + - '
' + - "Displaying " + - (responseJSON.offset + 1).toString() + - " to " + - Math.min(responseJSON.count, limit + responseJSON.offset) + - " of " + - responseJSON.count + - "
" + - "
") + - ('
' + - (responseJSON.offset > 0 - ? '
' + - '" + - "
" - : "") + - (limit + responseJSON.offset < responseJSON.count - ? '
' + - '" + - "
" - : "") + - "
") + - "
"; + "
"; + + searchResultsContainerElement.insertAdjacentHTML( + "beforeend", + los.getSearchResultsPagerHTML(limit, responseJSON.offset, responseJSON.count) + ); searchResultsContainerElement.querySelector("table")!.append(resultsTbodyElement); diff --git a/public/javascripts/lotOccupancySearch.min.js b/public/javascripts/lotOccupancySearch.min.js index 6fe34511..9f1458b1 100644 --- a/public/javascripts/lotOccupancySearch.min.js +++ b/public/javascripts/lotOccupancySearch.min.js @@ -1 +1 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const t=exports.los,e=document.querySelector("#form--searchFilters"),a=document.querySelector("#container--searchResults"),s=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),c=document.querySelector("#searchFilter--offset");function i(e){if(0===e.lotOccupancies.length)return void(a.innerHTML=`
\n

\n There are no ${t.escapedAliases.occupancy} records that meet the search criteria.\n

\n
`);const c=document.createElement("tbody"),i=cityssm.dateToString(new Date);for(const a of e.lotOccupancies){let e="";e=a.occupancyStartDateString<=i&&(""===a.occupancyEndDateString||a.occupancyEndDateString>=i)?'':a.occupancyStartDateString>i?'':'';let s="";for(const t of a.lotOccupancyOccupants)s+=' '+cityssm.escapeHTML(t.occupantName||"")+"
";c.insertAdjacentHTML("beforeend",'")}a.innerHTML='
'+e+''+cityssm.escapeHTML(a.occupancyType)+""+(a.lotName?''+cityssm.escapeHTML(a.lotName)+"":'(No '+t.escapedAliases.Lot+")")+'
'+cityssm.escapeHTML(a.mapName||"")+"
"+a.occupancyStartDateString+""+(a.occupancyEndDate?a.occupancyEndDateString:'(No End Date)')+""+s+""+(a.printEJS?'':"")+"
'+t.escapedAliases.Occupancy+" Type"+t.escapedAliases.Lot+""+t.escapedAliases.OccupancyStartDate+"End Date"+t.escapedAliases.Occupants+'Print
Displaying '+(e.offset+1).toString()+" to "+Math.min(e.count,s+e.offset)+" of "+e.count+'
'+(e.offset>0?'
':"")+(s+e.offset
':"")+"
",a.querySelector("table").append(c),e.offset>0&&a.querySelector("button[data-page='previous']").addEventListener("click",o),s+e.offset{t.preventDefault(),l()}),n()})(); \ No newline at end of file +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const t=exports.los,e=document.querySelector("#form--searchFilters"),a=document.querySelector("#container--searchResults"),s=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),c=document.querySelector("#searchFilter--offset");function n(e){if(0===e.lotOccupancies.length)return void(a.innerHTML=`
\n

\n There are no ${t.escapedAliases.occupancy} records that meet the search criteria.\n

\n
`);const c=document.createElement("tbody"),n=cityssm.dateToString(new Date);for(const a of e.lotOccupancies){let e="";e=a.occupancyStartDateString<=n&&(""===a.occupancyEndDateString||a.occupancyEndDateString>=n)?'':a.occupancyStartDateString>n?'':'';let s="";for(const t of a.lotOccupancyOccupants)s+=' '+cityssm.escapeHTML(t.occupantName||"")+"
";c.insertAdjacentHTML("beforeend",'
")}a.innerHTML=`
'+e+''+cityssm.escapeHTML(a.occupancyType)+""+(a.lotName?''+cityssm.escapeHTML(a.lotName)+"":'(No '+t.escapedAliases.Lot+")")+'
'+cityssm.escapeHTML(a.mapName||"")+"
"+a.occupancyStartDateString+""+(a.occupancyEndDate?a.occupancyEndDateString:'(No End Date)')+""+s+""+(a.printEJS?'':"")+"
\n \n \n \n \n \n \n \n \n \n
${t.escapedAliases.Occupancy} Type${t.escapedAliases.Lot}${t.escapedAliases.OccupancyStartDate}End Date${t.escapedAliases.Occupants}Print
`,a.querySelector("table").append(c),a.insertAdjacentHTML("beforeend",t.getSearchResultsPagerHTML(s,e.offset,e.count)),e.offset>0&&a.querySelector("button[data-page='previous']").addEventListener("click",o),s+e.offset{t.preventDefault(),i()}),r()})(); \ No newline at end of file diff --git a/public/javascripts/lotSearch.min.js b/public/javascripts/lotSearch.min.js index a7cc9352..ba8e1c66 100644 --- a/public/javascripts/lotSearch.min.js +++ b/public/javascripts/lotSearch.min.js @@ -1 +1 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=document.querySelector("#form--searchFilters"),s=document.querySelector("#container--searchResults"),a=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),i=document.querySelector("#searchFilter--offset");function o(t){if(0===t.lots.length)return void(s.innerHTML='

There are no '+e.escapedAliases.lots+" that meet the search criteria.

");const i=document.createElement("tbody");for(const s of t.lots)i.insertAdjacentHTML("beforeend",'
");s.innerHTML='
'+cityssm.escapeHTML(s.lotName||"")+''+(s.mapName?cityssm.escapeHTML(s.mapName):'(No Name)')+""+cityssm.escapeHTML(s.lotType||"")+""+(s.lotStatusId?cityssm.escapeHTML(s.lotStatus||""):'(No Status)')+"
"+(s.lotOccupancyCount>0?'Currently Occupied':"")+"
'+e.escapedAliases.Lot+""+e.escapedAliases.Map+""+e.escapedAliases.Lot+' TypeStatus
Displaying '+(t.offset+1).toString()+" to "+Math.min(t.count,a+t.offset)+" of "+t.count+'
'+(t.offset>0?'
':"")+(a+t.offset
':"")+"
",s.querySelector("table").append(i),t.offset>0&&s.querySelector("button[data-page='previous']").addEventListener("click",n),a+t.offset{e.preventDefault(),r()}),l()})(); \ No newline at end of file +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=document.querySelector("#form--searchFilters"),s=document.querySelector("#container--searchResults"),a=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),r=document.querySelector("#searchFilter--offset");function n(t){if(0===t.lots.length)return void(s.innerHTML='

There are no '+e.escapedAliases.lots+" that meet the search criteria.

");const r=document.createElement("tbody");for(const s of t.lots)r.insertAdjacentHTML("beforeend",'
");s.innerHTML=`
'+cityssm.escapeHTML(s.lotName||"")+''+(s.mapName?cityssm.escapeHTML(s.mapName):'(No Name)')+""+cityssm.escapeHTML(s.lotType||"")+""+(s.lotStatusId?cityssm.escapeHTML(s.lotStatus||""):'(No Status)')+"
"+(s.lotOccupancyCount>0?'Currently Occupied':"")+"
\n \n \n \n \n \n \n
${e.escapedAliases.Lot}${e.escapedAliases.Map}${e.escapedAliases.Lot} TypeStatus
`,s.insertAdjacentHTML("beforeend",e.getSearchResultsPagerHTML(a,t.offset,t.count)),s.querySelector("table").append(r),t.offset>0&&s.querySelector("button[data-page='previous']").addEventListener("click",l),a+t.offset{e.preventDefault(),c()}),o()})(); \ No newline at end of file diff --git a/public/javascripts/main.min.js b/public/javascripts/main.min.js index 0d26bb0d..8d8c1993 100644 --- a/public/javascripts/main.min.js +++ b/public/javascripts/main.min.js @@ -1 +1 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{let e=!1;function t(){return e}function s(e){const t=e.currentTarget.closest(".field").querySelector("input, select");if(t.classList.remove("is-readonly"),"INPUT"===t.tagName)t.readOnly=!1,t.disabled=!1;else{const e=t.querySelectorAll("option");for(const t of e)t.disabled=!1}t.focus()}const a={type:"date",dateFormat:"yyyy-MM-dd",showFooter:!1,color:"info",displayMode:"dialog"};const o=Object.freeze({Map:cityssm.escapeHTML(exports.aliases.map),map:cityssm.escapeHTML(exports.aliases.map.toLowerCase()),Maps:cityssm.escapeHTML(exports.aliases.maps),maps:cityssm.escapeHTML(exports.aliases.maps.toLowerCase()),Lot:cityssm.escapeHTML(exports.aliases.lot),lot:cityssm.escapeHTML(exports.aliases.lot.toLowerCase()),Lots:cityssm.escapeHTML(exports.aliases.lots),lots:cityssm.escapeHTML(exports.aliases.lots.toLowerCase()),Occupancy:cityssm.escapeHTML(exports.aliases.occupancy),occupancy:cityssm.escapeHTML(exports.aliases.occupancy.toLowerCase()),Occupancies:cityssm.escapeHTML(exports.aliases.occupancies),occupancies:cityssm.escapeHTML(exports.aliases.occupancies.toLowerCase()),Occupant:cityssm.escapeHTML(exports.aliases.occupant),occupant:cityssm.escapeHTML(exports.aliases.occupant.toLowerCase()),Occupants:cityssm.escapeHTML(exports.aliases.occupants),occupants:cityssm.escapeHTML(exports.aliases.occupants.toLowerCase()),ExternalReceiptNumber:cityssm.escapeHTML(exports.aliases.externalReceiptNumber),externalReceiptNumber:cityssm.escapeHTML(exports.aliases.externalReceiptNumber.toLowerCase()),OccupancyStartDate:cityssm.escapeHTML(exports.aliases.occupancyStartDate),occupancyStartDate:cityssm.escapeHTML(exports.aliases.occupancyStartDate.toLowerCase()),WorkOrderOpenDate:cityssm.escapeHTML(exports.aliases.workOrderOpenDate),workOrderOpenDate:cityssm.escapeHTML(exports.aliases.workOrderOpenDate.toLowerCase()),WorkOrderCloseDate:cityssm.escapeHTML(exports.aliases.workOrderCloseDate),workOrderCloseDate:cityssm.escapeHTML(exports.aliases.workOrderCloseDate.toLowerCase())}),c=["red","green","orange","blue","pink","yellow","purple"],r=["bright","light","dark"];const n={urlPrefix:document.querySelector("main").dataset.urlPrefix,apiKey:document.querySelector("main").dataset.apiKey,highlightMap:function(e,t,s){let a,o=t;for(;!(a=e.querySelector("#"+o))&&o.includes("-");)o=o.slice(0,Math.max(0,o.lastIndexOf("-")));if(a){a.style.fill="",a.classList.add("highlight","is-"+s);const e=a.querySelectorAll("path");for(const t of e)t.style.fill=""}},initializeUnlockFieldButtons:function(e){const t=e.querySelectorAll(".is-unlock-field-button");for(const e of t)e.addEventListener("click",s)},initializeDatePickers:function(e){const t=e.querySelectorAll("input[type='date']");for(const s of t){const t=Object.assign({},a);s.required&&(t.showClearButton=!1),s.min&&(t.minDate=cityssm.dateStringToDate(s.min)),s.max&&(t.maxDate=cityssm.dateStringToDate(s.max));const o=exports.bulmaCalendar.attach(s,t)[0];o.on("save",()=>{s.value=o.value(),s.dispatchEvent(new Event("change"))}),o.on("show",()=>{document.querySelector("html").classList.add("is-clipped")}),o.on("hide",()=>{bulmaJS.toggleHtmlClipped()});const c=e.querySelector("#"+o._id),r=c.querySelectorAll(".datepicker-nav button.is-text");for(const e of r)e.classList.add("is-"+a.color),e.classList.remove("is-text");const n=c.querySelector(".datetimepicker-clear-button");n&&(s.required?n.remove():(n.dataset.tooltip="Clear",n.ariaLabel="Clear",n.innerHTML=''));const i=document.querySelector("label[for='"+s.id+"']");i&&(c.querySelector(".datetimepicker-dummy-input").ariaLabel=i.textContent)}},populateAliases:function(e){const t=e.querySelectorAll(".alias");for(const e of t)switch(e.dataset.alias){case"Map":e.textContent=exports.aliases.map;break;case"Lot":e.textContent=exports.aliases.lot;break;case"lot":e.textContent=exports.aliases.lot.toLowerCase();break;case"Occupancy":e.textContent=exports.aliases.occupancy;break;case"occupancy":e.textContent=exports.aliases.occupancy.toLowerCase();break;case"Occupant":e.textContent=exports.aliases.occupant;break;case"occupant":e.textContent=exports.aliases.occupant.toLowerCase();break;case"ExternalReceiptNumber":e.textContent=exports.aliases.externalReceiptNumber}},escapedAliases:o,getRandomColor:function(e){let t=e;return t.length<2&&(t+="a1"),exports.randomColor({seed:t+t,hue:c[t.codePointAt(t.length-1)%c.length],luminosity:r[t.codePointAt(t.length-2)%r.length]})},setUnsavedChanges:function(){t()||(e=!0,cityssm.enableNavBlocker())},clearUnsavedChanges:function(){e=!1,cityssm.disableNavBlocker()},hasUnsavedChanges:t,getMoveUpDownButtonFieldHTML:function(e,t,s=!0){return`
\n
\n \n \n \n
\n
\n \n \n \n
\n
`},getLoadingParagraphHTML:function(e="Loading..."){return`

\n
\n ${cityssm.escapeHTML(e)}\n

`}};exports.los=n})(); \ No newline at end of file +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{let e=!1;function t(){return e}function s(e){const t=e.currentTarget.closest(".field").querySelector("input, select");if(t.classList.remove("is-readonly"),"INPUT"===t.tagName)t.readOnly=!1,t.disabled=!1;else{const e=t.querySelectorAll("option");for(const t of e)t.disabled=!1}t.focus()}const a={type:"date",dateFormat:"yyyy-MM-dd",showFooter:!1,color:"info",displayMode:"dialog"};const o=Object.freeze({Map:cityssm.escapeHTML(exports.aliases.map),map:cityssm.escapeHTML(exports.aliases.map.toLowerCase()),Maps:cityssm.escapeHTML(exports.aliases.maps),maps:cityssm.escapeHTML(exports.aliases.maps.toLowerCase()),Lot:cityssm.escapeHTML(exports.aliases.lot),lot:cityssm.escapeHTML(exports.aliases.lot.toLowerCase()),Lots:cityssm.escapeHTML(exports.aliases.lots),lots:cityssm.escapeHTML(exports.aliases.lots.toLowerCase()),Occupancy:cityssm.escapeHTML(exports.aliases.occupancy),occupancy:cityssm.escapeHTML(exports.aliases.occupancy.toLowerCase()),Occupancies:cityssm.escapeHTML(exports.aliases.occupancies),occupancies:cityssm.escapeHTML(exports.aliases.occupancies.toLowerCase()),Occupant:cityssm.escapeHTML(exports.aliases.occupant),occupant:cityssm.escapeHTML(exports.aliases.occupant.toLowerCase()),Occupants:cityssm.escapeHTML(exports.aliases.occupants),occupants:cityssm.escapeHTML(exports.aliases.occupants.toLowerCase()),ExternalReceiptNumber:cityssm.escapeHTML(exports.aliases.externalReceiptNumber),externalReceiptNumber:cityssm.escapeHTML(exports.aliases.externalReceiptNumber.toLowerCase()),OccupancyStartDate:cityssm.escapeHTML(exports.aliases.occupancyStartDate),occupancyStartDate:cityssm.escapeHTML(exports.aliases.occupancyStartDate.toLowerCase()),WorkOrderOpenDate:cityssm.escapeHTML(exports.aliases.workOrderOpenDate),workOrderOpenDate:cityssm.escapeHTML(exports.aliases.workOrderOpenDate.toLowerCase()),WorkOrderCloseDate:cityssm.escapeHTML(exports.aliases.workOrderCloseDate),workOrderCloseDate:cityssm.escapeHTML(exports.aliases.workOrderCloseDate.toLowerCase())}),c=["red","green","orange","blue","pink","yellow","purple"],i=["bright","light","dark"];const n={urlPrefix:document.querySelector("main").dataset.urlPrefix,apiKey:document.querySelector("main").dataset.apiKey,highlightMap:function(e,t,s){let a,o=t;for(;!(a=e.querySelector("#"+o))&&o.includes("-");)o=o.slice(0,Math.max(0,o.lastIndexOf("-")));if(a){a.style.fill="",a.classList.add("highlight","is-"+s);const e=a.querySelectorAll("path");for(const t of e)t.style.fill=""}},initializeUnlockFieldButtons:function(e){const t=e.querySelectorAll(".is-unlock-field-button");for(const e of t)e.addEventListener("click",s)},initializeDatePickers:function(e){const t=e.querySelectorAll("input[type='date']");for(const s of t){const t=Object.assign({},a);s.required&&(t.showClearButton=!1),s.min&&(t.minDate=cityssm.dateStringToDate(s.min)),s.max&&(t.maxDate=cityssm.dateStringToDate(s.max));const o=exports.bulmaCalendar.attach(s,t)[0];o.on("save",()=>{s.value=o.value(),s.dispatchEvent(new Event("change"))}),o.on("show",()=>{document.querySelector("html").classList.add("is-clipped")}),o.on("hide",()=>{bulmaJS.toggleHtmlClipped()});const c=e.querySelector("#"+o._id),i=c.querySelectorAll(".datepicker-nav button.is-text");for(const e of i)e.classList.add("is-"+a.color),e.classList.remove("is-text");const n=c.querySelector(".datetimepicker-clear-button");n&&(s.required?n.remove():(n.dataset.tooltip="Clear",n.ariaLabel="Clear",n.innerHTML=''));const r=document.querySelector("label[for='"+s.id+"']");r&&(c.querySelector(".datetimepicker-dummy-input").ariaLabel=r.textContent)}},populateAliases:function(e){const t=e.querySelectorAll(".alias");for(const e of t)switch(e.dataset.alias){case"Map":e.textContent=exports.aliases.map;break;case"Lot":e.textContent=exports.aliases.lot;break;case"lot":e.textContent=exports.aliases.lot.toLowerCase();break;case"Occupancy":e.textContent=exports.aliases.occupancy;break;case"occupancy":e.textContent=exports.aliases.occupancy.toLowerCase();break;case"Occupant":e.textContent=exports.aliases.occupant;break;case"occupant":e.textContent=exports.aliases.occupant.toLowerCase();break;case"ExternalReceiptNumber":e.textContent=exports.aliases.externalReceiptNumber}},escapedAliases:o,getRandomColor:function(e){let t=e;return t.length<2&&(t+="a1"),exports.randomColor({seed:t+t,hue:c[t.codePointAt(t.length-1)%c.length],luminosity:i[t.codePointAt(t.length-2)%i.length]})},setUnsavedChanges:function(){t()||(e=!0,cityssm.enableNavBlocker())},clearUnsavedChanges:function(){e=!1,cityssm.disableNavBlocker()},hasUnsavedChanges:t,getMoveUpDownButtonFieldHTML:function(e,t,s=!0){return`
\n
\n \n \n \n
\n
\n \n \n \n
\n
`},getLoadingParagraphHTML:function(e="Loading..."){return`

\n
\n ${cityssm.escapeHTML(e)}\n

`},getSearchResultsPagerHTML:function(e,t,s){return'
Displaying '+(t+1).toString()+" to "+Math.min(s,e+t)+" of "+s+'
'+(t>0?'
':"")+(e+t
':"")+"
"}};exports.los=n})(); \ No newline at end of file diff --git a/public/javascripts/workOrderSearch.min.js b/public/javascripts/workOrderSearch.min.js index b0f76a96..d6fc0ceb 100644 --- a/public/javascripts/workOrderSearch.min.js +++ b/public/javascripts/workOrderSearch.min.js @@ -1 +1 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=exports.workOrderPrints,s=document.querySelector("#form--searchFilters");e.initializeDatePickers(s);const a=document.querySelector("#container--searchResults"),r=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),o=document.querySelector("#searchFilter--offset");function i(s){if(0===s.workOrders.length)return void(a.innerHTML='

There are no work orders that meet the search criteria.

');const o=document.createElement("tbody");for(const a of s.workOrders){let s="";for(const t of a.workOrderLots)s+=' '+cityssm.escapeHTML(t.lotName||"(No "+exports.aliases.Lot+" Name)")+"
";for(const t of a.workOrderLotOccupancies)for(const a of t.lotOccupancyOccupants)s+=' '+cityssm.escapeHTML(a.occupantName||"(No Name)")+"
";o.insertAdjacentHTML("beforeend",'
"+(t.length>0?'':"")+"")}a.innerHTML='
'+(a.workOrderNumber.trim()?cityssm.escapeHTML(a.workOrderNumber||""):"(No Number)")+""+cityssm.escapeHTML(a.workOrderType||"")+'
'+cityssm.escapeHTML(a.workOrderDescription||"")+'
'+s+' '+a.workOrderOpenDateString+'
'+(a.workOrderCloseDate?a.workOrderCloseDateString:'(No '+e.escapedAliases.WorkOrderCloseDate+")")+"
"+(0===a.workOrderMilestoneCount?"-":a.workOrderMilestoneCompletionCount+" / "+a.workOrderMilestoneCount)+"
'+(t.length>0?'':"")+'
Work Order NumberDescriptionRelatedDateProgress
Displaying '+(s.offset+1).toString()+" to "+Math.min(s.count,r+s.offset)+" of "+s.count+'
'+(s.offset>0?'
':"")+(r+s.offset
':"")+"
",a.querySelector("table").append(o),s.offset>0&&a.querySelector("button[data-page='previous']").addEventListener("click",c),r+s.offset{e.preventDefault(),n()}),l()})(); \ No newline at end of file +"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),(()=>{const e=exports.los,t=exports.workOrderPrints,s=document.querySelector("#form--searchFilters");e.initializeDatePickers(s);const r=document.querySelector("#container--searchResults"),a=Number.parseInt(document.querySelector("#searchFilter--limit").value,10),o=document.querySelector("#searchFilter--offset");function i(s){if(0===s.workOrders.length)return void(r.innerHTML='

There are no work orders that meet the search criteria.

');const o=document.createElement("tbody");for(const r of s.workOrders){let s="";for(const t of r.workOrderLots)s+=' '+cityssm.escapeHTML(t.lotName||"(No "+exports.aliases.Lot+" Name)")+"
";for(const t of r.workOrderLotOccupancies)for(const r of t.lotOccupancyOccupants)s+=' '+cityssm.escapeHTML(r.occupantName||"(No Name)")+"
";o.insertAdjacentHTML("beforeend",'
"+(t.length>0?'':"")+"")}r.innerHTML='
'+(r.workOrderNumber.trim()?cityssm.escapeHTML(r.workOrderNumber||""):"(No Number)")+""+cityssm.escapeHTML(r.workOrderType||"")+'
'+cityssm.escapeHTML(r.workOrderDescription||"")+'
'+s+' '+r.workOrderOpenDateString+'
'+(r.workOrderCloseDate?r.workOrderCloseDateString:'(No '+e.escapedAliases.WorkOrderCloseDate+")")+"
"+(0===r.workOrderMilestoneCount?"-":r.workOrderMilestoneCompletionCount+" / "+r.workOrderMilestoneCount)+"
'+(t.length>0?'':"")+"
Work Order NumberDescriptionRelatedDateProgress
",r.insertAdjacentHTML("beforeend",e.getSearchResultsPagerHTML(a,s.offset,s.count)),r.querySelector("table").append(o),s.offset>0&&r.querySelector("button[data-page='previous']").addEventListener("click",c),a+s.offset{e.preventDefault(),n()}),l()})(); \ No newline at end of file diff --git a/types/globalTypes.d.ts b/types/globalTypes.d.ts index a87ae800..10a3b009 100644 --- a/types/globalTypes.d.ts +++ b/types/globalTypes.d.ts @@ -37,4 +37,5 @@ export interface LOS { hasUnsavedChanges: () => boolean; getMoveUpDownButtonFieldHTML: (upButtonClassNames: string, downButtonClassNames: string, isSmall?: boolean) => string; getLoadingParagraphHTML: (captionText?: string) => string; + getSearchResultsPagerHTML: (limit: number, offset: number, count: number) => string; } diff --git a/types/globalTypes.ts b/types/globalTypes.ts index cf8d1c31..a8b8fa9d 100644 --- a/types/globalTypes.ts +++ b/types/globalTypes.ts @@ -50,4 +50,5 @@ export interface LOS { getMoveUpDownButtonFieldHTML: (upButtonClassNames: string, downButtonClassNames: string, isSmall?: boolean) => string; getLoadingParagraphHTML: (captionText?: string) => string; + getSearchResultsPagerHTML: (limit: number, offset: number, count: number) => string; }