@snack-uikit/tree 0.10.3-preview-b1de11a6.0 → 0.10.3-preview-bf2b6776.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/README.md CHANGED
@@ -108,115 +108,6 @@ function TreeAsyncLoadExample() {
108
108
  | selected | `string \| string[]` | - | Состояние для выбраных элементов: <br> - При <strong>selectionMode</strong>=`Multi` - принимает массив строк <br> - При <strong>selectionMode</strong>=`Single` - принимает строку |
109
109
  | onSelect | `((selectedKeys: string[], node: TreeNodeProps) => void) \| ((selectedKey: string, node: TreeNodeProps) => void)` | - | Колбэк при изменении выбраных элементов: <br> - При <strong>selectionMode</strong>=`Multi` - возвращает массив строк <br> - При <strong>selectionMode</strong>=`Single` - возвращает строку |
110
110
  | showToggle | `boolean` | - | |
111
- ## collectIds
112
- ### Props
113
- | name | type | default value | description |
114
- |------|------|---------------|-------------|
115
- | __@unscopables@986* | `{ [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; ... 29 more ...; readonly [Symbol.unscopables]?: boolean; }` | - | Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement. |
116
- | __@iterator@984* | `() => ArrayIterator<TreeNodeProps>` | - | Iterator |
117
- | with* | `(index: number, value: TreeNodeProps) => TreeNodeProps[]` | - | Copies an array, then overwrites the value at the provided index with the given value. If the index is negative, then it replaces from the end of the array. @param index The index of the value to overwrite. If the index is negative, then it replaces from the end of the array. @param value The value to write into the copied array. @returns The copied array with the updated value. |
118
- | toSpliced* | `{ (start: number, deleteCount: number, ...items: TreeNodeProps[]): TreeNodeProps[]; (start: number, deleteCount?: number): TreeNodeProps[]; }` | - | Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array. Copies an array and removes elements while returning the remaining elements. @param start The zero-based location in the array from which to start removing elements. @param deleteCount The number of elements to remove. @param items Elements to insert into the copied array in place of the deleted elements. @returns The copied array. @param start The zero-based location in the array from which to start removing elements. @param deleteCount The number of elements to remove. @returns A copy of the original array with the remaining elements. |
119
- | toSorted* | `(compareFn?: (a: TreeNodeProps, b: TreeNodeProps) => number) => TreeNodeProps[]` | - | Returns a copy of an array with its elements sorted. @param compareFn Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. ```ts [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22] ``` |
120
- | toReversed* | `() => TreeNodeProps[]` | - | Returns a copy of an array with its elements reversed. |
121
- | findLastIndex* | `(predicate: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => unknown, thisArg?: any) => number` | - | Returns the index of the last element in the array where predicate is true, and -1 otherwise. @param predicate findLastIndex calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. @param thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
122
- | findLast* | `{ <S extends TreeNodeProps>(predicate: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => value is S, thisArg?: any): S; (predicate: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => unknown, thisArg?: any): TreeNodeProps; }` | - | Returns the value of the last element in the array where predicate is true, and undefined otherwise. @param predicate findLast calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLast immediately returns that element value. Otherwise, findLast returns undefined. @param thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
123
- | at* | `(index: number) => TreeNodeProps` | - | Returns the item located at the specified index. @param index The zero-based index of the desired code unit. A negative index will count back from the last item. |
124
- | flat* | `<A, D extends number = 1>(this: A, depth?: D) => FlatArray<A, D>[]` | - | Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth. @param depth The maximum recursion depth |
125
- | flatMap* | `<U, This = undefined>(callback: (this: This, value: TreeNodeProps, index: number, array: TreeNodeProps[]) => U \| readonly U[], thisArg?: This) => U[]` | - | Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1. @param callback A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value. |
126
- | includes* | `(searchElement: TreeNodeProps, fromIndex?: number) => boolean` | - | Determines whether an array includes a certain element, returning true or false as appropriate. @param searchElement The element to search for. @param fromIndex The position in this array at which to begin searching for searchElement. |
127
- | values* | `() => ArrayIterator<TreeNodeProps>` | - | Returns an iterable of values in the array |
128
- | keys* | `() => ArrayIterator<number>` | - | Returns an iterable of keys in the array |
129
- | entries* | `() => ArrayIterator<[number, TreeNodeProps]>` | - | Returns an iterable of key, value pairs for every entry in the array |
130
- | copyWithin* | `(target: number, start: number, end?: number) => TreeNodeProps[]` | - | Returns the this object after copying a section of the array identified by start and end to the same array starting at position target @param target If target is negative, it is treated as length+target where length is the length of the array. @param start If start is negative, it is treated as length+start. If end is negative, it is treated as length+end. @param end If not specified, length of the this object is used as its default value. |
131
- | fill* | `(value: TreeNodeProps, start?: number, end?: number) => TreeNodeProps[]` | - | Changes all array elements from `start` to `end` index to a static `value` and returns the modified array @param value value to fill array section with @param start index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. @param end index to stop filling the array at. If end is negative, it is treated as length+end. |
132
- | findIndex* | `(predicate: (value: TreeNodeProps, index: number, obj: TreeNodeProps[]) => unknown, thisArg?: any) => number` | - | Returns the index of the first element in the array where predicate is true, and -1 otherwise. @param predicate find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1. @param thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
133
- | find* | `{ <S extends TreeNodeProps>(predicate: (value: TreeNodeProps, index: number, obj: TreeNodeProps[]) => value is S, thisArg?: any): S; (predicate: (value: TreeNodeProps, index: number, obj: TreeNodeProps[]) => unknown, thisArg?: any): TreeNodeProps; }` | - | Returns the value of the first element in the array where predicate is true, and undefined otherwise. @param predicate find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. @param thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
134
- | reduceRight* | `{ (callbackfn: (previousValue: TreeNodeProps, currentValue: TreeNodeProps, currentIndex: number, array: TreeNodeProps[]) => TreeNodeProps): TreeNodeProps; (callbackfn: (previousValue: TreeNodeProps, currentValue: TreeNodeProps, currentIndex: number, array: TreeNodeProps[]) => TreeNodeProps, initialValue: TreeNodePro...` | - | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |
135
- | reduce* | `{ (callbackfn: (previousValue: TreeNodeProps, currentValue: TreeNodeProps, currentIndex: number, array: TreeNodeProps[]) => TreeNodeProps): TreeNodeProps; (callbackfn: (previousValue: TreeNodeProps, currentValue: TreeNodeProps, currentIndex: number, array: TreeNodeProps[]) => TreeNodeProps, initialValue: TreeNodePro...` | - | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |
136
- | filter* | `{ <S extends TreeNodeProps>(predicate: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => value is S, thisArg?: any): S[]; (predicate: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => unknown, thisArg?: any): TreeNodeProps[]; }` | - | Returns the elements of an array that meet the condition specified in a callback function. @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
137
- | map* | `<U>(callbackfn: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => U, thisArg?: any) => U[]` | - | Calls a defined callback function on each element of an array, and returns an array that contains the results. @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. |
138
- | forEach* | `(callbackfn: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => void, thisArg?: any) => void` | - | Performs the specified action for each element in an array. @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. |
139
- | some* | `(predicate: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => unknown, thisArg?: any) => boolean` | - | Determines whether the specified callback function returns true for any element of an array. @param predicate A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
140
- | every* | `{ <S extends TreeNodeProps>(predicate: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: TreeNodeProps, index: number, array: TreeNodeProps[]) => unknown, thisArg?: any): boolean; }` | - | Determines whether all the members of an array satisfy the specified test. @param predicate A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. @param predicate A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
141
- | lastIndexOf* | `(searchElement: TreeNodeProps, fromIndex?: number) => number` | - | Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present. @param searchElement The value to locate in the array. @param fromIndex The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array. |
142
- | indexOf* | `(searchElement: TreeNodeProps, fromIndex?: number) => number` | - | Returns the index of the first occurrence of a value in an array, or -1 if it is not present. @param searchElement The value to locate in the array. @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. |
143
- | unshift* | `(...items: TreeNodeProps[]) => number` | - | Inserts new elements at the start of an array, and returns the new length of the array. @param items Elements to insert at the start of the array. |
144
- | splice* | `{ (start: number, deleteCount?: number): TreeNodeProps[]; (start: number, deleteCount: number, ...items: TreeNodeProps[]): TreeNodeProps[]; }` | - | Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. @param start The zero-based location in the array from which to start removing elements. @param deleteCount The number of elements to remove. Omitting this argument will remove all elements from the start paramater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements. @returns An array containing the elements that were deleted. @param start The zero-based location in the array from which to start removing elements. @param deleteCount The number of elements to remove. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements. @param items Elements to insert into the array in place of the deleted elements. @returns An array containing the elements that were deleted. |
145
- | sort* | `(compareFn?: (a: TreeNodeProps, b: TreeNodeProps) => number) => TreeNodeProps[]` | - | Sorts an array in place. This method mutates the array and returns a reference to the same array. @param compareFn Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. ```ts [11,2,22,1].sort((a, b) => a - b) ``` |
146
- | slice* | `(start?: number, end?: number) => TreeNodeProps[]` | - | Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array. @param start The beginning index of the specified portion of the array. If start is undefined, then the slice begins at index 0. @param end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'. If end is undefined, then the slice extends to the end of the array. |
147
- | shift* | `() => TreeNodeProps` | - | Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified. |
148
- | reverse* | `() => TreeNodeProps[]` | - | Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array. |
149
- | join* | `(separator?: string) => string` | - | Adds all the elements of an array into a string, separated by the specified separator string. @param separator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma. |
150
- | concat* | `{ (...items: ConcatArray<TreeNodeProps>[]): TreeNodeProps[]; (...items: (TreeNodeProps \| ConcatArray<TreeNodeProps>)[]): TreeNodeProps[]; }` | - | Combines two or more arrays. This method returns a new array without modifying any existing arrays. @param items Additional arrays and/or items to add to the end of the array. @param items Additional arrays and/or items to add to the end of the array. |
151
- | push* | `(...items: TreeNodeProps[]) => number` | - | Appends new elements to the end of an array, and returns the new length of the array. @param items New elements to add to the array. |
152
- | pop* | `() => TreeNodeProps` | - | Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified. |
153
- | length* | `number` | - | Gets or sets the length of the array. This is a number one higher than the highest index in the array. |
154
- | toString | `() => string` | function toString() { [native code] } | Returns a string representation of an array. |
155
- | toLocaleString | `{ (): string; (locales: string \| string[], options?: NumberFormatOptions & DateTimeFormatOptions): string; }` | function toLocaleString() { [native code] } | Returns a string representation of an array. The elements are converted to string using their toLocaleString methods. |
156
- ## getSearchedTreeItems
157
- ### Props
158
- | name | type | default value | description |
159
- |------|------|---------------|-------------|
160
- | tree* | `ExtendedTreeNodeProps[]` | - | |
161
- | searchOptions | `Partial<{ query: string; includeChildrenMatchedParent: boolean; }>` | - | |
162
- ## getSearchedTreeNodeById
163
- ### Props
164
- | name | type | default value | description |
165
- |------|------|---------------|-------------|
166
- | searchOptions* | `{ id: I; includeNested?: boolean; }` | - | |
167
- | tree* | `T[]` | - | |
168
- ## lookupTreeForSelectedNodes
169
- ### Props
170
- | name | type | default value | description |
171
- |------|------|---------------|-------------|
172
- | selectedNodes* | `string[]` | - | |
173
- | node* | `Pick<TreeNodeProps, "id" \| "disabled" \| "nested">` | - | |
174
- | parentNode | `ParentNode` | - | |
175
- ## sortTreeItemsByTitle
176
- ### Props
177
- | name | type | default value | description |
178
- |------|------|---------------|-------------|
179
- | __@unscopables@986* | `{ [x: number]: boolean; length?: boolean; toString?: boolean; toLocaleString?: boolean; pop?: boolean; push?: boolean; concat?: boolean; join?: boolean; reverse?: boolean; shift?: boolean; slice?: boolean; sort?: boolean; ... 29 more ...; readonly [Symbol.unscopables]?: boolean; }` | - | Is an object whose properties have the value 'true' when they will be absent when used in a 'with' statement. |
180
- | __@iterator@984* | `() => ArrayIterator<ExtendedTreeNodeProps>` | - | Iterator |
181
- | with* | `(index: number, value: ExtendedTreeNodeProps) => ExtendedTreeNodeProps[]` | - | Copies an array, then overwrites the value at the provided index with the given value. If the index is negative, then it replaces from the end of the array. @param index The index of the value to overwrite. If the index is negative, then it replaces from the end of the array. @param value The value to write into the copied array. @returns The copied array with the updated value. |
182
- | toSpliced* | `{ (start: number, deleteCount: number, ...items: ExtendedTreeNodeProps[]): ExtendedTreeNodeProps[]; (start: number, deleteCount?: number): ExtendedTreeNodeProps[]; }` | - | Copies an array and removes elements and, if necessary, inserts new elements in their place. Returns the copied array. Copies an array and removes elements while returning the remaining elements. @param start The zero-based location in the array from which to start removing elements. @param deleteCount The number of elements to remove. @param items Elements to insert into the copied array in place of the deleted elements. @returns The copied array. @param start The zero-based location in the array from which to start removing elements. @param deleteCount The number of elements to remove. @returns A copy of the original array with the remaining elements. |
183
- | toSorted* | `(compareFn?: (a: ExtendedTreeNodeProps, b: ExtendedTreeNodeProps) => number) => ExtendedTreeNodeProps[]` | - | Returns a copy of an array with its elements sorted. @param compareFn Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. ```ts [11, 2, 22, 1].toSorted((a, b) => a - b) // [1, 2, 11, 22] ``` |
184
- | toReversed* | `() => ExtendedTreeNodeProps[]` | - | Returns a copy of an array with its elements reversed. |
185
- | findLastIndex* | `(predicate: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => unknown, thisArg?: any) => number` | - | Returns the index of the last element in the array where predicate is true, and -1 otherwise. @param predicate findLastIndex calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1. @param thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
186
- | findLast* | `{ <S extends ExtendedTreeNodeProps>(predicate: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => value is S, thisArg?: any): S; (predicate: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => unknown, thisArg?: any): ExtendedTreeNodeProps; }` | - | Returns the value of the last element in the array where predicate is true, and undefined otherwise. @param predicate findLast calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLast immediately returns that element value. Otherwise, findLast returns undefined. @param thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
187
- | at* | `(index: number) => ExtendedTreeNodeProps` | - | Returns the item located at the specified index. @param index The zero-based index of the desired code unit. A negative index will count back from the last item. |
188
- | flat* | `<A, D extends number = 1>(this: A, depth?: D) => FlatArray<A, D>[]` | - | Returns a new array with all sub-array elements concatenated into it recursively up to the specified depth. @param depth The maximum recursion depth |
189
- | flatMap* | `<U, This = undefined>(callback: (this: This, value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => U \| readonly U[], thisArg?: This) => U[]` | - | Calls a defined callback function on each element of an array. Then, flattens the result into a new array. This is identical to a map followed by flat with depth 1. @param callback A function that accepts up to three arguments. The flatMap method calls the callback function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the callback function. If thisArg is omitted, undefined is used as the this value. |
190
- | includes* | `(searchElement: ExtendedTreeNodeProps, fromIndex?: number) => boolean` | - | Determines whether an array includes a certain element, returning true or false as appropriate. @param searchElement The element to search for. @param fromIndex The position in this array at which to begin searching for searchElement. |
191
- | values* | `() => ArrayIterator<ExtendedTreeNodeProps>` | - | Returns an iterable of values in the array |
192
- | keys* | `() => ArrayIterator<number>` | - | Returns an iterable of keys in the array |
193
- | entries* | `() => ArrayIterator<[number, ExtendedTreeNodeProps]>` | - | Returns an iterable of key, value pairs for every entry in the array |
194
- | copyWithin* | `(target: number, start: number, end?: number) => ExtendedTreeNodeProps[]` | - | Returns the this object after copying a section of the array identified by start and end to the same array starting at position target @param target If target is negative, it is treated as length+target where length is the length of the array. @param start If start is negative, it is treated as length+start. If end is negative, it is treated as length+end. @param end If not specified, length of the this object is used as its default value. |
195
- | fill* | `(value: ExtendedTreeNodeProps, start?: number, end?: number) => ExtendedTreeNodeProps[]` | - | Changes all array elements from `start` to `end` index to a static `value` and returns the modified array @param value value to fill array section with @param start index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. @param end index to stop filling the array at. If end is negative, it is treated as length+end. |
196
- | findIndex* | `(predicate: (value: ExtendedTreeNodeProps, index: number, obj: ExtendedTreeNodeProps[]) => unknown, thisArg?: any) => number` | - | Returns the index of the first element in the array where predicate is true, and -1 otherwise. @param predicate find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1. @param thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
197
- | find* | `{ <S extends ExtendedTreeNodeProps>(predicate: (value: ExtendedTreeNodeProps, index: number, obj: ExtendedTreeNodeProps[]) => value is S, thisArg?: any): S; (predicate: (value: ExtendedTreeNodeProps, index: number, obj: ExtendedTreeNodeProps[]) => unknown, thisArg?: any): ExtendedTreeNodeProps; }` | - | Returns the value of the first element in the array where predicate is true, and undefined otherwise. @param predicate find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. @param thisArg If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. |
198
- | reduceRight* | `{ (callbackfn: (previousValue: ExtendedTreeNodeProps, currentValue: ExtendedTreeNodeProps, currentIndex: number, array: ExtendedTreeNodeProps[]) => ExtendedTreeNodeProps): ExtendedTreeNodeProps; (callbackfn: (previousValue: ExtendedTreeNodeProps, currentValue: ExtendedTreeNodeProps, currentIndex: number, array: Exte...` | - | Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |
199
- | reduce* | `{ (callbackfn: (previousValue: ExtendedTreeNodeProps, currentValue: ExtendedTreeNodeProps, currentIndex: number, array: ExtendedTreeNodeProps[]) => ExtendedTreeNodeProps): ExtendedTreeNodeProps; (callbackfn: (previousValue: ExtendedTreeNodeProps, currentValue: ExtendedTreeNodeProps, currentIndex: number, array: Exte...` | - | Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. |
200
- | filter* | `{ <S extends ExtendedTreeNodeProps>(predicate: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => value is S, thisArg?: any): S[]; (predicate: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => unknown, thisArg?: any): ExtendedTreeNodeProps[]; }` | - | Returns the elements of an array that meet the condition specified in a callback function. @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
201
- | map* | `<U>(callbackfn: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => U, thisArg?: any) => U[]` | - | Calls a defined callback function on each element of an array, and returns an array that contains the results. @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. |
202
- | forEach* | `(callbackfn: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => void, thisArg?: any) => void` | - | Performs the specified action for each element in an array. @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. |
203
- | some* | `(predicate: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => unknown, thisArg?: any) => boolean` | - | Determines whether the specified callback function returns true for any element of an array. @param predicate A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
204
- | every* | `{ <S extends ExtendedTreeNodeProps>(predicate: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: ExtendedTreeNodeProps, index: number, array: ExtendedTreeNodeProps[]) => unknown, thisArg?: any): boolean; }` | - | Determines whether all the members of an array satisfy the specified test. @param predicate A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. @param predicate A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. @param thisArg An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. |
205
- | lastIndexOf* | `(searchElement: ExtendedTreeNodeProps, fromIndex?: number) => number` | - | Returns the index of the last occurrence of a specified value in an array, or -1 if it is not present. @param searchElement The value to locate in the array. @param fromIndex The array index at which to begin searching backward. If fromIndex is omitted, the search starts at the last index in the array. |
206
- | indexOf* | `(searchElement: ExtendedTreeNodeProps, fromIndex?: number) => number` | - | Returns the index of the first occurrence of a value in an array, or -1 if it is not present. @param searchElement The value to locate in the array. @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. |
207
- | unshift* | `(...items: ExtendedTreeNodeProps[]) => number` | - | Inserts new elements at the start of an array, and returns the new length of the array. @param items Elements to insert at the start of the array. |
208
- | splice* | `{ (start: number, deleteCount?: number): ExtendedTreeNodeProps[]; (start: number, deleteCount: number, ...items: ExtendedTreeNodeProps[]): ExtendedTreeNodeProps[]; }` | - | Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. @param start The zero-based location in the array from which to start removing elements. @param deleteCount The number of elements to remove. Omitting this argument will remove all elements from the start paramater location to end of the array. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements. @returns An array containing the elements that were deleted. @param start The zero-based location in the array from which to start removing elements. @param deleteCount The number of elements to remove. If value of this argument is either a negative number, zero, undefined, or a type that cannot be converted to an integer, the function will evaluate the argument as zero and not remove any elements. @param items Elements to insert into the array in place of the deleted elements. @returns An array containing the elements that were deleted. |
209
- | sort* | `(compareFn?: (a: ExtendedTreeNodeProps, b: ExtendedTreeNodeProps) => number) => ExtendedTreeNodeProps[]` | - | Sorts an array in place. This method mutates the array and returns a reference to the same array. @param compareFn Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they're equal, and a positive value otherwise. If omitted, the elements are sorted in ascending, UTF-16 code unit order. ```ts [11,2,22,1].sort((a, b) => a - b) ``` |
210
- | slice* | `(start?: number, end?: number) => ExtendedTreeNodeProps[]` | - | Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array. @param start The beginning index of the specified portion of the array. If start is undefined, then the slice begins at index 0. @param end The end index of the specified portion of the array. This is exclusive of the element at the index 'end'. If end is undefined, then the slice extends to the end of the array. |
211
- | shift* | `() => ExtendedTreeNodeProps` | - | Removes the first element from an array and returns it. If the array is empty, undefined is returned and the array is not modified. |
212
- | reverse* | `() => ExtendedTreeNodeProps[]` | - | Reverses the elements in an array in place. This method mutates the array and returns a reference to the same array. |
213
- | join* | `(separator?: string) => string` | - | Adds all the elements of an array into a string, separated by the specified separator string. @param separator A string used to separate one element of the array from the next in the resulting string. If omitted, the array elements are separated with a comma. |
214
- | concat* | `{ (...items: ConcatArray<ExtendedTreeNodeProps>[]): ExtendedTreeNodeProps[]; (...items: (ExtendedTreeNodeProps \| ConcatArray<...>)[]): ExtendedTreeNodeProps[]; }` | - | Combines two or more arrays. This method returns a new array without modifying any existing arrays. @param items Additional arrays and/or items to add to the end of the array. @param items Additional arrays and/or items to add to the end of the array. |
215
- | push* | `(...items: ExtendedTreeNodeProps[]) => number` | - | Appends new elements to the end of an array, and returns the new length of the array. @param items New elements to add to the array. |
216
- | pop* | `() => ExtendedTreeNodeProps` | - | Removes the last element from an array and returns it. If the array is empty, undefined is returned and the array is not modified. |
217
- | length* | `number` | - | Gets or sets the length of the array. This is a number one higher than the highest index in the array. |
218
- | toString | `() => string` | function toString() { [native code] } | Returns a string representation of an array. |
219
- | toLocaleString | `{ (): string; (locales: string \| string[], options?: NumberFormatOptions & DateTimeFormatOptions): string; }` | function toLocaleString() { [native code] } | Returns a string representation of an array. The elements are converted to string using their toLocaleString methods. |
220
111
 
221
112
 
222
113
  [//]: DOCUMENTATION_SECTION_END
@@ -156,7 +156,7 @@ exports.ExpandableTreeNode = (0, react_1.forwardRef)((_a, ref) => {
156
156
  children: [(0, jsx_runtime_1.jsx)(TreeLine_1.TreeLine, {
157
157
  visible: showLines,
158
158
  "data-test-id": constants_1.TEST_IDS.line,
159
- height: "calc(100% - ".concat(lastItemHeight, "px)"),
159
+ height: `calc(100% - ${lastItemHeight}px)`,
160
160
  className: styles_module_scss_1.default.treeLine
161
161
  }), (0, jsx_runtime_1.jsx)("div", {
162
162
  className: styles_module_scss_1.default.expandableNested,
@@ -1,4 +1,3 @@
1
1
  export * from './components';
2
- export type { OnNodeClick, TreeNodeId, TreeNodeProps, ExtendedTreeNodeProps } from './types';
2
+ export type { OnNodeClick, TreeNodeId, TreeNodeProps } from './types';
3
3
  export { setNonce } from '@snack-uikit/list';
4
- export * from './helpers';
package/dist/cjs/index.js CHANGED
@@ -30,5 +30,4 @@ Object.defineProperty(exports, "setNonce", {
30
30
  get: function () {
31
31
  return list_1.setNonce;
32
32
  }
33
- });
34
- __exportStar(require("./helpers"), exports);
33
+ });
@@ -1,4 +1,3 @@
1
1
  export * from './components';
2
- export type { OnNodeClick, TreeNodeId, TreeNodeProps, ExtendedTreeNodeProps } from './types';
2
+ export type { OnNodeClick, TreeNodeId, TreeNodeProps } from './types';
3
3
  export { setNonce } from '@snack-uikit/list';
4
- export * from './helpers';
package/dist/esm/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from './components';
2
2
  export { setNonce } from '@snack-uikit/list';
3
- export * from './helpers';
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public"
5
5
  },
6
6
  "title": "Tree",
7
- "version": "0.10.3-preview-b1de11a6.0",
7
+ "version": "0.10.3-preview-bf2b6776.0",
8
8
  "sideEffects": [
9
9
  "*.css",
10
10
  "*.woff",
@@ -38,9 +38,9 @@
38
38
  "dependencies": {
39
39
  "@snack-uikit/button": "0.19.17",
40
40
  "@snack-uikit/icons": "0.27.7",
41
- "@snack-uikit/list": "0.32.16",
41
+ "@snack-uikit/list": "0.32.17-preview-bf2b6776.0",
42
42
  "@snack-uikit/toggles": "0.13.26",
43
- "@snack-uikit/truncate-string": "0.7.10",
43
+ "@snack-uikit/truncate-string": "0.7.11-preview-bf2b6776.0",
44
44
  "@snack-uikit/typography": "0.8.12",
45
45
  "@snack-uikit/utils": "4.0.1",
46
46
  "classnames": "2.5.1",
@@ -48,5 +48,5 @@
48
48
  "react-transition-state": "2.1.1",
49
49
  "uncontrollable": "8.0.4"
50
50
  },
51
- "gitHead": "080bd992968e92dbafbeea113bfb83b26397fa3a"
51
+ "gitHead": "8bd281dded73549f18334e96434af37cf809f683"
52
52
  }
package/src/index.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from './components';
2
- export type { OnNodeClick, TreeNodeId, TreeNodeProps, ExtendedTreeNodeProps } from './types';
2
+ export type { OnNodeClick, TreeNodeId, TreeNodeProps } from './types';
3
3
  export { setNonce } from '@snack-uikit/list';
4
- export * from './helpers';