@sme.up/ketchup 11.0.0-SNAPSHOT-20250515094227 → 11.0.0-SNAPSHOT-20250516092441

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/cjs/kup-accordion.cjs.entry.js +31 -41
  2. package/dist/cjs/kup-autocomplete_29.cjs.entry.js +22 -19
  3. package/dist/collection/assets/accordion.js +54 -0
  4. package/dist/collection/components/kup-accordion/kup-accordion.js +31 -61
  5. package/dist/collection/components/kup-tab-bar/kup-tab-bar.js +22 -39
  6. package/dist/components/kup-accordion.js +32 -42
  7. package/dist/components/kup-activity-timeline.js +1 -1
  8. package/dist/components/kup-autocomplete.js +1 -1
  9. package/dist/components/kup-badge.js +1 -1
  10. package/dist/components/kup-box.js +1 -1
  11. package/dist/components/kup-button-list.js +1 -1
  12. package/dist/components/kup-button.js +1 -1
  13. package/dist/components/kup-calendar.js +1 -1
  14. package/dist/components/kup-card-list.js +2 -2
  15. package/dist/components/kup-card.js +1 -1
  16. package/dist/components/kup-cell.js +1 -1
  17. package/dist/components/kup-chart.js +1 -1
  18. package/dist/components/kup-checkbox.js +1 -1
  19. package/dist/components/kup-chip.js +1 -1
  20. package/dist/components/kup-color-picker.js +1 -1
  21. package/dist/components/kup-combobox.js +1 -1
  22. package/dist/components/kup-dashboard.js +1 -1
  23. package/dist/components/kup-data-table.js +1 -1
  24. package/dist/components/kup-date-picker.js +1 -1
  25. package/dist/components/kup-dialog.js +1 -1
  26. package/dist/components/kup-drawer.js +1 -1
  27. package/dist/components/kup-dropdown-button.js +1 -1
  28. package/dist/components/kup-echart.js +1 -1
  29. package/dist/components/kup-editor.js +1 -1
  30. package/dist/components/kup-family-tree.js +2 -2
  31. package/dist/components/kup-file-upload.js +1 -1
  32. package/dist/components/kup-form.js +1 -1
  33. package/dist/components/kup-gauge.js +1 -1
  34. package/dist/components/kup-grid.js +1 -1
  35. package/dist/components/kup-htm.js +1 -1
  36. package/dist/components/kup-iframe.js +1 -1
  37. package/dist/components/kup-image-list.js +1 -1
  38. package/dist/components/kup-image.js +1 -1
  39. package/dist/components/kup-input-panel.js +2 -2
  40. package/dist/components/kup-lazy.js +1 -1
  41. package/dist/components/kup-list.js +1 -1
  42. package/dist/components/kup-magic-box.js +3 -3
  43. package/dist/components/kup-nav-bar.js +1 -1
  44. package/dist/components/kup-numeric-picker.js +1 -1
  45. package/dist/components/kup-object-field.js +1 -1
  46. package/dist/components/kup-pdf.js +1 -1
  47. package/dist/components/kup-planner.js +1 -1
  48. package/dist/components/kup-probe.js +1 -1
  49. package/dist/components/kup-progress-bar.js +1 -1
  50. package/dist/components/kup-qlik.js +1 -1
  51. package/dist/components/kup-radio.js +1 -1
  52. package/dist/components/kup-rating.js +1 -1
  53. package/dist/components/kup-snackbar.js +1 -1
  54. package/dist/components/kup-spinner.js +1 -1
  55. package/dist/components/kup-switch.js +1 -1
  56. package/dist/components/kup-tab-bar.js +1 -1
  57. package/dist/components/kup-text-field.js +1 -1
  58. package/dist/components/kup-time-picker.js +1 -1
  59. package/dist/components/kup-toolbar.js +1 -1
  60. package/dist/components/kup-tree.js +1 -1
  61. package/dist/components/kup-txt.js +1 -1
  62. package/dist/components/kup-typography-list.js +1 -1
  63. package/dist/components/kup-typography.js +1 -1
  64. package/dist/components/{p-a631326d.js → p-06a6ef10.js} +1 -1
  65. package/dist/components/{p-b86a7f8d.js → p-1ab77355.js} +1 -1
  66. package/dist/components/{p-c08b72aa.js → p-4f8f83ed.js} +1 -1
  67. package/dist/components/{p-c6005f49.js → p-652331f5.js} +22 -19
  68. package/dist/components/{p-d24ad4c1.js → p-8387161b.js} +1 -1
  69. package/dist/esm/kup-accordion.entry.js +31 -41
  70. package/dist/esm/kup-autocomplete_29.entry.js +22 -19
  71. package/dist/ketchup/ketchup.esm.js +1 -1
  72. package/dist/ketchup/p-1d0c5c3c.entry.js +1 -0
  73. package/dist/ketchup/{p-bdd459ee.entry.js → p-a8a05ef3.entry.js} +1 -1
  74. package/dist/types/components/kup-accordion/kup-accordion.d.ts +0 -5
  75. package/dist/types/components/kup-tab-bar/kup-tab-bar.d.ts +0 -4
  76. package/dist/types/components.d.ts +0 -10
  77. package/package.json +1 -1
  78. package/dist/ketchup/p-6df4360a.entry.js +0 -1
