@softheon/armature 19.23.1 → 19.23.3

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.
@@ -12,6 +12,8 @@ export declare class SofBadgeComponent {
12
12
  badgeColor: 'info' | 'success' | 'warn' | 'error' | 'theme' | 'neutral' | 'metal-tier';
13
13
  /** Whether or not to use default icons */
14
14
  useIcon: boolean;
15
+ /** Whether or not to use default icons */
16
+ isNotificationType: boolean;
15
17
  /** The icon class- this should be a Phosphor Icons class, type bold */
16
18
  iconClass: string;
17
19
  /** The badge aria label */
@@ -38,7 +40,7 @@ export declare class SofBadgeComponent {
38
40
  /** Sets the icon based on badge type */
39
41
  private setIcon;
40
42
  static ɵfac: i0.ɵɵFactoryDeclaration<SofBadgeComponent, never>;
41
- static ɵcmp: i0.ɵɵComponentDeclaration<SofBadgeComponent, "sof-badge", never, { "bold": { "alias": "bold"; "required": false; }; "badgeText": { "alias": "badgeText"; "required": false; }; "badgeColor": { "alias": "badgeColor"; "required": false; }; "useIcon": { "alias": "useIcon"; "required": false; }; "iconClass": { "alias": "iconClass"; "required": false; }; "badgeAria": { "alias": "badgeAria"; "required": false; }; "iconAria": { "alias": "iconAria"; "required": false; }; "tooltipData": { "alias": "tooltipData"; "required": false; }; }, {}, never, never, false, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<SofBadgeComponent, "sof-badge", never, { "bold": { "alias": "bold"; "required": false; }; "badgeText": { "alias": "badgeText"; "required": false; }; "badgeColor": { "alias": "badgeColor"; "required": false; }; "useIcon": { "alias": "useIcon"; "required": false; }; "isNotificationType": { "alias": "isNotificationType"; "required": false; }; "iconClass": { "alias": "iconClass"; "required": false; }; "badgeAria": { "alias": "badgeAria"; "required": false; }; "iconAria": { "alias": "iconAria"; "required": false; }; "tooltipData": { "alias": "tooltipData"; "required": false; }; }, {}, never, never, false, never>;
42
44
  }
43
45
  export declare enum STATUS {
44
46
  INFO = "info",
@@ -46,6 +46,10 @@ export interface NavPanelNode {
46
46
  * Node route url
47
47
  */
48
48
  route?: string;
49
+ /**
50
+ * Badge config
51
+ */
52
+ badgeConfig?: NavNodeBadgeConfig;
49
53
  /**
50
54
  * Subnodes array
51
55
  * @description If sub nodes are present,
@@ -95,5 +99,36 @@ interface NavPanelSubnode {
95
99
  * Subnode route url
96
100
  */
97
101
  route?: string;
102
+ /**
103
+ * Badge config
104
+ */
105
+ badgeConfig?: NavNodeBadgeConfig;
106
+ }
107
+ /**
108
+ * Navigation node badge configuration
109
+ */
110
+ export interface NavNodeBadgeConfig {
111
+ /** Badge type - 'notification' for red badges, 'status' for primary badges */
112
+ type: 'notification' | 'status';
113
+ }
114
+ /**
115
+ * Available badge data
116
+ * @note the nav-panel returns this as @Output() event
117
+ */
118
+ export interface NavNodeAvailableBadge {
119
+ /** node index */
120
+ nodeIndex: number;
121
+ /** node sub index */
122
+ subnodeIndex?: number;
123
+ /** the nodes label */
124
+ nodeLabel: string;
125
+ /** the nodes badge type - 'notification' for red badges, 'status' for primary badges */
126
+ badgeType: 'notification' | 'status';
127
+ }
128
+ /** Interface for badge update events */
129
+ export interface NavBadgeUpdate {
130
+ nodeIndex: number;
131
+ value: string;
132
+ subIndex?: number;
98
133
  }
99
134
  export {};
@@ -1,19 +1,19 @@
1
- import { EventEmitter, OnInit, Signal } from '@angular/core';
1
+ import { EventEmitter, OnChanges, OnInit, Signal, SimpleChanges, WritableSignal } from '@angular/core';
2
2
  import { BreakpointState } from '@angular/cdk/layout';
3
3
  import { MatSidenavContent } from '@angular/material/sidenav';
4
- import { NavPanelNode } from './models/nav-panel-nodes';
4
+ import { NavNodeAvailableBadge, NavPanelNode } from './models/nav-panel-nodes';
5
5
  import { NavPanelSettings } from './models/nav-panel-settings';
6
6
  import { NavPanelLogo } from './models/nav-panel-logo';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
9
9
  * The Navigation Panel Component
10
10
  * @description Main navigation panel for Portals, part of the new Portal UI-shell.
11
- * @note Designed to be used with the 'SofHeaderPortalComponent' component as its child.
11
+ * @note Designed to be used with the 'SofHeaderComponent' component as its child.
12
12
  * @see [Figma/portal-ui-shell]({@link https://www.figma.com/design/W5HVNCcN9HafDRvc5N7Z28/%5BWIP%5D-Softheon-Unified-Design-System-v1.0?node-id=14089-118395&t=G5IKDvYHpwU0vOFq-0})
13
13
  *
14
14
  * @todo `mobile styling` - awaiting design, minor adjustments have been made - 1/2/25 ...
15
15
  */
16
- export declare class SofNavPanelComponent implements OnInit {
16
+ export declare class SofNavPanelComponent implements OnInit, OnChanges {
17
17
  /**
18
18
  * Component Input (required) - Navigation node data
19
19
  * @see {@link NavPanelNode}
@@ -49,7 +49,7 @@ export declare class SofNavPanelComponent implements OnInit {
49
49
  * @note this is the element which has the apps 'main' scrollbar.
50
50
  */
51
51
  sidenavContent: MatSidenavContent;
52
- /** This is the navpanel element */
52
+ /** This is the navPanel element */
53
53
  private navPanel;
54
54
  /** Utility for checking the matching state of media queries.*/
55
55
  private breakpointObserver;
@@ -60,11 +60,23 @@ export declare class SofNavPanelComponent implements OnInit {
60
60
  /** The previous break point state */
61
61
  private previousBreakpointState;
62
62
  /**
63
- * Constructor.
63
+ * Badge values signal
64
+ * @description Map of node index to badge value string
65
+ * @example { 0: '5', 2: '12' } - node at index 0 shows '5', node at index 2 shows '12'
64
66
  */
67
+ badgeValues: WritableSignal<Record<number, string>>;
68
+ /** The nodes with badge configs */
69
+ nodeBadges: WritableSignal<Array<NavNodeAvailableBadge>>;
70
+ /** Emits the nodes with badge configs */
71
+ availableNodeBadges: EventEmitter<Array<NavNodeAvailableBadge>>;
72
+ /**
73
+ * Constructor.
74
+ */
65
75
  constructor();
66
76
  /** On Init - Initialize the settings */
67
77
  ngOnInit(): void;
78
+ /** On Changes - find node badges and emit the results */
79
+ ngOnChanges(changes: SimpleChanges): void;
68
80
  /**
69
81
  * Initializes the nav panel settings, defaults will be set if `null` or `undefined`
70
82
  * @note The 'nullish coalescing assignment operator' `??=` assigns defaults for `boolean` and `number` types,
@@ -82,6 +94,37 @@ export declare class SofNavPanelComponent implements OnInit {
82
94
  * Configuring `scrollPositionRestoration` in the router module will not work either.
83
95
  */
84
96
  scrollToTop(): void;
97
+ /**
98
+ * Gets the badge value for a specific node index
99
+ * @param index The flattened node index (accounts for subnodes)
100
+ * @returns The badge value string or empty string if not found
101
+ */
102
+ getBadgeValue(index: number): string;
103
+ /**
104
+ * Updates the badge value for a specific node or subnode
105
+ * @param nodeIndex The parent node index
106
+ * @param value The badge value to set
107
+ * @param subIndex The subnode index (optional, for subnodes only)
108
+ * @example
109
+ * // Update a regular node badge
110
+ * updateBadgeValue(0, '5');
111
+ *
112
+ * // Update a subnode badge
113
+ * updateBadgeValue(6, '12', 0); // 6th node, 1st subnode
114
+ */
115
+ updateBadgeValue(nodeIndex: number, value: string, subIndex?: number): void;
116
+ /**
117
+ * Calculates the flattened index for a node or subnode
118
+ * @param nodeIndex The parent node index
119
+ * @param subIndex The subnode index (optional)
120
+ * @returns The flattened index accounting for all previous nodes and subnodes
121
+ */
122
+ getFlatIndex(nodeIndex: number, subIndex?: number): number;
123
+ /**
124
+ * Finds all nodes with badge configurations
125
+ * @returns Array of badge information objects
126
+ */
127
+ private findBadges;
85
128
  static ɵfac: i0.ɵɵFactoryDeclaration<SofNavPanelComponent, never>;
86
- static ɵcmp: i0.ɵɵComponentDeclaration<SofNavPanelComponent, "sof-nav-panel", never, { "nodes": { "alias": "nodes"; "required": true; }; "settings": { "alias": "settings"; "required": false; }; "scrollToTopOnNavigationEndEvent": { "alias": "scrollToTopOnNavigationEndEvent"; "required": false; }; "brandLogo": { "alias": "brandLogo"; "required": false; }; "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "isAutoShrink": { "alias": "isAutoShrink"; "required": false; }; }, { "isNavPanelOpenedEvent": "isNavPanelOpenedEvent"; }, never, ["[sof-nav-panel-main-content]"], true, never>;
129
+ static ɵcmp: i0.ɵɵComponentDeclaration<SofNavPanelComponent, "sof-nav-panel", never, { "nodes": { "alias": "nodes"; "required": true; }; "settings": { "alias": "settings"; "required": false; }; "scrollToTopOnNavigationEndEvent": { "alias": "scrollToTopOnNavigationEndEvent"; "required": false; }; "brandLogo": { "alias": "brandLogo"; "required": false; }; "title": { "alias": "title"; "required": false; }; "subtitle": { "alias": "subtitle"; "required": false; }; "isAutoShrink": { "alias": "isAutoShrink"; "required": false; }; }, { "isNavPanelOpenedEvent": "isNavPanelOpenedEvent"; "availableNodeBadges": "availableNodeBadges"; }, never, ["[sof-nav-panel-main-content]"], true, never>;
87
130
  }
@@ -7,6 +7,12 @@ export declare class SofSnackbarComponent {
7
7
  private _snackbarService;
8
8
  /** Snackbars array signal */
9
9
  snackbars: Signal<Array<_SnackbarInternal>>;
10
+ /** Position from top for the snackbar container */
11
+ positionTop: string | undefined;
12
+ /** Position from right for the snackbar container (default: 24px) */
13
+ positionRight: string;
14
+ /** Position from bottom for the snackbar container (default: 24px) */
15
+ positionBottom: string;
10
16
  /** Live announcer for screen reader wcag */
11
17
  private _liveAnnouncerService;
12
18
  /** Translation service */
@@ -35,5 +41,5 @@ export declare class SofSnackbarComponent {
35
41
  */
36
42
  handleAction(snackbar: _SnackbarInternal): void;
37
43
  static ɵfac: i0.ɵɵFactoryDeclaration<SofSnackbarComponent, never>;
38
- static ɵcmp: i0.ɵɵComponentDeclaration<SofSnackbarComponent, "sof-snackbar", never, {}, {}, never, never, true, never>;
44
+ static ɵcmp: i0.ɵɵComponentDeclaration<SofSnackbarComponent, "sof-snackbar", never, { "positionTop": { "alias": "positionTop"; "required": false; }; "positionRight": { "alias": "positionRight"; "required": false; }; "positionBottom": { "alias": "positionBottom"; "required": false; }; }, {}, never, never, true, never>;
39
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softheon/armature",
3
- "version": "19.23.1",
3
+ "version": "19.23.3",
4
4
  "dependencies": {
5
5
  "tslib": "^2.5.0"
6
6
  },