import { ProgContextModel } from './prog-context.model.js';
|
import { e } from './custom-element-30fc6381.js';
|
import { n } from './base.component-813fc7cf.js';
|
import './query-assigned-elements-fea1f631.js';
|
import { BaseAccordionTheme } from './base-accordion.theme.js';
|
import './prog-property.model.js';
|
import '@dh-software/furnview-icons';
|
import './accordion.component.js';
|
import './accordion-item.component.js';
|
import './query-1c86d710.js';
|
import './class-map-a0fb5d87.js';
|
import './style.helper.js';
|
import './event.handler.model.js';
|
import './image.service.js';
|
import './accordion-layer.component.js';
|
import './titled-image.component.js';
|
import './info.component.js';
|
import './property-list.component.js';
|
import './query-all-828de4b2.js';
|
import './sikkens-picker.component.js';
|
import './color-picker.model.js';
|
import './transition.helper.js';
|
import './ncs-picker.component.js';
|
import './ral-picker.component.js';
|
import './radio.component.js';
|
import './filter.service.js';
|
import './filter-container.component.js';
|
import './filter-list.component.js';
|
import './label.component.js';
|
import './sass.default-d943b107.js';
|
import './single-color.component.js';
|
import './interface.js';
|
import './cached-layer.component.js';
|
import './pp-layer.component.js';
|
import './cache.service.js';
|
import './pp-util.class.js';
|
|
var __defProp = Object.defineProperty;
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
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 __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 ProgContextAccordionLayer = class extends BaseAccordionTheme {
|
getAccordionItems() {
|
return __async(this, null, function* () {
|
var _a;
|
const componentBuffer = [];
|
DragDropHelperService.cleanUp();
|
const options = {
|
useRelevant: true,
|
useSelection: true,
|
contextInfo: ((_a = this.contexts) == null ? void 0 : _a.map((x) => {
|
return { contextId: x };
|
})) || []
|
};
|
yield ProgContextModel.traverse({
|
propertyCallback: (context, program, property2, values, current) => __async(this, null, function* () {
|
var _a2;
|
if (!this.contexts || !((_a2 = this.contexts) == null ? void 0 : _a2.includes(context.contextId))) {
|
return;
|
}
|
const propertyMenu = yield this.buildAccordionPropertyHeader(program, {
|
key: property2.id,
|
name: property2.name || "Undefined",
|
image: ""
|
}, this.PPContainer.accordionItemClasses);
|
propertyMenu.replaceChildren();
|
const propertyFlexContent = yield this.buildAccordionFlexContent(propertyMenu, context, program, property2);
|
propertyFlexContent.replaceChildren();
|
for (let ppVI = 0; ppVI < values.length; ppVI++) {
|
const propertyValue = values[ppVI];
|
let ppItem;
|
if (propertyValue.alternativeImageUrl) {
|
ppItem = this.buildImageProperty(propertyMenu, propertyFlexContent, context, program, property2, propertyValue, current);
|
} else if (propertyValue.colorPicker && propertyValue.colorPicker.type) {
|
ppItem = this.buildColorPickerProperty(propertyMenu, propertyFlexContent, context, program, property2, propertyValue, current);
|
} else {
|
ppItem = this.buildRadioProperty(propertyMenu, propertyFlexContent, context, program, property2, propertyValue, current);
|
}
|
if (ppItem) {
|
const itemKeyIndex = this.getCacheKeys("items").indexOf(propertyValue.propertyKey);
|
if (itemKeyIndex !== -1)
|
this.getCacheKeys("items").splice(itemKeyIndex, 1);
|
propertyFlexContent.appendChild(ppItem);
|
}
|
}
|
if (values.length > 0) {
|
propertyMenu.append(propertyFlexContent);
|
this.getCache("flex")[property2.key] = propertyFlexContent;
|
const flexKeyIndex = this.getCacheKeys("flex").indexOf(property2.key);
|
if (flexKeyIndex !== -1)
|
this.getCacheKeys("flex").splice(flexKeyIndex, 1);
|
}
|
if (propertyMenu.childElementCount > 0) {
|
componentBuffer.push(propertyMenu);
|
}
|
})
|
}, options);
|
return componentBuffer;
|
});
|
}
|
getCacheKeyPrefix() {
|
return "progcontext";
|
}
|
};
|
__decorateClass([
|
n({ type: Object })
|
], ProgContextAccordionLayer.prototype, "contexts", 2);
|
ProgContextAccordionLayer = __decorateClass([
|
e("fv-prog-context-accordion-layer")
|
], ProgContextAccordionLayer);
|
|
export { ProgContextAccordionLayer };
|