@@ -51,7 +51,6 @@ const KupAccordion = class {
51
51
  this.kupBlur = index.createEvent(this, "kup-accordion-blur", 6);
52
52
  this.kupClick = index.createEvent(this, "kup-accordion-click", 6);
53
53
  this.kupIconClick = index.createEvent(this, "kup-accordion-iconclick", 6);
54
- this.kupInfoIconClick = index.createEvent(this, "kup-accordion-infoiconclick", 6);
55
54
  this.kupFocus = index.createEvent(this, "kup-accordion-focus", 6);
56
55
  this.kupToolbarItemClick = index.createEvent(this, "kup-accordion-toolbaritemclick", 6);
57
56
  /*-------------------------------------------------*/
@@ -86,15 +85,6 @@ const KupAccordion = class {
86
85
  node: node,
87
86
  });
88
87
  }
89
- onKupClick(i, node) {
90
- this.data[i].contentVisible = !this.data[i].contentVisible;
91
- this.updateSelectedItems();
92
- this.kupClick.emit({
93
- comp: this,
94
- id: this.rootElement.id,
95
- node: node,
96
- });
97
- }
98
88
  onKupIconClick(el) {
99
89
  if (!el) {
100
90
  this.kupManager.debug.logMessage(this, 'onKupIconClick: Element is null');
@@ -145,6 +135,9 @@ const KupAccordion = class {
145
135
  if ((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) {
146
136
  for (let i = 0; i < this.data.length; i++) {
147
137
  const node = this.data[i];
138
+ if (node.contentVisible === undefined) {
139
+ node.contentVisible = true;
140
+ }
148
141
  if (node.contentVisible) {
149
142
  ids.push(node.id);
150
143
  }
@@ -162,10 +155,8 @@ const KupAccordion = class {
162
155
  const ids = [];
163
156
  for (let i = 0; i < this.data.length; i++) {
164
157
  const node = this.data[i];
165
- const itemName = node.id;
166
- if (!this.isItemExpandible(itemName) &&
167
- this.isItemSelected(itemName)) {
168
- ids.push(itemName);
158
+ if (!this.isItemExpandible(node) && this.isItemSelected(node)) {
159
+ ids.push(node.id);
169
160
  }
170
161
  }
171
162
  this.selectedItems = ids;
@@ -177,9 +168,8 @@ const KupAccordion = class {
177
168
  const ids = [];
178
169
  for (let i = 0; i < this.data.length; i++) {
179
170
  const node = this.data[i];
180
- const itemName = node.id;
181
- if (this.isItemExpandible(itemName)) {
182
- ids.push(itemName);
171
+ if (this.isItemExpandible(node)) {
172
+ ids.push(node.id);
183
173
  }
184
174
  }
185
175
  this.selectedItems = ids;
@@ -210,14 +200,14 @@ const KupAccordion = class {
210
200
  * @param {string} itemName - Name of the item.
211
201
  */
212
202
  async toggleItem(node) {
213
- const ids = [...this.selectedItems];
214
- if (ids.includes(node.id)) {
215
- ids.splice(ids.indexOf(node.id), 1);
203
+ if (!this.isItemExpandible(node)) {
204
+ return;
216
205
  }
217
- else {
218
- ids.push(node.id);
206
+ if (node.contentVisible === undefined) {
207
+ node.contentVisible = true;
219
208
  }
220
- this.selectedItems = ids;
209
+ node.contentVisible = !node.contentVisible;
210
+ this.updateSelectedItems();
221
211
  this.kupClick.emit({
222
212
  comp: this,
223
213
  id: this.rootElement.id,
@@ -227,11 +217,11 @@ const KupAccordion = class {
227
217
  /*-------------------------------------------------*/
228
218
  /* P r i v a t e M e t h o d s */
229
219
  /*-------------------------------------------------*/
230
- isItemExpandible(itemName) {
231
- return this.slotsNames.includes(itemName);
220
+ isItemExpandible(item) {
221
+ return item.expandable || this.slotsNames.includes(item.id);
232
222
  }
233
- isItemSelected(itemName) {
234
- return this.selectedItems.includes(itemName);
223
+ isItemSelected(item) {
224
+ return this.selectedItems.includes(item.id);
235
225
  }
236
226
  renderItems() {
237
227
  var _a, _b;
@@ -244,9 +234,8 @@ const KupAccordion = class {
244
234
  }
245
235
  for (let i = 0; i < this.data.length; i++) {
246
236
  const node = this.data[i];
247
- const itemName = node.id;
248
- const isItemSelected = this.isItemSelected(itemName);
249
- const isItemExpandible = this.isItemExpandible(itemName);
237
+ const isItemSelected = this.isItemSelected(node);
238
+ const isItemExpandible = this.isItemExpandible(node);
250
239
  const itemHeaderClass = {
251
240
  'accordion-item__header': true,
252
241
  'accordion-item__header--selected': !isItemExpandible && isItemSelected ? true : false,
@@ -260,32 +249,33 @@ const KupAccordion = class {
260
249
  ? true
261
250
  : false,
262
251
  };
263
- const wrapper = (index.h("div", { class: "accordion-rigtbuttons" }, this.infoIcon && (index.h(fImage.FImage, { resource: "info_outline", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
252
+ const wrapper = (index.h("div", { class: "accordion-rigtbuttons" }, this.infoIcon && this.infoCallback && (index.h(fImage.FImage, { resource: "info_outline", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
264
253
  event.stopPropagation();
265
254
  const el = event.currentTarget;
266
- const data = await this.infoCallback();
267
- this.infoState = data;
255
+ this.infoState = await this.infoCallback();
268
256
  if (this.infoState.length > 0) {
269
257
  this.onKupInfoIconClick(el);
270
258
  }
271
259
  else {
272
260
  this.kupManager.debug.logMessage(this, 'InfoIcon data is empty, not opening dropdown.');
273
261
  }
274
- }, wrapperClass: "tab__iconToolbar iconInfo" })), this.toolbar && (index.h(fImage.FImage, { resource: "more_vert", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
262
+ }, wrapperClass: "tab__iconToolbar iconInfo" })), this.toolbar && this.toolbarCallback && (index.h(fImage.FImage, { resource: "more_vert", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
263
+ var _a;
275
264
  event.stopPropagation();
276
265
  const el = event.currentTarget;
277
- const data = await this.toolbarCallback();
278
- this.toolbarState = data;
279
- if (this.toolbarState.length > 0) {
266
+ this.toolbarState =
267
+ await this.toolbarCallback();
268
+ if (((_a = this.toolbarState) === null || _a === void 0 ? void 0 : _a.length) > 0) {
280
269
  this.onKupIconClick(el);
281
270
  }
282
271
  else {
283
272
  this.kupManager.debug.logMessage(this, 'Toolbar data is empty, not opening dropdown.');
284
273
  }
285
274
  }, wrapperClass: "tab__iconToolbar iconToolbar" })), isItemExpandible ? (index.h("div", { class: `accordion-item__dropdown kup-icon ${kupManager.KupThemeIconValues.DROPDOWN.replace('--', '')}` })) : null));
286
- items.push(index.h("div", { class: "accordion-item" }, index.h("div", { tabindex: i, title: (_a = node.title) !== null && _a !== void 0 ? _a : null, class: itemHeaderClass, onClick: () => this.toggleItem(node), onBlur: () => this.onKupBlur(node),
287
- // onClick={() => this.onKupClick(i, node)}
288
- onFocus: () => this.onKupFocus(node) }, node.icon ? (index.h(fImage.FImage, { color: `var(${kupManager.KupThemeColorValues.PRIMARY})`, resource: node.icon, placeholderResource: node.placeholderIcon, sizeX: "1.5em", sizeY: "1.5em", wrapperClass: "accordion-item__icon" })) : null, node.value ? (index.h("span", { class: "accordion-item__text" }, (_b = node.value) !== null && _b !== void 0 ? _b : '')) : null, wrapper), index.h("div", { class: itemContentClass }, index.h("slot", { name: node.id }))));
275
+ items.push(index.h("div", { class: "accordion-item" }, index.h("div", { tabindex: i, title: (_a = node.title) !== null && _a !== void 0 ? _a : null, class: itemHeaderClass, onClick: (e) => {
276
+ e.stopPropagation();
277
+ this.toggleItem(node);
278
+ }, onBlur: () => this.onKupBlur(node), onFocus: () => this.onKupFocus(node) }, node.icon ? (index.h(fImage.FImage, { color: `var(${kupManager.KupThemeColorValues.PRIMARY})`, resource: node.icon, placeholderResource: node.placeholderIcon, sizeX: "1.5em", sizeY: "1.5em", wrapperClass: "accordion-item__icon" })) : null, node.value ? (index.h("span", { class: "accordion-item__text" }, (_b = node.value) !== null && _b !== void 0 ? _b : '')) : null, wrapper), index.h("div", { class: itemContentClass }, index.h("slot", { name: node.id }))));
289
279
  }
290
280
  return items;
291
281
  }
@@ -411,7 +401,7 @@ const KupAccordion = class {
411
401
  }
412
402
  render() {
413
403
  const content = this.data && this.data.length ? this.renderItems() : null;
414
- return (index.h(index.Host, { key: '3f9af91ddcf48e60b8ac506dfbc7991eea418f70' }, index.h("style", { key: '3179a55c30b7a726f2f6cc20f15fd4c3003160c5' }, this.kupManager.theme.setKupStyle(this.rootElement)), index.h("div", { key: 'f7f9910a40af9bb7f0891523d1b30e3d7677c5b6', id: GenericVariables.componentWrapperId }, index.h("div", { key: 'c267fd8005f786b4a0e9207ab553b12a7044cc46', class: "accordion" }, content))));
404
+ return (index.h(index.Host, { key: '2b6280c1daf20870cb5a73f3c8f2c8e7272d9cd4' }, index.h("style", { key: '92169351854c60b65712dc174214ac450172dbf1' }, this.kupManager.theme.setKupStyle(this.rootElement)), index.h("div", { key: '20a65571ec0481ddf2938e29f48c2d26c7c637c7', id: GenericVariables.componentWrapperId }, index.h("div", { key: '8389a5bd3752c0ee21658de14f5e3590890b944c', class: "accordion" }, content))));
415
405
  }
416
406
  disconnectedCallback() {
417
407
  this.kupManager.theme.unregister(this);
@@ -17620,7 +17620,6 @@ const KupTabBar = class {
17620
17620
  this.kupBlur = index.createEvent(this, "kup-tabbar-blur", 6);
17621
17621
  this.kupClick = index.createEvent(this, "kup-tabbar-click", 6);
17622
17622
  this.kupIconClick = index.createEvent(this, "kup-tabbar-iconclick", 6);
17623
- this.kupInfoIconClick = index.createEvent(this, "kup-tabbar-infoiconclick", 6);
17624
17623
  this.kupFocus = index.createEvent(this, "kup-tabbar-focus", 6);
17625
17624
  this.kupToolbarItemClick = index.createEvent(this, "kup-tabbar-toolbaritemclick", 6);
17626
17625
  /*-------------------------------------------------*/
@@ -17910,26 +17909,30 @@ const KupTabBar = class {
17910
17909
  'kup-danger': node.danger,
17911
17910
  };
17912
17911
  const tabEl = (index.h("f-button", { class: tabClass, role: "tab", "aria-selected": node.active ? true : false, tabIndex: i, title: node.title ? node.title : null, onBlur: () => this.onKupBlur(i, node), onClick: () => this.onKupClick(i, node), onFocus: () => this.onKupFocus(i, node) }, index.h("span", { class: "tab__content" }, node.icon ? (index.h(fImage.FImage, { color: `var(${kupManager$2.KupThemeColorValues.PRIMARY})`, resource: node.icon, placeholderResource: node.placeholderIcon, wrapperClass: "tab__icon" })) : null, node.value ? (index.h("span", { class: "tab__text-label" }, node.value)) : null), this.infoIcon && (index.h(fImage.FImage, { resource: "info_outline", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
17913
- event.stopPropagation();
17914
- const el = event.currentTarget;
17915
- const data = await this.infoCallback();
17916
- this.infoState = data;
17917
- if (this.infoState.length > 0) {
17918
- this.onKupInfoIconClick(el);
17919
- }
17920
- else {
17921
- this.kupManager.debug.logMessage(this, 'InfoIcon data is empty, not opening dropdown.');
17912
+ if (node.active) {
17913
+ event.stopPropagation();
17914
+ const el = event.currentTarget;
17915
+ const data = await this.infoCallback();
17916
+ this.infoState = data;
17917
+ if (this.infoState.length > 0) {
17918
+ this.onKupInfoIconClick(el);
17919
+ }
17920
+ else {
17921
+ this.kupManager.debug.logMessage(this, 'InfoIcon data is empty, not opening dropdown.');
17922
+ }
17922
17923
  }
17923
17924
  }, wrapperClass: "tab__iconToolbar iconInfo" })), this.toolbar && (index.h(fImage.FImage, { resource: "more_vert", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
17924
- event.stopPropagation();
17925
- const el = event.currentTarget;
17926
- const data = await this.toolbarCallback();
17927
- this.toolbarState = data;
17928
- if (this.toolbarState.length > 0) {
17929
- this.onKupIconClick(el);
17930
- }
17931
- else {
17932
- this.kupManager.debug.logMessage(this, 'Toolbar data is empty, not opening dropdown.');
17925
+ if (node.active) {
17926
+ event.stopPropagation();
17927
+ const el = event.currentTarget;
17928
+ const data = await this.toolbarCallback();
17929
+ this.toolbarState = data;
17930
+ if (this.toolbarState.length > 0) {
17931
+ this.onKupIconClick(el);
17932
+ }
17933
+ else {
17934
+ this.kupManager.debug.logMessage(this, 'Toolbar data is empty, not opening dropdown.');
17935
+ }
17933
17936
  }
17934
17937
  }, wrapperClass: "tab__iconToolbar iconToolbar" })), index.h("span", { class: `tab-indicator ${node.active ? ' tab-indicator--active' : ''}` }, index.h("span", { class: "tab-indicator__content tab-indicator__content--underline" }))));
17935
17938
  tabBar.push(tabEl);
@@ -29,3 +29,57 @@ ksAccordion.data = ksData;
29
29
 
30
30
  const emptyAccordion = document.getElementById('empty');
31
31
  emptyAccordion.data = {};
32
+
33
+ const accordionIntoAnother = document.getElementById(
34
+ 'accordionIntoAnother-main'
35
+ );
36
+ const props = {
37
+ customStyle: '',
38
+ data: [
39
+ {
40
+ contentVisible: false,
41
+ value: 'First accordion',
42
+ id: 'main-first',
43
+ },
44
+ {
45
+ contentVisible: false,
46
+ value: 'Second accordion',
47
+ id: 'main-second',
48
+ expandable: true,
49
+ },
50
+ ],
51
+ infoIcon: false,
52
+ ripple: false,
53
+ toolbar: true,
54
+ sizing: 'small',
55
+ };
56
+ for (const key in props) {
57
+ accordionIntoAnother[key] = props[key];
58
+ }
59
+ accordionIntoAnother.toolbarCallback = (e) => {
60
+ console.log('Toolbar callback', e);
61
+ };
62
+
63
+ let child = document.getElementById('accordionIntoAnother-main-second');
64
+ const childProps = {
65
+ customStyle: '',
66
+ data: [
67
+ {
68
+ contentVisible: false,
69
+ value: 'First child accordion',
70
+ id: 'child-first',
71
+ },
72
+ {
73
+ contentVisible: false,
74
+ value: 'Second child accordion',
75
+ id: 'child-second',
76
+ expandable: true,
77
+ },
78
+ ],
79
+ infoIcon: false,
80
+ ripple: false,
81
+ toolbar: true,
82
+ };
83
+ for (const key in childProps) {
84
+ child[key] = childProps[key];
85
+ }
@@ -59,15 +59,6 @@ export class KupAccordion {
59
59
  node: node,
60
60
  });
61
61
  }
62
- onKupClick(i, node) {
63
- this.data[i].contentVisible = !this.data[i].contentVisible;
64
- this.updateSelectedItems();
65
- this.kupClick.emit({
66
- comp: this,
67
- id: this.rootElement.id,
68
- node: node,
69
- });
70
- }
71
62
  onKupIconClick(el) {
72
63
  if (!el) {
73
64
  this.kupManager.debug.logMessage(this, 'onKupIconClick: Element is null');
@@ -118,6 +109,9 @@ export class KupAccordion {
118
109
  if ((_a = this.data) === null || _a === void 0 ? void 0 : _a.length) {
119
110
  for (let i = 0; i < this.data.length; i++) {
120
111
  const node = this.data[i];
112
+ if (node.contentVisible === undefined) {
113
+ node.contentVisible = true;
114
+ }
121
115
  if (node.contentVisible) {
122
116
  ids.push(node.id);
123
117
  }
@@ -135,10 +129,8 @@ export class KupAccordion {
135
129
  const ids = [];
136
130
  for (let i = 0; i < this.data.length; i++) {
137
131
  const node = this.data[i];
138
- const itemName = node.id;
139
- if (!this.isItemExpandible(itemName) &&
140
- this.isItemSelected(itemName)) {
141
- ids.push(itemName);
132
+ if (!this.isItemExpandible(node) && this.isItemSelected(node)) {
133
+ ids.push(node.id);
142
134
  }
143
135
  }
144
136
  this.selectedItems = ids;
@@ -150,9 +142,8 @@ export class KupAccordion {
150
142
  const ids = [];
151
143
  for (let i = 0; i < this.data.length; i++) {
152
144
  const node = this.data[i];
153
- const itemName = node.id;
154
- if (this.isItemExpandible(itemName)) {
155
- ids.push(itemName);
145
+ if (this.isItemExpandible(node)) {
146
+ ids.push(node.id);
156
147
  }
157
148
  }
158
149
  this.selectedItems = ids;
@@ -183,14 +174,14 @@ export class KupAccordion {
183
174
  * @param {string} itemName - Name of the item.
184
175
  */
185
176
  async toggleItem(node) {
186
- const ids = [...this.selectedItems];
187
- if (ids.includes(node.id)) {
188
- ids.splice(ids.indexOf(node.id), 1);
177
+ if (!this.isItemExpandible(node)) {
178
+ return;
189
179
  }
190
- else {
191
- ids.push(node.id);
180
+ if (node.contentVisible === undefined) {
181
+ node.contentVisible = true;
192
182
  }
193
- this.selectedItems = ids;
183
+ node.contentVisible = !node.contentVisible;
184
+ this.updateSelectedItems();
194
185
  this.kupClick.emit({
195
186
  comp: this,
196
187
  id: this.rootElement.id,
@@ -200,11 +191,11 @@ export class KupAccordion {
200
191
  /*-------------------------------------------------*/
201
192
  /* P r i v a t e M e t h o d s */
202
193
  /*-------------------------------------------------*/
203
- isItemExpandible(itemName) {
204
- return this.slotsNames.includes(itemName);
194
+ isItemExpandible(item) {
195
+ return item.expandable || this.slotsNames.includes(item.id);
205
196
  }
206
- isItemSelected(itemName) {
207
- return this.selectedItems.includes(itemName);
197
+ isItemSelected(item) {
198
+ return this.selectedItems.includes(item.id);
208
199
  }
209
200
  renderItems() {
210
201
  var _a, _b;
@@ -217,9 +208,8 @@ export class KupAccordion {
217
208
  }
218
209
  for (let i = 0; i < this.data.length; i++) {
219
210
  const node = this.data[i];
220
- const itemName = node.id;
221
- const isItemSelected = this.isItemSelected(itemName);
222
- const isItemExpandible = this.isItemExpandible(itemName);
211
+ const isItemSelected = this.isItemSelected(node);
212
+ const isItemExpandible = this.isItemExpandible(node);
223
213
  const itemHeaderClass = {
224
214
  'accordion-item__header': true,
225
215
  'accordion-item__header--selected': !isItemExpandible && isItemSelected ? true : false,
@@ -233,32 +223,33 @@ export class KupAccordion {
233
223
  ? true
234
224
  : false,
235
225
  };
236
- const wrapper = (h("div", { class: "accordion-rigtbuttons" }, this.infoIcon && (h(FImage, { resource: "info_outline", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
226
+ const wrapper = (h("div", { class: "accordion-rigtbuttons" }, this.infoIcon && this.infoCallback && (h(FImage, { resource: "info_outline", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
237
227
  event.stopPropagation();
238
228
  const el = event.currentTarget;
239
- const data = await this.infoCallback();
240
- this.infoState = data;
229
+ this.infoState = await this.infoCallback();
241
230
  if (this.infoState.length > 0) {
242
231
  this.onKupInfoIconClick(el);
243
232
  }
244
233
  else {
245
234
  this.kupManager.debug.logMessage(this, 'InfoIcon data is empty, not opening dropdown.');
246
235
  }
247
- }, wrapperClass: "tab__iconToolbar iconInfo" })), this.toolbar && (h(FImage, { resource: "more_vert", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
236
+ }, wrapperClass: "tab__iconToolbar iconInfo" })), this.toolbar && this.toolbarCallback && (h(FImage, { resource: "more_vert", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
237
+ var _a;
248
238
  event.stopPropagation();
249
239
  const el = event.currentTarget;
250
- const data = await this.toolbarCallback();
251
- this.toolbarState = data;
252
- if (this.toolbarState.length > 0) {
240
+ this.toolbarState =
241
+ await this.toolbarCallback();
242
+ if (((_a = this.toolbarState) === null || _a === void 0 ? void 0 : _a.length) > 0) {
253
243
  this.onKupIconClick(el);
254
244
  }
255
245
  else {
256
246
  this.kupManager.debug.logMessage(this, 'Toolbar data is empty, not opening dropdown.');
257
247
  }
258
248
  }, wrapperClass: "tab__iconToolbar iconToolbar" })), isItemExpandible ? (h("div", { class: `accordion-item__dropdown kup-icon ${KupThemeIconValues.DROPDOWN.replace('--', '')}` })) : null));
259
- items.push(h("div", { class: "accordion-item" }, h("div", { tabindex: i, title: (_a = node.title) !== null && _a !== void 0 ? _a : null, class: itemHeaderClass, onClick: () => this.toggleItem(node), onBlur: () => this.onKupBlur(node),
260
- // onClick={() => this.onKupClick(i, node)}
261
- onFocus: () => this.onKupFocus(node) }, node.icon ? (h(FImage, { color: `var(${KupThemeColorValues.PRIMARY})`, resource: node.icon, placeholderResource: node.placeholderIcon, sizeX: "1.5em", sizeY: "1.5em", wrapperClass: "accordion-item__icon" })) : null, node.value ? (h("span", { class: "accordion-item__text" }, (_b = node.value) !== null && _b !== void 0 ? _b : '')) : null, wrapper), h("div", { class: itemContentClass }, h("slot", { name: node.id }))));
249
+ items.push(h("div", { class: "accordion-item" }, h("div", { tabindex: i, title: (_a = node.title) !== null && _a !== void 0 ? _a : null, class: itemHeaderClass, onClick: (e) => {
250
+ e.stopPropagation();
251
+ this.toggleItem(node);
252
+ }, onBlur: () => this.onKupBlur(node), onFocus: () => this.onKupFocus(node) }, node.icon ? (h(FImage, { color: `var(${KupThemeColorValues.PRIMARY})`, resource: node.icon, placeholderResource: node.placeholderIcon, sizeX: "1.5em", sizeY: "1.5em", wrapperClass: "accordion-item__icon" })) : null, node.value ? (h("span", { class: "accordion-item__text" }, (_b = node.value) !== null && _b !== void 0 ? _b : '')) : null, wrapper), h("div", { class: itemContentClass }, h("slot", { name: node.id }))));
262
253
  }
263
254
  return items;
264
255
  }
@@ -384,7 +375,7 @@ export class KupAccordion {
384
375
  }
385
376
  render() {
386
377
  const content = this.data && this.data.length ? this.renderItems() : null;
387
- return (h(Host, { key: '3f9af91ddcf48e60b8ac506dfbc7991eea418f70' }, h("style", { key: '3179a55c30b7a726f2f6cc20f15fd4c3003160c5' }, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { key: 'f7f9910a40af9bb7f0891523d1b30e3d7677c5b6', id: componentWrapperId }, h("div", { key: 'c267fd8005f786b4a0e9207ab553b12a7044cc46', class: "accordion" }, content))));
378
+ return (h(Host, { key: '2b6280c1daf20870cb5a73f3c8f2c8e7272d9cd4' }, h("style", { key: '92169351854c60b65712dc174214ac450172dbf1' }, this.kupManager.theme.setKupStyle(this.rootElement)), h("div", { key: '20a65571ec0481ddf2938e29f48c2d26c7c637c7', id: componentWrapperId }, h("div", { key: '8389a5bd3752c0ee21658de14f5e3590890b944c', class: "accordion" }, content))));
388
379
  }
389
380
  disconnectedCallback() {
390
381
  this.kupManager.theme.unregister(this);
@@ -663,27 +654,6 @@ export class KupAccordion {
663
654
  }
664
655
  }
665
656
  }
666
- }, {
667
- "method": "kupInfoIconClick",
668
- "name": "kup-accordion-infoiconclick",
669
- "bubbles": true,
670
- "cancelable": false,
671
- "composed": true,
672
- "docs": {
673
- "tags": [],
674
- "text": "Triggered when the icon inside accordion is clicked."
675
- },
676
- "complexType": {
677
- "original": "KupAccordionEventPayload",
678
- "resolved": "KupAccordionEventPayload",
679
- "references": {
680
- "KupAccordionEventPayload": {
681
- "location": "import",
682
- "path": "./kup-accordion-declarations",
683
- "id": "src/components/kup-accordion/kup-accordion-declarations.ts::KupAccordionEventPayload"
684
- }
685
- }
686
- }
687
657
  }, {
688
658
  "method": "kupFocus",
689
659
  "name": "kup-accordion-focus",
@@ -314,26 +314,30 @@ export class KupTabBar {
314
314
  'kup-danger': node.danger,
315
315
  };
316
316
  const tabEl = (h("f-button", { class: tabClass, role: "tab", "aria-selected": node.active ? true : false, tabIndex: i, title: node.title ? node.title : null, onBlur: () => this.onKupBlur(i, node), onClick: () => this.onKupClick(i, node), onFocus: () => this.onKupFocus(i, node) }, h("span", { class: "tab__content" }, node.icon ? (h(FImage, { color: `var(${KupThemeColorValues.PRIMARY})`, resource: node.icon, placeholderResource: node.placeholderIcon, wrapperClass: "tab__icon" })) : null, node.value ? (h("span", { class: "tab__text-label" }, node.value)) : null), this.infoIcon && (h(FImage, { resource: "info_outline", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
317
- event.stopPropagation();
318
- const el = event.currentTarget;
319
- const data = await this.infoCallback();
320
- this.infoState = data;
321
- if (this.infoState.length > 0) {
322
- this.onKupInfoIconClick(el);
323
- }
324
- else {
325
- this.kupManager.debug.logMessage(this, 'InfoIcon data is empty, not opening dropdown.');
317
+ if (node.active) {
318
+ event.stopPropagation();
319
+ const el = event.currentTarget;
320
+ const data = await this.infoCallback();
321
+ this.infoState = data;
322
+ if (this.infoState.length > 0) {
323
+ this.onKupInfoIconClick(el);
324
+ }
325
+ else {
326
+ this.kupManager.debug.logMessage(this, 'InfoIcon data is empty, not opening dropdown.');
327
+ }
326
328
  }
327
329
  }, wrapperClass: "tab__iconToolbar iconInfo" })), this.toolbar && (h(FImage, { resource: "more_vert", sizeX: "16px", sizeY: "16px", onClick: async (event) => {
328
- event.stopPropagation();
329
- const el = event.currentTarget;
330
- const data = await this.toolbarCallback();
331
- this.toolbarState = data;
332
- if (this.toolbarState.length > 0) {
333
- this.onKupIconClick(el);
334
- }
335
- else {
336
- this.kupManager.debug.logMessage(this, 'Toolbar data is empty, not opening dropdown.');
330
+ if (node.active) {
331
+ event.stopPropagation();
332
+ const el = event.currentTarget;
333
+ const data = await this.toolbarCallback();
334
+ this.toolbarState = data;
335
+ if (this.toolbarState.length > 0) {
336
+ this.onKupIconClick(el);
337
+ }
338
+ else {
339
+ this.kupManager.debug.logMessage(this, 'Toolbar data is empty, not opening dropdown.');
340
+ }
337
341
  }
338
342
  }, wrapperClass: "tab__iconToolbar iconToolbar" })), h("span", { class: `tab-indicator ${node.active ? ' tab-indicator--active' : ''}` }, h("span", { class: "tab-indicator__content tab-indicator__content--underline" }))));
339
343
  tabBar.push(tabEl);
@@ -650,27 +654,6 @@ export class KupTabBar {
650
654
  }
651
655
  }
652
656
  }
653
- }, {
654
- "method": "kupInfoIconClick",
655
- "name": "kup-tabbar-infoiconclick",
656
- "bubbles": true,
657
- "cancelable": false,
658
- "composed": true,
659
- "docs": {
660
- "tags": [],
661
- "text": "Triggered when the icon inside tab is clicked."
662
- },
663
- "complexType": {
664
- "original": "KupTabBarEventPayload",
665
- "resolved": "KupTabBarEventPayload",
666
- "references": {
667
- "KupTabBarEventPayload": {
668
- "location": "import",
669
- "path": "./kup-tab-bar-declarations",
670
- "id": "src/components/kup-tab-bar/kup-tab-bar-declarations.ts::KupTabBarEventPayload"
671
- }
672
- }
673
- }
674
657
  }, {
675
658
  "method": "kupFocus",
676
659
  "name": "kup-tabbar-focus",