@akcelik/strct 4.1.0 → 4.2.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/fesm2022/akcelik-strct.mjs +167 -39
- package/fesm2022/akcelik-strct.mjs.map +1 -1
- package/package.json +1 -1
- package/types/akcelik-strct.d.ts +38 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akcelik/strct",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.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",
|
package/types/akcelik-strct.d.ts
CHANGED
|
@@ -878,7 +878,16 @@ interface StrctMenuItem {
|
|
|
878
878
|
icon?: string;
|
|
879
879
|
/** Destructive styling. */
|
|
880
880
|
critical?: boolean;
|
|
881
|
+
/** Unavailable: shown dimmed and cannot be activated. Pair with `hint` to say why. */
|
|
881
882
|
disabled?: boolean;
|
|
883
|
+
/**
|
|
884
|
+
* A short explanation — typically why a disabled entry is unavailable
|
|
885
|
+
* ("VM must be powered off to clone."). Shown as the entry's tooltip and
|
|
886
|
+
* given to assistive technology as its description; never rendered inline,
|
|
887
|
+
* so it never widens the menu. A disabled entry WITH a hint stays reachable
|
|
888
|
+
* by keyboard so its reason can be read; without one it is skipped, as before.
|
|
889
|
+
*/
|
|
890
|
+
hint?: string;
|
|
882
891
|
/** Render a separator instead of an entry (label is ignored). */
|
|
883
892
|
divider?: boolean;
|
|
884
893
|
/** Nested submenu. */
|
|
@@ -919,7 +928,13 @@ declare class StrctMenuPanel {
|
|
|
919
928
|
protected readonly flipLeft: _angular_core.WritableSignal<boolean>;
|
|
920
929
|
protected readonly activeIndex: _angular_core.WritableSignal<number>;
|
|
921
930
|
protected readonly openSubIndex: _angular_core.WritableSignal<number | null>;
|
|
931
|
+
/** Entries the keyboard visits: not dividers, and not a disabled entry that
|
|
932
|
+
* has nothing to say — a disabled entry WITH a hint is reachable so its
|
|
933
|
+
* reason can be read. (Before, disabled entries were "visited" but a
|
|
934
|
+
* natively disabled button refused focus, stranding the keyboard.) */
|
|
922
935
|
private readonly navIndices;
|
|
936
|
+
private readonly uid;
|
|
937
|
+
protected hintId(i: number): string;
|
|
923
938
|
constructor();
|
|
924
939
|
private clampToViewport;
|
|
925
940
|
protected focusItem(i: number): void;
|
|
@@ -1379,6 +1394,9 @@ declare class StrctDropdown {
|
|
|
1379
1394
|
/** APG menu keyboarding: arrows rove, Home/End jump, Enter/Space activate. */
|
|
1380
1395
|
protected onMenuKeydown(event: KeyboardEvent): void;
|
|
1381
1396
|
private enabledItems;
|
|
1397
|
+
/** What the arrow keys visit: enabled items, plus disabled ones that carry a
|
|
1398
|
+
* hint (so the reason can be read). The menu still opens on an enabled one. */
|
|
1399
|
+
private navItems;
|
|
1382
1400
|
/** Focus the selected item if there is one, else the first — after render. */
|
|
1383
1401
|
private focusInitialItem;
|
|
1384
1402
|
protected onDocClick(event: MouseEvent): void;
|
|
@@ -1410,8 +1428,17 @@ declare class StrctDropdownItem {
|
|
|
1410
1428
|
readonly critical: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1411
1429
|
/** Static disable flag. */
|
|
1412
1430
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1431
|
+
/**
|
|
1432
|
+
* A short explanation — typically why a disabled item is unavailable. Shown
|
|
1433
|
+
* as the tooltip and given to assistive technology as the description; never
|
|
1434
|
+
* rendered inline. A disabled item with a hint stays keyboard-reachable so
|
|
1435
|
+
* its reason can be read; activation stays blocked.
|
|
1436
|
+
*/
|
|
1437
|
+
readonly hint: _angular_core.InputSignal<string | null | undefined>;
|
|
1438
|
+
protected readonly hintId: string;
|
|
1439
|
+
constructor();
|
|
1413
1440
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctDropdownItem, never>;
|
|
1414
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctDropdownItem, "strct-dropdown-item", never, { "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "critical": { "alias": "critical"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
1441
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctDropdownItem, "strct-dropdown-item", never, { "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "critical": { "alias": "critical"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
1415
1442
|
}
|
|
1416
1443
|
/** Thin separator between groups of menu items. */
|
|
1417
1444
|
declare class StrctDropdownDivider {
|
|
@@ -1449,7 +1476,8 @@ declare class StrctContextMenu {
|
|
|
1449
1476
|
private restoreTo;
|
|
1450
1477
|
onContextMenu(event: MouseEvent): void;
|
|
1451
1478
|
close(): void;
|
|
1452
|
-
/**
|
|
1479
|
+
/** Keyboard-reachable `strct-dropdown-item` elements in DOM order: enabled
|
|
1480
|
+
* ones, plus disabled ones that carry a hint (so the reason can be read). */
|
|
1453
1481
|
private navItems;
|
|
1454
1482
|
/**
|
|
1455
1483
|
* Focus-based roving: items keep the `tabindex="-1"` their host binding
|
|
@@ -1508,7 +1536,8 @@ declare class StrctSubmenu {
|
|
|
1508
1536
|
* the panel so a host menu's own roving/Escape does not also run.
|
|
1509
1537
|
*/
|
|
1510
1538
|
protected onPanelKeydown(event: KeyboardEvent): void;
|
|
1511
|
-
/** Rovable rows of the open fly-out
|
|
1539
|
+
/** Rovable rows of the open fly-out: enabled dropdown items, plus disabled
|
|
1540
|
+
* ones that carry a hint (so the reason can be read). */
|
|
1512
1541
|
private panelItems;
|
|
1513
1542
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<StrctSubmenu, never>;
|
|
1514
1543
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<StrctSubmenu, "strct-submenu", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, ["[strctSubmenuLabel]", "*"], true, never>;
|
|
@@ -4861,7 +4890,7 @@ declare class StrctTransfer {
|
|
|
4861
4890
|
declare class StrctSplitButton {
|
|
4862
4891
|
/** Main action label. */
|
|
4863
4892
|
readonly label: _angular_core.InputSignal<string>;
|
|
4864
|
-
/** Menu entries (StrctMenuItem: id, label, icon?, critical?, disabled?). */
|
|
4893
|
+
/** Menu entries (StrctMenuItem: id, label, icon?, critical?, disabled?, hint?). */
|
|
4865
4894
|
readonly items: _angular_core.InputSignal<StrctMenuItem[]>;
|
|
4866
4895
|
/** Optional leading icon of the main segment. */
|
|
4867
4896
|
readonly icon: _angular_core.InputSignal<string>;
|
|
@@ -5023,8 +5052,12 @@ declare class StrctMenubar {
|
|
|
5023
5052
|
/** Switch the open menu to the next/previous top-level entry; focus follows. */
|
|
5024
5053
|
private switchTop;
|
|
5025
5054
|
private closeMenu;
|
|
5055
|
+
private readonly uid;
|
|
5056
|
+
protected hintId(menuId: string, i: number, j?: number): string;
|
|
5026
5057
|
private topButtons;
|
|
5027
|
-
/**
|
|
5058
|
+
/** Keyboard-reachable item buttons of the open menu — either its items or the
|
|
5059
|
+
* open submenu's: enabled ones, plus disabled ones that carry a hint (so the
|
|
5060
|
+
* reason can be read). A disabled entry with nothing to say is skipped. */
|
|
5028
5061
|
private navButtons;
|
|
5029
5062
|
protected onDocClick(event: MouseEvent): void;
|
|
5030
5063
|
protected onEscape(event: Event): void;
|