@ecodev/natural 38.1.0 → 40.0.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.
@@ -22,7 +22,7 @@ declare type MaybeNavigable = Literal | NavigableItem<Literal>;
22
22
  * Components inheriting from this class can be used as standalone with input attributes.
23
23
  *
24
24
  * Usage :
25
- * <natural-my-listing [forcedVariables]="{filter:...}" [initialColumns]="['col1']" [persistSearch]="false">
25
+ * <natural-my-listing [forcedVariables]="{filter:...}" [selectedColumns]="['col1']" [persistSearch]="false">
26
26
  */
27
27
  export declare class NaturalAbstractList<TService extends NaturalAbstractModelService<any, any, PaginatedData<Literal>, QueryVariables, any, any, any, any, any, any>, Tall extends PaginatedData<MaybeNavigable> = ExtractTall<TService>> extends NaturalAbstractPanel implements OnInit, OnDestroy {
28
28
  readonly service: TService;
@@ -34,17 +34,15 @@ export declare class NaturalAbstractList<TService extends NaturalAbstractModelSe
34
34
  /**
35
35
  * Columns list after interaction with <natural-columns-picker>
36
36
  */
37
- private _selectedColumns;
37
+ columnsForTable: string[];
38
38
  /**
39
39
  * The default column selection that automatically happened after <natural-columns-picker> initialization
40
40
  */
41
41
  private defaultSelectedColumns;
42
42
  /**
43
- * Initial columns on component init
44
- *
45
- * Changing this value after initialization will have no effect at all
43
+ * Visible (checked) columns
46
44
  */
47
- initialColumns?: string[];
45
+ selectedColumns?: string[];
48
46
  /**
49
47
  * Source of the list
50
48
  */
@@ -158,7 +156,7 @@ export declare class NaturalAbstractList<TService extends NaturalAbstractModelSe
158
156
  * Uses data provided by router such as:
159
157
  *
160
158
  * - `route.data.forcedVariables`
161
- * - `route.data.initialColumns`
159
+ * - `route.data.selectedColumns`
162
160
  */
163
161
  protected initFromRoute(): void;
164
162
  protected getDataObservable(): Observable<Tall>;
@@ -174,7 +172,6 @@ export declare class NaturalAbstractList<TService extends NaturalAbstractModelSe
174
172
  */
175
173
  protected bulkDelete(): Observable<void>;
176
174
  private applyForcedVariables;
177
- get selectedColumns(): string[];
178
- set selectedColumns(columns: string[]);
175
+ selectColumns(columns: string[]): void;
179
176
  }
180
177
  export {};
@@ -2,17 +2,27 @@ import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnDestroy, QueryList }
2
2
  import { NaturalColumnsPickerColumnDirective } from './columns-picker-column.directive';
3
3
  export declare class NaturalColumnsPickerComponent implements AfterViewInit, OnDestroy {
4
4
  private readonly changeDetectorRef;
5
- set selection(columns: string[]);
5
+ private _selections?;
6
6
  /**
7
- * Emit a list of column keys whenever the selection changes
7
+ * Set the columns that are wanted but might be unavailable.
8
+ *
9
+ * If a column is unavailable it will be ignored silently. To know what columns were actually applied
10
+ * you should use `selectionChange`.
11
+ *
12
+ * It is often set once on component initialization, but it can also be set again later in the lifespan of the component.
13
+ */
14
+ set selections(columns: string[] | undefined);
15
+ /**
16
+ * Emit a list of valid and selected column keys whenever the selection changes
8
17
  */
9
18
  readonly selectionChange: EventEmitter<string[]>;
10
- readonly defaultSelectionChange: EventEmitter<string[]>;
11
19
  /**
12
- * Filter available columns
20
+ * Available columns are defined by options in the template
13
21
  */
14
- initialSelection?: string[];
15
22
  availableColumns: QueryList<NaturalColumnsPickerColumnDirective> | null;
23
+ /**
24
+ * Displayed options in the dropdown menu
25
+ */
16
26
  displayedColumns: NaturalColumnsPickerColumnDirective[];
17
27
  private ngUnsubscribe;
18
28
  constructor(changeDetectorRef: ChangeDetectorRef);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "38.1.0",
3
+ "version": "40.0.0",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,