@@ -1801,6 +1801,7 @@ var ElectroItemZoeker = /** @class */ (function () {
1801
1801
* 4. De ElectroItem wordt toegevoegd met de volgende structuur: {id: number, kringnaam: string, adres: string, type: string}
1802
1802
*/
1803
1803
ElectroItemZoeker.prototype.reCalculate = function () {
1804
+ this.data = [];
1804
1805
for (var i = 0; i < structure.length; i++) {
1805
1806
if (structure.active[i]) {
1806
1807
var id = structure.id[i];
@@ -3428,20 +3429,43 @@ function SituationPlanView_ElementPropertiesPopup(sitplanElement, callbackOK) {
3428
3429
}
3429
3430
;
3430
3431
}
3432
+ function handleExpandButton(electroItemId) {
3433
+ if (electroItemId === void 0) { electroItemId = null; }
3434
+ if (electroItemId == null)
3435
+ return;
3436
+ var element = structure.getElectroItemById(electroItemId);
3437
+ if (element == null)
3438
+ return;
3439
+ element.expand();
3440
+ adressen.reCalculate();
3441
+ kringnamen = adressen.getUniqueKringnaam();
3442
+ IdFieldChanged();
3443
+ }
3431
3444
/**
3432
3445
* Toon het type verbruiker van het gekozen electro-item
3433
3446
*/
3434
3447
function updateElectroType() {
3435
- if (textInput.value == null || textInput.value.trim() == '')
3448
+ if (textInput.value == null || textInput.value.trim() == '') {
3436
3449
feedback.innerHTML = '<span style="color: red;">Geen ID ingegeven</span>';
3450
+ expandButton.style.display = 'none';
3451
+ }
3437
3452
else {
3438
- var id = Number(textInput.value);
3439
- var element = structure.getElectroItemById(id );
3453
+ var electroItemId_1 = Number(textInput.value);
3454
+ var element = structure.getElectroItemById(electroItemId_1 );
3440
3455
if (element != null) {
3456
+ var type = element.getType();
3441
3457
feedback.innerHTML = '<span style="color:green;">' + element.getType() + '</span>';
3458
+ if (element.isExpandable()) {
3459
+ expandButton.style.display = 'block';
3460
+ feedback.innerHTML += '<br><span style="color: black;">Klik op uitpakken indien u de onderliggende elementen in het situatieschema wil kunnen plaatsen.</span>';
3461
+ expandButton.onclick = function () { handleExpandButton(electroItemId_1); };
3462
+ }
3463
+ else
3464
+ expandButton.style.display = 'none';
3442
3465
}
3443
3466
else {
3444
3467
feedback.innerHTML = '<span style="color: red;">Element niet gevonden</span>';
3468
+ expandButton.style.display = 'none';
3445
3469
}
3446
3470
}
3447
3471
}
@@ -3500,7 +3524,7 @@ function SituationPlanView_ElementPropertiesPopup(sitplanElement, callbackOK) {
3500
3524
* Eerst maken we de pop-up
3501
3525
*/
3502
3526
var div = document.createElement('div');
3503
- div.innerHTML = "\n <div id=\"popupOverlay\" style=\"position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; visibility: hidden; z-index: 9999;\">\n <div id=\"popupWindow\" style=\"width: 400px; background-color: white; padding: 20px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; justify-content: space-between;\">\n <div id=\"selectKringContainer\" style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">Kring:</label>\n <select id=\"selectKring\"></select>\n </div>\n <div id=\"selectElectroItemContainer\" style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">Element:</label>\n <select id=\"selectElectroItemBox\"></select>\n </div>\n <div id=\"textContainer\" style=\"display: flex; margin-bottom: 30px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">ID:</label>\n <input id=\"textInput\" style=\"width: 100px;\" type=\"number\" min=\"0\" step=\"1\" value=\"\">\n <div id=\"feedback\" style=\"margin-left: 10px; width: 100%; font-size: 12px\"></div>\n </div>\n <div id=\"selectContainer\" style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block; white-space: nowrap;\">Label type:</label>\n <select id=\"selectAdresType\">\n <option value=\"auto\">Automatisch</option>\n <option value=\"manueel\">Handmatig</option>\n </select>\n </div>\n <div id=\"adresContainer\" style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block; white-space: nowrap;\">Label tekst:</label>\n <input id=\"adresInput\" style=\"width: 100%;\" type=\"text\" value=\"\">\n <select id=\"selectAdresLocation\" style=\"margin-left: 10px; display: inline-block;\">\n <option value=\"links\">Links</option>\n <option value=\"rechts\">Rechts</option>\n <option value=\"boven\">Boven</option>\n <option value=\"onder\">Onder</option>\n </select>\n </div>\n <div id=\"fontSizeContainer\" style=\"display: flex; margin-bottom: 30px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block; white-space: nowrap;\">Tekengrootte (px):</label>\n <input id=\"fontSizeInput\" style=\"width: 100px;\" type=\"number\" min=\"1\" max=\"72\" step=\"11\" value=\"11\">\n </div> \n <div style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">Schaal (%):</label>\n <input id=\"scaleInput\" style=\"width: 100px;\" type=\"number\" min=\"10\" max=\"400\" step=\"10\" value=\"".concat(String(SITPLANVIEW_DEFAULT_SCALE * 100), "\">\n </div>\n <div style=\"display: flex; margin-bottom: 20px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">Rotatie (\u00B0):</label>\n <input id=\"rotationInput\" style=\"width: 100px;\" type=\"number\" min=\"0\" max=\"360\" step=\"10\" value=\"0\">\n </div>\n <div id=\"setDefaultContainer\" style=\"display: flex; margin-bottom: 20px; align-items: flex-start;\">\n <input type=\"checkbox\" id=\"setDefaultCheckbox\">\n ").concat((sitplanElement == null) || ((sitplanElement != null) && (sitplanElement.getElectroItemId() != null))
3527
+ div.innerHTML = "\n <div id=\"popupOverlay\" style=\"position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center; visibility: hidden; z-index: 9999;\">\n <div id=\"popupWindow\" style=\"width: 500px; background-color: white; padding: 20px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; justify-content: space-between;\">\n <div id=\"selectKringContainer\" style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">Kring:</label>\n <select id=\"selectKring\"></select>\n </div>\n <div id=\"selectElectroItemContainer\" style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">Element:</label>\n <select id=\"selectElectroItemBox\"></select><span style=\"display: inline-block; width: 10px;\"></span>\n <button id=\"expandButton\" title=\"Omzetten in indivuele elementen\" style=\"background-color:lightblue;\">Uitpakken</button>\n </div>\n <div id=\"textContainer\" style=\"display: flex; margin-bottom: 30px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">ID:</label>\n <input id=\"textInput\" style=\"width: 100px;\" type=\"number\" min=\"0\" step=\"1\" value=\"\">\n <div id=\"feedback\" style=\"margin-left: 10px; width: 100%; font-size: 12px\"></div>\n </div>\n <div id=\"selectContainer\" style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block; white-space: nowrap;\">Label type:</label>\n <select id=\"selectAdresType\">\n <option value=\"auto\">Automatisch</option>\n <option value=\"manueel\">Handmatig</option>\n </select>\n </div>\n <div id=\"adresContainer\" style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block; white-space: nowrap;\">Label tekst:</label>\n <input id=\"adresInput\" style=\"width: 100%;\" type=\"text\" value=\"\">\n <select id=\"selectAdresLocation\" style=\"margin-left: 10px; display: inline-block;\">\n <option value=\"links\">Links</option>\n <option value=\"rechts\">Rechts</option>\n <option value=\"boven\">Boven</option>\n <option value=\"onder\">Onder</option>\n </select>\n </div>\n <div id=\"fontSizeContainer\" style=\"display: flex; margin-bottom: 30px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block; white-space: nowrap;\">Tekengrootte (px):</label>\n <input id=\"fontSizeInput\" style=\"width: 100px;\" type=\"number\" min=\"1\" max=\"72\" step=\"11\" value=\"11\">\n </div> \n <div style=\"display: flex; margin-bottom: 10px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">Schaal (%):</label>\n <input id=\"scaleInput\" style=\"width: 100px;\" type=\"number\" min=\"10\" max=\"400\" step=\"10\" value=\"".concat(String(SITPLANVIEW_DEFAULT_SCALE * 100), "\">\n </div>\n <div style=\"display: flex; margin-bottom: 20px; align-items: center;\">\n <label style=\"margin-right: 10px; display: inline-block;\">Rotatie (\u00B0):</label>\n <input id=\"rotationInput\" style=\"width: 100px;\" type=\"number\" min=\"0\" max=\"360\" step=\"10\" value=\"0\">\n </div>\n <div id=\"setDefaultContainer\" style=\"display: flex; margin-bottom: 20px; align-items: flex-start;\">\n <input type=\"checkbox\" id=\"setDefaultCheckbox\">\n ").concat((sitplanElement == null) || ((sitplanElement != null) && (sitplanElement.getElectroItemId() != null))
3504
3528
? "<label for=\"checkbox\" style=\"margin-left: 10px; flex-grow: 1; flex-wrap: wrap;\">Zet tekengrootte en schaal als standaard voor alle toekomstige nieuwe symbolen.</label>"
3505
3529
: "<label for=\"checkbox\" style=\"margin-left: 10px; flex-grow: 1; flex-wrap: wrap;\">Zet schaal als standaard voor alle toekomstige nieuwe symbolen.</label>", " \n </div>\n <div style=\"display: flex; justify-content: center;\">\n <button id=\"okButton\" style=\"margin-right: 10px;\">OK</button>\n <button id=\"cancelButton\" style=\"margin-keft: 10px;\">Cancel</button>\n </div>\n </div>\n </div>");
3506
3530
var popupOverlay = div.querySelector('#popupOverlay');
@@ -3509,6 +3533,7 @@ function SituationPlanView_ElementPropertiesPopup(sitplanElement, callbackOK) {
3509
3533
var selectKring = popupWindow.querySelector('#selectKring');
3510
3534
var selectElectroItemContainer = popupWindow.querySelector('#selectElectroItemContainer');
3511
3535
var selectElectroItemBox = popupWindow.querySelector('#selectElectroItemBox');
3536
+ var expandButton = popupWindow.querySelector('#expandButton');
3512
3537
var textContainer = popupWindow.querySelector('#textContainer');
3513
3538
var textInput = popupWindow.querySelector('#textInput');
3514
3539
var feedback = popupWindow.querySelector('#feedback');
0 commit comments