@brickclay-org/ui 0.1.80 → 0.1.81

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
@@ -1028,6 +1028,22 @@ declare function parseColor(input: string | null | undefined): Rgb | null;
1028
1028
  */
1029
1029
  declare function deriveAppearance(color: string | null | undefined, fill?: ColorFill): ColorAppearance;
1030
1030
 
1031
+ interface BkSelectGridColumn {
1032
+ /** Property read from each item. Dot-separated paths are supported. */
1033
+ key: string;
1034
+ /** Column heading. */
1035
+ label: string;
1036
+ /** CSS width/min-width values, e.g. `120px` or `25%`. */
1037
+ width?: string;
1038
+ minWidth?: string;
1039
+ align?: 'left' | 'center' | 'right';
1040
+ type?: 'text' | 'badge';
1041
+ /** Optional display transform; the original item is supplied as well. */
1042
+ formatter?: (value: any, item: any) => string;
1043
+ /** Badge colour by cell value, e.g. `{ Active: '#16a34a' }`. */
1044
+ badgeColors?: Record<string, BadgeColor>;
1045
+ badgeVariant?: BadgeVariant;
1046
+ }
1031
1047
  declare class BkSelect implements ControlValueAccessor, AfterViewInit, OnDestroy {
1032
1048
  items: _angular_core.InputSignal<any[]>;
1033
1049
  bindLabel: _angular_core.InputSignal<string>;
@@ -1040,6 +1056,15 @@ declare class BkSelect implements ControlValueAccessor, AfterViewInit, OnDestroy
1040
1056
  clearAllText: _angular_core.InputSignal<string>;
1041
1057
  groupBy: _angular_core.InputSignal<string>;
1042
1058
  colorKey: _angular_core.InputSignal<string>;
1059
+ /** Opt-in table-like dropdown. The existing list is the unchanged default. */
1060
+ dropdownView: _angular_core.InputSignal<"list" | "grid">;
1061
+ gridColumns: _angular_core.InputSignal<BkSelectGridColumn[]>;
1062
+ /** Stage multi-grid changes until Apply is clicked. */
1063
+ gridSelectionActions: _angular_core.InputSignal<boolean>;
1064
+ gridMinWidth: _angular_core.InputSignal<string>;
1065
+ gridMaxHeight: _angular_core.InputSignal<string>;
1066
+ gridApplyText: _angular_core.InputSignal<string>;
1067
+ gridClearText: _angular_core.InputSignal<string>;
1043
1068
  /**
1044
1069
  * Show an accent dot beside each option, driven by `colorKey`.
1045
1070
  *
@@ -1107,6 +1132,7 @@ declare class BkSelect implements ControlValueAccessor, AfterViewInit, OnDestroy
1107
1132
  private static activeInstance;
1108
1133
  isOpen: _angular_core.WritableSignal<boolean>;
1109
1134
  selectedOptions: _angular_core.WritableSignal<any[]>;
1135
+ private gridDraftOptions;
1110
1136
  searchTerm: _angular_core.WritableSignal<string>;
1111
1137
  markedIndex: _angular_core.WritableSignal<number>;
1112
1138
  placement: _angular_core.WritableSignal<"top" | "bottom">;
@@ -1160,6 +1186,12 @@ declare class BkSelect implements ControlValueAccessor, AfterViewInit, OnDestroy
1160
1186
  private recomputeVisibleChips;
1161
1187
  resolveLabel(item: any): string;
1162
1188
  resolveValue(item: any): any;
1189
+ resolveGridCell(item: any, column: BkSelectGridColumn): string;
1190
+ gridColumnStyle(column: BkSelectGridColumn): Record<string, string>;
1191
+ gridBadgeColor(item: any, column: BkSelectGridColumn): BadgeColor;
1192
+ isGridItemSelected(item: any): boolean;
1193
+ gridSelectedCount(): number;
1194
+ private usesGridDraft;
1163
1195
  isItemSelected(item: any): boolean;
1164
1196
  isItemDisabled(item: any): boolean;
1165
1197
  compareWith: _angular_core.InputSignal<(a: any, b: any) => boolean>;
@@ -1177,6 +1209,9 @@ declare class BkSelect implements ControlValueAccessor, AfterViewInit, OnDestroy
1177
1209
  applyPlacement(): void;
1178
1210
  toggleSelectAll(event: Event): void;
1179
1211
  handleSelection(item: any, event?: Event): void;
1212
+ handleGridSelection(item: any, event?: Event): void;
1213
+ clearGridDraft(): void;
1214
+ applyGridDraft(): void;
1180
1215
  removeOption(item: any, event: Event): void;
1181
1216
  handleClear(event: Event): void;
1182
1217
  private updateModel;
@@ -1241,7 +1276,7 @@ declare class BkSelect implements ControlValueAccessor, AfterViewInit, OnDestroy
1241
1276
  getTooltipIfEllipsed(el: HTMLElement, text: string): string;
1242
1277
  onOptionHover(index: number): void;
1243
1278
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<BkSelect, never>;
1244
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<BkSelect, "bk-select", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "bindIcon": { "alias": "bindIcon"; "required": false; "isSignal": true; }; "isResponsive": { "alias": "isResponsive"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "notFoundText": { "alias": "notFoundText"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "clearAllText": { "alias": "clearAllText"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "colorKey": { "alias": "colorKey"; "required": false; "isSignal": true; }; "showDots": { "alias": "showDots"; "required": false; "isSignal": true; }; "showAvatar": { "alias": "showAvatar"; "required": false; "isSignal": true; }; "avatarKey": { "alias": "avatarKey"; "required": false; "isSignal": true; }; "iconAlt": { "alias": "iconAlt"; "required": false; }; "label": { "alias": "label"; "required": false; }; "required": { "alias": "required"; "required": false; }; "variation": { "alias": "variation"; "required": false; }; "iconSrc": { "alias": "iconSrc"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "maxLabels": { "alias": "maxLabels"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "allSelect": { "alias": "allSelect"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "dropdownPosition": { "alias": "dropdownPosition"; "required": false; "isSignal": true; }; "hasError": { "alias": "hasError"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "appendToBody": { "alias": "appendToBody"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "open": "open"; "close": "close"; "focus": "focus"; "blur": "blur"; "search": "search"; "clear": "clear"; "change": "change"; "scrollToEnd": "scrollToEnd"; }, never, never, true, never>;
1279
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BkSelect, "bk-select", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "bindIcon": { "alias": "bindIcon"; "required": false; "isSignal": true; }; "isResponsive": { "alias": "isResponsive"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "notFoundText": { "alias": "notFoundText"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "clearAllText": { "alias": "clearAllText"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "colorKey": { "alias": "colorKey"; "required": false; "isSignal": true; }; "dropdownView": { "alias": "dropdownView"; "required": false; "isSignal": true; }; "gridColumns": { "alias": "gridColumns"; "required": false; "isSignal": true; }; "gridSelectionActions": { "alias": "gridSelectionActions"; "required": false; "isSignal": true; }; "gridMinWidth": { "alias": "gridMinWidth"; "required": false; "isSignal": true; }; "gridMaxHeight": { "alias": "gridMaxHeight"; "required": false; "isSignal": true; }; "gridApplyText": { "alias": "gridApplyText"; "required": false; "isSignal": true; }; "gridClearText": { "alias": "gridClearText"; "required": false; "isSignal": true; }; "showDots": { "alias": "showDots"; "required": false; "isSignal": true; }; "showAvatar": { "alias": "showAvatar"; "required": false; "isSignal": true; }; "avatarKey": { "alias": "avatarKey"; "required": false; "isSignal": true; }; "iconAlt": { "alias": "iconAlt"; "required": false; }; "label": { "alias": "label"; "required": false; }; "required": { "alias": "required"; "required": false; }; "variation": { "alias": "variation"; "required": false; }; "iconSrc": { "alias": "iconSrc"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "maxLabels": { "alias": "maxLabels"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "allSelect": { "alias": "allSelect"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "dropdownPosition": { "alias": "dropdownPosition"; "required": false; "isSignal": true; }; "hasError": { "alias": "hasError"; "required": false; }; "errorMessage": { "alias": "errorMessage"; "required": false; }; "appendToBody": { "alias": "appendToBody"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "open": "open"; "close": "close"; "focus": "focus"; "blur": "blur"; "search": "search"; "clear": "clear"; "change": "change"; "scrollToEnd": "scrollToEnd"; }, never, never, true, never>;
1245
1280
  }
1246
1281
 
1247
1282
  type BkInputType = 'text' | 'email' | 'password' | 'number' | 'url' | 'tel';
@@ -2337,6 +2372,8 @@ declare class BkHierarchicalSelect implements ControlValueAccessor, AfterViewIni
2337
2372
  /** Runs after the panel has rendered: relocate (append mode) + position + focus. */
2338
2373
  private afterOpenInit;
2339
2374
  isOpen: _angular_core.WritableSignal<boolean>;
2375
+ /** Hidden until its real height has been measured and final placement applied. */
2376
+ panelReady: _angular_core.WritableSignal<boolean>;
2340
2377
  dropdownStyle: _angular_core.WritableSignal<{
2341
2378
  top?: string;
2342
2379
  bottom?: string;
@@ -4172,4 +4209,4 @@ declare class BkTreeDrag<T = any> extends BkTableDrag implements OnDestroy {
4172
4209
  declare const BK_TABLE: readonly [typeof BkTable, typeof BkTableTitle, typeof BkTableFooter, typeof BkVirtualScroll, typeof BkTh, typeof BkTd, typeof BkTrExpand, typeof BkTableSummary, typeof BkTableDrag, typeof BkDragHandle, typeof BkTreeDrag];
4173
4210
 
4174
4211
  export { BKTooltipDirective, BK_DEFAULT_DIALOG_CONFIG, BK_DIALOG_DATA, BK_DIALOG_GLOBAL_CONFIG, BK_TABLE, BkAvatar, BkAvatarGroup, BkAvatarUploader, BkBadge, BkBreadcrumb, BkButton, BkButtonGroup, BkCalendarManagerService, BkCheckbox, BkColumnFilterService, BkColumnSelect, BkCustomCalendar, BkDialogActions, BkDialogClose, BkDialogContent, BkDialogModule, BkDialogRef, BkDialogService, BkDialogTitle, BkDragHandle, BkDropdown, BkFileCard, BkFilePicker, BkGrid, BkHierarchicalSelect, BkIconButton, BkInput, BkInputChips, BkLoader, BkMenu, BkPagination, BkPill, BkPopover, BkRadioButton, BkScheduledDatePicker, BkSelect, BkSpinner, BkTable, BkTableDrag, BkTableFooter, BkTableSummary, BkTableTitle, BkTabs, BkTd, BkTextarea, BkTh, BkTimePicker, BkToastr, BkToastrService, BkToggle, BkTrExpand, BkTreeDrag, BkValidator, BkVirtualScroll, BrickclayIcons, BrickclayLib, CalendarModule, CalendarSelection, ColumnFilterOption, NEUTRAL_APPEARANCE, POPOVER_PLACEMENTS, computePopoverPosition, containsBkTreeNode, deriveAppearance, flattenBkTreeData, getDialogBackdropAnimation, getDialogPanelAnimation, joinPlacement, moveBkTreeNode, normalizeBkTableSize, parseColor, splitPlacement };
4175
- export type { AvatarFallback, AvatarGroupItem, AvatarSize, AvatarVariant, BadgeColor, BadgeSize, BadgeVariant, BkAnimationKeyframes, BkAvatarFallback, BkAvatarSize, BkCellAlign, BkColumnRef, BkColumnSelectPosition, BkDialogAnimation, BkDialogConfig, BkDialogPosition, BkFilterFn, BkFilterOption, BkInputAutoCapitalize, BkInputAutoComplete, BkInputMode, BkInputSize, BkInputType, BkLoaderVariant, BkPageSize, BkPageSizeVisibility, BkSortDirection, BkSortFn, BkSortOrder, BkTableNoResult, BkTableQueryParams, BkTableScroll, BkTableSelection, BkTableSize, BkTableSizeToken, BkTextAreaAutoCapitalize, BkTextAreaAutoComplete, BkTextAreaInputMode, BkTreeDragScope, BkTreeDropEvent, BkTreeDropPosition, BkTreeRow, BreadcrumbItem, ButtonSize, ButtonVariant, CalendarRange, ColorAppearance, ColorFill, CountryOption, CustomRangesConfig, DotPosition, DotStatus, DropdownItem, DropdownPlacement, DropdownSize, DropdownTrigger, DropdownVariant, FileState, GroupItem, GroupMode, HierarchicalNode, IconButtonSize, IconButtonVariant, IconOrientation, MenuItem, MenuOrientation, MenuPopupSide, MenuSize, MenuSubmenuMode, MenuTrigger, PillColor, PillSize, PillVariant, PopoverAlign, PopoverPlacement, PopoverPosition, PopoverPositionOptions, PopoverSide, Rect, ScheduledDateSelection, Size, SortDirection, SpinnerSize, TabIconDirection, TabItem, TableAction, TableBadge, TableColumn, TableIcon, TableRows, TabsColors, TabsOrientation, TabsVariant, TimeConfiguration, ToastConfig, ToastMessage, ToastMethodOptions, ToastPosition, ToastSeverity };
4212
+ export type { AvatarFallback, AvatarGroupItem, AvatarSize, AvatarVariant, BadgeColor, BadgeSize, BadgeVariant, BkAnimationKeyframes, BkAvatarFallback, BkAvatarSize, BkCellAlign, BkColumnRef, BkColumnSelectPosition, BkDialogAnimation, BkDialogConfig, BkDialogPosition, BkFilterFn, BkFilterOption, BkInputAutoCapitalize, BkInputAutoComplete, BkInputMode, BkInputSize, BkInputType, BkLoaderVariant, BkPageSize, BkPageSizeVisibility, BkSelectGridColumn, BkSortDirection, BkSortFn, BkSortOrder, BkTableNoResult, BkTableQueryParams, BkTableScroll, BkTableSelection, BkTableSize, BkTableSizeToken, BkTextAreaAutoCapitalize, BkTextAreaAutoComplete, BkTextAreaInputMode, BkTreeDragScope, BkTreeDropEvent, BkTreeDropPosition, BkTreeRow, BreadcrumbItem, ButtonSize, ButtonVariant, CalendarRange, ColorAppearance, ColorFill, CountryOption, CustomRangesConfig, DotPosition, DotStatus, DropdownItem, DropdownPlacement, DropdownSize, DropdownTrigger, DropdownVariant, FileState, GroupItem, GroupMode, HierarchicalNode, IconButtonSize, IconButtonVariant, IconOrientation, MenuItem, MenuOrientation, MenuPopupSide, MenuSize, MenuSubmenuMode, MenuTrigger, PillColor, PillSize, PillVariant, PopoverAlign, PopoverPlacement, PopoverPosition, PopoverPositionOptions, PopoverSide, Rect, ScheduledDateSelection, Size, SortDirection, SpinnerSize, TabIconDirection, TabItem, TableAction, TableBadge, TableColumn, TableIcon, TableRows, TabsColors, TabsOrientation, TabsVariant, TimeConfiguration, ToastConfig, ToastMessage, ToastMethodOptions, ToastPosition, ToastSeverity };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brickclay-org/ui",
3
- "version": "0.1.80",
3
+ "version": "0.1.81",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "ng-add": {
6
6
  "save": "dependencies"
@@ -164,6 +164,69 @@
164
164
  @apply absolute left-0 w-full bg-white border border-[#E3E3E7] rounded-xl shadow-lg z-[100] overflow-hidden cursor-default p-2.5;
165
165
  }
166
166
 
167
+ /* Opt-in grid dropdown. List-mode selectors above and below remain unchanged. */
168
+ .bk-grid-scroll {
169
+ @apply overflow-auto -mx-2.5;
170
+ }
171
+
172
+ .bk-select-grid {
173
+ @apply w-full border-collapse text-sm text-[#141414];
174
+ table-layout: fixed;
175
+ }
176
+
177
+ .bk-select-grid th {
178
+ @apply sticky top-0 z-10 bg-[#F8F8F8] px-4 py-2.5 font-semibold whitespace-nowrap border-b border-[#E3E3E7];
179
+ }
180
+
181
+ .bk-select-grid td {
182
+ @apply px-4 py-2.5 border-b border-[#E3E3E7] align-middle;
183
+ }
184
+
185
+ .bk-select-grid tbody tr {
186
+ @apply cursor-pointer transition-colors;
187
+ }
188
+
189
+ .bk-select-grid tbody tr:hover,
190
+ .bk-select-grid tbody tr.bk-marked {
191
+ @apply bg-[#F8F8F8];
192
+ }
193
+
194
+ .bk-select-grid tbody tr.bk-selected {
195
+ background-color: #F8F8F8;
196
+ }
197
+
198
+ .bk-select-grid tbody tr.bk-option-disabled {
199
+ @apply opacity-50 cursor-not-allowed;
200
+ }
201
+
202
+ .bk-grid-checkbox-column {
203
+ width: 48px;
204
+ min-width: 48px;
205
+ @apply !px-4;
206
+ }
207
+
208
+ .bk-grid-cell-text {
209
+ @apply block truncate;
210
+ }
211
+
212
+ .bk-grid-message {
213
+ @apply !px-4 !py-4 text-center text-gray-400;
214
+ }
215
+
216
+ .bk-grid-footer {
217
+ @apply flex items-center justify-between gap-4 px-1 pt-2.5 text-xs text-[#6B7080];
218
+ }
219
+
220
+ .bk-grid-footer-actions {
221
+ @apply flex items-center gap-2;
222
+ }
223
+
224
+ @media (max-width: 640px) {
225
+ .bk-grid-scroll {
226
+ max-width: calc(100vw - 32px);
227
+ }
228
+ }
229
+
167
230
  .bk-dropdown-search {
168
231
  @apply px-2 pt-2;
169
232
  }