@netgrif/components-core 6.4.0 → 6.4.1-rc.1

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.
@@ -6106,7 +6106,7 @@ let AbstractCaseRefBaseFieldComponent = class AbstractCaseRefBaseFieldComponent
6106
6106
  }
6107
6107
  let providers = [
6108
6108
  {
6109
- provide: NAE_DEFAULT_HEADERS, useValue: this.dataField.component?.properties?.headers.split(',')
6109
+ provide: NAE_DEFAULT_HEADERS, useValue: this.dataField.component?.properties?.headers?.split(',')
6110
6110
  },
6111
6111
  {
6112
6112
  provide: NAE_CASE_REF_CREATE_CASE, useValue: this.dataField.component?.properties?.createCase === 'true'
@@ -14296,6 +14296,13 @@ class SearchService {
14296
14296
  this._activeFilter.next(this._baseFilter.clone());
14297
14297
  }
14298
14298
  }
14299
+ /**
14300
+ * Loads whole new filter and search cases/tasks based on this filter
14301
+ * @param newFilter whole new filter that should be used for search
14302
+ */
14303
+ updateWithFullFilter(newFilter) {
14304
+ this._activeFilter.next(newFilter);
14305
+ }
14299
14306
  /**
14300
14307
  * @returns `undefined` if the predicate tree contains no complete query.
14301
14308
  * Otherwise returns the serialized form of the completed queries in the predicate tree.
@@ -18659,6 +18666,7 @@ class CaseViewService extends AbstractSortableViewComponent {
18659
18666
  useCachedProcesses: true
18660
18667
  };
18661
18668
  this._paginationView = false;
18669
+ this._cases = [];
18662
18670
  this._newCaseConfiguration = { ...this.DEFAULT_NEW_CASE_CONFIGURATION };
18663
18671
  if (newCaseConfig !== null) {
18664
18672
  Object.assign(this._newCaseConfiguration, newCaseConfig);
@@ -18697,7 +18705,7 @@ class CaseViewService extends AbstractSortableViewComponent {
18697
18705
  }
18698
18706
  return { ...acc, ...pageLoadResult.cases };
18699
18707
  }, {}));
18700
- this._cases$ = casesMap.pipe(map(v => Object.values(v)));
18708
+ this._cases$ = casesMap.pipe(map(v => Object.values(v)), tap(cases => this._cases = cases));
18701
18709
  }
18702
18710
  ngOnDestroy() {
18703
18711
  super.ngOnDestroy();
@@ -18713,6 +18721,9 @@ class CaseViewService extends AbstractSortableViewComponent {
18713
18721
  get cases$() {
18714
18722
  return this._cases$;
18715
18723
  }
18724
+ get cases() {
18725
+ return this._cases;
18726
+ }
18716
18727
  get pagination() {
18717
18728
  return this._pagination;
18718
18729
  }
@@ -20996,7 +21007,7 @@ class AbstractTaskListPaginationComponent extends AbstractDefaultTaskListCompone
20996
21007
  this.route = route;
20997
21008
  this.pageSize = 20;
20998
21009
  this.pageIndex = 0;
20999
- this.pageSizeOptions = [10, 20, 50];
21010
+ this.pageSizeOptions = [10, 20, 50, 100];
21000
21011
  }
21001
21012
  set tasks$(tasks) {
21002
21013
  this._tasks$ = tasks.pipe((tap(() => {
@@ -25823,10 +25834,12 @@ function stopPropagation($event) {
25823
25834
  }
25824
25835
 
25825
25836
  class AbstractHeaderComponent {
25826
- constructor(_injector, _translate, _overflowService) {
25837
+ constructor(_injector, _translate, _overflowService, _caseViewService, _dataFieldPortalData) {
25827
25838
  this._injector = _injector;
25828
25839
  this._translate = _translate;
25829
25840
  this._overflowService = _overflowService;
25841
+ this._caseViewService = _caseViewService;
25842
+ this._dataFieldPortalData = _dataFieldPortalData;
25830
25843
  this.DEFAULT_COLUMN_COUNT = 6;
25831
25844
  this.DEFAULT_COLUMN_WIDTH = 220;
25832
25845
  this.INPUT_DEBOUNCE_TIME = 600;
@@ -25841,6 +25854,7 @@ class AbstractHeaderComponent {
25841
25854
  this._initHeaderCount = undefined;
25842
25855
  this._initResponsiveHeaders = undefined;
25843
25856
  this.initializeFormControls(this._overflowService !== null);
25857
+ this._changeValue = true;
25844
25858
  }
25845
25859
  set maxHeaderColumns(count) {
25846
25860
  if (this.headerService) {
@@ -25879,6 +25893,7 @@ class AbstractHeaderComponent {
25879
25893
  this.headerService.responsiveHeaders = this._initResponsiveHeaders;
25880
25894
  }
25881
25895
  this.headerService.preferenceColumnCount$.subscribe(value => this.columnCountControl.setValue(value));
25896
+ this.resolveApprovalDatafields();
25882
25897
  }
25883
25898
  ngOnDestroy() {
25884
25899
  if (this.canOverflow) {
@@ -25886,6 +25901,9 @@ class AbstractHeaderComponent {
25886
25901
  this.subColumnCountControl.unsubscribe();
25887
25902
  this.subOverflowControl.unsubscribe();
25888
25903
  }
25904
+ if (this._subCases) {
25905
+ this._subCases.unsubscribe();
25906
+ }
25889
25907
  }
25890
25908
  /**
25891
25909
  * Injects the correct {@link AbstractHeaderService} instance based on this component's type
@@ -25976,8 +25994,55 @@ class AbstractHeaderComponent {
25976
25994
  }
25977
25995
  });
25978
25996
  }
25997
+ indeterminate() {
25998
+ if (this._caseViewService) {
25999
+ return this._dataFieldPortalData?.dataField?.value?.length > 0 &&
26000
+ this._caseViewService.cases.some(value => this._dataFieldPortalData?.dataField.value.includes(value.stringId)) &&
26001
+ !this.resolveApprovalValue();
26002
+ }
26003
+ return this._dataFieldPortalData?.dataField?.value?.length > 0 &&
26004
+ this._dataFieldPortalData?.dataField?.value?.length < this._dataFieldPortalData?.dataField?.choices?.length;
26005
+ }
26006
+ typeApproval() {
26007
+ return this._dataFieldPortalData?.dataField instanceof MultichoiceField ? 'multichoice' : 'enumeration';
26008
+ }
26009
+ resolveApprovalDatafields() {
26010
+ if (this._dataFieldPortalData !== null && this._dataFieldPortalData.dataField instanceof MultichoiceField && this._caseViewService) {
26011
+ this.approvalFormControl.setValue(this.resolveApprovalValue());
26012
+ this.approvalFormControl.valueChanges.subscribe(value => {
26013
+ if (this._changeValue) {
26014
+ if (value) {
26015
+ this._dataFieldPortalData.dataField.value = this._caseViewService.cases.map(caze => caze.stringId);
26016
+ }
26017
+ else {
26018
+ this._dataFieldPortalData.dataField.value = [];
26019
+ }
26020
+ }
26021
+ this._changeValue = true;
26022
+ });
26023
+ this._dataFieldPortalData.dataField.valueChanges().subscribe(() => {
26024
+ this._changeValue = false;
26025
+ this.approvalFormControl.setValue(this.resolveApprovalValue());
26026
+ });
26027
+ this._subCases = this._caseViewService.cases$.subscribe(() => {
26028
+ this._changeValue = false;
26029
+ this.approvalFormControl.setValue(this.resolveApprovalValue());
26030
+ });
26031
+ }
26032
+ if (this._dataFieldPortalData !== null && this._dataFieldPortalData.dataField instanceof EnumerationField) {
26033
+ this.approvalFormControl.valueChanges.subscribe(value => {
26034
+ this._dataFieldPortalData.dataField.value = null;
26035
+ });
26036
+ }
26037
+ }
26038
+ resolveApprovalValue() {
26039
+ if (this._caseViewService.cases.length === 0) {
26040
+ return false;
26041
+ }
26042
+ return this._caseViewService.cases.every(value => this._dataFieldPortalData?.dataField.value.includes(value.stringId));
26043
+ }
25979
26044
  }
25980
- AbstractHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AbstractHeaderComponent, deps: [{ token: i0.Injector }, { token: i1$2.TranslateService }, { token: OverflowService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
26045
+ AbstractHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AbstractHeaderComponent, deps: [{ token: i0.Injector }, { token: i1$2.TranslateService }, { token: OverflowService, optional: true }, { token: CaseViewService, optional: true }, { token: DATA_FIELD_PORTAL_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Component });
25981
26046
  AbstractHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: AbstractHeaderComponent, selector: "ncc-abstract-header", inputs: { type: "type", hideHeaderMenu: "hideHeaderMenu", showEditButton: "showEditButton", showSortButton: "showSortButton", showSearchButton: "showSearchButton", showTableSection: "showTableSection", approval: "approval", maxHeaderColumns: "maxHeaderColumns", responsiveHeaders: "responsiveHeaders" }, ngImport: i0, template: '', isInline: true });
25982
26047
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: AbstractHeaderComponent, decorators: [{
25983
26048
  type: Component,
@@ -25987,6 +26052,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImpo
25987
26052
  }]
25988
26053
  }], ctorParameters: function () { return [{ type: i0.Injector }, { type: i1$2.TranslateService }, { type: OverflowService, decorators: [{
25989
26054
  type: Optional
26055
+ }] }, { type: CaseViewService, decorators: [{
26056
+ type: Optional
26057
+ }] }, { type: undefined, decorators: [{
26058
+ type: Optional
26059
+ }, {
26060
+ type: Inject,
26061
+ args: [DATA_FIELD_PORTAL_DATA]
25990
26062
  }] }]; }, propDecorators: { type: [{
25991
26063
  type: Input
25992
26064
  }], hideHeaderMenu: [{
@@ -29074,7 +29146,7 @@ class FilterExtractionService {
29074
29146
  }
29075
29147
  return this.extractCompleteFilterFromData(dataSection.slice(taskRefIndex.dataGroupIndex + 1));
29076
29148
  }
29077
- extractCompleteFilterFromData(dataSection, fieldId = UserFilterConstants.FILTER_FIELD_ID) {
29149
+ extractCompleteFilterFromData(dataSection, filterData, fieldId = UserFilterConstants.FILTER_FIELD_ID) {
29078
29150
  const filterIndex = getFieldIndexFromDataGroups(dataSection, fieldId);
29079
29151
  if (filterIndex === undefined) {
29080
29152
  return undefined;
@@ -29086,7 +29158,10 @@ class FilterExtractionService {
29086
29158
  catch (e) {
29087
29159
  throw new Error('Filter segment could not be extracted from filter field');
29088
29160
  }
29089
- const parentFilter = this.extractCompleteFilterFromData(dataSection.slice(filterIndex.dataGroupIndex + 1));
29161
+ if (!!filterData) {
29162
+ filterSegment = filterSegment.merge(filterData, MergeOperator.AND);
29163
+ }
29164
+ const parentFilter = this.extractCompleteFilterFromData(dataSection.slice(filterIndex.dataGroupIndex + 1), filterData);
29090
29165
  if (parentFilter !== undefined && parentFilter.type === filterSegment.type) {
29091
29166
  return filterSegment.merge(parentFilter, MergeOperator.AND);
29092
29167
  }
@@ -30763,7 +30838,7 @@ class AbstractCaseListPaginatorComponent extends AbstractDefaultCaseListComponen
30763
30838
  this.route = route;
30764
30839
  this.pageSize = 20;
30765
30840
  this.pageIndex = 0;
30766
- this.pageSizeOptions = [10, 20, 50];
30841
+ this.pageSizeOptions = [10, 20, 50, 100];
30767
30842
  this._caseViewService.nextPagePagination(this.pageSize, this.pageIndex);
30768
30843
  this._caseViewService.paginationView = true;
30769
30844
  this.cases$ = this._caseViewService.cases$.pipe(tap(() => {
@@ -33111,9 +33186,9 @@ function mapToContent(source, filter, pagination) {
33111
33186
  * @param extractionService
33112
33187
  * @param navigationItemTaskData a navigation item task containing the aggregated data representing a navigation item
33113
33188
  */
33114
- function navigationItemTaskFilterFactory(extractionService, navigationItemTaskData) {
33189
+ function navigationItemTaskFilterFactory(extractionService, navigationItemTaskData, filterData) {
33115
33190
  return {
33116
- filter: extractionService.extractCompleteFilterFromData(navigationItemTaskData)
33191
+ filter: extractionService.extractCompleteFilterFromData(navigationItemTaskData, filterData)
33117
33192
  };
33118
33193
  }
33119
33194