@brickclay-org/ui 0.1.67 → 0.1.69
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/fesm2022/brickclay-org-ui.mjs +221 -3
- package/fesm2022/brickclay-org-ui.mjs.map +1 -1
- package/index.d.ts +98 -5
- package/package.json +1 -1
- package/src/lib/dropdown/dropdown.css +156 -0
- package/src/lib/tabs/tabs.css +63 -3
- package/src/styles.css +1 -0
|
@@ -5691,6 +5691,31 @@ class BkTabs {
|
|
|
5691
5691
|
list = [];
|
|
5692
5692
|
activeTabId = '';
|
|
5693
5693
|
disabled = false;
|
|
5694
|
+
orientation = 'horizontal';
|
|
5695
|
+
variant = 'default';
|
|
5696
|
+
colors = {};
|
|
5697
|
+
// Convenience getters for template class bindings
|
|
5698
|
+
get isVertical() {
|
|
5699
|
+
return this.orientation === 'vertical';
|
|
5700
|
+
}
|
|
5701
|
+
get isSegmented() {
|
|
5702
|
+
return this.variant === 'segmented';
|
|
5703
|
+
}
|
|
5704
|
+
// Wrapper (track) classes — only for segmented; empty keeps the CSS default.
|
|
5705
|
+
get wrapperClass() {
|
|
5706
|
+
return this.isSegmented ? (this.colors.wrapper ?? '') : '';
|
|
5707
|
+
}
|
|
5708
|
+
// Per-tab color classes for the segmented variant.
|
|
5709
|
+
// Active tabs get background + text classes; inactive tabs get the text class.
|
|
5710
|
+
// Empty strings simply fall through to the default colors in tabs.css.
|
|
5711
|
+
segmentedTabClass(tab) {
|
|
5712
|
+
if (!this.isSegmented)
|
|
5713
|
+
return '';
|
|
5714
|
+
if (this.isActive(tab.id)) {
|
|
5715
|
+
return `${this.colors.active ?? ''} ${this.colors.activeText ?? ''}`.trim();
|
|
5716
|
+
}
|
|
5717
|
+
return this.colors.inactive ?? '';
|
|
5718
|
+
}
|
|
5694
5719
|
change = new EventEmitter();
|
|
5695
5720
|
// Set active tab and emit change event
|
|
5696
5721
|
setActiveTab(tab) {
|
|
@@ -5711,17 +5736,23 @@ class BkTabs {
|
|
|
5711
5736
|
return tab.icon;
|
|
5712
5737
|
}
|
|
5713
5738
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BkTabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5714
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: BkTabs, isStandalone: true, selector: "bk-tabs", inputs: { list: "list", activeTabId: "activeTabId", disabled: "disabled" }, outputs: { change: "change" }, ngImport: i0, template: "<div class=\"tabs-container overflow-x-auto whitespace-nowrap\">\r\n <ul class=\"tabs-list\" role=\"tablist\">\r\n @for (tab of list; track tab.id; let i = $index) {\r\n
|
|
5739
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: BkTabs, isStandalone: true, selector: "bk-tabs", inputs: { list: "list", activeTabId: "activeTabId", disabled: "disabled", orientation: "orientation", variant: "variant", colors: "colors" }, outputs: { change: "change" }, ngImport: i0, template: "<div class=\"tabs-container\" [class.tabs-container--segmented]=\"isSegmented\"\r\n [ngClass]=\"isSegmented ? wrapperClass : (isVertical ? 'w-auto' : 'overflow-x-auto whitespace-nowrap')\">\r\n <ul class=\"tabs-list\" [class.tabs-list--segmented]=\"isSegmented\"\r\n [class.tabs-list--segmented-vertical]=\"isSegmented && isVertical\"\r\n [class.tabs-list--vertical]=\"isVertical && !isSegmented\" [attr.aria-orientation]=\"orientation\" role=\"tablist\">\r\n @for (tab of list; track tab.id; let i = $index) {\r\n <li class=\"tabs-item\" role=\"presentation\">\r\n <!--\r\n Tooltip logic:\r\n - Icon present (error or not) \u2192 tooltip on the icon, button gets no tooltip\r\n - No icon + error state \u2192 tooltip on the button\r\n - No icon + no error \u2192 no tooltip\r\n -->\r\n <button type=\"button\" [id]=\"'tab-' + tab.id\" [attr.aria-selected]=\"isActive(tab.id)\"\r\n [attr.aria-controls]=\"'panel-' + tab.id\" [disabled]=\"tab.disabled\"\r\n [class.tabs-button--active]=\"isActive(tab.id)\" [class.tabs-button--error]=\"tab.error\"\r\n [class.tabs-button--disabled]=\"disabled || tab.disabled\"\r\n [class.tabs-button--icon-right]=\"tab.direction === 'right'\" [class.tabs-button--segmented]=\"isSegmented\"\r\n [ngClass]=\"[\r\n isSegmented ? segmentedTabClass(tab) : '',\r\n (isVertical && !isSegmented) ? 'w-full justify-start' : ''\r\n ]\" [bkTooltip]=\"(!getTabIcon(tab) && tab.error) ? (tab.iconTooltip || []) : []\"\r\n [bkTooltipPosition]=\"tab.iconTooltipDirection || 'top'\" class=\"tabs-button\" (click)=\"setActiveTab(tab)\"\r\n role=\"tab\">\r\n <!-- Left icon: tooltip lives on the icon when an icon is present -->\r\n <img [bkTooltip]=\"getTabIcon(tab) ? (tab.iconTooltip || []) : []\"\r\n [bkTooltipPosition]=\"tab.iconTooltipDirection || 'top'\" [attr.src]=\"getTabIcon(tab)\"\r\n [alt]=\"tab.iconAlt || tab.label\" [class.tabs-icon--hidden]=\"!getTabIcon(tab) || tab.direction === 'right'\"\r\n class=\"tabs-icon\">\r\n <span class=\"tabs-label\">{{ tab.label }}</span>\r\n <!-- Right icon: same tooltip rule, shown when direction is 'right' -->\r\n <img [bkTooltip]=\"getTabIcon(tab) ? (tab.iconTooltip || []) : []\"\r\n [bkTooltipPosition]=\"tab.iconTooltipDirection || 'top'\" [attr.src]=\"getTabIcon(tab)\"\r\n [alt]=\"tab.iconAlt || tab.label\" [class.tabs-icon--hidden]=\"!getTabIcon(tab) || tab.direction !== 'right'\"\r\n class=\"tabs-icon\">\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n</div>", styles: [".tabs-container{@apply w-full;}.tabs-list{@apply grid grid-flow-col auto-cols-max gap-0 list-none m-0 px-0 py-0.5;}.tabs-item{@apply min-w-0;}.tabs-list--vertical{@apply grid-cols-1 grid-flow-row auto-rows-max;}.tabs-button{@apply flex items-center gap-[6px] px-3 py-2 rounded-md border-0 bg-transparent cursor-pointer transition-all duration-100 outline-none;@apply text-sm leading-[11px] font-medium text-[#141414] tracking-[-.28];}.tabs-button--active{@apply bg-[#141414] text-white;}.tabs-button--error{@apply bg-[#C10007] text-white border-0;}.tabs-button--disabled{@apply opacity-50 cursor-not-allowed;}.tabs-icon{@apply size-4 flex-shrink-0;max-width:1rem;opacity:1;overflow:hidden;transition:max-width .2s ease,opacity .2s ease}.tabs-icon--hidden{max-width:0;opacity:0}.tabs-label{@apply whitespace-nowrap;}.tabs-container--segmented{@apply p-[3px] rounded-md w-full md:w-auto;background:#54578e12}.tabs-list--segmented{@apply grid grid-flow-col auto-cols-fr items-center gap-2 rounded-md font-medium text-sm leading-4 w-full sm:w-auto py-0;color:#6b7080}.tabs-button--segmented{@apply border border-transparent px-3 sm:min-w-[5rem] py-1.5 w-full text-center justify-center rounded;color:#6b7080}.tabs-button--segmented:hover:not(:disabled):not(.tabs-button--active){border-color:#42578a26;background:#fff;color:#15191e}.tabs-button--segmented.tabs-button--active{background:#fff;color:#15191e}.tabs-list--segmented-vertical{@apply grid-cols-1 grid-flow-row auto-rows-max gap-1;}.tabs-list--segmented-vertical .tabs-button--segmented{@apply justify-start text-left;}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: BKTooltipDirective, selector: "[bkTooltip]", inputs: ["bkTooltip", "bkTooltipPosition", "bkTooltipScrollable", "bkTooltipMaxHeight", "bkTooltipSize", "bkTooltipAutoHeight"] }] });
|
|
5715
5740
|
}
|
|
5716
5741
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BkTabs, decorators: [{
|
|
5717
5742
|
type: Component,
|
|
5718
|
-
args: [{ selector: 'bk-tabs', standalone: true, imports: [CommonModule, BKTooltipDirective], template: "<div class=\"tabs-container overflow-x-auto whitespace-nowrap\">\r\n <ul class=\"tabs-list\" role=\"tablist\">\r\n @for (tab of list; track tab.id; let i = $index) {\r\n
|
|
5743
|
+
args: [{ selector: 'bk-tabs', standalone: true, imports: [CommonModule, BKTooltipDirective], template: "<div class=\"tabs-container\" [class.tabs-container--segmented]=\"isSegmented\"\r\n [ngClass]=\"isSegmented ? wrapperClass : (isVertical ? 'w-auto' : 'overflow-x-auto whitespace-nowrap')\">\r\n <ul class=\"tabs-list\" [class.tabs-list--segmented]=\"isSegmented\"\r\n [class.tabs-list--segmented-vertical]=\"isSegmented && isVertical\"\r\n [class.tabs-list--vertical]=\"isVertical && !isSegmented\" [attr.aria-orientation]=\"orientation\" role=\"tablist\">\r\n @for (tab of list; track tab.id; let i = $index) {\r\n <li class=\"tabs-item\" role=\"presentation\">\r\n <!--\r\n Tooltip logic:\r\n - Icon present (error or not) \u2192 tooltip on the icon, button gets no tooltip\r\n - No icon + error state \u2192 tooltip on the button\r\n - No icon + no error \u2192 no tooltip\r\n -->\r\n <button type=\"button\" [id]=\"'tab-' + tab.id\" [attr.aria-selected]=\"isActive(tab.id)\"\r\n [attr.aria-controls]=\"'panel-' + tab.id\" [disabled]=\"tab.disabled\"\r\n [class.tabs-button--active]=\"isActive(tab.id)\" [class.tabs-button--error]=\"tab.error\"\r\n [class.tabs-button--disabled]=\"disabled || tab.disabled\"\r\n [class.tabs-button--icon-right]=\"tab.direction === 'right'\" [class.tabs-button--segmented]=\"isSegmented\"\r\n [ngClass]=\"[\r\n isSegmented ? segmentedTabClass(tab) : '',\r\n (isVertical && !isSegmented) ? 'w-full justify-start' : ''\r\n ]\" [bkTooltip]=\"(!getTabIcon(tab) && tab.error) ? (tab.iconTooltip || []) : []\"\r\n [bkTooltipPosition]=\"tab.iconTooltipDirection || 'top'\" class=\"tabs-button\" (click)=\"setActiveTab(tab)\"\r\n role=\"tab\">\r\n <!-- Left icon: tooltip lives on the icon when an icon is present -->\r\n <img [bkTooltip]=\"getTabIcon(tab) ? (tab.iconTooltip || []) : []\"\r\n [bkTooltipPosition]=\"tab.iconTooltipDirection || 'top'\" [attr.src]=\"getTabIcon(tab)\"\r\n [alt]=\"tab.iconAlt || tab.label\" [class.tabs-icon--hidden]=\"!getTabIcon(tab) || tab.direction === 'right'\"\r\n class=\"tabs-icon\">\r\n <span class=\"tabs-label\">{{ tab.label }}</span>\r\n <!-- Right icon: same tooltip rule, shown when direction is 'right' -->\r\n <img [bkTooltip]=\"getTabIcon(tab) ? (tab.iconTooltip || []) : []\"\r\n [bkTooltipPosition]=\"tab.iconTooltipDirection || 'top'\" [attr.src]=\"getTabIcon(tab)\"\r\n [alt]=\"tab.iconAlt || tab.label\" [class.tabs-icon--hidden]=\"!getTabIcon(tab) || tab.direction !== 'right'\"\r\n class=\"tabs-icon\">\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n</div>", styles: [".tabs-container{@apply w-full;}.tabs-list{@apply grid grid-flow-col auto-cols-max gap-0 list-none m-0 px-0 py-0.5;}.tabs-item{@apply min-w-0;}.tabs-list--vertical{@apply grid-cols-1 grid-flow-row auto-rows-max;}.tabs-button{@apply flex items-center gap-[6px] px-3 py-2 rounded-md border-0 bg-transparent cursor-pointer transition-all duration-100 outline-none;@apply text-sm leading-[11px] font-medium text-[#141414] tracking-[-.28];}.tabs-button--active{@apply bg-[#141414] text-white;}.tabs-button--error{@apply bg-[#C10007] text-white border-0;}.tabs-button--disabled{@apply opacity-50 cursor-not-allowed;}.tabs-icon{@apply size-4 flex-shrink-0;max-width:1rem;opacity:1;overflow:hidden;transition:max-width .2s ease,opacity .2s ease}.tabs-icon--hidden{max-width:0;opacity:0}.tabs-label{@apply whitespace-nowrap;}.tabs-container--segmented{@apply p-[3px] rounded-md w-full md:w-auto;background:#54578e12}.tabs-list--segmented{@apply grid grid-flow-col auto-cols-fr items-center gap-2 rounded-md font-medium text-sm leading-4 w-full sm:w-auto py-0;color:#6b7080}.tabs-button--segmented{@apply border border-transparent px-3 sm:min-w-[5rem] py-1.5 w-full text-center justify-center rounded;color:#6b7080}.tabs-button--segmented:hover:not(:disabled):not(.tabs-button--active){border-color:#42578a26;background:#fff;color:#15191e}.tabs-button--segmented.tabs-button--active{background:#fff;color:#15191e}.tabs-list--segmented-vertical{@apply grid-cols-1 grid-flow-row auto-rows-max gap-1;}.tabs-list--segmented-vertical .tabs-button--segmented{@apply justify-start text-left;}\n"] }]
|
|
5719
5744
|
}], propDecorators: { list: [{
|
|
5720
5745
|
type: Input
|
|
5721
5746
|
}], activeTabId: [{
|
|
5722
5747
|
type: Input
|
|
5723
5748
|
}], disabled: [{
|
|
5724
5749
|
type: Input
|
|
5750
|
+
}], orientation: [{
|
|
5751
|
+
type: Input
|
|
5752
|
+
}], variant: [{
|
|
5753
|
+
type: Input
|
|
5754
|
+
}], colors: [{
|
|
5755
|
+
type: Input
|
|
5725
5756
|
}], change: [{
|
|
5726
5757
|
type: Output
|
|
5727
5758
|
}] } });
|
|
@@ -8646,6 +8677,193 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
8646
8677
|
type: Input
|
|
8647
8678
|
}] } });
|
|
8648
8679
|
|
|
8680
|
+
class BkDropdown {
|
|
8681
|
+
host;
|
|
8682
|
+
/** Text shown on the trigger button. */
|
|
8683
|
+
label = '';
|
|
8684
|
+
/** Menu items (supports divider / disabled / children). */
|
|
8685
|
+
items = [];
|
|
8686
|
+
/** Black (dark) or white (light, bordered) — mirrors the segment-tab look. */
|
|
8687
|
+
variant = 'black';
|
|
8688
|
+
/** Trigger size. */
|
|
8689
|
+
size = 'md';
|
|
8690
|
+
/** Open on click or on hover. */
|
|
8691
|
+
trigger = 'click';
|
|
8692
|
+
/** One of 6 placements for the menu. */
|
|
8693
|
+
placement = 'bottomLeft';
|
|
8694
|
+
/** Show the caret (▾) on the trigger. Rotates when open. */
|
|
8695
|
+
arrow = true;
|
|
8696
|
+
/** Split button: a primary action + a separate caret that opens the menu. */
|
|
8697
|
+
splitButton = false;
|
|
8698
|
+
/** Currently selected item id — the matching item shows a tick. */
|
|
8699
|
+
selectedId;
|
|
8700
|
+
/** Disable the whole control. */
|
|
8701
|
+
disabled = false;
|
|
8702
|
+
/** Optional leading icon on the trigger. */
|
|
8703
|
+
iconSrc;
|
|
8704
|
+
/** Extra classes appended to the trigger button. */
|
|
8705
|
+
customClass = '';
|
|
8706
|
+
/** Emits when a (non-disabled) leaf item is chosen. */
|
|
8707
|
+
select = new EventEmitter();
|
|
8708
|
+
/** Emits the open/closed state whenever it changes. */
|
|
8709
|
+
openChange = new EventEmitter();
|
|
8710
|
+
/** Split button primary-action click. */
|
|
8711
|
+
buttonClick = new EventEmitter();
|
|
8712
|
+
open = false;
|
|
8713
|
+
closeTimer = null;
|
|
8714
|
+
constructor(host) {
|
|
8715
|
+
this.host = host;
|
|
8716
|
+
}
|
|
8717
|
+
// ---- open/close ----------------------------------------------------------
|
|
8718
|
+
toggle() {
|
|
8719
|
+
if (this.disabled)
|
|
8720
|
+
return;
|
|
8721
|
+
this.setOpen(!this.open);
|
|
8722
|
+
}
|
|
8723
|
+
onPrimaryClick(event) {
|
|
8724
|
+
if (this.disabled)
|
|
8725
|
+
return;
|
|
8726
|
+
this.buttonClick.emit(event);
|
|
8727
|
+
}
|
|
8728
|
+
selectItem(item, event) {
|
|
8729
|
+
if (item.disabled)
|
|
8730
|
+
return;
|
|
8731
|
+
// Parents with children act as submenu toggles, not selections.
|
|
8732
|
+
if (item.children?.length) {
|
|
8733
|
+
event.stopPropagation();
|
|
8734
|
+
return;
|
|
8735
|
+
}
|
|
8736
|
+
this.selectedId = item.id;
|
|
8737
|
+
this.select.emit(item);
|
|
8738
|
+
this.setOpen(false);
|
|
8739
|
+
}
|
|
8740
|
+
isSelected(item) {
|
|
8741
|
+
return item.id != null && item.id === this.selectedId;
|
|
8742
|
+
}
|
|
8743
|
+
// Only scroll flat menus — a scroll container would clip cascading submenus
|
|
8744
|
+
// (overflow-y:auto forces overflow-x to clip too).
|
|
8745
|
+
get hasSubmenus() {
|
|
8746
|
+
return this.items.some(i => !!i.children?.length);
|
|
8747
|
+
}
|
|
8748
|
+
setOpen(value) {
|
|
8749
|
+
if (this.open === value)
|
|
8750
|
+
return;
|
|
8751
|
+
this.open = value;
|
|
8752
|
+
this.openChange.emit(value);
|
|
8753
|
+
}
|
|
8754
|
+
// ---- hover trigger -------------------------------------------------------
|
|
8755
|
+
onHoverEnter() {
|
|
8756
|
+
if (this.trigger !== 'hover' || this.disabled)
|
|
8757
|
+
return;
|
|
8758
|
+
this.clearCloseTimer();
|
|
8759
|
+
this.setOpen(true);
|
|
8760
|
+
}
|
|
8761
|
+
onHoverLeave() {
|
|
8762
|
+
if (this.trigger !== 'hover')
|
|
8763
|
+
return;
|
|
8764
|
+
// small delay so moving across the gap to the menu doesn't close it
|
|
8765
|
+
this.clearCloseTimer();
|
|
8766
|
+
this.closeTimer = setTimeout(() => this.setOpen(false), 120);
|
|
8767
|
+
}
|
|
8768
|
+
// ---- cascading submenu flip ----------------------------------------------
|
|
8769
|
+
/**
|
|
8770
|
+
* When a parent item is hovered, decide whether its submenu should open to
|
|
8771
|
+
* the right (default) or flip to the left if it would overflow the viewport.
|
|
8772
|
+
*/
|
|
8773
|
+
onSubmenuEnter(event) {
|
|
8774
|
+
const li = event.currentTarget;
|
|
8775
|
+
const submenu = li.querySelector(':scope > .bk-dd-submenu');
|
|
8776
|
+
if (!submenu)
|
|
8777
|
+
return;
|
|
8778
|
+
const parentRect = li.getBoundingClientRect();
|
|
8779
|
+
const submenuWidth = submenu.offsetWidth || 160; // min-w-[10rem] fallback
|
|
8780
|
+
const spaceOnRight = window.innerWidth - parentRect.right;
|
|
8781
|
+
const flipLeft = spaceOnRight < submenuWidth + 8;
|
|
8782
|
+
li.classList.toggle('bk-dd-submenu--flip', flipLeft);
|
|
8783
|
+
}
|
|
8784
|
+
clearCloseTimer() {
|
|
8785
|
+
if (this.closeTimer) {
|
|
8786
|
+
clearTimeout(this.closeTimer);
|
|
8787
|
+
this.closeTimer = null;
|
|
8788
|
+
}
|
|
8789
|
+
}
|
|
8790
|
+
// ---- global listeners ----------------------------------------------------
|
|
8791
|
+
onDocumentClick(event) {
|
|
8792
|
+
if (this.open && !this.host.nativeElement.contains(event.target)) {
|
|
8793
|
+
this.setOpen(false);
|
|
8794
|
+
}
|
|
8795
|
+
}
|
|
8796
|
+
onEscape() {
|
|
8797
|
+
if (this.open)
|
|
8798
|
+
this.setOpen(false);
|
|
8799
|
+
}
|
|
8800
|
+
// ---- class helpers -------------------------------------------------------
|
|
8801
|
+
get triggerClasses() {
|
|
8802
|
+
return [
|
|
8803
|
+
'bk-dd-trigger',
|
|
8804
|
+
`bk-dd-trigger--${this.variant}`,
|
|
8805
|
+
`bk-dd-trigger--${this.size}`,
|
|
8806
|
+
this.customClass,
|
|
8807
|
+
].join(' ').trim();
|
|
8808
|
+
}
|
|
8809
|
+
get caretSizeClass() {
|
|
8810
|
+
return this.size === 'sm' ? 'size-3' : this.size === 'lg' ? 'size-5' : 'size-4';
|
|
8811
|
+
}
|
|
8812
|
+
/** Position classes for the menu panel per placement. */
|
|
8813
|
+
get menuPositionClass() {
|
|
8814
|
+
switch (this.placement) {
|
|
8815
|
+
case 'bottomLeft': return 'top-full left-0 mt-1';
|
|
8816
|
+
case 'bottom': return 'top-full left-1/2 -translate-x-1/2 mt-1';
|
|
8817
|
+
case 'bottomRight': return 'top-full right-0 mt-1';
|
|
8818
|
+
case 'topLeft': return 'bottom-full left-0 mb-1';
|
|
8819
|
+
case 'top': return 'bottom-full left-1/2 -translate-x-1/2 mb-1';
|
|
8820
|
+
case 'topRight': return 'bottom-full right-0 mb-1';
|
|
8821
|
+
}
|
|
8822
|
+
}
|
|
8823
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BkDropdown, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
8824
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: BkDropdown, isStandalone: true, selector: "bk-dropdown", inputs: { label: "label", items: "items", variant: "variant", size: "size", trigger: "trigger", placement: "placement", arrow: "arrow", splitButton: "splitButton", selectedId: "selectedId", disabled: "disabled", iconSrc: "iconSrc", customClass: "customClass" }, outputs: { select: "select", openChange: "openChange", buttonClick: "buttonClick" }, host: { listeners: { "document:click": "onDocumentClick($event)", "document:keydown.escape": "onEscape()" } }, ngImport: i0, template: "<div class=\"bk-dd\" [class.bk-dd--open]=\"open\" (mouseenter)=\"onHoverEnter()\" (mouseleave)=\"onHoverLeave()\">\r\n\r\n <!-- ============ Trigger ============ -->\r\n @if (splitButton) {\r\n <!-- Button with dropdown menu (split button) -->\r\n <div class=\"bk-dd-split\" [class.bk-dd-split--disabled]=\"disabled\">\r\n <button type=\"button\" [class]=\"triggerClasses\" class=\"bk-dd-split-main\" [disabled]=\"disabled\"\r\n (click)=\"onPrimaryClick($event)\">\r\n @if (iconSrc) { <img [src]=\"iconSrc\" alt=\"\" class=\"shrink-0 size-4\" /> }\r\n <span class=\"bk-dd-label\">{{ label }}</span>\r\n </button>\r\n <button type=\"button\" [class]=\"triggerClasses\" class=\"bk-dd-split-caret\" [disabled]=\"disabled\"\r\n [attr.aria-haspopup]=\"'menu'\" [attr.aria-expanded]=\"open\" (click)=\"toggle()\">\r\n <svg class=\"bk-dd-caret shrink-0\" [ngClass]=\"caretSizeClass\" viewBox=\"0 0 16 16\" fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\r\n <path d=\"M4 6l4 4 4-4\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n </div>\r\n } @else {\r\n <button type=\"button\" [class]=\"triggerClasses\" [class.bk-dd-trigger--disabled]=\"disabled\" [disabled]=\"disabled\"\r\n [attr.aria-haspopup]=\"'menu'\" [attr.aria-expanded]=\"open\" (click)=\"toggle()\">\r\n @if (iconSrc) { <img [src]=\"iconSrc\" alt=\"\" class=\"shrink-0 size-4\" /> }\r\n <span class=\"bk-dd-label\">{{ label }}</span>\r\n @if (arrow) {\r\n <svg class=\"bk-dd-caret shrink-0\" [ngClass]=\"caretSizeClass\" viewBox=\"0 0 16 16\" fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\r\n <path d=\"M4 6l4 4 4-4\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n }\r\n </button>\r\n }\r\n\r\n <!-- ============ Menu ============ -->\r\n @if (open) {\r\n <div class=\"bk-dd-menu\" [ngClass]=\"menuPositionClass\" role=\"menu\">\r\n <ul class=\"bk-dd-list\" [class.bk-dd-list--scroll]=\"!hasSubmenus\">\r\n <ng-container *ngTemplateOutlet=\"menuList; context: { $implicit: items }\"></ng-container>\r\n </ul>\r\n </div>\r\n }\r\n</div>\r\n\r\n<!-- Recursive menu template (used for the root list and every submenu) -->\r\n<ng-template #menuList let-list>\r\n @for (item of list; track $index) {\r\n @if (item.divider) {\r\n <li class=\"bk-dd-divider\" role=\"separator\"></li>\r\n } @else {\r\n <li class=\"bk-dd-li\" [class.bk-dd-li--parent]=\"item.children?.length\" (mouseenter)=\"onSubmenuEnter($event)\"\r\n role=\"none\">\r\n <button type=\"button\" role=\"menuitem\" class=\"bk-dd-item\" [class.bk-dd-item--disabled]=\"item.disabled\"\r\n [disabled]=\"item.disabled\" (click)=\"selectItem(item, $event)\">\r\n @if (item.icon) { <img [src]=\"item.icon\" alt=\"\" class=\"shrink-0 size-4\" /> }\r\n <span class=\"bk-dd-item-label\">{{ item.label }}</span>\r\n @if (item.children?.length) {\r\n <svg class=\"bk-dd-item-caret shrink-0 size-3.5\" viewBox=\"0 0 16 16\" fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\r\n <path d=\"M6 4l4 4-4 4\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n } @else if (isSelected(item)) {\r\n <svg class=\"bk-dd-check shrink-0 size-4\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"\r\n aria-hidden=\"true\">\r\n <path d=\"M3.5 8.5l3 3 6-6.5\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n }\r\n </button>\r\n\r\n @if (item.children?.length) {\r\n <ul class=\"bk-dd-submenu\">\r\n <ng-container *ngTemplateOutlet=\"menuList; context: { $implicit: item.children }\"></ng-container>\r\n </ul>\r\n }\r\n </li>\r\n }\r\n }\r\n</ng-template>", styles: [".bk-dd{@apply relative inline-block;}.bk-dd-trigger{@apply inline-flex items-center justify-center gap-1.5 border rounded-md font-medium cursor-pointer transition-colors duration-100 outline-none whitespace-nowrap tracking-[-.28];}.bk-dd-trigger--sm{@apply text-xs px-2.5 py-1.5 leading-3;}.bk-dd-trigger--md{@apply text-sm px-3 py-2 leading-[14px];}.bk-dd-trigger--lg{@apply text-base px-4 py-2.5 leading-4;}.bk-dd-trigger--black{@apply bg-[#141414] text-white border-transparent;}.bk-dd-trigger--black:hover:not(:disabled){@apply bg-[#2A2A2A];}.bk-dd-trigger--white{@apply bg-white text-[#141414] border-[#E3E3E7];}.bk-dd-trigger--white:hover:not(:disabled){@apply bg-[#F9FAFA];}.bk-dd-trigger--disabled{@apply opacity-50 cursor-not-allowed;}.bk-dd-label{@apply whitespace-nowrap;}.bk-dd-caret{@apply transition-transform duration-200;}.bk-dd--open .bk-dd-caret{@apply rotate-180;}.bk-dd-split{@apply inline-flex items-stretch;}.bk-dd-split-main{@apply rounded-r-none;}.bk-dd-split-caret{@apply rounded-l-none border-l-0 px-2;}.bk-dd-split-caret.bk-dd-trigger--black{@apply border-l border-l-[#2A2A2A];}.bk-dd-split-caret.bk-dd-trigger--white{@apply border-l border-l-[#E3E3E7];}.bk-dd-split--disabled{@apply opacity-50 pointer-events-none;}.bk-dd-menu{@apply absolute z-[100] min-w-[10rem] max-w-[16rem] bg-white border border-[#E3E3E7] rounded-xl shadow-lg p-2.5;}.bk-dd-list{@apply relative z-10 list-none m-0 p-0 flex flex-col gap-0.5;}.bk-dd-list--scroll{@apply max-h-[16rem] overflow-y-auto;}.bk-dd-li{@apply relative;}.bk-dd-item{@apply flex items-center gap-2 w-full text-left p-2.5 rounded-md text-sm font-normal text-[#141414] bg-transparent cursor-pointer transition-colors;}.bk-dd-item:hover:not(:disabled){@apply bg-[#F8F8F8];}.bk-dd-item--disabled{@apply opacity-50 cursor-not-allowed;}.bk-dd-item-label{@apply flex-1 min-w-0 truncate;}.bk-dd-item-caret{@apply text-[#6B7080];}.bk-dd-check{@apply text-[#141414];}.bk-dd-divider{@apply -mx-2.5 h-px bg-[#E3E3E7];}.bk-dd-submenu{@apply absolute top-0 left-full ml-1 hidden min-w-[10rem] max-w-[16rem] list-none m-0 p-2.5 flex-col gap-0.5 bg-white border border-[#E3E3E7] rounded-xl shadow-lg;}.bk-dd-li--parent:hover>.bk-dd-submenu{@apply flex;}.bk-dd-submenu--flip>.bk-dd-submenu{@apply left-auto right-full ml-0 mr-1;}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
8825
|
+
}
|
|
8826
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: BkDropdown, decorators: [{
|
|
8827
|
+
type: Component,
|
|
8828
|
+
args: [{ selector: 'bk-dropdown', imports: [CommonModule], standalone: true, template: "<div class=\"bk-dd\" [class.bk-dd--open]=\"open\" (mouseenter)=\"onHoverEnter()\" (mouseleave)=\"onHoverLeave()\">\r\n\r\n <!-- ============ Trigger ============ -->\r\n @if (splitButton) {\r\n <!-- Button with dropdown menu (split button) -->\r\n <div class=\"bk-dd-split\" [class.bk-dd-split--disabled]=\"disabled\">\r\n <button type=\"button\" [class]=\"triggerClasses\" class=\"bk-dd-split-main\" [disabled]=\"disabled\"\r\n (click)=\"onPrimaryClick($event)\">\r\n @if (iconSrc) { <img [src]=\"iconSrc\" alt=\"\" class=\"shrink-0 size-4\" /> }\r\n <span class=\"bk-dd-label\">{{ label }}</span>\r\n </button>\r\n <button type=\"button\" [class]=\"triggerClasses\" class=\"bk-dd-split-caret\" [disabled]=\"disabled\"\r\n [attr.aria-haspopup]=\"'menu'\" [attr.aria-expanded]=\"open\" (click)=\"toggle()\">\r\n <svg class=\"bk-dd-caret shrink-0\" [ngClass]=\"caretSizeClass\" viewBox=\"0 0 16 16\" fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\r\n <path d=\"M4 6l4 4 4-4\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n </button>\r\n </div>\r\n } @else {\r\n <button type=\"button\" [class]=\"triggerClasses\" [class.bk-dd-trigger--disabled]=\"disabled\" [disabled]=\"disabled\"\r\n [attr.aria-haspopup]=\"'menu'\" [attr.aria-expanded]=\"open\" (click)=\"toggle()\">\r\n @if (iconSrc) { <img [src]=\"iconSrc\" alt=\"\" class=\"shrink-0 size-4\" /> }\r\n <span class=\"bk-dd-label\">{{ label }}</span>\r\n @if (arrow) {\r\n <svg class=\"bk-dd-caret shrink-0\" [ngClass]=\"caretSizeClass\" viewBox=\"0 0 16 16\" fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\r\n <path d=\"M4 6l4 4 4-4\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n }\r\n </button>\r\n }\r\n\r\n <!-- ============ Menu ============ -->\r\n @if (open) {\r\n <div class=\"bk-dd-menu\" [ngClass]=\"menuPositionClass\" role=\"menu\">\r\n <ul class=\"bk-dd-list\" [class.bk-dd-list--scroll]=\"!hasSubmenus\">\r\n <ng-container *ngTemplateOutlet=\"menuList; context: { $implicit: items }\"></ng-container>\r\n </ul>\r\n </div>\r\n }\r\n</div>\r\n\r\n<!-- Recursive menu template (used for the root list and every submenu) -->\r\n<ng-template #menuList let-list>\r\n @for (item of list; track $index) {\r\n @if (item.divider) {\r\n <li class=\"bk-dd-divider\" role=\"separator\"></li>\r\n } @else {\r\n <li class=\"bk-dd-li\" [class.bk-dd-li--parent]=\"item.children?.length\" (mouseenter)=\"onSubmenuEnter($event)\"\r\n role=\"none\">\r\n <button type=\"button\" role=\"menuitem\" class=\"bk-dd-item\" [class.bk-dd-item--disabled]=\"item.disabled\"\r\n [disabled]=\"item.disabled\" (click)=\"selectItem(item, $event)\">\r\n @if (item.icon) { <img [src]=\"item.icon\" alt=\"\" class=\"shrink-0 size-4\" /> }\r\n <span class=\"bk-dd-item-label\">{{ item.label }}</span>\r\n @if (item.children?.length) {\r\n <svg class=\"bk-dd-item-caret shrink-0 size-3.5\" viewBox=\"0 0 16 16\" fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\r\n <path d=\"M6 4l4 4-4 4\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n } @else if (isSelected(item)) {\r\n <svg class=\"bk-dd-check shrink-0 size-4\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"\r\n aria-hidden=\"true\">\r\n <path d=\"M3.5 8.5l3 3 6-6.5\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\" />\r\n </svg>\r\n }\r\n </button>\r\n\r\n @if (item.children?.length) {\r\n <ul class=\"bk-dd-submenu\">\r\n <ng-container *ngTemplateOutlet=\"menuList; context: { $implicit: item.children }\"></ng-container>\r\n </ul>\r\n }\r\n </li>\r\n }\r\n }\r\n</ng-template>", styles: [".bk-dd{@apply relative inline-block;}.bk-dd-trigger{@apply inline-flex items-center justify-center gap-1.5 border rounded-md font-medium cursor-pointer transition-colors duration-100 outline-none whitespace-nowrap tracking-[-.28];}.bk-dd-trigger--sm{@apply text-xs px-2.5 py-1.5 leading-3;}.bk-dd-trigger--md{@apply text-sm px-3 py-2 leading-[14px];}.bk-dd-trigger--lg{@apply text-base px-4 py-2.5 leading-4;}.bk-dd-trigger--black{@apply bg-[#141414] text-white border-transparent;}.bk-dd-trigger--black:hover:not(:disabled){@apply bg-[#2A2A2A];}.bk-dd-trigger--white{@apply bg-white text-[#141414] border-[#E3E3E7];}.bk-dd-trigger--white:hover:not(:disabled){@apply bg-[#F9FAFA];}.bk-dd-trigger--disabled{@apply opacity-50 cursor-not-allowed;}.bk-dd-label{@apply whitespace-nowrap;}.bk-dd-caret{@apply transition-transform duration-200;}.bk-dd--open .bk-dd-caret{@apply rotate-180;}.bk-dd-split{@apply inline-flex items-stretch;}.bk-dd-split-main{@apply rounded-r-none;}.bk-dd-split-caret{@apply rounded-l-none border-l-0 px-2;}.bk-dd-split-caret.bk-dd-trigger--black{@apply border-l border-l-[#2A2A2A];}.bk-dd-split-caret.bk-dd-trigger--white{@apply border-l border-l-[#E3E3E7];}.bk-dd-split--disabled{@apply opacity-50 pointer-events-none;}.bk-dd-menu{@apply absolute z-[100] min-w-[10rem] max-w-[16rem] bg-white border border-[#E3E3E7] rounded-xl shadow-lg p-2.5;}.bk-dd-list{@apply relative z-10 list-none m-0 p-0 flex flex-col gap-0.5;}.bk-dd-list--scroll{@apply max-h-[16rem] overflow-y-auto;}.bk-dd-li{@apply relative;}.bk-dd-item{@apply flex items-center gap-2 w-full text-left p-2.5 rounded-md text-sm font-normal text-[#141414] bg-transparent cursor-pointer transition-colors;}.bk-dd-item:hover:not(:disabled){@apply bg-[#F8F8F8];}.bk-dd-item--disabled{@apply opacity-50 cursor-not-allowed;}.bk-dd-item-label{@apply flex-1 min-w-0 truncate;}.bk-dd-item-caret{@apply text-[#6B7080];}.bk-dd-check{@apply text-[#141414];}.bk-dd-divider{@apply -mx-2.5 h-px bg-[#E3E3E7];}.bk-dd-submenu{@apply absolute top-0 left-full ml-1 hidden min-w-[10rem] max-w-[16rem] list-none m-0 p-2.5 flex-col gap-0.5 bg-white border border-[#E3E3E7] rounded-xl shadow-lg;}.bk-dd-li--parent:hover>.bk-dd-submenu{@apply flex;}.bk-dd-submenu--flip>.bk-dd-submenu{@apply left-auto right-full ml-0 mr-1;}\n"] }]
|
|
8829
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { label: [{
|
|
8830
|
+
type: Input
|
|
8831
|
+
}], items: [{
|
|
8832
|
+
type: Input
|
|
8833
|
+
}], variant: [{
|
|
8834
|
+
type: Input
|
|
8835
|
+
}], size: [{
|
|
8836
|
+
type: Input
|
|
8837
|
+
}], trigger: [{
|
|
8838
|
+
type: Input
|
|
8839
|
+
}], placement: [{
|
|
8840
|
+
type: Input
|
|
8841
|
+
}], arrow: [{
|
|
8842
|
+
type: Input
|
|
8843
|
+
}], splitButton: [{
|
|
8844
|
+
type: Input
|
|
8845
|
+
}], selectedId: [{
|
|
8846
|
+
type: Input
|
|
8847
|
+
}], disabled: [{
|
|
8848
|
+
type: Input
|
|
8849
|
+
}], iconSrc: [{
|
|
8850
|
+
type: Input
|
|
8851
|
+
}], customClass: [{
|
|
8852
|
+
type: Input
|
|
8853
|
+
}], select: [{
|
|
8854
|
+
type: Output
|
|
8855
|
+
}], openChange: [{
|
|
8856
|
+
type: Output
|
|
8857
|
+
}], buttonClick: [{
|
|
8858
|
+
type: Output
|
|
8859
|
+
}], onDocumentClick: [{
|
|
8860
|
+
type: HostListener,
|
|
8861
|
+
args: ['document:click', ['$event']]
|
|
8862
|
+
}], onEscape: [{
|
|
8863
|
+
type: HostListener,
|
|
8864
|
+
args: ['document:keydown.escape']
|
|
8865
|
+
}] } });
|
|
8866
|
+
|
|
8649
8867
|
/*
|
|
8650
8868
|
* Public API Surface of brickclay-lib
|
|
8651
8869
|
*/
|
|
@@ -8655,5 +8873,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
8655
8873
|
* Generated bundle index. Do not edit.
|
|
8656
8874
|
*/
|
|
8657
8875
|
|
|
8658
|
-
export { BKTooltipDirective, BK_DEFAULT_DIALOG_CONFIG, BK_DIALOG_DATA, BK_DIALOG_GLOBAL_CONFIG, BkAvatar, BkAvatarUploader, BkBadge, BkButton, BkButtonGroup, BkCalendarManagerService, BkCheckbox, BkColumnFilterService, BkColumnSelect, BkCustomCalendar, BkDialogActions, BkDialogClose, BkDialogContent, BkDialogModule, BkDialogRef, BkDialogService, BkDialogTitle, BkFileCard, BkFilePicker, BkGrid, BkHierarchicalSelect, BkIconButton, BkInput, BkInputChips, BkLoader, BkPagination, BkPill, BkRadioButton, BkScheduledDatePicker, BkSelect, BkSpinner, BkTabs, BkTextarea, BkTimePicker, BkToastr, BkToastrService, BkToggle, BkValidator, BrickclayIcons, BrickclayLib, CalendarModule, CalendarSelection, ColumnFilterOption, getDialogBackdropAnimation, getDialogPanelAnimation };
|
|
8876
|
+
export { BKTooltipDirective, BK_DEFAULT_DIALOG_CONFIG, BK_DIALOG_DATA, BK_DIALOG_GLOBAL_CONFIG, BkAvatar, BkAvatarUploader, BkBadge, BkButton, BkButtonGroup, BkCalendarManagerService, BkCheckbox, BkColumnFilterService, BkColumnSelect, BkCustomCalendar, BkDialogActions, BkDialogClose, BkDialogContent, BkDialogModule, BkDialogRef, BkDialogService, BkDialogTitle, BkDropdown, BkFileCard, BkFilePicker, BkGrid, BkHierarchicalSelect, BkIconButton, BkInput, BkInputChips, BkLoader, BkPagination, BkPill, BkRadioButton, BkScheduledDatePicker, BkSelect, BkSpinner, BkTabs, BkTextarea, BkTimePicker, BkToastr, BkToastrService, BkToggle, BkValidator, BrickclayIcons, BrickclayLib, CalendarModule, CalendarSelection, ColumnFilterOption, getDialogBackdropAnimation, getDialogPanelAnimation };
|
|
8659
8877
|
//# sourceMappingURL=brickclay-org-ui.mjs.map
|