bromcom-ui 3.0.0-alpha.3 → 3.0.0-alpha.5

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 (156) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/p-01eaca9a.entry.js +5 -0
  4. package/dist/bromcom-ui/{p-dc8b7bd5.entry.js → p-0b7de283.entry.js} +1 -1
  5. package/dist/bromcom-ui/{p-ff8adde6.entry.js → p-0e75f6ba.entry.js} +1 -1
  6. package/dist/bromcom-ui/{p-3a6e9576.entry.js → p-112b9a62.entry.js} +1 -1
  7. package/dist/bromcom-ui/{p-be96827e.js → p-1535f9b1.js} +1 -1
  8. package/dist/bromcom-ui/{p-ef839034.entry.js → p-32ce6cf6.entry.js} +1 -1
  9. package/dist/bromcom-ui/{p-33d97b3f.entry.js → p-33b2ed75.entry.js} +1 -1
  10. package/dist/bromcom-ui/p-3ddd3c83.entry.js +5 -0
  11. package/dist/bromcom-ui/{p-e115af8a.entry.js → p-4545a13d.entry.js} +1 -1
  12. package/dist/bromcom-ui/{p-f1de8ed5.entry.js → p-5532696c.entry.js} +1 -1
  13. package/dist/bromcom-ui/{p-f6e710ff.entry.js → p-69adb859.entry.js} +1 -1
  14. package/dist/bromcom-ui/{p-d0647951.js → p-6ce02d0a.js} +1 -1
  15. package/dist/bromcom-ui/p-7c08789d.entry.js +5 -0
  16. package/dist/bromcom-ui/{p-b7f449ff.entry.js → p-803739bc.entry.js} +1 -1
  17. package/dist/bromcom-ui/{p-3b988ad1.entry.js → p-8390dd02.entry.js} +1 -1
  18. package/dist/bromcom-ui/p-91197b04.js +5 -0
  19. package/dist/bromcom-ui/{p-b9b9d753.entry.js → p-a80e6310.entry.js} +1 -1
  20. package/dist/bromcom-ui/p-aa67918a.entry.js +5 -0
  21. package/dist/bromcom-ui/{p-91aa21af.entry.js → p-acab07ec.entry.js} +1 -1
  22. package/dist/bromcom-ui/{p-a53c3682.entry.js → p-b333a3d7.entry.js} +1 -1
  23. package/dist/bromcom-ui/{p-b386e9c9.entry.js → p-b7787c11.entry.js} +1 -1
  24. package/dist/bromcom-ui/{p-2e7ffc5a.entry.js → p-b7c56cbe.entry.js} +1 -1
  25. package/dist/bromcom-ui/{p-221095a9.entry.js → p-c36a7889.entry.js} +1 -1
  26. package/dist/bromcom-ui/p-ce0ab4e3.entry.js +5 -0
  27. package/dist/bromcom-ui/{p-ee75cd00.js → p-d3cf91a9.js} +1 -1
  28. package/dist/bromcom-ui/p-d5464577.entry.js +16 -0
  29. package/dist/bromcom-ui/{p-bd77f532.entry.js → p-d7a619c5.entry.js} +1 -1
  30. package/dist/bromcom-ui/{p-baa4193d.entry.js → p-e36b6b08.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-6c7fdf95.entry.js → p-f15c1d3d.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-8001040c.js → p-fc29c94d.js} +1 -1
  33. package/dist/cjs/bcm-accordion_69.cjs.entry.js +722 -66
  34. package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +4 -4
  35. package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +4 -4
  36. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +2 -2
  37. package/dist/cjs/bcm-caption.cjs.entry.js +4 -4
  38. package/dist/cjs/bcm-card.cjs.entry.js +2 -2
  39. package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
  40. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -2
  41. package/dist/cjs/bcm-default.cjs.entry.js +2 -2
  42. package/dist/cjs/bcm-file-upload.cjs.entry.js +578 -0
  43. package/dist/cjs/bcm-form-2.cjs.entry.js +3 -2
  44. package/dist/cjs/bcm-input-2.cjs.entry.js +2 -2
  45. package/dist/cjs/bcm-input-custom.cjs.entry.js +2 -2
  46. package/dist/cjs/bcm-input-dropdown.cjs.entry.js +4 -4
  47. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +4 -4
  48. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +4 -4
  49. package/dist/cjs/bcm-modal-2.cjs.entry.js +4 -4
  50. package/dist/cjs/bcm-number-input.cjs.entry.js +12 -6
  51. package/dist/cjs/bcm-skeleton.cjs.entry.js +4 -4
  52. package/dist/cjs/bcm-table.cjs.entry.js +4 -4
  53. package/dist/cjs/bcm-tag.cjs.entry.js +3 -3
  54. package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
  55. package/dist/cjs/bcm-toast.cjs.entry.js +17 -11
  56. package/dist/cjs/bromcom-ui.cjs.js +3 -3
  57. package/dist/cjs/{generate-554f54dc.js → generate-9d1bf6b3.js} +1 -1
  58. package/dist/cjs/{global-90b5dbce.js → global-d69a64ec.js} +1 -1
  59. package/dist/cjs/loader.cjs.js +3 -3
  60. package/dist/cjs/{number-helper-677e9c02.js → number-helper-ae28b255.js} +1 -1
  61. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +3 -3
  62. package/dist/cjs/old-bcm-popover.cjs.entry.js +2 -2
  63. package/dist/cjs/{package-8445ccd4.js → package-6de220be.js} +1 -1
  64. package/dist/cjs/{validators-92f2f1ef.js → validators-3381bee2.js} +1 -1
  65. package/dist/collection/collection-manifest.json +1 -0
  66. package/dist/collection/components/atoms/button/button.js +1 -1
  67. package/dist/collection/components/atoms/button/types.js +7 -0
  68. package/dist/collection/components/molecules/color-input/color-input.js +5 -22
  69. package/dist/collection/components/molecules/color-palette/color-palette.js +4 -4
  70. package/dist/collection/components/molecules/dropdown/dropdown.js +36 -1
  71. package/dist/collection/components/molecules/linked/linked-focus-manager.js +86 -0
  72. package/dist/collection/components/molecules/linked/linked.js +43 -1
  73. package/dist/collection/components/molecules/number-input/number-input.js +8 -2
  74. package/dist/collection/components/molecules/number-input/react-input.js +1 -1
  75. package/dist/collection/components/molecules/upload/file-upload.component.js +1060 -0
  76. package/dist/collection/components/molecules/upload/file-upload.style.js +201 -0
  77. package/dist/collection/components/organism/form/form.js +1 -0
  78. package/dist/collection/components/organism/form-2/bcm-form-components.js +1 -0
  79. package/dist/collection/components/organism/list/list-focus-manager.js +344 -0
  80. package/dist/collection/components/organism/list/list-key-control.js +9 -4
  81. package/dist/collection/components/organism/list/list.css +8 -3
  82. package/dist/collection/components/organism/list/list.js +227 -27
  83. package/dist/collection/components/other/toast/toast.js +15 -9
  84. package/dist/collection/components/other_deprecated/old-tag/old-tag.js +1 -1
  85. package/dist/collection/components/other_deprecated/tag/tag.js +1 -1
  86. package/dist/collection/templates/list-item-template.js +6 -5
  87. package/dist/collection/templates/list-template.js +2 -2
  88. package/dist/components/bcm-color-input.js +5 -22
  89. package/dist/components/bcm-dropdown.js +35 -0
  90. package/dist/components/bcm-file-upload.d.ts +11 -0
  91. package/dist/components/bcm-file-upload.js +625 -0
  92. package/dist/components/bcm-form-2.js +1 -0
  93. package/dist/components/bcm-number-input.js +8 -2
  94. package/dist/components/bcm-toast.js +15 -9
  95. package/dist/components/button.js +7 -0
  96. package/dist/components/color-palette.js +2 -2
  97. package/dist/components/form.js +1 -0
  98. package/dist/components/generate.js +1 -1
  99. package/dist/components/index.d.ts +1 -0
  100. package/dist/components/index.js +1 -0
  101. package/dist/components/linked.js +105 -2
  102. package/dist/components/list.js +567 -39
  103. package/dist/esm/bcm-accordion_69.entry.js +722 -66
  104. package/dist/esm/bcm-attendance-actions-comment.entry.js +4 -4
  105. package/dist/esm/bcm-attendance-actions-dropdown.entry.js +4 -4
  106. package/dist/esm/bcm-breadcrumb.entry.js +2 -2
  107. package/dist/esm/bcm-caption.entry.js +4 -4
  108. package/dist/esm/bcm-card.entry.js +2 -2
  109. package/dist/esm/bcm-date-picker.entry.js +2 -2
  110. package/dist/esm/bcm-datetime-picker.entry.js +2 -2
  111. package/dist/esm/bcm-default.entry.js +2 -2
  112. package/dist/esm/bcm-file-upload.entry.js +574 -0
  113. package/dist/esm/bcm-form-2.entry.js +3 -2
  114. package/dist/esm/bcm-input-2.entry.js +2 -2
  115. package/dist/esm/bcm-input-custom.entry.js +2 -2
  116. package/dist/esm/bcm-input-dropdown.entry.js +4 -4
  117. package/dist/esm/bcm-modal-2-footer.entry.js +4 -4
  118. package/dist/esm/bcm-modal-2-header.entry.js +4 -4
  119. package/dist/esm/bcm-modal-2.entry.js +4 -4
  120. package/dist/esm/bcm-number-input.entry.js +12 -6
  121. package/dist/esm/bcm-skeleton.entry.js +4 -4
  122. package/dist/esm/bcm-table.entry.js +4 -4
  123. package/dist/esm/bcm-tag.entry.js +3 -3
  124. package/dist/esm/bcm-time-picker.entry.js +2 -2
  125. package/dist/esm/bcm-toast.entry.js +17 -11
  126. package/dist/esm/bromcom-ui.js +3 -3
  127. package/dist/esm/{generate-8a394b83.js → generate-56d49b70.js} +1 -1
  128. package/dist/esm/{global-7919f57f.js → global-97c42a5f.js} +1 -1
  129. package/dist/esm/loader.js +3 -3
  130. package/dist/esm/{number-helper-a86adc72.js → number-helper-455ab41e.js} +1 -1
  131. package/dist/esm/old-bcm-popover-box.entry.js +3 -3
  132. package/dist/esm/old-bcm-popover.entry.js +2 -2
  133. package/dist/esm/{package-278e08d9.js → package-edee14d5.js} +1 -1
  134. package/dist/esm/{validators-89e791a1.js → validators-cc882165.js} +1 -1
  135. package/dist/types/components/atoms/button/types.d.ts +8 -1
  136. package/dist/types/components/molecules/color-input/color-input.d.ts +1 -4
  137. package/dist/types/components/molecules/dropdown/dropdown.d.ts +7 -0
  138. package/dist/types/components/molecules/linked/linked-focus-manager.d.ts +13 -0
  139. package/dist/types/components/molecules/linked/linked.d.ts +3 -0
  140. package/dist/types/components/molecules/number-input/number-input.d.ts +1 -0
  141. package/dist/types/components/molecules/upload/file-upload.component.d.ts +233 -0
  142. package/dist/types/components/molecules/upload/file-upload.style.d.ts +548 -0
  143. package/dist/types/components/organism/list/list-focus-manager.d.ts +53 -0
  144. package/dist/types/components/organism/list/list-key-control.d.ts +1 -0
  145. package/dist/types/components/organism/list/list.d.ts +18 -1
  146. package/dist/types/components/other/toast/toast.d.ts +1 -0
  147. package/dist/types/components.d.ts +417 -1
  148. package/dist/types/templates/list-item-template.d.ts +2 -0
  149. package/dist/types/templates/list-template.d.ts +2 -0
  150. package/package.json +1 -1
  151. package/dist/bromcom-ui/p-16b8a312.entry.js +0 -16
  152. package/dist/bromcom-ui/p-839b6fd5.entry.js +0 -5
  153. package/dist/bromcom-ui/p-be8aa3b8.entry.js +0 -5
  154. package/dist/bromcom-ui/p-d0aa71e1.entry.js +0 -5
  155. package/dist/bromcom-ui/p-df92d838.js +0 -5
  156. package/dist/bromcom-ui/p-dfd73f7c.entry.js +0 -5
