novo-elements 7.4.1-next.1 → 7.5.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/esm2020/src/elements/chips/ChipInput.mjs +2 -2
- package/esm2020/src/elements/data-table/data-table.component.mjs +14 -11
- package/esm2020/src/elements/data-table/interfaces.mjs +1 -1
- package/esm2020/src/elements/data-table/state/data-table-state.service.mjs +48 -30
- package/esm2020/src/elements/query-builder/condition-definitions/string-condition.definition.mjs +6 -9
- package/esm2020/src/elements/query-builder/condition-group/condition-group.component.mjs +2 -2
- package/esm2020/src/elements/query-builder/criteria-builder/criteria-builder.component.mjs +2 -2
- package/fesm2015/novo-elements.mjs +69 -50
- package/fesm2015/novo-elements.mjs.map +1 -1
- package/fesm2020/novo-elements.mjs +68 -50
- package/fesm2020/novo-elements.mjs.map +1 -1
- package/package.json +1 -1
- package/src/elements/chips/ChipInput.d.ts +1 -1
- package/src/elements/data-table/interfaces.d.ts +1 -0
- package/src/elements/data-table/state/data-table-state.service.d.ts +5 -1
- package/src/elements/query-builder/condition-definitions/string-condition.definition.d.ts +0 -1
|
@@ -35174,7 +35174,7 @@ class NovoChipInput {
|
|
|
35174
35174
|
focus(options) {
|
|
35175
35175
|
this._inputElement.focus(options);
|
|
35176
35176
|
}
|
|
35177
|
-
/**
|
|
35177
|
+
/** Clears the input. */
|
|
35178
35178
|
clearValue() {
|
|
35179
35179
|
var _a;
|
|
35180
35180
|
this._inputElement.value = '';
|
|
@@ -37285,6 +37285,8 @@ class DataTableState {
|
|
|
37285
37285
|
this.isForceRefresh = false;
|
|
37286
37286
|
this.updates = new EventEmitter();
|
|
37287
37287
|
this.retainSelected = false;
|
|
37288
|
+
this.savedSearchName = undefined;
|
|
37289
|
+
this.displayedColumns = undefined;
|
|
37288
37290
|
}
|
|
37289
37291
|
get userFiltered() {
|
|
37290
37292
|
return !!(this.filter || this.sort || this.globalSearch || this.outsideFilter || this.where);
|
|
@@ -37296,27 +37298,7 @@ class DataTableState {
|
|
|
37296
37298
|
return Array.from(this.selectedRows.values());
|
|
37297
37299
|
}
|
|
37298
37300
|
reset(fireUpdate = true, persistUserFilters) {
|
|
37299
|
-
|
|
37300
|
-
this.sort = undefined;
|
|
37301
|
-
this.globalSearch = undefined;
|
|
37302
|
-
this.filter = undefined;
|
|
37303
|
-
this.where = undefined;
|
|
37304
|
-
}
|
|
37305
|
-
this.page = 0;
|
|
37306
|
-
if (!this.retainSelected) {
|
|
37307
|
-
this.selectedRows.clear();
|
|
37308
|
-
this.resetSource.next();
|
|
37309
|
-
}
|
|
37310
|
-
this.onSortFilterChange();
|
|
37311
|
-
this.retainSelected = false;
|
|
37312
|
-
if (fireUpdate) {
|
|
37313
|
-
this.updates.emit({
|
|
37314
|
-
sort: this.sort,
|
|
37315
|
-
filter: this.filter,
|
|
37316
|
-
globalSearch: this.globalSearch,
|
|
37317
|
-
where: this.where,
|
|
37318
|
-
});
|
|
37319
|
-
}
|
|
37301
|
+
this.setState({}, fireUpdate, persistUserFilters);
|
|
37320
37302
|
}
|
|
37321
37303
|
clearSort(fireUpdate = true) {
|
|
37322
37304
|
this.sort = undefined;
|
|
@@ -37398,6 +37380,7 @@ class DataTableState {
|
|
|
37398
37380
|
filter: this.filter,
|
|
37399
37381
|
globalSearch: this.globalSearch,
|
|
37400
37382
|
where: this.where,
|
|
37383
|
+
savedSearchName: this.savedSearchName,
|
|
37401
37384
|
});
|
|
37402
37385
|
}
|
|
37403
37386
|
setInitialSortFilter(preferences) {
|
|
@@ -37409,24 +37392,60 @@ class DataTableState {
|
|
|
37409
37392
|
this.sort = preferences.sort;
|
|
37410
37393
|
}
|
|
37411
37394
|
if (preferences.filter) {
|
|
37412
|
-
|
|
37413
|
-
filters.forEach((filter) => {
|
|
37414
|
-
filter.value =
|
|
37415
|
-
filter.selectedOption && filter.type
|
|
37416
|
-
? NovoDataTableFilterUtils.constructFilter(filter.selectedOption, filter.type)
|
|
37417
|
-
: filter.value;
|
|
37418
|
-
});
|
|
37419
|
-
this.filter = filters;
|
|
37395
|
+
this.filter = this.transformFilters(preferences.filter);
|
|
37420
37396
|
}
|
|
37421
37397
|
if (preferences.globalSearch) {
|
|
37422
37398
|
this.globalSearch = preferences.globalSearch;
|
|
37423
37399
|
}
|
|
37400
|
+
if (preferences.savedSearchName) {
|
|
37401
|
+
this.savedSearchName = preferences.savedSearchName;
|
|
37402
|
+
}
|
|
37403
|
+
}
|
|
37404
|
+
}
|
|
37405
|
+
setState(preferences, fireUpdate = true, persistUserFilters = false) {
|
|
37406
|
+
var _a;
|
|
37407
|
+
if (!persistUserFilters) {
|
|
37408
|
+
this.where = preferences.where;
|
|
37409
|
+
this.sort = preferences.sort;
|
|
37410
|
+
this.filter = preferences.filter ? this.transformFilters(preferences.filter) : undefined;
|
|
37411
|
+
this.globalSearch = preferences.globalSearch;
|
|
37412
|
+
this.savedSearchName = preferences.savedSearchName;
|
|
37413
|
+
if ((_a = preferences.displayedColumns) === null || _a === void 0 ? void 0 : _a.length) {
|
|
37414
|
+
this.displayedColumns = preferences.displayedColumns;
|
|
37415
|
+
}
|
|
37416
|
+
}
|
|
37417
|
+
this.page = 0;
|
|
37418
|
+
if (!this.retainSelected) {
|
|
37419
|
+
this.selectedRows.clear();
|
|
37420
|
+
this.resetSource.next();
|
|
37421
|
+
}
|
|
37422
|
+
this.onSortFilterChange();
|
|
37423
|
+
this.retainSelected = false;
|
|
37424
|
+
if (fireUpdate) {
|
|
37425
|
+
this.updates.emit({
|
|
37426
|
+
sort: this.sort,
|
|
37427
|
+
filter: this.filter,
|
|
37428
|
+
globalSearch: this.globalSearch,
|
|
37429
|
+
where: this.where,
|
|
37430
|
+
savedSearchName: this.savedSearchName,
|
|
37431
|
+
displayedColumns: this.displayedColumns,
|
|
37432
|
+
});
|
|
37424
37433
|
}
|
|
37425
37434
|
}
|
|
37426
37435
|
checkRetainment(caller, allMatchingSelected = false) {
|
|
37427
37436
|
var _a;
|
|
37428
37437
|
this.retainSelected = ((_a = this.selectionOptions) === null || _a === void 0 ? void 0 : _a.some((option) => option.label === caller)) || this.retainSelected || allMatchingSelected;
|
|
37429
37438
|
}
|
|
37439
|
+
transformFilters(filters) {
|
|
37440
|
+
const filterArray = Helpers.convertToArray(filters);
|
|
37441
|
+
filterArray.forEach((filter) => {
|
|
37442
|
+
filter.value =
|
|
37443
|
+
filter.selectedOption && filter.type
|
|
37444
|
+
? NovoDataTableFilterUtils.constructFilter(filter.selectedOption, filter.type)
|
|
37445
|
+
: filter.value;
|
|
37446
|
+
});
|
|
37447
|
+
return filterArray;
|
|
37448
|
+
}
|
|
37430
37449
|
}
|
|
37431
37450
|
DataTableState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataTableState, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37432
37451
|
DataTableState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: DataTableState });
|
|
@@ -40868,6 +40887,7 @@ class NovoDataTable {
|
|
|
40868
40887
|
filter: event.filter,
|
|
40869
40888
|
globalSearch: event.globalSearch,
|
|
40870
40889
|
where: event.where,
|
|
40890
|
+
savedSearchName: event.savedSearchName,
|
|
40871
40891
|
});
|
|
40872
40892
|
this.performInteractions('change');
|
|
40873
40893
|
}
|
|
@@ -41000,17 +41020,19 @@ class NovoDataTable {
|
|
|
41000
41020
|
}
|
|
41001
41021
|
modifyCellHeaderMultiSelectFilterOptions(column, newOptions) {
|
|
41002
41022
|
const header = this.cellHeaders.find((cellHeader) => cellHeader.id === column);
|
|
41003
|
-
if (header
|
|
41004
|
-
|
|
41005
|
-
|
|
41006
|
-
|
|
41007
|
-
|
|
41008
|
-
|
|
41009
|
-
|
|
41010
|
-
|
|
41023
|
+
if (header) {
|
|
41024
|
+
if (header.config && header.config.filterConfig && header.config.filterConfig.options) {
|
|
41025
|
+
const filterOptions = header.config.filterConfig.options;
|
|
41026
|
+
const optionsToKeep = filterOptions.filter((opt) => header.isSelected(opt, header.multiSelectedOptions) &&
|
|
41027
|
+
!newOptions.find((newOpt) => opt.value && newOpt.value && newOpt.value === opt.value));
|
|
41028
|
+
header.config.filterConfig.options = [...optionsToKeep, ...newOptions];
|
|
41029
|
+
}
|
|
41030
|
+
else {
|
|
41031
|
+
header.config.filterConfig.options = newOptions;
|
|
41032
|
+
}
|
|
41033
|
+
header.setupFilterOptions();
|
|
41034
|
+
header.changeDetectorRef.markForCheck();
|
|
41011
41035
|
}
|
|
41012
|
-
header.setupFilterOptions();
|
|
41013
|
-
header.changeDetectorRef.markForCheck();
|
|
41014
41036
|
}
|
|
41015
41037
|
ngOnDestroy() {
|
|
41016
41038
|
var _a, _b, _c, _d, _e;
|
|
@@ -57207,7 +57229,6 @@ class NovoDefaultStringConditionDef extends AbstractConditionFieldDef {
|
|
|
57207
57229
|
super(...arguments);
|
|
57208
57230
|
this.separatorKeysCodes = [ENTER, COMMA];
|
|
57209
57231
|
this.defaultOperator = 'includeAny';
|
|
57210
|
-
this.model = '';
|
|
57211
57232
|
}
|
|
57212
57233
|
getValue(formGroup) {
|
|
57213
57234
|
var _a;
|
|
@@ -57248,15 +57269,14 @@ NovoDefaultStringConditionDef.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
|
|
|
57248
57269
|
<novo-option value="excludeAny">{{ labels.exclude }}</novo-option>
|
|
57249
57270
|
</novo-select>
|
|
57250
57271
|
</novo-field>
|
|
57251
|
-
<novo-field *novoConditionInputDef="let formGroup">
|
|
57252
|
-
<novo-chip-list #chipList aria-label="filter value">
|
|
57272
|
+
<novo-field *novoConditionInputDef="let formGroup" [formGroup]="formGroup">
|
|
57273
|
+
<novo-chip-list #chipList aria-label="filter value" formControlName="value">
|
|
57253
57274
|
<novo-chip *ngFor="let chip of formGroup.value?.value || []" [value]="chip" (removed)="remove(chip, formGroup)">
|
|
57254
57275
|
{{ chip }}
|
|
57255
57276
|
<novo-icon novoChipRemove>close</novo-icon>
|
|
57256
57277
|
</novo-chip>
|
|
57257
57278
|
<input
|
|
57258
57279
|
novoChipInput
|
|
57259
|
-
[(ngModel)]="model"
|
|
57260
57280
|
[placeholder]="labels.typeToAddChips"
|
|
57261
57281
|
autocomplete="off"
|
|
57262
57282
|
(novoChipInputTokenEnd)="add($event, formGroup)"
|
|
@@ -57265,7 +57285,7 @@ NovoDefaultStringConditionDef.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "1
|
|
|
57265
57285
|
<novo-autocomplete></novo-autocomplete>
|
|
57266
57286
|
</novo-field>
|
|
57267
57287
|
</ng-container>
|
|
57268
|
-
`, isInline: true, components: [{ type: NovoFieldElement, selector: "novo-field", inputs: ["layout", "appearance", "width"], outputs: ["valueChanges", "stateChanges"] }, { type: NovoSelectElement, selector: "novo-select", inputs: ["disabled", "required", "tabIndex", "id", "name", "options", "placeholder", "readonly", "headerConfig", "position", "overlayWidth", "overlayHeight", "displayWith", "compareWith", "value", "multiple"], outputs: ["onSelect", "selectionChange", "valueChange", "openedChange", "opened", "closed"] }, { type: NovoOption, selector: "novo-option", inputs: ["selected", "keepOpen", "novoInert", "value", "disabled"], exportAs: ["novoOption"] }, { type: NovoChipList, selector: "novo-chip-list", inputs: ["errorStateMatcher", "multiple", "stacked", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["novoChipList"] }, { type: NovoChipElement, selector: "novo-chip, [novo-chip]", inputs: ["color", "tabIndex", "size", "type", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"] }, { type: NovoIconComponent, selector: "novo-icon", inputs: ["raised", "theme", "shape", "color", "size", "smaller", "larger", "alt", "name"] }, { type: NovoAutocompleteElement, selector: "novo-autocomplete", inputs: ["tabIndex", "triggerOn", "displayWith", "aria-label", "multiple", "disabled"], outputs: ["optionSelected", "optionActivated"], exportAs: ["novoAutocomplete"] }], directives: [{ type: NovoConditionFieldDef, selector: "[novoConditionFieldDef]" }, { type: NovoConditionOperatorsDef, selector: "[novoConditionOperatorsDef]" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: NovoConditionInputDef, selector: "[novoConditionInputDef]" }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: NovoChipRemove, selector: "[novoChipRemove]" }, { type: NovoChipInput, selector: "input[novoChipInput]", inputs: ["novoChipInputAddOnBlur", "novoChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["novoChipInputTokenEnd"], exportAs: ["novoChipInput", "novoChipInputFor"] }
|
|
57288
|
+
`, isInline: true, components: [{ type: NovoFieldElement, selector: "novo-field", inputs: ["layout", "appearance", "width"], outputs: ["valueChanges", "stateChanges"] }, { type: NovoSelectElement, selector: "novo-select", inputs: ["disabled", "required", "tabIndex", "id", "name", "options", "placeholder", "readonly", "headerConfig", "position", "overlayWidth", "overlayHeight", "displayWith", "compareWith", "value", "multiple"], outputs: ["onSelect", "selectionChange", "valueChange", "openedChange", "opened", "closed"] }, { type: NovoOption, selector: "novo-option", inputs: ["selected", "keepOpen", "novoInert", "value", "disabled"], exportAs: ["novoOption"] }, { type: NovoChipList, selector: "novo-chip-list", inputs: ["errorStateMatcher", "multiple", "stacked", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["novoChipList"] }, { type: NovoChipElement, selector: "novo-chip, [novo-chip]", inputs: ["color", "tabIndex", "size", "type", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"] }, { type: NovoIconComponent, selector: "novo-icon", inputs: ["raised", "theme", "shape", "color", "size", "smaller", "larger", "alt", "name"] }, { type: NovoAutocompleteElement, selector: "novo-autocomplete", inputs: ["tabIndex", "triggerOn", "displayWith", "aria-label", "multiple", "disabled"], outputs: ["optionSelected", "optionActivated"], exportAs: ["novoAutocomplete"] }], directives: [{ type: NovoConditionFieldDef, selector: "[novoConditionFieldDef]" }, { type: NovoConditionOperatorsDef, selector: "[novoConditionOperatorsDef]" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: NovoConditionInputDef, selector: "[novoConditionInputDef]" }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: NovoChipRemove, selector: "[novoChipRemove]" }, { type: NovoChipInput, selector: "input[novoChipInput]", inputs: ["novoChipInputAddOnBlur", "novoChipInputSeparatorKeyCodes", "placeholder", "id", "disabled"], outputs: ["novoChipInputTokenEnd"], exportAs: ["novoChipInput", "novoChipInputFor"] }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
|
57269
57289
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: NovoDefaultStringConditionDef, decorators: [{
|
|
57270
57290
|
type: Component,
|
|
57271
57291
|
args: [{
|
|
@@ -57280,15 +57300,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
57280
57300
|
<novo-option value="excludeAny">{{ labels.exclude }}</novo-option>
|
|
57281
57301
|
</novo-select>
|
|
57282
57302
|
</novo-field>
|
|
57283
|
-
<novo-field *novoConditionInputDef="let formGroup">
|
|
57284
|
-
<novo-chip-list #chipList aria-label="filter value">
|
|
57303
|
+
<novo-field *novoConditionInputDef="let formGroup" [formGroup]="formGroup">
|
|
57304
|
+
<novo-chip-list #chipList aria-label="filter value" formControlName="value">
|
|
57285
57305
|
<novo-chip *ngFor="let chip of formGroup.value?.value || []" [value]="chip" (removed)="remove(chip, formGroup)">
|
|
57286
57306
|
{{ chip }}
|
|
57287
57307
|
<novo-icon novoChipRemove>close</novo-icon>
|
|
57288
57308
|
</novo-chip>
|
|
57289
57309
|
<input
|
|
57290
57310
|
novoChipInput
|
|
57291
|
-
[(ngModel)]="model"
|
|
57292
57311
|
[placeholder]="labels.typeToAddChips"
|
|
57293
57312
|
autocomplete="off"
|
|
57294
57313
|
(novoChipInputTokenEnd)="add($event, formGroup)"
|
|
@@ -57363,7 +57382,7 @@ class ConditionGroupComponent {
|
|
|
57363
57382
|
return this.formBuilder.group({
|
|
57364
57383
|
field: [field, Validators.required],
|
|
57365
57384
|
operator: [operator, Validators.required],
|
|
57366
|
-
value: [value
|
|
57385
|
+
value: [value],
|
|
57367
57386
|
});
|
|
57368
57387
|
}
|
|
57369
57388
|
cantRemoveRow(isFirst) {
|
|
@@ -57466,7 +57485,7 @@ class CriteriaBuilderComponent {
|
|
|
57466
57485
|
return this.formBuilder.group({
|
|
57467
57486
|
field: [field, Validators.required],
|
|
57468
57487
|
operator: [operator, Validators.required],
|
|
57469
|
-
value: [value
|
|
57488
|
+
value: [value],
|
|
57470
57489
|
});
|
|
57471
57490
|
}
|
|
57472
57491
|
removeConditionGroupAt(index) {
|