@paperless/angular 0.1.0-alpha.150 → 0.1.0-alpha.151

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.
@@ -126,19 +126,19 @@ let BaseTableComponent = class BaseTableComponent extends FormBaseComponent {
126
126
  if (!this.tableOptions) {
127
127
  return this._defaultTableValues.pageSize;
128
128
  }
129
- return this.tableOptions.get('pageSize')?.value;
129
+ return this.tableOptions.value.pageSize;
130
130
  }
131
131
  get page() {
132
132
  if (!this.tableOptions) {
133
133
  return this._defaultTableValues.page;
134
134
  }
135
- return this.tableOptions.get('page')?.value;
135
+ return this.tableOptions.value.page;
136
136
  }
137
137
  get quickFilter() {
138
138
  if (!this.tableOptions) {
139
139
  return this._defaultTableValues.quickFilter;
140
140
  }
141
- return this.tableOptions.get('quickFilter')?.value;
141
+ return this.tableOptions.value.quickFilter;
142
142
  }
143
143
  set quickFilter(quickFilter) {
144
144
  this.tableValues = {
@@ -149,7 +149,7 @@ let BaseTableComponent = class BaseTableComponent extends FormBaseComponent {
149
149
  if (!this.tableOptions) {
150
150
  return this._defaultTableValues.query;
151
151
  }
152
- return this.tableOptions.get('query')?.value;
152
+ return this.tableOptions.value.query;
153
153
  }
154
154
  set query(query) {
155
155
  this.tableValues = {
@@ -160,7 +160,7 @@ let BaseTableComponent = class BaseTableComponent extends FormBaseComponent {
160
160
  if (!this.tableOptions) {
161
161
  return this._defaultTableValues.selectedRows;
162
162
  }
163
- return this.tableOptions.get('selectedRows')?.value;
163
+ return this.tableOptions.value.selectedRows;
164
164
  }
165
165
  set selectedRows(selectedRows) {
166
166
  this.tableValues = {
@@ -176,7 +176,7 @@ let BaseTableComponent = class BaseTableComponent extends FormBaseComponent {
176
176
  };
177
177
  }
178
178
  get tableValues() {
179
- return this.tableOptions?.value;
179
+ return this.tableOptions?.value ?? {};
180
180
  }
181
181
  set tableValues(values) {
182
182
  this._setTableValues({
@@ -185,12 +185,12 @@ let BaseTableComponent = class BaseTableComponent extends FormBaseComponent {
185
185
  });
186
186
  }
187
187
  ngOnInit() {
188
- this.tableOptions = new FormGroup({
189
- pageSize: new FormControl(this.parsedDefaultTableValues.pageSize),
190
- page: new FormControl(this.parsedDefaultTableValues.page),
191
- quickFilter: new FormControl(this.parsedDefaultTableValues.quickFilter),
192
- query: new FormControl(this.parsedDefaultTableValues.query),
193
- selectedRows: new FormControl(this.parsedDefaultTableValues.selectedRows),
188
+ this.tableOptions = new FormControl({
189
+ pageSize: this.parsedDefaultTableValues.pageSize,
190
+ page: this.parsedDefaultTableValues.page,
191
+ quickFilter: this.parsedDefaultTableValues.quickFilter,
192
+ query: this.parsedDefaultTableValues.query,
193
+ selectedRows: this.parsedDefaultTableValues.selectedRows,
194
194
  });
195
195
  this.tableOptions.valueChanges
196
196
  .pipe(untilDestroyed(this), startWith(this.tableOptions.value), pairwise(), map(([previous, next]) => this._getChanges(previous, next)), filter((changes) => !!changes), debounce((changes) => {
@@ -229,7 +229,10 @@ let BaseTableComponent = class BaseTableComponent extends FormBaseComponent {
229
229
  this._refresh();
230
230
  }
231
231
  _setTableValues(data, emitEvent = true) {
232
- this.tableOptions?.setValue(data, { emitEvent });
232
+ this.tableOptions?.setValue({
233
+ ...this.tableOptions.value,
234
+ ...data,
235
+ }, { emitEvent });
233
236
  }
234
237
  _getChanges(previous, next) {
235
238
  const changes = {};
@@ -239,6 +242,7 @@ let BaseTableComponent = class BaseTableComponent extends FormBaseComponent {
239
242
  continue;
240
243
  }
241
244
  if (JSON.stringify(previous[key]) !== JSON.stringify(next[key])) {
245
+ // @ts-ignore
242
246
  changes[key] = next[key];
243
247
  }
244
248
  }