reneco-hierarchized-picker 0.4.3-beta.8 → 0.5.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.
Files changed (34) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/reneco-hierarchized-picker.cjs.js +1 -1
  3. package/dist/cjs/reneco-hierarchized-picker_2.cjs.entry.js +509 -270
  4. package/dist/collection/components/hierarchized-picker/hierarchized-picker.css +10 -2
  5. package/dist/collection/components/hierarchized-picker/hierarchized-picker.js +391 -130
  6. package/dist/collection/components/search-input/search-input.js +1 -3
  7. package/dist/collection/components/treejs/index.js +49 -50
  8. package/dist/collection/core/options-manager.js +2 -0
  9. package/dist/collection/features/events/focus-handlers.js +15 -11
  10. package/dist/collection/features/keyboard-navigation/keyboard-navigation.js +83 -56
  11. package/dist/collection/features/tree/tree-utils.js +12 -3
  12. package/dist/collection/utils/conf-helper.js +4 -0
  13. package/dist/collection/utils/constants.js +4 -3
  14. package/dist/collection/utils/theme-utils.js +1 -0
  15. package/dist/custom-elements/index.js +509 -270
  16. package/dist/esm/loader.js +1 -1
  17. package/dist/esm/reneco-hierarchized-picker.js +1 -1
  18. package/dist/esm/reneco-hierarchized-picker_2.entry.js +509 -270
  19. package/dist/esm-es5/loader.js +1 -1
  20. package/dist/esm-es5/reneco-hierarchized-picker.js +1 -1
  21. package/dist/esm-es5/reneco-hierarchized-picker_2.entry.js +2 -2
  22. package/dist/reneco-hierarchized-picker/p-0e305bec.entry.js +1 -0
  23. package/dist/reneco-hierarchized-picker/p-73168a50.system.js +1 -1
  24. package/dist/reneco-hierarchized-picker/p-9027f23a.system.entry.js +3 -0
  25. package/dist/reneco-hierarchized-picker/reneco-hierarchized-picker.esm.js +1 -1
  26. package/dist/types/components/hierarchized-picker/hierarchized-picker.d.ts +13 -2
  27. package/dist/types/components.d.ts +6 -0
  28. package/dist/types/core/options-manager.d.ts +1 -1
  29. package/dist/types/features/keyboard-navigation/keyboard-navigation.d.ts +2 -1
  30. package/dist/types/features/tree/tree-utils.d.ts +1 -1
  31. package/dist/types/utils/utils.d.ts +1 -0
  32. package/package.json +1 -1
  33. package/dist/reneco-hierarchized-picker/p-57a928cc.entry.js +0 -1
  34. package/dist/reneco-hierarchized-picker/p-eea99162.system.entry.js +0 -3
