@genesislcap/foundation-header 14.420.0 → 14.421.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/dist/custom-elements.json +58 -10
- package/dist/dts/main/main.d.ts +38 -5
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/esm/main/main.js +20 -7
- package/dist/foundation-header.api.json +94 -6
- package/dist/foundation-header.d.ts +39 -5
- package/package.json +23 -23
|
@@ -763,6 +763,15 @@
|
|
|
763
763
|
},
|
|
764
764
|
"description": "Callback function to check if a layout item is currently active in the layout.\nUsed with nav items that have `isLayoutItem: true` and `layoutRegistration` set."
|
|
765
765
|
},
|
|
766
|
+
{
|
|
767
|
+
"kind": "field",
|
|
768
|
+
"name": "onBeforeNavButtonClick",
|
|
769
|
+
"type": {
|
|
770
|
+
"text": "(detail: NavButtonClickDetail) => void | Promise<void> | undefined"
|
|
771
|
+
},
|
|
772
|
+
"description": "Callback invoked before navigation occurs when a nav button is clicked.\nAwaited before the route changes, so async cleanup is supported.",
|
|
773
|
+
"privacy": "public"
|
|
774
|
+
},
|
|
766
775
|
{
|
|
767
776
|
"kind": "method",
|
|
768
777
|
"name": "isLayoutItemActive",
|
|
@@ -883,7 +892,7 @@
|
|
|
883
892
|
"name": "handleNavButtonClick",
|
|
884
893
|
"return": {
|
|
885
894
|
"type": {
|
|
886
|
-
"text": "void"
|
|
895
|
+
"text": "Promise<void>"
|
|
887
896
|
}
|
|
888
897
|
},
|
|
889
898
|
"parameters": [
|
|
@@ -1523,6 +1532,19 @@
|
|
|
1523
1532
|
"module": "src/main/main.ts"
|
|
1524
1533
|
}
|
|
1525
1534
|
},
|
|
1535
|
+
{
|
|
1536
|
+
"kind": "field",
|
|
1537
|
+
"name": "onBeforeNavButtonClick",
|
|
1538
|
+
"type": {
|
|
1539
|
+
"text": "(detail: NavButtonClickDetail) => void | Promise<void> | undefined"
|
|
1540
|
+
},
|
|
1541
|
+
"description": "Callback invoked before navigation occurs when a nav button is clicked.\nAwaited before the route changes, so async cleanup is supported.",
|
|
1542
|
+
"privacy": "public",
|
|
1543
|
+
"inheritedFrom": {
|
|
1544
|
+
"name": "Navigation",
|
|
1545
|
+
"module": "src/main/main.ts"
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1526
1548
|
{
|
|
1527
1549
|
"kind": "method",
|
|
1528
1550
|
"name": "isLayoutItemActive",
|
|
@@ -1675,7 +1697,7 @@
|
|
|
1675
1697
|
"name": "handleNavButtonClick",
|
|
1676
1698
|
"return": {
|
|
1677
1699
|
"type": {
|
|
1678
|
-
"text": "void"
|
|
1700
|
+
"text": "Promise<void>"
|
|
1679
1701
|
}
|
|
1680
1702
|
},
|
|
1681
1703
|
"parameters": [
|
|
@@ -2637,6 +2659,19 @@
|
|
|
2637
2659
|
"module": "src/main/main.ts"
|
|
2638
2660
|
}
|
|
2639
2661
|
},
|
|
2662
|
+
{
|
|
2663
|
+
"kind": "field",
|
|
2664
|
+
"name": "onBeforeNavButtonClick",
|
|
2665
|
+
"type": {
|
|
2666
|
+
"text": "(detail: NavButtonClickDetail) => void | Promise<void> | undefined"
|
|
2667
|
+
},
|
|
2668
|
+
"description": "Callback invoked before navigation occurs when a nav button is clicked.\nAwaited before the route changes, so async cleanup is supported.",
|
|
2669
|
+
"privacy": "public",
|
|
2670
|
+
"inheritedFrom": {
|
|
2671
|
+
"name": "Navigation",
|
|
2672
|
+
"module": "src/main/main.ts"
|
|
2673
|
+
}
|
|
2674
|
+
},
|
|
2640
2675
|
{
|
|
2641
2676
|
"kind": "method",
|
|
2642
2677
|
"name": "isLayoutItemActive",
|
|
@@ -2789,7 +2824,7 @@
|
|
|
2789
2824
|
"name": "handleNavButtonClick",
|
|
2790
2825
|
"return": {
|
|
2791
2826
|
"type": {
|
|
2792
|
-
"text": "void"
|
|
2827
|
+
"text": "Promise<void>"
|
|
2793
2828
|
}
|
|
2794
2829
|
},
|
|
2795
2830
|
"parameters": [
|
|
@@ -3298,6 +3333,19 @@
|
|
|
3298
3333
|
"module": "src/main/main.ts"
|
|
3299
3334
|
}
|
|
3300
3335
|
},
|
|
3336
|
+
{
|
|
3337
|
+
"kind": "field",
|
|
3338
|
+
"name": "onBeforeNavButtonClick",
|
|
3339
|
+
"type": {
|
|
3340
|
+
"text": "(detail: NavButtonClickDetail) => void | Promise<void> | undefined"
|
|
3341
|
+
},
|
|
3342
|
+
"description": "Callback invoked before navigation occurs when a nav button is clicked.\nAwaited before the route changes, so async cleanup is supported.",
|
|
3343
|
+
"privacy": "public",
|
|
3344
|
+
"inheritedFrom": {
|
|
3345
|
+
"name": "Navigation",
|
|
3346
|
+
"module": "src/main/main.ts"
|
|
3347
|
+
}
|
|
3348
|
+
},
|
|
3301
3349
|
{
|
|
3302
3350
|
"kind": "method",
|
|
3303
3351
|
"name": "isLayoutItemActive",
|
|
@@ -3436,7 +3484,7 @@
|
|
|
3436
3484
|
"name": "handleNavButtonClick",
|
|
3437
3485
|
"return": {
|
|
3438
3486
|
"type": {
|
|
3439
|
-
"text": "void"
|
|
3487
|
+
"text": "Promise<void>"
|
|
3440
3488
|
}
|
|
3441
3489
|
},
|
|
3442
3490
|
"parameters": [
|
|
@@ -3991,12 +4039,6 @@
|
|
|
3991
4039
|
}
|
|
3992
4040
|
]
|
|
3993
4041
|
},
|
|
3994
|
-
{
|
|
3995
|
-
"kind": "javascript-module",
|
|
3996
|
-
"path": "src/templates/rapid.template.ts",
|
|
3997
|
-
"declarations": [],
|
|
3998
|
-
"exports": []
|
|
3999
|
-
},
|
|
4000
4042
|
{
|
|
4001
4043
|
"kind": "javascript-module",
|
|
4002
4044
|
"path": "src/tags/index.ts",
|
|
@@ -4018,6 +4060,12 @@
|
|
|
4018
4060
|
"declarations": [],
|
|
4019
4061
|
"exports": []
|
|
4020
4062
|
},
|
|
4063
|
+
{
|
|
4064
|
+
"kind": "javascript-module",
|
|
4065
|
+
"path": "src/templates/rapid.template.ts",
|
|
4066
|
+
"declarations": [],
|
|
4067
|
+
"exports": []
|
|
4068
|
+
},
|
|
4021
4069
|
{
|
|
4022
4070
|
"kind": "javascript-module",
|
|
4023
4071
|
"path": "src/utils/index.ts",
|
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -7,6 +7,20 @@ import type { ViewTemplate } from '@genesislcap/web-core';
|
|
|
7
7
|
import { Container } from '@genesislcap/web-core';
|
|
8
8
|
import { ControlPanel } from '../components/control-panel';
|
|
9
9
|
import { HeaderConfig } from '../config/config';
|
|
10
|
+
/**
|
|
11
|
+
* Detail payload for nav button click events and callbacks
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export type NavButtonClickDetail = {
|
|
15
|
+
/** The navigation item that was clicked */
|
|
16
|
+
item: FoundationRouteNavItem;
|
|
17
|
+
/** The pathname before navigation */
|
|
18
|
+
oldPath: string;
|
|
19
|
+
/** The destination path (`routeNavItem.routePath`). Undefined for items with a custom `onClick` that don't navigate. */
|
|
20
|
+
newPath: string | undefined;
|
|
21
|
+
/** The header component instance */
|
|
22
|
+
context: any;
|
|
23
|
+
};
|
|
10
24
|
/**
|
|
11
25
|
* Events dispatched by the navigation control buttons
|
|
12
26
|
* @public
|
|
@@ -17,10 +31,7 @@ export type NavEventDetailMap = {
|
|
|
17
31
|
'misc-icon-clicked': void;
|
|
18
32
|
'notification-icon-clicked': void;
|
|
19
33
|
'language-changed': void;
|
|
20
|
-
'nav-button-clicked':
|
|
21
|
-
item: FoundationRouteNavItem;
|
|
22
|
-
context: any;
|
|
23
|
-
};
|
|
34
|
+
'nav-button-clicked': NavButtonClickDetail;
|
|
24
35
|
};
|
|
25
36
|
/**
|
|
26
37
|
* Options for the language selector
|
|
@@ -640,6 +651,28 @@ export declare class Navigation extends Navigation_base {
|
|
|
640
651
|
* @beta
|
|
641
652
|
*/
|
|
642
653
|
layoutItemCheck?: (registration: string) => boolean;
|
|
654
|
+
/**
|
|
655
|
+
* Callback invoked before navigation occurs when a nav button is clicked.
|
|
656
|
+
* Awaited before the route changes, so async cleanup is supported.
|
|
657
|
+
*
|
|
658
|
+
* @remarks
|
|
659
|
+
* DOM events cannot be awaited, so this callback is the only way to guarantee
|
|
660
|
+
* execution before the route changes. The `nav-button-clicked` event fires after
|
|
661
|
+
* navigation and is suitable for informational use only.
|
|
662
|
+
*
|
|
663
|
+
* @example
|
|
664
|
+
* ```ts
|
|
665
|
+
* <foundation-header
|
|
666
|
+
* :onBeforeNavButtonClick=${(x) => async (detail) => {
|
|
667
|
+
* await x.cleanup();
|
|
668
|
+
* console.log(`Navigating from ${detail.oldPath} to ${detail.newPath}`);
|
|
669
|
+
* }}
|
|
670
|
+
* />
|
|
671
|
+
* ```
|
|
672
|
+
*
|
|
673
|
+
* @public
|
|
674
|
+
*/
|
|
675
|
+
onBeforeNavButtonClick?: (detail: NavButtonClickDetail) => void | Promise<void>;
|
|
643
676
|
/**
|
|
644
677
|
* Check if a layout item is currently active in the layout
|
|
645
678
|
* @param item - The navigation item to check
|
|
@@ -784,7 +817,7 @@ export declare class Navigation extends Navigation_base {
|
|
|
784
817
|
* Handles the click event for a navigation button
|
|
785
818
|
* @param routeNavItem - The navigation item that was clicked
|
|
786
819
|
*/
|
|
787
|
-
handleNavButtonClick(routeNavItem: FoundationRouteNavItem): void
|
|
820
|
+
handleNavButtonClick(routeNavItem: FoundationRouteNavItem): Promise<void>;
|
|
788
821
|
/**
|
|
789
822
|
* Current pathname for route highlighting
|
|
790
823
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAe,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE1E,OAAO,EAAsB,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,C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IAAI,IAAI;IAI1B;;;;;;;;OAQG;IACH,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI;IAKpC;;;;;;;;OAQG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAMrC;;;OAGG;IACG,oBAAoB,CAAC,YAAY,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB/E;;;OAGG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED;;;;;OAKG;IACI,cAAc,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO;CAmBhE;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IACxC,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAGnC;AAED;;;;;;GAMG;AACH,qBAKa,UAAW,SAAQ,UAAU;CAAG;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAKa,WAAY,SAAQ,UAAU;IACzC;;;;;;;;OAQG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAMlC,cAAc,IAAI,YAAY,CAAC,UAAU,CAAC;CAG3C"}
|
package/dist/esm/main/main.js
CHANGED
|
@@ -454,13 +454,23 @@ let Navigation = class Navigation extends EventEmitter(GenesisElement) {
|
|
|
454
454
|
* @param routeNavItem - The navigation item that was clicked
|
|
455
455
|
*/
|
|
456
456
|
handleNavButtonClick(routeNavItem) {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
457
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
458
|
+
var _a;
|
|
459
|
+
const detail = {
|
|
460
|
+
item: routeNavItem,
|
|
461
|
+
oldPath: this.pathName,
|
|
462
|
+
newPath: routeNavItem.routePath,
|
|
463
|
+
context: this,
|
|
464
|
+
};
|
|
465
|
+
yield ((_a = this.onBeforeNavButtonClick) === null || _a === void 0 ? void 0 : _a.call(this, detail));
|
|
466
|
+
if (routeNavItem.onClick) {
|
|
467
|
+
routeNavItem.onClick({ item: routeNavItem, context: this });
|
|
468
|
+
}
|
|
469
|
+
else if (routeNavItem.routePath) {
|
|
470
|
+
this.navigateTo(routeNavItem.routePath);
|
|
471
|
+
}
|
|
472
|
+
this.$emit('nav-button-clicked', detail);
|
|
473
|
+
});
|
|
464
474
|
}
|
|
465
475
|
/**
|
|
466
476
|
* Current pathname for route highlighting
|
|
@@ -578,6 +588,9 @@ __decorate([
|
|
|
578
588
|
__decorate([
|
|
579
589
|
observable
|
|
580
590
|
], Navigation.prototype, "layoutItemCheck", void 0);
|
|
591
|
+
__decorate([
|
|
592
|
+
observable
|
|
593
|
+
], Navigation.prototype, "onBeforeNavButtonClick", void 0);
|
|
581
594
|
__decorate([
|
|
582
595
|
attr({ mode: 'boolean', attribute: 'show-account-menu' })
|
|
583
596
|
], Navigation.prototype, "showAccountMenu", void 0);
|
|
@@ -534,6 +534,41 @@
|
|
|
534
534
|
"endIndex": 3
|
|
535
535
|
}
|
|
536
536
|
},
|
|
537
|
+
{
|
|
538
|
+
"kind": "TypeAlias",
|
|
539
|
+
"canonicalReference": "@genesislcap/foundation-header!NavButtonClickDetail:type",
|
|
540
|
+
"docComment": "/**\n * Detail payload for nav button click events and callbacks\n *\n * @public\n */\n",
|
|
541
|
+
"excerptTokens": [
|
|
542
|
+
{
|
|
543
|
+
"kind": "Content",
|
|
544
|
+
"text": "export type NavButtonClickDetail = "
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
"kind": "Content",
|
|
548
|
+
"text": "{\n item: "
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"kind": "Reference",
|
|
552
|
+
"text": "FoundationRouteNavItem",
|
|
553
|
+
"canonicalReference": "@genesislcap/foundation-ui!FoundationRouteNavItem:type"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
"kind": "Content",
|
|
557
|
+
"text": ";\n oldPath: string;\n newPath: string | undefined;\n context: any;\n}"
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"kind": "Content",
|
|
561
|
+
"text": ";"
|
|
562
|
+
}
|
|
563
|
+
],
|
|
564
|
+
"fileUrlPath": "src/main/main.ts",
|
|
565
|
+
"releaseTag": "Public",
|
|
566
|
+
"name": "NavButtonClickDetail",
|
|
567
|
+
"typeTokenRange": {
|
|
568
|
+
"startIndex": 1,
|
|
569
|
+
"endIndex": 4
|
|
570
|
+
}
|
|
571
|
+
},
|
|
537
572
|
{
|
|
538
573
|
"kind": "TypeAlias",
|
|
539
574
|
"canonicalReference": "@genesislcap/foundation-header!NavEventDetailMap:type",
|
|
@@ -545,16 +580,16 @@
|
|
|
545
580
|
},
|
|
546
581
|
{
|
|
547
582
|
"kind": "Content",
|
|
548
|
-
"text": "{\n 'luminance-icon-clicked': void;\n 'logout-clicked': void;\n 'misc-icon-clicked': void;\n 'notification-icon-clicked': void;\n 'language-changed': void;\n 'nav-button-clicked':
|
|
583
|
+
"text": "{\n 'luminance-icon-clicked': void;\n 'logout-clicked': void;\n 'misc-icon-clicked': void;\n 'notification-icon-clicked': void;\n 'language-changed': void;\n 'nav-button-clicked': "
|
|
549
584
|
},
|
|
550
585
|
{
|
|
551
586
|
"kind": "Reference",
|
|
552
|
-
"text": "
|
|
553
|
-
"canonicalReference": "@genesislcap/foundation-
|
|
587
|
+
"text": "NavButtonClickDetail",
|
|
588
|
+
"canonicalReference": "@genesislcap/foundation-header!NavButtonClickDetail:type"
|
|
554
589
|
},
|
|
555
590
|
{
|
|
556
591
|
"kind": "Content",
|
|
557
|
-
"text": ";\n
|
|
592
|
+
"text": ";\n}"
|
|
558
593
|
},
|
|
559
594
|
{
|
|
560
595
|
"kind": "Content",
|
|
@@ -851,9 +886,14 @@
|
|
|
851
886
|
"kind": "Content",
|
|
852
887
|
"text": "): "
|
|
853
888
|
},
|
|
889
|
+
{
|
|
890
|
+
"kind": "Reference",
|
|
891
|
+
"text": "Promise",
|
|
892
|
+
"canonicalReference": "!Promise:interface"
|
|
893
|
+
},
|
|
854
894
|
{
|
|
855
895
|
"kind": "Content",
|
|
856
|
-
"text": "void"
|
|
896
|
+
"text": "<void>"
|
|
857
897
|
},
|
|
858
898
|
{
|
|
859
899
|
"kind": "Content",
|
|
@@ -863,7 +903,7 @@
|
|
|
863
903
|
"isStatic": false,
|
|
864
904
|
"returnTypeTokenRange": {
|
|
865
905
|
"startIndex": 3,
|
|
866
|
-
"endIndex":
|
|
906
|
+
"endIndex": 5
|
|
867
907
|
},
|
|
868
908
|
"releaseTag": "Public",
|
|
869
909
|
"isProtected": false,
|
|
@@ -1428,6 +1468,54 @@
|
|
|
1428
1468
|
"isAbstract": false,
|
|
1429
1469
|
"name": "navigateTo"
|
|
1430
1470
|
},
|
|
1471
|
+
{
|
|
1472
|
+
"kind": "Property",
|
|
1473
|
+
"canonicalReference": "@genesislcap/foundation-header!Navigation#onBeforeNavButtonClick:member",
|
|
1474
|
+
"docComment": "/**\n * Callback invoked before navigation occurs when a nav button is clicked. Awaited before the route changes, so async cleanup is supported.\n *\n * @remarks\n *\n * DOM events cannot be awaited, so this callback is the only way to guarantee execution before the route changes. The `nav-button-clicked` event fires after navigation and is suitable for informational use only.\n *\n * @example\n * ```ts\n * <foundation-header\n * :onBeforeNavButtonClick=${(x) => async (detail) => {\n * await x.cleanup();\n * console.log(`Navigating from ${detail.oldPath} to ${detail.newPath}`);\n * }}\n * />\n * ```\n *\n * @public\n */\n",
|
|
1475
|
+
"excerptTokens": [
|
|
1476
|
+
{
|
|
1477
|
+
"kind": "Content",
|
|
1478
|
+
"text": "onBeforeNavButtonClick?: "
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"kind": "Content",
|
|
1482
|
+
"text": "(detail: "
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
"kind": "Reference",
|
|
1486
|
+
"text": "NavButtonClickDetail",
|
|
1487
|
+
"canonicalReference": "@genesislcap/foundation-header!NavButtonClickDetail:type"
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
"kind": "Content",
|
|
1491
|
+
"text": ") => void | "
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
"kind": "Reference",
|
|
1495
|
+
"text": "Promise",
|
|
1496
|
+
"canonicalReference": "!Promise:interface"
|
|
1497
|
+
},
|
|
1498
|
+
{
|
|
1499
|
+
"kind": "Content",
|
|
1500
|
+
"text": "<void>"
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
"kind": "Content",
|
|
1504
|
+
"text": ";"
|
|
1505
|
+
}
|
|
1506
|
+
],
|
|
1507
|
+
"isReadonly": false,
|
|
1508
|
+
"isOptional": true,
|
|
1509
|
+
"releaseTag": "Public",
|
|
1510
|
+
"name": "onBeforeNavButtonClick",
|
|
1511
|
+
"propertyTypeTokenRange": {
|
|
1512
|
+
"startIndex": 1,
|
|
1513
|
+
"endIndex": 6
|
|
1514
|
+
},
|
|
1515
|
+
"isStatic": false,
|
|
1516
|
+
"isProtected": false,
|
|
1517
|
+
"isAbstract": false
|
|
1518
|
+
},
|
|
1431
1519
|
{
|
|
1432
1520
|
"kind": "Property",
|
|
1433
1521
|
"canonicalReference": "@genesislcap/foundation-header!Navigation#pathName:member",
|
|
@@ -287,6 +287,21 @@ export declare const MainStyles: ElementStyles;
|
|
|
287
287
|
*/
|
|
288
288
|
export declare const mainTemplate: ViewTemplate<Navigation, any>;
|
|
289
289
|
|
|
290
|
+
/**
|
|
291
|
+
* Detail payload for nav button click events and callbacks
|
|
292
|
+
* @public
|
|
293
|
+
*/
|
|
294
|
+
export declare type NavButtonClickDetail = {
|
|
295
|
+
/** The navigation item that was clicked */
|
|
296
|
+
item: FoundationRouteNavItem;
|
|
297
|
+
/** The pathname before navigation */
|
|
298
|
+
oldPath: string;
|
|
299
|
+
/** The destination path (`routeNavItem.routePath`). Undefined for items with a custom `onClick` that don't navigate. */
|
|
300
|
+
newPath: string | undefined;
|
|
301
|
+
/** The header component instance */
|
|
302
|
+
context: any;
|
|
303
|
+
};
|
|
304
|
+
|
|
290
305
|
/**
|
|
291
306
|
* Events dispatched by the navigation control buttons
|
|
292
307
|
* @public
|
|
@@ -297,10 +312,7 @@ export declare type NavEventDetailMap = {
|
|
|
297
312
|
'misc-icon-clicked': void;
|
|
298
313
|
'notification-icon-clicked': void;
|
|
299
314
|
'language-changed': void;
|
|
300
|
-
'nav-button-clicked':
|
|
301
|
-
item: FoundationRouteNavItem;
|
|
302
|
-
context: any;
|
|
303
|
-
};
|
|
315
|
+
'nav-button-clicked': NavButtonClickDetail;
|
|
304
316
|
};
|
|
305
317
|
|
|
306
318
|
/**
|
|
@@ -557,6 +569,28 @@ export declare class Navigation extends Navigation_base {
|
|
|
557
569
|
* @beta
|
|
558
570
|
*/
|
|
559
571
|
layoutItemCheck?: (registration: string) => boolean;
|
|
572
|
+
/**
|
|
573
|
+
* Callback invoked before navigation occurs when a nav button is clicked.
|
|
574
|
+
* Awaited before the route changes, so async cleanup is supported.
|
|
575
|
+
*
|
|
576
|
+
* @remarks
|
|
577
|
+
* DOM events cannot be awaited, so this callback is the only way to guarantee
|
|
578
|
+
* execution before the route changes. The `nav-button-clicked` event fires after
|
|
579
|
+
* navigation and is suitable for informational use only.
|
|
580
|
+
*
|
|
581
|
+
* @example
|
|
582
|
+
* ```ts
|
|
583
|
+
* <foundation-header
|
|
584
|
+
* :onBeforeNavButtonClick=${(x) => async (detail) => {
|
|
585
|
+
* await x.cleanup();
|
|
586
|
+
* console.log(`Navigating from ${detail.oldPath} to ${detail.newPath}`);
|
|
587
|
+
* }}
|
|
588
|
+
* />
|
|
589
|
+
* ```
|
|
590
|
+
*
|
|
591
|
+
* @public
|
|
592
|
+
*/
|
|
593
|
+
onBeforeNavButtonClick?: (detail: NavButtonClickDetail) => void | Promise<void>;
|
|
560
594
|
/**
|
|
561
595
|
* Check if a layout item is currently active in the layout
|
|
562
596
|
* @param item - The navigation item to check
|
|
@@ -701,7 +735,7 @@ export declare class Navigation extends Navigation_base {
|
|
|
701
735
|
* Handles the click event for a navigation button
|
|
702
736
|
* @param routeNavItem - The navigation item that was clicked
|
|
703
737
|
*/
|
|
704
|
-
handleNavButtonClick(routeNavItem: FoundationRouteNavItem): void
|
|
738
|
+
handleNavButtonClick(routeNavItem: FoundationRouteNavItem): Promise<void>;
|
|
705
739
|
/**
|
|
706
740
|
* Current pathname for route highlighting
|
|
707
741
|
* @public
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-header",
|
|
3
3
|
"description": "Genesis Foundation Header",
|
|
4
|
-
"version": "14.
|
|
4
|
+
"version": "14.421.0",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/foundation-header.d.ts",
|
|
@@ -84,29 +84,29 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@genesislcap/foundation-testing": "14.
|
|
88
|
-
"@genesislcap/genx": "14.
|
|
89
|
-
"@genesislcap/rollup-builder": "14.
|
|
90
|
-
"@genesislcap/ts-builder": "14.
|
|
91
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
|
92
|
-
"@genesislcap/vite-builder": "14.
|
|
93
|
-
"@genesislcap/webpack-builder": "14.
|
|
87
|
+
"@genesislcap/foundation-testing": "14.421.0",
|
|
88
|
+
"@genesislcap/genx": "14.421.0",
|
|
89
|
+
"@genesislcap/rollup-builder": "14.421.0",
|
|
90
|
+
"@genesislcap/ts-builder": "14.421.0",
|
|
91
|
+
"@genesislcap/uvu-playwright-builder": "14.421.0",
|
|
92
|
+
"@genesislcap/vite-builder": "14.421.0",
|
|
93
|
+
"@genesislcap/webpack-builder": "14.421.0"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@genesislcap/foundation-ai": "14.
|
|
97
|
-
"@genesislcap/foundation-auth": "14.
|
|
98
|
-
"@genesislcap/foundation-comms": "14.
|
|
99
|
-
"@genesislcap/foundation-events": "14.
|
|
100
|
-
"@genesislcap/foundation-i18n": "14.
|
|
101
|
-
"@genesislcap/foundation-logger": "14.
|
|
102
|
-
"@genesislcap/foundation-login": "14.
|
|
103
|
-
"@genesislcap/foundation-shell": "14.
|
|
104
|
-
"@genesislcap/foundation-ui": "14.
|
|
105
|
-
"@genesislcap/foundation-user": "14.
|
|
106
|
-
"@genesislcap/foundation-utils": "14.
|
|
107
|
-
"@genesislcap/foundation-zero": "14.
|
|
108
|
-
"@genesislcap/rapid-design-system": "14.
|
|
109
|
-
"@genesislcap/web-core": "14.
|
|
96
|
+
"@genesislcap/foundation-ai": "14.421.0",
|
|
97
|
+
"@genesislcap/foundation-auth": "14.421.0",
|
|
98
|
+
"@genesislcap/foundation-comms": "14.421.0",
|
|
99
|
+
"@genesislcap/foundation-events": "14.421.0",
|
|
100
|
+
"@genesislcap/foundation-i18n": "14.421.0",
|
|
101
|
+
"@genesislcap/foundation-logger": "14.421.0",
|
|
102
|
+
"@genesislcap/foundation-login": "14.421.0",
|
|
103
|
+
"@genesislcap/foundation-shell": "14.421.0",
|
|
104
|
+
"@genesislcap/foundation-ui": "14.421.0",
|
|
105
|
+
"@genesislcap/foundation-user": "14.421.0",
|
|
106
|
+
"@genesislcap/foundation-utils": "14.421.0",
|
|
107
|
+
"@genesislcap/foundation-zero": "14.421.0",
|
|
108
|
+
"@genesislcap/rapid-design-system": "14.421.0",
|
|
109
|
+
"@genesislcap/web-core": "14.421.0"
|
|
110
110
|
},
|
|
111
111
|
"repository": {
|
|
112
112
|
"type": "git",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"peerDependencies": {
|
|
121
121
|
"@microsoft/fast-react-wrapper": ">=0.3.0"
|
|
122
122
|
},
|
|
123
|
-
"gitHead": "
|
|
123
|
+
"gitHead": "d109b70edbd07af351ed8bf393ace74b42bb5356"
|
|
124
124
|
}
|