@brickclay-org/ui 0.1.72 → 0.1.73

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/index.d.ts CHANGED
@@ -2614,13 +2614,27 @@ declare class BkMenu {
2614
2614
  activeItemId: string;
2615
2615
  /** Tint item icons: dark by default, white on the active (dark) row. */
2616
2616
  tintIcons: boolean;
2617
+ /**
2618
+ * Optional max height for the menu (e.g. '320px', '60vh', or a number of px).
2619
+ * When set, the item list scrolls vertically once it exceeds this height.
2620
+ * Pop-up fly-outs are positioned `fixed`, so they still escape the scroll box.
2621
+ */
2622
+ maxHeight: string | number | null;
2617
2623
  activeItemIdChange: EventEmitter<string>;
2618
2624
  itemClick: EventEmitter<MenuItem>;
2619
2625
  /** Ids of currently expanded/opened parent nodes. */
2620
2626
  private readonly openIds;
2627
+ /** Viewport coordinates for each open fixed-position fly-out, keyed by id. */
2628
+ readonly popupPos: Map<string, {
2629
+ top: number;
2630
+ left: number;
2631
+ }>;
2621
2632
  constructor(host: ElementRef<HTMLElement>);
2622
2633
  get isVertical(): boolean;
2623
2634
  get isPopup(): boolean;
2635
+ get maxHeightStyle(): string | null;
2636
+ popupTop(item: MenuItem): number | null;
2637
+ popupLeft(item: MenuItem): number | null;
2624
2638
  hasChildren(item: MenuItem): boolean;
2625
2639
  isOpen(item: MenuItem): boolean;
2626
2640
  isActive(item: MenuItem): boolean;
@@ -2628,13 +2642,15 @@ declare class BkMenu {
2628
2642
  isHighlighted(item: MenuItem): boolean;
2629
2643
  inlineIndent(level: number): number | null;
2630
2644
  onItemClick(item: MenuItem, siblings: MenuItem[], event: Event): void;
2631
- onItemEnter(item: MenuItem, siblings: MenuItem[]): void;
2645
+ onItemEnter(item: MenuItem, siblings: MenuItem[], event: MouseEvent, level: number): void;
2646
+ private computePopupPos;
2632
2647
  onItemLeave(item: MenuItem): void;
2633
2648
  private toggle;
2634
2649
  private closeBranch;
2635
2650
  onDocumentClick(event: MouseEvent): void;
2651
+ onViewportChange(): void;
2636
2652
  static ɵfac: i0.ɵɵFactoryDeclaration<BkMenu, never>;
2637
- static ɵcmp: i0.ɵɵComponentDeclaration<BkMenu, "bk-menu", never, { "items": { "alias": "items"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "submenuMode": { "alias": "submenuMode"; "required": false; }; "singleOpen": { "alias": "singleOpen"; "required": false; }; "activeItemId": { "alias": "activeItemId"; "required": false; }; "tintIcons": { "alias": "tintIcons"; "required": false; }; }, { "activeItemIdChange": "activeItemIdChange"; "itemClick": "itemClick"; }, never, never, true, never>;
2653
+ static ɵcmp: i0.ɵɵComponentDeclaration<BkMenu, "bk-menu", never, { "items": { "alias": "items"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "submenuMode": { "alias": "submenuMode"; "required": false; }; "singleOpen": { "alias": "singleOpen"; "required": false; }; "activeItemId": { "alias": "activeItemId"; "required": false; }; "tintIcons": { "alias": "tintIcons"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; }, { "activeItemIdChange": "activeItemIdChange"; "itemClick": "itemClick"; }, never, never, true, never>;
2638
2654
  }
2639
2655
 
2640
2656
  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, BkMenu, BkPagination, BkPill, BkRadioButton, BkScheduledDatePicker, BkSelect, BkSpinner, BkTabs, BkTextarea, BkTimePicker, BkToastr, BkToastrService, BkToggle, BkValidator, BrickclayIcons, BrickclayLib, CalendarModule, CalendarSelection, ColumnFilterOption, getDialogBackdropAnimation, getDialogPanelAnimation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickclay-org/ui",
3
- "version": "0.1.72",
3
+ "version": "0.1.73",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "ng-add": {
6
6
  "save": "dependencies"
@@ -19,6 +19,7 @@
19
19
 
20
20
  display: block;
21
21
  width: 100%;
22
+ max-width: 100%;
22
23
  font-size: 0.875rem;
23
24
  line-height: 1.25rem;
24
25
  font-weight: 500;
@@ -27,29 +28,11 @@
27
28
  color: var(--menu-text);
28
29
  border: 1px solid var(--menu-border);
29
30
  border-radius: var(--menu-radius);
30
- }
31
-
32
- /* Clip rounded corners for inline/default menus. Pop-up menus must NOT clip,
33
- otherwise the fly-out panels get cut off at the menu's edge. */
34
- .bk-menu:not(.bk-menu--popup) {
31
+ /* Safe to clip to rounded corners: pop-up fly-outs are position:fixed and
32
+ escape this box entirely, so nothing gets cut off. */
35
33
  overflow: hidden;
36
34
  }
37
35
 
38
- /* Round the first/last top-level buttons in pop-up mode so the active/hover
39
- background still respects the menu's corners without clipping fly-outs. */
40
- .bk-menu--popup.bk-menu--vertical > .bk-menu__list > .bk-menu__item:first-child > .bk-menu__button {
41
- border-radius: 8px 8px 0 0;
42
- }
43
- .bk-menu--popup.bk-menu--vertical > .bk-menu__list > .bk-menu__item:last-child > .bk-menu__button {
44
- border-radius: 0 0 8px 8px;
45
- }
46
- .bk-menu--popup.bk-menu--horizontal > .bk-menu__list > .bk-menu__item:first-child > .bk-menu__button {
47
- border-radius: 8px 0 0 8px;
48
- }
49
- .bk-menu--popup.bk-menu--horizontal > .bk-menu__list > .bk-menu__item:last-child > .bk-menu__button {
50
- border-radius: 0 8px 8px 0;
51
- }
52
-
53
36
  /* ---- Lists ---- */
54
37
  .bk-menu__list,
55
38
  .bk-menu__submenu {
@@ -58,16 +41,18 @@
58
41
  padding: 0;
59
42
  }
60
43
 
61
- /* Horizontal top-level row (menubar). */
44
+ /* Scroll container: vertical scroll past max-height, horizontal scroll if a
45
+ deeply-indented inline row is wider than the menu. Fixed fly-outs escape it. */
46
+ .bk-menu__list--scroll {
47
+ overflow: auto;
48
+ }
49
+
50
+ /* Horizontal top-level row (menubar). Scrolls when crowded — fixed fly-outs are
51
+ unaffected by the overflow. */
62
52
  .bk-menu--horizontal > .bk-menu__list {
63
53
  display: flex;
64
54
  flex-direction: row;
65
55
  align-items: stretch;
66
- }
67
-
68
- /* Scroll a crowded row only when NOT in pop-up mode — `overflow-x: auto`
69
- forces `overflow-y` to `auto`, which would clip the drop-down fly-outs. */
70
- .bk-menu--horizontal:not(.bk-menu--popup) > .bk-menu__list {
71
56
  overflow-x: auto;
72
57
  }
73
58
 
@@ -145,10 +130,13 @@
145
130
  .bk-menu__label {
146
131
  flex: 1 1 auto;
147
132
  min-width: 0;
133
+ overflow: hidden;
134
+ text-overflow: ellipsis;
148
135
  }
149
136
 
150
137
  .bk-menu--horizontal > .bk-menu__list > .bk-menu__item > .bk-menu__button > .bk-menu__label {
151
138
  flex: 0 0 auto;
139
+ overflow: visible;
152
140
  }
153
141
 
154
142
  /* ---- Chevron ---- */
@@ -185,9 +173,14 @@
185
173
  Pop-up submenus — floating panels, hidden until open.
186
174
  ========================================================================= */
187
175
  .bk-menu__submenu--popup {
188
- position: absolute;
189
- z-index: 50;
176
+ /* Fixed so the fly-out escapes the menu's overflow/scroll box and renders
177
+ outside the nav. Coordinates are set inline (top/left) from JS. */
178
+ position: fixed;
179
+ z-index: 1000;
190
180
  min-width: 200px;
181
+ max-width: 280px;
182
+ max-height: calc(100vh - 16px);
183
+ overflow-y: auto;
191
184
  background: var(--menu-bg);
192
185
  border: 1px solid var(--menu-border);
193
186
  border-radius: 12px;
@@ -200,20 +193,6 @@
200
193
  display: block;
201
194
  }
202
195
 
203
- /* Fly out to the right (vertical menus and all deeper levels). */
204
- .bk-menu__submenu--popup-right {
205
- top: 0;
206
- left: 100%;
207
- margin-left: 4px;
208
- }
209
-
210
- /* Drop down below (horizontal top-level items). */
211
- .bk-menu__submenu--popup-down {
212
- top: 100%;
213
- left: 0;
214
- margin-top: 4px;
215
- }
216
-
217
196
  /* Invisible bridges spanning the gap between a parent and its fly-out, so the
218
197
  pointer stays "inside" the item while crossing — prevents hover flicker. */
219
198
  .bk-menu__submenu--popup-right::before {
@@ -244,12 +223,4 @@
244
223
  .bk-menu--horizontal > .bk-menu__list > .bk-menu__item > .bk-menu__button {
245
224
  width: 100%;
246
225
  }
247
- /* On small screens, horizontal pop-ups behave like inline sections. */
248
- .bk-menu--horizontal .bk-menu__submenu--popup-down {
249
- position: static;
250
- box-shadow: none;
251
- border: 0;
252
- margin: 0;
253
- border-radius: 0;
254
- }
255
226
  }