@@ -1,11 +1,12 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { IConf } from '../../utils/utils';
3
+ import { OptionsManager } from '../../core/options-manager';
3
4
  export declare class HierarchizedPickerComponent {
4
5
  el: HTMLElement;
5
6
  scrollable: HTMLDivElement;
6
7
  loader: HTMLDivElement;
7
8
  private rawDataManager;
8
- private optionsManager;
9
+ optionsManager: OptionsManager;
9
10
  private modaleHeight;
10
11
  private modalePosition;
11
12
  /**
@@ -52,6 +53,7 @@ export declare class HierarchizedPickerComponent {
52
53
  (message?: any, ...optionalParams: any[]): void;
53
54
  };
54
55
  errorToLog: string;
56
+ lastErrorMessage: string;
55
57
  /**
56
58
  * This event is emitted when the component's value is modified, providing the new value of the component
57
59
  */
@@ -74,6 +76,10 @@ export declare class HierarchizedPickerComponent {
74
76
  * This event is emitted when the user navigates in the tree
75
77
  */
76
78
  navigateInTree: EventEmitter<any>;
79
+ /**
80
+ * This event is emitted when the picker suffers an error
81
+ */
82
+ errorRaised: EventEmitter<any>;
77
83
  /**
78
84
  * This method returns the current component's value
79
85
  */
@@ -96,6 +102,7 @@ export declare class HierarchizedPickerComponent {
96
102
  }>;
97
103
  logError(messageToLog: any): void;
98
104
  get theOptions(): IConf;
105
+ diffKeys(obj1: any, obj2: any, prefix?: string): string[];
99
106
  setNewOption(newValue: IConf, oldValue?: IConf): Promise<void>;
100
107
  setNewOptions(newoptions: any): void;
101
108
  setNewFilter(newfilter: any): void;
@@ -106,6 +113,7 @@ export declare class HierarchizedPickerComponent {
106
113
  * This method triggers a search inside of the tree based on the value passed to the method and displays the result
107
114
  */
108
115
  filterTree(searchedValue: string): Promise<void>;
116
+ getError(): Promise<string>;
109
117
  constructor();
110
118
  componentWillLoad(): Promise<void>;
111
119
  setDisplayedValueFromDefault(): void;
@@ -122,7 +130,7 @@ export declare class HierarchizedPickerComponent {
122
130
  errorLoadingXHR(): void;
123
131
  displayPickerError(errorMsg?: string): void;
124
132
  getApiSearchURL(): string;
125
- getContextualApiURL(init?: boolean): string;
133
+ getContextualApiURL(init?: boolean, forcedOptions?: any): any;
126
134
  getContextualApiParams(options?: any, search?: any, init?: boolean): any;
127
135
  translateDataForTree(dataToLoad: any, searchID?: any, searched?: any): void;
128
136
  loadSearchDataInCurrentTree(searchID: any, searched: any): void;
@@ -132,13 +140,16 @@ export declare class HierarchizedPickerComponent {
132
140
  onItemContextMenuItemClick(e: any): void;
133
141
  setNodeAsSelected(id: any, treeToUpdate: any, userClick: any): void;
134
142
  collapseAllNodes(): void;
143
+ private scrollToNode;
135
144
  /**
136
145
  * This method display the current selected node to the user by expanding all it's parent nodes and scrolling inside the tree
137
146
  */
138
147
  showSelectedNodes(addDelay?: boolean): Promise<void>;
148
+ scrollToNodeWithId(targetNodeId: any, displayChildren?: boolean): Promise<void>;
139
149
  showTree(focused: any): void;
140
150
  editValue(node: any, userClick?: boolean): void;
141
151
  getShortenedFullpath: (realFullpath: any) => any;
152
+ getShortpathFromFullpath(fullpath: any): any;
142
153
  setDisplayedValue(value?: any): void;
143
154
  search(searched: any): void;
144
155
  triggerSearch(searched: any): void;
@@ -21,6 +21,7 @@ export namespace Components {
21
21
  * This method triggers a search inside of the tree based on the value passed to the method and displays the result
22
22
  */
23
23
  "filterTree": (searchedValue: string) => Promise<void>;
24
+ "getError": () => Promise<string>;
24
25
  "getSearchResult": () => Promise<{ data: any; matches: number; }>;
25
26
  /**
26
27
  * This method returns the current component's value
@@ -39,6 +40,7 @@ export namespace Components {
39
40
  */
40
41
  "options": string | IConf;
41
42
  "refreshPicker": (resetDefaultValue?: boolean) => Promise<void>;
43
+ "scrollToNodeWithId": (targetNodeId: any, displayChildren?: boolean) => Promise<void>;
42
44
  /**
43
45
  * This method replaces the current component's options with the ones passed to the method
44
46
  */
@@ -98,6 +100,10 @@ declare namespace LocalJSX {
98
100
  * When set, this property allows the replacement of the [options] property of the component with the set value as the method [setOptions] would This property exists as an alternative for react context in which we can't directly call the component's method [setOptions]
99
101
  */
100
102
  "newoptions"?: string;
103
+ /**
104
+ * This event is emitted when the picker suffers an error
105
+ */
106
+ "onErrorRaised"?: (event: RenecoHierarchizedPickerCustomEvent<any>) => void;
101
107
  /**
102
108
  * This event can only be emitted when the component is in tree mode and the menu item context is set It will fire when the user clicks in the menu item, providing the item which has been clicked in the menu along with the focused node's ID
103
109
  */
@@ -2,7 +2,7 @@ import { IConf } from '../utils/utils';
2
2
  export declare class OptionsManager {
3
3
  private options;
4
4
  constructor(initialOptions: IConf);
5
- private initializeOptions;
5
+ initializeOptions(options: IConf): IConf;
6
6
  get data(): any;
7
7
  getOptions(): IConf;
8
8
  updateOptions(newOptions: Partial<IConf>): void;
@@ -1,3 +1,4 @@
1
1
  import { HierarchizedPickerComponent } from "../../components/hierarchized-picker/hierarchized-picker";
2
+ import { OptionsManager } from "../../core/options-manager";
2
3
  import { EventEmitter } from '../../stencil-public-runtime';
3
- export declare function setupKeyboardNavigation(component: HierarchizedPickerComponent, navigateInTree: EventEmitter<any>): void;
4
+ export declare function setupKeyboardNavigation(component: HierarchizedPickerComponent, optionsManager: OptionsManager, navigateInTree: EventEmitter<any>): void;
@@ -9,7 +9,7 @@ export declare function findNodeById(tree: any, nodeId: string): any;
9
9
  /**
10
10
  * Fills the tree with nodes based on the provided object.
11
11
  */
12
- export declare function fillTreeWithObject(tree: any[], myObject: any[], searched: string | null, options: any, depth?: number): any[];
12
+ export declare function fillTreeWithObject(tree: any[], myObject: any[], searched: string | null, options: any): any[];
13
13
  /**
14
14
  * Updates the current tree with new nodes.
15
15
  */
@@ -34,6 +34,7 @@ export interface IConf {
34
34
  token?: string | (() => {});
35
35
  options?: any;
36
36
  data?: any;
37
+ keyboardNavigation?: boolean;
37
38
  dragAndDropEnabled?: boolean;
38
39
  contextMenu?: any;
39
40
  searchResultPresentsUnMatched?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reneco-hierarchized-picker",
3
- "version": "0.4.3-beta.8",
3
+ "version": "0.5.0",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/custom-elements/index.js",