import { x } from './query-assigned-elements-fea1f631.js';
|
import { e } from './custom-element-30fc6381.js';
|
import { n, B as BaseElement, C as ComponentService } from './base.component-813fc7cf.js';
|
import { E as EventHandlerService } from './modal.component-7c440789.js';
|
import { FilteredCatalogComponent } from './filtered-catalog.component.js';
|
import '@dh-software/furnview-icons';
|
import './class-map-a0fb5d87.js';
|
import './event.handler.model.js';
|
import './loading.component.js';
|
import './dimmer.component.js';
|
import './query-1c86d710.js';
|
import './dot-flashing-loader.component.js';
|
import './rotating-dots-loader.component.js';
|
import './key-frame-effect.service.js';
|
import './card.data.service.js';
|
import './card-container-definitions.js';
|
import './card-container-events.js';
|
import './card-data-service-update-events.js';
|
import './toolbar.component.js';
|
import './toggle-toolbar.component.js';
|
import './style.helper.js';
|
import './image.service.js';
|
import './svg-icon.component.js';
|
import './popup.component.js';
|
import './popup-closer.component.js';
|
import './hr-item.component.js';
|
import './hr-list.component.js';
|
import './query-all-828de4b2.js';
|
import './hr-theme.model.js';
|
import './configurator.form.component.js';
|
import './configurator.form.base.element.component.js';
|
import './scene-helper.service.js';
|
import './async.base.component.js';
|
import './card-container-settings.js';
|
import './card-container-states.js';
|
import './card-container-additional-data.js';
|
import './card-containers-shared-data.js';
|
import './input.mask.component.js';
|
import './mask.component.js';
|
import './information.mask.component.js';
|
import './open-cloud-id.mask.component.js';
|
import './share-link-per-mail.component.js';
|
import './request-appointment.component.js';
|
import './prog-property.model.js';
|
import './interface.js';
|
import './reset.mask.component.js';
|
import './configuration.service.js';
|
import './step-based.mask.component.js';
|
import './container-mask.component.js';
|
import './messageNoCalc.mask.component.js';
|
import './button.component.js';
|
import './iwoFurn.mask.component.js';
|
import './input.component.js';
|
import './base-input.js';
|
import './save-dialog.mask.component.js';
|
import './cloud-id.service.js';
|
import './send-offer-request-mask.component.js';
|
import './file-upload-mask.component.js';
|
import './label.component.js';
|
import './sass.default-1ca9b57f.js';
|
import './accordion.component.js';
|
import './accordion-item.component.js';
|
import './accordion-layer.component.js';
|
import './slider.component.js';
|
import './equipment-list.component.js';
|
import './state-7ee0cf4f.js';
|
import './confirming-button.component.js';
|
import './fitting-item.component.js';
|
import './proptrans-item.component.js';
|
import './shoppingcart-item.component.js';
|
import './prog-context.model.js';
|
import './manu-prog.service.js';
|
import './catalog.service.js';
|
import './step-child.component.js';
|
import './clock.controller.js';
|
import './defer-helper.class.js';
|
import './dimension-helper.class.js';
|
|
var __defProp = Object.defineProperty;
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
var __getProtoOf = Object.getPrototypeOf;
|
var __reflectGet = Reflect.get;
|
var __decorateClass = (decorators, target, key, kind) => {
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
if (decorator = decorators[i])
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
if (kind && result)
|
__defProp(target, key, result);
|
return result;
|
};
|
var __superStaticGet = (obj, member) => __reflectGet(__getProtoOf(obj), member, obj);
|
var __async = (__this, __arguments, generator) => {
|
return new Promise((resolve, reject) => {
|
var fulfilled = (value) => {
|
try {
|
step(generator.next(value));
|
} catch (e) {
|
reject(e);
|
}
|
};
|
var rejected = (value) => {
|
try {
|
step(generator.throw(value));
|
} catch (e) {
|
reject(e);
|
}
|
};
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
step((generator = generator.apply(__this, __arguments)).next());
|
});
|
};
|
let FilteredCatalogToggleButtonComponent = class extends BaseElement {
|
constructor() {
|
super();
|
this.buttonClasses = [];
|
this.buttonAttributes = [];
|
this.textOverwrite = "";
|
this.selector = "";
|
this.noValuesTxtId = "";
|
this.anyTargetsHidden = false;
|
this.propertyNames = [];
|
this.addEventListener("click", (e) => {
|
if (this.buttonAttributes.includes("disabled") || this.buttonClasses.includes("disabled")) {
|
e.preventDefault();
|
e.stopPropagation();
|
return;
|
}
|
EventHandlerService.dispatch("toggle-classes", {
|
components: [{ name: "fv-filtered-catalog", selector: this.selector }],
|
classes: ["hidden"]
|
});
|
this.readTargetHiddenState();
|
});
|
this.init();
|
}
|
readTargetHiddenState() {
|
this.anyTargetsHidden = false;
|
const filteredCatalogs = ComponentService.findAll("fv-filtered-catalog", this.selector);
|
for (const filteredCatalog of filteredCatalogs) {
|
if (filteredCatalog.classList.contains("hidden")) {
|
this.anyTargetsHidden = true;
|
}
|
}
|
this.requestUpdate();
|
}
|
init() {
|
return __async(this, null, function* () {
|
yield CommunicationInterfaceService.IsAppReady;
|
FilteredCatalogComponent.RegisterPropertiesReadEvent((dataValue) => __async(this, null, function* () {
|
const filteredCatalog = ComponentService.find("fv-filtered-catalog", this.selector);
|
const properties = FilteredCatalogComponent.FilterProgPropertyProgram(dataValue, filteredCatalog.filter);
|
this.propertyNames = [];
|
for (const property2 of properties) {
|
this.propertyNames.push(property2.name);
|
}
|
this.requestUpdate();
|
}));
|
this.readTargetHiddenState();
|
});
|
}
|
makeString(array) {
|
let result = "";
|
array.forEach((entry) => {
|
result += " ";
|
result += entry;
|
});
|
return result;
|
}
|
render() {
|
let text = x`NO TARGET FILTERED CATALOG FOUND!`;
|
if (this.textOverwrite.length > 0) {
|
text = x`${this.textOverwrite}`;
|
} else {
|
this.classList.remove("hidden");
|
if (this.propertyNames.length < 1) {
|
if (this.noValuesTxtId.length > 0) {
|
return x`<fv-label class="no-values-txt" i18n="${this.noValuesTxtId}">${this.noValuesTxtId}</fv-label>`;
|
}
|
this.classList.add("hidden");
|
}
|
text = x`${this.propertyNames.map((propName, index) => x`${index < 1 ? propName : ", " + propName}`)}`;
|
}
|
const classes = new Array();
|
classes.push(...this.buttonClasses);
|
classes.push(...this.buttonAttributes);
|
if (this.anyTargetsHidden == false) {
|
classes.push("active");
|
}
|
return x`<fv-button class="${this.makeString(classes)}">${text}</fv-button>`;
|
}
|
};
|
FilteredCatalogToggleButtonComponent.styles = [
|
__superStaticGet(FilteredCatalogToggleButtonComponent, "styles") || []
|
];
|
__decorateClass([
|
n({ type: Array, reflect: true, attribute: "fv-button-classes" })
|
], FilteredCatalogToggleButtonComponent.prototype, "buttonClasses", 2);
|
__decorateClass([
|
n({ type: Array, reflect: true, attribute: "fv-button-toggle-attributes" })
|
], FilteredCatalogToggleButtonComponent.prototype, "buttonAttributes", 2);
|
__decorateClass([
|
n({ type: String, reflect: true, attribute: "text-overwrite" })
|
], FilteredCatalogToggleButtonComponent.prototype, "textOverwrite", 2);
|
__decorateClass([
|
n({ type: String, reflect: true, attribute: "selector" })
|
], FilteredCatalogToggleButtonComponent.prototype, "selector", 2);
|
__decorateClass([
|
n({ type: String, reflect: true, attribute: "no-values-txt-id" })
|
], FilteredCatalogToggleButtonComponent.prototype, "noValuesTxtId", 2);
|
FilteredCatalogToggleButtonComponent = __decorateClass([
|
e("fv-filtered-catalog-toggle-button")
|
], FilteredCatalogToggleButtonComponent);
|
|
export { FilteredCatalogToggleButtonComponent };
|