@cute-widgets/base 20.0.2 → 20.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/core/directives/index.d.ts +1 -1
- package/fesm2022/cute-widgets-base-core-directives.mjs +1 -1
- package/fesm2022/cute-widgets-base-core-directives.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-core.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-sort.mjs +4 -4
- package/fesm2022/cute-widgets-base-sort.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-table.mjs +16 -13
- package/fesm2022/cute-widgets-base-table.mjs.map +1 -1
- package/fesm2022/cute-widgets-base-tree.mjs +11 -2
- package/fesm2022/cute-widgets-base-tree.mjs.map +1 -1
- package/fesm2022/cute-widgets-base.mjs +1 -1
- package/package.json +9 -9
- package/sort/index.d.ts +4 -4
- package/table/index.d.ts +16 -13
- package/tree/index.d.ts +5 -0
package/sort/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ type SortDirection = 'asc' | 'desc' | '';
|
|
|
21
21
|
|
|
22
22
|
/** Position of the arrow that displays when sorted. */
|
|
23
23
|
type SortHeaderArrowPosition = 'before' | 'after';
|
|
24
|
-
/** Interface for a directive that holds sorting state consumed by `
|
|
24
|
+
/** Interface for a directive that holds sorting state consumed by `CuteSortHeader`. */
|
|
25
25
|
interface CuteSortable {
|
|
26
26
|
/** The id of the column being sorted. */
|
|
27
27
|
id: string;
|
|
@@ -46,7 +46,7 @@ interface CuteSortDefaultOptions {
|
|
|
46
46
|
}
|
|
47
47
|
/** Injection token to be used to override the default options for `mat-sort`. */
|
|
48
48
|
declare const CUTE_SORT_DEFAULT_OPTIONS: InjectionToken<CuteSortDefaultOptions>;
|
|
49
|
-
/** Container for
|
|
49
|
+
/** Container for CuteSortables to manage the sort state and provide default sort parameters. */
|
|
50
50
|
declare class CuteSort implements OnChanges, OnDestroy, OnInit {
|
|
51
51
|
private _defaultOptions?;
|
|
52
52
|
private _initializedStream;
|
|
@@ -229,7 +229,7 @@ declare class CuteSortHeader implements CuteSortable, OnDestroy, OnInit, AfterVi
|
|
|
229
229
|
/** whether the sort header is disabled. */
|
|
230
230
|
disabled: boolean;
|
|
231
231
|
/**
|
|
232
|
-
* Description applied to
|
|
232
|
+
* Description applied to CuteSortHeader's button element with aria-describedby. This text should
|
|
233
233
|
* describe the action that will occur when the user clicks the sort header.
|
|
234
234
|
*/
|
|
235
235
|
get sortActionDescription(): string;
|
|
@@ -263,7 +263,7 @@ declare class CuteSortHeader implements CuteSortable, OnDestroy, OnInit, AfterVi
|
|
|
263
263
|
_toggleOnInteraction(): void;
|
|
264
264
|
_handleClick(): void;
|
|
265
265
|
_handleKeydown(event: KeyboardEvent): void;
|
|
266
|
-
/** Whether this
|
|
266
|
+
/** Whether this CuteSortHeader is currently sorted in either ascending or descending order. */
|
|
267
267
|
_isSorted(): boolean;
|
|
268
268
|
/** Returns the animation state for the arrow direction (indicator and pointers). */
|
|
269
269
|
_getArrowDirectionState(): string;
|
package/table/index.d.ts
CHANGED
|
@@ -38,6 +38,9 @@ declare class CuteRecycleRows {
|
|
|
38
38
|
static ɵfac: i0.ɵɵFactoryDeclaration<CuteRecycleRows, never>;
|
|
39
39
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CuteRecycleRows, "cute-table[recycleRows], table[cute-table][recycleRows]", never, {}, {}, never, never, true, never>;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* @inheritDoc
|
|
43
|
+
*/
|
|
41
44
|
declare class CuteTable<T> extends CdkTable<T> implements OnInit {
|
|
42
45
|
/** Overrides the sticky CSS class set by the `CdkTable`. */
|
|
43
46
|
protected stickyCssClass: string;
|
|
@@ -227,10 +230,10 @@ declare class CuteNoDataRow extends CdkNoDataRow {
|
|
|
227
230
|
|
|
228
231
|
/**
|
|
229
232
|
* Data source that accepts a client-side data array and includes native support of filtering,
|
|
230
|
-
* sorting (using CuteSort), and pagination (using CutePaginator).
|
|
233
|
+
* sorting (using `CuteSort`), and pagination (using `CutePaginator`).
|
|
231
234
|
*
|
|
232
|
-
* Allows for sort customization by overriding sortingDataAccessor
|
|
233
|
-
* properties are accessed. It also allows for filter customization by overriding filterPredicate
|
|
235
|
+
* Allows for sort customization by overriding `sortingDataAccessor`, which defines how data
|
|
236
|
+
* properties are accessed. It also allows for filter customization by overriding `filterPredicate`,
|
|
234
237
|
* which defines how row data is converted to a string for filter matching.
|
|
235
238
|
*
|
|
236
239
|
* **Note:** This class is meant to be a simple data source to help you get started. As such,
|
|
@@ -269,8 +272,8 @@ declare class CuteTableDataSource<T, P extends CutePaginator = CutePaginator> ex
|
|
|
269
272
|
get filter(): string;
|
|
270
273
|
set filter(filter: string);
|
|
271
274
|
/**
|
|
272
|
-
* Instance of the CuteSort directive used by the table to control its sorting. Sort changes
|
|
273
|
-
* emitted by the CuteSort will trigger an update to the table's rendered data.
|
|
275
|
+
* Instance of the `CuteSort` directive used by the table to control its sorting. Sort changes
|
|
276
|
+
* emitted by the `CuteSort` will trigger an update to the table's rendered data.
|
|
274
277
|
*/
|
|
275
278
|
get sort(): CuteSort | null;
|
|
276
279
|
set sort(sort: CuteSort | null);
|
|
@@ -299,13 +302,13 @@ declare class CuteTableDataSource<T, P extends CutePaginator = CutePaginator> ex
|
|
|
299
302
|
*/
|
|
300
303
|
sortingDataAccessor: (data: T, sortHeaderId: string) => string | number;
|
|
301
304
|
/**
|
|
302
|
-
* Gets a sorted copy of the data array based on the state of the CuteSort
|
|
303
|
-
* after changes are made to the filtered data or when sort changes are emitted from CuteSort
|
|
305
|
+
* Gets a sorted copy of the data array based on the state of the `CuteSort`. Called
|
|
306
|
+
* after changes are made to the filtered data or when sort changes are emitted from `CuteSort`.
|
|
304
307
|
* By default, the function retrieves the active sort and its direction and compares data
|
|
305
|
-
* by retrieving data using the sortingDataAccessor. May be overridden for a custom implementation
|
|
308
|
+
* by retrieving data using the {@link sortingDataAccessor}. May be overridden for a custom implementation
|
|
306
309
|
* of data ordering.
|
|
307
310
|
* @param data The array of data that should be sorted.
|
|
308
|
-
* @param sort The connected CuteSort that holds the current sort state.
|
|
311
|
+
* @param sort The connected `CuteSort` that holds the current sort state.
|
|
309
312
|
*/
|
|
310
313
|
sortData: (data: T[], sort: CuteSort) => T[];
|
|
311
314
|
/**
|
|
@@ -328,12 +331,12 @@ declare class CuteTableDataSource<T, P extends CutePaginator = CutePaginator> ex
|
|
|
328
331
|
protected _updateChangeSubscription(): void;
|
|
329
332
|
/**
|
|
330
333
|
* Returns a filtered data array where each filter object contains the filter string within
|
|
331
|
-
* the result of the filterPredicate function. If no filter is set, return the data array
|
|
334
|
+
* the result of the {@link filterPredicate} function. If no filter is set, return the data array
|
|
332
335
|
* as provided.
|
|
333
336
|
*/
|
|
334
337
|
protected _filterData(data: T[]): T[];
|
|
335
338
|
/**
|
|
336
|
-
* Returns a sorted copy of the data if CuteSort has a sort applied, otherwise just returns the
|
|
339
|
+
* Returns a sorted copy of the data if `CuteSort` has a sort applied, otherwise just returns the
|
|
337
340
|
* data array as provided. Uses the default data accessor for data lookup, unless a
|
|
338
341
|
* sortDataAccessor function is defined.
|
|
339
342
|
*/
|
|
@@ -350,11 +353,11 @@ declare class CuteTableDataSource<T, P extends CutePaginator = CutePaginator> ex
|
|
|
350
353
|
*/
|
|
351
354
|
protected _updatePaginator(filteredDataLength: number): void;
|
|
352
355
|
/**
|
|
353
|
-
* Used by the CuteTable. Called when it connects to the data source.
|
|
356
|
+
* Used by the {@link CuteTable}. Called when it connects to the data source.
|
|
354
357
|
*/
|
|
355
358
|
connect(): BehaviorSubject<T[]>;
|
|
356
359
|
/**
|
|
357
|
-
* Used by the CuteTable. Called when it disconnects from the data source.
|
|
360
|
+
* Used by the {@link CuteTable}. Called when it disconnects from the data source.
|
|
358
361
|
*/
|
|
359
362
|
disconnect(): void;
|
|
360
363
|
}
|
package/tree/index.d.ts
CHANGED
|
@@ -241,6 +241,7 @@ declare class CuteTreeFlattener<T, F, K = F> {
|
|
|
241
241
|
getLevel: (node: F) => number;
|
|
242
242
|
isExpandable: (node: F) => boolean;
|
|
243
243
|
getChildren: (node: T) => Observable<T[]> | T[] | undefined | null;
|
|
244
|
+
private _subscription;
|
|
244
245
|
constructor(transformFunction: (node: T, level: number) => F, getLevel: (node: F) => number, isExpandable: (node: F) => boolean, getChildren: (node: T) => Observable<T[]> | T[] | undefined | null);
|
|
245
246
|
private _flattenNode;
|
|
246
247
|
private _flattenChildren;
|
|
@@ -255,6 +256,10 @@ declare class CuteTreeFlattener<T, F, K = F> {
|
|
|
255
256
|
* The returned list may have different length.
|
|
256
257
|
*/
|
|
257
258
|
expandFlattenedNodes(nodes: F[], treeControl: TreeControl<F, K>): F[];
|
|
259
|
+
/**
|
|
260
|
+
* Performs the final actions with the flattener before destroying it.
|
|
261
|
+
*/
|
|
262
|
+
finalize(): void;
|
|
258
263
|
}
|
|
259
264
|
/**
|
|
260
265
|
* Data source for a flat tree.
|