dh_ackergaul
2026-06-03 a25433795ec239654db2ef31af6d3f4e84b3b8dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
import { ProgPropertyModel } from './prog-property.model.js';
import './accordion.component.js';
import { AccordionItemComponent } from './accordion-item.component.js';
import './accordion-layer.component.js';
import { e } from './custom-element-30fc6381.js';
import { i, r } from './query-assigned-elements-fea1f631.js';
import { BaseAccordionTheme } from './base-accordion.theme.js';
import './base.component-813fc7cf.js';
import '@dh-software/furnview-icons';
import './query-1c86d710.js';
import './class-map-a0fb5d87.js';
import './style.helper.js';
import './event.handler.model.js';
import './image.service.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 css_248z = i`:host{margin-bottom:0}`;
 
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 ProgPropertyAccordionLayer = class extends BaseAccordionTheme {
  constructor() {
    super();
    this.preventEmpty = true;
  }
  getAccordionItems() {
    return __async(this, null, function* () {
      const additionalClasses = this.PPContainer.accordionItemClasses;
      const componentBuffer = [];
      DragDropHelperService.cleanUp();
      const result = yield ProgPropertyModel.traverse({
        propertyGroupedCallback: (manufacturerModel, programModel, propertyGroup) => __async(this, null, function* () {
          var _a, _b, _c;
          if (this.PPContainer.hideSingleValueProperties) {
            let noProgPropertyValueList = false;
            let totalPropertiesCount = 0;
            for (const item of propertyGroup.keys) {
              if (item.progPropertyValueList) {
                totalPropertiesCount += item.progPropertyValueList.length;
              } else {
                noProgPropertyValueList = true;
              }
            }
            if (totalPropertiesCount < 2 && !noProgPropertyValueList) {
              return;
            }
          }
          if (!propertyGroup.title) {
            propertyGroup.title = ((_a = propertyGroup.keys[0].progPropertyModel) == null ? void 0 : _a.name) || "";
          }
          let preventGroupAdd = true;
          let cacheKey = "";
          if (propertyGroup.title) {
            cacheKey += `${propertyGroup.title}`;
          }
          if (propertyGroup == null ? void 0 : propertyGroup.id) {
            cacheKey += `_${propertyGroup.id}`;
          }
          const overrides = { image: propertyGroup.imgSrc };
          const propertyMenu = yield this.buildAccordionPropertyHeader(programModel, {
            name: propertyGroup.title || "Undefined",
            image: propertyGroup.imgSrc,
            key: cacheKey
          }, additionalClasses);
          propertyMenu.replaceChildren();
          for (const item of propertyGroup.keys) {
            if (!((_b = item.progPropertyModel) == null ? void 0 : _b.name)) {
              continue;
            }
            if (!(item.progPropertyValueList && (item.progPropertyValueList.length > 1 || !this.PPContainer.hideNotSettable))) {
              continue;
            }
            const propertyFlexContent = yield this.buildAccordionFlexContent(propertyMenu, manufacturerModel, programModel, item.progPropertyModel);
            propertyFlexContent.replaceChildren();
            for (let ppVI = 0; ppVI < item.progPropertyValueList.length; ppVI++) {
              const propertyValue = item.progPropertyValueList[ppVI];
              let ppItem;
              if (propertyValue.alternativeImageUrl) {
                ppItem = this.buildImageProperty(propertyMenu, propertyFlexContent, manufacturerModel, programModel, item.progPropertyModel, propertyValue, item.currentValue, overrides);
              } else if (propertyValue.colorPicker && propertyValue.colorPicker.type) {
                ppItem = this.buildColorPickerProperty(propertyMenu, propertyFlexContent, manufacturerModel, programModel, item.progPropertyModel, propertyValue, item.currentValue, overrides);
              } else {
                ppItem = this.buildRadioProperty(propertyMenu, propertyFlexContent, manufacturerModel, programModel, item.progPropertyModel, propertyValue, item.currentValue, overrides);
              }
              if (ppItem) {
                const itemKeyIndex = this.getCacheKeys("items").indexOf(propertyValue.propertyKey);
                if (itemKeyIndex !== -1)
                  this.getCacheKeys("items").splice(itemKeyIndex, 1);
                propertyFlexContent.appendChild(ppItem);
              }
            }
            if (propertyFlexContent.children.length > 0) {
              preventGroupAdd = false;
              const label = this.buildLabel(item.progPropertyModel);
              label.style.fontWeight = "bold";
              const labelKeyIndex = this.getCacheKeys("labels").indexOf((_c = item.progPropertyModel) == null ? void 0 : _c.key);
              if (labelKeyIndex !== -1)
                this.getCacheKeys("labels").splice(labelKeyIndex, 1);
              propertyMenu.append(label);
              propertyMenu.append(propertyFlexContent);
              this.getCache("flex")[item.progPropertyModel.key] = propertyFlexContent;
              const flexKeyIndex = this.getCacheKeys("flex").indexOf(item.progPropertyModel.key);
              if (flexKeyIndex !== -1)
                this.getCacheKeys("flex").splice(flexKeyIndex, 1);
            }
            item.currentValue;
            if (!item.currentValue) {
              item.progPropertyValueList.find((c) => {
                var _a2;
                return c.propertyKey === ((_a2 = item.progPropertyModel) == null ? void 0 : _a2.currentValue);
              });
            }
          }
          if (!preventGroupAdd && propertyMenu.childElementCount > 0) {
            componentBuffer.push(propertyMenu);
          }
        })
      });
      if (result) {
        if (componentBuffer.length === 1) {
          if (componentBuffer[0] instanceof AccordionItemComponent) {
            componentBuffer[0].isSingular = true;
          }
        } else if (componentBuffer.length > 1) {
          componentBuffer.forEach((item, index) => {
            item.isSingular = false;
          });
        }
      }
      return componentBuffer;
    });
  }
  getCacheKeyPrefix() {
    return "progproperty";
  }
};
ProgPropertyAccordionLayer.styles = [__superStaticGet(ProgPropertyAccordionLayer, "styles") || [], r(css_248z)];
ProgPropertyAccordionLayer = __decorateClass([
  e("fv-prog-property-accordion-layer")
], ProgPropertyAccordionLayer);
 
export { ProgPropertyAccordionLayer };