@agorapulse/ui-components 18.0.9 → 18.0.11

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 (65) hide show
  1. package/agorapulse-ui-components-18.0.11.tgz +0 -0
  2. package/esm2022/datepicker/datepicker.component.mjs +1 -1
  3. package/esm2022/index.mjs +2 -1
  4. package/esm2022/input-search/input-search.component.mjs +5 -4
  5. package/esm2022/nav-selector/agorapulse-ui-components-nav-selector.mjs +5 -0
  6. package/esm2022/nav-selector/directives/tree-node-accessibility.directive.mjs +30 -0
  7. package/esm2022/nav-selector/nav-selector-category/nav-selector-category.component.mjs +81 -0
  8. package/esm2022/nav-selector/nav-selector-category/nav-selector-category.presenter.mjs +29 -0
  9. package/esm2022/nav-selector/nav-selector-group/nav-selector-group.component.mjs +142 -0
  10. package/esm2022/nav-selector/nav-selector-group/nav-selector-group.presenter.mjs +31 -0
  11. package/esm2022/nav-selector/nav-selector-leaf/nav-selector-leaf.component.mjs +240 -0
  12. package/esm2022/nav-selector/nav-selector-leaf/nav-selector-leaf.presenter.mjs +35 -0
  13. package/esm2022/nav-selector/nav-selector-leaf-detail/nav-selector-leaf-detail.component.mjs +39 -0
  14. package/esm2022/nav-selector/nav-selector-leaf-detail/nav-selector-leaf-detail.presenter.mjs +18 -0
  15. package/esm2022/nav-selector/nav-selector-leaf-details/nav-selector-leaf-details.component.mjs +92 -0
  16. package/esm2022/nav-selector/nav-selector-leaf-details/nav-selector-leaf-details.presenter.mjs +31 -0
  17. package/esm2022/nav-selector/nav-selector.component.mjs +123 -0
  18. package/esm2022/nav-selector/nav-selector.mjs +9 -0
  19. package/esm2022/nav-selector/nav-selector.state.mjs +173 -0
  20. package/esm2022/nav-selector/public_api.mjs +2 -0
  21. package/esm2022/nav-selector/utils/leaf.utils.mjs +10 -0
  22. package/esm2022/nav-selector/utils/nav-selector.accessibility.mjs +171 -0
  23. package/esm2022/nav-selector/utils/nav-selector.builder.mjs +263 -0
  24. package/esm2022/nav-selector/utils/nav-selector.filter.mjs +102 -0
  25. package/esm2022/nav-selector/utils/nav-selector.folding.mjs +219 -0
  26. package/esm2022/nav-selector/utils/nav-selector.minifying.mjs +50 -0
  27. package/esm2022/nav-selector/utils/nav-selector.multi-select.mjs +208 -0
  28. package/esm2022/nav-selector/utils/nav-selector.single-select.mjs +91 -0
  29. package/esm2022/nav-selector/utils/nav-selector.view-more.mjs +98 -0
  30. package/fesm2022/agorapulse-ui-components-datepicker.mjs.map +1 -1
  31. package/fesm2022/agorapulse-ui-components-input-search.mjs +4 -3
  32. package/fesm2022/agorapulse-ui-components-input-search.mjs.map +1 -1
  33. package/fesm2022/agorapulse-ui-components-nav-selector.mjs +2198 -0
  34. package/fesm2022/agorapulse-ui-components-nav-selector.mjs.map +1 -0
  35. package/fesm2022/agorapulse-ui-components.mjs +1 -0
  36. package/fesm2022/agorapulse-ui-components.mjs.map +1 -1
  37. package/index.d.ts +1 -0
  38. package/input-search/input-search.component.d.ts +1 -1
  39. package/nav-selector/directives/tree-node-accessibility.directive.d.ts +9 -0
  40. package/nav-selector/index.d.ts +5 -0
  41. package/nav-selector/nav-selector-category/nav-selector-category.component.d.ts +16 -0
  42. package/nav-selector/nav-selector-category/nav-selector-category.presenter.d.ts +14 -0
  43. package/nav-selector/nav-selector-group/nav-selector-group.component.d.ts +29 -0
  44. package/nav-selector/nav-selector-group/nav-selector-group.presenter.d.ts +17 -0
  45. package/nav-selector/nav-selector-leaf/nav-selector-leaf.component.d.ts +51 -0
  46. package/nav-selector/nav-selector-leaf/nav-selector-leaf.presenter.d.ts +19 -0
  47. package/nav-selector/nav-selector-leaf-detail/nav-selector-leaf-detail.component.d.ts +13 -0
  48. package/nav-selector/nav-selector-leaf-detail/nav-selector-leaf-detail.presenter.d.ts +10 -0
  49. package/nav-selector/nav-selector-leaf-details/nav-selector-leaf-details.component.d.ts +24 -0
  50. package/nav-selector/nav-selector-leaf-details/nav-selector-leaf-details.presenter.d.ts +14 -0
  51. package/nav-selector/nav-selector.component.d.ts +29 -0
  52. package/nav-selector/nav-selector.d.ts +220 -0
  53. package/nav-selector/nav-selector.state.d.ts +47 -0
  54. package/nav-selector/public_api.d.ts +2 -0
  55. package/nav-selector/utils/leaf.utils.d.ts +5 -0
  56. package/nav-selector/utils/nav-selector.accessibility.d.ts +52 -0
  57. package/nav-selector/utils/nav-selector.builder.d.ts +32 -0
  58. package/nav-selector/utils/nav-selector.filter.d.ts +30 -0
  59. package/nav-selector/utils/nav-selector.folding.d.ts +47 -0
  60. package/nav-selector/utils/nav-selector.minifying.d.ts +27 -0
  61. package/nav-selector/utils/nav-selector.multi-select.d.ts +54 -0
  62. package/nav-selector/utils/nav-selector.single-select.d.ts +15 -0
  63. package/nav-selector/utils/nav-selector.view-more.d.ts +30 -0
  64. package/package.json +13 -7
  65. package/agorapulse-ui-components-18.0.9.tgz +0 -0