@@ -21,11 +21,22 @@ import { Host, h } from "@stencil/core";
21
21
  import cs from "classnames";
22
22
  import snq from "snq";
23
23
  import listState from "../states/bcm-list2.states";
24
+ import { ListFocusManager } from "./list-focus-manager";
24
25
  import { ListKeyControl } from "./list-key-control";
25
26
  export class BcmList {
26
27
  constructor() {
28
+ var _a, _b;
27
29
  this.debounce = null;
30
+ this.focusManager = new ListFocusManager();
31
+ this.openTriggerElement = null;
32
+ this.suppressScrollCloseUntil = 0;
28
33
  this.debounceHandler = Generate.debounceInput(() => this.listenResize(), 300, false);
34
+ this.handleVisualViewportChange = () => {
35
+ if (!this.isOpen)
36
+ return;
37
+ this.preventScrollClose(400);
38
+ this.calculateLocation();
39
+ };
29
40
  this._id = Generate.UID();
30
41
  this.tempId = Generate.UID();
31
42
  this.type = Bcm.ListType.listbox;
@@ -107,6 +118,8 @@ export class BcmList {
107
118
  window.addEventListener("scroll", this.handleWheel.bind(this), true);
108
119
  window.addEventListener("wheel", this.handleWheel.bind(this), true);
109
120
  window.addEventListener("resize", this.handleResize.bind(this), true);
121
+ (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.addEventListener("resize", this.handleVisualViewportChange, true);
122
+ (_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.addEventListener("scroll", this.handleVisualViewportChange, true);
110
123
  }
111
124
  connectedCallback() {
112
125
  if (this.height != "256px") {
@@ -157,7 +170,10 @@ export class BcmList {
157
170
  // }
158
171
  }
159
172
  disconnectedCallback() {
173
+ var _a, _b;
160
174
  this.isOpen = false;
175
+ (_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.removeEventListener("resize", this.handleVisualViewportChange, true);
176
+ (_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.removeEventListener("scroll", this.handleVisualViewportChange, true);
161
177
  if (this.stopDeepClean)
162
178
  return;
163
179
  listState.removeState(this._id);
@@ -216,8 +232,10 @@ export class BcmList {
216
232
  }
217
233
  async handleOpen() {
218
234
  const isAutoSelected = this.autoFocusSelected && this.type == "select" && !this.checkboxes && this.value;
235
+ const isMobile = this.isMobileViewport();
219
236
  if (this.isOpen) {
220
237
  this.detectClone();
238
+ await this.prepareMobileViewportForOpen();
221
239
  if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
222
240
  const list = this.el.querySelector(`#bcm-list-${this._id}`);
223
241
  if (list) {
@@ -228,7 +246,9 @@ export class BcmList {
228
246
  this.open.emit();
229
247
  this.calculateLocation();
230
248
  this.onSelectSearch();
231
- await delay(50);
249
+ if (!isMobile) {
250
+ await delay(50);
251
+ }
232
252
  this.isOpenAnimation = true;
233
253
  if (isAutoSelected) {
234
254
  this.focusSelectedElement();
@@ -286,11 +306,41 @@ export class BcmList {
286
306
  this.calculateLocation();
287
307
  }
288
308
  }
309
+ else if (this.shouldKeepOpenWhileInteracting(list)) {
310
+ if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
311
+ this.calculateLocation();
312
+ }
313
+ }
289
314
  else {
290
315
  this.hide();
291
316
  }
292
317
  }
293
318
  }
319
+ handleTouchStart(event) {
320
+ if (!this.isOpen)
321
+ return;
322
+ const list = document.querySelector(`#bcm-list-${this._id}`);
323
+ const isInside = Generate.findEventPath(event, this.el) || (list && Generate.findEventPath(event, list));
324
+ if (isInside) {
325
+ this.preventScrollClose(1000);
326
+ }
327
+ else if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
328
+ this.isOpen = false;
329
+ }
330
+ }
331
+ handleFocusIn(event) {
332
+ if (!this.isOpen)
333
+ return;
334
+ const list = document.querySelector(`#bcm-list-${this._id}`);
335
+ const isInside = Generate.findEventPath(event, this.el) || (list && Generate.findEventPath(event, list));
336
+ if (isInside) {
337
+ this.preventScrollClose(1000);
338
+ this.calculateLocation();
339
+ }
340
+ else if (this.isOverlayType()) {
341
+ this.isOpen = false;
342
+ }
343
+ }
294
344
  clearAutocomplete() {
295
345
  if (this.type == "autocomplete") {
296
346
  const autocompleteInput = this.getAutoCompleteInput();
@@ -386,8 +436,8 @@ export class BcmList {
386
436
  var _a, _b, _c, _d, _e, _f;
387
437
  if (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.id) === `bcm-list-${this._id}-search` || ((_b = event === null || event === void 0 ? void 0 : event.target) === null || _b === void 0 ? void 0 : _b.id) === `bcm-list-input-tag-container-${this._id}-autocomplete-input`) {
388
438
  this.searchGetParents = snq(() => { var _a; return (_a = event.detail) === null || _a === void 0 ? void 0 : _a.parentIndex; }, null);
389
- this.searchResultLimit = 10;
390
439
  this.searchFound = ((_c = event.detail) === null || _c === void 0 ? void 0 : _c.matching) != null ? (_d = event.detail) === null || _d === void 0 ? void 0 : _d.matching.length : null;
440
+ this.searchResultLimit = this.getInitialSearchResultLimit();
391
441
  this.returnFilterData = listState.filterData(this._id, (_e = event.detail) === null || _e === void 0 ? void 0 : _e.nestedResult);
392
442
  if (this.searchFound > 0 && this.highlight) {
393
443
  this.highlightText = (_f = event.detail) === null || _f === void 0 ? void 0 : _f.value;
@@ -413,13 +463,51 @@ export class BcmList {
413
463
  //keyboard navigation
414
464
  handleKeyDown(ev) {
415
465
  const keycode = ev.keyCode || ev.which;
416
- if (keycode === Bcm.KeyCode.escape) {
417
- if (this.isOpen) {
466
+ const handled = this.focusManager.handleKeyDown({
467
+ event: ev,
468
+ disabled: this.disabled,
469
+ isOpen: this.isOpen,
470
+ isOverlayType: this.isOverlayType(),
471
+ hostElement: this.el,
472
+ targetElement: this.getTargetElement(),
473
+ listElement: document.getElementById(`bcm-list-${this._id}`),
474
+ openList: () => {
475
+ this.rememberOpenTrigger();
476
+ this.isOpen = true;
477
+ },
478
+ closeList: () => {
418
479
  this.isOpen = false;
419
- ev.preventDefault();
420
- ev.stopPropagation();
421
- ev.stopImmediatePropagation();
422
- }
480
+ },
481
+ selectFocusedItem: (itemId) => {
482
+ if (this.checkboxes) {
483
+ this.checkedItem(itemId);
484
+ }
485
+ else {
486
+ this.selectedItem(itemId);
487
+ }
488
+ },
489
+ openGroup: (itemId) => {
490
+ this.openGroup(itemId);
491
+ },
492
+ treeview: this.treeview,
493
+ checkboxes: this.checkboxes,
494
+ autocompleteInput: this.type == "autocomplete" ? this.getAutoCompleteInput() : null,
495
+ openTriggerElement: this.openTriggerElement,
496
+ });
497
+ if (handled)
498
+ return;
499
+ if ((ev.key === "Escape" || keycode === Bcm.KeyCode.escape) && this.isOpen) {
500
+ this.isOpen = false;
501
+ ev.preventDefault();
502
+ ev.stopPropagation();
503
+ ev.stopImmediatePropagation();
504
+ this.focusManager.restoreTriggerFocus({
505
+ hostElement: this.el,
506
+ targetElement: this.getTargetElement(),
507
+ autocompleteInput: this.type == "autocomplete" ? this.getAutoCompleteInput() : null,
508
+ openTriggerElement: this.openTriggerElement,
509
+ preferOpenTrigger: true,
510
+ });
423
511
  }
424
512
  if (this.keyControl) {
425
513
  const keyboard = new ListKeyControl(keycode, this.el, this.treeview, this.checkboxes);
@@ -429,6 +517,9 @@ export class BcmList {
429
517
  keyboard.checkedItem = checkedItemId => {
430
518
  this.checkedItem(checkedItemId);
431
519
  };
520
+ keyboard.selectedItem = itemId => {
521
+ this.selectedItem(itemId);
522
+ };
432
523
  keyboard.keyDown();
433
524
  }
434
525
  }
@@ -538,7 +629,8 @@ export class BcmList {
538
629
  });
539
630
  }
540
631
  }
541
- async show() {
632
+ async show(openTriggerElement) {
633
+ this.rememberOpenTrigger(openTriggerElement);
542
634
  this.isOpen = true;
543
635
  return Promise.resolve();
544
636
  }
@@ -575,11 +667,50 @@ export class BcmList {
575
667
  async onSelectSearch() {
576
668
  const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
577
669
  if (searchInput) {
670
+ this.preventScrollClose(1000);
578
671
  await delay(100);
579
672
  searchInput.onBcmFocus();
580
673
  searchInput.onBcmSelect();
581
674
  }
582
675
  }
676
+ preventScrollClose(duration = 500) {
677
+ this.suppressScrollCloseUntil = Date.now() + duration;
678
+ }
679
+ isMobileViewport() {
680
+ return window.matchMedia("(max-width: 768px), (pointer: coarse)").matches;
681
+ }
682
+ async prepareMobileViewportForOpen() {
683
+ var _a;
684
+ if (!this.isMobileViewport() || !(this.type == "select" || this.type == "autocomplete" || this.linkedComponent)) {
685
+ return;
686
+ }
687
+ const targetElementId = this.linkedComponent ? this.linkedComponent : `bcm-list-input-${this._id}`;
688
+ const targetElement = document.getElementById(targetElementId);
689
+ if (!targetElement)
690
+ return;
691
+ const viewportHeight = ((_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height) || window.innerHeight;
692
+ const rect = targetElement.getBoundingClientRect();
693
+ const minimumSpaceBelow = Math.min(320, viewportHeight * 0.45);
694
+ const shouldReposition = rect.top > viewportHeight * 0.35 || viewportHeight - rect.bottom < minimumSpaceBelow;
695
+ if (shouldReposition) {
696
+ this.preventScrollClose(1200);
697
+ const desiredTop = Math.max(110, Math.min(180, viewportHeight * 0.24));
698
+ const delta = rect.top - desiredTop;
699
+ window.scrollBy({
700
+ top: delta,
701
+ left: 0,
702
+ behavior: "auto",
703
+ });
704
+ await delay(50);
705
+ this.calculateLocation();
706
+ }
707
+ }
708
+ shouldKeepOpenWhileInteracting(list) {
709
+ var _a;
710
+ const activeElement = document.activeElement;
711
+ const focusedInside = !!(activeElement && (((_a = this.el) === null || _a === void 0 ? void 0 : _a.contains(activeElement)) || (list === null || list === void 0 ? void 0 : list.contains(activeElement))));
712
+ return focusedInside || Date.now() < this.suppressScrollCloseUntil;
713
+ }
583
714
  async filterOtherList(ids) {
584
715
  const checklist = (await this.getCheckedList()).nestedResult;
585
716
  const filter = Generate.convertIdsToNestedData(ids, checklist);
@@ -642,8 +773,30 @@ export class BcmList {
642
773
  }
643
774
  return snq(() => listState.getData(this._id), []);
644
775
  }
776
+ hasNestedItems(items = []) {
777
+ return items.some((item) => { var _a; return (item === null || item === void 0 ? void 0 : item.type) === "group" || ((_a = item === null || item === void 0 ? void 0 : item.items) === null || _a === void 0 ? void 0 : _a.length) > 0; });
778
+ }
779
+ getVisibleSearchItems() {
780
+ const visibledItems = this.returnFilterData["visibledItems"];
781
+ if (this.searchFound == null || !Array.isArray(visibledItems)) {
782
+ return null;
783
+ }
784
+ return visibledItems;
785
+ }
786
+ getInitialSearchResultLimit() {
787
+ if (this.searchFound === 0) {
788
+ return 0;
789
+ }
790
+ const initialLimit = Math.max(10, this.limit);
791
+ return this.searchFound == null ? initialLimit : Math.min(initialLimit, this.searchFound);
792
+ }
645
793
  getLimitedItems(ids) {
646
- return snq(() => listState.getDataPagination(this._id, this.searchResultLimit || this.limit, ids), []);
794
+ const visibleSearchItems = this.getVisibleSearchItems();
795
+ const limit = this.searchResultLimit || this.limit;
796
+ if (visibleSearchItems && !this.hasNestedItems(this.getItems())) {
797
+ return visibleSearchItems.slice(0, limit);
798
+ }
799
+ return snq(() => listState.getDataPagination(this._id, limit, ids), []);
647
800
  }
648
801
  openGroup(parentId) {
649
802
  listState.openGroup(this._id, parentId);
@@ -671,7 +824,15 @@ export class BcmList {
671
824
  this.value = listState.selectedItem(this._id, itemId) ? listState.selectedItem(this._id, itemId)[0] : null;
672
825
  this.inputText = Generate.domParser((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
673
826
  this.isOpen = false;
674
- this.markForCheck();
827
+ await this.markForCheck();
828
+ if (this.isOverlayType()) {
829
+ await delay(10);
830
+ this.focusManager.restoreTriggerFocus({
831
+ hostElement: this.el,
832
+ targetElement: this.getTargetElement(),
833
+ autocompleteInput: this.type == "autocomplete" ? this.getAutoCompleteInput() : null,
834
+ });
835
+ }
675
836
  if (this.type == "autocomplete" && this.value) {
676
837
  // await delay(100)
677
838
  // this.resetCaption()
@@ -709,15 +870,36 @@ export class BcmList {
709
870
  getAutoCompleteInput() {
710
871
  return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`);
711
872
  }
873
+ rememberOpenTrigger(openTriggerElement) {
874
+ const activeElement = openTriggerElement || document.activeElement;
875
+ this.openTriggerElement = this.isValidOpenTrigger(activeElement) ? activeElement : null;
876
+ }
877
+ isValidOpenTrigger(element) {
878
+ return !!(element && element.isConnected && element !== document.body && element !== document.documentElement);
879
+ }
880
+ isOverlayType() {
881
+ return this.type == "select" || this.type == "autocomplete" || !!this.linkedComponent;
882
+ }
883
+ getTargetElement() {
884
+ const targetElementId = this.linkedComponent ? this.linkedComponent : `bcm-list-input-${this._id}`;
885
+ return document.getElementById(targetElementId);
886
+ }
712
887
  /** @description Fixes the issue where the list appears empty during fast scrolling. */
713
888
  dataScrollEvent(event) {
714
889
  var _a, _b;
715
890
  const itemHeight = this.size === 'small' ? 28 : this.size === 'large' ? 48 : 36;
716
891
  const currentScrollBottom = ((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.scrollTop) + ((_b = event === null || event === void 0 ? void 0 : event.target) === null || _b === void 0 ? void 0 : _b.clientHeight);
717
892
  const requiredItems = Math.ceil(currentScrollBottom / itemHeight) + 20;
718
- if (requiredItems > this.limit) {
719
- this.limit = requiredItems;
720
- this.searchResultLimit = requiredItems;
893
+ const isSearchActive = this.searchFound != null && !this.isSelectedOther;
894
+ const currentLimit = isSearchActive ? this.searchResultLimit || 0 : this.limit;
895
+ if (requiredItems > currentLimit) {
896
+ if (isSearchActive) {
897
+ this.searchResultLimit = Math.min(requiredItems, this.searchFound);
898
+ }
899
+ else {
900
+ this.limit = requiredItems;
901
+ this.searchResultLimit = requiredItems;
902
+ }
721
903
  }
722
904
  }
723
905
  async calculateLocation() {
@@ -790,20 +972,20 @@ export class BcmList {
790
972
  }
791
973
  /** @description Focus selected element * BUG 282262 */
792
974
  focusSelectedElement() {
793
- var _a;
975
+ var _a, _b;
794
976
  const listElement = document.querySelector(`#bcm-list-${this._id}`);
795
977
  if (!listElement)
796
978
  return;
797
- const selectedId = (_a = this.value) === null || _a === void 0 ? void 0 : _a.id;
979
+ const selectedId = Array.isArray(this.value) ? (_a = this.value[0]) === null || _a === void 0 ? void 0 : _a.id : (_b = this.value) === null || _b === void 0 ? void 0 : _b.id;
798
980
  if (selectedId) {
799
- const targetItem = listElement.querySelector(`[id*="${selectedId}"]`);
800
- if (targetItem) {
801
- targetItem.scrollIntoView({
802
- block: 'center',
803
- inline: 'nearest',
804
- behavior: 'auto'
805
- });
806
- targetItem.focus();
981
+ const targetItem = (listElement.querySelector(`[id="${selectedId}"]`) || listElement.querySelector(`[id*="${selectedId}"]`));
982
+ const scrollContainer = listElement.querySelector(".scrolling");
983
+ if (targetItem && scrollContainer) {
984
+ const containerRect = scrollContainer.getBoundingClientRect();
985
+ const itemRect = targetItem.getBoundingClientRect();
986
+ const relativeOffsetTop = itemRect.top - containerRect.top + scrollContainer.scrollTop;
987
+ scrollContainer.scrollTop = relativeOffsetTop - (containerRect.height / 2) + (itemRect.height / 2);
988
+ targetItem.focus({ preventScroll: true });
807
989
  const items = listElement.querySelectorAll(".bcm-list__item");
808
990
  items.forEach(i => i.classList.remove("focused"));
809
991
  targetItem.classList.add("focused");
@@ -838,7 +1020,7 @@ export class BcmList {
838
1020
  "--min-height": openedType ? "inherit" : this.minHeight,
839
1021
  } }, h("div", { id: `bcm-list-label-${this._id}`, class: "bcm-list__label" }, label && (h("div", null, h("bcm-label", { tooltip: this.tooltip, size: this.size, type: this.captionType, value: label, required: required, htmlFor: this._id })))), this.type == "select" && (h("div", { id: `bcm-list-input-${this._id}`, class: bcmListInput }, h("span", { class: cs("bcm-list__input-container", { "type-single": !checkboxes, "value-empty": !this.value }) }, this.checkboxes ? (this.value && this.value.length > 0 ? (h("bcm-rc-overflow", { data: this.tagData, maxCount: this.tagCount })) : (h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))) : this.value ? (this.inputText) : (h("span", { class: "bcm-list__input-placeholder" }, this.placeholder))), h("span", { class: cs("bcm-list__input-buttons", {
840
1022
  disabled: disabled,
841
- }) }, this.clearable && this.value && (h("div", { class: "bcm-list__input-buttons-button" }, h("bcm-icon", { icon: "fal fa-times", onClick: e => !disabled && this.setClear(e) }))), h("div", { class: `bcm-list__input-buttons-button caret-is ${this.isOpen && this.calculatedViewport && "caret-is-open"}` }, h("bcm-icon", { icon: `far fa-angle-down` }))))), this.type === "autocomplete" && (h("div", { id: `bcm-list-input-${this._id}`, class: cs(bcmListInput, { "bcm-list__input-autocomplete": this.type == "autocomplete" }) }, h("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` }, this.checkboxes && h("span", { class: "bcm-list__input-tag-container", id: `bcm-list-input-tag-container-${this._id}-autocomplete` }), h("bcm-search", { id: `bcm-list-input-tag-container-${this._id}-autocomplete-input`, class: "bcm-list__autocomplete", data: this.data, clearable: true, "full-width": true, "no-caption": true, placeholder: this.placeholder })))), h(ListTemplate, { type: this.type, highlight: this.highlightText, searchable: this.type == "autocomplete" ? false : searchable, bcmListContainer: bcmListContainer, checkboxes: checkboxes, treeview: treeview, infoFooter: this.infoFooter, value: this.value, totalData: this.totalData, searchFound: this.searchFound, variableText: this.variableText, searchPlaceholder: this.searchPlaceholder, minSearchLength: this.minSearchLength, searchIsOnlyChilds: this.searchIsOnlyChilds, _id: this._id, tempId: this.tempId, checkAll: this.checkAll, data: this.getItems(), width: this.width, height: this.height, size: this.size, selectAllItem: this.selectAllItem, onScrollEvent: e => this.dataScrollEvent(e), items: this.getLimitedItems(this.searchGetParents), selectedItem: itemId => this.selectedItem(itemId), checkedItem: itemId => this.checkedItem(itemId), openGroup: parentId => this.openGroup(parentId), focusItem: itemId => this.focusItem(itemId), emptyText: this.emptyText, emptyIcon: this.emptyIcon, handleTransitionEnd: e => this.handleTransitionEnd(e) }), h(CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
1023
+ }) }, this.clearable && this.value && (h("div", { class: "bcm-list__input-buttons-button" }, h("bcm-icon", { icon: "fal fa-times", onClick: e => !disabled && this.setClear(e) }))), h("div", { class: `bcm-list__input-buttons-button caret-is ${this.isOpen && this.calculatedViewport && "caret-is-open"}` }, h("bcm-icon", { icon: `far fa-angle-down` }))))), this.type === "autocomplete" && (h("div", { id: `bcm-list-input-${this._id}`, class: cs(bcmListInput, { "bcm-list__input-autocomplete": this.type == "autocomplete" }) }, h("span", { class: "bcm-list__input-container", id: `bcm-list-input-tag-container-${this._id}` }, this.checkboxes && h("span", { class: "bcm-list__input-tag-container", id: `bcm-list-input-tag-container-${this._id}-autocomplete` }), h("bcm-search", { id: `bcm-list-input-tag-container-${this._id}-autocomplete-input`, class: "bcm-list__autocomplete", data: this.data, clearable: true, "full-width": true, "no-caption": true, placeholder: this.placeholder })))), h(ListTemplate, { type: this.type, highlight: this.highlightText, searchable: this.type == "autocomplete" ? false : searchable, bcmListContainer: bcmListContainer, checkboxes: checkboxes, treeview: treeview, infoFooter: this.infoFooter, value: this.value, totalData: this.totalData, searchFound: this.searchFound, variableText: this.variableText, searchPlaceholder: this.searchPlaceholder, minSearchLength: this.minSearchLength, searchIsOnlyChilds: this.searchIsOnlyChilds, _id: this._id, tempId: this.tempId, checkAll: this.checkAll, data: this.getItems(), width: this.width, height: this.height, size: this.size, selectAllItem: this.selectAllItem, onScrollEvent: e => this.dataScrollEvent(e), items: this.getLimitedItems(this.searchGetParents), selectedItem: itemId => this.selectedItem(itemId), checkedItem: itemId => this.checkedItem(itemId), openGroup: parentId => this.openGroup(parentId), focusItem: itemId => this.focusItem(itemId), emptyText: this.emptyText, emptyIcon: this.emptyIcon, handleTransitionEnd: e => this.handleTransitionEnd(e), disabled: disabled, readonly: readonly }), h(CaptionTemplate, { noCaption: this.noCaption, captionType: this.captionType, captionError: this.captionError, caption: this.caption })));
842
1024
  }
843
1025
  static get is() { return "bcm-list"; }
844
1026
  static get originalStyleUrls() {
@@ -2015,11 +2197,17 @@ export class BcmList {
2015
2197
  },
2016
2198
  "show": {
2017
2199
  "complexType": {
2018
- "signature": "() => Promise<void>",
2019
- "parameters": [],
2200
+ "signature": "(openTriggerElement?: HTMLElement) => Promise<void>",
2201
+ "parameters": [{
2202
+ "tags": [],
2203
+ "text": ""
2204
+ }],
2020
2205
  "references": {
2021
2206
  "Promise": {
2022
2207
  "location": "global"
2208
+ },
2209
+ "HTMLElement": {
2210
+ "location": "global"
2023
2211
  }
2024
2212
  },
2025
2213
  "return": "Promise<void>"
@@ -2085,6 +2273,18 @@ export class BcmList {
2085
2273
  "target": undefined,
2086
2274
  "capture": false,
2087
2275
  "passive": false
2276
+ }, {
2277
+ "name": "touchstart",
2278
+ "method": "handleTouchStart",
2279
+ "target": "window",
2280
+ "capture": true,
2281
+ "passive": true
2282
+ }, {
2283
+ "name": "focusin",
2284
+ "method": "handleFocusIn",
2285
+ "target": "window",
2286
+ "capture": true,
2287
+ "passive": false
2088
2288
  }, {
2089
2289
  "name": "bcm-select-other-tag",
2090
2290
  "method": "handleSelectOtherTag",
@@ -5,7 +5,6 @@
5
5
  import { Host, h } from "@stencil/core";
6
6
  import cs from "classnames";
7
7
  import { Generate } from "../../../helper/generate";
8
- import { StringHelper } from "../../../helper/string-helper";
9
8
  import Bcm from "../../../models/bcm";
10
9
  import { delay } from "../../../utils/utils";
11
10
  export class BcmToast {
@@ -23,6 +22,13 @@ export class BcmToast {
23
22
  this.visible = false;
24
23
  this.visibleContainer = false;
25
24
  }
25
+ renderMultiline(text) {
26
+ if (!text) {
27
+ return null;
28
+ }
29
+ const lines = text.split("\n");
30
+ return lines.map((line, index) => [index > 0 && h("br", null), line]);
31
+ }
26
32
  async show() {
27
33
  const toast = document.getElementById(this._id + "-container");
28
34
  if (toast) {
@@ -78,7 +84,7 @@ export class BcmToast {
78
84
  return container;
79
85
  }
80
86
  render() {
81
- return (h(Host, { class: "tw-hidden" }, h("div", { class: cs({ "tw-hidden": !this.visible }), id: this._id + "-container", onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { class: cs("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out", "tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2", "tw-border-color-default tw-bg-white tw-text-color-default", {
87
+ return (h(Host, { class: "tw-hidden" }, h("div", { class: cs({ "tw-hidden": !this.visible }), id: this._id + "-container", onMouseEnter: () => this.handleMouseEnter(), onMouseLeave: () => this.handleMouseLeave() }, h("div", { class: cs("tw-pointer-events-auto tw-transform tw-transition tw-duration-300 tw-ease-in-out", "tw-flex tw-min-w-[256px] tw-max-w-[420px] tw-flex-col tw-gap-2 tw-rounded-lg tw-border tw-font-sans tw-font-normal tw-shadow-2", "tw-border-gray-300 tw-bg-white tw-text-slate-600", {
82
88
  "tw-p-4": !this.description,
83
89
  "tw-p-6": this.description,
84
90
  }, "tw-transform tw-transition tw-duration-300 tw-ease-in-out ", {
@@ -86,11 +92,11 @@ export class BcmToast {
86
92
  "tw-opacity-0": !this.visibleContainer,
87
93
  "tw-translate-y-[-100%]": !this.visibleContainer && this.position.split("-")[0] === "top",
88
94
  "tw-translate-y-[100%]": !this.visibleContainer && this.position.split("-")[0] === "bottom",
89
- }) }, h("div", { class: "tw-flex tw-items-center tw-justify-between tw-gap-5" }, h("div", { class: "tw-flex tw-items-center tw-gap-3 " }, this.status && (h("i", { class: cs("tw-text-6", this.messageIcon ? this.messageIcon : "far", {
90
- "tw-text-color-success": this.status === "success",
91
- "tw-text-color-error": this.status === "error",
92
- "tw-text-color-warning": this.status === "warning",
93
- "tw-text-color-info": this.status === "info",
95
+ }) }, h("div", { class: "tw-flex tw-items-start tw-justify-between tw-gap-5" }, h("div", { class: "tw-flex tw-items-start tw-gap-3 " }, this.status && (h("i", { class: cs("tw-text-6 tw-pt-0.5", this.messageIcon ? this.messageIcon : "far", {
96
+ "tw-text-emerald-500": this.status === "success",
97
+ "tw-text-red-500": this.status === "error",
98
+ "tw-text-amber-500": this.status === "warning",
99
+ "tw-text-blue-500": this.status === "info",
94
100
  }, {
95
101
  "fa-check-circle": !this.messageIcon && this.status === "success",
96
102
  "fa-exclamation-circle": !this.messageIcon && this.status === "error",
@@ -99,9 +105,9 @@ export class BcmToast {
99
105
  }) })), h("span", { class: cs({
100
106
  "tw-text-4": !this.description,
101
107
  "tw-text-6 tw-font-medium": this.description,
102
- }) }, !this.description && this.status && h("span", null, StringHelper.capitalize(this.status), ": "), this.message)), h("div", { class: "tw-flex tw-items-baseline tw-gap-2" }, this.viewButton && (h("button", { onClick: () => this.bcmToastView.emit(), title: "View details", class: cs("tw-appearance-none tw-outline-0 tw-border-none tw-cursor-pointer tw-rounded tw-bg-transparent tw-p-0 tw-px-1 tw-text-4 tw-text-inherit", "hover:tw-bg-color-default-hover", "active:tw-bg-color-default-active", "tw-transition tw-duration-300 tw-ease-in-out", {
108
+ }) }, this.renderMultiline(this.message))), h("div", { class: "tw-flex tw-items-baseline tw-gap-2" }, this.viewButton && (h("button", { onClick: () => this.bcmToastView.emit(), title: "View details", class: cs("tw-cursor-pointer tw-rounded tw-bg-transparent tw-p-0 tw-px-1 tw-text-4 tw-text-inherit", "hover:tw-bg-gray-100 hover:tw-text-slate-800", "active:tw-bg-gray-200", "tw-transition tw-duration-300 tw-ease-in-out", {
103
109
  "tw-font-medium": this.description,
104
- }) }, "View")), this.closeButton && (h("button", { title: "Close", onClick: () => this.hide(), class: cs("tw-appearance-none tw-outline-0 tw-border-none tw-cursor-pointer", "tw-rounded tw-bg-transparent tw-p-0", "tw-flex tw-h-6 tw-w-6 tw-cursor-pointer tw-items-center tw-justify-center tw-text-3 tw-text-inherit", "hover:tw-bg-color-default-hover", "active:tw-bg-color-default-active") }, h("i", { class: "fal fa-times" }))))), this.description && h("div", { class: "tw-text-size-5 font-medium" }, this.description), h("slot", null)))));
110
+ }) }, "View")), this.closeButton && (h("button", { title: "Close", onClick: () => this.hide(), class: cs("tw-rounded tw-bg-transparent tw-p-0", "tw-flex tw-h-6 tw-w-6 tw-cursor-pointer tw-items-center tw-justify-center tw-text-3 tw-text-inherit", "hover:tw-bg-gray-100 hover:tw-text-slate-800", "active:tw-bg-gray-200") }, h("i", { class: "fal fa-times" }))))), this.description && h("div", { class: "tw-text-3 " }, this.renderMultiline(this.description)), h("slot", null)))));
105
111
  }
106
112
  static get is() { return "bcm-toast"; }
107
113
  static get properties() {
@@ -140,7 +140,7 @@ export class BcmOldTag {
140
140
  "mutable": true,
141
141
  "complexType": {
142
142
  "original": "ColorPaletteTypes",
143
- "resolved": "\"red\" | \"default\" | \"black\" | \"white\" | \"prime-blue\" | \"prime-blue-1\" | \"prime-blue-2\" | \"prime-blue-3\" | \"prime-blue-5\" | \"prime-blue-6\" | \"prime-blue-7\" | \"prime-blue-8\" | \"prime-blue-9\" | \"prime-blue-10\" | \"grey\" | \"grey-1\" | \"grey-2\" | \"grey-3\" | \"grey-4\" | \"grey-5\" | \"grey-6\" | \"grey-7\" | \"grey-8\" | \"grey-9\" | \"grey-10\" | \"blue\" | \"blue-1\" | \"blue-2\" | \"blue-3\" | \"blue-4\" | \"blue-5\" | \"blue-6\" | \"blue-7\" | \"blue-8\" | \"blue-9\" | \"blue-10\" | \"warmyellow\" | \"warmyellow-1\" | \"warmyellow-2\" | \"warmyellow-3\" | \"warmyellow-4\" | \"warmyellow-5\" | \"warmyellow-6\" | \"warmyellow-7\" | \"warmyellow-8\" | \"warmyellow-9\" | \"warmyellow-10\" | \"yellow\" | \"yellow-1\" | \"yellow-2\" | \"yellow-3\" | \"yellow-4\" | \"yellow-5\" | \"yellow-6\" | \"yellow-7\" | \"yellow-8\" | \"yellow-9\" | \"yellow-10\" | \"limegreen\" | \"limegreen-1\" | \"limegreen-2\" | \"limegreen-3\" | \"limegreen-4\" | \"limegreen-5\" | \"limegreen-6\" | \"limegreen-7\" | \"limegreen-8\" | \"limegreen-9\" | \"limegreen-10\" | \"red-1\" | \"red-2\" | \"red-3\" | \"red-4\" | \"red-5\" | \"red-6\" | \"red-7\" | \"red-8\" | \"red-9\" | \"red-10\" | \"darkorange\" | \"darkorange-1\" | \"darkorange-2\" | \"darkorange-3\" | \"darkorange-4\" | \"darkorange-5\" | \"darkorange-6\" | \"darkorange-7\" | \"darkorange-8\" | \"darkorange-9\" | \"darkorange-10\" | \"orange\" | \"orange-1\" | \"orange-2\" | \"orange-3\" | \"orange-4\" | \"orange-5\" | \"orange-6\" | \"orange-7\" | \"orange-8\" | \"orange-9\" | \"orange-10\" | \"green\" | \"green-1\" | \"green-2\" | \"green-3\" | \"green-4\" | \"green-5\" | \"green-6\" | \"green-7\" | \"green-8\" | \"green-9\" | \"green-10\" | \"turquosie\" | \"turquosie-1\" | \"turquosie-2\" | \"turquosie-3\" | \"turquosie-4\" | \"turquosie-5\" | \"turquosie-6\" | \"turquosie-7\" | \"turquosie-8\" | \"turquosie-9\" | \"turquosie-10\" | \"cobaltblue\" | \"cobaltblue-1\" | \"cobaltblue-2\" | \"cobaltblue-3\" | \"cobaltblue-4\" | \"cobaltblue-5\" | \"cobaltblue-6\" | \"cobaltblue-7\" | \"cobaltblue-8\" | \"cobaltblue-9\" | \"cobaltblue-10\" | \"magenta\" | \"magenta-1\" | \"magenta-2\" | \"magenta-3\" | \"magenta-4\" | \"magenta-5\" | \"magenta-6\" | \"magenta-7\" | \"magenta-8\" | \"magenta-9\" | \"magenta-10\" | \"purple\" | \"purple-1\" | \"purple-2\" | \"purple-3\" | \"purple-4\" | \"purple-5\" | \"purple-6\" | \"purple-7\" | \"purple-8\" | \"purple-9\" | \"purple-10\" | \"bc-red\" | \"bc-red-1\" | \"bc-red-2\" | \"bc-red-3\" | \"bc-red-4\" | \"bc-red-5\" | \"bc-red-6\" | \"bc-red-7\" | \"bc-red-8\" | \"bc-red-9\" | \"bc-blue\" | \"bc-blue-1\" | \"bc-blue-2\" | \"bc-blue-3\" | \"bc-blue-4\" | \"bc-blue-5\" | \"bc-blue-6\" | \"bc-blue-7\" | \"bc-blue-8\" | \"bc-blue-9\" | \"bc-green\" | \"bc-green-1\" | \"bc-green-2\" | \"bc-green-3\" | \"bc-green-4\" | \"bc-green-5\" | \"bc-green-6\" | \"bc-green-7\" | \"bc-green-8\" | \"bc-green-9\" | \"bc-orange\" | \"bc-orange-1\" | \"bc-orange-2\" | \"bc-orange-3\" | \"bc-orange-4\" | \"bc-orange-5\" | \"bc-orange-6\" | \"bc-orange-7\" | \"bc-orange-8\" | \"bc-orange-9\"",
143
+ "resolved": "\"red\" | \"blue\" | \"default\" | \"black\" | \"white\" | \"prime-blue\" | \"prime-blue-1\" | \"prime-blue-2\" | \"prime-blue-3\" | \"prime-blue-5\" | \"prime-blue-6\" | \"prime-blue-7\" | \"prime-blue-8\" | \"prime-blue-9\" | \"prime-blue-10\" | \"grey\" | \"grey-1\" | \"grey-2\" | \"grey-3\" | \"grey-4\" | \"grey-5\" | \"grey-6\" | \"grey-7\" | \"grey-8\" | \"grey-9\" | \"grey-10\" | \"blue-1\" | \"blue-2\" | \"blue-3\" | \"blue-4\" | \"blue-5\" | \"blue-6\" | \"blue-7\" | \"blue-8\" | \"blue-9\" | \"blue-10\" | \"warmyellow\" | \"warmyellow-1\" | \"warmyellow-2\" | \"warmyellow-3\" | \"warmyellow-4\" | \"warmyellow-5\" | \"warmyellow-6\" | \"warmyellow-7\" | \"warmyellow-8\" | \"warmyellow-9\" | \"warmyellow-10\" | \"yellow\" | \"yellow-1\" | \"yellow-2\" | \"yellow-3\" | \"yellow-4\" | \"yellow-5\" | \"yellow-6\" | \"yellow-7\" | \"yellow-8\" | \"yellow-9\" | \"yellow-10\" | \"limegreen\" | \"limegreen-1\" | \"limegreen-2\" | \"limegreen-3\" | \"limegreen-4\" | \"limegreen-5\" | \"limegreen-6\" | \"limegreen-7\" | \"limegreen-8\" | \"limegreen-9\" | \"limegreen-10\" | \"red-1\" | \"red-2\" | \"red-3\" | \"red-4\" | \"red-5\" | \"red-6\" | \"red-7\" | \"red-8\" | \"red-9\" | \"red-10\" | \"darkorange\" | \"darkorange-1\" | \"darkorange-2\" | \"darkorange-3\" | \"darkorange-4\" | \"darkorange-5\" | \"darkorange-6\" | \"darkorange-7\" | \"darkorange-8\" | \"darkorange-9\" | \"darkorange-10\" | \"orange\" | \"orange-1\" | \"orange-2\" | \"orange-3\" | \"orange-4\" | \"orange-5\" | \"orange-6\" | \"orange-7\" | \"orange-8\" | \"orange-9\" | \"orange-10\" | \"green\" | \"green-1\" | \"green-2\" | \"green-3\" | \"green-4\" | \"green-5\" | \"green-6\" | \"green-7\" | \"green-8\" | \"green-9\" | \"green-10\" | \"turquosie\" | \"turquosie-1\" | \"turquosie-2\" | \"turquosie-3\" | \"turquosie-4\" | \"turquosie-5\" | \"turquosie-6\" | \"turquosie-7\" | \"turquosie-8\" | \"turquosie-9\" | \"turquosie-10\" | \"cobaltblue\" | \"cobaltblue-1\" | \"cobaltblue-2\" | \"cobaltblue-3\" | \"cobaltblue-4\" | \"cobaltblue-5\" | \"cobaltblue-6\" | \"cobaltblue-7\" | \"cobaltblue-8\" | \"cobaltblue-9\" | \"cobaltblue-10\" | \"magenta\" | \"magenta-1\" | \"magenta-2\" | \"magenta-3\" | \"magenta-4\" | \"magenta-5\" | \"magenta-6\" | \"magenta-7\" | \"magenta-8\" | \"magenta-9\" | \"magenta-10\" | \"purple\" | \"purple-1\" | \"purple-2\" | \"purple-3\" | \"purple-4\" | \"purple-5\" | \"purple-6\" | \"purple-7\" | \"purple-8\" | \"purple-9\" | \"purple-10\" | \"bc-red\" | \"bc-red-1\" | \"bc-red-2\" | \"bc-red-3\" | \"bc-red-4\" | \"bc-red-5\" | \"bc-red-6\" | \"bc-red-7\" | \"bc-red-8\" | \"bc-red-9\" | \"bc-blue\" | \"bc-blue-1\" | \"bc-blue-2\" | \"bc-blue-3\" | \"bc-blue-4\" | \"bc-blue-5\" | \"bc-blue-6\" | \"bc-blue-7\" | \"bc-blue-8\" | \"bc-blue-9\" | \"bc-green\" | \"bc-green-1\" | \"bc-green-2\" | \"bc-green-3\" | \"bc-green-4\" | \"bc-green-5\" | \"bc-green-6\" | \"bc-green-7\" | \"bc-green-8\" | \"bc-green-9\" | \"bc-orange\" | \"bc-orange-1\" | \"bc-orange-2\" | \"bc-orange-3\" | \"bc-orange-4\" | \"bc-orange-5\" | \"bc-orange-6\" | \"bc-orange-7\" | \"bc-orange-8\" | \"bc-orange-9\"",
144
144
  "references": {
145
145
  "ColorPaletteTypes": {
146
146
  "location": "import",
@@ -156,7 +156,7 @@ export class BcmTag {
156
156
  "mutable": true,
157
157
  "complexType": {
158
158
  "original": "ColorPaletteTypes",
159
- "resolved": "\"red\" | \"default\" | \"black\" | \"white\" | \"prime-blue\" | \"prime-blue-1\" | \"prime-blue-2\" | \"prime-blue-3\" | \"prime-blue-5\" | \"prime-blue-6\" | \"prime-blue-7\" | \"prime-blue-8\" | \"prime-blue-9\" | \"prime-blue-10\" | \"grey\" | \"grey-1\" | \"grey-2\" | \"grey-3\" | \"grey-4\" | \"grey-5\" | \"grey-6\" | \"grey-7\" | \"grey-8\" | \"grey-9\" | \"grey-10\" | \"blue\" | \"blue-1\" | \"blue-2\" | \"blue-3\" | \"blue-4\" | \"blue-5\" | \"blue-6\" | \"blue-7\" | \"blue-8\" | \"blue-9\" | \"blue-10\" | \"warmyellow\" | \"warmyellow-1\" | \"warmyellow-2\" | \"warmyellow-3\" | \"warmyellow-4\" | \"warmyellow-5\" | \"warmyellow-6\" | \"warmyellow-7\" | \"warmyellow-8\" | \"warmyellow-9\" | \"warmyellow-10\" | \"yellow\" | \"yellow-1\" | \"yellow-2\" | \"yellow-3\" | \"yellow-4\" | \"yellow-5\" | \"yellow-6\" | \"yellow-7\" | \"yellow-8\" | \"yellow-9\" | \"yellow-10\" | \"limegreen\" | \"limegreen-1\" | \"limegreen-2\" | \"limegreen-3\" | \"limegreen-4\" | \"limegreen-5\" | \"limegreen-6\" | \"limegreen-7\" | \"limegreen-8\" | \"limegreen-9\" | \"limegreen-10\" | \"red-1\" | \"red-2\" | \"red-3\" | \"red-4\" | \"red-5\" | \"red-6\" | \"red-7\" | \"red-8\" | \"red-9\" | \"red-10\" | \"darkorange\" | \"darkorange-1\" | \"darkorange-2\" | \"darkorange-3\" | \"darkorange-4\" | \"darkorange-5\" | \"darkorange-6\" | \"darkorange-7\" | \"darkorange-8\" | \"darkorange-9\" | \"darkorange-10\" | \"orange\" | \"orange-1\" | \"orange-2\" | \"orange-3\" | \"orange-4\" | \"orange-5\" | \"orange-6\" | \"orange-7\" | \"orange-8\" | \"orange-9\" | \"orange-10\" | \"green\" | \"green-1\" | \"green-2\" | \"green-3\" | \"green-4\" | \"green-5\" | \"green-6\" | \"green-7\" | \"green-8\" | \"green-9\" | \"green-10\" | \"turquosie\" | \"turquosie-1\" | \"turquosie-2\" | \"turquosie-3\" | \"turquosie-4\" | \"turquosie-5\" | \"turquosie-6\" | \"turquosie-7\" | \"turquosie-8\" | \"turquosie-9\" | \"turquosie-10\" | \"cobaltblue\" | \"cobaltblue-1\" | \"cobaltblue-2\" | \"cobaltblue-3\" | \"cobaltblue-4\" | \"cobaltblue-5\" | \"cobaltblue-6\" | \"cobaltblue-7\" | \"cobaltblue-8\" | \"cobaltblue-9\" | \"cobaltblue-10\" | \"magenta\" | \"magenta-1\" | \"magenta-2\" | \"magenta-3\" | \"magenta-4\" | \"magenta-5\" | \"magenta-6\" | \"magenta-7\" | \"magenta-8\" | \"magenta-9\" | \"magenta-10\" | \"purple\" | \"purple-1\" | \"purple-2\" | \"purple-3\" | \"purple-4\" | \"purple-5\" | \"purple-6\" | \"purple-7\" | \"purple-8\" | \"purple-9\" | \"purple-10\" | \"bc-red\" | \"bc-red-1\" | \"bc-red-2\" | \"bc-red-3\" | \"bc-red-4\" | \"bc-red-5\" | \"bc-red-6\" | \"bc-red-7\" | \"bc-red-8\" | \"bc-red-9\" | \"bc-blue\" | \"bc-blue-1\" | \"bc-blue-2\" | \"bc-blue-3\" | \"bc-blue-4\" | \"bc-blue-5\" | \"bc-blue-6\" | \"bc-blue-7\" | \"bc-blue-8\" | \"bc-blue-9\" | \"bc-green\" | \"bc-green-1\" | \"bc-green-2\" | \"bc-green-3\" | \"bc-green-4\" | \"bc-green-5\" | \"bc-green-6\" | \"bc-green-7\" | \"bc-green-8\" | \"bc-green-9\" | \"bc-orange\" | \"bc-orange-1\" | \"bc-orange-2\" | \"bc-orange-3\" | \"bc-orange-4\" | \"bc-orange-5\" | \"bc-orange-6\" | \"bc-orange-7\" | \"bc-orange-8\" | \"bc-orange-9\" | \"prime-blue-4\"",
159
+ "resolved": "\"red\" | \"blue\" | \"default\" | \"black\" | \"white\" | \"prime-blue\" | \"prime-blue-1\" | \"prime-blue-2\" | \"prime-blue-3\" | \"prime-blue-5\" | \"prime-blue-6\" | \"prime-blue-7\" | \"prime-blue-8\" | \"prime-blue-9\" | \"prime-blue-10\" | \"grey\" | \"grey-1\" | \"grey-2\" | \"grey-3\" | \"grey-4\" | \"grey-5\" | \"grey-6\" | \"grey-7\" | \"grey-8\" | \"grey-9\" | \"grey-10\" | \"blue-1\" | \"blue-2\" | \"blue-3\" | \"blue-4\" | \"blue-5\" | \"blue-6\" | \"blue-7\" | \"blue-8\" | \"blue-9\" | \"blue-10\" | \"warmyellow\" | \"warmyellow-1\" | \"warmyellow-2\" | \"warmyellow-3\" | \"warmyellow-4\" | \"warmyellow-5\" | \"warmyellow-6\" | \"warmyellow-7\" | \"warmyellow-8\" | \"warmyellow-9\" | \"warmyellow-10\" | \"yellow\" | \"yellow-1\" | \"yellow-2\" | \"yellow-3\" | \"yellow-4\" | \"yellow-5\" | \"yellow-6\" | \"yellow-7\" | \"yellow-8\" | \"yellow-9\" | \"yellow-10\" | \"limegreen\" | \"limegreen-1\" | \"limegreen-2\" | \"limegreen-3\" | \"limegreen-4\" | \"limegreen-5\" | \"limegreen-6\" | \"limegreen-7\" | \"limegreen-8\" | \"limegreen-9\" | \"limegreen-10\" | \"red-1\" | \"red-2\" | \"red-3\" | \"red-4\" | \"red-5\" | \"red-6\" | \"red-7\" | \"red-8\" | \"red-9\" | \"red-10\" | \"darkorange\" | \"darkorange-1\" | \"darkorange-2\" | \"darkorange-3\" | \"darkorange-4\" | \"darkorange-5\" | \"darkorange-6\" | \"darkorange-7\" | \"darkorange-8\" | \"darkorange-9\" | \"darkorange-10\" | \"orange\" | \"orange-1\" | \"orange-2\" | \"orange-3\" | \"orange-4\" | \"orange-5\" | \"orange-6\" | \"orange-7\" | \"orange-8\" | \"orange-9\" | \"orange-10\" | \"green\" | \"green-1\" | \"green-2\" | \"green-3\" | \"green-4\" | \"green-5\" | \"green-6\" | \"green-7\" | \"green-8\" | \"green-9\" | \"green-10\" | \"turquosie\" | \"turquosie-1\" | \"turquosie-2\" | \"turquosie-3\" | \"turquosie-4\" | \"turquosie-5\" | \"turquosie-6\" | \"turquosie-7\" | \"turquosie-8\" | \"turquosie-9\" | \"turquosie-10\" | \"cobaltblue\" | \"cobaltblue-1\" | \"cobaltblue-2\" | \"cobaltblue-3\" | \"cobaltblue-4\" | \"cobaltblue-5\" | \"cobaltblue-6\" | \"cobaltblue-7\" | \"cobaltblue-8\" | \"cobaltblue-9\" | \"cobaltblue-10\" | \"magenta\" | \"magenta-1\" | \"magenta-2\" | \"magenta-3\" | \"magenta-4\" | \"magenta-5\" | \"magenta-6\" | \"magenta-7\" | \"magenta-8\" | \"magenta-9\" | \"magenta-10\" | \"purple\" | \"purple-1\" | \"purple-2\" | \"purple-3\" | \"purple-4\" | \"purple-5\" | \"purple-6\" | \"purple-7\" | \"purple-8\" | \"purple-9\" | \"purple-10\" | \"bc-red\" | \"bc-red-1\" | \"bc-red-2\" | \"bc-red-3\" | \"bc-red-4\" | \"bc-red-5\" | \"bc-red-6\" | \"bc-red-7\" | \"bc-red-8\" | \"bc-red-9\" | \"bc-blue\" | \"bc-blue-1\" | \"bc-blue-2\" | \"bc-blue-3\" | \"bc-blue-4\" | \"bc-blue-5\" | \"bc-blue-6\" | \"bc-blue-7\" | \"bc-blue-8\" | \"bc-blue-9\" | \"bc-green\" | \"bc-green-1\" | \"bc-green-2\" | \"bc-green-3\" | \"bc-green-4\" | \"bc-green-5\" | \"bc-green-6\" | \"bc-green-7\" | \"bc-green-8\" | \"bc-green-9\" | \"bc-orange\" | \"bc-orange-1\" | \"bc-orange-2\" | \"bc-orange-3\" | \"bc-orange-4\" | \"bc-orange-5\" | \"bc-orange-6\" | \"bc-orange-7\" | \"bc-orange-8\" | \"bc-orange-9\" | \"prime-blue-4\"",
160
160
  "references": {
161
161
  "ColorPaletteTypes": {
162
162
  "location": "import",
@@ -6,7 +6,7 @@ import { h } from '@stencil/core';
6
6
  import cs from 'classnames';
7
7
  import { CheckboxTemplate } from './checkbox-template';
8
8
  import { StringHelper } from '@bcm/helpers';
9
- export const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds }) => {
9
+ export const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selectedItem, openGroup, checkedItem, focusItem, searchIsOnlyChilds, disabled: parentDisabled, readonly: parentReadonly }) => {
10
10
  const isHaveChildren = item.items && item.items.length > 0;
11
11
  var text = StringHelper.htmlEntities(item.text);
12
12
  let intersection = [];
@@ -25,8 +25,8 @@ export const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size,
25
25
  }
26
26
  text = item.isHtmlContent ? item.isHtmlContent : item.template && intersection.length > 0 ? StringHelper.templateParser(item.template, Object.assign(Object.assign({}, item.itemObject), { text })) : text;
27
27
  const unClickable = !treeview && item.type == "group" && !item.clickable;
28
- const disabled = item.disabled;
29
- const readonly = item.readonly;
28
+ const disabled = item.disabled || parentDisabled;
29
+ const readonly = item.readonly || parentReadonly;
30
30
  const itemClick = (event) => {
31
31
  let path = event.path || event.composedPath();
32
32
  if (path.filter(x => x.attributes && x.attributes.getNamedItem("unlinked"))[0]) {
@@ -44,11 +44,12 @@ export const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size,
44
44
  item.open = item.isSearching;
45
45
  openGroup(item.id);
46
46
  };
47
- return (h("div", { id: item.id, hidden: item.hidden, "on-focus": e => !unClickable && !disabled && focusItem(e), tabIndex: unClickable || disabled ? -1 : 0, class: cs('bcm-list__item',
47
+ return (h("div", { id: item.id, hidden: item.hidden, "data-has-children": isHaveChildren ? "true" : "false", "data-open": item.isSearching || item.open ? "true" : "false", "data-parent-id": item.parentId || "", "on-focus": e => !unClickable && !disabled && focusItem(e), tabIndex: unClickable || disabled ? -1 : 0, class: cs('bcm-list__item',
48
48
  // size === 'large' ? 'size-3' : 'size-2',
49
49
  'bcm-list__item-' + size, {
50
50
  'bcm-list__item--group': !treeview && item.type == 'group',
51
+ 'bcm-list__item--open': item.isSearching || item.open,
51
52
  'bcm-list__item--readonly': readonly,
52
- }) }, h("div", { class: cs('bcm-list__item-content', !checkboxes && item.selected && 'selected', { disabled, readonly }) }, treeview && (h("div", { class: "bcm-list__item-content-collapse-icon", onClick: () => collapseClick() }, isHaveChildren && h("bcm-icon", { icon: cs('fas fa-caret-' + (item.isSearching || item.open ? 'down' : 'right')) }))), h("div", { class: cs('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) }, checkboxes && (treeview || (!treeview && item.type != 'group')) && (h("div", { class: "bcm-list__item-content-text-checkbox" }, h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled: item.disabled }))), h("span", Object.assign({ class: "bcm-list__item-content-text-inner" }, (item.title && { "title": item.title }), { innerHTML: text })))), (treeview || !treeview && item.type == "group") && isHaveChildren && (h("div", { class: "bcm-list__item-childs" }, (item.isSearching || item.open || (!treeview && item.type == "group")) &&
53
+ }) }, h("div", { class: cs('bcm-list__item-content', !checkboxes && item.selected && 'selected', { disabled, readonly }) }, treeview && (h("div", { class: "bcm-list__item-content-collapse-icon", onClick: () => collapseClick() }, isHaveChildren && h("bcm-icon", { icon: cs('fas fa-caret-' + (item.isSearching || item.open ? 'down' : 'right')) }))), h("div", { class: cs('bcm-list__item-content-text', { treeview }), onClick: (e) => itemClick(e) }, checkboxes && (treeview || (!treeview && item.type != 'group')) && (h("div", { class: "bcm-list__item-content-text-checkbox" }, h(CheckboxTemplate, { indeterminate: item.indeterminate, checked: item.checked, disabled: disabled }))), h("span", Object.assign({ class: "bcm-list__item-content-text-inner" }, (item.title && { "title": item.title }), { innerHTML: text })))), (treeview || !treeview && item.type == "group") && isHaveChildren && (h("div", { class: "bcm-list__item-childs" }, (item.isSearching || item.open || (!treeview && item.type == "group")) &&
53
54
  item.items.map((item) => (h(ListItemTemplate, { highlight: highlight, item: item, searchIsOnlyChilds: searchIsOnlyChilds, treeview: treeview, checkboxes: checkboxes, size: size, selectedItem: selectedItem, checkedItem: checkedItem, openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId) })))))));
54
55
  };
@@ -5,7 +5,7 @@
5
5
  import { h } from '@stencil/core';
6
6
  import { InfoFooterTemplate } from './info-footer-template';
7
7
  import { ListItemTemplate } from './list-item-template';
8
- export const ListTemplate = ({ type, highlight, selectAllItem, bcmListContainer, treeview, checkboxes, checkAll, infoFooter, value, totalData, searchFound, variableText, _id, tempId, data, width, height, size, searchPlaceholder, minSearchLength, selectedItem, openGroup, checkedItem, onScrollEvent, focusItem, items, searchable, searchIsOnlyChilds, emptyText, emptyIcon, handleTransitionEnd, }) => {
8
+ export const ListTemplate = ({ type, highlight, selectAllItem, bcmListContainer, treeview, checkboxes, checkAll, infoFooter, value, totalData, searchFound, variableText, _id, tempId, data, width, height, size, searchPlaceholder, minSearchLength, selectedItem, openGroup, checkedItem, onScrollEvent, focusItem, items, searchable, searchIsOnlyChilds, emptyText, emptyIcon, handleTransitionEnd, disabled, readonly, }) => {
9
9
  const showSelectAll = !(treeview && searchFound > 0) && !(searchFound > 0);
10
10
  const setScrollHeight = () => {
11
11
  const itemHeight = size === 'small' ? 28 : size === 'medium' ? 36 : 48;
@@ -13,5 +13,5 @@ export const ListTemplate = ({ type, highlight, selectAllItem, bcmListContainer,
13
13
  const scrollHeight = itemCount * itemHeight || 0;
14
14
  return Object.assign(Object.assign({ 'min-height': `${scrollHeight}px` }, (type === 'select' && { 'overscroll-behavior': 'none' })), { 'height': '100%', 'display': 'flex', 'flex-direction': 'column' });
15
15
  };
16
- return (h("div", { id: `bcm-list-${_id}`, class: bcmListContainer, "temp-id": `bcm-list-${tempId}`, style: { '--height': height, '--width': width }, onTransitionEnd: e => handleTransitionEnd(e) }, data && searchable && (h("section", { class: "bcm-list__container-search" }, h("bcm-search", { size: size, id: `bcm-list-${_id}-search`, data: data, clearable: true, placeholder: searchPlaceholder, "min-search-length": minSearchLength, searchIsOnlyChilds: searchIsOnlyChilds }))), h("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: Object.assign({}, (type === 'select' && { 'overscroll-behavior': 'none' })) }, h("div", { style: setScrollHeight() }, checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (h("section", { class: "bcm-list__container-select-all" }, h(ListItemTemplate, { size: size, item: selectAllItem, treeview: false, checkboxes: true, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId) }))), items.map((item) => (h(ListItemTemplate, { highlight: highlight, size: size, item: item, searchIsOnlyChilds: searchIsOnlyChilds, treeview: treeview, checkboxes: checkboxes, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId) }))), (!items || items.length === 0) && searchFound != 0 && (h("section", { class: "bcm-list__container-no-data" }, h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon }, h("span", { innerHTML: emptyText || 'No data' })))), searchFound == 0 && (h("section", { class: "bcm-list__container-no-data" }, h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon }, h("span", { innerHTML: emptyText || 'No Data Found' })))))), infoFooter && data && data.length > 0 && (h(InfoFooterTemplate, { selected: value === null || value === void 0 ? void 0 : value.length, total: totalData, found: searchFound, multiple: checkboxes, variableText: variableText }))));
16
+ return (h("div", { id: `bcm-list-${_id}`, class: bcmListContainer, "temp-id": `bcm-list-${tempId}`, style: { '--height': height, '--width': width }, onTransitionEnd: e => handleTransitionEnd(e) }, data && searchable && (h("section", { class: "bcm-list__container-search" }, h("bcm-search", { size: size, id: `bcm-list-${_id}-search`, data: data, clearable: true, placeholder: searchPlaceholder, "min-search-length": minSearchLength, searchIsOnlyChilds: searchIsOnlyChilds }))), h("main", { onScroll: e => onScrollEvent(e), class: "scrolling", style: Object.assign({}, (type === 'select' && { 'overscroll-behavior': 'none' })) }, h("div", { style: setScrollHeight() }, checkAll && searchFound != 0 && items && items.length > 0 && checkboxes && showSelectAll && (h("section", { class: "bcm-list__container-select-all" }, h(ListItemTemplate, { size: size, item: selectAllItem, treeview: false, checkboxes: true, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId), disabled: disabled, readonly: readonly }))), items.map((item) => (h(ListItemTemplate, { highlight: highlight, size: size, item: item, searchIsOnlyChilds: searchIsOnlyChilds, treeview: treeview, checkboxes: checkboxes, selectedItem: itemId => selectedItem(itemId), checkedItem: itemId => checkedItem(itemId), openGroup: parentId => openGroup(parentId), focusItem: itemId => focusItem(itemId), disabled: disabled, readonly: readonly }))), (!items || items.length === 0) && searchFound != 0 && (h("section", { class: "bcm-list__container-no-data" }, h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon }, h("span", { innerHTML: emptyText || 'No data' })))), searchFound == 0 && (h("section", { class: "bcm-list__container-no-data" }, h("bcm-empty", { style: { height: 'auto' }, icon: emptyIcon }, h("span", { innerHTML: emptyText || 'No Data Found' })))))), infoFooter && data && data.length > 0 && (h(InfoFooterTemplate, { selected: value === null || value === void 0 ? void 0 : value.length, total: totalData, found: searchFound, multiple: checkboxes, variableText: variableText }))));
17
17
  };