@akcelik/strct 0.5.31 → 0.7.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akcelik/strct",
3
- "version": "0.5.31",
3
+ "version": "0.7.0",
4
4
  "description": "UIStruct — a standalone Angular component library with a tokenised, multi-palette theme system, built for datacenter / infrastructure management UIs.",
5
5
  "author": "Serkan Akcelik <serkan.akcelik@gmail.com>",
6
6
  "license": "MIT",
@@ -188,6 +188,47 @@ declare class StrctNavItem {
188
188
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctNavItem, "strct-nav-item", never, { "active": { "alias": "active"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
189
189
  }
190
190
 
191
+ /** Semantic colour for a rail item's count badge. */
192
+ type StrctRailStatus = 'accent' | 'success' | 'warning' | 'critical';
193
+ /** A single entry in a {@link StrctRail}. */
194
+ interface StrctRailItem {
195
+ /** Stable identity, matched against the rail's `activeId`. */
196
+ id: string;
197
+ label: string;
198
+ /** Icon name (see the icon set). */
199
+ icon: string;
200
+ /** Optional count/indicator — e.g. number of active alerts. */
201
+ badge?: string | number;
202
+ /** Badge colour (defaults to `accent`). When collapsed it renders as a dot. */
203
+ badgeStatus?: StrctRailStatus;
204
+ disabled?: boolean;
205
+ }
206
+ /**
207
+ * Collapsible, data-driven primary navigation rail for an application shell.
208
+ * Each item is an icon + label + optional status badge; collapsing shrinks it to
209
+ * an icon-only rail (badges become dots, labels become tooltips).
210
+ *
211
+ * <strct-rail [items]="navItems" [(activeId)]="section" [(collapsed)]="railOff"
212
+ * (select)="go($event)" />
213
+ */
214
+ declare class StrctRail {
215
+ /** Navigation entries. */
216
+ readonly items: _angular_core.InputSignal<StrctRailItem[]>;
217
+ /** Currently-active item id (two-way). */
218
+ readonly activeId: _angular_core.ModelSignal<string | null>;
219
+ /** Collapsed (icon-only) state (two-way). */
220
+ readonly collapsed: _angular_core.ModelSignal<boolean>;
221
+ /** Show the collapse toggle at the foot of the rail. */
222
+ readonly collapsible: _angular_core.InputSignal<boolean>;
223
+ /** Accessible label for the nav landmark. */
224
+ readonly ariaLabel: _angular_core.InputSignal<string>;
225
+ /** Emitted when an item is chosen. */
226
+ readonly select: _angular_core.OutputEmitterRef<StrctRailItem>;
227
+ protected pick(item: StrctRailItem): void;
228
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctRail, never>;
229
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctRail, "strct-rail", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "activeId": { "alias": "activeId"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "activeId": "activeIdChange"; "collapsed": "collapsedChange"; "select": "select"; }, never, never, true, never>;
230
+ }
231
+
191
232
  /**
192
233
  * Authentication layout. Two modes:
193
234
  * - default: a single centered column (drop a card + form inside).
@@ -483,30 +524,51 @@ declare class StrctMenuPanel {
483
524
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctMenuPanel, never>;
484
525
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctMenuPanel, "strct-menu-panel", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "x": { "alias": "x"; "required": false; "isSignal": true; }; "y": { "alias": "y"; "required": false; "isSignal": true; }; "submenu": { "alias": "submenu"; "required": false; "isSignal": true; }; }, { "select": "select"; "close": "close"; "back": "back"; }, never, never, true, never>;
485
526
  }
527
+ /** Options for {@link StrctMenuService.open}. */
528
+ interface StrctMenuOpenOptions {
529
+ /** Viewport x of the menu's top-left (clamped/flipped to stay on screen). */
530
+ x: number;
531
+ /** Viewport y of the menu's top-left. */
532
+ y: number;
533
+ items: StrctMenuItem[];
534
+ /** Payload passed to each item's `action`. */
535
+ data?: unknown;
536
+ /** Called with the chosen item (after its `action` runs). */
537
+ onSelect?: (item: StrctMenuItem) => void;
538
+ }
486
539
  /**
487
- * Right-click (context) menu driven by a data array. Attach to any trigger; the
488
- * menu portals into `<body>` and runs each item's `action` on selection.
489
- * <div [strctContextMenu]="menuFor(host)" [strctContextMenuData]="host"
490
- * (menuSelect)="onPick($event)">…</div>
540
+ * Imperatively opens the data-driven menu panel, portaled into `<body>`. Shared
541
+ * by the `[strctContextMenu]` directive (right-click) and any click trigger such
542
+ * as the datagrid row-action button. Only one menu is open at a time.
491
543
  */
492
- declare class StrctContextMenuTrigger implements OnDestroy {
544
+ declare class StrctMenuService {
493
545
  private readonly appRef;
494
546
  private readonly envInjector;
495
547
  private readonly zone;
496
548
  private readonly doc;
549
+ private ref;
550
+ open(opts: StrctMenuOpenOptions): void;
551
+ private readonly onClose;
552
+ private readonly onOutside;
553
+ close(): void;
554
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctMenuService, never>;
555
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<StrctMenuService>;
556
+ }
557
+ /**
558
+ * Right-click (context) menu driven by a data array. Attach to any trigger; the
559
+ * menu portals into `<body>` and runs each item's `action` on selection.
560
+ * <div [strctContextMenu]="menuFor(host)" [strctContextMenuData]="host"
561
+ * (menuSelect)="onPick($event)">…</div>
562
+ */
563
+ declare class StrctContextMenuTrigger {
564
+ private readonly menu;
497
565
  /** Menu items to display. */
498
566
  readonly items: _angular_core.InputSignal<StrctMenuItem[]>;
499
567
  /** Arbitrary payload passed to item actions. */
500
568
  readonly data: _angular_core.InputSignal<unknown>;
501
569
  /** Emitted when a menu item is selected. */
502
570
  readonly menuSelect: _angular_core.OutputEmitterRef<StrctMenuItem>;
503
- private ref;
504
- private readonly onClose;
505
571
  protected onContextMenu(event: MouseEvent): void;
506
- private openAt;
507
- private readonly onOutside;
508
- private closeMenu;
509
- ngOnDestroy(): void;
510
572
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctContextMenuTrigger, never>;
511
573
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<StrctContextMenuTrigger, "[strctContextMenu]", never, { "items": { "alias": "strctContextMenu"; "required": true; "isSignal": true; }; "data": { "alias": "strctContextMenuData"; "required": false; "isSignal": true; }; }, { "menuSelect": "menuSelect"; }, never, never, true, never>;
512
574
  }
@@ -643,6 +705,46 @@ declare class StrctModal {
643
705
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctModal, "strct-modal", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "hideFooter": { "alias": "hideFooter"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "closed": "closed"; }, never, ["*", "[strctModalFooter]"], true, never>;
644
706
  }
645
707
 
708
+ /** Marks the drawer's footer action area: `<ng-container strctDrawerFooter>…`. */
709
+ declare class StrctDrawerFooter {
710
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctDrawerFooter, never>;
711
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<StrctDrawerFooter, "[strctDrawerFooter]", never, {}, {}, never, never, true, never>;
712
+ }
713
+ /** Which edge the drawer slides in from. */
714
+ type StrctDrawerSide = 'start' | 'end' | 'top' | 'bottom';
715
+ /** Drawer extent along its sliding axis. */
716
+ type StrctDrawerSize = 'sm' | 'md' | 'lg';
717
+ /**
718
+ * Slide-out overlay panel anchored to an edge of the viewport — for inspecting
719
+ * or editing a record without losing the underlying table's scroll/selection.
720
+ *
721
+ * <strct-drawer [(open)]="editing" side="end" title="Virtual machine">
722
+ * … body …
723
+ * <ng-container strctDrawerFooter>
724
+ * <button strct-button (click)="editing.set(false)">Cancel</button>
725
+ * </ng-container>
726
+ * </strct-drawer>
727
+ */
728
+ declare class StrctDrawer {
729
+ /** Open state (two-way). */
730
+ readonly open: _angular_core.ModelSignal<boolean>;
731
+ /** Edge to anchor to. Defaults to `end` (right in LTR). */
732
+ readonly side: _angular_core.InputSignal<StrctDrawerSide>;
733
+ /** Extent along the sliding axis. */
734
+ readonly size: _angular_core.InputSignal<StrctDrawerSize>;
735
+ /** Header title. */
736
+ readonly title: _angular_core.InputSignal<string>;
737
+ /** Show the close button and allow backdrop/Esc dismissal. */
738
+ readonly dismissable: _angular_core.InputSignalWithTransform<boolean, unknown>;
739
+ protected readonly footerDef: _angular_core.Signal<StrctDrawerFooter | undefined>;
740
+ protected readonly hasFooter: _angular_core.Signal<boolean>;
741
+ protected onBackdrop(): void;
742
+ protected onEscape(): void;
743
+ close(): void;
744
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctDrawer, never>;
745
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctDrawer, "strct-drawer", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "side": { "alias": "side"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "dismissable": { "alias": "dismissable"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, ["footerDef"], ["*", "[strctDrawerFooter]"], true, never>;
746
+ }
747
+
646
748
  /**
647
749
  * Click-to-open menu:
648
750
  * <strct-dropdown align="end">
@@ -1495,10 +1597,22 @@ declare class StrctDatagrid {
1495
1597
  * that replace the row objects. Defaults to object identity.
1496
1598
  */
1497
1599
  readonly rowId: _angular_core.InputSignal<StrctRowId | null>;
1600
+ /**
1601
+ * Per-row action menu resolver. When set, each row gets a trailing actions
1602
+ * column with a vertical-dots (kebab) button that opens this row's menu.
1603
+ * [rowActions]="(row) => [{ label: 'Open', action: () => open(row) }, …]"
1604
+ */
1605
+ readonly rowActions: _angular_core.InputSignal<((row: StrctRow) => StrctMenuItem[]) | null>;
1498
1606
  /** Emitted when the selection changes. */
1499
1607
  readonly selectionChange: _angular_core.OutputEmitterRef<StrctRow[]>;
1500
1608
  /** Emitted when the refresh button is clicked. */
1501
1609
  readonly syncChange: _angular_core.OutputEmitterRef<void>;
1610
+ /** Emitted when a row's action-menu item is chosen. */
1611
+ readonly rowAction: _angular_core.OutputEmitterRef<{
1612
+ row: StrctRow;
1613
+ item: StrctMenuItem;
1614
+ }>;
1615
+ private readonly menu;
1502
1616
  protected readonly detailDef: _angular_core.Signal<StrctRowDetailDef | undefined>;
1503
1617
  protected readonly actionBarDef: _angular_core.Signal<StrctDatagridActionBar | undefined>;
1504
1618
  private readonly cellDefs;
@@ -1524,6 +1638,8 @@ declare class StrctDatagrid {
1524
1638
  protected readonly canExpand: _angular_core.Signal<boolean>;
1525
1639
  protected readonly canDetail: _angular_core.Signal<boolean>;
1526
1640
  protected readonly paneOpen: _angular_core.Signal<boolean>;
1641
+ /** Whether to render the trailing row-actions (kebab) column. */
1642
+ protected readonly canActions: _angular_core.Signal<boolean>;
1527
1643
  /** Only the first column is shown while the detail pane is open. */
1528
1644
  protected readonly visibleColumns: _angular_core.Signal<StrctDatagridColumn[]>;
1529
1645
  protected readonly sorted: _angular_core.Signal<StrctRow[]>;
@@ -1540,6 +1656,8 @@ declare class StrctDatagrid {
1540
1656
  * so row cells remain selectable for copy). */
1541
1657
  openDetail(row: StrctRow): void;
1542
1658
  closePane(): void;
1659
+ /** Open the row-action menu next to the clicked kebab button. */
1660
+ protected openRowMenu(row: StrctRow, event: MouseEvent): void;
1543
1661
  sortBy(key: string): void;
1544
1662
  protected sortIcon(key: string): string;
1545
1663
  protected ariaSort(key: string): 'ascending' | 'descending' | 'none';
@@ -1556,7 +1674,7 @@ declare class StrctDatagrid {
1556
1674
  private commitSelection;
1557
1675
  private compare;
1558
1676
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctDatagrid, never>;
1559
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctDatagrid, "strct-datagrid", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "expandable": { "alias": "expandable"; "required": false; "isSignal": true; }; "detailPane": { "alias": "detailPane"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "columnChooser": { "alias": "columnChooser"; "required": false; "isSignal": true; }; "sync": { "alias": "sync"; "required": false; "isSignal": true; }; "footerActionsDisabled": { "alias": "footerActionsDisabled"; "required": false; "isSignal": true; }; "rowId": { "alias": "rowId"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "syncChange": "syncChange"; }, ["detailDef", "actionBarDef", "cellDefs"], ["[strctDatagridActionBar]"], true, never>;
1677
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctDatagrid, "strct-datagrid", never, { "columns": { "alias": "columns"; "required": true; "isSignal": true; }; "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "expandable": { "alias": "expandable"; "required": false; "isSignal": true; }; "detailPane": { "alias": "detailPane"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "resizable": { "alias": "resizable"; "required": false; "isSignal": true; }; "columnChooser": { "alias": "columnChooser"; "required": false; "isSignal": true; }; "sync": { "alias": "sync"; "required": false; "isSignal": true; }; "footerActionsDisabled": { "alias": "footerActionsDisabled"; "required": false; "isSignal": true; }; "rowId": { "alias": "rowId"; "required": false; "isSignal": true; }; "rowActions": { "alias": "rowActions"; "required": false; "isSignal": true; }; }, { "selectionChange": "selectionChange"; "syncChange": "syncChange"; "rowAction": "rowAction"; }, ["detailDef", "actionBarDef", "cellDefs"], ["[strctDatagridActionBar]"], true, never>;
1560
1678
  }
1561
1679
 
1562
1680
  /** Timeline node state colors. */
@@ -1823,5 +1941,5 @@ declare class StrctToastOutlet {
1823
1941
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctToastOutlet, "strct-toast-outlet", never, {}, {}, never, never, true, never>;
1824
1942
  }
1825
1943
 
1826
- export { STRCT_ICONS, STRCT_ICON_GROUPS, STRCT_MASKS, STRCT_PALETTES, STRCT_RAW_ICONS, StrctAccordion, StrctAccordionPanel, StrctAlert, StrctAvatar, StrctBadge, StrctBreadcrumb, StrctBreadcrumbItem, StrctButton, StrctButtonGroup, StrctCard, StrctCardBlock, StrctCardFooter, StrctCardHeader, StrctCascadeHost, StrctCascadeNode, StrctCascadeSelect, StrctCellDef, StrctChart, StrctCheckbox, StrctChips, StrctColorPicker, StrctCombobox, StrctContextMenu, StrctContextMenuTrigger, StrctDatagrid, StrctDatagridActionBar, StrctDatepicker, StrctDivider, StrctDonut, StrctDropdown, StrctDropdownDivider, StrctDropdownItem, StrctField, StrctFile, StrctFooter, StrctGauge, StrctHeader, StrctIcon, StrctInput, StrctInputMask, StrctInputOtp, StrctKnob, StrctLogin, StrctMenuPanel, StrctModal, StrctNav, StrctNavItem, StrctOverlay, StrctPagination, StrctPassword, StrctProgress, StrctRadio, StrctRadioGroup, StrctRange, StrctRating, StrctRowDetailDef, StrctShell, StrctShellService, StrctSignpost, StrctSkeleton, StrctSparkline, StrctSpeedDial, StrctSpinner, StrctStack, StrctStackItem, StrctStep, StrctSubmenu, StrctTab, StrctTable, StrctTabs, StrctTag, StrctThemeService, StrctThemeSwitcher, StrctTimeline, StrctTimelineItem, StrctToastOutlet, StrctToastService, StrctToggle, StrctTooltip, StrctTree, StrctTreeNode, StrctVerticalNav, StrctWizard, registerStrctIcon };
1827
- export type { StrctAlertType, StrctAvatarSize, StrctAvatarStatus, StrctBadgeStatus, StrctButtonSize, StrctButtonVariant, StrctCascadeOption, StrctCellContext, StrctChartStatus, StrctChartType, StrctColumn, StrctDatagridColumn, StrctDonutSegment, StrctIconBadge, StrctKnobStatus, StrctMenuItem, StrctModalSize, StrctMode, StrctOption, StrctOverlayPlacement, StrctPalette, StrctPaletteInfo, StrctProgressStatus, StrctRow, StrctRowId, StrctSignpostPosition, StrctSpeedDialDirection, StrctSpinnerSize, StrctTagStatus, StrctTimelineState, StrctToast, StrctToastOptions, StrctToastType, StrctTooltipPosition, StrctTreeMenuEvent, StrctTreeNodeData, StrctTreeNodeMenuFn };
1944
+ export { STRCT_ICONS, STRCT_ICON_GROUPS, STRCT_MASKS, STRCT_PALETTES, STRCT_RAW_ICONS, StrctAccordion, StrctAccordionPanel, StrctAlert, StrctAvatar, StrctBadge, StrctBreadcrumb, StrctBreadcrumbItem, StrctButton, StrctButtonGroup, StrctCard, StrctCardBlock, StrctCardFooter, StrctCardHeader, StrctCascadeHost, StrctCascadeNode, StrctCascadeSelect, StrctCellDef, StrctChart, StrctCheckbox, StrctChips, StrctColorPicker, StrctCombobox, StrctContextMenu, StrctContextMenuTrigger, StrctDatagrid, StrctDatagridActionBar, StrctDatepicker, StrctDivider, StrctDonut, StrctDrawer, StrctDrawerFooter, StrctDropdown, StrctDropdownDivider, StrctDropdownItem, StrctField, StrctFile, StrctFooter, StrctGauge, StrctHeader, StrctIcon, StrctInput, StrctInputMask, StrctInputOtp, StrctKnob, StrctLogin, StrctMenuPanel, StrctMenuService, StrctModal, StrctNav, StrctNavItem, StrctOverlay, StrctPagination, StrctPassword, StrctProgress, StrctRadio, StrctRadioGroup, StrctRail, StrctRange, StrctRating, StrctRowDetailDef, StrctShell, StrctShellService, StrctSignpost, StrctSkeleton, StrctSparkline, StrctSpeedDial, StrctSpinner, StrctStack, StrctStackItem, StrctStep, StrctSubmenu, StrctTab, StrctTable, StrctTabs, StrctTag, StrctThemeService, StrctThemeSwitcher, StrctTimeline, StrctTimelineItem, StrctToastOutlet, StrctToastService, StrctToggle, StrctTooltip, StrctTree, StrctTreeNode, StrctVerticalNav, StrctWizard, registerStrctIcon };
1945
+ export type { StrctAlertType, StrctAvatarSize, StrctAvatarStatus, StrctBadgeStatus, StrctButtonSize, StrctButtonVariant, StrctCascadeOption, StrctCellContext, StrctChartStatus, StrctChartType, StrctColumn, StrctDatagridColumn, StrctDonutSegment, StrctDrawerSide, StrctDrawerSize, StrctIconBadge, StrctKnobStatus, StrctMenuItem, StrctMenuOpenOptions, StrctModalSize, StrctMode, StrctOption, StrctOverlayPlacement, StrctPalette, StrctPaletteInfo, StrctProgressStatus, StrctRailItem, StrctRailStatus, StrctRow, StrctRowId, StrctSignpostPosition, StrctSpeedDialDirection, StrctSpinnerSize, StrctTagStatus, StrctTimelineState, StrctToast, StrctToastOptions, StrctToastType, StrctTooltipPosition, StrctTreeMenuEvent, StrctTreeNodeData, StrctTreeNodeMenuFn };