@@ -0,0 +1,32 @@
1
+ import { InternalNavSelectorEntry, NavSelectorEntry } from '../nav-selector';
2
+ /**
3
+ * NavSelectorBuilder is a utility class that builds the NavSelector entries for single and multiple select modes.
4
+ * It also checks the structure of the entries to ensure they are valid.
5
+ */
6
+ export declare class NavSelectorBuilder {
7
+ private static LEAF_LOGICS_PRIORITY;
8
+ /**
9
+ * Builds the NavSelector entries for single select mode.
10
+ * @param entries nav selector entries
11
+ * @param selectedEntryUid selected entry uid
12
+ * @param detailsDisplayedLimit number of details displayed limit
13
+ */
14
+ static build(entries: NavSelectorEntry[], selectedEntryUid: string | null, detailsDisplayedLimit: number): InternalNavSelectorEntry[];
15
+ /**
16
+ * Builds the NavSelector entries for multiple select mode.
17
+ * @param entries nav selector entries
18
+ * @param selectedEntryUids selected entry uids
19
+ * @param detailsDisplayedLimit number of details displayed limit
20
+ */
21
+ static buildInMultipleMode(entries: NavSelectorEntry[], selectedEntryUids: string[] | null, detailsDisplayedLimit: number): InternalNavSelectorEntry[];
22
+ private static structureChecker;
23
+ private static buildEntries;
24
+ private static buildEntry;
25
+ private static buildCategoryChildren;
26
+ private static buildCategory;
27
+ private static buildGroupChildren;
28
+ private static buildGroup;
29
+ private static buildLeaf;
30
+ private static buildLeafDetail;
31
+ private static isLeafLogicValid;
32
+ }
@@ -0,0 +1,30 @@
1
+ import { InternalNavSelectorEntry } from '../nav-selector';
2
+ /**
3
+ * NavSelectorFilter is a utility class that provides methods to filter entries
4
+ */
5
+ export declare class NavSelectorFilter {
6
+ /**
7
+ * Filters the entries based on the search string
8
+ *
9
+ * The search string is normalized and lowercase and trimmed.
10
+ *
11
+ * If a category matches the search string, all its children are unfolded, marked as focusable, and not hidden.
12
+ *
13
+ * If a group matches the search string, the group is unfolded and all its children are unfolded, marked as focusable, and not hidden.
14
+ *
15
+ * If a leaf matches the search string, it is marked as not hidden and focusable.
16
+ *
17
+ * Else the entry marked as hidden and not focusable.
18
+ *
19
+ * It also determines whenever counter and token invalid should be displayed on groups and leaves.
20
+ *
21
+ * @param entries The entries to filter.
22
+ * @param search The search string.
23
+ * @returns The filtered entries.
24
+ */
25
+ static filter(entries: InternalNavSelectorEntry[], search: string): InternalNavSelectorEntry[];
26
+ private static filterEntries;
27
+ private static recursivelyUnfoldEntry;
28
+ private static matches;
29
+ private static cleanValue;
30
+ }
@@ -0,0 +1,47 @@
1
+ import { InternalNavSelectorEntry } from '../nav-selector';
2
+ /**
3
+ * Class to handle the folding and unfolding of nav selector entries.
4
+ */
5
+ export declare class NavSelectorFolding {
6
+ /**
7
+ * Toggle the folding state of an entry.
8
+ *
9
+ * @see {@link NavSelectorFolding.fold} and {@link NavSelectorFolding.unfold} for more information on folding and unfolding.
10
+ *
11
+ * @param entries nav selector entries
12
+ * @param entryUid the entry uid to toggle
13
+ * @param minified true if the nav selector is minified. Needed for leaf as they are not foldable in minified mode
14
+ */
15
+ static toggleFolding<T extends InternalNavSelectorEntry>(entries: T[], entryUid: string, minified: boolean): InternalNavSelectorEntry[];
16
+ /**
17
+ * Fold an entry.
18
+ *
19
+ * Set unfocusable on all children of the folded entry.
20
+ * Compute whenever the counter and token invalid should be displayed on groups and leaves.
21
+ *
22
+ * @param entries nav selector entries
23
+ * @param entryUid the entry uid to fold
24
+ * @param minified true if the nav selector is minified. Needed for leaf as they are not foldable in minified mode
25
+ */
26
+ static fold<T extends InternalNavSelectorEntry>(entries: T[], entryUid: string, minified: boolean): InternalNavSelectorEntry[];
27
+ /**
28
+ * Unfold an entry.
29
+ *
30
+ * Set focusable on all children of the folded entry.
31
+ * Compute whenever the counter and token invalid should be displayed on groups and leaves.
32
+ *
33
+ * @param entries nav selector entries
34
+ * @param entryUid the entry uid to unfold
35
+ * @param minified true if the nav selector is minified. Needed for leaf as they are not foldable in minified mode
36
+ */
37
+ static unfold<T extends InternalNavSelectorEntry>(entries: T[], entryUid: string, minified: boolean): InternalNavSelectorEntry[];
38
+ private static toggleEntryFolding;
39
+ private static foldEntry;
40
+ private static unfoldEntry;
41
+ private static foldCategory;
42
+ private static unfoldCategory;
43
+ private static foldGroup;
44
+ private static unfoldGroup;
45
+ private static foldLeaf;
46
+ private static unfoldLeaf;
47
+ }
@@ -0,0 +1,27 @@
1
+ import { InternalNavSelectorEntry } from '../nav-selector';
2
+ /**
3
+ * NavSelectorMinifying is a utility class that provides methods to apply rules on entries when minifying or expanded nav selector.
4
+ */
5
+ export declare class NavSelectorMinifying {
6
+ /**
7
+ * When minifying the nav selector, compute the focusable state of the entries.
8
+ *
9
+ * Leaf are not focusable in any error state when minified.
10
+ * Detail are not focusable when minified.
11
+ *
12
+ * @param entries The entries to minify.
13
+ * @returns The modified entries.
14
+ */
15
+ static minify<T extends InternalNavSelectorEntry>(entries: T[]): InternalNavSelectorEntry[];
16
+ /**
17
+ * When expanding the nav selector, compute the focusable state of the entries.
18
+ *
19
+ * Leaf are not focusable in disabled state when expanded.
20
+ * Detail are focusable when expanded.
21
+ *
22
+ * @param entries The entries to minify.
23
+ * @returns The modified entries.
24
+ */
25
+ static expand<T extends InternalNavSelectorEntry>(entries: T[]): InternalNavSelectorEntry[];
26
+ private static compute;
27
+ }
@@ -0,0 +1,54 @@
1
+ import { InternalNavSelectorEntry } from '../nav-selector';
2
+ /**
3
+ * NavSelectorMultiSelect is a utility class that provides methods to select an entry in multiple mode.
4
+ */
5
+ export declare class NavSelectorMultiSelect {
6
+ /**
7
+ * Select an entry in multiple mode.
8
+ *
9
+ * Categories are not selectable.
10
+ *
11
+ * Groups and leaves are selectable.
12
+ *
13
+ * Groups may be in undetermined state if some of their children are selected and some are not.
14
+ * @param entries nav selector entries
15
+ * @param entryUid the entry uid to select
16
+ */
17
+ static selectInMultipleMode(entries: InternalNavSelectorEntry[], entryUid: string): InternalNavSelectorEntry[];
18
+ /**
19
+ * Select only a leaf in multiple mode.
20
+ *
21
+ * Categories are not selectable.
22
+ *
23
+ * Groups may be in undetermined state if some of their children are selected and some are not.
24
+ * @param entries nav selector entries
25
+ * @param entryUid the entry uid to select
26
+ */
27
+ static selectOnlyALeafInMultipleMode<T extends InternalNavSelectorEntry>(entries: T[], entryUid: string): InternalNavSelectorEntry[];
28
+ /**
29
+ * Select all entries in multiple mode.
30
+ *
31
+ * Categories are not selectable.
32
+ *
33
+ * Groups and leaves are selectable.
34
+ * @param entries nav selector entries
35
+ */
36
+ static selectAll(entries: InternalNavSelectorEntry[]): InternalNavSelectorEntry[];
37
+ /**
38
+ * Unselect all entries in multiple mode.
39
+ *
40
+ * Categories are not selectable.
41
+ *
42
+ * Groups and leaves are selectable.
43
+ * @param entries nav selector entries
44
+ */
45
+ static unselectAll(entries: InternalNavSelectorEntry[]): InternalNavSelectorEntry[];
46
+ private static selectALeafInMultipleMode;
47
+ private static selectACategoryInMultipleMode;
48
+ private static selectAGroupInMultipleMode;
49
+ private static toggleSelectLeaf;
50
+ private static selectLeafs;
51
+ private static unselectLeafs;
52
+ private static unselectChildren;
53
+ private static selectChildren;
54
+ }
@@ -0,0 +1,15 @@
1
+ import { InternalNavSelectorEntry } from '../nav-selector';
2
+ /**
3
+ * NavSelectorSingleSelect is a utility class that provides methods to select a single entry in a nav selector.
4
+ */
5
+ export declare class NavSelectorSingleSelect {
6
+ /**
7
+ * Selects a single entry in the nav selector.
8
+ * @param entries nav selector entries
9
+ * @param entryUid the entry uid to select
10
+ */
11
+ static select<T extends InternalNavSelectorEntry>(entries: T[], entryUid: string): InternalNavSelectorEntry[];
12
+ private static selectALeaf;
13
+ private static selectALeafWithDetails;
14
+ private static selectALeafWithoutDetails;
15
+ }
@@ -0,0 +1,30 @@
1
+ import { InternalNavSelectorEntry } from '../nav-selector';
2
+ /**
3
+ * Utility class to handle the view more functionality on leaves
4
+ */
5
+ export declare class NavSelectorViewMore {
6
+ /**
7
+ * Change the view more details displayed limit on leaves
8
+ * @param entries nav selector entries
9
+ * @param limit the number of details we want to display by default
10
+ */
11
+ static changeViewMoreDetailsDisplayedLimit<T extends InternalNavSelectorEntry>(entries: T[], limit: number): InternalNavSelectorEntry[];
12
+ /**
13
+ * We want to display all details of the leaf
14
+ *
15
+ * set viewMoreDisplayed to false and set all details as focusable
16
+ *
17
+ * @param entries nav selector entries
18
+ * @param leafUid the uid of the leaf we want to view all details
19
+ */
20
+ static viewMore<T extends InternalNavSelectorEntry>(entries: T[], leafUid: string): InternalNavSelectorEntry[];
21
+ /**
22
+ * We want to display only the number of details of the leaf corresponding to the viewMoreDetailsDisplayedLimit
23
+ *
24
+ * set viewMoreDisplayed to true and set only the details with an index lower than the limit as focusable
25
+ *
26
+ * @param entries nav selector entries
27
+ * @param uid the uid of the leaf we want to view all details
28
+ */
29
+ static viewLess<T extends InternalNavSelectorEntry>(entries: T[], uid: string): InternalNavSelectorEntry[];
30
+ }
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.9",
4
+ "version": "18.0.11",
5
5
  "author": "Benoit Hediard",
