@energycap/components 0.30.1 → 0.30.2
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/bundles/energycap-components.umd.js +87 -33
- package/bundles/energycap-components.umd.js.map +1 -1
- package/bundles/energycap-components.umd.min.js +1 -1
- package/bundles/energycap-components.umd.min.js.map +1 -1
- package/energycap-components.metadata.json +1 -1
- package/esm2015/lib/controls/item-picker/item-picker.component.js +34 -9
- package/esm2015/lib/display/table/table-selectable-row.component.js +45 -28
- package/fesm2015/energycap-components.js +74 -32
- package/fesm2015/energycap-components.js.map +1 -1
- package/lib/controls/item-picker/item-picker.component.d.ts +10 -2
- package/lib/display/table/table-selectable-row.component.d.ts +26 -11
- package/package.json +1 -1
|
@@ -10,6 +10,8 @@ export interface PickerItem<TValue = any, SItems = any> extends MenuItem {
|
|
|
10
10
|
id: string;
|
|
11
11
|
/** When set to true the available item will be automatically added to the selected list */
|
|
12
12
|
defaultSelected?: boolean;
|
|
13
|
+
/** When set to true, the item will not be allowed to be removed from the selected list */
|
|
14
|
+
preventRemove?: boolean;
|
|
13
15
|
/** Redefining to get the typing */
|
|
14
16
|
value: TValue;
|
|
15
17
|
}
|
|
@@ -21,6 +23,10 @@ export declare class ItemPickerSelectableContext<T> extends TableSelectableRowCo
|
|
|
21
23
|
* the available/selected lists
|
|
22
24
|
*/
|
|
23
25
|
selectedItemsMapChanged: Subject<void>;
|
|
26
|
+
/**
|
|
27
|
+
* AdvancedRowClickBehavior is disabled for ItemPicker.
|
|
28
|
+
*/
|
|
29
|
+
readonly disableAdvancedRowClickBehavior: boolean;
|
|
24
30
|
}
|
|
25
31
|
export declare class ItemPickerComponent<T> implements OnInit, OnChanges, OnDestroy {
|
|
26
32
|
/** Identifier for the component. This will be added to the beginning of all internal action elements */
|
|
@@ -62,6 +68,8 @@ export declare class ItemPickerComponent<T> implements OnInit, OnChanges, OnDest
|
|
|
62
68
|
* update this gets set to the values
|
|
63
69
|
*/
|
|
64
70
|
selectedItems: PickerItem[];
|
|
71
|
+
/** True if there are selected items and at least one can be removed */
|
|
72
|
+
selectedItemsClearable: boolean;
|
|
65
73
|
/** Track by used for the searchable table rows */
|
|
66
74
|
trackByIndex: (index: number) => number;
|
|
67
75
|
tableStatus: Overlay;
|
|
@@ -86,8 +94,8 @@ export declare class ItemPickerComponent<T> implements OnInit, OnChanges, OnDest
|
|
|
86
94
|
ngOnChanges(): void;
|
|
87
95
|
ngOnDestroy(): void;
|
|
88
96
|
/**
|
|
89
|
-
* Called by the searchable table when a new set of items are returned from the getItems call
|
|
90
|
-
*
|
|
97
|
+
* Called by the searchable table when a new set of items are returned from the getItems call.
|
|
98
|
+
* If any of the items have `preventRemove` set, their indices are added to the context.
|
|
91
99
|
*/
|
|
92
100
|
onItemsChange(results: TableSearchResults): void;
|
|
93
101
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { AbstractControl, FormArray } from '@angular/forms';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
export declare class TableSelectableRowContext {
|
|
5
5
|
/**specify the form control to use for the selectAll checkbox or provide your own.
|
|
@@ -24,14 +24,22 @@ export declare class TableSelectableRowContext {
|
|
|
24
24
|
* without replacing the actual FormArray that the hosting component may be subscribed to for changes
|
|
25
25
|
*/
|
|
26
26
|
rowAddedOrRemoved: Subject<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Set to true to disable Shift-Click/Ctrl-Click functionality
|
|
29
|
+
*/
|
|
30
|
+
disableAdvancedRowClickBehavior: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Set to list of indices of controls that should not toggle when master/header checkbox toggles
|
|
33
|
+
*/
|
|
34
|
+
nonDependentCheckboxes: number[];
|
|
27
35
|
}
|
|
28
36
|
export declare class TableSelectableRowComponent implements OnInit, OnDestroy, OnChanges {
|
|
29
37
|
/**The ID root to use for the checkbox and table cell */
|
|
30
38
|
id: string;
|
|
31
39
|
/** Disables the selection functionality when false */
|
|
32
|
-
set
|
|
33
|
-
get
|
|
34
|
-
private
|
|
40
|
+
set isSelectionEnabled(value: boolean | null | undefined);
|
|
41
|
+
get isSelectionEnabled(): boolean | null | undefined;
|
|
42
|
+
private _selectionEnabled;
|
|
35
43
|
/**Shared context between master and children. Child directive adds its own FormControl to this
|
|
36
44
|
and removes it onDestroy. The same context object must be used for all directives in a single table*/
|
|
37
45
|
context: TableSelectableRowContext;
|
|
@@ -44,10 +52,17 @@ export declare class TableSelectableRowComponent implements OnInit, OnDestroy, O
|
|
|
44
52
|
left?: number;
|
|
45
53
|
right?: number;
|
|
46
54
|
};
|
|
47
|
-
/**Automatically set to true based on checkbox state, used to highlight the row to match our table selected row styles */
|
|
55
|
+
/** Automatically set to true based on checkbox state, used to highlight the row to match our table selected row styles */
|
|
48
56
|
isSelected: boolean;
|
|
49
|
-
/**
|
|
57
|
+
/** Automatically set to true if no rowIndex is provided or the row index is less than zero */
|
|
50
58
|
isHeader: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Set to true if you want the checkbox to be disabled.
|
|
61
|
+
*
|
|
62
|
+
* When you use this property, make sure you set `disableAdvancedRowClickBehavior: true`
|
|
63
|
+
* in the `TableSelectableRowContext`, or undesired side-effects will occur.
|
|
64
|
+
*/
|
|
65
|
+
isCheckboxDisabled?: boolean;
|
|
51
66
|
dependentCheckboxesReference: {
|
|
52
67
|
controls: AbstractControl[];
|
|
53
68
|
};
|
|
@@ -56,10 +71,10 @@ export declare class TableSelectableRowComponent implements OnInit, OnDestroy, O
|
|
|
56
71
|
/**Sends an event when the component is destroyed so that it can unsubscribe from any observables */
|
|
57
72
|
private destroyed;
|
|
58
73
|
/**Validate and populate the context as the table is dynamically built. Because the context is shared between the
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
* header and each of the rows, changes to it can be used to determine what is happening and hook up the correct
|
|
75
|
+
* subscriptions for selectAll. The user can provide an existing formArray for the rows and form control for the header,
|
|
76
|
+
* or it can just be the default empty ones created by the context class.
|
|
77
|
+
*/
|
|
63
78
|
ngOnInit(): void;
|
|
64
79
|
/**Watch for changes to the row index that can occur if the table is reordered in-place instead of
|
|
65
80
|
* recreated from scratch. Re-capture the correct form control to keep everything in sync
|