@agorapulse/ui-components 18.0.31 → 18.0.33

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.
Files changed (32) hide show
  1. package/agorapulse-ui-components-18.0.33.tgz +0 -0
  2. package/button/button.component.d.ts +3 -0
  3. package/esm2022/button/button.component.mjs +3 -3
  4. package/esm2022/nav-selector/nav-selector-category/nav-selector-category.component.mjs +5 -4
  5. package/esm2022/nav-selector/nav-selector-group/nav-selector-group.component.mjs +5 -4
  6. package/esm2022/nav-selector/nav-selector-leaf/nav-selector-leaf.component.mjs +13 -6
  7. package/esm2022/nav-selector/nav-selector-leaf/nav-selector-leaf.presenter.mjs +1 -2
  8. package/esm2022/nav-selector/nav-selector-leaf-action/nav-selector-leaf-action.component.mjs +13 -0
  9. package/esm2022/nav-selector/nav-selector-popover/nav-selector-popover-item.component.mjs +24 -6
  10. package/esm2022/nav-selector/nav-selector.component.mjs +5 -14
  11. package/esm2022/nav-selector/nav-selector.mjs +1 -1
  12. package/esm2022/nav-selector/nav-selector.state.mjs +4 -6
  13. package/esm2022/nav-selector/utils/leaf.utils.mjs +11 -1
  14. package/esm2022/nav-selector/utils/nav-selector.builder.mjs +3 -2
  15. package/esm2022/nav-selector/utils/nav-selector.multi-select.mjs +15 -8
  16. package/esm2022/nav-selector/utils/nav-selector.single-select.mjs +5 -2
  17. package/fesm2022/agorapulse-ui-components-button.mjs +2 -2
  18. package/fesm2022/agorapulse-ui-components-button.mjs.map +1 -1
  19. package/fesm2022/agorapulse-ui-components-nav-selector.mjs +83 -41
  20. package/fesm2022/agorapulse-ui-components-nav-selector.mjs.map +1 -1
  21. package/nav-selector/nav-selector-category/nav-selector-category.component.d.ts +3 -2
  22. package/nav-selector/nav-selector-group/nav-selector-group.component.d.ts +3 -2
  23. package/nav-selector/nav-selector-leaf/nav-selector-leaf.component.d.ts +4 -2
  24. package/nav-selector/nav-selector-leaf/nav-selector-leaf.presenter.d.ts +0 -1
  25. package/nav-selector/nav-selector-leaf-action/nav-selector-leaf-action.component.d.ts +7 -0
  26. package/nav-selector/nav-selector-popover/nav-selector-popover-item.component.d.ts +3 -1
  27. package/nav-selector/nav-selector.component.d.ts +3 -3
  28. package/nav-selector/nav-selector.d.ts +38 -4
  29. package/nav-selector/nav-selector.state.d.ts +1 -3
  30. package/nav-selector/utils/leaf.utils.d.ts +2 -1
  31. package/package.json +1 -1
  32. package/agorapulse-ui-components-18.0.31.tgz +0 -0
@@ -1,11 +1,12 @@
1
1
  import { ElementRef } from '@angular/core';