6
6
  "repository": {
7
7
  "type": "git",
@@ -49,18 +49,18 @@
49
49
  "esm": "./esm2022/autocomplete/agorapulse-ui-components-autocomplete.mjs",
50
50
  "default": "./fesm2022/agorapulse-ui-components-autocomplete.mjs"
51
51
  },
52
- "./badge": {
53
- "types": "./badge/index.d.ts",
54
- "esm2022": "./esm2022/badge/agorapulse-ui-components-badge.mjs",
55
- "esm": "./esm2022/badge/agorapulse-ui-components-badge.mjs",
56
- "default": "./fesm2022/agorapulse-ui-components-badge.mjs"
57
- },
58
52
  "./avatar": {
59
53
  "types": "./avatar/index.d.ts",
60
54
  "esm2022": "./esm2022/avatar/agorapulse-ui-components-avatar.mjs",
61
55
  "esm": "./esm2022/avatar/agorapulse-ui-components-avatar.mjs",
62
56
  "default": "./fesm2022/agorapulse-ui-components-avatar.mjs"
63
57
  },
58
+ "./badge": {
59
+ "types": "./badge/index.d.ts",
60
+ "esm2022": "./esm2022/badge/agorapulse-ui-components-badge.mjs",
61
+ "esm": "./esm2022/badge/agorapulse-ui-components-badge.mjs",
62
+ "default": "./fesm2022/agorapulse-ui-components-badge.mjs"
63
+ },
64
64
  "./button": {
65
65
  "types": "./button/index.d.ts",
66
66
  "esm2022": "./esm2022/button/agorapulse-ui-components-button.mjs",
@@ -175,6 +175,12 @@
175
175
  "esm": "./esm2022/modal/agorapulse-ui-components-modal.mjs",
176
176
  "default": "./fesm2022/agorapulse-ui-components-modal.mjs"
177
177
  },
178
+ "./nav-selector": {
179
+ "types": "./nav-selector/index.d.ts",
180
+ "esm2022": "./esm2022/nav-selector/agorapulse-ui-components-nav-selector.mjs",
181
+ "esm": "./esm2022/nav-selector/agorapulse-ui-components-nav-selector.mjs",
182
+ "default": "./fesm2022/agorapulse-ui-components-nav-selector.mjs"
183
+ },
178
184
  "./neo-datepicker": {
179
185
  "types": "./neo-datepicker/index.d.ts",
180
186
  "esm2022": "./esm2022/neo-datepicker/agorapulse-ui-components-neo-datepicker.mjs",
Binary file