nuxeo-development-framework 5.6.6 → 5.6.8

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.
Files changed (17) hide show
  1. package/bundles/nuxeo-development-framework.umd.js +35 -14
  2. package/bundles/nuxeo-development-framework.umd.js.map +1 -1
  3. package/esm2015/lib/components/dynamic-form/components/dynamic-form-select-users/dynamic-form-select-users.component.js +13 -9
  4. package/esm2015/lib/components/ndf-config-editor/containers/ndf-config-editor/ndf-config-editor.component.js +6 -1
  5. package/esm2015/lib/components/ndf-filters/base/base-checkbox-radio.component.js +2 -1
  6. package/esm2015/lib/components/ndf-filters/components/aggregation-checkbox/aggregation-checkbox.component.js +2 -2
  7. package/esm2015/lib/components/ndf-filters/custom-components/aggregation-group/aggregation-group.component.js +12 -2
  8. package/esm2015/lib/components/reports/ndf-reports/containers/ndf-reports/ndf-reports.component.js +3 -3
  9. package/esm2015/lib/components/spell-checker-field/spell-checker-field.module.js +1 -1
  10. package/esm2015/lib/shared/components/nuxeo-dialog/models/dialog-option.model.js +1 -1
  11. package/esm2015/lib/shared/components/nuxeo-dialog/services/nuxeo-dialog.service.js +3 -2
  12. package/fesm2015/nuxeo-development-framework.js +34 -13
  13. package/fesm2015/nuxeo-development-framework.js.map +1 -1
  14. package/lib/components/dynamic-form/components/dynamic-form-select-users/dynamic-form-select-users.component.d.ts +1 -0
  15. package/lib/components/ndf-filters/custom-components/aggregation-group/aggregation-group.component.d.ts +1 -0
  16. package/lib/shared/components/nuxeo-dialog/models/dialog-option.model.d.ts +1 -0
  17. package/package.json +1 -1
