bromcom-ui 3.0.0-alpha.4 → 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.
- package/dist/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/p-01eaca9a.entry.js +5 -0
- package/dist/bromcom-ui/p-3ddd3c83.entry.js +5 -0
- package/dist/bromcom-ui/p-aa67918a.entry.js +5 -0
- package/dist/bromcom-ui/p-d5464577.entry.js +16 -0
- package/dist/cjs/bcm-accordion_69.cjs.entry.js +704 -31
- package/dist/cjs/bcm-file-upload.cjs.entry.js +578 -0
- package/dist/cjs/bcm-form-2.cjs.entry.js +1 -0
- package/dist/cjs/bcm-number-input.cjs.entry.js +8 -2
- package/dist/cjs/bromcom-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/button/button.js +1 -1
- package/dist/collection/components/atoms/button/types.js +7 -0
- package/dist/collection/components/molecules/dropdown/dropdown.js +36 -1
- package/dist/collection/components/molecules/linked/linked-focus-manager.js +86 -0
- package/dist/collection/components/molecules/linked/linked.js +43 -1
- package/dist/collection/components/molecules/number-input/number-input.js +8 -2
- package/dist/collection/components/molecules/number-input/react-input.js +1 -1
- package/dist/collection/components/molecules/upload/file-upload.component.js +1060 -0
- package/dist/collection/components/molecules/upload/file-upload.style.js +201 -0
- package/dist/collection/components/organism/form/form.js +1 -0
- package/dist/collection/components/organism/form-2/bcm-form-components.js +1 -0
- package/dist/collection/components/organism/list/list-focus-manager.js +344 -0
- package/dist/collection/components/organism/list/list-key-control.js +9 -4
- package/dist/collection/components/organism/list/list.css +8 -3
- package/dist/collection/components/organism/list/list.js +226 -26
- package/dist/collection/components/other_deprecated/old-tag/old-tag.js +1 -1
- package/dist/collection/components/other_deprecated/tag/tag.js +1 -1
- package/dist/collection/templates/list-item-template.js +2 -1
- package/dist/components/bcm-dropdown.js +35 -0
- package/dist/components/bcm-file-upload.d.ts +11 -0
- package/dist/components/bcm-file-upload.js +625 -0
- package/dist/components/bcm-form-2.js +1 -0
- package/dist/components/bcm-number-input.js +8 -2
- package/dist/components/button.js +7 -0
- package/dist/components/form.js +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/linked.js +105 -2
- package/dist/components/list.js +559 -31
- package/dist/esm/bcm-accordion_69.entry.js +704 -31
- package/dist/esm/bcm-file-upload.entry.js +574 -0
- package/dist/esm/bcm-form-2.entry.js +1 -0
- package/dist/esm/bcm-number-input.entry.js +8 -2
- package/dist/esm/bromcom-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/atoms/button/types.d.ts +8 -1
- package/dist/types/components/molecules/dropdown/dropdown.d.ts +7 -0
- package/dist/types/components/molecules/linked/linked-focus-manager.d.ts +13 -0
- package/dist/types/components/molecules/linked/linked.d.ts +3 -0
- package/dist/types/components/molecules/number-input/number-input.d.ts +1 -0
- package/dist/types/components/molecules/upload/file-upload.component.d.ts +233 -0
- package/dist/types/components/molecules/upload/file-upload.style.d.ts +548 -0
- package/dist/types/components/organism/list/list-focus-manager.d.ts +53 -0
- package/dist/types/components/organism/list/list-key-control.d.ts +1 -0
- package/dist/types/components/organism/list/list.d.ts +18 -1
- package/dist/types/components.d.ts +417 -1
- package/package.json +1 -1
- package/dist/bromcom-ui/p-8e7274e4.entry.js +0 -5
- package/dist/bromcom-ui/p-9e0dd503.entry.js +0 -16
- package/dist/bromcom-ui/p-a320cde8.entry.js +0 -5
package/dist/components/list.js
CHANGED
|
@@ -99,10 +99,11 @@ const ListItemTemplate = ({ item, treeview, highlight, checkboxes, size, selecte
|
|
|
99
99
|
item.open = item.isSearching;
|
|
100
100
|
openGroup(item.id);
|
|
101
101
|
};
|
|
102
|
-
return (h("div", { id: item.id, hidden: item.hidden, "on-focus": e => !unClickable && !disabled && focusItem(e), tabIndex: unClickable || disabled ? -1 : 0, class: classnames('bcm-list__item',
|
|
102
|
+
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: classnames('bcm-list__item',
|
|
103
103
|
// size === 'large' ? 'size-3' : 'size-2',
|
|
104
104
|
'bcm-list__item-' + size, {
|
|
105
105
|
'bcm-list__item--group': !treeview && item.type == 'group',
|
|
106
|
+
'bcm-list__item--open': item.isSearching || item.open,
|
|
106
107
|
'bcm-list__item--readonly': readonly,
|
|
107
108
|
}) },
|
|
108
109
|
h("div", { class: classnames('bcm-list__item-content', !checkboxes && item.selected && 'selected', { disabled, readonly }) },
|
|
@@ -634,6 +635,347 @@ const listState = {
|
|
|
634
635
|
removeState,
|
|
635
636
|
};
|
|
636
637
|
|
|
638
|
+
class ListFocusManager {
|
|
639
|
+
constructor() {
|
|
640
|
+
this.focusableSelector = [
|
|
641
|
+
"a[href]",
|
|
642
|
+
"area[href]",
|
|
643
|
+
"button:not([disabled])",
|
|
644
|
+
"input:not([disabled]):not([type='hidden'])",
|
|
645
|
+
"select:not([disabled])",
|
|
646
|
+
"textarea:not([disabled])",
|
|
647
|
+
"[contenteditable='true']",
|
|
648
|
+
"[tabindex]:not([tabindex='-1'])",
|
|
649
|
+
].join(",");
|
|
650
|
+
}
|
|
651
|
+
getFocusableElements(container) {
|
|
652
|
+
return Array.from(container.querySelectorAll(this.focusableSelector)).filter(item => this.isVisible(item));
|
|
653
|
+
}
|
|
654
|
+
getFirstFocusableElement(container) {
|
|
655
|
+
if (!container)
|
|
656
|
+
return null;
|
|
657
|
+
if (this.canReceiveProgrammaticFocus(container))
|
|
658
|
+
return container;
|
|
659
|
+
return this.getFocusableElements(container)[0] || null;
|
|
660
|
+
}
|
|
661
|
+
getListItems(listElement) {
|
|
662
|
+
if (!listElement)
|
|
663
|
+
return [];
|
|
664
|
+
return Array.from(listElement.querySelectorAll(".bcm-list__item")).filter(item => this.canReceiveProgrammaticFocus(item));
|
|
665
|
+
}
|
|
666
|
+
getItemById(listElement, itemId) {
|
|
667
|
+
return this.getListItems(listElement).find(item => item.id === itemId) || null;
|
|
668
|
+
}
|
|
669
|
+
getCurrentListItem(listElement, activeElement) {
|
|
670
|
+
if (!listElement)
|
|
671
|
+
return null;
|
|
672
|
+
const activeItem = activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest(".bcm-list__item");
|
|
673
|
+
if (activeItem && this.isInsideElement(listElement, activeItem) && this.canReceiveProgrammaticFocus(activeItem)) {
|
|
674
|
+
return activeItem;
|
|
675
|
+
}
|
|
676
|
+
const focusedItem = listElement.querySelector(".bcm-list__item.focused");
|
|
677
|
+
return this.canReceiveProgrammaticFocus(focusedItem) ? focusedItem : null;
|
|
678
|
+
}
|
|
679
|
+
getPreferredListFocusElement(listElement, direction = "first") {
|
|
680
|
+
var _a;
|
|
681
|
+
if (!listElement)
|
|
682
|
+
return null;
|
|
683
|
+
const focusedItem = listElement.querySelector(".bcm-list__item.focused");
|
|
684
|
+
if (focusedItem && this.canReceiveProgrammaticFocus(focusedItem))
|
|
685
|
+
return focusedItem;
|
|
686
|
+
const selectedItem = (_a = listElement.querySelector(".bcm-list__item .selected")) === null || _a === void 0 ? void 0 : _a.closest(".bcm-list__item");
|
|
687
|
+
if (selectedItem && this.canReceiveProgrammaticFocus(selectedItem))
|
|
688
|
+
return selectedItem;
|
|
689
|
+
const listItems = this.getListItems(listElement);
|
|
690
|
+
if (listItems.length > 0) {
|
|
691
|
+
return direction === "last" ? listItems[listItems.length - 1] : listItems[0];
|
|
692
|
+
}
|
|
693
|
+
const focusableElements = this.getFocusableElements(listElement);
|
|
694
|
+
return direction === "last" ? focusableElements[focusableElements.length - 1] || null : focusableElements[0] || null;
|
|
695
|
+
}
|
|
696
|
+
isElementNaturallyFocusable(element) {
|
|
697
|
+
const nodeName = element.tagName;
|
|
698
|
+
if (nodeName === "A")
|
|
699
|
+
return element.hasAttribute("href");
|
|
700
|
+
return ["BUTTON", "INPUT", "SELECT", "TEXTAREA"].includes(nodeName);
|
|
701
|
+
}
|
|
702
|
+
isEditableElement(element) {
|
|
703
|
+
if (!element)
|
|
704
|
+
return false;
|
|
705
|
+
const nodeName = element.tagName;
|
|
706
|
+
return nodeName === "INPUT" || nodeName === "TEXTAREA" || nodeName === "SELECT" || element.isContentEditable;
|
|
707
|
+
}
|
|
708
|
+
isVisible(element) {
|
|
709
|
+
if (!element.isConnected)
|
|
710
|
+
return false;
|
|
711
|
+
const style = window.getComputedStyle(element);
|
|
712
|
+
return style.display !== "none" && style.visibility !== "hidden";
|
|
713
|
+
}
|
|
714
|
+
isInsideElement(parent, child) {
|
|
715
|
+
return !!(parent && child && (parent === child || parent.contains(child)));
|
|
716
|
+
}
|
|
717
|
+
canReceiveProgrammaticFocus(element) {
|
|
718
|
+
if (!element || !this.isVisible(element))
|
|
719
|
+
return false;
|
|
720
|
+
const tabIndexAttr = element.getAttribute("tabindex");
|
|
721
|
+
if (tabIndexAttr != null) {
|
|
722
|
+
return Number(tabIndexAttr) >= 0;
|
|
723
|
+
}
|
|
724
|
+
return this.isElementNaturallyFocusable(element);
|
|
725
|
+
}
|
|
726
|
+
getInteractionContext(params) {
|
|
727
|
+
const { hostElement, targetElement, listElement, openTriggerElement } = params;
|
|
728
|
+
const activeElement = document.activeElement;
|
|
729
|
+
const isFocusInsideTarget = this.isInsideElement(targetElement, activeElement);
|
|
730
|
+
const isFocusInsideOpenTrigger = this.isInsideElement(openTriggerElement || null, activeElement);
|
|
731
|
+
const isFocusInsideHost = this.isInsideElement(hostElement, activeElement);
|
|
732
|
+
const isFocusInsideList = this.isInsideElement(listElement, activeElement);
|
|
733
|
+
const isTriggerFocused = isFocusInsideHost || isFocusInsideTarget || isFocusInsideOpenTrigger;
|
|
734
|
+
return {
|
|
735
|
+
activeElement,
|
|
736
|
+
isFocusInsideHost,
|
|
737
|
+
isFocusInsideList,
|
|
738
|
+
isFocusInsideOpenTrigger,
|
|
739
|
+
isFocusInsideTarget,
|
|
740
|
+
isTriggerFocused,
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
isInsideSearch(activeElement) {
|
|
744
|
+
return !!(activeElement === null || activeElement === void 0 ? void 0 : activeElement.closest(".bcm-list__container-search"));
|
|
745
|
+
}
|
|
746
|
+
focusElement(element) {
|
|
747
|
+
var _a;
|
|
748
|
+
if (!element || !this.canReceiveProgrammaticFocus(element))
|
|
749
|
+
return false;
|
|
750
|
+
element.focus();
|
|
751
|
+
(_a = element.scrollIntoView) === null || _a === void 0 ? void 0 : _a.call(element, { block: "nearest" });
|
|
752
|
+
return this.isInsideElement(element, document.activeElement);
|
|
753
|
+
}
|
|
754
|
+
focusListElement(listElement, preferItem = false, direction = "first") {
|
|
755
|
+
const focusTarget = preferItem ? this.getPreferredListFocusElement(listElement, direction) : this.getFirstFocusableElement(listElement);
|
|
756
|
+
return this.focusElement(focusTarget);
|
|
757
|
+
}
|
|
758
|
+
focusListItemByOffset(listElement, activeElement, offset) {
|
|
759
|
+
const items = this.getListItems(listElement);
|
|
760
|
+
if (items.length === 0)
|
|
761
|
+
return false;
|
|
762
|
+
const currentItem = this.getCurrentListItem(listElement, activeElement);
|
|
763
|
+
const currentIndex = currentItem ? items.indexOf(currentItem) : -1;
|
|
764
|
+
const nextIndex = currentIndex === -1 ? (offset > 0 ? 0 : items.length - 1) : (currentIndex + offset + items.length) % items.length;
|
|
765
|
+
return this.focusElement(items[nextIndex]);
|
|
766
|
+
}
|
|
767
|
+
focusListItemWhenReady(listElement, itemId, remainingAttempts = 6) {
|
|
768
|
+
if (this.focusElement(this.getItemById(listElement, itemId)))
|
|
769
|
+
return true;
|
|
770
|
+
if (remainingAttempts <= 0)
|
|
771
|
+
return false;
|
|
772
|
+
requestAnimationFrame(() => {
|
|
773
|
+
this.focusListItemWhenReady(listElement, itemId, remainingAttempts - 1);
|
|
774
|
+
});
|
|
775
|
+
return true;
|
|
776
|
+
}
|
|
777
|
+
focusListElementWhenReady(listElement, preferItem = false, direction = "first", remainingAttempts = 6) {
|
|
778
|
+
if (this.focusListElement(listElement, preferItem, direction))
|
|
779
|
+
return true;
|
|
780
|
+
if (remainingAttempts <= 0)
|
|
781
|
+
return false;
|
|
782
|
+
requestAnimationFrame(() => {
|
|
783
|
+
this.focusListElementWhenReady(listElement, preferItem, direction, remainingAttempts - 1);
|
|
784
|
+
});
|
|
785
|
+
return true;
|
|
786
|
+
}
|
|
787
|
+
getParentListItem(item) {
|
|
788
|
+
if (!item)
|
|
789
|
+
return null;
|
|
790
|
+
const parentId = item.getAttribute("data-parent-id");
|
|
791
|
+
if (!parentId)
|
|
792
|
+
return null;
|
|
793
|
+
return this.getItemById(item.closest(".bcm-list__container"), parentId);
|
|
794
|
+
}
|
|
795
|
+
getFirstChildListItem(item) {
|
|
796
|
+
return (item === null || item === void 0 ? void 0 : item.querySelector(":scope > .bcm-list__item-childs > .bcm-list__item")) || null;
|
|
797
|
+
}
|
|
798
|
+
hasTreeChildren(item) {
|
|
799
|
+
return (item === null || item === void 0 ? void 0 : item.getAttribute("data-has-children")) === "true";
|
|
800
|
+
}
|
|
801
|
+
isTreeItemOpen(item) {
|
|
802
|
+
return (item === null || item === void 0 ? void 0 : item.getAttribute("data-open")) === "true";
|
|
803
|
+
}
|
|
804
|
+
isInsideAnyElement(elements, child) {
|
|
805
|
+
return elements.some(element => this.isInsideElement(element || null, child));
|
|
806
|
+
}
|
|
807
|
+
focusAdjacentOutside(params) {
|
|
808
|
+
const { hostElement, targetElement, listElement, openTriggerElement, direction } = params;
|
|
809
|
+
const relatedElements = [hostElement, targetElement, listElement, openTriggerElement];
|
|
810
|
+
const focusableElements = this.getFocusableElements(document.body).filter(item => !this.isInsideAnyElement(relatedElements, item));
|
|
811
|
+
const documentFocusableElements = this.getFocusableElements(document.body);
|
|
812
|
+
const relatedIndexes = documentFocusableElements
|
|
813
|
+
.map((item, index) => (this.isInsideAnyElement(relatedElements, item) ? index : -1))
|
|
814
|
+
.filter(index => index >= 0);
|
|
815
|
+
if (relatedIndexes.length === 0 || focusableElements.length === 0)
|
|
816
|
+
return false;
|
|
817
|
+
const anchorIndex = direction === "next" ? Math.max(...relatedIndexes) : Math.min(...relatedIndexes);
|
|
818
|
+
const focusTarget = direction === "next"
|
|
819
|
+
? documentFocusableElements.slice(anchorIndex + 1).find(item => focusableElements.includes(item))
|
|
820
|
+
: documentFocusableElements
|
|
821
|
+
.slice(0, anchorIndex)
|
|
822
|
+
.reverse()
|
|
823
|
+
.find(item => focusableElements.includes(item));
|
|
824
|
+
return this.focusElement(focusTarget || null);
|
|
825
|
+
}
|
|
826
|
+
restoreTriggerFocus(params) {
|
|
827
|
+
const { hostElement, targetElement, autocompleteInput, openTriggerElement, preferOpenTrigger } = params;
|
|
828
|
+
const primaryTarget = preferOpenTrigger ? openTriggerElement : autocompleteInput || targetElement;
|
|
829
|
+
const secondaryTarget = preferOpenTrigger ? autocompleteInput || targetElement : openTriggerElement;
|
|
830
|
+
const focusTarget = this.getFirstFocusableElement(primaryTarget || null) || this.getFirstFocusableElement(secondaryTarget || null) || this.getFirstFocusableElement(hostElement);
|
|
831
|
+
focusTarget === null || focusTarget === void 0 ? void 0 : focusTarget.focus();
|
|
832
|
+
}
|
|
833
|
+
handleKeyDown(params) {
|
|
834
|
+
const { disabled, isOpen, isOverlayType } = params;
|
|
835
|
+
if (disabled || !isOverlayType)
|
|
836
|
+
return false;
|
|
837
|
+
return isOpen ? this.handleOpenOverlayKeyDown(params) : this.handleClosedOverlayKeyDown(params);
|
|
838
|
+
}
|
|
839
|
+
handleClosedOverlayKeyDown(params) {
|
|
840
|
+
const { event, hostElement, targetElement, listElement, openList, openTriggerElement } = params;
|
|
841
|
+
const keyCode = event.keyCode || event.which;
|
|
842
|
+
const isSpaceKey = event.key === " " || event.key === "Spacebar" || keyCode === 32;
|
|
843
|
+
const isArrowDownKey = event.key === "ArrowDown" || keyCode === 40;
|
|
844
|
+
const isArrowUpKey = event.key === "ArrowUp" || keyCode === 38;
|
|
845
|
+
const context = this.getInteractionContext({ hostElement, targetElement, listElement, openTriggerElement });
|
|
846
|
+
if (!context.isTriggerFocused)
|
|
847
|
+
return false;
|
|
848
|
+
if (this.isEditableElement(context.activeElement) && !isArrowDownKey && !isArrowUpKey)
|
|
849
|
+
return false;
|
|
850
|
+
if (!isSpaceKey && !isArrowDownKey && !isArrowUpKey)
|
|
851
|
+
return false;
|
|
852
|
+
event.preventDefault();
|
|
853
|
+
event.stopPropagation();
|
|
854
|
+
event.stopImmediatePropagation();
|
|
855
|
+
openList();
|
|
856
|
+
if (isArrowDownKey || isArrowUpKey) {
|
|
857
|
+
this.focusListElementWhenReady(listElement, true, isArrowUpKey ? "last" : "first");
|
|
858
|
+
}
|
|
859
|
+
return true;
|
|
860
|
+
}
|
|
861
|
+
handleOpenOverlayKeyDown(params) {
|
|
862
|
+
const { event, hostElement, targetElement, listElement, closeList, selectFocusedItem, openGroup, treeview, checkboxes, autocompleteInput, openTriggerElement } = params;
|
|
863
|
+
const keyCode = event.keyCode || event.which;
|
|
864
|
+
const isSpaceKey = event.key === " " || event.key === "Spacebar" || keyCode === 32;
|
|
865
|
+
const isEnterKey = event.key === "Enter" || keyCode === 13;
|
|
866
|
+
const isEscapeKey = event.key === "Escape" || keyCode === 27;
|
|
867
|
+
const isTabKey = event.key === "Tab" || keyCode === 9;
|
|
868
|
+
const isArrowDownKey = event.key === "ArrowDown" || keyCode === 40;
|
|
869
|
+
const isArrowUpKey = event.key === "ArrowUp" || keyCode === 38;
|
|
870
|
+
const isArrowRightKey = event.key === "ArrowRight" || keyCode === 39;
|
|
871
|
+
const isArrowLeftKey = event.key === "ArrowLeft" || keyCode === 37;
|
|
872
|
+
const context = this.getInteractionContext({ hostElement, targetElement, listElement, openTriggerElement });
|
|
873
|
+
const currentItem = this.getCurrentListItem(listElement, context.activeElement);
|
|
874
|
+
const isInsideSearch = this.isInsideSearch(context.activeElement);
|
|
875
|
+
if (isEscapeKey && (context.isTriggerFocused || context.isFocusInsideList || context.isFocusInsideHost)) {
|
|
876
|
+
event.preventDefault();
|
|
877
|
+
event.stopPropagation();
|
|
878
|
+
event.stopImmediatePropagation();
|
|
879
|
+
closeList();
|
|
880
|
+
this.restoreTriggerFocus({ hostElement, targetElement, autocompleteInput, openTriggerElement, preferOpenTrigger: true });
|
|
881
|
+
return true;
|
|
882
|
+
}
|
|
883
|
+
if (isSpaceKey && checkboxes && currentItem && !isInsideSearch) {
|
|
884
|
+
event.preventDefault();
|
|
885
|
+
event.stopPropagation();
|
|
886
|
+
event.stopImmediatePropagation();
|
|
887
|
+
selectFocusedItem(currentItem.id);
|
|
888
|
+
return true;
|
|
889
|
+
}
|
|
890
|
+
if (isSpaceKey && currentItem && !checkboxes && !isInsideSearch) {
|
|
891
|
+
event.preventDefault();
|
|
892
|
+
event.stopPropagation();
|
|
893
|
+
event.stopImmediatePropagation();
|
|
894
|
+
return true;
|
|
895
|
+
}
|
|
896
|
+
if (isSpaceKey && context.isTriggerFocused && !this.isEditableElement(context.activeElement)) {
|
|
897
|
+
event.preventDefault();
|
|
898
|
+
event.stopPropagation();
|
|
899
|
+
event.stopImmediatePropagation();
|
|
900
|
+
closeList();
|
|
901
|
+
this.restoreTriggerFocus({ hostElement, targetElement, autocompleteInput, openTriggerElement, preferOpenTrigger: true });
|
|
902
|
+
return true;
|
|
903
|
+
}
|
|
904
|
+
if ((isArrowDownKey || isArrowUpKey) && listElement && (context.isFocusInsideList || context.isTriggerFocused)) {
|
|
905
|
+
event.preventDefault();
|
|
906
|
+
event.stopPropagation();
|
|
907
|
+
event.stopImmediatePropagation();
|
|
908
|
+
if (context.isFocusInsideList && !isInsideSearch) {
|
|
909
|
+
return this.focusListItemByOffset(listElement, context.activeElement, isArrowUpKey ? -1 : 1);
|
|
910
|
+
}
|
|
911
|
+
return this.focusListElementWhenReady(listElement, true, isArrowUpKey ? "last" : "first");
|
|
912
|
+
}
|
|
913
|
+
if (treeview && (isArrowRightKey || isArrowLeftKey) && currentItem && !isInsideSearch) {
|
|
914
|
+
event.preventDefault();
|
|
915
|
+
event.stopPropagation();
|
|
916
|
+
event.stopImmediatePropagation();
|
|
917
|
+
if (isArrowRightKey) {
|
|
918
|
+
if (this.hasTreeChildren(currentItem) && !this.isTreeItemOpen(currentItem)) {
|
|
919
|
+
openGroup(currentItem.id);
|
|
920
|
+
return this.focusListItemWhenReady(listElement, currentItem.id);
|
|
921
|
+
}
|
|
922
|
+
return this.focusElement(this.getFirstChildListItem(currentItem));
|
|
923
|
+
}
|
|
924
|
+
if (this.hasTreeChildren(currentItem) && this.isTreeItemOpen(currentItem)) {
|
|
925
|
+
openGroup(currentItem.id);
|
|
926
|
+
return this.focusListItemWhenReady(listElement, currentItem.id);
|
|
927
|
+
}
|
|
928
|
+
return this.focusElement(this.getParentListItem(currentItem));
|
|
929
|
+
}
|
|
930
|
+
if (isEnterKey && context.isFocusInsideOpenTrigger && !this.isEditableElement(context.activeElement) && listElement) {
|
|
931
|
+
event.preventDefault();
|
|
932
|
+
event.stopPropagation();
|
|
933
|
+
event.stopImmediatePropagation();
|
|
934
|
+
return this.focusListElementWhenReady(listElement, true, "first");
|
|
935
|
+
}
|
|
936
|
+
if (isEnterKey && listElement && context.isFocusInsideList && !isInsideSearch) {
|
|
937
|
+
const focusedItem = currentItem || listElement.querySelector(".bcm-list__item.focused");
|
|
938
|
+
if (focusedItem === null || focusedItem === void 0 ? void 0 : focusedItem.id) {
|
|
939
|
+
event.preventDefault();
|
|
940
|
+
event.stopPropagation();
|
|
941
|
+
event.stopImmediatePropagation();
|
|
942
|
+
selectFocusedItem(focusedItem.id);
|
|
943
|
+
return true;
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
if (!isTabKey || !listElement)
|
|
947
|
+
return false;
|
|
948
|
+
const focusableElements = this.getFocusableElements(listElement);
|
|
949
|
+
const firstFocusableElement = focusableElements[0];
|
|
950
|
+
const lastFocusableElement = focusableElements[focusableElements.length - 1];
|
|
951
|
+
if (!event.shiftKey && context.isTriggerFocused) {
|
|
952
|
+
event.preventDefault();
|
|
953
|
+
return this.focusListElementWhenReady(listElement);
|
|
954
|
+
}
|
|
955
|
+
if (event.shiftKey && context.isFocusInsideList && firstFocusableElement && context.activeElement === firstFocusableElement) {
|
|
956
|
+
event.preventDefault();
|
|
957
|
+
closeList();
|
|
958
|
+
this.restoreTriggerFocus({ hostElement, targetElement, autocompleteInput, openTriggerElement, preferOpenTrigger: true });
|
|
959
|
+
return true;
|
|
960
|
+
}
|
|
961
|
+
if (!event.shiftKey && context.isFocusInsideList && lastFocusableElement && context.activeElement === lastFocusableElement) {
|
|
962
|
+
event.preventDefault();
|
|
963
|
+
closeList();
|
|
964
|
+
requestAnimationFrame(() => {
|
|
965
|
+
this.focusAdjacentOutside({ hostElement, targetElement, listElement, openTriggerElement, direction: "next" });
|
|
966
|
+
});
|
|
967
|
+
return true;
|
|
968
|
+
}
|
|
969
|
+
if (context.isFocusInsideList && focusableElements.length === 0) {
|
|
970
|
+
event.preventDefault();
|
|
971
|
+
closeList();
|
|
972
|
+
this.restoreTriggerFocus({ hostElement, targetElement, autocompleteInput, openTriggerElement, preferOpenTrigger: true });
|
|
973
|
+
return true;
|
|
974
|
+
}
|
|
975
|
+
return false;
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
|
|
637
979
|
class KeyControl {
|
|
638
980
|
constructor(keyCode, element, elementName, childElementName) {
|
|
639
981
|
this.elementName = '';
|
|
@@ -816,13 +1158,18 @@ class ListKeyControl extends KeyControl {
|
|
|
816
1158
|
}
|
|
817
1159
|
}
|
|
818
1160
|
}
|
|
819
|
-
keyEnterControl() {
|
|
820
|
-
|
|
1161
|
+
keyEnterControl() {
|
|
1162
|
+
const focused = this.getFocusedElement();
|
|
1163
|
+
if (!(focused === null || focused === void 0 ? void 0 : focused.id))
|
|
1164
|
+
return;
|
|
821
1165
|
if (this.isCheckBoxes) {
|
|
822
|
-
|
|
823
|
-
|
|
1166
|
+
this.checkedItem(focused.id);
|
|
1167
|
+
}
|
|
1168
|
+
else {
|
|
1169
|
+
this.selectedItem(focused.id);
|
|
824
1170
|
}
|
|
825
1171
|
}
|
|
1172
|
+
keySpaceControl() { }
|
|
826
1173
|
keyDown() {
|
|
827
1174
|
switch (this.getKeyCode()) {
|
|
828
1175
|
case Bcm.KeyCode.up:
|
|
@@ -848,7 +1195,7 @@ class ListKeyControl extends KeyControl {
|
|
|
848
1195
|
keyUp() { }
|
|
849
1196
|
}
|
|
850
1197
|
|
|
851
|
-
const listCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}*{box-sizing:border-box}.bcm-checkbox{outline:none;border:none;--bcm-checkbox-primary-color-default:var(--bcm-ui-color-background-primary-default);--bcm-checkbox-secondary-color-default:var(--bcm-ui-color-background-base-default);--bcm-checkbox-primary-color-hover:var(--bcm-ui-color-background-primary-hover);--bcm-checkbox-secondary-color-hover:var(--bcm-ui-color-background-default-default);--bcm-checkbox-primary-color-focus-visible:var(--bcm-ui-color-background-primary-active);--bcm-checkbox-secondary-color-focus-visible:var(--bcm-ui-color-background-default-active);--bcm-checkbox-primary-color-active:var(--bcm-ui-color-background-primary-active);--bcm-checkbox-secondary-color-active:var(--bcm-ui-color-background-default-active);--bcm-checkbox-primary-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-checkbox-secondary-color-disabled:var(--bcm-new-ds-color-slate-200);display:inline-flex;width:fit-content;flex-direction:column;margin-bottom:8px}.bcm-checkbox:focus,.bcm-checkbox:hover,.bcm-checkbox:active{outline:none;border:none}.bcm-checkbox *{box-sizing:border-box}.bcm-checkbox input[type=radio],.bcm-checkbox input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:#fff;margin:0;display:none}.bcm-checkbox__input{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;padding-top:4px}.bcm-checkbox.hidden{display:none}.bcm-checkbox :hover{cursor:pointer}.bcm-checkbox[disabled] :hover,.bcm-checkbox.disabled :hover{cursor:not-allowed}.bcm-checkbox .slot{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;color:var(--bcm-ui-color-text-default)}.bcm-checkbox .slot:not(:empty){margin-left:8px;margin-right:8px}.bcm-checkbox-size-small .slot{font-size:var(--bcm-ui-font-size-4);line-height:var(--bcm-ui-line-height-4);margin-top:-2.5px}.bcm-checkbox-size-small .bcm-checkbox__input{min-height:24px}.bcm-checkbox-size-small .bcm-checkbox__label-icon{width:14px;height:14px;min-width:14px;font-size:calc(10px - 2px)}.bcm-checkbox-size-medium .slot{font-size:var(--bcm-ui-font-size-5);line-height:var(--bcm-ui-line-height-4);margin-top:-1.5px}.bcm-checkbox-size-medium .bcm-checkbox__input{min-height:32px}.bcm-checkbox-size-medium .bcm-checkbox__label-icon{width:16px;height:16px;min-width:16px;font-size:10px}.bcm-checkbox-size-large .slot{font-size:var(--bcm-ui-font-size-6);line-height:var(--bcm-ui-line-height-6);margin-top:-1.5px}.bcm-checkbox-size-large .bcm-checkbox__input{min-height:40px}.bcm-checkbox-size-large .bcm-checkbox__label-icon{width:18px;height:18px;min-width:18px;font-size:12px}.bcm-checkbox__label{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap}.bcm-checkbox__label-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;border-width:1px;border-style:solid;border-radius:2px}.bcm-checkbox__label-icon-indeterminate{position:relative}.bcm-checkbox__label-icon-indeterminate:after{content:\"\";display:block;position:absolute;width:70%;height:1.5px;background:var(--bcm-new-ds-color-white)}.bcm-checkbox__label-icon.bcm-radio__icon{width:16px;height:16px;box-sizing:border-box;border-radius:100px}.bcm-checkbox__label-icon.bcm-radio__icon .bcm-radio__icon-inner{width:10px;height:10px;border-radius:100px;background-color:var(--bcm-new-ds-color-white)}.bcm-checkbox .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-default);color:var(--bcm-checkbox-secondary-color-default);border-color:var(--bcm-new-ds-color-slate-300)}.bcm-checkbox .bcm-checkbox__label-icon-checked,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-default);border-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-default);background-color:var(--bcm-checkbox-secondary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox:hover .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-hover);color:var(--bcm-checkbox-secondary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-hover);background-color:var(--bcm-checkbox-secondary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-focus-visible);color:var(--bcm-checkbox-secondary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-focus-visible);background-color:var(--bcm-checkbox-secondary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:active .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-active);color:var(--bcm-checkbox-secondary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-active);background-color:var(--bcm-checkbox-secondary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-disabled);color:var(--bcm-checkbox-secondary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-disabled);background-color:var(--bcm-checkbox-secondary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[no-margin] .bcm-checkbox__input{margin:0;min-height:0;padding:0}.bcm-list{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;--width:256px;--height:256px;--max-height:inherit;--min-height:inherit;min-width:90px;display:flex;flex-direction:column;margin:0 0 8px 0}.bcm-list__listbox .bcm-list__container{height:var(--height);max-height:var(--max-height);min-height:var(--min-height)}.bcm-list.full-width{width:100%}.bcm-list__size-small .bcm-list__input{height:24px;font-size:var(--bcm-ui-font-size-4);line-height:var(--bcm-ui-line-height-4)}.bcm-list__size-small .bcm-list__input .bcm-tag__content.dismissable{font-size:10px;line-height:calc(10px + 8px)}.bcm-list__size-medium .bcm-list__input{height:32px;font-size:var(--bcm-ui-font-size-5);line-height:var(--bcm-ui-line-height-5)}.bcm-list__size-medium .bcm-list__input .bcm-tag__content.dismissable{font-size:12px;line-height:calc(12px + 8px)}.bcm-list__size-large .bcm-list__input{height:40px;font-size:var(--bcm-ui-font-size-6);line-height:var(--bcm-ui-line-height-6)}.bcm-list__size-large .bcm-list__input .bcm-tag__content.dismissable{font-size:14px;line-height:calc(14px + 8px)}.bcm-list:hover{outline:none}.bcm-list:hover .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-500);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list:focus-visible{outline:none}.bcm-list:focus-visible .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-600);background-color:var(--bcm-new-ds-color-white)}.bcm-list:active{outline:none}.bcm-list:active .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-600);box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-list__container{--width:256px;--height:256px;width:var(--width);height:var(--height);background-color:var(--bcm-ui-color-background-base-default);border:1px solid var(--bcm-ui-color-border-default);border-radius:var(--bcm-ui-border-radius-default);box-sizing:border-box;padding-top:8px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;gap:4px}.bcm-list__container main{padding:0 8px;flex:1;overflow:auto;display:flex;flex-direction:column}.bcm-list__container-search{margin:0 8px}.bcm-list__container-search:after{margin:4px 0}.bcm-list__container-no-data{flex:1;display:flex;justify-content:stretch;align-items:stretch;padding-bottom:4px}.bcm-list__container.error{border-color:var(--bcm-color-red-6)}.bcm-list__container.full-width{width:100%}.bcm-list__container.bcm-list__type-linked-component,.bcm-list__container.bcm-list__type-select,.bcm-list__container.bcm-list__type-autocomplete{display:none;opacity:0;visibility:hidden;position:absolute;top:0;left:0;height:0;width:0;transform:translateY(10%);z-index:10800}.bcm-list__container.bcm-list__type-linked-component.is-open,.bcm-list__container.bcm-list__type-select.is-open,.bcm-list__container.bcm-list__type-autocomplete.is-open{transition:transform 50ms;display:flex}.bcm-list__container.bcm-list__type-linked-component.is-open-animation,.bcm-list__container.bcm-list__type-select.is-open-animation,.bcm-list__container.bcm-list__type-autocomplete.is-open-animation{opacity:1;transform:translateY(0);visibility:visible}.bcm-list__container.bcm-list__type-linked-component{margin-top:2px}.bcm-list__label{display:contents}.bcm-list__label>div{display:contents}.bcm-list__input{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;color:var(--bcm-ui-color-text-default);background-color:var(--bcm-ui-color-background-base-default);border:1px solid var(--bcm-ui-color-border-default);border-radius:var(--bcm-ui-border-radius-default);user-select:none;cursor:pointer;padding:0 8px;height:32px;overflow:hidden;position:relative;transition:background-color 100ms, border-color 100ms}.bcm-list__input-spinner{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:var(--bcm-color-grey-1);opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out;z-index:-1}.bcm-list__input-spinner.is-open{opacity:1;visibility:visible;z-index:1}.bcm-list__input-container{flex:1;display:block;overflow:hidden}.bcm-list__input-container.value-empty{color:#6B7280}.bcm-list__input-container.type-single,.bcm-list__input-container.value-empty{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bcm-list__input-placeholder{color:var(--bcm-ui-color-text-placeholder)}.bcm-list__input-tag-container{height:100%;width:100%;display:flex;align-items:center;justify-content:flex-start;flex-wrap:nowrap;grid-gap:2px;line-height:1}.bcm-list__input-buttons{display:flex;align-items:center;justify-content:flex-end;grid-gap:4px}.bcm-list__input-buttons-button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0 4px 0 4px;font-size:16px;color:var(--bcm-ui-color-text-default)}.bcm-list__input-buttons-button.caret-is{transform:rotate(360deg);transition:transform 0.2s ease-in-out}.bcm-list__input-buttons-button.caret-is-open{transform:rotate(180deg)}.bcm-list__input-buttons:not(.disabled) .bcm-list__input-buttons-button:hover{cursor:pointer;color:var(--bcm-new-ds-color-slate-600)}.bcm-list__input-autocomplete{position:relative;padding-right:0}.bcm-list__input-autocomplete .bcm-list-input-selected-text{background-color:#ffffff;display:flex;align-items:center;justify-content:flex-start;width:calc(100% - 24px);height:100%;padding:0 calc(8px + 4px);position:absolute;top:0;left:0}.bcm-list__input-autocomplete .bcm-list__input-container{height:100%;display:flex;flex-direction:row}.bcm-list__input-autocomplete .bcm-list__input-container .bcm-list__input-tag-container{width:auto}.bcm-list__input-autocomplete .bcm-input,.bcm-list__input-autocomplete .bcm-list__autocomplete{height:100%;min-width:70px;width:100%}.bcm-list__input-autocomplete .bcm-input__container,.bcm-list__input-autocomplete .bcm-list__autocomplete__container{height:100%;border:none;padding:0;width:100%}.bcm-list__input-autocomplete .bcm-input__container:not(.disabled).focused,.bcm-list__input-autocomplete .bcm-input__container:not(.disabled):hover,.bcm-list__input-autocomplete .bcm-list__autocomplete__container:not(.disabled).focused,.bcm-list__input-autocomplete .bcm-list__autocomplete__container:not(.disabled):hover{border:none;box-shadow:none}.bcm-list__autocomplete{width:100%;position:relative}.bcm-list.full-width .bcm-list__container,.bcm-list.full-width .bcm-list__input{width:100%}.bcm-list.error .bcm-list__input{border-color:var(--bcm-color-red-6)}.bcm-list.disabled .bcm-list__container,.bcm-list.disabled .bcm-list__input{color:var(--bcm-ui-color-text-disabled);background-color:var(--bcm-ui-color-background-disabled-default);cursor:not-allowed}.bcm-list.disabled .bcm-tag__content.dismissable .close-button{cursor:default}.bcm-list:not(.disabled) .bcm-list__input .bcm-tag__content.checked .close-button bcm-icon{color:var(--bcm-new-ds-color-slate-100)}.bcm-list:not(.disabled) .bcm-list__input .bcm-tag__content.checked .close-button:hover bcm-icon{color:var(--bcm-new-ds-color-slate-200)}.bcm-list:not(.disabled) .bcm-list__input:hover{border-color:var(--bcm-ui-color-border-primary)}.bcm-list:not(.disabled) .bcm-list__input:hover .bcm-tag__content.dismissable:not(.checked){background-color:var(--bcm-new-ds-color-slate-200);border-color:var(--bcm-new-ds-color-slate-200)}.bcm-list:not(.disabled) .bcm-list__input:focus-visible{border-color:var(--bcm-ui-color-border-primary);box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-list:not(.disabled) .bcm-list__input:active{border-color:var(--bcm-ui-color-border-primary)}.bcm-list__item{padding:2px 0}.bcm-list__item.disabled{user-select:none}.bcm-list__item:focus{outline:none}.bcm-list__item:focus-visible>.bcm-list__item-content{background-color:var(--bcm-new-ds-color-slate-300)}.bcm-list__item:focus-visible>.bcm-list__item-content:not(.disabled){color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item-content{display:flex;flex-direction:row;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;cursor:pointer;border-radius:4px;padding:0;padding-left:4px;color:var(--bcm-ui-color-text-default);transition:background-color 0.2s ease}.bcm-list__item-content.disabled{color:var(--bcm-ui-color-text-disabled);background-color:var(--bcm-ui-color-background-disabled-default);user-select:none;cursor:not-allowed}.bcm-list__item-content.readonly{color:var(--bcm-new-ds-color-slate-500);background-color:var(--bcm-new-ds-color-slate-100);cursor:default}.bcm-list__item-content.readonly .bcm-list__item-content-collapse-icon{color:var(--bcm-new-ds-color-slate-700);cursor:pointer}.bcm-list__item-content.selected{color:var(--bcm-ui-color-text-primary);background-color:var(--bcm-ui-color-background-stated-primary-default)}.bcm-list__item-content.selected:hover:not(.disabled):not(.readonly){color:var(--bcm-ui-color-text-primary);background-color:var(--bcm-ui-color-background-stated-primary-hover)}.bcm-list__item-content:hover:not(.disabled):not(.readonly){background-color:var(--bcm-ui-color-background-base-hover)}.bcm-list__item-content:active:not(.disabled):not(.readonly){color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-ui-color-background-base-active)}.bcm-list__item-content-collapse-icon{width:16px;padding:0 8px;display:flex;align-items:center;justify-content:center;font-size:16px}.bcm-list__item-content-collapse-icon.child{cursor:pointer}.bcm-list__item-content-text{user-select:none;padding:8px;width:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.bcm-list__item-content-text.treeview{padding:8px 0}.bcm-list__item-content-text-checkbox{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;margin-right:8px}.bcm-list__item-content-text-checkbox .bcm-checkbox{margin:0}.bcm-list__item-content-text-inner{width:100%}.bcm-list__item-content-text mark{padding:0;margin:0;font-size:inherit;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-yellow-4)}.bcm-list__item-childs{padding-left:16px}.bcm-list__item-small{padding:2px 0 2px 8px;font-size:10px;line-height:calc(10px + 8px)}.bcm-list__item-small .bcm-list__item-content-text{padding:3px 4px}.bcm-list__item-medium{font-size:12px;line-height:calc(12px + 8px)}.bcm-list__item-medium .bcm-list__item-content-text{padding:6px 4px}.bcm-list__item-large{font-size:14px;line-height:calc(14px + 8px)}.bcm-list__item-large .bcm-list__item-content-text{padding:9px 4px}.bcm-list__item--group{border-radius:4px}.bcm-list__item--group:focus>.bcm-list__item-content:not(.disabled){background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-content{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);border-radius:4px 4px 0 0;cursor:default;font-size:14px;line-height:calc(14px + 8px);font-weight:500;position:sticky;top:0}.bcm-list__item--group>.bcm-list__item-content>.bcm-list__item-content-text{padding:4px 8px 4px 16px}.bcm-list__item--group>.bcm-list__item-content:hover,.bcm-list__item--group>.bcm-list__item-content:focus{color:var(--bcm-new-ds-color-slate-800);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-content-unclickable:hover{color:var(--bcm-new-ds-color-slate-700);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-childs{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);padding-bottom:8px;border-radius:0 0 4px 4px;padding-left:8px}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content{background-color:var(--bcm-new-ds-color-white);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:hover{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:active{background-color:var(--bcm-new-ds-color-slate-200)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:focus-visible{background-color:var(--bcm-new-ds-color-slate-300)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected{background-color:var(--bcm-new-ds-color-blue-500);color:var(--bcm-new-ds-color-white)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:hover{background-color:var(--bcm-new-ds-color-blue-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:active{background-color:var(--bcm-new-ds-color-blue-700)}.bcm-list__linked{display:none}.bcm-list .bcm-tag--other .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bcm-info-footer{text-align:right;padding:4px 8px;background-color:var(--bcm-new-ds-color-slate-100);color:var(--bcm-new-ds-color-slate-600);border-radius:0 0 4px 4px}";
|
|
1198
|
+
const listCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}*{box-sizing:border-box}.bcm-checkbox{outline:none;border:none;--bcm-checkbox-primary-color-default:var(--bcm-ui-color-background-primary-default);--bcm-checkbox-secondary-color-default:var(--bcm-ui-color-background-base-default);--bcm-checkbox-primary-color-hover:var(--bcm-ui-color-background-primary-hover);--bcm-checkbox-secondary-color-hover:var(--bcm-ui-color-background-default-default);--bcm-checkbox-primary-color-focus-visible:var(--bcm-ui-color-background-primary-active);--bcm-checkbox-secondary-color-focus-visible:var(--bcm-ui-color-background-default-active);--bcm-checkbox-primary-color-active:var(--bcm-ui-color-background-primary-active);--bcm-checkbox-secondary-color-active:var(--bcm-ui-color-background-default-active);--bcm-checkbox-primary-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-checkbox-secondary-color-disabled:var(--bcm-new-ds-color-slate-200);display:inline-flex;width:fit-content;flex-direction:column;margin-bottom:8px}.bcm-checkbox:focus,.bcm-checkbox:hover,.bcm-checkbox:active{outline:none;border:none}.bcm-checkbox *{box-sizing:border-box}.bcm-checkbox input[type=radio],.bcm-checkbox input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:#fff;margin:0;display:none}.bcm-checkbox__input{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;padding-top:4px}.bcm-checkbox.hidden{display:none}.bcm-checkbox :hover{cursor:pointer}.bcm-checkbox[disabled] :hover,.bcm-checkbox.disabled :hover{cursor:not-allowed}.bcm-checkbox .slot{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;color:var(--bcm-ui-color-text-default)}.bcm-checkbox .slot:not(:empty){margin-left:8px;margin-right:8px}.bcm-checkbox-size-small .slot{font-size:var(--bcm-ui-font-size-4);line-height:var(--bcm-ui-line-height-4);margin-top:-2.5px}.bcm-checkbox-size-small .bcm-checkbox__input{min-height:24px}.bcm-checkbox-size-small .bcm-checkbox__label-icon{width:14px;height:14px;min-width:14px;font-size:calc(10px - 2px)}.bcm-checkbox-size-medium .slot{font-size:var(--bcm-ui-font-size-5);line-height:var(--bcm-ui-line-height-4);margin-top:-1.5px}.bcm-checkbox-size-medium .bcm-checkbox__input{min-height:32px}.bcm-checkbox-size-medium .bcm-checkbox__label-icon{width:16px;height:16px;min-width:16px;font-size:10px}.bcm-checkbox-size-large .slot{font-size:var(--bcm-ui-font-size-6);line-height:var(--bcm-ui-line-height-6);margin-top:-1.5px}.bcm-checkbox-size-large .bcm-checkbox__input{min-height:40px}.bcm-checkbox-size-large .bcm-checkbox__label-icon{width:18px;height:18px;min-width:18px;font-size:12px}.bcm-checkbox__label{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap}.bcm-checkbox__label-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;border-width:1px;border-style:solid;border-radius:2px}.bcm-checkbox__label-icon-indeterminate{position:relative}.bcm-checkbox__label-icon-indeterminate:after{content:\"\";display:block;position:absolute;width:70%;height:1.5px;background:var(--bcm-new-ds-color-white)}.bcm-checkbox__label-icon.bcm-radio__icon{width:16px;height:16px;box-sizing:border-box;border-radius:100px}.bcm-checkbox__label-icon.bcm-radio__icon .bcm-radio__icon-inner{width:10px;height:10px;border-radius:100px;background-color:var(--bcm-new-ds-color-white)}.bcm-checkbox .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-default);color:var(--bcm-checkbox-secondary-color-default);border-color:var(--bcm-new-ds-color-slate-300)}.bcm-checkbox .bcm-checkbox__label-icon-checked,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-default);border-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-default);background-color:var(--bcm-checkbox-secondary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox:hover .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-hover);color:var(--bcm-checkbox-secondary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-hover);background-color:var(--bcm-checkbox-secondary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-focus-visible);color:var(--bcm-checkbox-secondary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-focus-visible);background-color:var(--bcm-checkbox-secondary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:active .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-active);color:var(--bcm-checkbox-secondary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-active);background-color:var(--bcm-checkbox-secondary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-disabled);color:var(--bcm-checkbox-secondary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-disabled);background-color:var(--bcm-checkbox-secondary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[no-margin] .bcm-checkbox__input{margin:0;min-height:0;padding:0}.bcm-list{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;--width:256px;--height:256px;--max-height:inherit;--min-height:inherit;min-width:90px;display:flex;flex-direction:column;margin:0 0 8px 0}.bcm-list__listbox .bcm-list__container{height:var(--height);max-height:var(--max-height);min-height:var(--min-height)}.bcm-list.full-width{width:100%}.bcm-list__size-small .bcm-list__input{height:24px;font-size:var(--bcm-ui-font-size-4);line-height:var(--bcm-ui-line-height-4)}.bcm-list__size-small .bcm-list__input .bcm-tag__content.dismissable{font-size:10px;line-height:calc(10px + 8px)}.bcm-list__size-medium .bcm-list__input{height:32px;font-size:var(--bcm-ui-font-size-5);line-height:var(--bcm-ui-line-height-5)}.bcm-list__size-medium .bcm-list__input .bcm-tag__content.dismissable{font-size:12px;line-height:calc(12px + 8px)}.bcm-list__size-large .bcm-list__input{height:40px;font-size:var(--bcm-ui-font-size-6);line-height:var(--bcm-ui-line-height-6)}.bcm-list__size-large .bcm-list__input .bcm-tag__content.dismissable{font-size:14px;line-height:calc(14px + 8px)}.bcm-list:hover{outline:none}.bcm-list:hover .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-500);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list:focus-visible{outline:none}.bcm-list:focus-visible .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-600);background-color:var(--bcm-new-ds-color-white)}.bcm-list:active{outline:none}.bcm-list:active .bcm-list__input{border-color:var(--bcm-new-ds-color-blue-600);box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-list__container{--width:256px;--height:256px;width:var(--width);height:var(--height);background-color:var(--bcm-ui-color-background-base-default);border:1px solid var(--bcm-ui-color-border-default);border-radius:var(--bcm-ui-border-radius-default);box-sizing:border-box;padding-top:8px;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;gap:4px}.bcm-list__container main{padding:0 8px;flex:1;overflow:auto;display:flex;flex-direction:column}.bcm-list__container-search{margin:0 8px}.bcm-list__container-search:after{margin:4px 0}.bcm-list__container-no-data{flex:1;display:flex;justify-content:stretch;align-items:stretch;padding-bottom:4px}.bcm-list__container.error{border-color:var(--bcm-color-red-6)}.bcm-list__container.full-width{width:100%}.bcm-list__container.bcm-list__type-linked-component,.bcm-list__container.bcm-list__type-select,.bcm-list__container.bcm-list__type-autocomplete{display:none;opacity:0;visibility:hidden;position:absolute;top:0;left:0;height:0;width:0;z-index:10800}.bcm-list__container.bcm-list__type-linked-component.is-open,.bcm-list__container.bcm-list__type-select.is-open,.bcm-list__container.bcm-list__type-autocomplete.is-open{display:flex}.bcm-list__container.bcm-list__type-linked-component.is-open-animation,.bcm-list__container.bcm-list__type-select.is-open-animation,.bcm-list__container.bcm-list__type-autocomplete.is-open-animation{opacity:1;visibility:visible}.bcm-list__container.bcm-list__type-linked-component{margin-top:2px}.bcm-list__label{display:contents}.bcm-list__label>div{display:contents}.bcm-list__input{display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;color:var(--bcm-ui-color-text-default);background-color:var(--bcm-ui-color-background-base-default);border:1px solid var(--bcm-ui-color-border-default);border-radius:var(--bcm-ui-border-radius-default);user-select:none;cursor:pointer;padding:0 8px;height:32px;overflow:hidden;position:relative;transition:background-color 100ms, border-color 100ms}.bcm-list__input-spinner{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;background-color:var(--bcm-color-grey-1);opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out;z-index:-1}.bcm-list__input-spinner.is-open{opacity:1;visibility:visible;z-index:1}.bcm-list__input-container{flex:1;display:block;overflow:hidden}.bcm-list__input-container.value-empty{color:#6B7280}.bcm-list__input-container.type-single,.bcm-list__input-container.value-empty{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bcm-list__input-placeholder{color:var(--bcm-ui-color-text-placeholder)}.bcm-list__input-tag-container{height:100%;width:100%;display:flex;align-items:center;justify-content:flex-start;flex-wrap:nowrap;grid-gap:2px;line-height:1}.bcm-list__input-buttons{display:flex;align-items:center;justify-content:flex-end;grid-gap:4px}.bcm-list__input-buttons-button{display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding:0 4px 0 4px;font-size:16px;color:var(--bcm-ui-color-text-default)}.bcm-list__input-buttons-button.caret-is{transform:rotate(360deg);transition:transform 0.2s ease-in-out}.bcm-list__input-buttons-button.caret-is-open{transform:rotate(180deg)}.bcm-list__input-buttons:not(.disabled) .bcm-list__input-buttons-button:hover{cursor:pointer;color:var(--bcm-new-ds-color-slate-600)}.bcm-list__input-autocomplete{position:relative;padding-right:0}.bcm-list__input-autocomplete .bcm-list-input-selected-text{background-color:#ffffff;display:flex;align-items:center;justify-content:flex-start;width:calc(100% - 24px);height:100%;padding:0 calc(8px + 4px);position:absolute;top:0;left:0}.bcm-list__input-autocomplete .bcm-list__input-container{height:100%;display:flex;flex-direction:row}.bcm-list__input-autocomplete .bcm-list__input-container .bcm-list__input-tag-container{width:auto}.bcm-list__input-autocomplete .bcm-input,.bcm-list__input-autocomplete .bcm-list__autocomplete{height:100%;min-width:70px;width:100%}.bcm-list__input-autocomplete .bcm-input__container,.bcm-list__input-autocomplete .bcm-list__autocomplete__container{height:100%;border:none;padding:0;width:100%}.bcm-list__input-autocomplete .bcm-input__container:not(.disabled).focused,.bcm-list__input-autocomplete .bcm-input__container:not(.disabled):hover,.bcm-list__input-autocomplete .bcm-list__autocomplete__container:not(.disabled).focused,.bcm-list__input-autocomplete .bcm-list__autocomplete__container:not(.disabled):hover{border:none;box-shadow:none}.bcm-list__autocomplete{width:100%;position:relative}.bcm-list.full-width .bcm-list__container,.bcm-list.full-width .bcm-list__input{width:100%}.bcm-list.error .bcm-list__input{border-color:var(--bcm-color-red-6)}.bcm-list.disabled .bcm-list__container,.bcm-list.disabled .bcm-list__input{color:var(--bcm-ui-color-text-disabled);background-color:var(--bcm-ui-color-background-disabled-default);cursor:not-allowed}.bcm-list.disabled .bcm-tag__content.dismissable .close-button{cursor:default}.bcm-list:not(.disabled) .bcm-list__input .bcm-tag__content.checked .close-button bcm-icon{color:var(--bcm-new-ds-color-slate-100)}.bcm-list:not(.disabled) .bcm-list__input .bcm-tag__content.checked .close-button:hover bcm-icon{color:var(--bcm-new-ds-color-slate-200)}.bcm-list:not(.disabled) .bcm-list__input:hover{border-color:var(--bcm-ui-color-border-primary)}.bcm-list:not(.disabled) .bcm-list__input:hover .bcm-tag__content.dismissable:not(.checked){background-color:var(--bcm-new-ds-color-slate-200);border-color:var(--bcm-new-ds-color-slate-200)}.bcm-list:not(.disabled) .bcm-list__input:focus-visible{border-color:var(--bcm-ui-color-border-primary);box-shadow:0 1px 3px 0 rgba(17, 24, 38, 0.1)}.bcm-list:not(.disabled) .bcm-list__input:active{border-color:var(--bcm-ui-color-border-primary)}.bcm-list__item{padding:2px 0}.bcm-list__item.disabled{user-select:none}.bcm-list__item:focus{outline:none}.bcm-list__item:focus-visible>.bcm-list__item-content{background-color:var(--bcm-new-ds-color-slate-300)}.bcm-list__item:focus-visible>.bcm-list__item-content:not(.disabled){color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item-content{display:flex;flex-direction:row;align-items:stretch;justify-content:flex-start;flex-wrap:nowrap;cursor:pointer;border-radius:4px;padding:0;padding-left:4px;color:var(--bcm-ui-color-text-default);transition:background-color 0.2s ease}.bcm-list__item-content.disabled{color:var(--bcm-ui-color-text-disabled);background-color:var(--bcm-ui-color-background-disabled-default);user-select:none;cursor:not-allowed}.bcm-list__item-content.readonly{color:var(--bcm-new-ds-color-slate-500);background-color:var(--bcm-new-ds-color-slate-100);cursor:default}.bcm-list__item-content.readonly .bcm-list__item-content-collapse-icon{color:var(--bcm-new-ds-color-slate-700);cursor:pointer}.bcm-list__item-content.selected{color:var(--bcm-ui-color-text-primary);background-color:var(--bcm-ui-color-background-stated-primary-default)}.bcm-list__item-content.selected:hover:not(.disabled):not(.readonly){color:var(--bcm-ui-color-text-primary);background-color:var(--bcm-ui-color-background-stated-primary-hover)}.bcm-list__item-content:hover:not(.disabled):not(.readonly){background-color:var(--bcm-ui-color-background-base-hover)}.bcm-list__item-content:active:not(.disabled):not(.readonly){color:var(--bcm-new-ds-color-slate-600);background-color:var(--bcm-ui-color-background-base-active)}.bcm-list__item-content-collapse-icon{width:16px;padding:0 8px;display:flex;align-items:center;justify-content:center;font-size:16px}.bcm-list__item-content-collapse-icon.child{cursor:pointer}.bcm-list__item-content-text{user-select:none;padding:8px;width:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.bcm-list__item-content-text.treeview{padding:8px 0}.bcm-list__item-content-text-checkbox{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;margin-right:8px}.bcm-list__item-content-text-checkbox .bcm-checkbox{margin:0}.bcm-list__item-content-text-inner{width:100%}.bcm-list__item-content-text mark{padding:0;margin:0;font-size:inherit;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-yellow-4)}.bcm-list__item-childs{padding-left:16px}.bcm-list__item-small{padding:2px 0 2px 8px;font-size:10px;line-height:calc(10px + 8px)}.bcm-list__item-small .bcm-list__item-content-text{padding:3px 4px}.bcm-list__item-medium{font-size:12px;line-height:calc(12px + 8px)}.bcm-list__item-medium .bcm-list__item-content-text{padding:6px 4px}.bcm-list__item-large{font-size:14px;line-height:calc(14px + 8px)}.bcm-list__item-large .bcm-list__item-content-text{padding:9px 4px}.bcm-list__item--group{border-radius:4px}.bcm-list__item--group:focus>.bcm-list__item-content:not(.disabled){background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-content{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);border-radius:4px 4px 0 0;cursor:default;font-size:14px;line-height:calc(14px + 8px);font-weight:500;position:sticky;top:0}.bcm-list__item--group>.bcm-list__item-content>.bcm-list__item-content-text{padding:4px 8px 4px 16px}.bcm-list__item--group>.bcm-list__item-content:hover,.bcm-list__item--group>.bcm-list__item-content:focus{color:var(--bcm-new-ds-color-slate-800);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-content-unclickable:hover{color:var(--bcm-new-ds-color-slate-700);background-color:var(--bcm-new-ds-color-slate-50)}.bcm-list__item--group>.bcm-list__item-childs{background-color:var(--bcm-new-ds-color-slate-50);color:var(--bcm-new-ds-color-slate-600);padding-bottom:8px;border-radius:0 0 4px 4px;padding-left:8px}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content{background-color:var(--bcm-new-ds-color-white);color:var(--bcm-new-ds-color-slate-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:hover{background-color:var(--bcm-new-ds-color-slate-100)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:active{background-color:var(--bcm-new-ds-color-slate-200)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content:focus-visible{background-color:var(--bcm-new-ds-color-slate-300)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected{background-color:var(--bcm-new-ds-color-blue-500);color:var(--bcm-new-ds-color-white)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:hover{background-color:var(--bcm-new-ds-color-blue-600)}.bcm-list__item--group>.bcm-list__item-childs .bcm-list__item-content.selected:active{background-color:var(--bcm-new-ds-color-blue-700)}.bcm-list__linked{display:none}.bcm-list .bcm-tag--other .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media (max-width: 768px), (pointer: coarse){.bcm-list__container-search .bcm-input__container,.bcm-list__autocomplete .bcm-input__container{font-size:16px}.bcm-list__container-search .bcm-input-element,.bcm-list__autocomplete .bcm-input-element{font-size:16px}}.bcm-info-footer{text-align:right;padding:4px 8px;background-color:var(--bcm-new-ds-color-slate-100);color:var(--bcm-new-ds-color-slate-600);border-radius:0 0 4px 4px}";
|
|
852
1199
|
|
|
853
1200
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
854
1201
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -871,8 +1218,18 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
871
1218
|
this.close = createEvent(this, "bcm-close", 3);
|
|
872
1219
|
this.listClose = createEvent(this, "bcm-list-close", 7);
|
|
873
1220
|
this.listOpen = createEvent(this, "bcm-list-open", 7);
|
|
1221
|
+
var _a, _b;
|
|
874
1222
|
this.debounce = null;
|
|
1223
|
+
this.focusManager = new ListFocusManager();
|
|
1224
|
+
this.openTriggerElement = null;
|
|
1225
|
+
this.suppressScrollCloseUntil = 0;
|
|
875
1226
|
this.debounceHandler = Generate.debounceInput(() => this.listenResize(), 300, false);
|
|
1227
|
+
this.handleVisualViewportChange = () => {
|
|
1228
|
+
if (!this.isOpen)
|
|
1229
|
+
return;
|
|
1230
|
+
this.preventScrollClose(400);
|
|
1231
|
+
this.calculateLocation();
|
|
1232
|
+
};
|
|
876
1233
|
this._id = Generate.UID();
|
|
877
1234
|
this.tempId = Generate.UID();
|
|
878
1235
|
this.type = Bcm$1.ListType.listbox;
|
|
@@ -954,6 +1311,8 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
954
1311
|
window.addEventListener("scroll", this.handleWheel.bind(this), true);
|
|
955
1312
|
window.addEventListener("wheel", this.handleWheel.bind(this), true);
|
|
956
1313
|
window.addEventListener("resize", this.handleResize.bind(this), true);
|
|
1314
|
+
(_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.addEventListener("resize", this.handleVisualViewportChange, true);
|
|
1315
|
+
(_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.addEventListener("scroll", this.handleVisualViewportChange, true);
|
|
957
1316
|
}
|
|
958
1317
|
connectedCallback() {
|
|
959
1318
|
if (this.height != "256px") {
|
|
@@ -1004,7 +1363,10 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1004
1363
|
// }
|
|
1005
1364
|
}
|
|
1006
1365
|
disconnectedCallback() {
|
|
1366
|
+
var _a, _b;
|
|
1007
1367
|
this.isOpen = false;
|
|
1368
|
+
(_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.removeEventListener("resize", this.handleVisualViewportChange, true);
|
|
1369
|
+
(_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.removeEventListener("scroll", this.handleVisualViewportChange, true);
|
|
1008
1370
|
if (this.stopDeepClean)
|
|
1009
1371
|
return;
|
|
1010
1372
|
listState.removeState(this._id);
|
|
@@ -1063,8 +1425,10 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1063
1425
|
}
|
|
1064
1426
|
async handleOpen() {
|
|
1065
1427
|
const isAutoSelected = this.autoFocusSelected && this.type == "select" && !this.checkboxes && this.value;
|
|
1428
|
+
const isMobile = this.isMobileViewport();
|
|
1066
1429
|
if (this.isOpen) {
|
|
1067
1430
|
this.detectClone();
|
|
1431
|
+
await this.prepareMobileViewportForOpen();
|
|
1068
1432
|
if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
|
|
1069
1433
|
const list = this.el.querySelector(`#bcm-list-${this._id}`);
|
|
1070
1434
|
if (list) {
|
|
@@ -1075,7 +1439,9 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1075
1439
|
this.open.emit();
|
|
1076
1440
|
this.calculateLocation();
|
|
1077
1441
|
this.onSelectSearch();
|
|
1078
|
-
|
|
1442
|
+
if (!isMobile) {
|
|
1443
|
+
await delay(50);
|
|
1444
|
+
}
|
|
1079
1445
|
this.isOpenAnimation = true;
|
|
1080
1446
|
if (isAutoSelected) {
|
|
1081
1447
|
this.focusSelectedElement();
|
|
@@ -1133,11 +1499,41 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1133
1499
|
this.calculateLocation();
|
|
1134
1500
|
}
|
|
1135
1501
|
}
|
|
1502
|
+
else if (this.shouldKeepOpenWhileInteracting(list)) {
|
|
1503
|
+
if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
|
|
1504
|
+
this.calculateLocation();
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1136
1507
|
else {
|
|
1137
1508
|
this.hide();
|
|
1138
1509
|
}
|
|
1139
1510
|
}
|
|
1140
1511
|
}
|
|
1512
|
+
handleTouchStart(event) {
|
|
1513
|
+
if (!this.isOpen)
|
|
1514
|
+
return;
|
|
1515
|
+
const list = document.querySelector(`#bcm-list-${this._id}`);
|
|
1516
|
+
const isInside = Generate.findEventPath(event, this.el) || (list && Generate.findEventPath(event, list));
|
|
1517
|
+
if (isInside) {
|
|
1518
|
+
this.preventScrollClose(1000);
|
|
1519
|
+
}
|
|
1520
|
+
else if (this.type == "select" || this.type == "autocomplete" || this.linkedComponent) {
|
|
1521
|
+
this.isOpen = false;
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
handleFocusIn(event) {
|
|
1525
|
+
if (!this.isOpen)
|
|
1526
|
+
return;
|
|
1527
|
+
const list = document.querySelector(`#bcm-list-${this._id}`);
|
|
1528
|
+
const isInside = Generate.findEventPath(event, this.el) || (list && Generate.findEventPath(event, list));
|
|
1529
|
+
if (isInside) {
|
|
1530
|
+
this.preventScrollClose(1000);
|
|
1531
|
+
this.calculateLocation();
|
|
1532
|
+
}
|
|
1533
|
+
else if (this.isOverlayType()) {
|
|
1534
|
+
this.isOpen = false;
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1141
1537
|
clearAutocomplete() {
|
|
1142
1538
|
if (this.type == "autocomplete") {
|
|
1143
1539
|
const autocompleteInput = this.getAutoCompleteInput();
|
|
@@ -1233,8 +1629,8 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1233
1629
|
var _a, _b, _c, _d, _e, _f;
|
|
1234
1630
|
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`) {
|
|
1235
1631
|
this.searchGetParents = snq(() => { var _a; return (_a = event.detail) === null || _a === void 0 ? void 0 : _a.parentIndex; }, null);
|
|
1236
|
-
this.searchResultLimit = 10;
|
|
1237
1632
|
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;
|
|
1633
|
+
this.searchResultLimit = this.getInitialSearchResultLimit();
|
|
1238
1634
|
this.returnFilterData = listState.filterData(this._id, (_e = event.detail) === null || _e === void 0 ? void 0 : _e.nestedResult);
|
|
1239
1635
|
if (this.searchFound > 0 && this.highlight) {
|
|
1240
1636
|
this.highlightText = (_f = event.detail) === null || _f === void 0 ? void 0 : _f.value;
|
|
@@ -1260,13 +1656,51 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1260
1656
|
//keyboard navigation
|
|
1261
1657
|
handleKeyDown(ev) {
|
|
1262
1658
|
const keycode = ev.keyCode || ev.which;
|
|
1263
|
-
|
|
1264
|
-
|
|
1659
|
+
const handled = this.focusManager.handleKeyDown({
|
|
1660
|
+
event: ev,
|
|
1661
|
+
disabled: this.disabled,
|
|
1662
|
+
isOpen: this.isOpen,
|
|
1663
|
+
isOverlayType: this.isOverlayType(),
|
|
1664
|
+
hostElement: this.el,
|
|
1665
|
+
targetElement: this.getTargetElement(),
|
|
1666
|
+
listElement: document.getElementById(`bcm-list-${this._id}`),
|
|
1667
|
+
openList: () => {
|
|
1668
|
+
this.rememberOpenTrigger();
|
|
1669
|
+
this.isOpen = true;
|
|
1670
|
+
},
|
|
1671
|
+
closeList: () => {
|
|
1265
1672
|
this.isOpen = false;
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1673
|
+
},
|
|
1674
|
+
selectFocusedItem: (itemId) => {
|
|
1675
|
+
if (this.checkboxes) {
|
|
1676
|
+
this.checkedItem(itemId);
|
|
1677
|
+
}
|
|
1678
|
+
else {
|
|
1679
|
+
this.selectedItem(itemId);
|
|
1680
|
+
}
|
|
1681
|
+
},
|
|
1682
|
+
openGroup: (itemId) => {
|
|
1683
|
+
this.openGroup(itemId);
|
|
1684
|
+
},
|
|
1685
|
+
treeview: this.treeview,
|
|
1686
|
+
checkboxes: this.checkboxes,
|
|
1687
|
+
autocompleteInput: this.type == "autocomplete" ? this.getAutoCompleteInput() : null,
|
|
1688
|
+
openTriggerElement: this.openTriggerElement,
|
|
1689
|
+
});
|
|
1690
|
+
if (handled)
|
|
1691
|
+
return;
|
|
1692
|
+
if ((ev.key === "Escape" || keycode === Bcm$1.KeyCode.escape) && this.isOpen) {
|
|
1693
|
+
this.isOpen = false;
|
|
1694
|
+
ev.preventDefault();
|
|
1695
|
+
ev.stopPropagation();
|
|
1696
|
+
ev.stopImmediatePropagation();
|
|
1697
|
+
this.focusManager.restoreTriggerFocus({
|
|
1698
|
+
hostElement: this.el,
|
|
1699
|
+
targetElement: this.getTargetElement(),
|
|
1700
|
+
autocompleteInput: this.type == "autocomplete" ? this.getAutoCompleteInput() : null,
|
|
1701
|
+
openTriggerElement: this.openTriggerElement,
|
|
1702
|
+
preferOpenTrigger: true,
|
|
1703
|
+
});
|
|
1270
1704
|
}
|
|
1271
1705
|
if (this.keyControl) {
|
|
1272
1706
|
const keyboard = new ListKeyControl(keycode, this.el, this.treeview, this.checkboxes);
|
|
@@ -1276,6 +1710,9 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1276
1710
|
keyboard.checkedItem = checkedItemId => {
|
|
1277
1711
|
this.checkedItem(checkedItemId);
|
|
1278
1712
|
};
|
|
1713
|
+
keyboard.selectedItem = itemId => {
|
|
1714
|
+
this.selectedItem(itemId);
|
|
1715
|
+
};
|
|
1279
1716
|
keyboard.keyDown();
|
|
1280
1717
|
}
|
|
1281
1718
|
}
|
|
@@ -1385,7 +1822,8 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1385
1822
|
});
|
|
1386
1823
|
}
|
|
1387
1824
|
}
|
|
1388
|
-
async show() {
|
|
1825
|
+
async show(openTriggerElement) {
|
|
1826
|
+
this.rememberOpenTrigger(openTriggerElement);
|
|
1389
1827
|
this.isOpen = true;
|
|
1390
1828
|
return Promise.resolve();
|
|
1391
1829
|
}
|
|
@@ -1422,11 +1860,50 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1422
1860
|
async onSelectSearch() {
|
|
1423
1861
|
const searchInput = document.getElementById(`bcm-list-${this._id}-search`);
|
|
1424
1862
|
if (searchInput) {
|
|
1863
|
+
this.preventScrollClose(1000);
|
|
1425
1864
|
await delay(100);
|
|
1426
1865
|
searchInput.onBcmFocus();
|
|
1427
1866
|
searchInput.onBcmSelect();
|
|
1428
1867
|
}
|
|
1429
1868
|
}
|
|
1869
|
+
preventScrollClose(duration = 500) {
|
|
1870
|
+
this.suppressScrollCloseUntil = Date.now() + duration;
|
|
1871
|
+
}
|
|
1872
|
+
isMobileViewport() {
|
|
1873
|
+
return window.matchMedia("(max-width: 768px), (pointer: coarse)").matches;
|
|
1874
|
+
}
|
|
1875
|
+
async prepareMobileViewportForOpen() {
|
|
1876
|
+
var _a;
|
|
1877
|
+
if (!this.isMobileViewport() || !(this.type == "select" || this.type == "autocomplete" || this.linkedComponent)) {
|
|
1878
|
+
return;
|
|
1879
|
+
}
|
|
1880
|
+
const targetElementId = this.linkedComponent ? this.linkedComponent : `bcm-list-input-${this._id}`;
|
|
1881
|
+
const targetElement = document.getElementById(targetElementId);
|
|
1882
|
+
if (!targetElement)
|
|
1883
|
+
return;
|
|
1884
|
+
const viewportHeight = ((_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height) || window.innerHeight;
|
|
1885
|
+
const rect = targetElement.getBoundingClientRect();
|
|
1886
|
+
const minimumSpaceBelow = Math.min(320, viewportHeight * 0.45);
|
|
1887
|
+
const shouldReposition = rect.top > viewportHeight * 0.35 || viewportHeight - rect.bottom < minimumSpaceBelow;
|
|
1888
|
+
if (shouldReposition) {
|
|
1889
|
+
this.preventScrollClose(1200);
|
|
1890
|
+
const desiredTop = Math.max(110, Math.min(180, viewportHeight * 0.24));
|
|
1891
|
+
const delta = rect.top - desiredTop;
|
|
1892
|
+
window.scrollBy({
|
|
1893
|
+
top: delta,
|
|
1894
|
+
left: 0,
|
|
1895
|
+
behavior: "auto",
|
|
1896
|
+
});
|
|
1897
|
+
await delay(50);
|
|
1898
|
+
this.calculateLocation();
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
shouldKeepOpenWhileInteracting(list) {
|
|
1902
|
+
var _a;
|
|
1903
|
+
const activeElement = document.activeElement;
|
|
1904
|
+
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))));
|
|
1905
|
+
return focusedInside || Date.now() < this.suppressScrollCloseUntil;
|
|
1906
|
+
}
|
|
1430
1907
|
async filterOtherList(ids) {
|
|
1431
1908
|
const checklist = (await this.getCheckedList()).nestedResult;
|
|
1432
1909
|
const filter = Generate.convertIdsToNestedData(ids, checklist);
|
|
@@ -1489,8 +1966,30 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1489
1966
|
}
|
|
1490
1967
|
return snq(() => listState.getData(this._id), []);
|
|
1491
1968
|
}
|
|
1969
|
+
hasNestedItems(items = []) {
|
|
1970
|
+
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; });
|
|
1971
|
+
}
|
|
1972
|
+
getVisibleSearchItems() {
|
|
1973
|
+
const visibledItems = this.returnFilterData["visibledItems"];
|
|
1974
|
+
if (this.searchFound == null || !Array.isArray(visibledItems)) {
|
|
1975
|
+
return null;
|
|
1976
|
+
}
|
|
1977
|
+
return visibledItems;
|
|
1978
|
+
}
|
|
1979
|
+
getInitialSearchResultLimit() {
|
|
1980
|
+
if (this.searchFound === 0) {
|
|
1981
|
+
return 0;
|
|
1982
|
+
}
|
|
1983
|
+
const initialLimit = Math.max(10, this.limit);
|
|
1984
|
+
return this.searchFound == null ? initialLimit : Math.min(initialLimit, this.searchFound);
|
|
1985
|
+
}
|
|
1492
1986
|
getLimitedItems(ids) {
|
|
1493
|
-
|
|
1987
|
+
const visibleSearchItems = this.getVisibleSearchItems();
|
|
1988
|
+
const limit = this.searchResultLimit || this.limit;
|
|
1989
|
+
if (visibleSearchItems && !this.hasNestedItems(this.getItems())) {
|
|
1990
|
+
return visibleSearchItems.slice(0, limit);
|
|
1991
|
+
}
|
|
1992
|
+
return snq(() => listState.getDataPagination(this._id, limit, ids), []);
|
|
1494
1993
|
}
|
|
1495
1994
|
openGroup(parentId) {
|
|
1496
1995
|
listState.openGroup(this._id, parentId);
|
|
@@ -1518,7 +2017,15 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1518
2017
|
this.value = listState.selectedItem(this._id, itemId) ? listState.selectedItem(this._id, itemId)[0] : null;
|
|
1519
2018
|
this.inputText = Generate.domParser((_a = this.value) === null || _a === void 0 ? void 0 : _a.text) || null;
|
|
1520
2019
|
this.isOpen = false;
|
|
1521
|
-
this.markForCheck();
|
|
2020
|
+
await this.markForCheck();
|
|
2021
|
+
if (this.isOverlayType()) {
|
|
2022
|
+
await delay(10);
|
|
2023
|
+
this.focusManager.restoreTriggerFocus({
|
|
2024
|
+
hostElement: this.el,
|
|
2025
|
+
targetElement: this.getTargetElement(),
|
|
2026
|
+
autocompleteInput: this.type == "autocomplete" ? this.getAutoCompleteInput() : null,
|
|
2027
|
+
});
|
|
2028
|
+
}
|
|
1522
2029
|
if (this.type == "autocomplete" && this.value) {
|
|
1523
2030
|
// await delay(100)
|
|
1524
2031
|
// this.resetCaption()
|
|
@@ -1556,15 +2063,36 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1556
2063
|
getAutoCompleteInput() {
|
|
1557
2064
|
return document.getElementById(`bcm-list-input-tag-container-${this._id}-autocomplete-input`);
|
|
1558
2065
|
}
|
|
2066
|
+
rememberOpenTrigger(openTriggerElement) {
|
|
2067
|
+
const activeElement = openTriggerElement || document.activeElement;
|
|
2068
|
+
this.openTriggerElement = this.isValidOpenTrigger(activeElement) ? activeElement : null;
|
|
2069
|
+
}
|
|
2070
|
+
isValidOpenTrigger(element) {
|
|
2071
|
+
return !!(element && element.isConnected && element !== document.body && element !== document.documentElement);
|
|
2072
|
+
}
|
|
2073
|
+
isOverlayType() {
|
|
2074
|
+
return this.type == "select" || this.type == "autocomplete" || !!this.linkedComponent;
|
|
2075
|
+
}
|
|
2076
|
+
getTargetElement() {
|
|
2077
|
+
const targetElementId = this.linkedComponent ? this.linkedComponent : `bcm-list-input-${this._id}`;
|
|
2078
|
+
return document.getElementById(targetElementId);
|
|
2079
|
+
}
|
|
1559
2080
|
/** @description Fixes the issue where the list appears empty during fast scrolling. */
|
|
1560
2081
|
dataScrollEvent(event) {
|
|
1561
2082
|
var _a, _b;
|
|
1562
2083
|
const itemHeight = this.size === 'small' ? 28 : this.size === 'large' ? 48 : 36;
|
|
1563
2084
|
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);
|
|
1564
2085
|
const requiredItems = Math.ceil(currentScrollBottom / itemHeight) + 20;
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
2086
|
+
const isSearchActive = this.searchFound != null && !this.isSelectedOther;
|
|
2087
|
+
const currentLimit = isSearchActive ? this.searchResultLimit || 0 : this.limit;
|
|
2088
|
+
if (requiredItems > currentLimit) {
|
|
2089
|
+
if (isSearchActive) {
|
|
2090
|
+
this.searchResultLimit = Math.min(requiredItems, this.searchFound);
|
|
2091
|
+
}
|
|
2092
|
+
else {
|
|
2093
|
+
this.limit = requiredItems;
|
|
2094
|
+
this.searchResultLimit = requiredItems;
|
|
2095
|
+
}
|
|
1568
2096
|
}
|
|
1569
2097
|
}
|
|
1570
2098
|
async calculateLocation() {
|
|
@@ -1637,20 +2165,20 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1637
2165
|
}
|
|
1638
2166
|
/** @description Focus selected element * BUG 282262 */
|
|
1639
2167
|
focusSelectedElement() {
|
|
1640
|
-
var _a;
|
|
2168
|
+
var _a, _b;
|
|
1641
2169
|
const listElement = document.querySelector(`#bcm-list-${this._id}`);
|
|
1642
2170
|
if (!listElement)
|
|
1643
2171
|
return;
|
|
1644
|
-
const selectedId = (_a = this.value) === null || _a === void 0 ? void 0 : _a.id;
|
|
2172
|
+
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;
|
|
1645
2173
|
if (selectedId) {
|
|
1646
|
-
const targetItem = listElement.querySelector(`[id*="${selectedId}"]`);
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
targetItem.focus();
|
|
2174
|
+
const targetItem = (listElement.querySelector(`[id="${selectedId}"]`) || listElement.querySelector(`[id*="${selectedId}"]`));
|
|
2175
|
+
const scrollContainer = listElement.querySelector(".scrolling");
|
|
2176
|
+
if (targetItem && scrollContainer) {
|
|
2177
|
+
const containerRect = scrollContainer.getBoundingClientRect();
|
|
2178
|
+
const itemRect = targetItem.getBoundingClientRect();
|
|
2179
|
+
const relativeOffsetTop = itemRect.top - containerRect.top + scrollContainer.scrollTop;
|
|
2180
|
+
scrollContainer.scrollTop = relativeOffsetTop - (containerRect.height / 2) + (itemRect.height / 2);
|
|
2181
|
+
targetItem.focus({ preventScroll: true });
|
|
1654
2182
|
const items = listElement.querySelectorAll(".bcm-list__item");
|
|
1655
2183
|
items.forEach(i => i.classList.remove("focused"));
|
|
1656
2184
|
targetItem.classList.add("focused");
|
|
@@ -1776,7 +2304,7 @@ const BcmList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
1776
2304
|
"resetCaption": [64],
|
|
1777
2305
|
"show": [64],
|
|
1778
2306
|
"hide": [64]
|
|
1779
|
-
}, [[2, "bcm-is-intersecting", "isIntersecting"], [2, "bcm-items", "handleSlotItems"], [0, "bcm-change", "handleChange"], [0, "bcm-select-other-tag", "handleSelectOtherTag"], [0, "bcm-delete-tag", "handleDeleteTag"], [0, "bcm-select-tag", "handleSelectTag"], [10, "click", "handleClick"], [10, "bcm-on-search-clear", "bcmOnSearchClear"], [10, "bcm-on-search", "bcmOnSearch"], [10, "keydown", "handleKeyDown"], [10, "keyup", "handleKeyUp"]]]);
|
|
2307
|
+
}, [[2, "bcm-is-intersecting", "isIntersecting"], [2, "bcm-items", "handleSlotItems"], [0, "bcm-change", "handleChange"], [11, "touchstart", "handleTouchStart"], [10, "focusin", "handleFocusIn"], [0, "bcm-select-other-tag", "handleSelectOtherTag"], [0, "bcm-delete-tag", "handleDeleteTag"], [0, "bcm-select-tag", "handleSelectTag"], [10, "click", "handleClick"], [10, "bcm-on-search-clear", "bcmOnSearchClear"], [10, "bcm-on-search", "bcmOnSearch"], [10, "keydown", "handleKeyDown"], [10, "keyup", "handleKeyUp"]]]);
|
|
1780
2308
|
__decorate([
|
|
1781
2309
|
IsLoad()
|
|
1782
2310
|
], BcmList.prototype, "el", void 0);
|