2
- import { InternalNavSelectorCategory } from '../nav-selector';
2
+ import { InternalNavSelectorCategory, NavSelectorLeafActionClickedEvent } from '../nav-selector';
3
3
  import { NavSelectorCategoryPresenter } from './nav-selector-category.presenter';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class NavSelectorCategoryComponent {
6
6
  private el;
7
7
  navSelectorCategoryPresenter: NavSelectorCategoryPresenter;
8
8
  category: import("@angular/core").InputSignal<InternalNavSelectorCategory>;
9
+ actionClicked: import("@angular/core").OutputEmitterRef<NavSelectorLeafActionClickedEvent>;
9
10
  foldSymbol: import("@angular/core").Signal<"chevron-down" | "chevron-up">;
10
11
  foldedWithDelay: import("@angular/core").WritableSignal<boolean>;
11
12
  animationState: import("@angular/core").Signal<"collapsed" | "expanded">;
@@ -22,5 +23,5 @@ export declare class NavSelectorCategoryComponent {
22
23
  maxHeight: import("@angular/core").WritableSignal<string>;
23
24
  private updateAliasBoundedClientRect;
24
25
  static ɵfac: i0.ɵɵFactoryDeclaration<NavSelectorCategoryComponent, never>;
25
- static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorCategoryComponent, "ap-nav-selector-category", never, { "category": { "alias": "category"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorCategoryComponent, "ap-nav-selector-category", never, { "category": { "alias": "category"; "required": true; "isSignal": true; }; }, { "actionClicked": "actionClicked"; }, never, never, true, never>;
26
27
  }
@@ -1,11 +1,12 @@
1
1
  import { ElementRef } from '@angular/core';
2
- import { InternalNavSelectorGroup } from '../nav-selector';
2
+ import { InternalNavSelectorGroup, NavSelectorLeafActionClickedEvent } from '../nav-selector';
3
3
  import { NavSelectorGroupPresenter } from './nav-selector-group.presenter';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class NavSelectorGroupComponent {
6
6
  private el;
7
7
  navSelectorGroupPresenter: NavSelectorGroupPresenter;
8
8
  group: import("@angular/core").InputSignal<InternalNavSelectorGroup>;
9
+ actionClicked: import("@angular/core").OutputEmitterRef<NavSelectorLeafActionClickedEvent>;
9
10
  foldSymbol: import("@angular/core").Signal<"chevron-down" | "chevron-up">;
10
11
  aliasEl: import("@angular/core").Signal<ElementRef<any> | undefined>;
11
12
  aliasBoundedClientRect: import("@angular/core").WritableSignal<{
@@ -31,5 +32,5 @@ export declare class NavSelectorGroupComponent {
31
32
  unfold(event: Event): void;
32
33
  private updateAliasBoundedClientRect;
33
34
  static ɵfac: i0.ɵɵFactoryDeclaration<NavSelectorGroupComponent, never>;
34
- static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorGroupComponent, "ap-nav-selector-group", never, { "group": { "alias": "group"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
35
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorGroupComponent, "ap-nav-selector-group", never, { "group": { "alias": "group"; "required": true; "isSignal": true; }; }, { "actionClicked": "actionClicked"; }, never, never, true, never>;
35
36
  }
@@ -1,11 +1,12 @@
1
1
  import { ElementRef } from '@angular/core';
2
- import { InternalNavSelectorLeaf, InternalNavSelectorLeafDetails } from '../nav-selector';
2
+ import { InternalNavSelectorLeaf, InternalNavSelectorLeafAction, InternalNavSelectorLeafDetails, NavSelectorLeafActionClickedEvent } from '../nav-selector';
3
3
  import { NavSelectorLeafPresenter } from './nav-selector-leaf.presenter';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class NavSelectorLeafComponent {
6
6
  private el;
7
7
  navSelectorLeafPresenter: NavSelectorLeafPresenter;
8
8
  leaf: import("@angular/core").InputSignal<InternalNavSelectorLeaf>;
9
+ actionClicked: import("@angular/core").OutputEmitterRef<NavSelectorLeafActionClickedEvent>;
9
10
  initial: import("@angular/core").Signal<string>;
10
11
  foldSymbol: import("@angular/core").Signal<"chevron-down" | "chevron-up">;
11
12
  focused: import("@angular/core").WritableSignal<boolean>;
@@ -37,7 +38,8 @@ export declare class NavSelectorLeafComponent {
37
38
  fold(event: Event): void;
38
39
  unfold(event: Event): void;
39
40
  onDetailClicked(event: Event, detail: InternalNavSelectorLeafDetails): void;
41
+ onActionClicked(action: InternalNavSelectorLeafAction): void;
40
42
  private updateAliasBoundedClientRect;
41
43
  static ɵfac: i0.ɵɵFactoryDeclaration<NavSelectorLeafComponent, never>;
42
- static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorLeafComponent, "ap-nav-selector-leaf", never, { "leaf": { "alias": "leaf"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
44
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorLeafComponent, "ap-nav-selector-leaf", never, { "leaf": { "alias": "leaf"; "required": true; "isSignal": true; }; }, { "actionClicked": "actionClicked"; }, never, never, true, never>;
43
45
  }
@@ -6,7 +6,6 @@ export declare class NavSelectorLeafPresenter {
6
6
  expanded: import("@angular/core").Signal<boolean>;
7
7
  texts: import("@angular/core").Signal<import("../nav-selector").NavSelectorTranslatedTexts>;
8
8
  isMultipleModeEnabled: import("@angular/core").Signal<boolean>;
9
- leafActionProjection: import("@angular/core").Signal<readonly import("@angular/core").TemplateRef<unknown>[] | undefined>;
10
9
  expandedAfterDelay: import("@angular/core").Signal<boolean>;
11
10
  constructor(navSelectorState: NavSelectorState);
12
11
  selectLeaf(leaf: InternalNavSelectorLeaf): void;
@@ -0,0 +1,7 @@
1
+ import { InternalNavSelectorLeafAction } from '../nav-selector';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NavSelectorLeafActionComponent {
4
+ action: import("@angular/core").InputSignal<InternalNavSelectorLeafAction>;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<NavSelectorLeafActionComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorLeafActionComponent, "ap-nav-selector-leaf-action", never, { "action": { "alias": "action"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
7
+ }
@@ -4,9 +4,11 @@ import * as i1 from "@agorapulse/ui-components/directives";
4
4
  export declare class NavSelectorPopoverItemComponent {
5
5
  selected: import("@angular/core").InputSignal<boolean>;
6
6
  disabled: import("@angular/core").InputSignal<boolean>;
7
+ locked: import("@angular/core").InputSignal<boolean>;
8
+ id: import("@angular/core").InputSignal<string | null>;
7
9
  name: import("@angular/core").InputSignal<string>;
8
10
  ariaLabel: import("@angular/core").InputSignal<string | undefined>;
9
11
  readonly baseButtonDirective: BaseButtonDirective;
10
12
  static ɵfac: i0.ɵɵFactoryDeclaration<NavSelectorPopoverItemComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorPopoverItemComponent, "ap-nav-selector-popover-item", never, { "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": true; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BaseButtonDirective; inputs: {}; outputs: {}; }]>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorPopoverItemComponent, "ap-nav-selector-popover-item", never, { "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "locked": { "alias": "locked"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": true; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.BaseButtonDirective; inputs: {}; outputs: {}; }]>;
12
14
  }
@@ -1,5 +1,5 @@
1
1
  import { ElementRef, OnInit, TemplateRef } from '@angular/core';
2
- import { NavSelectorEntry, NavSelectorTranslatedTexts } from './nav-selector';
2
+ import { NavSelectorEntry, NavSelectorLeafActionClickedEvent, NavSelectorTranslatedTexts } from './nav-selector';
3
3
  import { NavSelectorState } from './nav-selector.state';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class NavSelectorComponent implements OnInit {
@@ -16,10 +16,10 @@ export declare class NavSelectorComponent implements OnInit {
16
16
  forceExpanded: import("@angular/core").InputSignal<boolean>;
17
17
  expandedStateLocalStorageKey: import("@angular/core").InputSignal<string | undefined>;
18
18
  selectedEntryUids: import("@angular/core").ModelSignal<string[]>;
19
+ actionClicked: import("@angular/core").OutputEmitterRef<NavSelectorLeafActionClickedEvent>;
19
20
  headerProjection: import("@angular/core").Signal<TemplateRef<unknown> | undefined>;
20
21
  footerProjection: import("@angular/core").Signal<TemplateRef<unknown> | undefined>;
21
22
  displayFooter: import("@angular/core").Signal<boolean>;
22
- leafActionProjection: import("@angular/core").Signal<readonly TemplateRef<unknown>[]>;
23
23
  expansionState: import("@angular/core").Signal<"expanded" | "minified">;
24
24
  onExpansionStateChange: import("@angular/core").OutputEmitterRef<{
25
25
  expanded: boolean;
@@ -35,5 +35,5 @@ export declare class NavSelectorComponent implements OnInit {
35
35
  private initializeExpandedState;
36
36
  clickExpandButton(): void;
37
37
  static ɵfac: i0.ɵɵFactoryDeclaration<NavSelectorComponent, never>;
38
- static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorComponent, "ap-nav-selector", never, { "navSelectorEntries": { "alias": "navSelectorEntries"; "required": true; "isSignal": true; }; "translatedTexts": { "alias": "translatedTexts"; "required": true; "isSignal": true; }; "multipleModeEnabled": { "alias": "multipleModeEnabled"; "required": false; "isSignal": true; }; "detailsDisplayedLimit": { "alias": "detailsDisplayedLimit"; "required": false; "isSignal": true; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; "forceExpanded": { "alias": "forceExpanded"; "required": false; "isSignal": true; }; "expandedStateLocalStorageKey": { "alias": "expandedStateLocalStorageKey"; "required": false; "isSignal": true; }; "selectedEntryUids": { "alias": "selectedEntryUids"; "required": true; "isSignal": true; }; }, { "selectedEntryUids": "selectedEntryUidsChange"; "onExpansionStateChange": "onExpansionStateChange"; }, ["headerProjection", "footerProjection", "leafActionProjection"], never, true, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<NavSelectorComponent, "ap-nav-selector", never, { "navSelectorEntries": { "alias": "navSelectorEntries"; "required": true; "isSignal": true; }; "translatedTexts": { "alias": "translatedTexts"; "required": true; "isSignal": true; }; "multipleModeEnabled": { "alias": "multipleModeEnabled"; "required": false; "isSignal": true; }; "detailsDisplayedLimit": { "alias": "detailsDisplayedLimit"; "required": false; "isSignal": true; }; "embedded": { "alias": "embedded"; "required": false; "isSignal": true; }; "forceExpanded": { "alias": "forceExpanded"; "required": false; "isSignal": true; }; "expandedStateLocalStorageKey": { "alias": "expandedStateLocalStorageKey"; "required": false; "isSignal": true; }; "selectedEntryUids": { "alias": "selectedEntryUids"; "required": true; "isSignal": true; }; }, { "selectedEntryUids": "selectedEntryUidsChange"; "actionClicked": "actionClicked"; "onExpansionStateChange": "onExpansionStateChange"; }, ["headerProjection", "footerProjection"], never, true, never>;
39
39
  }
@@ -1,4 +1,10 @@
1
1
  import { AvatarNetwork } from '@agorapulse/ui-components/avatar';
2
+ export type NavSelectorLeafActionClickedEvent = {
3
+ /** Name of the action that has been clicked */
4
+ actionName: string;
5
+ /** Leaf on which the action has been clicked */
6
+ leafUid: string;
7
+ };
2
8
  /**
3
9
  * As translation is not available in the DS, this all translations needed
4
10
  */
@@ -31,6 +37,21 @@ export type NavSelectorBaseNode = {
31
37
  /** Displayed name of the node */
32
38
  alias: string;
33
39
  };
40
+ /**
41
+ * Represent an action that can be performed on a leaf
42
+ */
43
+ export type NavSelectorLeafAction = {
44
+ /** Unique identifier of the action, used for click tracking */
45
+ id: string | null;
46
+ /** Action label to display */
47
+ label: string;
48
+ /** Technical name of the action, used to identify the action */
49
+ name: string;
50
+ /** Optional icon to display on the action */
51
+ icon: string | null;
52
+ /** Optional Status */
53
+ status: 'disabled' | 'locked' | null;
54
+ };
34
55
  /**
35
56
  * Represent final entry of the nav selector
36
57
  */
@@ -50,6 +71,8 @@ export type NavSelectorLeaf = {
50
71
  featureLocked: boolean;
51
72
  /** Sub elements of the leaf, they are optional */
52
73
  details: NavSelectorLeafDetails[];
74
+ /** Optional actions that can be performed on the leaf */
75
+ actions: NavSelectorLeafAction[];
53
76
  type: 'LEAF';
54
77
  } & NavSelectorBaseNode;
55
78
  /**
@@ -102,6 +125,18 @@ export type NodeAccessibility = {
102
125
  /** In a tree, the deep level, starting from 1 */
103
126
  ariaLevel: number;
104
127
  };
128
+ export type InternalNavSelectorLeafAction = {
129
+ /** Unique identifier of the action, used for click tracking */
130
+ id: string | null;
131
+ /** Action label to display */
132
+ label: string;
133
+ /** Technical name of the action, used to identify the action */
134
+ name: string;
135
+ /** Optional icon to display on the action */
136
+ icon: string | null;
137
+ /** Optional Status */
138
+ status: 'disabled' | 'locked' | null;
139
+ };
105
140
  /**
106
141
  * Represent a node
107
142
  */
@@ -157,11 +192,10 @@ export type InternalNavSelectorCategory = {
157
192
  * Represent final entry of the nav selector
158
193
  */
159
194
  export type InternalNavSelectorLeaf = {
160
- /**
161
- * Indicates if the actions dropdown could be display. Should not be display if the leaf has an error status.
162
- * Note: only working if actions are projected in the nav selector component
163
- */
195
+ /** Indicates if the actions dropdown could be display. Should not be display if the leaf has an error status. */
164
196
  actionsDisplayable: boolean;
197
+ /** Actions that can be performed on the leaf */
198
+ actions: InternalNavSelectorLeafAction[];
165
199
  /** Picture url to display on the avatar, optional */
166
200
  pictureUrl: string | null;
167
201
  /** Indicates if the counter could be display. The leaf should not be disabled, feature locked or has token invalid */
@@ -1,4 +1,3 @@
1
- import { TemplateRef } from '@angular/core';
2
1
  import { InternalNavSelectorEntry, InternalNavSelectorLeaf, InternalNavSelectorLeafDetails, NavSelectorEntry, NavSelectorTranslatedTexts } from './nav-selector';
3
2
  import * as i0 from "@angular/core";
4
3
  /**
@@ -15,9 +14,9 @@ export declare class NavSelectorState {
15
14
  search: import("@angular/core").WritableSignal<string>;
16
15
  noResults: import("@angular/core").Signal<boolean>;
17
16
  texts: import("@angular/core").Signal<NavSelectorTranslatedTexts>;
18
- leafActionProjection: import("@angular/core").WritableSignal<readonly TemplateRef<unknown>[] | undefined>;
19
17
  expanded: import("@angular/core").WritableSignal<boolean>;
20
18
  expandedAfterDelay: import("@angular/core").WritableSignal<boolean>;
19
+ previousSelectedUids: string[];
21
20
  selectedUidsChangeCallback: ((selectedUids: string[]) => void) | null;
22
21
  constructor();
23
22
  updateMultiModeEnabled(enabled: boolean): void;
@@ -40,7 +39,6 @@ export declare class NavSelectorState {
40
39
  onArrowUp(): void;
41
40
  private collectSelectedUids;
42
41
  private getFoldingOptions;
43
- updateLeafAction(leafActionProjection: ReadonlyArray<TemplateRef<unknown>>): void;
44
42
  fold(entry: InternalNavSelectorEntry): void;
45
43
  unfold(entry: InternalNavSelectorEntry): void;
46
44
  updateDetailsDisplayedLimit(detailsDisplayedLimit: number): void;
@@ -1,4 +1,4 @@
1
- import { InternalNavSelectorLeaf } from '../nav-selector';
1
+ import { InternalNavSelectorCategory, InternalNavSelectorEntry, InternalNavSelectorGroup, InternalNavSelectorLeaf } from '../nav-selector';
2
2
  /**
3
3
  * Utility type to extract keys of an object that are of type string, number or symbol which are the only type allowed in a Record
4
4
  */
@@ -15,4 +15,5 @@ export declare const isInternalNavSelectorEntryALeafFocusable: (leaf: InternalNa
15
15
  parentFolded: boolean;
16
16
  multipleMode: boolean;
17
17
  }) => boolean;
18
+ export declare const computeFolded: (entry: InternalNavSelectorGroup | InternalNavSelectorCategory, children: InternalNavSelectorEntry[]) => boolean;
18
19
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agorapulse/ui-components",
3
3
  "description": "Agorapulse UI Components Library",
4
- "version": "18.0.31",
4
+ "version": "18.0.33",
5
5
  "author": "Benoit Hediard",
6
6
  "repository": {
7
7
  "type": "git",