import { a as __decorate, _ as __awaiter } from './tslib.es6-b53fb3ce.js';
|
import { n, B as BaseElement } from './base.component-76cf6d93.js';
|
import { i, r, x } from './query-assigned-elements-fea1f631.js';
|
import { e } from './custom-element-30fc6381.js';
|
|
var css_248z$1 = i`.close-symbol{cursor:pointer;height:100%;position:relative;width:100%}.close-symbol.loading{z-index:999}.close-symbol.loading:after,.close-symbol.loading:before{background:#fff}.close-symbol:after,.close-symbol:before{background:var(--close-symbol-background,#888);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;content:" ";height:1px;margin:0;padding:0;position:absolute;top:50%;width:100%}.close-symbol:after:hover,.close-symbol:before:hover{background:var(--close-symbol-background-hover,#333)}.close-symbol:after{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);transform:rotate(-45deg)}.close-symbol:before{-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg)}:host(.active) .circle-number-symbol{border:var(--circle-number-symbol-border-active,2px solid #000)}.circle-number-symbol{align-items:center;background:var(--circle-number-symbol-background,var(--primary-color,red));border:var(--circle-number-symbol-border,2px solid #fff);border-radius:50%;box-shadow:var(--circle-number-symbol-box-shadow,1px 2px 5px 0 #000);color:var(--circle-number-symbol-color,var(--primary-text-color,#000));display:flex;height:var(--circle-number-symbol-size,30px);justify-content:center;position:relative;width:var(--circle-number-symbol-size,30px)}.custom-symbol{cursor:pointer;display:flex;left:10px;position:relative}.custom-symbol.up:after{background-image:var(--custom-symbol-image-down,url("/webui/images/minus.svg"));content:"";height:18px}.custom-symbol.down:after{background-image:var(--custom-symbol-image-down,url("/webui/images/plus.svg"));content:"";height:18px}.custom-symbol:after{color:#1e1e1e;margin:auto 0;padding:0 0 2px;pointer-events:none;transform:translateX(-15px);width:18px}.accordion-symbol{cursor:pointer;display:flex;left:10px;position:relative}.accordion-symbol.up:after{content:"-";font-size:xx-large;transform:scaleX(2) translateX(-4px)}.accordion-symbol.down:after{content:"+";font-size:xx-large}.accordion-symbol:after{color:#1e1e1e;margin:auto 0;padding:0 0 2px;pointer-events:none;transform:translateX(-15px);width:18px}.chevron-symbol{cursor:pointer;left:10px;position:relative}.chevron-symbol.up:after{content:"<"}.chevron-symbol.down:after{content:">"}.chevron-symbol:after{color:inherit;font:17px Consolas,monospace;padding:0 0 2px;pointer-events:none;position:absolute;-webkit-transform:rotate(90deg) translateX(-100%);-moz-transform:rotate(90deg) translateX(-100%);-ms-transform:rotate(90deg) translateX(-100%);transform:rotate(90deg) translateX(-100%)}@media (width >= 980px){.only-mobile{display:none!important}}@media (width <= 980px){.only-desktop{display:none!important}}.bold{font-weight:var(--global-font-weight-bold,600)}*{font-family:var(--global-font,Roboto);font-weight:var(--global-font-weight,400);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container{display:flex;margin:10px 0}.container.column{flex-direction:column}.container.column.reverse{flex-direction:column-reverse}.container.row{flex-direction:row}.container.row.reverse{flex-direction:row-reverse}.fluid{flex:1}.fluid.space-after{margin-right:55px}.hidden{display:none!important}.mobile-mode-hide,:host(.mobile-mode-hide){display:none!important}.invisible{visibility:hidden!important}.invisible-scroll,:host(.invisible-scroll){margin-right:-22px;overflow:hidden}.invisible-scroll>:first-child,:host(.invisible-scroll)>:first-child{box-sizing:content-box;overflow-x:hidden;overflow-y:scroll;padding-right:22px}.invisible-scroll.bottom,:host(.invisible-scroll.bottom){margin-right:unset;overflow:hidden}.invisible-scroll.bottom>:first-child,:host(.invisible-scroll.bottom)>:first-child{box-sizing:content-box;margin-bottom:-22px;overflow-x:scroll;overflow-y:hidden;padding-bottom:22px;padding-right:unset}:host([disabled]){filter:contrast(.5) grayscale(1);pointer-events:none}*{scrollbar-color:#5c5c5c hsla(0,0%,100%,.004);scrollbar-width:thin}[disabled]{filter:contrast(.5) grayscale(1);pointer-events:none}::-webkit-scrollbar{height:8px;width:8px}::-webkit-scrollbar,::-webkit-scrollbar-corner{background:hsla(0,0%,100%,0)}::-webkit-scrollbar-thumb{background:#5c5c5c;-webkit-border-radius:8px}::-webkit-scrollbar-button,::-webkit-scrollbar-button:horizontal:end:decrement,::-webkit-scrollbar-button:horizontal:end:increment,::-webkit-scrollbar-button:vertical:end:decrement,::-webkit-scrollbar-button:vertical:start:increment{background-color:transparent;border:none;color:transparent}:host{--select-option-background:var(--webcab-display-option-selection-option-background,transparent);--select-option-hover-background:var(--webcab-display-selection-option-hover-background,var(--webcab-ui-cabinets-arrange-button-hover-background,#70707060));--select-option-border:var(--webcab-display-option-selection-option-border,none);--select-option-justify-content:var(--webcab-display-option-selection-option-justify-content,flex-start);--select-option-padding-left:var(--webcab-display-option-selection-option-padding-left,0.6em);--select-option-padding-right:var(--webcab-display-option-selection-option-padding-right,0px);--select-option-selection-button-border:var(--webcab-ui-cabinets-toggle-button-border,none);--select-option-color:var(--webcab-ui-color,#000);--select-option-hover-color:var(--webcab-ui-hover-color,var(--webcab-ui-color,#000));--select-option-selected-color:var(--webcab-ui-selected-color,var(--webcab-ui-color,#000))}:host(.select-by-buttons){--select-option-background:var(--webcab-display-option-selection-option-background,var(--webcab-ui-cabinets-arrange-button-background,unset));--select-option-hover-background:var(--webcab-display-selection-option-hover-background,var(--webcab-ui-cabinets-arrange-button-hover-background,#70707060));--select-option-border:var(--webcab-display-option-selection-option-border,var(--webcab-ui-cabinets-arrange-button-border,none));--select-option-justify-content:var(--webcab-display-option-selection-option-justify-content,var(--webcab-ui-cabinets-arrange-button-justify-content,center));--select-option-padding-left:var(--webcab-display-option-selection-option-padding-left,var(--webcab-ui-cabinets-arrange-button-padding-left,unset));--select-option-padding-right:var(--webcab-display-option-selection-option-padding-right,var(--webcab-ui-cabinets-arrange-button-padding-right,unset));--select-option-selection-button-border:var(--webcab-ui-cabinets-toggle-button-border,none);--select-option-color:var(--webcab-ui-color,#000);--select-option-hover-color:var(--webcab-ui-hover-color,var(--webcab-ui-color,#000));--select-option-selected-color:var(--webcab-ui-selected-color,var(--webcab-ui-color,#000))}`;
|
|
var css_248z = i`.close-symbol{cursor:pointer;height:100%;position:relative;width:100%}.close-symbol.loading{z-index:999}.close-symbol.loading:after,.close-symbol.loading:before{background:#fff}.close-symbol:after,.close-symbol:before{background:var(--close-symbol-background,#888);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;content:" ";height:1px;margin:0;padding:0;position:absolute;top:50%;width:100%}.close-symbol:after:hover,.close-symbol:before:hover{background:var(--close-symbol-background-hover,#333)}.close-symbol:after{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);transform:rotate(-45deg)}.close-symbol:before{-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);transform:rotate(45deg)}:host(.active) .circle-number-symbol{border:var(--circle-number-symbol-border-active,2px solid #000)}.circle-number-symbol{align-items:center;background:var(--circle-number-symbol-background,var(--primary-color,red));border:var(--circle-number-symbol-border,2px solid #fff);border-radius:50%;box-shadow:var(--circle-number-symbol-box-shadow,1px 2px 5px 0 #000);color:var(--circle-number-symbol-color,var(--primary-text-color,#000));display:flex;height:var(--circle-number-symbol-size,30px);justify-content:center;position:relative;width:var(--circle-number-symbol-size,30px)}.custom-symbol{cursor:pointer;display:flex;left:10px;position:relative}.custom-symbol.up:after{background-image:var(--custom-symbol-image-down,url("/webui/images/minus.svg"));content:"";height:18px}.custom-symbol.down:after{background-image:var(--custom-symbol-image-down,url("/webui/images/plus.svg"));content:"";height:18px}.custom-symbol:after{color:#1e1e1e;margin:auto 0;padding:0 0 2px;pointer-events:none;transform:translateX(-15px);width:18px}.accordion-symbol{cursor:pointer;display:flex;left:10px;position:relative}.accordion-symbol.up:after{content:"-";font-size:xx-large;transform:scaleX(2) translateX(-4px)}.accordion-symbol.down:after{content:"+";font-size:xx-large}.accordion-symbol:after{color:#1e1e1e;margin:auto 0;padding:0 0 2px;pointer-events:none;transform:translateX(-15px);width:18px}.chevron-symbol{cursor:pointer;left:10px;position:relative}.chevron-symbol.up:after{content:"<"}.chevron-symbol.down:after{content:">"}.chevron-symbol:after{color:inherit;font:17px Consolas,monospace;padding:0 0 2px;pointer-events:none;position:absolute;-webkit-transform:rotate(90deg) translateX(-100%);-moz-transform:rotate(90deg) translateX(-100%);-ms-transform:rotate(90deg) translateX(-100%);transform:rotate(90deg) translateX(-100%)}@media (width >= 980px){.only-mobile{display:none!important}}@media (width <= 980px){.only-desktop{display:none!important}}.bold{font-weight:var(--global-font-weight-bold,600)}*{font-family:var(--global-font,Roboto);font-weight:var(--global-font-weight,400);-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.container{display:flex;margin:10px 0}.container.column{flex-direction:column}.container.column.reverse{flex-direction:column-reverse}.container.row{flex-direction:row}.container.row.reverse{flex-direction:row-reverse}.fluid{flex:1}.fluid.space-after{margin-right:55px}.hidden{display:none!important}.mobile-mode-hide,:host(.mobile-mode-hide){display:none!important}.invisible{visibility:hidden!important}.invisible-scroll,:host(.invisible-scroll){margin-right:-22px;overflow:hidden}.invisible-scroll>:first-child,:host(.invisible-scroll)>:first-child{box-sizing:content-box;overflow-x:hidden;overflow-y:scroll;padding-right:22px}.invisible-scroll.bottom,:host(.invisible-scroll.bottom){margin-right:unset;overflow:hidden}.invisible-scroll.bottom>:first-child,:host(.invisible-scroll.bottom)>:first-child{box-sizing:content-box;margin-bottom:-22px;overflow-x:scroll;overflow-y:hidden;padding-bottom:22px;padding-right:unset}:host([disabled]){filter:contrast(.5) grayscale(1);pointer-events:none}*{scrollbar-color:#5c5c5c hsla(0,0%,100%,.004);scrollbar-width:thin}[disabled]{filter:contrast(.5) grayscale(1);pointer-events:none}::-webkit-scrollbar{height:8px;width:8px}::-webkit-scrollbar,::-webkit-scrollbar-corner{background:hsla(0,0%,100%,0)}::-webkit-scrollbar-thumb{background:#5c5c5c;-webkit-border-radius:8px}::-webkit-scrollbar-button,::-webkit-scrollbar-button:horizontal:end:decrement,::-webkit-scrollbar-button:horizontal:end:increment,::-webkit-scrollbar-button:vertical:end:decrement,::-webkit-scrollbar-button:vertical:start:increment{background-color:transparent;border:none;color:transparent}:host .element-ui{background:var(--webcab-ui-background,transparent)}:host fv-loading.loader{background-color:var(--webcab-ui-loader-background-color,#fff)}:host .z-splitting-count-input{width:100%}:host .z-splitting-height-input{margin-left:10%;width:90%}:host .z-splitting-content-option-selection{margin-left:20%;width:80%}`;
|
|
var WebCabUiComponent_1;
|
class WebCabChangeLoadingEvent extends CustomEvent {
|
constructor(value) {
|
super("webcabchangeloading", {
|
bubbles: true,
|
composed: true,
|
detail: value
|
});
|
}
|
}
|
class WebCabTemplateReplaceEvent extends CustomEvent {
|
constructor(template, webcabui, index) {
|
super("webcabtemplatereplace", {
|
bubbles: true,
|
composed: true,
|
detail: { template: template, webcabui: webcabui, index: index }
|
});
|
}
|
}
|
let WebCabUiComponent = WebCabUiComponent_1 = class WebCabUiComponent extends BaseElement {
|
setElementUiComponents(instanceIdent_, webcabUiData_, preventUpdateRequest_ = false) {
|
this._components[instanceIdent_] = webcabUiData_;
|
for (let index = 0; index < this.webcabuis.length; ++index) {
|
if (this.webcabuis[index]["instance-ident"] == instanceIdent_) {
|
this.webcabuis[index].disabled = webcabUiData_.disabled;
|
}
|
}
|
const controlsTemplate = this.querySelector(this.settings["element-controls-template-selector"]);
|
if (!controlsTemplate)
|
return;
|
const componentName = controlsTemplate.getAttribute("component-name");
|
if (!componentName)
|
return;
|
const components = webcabUiData_.data[componentName].components;
|
if (components) {
|
this._elementControlsComponents[instanceIdent_] = {};
|
for (const component of components) {
|
if (component.name) {
|
this._elementControlsComponents[instanceIdent_][component.name] = component;
|
}
|
}
|
if (!preventUpdateRequest_) {
|
this.requestUpdate();
|
}
|
}
|
}
|
get components() {
|
return this._components;
|
}
|
getTemplate(webcabui_) {
|
const headingTemplateElement = this.querySelector(this.settings["object-heading-template-selector"]);
|
const headingTemplate = headingTemplateElement ? headingTemplateElement.innerHTML : "";
|
const controlsTemplateElement = this.querySelector(this.settings["controls-template-selector"]);
|
if (!controlsTemplateElement) {
|
return "";
|
}
|
const controlsTemplate = webcabui_.disabled ? "" : controlsTemplateElement.innerHTML;
|
return this.applyGeneralReplacers(headingTemplate + controlsTemplate);
|
}
|
get loading() {
|
return this._loading;
|
}
|
set loading(loading_) {
|
this._loading = loading_;
|
if (loading_) {
|
// this.dispatchEvent start
|
return;
|
}
|
// this.dispatchEvent finish
|
}
|
constructor() {
|
super();
|
this.openedPopups = [];
|
this.showing = false;
|
this.shown = false;
|
this.updateEventActive = false;
|
this._components = {};
|
this._elementControlsComponents = {};
|
this.webcabuis = new Array();
|
this.settings = {
|
"object-ui-settings": {
|
"customer-type": "",
|
"config-suffix": "",
|
increment: 0,
|
"fraction-digits": 0,
|
"input-buttons-timeout-ms": 500,
|
},
|
"object-heading-template-selector": "",
|
"controls-template-selector": "",
|
"element-controls-template-selector": "",
|
"content-option-selection-template-selector": "",
|
replacers: {
|
"by-object-ui": {},
|
general: {}
|
}
|
};
|
this.objectUiExportparts = "";
|
this._loading = false;
|
this.dimmed = false;
|
this.TemplateReplaceEventResult = undefined;
|
this.postUpdateEventPromise = undefined;
|
this.updatePromise = undefined;
|
this.addEventListener("webcabstartloading", (event) => {
|
this.loading = event.detail ? event.detail : false;
|
});
|
this.addEventListener("webcabselectionchange", (event) => {
|
if (event.detail == undefined)
|
return;
|
const instances = Object.keys(event.detail.uidata);
|
const uidata = this.breakDownUiData(event.detail.uidata);
|
for (const instance of instances) {
|
const instanceIdent = parseInt(instance);
|
this.setElementUiComponents(instanceIdent, uidata[instanceIdent], true);
|
}
|
this.requestUpdate();
|
this.loading = false;
|
});
|
this.addEventListener("webcab-value-input-loading", (event_) => __awaiter(this, void 0, void 0, function* () {
|
if (event_.detail != undefined) {
|
if (event_.detail.uiData) {
|
const instances = Object.keys(event_.detail.uiData);
|
const uidata = this.breakDownUiData(event_.detail.uiData);
|
for (const instance of instances) {
|
const instanceIdent = parseInt(instance);
|
this.setElementUiComponents(instanceIdent, uidata[instanceIdent], true);
|
}
|
this.requestUpdate();
|
}
|
this.loading = event_.detail.loading;
|
}
|
}));
|
this.addEventListener("webcab-enable-disable-button-toggle", (event_) => __awaiter(this, void 0, void 0, function* () {
|
if (event_.detail) {
|
const instances = Object.keys(event_.detail);
|
const uidata = this.breakDownUiData(event_.detail);
|
for (const instance of instances) {
|
const instanceIdent = parseInt(instance);
|
this.setElementUiComponents(instanceIdent, uidata[instanceIdent], true);
|
}
|
this.requestUpdate();
|
}
|
}));
|
this.addEventListener("webcabpopupchange", (event) => {
|
if (event.detail && event.detail.open != undefined && event.detail.element != undefined && event.detail.element.componentData != undefined && event.detail.element.componentData.change != undefined) {
|
const xGroupId = event.detail.element.componentData.change.xGroupId;
|
const xInGroupId = event.detail.element.componentData.change.xInGroupId;
|
const zSpaceId = event.detail.element.componentData.change.zSpaceId;
|
if (xGroupId != undefined && xInGroupId != undefined) {
|
const zSpaceOpenId = zSpaceId != undefined ? "-" + zSpaceId.toFixed(0) : "";
|
const openedId = xGroupId.toFixed(0) + "-" + xInGroupId.toFixed(0) + zSpaceOpenId;
|
if (event.detail.open) {
|
if (!this.openedPopups.includes(openedId)) {
|
this.openedPopups.push(openedId);
|
}
|
}
|
else {
|
const index = this.openedPopups.indexOf(openedId);
|
if (index != -1) {
|
this.openedPopups.splice(index, 1);
|
}
|
}
|
}
|
}
|
});
|
EventFactoryService.SendEvent.register((eventId_) => {
|
if (this.loading)
|
return; // skip if already loading
|
if (this.shown == false)
|
return; // prevent if not shown
|
switch (eventId_) {
|
case 914472533:
|
case 451786:
|
this.updateArticles();
|
break;
|
}
|
});
|
EventFactoryService.LastPOLoaded.register(() => {
|
if (this.loading)
|
return; // skip if already loading
|
if (this.shown == false)
|
return; // prevent if not shown
|
this.updateArticles();
|
});
|
}
|
render() {
|
let exportparts = "element-ui";
|
for (const ui of this.webcabuis) {
|
exportparts += ",nr-" + ui.index;
|
}
|
this.setAttribute("exportparts", exportparts);
|
this.applyReplacersToSlots();
|
return x `
|
<slot name="above"></slot>
|
${this.webcabuis.map((webcabui) => x `
|
<div class="element-ui nr-${webcabui.index}" part="element-ui nr-${webcabui.index}" instance-ident="${webcabui["instance-ident"]}" ui-index="${webcabui.index}">
|
${document.createRange().createContextualFragment(this.getObjectUiTemplate(this.getTemplate(webcabui), webcabui.index, this.webcabuis.length, webcabui["instance-ident"]))}
|
</div>
|
`)}
|
`;
|
}
|
updated(_changedProperties) {
|
super.updated(_changedProperties);
|
this.postUpdateEventPromise = this.postUpdateEvent();
|
}
|
postUpdateEvent() {
|
return __awaiter(this, void 0, void 0, function* () {
|
this.loading = true;
|
yield this.updateElementUIs();
|
if (!this.updateEventActive) {
|
this.updateEventActive = true;
|
this.dispatchEvent(new WebCabUiRenderedEvent());
|
this.updateEventActive = false;
|
}
|
this.loading = false;
|
});
|
}
|
createZSplittingTemplate(component, internalIndex) {
|
const zSplittingUi = component["z-splitting-ui"];
|
if (zSplittingUi == undefined || zSplittingUi.length < 1)
|
return "";
|
let result = "";
|
for (let zSplittingIndex = 0; zSplittingIndex < zSplittingUi.length; ++zSplittingIndex) {
|
const inputComponent = zSplittingUi[zSplittingIndex];
|
if (inputComponent == undefined)
|
continue;
|
const dataAttributes = inputComponent["data-attributes"];
|
if (dataAttributes == undefined)
|
continue;
|
if (dataAttributes.type == "intInput") {
|
result += "<fv-webcab-value-input part=\"webcab-input z-splitting-count-input\" class=\"webcab-input z-splitting-count-input\" component-name=\"" + inputComponent.name + "\">";
|
result += "<label slot=\"label\" i18n=\"webcab.item.count.input.label\" part=\"webcab-input-label\"></label>";
|
result += "<label slot=\"increase-button\" part=\"toggle-indecrease-container\"><div part=\"toggle-increase-button\"><div part=\"toggle-increase-button-horizontal-container\"><div part=\"toggle-increase-button-horizontal\"></div></div><div part=\"toggle-increase-button-vertical-container\"><div part=\"toggle-increase-button-vertical\"></div></div></div></label>";
|
result += "<label slot=\"decrease-button\" part=\"toggle-indecrease-container\"><div part=\"toggle-decrease-button\"></div></label>";
|
result += "</fv-webcab-value-input>";
|
}
|
else if (dataAttributes.type == "floatInput") {
|
result += "<fv-webcab-value-input part=\"webcab-input z-splitting-height-input\" class=\"webcab-input z-splitting-height-input\" component-name=\"" + inputComponent.name + "\">";
|
result += "<label slot=\"label\" part=\"webcab-input-label\"><label i18n=\"webcab.height.input.label\"></label> " + (zSplittingIndex).toFixed(0) + ":</label>";
|
result += "<label slot=\"increase-button\" part=\"toggle-indecrease-container\"><div part=\"toggle-increase-button\"><div part=\"toggle-increase-button-horizontal-container\"><div part=\"toggle-increase-button-horizontal\"></div></div><div part=\"toggle-increase-button-vertical-container\"><div part=\"toggle-increase-button-vertical\"></div></div></div></label>";
|
result += "<label slot=\"decrease-button\" part=\"toggle-indecrease-container\"><div part=\"toggle-decrease-button\"></div></label>";
|
result += "</fv-webcab-value-input>";
|
}
|
if (inputComponent["content-option-selection-ui"] != undefined) {
|
const contentOptionSelectionTemplate = this.querySelector(this.settings["content-option-selection-template-selector"]);
|
const contentOptionSelectionUi = inputComponent["content-option-selection-ui"];
|
if (contentOptionSelectionUi && contentOptionSelectionTemplate && contentOptionSelectionTemplate.innerHTML.length > 0) {
|
let contentOptionSelectionsTemplates = "";
|
for (const optionSelection of contentOptionSelectionUi) {
|
let optionSelectionTemplate = contentOptionSelectionTemplate.innerHTML;
|
let optionSelectionPieces = optionSelectionTemplate.split("|internal-index|");
|
optionSelectionTemplate = optionSelectionPieces.join("-" + optionSelection.name + internalIndex.toFixed(0));
|
optionSelectionPieces = optionSelectionTemplate.split("|content-option-selection-component-name|");
|
optionSelectionTemplate = optionSelectionPieces.join(inputComponent.name + "-" + optionSelection.name);
|
optionSelectionPieces = optionSelectionTemplate.split("|content-option-selection-class|");
|
optionSelectionTemplate = optionSelectionPieces.join("z-splitting-content-option-selection");
|
contentOptionSelectionsTemplates += optionSelectionTemplate;
|
}
|
result += contentOptionSelectionsTemplates;
|
}
|
}
|
}
|
return result;
|
}
|
pushElementControlsToTemplate(instanceIdent_, template_) {
|
const elementControlsTemplate = this.querySelector(this.settings["element-controls-template-selector"]);
|
if (!elementControlsTemplate)
|
return template_;
|
if (elementControlsTemplate.innerHTML.length < 1)
|
return template_;
|
const contentOptionSelectionTemplate = this.querySelector(this.settings["content-option-selection-template-selector"]);
|
const templatePieces = template_.split("|element-controls|");
|
let index = 0;
|
let elementControlsTemplates = "";
|
const components = this._elementControlsComponents[instanceIdent_];
|
if (components) {
|
const names = Object.keys(components);
|
for (const name of names) {
|
const component = components[name];
|
if (component) {
|
let template = elementControlsTemplate.innerHTML;
|
let pieces = template.split("|component-name|");
|
template = pieces.join(name);
|
const internalIndex = index;
|
pieces = template.split("|index|");
|
template = pieces.join((++index).toFixed(0));
|
const contentOptionSelectionUi = component["content-option-selection-ui"];
|
if (contentOptionSelectionUi && contentOptionSelectionTemplate && contentOptionSelectionTemplate.innerHTML.length > 0) {
|
pieces = template.split("|content-option-selection|");
|
let contentOptionSelectionsTemplates = "";
|
for (const optionSelection of contentOptionSelectionUi) {
|
let optionSelectionTemplate = contentOptionSelectionTemplate.innerHTML;
|
let optionSelectionPieces = optionSelectionTemplate.split("|internal-index|");
|
optionSelectionTemplate = optionSelectionPieces.join("-" + optionSelection.name + internalIndex.toFixed(0));
|
optionSelectionPieces = optionSelectionTemplate.split("|content-option-selection-component-name|");
|
optionSelectionTemplate = optionSelectionPieces.join(component.name + "-" + optionSelection.name);
|
optionSelectionPieces = optionSelectionTemplate.split("|content-option-selection-class|");
|
optionSelectionTemplate = optionSelectionPieces.join("");
|
contentOptionSelectionsTemplates += optionSelectionTemplate;
|
}
|
template = pieces.join(contentOptionSelectionsTemplates);
|
}
|
else {
|
pieces = template.split("|content-option-selection|");
|
template = pieces.join("");
|
}
|
pieces = template.split("|z-splitting-ui|");
|
const zSplittingTemplate = this.createZSplittingTemplate(component, internalIndex);
|
template = pieces.join(zSplittingTemplate);
|
elementControlsTemplates += template;
|
}
|
}
|
template_ = templatePieces.join(elementControlsTemplates);
|
}
|
return template_;
|
}
|
applyGeneralReplacers(template_) {
|
const genaralReplacers = Object.keys(this.settings.replacers.general);
|
for (const replacer of genaralReplacers) {
|
const pieces = template_.split(replacer);
|
template_ = pieces.join(this.settings.replacers.general[replacer]);
|
}
|
return template_;
|
}
|
applyReplacersToSlots() {
|
const slots = this.querySelectorAll("[slot]");
|
slots.forEach((slot) => {
|
this.applyReplacersToSlot(slot);
|
});
|
}
|
applyReplacersToSlot(slot_) {
|
let replacedSlot = this.applyGeneralReplacers(slot_.innerHTML);
|
this.webcabuis.map((webcabui) => {
|
const replacersKey = webcabui.index.toFixed(0) + "_" + this.webcabuis.length.toFixed(0);
|
const replacers = this.settings.replacers["by-object-ui"][replacersKey];
|
if (replacers) {
|
const replacerKeys = Object.keys(replacers);
|
for (const key of replacerKeys) {
|
const pieces = replacedSlot.split(key);
|
replacedSlot = pieces.join(replacers[key]);
|
}
|
}
|
});
|
slot_.innerHTML = replacedSlot;
|
}
|
getObjectUiTemplate(baseTemplate_, index_, totalUiAmount, instanceIdent_) {
|
if (baseTemplate_.length < 1) {
|
console.error("webcab-ui: render failed! template not found!");
|
return "";
|
}
|
const replacersKey = index_.toFixed(0) + "_" + totalUiAmount.toFixed(0);
|
const replacers = this.settings.replacers["by-object-ui"][replacersKey];
|
if (replacers) {
|
const replacerKeys = Object.keys(replacers);
|
for (const key of replacerKeys) {
|
const pieces = baseTemplate_.split(key);
|
baseTemplate_ = pieces.join(replacers[key]);
|
}
|
}
|
const pieces = baseTemplate_.split("|index|");
|
baseTemplate_ = pieces.join((index_ + 1).toFixed(0));
|
this.dispatchEvent(new WebCabTemplateReplaceEvent(baseTemplate_, this, index_));
|
baseTemplate_ = this.TemplateReplaceEventResult ? this.TemplateReplaceEventResult : baseTemplate_;
|
this.TemplateReplaceEventResult = undefined;
|
baseTemplate_ = this.pushElementControlsToTemplate(instanceIdent_, baseTemplate_);
|
return baseTemplate_;
|
}
|
updateElementUIs() {
|
return __awaiter(this, void 0, void 0, function* () {
|
const elementuis = this.renderRoot.querySelectorAll(".element-ui");
|
if (elementuis) {
|
for (let index = 0; index < elementuis.length; ++index) {
|
yield this.updateComponentElements(elementuis.item(index));
|
}
|
}
|
});
|
}
|
getElementAttribute(element_, name_) {
|
if (element_.hasAttribute(name_)) {
|
const attribute = element_.getAttribute(name_);
|
if (attribute) {
|
return attribute;
|
}
|
}
|
return "";
|
}
|
ArrangeEquallyButtonClick(element_, click_) {
|
return __awaiter(this, void 0, void 0, function* () {
|
this.loading = true;
|
if (click_ && click_.GroupID) {
|
const instanceIdent = parseInt(this.getElementAttribute(element_, "instance-ident"));
|
const customerType = this.settings["object-ui-settings"]["customer-type"];
|
const brokenDownResult = this.breakDownUiData(yield WebCabApi.ArrangeEqually(customerType, [click_.GroupID], this.settings["object-ui-settings"]["config-suffix"], [instanceIdent]));
|
this._components[instanceIdent] = brokenDownResult[instanceIdent];
|
}
|
this.loading = false;
|
yield this.updateArticles(); //this._components
|
});
|
}
|
static getComponentFromArray(components_, name_) {
|
let componentData = undefined;
|
for (const component of components_) {
|
if (component.name === name_) {
|
componentData = component;
|
break;
|
}
|
if (component.components) {
|
componentData = this.getComponentFromArray(component.components, name_);
|
if (componentData)
|
break;
|
}
|
}
|
return componentData;
|
}
|
static getComponent(components_, name_) {
|
if (components_[name_])
|
return components_[name_];
|
const names = Object.keys(components_);
|
for (const name of names) {
|
const component = components_[name];
|
if (component && component.components) {
|
const componentFromArray = this.getComponentFromArray(component.components, name_);
|
if (componentFromArray) {
|
return componentFromArray;
|
}
|
}
|
}
|
return undefined;
|
}
|
static getComponentFromContentOptionSelection(components_, name_, parent_) {
|
for (const component of components_) {
|
if (component.name == name_) {
|
return component;
|
}
|
if (parent_ && (parent_.name + "-" + component.name) == name_) {
|
return component;
|
}
|
if (component.components) {
|
const subComponentsResult = this.getComponentFromContentOptionSelection(component.components, name_, component);
|
if (subComponentsResult != undefined)
|
return subComponentsResult;
|
}
|
if (component["content-option-selection-ui"]) {
|
const subComponentsResult = this.getComponentFromContentOptionSelection(component["content-option-selection-ui"], name_, component);
|
if (subComponentsResult != undefined)
|
return subComponentsResult;
|
}
|
if (component["z-splitting-ui"]) {
|
const subComponentsResult = this.getComponentFromContentOptionSelection(component["z-splitting-ui"], name_, component);
|
if (subComponentsResult != undefined)
|
return subComponentsResult;
|
}
|
}
|
return undefined;
|
}
|
static getComponentFromZSplitting(components_, name_, parent_) {
|
for (const component of components_) {
|
if (component.name == name_) {
|
return component;
|
}
|
if (parent_ && (parent_.name + "-" + component.name) == name_) {
|
return component;
|
}
|
if (component.components) {
|
const subComponentsResult = this.getComponentFromZSplitting(component.components, name_, component);
|
if (subComponentsResult != undefined)
|
return subComponentsResult;
|
}
|
if (component["z-splitting-ui"]) {
|
const subComponentsResult = this.getComponentFromZSplitting(component["z-splitting-ui"], name_, component);
|
if (subComponentsResult != undefined)
|
return subComponentsResult;
|
}
|
}
|
return undefined;
|
}
|
static getComponentForElement(components_, componentName) {
|
let component = WebCabUiComponent_1.getComponent(components_, componentName);
|
if (component == undefined) {
|
const componentsArray = [];
|
const names = Object.keys(components_);
|
for (const name of names) {
|
componentsArray.push(components_[name]);
|
}
|
component = WebCabUiComponent_1.getComponentFromContentOptionSelection(componentsArray, componentName);
|
if (component == undefined) {
|
component = WebCabUiComponent_1.getComponentFromZSplitting(componentsArray, componentName);
|
}
|
}
|
if (component == undefined) {
|
console.warn("no component found!", componentName, components_);
|
}
|
return component;
|
}
|
static updateComponentElement(components_, element_, instanceIdent_, settings_, arrangeEquallyEvent_) {
|
return __awaiter(this, void 0, void 0, function* () {
|
if (!element_)
|
return;
|
const componentName = element_.getAttribute("component-name");
|
if (!componentName || componentName.length < 1)
|
return;
|
const component = this.getComponentForElement(components_, componentName);
|
if (component == undefined) {
|
element_.classList.add("hidden");
|
return;
|
}
|
element_.classList.remove("hidden");
|
element_.setAttribute("instance-ident", instanceIdent_.toFixed(0));
|
const dataAttributes = component["data-attributes"];
|
let fractionDigits = 0;
|
if (dataAttributes && dataAttributes.type && dataAttributes.type == "floatInput") {
|
fractionDigits = settings_["object-ui-settings"]["fraction-digits"];
|
}
|
element_.setAttribute("name", componentName);
|
if (component.attributes) {
|
if (component.attributes.value && component.attributes.value.toFixed) {
|
element_.setAttribute("value", component.attributes.value.toFixed(fractionDigits));
|
}
|
if (component.attributes.min && component.attributes.min.toFixed) {
|
element_.setAttribute("min-value", component.attributes.min.toFixed(fractionDigits));
|
}
|
if (component.attributes.max && component.attributes.max.toFixed) {
|
element_.setAttribute("max-value", component.attributes.max.toFixed(fractionDigits));
|
}
|
if (component.attributes["unit-txt"] != undefined) {
|
element_.setAttribute("unit-txt", component.attributes["unit-txt"] == "" ? "error" : component.attributes["unit-txt"]);
|
}
|
if (component.attributes["dim-scale"]) {
|
element_.setAttribute("dim-scale", component.attributes["dim-scale"].toString());
|
}
|
}
|
if (component.change) {
|
element_.setAttribute("modification-targets", JSON.stringify(component.change.ModificationTargets));
|
if (component.change.GroupID) {
|
element_.setAttribute("group-id", component.change.GroupID);
|
}
|
else if (component.change.ZSplittingXGroupId) {
|
element_.setAttribute("group-id", component.change.ZSplittingXGroupId);
|
}
|
if (component.change.InGroupID) {
|
element_.setAttribute("in-group-id", component.change.InGroupID);
|
}
|
else if (component.change.ZSplittingXInGroupId) {
|
element_.setAttribute("in-group-id", component.change.ZSplittingXInGroupId);
|
}
|
if (component.change.ZSplittingZSpaceIndex) {
|
element_.setAttribute("z-space-id", component.change.ZSplittingZSpaceIndex);
|
}
|
}
|
if (element_ && element_ instanceof WebCabDisplayOptionSelectionComponent) {
|
element_.componentData = component;
|
element_.customerType = settings_["object-ui-settings"]["customer-type"];
|
element_.configSuffix = settings_["object-ui-settings"]["config-suffix"];
|
}
|
if (dataAttributes) {
|
if (dataAttributes.type == "floatInput") {
|
const input = element_;
|
input.addEventListener("webcab-value-input-changed", () => __awaiter(this, void 0, void 0, function* () {
|
if (component.change && component.change.ZSplittingXGroupId && component.change.ZSplittingXInGroupId) {
|
yield input.ModifyZSplitting(false, component.change.ZSplittingZSpaceIndex != undefined);
|
return;
|
}
|
if (component.change && component.change.GroupID && component.change.InGroupID) {
|
yield input.ModifySingleSpace();
|
return;
|
}
|
yield input.ModifyFloatValue();
|
}));
|
input.increment = dataAttributes.step;
|
input.fractionDigits = fractionDigits;
|
input.timeoutms = settings_["object-ui-settings"]["input-buttons-timeout-ms"];
|
input.customerType = settings_["object-ui-settings"]["customer-type"];
|
input.configSuffix = settings_["object-ui-settings"]["config-suffix"];
|
}
|
else if (dataAttributes.type == "intInput") {
|
const input = element_;
|
input.addEventListener("webcab-value-input-changed", () => {
|
if (component.change && component.change.ZSplittingXGroupId && component.change.ZSplittingXInGroupId) {
|
input.ModifyZSplitting(false, component.change.ZSplittingZSpaceIndex != undefined);
|
return;
|
}
|
input.ChangeCount();
|
});
|
input.increment = dataAttributes.step;
|
input.timeoutms = settings_["object-ui-settings"]["input-buttons-timeout-ms"];
|
input.customerType = settings_["object-ui-settings"]["customer-type"];
|
input.configSuffix = settings_["object-ui-settings"]["config-suffix"];
|
}
|
else if (dataAttributes.type == "command") {
|
if (component.click) {
|
if (component.click.WebCabCommand == "ArrangeEqually") {
|
element_.addEventListener("click", () => __awaiter(this, void 0, void 0, function* () {
|
yield arrangeEquallyEvent_(element_, component.click);
|
}));
|
}
|
else if (component.click.WebCabCommand == "EnableWebCabs" || component.click.WebCabCommand == "DisableWebCabs") {
|
const button = element_;
|
button.clickDetails = component.click;
|
}
|
}
|
}
|
}
|
});
|
}
|
updateComponentElements(elementUi_) {
|
return __awaiter(this, void 0, void 0, function* () {
|
const instanceIdent = parseInt(this.getElementAttribute(elementUi_, "instance-ident"));
|
if (this._components[instanceIdent]) {
|
const elemets = new Array();
|
this.getComponentElements(elemets, elementUi_);
|
if (elemets.length > 0) {
|
for (let index = 0; index < elemets.length; ++index) {
|
const element = elemets[index];
|
if (element) {
|
yield WebCabUiComponent_1.updateComponentElement(this._components[instanceIdent].data, element, instanceIdent, this.settings, (element_, click_) => __awaiter(this, void 0, void 0, function* () {
|
yield this.ArrangeEquallyButtonClick(element_, click_);
|
}));
|
if (element && element instanceof WebCabDisplayOptionSelectionComponent && element.componentData != undefined && element.componentData.change != undefined) {
|
const xGroupId = element.componentData.change.xGroupId;
|
const xInGroupId = element.componentData.change.xInGroupId;
|
const zSpaceId = element.componentData.change.zSpaceId;
|
if (xGroupId != undefined && xInGroupId != undefined) {
|
const zSpaceOpenId = zSpaceId != undefined ? "-" + zSpaceId.toFixed(0) : "";
|
const openedId = xGroupId.toFixed(0) + "-" + xInGroupId.toFixed(0) + zSpaceOpenId;
|
element.open = this.openedPopups.includes(openedId);
|
}
|
}
|
}
|
}
|
}
|
}
|
});
|
}
|
updateArticles( /*uidata_?: WebCabUiDataList | undefined*/) {
|
return __awaiter(this, void 0, void 0, function* () {
|
this.loading = true;
|
if (this.updatePromise != undefined) {
|
yield this.updatePromise;
|
}
|
this.updatePromise = this.ReadUiData();
|
const uidata = yield this.updatePromise;
|
// let uidata = uidata_;
|
// if (uidata == undefined) {
|
// uidata = await this.ReadUiData();
|
// }
|
let index = 0;
|
this.webcabuis = [];
|
this._components = {};
|
this._elementControlsComponents = {};
|
const instanceIdents = Object.keys(uidata);
|
for (const instanceIdentString of instanceIdents) {
|
const instanceIdent = parseInt(instanceIdentString);
|
this.webcabuis.push({
|
index: index++,
|
"instance-ident": instanceIdent,
|
disabled: uidata[instanceIdent].disabled
|
});
|
this.setElementUiComponents(instanceIdent, uidata[instanceIdent], true);
|
}
|
this.requestUpdate();
|
yield this.updateComplete;
|
if (this.postUpdateEventPromise != undefined) {
|
yield this.postUpdateEventPromise;
|
this.postUpdateEventPromise = undefined;
|
}
|
this.updatePromise = undefined;
|
});
|
}
|
show(uidata_) {
|
return __awaiter(this, void 0, void 0, function* () {
|
if (!this.showing) {
|
this.showing = true;
|
yield this.updateArticles(); //uidata_
|
this.shown = true;
|
this.showing = false;
|
}
|
});
|
}
|
getObjectUiIndex(value_) {
|
const attribute = value_.getAttribute("ui-index");
|
if (attribute) {
|
return parseInt(attribute);
|
}
|
return -1;
|
}
|
EachObjectUi(callback_) {
|
const objects = this.renderRoot.querySelectorAll(".element-ui");
|
objects.forEach((value) => {
|
callback_(value, this.getObjectUiIndex(value));
|
});
|
}
|
getFirstObjectUi() {
|
const objects = this.renderRoot.querySelectorAll(".element-ui");
|
if (objects.length > 0) {
|
return objects.item(0);
|
}
|
return undefined;
|
}
|
getComponentElements(list, curr) {
|
if (curr.hasAttribute("component-name")) {
|
list.push(curr);
|
}
|
for (let index = 0; index < curr.children.length; ++index) {
|
const item = curr.children.item(index);
|
if (item) {
|
this.getComponentElements(list, item);
|
}
|
}
|
}
|
breakDownUiData(uidata_) {
|
const instanceIdents = Object.keys(uidata_);
|
const ret = {};
|
for (const instanceIdentString of instanceIdents) {
|
const instanceIdent = parseInt(instanceIdentString);
|
const data = uidata_[instanceIdent];
|
if (data != undefined && data.components != undefined) {
|
const components = data.components;
|
ret[instanceIdent] = { data: {}, disabled: uidata_[instanceIdent].disabled };
|
for (const component of components) {
|
if (component.name) {
|
ret[instanceIdent].data[component.name] = component;
|
}
|
}
|
}
|
}
|
return ret;
|
}
|
ReadUiData() {
|
return __awaiter(this, void 0, void 0, function* () {
|
const data = yield WebCabApi.GetUIs(this.settings["object-ui-settings"]["customer-type"], this.settings["object-ui-settings"]["config-suffix"]);
|
return this.breakDownUiData(data);
|
});
|
}
|
ModifyFloatValueAllInstances(modificationTargets_, value_) {
|
return __awaiter(this, void 0, void 0, function* () {
|
const modifications = [];
|
for (const target of modificationTargets_) {
|
modifications.push({
|
target: target,
|
value: (value_ * 10.0).toFixed(2)
|
});
|
}
|
const uidata = yield WebCabApi.ModifyValues(this.settings["object-ui-settings"]["customer-type"], modifications, this.settings["object-ui-settings"]["config-suffix"]);
|
return this.breakDownUiData(uidata);
|
});
|
}
|
SetDisableDimensionVisuals(value_, instanceIdentFilter_) {
|
return __awaiter(this, void 0, void 0, function* () {
|
yield WebCabApi.SetDisableDimensionVisuals(this.settings["object-ui-settings"]["customer-type"], value_ ? 1 : 0, this.settings["object-ui-settings"]["config-suffix"], instanceIdentFilter_);
|
});
|
}
|
GetDisableDimensionVisuals(instanceIdentFilter_) {
|
return __awaiter(this, void 0, void 0, function* () {
|
const disableDimensionVisuals = yield WebCabApi.GetDisableDimensionVisuals(this.settings["object-ui-settings"]["customer-type"], this.settings["object-ui-settings"]["config-suffix"], instanceIdentFilter_);
|
return disableDimensionVisuals;
|
});
|
}
|
};
|
WebCabUiComponent.styles = [
|
(void 0).styles || [],
|
i `${r(css_248z)}`
|
];
|
__decorate([
|
n({ attribute: false })
|
], WebCabUiComponent.prototype, "webcabuis", void 0);
|
__decorate([
|
n({ type: Object, attribute: true })
|
], WebCabUiComponent.prototype, "settings", void 0);
|
__decorate([
|
n({ type: String, reflect: true, attribute: "object-ui-exportparts" })
|
], WebCabUiComponent.prototype, "objectUiExportparts", void 0);
|
__decorate([
|
n({ type: Boolean, reflect: true }),
|
n({ type: Boolean, reflect: true })
|
], WebCabUiComponent.prototype, "dimmed", void 0);
|
__decorate([
|
n({ type: String, reflect: true, attribute: "template-replace-event-result" })
|
], WebCabUiComponent.prototype, "TemplateReplaceEventResult", void 0);
|
WebCabUiComponent = WebCabUiComponent_1 = __decorate([
|
e("fv-webcab-ui")
|
], WebCabUiComponent);
|
class WebCabUiRenderedEvent extends CustomEvent {
|
constructor() {
|
super("webcab-ui-rendered", { detail: {}, bubbles: true, composed: true });
|
}
|
}
|
|
class WebCabSelectionChangeEvent extends CustomEvent {
|
constructor(option, element, uidata) {
|
super("webcabselectionchange", {
|
bubbles: true,
|
composed: true,
|
detail: { option: option, element: element, uidata: uidata }
|
});
|
}
|
}
|
class WebCabPopUpChangeEvent extends CustomEvent {
|
constructor(open, element) {
|
super("webcabpopupchange", {
|
bubbles: true,
|
composed: true,
|
detail: { open: open, element: element }
|
});
|
}
|
}
|
let WebCabDisplayOptionSelectionComponent = class WebCabDisplayOptionSelectionComponent extends BaseElement {
|
constructor() {
|
super();
|
this.componentData = { name: "" };
|
this.maxAmountSelectByButtons = 3;
|
this.customerType = "";
|
this.configSuffix = "";
|
this.instanceIdent = -1;
|
this.open = false;
|
this.selected = undefined;
|
this.addEventListener("selectionchange", (event) => {
|
if (event.detail && event.detail.option) {
|
this.dispatchEvent(new WebCabChangeLoadingEvent(true));
|
this.selectOption(JSON.parse(event.detail.option.replaceAll("\\\"", "\""))).then((result) => {
|
if (result == undefined || event.detail == undefined || event.detail.option == undefined || event.detail.element == undefined)
|
return;
|
this.dispatchEvent(new WebCabSelectionChangeEvent(event.detail.option, event.detail.element, result));
|
this.dispatchEvent(new WebCabChangeLoadingEvent(false));
|
});
|
}
|
});
|
this.addEventListener("popupchange", (event) => {
|
if (event.detail && event.detail.open != undefined) {
|
this.dispatchEvent(new WebCabPopUpChangeEvent(event.detail.open, this));
|
}
|
});
|
}
|
selectOption(component) {
|
return __awaiter(this, void 0, void 0, function* () {
|
if (component.click == undefined || component.click.xGroupId == undefined || component.click.xInGroupId == undefined)
|
return undefined;
|
this.selected = component;
|
const modifications = [];
|
for (const target of component.click.ModificationTargets) {
|
const modification = {
|
target: target,
|
value: component.click.value,
|
additional: ""
|
};
|
const additional = {
|
xGroupId: component.click.xGroupId,
|
xInGroupId: component.click.xInGroupId,
|
definition: this.componentData.name
|
};
|
if (component.click.zSpaceId != undefined)
|
additional.zSpaceId = component.click.zSpaceId;
|
modification.additional = JSON.stringify(additional);
|
modifications.push(modification);
|
}
|
return yield WebCabApi.ModifyValues(this.customerType, modifications, this.configSuffix, [this.instanceIdent]);
|
});
|
}
|
createOption(component) {
|
return x `<fv-select-option class="option" option="${JSON.stringify(component).replaceAll("\"", "\\\"")}" display-value="${LocalesModel.translate(component.name, component.name)}">${LocalesModel.translate(component.name, component.name)}</fv-select-option>`;
|
}
|
createOptions(components) {
|
const result = new Array();
|
for (const component of components) {
|
result.push(this.createOption(component));
|
}
|
return result;
|
}
|
render() {
|
if (this.componentData.components == undefined)
|
return x `<div>ERROR!! ${this.componentData.name} - does not define any display options!</div>`;
|
const currentValue = this.componentData.attributes ? this.componentData.attributes.value : "";
|
const selectedComponent = this.componentData.components.find((value) => {
|
return value.name === currentValue;
|
});
|
if (this.selected != selectedComponent) {
|
this.selected = selectedComponent;
|
}
|
const selected = selectedComponent != undefined ? JSON.stringify(selectedComponent).replaceAll("\"", "\\\"") : "";
|
if (this.componentData.components.length <= this.maxAmountSelectByButtons) {
|
this.classList.add("select-by-buttons");
|
}
|
else {
|
this.classList.remove("select-by-buttons");
|
}
|
return x `
|
<fv-select class="container" max-amount-select-by-buttons="${this.maxAmountSelectByButtons}" i18n-placeholder="your_selection" selected="${selected}" selected-display-value="${selectedComponent ? LocalesModel.translate(selectedComponent.name, selectedComponent.name) : ""}" ?open="${this.open}">
|
${this.createOptions(this.componentData.components)}
|
</fv-select>
|
`;
|
}
|
};
|
WebCabDisplayOptionSelectionComponent.styles = [
|
(void 0).styles || [],
|
i `${r(css_248z$1)}`
|
];
|
__decorate([
|
n({ type: Object, reflect: true, attribute: "component-data" })
|
], WebCabDisplayOptionSelectionComponent.prototype, "componentData", void 0);
|
__decorate([
|
n({ type: Number, reflect: true, attribute: "max-amount-select-by-buttons" })
|
], WebCabDisplayOptionSelectionComponent.prototype, "maxAmountSelectByButtons", void 0);
|
__decorate([
|
n({ type: String, reflect: true, attribute: "customer-type" })
|
], WebCabDisplayOptionSelectionComponent.prototype, "customerType", void 0);
|
__decorate([
|
n({ type: String, reflect: true, attribute: "config-suffix" })
|
], WebCabDisplayOptionSelectionComponent.prototype, "configSuffix", void 0);
|
__decorate([
|
n({ type: Number, reflect: true, attribute: "instance-ident" })
|
], WebCabDisplayOptionSelectionComponent.prototype, "instanceIdent", void 0);
|
__decorate([
|
n({ type: Boolean, reflect: true, attribute: "open" })
|
], WebCabDisplayOptionSelectionComponent.prototype, "open", void 0);
|
__decorate([
|
n({ type: Object, reflect: true, attribute: "selected" })
|
], WebCabDisplayOptionSelectionComponent.prototype, "selected", void 0);
|
WebCabDisplayOptionSelectionComponent = __decorate([
|
e("fv-webcab-display-option-selection")
|
], WebCabDisplayOptionSelectionComponent);
|
|
export { WebCabUiComponent as W, WebCabChangeLoadingEvent as a, WebCabTemplateReplaceEvent as b, WebCabUiRenderedEvent as c, WebCabDisplayOptionSelectionComponent as d };
|