@@ -3172,7 +3172,8 @@
3172
3172
  return this.dialog.open(options.component, {
3173
3173
  width: (options === null || options === void 0 ? void 0 : options.width) || 'auto',
3174
3174
  height: (options === null || options === void 0 ? void 0 : options.height) || 'auto',
3175
- minWidth: '35%',
3175
+ minWidth: (options === null || options === void 0 ? void 0 : options.height) || '35%',
3176
+ maxWidth: (options === null || options === void 0 ? void 0 : options.maxWidth) || '80vw',
3176
3177
  panelClass: __spreadArray(['ndf-dialog'], __read(__classPrivateFieldGet(this, _NuxeoDialogService_instances, "m", _NuxeoDialogService_getPanelClass).call(this, options === null || options === void 0 ? void 0 : options.panelClass))),
3177
3178
  disableClose: true,
3178
3179
  data: Object.assign({ dialogConfig: {
@@ -12502,7 +12503,6 @@
12502
12503
  return this.userApiService.getUsersSuggestions(term);
12503
12504
  };
12504
12505
  DynamicFormSelectUsersComponent.prototype.constructUserArray = function (data, filterValue) {
12505
- var _this = this;
12506
12506
  var ConstructedData;
12507
12507
  // if not using arabic name then construct full name here
12508
12508
  if (!this.useArabicName) {
@@ -12511,17 +12511,22 @@
12511
12511
  ConstructedData = this.filterUsers(data, filterValue);
12512
12512
  // Due to not using bindValue, we need to hold the selected value as the full user object, not just the username
12513
12513
  if (this.writedValue) {
12514
- var selected = void 0;
12515
- if (this.multiple) {
12516
- selected = ConstructedData.filter(function (user) { return _this.writedValue.includes(user.properties.username); });
12517
- }
12518
- else {
12519
- selected = ConstructedData.filter(function (user) { return user.properties.username === _this.writedValue; })[0];
12520
- }
12521
- this.selection = selected !== null && selected !== void 0 ? selected : this.selection;
12514
+ this.handleWrittedValue(ConstructedData);
12522
12515
  }
12523
12516
  return ConstructedData;
12524
12517
  };
12518
+ DynamicFormSelectUsersComponent.prototype.handleWrittedValue = function (users) {
12519
+ var _this = this;
12520
+ var userId = function (value) {
12521
+ return (typeof (value) === 'string') ? value : value.id;
12522
+ };
12523
+ this.selection = (this.multiple) ? users.filter(function (user) { return _this.writedValue.some(function (value) { return user.properties.username === userId(value); }); })
12524
+ : users.filter(function (user) { return user.properties.username === userId(_this.writedValue); })[0];
12525
+ if (this.selection) {
12526
+ this.writedValue = null;
12527
+ this.emitSelection(this.selection);
12528
+ }
12529
+ };
12525
12530
  DynamicFormSelectUsersComponent.prototype.insertFUllName = function (data) {
12526
12531
  return data.map(function (user) {
12527
12532
  var _a, _b;
@@ -18701,6 +18706,7 @@
18701
18706
  }
18702
18707
  var _vals = Array.isArray(_values) ? _values : [_values];
18703
18708
  this.internalValue = _values;
18709
+ this.selectionModel.clear();
18704
18710
  (_b = this.selectionModel).select.apply(_b, __spreadArray([], __read(_vals)));
18705
18711
  this._isFieldDirty = true;
18706
18712
  this.cdr.markForCheck();
@@ -19334,7 +19340,7 @@
19334
19340
  useExisting: i0.forwardRef(function () { return AggregationCheckboxComponent; }),
19335
19341
  multi: true
19336
19342
  }
19337
- ], usesInheritance: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"options$ | async as options\">\r\n\t<field-header *ngIf=\"fieldConfig.label && !renderOptions?.hideLabel\" class=\"filter-checkbox__header\">\r\n\t\t<span>\r\n\t\t\t{{ fieldConfig.label | translate }}\r\n\t\t</span>\r\n\t\t<filter-options-sort *ngIf=\"renderOptions?.sort\" (sortChange)=\"sortChange($event)\"></filter-options-sort>\r\n\t</field-header>\r\n\r\n\t<filter-search-input\r\n\t\tclass=\"filter-checkbox__filter\"\r\n\t\t*ngIf=\"renderOptions?.filter\"\r\n\t\t[(searchText)]=\"searchText\"\r\n\t></filter-search-input>\r\n\r\n\t<filter-autocomplete-input\r\n\t\t*ngIf=\"renderOptions?.search\"\r\n\t\t[fieldConfig]=\"fieldConfig\"\r\n\t\t[language]=\"language\"\r\n\t\t[direction]=\"direction\"\r\n\t\t(searchChange)=\"emitValue($event)\"\r\n\t></filter-autocomplete-input>\r\n\r\n\t<ng-container *ngIf=\"options | filter: searchText | sortList: sort as filteredOptions\">\r\n\t\t<div class=\"filter-checkbox__wrapper\">\r\n\t\t\t<mat-checkbox\r\n\t\t\t\tclass=\"filter-checkbox__item\"\r\n\t\t\t\t*ngFor=\"let option of filteredOptions; index as index\"\r\n\t\t\t\t[checked]=\"selectionModel.isSelected(option.value)\"\r\n\t\t\t\t(change)=\"selectionModel.toggle(option.value)\"\r\n\t\t\t\t[class.checkedBox]=\"selectionModel.isSelected(option.value)\"\r\n\t\t\t\t[class.unCheckedBox]=\"!selectionModel.isSelected(option.value)\"\r\n\t\t\t\t[class.hidden]=\"renderOptions?.collapse && index + 1 > visibleItemsCount\"\r\n\t\t\t>\r\n\t\t\t\t<ng-container\r\n\t\t\t\t\t[ngTemplateOutlet]=\"contentTemplate || defaultTemplate\"\r\n\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: option, fieldConfig, aggregation }\"\r\n\t\t\t\t></ng-container>\r\n\r\n\t\t\t\t<ng-template #defaultTemplate>\r\n\t\t\t\t\t<filter-option-text\r\n\t\t\t\t\t\t[option]=\"option\"\r\n\t\t\t\t\t\t[language]=\"language\"\r\n\t\t\t\t\t\t[showCount]=\"renderOptions?.showTotal\"\r\n\t\t\t\t\t></filter-option-text>\r\n\t\t\t\t</ng-template>\r\n\t\t\t</mat-checkbox>\r\n\t\t</div>\r\n\r\n\t\t<filter-empty-message *ngIf=\"!filteredOptions.length\" class=\"filter-checkbox__empty\"></filter-empty-message>\r\n\r\n\t\t<filter-collapse-control\r\n\t\t\tclass=\"filter-checkbox__collapse\"\r\n\t\t\t*ngIf=\"renderOptions?.collapse\"\r\n\t\t\t[minCount]=\"expandedCount\"\r\n\t\t\t[(visibleCount)]=\"visibleItemsCount\"\r\n\t\t\t[totalItems]=\"filteredOptions.length\"\r\n\t\t></filter-collapse-control>\r\n\t</ng-container>\r\n</ng-container>\r\n", styles: [".filter-checkbox{display:var(--fc-display, block)}.filter-checkbox__wrapper{display:var(--fc-wrapper-display, flex);flex-direction:var(--fc-wrapper-direction, column)}.filter-checkbox__item{margin-bottom:var(--filter-row-margin-bottom, .3rem)}.filter-checkbox__item.hidden{display:none}.filter-checkbox__item .mat-checkbox-layout{display:flex}.filter-checkbox__item .mat-checkbox-layout .mat-checkbox-label{flex-grow:1}\n"], components: [{ type: FieldHeaderComponent, selector: "field-header" }, { type: FilterOptionsSortComponent, selector: "filter-options-sort", inputs: ["options", "sort"], outputs: ["sortChange"] }, { type: FilterSearchInputComponent, selector: "filter-search-input", inputs: ["searchText"], outputs: ["searchTextChange"] }, { type: FilterAutocompleteInputComponent, selector: "filter-autocomplete-input", inputs: ["direction", "language", "fieldConfig"], outputs: ["searchChange"] }, { type: i5__namespace$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: FilterOptionTextComponent, selector: "filter-option-text", inputs: ["option", "showCount", "language"] }, { type: FilterEmptyMessageComponent, selector: "filter-empty-message", inputs: ["message"] }, { type: FilterCollapseControlComponent, selector: "filter-collapse-control", inputs: ["minCount", "totalItems", "visibleCount"], outputs: ["visibleCountChange"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4__namespace$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe, "sortList": SortListPipe, "filter": FilterPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.Default, encapsulation: i0__namespace.ViewEncapsulation.None });
19343
+ ], usesInheritance: true, ngImport: i0__namespace, template: "<ng-container *ngIf=\"options$ | async as options\">\r\n\t<field-header *ngIf=\"fieldConfig.label && !renderOptions?.hideLabel\" class=\"filter-checkbox__header\">\r\n\t\t<span>\r\n\t\t\t{{ fieldConfig.label | translate }}\r\n\t\t</span>\r\n\t\t<filter-options-sort *ngIf=\"renderOptions?.sort\" (sortChange)=\"sortChange($event)\"></filter-options-sort>\r\n\t</field-header>\r\n\r\n\t<filter-search-input\r\n\t\tclass=\"filter-checkbox__filter\"\r\n\t\t*ngIf=\"renderOptions?.filter\"\r\n\t\t[(searchText)]=\"searchText\"\r\n\t></filter-search-input>\r\n\r\n\t<filter-autocomplete-input\r\n\t\t*ngIf=\"renderOptions?.search\"\r\n\t\t[fieldConfig]=\"fieldConfig\"\r\n\t\t[language]=\"language\"\r\n\t\t[direction]=\"direction\"\r\n\t\t(searchChange)=\"emitValue($event)\"\r\n\t></filter-autocomplete-input>\r\n\r\n\t<ng-container *ngIf=\"options | filter: searchText | sortList: sort as filteredOptions\">\r\n\t\t<div class=\"filter-checkbox__wrapper\">\r\n\t\t\t<mat-checkbox\r\n\t\t\t\tclass=\"filter-checkbox__item\"\r\n\t\t\t\t*ngFor=\"let option of filteredOptions; index as index ;\"\r\n\t\t\t\t[checked]=\"selectionModel.isSelected(option.value)\"\r\n\t\t\t\t(change)=\"selectionModel.toggle(option.value)\"\r\n\t\t\t\t[class.checkedBox]=\"selectionModel.isSelected(option.value)\"\r\n\t\t\t\t[class.unCheckedBox]=\"!selectionModel.isSelected(option.value)\"\r\n\t\t\t\t[class.hidden]=\"renderOptions?.collapse && index + 1 > visibleItemsCount\"\r\n\t\t\t>\r\n\t\t\t\t<ng-container\r\n\t\t\t\t\t[ngTemplateOutlet]=\"contentTemplate || defaultTemplate\"\r\n\t\t\t\t\t[ngTemplateOutletContext]=\"{ $implicit: option, fieldConfig, aggregation }\"\r\n\t\t\t\t></ng-container>\r\n\r\n\t\t\t\t<ng-template #defaultTemplate>\r\n\t\t\t\t\t<filter-option-text\r\n\t\t\t\t\t\t[option]=\"option\"\r\n\t\t\t\t\t\t[language]=\"language\"\r\n\t\t\t\t\t\t[showCount]=\"renderOptions?.showTotal\"\r\n\t\t\t\t\t></filter-option-text>\r\n\t\t\t\t</ng-template>\r\n\t\t\t</mat-checkbox>\r\n\t\t</div>\r\n\r\n\t\t<filter-empty-message *ngIf=\"!filteredOptions.length\" class=\"filter-checkbox__empty\"></filter-empty-message>\r\n\r\n\t\t<filter-collapse-control\r\n\t\t\tclass=\"filter-checkbox__collapse\"\r\n\t\t\t*ngIf=\"renderOptions?.collapse\"\r\n\t\t\t[minCount]=\"expandedCount\"\r\n\t\t\t[(visibleCount)]=\"visibleItemsCount\"\r\n\t\t\t[totalItems]=\"filteredOptions.length\"\r\n\t\t></filter-collapse-control>\r\n\t</ng-container>\r\n</ng-container>\r\n\r\n", styles: [".filter-checkbox{display:var(--fc-display, block)}.filter-checkbox__wrapper{display:var(--fc-wrapper-display, flex);flex-direction:var(--fc-wrapper-direction, column)}.filter-checkbox__item{margin-bottom:var(--filter-row-margin-bottom, .3rem)}.filter-checkbox__item.hidden{display:none}.filter-checkbox__item .mat-checkbox-layout{display:flex}.filter-checkbox__item .mat-checkbox-layout .mat-checkbox-label{flex-grow:1}\n"], components: [{ type: FieldHeaderComponent, selector: "field-header" }, { type: FilterOptionsSortComponent, selector: "filter-options-sort", inputs: ["options", "sort"], outputs: ["sortChange"] }, { type: FilterSearchInputComponent, selector: "filter-search-input", inputs: ["searchText"], outputs: ["searchTextChange"] }, { type: FilterAutocompleteInputComponent, selector: "filter-autocomplete-input", inputs: ["direction", "language", "fieldConfig"], outputs: ["searchChange"] }, { type: i5__namespace$1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { type: FilterOptionTextComponent, selector: "filter-option-text", inputs: ["option", "showCount", "language"] }, { type: FilterEmptyMessageComponent, selector: "filter-empty-message", inputs: ["message"] }, { type: FilterCollapseControlComponent, selector: "filter-collapse-control", inputs: ["minCount", "totalItems", "visibleCount"], outputs: ["visibleCountChange"] }], directives: [{ type: i4__namespace$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4__namespace$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i4__namespace$1.AsyncPipe, "translate": i1__namespace.TranslatePipe, "sortList": SortListPipe, "filter": FilterPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.Default, encapsulation: i0__namespace.ViewEncapsulation.None });
19338
19344
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AggregationCheckboxComponent, decorators: [{
19339
19345
  type: i0.Component,
19340
19346
  args: [{
@@ -21158,6 +21164,7 @@
21158
21164
  return field === null || field === void 0 ? void 0 : field.fieldKey;
21159
21165
  };
21160
21166
  AggregationGroupComponent.prototype.writeValue = function (value) {
21167
+ var _a;
21161
21168
  if (value) {
21162
21169
  var _values = this._getValues(value);
21163
21170
  if (___default["default"].isEqual(_values, this.internalValue)) {
@@ -21166,6 +21173,12 @@
21166
21173
  this.internalValue = _values;
21167
21174
  this.formItems.clear();
21168
21175
  this._prepareFormFields(this.internalValue);
21176
+ return;
21177
+ }
21178
+ else if (!!((_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.length)) {
21179
+ this.internalValue = [];
21180
+ this._resetFormArray();
21181
+ this._prepareFormFields(this.internalValue);
21169
21182
  }
21170
21183
  };
21171
21184
  AggregationGroupComponent.prototype.ngOnInit = function () {
@@ -21189,7 +21202,6 @@
21189
21202
  var _a;
21190
21203
  var items = ((_a = this.options) === null || _a === void 0 ? void 0 : _a.aggregations) || [];
21191
21204
  if (!!items.length) {
21192
- this.formItems.clear();
21193
21205
  items.forEach(function (item) {
21194
21206
  _this.formItems.push(new i2.FormControl(values));
21195
21207
  });
@@ -21208,6 +21220,10 @@
21208
21220
  var _a;
21209
21221
  return Array.isArray(values) ? values : ((_a = values) === null || _a === void 0 ? void 0 : _a.value) || [];
21210
21222
  };
21223
+ AggregationGroupComponent.prototype._resetFormArray = function () {
21224
+ this.formItems = new i2.FormArray([]);
21225
+ this.formGroup.setControl('items', this.formItems);
21226
+ };
21211
21227
  return AggregationGroupComponent;
21212
21228
  }(BaseCustomField));
21213
21229
  AggregationGroupComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AggregationGroupComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
@@ -47454,11 +47470,11 @@
47454
47470
  var value = ___default["default"].cloneDeep(config);
47455
47471
  this._checkConfigChange(value);
47456
47472
  this._configSubject.next(value);
47457
- if (value === null || value === void 0 ? void 0 : value.activeQuery) {
47473
+ if ((value === null || value === void 0 ? void 0 : value.activeQuery) && !!Object.keys(value === null || value === void 0 ? void 0 : value.activeQuery).length) {
47458
47474
  this._updateActiveQuery(value === null || value === void 0 ? void 0 : value.activeQuery);
47459
47475
  this._filtersCriteriaSubject.next(this._prepareMappedQuery(value === null || value === void 0 ? void 0 : value.activeQuery, this.filtersConfig.mode));
47460
47476
  }
47461
- else if (!!Object.keys(this.activeQuery).length) {
47477
+ else if (!this.activeQuery || Object.keys(this.activeQuery).length == 0) {
47462
47478
  this._resetQueryAndFiltersCriteria();
47463
47479
  }
47464
47480
  this.isPanelOpened = false;
@@ -48262,10 +48278,15 @@
48262
48278
  var themeValue = (_a = changes.theme) === null || _a === void 0 ? void 0 : _a.currentValue;
48263
48279
  var optionsValue = (_b = changes.options) === null || _b === void 0 ? void 0 : _b.currentValue;
48264
48280
  var isThemeFirstChange = (_c = changes === null || changes === void 0 ? void 0 : changes.theme) === null || _c === void 0 ? void 0 : _c.firstChange;
48281
+ var activeTheme = this._optionsSubject.getValue().theme;
48265
48282
  var mergedOptions = ___default["default"].merge(this._defaultEditorOptions, optionsValue || {}, { language: 'json' });
48266
48283
  if (themeValue && isThemeFirstChange) {
48267
48284
  mergedOptions.theme = themeValue;
48268
48285
  }
48286
+ if (!optionsValue && activeTheme && themeValue && activeTheme !== themeValue) {
48287
+ var activeOptions = this._optionsSubject.getValue();
48288
+ this._optionsSubject.next(___default["default"].merge(activeOptions, { theme: themeValue }));
48289
+ }
48269
48290
  if (optionsValue || (themeValue && isThemeFirstChange)) {
48270
48291
  this._optionsSubject.next(___default["default"].cloneDeep(mergedOptions));
48271
48292
  }